Create Enqueued_Resources_Check #25
Labels
Checks
Audit/test of the particular part of the plugin
[Team] Performance
Issues owned by Performance Team
[Type] Enhancement
A suggestion for improvement of an existing feature
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
Enqueued_Resources_Check
should be created and exists atincludes/Checker/Checks
Enqueued_Resources_Check
should extend theAbstract_PHP_CodeSniffer_Check
abstract classget_args()
and return an associative array of the required PHPCS arguments'sniffs' => 'WordPress.WP.EnqueuedResources'
'standard' => 'WordPress'
<link>
in thetests/testdata/plugins/test-plugin-with-errors\test-plugin-with-errors.php
file to include any sample script. Make sure it will come under theWordPress.WP.EnqueuedResources
error.Tests Coverage
get_args()
method returns the expected array of PHPCS arguments for the checkrun()
method adds warnings to the$check_result
when checking an invalid file - check reference hererun()
method does not add any warnings to the$check_result
when checking a valid file - check reference hereThe text was updated successfully, but these errors were encountered: