There's a plugin for Wordpress that does what I'm doing
a lot with .htaccess: Blocking unwanted requests from spammers and certain bots.
Now, some people can't use a .htaccess or don't want to mess with it. "Bad Behavior" is a plugin for Wordpress, "which prevents spambots from accessing your site by analyzing their actual HTTP requests and comparing them to profiles from known spambots. It goes far beyond User-Agent and Referer, however." (quote from the
homepage).
Since Bad Behavior isn't much more than a set of scripts, I made a quick'n'dirty integration for Geeklog. This is more of an experiment, not quite a usable solution yet (although it works). It completely ignores the option to log anything to the database for now.
- Download Bad Behavior
- Unzip it into Geeklog's public_html directory (so that you have a "bad-behavior" directory there)
- In lib-common.php, right after the require_once line that includes the config.php, add this:
Text Formatted Code
$wp_bb_logging = FALSE;
$wp_bb_verbose_logging = FALSE;
$wp_bb_logging_duration = 7;
$wp_bb_cwd = $_CONF['path_html'] . 'bad-behavior';
require_once($wp_bb_cwd . '/bad-behavior-core.php');
And that's it. Your site should still work as normal.
To try it out, you could use a browser that allows you to modify the User-Agent header, e.g. with Lynx, try
Text Formatted Code
lynx -useragent=Digger http://www.example.com/
(where example.com is the URL of your site, of course). "Digger" is the name of one of the bots that the plugin blocks.
As I said, this is an experiment. If you think this is useful, I may look into getting the logging to work. I also assume that the original author would like to hear your feedback, e.g. if it causes any problems (or proves a success).
bye, Dirk