I am adding the wp-retina-2x plugin via composer and can successfully install this by adding it to the require hash in the composer file.
I do however want to have this instead as an mu-plugin but moving it from require into the "extra":"installer-paths":"web/app/mu-plugins/{$name}/" has no affect and the plugin is not installed. I get no errors:
Same here, thought I could append my plugins to the mu-plugins stuff. Soil works fine, the wpackagist-plugins and my CPT plugin don’t…
Guess it has to do with the missing composer-file in the regular WordPress-plugins?
Soil is a package with its type set to wordpress-plugin. Since it implements composer/installers we can override its type.
Or are all the plugin sitting in the mu-plugins-folder automatically being recognized and installed upon deployment? If so then why would I add Soil here?
Nobody? Still haven’t found a way on how to push / deploy mu-plugins properly, they are being ignored on a Trellis deploy if I just place them in the folder and I cannot add them via composer like so:
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": [
"type:wordpress-muplugin",
"roots/soil:3.7.3", // --> THIS WORKS
"wpackagist-plugin/safe-svg:1.6.1", // --> NOT WORKING
"wpackagist-plugin/otf-regenerate-thumbnails:0.3", // --> NOT WORKING
"wpackagist-plugin/media-credit:3.2.0", // --> NOT WORKING
],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
}
UPDATE
I’ve just discovered another thread with regards to this but this is from 2014 and since then the autoloader seems to have landed so I guess it is obsolete…?
As you can see, the plugins need to be referenced both in require and under installer-paths=>mu-plugins. As well as this, each one must have a preceding “type:wordpress-muplugin” in the array list
Great, thanks, helped me too! But the plugin stays under /plugins/ folder as well when running composer update (as well as creating a folder under mu-plugins/ which is correct).
What should I do to properly remove it via composer without removing folder manually? Should only be installed under mu-plugins not under both right?
Composer is only aware of the paths you tell it to install to now: it has no knowledge of a path you told it to install to in the past. You will have to manually delete the files in plugins.