Avif server test notice incorrect
-
First off, thanks for the great plug-in.
I’m running Shortpixel with the options set to create AVIF versions and using .htaccess to deliver them on the front-end. nginx on my server is configured to proxy requests to Apache, so the automatically added rules do work for visitors. The result by checking in Chrome Devtools is that the images are delivered with the content-type image/avif (so far so good!).
But in the WP admin I get the notice “Avif server test failed. Necessary content-type header for AVIF files wasn’t found”. So everything works, but I keep getting this notice telling me something is wrong.
Testing around I found that the get_headers PHP function for the test file (res/img/test.avif) isn’t returning the correct headers. I’m not completely sure, but I get the impression get_headers gets its information from the wrong environment. Using cURL for example I do get the correct content-type that the user gets to see in the end.
So my suggestion is to use something other than get_headers (like cURL), for a better AVIF support check.
- The topic ‘Avif server test notice incorrect’ is closed to new replies.