Here’s the FIX for this plugin on WP 5.5 and later
-
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”
- The topic ‘Here’s the FIX for this plugin on WP 5.5 and later’ is closed to new replies.