Stage WP Plugin Manager
If you develop in a local machine, at some point you’ll have some active plugins there that you don’t need in the servers that you’re deploying to. Sure, you can deactivate them in your local machine before deploying, or after deploying in the remote ones, but you’re gonna need them again to be acti
If you develop in a local machine, at some point you’ll have some active plugins there that you don’t need in the servers that you’re deploying to. Sure, you can deactivate them in your local machine before deploying, or after deploying in the remote ones, but you’re gonna need them again to be active if you want to perform local work in the future, specially when you update your local database from a remote one. On such kind of scenarios, the whole process of manually activating and deactivating plugins for each stage can be really frustrating, sometimes even taking a lot of your time.
Stage WP Plugin Manager is meant to solve that problem in an quick and elegant way, by doing an automatic “fake” activation of the plugins you select for each stage: every plugin you attach to a stage will be immediatly treated as an active plugin on that stage, no matter what its previous status was, or its current status on the other stages. Since the list of active plugins is just filtered instead of rewritten, you can restore the previous status of a plugin by detaching it, and go back to your original setup by deactivating Stage WP Plugin Manager.
Please read the following instructions very carefully.
Getting Started
Stage WP Plugin Manager works on some assumptions about your workflow:
- You have a constant named WP_STAGE defined in your WordPress configuration file (often wp-config.php ).
- The value of WP_STAGE is one of the supported stages. The default supported stages are local , staging and production .
- The value of WP_STAGE is different in each of your stages.
Some developers prefer to keep different configuration files for each one of their stages, or change the values of their constants based on some evaluation. For example, you could have something like this in your wp-config.php file:
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) { define( 'WP_STAGE', 'local' ); } elseif ( file_exists( dirname( __FILE__ ) . '/staging-config.php' ) ) { define( 'WP_STAGE', 'staging' ); } else { define( 'WP_STAGE', 'production' ); }
If you follow this example, note that local-config.php should not be included in your deployments to staging and production, and both local-config.php and staging-config.php should not exist in your production stage.
Attach & Detach
Once you have installed this plugin, you will notice that a new link appears under each active plugin of the list, which reads “Attach to [your-stage] stage”. By clicking that link, you are setting a plugin to be always active in the stage you’re working at, and not active on the other stages (unless you attach the plugin to the other stages too).