• Hello,

    I am using Beaver Builder Theme (version 1.6.2), Beaver Builder Pro plugin (Version 1.10.8.1) and WordPress (Version 4.8.1). I am using reCAPTCHA V2 on the Beaver Builder Contact for and worked fine until I enabled and configured reCAPTCHA in the Theme My Login Plugin. Once this was done reCAPTCHA doesn’t appear on my contact form. I tried using the same keys for both and the generated new keys for the TML module and both scenarios yield the same results: reCAPTCHA appears and works on the registration page however does not appear and will not allow submissions on the contact form. I am wondering if you have any words of wisdom?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter rickapplin

    (@rickapplin)

    So, why does TML add the java-script to all pages and not just applicable pages? Can this be fixed?

    Just came across this myself. Two options, pick either. The first is simpler but will get overwritten with any future changes to TML.

    1) Modify wp-content/plugins/theme-my-login/modules/recaptcha/recaptcha.php
    – Remove the line in the load() method:
    add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
    – Add it again inside the recaptcha_display method.

    2) Add the following code into a custom plugin or functions.php:

    add_action('wp_enqueue_scripts', __NAMESPACE__ . '\\lrkw_fix_tml', 9);
    function lrkw_fix_tml()
    {
       if (class_exists('Theme_My_Login_Recaptcha'))
       {
          $res = remove_action('wp_enqueue_scripts', [\Theme_My_Login_Recaptcha::get_object(), 'wp_enqueue_scripts']);
          error_log("Remove ThemeMyLogin scripts: " . $res);
    
          if ($res)
          {
             add_action('register_form', [\Theme_My_Login_Recaptcha::get_object(), 'wp_enqueue_scripts'] );
             add_action('signup_extra_fields', [\Theme_My_Login_Recaptcha::get_object(), 'wp_enqueue_scripts'] );
          }
       }
    }
    Plugin Author Jeff Farthing

    (@jfarthing84)

    TML loads the javascript on all pages because it could be needed via widget or shortcode.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Compatability Issue when reCAPTCHA module enabled’ is closed to new replies.