• Here is the fix for the helpful Conditional Captcha plugin so that it continues to run properly on WordPress version 5.5 and later…

    The fix is very simple. Edit the plugin’s main file wp-conditional-captcha.php

    …and change line 351 from:

    elseif( !is_user_logged_in() && empty( $comment['comment_type'] ) && empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && ( !defined( 'XMLRPC_REQUEST' ) || !XMLRPC_REQUEST ) ) {

    to:

    elseif( !is_user_logged_in() && ( empty( $comment['comment_type'] ) || $comment['comment_type'] == 'comment' ) && empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && ( !defined( 'XMLRPC_REQUEST' ) || !XMLRPC_REQUEST ) ) {

    Explanation:

    The problem was brought on in WordPress 5.5 where the WP team decided to change the default comment_type to be ‘comment’ rather than blank (as it had always been previously).

    This broke the plugin, which was testing for an empty comment_type field to check for a standard comment. The result is no comments were being processed after upgrading to WP 5.5 or later.

    But it’s a simple one-line change to the code, and I hope the plugin author @solarissmoke incorporates this tweak into the official plugin distribution!

    Details:

    See the section, “Comments: default comment_type value now enforced”

    Miscellaneous Developer Focused Changes in WordPress 5.5

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thanks mate. Applied the fix. Will see how it goes.

    Thread Starter roam92

    (@roam92)

    You’re welcome, glad to help!

    Since applying the fix, the plugin works perfectly again – and saves me tons of time from having to review spambot posts by automatically deleting them if the captcha challenge is not passed by an actual human commenter…

    [Plugin setting: “When a CAPTCHA is not completed correctly: Delete the comment permanently”]

    I’ve always thought this type of captcha functionality should be built into Akismet itself, but for some reason they have not picked up on this terrific, timesaving idea.

    So I hope that the author of this helpful plugin @solarissmoke will incorporate the simple fix above back into the official distribution of his plugin!

    Best!

    Thread Starter roam92

    (@roam92)

    Thanks, happy to hear that it helped!

    I am not sure what I would do without this useful plugin, so I am hopeful that the author @solarissmoke will incorporate the simple fix above back into the official distribution…

    That way it will be fixed once and for all!

    Amazing how much time this plugin has saved me over the years:

    “1,152,064 spam comments have been blocked by Conditional CAPTCHA.”

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Here’s the FIX for this plugin on WP 5.5 and later’ is closed to new replies.