Arrow

Peter’s Custom Anti-Spam Version History

Back to the plugin page

Download version 3.2.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress [February 8, 2014: Minor code cleanup (thanks koc!)]

Download version 3.2.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress [October 7, 2013: Support PHP 5 static function calls, bumping WordPress requirement to 3.2+.]

Download version 3.2.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress [March 30, 2013: Add dynamic anti-spam field name. Also: standardize translation and upgrade process.]

Download version 3.1.4 of Peter’s Custom Anti-Spam Image Plugin for WordPress [August 2, 2010: Minor code tweak for WordPress 3.0.]

Download version 3.1.3 of Peter’s Custom Anti-Spam Image Plugin for WordPress [December 10, 2008: Minor tweak to the automatic JavaScript positioning to account for labels for the comment textarea (thanks Midwestern City Boy!).]

Download version 3.1.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress [December 4, 2008: The plugin will now bypass the anti-spam check if a comment is posted from within the WordPress back-end (thanks steveegg!).]

Download version 3.1.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress [November 16, 2008: Added a setting for compatibility with various WordPress caching plugins. When the setting is enabled, the anti-spam URL is dynamically pulled via JavaScript (and is thus not cached).]

Download version 3.1.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress [November 5, 2008: Implemented a user interface for modifying settings (see Settings > Custom anti-spam) so that almost all settings are now handled through the WordPress back-end interface. Modified JavaScript so that the anti-spam image attaches itself above the comment form for logged in users.]

Download version 3.0.7 of Peter’s Custom Anti-Spam Image Plugin for WordPress [August 2, 2008: Added a setting $cas_wpconfig for the absolute path to wp-config.php for WordPress 2.6+ users who have moved either wp-config.php or the wp-content folder from the default locations.]

Download version 3.0.6 of Peter’s Custom Anti-Spam Image Plugin for WordPress [May 31, 2008: Fixed the registration protection feature for WordPress 2.5. To use this feature in previous versions of WordPress, you should use version 3.0.5 of the plugin.]

Download version 3.0.5 of Peter’s Custom Anti-Spam Image Plugin for WordPress [May 24, 2008: For efficiency reasons, image and audio generation is now run directly through the plugin file.]

Download version 3.0.4 of Peter’s Custom Anti-Spam Image Plugin for WordPress [May 5, 2008: Anti-spam words can now be customized in the WordPress admin panel. Also, all translation text is now contained in a separate file (in "translate/cas_translations.php").]

Download version 3.0.3 of Peter’s Custom Anti-Spam Image Plugin for WordPress [Made the folder name of fonts and sounds customizable. The plugin is now tested to be compatible with WordPress MU (thanks Clay!). See the WordPress MU installation instructions.]

Download version 3.0.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress [Minor tweak to ensure compatibility with WordPress 2.5.]

Download version 3.0.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress [New option to disable random stretching of the wav files. Made the operation to stretch the wav files silent to the server(thanks Angelo!). Blocked indexing of audio file links by search engines (thanks Lucky!).]

Download version 3.0.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress [Added registration form protection (WordPress 2.1 and higher required for that feature) and a corresponding e-mail blacklist. For registration form protection, set $ras_reg_protection equal to "true". Also tweaked the audio file generation with wav files to be more robust against spambots (see here; thanks to Jose for pointing it out).]

Download version 2.9.8 of Peter’s Custom Anti-Spam Image Plugin for WordPress [Added support for spaces and hyphens in the anti-spam words.]

