wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
90 stars 79 forks source link

Listing folders in `muplugins` #25

Open schlessera opened 7 years ago

schlessera commented 7 years ago

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.

pmbaldha commented 4 years ago

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

image

dugajean commented 4 years ago

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

I might pick this one up.

dugajean commented 4 years ago

@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!

StanvanHoorn commented 2 years ago

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.