WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.

Home Page:https://wordpress.org/plugins/plugin-check/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

adamsilverstein opened this issue · comments

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)

Looks like there is #26 for this already

Looks like there is #26 for this already

oh, I missed that - thanks!