Skip to content
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

Image_Functions_Usage_Check: Would warn about any direct output of img tags in PHP code and templates #468

Closed
adamsilverstein opened this issue Jun 5, 2024 · 2 comments
Labels
[Team] Performance Issues owned by Performance Team [Type] Check Proposal A new check proposal

Comments

@adamsilverstein
Copy link
Member

As suggested by @felixarntz in #443, those should use wp_get_attachment_image() etc. instead, which comes with performance benefits. The exception is img tags which aren't for attachments. For such manual img tags, the check could trigger a warning if the wp_get_loading_optimization_attributes() is not used as part of generating the output.

We could probably use the same/opposite approach as core does to to find images without the core image class (in a runtime check)

@adamsilverstein adamsilverstein changed the title Image_Functions_Usage_Check: Would warn about any direct output of img tags in PHP code and templates Image_Functions_Usage_Check: Would warn about any direct output of img tags in PHP code and templates Jun 5, 2024
@swissspidy swissspidy added [Type] Check Proposal A new check proposal [Team] Performance Issues owned by Performance Team labels Jun 6, 2024
@swissspidy
Copy link
Member

Looks like there is #26 for this already

@swissspidy swissspidy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
@adamsilverstein
Copy link
Member Author

Looks like there is #26 for this already

oh, I missed that - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Team] Performance Issues owned by Performance Team [Type] Check Proposal A new check proposal
Projects
None yet
Development

No branches or pull requests

2 participants