WooCommerce subscription : Could not verify you are not a robot
Hello, Thank you for this great plugin :)
We have a problem on WooCommerce/Elementor signup with Altcha, we systematically have the following error message :
Could not verify you are not a robot.
We reproduce the problem on 2 different websites :
- One uses the widget "Woo Checkout" from Essentiel Addons Pro.
- Other uses the widget "Checkout" from Elementor Pro.
We tried to disable Redis Cache Object and Wp Super Cache, but we still have the problem. We also added the checkout URL and the /wp-json/altcha/v1/challenge URL to WP Super Cache URL exclusion rules.
Maybe it's a compatibility problem between Altcha and WooCommerce checkout for Elementor/Esential Addons ?
Our environment is :
- PHP 8.1
- Wordpress 6.8.2
- WooCommerce 9.8.5
- Elementor and Elementor Pro 3.29.0
- Essential Addons 6.1.14
- Essential Addons Pro 6.2.3
- WP Super Cache 2.0.1
- Redis Cache Object 2.5.4
- Altcha 1.26.1
Hello, It seems Elementor/Essential Addons does not implement the woocommerce_register_form action. We found a fix for WooCommerce Elementor/Essential Addons by adding the following code to our functions.php. We did not try it with classic woocommerce checkout, maybe it might cause altcha to be displayed twice...
/**
* Display altcha on Elementor/Essential Addons Woocommerce widget right before order submit
* @see https://github.com/altcha-org/wordpress-plugin/issues/46
*/
add_action(
//'woocommerce_checkout_order_review', // V1 : Works, but captcha is visible on each step (billing/shipping/payment)
//'woocommerce_review_order_before_submit', // V2 : Does not work, order submit button is frozen ?!
'woocommerce_review_order_after_payment', // V3
function () {
$plugin = AltchaPlugin::$instance;
$mode = $plugin->get_integration_woocommerce_register();
if (!empty($mode)) {
altcha_woocommerce_comments_render_widget($mode, 'altcha_register');
}
},
10,
0
);
Hi, thanks for reporting. I was able to reproduce this issue but the suggested fix will require more testing as it will probably break other parts. It is worth noting, that it works fine with default woocommerce configuration which allows "guest checkout" without requiring user registration.