-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to unhook it from the woocommerce checkout page? #29
Comments
This plugin only places a captcha on the main/woo login prompts, password
reset, and registration —not the checkout page itself (unless you are
talking about a login prompt in the checkout flow?)
On Wed, 7 Sep 2022 at 09:58, luboslives ***@***.***> wrote:
Hi, I'm at a loss here so I thought I'd go to the source. I've tried
unhooking the captcha from the login form inside the woo checkout page by
removing every action and script I could find in the source, and hooking
into plugins_loaded, init and wp_loaded, yet still the captcha just keeps
loading into the form:
function cdnrec_remove_captcha_from_checkout () {
if ( ! is_checkout() ) {
return;
}
// unhook all mentions of nocaptcha_form
remove_action('login_form', array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('register_form', array('LoginNocaptcha', 'nocaptcha_form'), 99);
remove_action('signup_extra_fields', array('LoginNocaptcha', 'nocaptcha_form'), 99);
remove_action('lostpassword_form', array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('woocommerce_login_form', array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('woocommerce_lostpassword_form', array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('woocommerce_register_form', array('LoginNocaptcha', 'nocaptcha_form'));
// others?
remove_action('woocommerce_register_post', array('LoginNocaptcha', 'woo_authenticate'), 10, 3);
// scripts and styles
wp_dequeue_script('login_nocaptcha_google_api');
wp_dequeue_style('login_nocaptcha_css');
remove_action('wp_head', array('LoginNocaptcha', 'enqueue_scripts_css'));
remove_action('login_enqueue_scripts', array('LoginNocaptcha', 'enqueue_scripts_css'));
}
// add_action( 'plugins_loaded', 'cdnrec_remove_captcha_from_checkout');
// add_action( 'init', 'cdnrec_remove_captcha_from_checkout');
// add_action( 'wp_loaded', 'cdnrec_remove_captcha_from_checkout');
I also tried a priority of 99, no change. What's the secret to unhooking
it?
—
Reply to this email directly, view it on GitHub
<#29>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFJLZJNIOVMB4OXDX47NKTV5BKJ5ANCNFSM6AAAAAAQGRVIBI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Sent from Gmail Mobile
|
Yes that's the one. In this case, and possibly in general, the checkout page won't load anything other than "Your cart is empty" unless you have something to check out with. So I figure unless a bot is clever enough to add in-stock items to their cart before trying to hit the form from the checkout page - and why would they? - the captcha only increases the weight and loading time of the checkout page. |
WordPress Core only gives one place to hook in to the login forms, and it
applies to all forms whether on the main page or in the checkout flow. So
there isn't an option to selectively enable/disable in certain places,
because to WordPress, it's all just one form.
The "weight" isn't substantial--just one DOM element, one call to Google,
and the process of Javascript.
…On Wed, 7 Sept 2022 at 10:21, luboslives ***@***.***> wrote:
This plugin only places a captcha on the main/woo login prompts, password
reset, and registration —not the checkout page itself (unless you are
talking about a login prompt in the checkout flow?)
On Wed, 7 Sep 2022 at 09:58, luboslives *@*.*> wrote: Hi, I'm at a loss
here so I thought I'd go to the source. I've tried unhooking the captcha
from the login form inside the woo checkout page by removing every action
and script I could find in the source, and hooking into plugins_loaded,
init and wp_loaded, yet still the captcha just keeps loading into the form:
function cdnrec_remove_captcha_from_checkout () { if ( ! is_checkout() ) {
return; } // unhook all mentions of nocaptcha_form
remove_action('login_form', array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('register_form', array('LoginNocaptcha', 'nocaptcha_form'),
99); remove_action('signup_extra_fields', array('LoginNocaptcha',
'nocaptcha_form'), 99); remove_action('lostpassword_form',
array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('woocommerce_login_form', array('LoginNocaptcha',
'nocaptcha_form')); remove_action('woocommerce_lostpassword_form',
array('LoginNocaptcha', 'nocaptcha_form'));
remove_action('woocommerce_register_form', array('LoginNocaptcha',
'nocaptcha_form')); // others? remove_action('woocommerce_register_post',
array('LoginNocaptcha', 'woo_authenticate'), 10, 3); // scripts and styles
wp_dequeue_script('login_nocaptcha_google_api');
wp_dequeue_style('login_nocaptcha_css'); remove_action('wp_head',
array('LoginNocaptcha', 'enqueue_scripts_css'));
remove_action('login_enqueue_scripts', array('LoginNocaptcha',
'enqueue_scripts_css')); } // add_action( 'plugins_loaded',
'cdnrec_remove_captcha_from_checkout'); // add_action( 'init',
'cdnrec_remove_captcha_from_checkout'); // add_action( 'wp_loaded',
'cdnrec_remove_captcha_from_checkout'); I also tried a priority of 99, no
change. What's the secret to unhooking it? — Reply to this email directly,
view it on GitHub <#29
<#29>>, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAFJLZJNIOVMB4OXDX47NKTV5BKJ5ANCNFSM6AAAAAAQGRVIBI
<https://github.com/notifications/unsubscribe-auth/AAFJLZJNIOVMB4OXDX47NKTV5BKJ5ANCNFSM6AAAAAAQGRVIBI>
. You are receiving this because you are subscribed to this thread.Message
ID: @.*>
-- Sent from Gmail Mobile
Yes that's the one.
In this case, and possibly in general, the checkout page won't load
anything other than "Your cart is empty" unless you have something to check
out with. So I figure unless a bot is clever enough to add in-stock items
to their cart before trying to hit the form from the checkout page - and
why would they? - the captcha only increases the weight and loading time of
the checkout page.
—
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFJLZMQGVRAGCIPYYESH23V5BNB5ANCNFSM6AAAAAAQGRVIBI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi, I'm at a loss here so I thought I'd go to the source. I've tried unhooking the captcha from the login form inside the woo checkout page by removing every action and script I could find in the source, and hooking into
plugins_loaded
,init
andwp_loaded
, yet still the captcha just keeps loading into the form:I also tried a priority of 99, no change. What's the secret to unhooking it?
The text was updated successfully, but these errors were encountered: