• Resolved Jason

    (@galapogos01)


    Hi guys,

    I was looking into a TBT problem on my site and found that your plugin is enqueueing the recaptcha js on every page, despite a comment in the code saying it shouldn’t. In recaptcha-woo.php line 56

    // Enqueue recaptcha script only on account or checkout page
    add_action("wp_enqueue_scripts", "rcfwc_script_enqueue");
    function rcfwc_script_enqueue() {
    wp_enqueue_script( 'rcfwc-js', plugins_url( '/js/rcfwc.js', __FILE__ ), array('jquery'), '1.0', array('strategy' => 'defer'));
    wp_enqueue_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js?explicit&hl=' . get_locale(), array(), null, array('strategy' => 'defer'));
    }
    add_action("wp_enqueue_scripts", "rcfwc_script");
    function rcfwc_script() {
    if( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    if ( is_checkout() || is_account_page() ) {
    rcfwc_script_enqueue();
    }
    }
    }
    // Enqueue recaptcha script on login
    add_action("login_enqueue_scripts", "rcfwc_script_login");
    function rcfwc_script_login() {
    rcfwc_script_enqueue();
    }

    Simply commenting out the first add_action("wp_enqueue_scripts", "rcfwc_script_enqueue"); seems to do the trick.

    Can we get a fix for this in the plugin?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Elliot Sowersby / RelyWP

    (@elliotvs)

    Hi,

    An option has now been added to the plugin to choose whether or not to load the scripts on all pages or not.

    (Some websites do require it to load on all pages, for example if other plugins are using the WooCommerce login forms, or the login form is displayed on all pages, etc.)

    Appreciate you adding this option. However, on both the sites where I have your plugin installed, unchecking the new option and saving causes the form to reload with the option is still checked.

    Any idea what the issues might be?

    @elliotvs I’m not able to uncheck the option “Load scripts on all pages”. Every time i uncheck it and click Save Change, it returns to Checked

    Other Settings
    Load scripts on all pages? “If unchecked, scripts will only load on the WP Login, My Account, and Checkout pages.” Hello, so if unchecked we cannot use recaptcha for woocommerce inscription and connection ?

    Thank you for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.