• Hi,

    First of all, thanks for creating this super useful, well-designed plugin.

    I’m in the process of implementing it at Goshen College (goshen.edu), a large, highly trafficked WordPress site, but am unable to do so b/c the plugin loads the recaptcha scripts on every page, even though we just need them on the login and password reset pages. Performance matters a lot to us, and we can’t afford to force 99% of our users to download scripts for the 1% who actually log in.

    I’m planning on forking your plugin and commenting out line 18 of MchBasePublicPlugin.php:

    add_action('wp_enqueue_scripts', array( $this, 'enqueuePublicScriptsAndStyles' ));

    It would be great if there was an action/filter/constant for disabling the public enqueueing of scripts & styles. Even better, you could only enqueue them publicly if one of the non-Wordpress options (WooCommerce, UltraCommunity, etc..) is checked.

    Thanks!

    – Micah

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author MihChe

    (@mihche)

    Hi Micah,

    Is this good enough for you?

    add_action('wp_print_scripts', function (){
    	function_exists('login_header') ?: wp_dequeue_script( 'google-invisible-recaptcha' );
    });

    ~Mihai

    Thread Starter Micah Miller-Eshleman

    (@micahjm)

    Thanks Mihai, this would work for my use case.

    Plugin Author MihChe

    (@mihche)

    Hi @micahjm,
    Glad to hear that works for you. If you have a second to write a short review I’ll really appreciate that.

    ~Mihai

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent JavaScript enqueue on frontend’ is closed to new replies.