-
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
Facilitate documents in AMP Dev Mode to be unmarked as AMP pages when site is in Standard mode #5549
Comments
I think I have a problem related to this. Google does not accept our pages as AMP compatible and gives error:
|
@coolov That's right. That's why this issue proposed a filter like |
The better way forward here is what we've been discussing lately in terms of sandbox levels:
|
Also, the levels should also indicate what is the least restrictive sandboxing enforcement. Just because I select L1 this doesn't mean that I will necessarily be invalid AMP. If there is nothing on the page that is invalid AMP, then the page itself would be L3 but other pages on the site may be L1. In the same way for L2: you may have a site that uses uncertified components, but on some pages only certified components are used. For the latter pages, they would be L3. |
QA passed I tested what has been implemented in #6518, but the
Validation errors has not been raised for Plugin used during testing:
|
Feature description
This originally was in discussed in Automattic/jetpack#16901 (review), where AMP Dev Mode was being explored as a way to serve pages managed by the AMP runtime which also include invalid AMP markup which is marked using
data-ampdevmode
. I wrote Automattic/jetpack#16901 (review):Come to think of it, if Dev Mode is enabled and no user is logged in, the behavior could be to just remove the the
amp
attribute by default. We wouldn't even need to introduce a filter. Users who are logged-in would still get the AMP Validator informing them of any validation errors that are leaking out of the sanitizers, but visitors who are not logged-in (e.g. Googlebot) would not see it as an AMP page.So this condition here:
amp-wp/includes/class-amp-theme-support.php
Lines 2059 to 2064 in e99ff09
Would take into account whether
$dom->documentElement->hasAttribute( 'data-ampdevmode )
. If not, those AMP attributes should all be removed rather than being added, for unauthenticated requests. This should probably only apply to to sites in Standard mode.Also discussed in Automattic/newspack-plugin#688.
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
The text was updated successfully, but these errors were encountered: