Skip to content
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

Allow a site to express the need to be 100% AMP #6429

Closed
felixarntz opened this issue Jun 28, 2021 · 1 comment
Closed

Allow a site to express the need to be 100% AMP #6429

felixarntz opened this issue Jun 28, 2021 · 1 comment
Labels
Bento Enhancement New feature or improvement of an existing one

Comments

@felixarntz
Copy link
Collaborator

Feature description

Related to #1235 and google/site-kit-wp#2998, it looks like currently it is impossible for a third-party to really know whether the AMP plugin is truly using AMP-only, since even in Standard Mode there are ways to opt out e.g. on a per-post basis. While this makes sense to most end users of the AMP plugin, for users (arguably with enough technical knowledge) that want to be a 100% AMP-only, this results in sub-optimal UX, for example in Site Kit:

To avoid the need for the above, it should be possible to indicate somehow that the site should be 100% AMP, so that other plugins can act accordingly with their integrations - essentially some sort of "strict" Standard Mode. I see this might be more of an edge-case, so maybe this could even be a configuration only controllable via filter.

In such a strict mode, I would envision no opt-out UI being displayed anywhere, and any non-AMP compatible URLs continuing with validation errors until the user resolves them.

cc @westonruter


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@felixarntz felixarntz added the Enhancement New feature or improvement of an existing one label Jun 28, 2021
@felixarntz felixarntz changed the title Allow a site to "force" AMP Allow a site to express the need to be 100% AMP Jun 28, 2021
@westonruter
Copy link
Member

See also prior discussion in google/site-kit-wp#2998 (comment):

@westonruter Given the above, it would be great to somehow indicate to the AMP plugin that you really only want AMP, everywhere. Almost like "strict mode". That may be a good enhancement, potentially just as a simple filter initially which would prevent any opt-outs, as it would give certain guarantees which would result in better UX for cases like ours here.

Yeah, it's something we've thought about. We had an issue for it: #2314. But we decided against it. The reality is that the majority of sites need the ability for AMP to be turned off in certain cases. Given that the AMP-compatible ecosystem of themes and plugins are not complete, the number of sites that run in Standard mode is still small in relation to sites in a paired mode (Reader/Transitional). And then among the Standard mode sites, there is a need to often turn off AMP for individual posts/pages (e.g. shopping cart), or to only have AMP enabled for certain templates (singular). So even if we added the ability for a site to only ever serve AMP pages no matter what without any ability to turn it off, the number would likely be very small who would access this streamlined analytics screen in Site Kit. It's not a scenario that is yet common enough to worry about, IMO.

See also #1864 and #2724 (comment).

We'll likely be revisiting this with Bento because a site would be able to serve all pages using AMP/Bento components without the need to disable AMP selectively for certain templates. When the least-restrictive sandboxing enforcement enabled (L1, #5549 (comment)) custom scripts would not be sanitized from AMP pages. So if you have custom JS on your shopping cart page, it could remain and live alongside Bento components on the same page (e.g. amp-analytics).

L2 sandboxing means only Bento components are allowed, and L3 sandboxing means only “AMP-certified” components are allowed.

So instead of there being a option to opt-out of AMP for a template, it's likely that what this instead could look like is to opt-out of L3 enforcement. This would likely be a power user feature and may not even be relevant to show in the UI.

The intention is that if a user has selected L1 sandboxing, but a page has no markup that would make it violate L3 sandboxing, that we'd automatically upgrade that page to be marked as a valid AMP page. The L1 sandboxing thus would break no pages out of the box. If you want to be more strict, then you'd select L2 or L3 for your site. Only in this latter more-technical case, would you potentially need to opt-out of sanitization on a per-post basis.

In any case, if amp-analytics were made available as a Bento component, then it could be used exclusively in Site Kit because it would work on AMP and non-AMP pages alike. But I don't believe amp-analytics is going to be made available to Bento soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bento Enhancement New feature or improvement of an existing one
Projects
None yet
Development

No branches or pull requests

2 participants