• Resolved wpuser000

    (@wpuser000)


    Hi, thanks for the great plugin! (just left a 5-star review)

    For JS I have optimize, defer and defer inline enabled (but not aggregate). I haven’t added any extra script excludes apart from the default.

    I have some plain inline <script> tags in the site (added in the wp widgets) and noticed that some of them get deferred (with the base64 method) but some don’t, and I haven’t been able to figure out why some are not deferred (read the faq’s etc.). I’ve also tried changing the order of the script tags with the same result. The scripts themselves are working fine.

    What possible reasons are there that could cause some inline scripts to not be deferred?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    That would happen if for example the script is marked as “not to be deferred/ asynced”, e.g. with the data-cfasync or if a nonce was found or if document.write was spotted in the JS wpuser000.

    If you can share your site’s URL I’ll be happy to have a quick look at what is the root cause in your case?

    frank

    Thread Starter wpuser000

    (@wpuser000)

    Thank you,

    It doesn’t seem any of those apply to my code – is there a private way to share the website?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you can mail me; futtta-at-gmail-dot-com 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Follow-up for others experiencing this; the root cause turned out to be the presence of adsbygoogle in the inline JS. To avoid impacting Google Ads displaying, the presence of that string causes AO not to defer the JS.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Some inline javascript not being deferred’ is closed to new replies.