extension-command icon indicating copy to clipboard operation
extension-command copied to clipboard

Listing folders in `muplugins`

Open schlessera opened this issue 7 years ago • 4 comments

A lot of more complex sites make use of subfolders in the muplugins folder, just like with regular plugins.

They then use something like the Bedrock Autoloader or the MULoader in WPStarter.

Although these plugins are then active like normal plugins and properly shown in the WP admin backend, WP-CLI does not display them with plugin list.

To correctly mirror WP behaviour, these should be shown as well if they are active.

schlessera avatar Jul 12 '17 15:07 schlessera

@schlessera This feature is already implemented. Please close this issue.

image

pmbaldha avatar Mar 30 '20 17:03 pmbaldha

@pmbaldha I don't think that's the case: https://d.pr/i/He4Pec

I might pick this one up.

dugajean avatar Jul 31 '20 19:07 dugajean

@schlessera It appears that WP itself doesn't list mu-plugins that are nested within other directories.

Screen Shot 2020-07-31 at 16 42 29 Screen Shot 2020-07-31 at 16 42 45

From the function that lists mu-plugin (https://developer.wordpress.org/reference/functions/get_mu_plugins/):

WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).

I can still include nested mu-plugin files, but that wouldn't be mirroring what WP itself is doing. Unless I'm understanding the ticket wrong?

Can you please clarify? Thanks!

dugajean avatar Jul 31 '20 20:07 dugajean

As per WordPress documentation: WordPress only looks for PHP files right inside the mu-plugins directory, and (unlike for normal plugins) not for files in subdirectories. You may want to create a proxy PHP loader file inside the mu-plugins directory.

So if you use a (auto)loader the mu-plugins in the subdirectory are loaded, but not listed by wp plugin list.

StanvanHoorn avatar Nov 02 '22 15:11 StanvanHoorn