ampproject / amp-wp

Enable AMP on your WordPress site, the WordPress way.
https://wordpress.org/plugins/amp/
GNU General Public License v2.0
1.79k stars 383 forks source link

Unicode quotations typo bug on feat-img throwing AMP error - Google de-indexing AMP pages #559

Closed KringleClaus closed 7 years ago

KringleClaus commented 7 years ago

Google Search Console is throwing an error message "Invalid layout property found in AMP tag".

The exact error message is: >The attribute 'width' in tag 'amp-img' is set to the invalid value '”2299”'<

The error relates to the feat-img tag.

In closely reviewing the GSC error message and the source code for a sample AMP webpage, I noticed that the quotation marks around the 2299 are "curly" or unicode marks and that they are both right-hand side (or "closing") marks. (Unfortunately the curly marks do not seem to be showing up in the text here).

I checked all 252 quotation marks on the sample AMP blog posting and found 12 occurrences of the "curly" or unicode marks, all in the <amp-img id=”feat-img” code:

<amp-img id=”feat-img” src=”http://emailsanta.com/santa-claus-xmas-blog/santa-claus-xmas-blog/wp-content/uploads/emailSanta.com-Santa_Clausreindeersleigh-Christmas-Eve.png” srcset=”http://emailsanta.com/santa-claus-xmas-blog/santa-claus-xmas-blog/wp-content/uploads/emailSanta.com-Santa_Clausreindeersleigh-Christmas-Eve.png 2299w, http://emailsanta.com/santa-claus-xmas-blog/santa-claus-xmas-blog/wp-content/uploads/emailSanta.com-Santa_Clausreindeersleigh-Christmas-Eve-300x150.png 300w, http://emailsanta.com/santa-claus-xmas-blog/santa-claus-xmas-blog/wp-content/uploads/emailSanta.com-Santa_Clausreindeersleigh-Christmas-Eve-768x384.png 768w, http://emailsanta.com/santa-claus-xmas-blog/santa-claus-xmas-blog/wp-content/uploads/emailSanta.com-Santa_Clausreindeersleigh-Christmas-Eve-1024x512.png 1024w” alt=”emailsanta-com-santa_clausreindeersleigh-christmas-eve” width=”2299” height=”1149”>

All other AMP tags added by the plug-in are regular double quotes.

Thank you for creating the plug-in and for correcting this minor glitch. The elves will have to bring you something extra nice this Christmas ;-)

"Santa"

KringleClaus commented 7 years ago

I've been digging thru the WordPress core and this AMP plug-in's code to figure out where exactly the unicode/"curly" brackets are being added to the "feat-img" snippet (See original post).

However, I've had no luck.

Any suggestions where to find the files? I'd love to fix it and post the solution here.

BTW, Google has now de-indexed all my AMP pages because of this "curly" quotes bug.

KringleClaus commented 7 years ago

RESOLVED SOLUTION: I re-installed the AMP plug-in.