gazzazzag
Forum Replies Created
-
Thanks @probablynotphil your reply was helpful.
Forum: Plugins
In reply to: [WooCommerce] There has been a critical error on this website@cumulusnet My offered temporary solution was just me being helpful to others affected by this sudden and unexpected woocommerce critical failure. If you don’t like community based help then don’t use it, save your ‘disgust’ and wait for an official resolution from woocommerce instead. I’d like the official solution soon too, but my clients can’t wait for that.
Forum: Plugins
In reply to: [WooCommerce] There has been a critical error on this websiteThe same issue cropped up for me this morning on all my sites.
I have applied a temporary patch of my own making to the relevant woocommerce file, which is /plugins/woocommerce/src/Admin/RemoteInboxNotifications/ComparisonOperation.php.
For those who want to try it themselves, replace the compare function in this file with the following (back up the old file first though).
Seems to get around the issue, but would be interested to see if this works for others too.
public static function compare( $left_operand, $right_operand, $operation ) { switch ( $operation ) { case '=': return $left_operand === $right_operand; case '<': return $left_operand < $right_operand; case '<=': return $left_operand <= $right_operand; case '>': return $left_operand > $right_operand; case '>=': return $left_operand >= $right_operand; case '!=': return $left_operand !== $right_operand; case 'contains': if ( is_array( $left_operand ) && is_string( $right_operand ) ) { return in_array( $right_operand, $left_operand, true ); } if(is_string( $left_operand ) && is_string( $right_operand )) { return strpos( $right_operand, $left_operand ) !== false; } case '!contains': if ( is_array( $left_operand ) && is_string( $right_operand ) ) { return ! in_array( $right_operand, $left_operand, true ); } if(is_string( $left_operand ) && is_string( $right_operand )) { return strpos( $right_operand, $left_operand ) === false; } case 'in': if ( is_array( $right_operand ) && is_string( $left_operand ) ) { return in_array( $left_operand, $right_operand, true ); } if(is_string( $left_operand ) && is_string( $right_operand )) { return strpos( $left_operand, $right_operand ) !== false; } case '!in': if ( is_array( $right_operand ) && is_string( $left_operand ) ) { return ! in_array( $left_operand, $right_operand, true ); } if(is_string( $left_operand ) && is_string( $right_operand )) { return strpos( $left_operand, $right_operand ) === false; } } return false; }If you are using Firefox make sure that you disable Content Blocking for the site. I had this on and discovered that if you have Recaptcha 3 enabled then it would result in CF7 returning the error message and the send attempt would fail. Of course other site users won’t be aware of this so it raises an interesting dilemma as to whether to have recaptcha turned on at all.