If you’ve read the Mozart overview, you know what problem it solves: WordPress plugins share a PHP process, two plugins using different versions of the same library causes fatal errors, and Mozart prefixes your vendor namespaces to isolate them.
Strauss was forked from Mozart to address several of its known limitations. It’s what the community generally recommends now.
What Strauss Changed
| Issue | Mozart | Strauss |
|---|---|---|
files autoloader support | Limited | Full |
Constant prefixing (define()) | Not supported | Supported |
| Function prefixing | Not supported | v0.21.0+ |
| License compliance | Questionable | Header edits + license files preserved |
| Destructive defaults | Can delete files | Non-destructive by default |
| Zero config | Requires setup | Works out of the box |
| Test coverage | Limited | Comprehensive PHPUnit tests |
Installation
Recommended: PHAR
| |
Add to .gitignore:
| |
Add to composer.json scripts:
| |
Downloads the PHAR on first run, uses the cached version after.
Or Require Directly
| |
Configuration
Strauss works with zero configuration β it infers the namespace prefix and target directory from your composer.json automatically.
To customize, add extra.strauss:
| |
| Option | Purpose |
|---|---|
target_directory | Where processed files go (default: vendor-prefixed) |
namespace_prefix | Prefix added to namespaces |
classmap_prefix | Prefix for classes without namespaces |
constant_prefix | Prefix for define() constants |
exclude_from_copy | Packages, namespaces, or file patterns to skip entirely |
exclude_from_prefix | Copy but don’t prefix (e.g. PSR interfaces) |
Running
| |
Or directly:
| |
Dry run to preview changes without writing:
| |
Constant Prefixing
Mozart doesn’t handle define(). Strauss does:
| |
Constants are global just like classes β they conflict the same way. This matters for certain packages.
files Autoloader Support
Some packages use files autoloaders (direct require instead of PSR-4). Mozart handles these inconsistently. Strauss processes them fully:
| |
Strauss copies and prefixes these files without missing anything.
Loading in Your Plugin
| |
Or have Strauss inject the autoloader into vendor/autoload.php:
| |
Then you only need require vendor/autoload.php β no separate require for vendor-prefixed/.
License Compliance
Strauss adds a note to each modified file’s header and preserves original license files. Mozart’s handling of this is questionable β open source licenses typically require retaining original attribution. Strauss deals with it properly.
Mozart Configuration Compatibility
If you’re currently using Mozart, Strauss reads extra.mozart config directly. No need to migrate immediately:
| |
Strauss recognizes and applies it automatically.
Mozart or Strauss?
New project: use Strauss.
Existing Mozart project, consider migrating if:
- Your dependencies use
filesautoloaders - You need
define()constant prefixing - License compliance matters
- You need function prefixing (v0.21.0+)
Migration cost is low β Strauss reads Mozart config, so it’s mostly updating the scripts section.
Summary
Strauss and Mozart solve the same problem: WordPress plugin dependency conflicts. The difference is in the details: more complete autoloader support, constant prefixing, proper license handling, and safer defaults.
Start new plugins with Strauss. Migrate existing Mozart setups when you hit a limitation.
