Open adamsilverstein opened 3 weeks ago
We can probably use Enqueued_Scripts_Size_Check
as a base and then simply check $script->extra['strategy']
of all the enqueued scripts.
Related:
We might want to have an abstract class for shared logic to reduce repetition.
As proposed by @felixarntz in https://github.com/WordPress/plugin-check/issues/443, this check would help encourage user to switch to non blocking enqueues.
Potentially we could also accept a blocking script as long as it's
$in_footer
. But it would definitely warn about a blocking in head script.@swissspidy pointed out that The corresponding PHPCS sniff does not yet support the new $args param we added in 6.3. It was also indicated that the sniff might actually be removed because it's harder to detect. So probably needs to be a runtime check.