Hello @egornmore
Thank you for the support topic, can you please add the following code in to your active themes functions.php or in custom plugin
add_filter( 'amp_enable_ssr', '__return_false' );
Once you add the code clear site cache and check your site on AMP validator
Let me know if this works
Hello @milindmore22
Added filter, checked on AMP validator, it says – “Validation Status: PASS”
Screenshot: https://ibb.co/Wc2brVV
@egornmore
ok, I am still seeing some validation errors, can you please confirm that you have not removed the code.
It should say “Validation Status:Pass” once you click validate button after adding code and clearing cache.
Additionally, please confirm that you have not added <i-amphtml-sizer> sizer element manually.
@milindmore22
I’ve done tests on staging domain which is supposed to be almost identical to the live website, as I thought… Now I realised that the live website has validation errors, sorry… I will double-check everything and will get back to you with an update.
-
This reply was modified 4 years, 2 months ago by
egornmore.
@milindmore22
Tested exactly the same menu on staging and live websites, on staging it has no validation errors, and on the live website, it has. Disabling AMP Optimizer server-side rendering did not help. I haven’t added <i-amphtml-sizer> manually, all images in the <amp-mega-menu> are added as <amp-img> e.g. <amp-img src="..." width="32" height="32" alt="Slack" layout="intrinsic"></amp-img>
@egornmore
I will also recommend removing layout attribute from <amp-img>
Example snippet
@milindmore22
Removed layout, still has validation errors. Reinstallation of AMP Plugin with “Delete plugin data at uninstall” ticked, unfortunately did not help as well
-
This reply was modified 4 years, 2 months ago by
egornmore.
-
This reply was modified 4 years, 2 months ago by
egornmore.
@egornmore
Can you please share input HTML code snippet with us? also please share your staging URL if possible
@egornmore
I just tried your code snippet and didn’t encounter any issue with filter enabled
add_filter( 'amp_enable_ssr', '__return_false' );
here is test https://amp-support.rt.gw/nmore-menu-test/?amp=1
@milindmore22
Tried to turn off plugins that are missing on Staging that didn’t work. Could it be a server-side or non AMP CDN issue by any chance?
-
This reply was modified 4 years, 2 months ago by
egornmore.
-
This reply was modified 4 years, 2 months ago by
egornmore.
@egornmore I am not sure about cause of issue
Can you please try adding absolute URL instead of related URL for images and remove the layout attribute
Here is updated code snippet : https://goonlinetools.com/snapshot/code/#ep3a9odp0hef44n44daq7b
@milindmore22
Still validation status failed, but plugin shows 0 errors.
@egornmore
Can you please confirm that you have added code snippet in Active themes functions.php OR in Active Custom Plugin
Additionally, please try adding filter on wp action.
add_action( 'wp', function() {
add_filter( 'amp_enable_ssr', '__return_false' );
} );
PS: Once you add code snippet clear site cache.
@milindmore22
Just tried to add a filter with wp action directly in functions.php – same result. I can confirm that amp_enable_ssr is disabled, some of the images are rendered differently. Does https://validator.amp.dev/ has a cache? Do I need to wait before the test?
P.S. Removed code after the validation tests
-
This reply was modified 4 years, 2 months ago by
egornmore.
-
This reply was modified 4 years, 2 months ago by
egornmore.
-
This reply was modified 4 years, 2 months ago by
egornmore.