Skip to content

Inline scripts/styles should have sources identified and core script/style dependencies should get enqueueing theme/plugin as source #4134

@westonruter

Description

@westonruter

Feature description

Related: #4133

If a theme enqueues a navigation.js that has jQuery as a dependency, currently this appears in the validated URL screen as “wp-includes” as the source. This is not very helpful. It would be helpful that if a theme or plugin enqueues a script or a style, that the original theme/plugin that enqueued it would be attributed as a source in some way. As an example, consider this demo plugin.

All of the scripts here should get “Enqueue assets with core dependencies” as the source, at least indirectly:

image

And for the stylesheets, the same goes for the circled stylesheets:

image

I believe that Origination already provides support here for this, so this should perhaps be deferred to the incorporation of that library.

Also: For each script/stylesheet, the asset which caused the dependency to be printed should be listed.

Additionally, inline styles added via wp_add_inline_style() do not get their source attributed.

Inline Scripts

Scripts added via wp_localize_script() and wp_add_inline_script() should all get properly identified. For this, see another example plugin.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions