-
Notifications
You must be signed in to change notification settings - Fork 385
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
Introduce and expose query arguments for debugging AMP content generation #1294
Comments
The |
Question About Working On This Hi @westonruter, It looks like this is assigned to you. Could I work on it? Otherwise, no problem 😄 Thanks, Weston! |
@kienstra Yes, please go for it. |
Thanks, Weston! |
Question about a query arg Hi @westonruter,
Should this exclude only a single sanitizer, like Or would this somehow be different from the other query arg:
Thanks, Weston! |
Excluding all sanitizers would essentially be the same as short-circuiting the entire post-processor. I'm not sure of the value of providing a UI to disable individual sanitizers. I suggest revisiting that later. |
OK, thanks |
|
Yeah, that's a good idea. Excessive CSS errors can be tough on big sites. |
Something else that just came up which would be helpful for debugging: when adding the Countdown block from the Ultimate Blocks plugin, you will get two validation errors due to scripts being enqueued on the page. If you are in Transitional mode, it is easy to see what the expected behavior of the block is sine you can just look at the non-AMP version. If you are in Standard mode, you don't want to have to switch to Transitional. You also don't want to turn off AMP for the post/page in order to check it. The alternative then is to try marking the two validation errors as Rejected so that they scripts don't get sanitized and then click the Preview button. This allows the scripts to be included on the page, but the countdown timer then has broken styling because the styles were removed given that they weren't in the page at serve time. So to help identify that as being an issue, a debug flag would be helpful.
|
@westonruter, sounds good. I'll add those to #3448. |
One-off build to help with debugging support topic: amp.zip (v1.5.0-RC1-20200326T192429Z-d69f536dd) Includes patch: --- a/includes/class-amp-theme-support.php
+++ b/includes/class-amp-theme-support.php
@@ -1889,6 +1889,9 @@ class AMP_Theme_Support {
* @return string Processed Response.
*/
public static function finish_output_buffering( $response ) {
+ if ( isset( $_GET['amp_bypass_post_processing'] ) ) {
+ return '<!-- amp:output_buffered -->' . $response . '<!-- /amp:output_buffered -->';
+ }
self::$is_output_buffering = false;
return self::prepare_response( $response );
} |
…can validate Also add a "View with AMP disabled" link to the admin bar for such users to easily disable AMP for a URL when a site is in Standard mode without requiring them to switch the entire site to Transitional mode or to disable AMP for a given URL. See #1294
There is currently a query that can be added to an AMP URL to facilitate debugging:
amp_preserve_source_comments
: This prevents source comments from being removed when performing anamp_validate
request.This isn't exposed anywhere in the UI to discover, and the developer just has to know it exists. Maybe this is fine, but there should be a Wiki page with debugging information to inform of its use.
Alternatively, when(Update: UI to be addressed in a subsequent issue.)WP_DEBUG
is enabled there could be a link added to the AMP admin bar menu to link to it.But beyond
amp_preserve_source_comments
there is probably other flags that would be useful for debugging:amp_validate
param does this already, but it also has the behavior of adding validation error source comments, so having another param may be helpful.These debug parameters should only be made available when an appropriately-authorized user is authenticated.
The text was updated successfully, but these errors were encountered: