PHPackages                             wp-spaghetti/bedrock-autoloader-mu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wp-spaghetti/bedrock-autoloader-mu

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

wp-spaghetti/bedrock-autoloader-mu
==================================

Self-contained Bedrock MU-Plugin Autoloader, auto-synced daily from roots/bedrock and roots/bedrock-autoloader

v1.0.20260107(4mo ago)011MITPHPPHP &gt;=7.1CI passing

Since Jan 7Pushed 4mo agoCompare

[ Source](https://github.com/wp-spaghetti/bedrock-autoloader-mu)[ Packagist](https://packagist.org/packages/wp-spaghetti/bedrock-autoloader-mu)[ Docs](https://github.com/wp-spaghetti/bedrock-autoloader-mu)[ Fund](https://www.buymeacoffee.com/frugan)[ GitHub Sponsors](https://github.com/frugan-dev)[ RSS](/packages/wp-spaghetti-bedrock-autoloader-mu/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

[![Sync Status](https://github.com/wp-spaghetti/bedrock-autoloader-mu/actions/workflows/sync.yml/badge.svg)](https://github.com/wp-spaghetti/bedrock-autoloader-mu/actions)[![Latest Stable Version](https://camo.githubusercontent.com/e19d8b9435bd0866acc364e3d9f5851ad768365156ba668303112f1db275acf9/68747470733a2f2f706f7365722e707567782e6f72672f77702d7370616768657474692f626564726f636b2d6175746f6c6f616465722d6d752f762f737461626c65)](https://packagist.org/packages/wp-spaghetti/bedrock-autoloader-mu)[![Total Downloads](https://camo.githubusercontent.com/b1557fcfad3bb15d27a790d75459dbed1ff6f9b08818d26a215ff7035d9115e3/68747470733a2f2f706f7365722e707567782e6f72672f77702d7370616768657474692f626564726f636b2d6175746f6c6f616465722d6d752f646f776e6c6f616473)](https://packagist.org/packages/wp-spaghetti/bedrock-autoloader-mu)[![License](https://camo.githubusercontent.com/c1db7857d8821a982c77357abc0d664b708c02163f31f1936a46804cf35a7baf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f626564726f636b2d6175746f6c6f616465722d6d75)](https://camo.githubusercontent.com/c1db7857d8821a982c77357abc0d664b708c02163f31f1936a46804cf35a7baf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f626564726f636b2d6175746f6c6f616465722d6d75)

Bedrock MU-Plugin Autoloader
============================

[](#bedrock-mu-plugin-autoloader)

Self-contained Bedrock autoloader for must-use plugins. This package is automatically synchronized daily from [roots/bedrock](https://github.com/roots/bedrock) and [roots/bedrock-autoloader](https://github.com/roots/bedrock-autoloader).

Why this package?
-----------------

[](#why-this-package)

The original [roots/bedrock-autoloader](https://github.com/roots/bedrock-autoloader) requires the library to be loaded before the mu-plugin wrapper executes. This creates a chicken-and-egg problem in standard WordPress environments where mu-plugins load before regular plugins.

This package solves that by:

- Combining the Autoloader class and wrapper into a single self-contained file
- Auto-syncing daily from upstream sources
- Installing directly in `mu-plugins` root (not a subdirectory)
- Working out-of-the-box with WordPress `mu-plugins` directory
- Requiring no external dependencies at runtime

Installation
------------

[](#installation)

### Method 1: Via Composer with Auto-Copy Helper (Recommended)

[](#method-1-via-composer-with-auto-copy-helper-recommended)

Install the package:

```
composer require wp-spaghetti/bedrock-autoloader-mu
```

Add this to your **project root** `composer.json`:

```
{
    "require": {
        "wp-spaghetti/bedrock-autoloader-mu": "^1.0"
    },
    "scripts": {
        "post-install-cmd": [
            "@copy-bedrock-autoloader-mu"
        ],
        "post-update-cmd": [
            "@copy-bedrock-autoloader-mu"
        ],
        "copy-bedrock-autoloader-mu": [
            "WpSpaghetti\\BedrockAutoloader\\CopyHelper::copy"
        ]
    },
    "extra": {
        "installer-paths": {
            "wp-content/mu-plugins/{$name}/": [
                "type:wordpress-muplugin"
            ]
        }
    }
}
```

The helper class will automatically copy `bedrock-autoloader.php` to `mu-plugins/` root on install and update.

### Method 2: Via Composer with Direct Download

[](#method-2-via-composer-with-direct-download)

Install the package to manage versions via Composer, then download the file directly:

Add this to your **project root** `composer.json`:

```
{
    "require": {
        "wp-spaghetti/bedrock-autoloader-mu": "^1.0"
    },
    "scripts": {
        "post-install-cmd": [
            "@copy-bedrock-autoloader-mu"
        ],
        "post-update-cmd": [
            "@copy-bedrock-autoloader-mu"
        ],
        "copy-bedrock-autoloader-mu": [
            "curl -sS https://raw.githubusercontent.com/wp-spaghetti/bedrock-autoloader-mu/main/dist/bedrock-autoloader.php -o wp-content/mu-plugins/bedrock-autoloader.php"
        ]
    },
    "extra": {
        "installer-paths": {
            "wp-content/mu-plugins/{$name}/": [
                "type:wordpress-muplugin"
            ]
        }
    }
}
```

> **Note:** Adjust the path `wp-content/mu-plugins/bedrock-autoloader.php` according to your project structure.

Usage
-----

[](#usage)

Once installed, the autoloader will automatically load all subdirectories in `wp-content/mu-plugins/` as plugins.

Example structure after installation:

```
wp-content/
└── mu-plugins/
    ├── bedrock-autoloader.php (← main autoloader file, copied from dist/)
    ├── bedrock-autoloader-mu/
    │   ├── dist/
    │   │   └── bedrock-autoloader.php (← source template)
    │   ├── src/
    │   │   └── CopyHelper.php (← helper class)
    │   └── composer.json
    └── your-mu-plugin/
        └── your-mu-plugin.php (← auto-loaded)

```

How It Works
------------

[](#how-it-works)

1. Composer installs the package in `mu-plugins/bedrock-autoloader-mu/`
2. Your post-install script copies `dist/bedrock-autoloader.php` to `mu-plugins/` root
3. WordPress loads `mu-plugins/bedrock-autoloader.php` directly
4. The autoloader loads all other mu-plugin subdirectories

Auto-Sync
---------

[](#auto-sync)

This repository automatically syncs the following files every day at 2 AM UTC:

- [Autoloader.php](https://github.com/roots/bedrock-autoloader/blob/master/src/Autoloader.php) - The autoloader class
- [bedrock-autoloader.php](https://github.com/roots/bedrock/blob/master/web/app/mu-plugins/bedrock-autoloader.php) - The wrapper file

The combined file is generated and saved in the `dist/` directory to prevent it from being autoloaded by itself.

When changes are detected, a new version tag is automatically created with format `v1.0.YYYYMMDD`.

Troubleshooting
---------------

[](#troubleshooting)

### File not copied to mu-plugins root

[](#file-not-copied-to-mu-plugins-root)

Make sure:

1. You've added the scripts to your **project root** `composer.json` (not the package's composer.json)
2. Your `installer-paths` correctly points to your mu-plugins directory
3. The helper class can write to the mu-plugins directory (check permissions)

### Different project structure

[](#different-project-structure)

If your project has a custom structure, adjust the paths in your scripts. The helper class copies the file relative to the vendor directory, so you may need to use a custom shell script instead:

```
"copy-bedrock-autoloader-mu": [
    "cp -f custom/path/to/vendor/wp-spaghetti/bedrock-autoloader-mu/dist/bedrock-autoloader.php custom/path/to/mu-plugins/"
]
```

Contributing
------------

[](#contributing)

For your contributions please use:

- [Conventional Commits](https://www.conventionalcommits.org)
- [Pull request workflow](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)

See [CONTRIBUTING](.github/CONTRIBUTING.md) for detailed guidelines.

Sponsor
-------

[](#sponsor)

[![Buy Me A Coffee](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://buymeacoff.ee/frugan)

Credits
-------

[](#credits)

Based on the original work by [Roots](https://roots.io/):

- [roots/bedrock](https://github.com/roots/bedrock)
- [roots/bedrock-autoloader](https://github.com/roots/bedrock-autoloader)

License
-------

[](#license)

MIT License - See [LICENSE](LICENSE.md) file for details.

Original code © Roots
Self-contained package © Frugan

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 73.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d63132b36d930fc7ea4bc04b54843b6d17ffb0354514ec3eb8a949df882fd5e9?d=identicon)[frugan](/maintainers/frugan)

---

Top Contributors

[![frugan-dev](https://avatars.githubusercontent.com/u/7957714?v=4)](https://github.com/frugan-dev "frugan-dev (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

autoloaderbedrockwordpresswordpress-mupluginwordpress-pluginwordpressautoloaderbedrockmust-usemu-plugins

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/wp-spaghetti-bedrock-autoloader-mu/health.svg)

```
[![Health](https://phpackages.com/badges/wp-spaghetti-bedrock-autoloader-mu/health.svg)](https://phpackages.com/packages/wp-spaghetti-bedrock-autoloader-mu)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[roots/bedrock-autoloader

An autoloader that enables standard plugins to be required just like must-use plugins

405.6M51](/packages/roots-bedrock-autoloader)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

525.5M69](/packages/automattic-jetpack-autoloader)[log1x/plugin-meta

A simple meta package for my commonly used WordPress plugins

164.3k](/packages/log1x-plugin-meta)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
