Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    You can go through the troubleshooting part of the FAQ. You will probably have to exclude some javascript from being optimized. If you have a URL you can communicate, I’ll be happy to have a look to advise what to exclude.

    frank

    Thread Starter felix_nong

    (@felix_nong)

    Hi frank,

    I think the problem is that this block of codes:

    <script type="text/javascript">
        // <![CDATA[
        var RecaptchaOptions = {
            custom_translations: {
                instructions_visual: "Type the two words:",
                instructions_audio: "Type what you hear:",
                play_again: "Play sound again",
                cant_hear_this: "Download sound as MP3",
                visual_challenge: "Visual challenge",
                audio_challenge: "Audio challenge",
                refresh_btn: "Get two new words",
                help_btn: "Help",
                incorrect_try_again: "Incorrect. Try again.",
            },
            theme: "clean",
            lang: "en",
            tabindex: 5
        };
        // ]]>
    </script>

    is being compressed along with other scripts on my page which make it’s loaded after the google captcha script:

    <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6Ld9GfsSAAAAAAzHv1L48n3s3ceXJ3H9bZ9f24X8"></script>

    The above google script require the first block of codes which is the RecaptchaOptions in order to work properly but since it’s being compressed by Autoptimize then above block of codes is loaded after the google script which is the reason why it cannot render correctly.

    How can I exclude that block of codes from being compressed?

    Thanks,

    Felix

    Plugin Author Frank Goossens

    (@futtta)

    ah, but the answer to your question is in the FAQ Felix ??

    How does “exclude from optimizing” work?
    Both CSS and JS optimization can skip code from being aggregated and minimized by adding “identifiers” to the comma-seperated exclusion list. The exact identifier string to use can be determined this way:

    • if you want to exclude a specific file, e.g. wp-content/plugins/funkyplugin/css/style.css, you could simply exclude “funkyplugin/css/style.css”
    • if you want to exclude all files of a specific plugin, e.g. wp-content/plugins/funkyplugin/js/*, you can exclude for example “funkyplugin/js/” or “plugins/funkyplugin”
    • if you want to exclude inline code, you’ll have to find a specific, unique string in that block of code and add that to the exclusion list. Example: to exclude “funky_data=’Won\’t you take me to, Funky Town'”, the identifier is “funky_data”.

    that should help, no? ??
    frank

    (hint; use “RecaptchaOptions” as exclusion-string)

    Thread Starter felix_nong

    (@felix_nong)

    Thanks, problem solved. 5 star plugin ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Recaptcha display incorrectly’ is closed to new replies.