Skip to content

Enqueued block scripts and styles show as coming from AMP instead of actual plugin #5411

Closed
@westonruter

Description

@westonruter

Bug Description

In legacy Reader mode, I noticed that when Jetpack is active and I add a block that enqueues a stylesheet, the stylesheet shows as the AMP plugin being the source as opposed to Jetpack:

image

When a Reader theme is selected, it shows Gutenberg as the source:

image

When Gutenberg is deactivated, it shows wp-includes as the source:

image

The same happens for scripts which are enqueued from a block.

When a script is enqueued due by a block, make sure it is attributed as the source. The Bad Block plugin is an example of this, specifically for a script which is registered and enqueued in the render_callback:

image

Interesting, if it is registered beforehand then its attribution is correctly identified.

Expected Behaviour

The plugin responsible for enqueueing a block should be shown as the source.

Steps to reproduce

  1. Activate Jetpack.
  2. Add the Eventbrite block.
  3. Validate the AMP page.
  4. Look at the Stylesheets metabox.

And:

  1. Activate the Bad Block plugin
  2. Add the block to a post
  3. Save and validate
  4. See that the script source is not shown to be bad-block.

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

Assignees

Labels

BugSomething isn't workingCSSChangeloggedWhether the issue/PR has been added to release notes.Developer ToolsGroomedP1Medium priorityWS:CoreWork stream for Plugin core

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions