I was able to find much of the errors appeared between AMP plugin v1.4.4 and 1.5.2. Trying to track down when this all started, and it’s certainly not completely eliminating the errors, but reverting back to v1.4.4 a lot of issues appear to be resolved (or errors quieted at least)
@joshuadnelson Apologies for the late response. Can you share your site URL and further details on this and we can investigate, I couldn’t locate it in your Site Health?
If you prefer to share privately you can use this form, we can respond here.
Hey James!
This is a local site I’m working on, the production site does not have it implemented yet. The staging site is behind a VPN and would require a bit more work to coordinate on. I could see about getting you access to the github repo and/or a copy of it to spin up locally on your end. I submitted the full site health and such in the form as well.
I’m still getting the errors, but I was able to run a full validation on our content last night (only a few errors in the process, not full stop). I’m not sure if it’s related, but now the staging site isn’t full rendering AMP templates (it appears related to the validation process perhaps, the output is partial AMP/HTML but missing things).
Is there a way to filter/alter/intercept validators easily?
Let me know the best next steps, appreciate the help!
Thanks,
Joshua
@joshuadnelson Do you have Xdebug enabled? That may be the cause for the PHP timeout.
I’m also noticing you’re using glue-for-yoast-seo-amp. This plugin shouldn’t be necessary anymore, as Yoast itself is fully AMP-compatible.
For the cURL issue, in Site Health do you see any failures in regards to loopback requests?
Also, in 1.5 we introduced the AMP Optimizer which does use cURL to fetch some assets to inline some CSS.
You can try disabling the Optimizer to see if that eliminates the problem as a way to narrow down what the problem is:
add_filter( 'amp_enable_optimizer', '__return_false', 100 );
Or to just try disabling the SSR aspect of the Optimizer:
add_filter( 'amp_enable_ssr', '__return_false', 100 );
Please check to see if one or both of those resolve the issues.
Hey there,
Getting back to this, no luck on resolving issues via those filters. Disabling xdebug didn’t have any impact locally, though I will keep it disabled just in case.
My local wp-cli validation returns the same cURL errors, like the one below, but is slowly validating pages.
Warning: Validate URL error (http_request_failed): cURL error 28: Operation timed out after 15000 milliseconds with 0 bytes received URL
The staging site is not full rendering AMP content – it looks like a mixture of AMP and non-amp content, the amp.state functionality doesn’t work and none of the images are showing up. This doesn’t happen on my local site, though. Locally I’m running MAMP/Apache, staging is using nginx. Locally I do have some SVG and one specific image in the footer that are getting stripped out but not showing up in validation/error index.
It looks like it’s related to something in the sanitizer and output buffering, here’s an error I found in the debug.log (full stack trace output here):
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php on line 1015
PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0
Any ideas? I’m guessing that some process related to the AMP version is timing out, but I can’t track it down. Per the errors above (which also appear in the apache error log), it looks like something in AMP_Tag_And_Attribute_Sanitizer.
Appreciate the help!
Thanks,
Joshua
It shouldn’t be taking so long for the AMP plugin to process the page.
One possible way to identify what is causing the slowness is to enable this helper plugin which turns on Server-Timing response headers: https://gist.github.com/westonruter/053f8f47c21df51f1a081fc41b47f547
This can give an indication into what sanitizers are taking so long.
Otherwise, the next step to debug this would be to dig into the code and add breakpoints/logging during the post-processing phase to isolate what the issue is.
Thanks for the assistance! I had to put this project on hold for some time, but I think I’ve got it working. I’ll be back at in next month and, if needed, I’ll reach out again.