You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to this project are documented in this file. Releases correspond to [GitHub tags](https://github.com/BeAPI/wp-mu-loader/tags).
4
+
5
+
The format is inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+
## [Unreleased]
8
+
9
+
## [1.0.4] - 2026-04-07
10
+
11
+
### Changed
12
+
13
+
- Update plugin header with BeAPI metadata ([#4](https://github.com/BeAPI/wp-mu-loader/pull/4)).
14
+
- Add `CHANGELOG.md` (release history aligned with [GitHub tags](https://github.com/BeAPI/wp-mu-loader/tags)) and link it from the README.
15
+
16
+
## [1.0.3] - 2016-08-26
17
+
18
+
### Fixed
19
+
20
+
- Do not run the loader while WordPress is installing or upgrading (`WP_INSTALLING`) ([#3](https://github.com/BeAPI/wp-mu-loader/pull/3)).
21
+
- Fix cache flushing for network admins on multisite.
22
+
- Remove case-insensitive flag from plugin discovery for more predictable matching.
23
+
24
+
### Changed
25
+
26
+
- Do not wait for MU plugins to be loaded before requiring the bootstrap file for subdirectory plugins.
27
+
- Author and package metadata updates.
28
+
29
+
### Other
30
+
31
+
- Extra loader improvements from community contributions.
32
+
33
+
## [1.0.2] - 2015-01-21
34
+
35
+
### Fixed
36
+
37
+
- Avoid error messages during installation when database tables are not yet available ([e1fcd9b](https://github.com/BeAPI/wp-mu-loader/commit/e1fcd9b); originally merged from rexblack on the upstream project).
38
+
39
+
## [1.0.1] - 2014-12-10
40
+
41
+
### Changed
42
+
43
+
- README expanded with more installation and usage information.
44
+
45
+
## [1.0] - 2014-02-06
46
+
47
+
### Added
48
+
49
+
- Initial release: load WordPress MU plugins that live in subdirectories of `wp-content/mu-plugins/`.
Builds a list of all plugins in the `wp-content/mu-plugins` folder and include them.
3
+
WordPress only executes **single PHP files** placed directly in `wp-content/mu-plugins/`. It does **not** load plugins that live in subfolders, unlike normal plugins in `wp-content/plugins/`.
4
4
5
-
Uses the internal Wordpress function `get_plugins` for better compatibility.
6
-
In theory, any plugin could be included this way.
5
+
This small must-use (MU) package bridges that gap: it discovers MU plugins that live in **subdirectories**, loads their main bootstrap file, and lists them neatly under the loader entry in **Plugins → Must-Use** in the admin.
7
6
8
-
Sadly, `get_mu_plugins` does not have any hooks.
7
+
## What it does
9
8
10
-
* Will clear cache when visiting the plugin page in /wp-admin/.
11
-
* Will also clear cache if a previously detected mu-plugin was deleted.
9
+
- Scans `mu-plugins` with WordPress’s own [`get_plugins()`](https://developer.wordpress.org/reference/functions/get_plugins/) so discovery stays aligned with core behaviour.
10
+
- Skips loose PHP files at the root of `mu-plugins` and skips the `mu-loader` folder itself, then `require_once`s each detected plugin’s bootstrap file.
11
+
- During installation (`WP_INSTALLING`), it does nothing so core install/upgrade is not disturbed.
12
+
- In the admin, each loaded subdirectory plugin appears as an indented row under the main MU loader line for easier reading.
The project was originally created and published as **`wemakecustom/wp-mu-loader`** by **[WeMakeCustom](https://github.com/wemakecustom)**. BeAPI now maintains this fork as **`beapi/wp-mu-loader`**. Thanks to WeMakeCustom for the original work.
17
+
18
+
Further background:
19
+
20
+
-[Original idea (gist)](https://gist.github.com/lavoiesl/6302907) — Sébastien Lavoie
21
+
-[Blog post explaining MU subdirectories](http://blog.lavoie.sl/2013/08/wordpress-mu-plugins-subdirectory-loader.html)
22
+
23
+
WordPress does not expose hooks on `get_mu_plugins()`, which is why a dedicated loader like this one is still useful.
16
24
17
25
## Installation
18
26
19
27
### Composer
20
28
21
-
Add this to your `composer.json`:
29
+
Require the package (maintained under the BeAPI vendor name):
30
+
22
31
```json
23
32
{
24
33
"require": {
25
-
"wemakecustom/wp-mu-loader": "*"
34
+
"beapi/wp-mu-loader": "^1.0"
26
35
}
27
36
}
28
37
```
29
38
30
-
### Manual
39
+
Then run `composer install` so the package is installed under `mu-plugins/mu-loader/` (see `composer.json``extra.installer-name` in this repo).
31
40
32
-
Extract/clone this plugin in `wp-content/mu-plugins/mu-loader/`
41
+
### Manual
33
42
34
-
### IMPORTANT
43
+
1. Clone or extract this repository into `wp-content/mu-plugins/mu-loader/`.
44
+
2.**Copy or symlink**`mu-require.php` into `wp-content/mu-plugins/` so WordPress loads the loader.
45
+
Only `mu-require.php` must sit at the root of `mu-plugins`; the rest stays in the `mu-loader` folder.
35
46
36
-
**Copy or symlink `mu-require.php`into `wp-content/mu-plugins/`**
47
+
If `mu-loader/mu-loader.php`is missing (e.g. incomplete install), an admin notice suggests running `composer install`.
37
48
38
-
## Usage
49
+
## Usage for your own MU plugin
39
50
40
-
Create a plugin with this in your `composer.json`:
51
+
If you ship a must-use plugin that should install into a folder under `mu-plugins`, use Composer’s `wordpress-muplugin` type and optionally set `extra.installer-name`:
41
52
42
53
```json
43
54
{
44
55
"name": "my-vendor/my-plugin",
45
56
"type": "wordpress-muplugin",
46
-
"keywords": ["wordpress","plugins"],
47
-
"license": "GPL-2.0",
57
+
"keywords": ["wordpress","plugins"],
58
+
"license": "GPL-2.0-or-later",
48
59
"require": {
49
-
"composer/installers": "~1.0"
60
+
"composer/installers": "^1.0 || ^2.0"
50
61
},
51
-
52
62
"extra": {
53
63
"installer-name": "my-plugin"
54
64
}
55
65
}
56
66
```
57
67
58
-
The `extra.installer-name` is optional, it is to give a custom folder name in case your plugin is actually declared as `my-vendor/wp-mu-my-plugin` like this one.
68
+
`extra.installer-name` is optional; use it when you want the directory name under `mu-plugins` to differ from the Composer package name (this repo uses `mu-loader` for `beapi/wp-mu-loader`).
59
69
60
-
`keywords` and `license` are also optional but strongly suggested.
70
+
`keywords` and `license` are optional but recommended for published packages.
61
71
62
-
## Extra notes
72
+
## Custom install paths
63
73
64
-
If like me, your wordpress installation is not at the root of your project, you may need to change the install path:
74
+
If WordPress is not at the project root, point `composer/installers`to your real `wp-content` paths, for example:
65
75
66
76
```json
67
77
{
@@ -74,3 +84,13 @@ If like me, your wordpress installation is not at the root of your project, you
74
84
}
75
85
}
76
86
```
87
+
88
+
Adjust the `htdocs/...` segments to match your layout.
89
+
90
+
## Changelog
91
+
92
+
Release notes are in [CHANGELOG.md](CHANGELOG.md). Tagged versions are listed on [GitHub](https://github.com/BeAPI/wp-mu-loader/tags).
93
+
94
+
## License
95
+
96
+
GPL-2.0-or-later (see `composer.json` and plugin header in `mu-require.php`).
* Description: Loads must-use plugins from subdirectories under mu-plugins, not only single PHP files at the root. Uses the core get_plugins() API for discovery.
0 commit comments