ilab-media-tools
ilab-media-tools copied to clipboard
Enabling Imgix causes Yoast sitemap archives to WSOD if any post contains a featured image
Describe the bug Yoast generates an XML Sitemap for all Custom Post Types on a site. These can be seen by visiting the /sitemap-index.xml, which lists all the Custom Post Types of the site and provides an XML Sitemap for each Post type (e.g /post-sitemap.xml and /page-sitemap.xml and /your-cpt-sitemap.xml.
If you meet all of the following criteria, your post-sitemap.xml or page-sitemap.xml will not work and you will see a White-screen-of-death (WSOD) instead of an XML list of links.
- Activate Media Cloud (hereby 'MC')
- Activate Imgix
- Add an featured image to a Post.
Disabling MC, or disabling the Imgix setting, or removing all images from all posts will prevents the WSOD from occuring when you visit the relevant sitemap page.
E.g: All posts must have no featured images for the sitemap to not WSOD. If one post has an image, the post-sitemap.xml page will WSOD.
This affects all CPTs.
Impact: Quite high. Loss of site crawlability for search engines. Loss in traffic. SEO audit warnings.
To Reproduce Steps to reproduce the behavior:
- Install Yoast SEO (I've tested 18.8 and 18.9)
- Install Media Cloud Premium 4.4.0 or 4.3.11 (I've not tested earlier versions).
- Ensure Imgix is enabled and is fully configured.
- Ensure MC Crop Tool is enabled (required by enabling Imgix)
- Ensure you have created some posts and/or pages and you have added an featured image.
- Now visit and view all sitemap archives shown in /sitemap_index.xml.
Expected behavior I should be able to visit all all Yoast SEO sitemap archives, and receive no WSOD.
Actual behavior I visit /post-sitemap.xml (and some, but not all, sitemap URLs) and receive a WSOD.
Errors Shown? No PHP errors/warning/notices are shown.
Server (please complete the following information)
- WP 5.9.3
- Ubuntu 20.04
- PHP 7.4
- Nginx
- PHP-FPM Enabled
- System Cron
How did you install the plugin? Plugin installed manually. The issue is the same on 3 environments (dev/staging/production), each on completely different servers of the same spec.
Attempts to fix: (none worked)
- Tried latest 2 versions of Yoast
- Tried latest 2 versions of MC.
- Disabled all other plugins (except Yoast as this generatest the sitemap)
- Enabled Imgix and toggled all Imgix settings one-by-one to see if there is one specific setting that causes it (nope)
- Tested on 3 separate environments
- Tested on TwentyTwentyOne theme
- Tested on our custom theme
- Flushed Permalinks
- Added a new CPT 'test'. Then visited /test-sitemap.xml (success). Then added an image to a test CPT post and re-visited test-sitemap.xml (WSOD).
Area to investigate It seems that the Imgix is breaking sitemap archives if any of the posts contain an featured image. I've not tested if adding an image inside the_content or post meta causes any issue, but this will need testing once a fix is provided..
Just updated the original post with new information after discovering that adding a featured image to any post is what causes the entire Yoast-generated Sitemap for the sitemap archive page to WSOD. @jawngee this issue is now very clear. Could you kindly please release a fix?
This is an issue for yoast. They don't escape ampersands in XML. There's literally nothing I can do about it, you should bring this up with them.
Not valid XML:
You might want to crank down error reporting levels if this is WSOD your site though.