Introduce AVIF header health check#1612
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Great idea! Definitely re-using this for https://github.com/swissspidy/media-experiments to check the content type of WASM files. |
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
| */ | ||
| function avif_headers_check_avif_headers_test(): array { | ||
| $result = array( | ||
| 'label' => __( 'Your site sends AVIF image headers', 'performance-lab' ), |
There was a problem hiding this comment.
I can't remember the specifics of escaping fields like this.
There was a problem hiding this comment.
I will match other instances
There was a problem hiding this comment.
Escaping for labels is only included in plugins/performance-lab/tests/data/class-site-health-mock-responses.php, maybe we should remove it there.
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks for the PR. Left some feedbacks.
Does it possible that Site health shows Your site does not support AVIF as failed but Your site sends AVIF image headers return headers 🤔
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
…er.php Co-authored-by: Weston Ruter <[email protected]>
…er.php Co-authored-by: Weston Ruter <[email protected]>
…er.php Co-authored-by: Weston Ruter <[email protected]>
…er.php Co-authored-by: Mukesh Panchal <[email protected]>
@mukeshpanchal27 yes, it is possible - AVIF server support and AVIF file header support are two very separate things. |
Begs the question: is it worth adding this health check if the server doesn't support AVIF files anyway? |
That's my next question. Thanks @swissspidy for asking. |
I thought about that and I'd say yes - one reason is you could potentially migrate a site with AVIF images to a new server where they still need to get served. Also, AVIF files could be included in the theme even if not supported by the server for uploads, eg as part of a template. |
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
…er.php Co-authored-by: Weston Ruter <[email protected]>
plugins/performance-lab/includes/site-health/avif-headers/helper.php
Outdated
Show resolved
Hide resolved
…er.php Co-authored-by: Weston Ruter <[email protected]>
Summary
Add a health check to verify that AVIF images are served correctly.
Fixes #1263
Relevant technical choices
Currently this offers miinimal suggestions for how to fix the issue.