plugin-check
plugin-check copied to clipboard
Create Enqueued_Resources_Check
trafficstars
Description
Checks that all plugin scripts and styles are enqueued using core functions and not directly output in HTML. This will use the existing WordPress.WP.EnqueuedResources sniff in the WordPress Coding Standards.
Acceptance Criteria
- Class
Enqueued_Resources_Checkshould be created and exists atincludes/Checker/Checks - Class
Enqueued_Resources_Checkshould extend theAbstract_PHP_CodeSniffer_Checkabstract class - Class should implement the public
get_args()and return an associative array of the required PHPCS arguments'sniffs' => 'WordPress.WP.EnqueuedResources''standard' => 'WordPress'
- Add a sample
<link>in thetests/testdata/plugins/test-plugin-with-errors\test-plugin-with-errors.phpfile to include any sample script. Make sure it will come under theWordPress.WP.EnqueuedResourceserror.
Tests Coverage
@felixarntz I have updated AC for this epic, and it is ready for review now. Thanks! 🙂