Using Peter’s Custom Anti-Spam Image plugin with WordPress MU
Instructions for Peter’s Custom Anti-Spam Image 3.0.5 and WordPress MU 1.5.1
Note: For registration form protection in WordPress MU, see here
First of all, I fully recommend that you use the plugin with Plugin Commander, which gives you complete control over how your plugins are deployed across the blogs in your WPMU installation. For example, Plugin Commander enables you to:
- activate and de-activate plugins across all MU blogs
- set plugins to be automatically activated when new blogs are created
- empower individual blog owners to de-activate a plugin that has been automatically activated
Once you have installed Plugin Commander (extract one file to the wp-content/mu-plugins folder), simply download the anti-spam plugin and extract the custom anti-spam folder into the wp-content/plugins folder (not mu-plugins). Options are configured globally by editing custom_anti_spam.php and are the same as for the instructions for normal WordPress sites.
Activation and de-activation is handled for all blogs by the Plugin Commander or per blog.
If, for some reason, you must put the anti-spam plugin in the wp-content/mu-plugins folder, you will lose all of the advantages of the Plugin Commander plugin described above. All plugins installed to mu-plugins are automatically activated. There are several steps in order to install the anti-spam plugin to the mu-plugins folder:
- Download the anti-spam plugin. Do not upload the plugin yet. Edit the custom_anti_spam.php file in the several locations. First, remove all instances of “$wpdb->prefix . “.
Then, find this code (removing one “../”):
Change it to:
Finally, find these the pieces of code that mention the “wp-content/plugins” folder, such as these two examples (there are more instances):
if ($cas_wav) echo( '<a href="' . $cas_myurl . '/wp-content/plugins/' . end($cas_thisfolder)
echo( '<img src="' . $cas_myurl . '/wp-content/plugins/' . end($cas_thisfolder)
Change them to (removing the “plugins/” part):
if ($cas_wav) echo( '<a href="' . $cas_myurl . '/wp-content/' . end($cas_thisfolder)
echo( '<img src="' . $cas_myurl . '/wp-content/' . end($cas_thisfolder)
- Upload the plugin to the wp-content/plugins folder (NOT the mu-plugins folder), then activate it through the WPMU admin panel. This is done so that the necessary tables are created.
- Without de-activating the plugin, move the plugin files to the wp-content/mu-plugins folder, but without being contained in the custom anti-spam folder. In other words, the directory structure should be:
wp-content ----- mu-plugins --------- custom_anti_spam.php --------- fonts --------- sounds --------- translate --------- words
Options are configured globally by editing custom_anti_spam.php and are the same as for the instructions for normal WordPress sites. The plugin will automatically be active for all blogs.