• This plugin seems to break AMP scripts output by the WordPress AMP plugin. With only the AMP plugin, wordpress will emit the following script tags:

    <script custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js" async></script>

    <script custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js async></script>

    <script src="https://cdn.ampproject.org/v0.js" async></script>

    When Speed Booster Pack is used with “Defer parsing of javascript files” enabled, it breaking the tag by injecting a “defer” property incorrectly. Here is the output:

    <script custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js' defer='defer" async></script>

    <script custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js' defer='defer" async></script>

    <script src="https://cdn.ampproject.org/v0.js' defer='defer" async></script>

    Note that the single and double quotes are not placed properly. It is injecting the defer property into the src.

    Disabling “Defer parsing of javascript files” fixes the issue, as does including these scripts in the “Exclude scripts from being deferred” section. However we are only allotted 4 scripts and I’m already at the limit.

    It seems like this plugin isn’t injecting the defer correctly for these AMP scripts.

Viewing 12 replies - 1 through 12 (of 12 total)
  • @jabrot – thanks for reporting this.

    An update is already in the works and I was already going to change the way “defer” works – now I just have an extra reason to do so šŸ™‚

    In a future update, not the one currently coming, we’ll look into adding the possibility of deferring scripts to more than 4. But right now, with the 3.7 update we’re more focused on actually fixing the bugs and making sure everything works properly.

    Thanks,
    Cristian.

    @jabrot – this has been addressed in the latest release of SBP (v3.7).

    Thanks,
    Cristian.

    Thread Starter jabrot

    (@jabrot)

    Thanks for updating it! The AMP defers are now working correctly. There seems to be a new issue now though. I will open a new ticket to track it.

    @jabrot – just a friendly reminder šŸ™‚ You haven’t opened up a new ticket to report the new AMP issue.

    Thanks,
    Cristian.

    Thread Starter jabrot

    (@jabrot)

    The new issue was this one:
    https://ww.wp.xz.cn/support/topic/jquery-defer/

    and it is resolved now.

    Thread Starter jabrot

    (@jabrot)

    It looks like this issue has returned with the latest update. I’m seeing the defer properties added to the amp scripts again. Was there a regression in the last update?

    Macho Themes

    (@machothemes)

    No regressesion, I’ll look into it šŸ™‚

    Thread Starter jabrot

    (@jabrot)

    Hi, should I open a new ticket to track this? Looking forward to a resolution, Thanks.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi @jabrot, there is no need to open a new ticket. Simply keep an eye open to the reply by @machothemes in a future release.

    Kind regards

    Everything is updated on my site but always get the defer=”defer” to appears… Tried to put it on the exclusion list, but that changed nothing…

    Thread Starter jabrot

    (@jabrot)

    Can we get this ticket marked as unresolved?

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, I marked the ticket as unresolved.

    Regards

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

The topic ‘SBP Breaks AMP script’ is closed to new replies.