Posted by on in iDevelop | 3 comments

No, this is not a rant about someone’s Bad Behaviour, but the Bad Behavior plugin for WordPress!! 😉

I’ve just installed it & lets hope it’ll stop the bandwidth wastage to some extent, its really getting out of hand as the domain almost used 2GB of bandwidth last month, with more than half of it going to this blog only, most of which was due to referrer spam!! :curse:

I got the latest version 1.2.2 of Bad Behavior, so if you are gonna try it, I’d suggest not to follow the instructions for installation on WordPress for integrating the plugin with WP-Cache2. They are not right.


I’m sorry for the confusion, it seems that I had WP-Cache 2.0.0 while the instructions were for the WP-Cache 2.0.14
So if you are using v2.0.0 of WP-Cache, then follow these instructions else the official instructions are correct.

First, there’s some problem with the files, its got spaces at the end after the closing PHP delimiter(?>). Now that may work on some WordPress installs, but it’ll give out errors on usually all installations, so trim down the files & remove spaces from the end. Then the file “bad-behavior-whitelist.php” doesn’t have the closing PHP delimiter(?>) at the end, so add it.

Now then, if you are integrating Bad Behavior with WP-Cache2, then the official instructions(as of now) say that in “wp-content/plugins/wp-cache/wp-cache-phase1.php” file, you need to find this around line 32

  1. if (! ($meta = unserialize(@file_get_contents($meta_pathname))) )
  2.     return;

But its not there!! Instead, you should find this on line 34

  1. if (! ($meta = unserialize(@file_get_contents($cache_path . $meta_file))) ) return;

after this line you can add

  1. require_once( 'wp-content/plugins/bad-behavior/bad-behavior-generic.php');

as suggested by the official instructions!! I’ve sent an email to the Bad Behavior developer & hopefully these will be fixed. 😉