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

Site Scan & AMP: Include toolbar scripts for Site Scan have data-ampdevmode on AMP requests #17034

Merged

Conversation

westonruter
Copy link
Contributor

@westonruter westonruter commented Aug 31, 2020

Since the Site Scan feature launched, I've very frequently seen the AMP menu item in the admin bar show validation errors:

image

The validation errors are coming from Jetpack:

image

Specifically they are coming from the Site Scan feature:

jetpack-site-scan-validation-errors cropped

The issue can be fixed simply be flagging the scripts as being part of AMP Dev Mode.

This can be done for the jetpack-scan-show-notice script simply by making it dependent on the admin-bar script, which is itself already part of AMP Dev Mode by default. The only thing left is to ensure that the inline script (added via wp_localize_script()) to also be flagged for AMP Dev Mode via the amp_dev_mode_element_xpaths filter, which itself may be unnecessary after ampproject/amp-wp#4598.

Changes proposed in this Pull Request:

  • Add data-ampdevmode attributes to printed scripts for Site Scan toolbar.

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  1. Ensure Site Scan is active and enqueuing scripts on the frontend.
  2. Enable Standard mode in the AMP plugin.
  3. See validation errors caused by Jetpack.

Proposed changelog entry for your changes:

  • Fix AMP compatibility for Site Scan module.

@jetpackbot
Copy link

jetpackbot commented Aug 31, 2020

Warnings
⚠️

The PR is missing at least one [Status] label. Suggestions: [Status] In Progress, [Status] Needs Review

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17034

Generated by 🚫 dangerJS against 2b37c41

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended AMP [Feature] Backup & Scan labels Sep 1, 2020
@jeherve jeherve requested a review from a team September 1, 2020 10:19
@jeherve jeherve added [Pri] Normal [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Sep 1, 2020
@jeherve jeherve added this to the 9.0 milestone Sep 2, 2020
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Sep 2, 2020
Copy link
Contributor

@rcanepa rcanepa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the product perspective, everything works fine.

@jeherve jeherve merged commit 32e088d into Automattic:master Sep 2, 2020
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Sep 2, 2020
davidlonjon added a commit that referenced this pull request Sep 4, 2020
* master:
  External Media: Handle space errors on upload (#17014)
  Autoloader: Support unoptimized PSR-4 (#16819)
  Donations / Payments: Use getSiteFragment for building Calypso links (#17042)
  Site Scan & AMP: Include toolbar scripts for Site Scan have data-ampdevmode on AMP requests (#17034)
  Update optin comment to correct default value of true. (#17048)
  Plugins: avoid including network-activated plugins in responses (#17044)
  Instant Search: Fix photon integration (#17037)
pereirinha pushed a commit that referenced this pull request Sep 10, 2020
jeherve added a commit that referenced this pull request Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMP [Feature] Backup & Scan [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants