Answer the question
In order to leave comments, you need to log in
Why can there be a long loading of the page with google recaptcha?
There are three forms on the site, Google captcha is connected to them.
For something very long it is executed according to Google's speedometer, what could be wrong?
Maybe something is wrong in the js code connection?
captcha v2 (hidden)
<?if(!empty($GLOBALS['FORMS_ID'])):?>
<script type="text/javascript">
<?foreach ($GLOBALS['FORMS_ID'] as $formID):?>
var idCaptcha<?=$formID?>;
<?endforeach;?>
var onloadReCaptchaInvisible = function() {
<?foreach ($GLOBALS['FORMS_ID'] as $formID):?>
idCaptcha<?=$formID?> = grecaptcha.render('recaptcha<?=$formID?>', {
"sitekey": "<?=PUBLIC_KEY_GOOGLE_CAPTCHA_V2_HIDDEN?>",
"callback": "onSubmitReCaptcha<?=$formID?>",
"size": "invisible"
});
<?endforeach;?>
};
<?foreach ($GLOBALS['FORMS_ID'] as $formID):?>
function onSubmitReCaptcha<?=$formID?>(token) {
var idForm = 'form_<?=$formID?>';
sendForm(document.getElementById(idForm), idCaptcha<?=$formID?>);
}
<?endforeach;?>
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadReCaptchaInvisible&render=explicit" async defer></script>
<?endif;?>
Answer the question
In order to leave comments, you need to log in
After the update, something is wrong with Google speedometer for a long time.
Here, try Optimized .htaccess for Google PageSpeed Insights
You can google the same for nginx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question