Tags: Open Source, Spam, Tech, Website, WordPress
Worst Offenders for Wordpress 2.5 - Pre-Alpha
March 13th, 2008, by Rich.

I’m in the process of rewriting the Worst Offenders plugin for the soon-to-be-released WordPress 2.5. Before I make a tested and polished version of the code globally available, I’d be interested to hear from anyone who’d like to alpha test it.
As before Worst Offenders works cooperatively with other anti-spam plugins: its primary purpose is identifying and deleting the comments that are 100% definitely spam (sent by the very worst offenders) so that any “false positives” (sent by real genuine humans) can be rescued from the spam bin!
I’ve got it working on this site already, where it’s proved faster than the previous versions - it also has a nicer user interface. There are a few minor operational features that need to be finalised, but it’s basically capable of doing what it’s supposed to.
This version has a pluggable interface, so different “litmus tests” can be applied to spam at the same time, and third parties can easily write tests without having to write a whole interface.

I’m keen to hear from people who:
- Know their way around Wordpress/PHP already.
- Can take a look at the litmus test API and comment on ways to improve it.
- Suffer from very high spam loads (hundreds or thousands per day) who’ll be able to give the existing litmus tests a bit of a workout to check if their SQL is as efficient as I hope.
Development SVN is being kindly hosted by Automattic and releases will be available here.



March 17th, 2008 at 9:02 pm
Great news .. In fact I was considering to pick this up for development .. But my being lazy (and busy) kept me from doing so .. I have few comments :
Remove it from Manage screen .. Its a hassle to click three times to goto Worst Offender screen (where you pass Manage posts page in between) on a mobile client .. It would be good if a userhook kinda link is posted in the dashboard itself just beneath the “Akismet has blocked 3 million spams” link … [update: done!]
The black list feature needs a lot of tweaking .. currently it adds up a lot of duplicates .. I’ll recommend using tables in the database for temporary sorting and filtering the ip addresses that are to be blocked … [update: done!]
You cant see the comment which is currently marked as spam in WO page .. The link which is generated for a spam comment is dead .. So its no way you can find out which comment is which .. Showing the content in tool tip would be much better ..
Thanks and good luck for one of the best plugins Ive ever used ..
March 18th, 2008 at 6:22 am
great input there Shahab, thanks.
As I see it there’s a bunch of stuff to be done before the first release candidate, the list is…
March 18th, 2008 at 9:03 pm
I’ve just checked in a basic dashboard link which cuts the number of clicks down to 2 (one click to select the worst offenders page and one click to press the delete button. I’ll have a look at adding a button to the dashboard later.
March 20th, 2008 at 1:05 pm
Bore da Rich, dw’in hoffi clep fawr! ;-)
OK - just upgraded a test version of my blog to 2.5, so I gave your WO 3.0 a quick go, and find I get a divide by zero error:
Warning: Division by zero in [..]/worst-offenders/classes/all_litmus.php on line 67
Line 67 in the version I have is:
$average = $counter / $denominator;
so it’s not handling where $denominator is 0.
Pob lwc!
Chris
March 21st, 2008 at 3:52 am
Interestingly, now I’ve migrated my main blog to 2.5-RC1 I’m not seeing the same problem, possibly because I’ve had a couple of spam comments arrive since the migration.
Still, well worth checking before a possible divide that something bad isn’t about to happen..
Diolch yn fawr!
March 21st, 2008 at 4:25 am
Just noticed that it claims “Worst Offenders has has removed 10,264% of spam automatically” - whiter than white ? :-)
March 21st, 2008 at 11:42 am
I’ve checked in an update that:
March 21st, 2008 at 1:01 pm
Do you need to bump the version number for it to notice the change ?
Or do they only update daily ?
March 21st, 2008 at 1:53 pm
No idea… perhaps I should probably start tagging the check-ins.
March 22nd, 2008 at 12:59 pm
Bore da Rich,
The current version gives me this error on the WO options screen:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘AllLitmus::rollCall’ was given in $BLOG/wp-includes/plugin.php on line 311
Two other points:
1. You need to tell people they must use MyISAM for their comments table in MySQL as you rely on FULLTEXT queries. I was using InnoDB and was getting errors about FULLTEXT not being supported on that table.
2. You need to tell people to update their indexes when they install the plugin (or do it for them), otherwise you get errors like:
[Sat Mar 22 23:53:49 2008] [warn] mod_fcgid: stderr: WordPress database error FUNCTION wp2.wordcount2 does not exist for query SELECT wordcount2(comment_content, ‘http://’) as num, group_concat(comment_id separator ‘,’) as comment_id_list FROM wp_comments where comment_approved=’spam’ group by num having num >= 10 order by num desc; made by runCachedMatchesQuery
Actually, I’m still getting that, is that because the first error stops the FUNCTION being created ?
cheers,
Chris