-
Notifications
You must be signed in to change notification settings - Fork 110
Introduce AVIF header health check #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember the specifics of escaping fields like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will match other instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escaping for labels is only included in plugins/performance-lab/tests/data/class-site-health-mock-responses.php
, maybe we should remove it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.