WP Hashcash

I’ve had problems with clever spam getting past Akismet ever since I started this blog. It’s annoying to say the least, I have no idea whether it’s humans or software posting but I’ve now installed WP Hashcash by Elliott Bäck to stop the bots. It employs a different tactic than your normal captcha:

WP Hashcash is an antispam plugin that eradicates comment spam on WordPress blogs. It works because your visitors must use obfuscated javascript to submit a proof-of-work that indicates they opened your website in a web browser, not a robot.

WP Hashcash comes with 3 options for what to do when a check fails, put the message in the moderate queue, pass it on to Akismet or delete. The default is either moderate or Akismet, if you have Akismet installed. However, my problem is that the spam that gets past Akismet ends up in my moderate queue which I have enabled per default for all comments.

Checking that queue only to discover that messages are spam is annoying to say the least, therefore I wanted the delete option which according to Elliott can be turned on by enabling the widget part of the plugin, which I did. I don’t know if it’s my version of WordPress that is incompatible with Hashcash or what, but the options failed to materialize. Changing the wphc_install function in the source and reactivating the plugin should take care of that, it looks like this for me now (line 28-50):

function wphc_install () {
	// set our default options
	$options = wphc_option();
	$options['comments-spam'] = $options['comments-spam'] || 0;
	$options['comments-ham'] = $options['comments-ham'] || 0;
	$options['key'] = array();
	$options['key-date'] = 0;
	$options['refresh'] = 60 * 60 * 24 * 7;
	
	// akismet compat check
	/*
	if(function_exists('akismet_init')){
		$options['moderation'] = 'akismet';
	} else {
		$options['moderation'] = 'moderate';
	}
	*/
	$options['moderation'] = 'delete';
	wphc_option($options);
	
	// update the key
	wphc_refresh();
}

Anyway it’s gonna be interesting to see if the spam in the moderation queue disappears after this install. If that will be the case then thanks Elliott for a nice plugin!

Related Posts

Tags: , , ,