Download version 2.9.7 of Peter’s Custom Anti-Spam Image Plugin for WordPress [Minor code tweak to the image and audio generation code so that full page generation doesn't occur unnecessarily (thanks Steve!).]

Download version 2.9.6 of Peter’s Custom Anti-Spam Image Plugin for WordPress [November 11th, 2007: Made a few minor efficiency and display tweaks, and switched up the fonts.]

Download version 2.9.5 of Peter’s Custom Anti-Spam Image Plugin for WordPress [October 13th, 2007: Tweaked a database command to be more compatible, allowed a site address override (over the WordPress site URL value), and removed some redundant code.]

Download version 2.9.4 of Peter’s Custom Anti-Spam Image Plugin for WordPress [September 30th, 2007: Fixed a bug that was blocking trackbacks and pingbacks for the past few versions (a stupid oversight on my part in the order of some code).]

Download version 2.9.3 of Peter’s Custom Anti-Spam Image Plugin for WordPress [September 26th, 2007: Fixed minor CSS detail, allowed for different folder names for the plugin, and renamed mp3 class to avoid the possibility of clashes with other class names.]

Download version 2.9.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress [September 10th, 2007: Fixed a bug whereby the audio files weren't generating in all Internet Explorer setups. Fixed a bug with the "don't force registered users to enter the anti-spam word" setting. Changed table creation method so that PHP installations with low memory allocated to scripts will still be able to create the necessary tables. Also, made all display strings more easily customizable, to enhance translation support.]

Download version 2.9.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress [September 3rd, 2007: Small tweaks: diagnosis page reflects user fixes and there's more accurate error catching for when the anti-spam word doesn't exist in the database.]

Download version 2.9.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress [August 11th, 2007: New option to generate audio files for visually-impaired users. The plugin also now makes use of a database to prevent mapping of words.]

Download version 2.83 of Peter’s Custom Anti-Spam Image Plugin for WordPress [July 28th, 2007: Added easy translation support to the settings at the top of the plugin file (after all the usual settings). Also, if a visitor gets the anti-spam word wrong, he or she is presented with a text field so in order to copy the comment before going back (in case the site forces a page reload when the Back button is pressed, thus erasing all comment fields). And... there's a new font to rotate.]

Download version 2.82 of Peter’s Custom Anti-Spam Image Plugin for WordPress [July 2nd, 2007: Changed the default settings so that trackbacks and pingbacks are enabled by default and added the option to send one or both types to a moderation queue (Thanks to Donovan for feedback and MtDewVirus for unknowingly providing an example). With TTF fonts, the font size will automatically decrease if the word is slightly too tall for the image box (similar to the version 2.8 feature but for height).]

Download version 2.81 of Peter’s Custom Anti-Spam Image Plugin for WordPress (June 27th, 2007: A bug fix where the admin menu was producing a silent error. Thank you wirelessguru for pointing out the error!)

Download version 2.8 of Peter’s Custom Anti-Spam Image Plugin for WordPress (June 17th, 2007: With TTF fonts, the font size will now automatically decrease (to a certain extent) if the word is slightly too long for the image box (thanks to LaTomate for introducing the imagettfbbox function to me). Also added a diagnosis page under Manage > Custom anti-spam which should be able to diagnose the server setup to identify most common problems with the script.)

Download version 2.7 of Peter’s Custom Anti-Spam Image Plugin for WordPress (March 24th, 2007: Added a workaround for users who for some reason don’t have access to the get_option function or who have an open_basedir restriction and can’t remove it. Also, added a new font!)

Download version 2.61 of Peter’s Custom Anti-Spam Image Plugin for WordPress (February 10th, 2007: Tweaked the logged in user verification to ensure compatibility with the WP-Polls plugin. Thanks to Troy and GaMerZ)

Download version 2.6 of Peter’s Custom Anti-Spam Image Plugin for WordPress (December 7th, 2006: Added the ability for users to selectively allow either pingbacks or trackbacks or both, instead of having to either allow both or block both.)

Download version 2.5 of Peter’s Custom Anti-Spam Image Plugin for WordPress (November 17th, 2006: Changed the way comments are rejected for better compatibility with other plugins and for a slight performance increase. Also tweaked some stuff to be XHTML compliant. Thanks Ajay!)

Download version 2.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress (October 14th, 2006: Added the option to customize the image’s border color and increased the default width of the image.)

Download version 2.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress

Instructions:
2.0 release:
Unzip the entire folder custom-anti-spam to your plugins directory, so that the path is wp-content/plugins/custom-anti-spam/. Then activate the plugin via your WordPress admin section. The plugin should work directly “out of the box”, but all instructions for customization are found by editing the plugin file (in your WordPress control panel, go to Plugins > Edit Plugins). If you are upgrading from a previous release, de-activate that release first.

Here’s the pre-2.0 release instructions:

Unzip custom_anti_spam.php and jenkinsv.ttf to your wp-content/plugins directory. Then activate the plugin via your WordPress admin section. You can pick your own word list by editing the first few lines of the code. You can also use your own font by uploading a different .ttf file to your main WordPress directory and changing the piece of code that reads as follows:
imagettftext($image, 28, 5, 10, 30, $blue, “jenkinsv”, $antispam);

September 15th: Core rewrite by Will Murray (http://WillMurray.name/):

  • Added ability to use multiple, random fonts.
  • Added random text color selection.
  • Added limited ability to pick background color (white or black) for better compatibility with light or dark themes.
  • Added custom (not yet dynamic) image sizes.
  • Added the option to output PNG (clearer text, but may break older browsers — your choice)
  • Added additional input validation for improved security.
  • Improved speed and efficiency by adding conditionals and reducing redundant code.
  • Added “cas_” prefix to custom_anti_spam variables to avoid conflicts with other plugins.
  • Added self-checking of plugin location (placing the plugin inside a subfolder of wp-content/plugins is now suggested).
  • Added ability to forgo basic JavaScript positioning and insert the file yourself (Thanks to TerminalDigit)

Download version 1.3 of Peter’s Custom Anti-Spam Image Plugin for WordPress (September 8th, 2006: Tweak so that both the plugin and font files should be uploaded to the plugins directory. Also renamed the function and class name to prevent clashing with other plugins.)

Download version 1.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress (August 30, 2006: option to allow both trackbacks AND pingbacks through)

Download version 1.11 of Peter’s Custom Anti-Spam Image Plugin for WordPress (August 17, 2006: new option to allow trackbacks, based on Nio’s fix via steveegg; August 22, 2006: fixed my buggy code thanks to TerminalDigit and Marc — version 1.1 replaced)
-Note: what are trackbacks? Other bloggers might post about you and give you a “trackback”. This will usually send an automated comment to your blog to let you know that they are posting about you. The anti-spam image plugin cannot block trackback spam — sent by spammers via trackbacks to bypass the anti-spam image. If you choose to allow trackbacks, make sure you have a second line of spam filter defence as I discussed in the first paragraph of this post (or be prepared to deal with the possibility of trackback spam manually).

Download version 1.0 of Peter’s Custom Anti-Spam Image Plugin for WordPress (August 11, 2006: slight tweak in the listing of words, warranting a bump to… version 1.0!)

Download version 0.3 of Peter’s Custom Anti-Spam Image Plugin for WordPress (July 24, 2006: thanks to a great mod from Lee Jordan, allowing users who do not have the php function imagettftext to display a non-fancy-font word. He also developed a tweak to allow users the additional option of listening to an audio version of the anti-spam words (which you would record yourself) — please contact him if you are interested in implementing this into your code.)

Download version 0.2 of Peter’s Custom Anti-Spam Image Plugin for WordPress (July 5, 2006: added the option to force registered users to enter the anti-spam word as well)

Download version 0.1 of Peter’s Custom Anti-Spam Image Plugin for WordPress (June 24, 2006: first version)

Thanks to all the people who have contributed so far to this plugin (if I’ve missed anybody, please let me know!)
-TerminalDigit
-Marc
-Krazy Nio
-Lee Jordan
-Will Murray
-Ergin
-Ajay
-LaTomate
-All the other people who have websites on theblog.ca… and whose blogs I use to test this plugin without them knowing…

Arrow

244 Responses to “Peter’s Custom Anti-Spam Version History”


  1. xopher says:

    Peter – I couldn’t get it to work on my site. There’s a small box with “security image” in place of where the image should appear. And when I try to view the image elsewhere, it returns the pathname.

    I was able to get Nio’s Anti-Spam image plugin to work with no problem.

    What about the font file? Does that go in the plugins directory as well?

    I will deactivate Nio’s plugin and reactivate yours, just in-case you want to poke around.

    Thanks,

    Christopher


  2. Amy says:

    I couldn’t get it to work on my site either, with the same problem Xopher had. I would love to know how to fix it. I’ll try messing with it on my end. Thanks!


  3. Danny says:

    Had the same issue, it was caused by the ttf file not being found. Fixed it by replacing the line

    imagettftext($image, 28, 5, 10, 30, $blue, “jenkinsv”, $antispam);

    with

    imagettftext($image, 28, 5, 10, 30, $blue, ‘/your/absolute/path/to/jenkinsv.ttf’, $antispam);

    Hope this helps.


  4. Mark Fleming says:

    Hmmm…I installed it just fine. But no anti-spam word shows up. Does it not work for logged in registered users ?


  5. Peter says:

    Thanks for the comments.

    Issue 1 is about registered users. If you are logged in, you must log out before you can test the plugin. This is because by default, WordPress “trusts” registered users.

    Issue 2 is about the font file. Sorry — my instructions weren’t completely clear: you must upload the plugin file (custom_anti_spam.php) to your plugin directory and upload the font file (jenkinsv.ttf) to your main WordPress directory.


  6. Mark Fleming says:

    Thanks for the clarifications.

    It’s too bad about the registered users bit. I don’t trust registered users. With easy to get web email accounts, being registered is kind of meaningless. and, even with one valid account someone could spam through that one every 10 seconds (or whatever the duration is WP has).


  7. Peter says:

    If you want to force registered users to enter the anti-spam word, you need to comment out two sections in the plugin file as follows:

    1)

    // if (isset($user_ID)) {
    // return $post_ID;
    // }

    2)

    // If the user is not logged in check the security code
    // if ( !$user_ID ) {
    … There is a bunch of code here (don’t touch it; I only cut it here for concision)…
    } else {
    unset($matchthis);
    }
    // }


  8. Danny says:

    Removed my fix and did as you suggested Peter (issue 2), just posting to confirm for you that this works fine. Nice work!


  9. Peter says:

    Version 0.2 has been released — it includes the option to force registered users to enter the anti-spam word as well.


  10. VirusHead says:

    The plug-in works well, and I like the look of it too. My only problem is that the anti-spam word shows up after the submit comment button. How do I get it to format like this one? I don’t see anything obvious in the comments or single post pages, or in the plug-in page itself.


  11. Peter says:

    Hmmm, are you seeing this only when you’re logged in? The anti-spam word should be underneath the Website field, but if you’re logged in, it shows up below the comments field (probably something that I’ll have to work on for an updated version).


  12. Testy Tester says:

    I dig this plugin, and I’d like to get it working on my site. I’m having the same problems as others whereit is not showing the image. Your instructions say to “upload the font file (jenkinsv.ttf) to your main WordPress directory”. What is the “main WordPress directory?”


  13. Peter says:

    Hmmmm, how to describe… if you are using the default WordPress installation, then the main WordPress directory is the one that has wp-atom.php, wp-login.php, wp-register.php, and the like. If your plugin directory is /wp-content/plugins, then your main directory is where / is.

    Let me know if that doesn’t help!


  14. Peter says:

    Also, you could just enter the full path to the font file as Danny stated:

    imagettftext($image, 28, 5, 10, 30, $blue, ‘/your/absolute/path/to/jenkinsv.ttf’, $antispam);


  15. Testy Tester says:

    Thank you for your suggestions.

    I’m using WordPress 2.0.3. I tried all of the following paths, but I cannot get the plugin to work on my site.

    imagettftext($image, 28, 5, 10, 30, $blue, “jenkinsv”, $antispam);

    imagettftext($image, 28, 5, 10, 30, $blue, “jenkinsv.ttf”, $antispam);

    imagettftext($image, 28, 5, 10, 30, $blue, “/jenkinsv.ttf”, $antispam);

    imagettftext($image, 28, 5, 10, 30, $blue, “http://mydomainname.com/blog/jenkinsv.ttf”, $antispam);

    I know the path is valid, because I can get to the file from my browser via the URL (
    http://mydomainname.com/blog/jenkinsv.ttf).

    Is there anything else I should try?


  16. Peter says:

    Hi Testy Tester,

    It needs to be the path on your server, which would look something like /home/yourname/public_html/blog/jenkinsv.ttf

    If you don’t know how to find out your path, create a php file with this code:

    print $_SERVER['SCRIPT_FILENAME'];


  17. Lutz says:

    Hi Peter,

    thanks for a very nice piece of php-programming. Just installed it at my blog. Captcha-pic shows up as expected, but the formatting of my commentinput-fields looks now a little bit confused (http://www.lutzsindermann.de/blog/?p=38). Any idea how I can do some formatting to my comments.php? My blogs uses the BLIX-theme.

    regards

    Lutz


  18. Testy Tester says:

    Hi Peter,
    Thanks for your recommendations. I determined the absolute path, and it looks like some arbitrary path that I did not feel comfortable hard-coding into the plugin. I’m worried that my hosting company may change this path without my knowledge. It was something like…

    /homepages/96/c112349872/htdocs/public_html/blog/

    So, I added the following logic to dynamically determine the absolute path of the root WordPress directory.

    $secureimagefile = getcwd() . “/jenkinsv.ttf”;
    imagettftext($image, 28, 5, 10, 30, $blue, $secureimagefile, $antispam);

    Now it works! Thanks!


  19. Virushead says:

    Peter – Thanks and you are right. I didn’t realize that the layout would be different when I was logged in. Once I logged out, it looked perfect.

    On the “main directory” question:
    If it’s confusing, the best thing is just to ftp it.
    You already know how to upload to the “plugins” folder, right?
    So just navigate up one step to “wp-content”, and then one more – that’s the main directory of your installation – the folder where you have installed WordPress.


  20. Peter says:

    Here’s a tweak that you can make for the Blix theme. Edit the plugin file with the instructions below. Let me know if it works for you!

    Link


  21. Lutz says:

    @Peter

    Thanks a lot for your tweak. Works perfect for me. Will start to work on the formatting of the commentsfields. I’ve found out, that the catcha-word should only be written in lower cases. If a word starts with an upper case, an error will be displayed.

    I’m sure, there will be only remain a little spam from now on. This weak nearly 3.000 spams were killed by akismet.

    Again: Thank you very much for your help

    Lutz
    from Germany


  22. Amy says:

    Hey Peter,

    I just wanted to say thanks – I got your plugin working perfectly. The Blix tweak was especially helpful to me. You rock!

    :) Amy


  23. Anne says:

    Just want to say it worked perfectly on my site! Great plugin! I love it!


  24. Anne says:

    Just want to ask if I can add additional words to the plug in…how will i do it?


  25. Peter says:

    Yes, you can do that. First, add lines of words according to this format:

    $text[9] = “hoop”;
    $text[10] = “pinto”;
    $text[11] = “worda”;
    $text[12] = “wordb”;

    Then, find this line of code and change the 10 to the number of words you have:

    // pick a random number

    $antiselect = rand(1, 10);


  26. landon says:

    this is some of the most useful crap i’ve ever used.

    thanks.


  27. maotouying says:

    ä½ ä»¬å¤§å®¶å¥½ another chinese .. they are everywhere nowadays :-)


  28. manboo says:

    太好了---This Chinese words means: It’s wonderful!
    I’m using this plugin on my blog.


  29. lucas says:

    is it possible to use this in combination with “moderate all comments” – ie, i want the anti spam thingy you’ve cleverly made to filter out spam, but i still want to moderate all comments after that.


  30. lucas says:

    disregard the last question – i was logged into my own blog, that’s why it went thru without requiring moderation. when i logged out, it passed my comment as “not spam” but still required moderation before making it public. perfect!


  31. Permawords says:

    This didn’t work for me because my install of PHP doesn’t support the function imagettftext().


  32. Permawords says:

    On the other hand, Nio’s Anti-Spam plugin worked fine. It uses different functions to create the image. Well, I guess I’ll settle for that.


  33. Peter says:

    Sorry, Permawords. There’s really nothing I can do about that, but I’ll mention it in my post in order to save some people time. I’m glad that Nio’s Anti-Spam plugin worked for you!


  34. Lee Jordan says:

    Hi Peter,

    Thanks for the great plugin. I took your work and used it on my site but my host doesn’t support freetype, as I see some folks here having some trouble with the same thing I thought I’d drop you my mods.

    So I implemented a set of functions using imagechar() to create the image instead, but still kept your imagegettftext() stuff for hosts that suport that. Non-freetype people get a basic font and freetype people get your scripty font.

    I also thought about people who can’t see the word, maybe because they are blind or such, so I simply added a link around the image to a numbered audio file of me reading the word and the filename number of those files represents the array index.

    Anyway here’s a link to the modded source and you can see what I’ve done on my site by dropping into any post’s comment page:

    http://www.leejordan.org.uk/code/wordpress/custom_anti_spam.phps
    My email is [email protected]

    Cheers
    Lee


  35. Day Tooley says:

    Hi, Peter.

    Flawless and simple plugin. With 30+ German poker comments already today, it was time.

    We’ll see how this affects the spam volume. I have put it on a couple of WordPress 2.0 sites this morning.

    Thanks.

    Day


  36. Meredith says:

    Is there a way to determine if one’s PHP installation supports imagettftext? I suspect that’s the reason mine isn’t working, but I’m not 100% sure.


  37. Peter says:

    Here’s some code for a php file that can check the existence of any function:

    <?
    $function = “imagettftext”;
    if(function_exists($function)) {
    print “Yes, the function $function is installed.”;
    }
    else {
    print “Nope, the function $function is not installed.”;
    }
    ?>

    Upload that to your site and it’ll tell you whether imagettftext exists.

    Also, I’m working on Version 0.3 of the plugin based on Lee’s suggestions, in order to give users another option if they don’t have imagettftext installed. Stay tuned for that!


  38. Alan says:

    Peter you’re amazing. You’re gonna get rich and famous. Any day now. DEAR GOOGLE, BUY PETER’S SHIT.


  39. WaLLacE says:

    Words for image are defined (not random), so i think it’s good idea to cache its (something like this ).

    ps. simple and great, thx for plugin (:


  40. Day Tooley says:

    Update on effectiveness.

    I installed your plugin 2 days ago on a couple of my blogs. Since then, there have been zero (0) spam comments! Before, I was getting up to 30 spam posts per day.

    Thanks again.

    Day


  41. Duncan says:

    Just installed your plugin, looks like a good piece of crap, thanks mate.


  42. Starlight says:

    I can’t get this to work at all, the image doesn’t show at all or I get PHP errors. I’ve tried the various suggestions above too. I’m using the “In Business” theme by Kaushal Sheth (http://www.kaushalsheth.com/).

    Not knowing much, if anything, about PHP, I’m not sure how to run Peter’s PHP file to check whether imagettftext exists.

    PS – I’ve also tried Nio’s anti-spam image, and that doesn’t work either – no image.

    Thanks in advance for any help.


  43. Peter says:

    Hi Starlight. I temporarily installed that theme to find out what the problem was. From what I can tell, it has something to do with the code in the comments.php file from the “In Business” theme. I copied and pasted the comments.php code from the default theme to the “In Business” theme and the plugin worked. If anybody wants to investigate the exact cause of the problem, please let us know what you find!


  44. ::Wendy:: says:

    Installed on wordpress 2.04 site.
    When I navigate to the ‘moderate’ view of my administration pages I get an error showing this text.

    Parse error: parse error, unexpected T_STRING in /home/content/W/e/n/WendyHouse/html/wp-content/plugins/custom_anti_spam.php on line 80

    it looks cool when it works…. should i have turned off moderation before installing?


  45. ::Wendy:: says:

    I no longer get the above error page, but when trying a test post the anti-spam word doesn’t show with a text box to enter the word in, so no-one can comment. Darn, I’ll have to turn it of….


  46. Peter says:

    That is odd… I installed the Ocadia theme to test and upgraded to WP 2.04 but cannot duplicate your problem. Did you remember to log out to test the plugin (or edit the setting in the plugin file to force registered users to enter the word as well)?


  47. Starlight says:

    Hi Peter and many thanks for your reply.

    I tried your suggestion, and this time I get the reply box as it should be, but there’s no image, just “Security Image” in a box. If I nevertheless try to submit the reply I (naturally) get a page saying “enter anti-spam word”.

    How do I run the PHP file you suggested in your previous reply for checking whether imagettftext exists?


  48. Starlight says:

    I meant to additionally add to my post above that I uploaded to the ttf file via FTP to the correct base directory (the permissions are preset to 644). My error logs in CPanel show the following:

    [Mon Aug 7 21:46:12 2006] [error] PHP Warning: imagettftext(): Could not find/open font in /home/domain/public_html/blog/wp-content/plugins/custom_anti_spam.php on line 118

    [Mon Aug 7 21:46:12 2006] [error] PHP Warning: Division by zero in /home/domain/public_html/blog/wp-content/plugins/custom_anti_spam.php on line 117

    Does that help any further?

    Thanks again, it really is much appreciated, especially as I far prefer the idea of your anti-spam image plugin than any of the others.


  49. ::Wendy:: says:

    I uninstalled everything, re-installed everything, tried it and it worked. i’m just baffled but happy It’s wonderful :-)


  50. Drew says:

    Hey there. Thanks for the great plug-in! I’m a WP/php novice, and it worked like a charm. Even subbed in my own anti-span words. Might be worth noting here, though, that there is a limit on how long these words can be: the box is fixed and can only handle about ten characters or so. Any extra characters are lost.

    Also, the comments were helpful in themselves; you might suggest to newcomers that they read through before uploading/activating. Either that, or summarize a few of the key points in a revised entry up top?

    Anyway, thanks again.


  51. the C says:

    just a test


  52. michael brunton-spall says:

    Fantastic, works just fine now I’ve moved the font file.

    Slightly weird, if I put a long word (Independant for example) it goes of the right hand side of the image. I just changed the words to be shorter.

    Other than that everything works fine.


  53. steveegg says:

    ‘Tis a great plug-in. Some keyboard monkeys had been hopping on my blog trying to get past my existing anti-spam defenses (failing, but forcing me to dig through the spam folders just in case it also snared something legit), so I put this on. Kept them out, but unfortunately it also kept out all the trackbacks/pingbacks. I did finally figure out how to put Nio’s fix for that (in ver. 0.5 of his plugin) into this without breaking the option to force registered users to type in the word (slight edit of the function comment_post below; added code in bold):

    function comment_post($post_ID)
    {
    global $wpdb, $user_ID, $_POST, $text, $forcereg, $comment_type;

    $securitycode = strtolower($_POST['securitycode']);
    $matchthis = $text[$_POST['matchthis']];
    // If the user is not logged in check the security code
    if (!isset($user_ID) or $forcereg == 1) {
    if (!$comment_type) {
    if ( ” == $securitycode ) {
    $this->comment_rollback($post_ID); //roll back
    die( __(‘Error: please enter the anti-spam word.’) );
    }
    if ( $matchthis != $securitycode ) {
    $this->comment_rollback($post_ID); //roll back
    die( __(‘Please enter the correct anti-spam word. Press the back button and try again.’) );
    } else {
    unset($matchthis);
    }
    }
    }

    After a couple of quick tests, that seemed to do the trick for me. Thanks for the kick-ass plugin.


  54. Julia says:

    Holy comments frenzy!! I have not had these spam posts or whatever, but glad to know there is a solution!


  55. Marc Mezzacca says:

    When I set $allowtrack = 1 then I can bypass the Anti-spam word all together. I enter nothing for the anti-spam word and it posts. Is it a bug?


  56. TerminalDigit says:

    I just independently noticed the same thing as Marc and came here looking for an explanation. Setting $allowtrack = 1 allows anyone to enter anything (or nothing) in the box, and the post will go through. I believe the !$comment_type portion of the check is incorrect. I need to go digging through the WordPress codex to figure out what it should be, but I’m sleepy right now. :-p


  57. TerminalDigit says:

    Couldn’t sleep. :-p

    But on second thought, I think it’s just a problem in the conditional statement. The AND should be an OR. i.e. change this line:
    if (!$comment_type && $allowtrack == 0) {
    to this:
    if (!$comment_type || $allowtrack == 0) {

    Seems to work, although I haven’t tested a trackback yet since my site is still in development on my local machine.


  58. Marc Mezzacca says:

    Looking at it quickly, I couldn’t figure out the logic of the $allowtrack variable. Actually, it is odd how the entire If statement is structured. I removed it, changing:
    if (!$comment_type && $allowtrack == 0) {
    to
    if (!$comment_type) {

    Works now, but haven’t tested trackbacks eithier.


  59. TerminalDigit says:

    Hi Marc,

    I’m pretty sure the swith to OR is the correct thing to do. The whole point of that if block is to check if the user filled in the captcha, and if they filled it in correctly. When would we want to even bother doing these checks? It might make the most sense if you analyze the two conditions from right to left. Well if the blog owner (you) has the $allowtrack option switched off (0), then everything—trackbacks, pingbacks, and regular comments—needs to be checked. That’s what the ($allowtrack == 0) portion guarantees. We also want to do those checks, however, for all regular (non-track/pingbacks) commenters regardless of the state of the $allowtrack variable. That’s what you get from (!$comment_type). EITHER of these conditions is sufficient to trigger us to check; both need not be true (hence the switch from && to ||).

    Your fix is essentially going to work fine for you because you’ve got $allowtrack set to 1, so the ($allowtrack == 0) was always going to be false for you anyway. If in the future, however, you decide to disallow trackbacks, you’ll want to switch to the full OR statement.

    Hope that was more helpful than confusing! :-)


  60. Peter says:

    So, I finally got a good sleep last night and wake up to this bug fix! Thanks a lot guys! I’ve updated the plugin. I don’t know what I was thinking with the “and” instead of “or”…

    You’ll notice that most of the updates to this plugin are triggered by other users. So thanks to all of you!


  61. TerminalDigit says:

    Hi, it’s me again. I noticed another problem. The modification I made earlier allows trackbacks, but not pingbacks for some reason. Apparently !$comment_type catches pingbacks as well as regular comments, at least at the location where we’ve hooked in. I can’t figure out why, but I know it’s true because I tested it with another test blog I have, and also from this very useful site: http://www.redalt.com/External/pingback.php

    For now, I’ve changed the line we were previously discussing to the following: if ($_POST['matchthis'] || $allowtrack == 0) I know this is a lame hack which can be bypassed pretty easily, but it works.


  62. TerminalDigit says:

    Sorry for the double post. Just wanted to mention that I also made some other modifications to this plugin which allow for a randomly chosen angle (within a specified range) and for centering of the word within the box. You can check it out on my site (which is now up). It’s kind of a mess, but I’ll send you the code if you want.


  63. Peter says:

    New version released that gives the option to allow both trackbacks and pingbacks!


  64. Mike says:

    I have tried your anti spam, and it works with the latest wordpress 2.0.4.

    But it didn’t at first because i hade checked in “WordPress should compress articles (gzip) if browser ask for them” under Options->Reading. Unchecking that should make the plugin work for everyone that have had problems with it.


  65. how to contact you ? says:

    Do you have a e-mail ? I want to contact you because after I installed your plug-in and activated it there is no image on the frontend.

    Thank you !


  66. Michael says:

    When uploading the file to my WP plugins folder I get this error everytime I view my site in any way, shape, or form:

    Fatal error: Cannot redeclare class antispamimage in /home/.nels/kidfixit/crankedmag.com/wp-content/plugins/custom_anti_spam.php on line 41

    Any ideas? Thanks,

    M


  67. Mark says:

    I’m having the “security image” problem. I’m using plugin 1.2 with WP1.5. I modified the php file to point to the ttf file at the root level [ "/public_html/jenkinsv.ttf" ], path verified by looking at the login panel of my FTP program. I’ve tried every other qualification I can think of, but every one give me “security image.”


  68. Peter says:

    Updates on problems above:

    Michael had another plugin using the same function name (which I have now changed in the new version of the plugin)

    Mark’s ttf file wasn’t uploaded in binary.


  69. paul says:

    Great plugin! Its only flaw is not being able to control where it goes, but I can probably get around that by dissecting the plugin and just incorporating the code into the regular comments file.


  70. paul says:

    Or not. What code does control where it goes?


  71. Will Murray says:

    Paul,

    It’s the javascript code that determines where the control goes. Currently, it locates the website the user enters (‘url’) and moves the control in behind that. Presumably you acould pick any other ID and move it there (always assuming the visitor has Javascript enabled).

    The DIV for the control also has a unique ID, so if you simply want to change how it appears, you could style the DIV using CSS. It all depends on how you want to tweak it.


  72. Jordan Meeter says:

    Hey, on my blog http://jordanmeeter.com/blog/ the anti-spam box is located below the submit button… How can I make the submit button below the anti-spam box?


  73. Paulo Brito says:

    Cool plugin. It work fine.
    Thanks


  74. Javier says:

    Hey great job and thanks for it!


  75. WesAW says:

    testing it out, think i like it!


  76. James says:

    Very nice plugin. I was testing it out on my blog, and whenever I leave the anti-spam word blank, it locks up the submit button. Any reason why this is happening?

    Thanks.


  77. test says:

    gfgdf


  78. Cristian says:

    Very nice plugin! I’ve just implemented it on my weblog


  79. Martin says:

    Does this work on K2 in combo with IE6?


  80. michael says:

    This is the best looking captcha I’ve seen, but if only I could get it to work. No matter what I do, I don’t get the image. I tried modifying the font path to be empty, D:\apps\…, and D:/apps/… to no avail. Copied the fonts to my wordpress home as well.

    Any ideas? I’m using wordpress 2.


  81. michael says:

    update: it seems to work for linux but not on windows. not a problem but you might want to check it out..


  82. iwan says:

    how to install this to wp mu ?


  83. CHRIS says:

    Just a test, looks promising. My current WP Captcha has failed since upgrading WP to 2.0.x.


  84. Lysiane says:

    Howdy. Looks good.


  85. Lysiane says:

    It trusts registered users, but only users registered with that one blog they’re commenting on, right ?


  86. eric says:

    looks good I will give it a try!


  87. Ghost says:

    Hello,

    Lookie here http://madeofstorm.free.fr/myheadupsidedown/?p=49#comments

    The image displays correctly, with the word, but with no font or text transformation.
    I don’t know why, since imagettftext is available (http://madeofstorm.free.fr/funcexists.php). And I’ve tried two locations for my fonts, addressed by absolute URL. I can’t do anything for it to work with the fonts…

    Thanks.


  88. Steve Nelson says:

    Peter this is great.

    I tried a number of ‘solutions’ before coming across your one.

    Simple to implement, fantastic.

    Many Thanks

    Steve.


  89. Juanma says:

    i’ve try all the solutions but doesn’t work, i’ve GD installed but no code are generated only the text located in alt=Peter Anti-Spam!


  90. DJ melomano says:

    I’ve changed this.

    $cas_allowtrack = true;

    trackback is working but pingback doesn’t work.
    How can I use pingback with this plugin?

    I allowed all these options in [Discussion Options].

    # Attempt to notify any Weblogs linked to from the article (slows down posting.)
    # Allow link notifications from other Weblogs (pingbacks and trackbacks.)
    # Allow people to post comments on the article


  91. Sara says:

    Thank you for this!

    Is there a way to change the border around the spam word image? I would like to change the color. :)


  92. Jen says:

    Peter, this is beyond useful. Thanks so much. It works like a charm; however, when I try to substitute some of the words, I receive the following error: “You don’t have permission to access /sims2/wp-admin/plugin-editor.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.” I made sure the permissions are ‘666’ for plugin-editor.php and custom-anti-spam.php. What am I missing?


  93. Gareth says:

    I just started receiving comment spam in my blog. This is a great solution for stopping those crafty devils. Thanks.


  94. Nessi says:

    Great idea! I just installed the plugin no problem. I changed it so that it uses 2 words together instead to have more fun with the words (http://blog.crazy-ness.com)


  95. Farrell Kramer says:

    Great plugin!
    Just loaded it onto three sites and it’s working like a charm.
    Askimet was getting overwhelmed with spam and couldn’t stop it all. I think this will do the trick.
    Thanks for the fine work!


  96. Ergin says:

    Great plugin, however, it didn’t work for me. I just downloaded WordPress and installed on my server, I followed all the previous suggestions. Server has the imagettftext function, path is correct I checked it print $_SERVER[’SCRIPT_FILENAME’]; code. Fonts transfered in binary. I did everything still I got this text “Anti-Spam Image” instead of the image. And when I right click and select view image, it gives me below error.

    The image …/wp-content/plugins/custom-anti-spam/custom_anti_spam.php?antiselect=1” cannot be displayed, because it contains errors.

    I am using WordPress 2.0. For now, Nio works ok… So I will settle with it for now.

    And have a little, suggestion, in case these new robots are packed with OCR, perhaps this might be a nice work around.

    For this to work, security words need to be more than 3 characters.

    [Your Image goes here]

    [Editbox1] [one chr] [Editbox 2]

    One chr: it is character selected randomly from the security word, but it shouldn’t be first or last, something from middle. It should be also printed in different color then the rest of the characters in the security word. You can either display this as a second image using the same color as in security word or just input as html. Former might be better.

    Editbox1 : all the characters before randomly selected [one chr]. since there can be repetition for selected character, coloring becomes important to specify the separation point.

    Editbox2: all the characters after randomly selected [one chr].

    In an example:

    Security word : funny (This is what I got to post this message.)
    Randomly selecting : ‘n’ (First ‘n’, so first ‘n’ is in different color than the rest of the word.)

    What we see : [edit1] n [edit2]
    What we write: [fu] n [ny]

    I don’t know, may be this type is not better than original, since I have no idea how robots work. Showing one word and dividing it in to pieces sounds more difficult for the robot to hack, even though it might capture the text with OCR, it will not know how to divide it.

    Thanks…


  97. fruityoaty says:

    Great plugin. Easy to use. Effective.


  98. Troels says:

    Hi! Great plugin, thanks :)

    Is it possible to use characters such as æ ø å ? I have tried using fx &aring: but that doesnt help.


  99. fruityoaty says:

    Hi,

    It is definitely not 100% compatible with the excellent Ajax Comments 2.0. If the user does not enter the security word OR the entry does not match the word BEFORE clicking the submit button, the user is forced to retype the comment again (not user-friendly). I don’t know if the bug belongs to the Ajax Comments 2.0 plugin or your plugin. I’ve informed the other author via blog comment.

    Anyone know about this and has a solution?


  100. Some Vato says:

    Not sure if you’ve seen this before, I tried installing version 2.1 but I get the error below. I’ll try v. 2 but thought you should know.
    Thanks for the good work!

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
    wp-content/plugins/custom-anti-spam/custom_anti_spam.php on line 254


  101. Steve Sensenig says:

    I love your plugin, and because I am a classical musician, I enjoyed customizing my list of words to include lots of the names of classical composers!

    One question: I am also using Filosofo Comments Preview plugin, and it creates an interesting situation:

    If a user wants to preview their comment, the anti-spam word (from your plugin) shows up every time. They don’t actually need to type anything in it, because it gets verified only when the comment is actually being submitted. This causes some confusion for the users.

    Would it be possible to either suppress your plugin until they are on the preview page? Or, alternatively, would it be possible to verify their anti-spam word the first time they see it and not show them another one?

    I’m just curious. I’m not too worried about it, and may eventually find the time to hack it myself, but was just curious if you had any thoughts since you are more familiar with your own code.

    Thanks! Great plugin!

    steve :)


  102. moieu says:

    Hi,

    I installed the plugin and the picture did not show up!

    I tried writing the absolute path…

    I tried to get it via print $_SERVER[’jenkinsv.ttf’]; and print $_SERVER[’SCRIPT_jenkinsv.ttf’];

    I saw the code line only!

    Nothing worked fine and I could not get the files absolute path.

    In my domain, on windows, I have ar.moieu.ws as the absolute path and the ttf file was uploaded there. Any help?


  103. Ergin says:

    Hi Peter,

    I found my mistake. I used this $_SERVER['SCRIPT_FILENAME'] function to get absolute path to the folder and used it in initial $cas_fontpath assignment. But it is not a good practice to use it, I realized later on you had code line

    $cas_fontpath = ABSPATH . $cas_fontpath;

    to combine blog path with initially entered $cas_fontpath value. This was one of the problem. I guess I also did some mistake when I was uploading files, font files might have lost their integrity due to wrong type of ftp upload. During debugging I got a message saying font cannot be load. I uploaded fonts again, this time I set it to binary upload, and then it worked.

    During this debugging, I download my site to my computer and used my own apache server to test it. Which made me notice directory separator issues. So I modified the initial path

    $abspath = dirname(__FILE__).’/';

    with

    if (DIRECTORY_SEPARATOR==’/’){
    $abspath = dirname(__FILE__).’/';
    }
    else{
    $abspath = str_replace(‘\\’, ‘/’, dirname(__FILE__)).’/';
    }

    This converted all path info gathered by dirname(__FILE__) to linux style. Since windows works with both style, this do the trick. There is also one more place need modification for the image properly shown, find this line tagged with

    // Determine the url to this script
    $tmp1 = strpos( __FILE__, ABSPATH );
    $tmp2 = strlen( ABSPATH);

    We need to modify __FILE__ variable so that other functions works alright. Below modification will do the trick.

    $tmpfile=str_replace(‘\\’, ‘/’, __FILE__);
    $tmp1 = strpos( $tmpfile, ABSPATH );
    $tmp2 = strlen( ABSPATH);
    $cas_myurl = get_settings(‘siteurl’) . “/” . substr( $tmpfile, $tmp1 + $tmp2 );

    I hope this will, help those with windows servers. Thank you Peter for this great plugin.


  104. moieu says:

    Guess what? I was using Arabic version and I deleted it and used your latest release. It did not show the picture too :(

    Please check my site:
    http://ar.moieu.ws/?p=51#respond


  105. T.J. says:

    Does this work with AJAX Comments by Mike Smullen?


  106. lara says:

    Just letting you know that I installed this to my blog this morning and it works like a dream. Thank you very much!


  107. Michael says:

    I haven’t been able to get your plugin or nio’s plugin to work. I’m thinking there is something flawed in my system, but i’m not sure what.

    This worked when I had gentoo installed. Now with ubuntu. No worky. I’m not sure what is off to even start looking.

    I would appreciate any clues where to look. I have GD and freetype installed…

    Thanks.


  108. Robert says:

    Hi, your script installed and worked without a hitch. I didn’t see the spam word at first because I’m an administrator and hadn’t updated the plugin configuration (at least for testing), once I actually read the instructions it was great. Thank you for the great resource.


  109. Zach says:

    can u mail me the source code I need to study it


  110. John says:

    Just checking out your plugin. So far so good!
    Cheers,
    John


  111. Michael says:

    A note for Ubuntu users. I got it to work but I needed to install the php5-gd package.

    Nice plugin Peter!


  112. David says:

    Hi Peter

    Nice plugin – the only one that worked with my template!

    Easy to manipulate and configure

    Thanx


  113. tom says:

    thank’s for this plugin! it work’s fine.
    hopefully most of my comment-spam is history from now on…


  114. Angie says:

    I get about 30+ emails a day to moderate comment spam. I just installed your plugin and it’s working great! Thank you so much!


  115. Scott Bryce says:

    I have installed your plug in. It installed easily, and setup was easy. Everything works fine…. except:

    I can’t get the custom fonts to work. I have determined that the imagettftext() function is enabled on my server by running another script that uses it. Any ideas?

    OK, I know how annoying it is to get tech support questions with too little data, but right now, this is all the information I have.


  116. Scott Bryce says:

    I hard-coded this line into the script at an appropriate place:

    $cas_fontpath = ”;

    Now the random fonts work.

    But I noticed that the image is drawn twice. Both times it uses the same word, but a different font and color.


  117. Alan says:

    hey dude, ace plugin but I can’t get it to work on my theme. I dno if it’s somit that I have misssed out in my theme. It works on my dev blog, but not on my Main Blog. Any pointers welcome!


  118. Peter says:

    Thank you very much!
    I hope that the spam will stop now. I think that the possibility to make up my own words is great.
    :)


  119. Ajay D’Souza says:

    Hi Peter,

    Am using the plugin on my blog. I also have SK2 installed.

    I have noticed that some comments of mine that land up in moderation end up getting deleted, as a result, SK2 cannot find this.

    I have started facing this only after installing your plugin.

    I have moderation setup so that only new commenters land in the moderation bin.

    Any ideas?


  120. Ajay D’Souza says:

    Thanks for the mention.

    I’ve modified the get_settings to get_option as I told you in the mail.


  121. krislog says:

    hi peter, i upgraded from 2.0.1 to 2.0.5. Now the plugin doesn’t work anymore :-(

    after submitting a comment: following message appears:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1]
    SELECT post_title FROM wp_posts WHERE ID = LIMIT 1

    what could that be?


  122. fruityoaty says:

    Yeah, that’s what I got too – that exact error. People told me that commenting on my site didn’t work – I was wondering why I hadn’t been getting any new comments.


  123. fruityoaty says:

    Oh, if it helps any… I use Spam Karma 2 and Akismet 1.15. The issue (someone helped me to test it and repro it):
    1. Commenter gets that SQL error message upon submitting.
    2. Then the message shows up in my Awaiting Moderation queue.
    The name of the user shows up as “Anonymous” and strangely… the contents of the comment ARE BLANK.


  124. fruityoaty says:

    Hi Peter!

    I got your e-mail. I re-downloaded the fixed v2.5. Installed it, tested it with both admin/registered user login as well as non-registered user comment – WORKS! No problems.

    Thanks again for continuing to work on a fantastic plugin.

    Peace,
    fruityoaty


  125. Vincent says:

    I could not get it work, the image did not show up, only a “anti-spam image” with a border showed up. I don’t know what is wrong with the plugin.


  126. Eric says:

    I just installed this plugin and it’s great, I love it. Works like a charm. I really like how customizable it is, but I have some questions about further customization:

    – Is it possible to choose different colors for the text to appear in?
    – Is it possible to place the image below the field you type the word into?

    Otherwise, this thing rocks. Awesome job!


  127. Eric says:

    Oops, forgot a question- is it also possible to change the size of the type in the image? Thanks!


  128. Ajay D’Souza says:

    Hi Peter,

    Is the problem fixed?


  129. Robin says:

    Is there a way to add it to a pop-up comment box too?


  130. Axel says:

    Hallo, hier The Netherlands ;)


  131. Peter says:

    Your plugin seems to be broken at WP2.05 ????

    All comments get rejected with “duplicate comment” error….


  132. Jack says:

    I too am having issues with the duplicate comment error. After upgrading to 2.0.5, I can post a comment once, then all subsequent posts error with the “duplicate comment” message. The only thing duplicated in the messages is the IP address, I even tried commenting on different posts in the blog. Also, the one post that did go through was empty, like someone mentioned above. I have disabled the plugin for now, please advise.

    I have been loving it, keeping me spam free, so I am sure I will miss it.


  133. Jack says:

    Nevermind, I noticed that the version of 2.5 was newer than the one I had, so I installed the new one and all seems well. Thanks!


  134. Remigio says:

    I’ve able your plugin, but I can’t see in action your plugin. Why?
    See at http://www.100asa.it/wordpress.html


  135. Remigio says:

    Done!
    but nothing…
    my version: wordpress 2.0


  136. enrique vamp says:

    I’ve had no contact form spam. I think a similar approach could be used for comment spam, I’ve just not had the time to develop it.


  137. Markus says:

    can the page after succeeded posting the comment redirected to the original post article?


  138. Markus says:

    ah.. forget my first post, it seems that i have SK2 Capcha enabled :D


  139. Mike says:

    Testing- Nice work


  140. testing says:

    just checking out your plugin, my site is yet to be fully ready, but I think I will be using this.


  141. Mark says:

    Having major issues with spam on over 3000 blogs, so am checking out all the available plugins… this one looks good!


  142. Dan says:

    I’m looking for a good anti spam tool as I’m getting over run. This one looks good.


  143. David Rourke says:

    This is just what I was looking for. The others I’ve tried were complex to set up or didn’t display well.

    Thanks!


  144. Earl of Sandwich says:

    Fried Spam……….Mmmmmmmm..


  145. iyiz says:

    thanks for this plugin
    regards…


  146. pineapple says:

    Hi Peter,

    I got the plugin installed & running fine on my roommates blog, but I cannot get it working on mine.

    I get the words Anti-Spam image showing up and nothing else. I’ve tried different configurations, and such, but it just doesn’t work. I’ve even removed it completely and started from scratch with the plugin, but that doesn’t work either.

    http://k-l-a-s-s-y.com/pineapple

    also, I am using wordpress version 2.0.4


  147. Amber says:

    I’ve edited the size of the image box and trying to do the manual insert, but even with the changes in the code, such changes are not reflected on a page refresh or in another browser on another computer. Am I missing something?


  148. ras says:

    Is this working, I will find out now.


  149. FreedomSight says:

    No cookies, no JavaScript enabled. Does it still work?


  150. Testing says:

    Testing, testing


  151. Zern says:

    Works great – thanks for sharing. Definitely good crap!!!


  152. moieu says:

    Hey, the new version rocks!

    I like it so much and thanks man :)


  153. Giuseppe Leone says:

    Hi Peter,
    what do you think to define a single element into your array, like this: $cas_text[] = substr(md5(rand(0,255)),0,7); ? In this mode we’ll have a random generation code of a seven’s character lenght. So, at the end, we can semplify the script. If you’re interest to improve this plugin, you can take a look to this class http://www.phpclasses.org/browse/package/3327.html write by me that require PHP 5, but it’s easly to downgrade for PHP 4.

    Thanks,
    Giuseppe Leone


  154. Murray Nickel says:

    Awesome Peter – thanks for your great plugin.

    I tried several WP Turing plugins, and they either failed to work or, in the last case, crashed my comments section altogether with a parse error in comments.php.

    Luckily I stumbled over your site via a google search: your solution was quick and easy to instal and worked perfectly without any tweaking.

    I require folk to register before commenting, but still somehow spammers have started to get through (without registering) – I’m hoping this will deter them a while at least, and that’s where your options within the code are very useful: I turned on the option to require registered folk to enter the word.

    Like the fact that it’s a real word and not garbagge that people need to type.

    OK, enough raving, but thanks once more.


  155. stein says:

    Thanks Peter!
    Easy to implement and customize.


  156. melanie west says:

    thank you very much! it is working so far! i was desperate to find a solution, these past few weeks i have been getting tremendous spam in akismet, i needed to find another option. i hope this will work as i don’t have time moderating comments. blessings!


  157. Peter says:

    I really like your anti span plugin, it has stopped 99% of spam messages on my website : http://krapanj.com


  158. Wendy says:

    Peter, thank you so much.

    I’ve been using this plugin since August 2006.
    It’s wonderful because
    a) its fun making up your own list of spam words
    b) commenters have fun realing the spam words are personalised
    c) it has worked to stop spam comments on my blog
    d) I’m a ‘novice’, yet it was easy to install, set-up, test and use

    I haven’t ‘updated it since Aughust. I’m not 100% confident I could do it effectively or that I need to. I’ve deleted my tackback .php and turned of pings.

    If anyone want’s to give me advice on how to more effectively manage spam for my readers, I’d love to hear it. The WordPress support community is such a wonderful thing :-)


  159. devildumi says:

    Hi there! that’s a great plugin.. but i have a question.. i’m trying to put a contact page on my blog.. and i want to use this plugin for security.. against spamers :-l but i don’t know how.. the contact plugin has 4 forms and 1 submit button.. can i use something like “if(request_function_anti_spam)..” or.. i don’t know.. i’m using anti spam addon for comments and it’s realy works.. no more spam comments :)

    if anyone can help me.. post a comment please.. 10x :-s


  160. John says:

    Peter,

    First, thanks for this plugin. It was really easy to install, and most importantly, it works! I’ve been working with the the plugin to fully integrate it with my blog’s layout, and I’ve almost got it looking just the way I want it to. But there is one thing I can’t figure out. What I want to do is make the input form and the caption appear on the same line, with the form to the left of the caption, and the word box on it’s own separate line below.

    To better illustrate what I am going for, I have created an image of what my comments should look like. Also linked is the PHP code with my modifications so far. Of course, you can see the plugin as I presently have it by visiting any post on my blog. I hope you can help. Thanks in advance!

    http://wisgrove.com/documents/comments.jpg
    http://wisgrove.com/documents/php.txt


  161. Peter says:

    Here’s the reply I sent via e-mail:

    Here


  162. Kim Linnet says:

    Hi Peter. Love your work.

    But look at my site in IE, and you plugin shows up correctly before the comment text area box. Look at my site in Firefox 2, and it shows up below, and destroys the layout if there are cemments already.

    AAARGH!

    Could you mail me the exact php-code / php-call I have to write in my comments.php file to insert you plugin? I’ve tried doing it myself, using the plugin-editor, but guess im to much of a noob to get it to work.

    With hopes of help :-)

    – Kim


  163. eli says:

    nice and easy to install plugin, very nice work!


  164. Mack says:

    Peter,

    Thanks for the plug-in. It worked right out of the box with no problems. Thanks again and Happy New Year!


  165. Cherife Li says:

    Hi,Peter.
    Your plugin is pretty good,but I’ve got a problem that when I use firefox with adblock plus add-on,I can see the “Anti-spam word” section “out of the box” in my site,add in the same condition,I can see it in your site,could you please tell me what’s the problem?thx!
    Best regards!


  166. Cherife Li says:

    Sorry,I mean I can not see the “Anti-spam word” section “out of the box” in my site:)


  167. Cherife Li says:

    And,I can see it in microsoft internet explorer.


  168. Peter says:

    Don’t forget to log out to test the plugin, as by default it does not display to registered users (although you can set it to display to all users if desired).


  169. Don Lapre James says:

    Love the theme. Is it yours or did you steal, sorry borrow, it from somewhere? If so wonder how or where you got it.

    Jim
    Don Lapre James
    [email protected]
    www.donlapresite.com


  170. Peter says:

    Yeah it’s definitely stolen. I based it on this one:

    http://themes.wordpress.net/columns/2-columns/970/plain-v10/

    My tweaks are minor. I’m going to have to reference the theme in my footer!


  171. Nathan says:

    This plugin looks to be great, unfortunately, I have tried to install it on a debian system and cannot seem to get it to display the image. It just comes up as if the image is unavailabe. After reading a few of the posts here I have tried installing all necessary librarys for the imagettftext() as none were installed but haven’t yet gotten an image. If anyone has had this problem and resolved it please let me know. I’m using debian’s standard php4 and apache2.0.54. Thanks for any help
    Nathan


  172. Maggie says:

    Great tool – thanks a lot.

    I’m now using it on my site. Good look with your great, looking site.

    Big thumbs up.


  173. Brayden says:

    Just testing. Great tool. Thanks.


  174. Christian says:

    Hi Peter,
    I downloaded your plugins yesterday and tried to install it. I copied the .ttf files in the main directory and activated the plugin. But when I want to write a comment, there’s no image but only a spacer. Could you help me, please ?
    PS: Sorry for my (bad) English ;-)


  175. Lysiane says:

    Thank you for this great plugin. A breeze to install and very customizable.

    PS. But… there’s always a but… yah, I just might wish you could set it to use one single custom text/background color with HEX code instead of having to choose between two colors or 10 random colors…


  176. julien barbier says:

    Thank you peter ! You saved us (more than 100 messages per day of spam in our blog !)


  177. Spam bot of the future says:

    Maybe one day the spam bots will become like Terminators, gain artificial intelligence and force us, at the point of a laser gun, to buy viagra.

    For now, this great piece of kit will suffice, but are there any plans to incorporate perhaps some sort of missile system to thwart the spam bots of the future?


  178. Trisha says:

    I’m seeing the words ‘Anti-Spam Image’ instead of the image and when I right click and choose ‘View Image’, I get a message that says ‘ Could not determine the ABSPATH (the root of the blog).’ I can see that part in the code, right after the configuration section. How is the ABSPATH determined anyway?

    Any ideas of anything I could edit to get it to work? The problem is likely because I am using Lyceum (http://lyceum.ibiblio.org/ ) – a multi-blog system that uses WP. Most WP plug-ins are supposed to work with it, but I am having problems with this one.

    Thanks


  179. paul says:

    Test comment to see how this works.


  180. tech says:

    Thank you peter ! You saved us (more than 100 messages per day of spam in our blog !)


  181. ybae says:

    Danke Peter!

    Alles super Funktioniert!

    Mit freundlichen Grüßen,
    Ybae


  182. xsdfd says:

    umm. maybe it’s because I was logged on as the admin – lol.
    Thanks, Works great.


  183. Joe says:

    tesytin


  184. Aukcje says:

    Thanks for this very good article … Can i translate this and insert on my site in Poland? … Thanks


  185. snee says:

    Excellent work!

    Just what I was looking for and works a treat – so simple to install too, no messing about with editing files.

    Great job


  186. Meble says:

    Enjoyed browsing through the site. Keep up the good work. Greetings from Poland


  187. Lee-Roy says:

    Peter,

    Is there any way to put this below the comment field instead of above? In K2, the area above the comment field is hidden to repeat users. They have to click a link labeled “(Change)” to show these fields and it’s not entirely intuitive or convenient. Ideally, I’d like to place the anti-spam image and text field below the comment field, but still above the submit button.

    Thanks!

    Lee-Roy


  188. marker says:

    i am very happy to see this blog becaouse of i get lots imfoRmation on it. and i m very thank full to you.!!!!


  189. Tanie linie lotnicze says:

    Spammers are very smart and we have to fight , maby by captha


  190. Troy says:

    Thanks a ton peter for this great tool. Since i installed it i have had no comment spam. However I have just installed the a polling plugin and it seemed to be interfering with your plugin. I contacted the creator of that plugin and he came up with this solution. I was just a minor tweak to your code. Here is the link to the post.

    http://forums.lesterchan.net/index.php?topic=240.0

    Cheers


  191. Élodie says:

    Thanks ever so much for providing this! It’s a great resource to have for a blog!


  192. mememe says:

    just testing


  193. tonis says:

    Your plugin doesn’t work on my wordpress (2.0.5). Can you please mail my what the problem could be? Thanks.


  194. Frank Roche says:

    Peter, thanks very much. Worked right out of the box as advertised. Nice one…and I like it very much because it’s actually readable. Nice work, man. Thanks much.


  195. Cristina says:

    It’s nice. Thank you!


  196. Dennis says:

    Great plugin, thank you! Easy to install. Any possibility to add in an audio alternative? (Link to audio file that reads the letters for vision-impaired users)


  197. Peter says:

    Yes, Lee Jordan has actually implemented a sound file tweak. Read my full reply.


  198. Domain regisztráció says:

    Hi Peter,
    I found your site on another blog recommending your solution :)
    I agree that this is a good compromise between anti-spam and readability. But I am looking for a similar solution for an average website, not for a blog. Do you have such, or can you recommend such?

    Janos
    Használtautó, használt autó


  199. Onlineshop says:

    I think these blog is really useful for new comers and Excellent resource list.


  200. moonswamp says:

    Thank you peter, i have use your plugin and it works well!!
    you can test at my page
    http://www.tearsea.com/?p=542

    and also i quote your plugin on my blog,thanks!!


  201. Daniel Taghioff says:

    Hi Peter

    I like the idea of the plugin, but can’t get it to work. I am using the daydream worpress theme, whcih might be the problem. What is happening is that in stead of the “anti-spam image” I am getting a box saying “anti-spam image” (it is very Magritte.)

    Anyway, point being, how do I get the image to display with daydream?

    Or is there a different problem…?


  202. theddy says:

    Hi

    I am using your helpful plugin – thanks a lot. I made good experiences when I made some changes in the CSS and the picture has no borders and the same background as the page itself. Seems hard for scripts to decode the word in the picture.

    theddy


  203. Josh Miller says:

    So easy to use, and so functional.

    Thanks a million.


  204. Maveric says:

    Hi ur work was good. It worked great. But I have a small doubt regarding the working of CAPTCHA control. Instead of having a static CAPTCHA, can we have a CAPTCAH image that can move like a marquee at a slow rate? If not what are the possible kinds of security vulnerabilities that one could face with such a moving CAPTCAH image? Can u please mail me to the above mentioned mail-id with the reply for my doubt…..


  205. Jennifer says:

    I installed this and the input section didn’t appear in Internet Explorer.

    It could have been something I did though, don’t know..

    See ya…


  206. lb says:

    Thank you so much! I’ve not seen a single comment spam since I started using this months ago.

    One little tip: Change the default word list. I don’t know if it matters at this point, but I changed both the fonts used and the word list and as said: I’ve not had a single comment spam since I started using this excellent plugin.


  207. Retirement investment blog says:

    I noticed that people do not like captcha and may opt for not leaving their comments. Why don’t use Askimet plugin for WP?


  208. another tester says:

    so what?


  209. ritzy periwinkle says:

    thanks soo much for this!!!


  210. grizzmine says:

    Please, need a help.

    I have problem with this plugin. The text image can not see .
    i have the text “antispam image” in the place.
    Visitors can’t send message.

    Forgive my english, i talk french.


  211. grizzmine says:

    Please, need a help.

    I have problem with this plugin. The text image can not see .
    i have the text “antispam image” in the place.
    Visitors can’t send message.

    Click this link to view my antispam word security

    http://togopages.net/blog/?p=742

    Forgive my english, i talk french.


  212. Perk1z says:

    thx for nice plugin


  213. Sleepy says:

    Aha! Just leaving movable type and getting into wordpress, this is just what I was looking for – cheers.


  214. Steve says:

    This is an awesome plugin. I’ve installed it on my own blog plus another that I manage. Thank you!


  215. Christoph says:

    What a wonderful plug-in.


  216. John Roberts says:

    Excellent and VERY user-friendly plugin – should help to stem the comment spam deluge. I love the way you can customize the security words!


  217. Mark A says:

    Nice plugin, thanks


  218. Michael says:

    I’ve have this working on other WordPress blogs before, but it’s not working on my new one. I just get a black box with Anti Spam Image inside. The blogs are all on the same server. Is this version not compatible with the new version of WordPress?

    Thank you

    Michael


  219. surftradon says:

    Hi Peter,

    I have installed your plugin but I only get an “anti-spam image” only image. Searched the previous posts with no result. Am I missing something?
    Thanks


  220. Jacob Cohen says:

    Great plugin, very easy to install and configure. Thanks.


  221. Roshan says:

    Thanks a ton Peter. I was looking around for a spam blocker like yours for a few days and finally got something just like what I was looking for. I tried a few others but was not happy with the results. This works just fine and I tested it myself. Thank you, thank you.
    I was being hit by some morons with spambots that was driving me crazy. I’d come home from work, switch on my pc, login to my account and find 30 comments out of which only 1 or 2 will be by humans. Rest is all junk. And although they don’t display until I moderate it, it is still a pain in the ass to go and delete them from my manage comments section. And also since I moderate them, I also get an email informing me that I a have comments, so I have to delete them from my inbox as well.
    So thanks once a again.


  222. tanya says:

    trying to understand spam, but still haven’t gotten anywhere…I get 300 spams a day, and about 5 real emails a week. Have tried the internet, nerds, future shop, looking for a spam blocker…everyone says nortons….have it and it does bulk them, but I still have to sift through about 2000 emails a week. Is captcha available for incoming, unsolicited emails, or do you know what can help me?? Any advice would be greatly appreciated…wanted to check your captcha out, so cant comment on the site, but Im going back to check further…love your catch lines….


  223. blueyes says:

    I also cannot use this plugin now, the server recently had a PHP update, is there a way to update the PHP in the plugin itself? So it now just shows the “anti-spam image” only instead of the word. A few other plugins crashed from this PHP update as well.


  224. Q… says:

    Thanks– I have one or two clients that have been looking for an out of the box spam plugin that works. Yours seems to do the trick.

    Q…


  225. Stew says:

    “I couldn’t get the part to work where you put the code anywhere on the page that you want (which explains why it’s after the submit button in IE )”

    For me it’s the other way around. In IE the anti-spam image shows correctly after the website field. In firefox the anti-spam image and field show after the submit button, bumping all the comments to the right.


  226. Fed up with Spammers says:

    Brilliant – just what I was looking for.


  227. Scott says:

    recently my host updated our wordpress to 2.1.2 and at the same time may have upgraded to php5. Now I get a broken image with Anti Spam Image in it.
    Is there something wrong with wp 2.1.2 or php5 that would cause this or can I change something?


  228. Edgar says:

    This program works well to prevent automatic commercial smam. However, I have begun to see a new (and old) type of spam. Chain mail spam. How do you prevent people from copying the message 3 times for good luck? Do the other types of spam blocking look for signs of chain mail?


  229. LaTomate says:

    I tried to install it and had the same problem (“Anti-spam image” instead of the image itself.

    I managed to fix the problem by modifying line 142 in custom_anti_spam.php:

    // Pick a random font to use //
    $cas_font = $cas_fontpath . $cas_fontlist[ rand( 0, count( $cas_fontlist ) - 1 ) ];

    I inserted directly the adress to the path containing the fonts. If, say, my fonts were at http://my_site.com/wp-content/plugins/custom-anti-spam/ then I would replace the above line with this:

    // Pick a random font to use //
    $cas_font = “http://my_site.com/wp-content/plugins/custom-anti-spam/” . $cas_fontlist[ rand( 0, count( $cas_fontlist ) - 1 ) ];


  230. Soverato News says:

    Very good, work fine on my site. WordPress 2.1.3.
    Thank you very much for this solution.


  231. Max Christian Hansen says:

    does uppercase work? If this comment goes through, then the anti-spam word is not case-sensitive


  232. Michael says:

    Cool feature


  233. Strafverteidiger München says:

    Very cool. Thanks.


  234. Kaye says:

    ok I’ve tried using this plugin.Did everything that was supposed to be done but I could never get the image to show???? Any hints why ??
    Thanks Kaye


  235. Peter says:

    Her problem was solved by configuring this option:

    // Leave this as FALSE unless you have an open_basedir restriction on your server and can’t get it removed. In that case, enter the server path to your blog (different from the site address!) like in the example below WITH a trailing slash.
    // $cas_abspath = “/home/yourusername/public_html/blog/”;
    $cas_abspath = false;


  236. meisterblog.de says:

    Thanks a lot, this is a really useful captcha Plugin – and funny too. I had recently a comment-spam attack on my blog, and i tried several captcha-plugins, but none worked as i wished. Yours did the job.

    Maybe in a future version an page in the control panel? This would be very useful!


  237. joseph says:

    this is the best plugin I have used so far

    easy to install

    works great

    just download, unzip, upload to your plugin diretory
    and activat

    and you are good to go!!!


  238. Melissa says:

    Peter, I love your plugin, but have you been able to figure out why it does not work on WordPress MU? There have already been a few comments about MU but I don’t see any reply from you. I’m using wordpress-mu-1.2.1 — 0.34 seconds. Thanks for any input.


  239. john says:

    I’m tired of getting spambots. Thanks for sharing.


  240. Peter says:

    Solution to Melissa’s problem: she didn’t have GD Library or FreeType installed. Now all is well.

    This plugin shouldn’t have any problems with WordPress MU.


  241. Michiel says:

    Can it be that i can now download and extract the plugin. i get a winzip error.


  242. Boris says:

    Hi, after having received thousands of comment spams I finally installed this Plug-in and the spam dropped to 0 instantly.

    To make it easier for visitors to comment I erased all the different captcha words and entered only my name (“boris”). Regular visitors don’t even have to look at the picture and can just type my name in the required field. Spammers don’t actually take a look at the image.

    Just a tip…


  243. Sander Soeteman says:

    Install was a breeze, customization of words worked, hope this will bring an end to the daily and very irritating cleaning of slimy spam out of my comments.

    Thanks a lot!


  244. Peter says:

    Comments on this post are now closed. Please post any questions or comments in the forum.