From 9bcd323b73632fba830ad187f4b1c6162a77a604 Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 3 May 2019 14:55:59 +0530 Subject: [PATCH 1/2] Ignore UWP login form submission to avoid 2 times validation of captcha --- includes/class-uwp-recaptcha.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-uwp-recaptcha.php b/includes/class-uwp-recaptcha.php index 86d1ce9..51d434f 100644 --- a/includes/class-uwp-recaptcha.php +++ b/includes/class-uwp-recaptcha.php @@ -134,6 +134,10 @@ public function add_scripts() public function login_authenticate($user){ + if(isset( $_POST['uwp_login_nonce'] )){ // ignore UWP login form submission + return $user; + } + if(1 != uwp_get_option('enable_recaptcha_in_wp_register_form') || !uwp_recaptcha_enabled()){ return $user; } From ccf168791d8e985e770f74337b3690d08c226dc5 Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 3 May 2019 14:57:37 +0530 Subject: [PATCH 2/2] fix option name checks for wp forms --- includes/class-uwp-recaptcha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-uwp-recaptcha.php b/includes/class-uwp-recaptcha.php index 51d434f..6a0151c 100644 --- a/includes/class-uwp-recaptcha.php +++ b/includes/class-uwp-recaptcha.php @@ -138,7 +138,7 @@ public function login_authenticate($user){ return $user; } - if(1 != uwp_get_option('enable_recaptcha_in_wp_register_form') || !uwp_recaptcha_enabled()){ + if(1 != uwp_get_option('enable_recaptcha_in_wp_login_form') || !uwp_recaptcha_enabled()){ return $user; } @@ -168,7 +168,7 @@ public function login_authenticate($user){ public function registration_errors($errors){ - if(1 != uwp_get_option('enable_recaptcha_in_wp_login_form') || !uwp_recaptcha_enabled()){ + if(1 != uwp_get_option('enable_recaptcha_in_wp_register_form') || !uwp_recaptcha_enabled()){ return $errors; }