SBP Breaks AMP script
-
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 thesrc
.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.
- The topic ‘SBP Breaks AMP script’ is closed to new replies.