AMP: Stylesheet 'jetpack-widget-social-icons-styles' is enqueued even if Social Icons widget is never used #10862
Labels
[Feature] Extra Sidebar Widgets
[Type] Bug
When a feature is broken and / or not performing as intended
The stylesheet for the Social Icons widget is enqueued unconditionally even when the widget not used on the page:
jetpack/modules/widgets/social-icons.php
Lines 50 to 55 in 429d964
Normally
jetpack_implode_frontend_css
would be true so this issue would not be noticed. However, when serving AMP pages, Jetpack opts-out of serving the concatenated CSS to facilitate the AMP plugin's CSS tree shaker to make it easier to stay below 50KB:jetpack/3rd-party/class.jetpack-amp-support.php
Lines 32 to 33 in 429d964
This then causes the CSS to be needlessly output on the frontend, as seen in the
style[amp-custom]
manifest comment:There are 253 bytes, the
.screen-reader-text
rule, which survive the tree-shaking process. While this is very small, every byte counts when there is a 50KB limit.And for sites that have other reasons to disable
jetpack_implode_frontend_css
, this needless enqueue slows down the performance of the frontend.The text was updated successfully, but these errors were encountered: