You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which results in Images should be added using wp_get_attachment_image() or similar functions
For many of the WP plugins makers , we add images in the WP admin backoffice. Those images are not uploaded to WP gallery, but rather static files called the good old way with an . There is no way to bypass the regex, which will detect any in the plugin.
It is my understanding you're going to change it a warning, as discussed here #757 but I'm questionning even such a warning. To my understanding, even a warning is not appropriate for plugins makers.
Even if the aim is undertandable, in practice it doesn't make sense to me.
The text was updated successfully, but these errors were encountered:
A static code analysis tool does not know whether an image is used in the WP admin or elsewhere. So the idea behind that was to warn about this to catch cases where another function may be more appropriate. In some places that's not possible, in which case it can be ignored.
What we might be able to do here is enhancing this check to look for things like width, height and only emit a warning if these are missing. Maybe for srcset and sizes too. Curious to hear other thoughts from the performance folks.
Hi there,
I don't understand the point of this new PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage as implemented there:
plugin-check/phpcs-sniffs/PluginCheck/Sniffs/CodeAnalysis/ImageFunctionsSniff.php
which results in
Images should be added using wp_get_attachment_image() or similar functions
For many of the WP plugins makers , we add images in the WP admin backoffice. Those images are not uploaded to WP gallery, but rather static files called the good old way with an . There is no way to bypass the regex, which will detect any in the plugin.
It is my understanding you're going to change it a warning, as discussed here #757 but I'm questionning even such a warning. To my understanding, even a warning is not appropriate for plugins makers.
Even if the aim is undertandable, in practice it doesn't make sense to me.
The text was updated successfully, but these errors were encountered: