WordPress.org

Ready to get started?Download WordPress

Forums

Math Comment Spam Protection
[resolved] Doesn't work with WordPress 3.0 (6 posts)

  1. Yuki_Keylin
    Member
    Posted 4 years ago #

    Since I updated WordPress to the latest Version 3.0 I wondered why all this spam is getting through again.

    A simply test commenting without being logged in shows that it doesn't matter if you answer the math question or not. The comment goes directly into the moderation or spam area.

    Somebody the same problem? Or even a solution?

    http://wordpress.org/extend/plugins/math-comment-spam-protection/

  2. optimiced
    Member
    Posted 4 years ago #

    Plugin is no longer maintained by its original author, unfortunately... You may try to replace your simple math spam protection with the Quiz plugin:

    http://wordpress.org/extend/plugins/quiz/

    -- works in a similar way and if you don't overcomplicate it, may suit you pretty well. Try it.

    I just made one simple question ("The sum of 2+1?") and one simple answer (3 or three), and that's it...

    I will see if it works well...

  3. Chip Bennett
    Theme Review Admin
    Posted 4 years ago #

    After some poking around, I found the problem with the Math Comment Spam Protection plugin. The fix is simple.

    Hope this helps!

  4. Chip Bennett
    Theme Review Admin
    Posted 4 years ago #

    Er, I suppose I should post the fix here, as well.

    Find Line 211 of math-comment-spam-protection.php:
    if ( ( !isset($user_ID) ) && ( $comment_data['comment_type'] == ” ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks
    The offending code is this:
    ( !isset($user_ID)
    Simply change the above to this:
    ( ! $user_ID )
    So that Line 211 looks like the following:
    if ( ( ! $user_ID ) && ( $comment_data['comment_type'] == ” ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks
    Voila! The Math Comment Spam Protection plugin will now work again!

  5. Chip Bennett
    Theme Review Admin
    Posted 4 years ago #

    Otto has suggested a better fix: use is_user_logged_in():

    ( ! is_user_logged_in() )

  6. Yuki_Keylin
    Member
    Posted 4 years ago #

    @optimiced: Thanks for your tip, maybe I'll try it.

    @chipbennett: I tried to change it into ( ! is_user_logged_in() ) and first thought, it worked. But after submitting the comment it transported me to a totally different post I didn't want to comment. Strange!? After some test I found out that the newer version of my theme seems to cause the trouble. I reactivated the older version and now it works again.

    Thanks although!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic