Skip to content

Conversation

@adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Oct 21, 2024

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.

@github-actions
Copy link

github-actions bot commented Oct 21, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <[email protected]>
Co-authored-by: westonruter <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: swissspidy <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein adamsilverstein added [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature labels Oct 21, 2024
@swissspidy
Copy link
Member

Great idea! Definitely re-using this for https://github.com/swissspidy/media-experiments to check the content type of WASM files.

@swissspidy swissspidy added this to the performance-lab n.e.x.t milestone Oct 21, 2024
*/
function avif_headers_check_avif_headers_test(): array {
$result = array(
'label' => __( 'Your site sends AVIF image headers', 'performance-lab' ),
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a 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 🤔

@adamsilverstein
Copy link
Member Author

Does it possible that Site health shows Your site does not support AVIF as failed but Your site sends AVIF image headers return headers 🤔

@mukeshpanchal27 yes, it is possible - AVIF server support and AVIF file header support are two very separate things.

@swissspidy
Copy link
Member

Does it possible that Site health shows Your site does not support AVIF as failed but Your site sends AVIF image headers return headers 🤔

@mukeshpanchal27Image 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?

@mukeshpanchal27
Copy link
Member

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.

@adamsilverstein
Copy link
Member Author

Begs the question: is it worth adding this health check if the server doesn't support AVIF files anyway?

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.

@mukeshpanchal27 mukeshpanchal27 merged commit 692a9c5 into WordPress:trunk Oct 28, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Site Health: detect web server AVIF mime type support

4 participants