Plugin Directory

Changeset 3486218


Ignore:
Timestamp:
03/19/2026 08:13:43 AM (9 days ago)
Author:
WebFactory
Message:

Woo fix

Location:
advanced-google-recaptcha/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • advanced-google-recaptcha/trunk/advanced-google-recaptcha.php

    r3336844 r3486218  
    44  Plugin URI: https://getwpcaptcha.com/
    55  Description: Advanced Google reCAPTCHA will safeguard your WordPress site from spam comments and brute force attacks. With this plugin, you can easily add Google reCAPTCHA to WordPress comment form, login form and other forms.
    6   Version: 1.31
     6  Version: 1.32
    77  Author: WebFactory Ltd
    88  Author URI: https://www.webfactoryltd.com/
     
    1010  Text Domain: advanced-google-recaptcha
    1111  Requires at least: 4.9
    12   Tested up to: 6.8
     12  Tested up to: 6.9
    1313  Requires PHP: 5.2
    1414
    15   Copyright 2023 - 2025  WebFactory Ltd  (email: [email protected])
     15  Copyright 2023 - 2026  WebFactory Ltd  (email: [email protected])
    1616  Copyright 2021 - 2023  WP Concern
    1717
     
    161161                add_action( 'woocommerce_review_order_before_submit', array('WPCaptcha_Functions', 'login_scripts_print'));
    162162                add_action( 'woocommerce_checkout_process', array('WPCaptcha_Functions', 'check_woo_checkout_form'));
     163                add_action( 'woocommerce_pay_order_before_submit', array('WPCaptcha_Functions', 'login_scripts_print'), 10);
     164                add_action( 'woocommerce_pay_order_before_submit', array('WPCaptcha_Functions', 'captcha_fields_print'), 11);
     165                add_action( 'woocommerce_before_pay_action', array('WPCaptcha_Functions', 'check_woo_order_pay'));
    163166            }
    164167
  • advanced-google-recaptcha/trunk/libs/functions.php

    r3262396 r3486218  
    390390    }
    391391
     392    static function check_woo_order_pay()
     393    {
     394        $captcha_check = self::handle_captcha();
     395        if ( $captcha_check === true ) {
     396            return;
     397        }
     398
     399        if ( function_exists('wc_add_notice') ) {
     400            wc_add_notice($captcha_check->get_error_message(), 'error');
     401        }
     402    }
     403
    392404    static function check_edd_register_form()
    393405    {
     
    485497            if (class_exists('woocommerce')) {
    486498                $output .= '<script>
    487                 jQuery("form.woocommerce-checkout").on("submit", function(){
    488                     setTimeout(function(){
     499                    function wpcaptcha_captcha_refresh() {
    489500                        grecaptcha.reset();
    490                     },100);
    491                 });
     501                    }
     502
     503                    jQuery(document.body).on("checkout_error", function(){
     504                        setTimeout(wpcaptcha_captcha_refresh, 50);
     505                    });
     506
     507                    jQuery(document.body).on("updated_checkout", function(){
     508                        setTimeout(wpcaptcha_captcha_refresh, 50);
     509                    });
    492510                </script>';
    493511            }
     
    506524            if (class_exists('woocommerce')) {
    507525                $output .= '<script>
    508                     jQuery("form.woocommerce-checkout").on("submit", function(){
    509                         setTimeout(function(){
    510                             wpcaptcha_captcha();
    511                         },100);
     526                    jQuery(document.body).on("checkout_error", function(){
     527                        setTimeout(wpcaptcha_captcha, 50);
     528                    });
     529
     530                    jQuery(document.body).on("updated_checkout", function(){
     531                        setTimeout(wpcaptcha_captcha, 50);
    512532                    });
    513533                </script>';
     
    529549        $options = WPCaptcha_Setup::get_options();
    530550        if ($options['captcha'] == 'recaptchav2') {
    531             wp_enqueue_script('wpcaptcha-recaptcha', 'https://www.google.com/recaptcha/api.js', array(), self::$version, true);
     551            wp_enqueue_script('wpcaptcha-recaptcha', 'https://www.google.com/recaptcha/api.js', array('jquery'), self::$version, true);
    532552        } else if ($options['captcha'] == 'recaptchav3') {
    533             wp_enqueue_script('wpcaptcha-recaptcha', 'https://www.google.com/recaptcha/api.js?onload=wpcaptcha_captcha&render=' . esc_html($options['captcha_site_key']), array(), self::$version, true);
     553            wp_enqueue_script('wpcaptcha-recaptcha', 'https://www.google.com/recaptcha/api.js?onload=wpcaptcha_captcha&render=' . esc_html($options['captcha_site_key']), array('jquery'), self::$version, true);
    534554        }
    535555    }
  • advanced-google-recaptcha/trunk/readme.txt

    r3336844 r3486218  
    55Requires at least: 4.9
    66Requires PHP: 5.6
    7 Tested up to: 6.8
    8 Stable tag: 1.31
     7Tested up to: 6.9
     8Stable tag: 1.32
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    7676
    7777== Changelog ==
     78= 1.32 - 19/03/2026 =
     79* added captcha to WooCommerce payment endpoint
     80* improved checkout error handling
     81
    7882= 1.31 - 30/07/2025 =
    7983* minor code fixes
Note: See TracChangeset for help on using the changeset viewer.