• Resolved Frank Kalk

    (@fpckalk)


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Thanks, Frank, for your suggestion! I’ll forward it to our team. Hopefully they’ll implement it soon ??

    Plugin Author Pedro

    (@petredobrescu)

    Hello @fpckalk and thanks for opening this thread.

    I must say that your setup is somehow unusual and most probably this is why the get_headers function doesn’t work as expected (which could happen with other plugins too, that rely on this function for various things, such as SEO plugins). The issue with cURL (which BTW I love!) is that it isn’t working by default on all hosts (like the get_headers function does, being a standard PHP function) and this is why we have made the choice to use get_headers (and this is also the reason why we want to stick with it for now).

    With regards to the notification – if you dismiss it and don’t clear your cookies often, it should stay dismissed for a while, hopefully until we’ll manage to figure out a way to also cover your use case ??

    Many thanks for your understanding with this.

    Best,
    Pedro

    I stumbbled into the same error, but notice the response is a 403 -> not allowed
    When the link to the image is opended directly, the avif-logo shows correctly in the browser, hence avif is supported.

    My guess is, that code is not in line with th security rules.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi arno-kools,

    Could you please open a new support thread to keep things organized?

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Avif server test notice incorrect’ is closed to new replies.