-
Notifications
You must be signed in to change notification settings - Fork 383
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
Always allow switching to Reader mode, but default to mode defined by theme #2622
Conversation
Best to suppress whitespace changes when reviewing: https://github.com/ampproject/amp-wp/pull/2622/files?w=1 |
This comment has been minimized.
This comment has been minimized.
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.
LGTM. Tested the branch varying the theme support options. The changes make the UX more intuitive and I think it captures important use cases for the plugin.
…when upgrading from 1.0 to 1.2
daed656
to
68f8c9a
Compare
Hi @westonruter, What do you think about moving this to 'Ready for Merging,' without more functional testing? I could test this also, if that would help. Thanks, Weston! |
I did test various scenarios, including variables:
Having your set of eyes on testing to make sure it works as expected would be helpful. |
*/ | ||
self::$support_added_via_option = ( $is_paired && self::STANDARD_MODE_SLUG === $theme_support_option ) ? self::STANDARD_MODE_SLUG : null; | ||
if ( self::STANDARD_MODE_SLUG === self::$support_added_via_option ) { | ||
// Make sure the user option can override what the theme has specified. |
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.
Good idea. Like you mentioned, the theme might have support, but plugins might not.
Upgrading from 1.0 to 1.2
Steps Taken
|
Theme with declared AMP support
Steps Taken
|
Testing on (simulated) fresh install
Steps Taken
|
Looks Good! Hi @westonruter, See you soon! |
Thank you for confirming! |
This is a follow-up on #2550.
When using a core theme, a notice is displayed encouraging a user to switch to Standard or Transitional mode:
If using a non-core theme without any special theme support, it looks like:
However, when using a theme like Neve which has built-in paired AMP support, the Reader mode option is removed:
The user can still switch to Transitional mode (see #2312), but the Reader mode is gone.
Additionally, if a theme is active which is AMP-first (non-paired
amp
theme support declared), then they see no options at all:This can be undesirable because while the theme itself has
amp
support, the plugins being used by the theme may very well not. For such sites, having the option to stay in Reader mode is important until AMP-compatible plugins can be activated. As it stands today, the lack of Reader mode availability could cause theme makers hesitate from adding AMP compatibility, since it limits the options available to their users. It could cause users to either switch to a different theme if they want AMP, or turn off AMP if they really want the theme.So we should let Reader mode always be an available option. Nevertheless, upon activating the AMP plugin and the theme has
amp
support, then the default option should be Standard whenpaired
flag is present and Transitional whenpaired
flag is present. As explained in #2312, ifpaired
is absent then the Transitional mode should still not be made available.This is related to #1384: Default to transitional mode with auto-sanitization for new activations, and to native mode when compatible theme/plugins active.
Proposed Changes
No change for when a core theme is being used, continuing to default to Reader mode or when using a theme that lacks
amp
theme support.However, when switching to a theme like Neve which has
paired
theme support, then for existing plugin activations (which had previously been on Reader) then the Reader mode remains active and a green notice is displayed encouraging them to switch:For new AMP plugin activations, the default mode is Transitional, and again the Reader mode is still presented as an option (the notice is removed because the user switched):
Similarly, if the user has activated a theme that has
amp
theme support without thepaired
flag (i.e. an AMP-first theme), then upon switching to such a theme from an existing Reader mode install they would see defaulting to Reader with a notice:And brand new AMP plugin activations would default to Standard for themes that have non-paried
amp
theme support, but with the ability to switch to Reader: