-
Notifications
You must be signed in to change notification settings - Fork 54
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
Create Image_Functions_Usage_Check #26
Comments
This should be trivial to implement by following the |
From #443:
For the last part about |
Description
Checks and warns against the usage of image HTML in templates. Developers are encouraged to use image functions such as wp_get_attachment_image that generate image HTML in templates. The HTML output by these functions is often better as it generates the tag with more performant attributes such as srcset and sizes. No existing sniff exists but the existing WordPress.WP.EnqueuedResources sniff in the WordPress Coding Standards can be used as a starting point.
Acceptance Criteria
Image_Functions_Usage_Check
should be created and exists atincludes/Checker/Checks
Image_Functions_Usage_Check
should extend thePHPCodesniffer_Check
abstract class which extendsCheck
interface$violation
code should bewarning
run
should be implemented from thePHPCodesniffer_Check
abstract class if neededCheck_Result $check_result
should be used from therun
method parameter to append the results$_SERVER['argv']
arguments should be passed to parentrun
method to provide PHPCS information aboutstandard
,report
andsniff
Tests Coverage
Image_Functions_Usage_Check
class expected to extendPHPCodesniffer_Check
abstract classImage_Functions_Usage_Check
class expected to be instance of thePHPCodesniffer_Check
classrun
method expected to append results of check into$check_result
The text was updated successfully, but these errors were encountered: