WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
195 stars 39 forks source link

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

Closed adamsilverstein closed 3 weeks ago

adamsilverstein commented 3 weeks ago

As suggested by @felixarntz in https://github.com/WordPress/plugin-check/issues/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)

swissspidy commented 3 weeks ago

Looks like there is #26 for this already

adamsilverstein commented 3 weeks ago

Looks like there is #26 for this already

oh, I missed that - thanks!