PHPackages                             ojohnny/wp-fallback-plugins-dir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ojohnny/wp-fallback-plugins-dir

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ojohnny/wp-fallback-plugins-dir
===============================

Load all wordpress plugins in directory unless already loaded

1.0.4(4y ago)05.7k↓33.3%MITPHPPHP &gt;=7.4

Since Mar 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ojohnny/wp-fallback-plugins-dir)[ Packagist](https://packagist.org/packages/ojohnny/wp-fallback-plugins-dir)[ RSS](/packages/ojohnny-wp-fallback-plugins-dir/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

wp-fallback-plugins-dir
=======================

[](#wp-fallback-plugins-dir)

Load all WordPress plugins in a specified directory, unless they are loaded elsewhere.

Why?
----

[](#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.

1. 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.
2. 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.
3. 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.
4. Reduce the amount of clicking around in admin panels after deploys or when setting up a new development environments.

Installation
------------

[](#installation)

Using `composer`:

```
$ composer require ojohnny/wp-fallback-plugins-dir
```

Usage
-----

[](#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:

```
