Closed swissspidy closed 2 years ago
Related tickets: https://secure.helpscout.net/conversation/1717271304/312671 https://secure.helpscout.net/conversation/1718076149/312826?folderId=3864740
Issue is also reported here: https://github.com/google/web-stories-wp/issues/9896
Related ticket: https://secure.helpscout.net/conversation/1724424648/313860/
We can do as we did for the other options, and use the filter to disable the option when on AMP pages in the disable_options_for_amp()
method.
add_filter( 'pre_get_rocket_option_minify_google_fonts', '__return_false' );
Effort [XS]
@Tabrisrp I think the method name is disable_options_on_amp()? https://github.com/wp-media/wp-rocket/blob/trunk/inc/ThirdParty/Plugins/Optimization/AMP.php#L111
Well for Web stories 1.15.1 (while AMP is activated 2.2.0) => GF optimization is not applied while for Web Stories 1.16.0, GF optimization is applied now on develop @alfonso100 @Tabrisrp can you please check this (not sure why optimizations are there for 1.16.0)
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
Google Fonts combining adds
onload
attributes to thelink
tags, which causes AMP invalidation, for example when using the Web Stories WordPress plugin.This is done here:
https://github.com/wp-media/wp-rocket/blob/68459b83c9ab16e27d78ad6a3d33fdedfe942012/inc/Engine/Optimization/GoogleFonts/AbstractGFOptimization.php#L119
To Reproduce Steps to reproduce the behavior:
onload
attributeExpected behavior
The
AMP
compat class should be extended to disable Google Fonts combining:https://github.com/wp-media/wp-rocket/blob/290c89ed141b814641bae71b5238b46498c1f4e8/inc/ThirdParty/Plugins/Optimization/AMP.php
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Backlog Grooming (for WP Media dev team use only)