zombie-flesh-eaters / mu-loader
Composer 2 plugin that generates a WordPress MU-plugin autoloader file from configured folders.
Package info
github.com/zombie-flesh-eaters/mu-loader
Type:composer-plugin
pkg:composer/zombie-flesh-eaters/mu-loader
v0.0.3
2026-02-19 15:54 UTC
Requires
- php: ^7.4 || ^8.0
- composer-plugin-api: ^2.0
This package is not auto-updated.
Last update: 2026-03-20 14:37:09 UTC
README
Composer 2 plugin for WordPress that generates a single MU-plugin loader file from one or more configured folders.
Install
composer require zombie-flesh-eaters/mu-loader
How it works
On Composer autoload dump (install, update, or dump-autoload), this package:
- Scans configured MU-plugin folders and includes:
- top-level
.phpfiles in the MU root - one entry file per plugin directory (
<slug>/<slug>.php)
- top-level
- Writes a generated loader file with
require_oncestatements.
Default output file:
wp-content/mu-plugins/000-mu-loader.php
Configuration
Set config in your project composer.json under extra.mu-loader.
{
"extra": {
"mu-loader": {
"paths": [
"wp-content/mu-plugins",
"web/app/mu-plugins"
],
"output": "wp-content/mu-plugins/000-mu-loader.php",
"exclude": [
"wp-content/mu-plugins/some-file-to-skip.php"
]
}
}
}
Options
paths(string|array, default:["wp-content/mu-plugins"])output(string, default: first existing path +/000-mu-loader.php)exclude(string|array, default:[]) absolute or relative file paths to skip
Notes
- The output file is generated; manual edits are overwritten.
- Only existing directories in
pathsare scanned.
Testing
Run the integration test:
composer run test:integration