This week I needed support from one plugin developer for WooCommerce, he requested Admin access to my live site, which is something that I’m not quite comfortable doing. Instead I granted him access to my Dev site so he could do his testing and playing a bit around without causing any “damage”.
After a couple of hours I received an email saying the environment was down, that he was trying to disable all the plugins but the his. As soon as he hit the disable plugins the site went down.
There was no way to access my dashboard to activate the plugins back in order to work in the site.
One way to solve this is to enable (and this also works for disabling) plugins from the database, so:
First, an array has to be created in a single string line (below is formatted for readability):
- a: Number of active plugins.
- i: Index of each plugin starting from 0.
- s: Number of characters for the plugin.
- <plugin folder name>/<plugin>.php: Folder and plugin php file.
After building the array, the ‘active_plugins’ records needs to be updated with this value. After committing the transaction, plugins included in the array should be activated, and, in my case, I will be able to use my Dev site as usual:
For my specific problem, I retrieve the array form my live site using the following query: