PHPackages                             lkwdwrd/wp-muplugin-loader - 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. lkwdwrd/wp-muplugin-loader

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

lkwdwrd/wp-muplugin-loader
==========================

A drop-in MU Plugin loader for WordPress

1.0.5(8y ago)5847.1k29[7 issues](https://github.com/lkwdwrd/wp-muplugin-loader/issues)[2 PRs](https://github.com/lkwdwrd/wp-muplugin-loader/pulls)MITPHPCI failing

Since Oct 5Pushed 5y ago3 watchersCompare

[ Source](https://github.com/lkwdwrd/wp-muplugin-loader)[ Packagist](https://packagist.org/packages/lkwdwrd/wp-muplugin-loader)[ RSS](/packages/lkwdwrd-wp-muplugin-loader/feed)WikiDiscussions master Synced 1mo ago

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

WP Must-Use Plugin Loader
=========================

[](#wp-must-use-plugin-loader)

[![Build Status](https://camo.githubusercontent.com/d41d0865681f57e74c51123705736ae9889a0172fd5bd3f4e342744674b97bd6/68747470733a2f2f7472617669732d63692e6f72672f6c6b77647772642f77702d6d75706c7567696e2d6c6f616465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lkwdwrd/wp-muplugin-loader)

Managing plugins using the [Composer Installers](https://github.com/composer/installers) library works remarkably well. However, its handling of MU plugins leaves something to be desired.

WordPress MU (must use) Plugins are files that are placed in the `wp-content/mu-plugins/` folder. These files are loaded automatically. The problem is when a plugin is actually inside a folder. WordPress will only load .php files and doesn't drop into any directories. When the Composer Installers plugin runs, it always puts the repo into a nice contained folder. This means the Composer Installers MU plugins never actually run!

There are manual ways around this that work fine, but I want to get away from any manual steps when running the install. No extra files, just run `composer install` or `composer update` and have it work. That is what the WP Must-Use Plugin Loader does.

Usage Instructions
------------------

[](#usage-instructions)

In your project's `composer.json` file, require this package.

```
"require": {
	"composer/installers": "~1.2.0",
	"johnpbloch/wordpress": "*",
	"lkwdwrd/wp-muplugin-loader": "~1.0.0",
}
```

Make sure in the `extras` of your `composer.json` you have your mu-plugins path defined.

```
"extra": {
	"installer-paths": {
		"app/wp-content/themes/{$name}": [
			"type:wordpress-theme"
		],
		"app/wp-content/plugins/{$name}": [
			"type:wordpress-plugin"
		],
		"app/wp-content/mu-plugins/{$name}": [
			"type:wordpress-muplugin"
		]
	},
	"wordpress-install-dir": "app/wp"
}
```

And that's it.

When Composer dumps it's autoload file, a file called `mu-require.php` will be placed into your mu-plugins folder. When WordPress loads this file as an MU plugin, it will find all of the plugins in folders in your MU plugins directory and include those as well.

Forcing MU Plugins
------------------

[](#forcing-mu-plugins)

Usually when you are using MU plugins, you have some 'normal' WordPress plugins that you want to always be active. They are not always MU-Plugins, though, so it makes no sense to put the `"type": "wordpress-muplugin"` in the `composer.json` file. WP Must-Use Plugin Loader allows you to override the type from `wordpress-plugin` to `wordpress-muplugin` as needed.

To do this, define a `"force-mu"` key in `"extra"` of your `composer.json` file. This key should hold an array of slugs for plugins to force into Must-Use status.

This is compatible with [WPackagist](https://wpackagist.org/). When adding plugins from WPackagist use the plugin's normal slug, not the wp-packagist version.

```
"require": {
	"johnpbloch/wordpress": "*",
	"lkwdwrd/wp-muplugin-loader": "~1.0.0",
	"wpackagist-plugin/rest-api": "*"
},
"extra": {
	"force-mu": [
		"rest-api"
	],
	"installer-paths": {
		"app/wp-content/themes/{$name}": [
			"type:wordpress-theme"
		],
		"app/wp-content/plugins/{$name}": [
			"type:wordpress-plugin"
		],
		"app/wp-content/mu-plugins/{$name}": [
			"type:wordpress-muplugin"
		]
	},
	"wordpress-install-dir": "app/wp"
}
```

When the `rest-api` plugin is installed, instead of going in the normal plugins folder, it will be pushed over to the mu-plugins folder and loaded automatically with other Must-Use Plugins.

Forcing Unix Directory Separators
---------------------------------

[](#forcing-unix-directory-separators)

If you work on Windows but use a Linux VM to run your development server, you may need to force unix directory separators to make sure the server can find the mu loader script. If so, there's another configuration in the `extra` block you can set:

```
"extra": {
	"force-unix-separator": true
}
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 81.4% 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

Every ~140 days

Total

5

Last Release

2940d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/225ce2e052bbe805af4c26a1bae8af3a444eb493bb844dae42a310d0097ebfc9?d=identicon)[lkwdwrd](/maintainers/lkwdwrd)

---

Top Contributors

[![lkwdwrd](https://avatars.githubusercontent.com/u/1895738?v=4)](https://github.com/lkwdwrd "lkwdwrd (35 commits)")[![johnpbloch](https://avatars.githubusercontent.com/u/446833?v=4)](https://github.com/johnpbloch "johnpbloch (7 commits)")[![nlemoine](https://avatars.githubusercontent.com/u/2526939?v=4)](https://github.com/nlemoine "nlemoine (1 commits)")

---

Tags

wordpressloadermuplugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lkwdwrd-wp-muplugin-loader/health.svg)

```
[![Health](https://phpackages.com/badges/lkwdwrd-wp-muplugin-loader/health.svg)](https://phpackages.com/packages/lkwdwrd-wp-muplugin-loader)
```

###  Alternatives

[typisttech/imposter-plugin

Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.

158251.0k2](/packages/typisttech-imposter-plugin)[bueltge/must-use-loader

Load Must-Use Plugins inside subdirectories with caching. For delete the cache: if you view the Must Use plugin list in the network administration.

6115.7k2](/packages/bueltge-must-use-loader)[szepeviktor/composer-envato

Composer plugin for Envato

3715.2k1](/packages/szepeviktor-composer-envato)[balbuf/composer-wp

Manage WordPress core, plugins, and themes with composer.

173.6k](/packages/balbuf-composer-wp)

PHPackages © 2026

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