Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
westonruter opened this issue Sep 20, 2020 · 5 comments · Fixed by #6579
Closed
Assignees
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. CSS Developer Tools Groomed P1 Medium priority WS:Core Work stream for Plugin core
Milestone

Comments

@westonruter
Copy link
Member

westonruter commented Sep 20, 2020

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

@westonruter westonruter added Bug Something isn't working CSS Developer Tools labels Sep 20, 2020
@jwold jwold added the WS:Core Work stream for Plugin core label Sep 29, 2020
@westonruter westonruter added the P1 Medium priority label Oct 27, 2020
@kmyram kmyram added the Groomed label Nov 10, 2020
@westonruter westonruter added this to the v2.2 milestone Feb 11, 2021
@westonruter westonruter changed the title Enqueued block stylesheets show as coming from AMP instead of actual plugin Enqueued block scripts and styles show as coming from AMP instead of actual plugin Jun 18, 2021
@dhaval-parekh dhaval-parekh self-assigned this Aug 10, 2021
@dhaval-parekh
Copy link
Collaborator

dhaval-parekh commented Aug 17, 2021

Currently, the Issue is not able to reproduce with the current version of the Jetpack plugin along with previous versions of it (First scenario). However, the Issue is able to reproduce with the "Bad Block" plugin (second scenario), But in the stylesheet meta, It shows AMP and Bad Block as source plugins.

image

@westonruter @pierlon

@westonruter
Copy link
Member Author

Another issue which may actually be the same as this one: #6231.

@delawski
Copy link
Collaborator

delawski commented Dec 3, 2021

QA In Progress

⚠️ After activating the Bad Block plugin, adding a block to a post and revalidating the post, the Sources contains both Bad Block and AMP:

Screenshot 2021-12-03 at 15 04 14

As far as I understand, the Sources should attribute those issues to Bad Block only. Is that correct?

Other notes:

  • I got the same result no matter if Gutenberg was activated or not.
  • The Jetpack Eventbrite Checkout block doesn't cause any AMP validation issues for me so I skipped this test.

@westonruter
Copy link
Member Author

Hummm. I'm not seeing that:

image

@delawski
Copy link
Collaborator

delawski commented Dec 6, 2021

QA Passed

✅ I've downloaded the latest 2.2-alpha production build of the and reinstalled the plugin on my local environment. When I repeated the QA process, the Sources column correctly stated that the "Bad Block" is the only source of the validation errors:

Screenshot 2021-12-06 at 12 50 49

@delawski delawski self-assigned this Dec 6, 2021
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. CSS Developer Tools Groomed P1 Medium priority WS:Core Work stream for Plugin core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants