WordPress.org

Ready to get started?Download WordPress

Forums

Math Comment Spam Protection
How to make the math plugin 2.2 work with WP 3.0 [fix] (7 posts)

  1. optimiced
    Member
    Posted 4 years ago #

    After WordPress 3.0 was released, the Math Comment Spam Protection plugin 2.2 suddenly stopped working (the plugin worked perfectly with WP 2.9.2 and lower).

    Thanks to Frank Bültge, perhaps we have an easy fix for the problem! (I am still testing a lightly updated version of the plugin, so no promises here!).

    So, in case you are using WP 3.0 and the Math Comment Spam Protection plugin 2.2, and the plugin doesn't protect you from comment spam anymore, try the following:

    1) Open the file math-comment-spam-protection.php in the math-comment-spam-protection plugin folder.

    2) Find the following code (go to line 106):

    if ( ( !isset($user_ID) ) && ( $comment_data['comment_type'] == '' ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks

    and change it to:

    if ( ( !isset($user_ID) || (0 == $user_ID) ) && ( $comment_data['comment_type'] == '' ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks

    3) Save the file and re-upload it to your server.

    See if this helps making the plugin work again with latest WordPress!

    It works for me, for now! :-)

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

  2. optimiced
    Member
    Posted 4 years ago #

    Hmm, I wasn't checking the php file more attentively -- there are more changes in it... Not so easy to explain in just a few lines of code. :(

    Perhaps I should post a link to the updated version...

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

    Just change the line in question to the following, and the plugin will work:

    if ( ( ! $user_ID ) && ( $comment_data['comment_type'] == ” ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks

    In other words, change:

    ( !isset($user_ID)

    To this:

    ( ! $user_ID )

  4. alekseybg
    Member
    Posted 4 years ago #

    2) Find the following code (go to line 106):

    if ( ( !isset($user_ID) ) && ( $comment_data['comment_type'] == '' ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks

    and change it to:

    if ( ( !isset($user_ID) || (0 == $user_ID) ) && ( $comment_data['comment_type'] == '' ) ) { // Do not check if the user is registered & do not check trackbacks/pingbacks

    It works! Thanks :)

  5. Marcc1
    Member
    Posted 4 years ago #

    works!
    Thanks.

  6. MarkRH
    Member
    Posted 4 years ago #

    Suppose I can try this plug-in again with this fix but does it work with the new default twentyten theme?

    My problem was trying to figure out where exactly to place the code that needed to go into the comments.php file of the theme. That file looks much different than the older default. I'll give it another shot.

  7. amberfellows
    Member
    Posted 4 years ago #

    Please do post the link to the updated version, or direct me to something equivalent that is compatible with WP 3.0 without having to change php files. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic