Skip to content

Non_Blocking_Scripts_Check: Warn about enqueued scripts that use neither defer nor async #467

@adamsilverstein

Description

@adamsilverstein

As proposed by @felixarntz in #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.

Metadata

Metadata

Assignees

Labels

ChecksAudit/test of the particular part of the plugin[Team] PerformanceIssues owned by Performance Team[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

Status

Done 😃

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions