WPIntell

Source evidence

How to defer script Google Recaptcha

Contact Form by Supsystic · support · 2019-09-11T14:46:00+00:00

mixedsentiment
highseverity
0.94relevance
8replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 36 rows with source links

19.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
leoidro resolved
Hello, anyone can tell me a way to defer the script of loading google recaptcha included in this plugin? <script src=” https://www.google.com/recaptcha/api.js?render=explicit&onload=cfsInitCaptcha&ver=1.6.5″></script> ; I see a bad performance on my web site loading speed with that script. I don’t want to use some plugin like Async Js. I want something that affect just this script. Thanks Can anyone help me? Hello, @leoidro Thank you for contacting us regarding your question! We have already made this fix. You can wait for release of this version or make fix in your plugin yourself. Replace frame.php file via FTP. Path: /classes/frame.php frame.php Code: public function add_defer_attribute($tag, $handle) { // add script handles to the array below switch ($handle) { case 'google.recaptcha': return str_replace(' src', ' defer="defer" src', $tag); break; case 'google.recaptcha.frontend': return str_replace(' src', ' defer="defer" src', $tag); break; } return $tag; } Best regards, Ole Thank you for your answer. So I just have to add that code to the end of the frame.php file? Just replace the file that we provided to you. The file frame.php that you provided to me is exactly the same to the file that I already have, and doesn’t contain the function add_defer_attribute that you link above. How is it possible? Please re-download file . This reply was modified 6 years, 8 months ago by supsystic . I tried your solution but it’s doesn’t work. The problem of Google recaptcha that doesn’t defer remain. This is the report from Gtmetrix.com: 524.6KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering. https://www.gstatic.com/recaptcha/api2/v1566858990656/recaptcha__en.js (215.7KiB) https://www.gstatic.com/recaptcha/api2/v1566858990656/recaptcha__en.js (215.7KiB) Please contact us through our internal support . We will help you to solve the problem.

Comments

8 shown
leoidro 2019-09-16T12:22:00+00:00

Can anyone help me?

supsystic 2019-09-16T13:45:00+00:00

Hello, @leoidro Thank you for contacting us regarding your question! We have already made this fix. You can wait for release of this version or make fix in your plugin yourself. Replace frame.php file via FTP. Path: /classes/frame.php frame.php Code: public function add_defer_attribute($tag, $handle) { // add script handles to the array below switch ($handle) { case 'google.recaptcha': return str_replace(' src', ' defer="defer" src', $tag); break; case 'google.recaptcha.frontend': return str_replace(' src', ' defer="defer" src', $tag); break; } return $tag; } Best regards, Ole

leoidro 2019-09-16T14:35:00+00:00

Thank you for your answer. So I just have to add that code to the end of the frame.php file?

supsystic 2019-09-17T13:45:00+00:00

Just replace the file that we provided to you.

leoidro 2019-09-17T13:48:00+00:00

The file frame.php that you provided to me is exactly the same to the file that I already have, and doesn’t contain the function add_defer_attribute that you link above. How is it possible?

supsystic 2019-09-17T13:54:00+00:00

Please re-download file . This reply was modified 6 years, 8 months ago by supsystic .

leoidro 2019-09-18T08:53:00+00:00

I tried your solution but it’s doesn’t work. The problem of Google recaptcha that doesn’t defer remain. This is the report from Gtmetrix.com: 524.6KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering. https://www.gstatic.com/recaptcha/api2/v1566858990656/recaptcha__en.js (215.7KiB) https://www.gstatic.com/recaptcha/api2/v1566858990656/recaptcha__en.js (215.7KiB)

supsystic 2019-09-18T13:31:00+00:00

Please contact us through our internal support . We will help you to solve the problem.