Viewing 9 replies - 1 through 9 (of 9 total)
  • If you have a GitHub repo, I can send a PR to solve the issue.

    If not, just add a defer attribute to all the scripts in this file:

    https://plugins.trac.wordpress.org/browser/leadin/trunk/src/class-pagehooks.php

    Plugin Support mlamacchia

    (@mlamacchia)

    Hi Rami, thanks for your message.

    What script in particular are you referring to?

    We are aware that the speed rank is affected by our tracking code and our team is currently working on it. However, the tracking code is already loaded using defer (check line 82).

    • This reply was modified 6 months, 2 weeks ago by mlamacchia.

    @mlamacchia

    GTMatrix refers to the script loaded in line 116.

    See here: https://imgur.com/a/9eCUuFN

    If you can’t add defer attribute, at least load the script asynchronously using async attribute…

    Another solution is to add WordPress Hook to to your code (everywhere you load scripts). This way developers can change the code – for example a Filter Hook that passes an array of script attributes.

    I mean, I can change the plugin code, but the next plugin update will override my changes. WP hooks solve this issue.

    Again, if you have a GitHub repo, I can send a PR to solve the issue.

    Plugin Support mlamacchia

    (@mlamacchia)

    Hi Rami,

    Unfortunately, our code isn’t on GitHub yet.

    There is an inline script right after that one that relies on it, so adding defer isn’t enough. But we can, however, add a handler and run it on load.

    Our team is working on it, it’ll be live in around a week.

    Thanks for your help!

    Plugin Support alortega

    (@alortega)

    Hello @ramiy. We are now releasing a new version that prevent the forms loading for blocking the rendering.

    Thanks for your help!
    Alvaro.

    @mlamacchia @alortega

    The new plugin version didn’t solved the issue.

    When I view source the page, this is the code I see (I’ve removed the actual params):

    
    <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
    <script>
    hbspt.forms.create({
    portalId: "XXX",
    formId: "XXX",
    sfdcCampaignId: "XXX"
    });
    </script>
    

    You need to add defer or async attribute to the external script //js.hsforms.net/forms/v2.js in order to avoid render blocking.

    Plugin Support alortega

    (@alortega)

    Hello @ramiy. Thanks for your submission. If I’m not mistaken there should be a second appearance in the code of
    <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
    which do contain the defer attribute, isn’t it?

    Here are the lines where we add them

    https://plugins.trac.wordpress.org/browser/leadin/trunk/src/class-pagehooks.php#L135

    https://plugins.trac.wordpress.org/browser/leadin/trunk/js/src/gutenberg/FormBlock/FormBlockSave.js#L27

    This bit of code you shared is generated by a different part of the application. We have already discuss this with the relevant people and they informed they have this modification in the roadmap but at the moment we do not have an estimation of when this will be released.

    Kind regards,
    Alvaro.

    • This reply was modified 4 months, 3 weeks ago by alortega.
    • This reply was modified 4 months, 3 weeks ago by alortega.
    • This reply was modified 4 months, 3 weeks ago by alortega.
Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.