Forum Replies Created

Viewing 15 replies - 76 through 90 (of 378 total)
  • Plugin Author IQComputing

    (@iqcomputing)

    Hello @erulezz

    Thank you for the suggestion! We’ll need to investigate this as it’s not just pages we would need to consider, but all WordPress endpoints: Post Archives, Term Archives, Custom Post Types, Posts, Pages. Should a user add a sidebar with a contact form on their custom taxonomy term page, they would need an option to include the script just for that term or that whole taxonomy (i.e. all terms in the tax). We would want to make sure that the UX is easily understandable to the user and is relatively simplistic. Unfortunately, this is not something that is a quick implementation but also still 100% doable (some themes come to mind that already does something similar, but different circumstances).

    Should something come of this we will keep you updated via this thread (if you are subscribed, you will be notified). In the meantime should you have any further questions you may also reply back to this thread and we can assist further. Have a wonderful weekend!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    There shouldn’t be any restrictions to having multiple forms on the same page with our [recaptcha] script. In our testing, it does treat each form submission independently. Could you edit your original question and append the website URL to the “Link to the page you need help with” field so that we can take a look?

    Plugin Author IQComputing

    (@iqcomputing)

    Hello & thank you for your kind words!

    This is true, the plugin originally enqueued the script in the shortcode callback. Unfortunately, with the introduction of Block-based(FSE) Themes, late script enqueue (such as in a shortcode callback) no longer work. This is most notable in the TwentyTwentyTwo Theme. Additionally, we have no way of knowing during that enqueue hook if there is a Contact Form 7 shortcode on the page and that shortcode contains our [recaptcha] shortcode.

    If you control the website, you could create a small plugin to dequeue the script on specific pages:

    add_action( 'wp_enqueue_scripts', function() {
    	wp_dequeue_script( 'google-recaptcha' );
    }, 51 );

    Do note that the action hook priority here is important. The conditional tags should be available here too. We are open to ideas and suggestions should you think there is a better workaround for the above issue, but currently, we’re not seeing a universal way to appease both Block-based FSE Themes and traditional WordPress Themes. We apologize for the inconvenience but hope you have a wonderful weekend!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello @teidar

    We’ve just published update 1.3.8, which includes a new filter for the Google ReCaptcha javascript Locale. The filter is: wpcf7_recaptcha_locale and can be used to change the scripts locale. You should be able to use this filter the same way as above without having the locale apply to the entire page:

    function custom_locale( $locale ) {
    	
    	if ( is_page('page_slug') ) {
    		$locale = 'uk_UA';
    	}
    
    	return $locale;
    
    }
    add_filter( 'wpcf7_recaptcha_locale', 'custom_locale' );

    Let us know if you have any questions or concerns, and have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    @teidar We’re glad you were able to find a solution!

    In our example, the reason we add and remove this locale filter during the wp_enqueue_scripts action is to ensure that the locale only applies during the enqueue process. Otherwise, applying the filter on a global scale will change the locale for the entire page, which may have unforeseen consequences.

    Now that we see how you are implementing this, a filter may make sense. We will add a new filter for this locale on Monday to make this process easier in the future. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    The locale is based on the WordPress Installed site language set in Settings. There is a filter for that locale in get_locale() function.

    One possible way to work around this is to use the wp_enqueu_scripts hook to add a filter and remove the filter. It could look like this:

    /**
     * Change the locale for just one form instead of the whole website
     * Note that the action priority is important as this is what the
     * plugin uses to enqueue scripts.
     *
     * @return void
     */
    function custom_locale() {
    	add_filter( 'locale', 'update_locale' );
    }
    add_action( 'wp_enqueue_scripts', 'custom_locale', 50 );
    
    /**
     * Change the locale for just one form instead of the whole website
     * Note that the action priority is important as this runs after the
     * plugin enqueue scripts.
     *
     * @return void
     */
    function remove_custom_locale() {
    	remove_filter( 'locale', 'update_locale' );
    }
    add_action( 'wp_enqueue_scripts', 'remove_custom_locale', 51 );
    
    /**
     * Change the locale
     *
     * @param String $locale
     *
     * @return Sting $locale
     */
    function update_locale( $locale ) {
    
    	return 'uk_UA';
    
    }

    I’m not convinced yet that there is a good use-case for a filter hook in the “ReCaptcha v2 for Contact Form 7”. The forms inherit the same language that the website is set to. Since the reCaptcha script is only enqueued once, all forms would have to have the same locale. I personally believe that the best solution for this is to set the Site Language to the one you desire.

    Hopefully, the above answers your question, but should you need anything else, please reply to this thread and we can assist you further. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    The locale is based on the WordPress Installed site language set in Settings. There is a filter for that locale in get_locale() function.

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    Looking at the source code of this website, we’re not seeing any of the required JavaScript files which load the reCaptcha. If this is a custom theme, please ensure that the header calls wp_head() and the footer calls wp_footer() so that the script files can load properly.

    When viewing the source of the website, we expect to see calls to both:

    – recaptcha/api.js
    – assets/js/wpcf7-recaptcha-controls.js

    Neither of which we are seeing.

    Another option is to install the WordPress Health Check & Troubleshooting tool. This will allow you to safely, and just for your admin user, to activate a WordPress Theme like TwentyTwentyOne. Doing so may give you some insight if the issue lies with the theme or a conflict with one of the installed plugins. For more information, please review their documentation.

    Hopefully, using the above information, you can narrow down the root cause of these issues. Please reply back to this thread if you have any questions or require further assistance. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello @streettb

    Looking at the source, we can see that the api.js script from Google is still trying to pull in ver=3.0 instead of 2.0. We’re also not seeing the wpcf7-recaptcha-controls.js that should appear. Could you verify that your theme calls wp_head() and wp_footer() in the header and footer respectively?

    Another debugging method to test if it’s a theme or plugin conflict is installing the WordPress Health Check & Troubleshooting plugin. This is an official WordPress plugin and you can view their documentation. We still recommend taking a website backup but this plugin will allow you to safely disable plugins and revert to a default WordPress theme. If you change the theme to a TwentyTwentyOne theme and the reCaptcha displays, then you know it’s a theme issue. Otherwise, you can start troubleshooting plugins to figure out which one is the conflict. For more information on Troubleshooting, please review their documentation:

    https://make.ww.wp.xz.cn/support/handbook/appendix/troubleshooting-using-the-health-check/#troubleshooting

    Currently, since we don’t see our plugin script file in the source code we suspect it’s either a theme issue or another plugin is adding their own reCaptcha script and is conflicting. Hopefully, with the above information, you’re able to narrow down the root cause of this issue. Otherwise, please reply back to this thread and we can assist further. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    We recommend double-checking the installation steps. Some easy to miss steps can include:

    1) Ensure that your domain name is listed on the Version 2 API Keys through Google Webmaster.

    2) Ensure that under “Contact > reCaptcha Version” in the left-hand admin menu, you have Version 2 set and saved in the select box.

    Generally, 400 Errors occur whenever Version 3 is requested with Version 2 keys. Hopefully, using the above, you’re able to fix your issues, but if not, please reply to this thread, and we can assist you further. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello @plushwigz,

    Please create a separate topic. It’s easier to keep track of unresolved topics and replies when each issue has its own topic.

    Our plugin does not load ReCaptcha or any ReCaptcha JavaScript on the WP login page. If you have multiple ReCaptcha v2 plugins, you’ll need to ensure that the API keys are the same. If you cannot log into your website, we recommend reaching out to your hosting provider to disable the specific ReCaptcha plugin so you’re able to address the issue.

    Hopefully, you’re able to solve your issue but should you have any questions please create a new topic and we can assist you further.

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    We’ve installed and enabled the Minify settings for WP Optimize and could not replicate your issue. Please ensure that the plugin is up to date and the plugin cache has been cleared.

    If the above does not work, you can try to exclude the script by following the below instructions:

    1) Navigate to WP-Optimize > Minify

    2) In the JavaScript tab in the “Exclude JavaScript from processing” box, paste the following:

    wpcf7-recaptcha/assets/js/wpcf7-recaptcha-controls.js

    3) Save your changes.

    The above will exclude the callback script from being minified and included in your other scripts.

    Hopefully, the above works for you, but if not, please reply back to this thread, and we can assist you further. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    The wpcf7-recaptcha-controls.js is purposely small. Coming in at 63 lines of code, 2 KB unminified and ~1000 bytes minified ( by optimization plugin ). It’s unlikely you will see any performance improvements removing such a tiny script from being requested.

    That being said, the script is enqueued using wp_enqueue_scripts at priority 50 and is a required script with google-recaptcha handle. You would need to conditional dequeue google-recaptcha to also dequeue wpcf7-recaptcha-controls.js.

    Plugin Author IQComputing

    (@iqcomputing)

    Hello @duboi,

    This issue likely stems from WP Rocket. If you temporarily disable this plugin, does the reCaptcha appear normally? If so, we recommend reaching out to WP Rocket for a solution. Additionally, if you can exclude the following script from WP Rocket, this is where the reCpatcha gets initialized, then it may also work as expected:

    plugins/wpcf7-recaptcha/assets/js/wpcf7-recaptcha-controls.js

    Unfortunately, WP Rocket is a premium plugin, so we cannot easily replicate this issue ourselves. Hopefully, between their support and excluding the above script from being minified, modified, and cached, you’re able to find a solution. Otherwise, if you have any additional questions or suggestions, please reply back to this thread, and we can assist further. Have a wonderful rest of your week!

    Plugin Author IQComputing

    (@iqcomputing)

    Hello @tonyntje

    If you would like to get to the bottom of the issue please open a new thread with further details. It’s much easier to track issues when each one has its own topic. We would be happy to help!

Viewing 15 replies - 76 through 90 (of 378 total)