Extend Sandboxing experiment to Paired AMP modes#7288
Conversation
…mode - Replace link[rel=amphtml] with link[rel=alternate] if non-strict sandboxing level is selected.
… and in reader mode
288cbe9 to
40688e0
Compare
|
For this existing code: amp-wp/src/MobileRedirection.php Lines 573 to 583 in 40688e0 It should probably afterward do: if ( empty( $text ) ) {
return;
}This would allow someone to turn off the link via: add_filter( 'amp_mobile_version_switcher_styles_used', '__return_false' );
add_filter( 'amp_mobile_version_switcher_link_text', '__return_empty_string' ); |
…direction is disabled
|
Plugin builds for dbe9350 are ready 🛎️!%0A- Download development build%0A- Download production build |
Co-authored-by: Weston Ruter <westonruter@google.com>
Codecov Report
@@ Coverage Diff @@
## develop #7288 +/- ##
==============================================
+ Coverage 64.88% 77.82% +12.94%
- Complexity 0 6867 +6867
==============================================
Files 67 276 +209
Lines 1159 19842 +18683
==============================================
+ Hits 752 15443 +14691
- Misses 407 4399 +3992
Flags with carried forward coverage won't be shown. Click here to find out more.
|
8cc7b58 to
5e87dbf
Compare
8bec181 to
0d2c16f
Compare
…_used() Test if it keeps the required AMP markup if AMP elements are present
westonruter
left a comment
There was a problem hiding this comment.
I was doing some thorough testing and I found two additional required changes. Almost there!
| if ( ! amp_is_canonical() && ( $is_mobile_redirect_enabled || ( 1 === $sandboxing_level || 2 === $sandboxing_level ) ) ) { | ||
| add_action( 'wp_head', [ $this, 'add_mobile_alternative_link' ] ); | ||
| } |
There was a problem hiding this comment.
Note to self: previously this was done below.
if ( ! amp_is_request() ) {
add_action( 'wp_head', [ $this, 'add_mobile_alternative_link' ] );
}…te link Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Summary
Fixes #7268
Checklist