2.2.0
版本发布时间: 2021-12-16 04:16:27
ampproject/amp-wp最新发布版本:2.5.4(2024-07-16 02:45:13)
For the full list of changes in this release, please see the 2.2 milestone, with 44 closed issues and 116 merged pull requests (minus dependency updates). Read on for the full details.
Changelog
Settings Screen and Onboarding Wizard
- Add Site Scanner to check key templates for AMP compatibility issues with plugins themes. Results inform recommendations for the template mode, plugin suppression, and trying alternative AMP-compatible themes/plugins. Site Scanning is exposed on Settings screen and Onboarding Wizard. (#4719, #6610, #6650, #6740, #6742, #6741, #6791, #6615, #6692, #6683, #6691, #6705, #6760, #6777, #6743, #6698, #6696, #6690, #6689)
- Add Site Review to final step of Onboarding Wizard to allow users to browse around key AMP-enabled URLs to verify it is working as expected. Also add a Review section to the Settings screen. (#6071, #6596)
- Integrate AMP-compatible directory of themes and plugins, highlighting the ecosystem components that are known to work well. (#2313, #6597, #6725, #6726, #6681, #6704, #6723)
- Update Settings page to include "Other" section including user-specific DevTools toggle. (#6501, #5578)
- Reduce size of UI elements on Settings screen. (#5559, #6500)
Bento & Sandboxing
Introduce experimental support for a more flexible AMP via Bento with dynamic levels of sandboxing enforcement. (See Bento introduction post on AMP Blog.) The Sandboxing experiment can be enabled when using the Standard template mode, and you may choose a minimum sandboxing level of loose, moderate, or strict.
- Strict is essentially the plugin's current behavior of removing all invalid AMP markup by default.
-
Moderate means that custom scripts are removed by default (like Strict) and conversions to (Bento) AMP components will be performed, but other invalid AMP like external POST forms will be retained. (To add a custom script to a page and yet remain in Moderate, add the
data-px-verified-tag
attribute to thescript
tag.) - Loose means no invalid AMP markup will be stripped out by default, image/video/iframe/etc conversions will be skipped, and CSS tree shaking is not performed.
The sandboxing levels are dynamic, so if you select Loose but there is no invalid AMP markup on the page, it will automatically upgrade to Strict. (#6443, #6546, #6769, #5549, #6715, #6787, #6788, #6767, #6577, #6757)
- Add opt-in support for custom non-AMP scripts, where keeping a non-AMP script disables CSS tree-shaking and disables various conversions which could break the included scripts. Provide mechanism to prevent
noscript
unwrapping, and disables unwrapping whenever custom non-AMP scripts are kept. (#6030, #6528) - Add support for native
img
. This involves anative_img_used
argument on the image sanitizer which is disabled by default, but it will be enabled by default in the next release (since nativeimg
will be valid AMP). It is enabled when in the loose sandboxing level. (#6518) - Add opt-in to prevent
POST
forms from being converted toamp-form
(withaction-xhr
). This opt-in is enabled when in loose or moderate sandboxing levels. (#6527) - Add Bento opt-in via
amp_bento_enabled
filter. (#6353, #6537) - Introduce Bento sanitizer to handle with
bento
-prefixed components. (#6722) - Propagate width/height styles as width/height attributes when setting layout. (#6662)
- Use intrinsic as default layout for video instead of responsive layout. (#6761)
- Fix height of Video blocks when native
video
is used. (#6762)
Support
Add Support screen that facilitates users to submit site information privately with a submission UUID to reference in a support topic. This eliminates the need for the Google Form we were previously using. (#5939, #6147, #6627, #6604, #6652, #6764, #6707, #6718)
Site Health
- Add Site Health test for page caching (advanced cache) and recommend if not detected. (#4386, #6456)
- Prompt user to flush page cache when changing template mode or reader theme (and page caching is detected). (#4843, #6467)
- Detect available object caching backend(s) to guide users toward persistent object caching plugins. (#5780, #6493)
Embeds
- Persist YouTube URL parameters when converting to
amp-youtube
, including the seek time. (#4518, #6423) - Add overflow buttons to Twitter, Facebook, and Instagram embeds. This is necessary since the Bento components no longer cause layout shifts if they need to resize. (#6502)
- Update
amp-twitter
to usefixed-height
layout with a default height matching minimal tweet height. (#6504, #6510)
CSS
- Provide ability to bypass conversion of inline style attributes and
!important
qualifiers via newtransform_important_qualifiers
argument to style sanitizer. (#6295, #6589) - Prevent completely tree-shaken styles from triggering excessive CSS. (#6624)
- Mark
amp-story-captions
as element containing dynamic content. (#6628) - Fix prioritization of TT1 stylesheet after core theme sanitizer changes. (#6625)
Images
- Avoid fetching image dimensions over HTTP when images are on the filesystem. (#5115, #6448)
- Eliminate static emoji handling since most browsers now support natively. (#6717)
Validation
- Do asynchronous Site Scan upon plugin activation and show results in admin notice on plugins screen. This eliminates plugin activation latency caused by previously doing synchronous validation of just the homepage. (#5101, #6685, #6758)
- Re-validate site URLs used for Site Scanning in weekly scheduled task. (#5750, #6520)
- Add garbage collection for stale and redundant validation data. (#4779, #6763)
- Add validation error source attribution for script translations and
wp_editor()
(#4750, #6670, #6668) - Track assets those registered or enqueued in block's render callback to prevent erroneous attribution. (#6579, #5411, #6231)
- Update amphtml spec to 2111242025000. (#6651, #6697, #6712, #6752)
- Ignore WordPress core as a source when there is a theme/plugin error source in block editor AMP sidebar. Errors emitted by
core/shortcode
will no longer be blamed on WordPress core. (#6667, #6675) - Improve displaying of unreviewed counts for Validated URLs and Validation Errors to reduce the loading flash with each page load. (#6765, #6770)
- Fix selection of Reader theme causing validated URLs to always be stale. (#6779)
- Mark scripts output by
wp_comment_form_unfiltered_html_nonce()
andwp_post_preview_js()
as being in AMP Dev Mode so they are not sanitized; they only appear when logged-in and they are don't negatively impact PX. (#6680)
WP Core Compatibility
- Improve page experience for fonts in core themes with
preload
links andfont-display
. (#6036, #6674) - Fix backwards compatibility with older versions of WP by fixing polyfills, gracefully degrading, and omitting certain features. (#6773, #6775, #6789, #6776, #6782)
- Mark wp-polyfill as an AMP Dev Mode script for Paired Browsing. (#6721)
- Implement WP 5.9 change to remove empty query string when removing endpoint from a URL that contains a URL fragment. (#6727)
- Fix test in WP 5.9-beta1: Cast term IDs to integers instead of using
sanitize_key()
. (#6754)
Uninstallation
Remove plugin-specific data at plugin uninstallation. A new toggle on the settings screen allows uninstall without AMP data removal. (#3210, #6422, #6486, #6632)
Misc
- Eliminate
amphtml
AMP-to-AMP linking attribute from links to fix broken structure data. (#6599, #6661) - Add robots noindexing to PWA service worker install page. (#6669)
- Update amp-toolbox-php from 0.6.0 to to 0.8.3. (#6498, #6551, #6567, #6568, #6657, #6768, #6792)
Infrastructure & Testing
- Ensure services that are delayed and have requirements are scheduled correctly. (#6548, #6529)
- Allow for required GHA job statuses to be reported so that all PR checks have a status. (#6378, #6393)
- Make E2E environment setup more robust; add GHA reporter for E2E and JS unit tests. (#6280)
- Trigger CI jobs when a dependency file is modified. (#6400)
- Add GitHub action to auto-merge Dependabot pull requests and combine Gutenberg dependency updates in a single PR. (#6298, #6302, #6347, #6380, #6401, #6478, #6349, #6379, #6439)
- Change time dependabot creates PRs. (#6482)
- Add CODEOWNERS. (#6296)
- Fix phpstan v0.12.99 static analysis failures. (#6600)
- Update phpstan config for 1.0.0. (#6673)
- Remove empty scripts after webpack compilation. (#6778, #6780)
- Add LGTM code analysis. (#6587, #6608)
- Add CodeQL GHA to find potential security vulnerabilities. (#6591)
- Ensure only a single instance of a workflow using the same concurrency group will run at a time. (#6592)
- Fix and modernize E2E tests. (#6613, #6620, #6747, #6751)
- Update svgo Babel config. (#6562)
- Migrate QA plugin to separate repo. (#6427)
- Convert issue templates into issue forms. (#6543)
Tech Debt
- Fix default arg and actual arg key mismatch in comment sanitizer. (#4624)
- Use class constants instead of classes as string literals. (#6545)
- Remove obsolete
include_layout_in_wp_kses_allowed_html
. (#6572) - Remove obsolete (and unused)
SavePostValidationEvent
. (#6771)
Props
Thanks to the many contributors who made this release possible through work on development, design, testing, project management, and more:
Adam Silverstein (@adamsilverstein), Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Bethany Chobanian Lang (@bethanylang), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin), Fellyph Cintra (@fellyph), Gagan Deep Singh (@gagan0123), James Osborne (@jamesozzie), Joshua Wold (@jwold), Ken Rodrigues (@kenrodriguesdesign), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Paul Clark (@pdclark), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pradeep Sonawane (@pradeep910), Rahul Bansal (@rahul286), Weston Ruter (@westonruter)
Installation
Now available to install via WordPress.org.
You can also install the amp.zip
build linked below by uploading it in the WordPress admin.
To install as a Git submodule, consider 2.2.0-built.
1、 amp.zip 2.7MB