I was forced to uninstall the AMP plugin. Thereafter, the problem with error_log disappeared.
I am quite surprised I got no reactions to my post, the problem I experienced is very serious and getting the server disk full made my site unreachable even by the administrators. Only removing some files via ftp and resizing the error log via SSH put it online again.
I was wondering if I was the only one getting such problem. Have anyone else noticed a very large error log caused by AMP? (you can easily check it via ftp in the logs folder).
Bye
I have not had a free moment to go actually check that due to being in midst of PCI-DSS ‘attack scanning’ right now. But I will, as now you have me darn curious about that, since we run multiple sites with AMP.
I’m assuming you have looked at your amp page source to see if there is a broken sitename tag in there ?
I have not had a free moment to go actually check that due to being in midst of PCI-DSS ‘attack scanning’ right now. But I will, as now you have me darn curious about that, since we run multiple sites with AMP.
I’m assuming you have looked at your amp page source to see if there is a broken sitename tag in there ?
Sorry that you ran into these issues.
Two thoughts:
– I’d suggest doing size-based log rotation as well to prevent issues when the log file gets too big.
– The errors are happening when an image included in a post doesn’t have an explicit size available (usually a hotlinked image), in which case we remotely fetch it and attempt to guess it’s size. The errors are being generated from the class we use to do this (although, technically, the lower-level PHP APIs are throwing the errors), most likely because it failed to properly fetch or read the image. It’s possible the resource where the images are hosted is having issues? Or maybe remote connections are blocked on the server? Or maybe there’s a bug in the plugin 🙂
If you want to disable this remote image lookup, you can use the following code:
add_action( 'amp_extract_image_dimensions_callbacks_registered', 'xyz_amp_extract_image_dimensions_disable_remote_lookup' );
function xyz_amp_extract_image_dimensions_disable_remote_lookup() {
remove_filter( 'amp_extract_image_dimensions', array( 'AMP_Image_Dimension_Extractor', 'extract_by_downloading_image' ), 999, 2 );
}
Thank you for the feedback!
@neotrope: I checked and I don’t see broken sitenames.
@mohammad: Yes, this makes much sense to me. Overall., I have over 20,000 images in my posts, thus if each on them throws some errors (actually a warning), the error_log can quickly become really huge. I have no hotlinked images in my site, and image size seems correctly declared (see http://www.inexhibit.com/marker/london-botticelli-reimagined-at-the-va-museum/amp/ for example), I will check for remote connections blocking in my server settings.
Now I have added the code you kindly provided me to my functions.php and re-activated the plugin, I keep on checking if the problem with the log file reappears.
Amp pages seem to work fine, and perfectly validate both in GSC and in Chrome also with the modified code.
I keep you updated.
Thanks
OK, tested long enough to say that all works fine now.
The call for image size was redundant; after removing the filter, all problems disappeared and the error_log no more register errors related to the AMP WordPress plugin; furthermore, all pages correctly validate.
Good job, Mohammad!
Tomorrow I’ll try to produce AMP versions from those more complex custom post types I have (more complex in their PHP template, I mean) that gave me some errors in the past (I’m talking about the prohibited attributes/align issueI know you are already aware of). Yet, I’m quite happy with what you are doing, for being an early-development version, this plugin works great, no matter what who wants a “click-and-go” button says.
Thanks