Download the PHP package ojohnny/wp-fallback-plugins-dir without Composer
On this page you can find all versions of the php package ojohnny/wp-fallback-plugins-dir. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ojohnny/wp-fallback-plugins-dir
More information about ojohnny/wp-fallback-plugins-dir
Files in ojohnny/wp-fallback-plugins-dir
Package wp-fallback-plugins-dir
Short Description Load all wordpress plugins in directory unless already loaded
License MIT
Informations about the package wp-fallback-plugins-dir
wp-fallback-plugins-dir
Load all WordPress plugins in a specified directory, unless they are loaded elsewhere.
Why?
Look, I'm not saying that you should bundle other plugins with your theme/plugin, but if your deployment process only handles theme deployment rather than a full WordPress deployment then you could give it a try.
- Users can't disable the bundled plugins. They can still install another version of the same plugin and load it instead, which may be useful in case of security updates after the theme is no longer being developed.
- The fallback plugins are still visible in the Admin interface. This can help future developers (including your future self) figure out what is going on.
- If a user would install some incompatible plugin, the first action can now be to bulk-deactivate all plugins. The bundled plugins are still active after this operation, so it should not break vital site functionality.
- Reduce the amount of clicking around in admin panels after deploys or when setting up a new development environments.
Installation
Using composer
:
Usage
Assuming you are using composer
and have installed composer/installers
and a couple of WordPress plugins (possibly from wpackagist), then your
functions.php
could look something like this:
If you want to use this inside a plugin, perhaps it is better to do this
inside an appropriate add_action()
, such as plugins_loaded
.