2.0.2
版本发布时间: 2020-09-18 10:44:11
ampproject/amp-wp最新发布版本:2.5.4(2024-07-16 02:45:13)
This release follows up on 2.0.0 and 2.0.1, fixing a few issues reported in that release as well as making a few other enhancements.
For the full list of issues and pull requests in this release, please see the 2.0.2 milestone, with 9 closed issues and 20 merged pull requests. See full diff of changes.
Changelog
Developers
- Identify the theme or plugin responsible for calling
amp_is_request()
(is_amp_endpoint()
) oramp_is_available()
prematurely when the_doing_it_wrong()
usage notice is raised. Also identify the theme/plugin that is responsible for causing a fatal error during post-processing to display on the resulting error page. https://github.com/ampproject/amp-wp/issues/4602, https://github.com/ampproject/amp-wp/pull/5289 - Ensure
amp_is_available()
returns false when accessing Database Repair screen. https://github.com/ampproject/amp-wp/pull/5362 - Ensure the GitHub link to the source is formed correctly in generated documentation. https://github.com/ampproject/amp-wp/pull/5359
- Remove instances of
@return
annotation in hook documentation. https://github.com/ampproject/amp-wp/pull/5344
Performance
- Cache error index counts and URL count in “At a Glance” dashboard widget, eliminating the need to run additional SQL queries with each admin page load. https://github.com/ampproject/amp-wp/issues/5271, https://github.com/ampproject/amp-wp/pull/5343
- Only
add_admin_menu_new_invalid_url_count
when post type isshow_in_menu
. https://github.com/ampproject/amp-wp/pull/5336
Sanitization & Validation
- Gracefully handle sanitization of validation errors caused by use of
i-amphtml-*
in CSS selectors orclass
attributes. Instead of removing the entirestyle[amp-custom]
or the entireclass
attribute, now just the invalid CSS selector or class name will be removed. https://github.com/ampproject/amp-wp/issues/771, https://github.com/ampproject/amp-wp/pull/5356 - Update AMP validator spec to 2008290323001 and improve
i-amphtml-*
sanitization. https://github.com/ampproject/amp-wp/pull/5356 - Validate and sanitize image candidates in
srcset
attributes. This prevents the sanitizer from leaking an error: “Multiple image candidates with the same width or pixel density found in attribute ‘srcset’ in tag ‘amp-img’.” https://github.com/ampproject/amp-wp/issues/5358, https://github.com/ampproject/amp-wp/pull/5366 - Gather required script components even for kept invalid markup. https://github.com/ampproject/amp-wp/pull/5388
- Prevent fatal error during post-processing from being masked by a notice. Call
error_get_last()
prior to calling sanitizers. https://github.com/ampproject/amp-wp/pull/5375 - Fix parsing of
turn
unit in CSS. https://github.com/ampproject/amp-wp/issues/4604, https://github.com/ampproject/amp-wp/pull/5392 - Update button text used in the locked post dialog when editing a validated URL post. https://github.com/ampproject/amp-wp/pull/5354
Settings Screen & Onboarding Wizard
- Avoid showing blank settings drawer for Plugin Suppression when no other suppressible plugins are active. Show message instead. https://github.com/ampproject/amp-wp/issues/5310, https://github.com/ampproject/amp-wp/pull/5349
- Fix ability to complete onboarding when Twenty Twenty is chosen as Reader Mode on a Twenty Twenty site. Override Reader mode selection and re-set page index before reaching done screen. https://github.com/ampproject/amp-wp/issues/5351, https://github.com/ampproject/amp-wp/pull/5361
- Harden presentation of available Reader themes. Ensure
get_default_reader_themes
returns an array and sets the array as a class attribute, and handle failedthemes_api
in UI. https://github.com/ampproject/amp-wp/issues/5367, https://github.com/ampproject/amp-wp/pull/5368
Reader Mode
- Prevent showing Gutenberg's new Widget Blocks section in Customizer for a Reader theme, since widgets in general are not currently supported in Reader mode. https://github.com/ampproject/amp-wp/issues/5322, https://github.com/ampproject/amp-wp/pull/5338
- Ensure robots meta tag is added to AMP legacy template when search engines are discouraged. https://github.com/ampproject/amp-wp/pull/5339
- Fix displaying relative publish date/time in legacy AMP post template when timezine is not UTC. Ensure
post_publish_timestamp
inAMP_Post_Template
is UTC forhuman_time_diff()
. https://github.com/ampproject/amp-wp/pull/5335
Testing
- Allow test in Test_AMP_Core_Block_Handler to run now that WordPress/gutenberg#25026 has been merged. https://github.com/ampproject/amp-wp/pull/5347
- Fix
test_add_block_source_comments
withlatest_posts
dataset when Gutenberg installed from source. https://github.com/ampproject/amp-wp/pull/5346
Props
Thanks to the many contributors who made this release possible through work on development, design, testing, project management, and more:
Alain Schlesser (schlessera), Alberto Medina (amedina), James Osborne (jamesozzie), John Watkins (johnwatkins0), Joshua Wold (jwold), Kasper Myram (kmyram), Pascal Birchler (swissspidy), Pierre Gordon (pierlon), Renee Johnson (ernee), 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.0.2-built.
1、 amp.zip 1.52MB