Results 1 to 8 of 8

Thread: Fixing Math Comment Spam Protection Plugin in WordPress 3.0

  1. #1
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,992

    Default Fixing Math Comment Spam Protection Plugin in WordPress 3.0

    Several people have noticed that the Math Comment Spam Protection plugin stopped working in WordPress 3.0.

    I poked around a bit, and found the problem. The fix is simple:

    Find Line 211 of math-comment-spam-protection.php:
    PHP Code:
    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:
    PHP Code:
    ( !isset($user_ID
    Simply change the above to this:
    PHP Code:
    ( ! $user_ID 
    So that Line 211 looks like the following:
    PHP Code:
    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!

    (Cross-posting this, to make sure the fix is readily available. It seems that the plugin developer is no longer supporting the plugin, though I'm going to try to contact him to see if he'll patch the original with the above fix. I really don't want to fork (and support) the plugin for something so simple.)
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  2. #2
    Otto's Avatar
    Otto is offline On The Rocks
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    862

    Default

    Using the is_user_logged_in() function there would probably be more appropriate. Checking for the $user_ID global is not particularly forwards compatible.

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

  3. #3
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,992

    Default

    Thanks, Otto!

    Updated accordingly.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  4. #4
    masonjames is offline Hello World
    Join Date
    Dec 2009
    Posts
    6

    Default

    Hey Chip,
    Any luck contacting the developer? I think this plugin deserves to have this update.

  5. #5
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,992

    Default

    Quote Originally Posted by masonjames View Post
    Hey Chip,
    Any luck contacting the developer? I think this plugin deserves to have this update.
    No, not yet. But thanks for the reminder for me to try again!
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  6. #6
    Otto's Avatar
    Otto is offline On The Rocks
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    862

    Default

    Quote Originally Posted by chipbennett View Post
    I really don't want to fork (and support) the plugin for something so simple.)
    I can add you as a contributor to the plugin and let you make the changes to it directly, instead of having to fork to a new plugin.

    Ran this thought by Matt, and his opinion is that if you've tried to contact the author and gotten no response within a week, then it's probably okay to allow this sort of thing.

    Maybe you disagree. Dunno. Might be worth polling the community, get an idea of the proper way to handle defunct plugins with easy fixes like this.

  7. #7
    masonjames is offline Hello World
    Join Date
    Dec 2009
    Posts
    6

    Default

    Otto,

    I think this is a good idea. Give the original developer time to respond, but if nothing happens this keeps progress/innovation happening and that benefits the community overall. Some kind of poll/consensus would probably be good. It's nice to feel like you're getting to provide input, ya know?

  8. #8
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,992

    Default

    Quote Originally Posted by Otto View Post
    I can add you as a contributor to the plugin and let you make the changes to it directly, instead of having to fork to a new plugin.

    Ran this thought by Matt, and his opinion is that if you've tried to contact the author and gotten no response within a week, then it's probably okay to allow this sort of thing.

    Maybe you disagree. Dunno. Might be worth polling the community, get an idea of the proper way to handle defunct plugins with easy fixes like this.
    I honestly don't remember what effort I put into contacting him. Let me try again, and I'll be more conscientious about it. After that, I'll be happy to add the fix directly.

    I'm just not sure about maintaining another plugin. I suppose though, that any effort I can put in will be more than whatever is happening right now, eh?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •