-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <[email protected]>
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Co-authored-by: Weston Ruter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Summary
Fixes #7268
Checklist