Composer 2 plugin that generates a WordPress MU-plugin autoloader file from configured folders.

Maintainers

Package info

github.com/zombie-flesh-eaters/mu-loader

Type:composer-plugin

pkg:composer/zombie-flesh-eaters/mu-loader

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.3 2026-02-19 15:54 UTC

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:

  1. Scans configured MU-plugin folders and includes:
    • top-level .php files in the MU root
    • one entry file per plugin directory (<slug>/<slug>.php)
  2. Writes a generated loader file with require_once statements.

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 paths are scanned.

Testing

Run the integration test:

composer run test:integration