Hi,
We operate several WPMU installations, as well as 20+ normal WordPress installations.
Each of these has the same set of WordPress plugins (Google XML sitemaps, cforms, etc).
We manage all of these using a SVN repository that contains all the core WP/WPMU files, as well as the standard plugins.
This makes it easy to ensure that all installations have the same files, and makes deployment of updates as simple as running and "svn up" on each installation.
When I need to update a plugin to a new version, I check the changes into our SVN repository and "svn up" all our installations.
This works fine in most cases, however some plugins need to be deactivated and reactivated during the plugin update process in order to update properly.
For example, up until recently our sites all used cforms v8.7. We wanted to update to cforms v9.3, but in order to do this, the cforms plugin must be deactivated and reactivated in order to migrate the settings to the new storage format.
We have over 100 individual WPMU blogs, and 20+ standalone WordPress installations, so going through each of these and deactivating and reactivating the cforms plugin would be very painful.
Does anyone know of an easy way to programmatically deactivating and reactivating the plugin?
I know we could use Plugin Commander to do a batch deactivate and batch activate, but not every blog needs the plugin activated.
We currently have a common PHP file that is included by every theme we use, and this file stores a COMMON_DB_VERSION constant that can be used to perform update tasks if it's value is different to the value in the wp_options table (similar to WP's db_version option). However I am not sure of the best way to automatically deactivate and then reactivate a plugin.
I tried manually running the 'activate_cforms/cforms.php hook', but this didn't seem to work either:
do_action('activate_cforms/cforms.php');
The cforms plugin is just an example of one plugin that needs this deactivation/reactivation procedure. There are many others too.
Any help would be appreciated.
James Collins