Skip to content

Releases: ampproject/amp-wp

2.1 Release Candidate 2

05 May 05:51
56349d5
Compare
Choose a tag to compare
Pre-release

This is the second release candidate for v2.1, after the first beta, second beta, and first release candidate. For the full list of changes coming in this release, see the previous prerelease changelogs, as well as the exhaustive list in the 2.1 milestone. The 2.1.0 final release is due on May 6th.

On top of the changes in the previous prereleases, this prerelease includes 1 closed issue and 4 merged pull requests. Please report any issues you encounter while testing!

The changes included are minor:

Installation

You can also install the amp.zip build linked below by uploading it in the WordPress admin.

For up-to-the-minute builds, see the Development Builds Wiki page.

2.1 Release Candidate 1

29 Apr 06:01
c2248ca
Compare
Choose a tag to compare
Pre-release

This is the first release candidate for v2.1, after the first beta and second beta. For the full list of changes coming in this release, see the previous prerelease changelogs, as well as the exhaustive list in the 2.1 milestone. We were originally going to release 2.1 on the WordPress plugin directory by the end of April, but due to a couple bugs discovered during QA for the release candidate, 2.1 will be released the first week of May.

On top of the changes in the first and second betas, this prerelease includes 10 closed issues and 20 merged pull requests (excluding Dependabot updates). Please report any issues you encounter while testing!

The key changes since the second beta include:

  • Visual refresh of validation screens. The way to represent “unreviewed” validation errors has changed. Instead of being styled like unmoderated comments with an orange background, they now appear with bolded text and a white background. In contrast, reviewed errors get a gray background and unbolded text. In this way, they are styled similarly to unread/read messages in an email client. When the invalid markup causing a validation error is kept, then the error gets a red left border. This new design language is carried throughout all the validation screens as well as the new AMP Validation sidebar in the block editor. #5995, #6067
  • Editor theme support styling from primary theme now applies to Reader templates. If you added blocks that used any colors from the primary theme's palette (defined in the editor-color-palette theme support), these predefined colors would be entirely absent when you viewed an AMP page in Reader mode—both for AMP Legacy templates and Reader themes. Styles were likewise missing for gradient presets (editor-gradient-presets) and font sizes (editor-font-sizes). This has now been fixed. All styles for these theme support features are now dynamically generated in PHP for inclusion on AMP pages. On the AMP Legacy templates, where the primary theme context is present, the theme support features are pulled straight from get_theme_support(). When a Reader theme is active, however, the primary active theme's support features are not registered in memory; in this case, the active theme's support features are stored in an option so that they can then be available when the plugin switches to another theme for serving AMP pages in Reader mode. #5229, #6042
  • Support for PDF embeds in File block. In Gutenberg 10.5, the File block now supports embedding PDFs (see WordPress/gutenberg#30857). When such a File block appears on an AMP page, its object[type=application/pdf] element will be automatically converted into an amp-google-document-embed element. #6083, #6112
  • Optimization of amp-bind. A new transformer has been added to the Optimizer which improves performance of amp-bind by making it faster to locate the elements that have bound attributes when server-side rendering is enabled (as it is by default). #6117, ampproject/amp-toolbox-php#84, ampproject/amp-toolbox-php#162
  • Improved support for late-defined AMP slugs. If you happen to change the AMP slug (query var) from the default amp to something else like lite, you can do so either via the amp_query_var filter or via the (deprecated) AMP_QUERY_VAR constant. In early versions of the AMP plugin, this customization was commonly done in the theme. However, this happens much too late for the AMP plugin to be able to switch to a Reader theme or now to properly route paired AMP requests. Instead of limiting the user to the AMP Legacy theme and the ?amp=1 paired URL structure, when the query var is defined late it is now cached in an option so that it can be made available early in WordPress's execution (at plugins_loaded). Since such late-defined slugs are still not ideal, a new Site Health check will recommend that you move it from the theme to a plugin. #6125

The amp-toolbox-php package was updated to include changes from the 0.5.0 milestone.

Also merged since the second beta is the a new QA Tester Plugin which can be installed to greatly facilitate switching between prereleases and builds for unmerged pull requests.

Installation

You can also install the amp.zip build linked below by uploading it in the WordPress admin.

For up-to-the-minute builds, see the Development Builds Wiki page.

2.1 Beta 2

15 Apr 06:39
1e7ea02
Compare
Choose a tag to compare
2.1 Beta 2 Pre-release
Pre-release

This is the second beta prerelease for v2.1, after the first beta a few weeks ago. For the full list of changes coming in this release, please see the 2.1 milestone.

On top of the changes in the first beta, this prerelease includes 8 closed issues and 12 merged pull requests (excluding dependency updates). Please report any issues you encounter while testing! The 2.1 stable release is due out this month (April).

The key changes since the first beta include:

  • Improve hero image determination. The first beta included a DetermineHeroImages transformer which automatically identified the custom logo, header image, featured image, and content-initial cover/image blocks. However, it was only enabled by default for core themes since there were known cases where it failed to properly identify hero images, erroneously causing some images outside of the initial viewport to be prerendered. These issues have been fixed and the transformer is now enabled by default. A new HeroCandidateFiltering service uses filters to inject the data-hero-candidate attribute into the custom logo and custom header images as well as in the attachment image which is the featured image for the first post in the main query. If these filters missed identifying a hero image candidate, then the DetermineHeroImages transformer will mark all non-lazy loaded images which occur before the main element (or the first .entry-content) as hero image candidates. Additionally, when the original img had loading=lazy this is now preserved on the prerendered image which mitigates the risk of accidentally marking an image out of the first viewport as a hero image. Lastly, beyond just considering the content-initial Cover block and Image block, now any image appearing as a descendant of the first content element will be considered as a hero. Note that currently only two images get identified as heroes for prerendering (but see ampproject/amp-toolbox-php#55 (comment)). If you want to have total control over which images are designated as heroes, you can add the data-hero attribute yourself. (#6062, #6061, ampproject/amp-toolbox-php#141, ampproject/amp-toolbox-php#149, ampproject/amp-toolbox-php#144, ampproject/amp-toolbox-php#141, ampproject/amp-toolbox-php#136, ampproject/amp-toolbox-php#135, ampproject/amp-toolbox-php#115)
  • Serve AMP scripts as ES modules to modern browsers. The RewriteAmpUrls optimizer transformer was ported to amp-toolbox-php. This transformer rewrites AMP script tags to use type=module for supporting browsers. These scripts are comprised of ES modules which reduce the overall amount of code since polyfills for older browsers are omitted. Support for older browsers remains by serving the original AMP scripts with nomodule. This transformer also allows opting-in to the LTS versions of AMP scripts (cf. #4600). Additional changes will facilitate script self-hosting in a future release. (#6037, ampproject/amp-toolbox-php#140, ampproject/amp-toolbox-php#130, ampproject/amp-toolbox-php#122)
  • Introduce AMP status panel to document sidebar and pre-publish checks. To improve visibility of AMP validation issues in the block editor when developer tools are enabled, the “Enable AMP” toggle has been moved to a new AMP panel in the document sidebar. This panel now includes the validation status message and a button to take you to the AMP Validation sidebar. This same panel is also now presented in the pre-publish checks. (#5997, #6027, #6022)
  • Add wp amp optimizer WP-CLI command. (Experimental) The AMP Optimizer from amp-toolbox-php is bundled with the AMP plugin and its CLI interface is now accessible via WP-CLI. New commands include wp amp optimizer optimize, wp amp optimizer transformer list, and wp amp optimizer transformer config. See pull request for details. (#6053, #6063, #6064, #6065, ampproject/amp-toolbox-php#150, ampproject/amp-toolbox-php#92, ampproject/amp-toolbox-php#139)
  • Inherit object-fit and object-position styles. In the past when your theme used object-fit/object-position style properties on images and videos they would not show up on AMP pages when the img and video elements were converted into amp-img and amp-video respectively. This required having to add additional AMP-specific styling. This is no longer the case as the img and video elements that AMP creates inside of amp-img and amp-video now have default styling to inherit these style properties. This also applies to the noscript fallback images/videos. Special support for core themes and the Cover block were able to be removed, and cases in other themes/plugins should now more often work out of the box. The overall CSS is also reduced. (#5955, #6028)

The amp-toolbox-php package was updated to include changes from the 0.3.0 and 0.4.0 releases. Again, for all changes see issues and PRs closed since 2.1-beta1.

Installation

You can also install the amp.zip build linked below by uploading it in the WordPress admin.

For up-to-the-minute builds, see the Development Builds Wiki page.

2.1 Beta 1

20 Mar 03:07
4bf1b79
Compare
Choose a tag to compare
2.1 Beta 1 Pre-release
Pre-release

This is the first beta prerelease for v2.1. For the full list of changes coming in this release, please see the 2.1 milestone. This prerelease includes 35 closed issues and 62 merged pull requests (excluding dependency updates). Please report any issues you encounter while testing! The 2.1 stable release is due out in April.

Additional information will come with future prereleases of 2.1, but for now some key highlights in this release for testing include:

  • Customizable Paired URL Structures: One of the most frequent requests we've received over the years is to have more control over the structure of paired AMP URLs. (Remember that paired URLs only apply to Transitional/Reader template modes since Standard template mode is AMP-first in that the canonical URLs themselves are AMP.) Historically, the /amp/ URL endpoint was limited to single post URLs in Reader mode for the legacy post templates, whereas the ?amp query param was used for pages and all URLs in Transitional mode and any AMP page using a Reader theme. These restrictions have been lifted, so now you can use any paired URL structure you like regardless of whether you're in Transitional or Reader mode and irrespective of the template being viewed. By default the ?amp=1 query param is used as the paired URL structure for new installs, but you can also use the /amp/ endpoint suffix for all paired URLs. You can even implement a totally custom structure, such as a subdomain or using a path prefix. See settings UI screenshots on the PR. #2204, #5558, #4312, #5861, #5862, #2062, #3357
  • Redesigned AMP Validation in Block Editor: Checking for validation issues is no longer performed synchronously during post updates, greatly speeding up the save process. When AMP validation errors are reported in the editor, previously they were displayed as inline warning notices with each block which had an AMP validation error. This was obtrusive and it could break the layout of nested blocks. These inline warnings have been eliminated in favor of showing all the validation information in an AMP Validation sidebar in the editor. A block toolbar button indicates when there is an error and provides a shortcut to open the sidebar. The validation errors in the sidebar provide much more information than the inline notices previously did, including the theme/plugin responsible for the error. AMP validation has also been removed from the Classic Editor. #3821, #5589, #5929, #2069, #5741, #5996
  • Hero Image Prerendering: To reduce the Largest Contentful Paint (LCP) metric, the AMP Optimizer now prerenders hero image(s). It will automatically detect the first image in the page to prerender, but you can manually designate which images should be prerendered by adding the data-hero attribute. For core themes there is a transformer which is tuned to automatically identify hero candidates among the header image, custom logo, featured image, initial cover block, and initial image block. This transformer will likely be enabled by default in the future once we've tested with more themes. #5055, #5350, #5824, #5923, #5934
  • Copying Validation Errors to Clipboard: When on the Validated URL screen, you can now copy to the clipboard the full JSON data for a validation error or all validation errors for a URL. This should greatly facilitate getting support. #5209, #5500, #5825, #5835
  • Deprecated/removed rarely-used AMP-specific settings: The block editor included various settings that controlled some low-level details of AMP, including whether an image got the noloading attribute or what AMP layout should be applied for a given block. These were just confusing for users and were not helpful, especially since they didn't apply to the non-AMP version of the page (which will no longer necessarily be the case with Bento AMP). For this reason, those settings as well as fit-text and AMP-specific blocks have been deprecated or removed. These features make more sense in ecosystem plugins; for example instead of an amp-mathml block, users should rather use the AMP-compatible MathML Block plugin. Not all AMP-specific settings have been removed, for example the carousels or lightboxes on galleries, but they'll be revisited at a later date. Users of the editor should not need to know anything about AMP and they needn't see "AMP" mentioned anywhere unless they want those technical details. #4554, #4555, #4556, #5575, #5573, #5574

Again, these are some highlights. Additional bugfixes and enhancements have been made which will be detailed in subsequent changelogs. Some features not listed here include groundwork for site scanning features coming in v2.2.

Installation

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.1.0-beta1-built.

For up-to-the-minute builds, see the Development Builds Wiki page.

2.0.11

09 Mar 16:12
4c52805
Compare
Choose a tag to compare

A couple months after the 2.0.10 release, this 2.0.11 release includes a few fixes, enhancements, and improved compatibility with WordPress 5.7. See milestone with 22 issues/PRs and review full diff. (Please note the larger 2.1 release is coming in a few weeks! Stay tuned for beta/RC pre-releases for testing.)

Changelog

  • Ensure object-fit, object-position, and layout=fill are set on Cover Block's image/video background, ensuring blocks created in WordPress 5.7 get handled correctly; omit playsinline attribute in video sanitizer (since handled by amp-video). #5914, #5927
  • Utilize wp_print_inline_script_tag() to print mobile redirection script so that the wp_inline_script_attributes filter can be used to add additional attributes (to prevent optimization plugins from mutating, for example). #5942, #5945
  • Normalize string and number literals in script text contents for validation errors. This prevents scripts containing nonces, random numbers, and other variable content from continually generating never-before-seen validation errors. #4753, #5836
  • Add support and review links to plugin row meta. #5893, #5924, #5959
  • Use wp_robots() instead of the now-deprecated noindex() in WP 5.7. #5793
  • Prevent possibility of fatal error while invoking MonitorCssTransientCaching::process() during WP Cron. #5838, #5841, #5842
  • Fix test_decorate_shortcode_and_filter_source in WP 5.7-alpha after HTTPS migration commit. #5837
  • Eliminate use of Travis on 2.0 branch in favor of GHA for testing. #5851
  • Harden AMP_Post_Type_Support::get_support_errors() to account for case where invalid post is supplied. #5871
  • Prevent possible PHP Notice from occuring when global $post is null when editing a post. #5958
  • Prevent Close button on Onboarding Wizard from causing re-auth loop when referrer is login page. #5925, #5932
  • Make AMP_DOM_Utils non-internal since useful for devs and already in third party use. #5902
  • Sanitize keys in Server-Timing instead of escaping with slashes. #5941
  • Fix production build for CI on 2.0 branch. #5956

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), Erwin Bantilan (@bantilan), James G (@jamesozzie), Jono Alderson (@jono-alderson), Joshua Wold (@jwold), Kasper Myram (@kmyram), Milind More (@milindmore22), Pierre Gordon (@pierlon), Ryan Smith (@rsmith4321), 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.11-built.

2.0.10

13 Jan 22:19
501d13f
Compare
Choose a tag to compare

Four weeks after the 2.0.9 release, this 2.0.10 release includes a couple fixes and a security hardening. See milestone with 14 issues/PRs, and full diff.

Changelog

  • Close Twenty Twenty and Twenty Twenty-One mobile menus when clicking on in-page anchor link menu items. #5719, #5720
  • Persist URL fragment during client-side mobile redirection and guard against infinite redirect for misconfigured caching plugins. #5767, #5775
  • Fix attempting to echo and escape _ex(). #5730
  • Harden hash comparison by using hash_equals() instead of ===. #5777
  • Fix parsing of docblocks that contain code snippets. #5743, #5748
  • Remove E2E test utils that are now available upstream. #5746, #5754, #5755
  • Update amphtml spec to 68e4db07. #5608, #5703, #5702

Props

Thanks to the many contributors who made this release possible through work on development, design, testing, project management, and more:

Alberto Medina (@amedina), Alain Schlesser (@schlessera), Barry Ceelen (@barryceelen), John Watkins (@johnwatkins0), Kasper Myram (@kmyram), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), @titoabreurj, 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.10-built.

2.0.9

18 Dec 04:07
86dd80c
Compare
Choose a tag to compare

A week after the 2.0.8 release, this 2.0.9 release includes a couple enhancements. See milestone with 8 issues/PRs, and full diff.

Changelog

  • Add amp_featured_image_minimum_width and amp_featured_image_minimum_height PHP filters to allow overriding the default featured image minimum dimensions (1200x675), or to disable the featured image dimension requirements by filtering both to be zero/falsy. #5611, #5647
  • Fix ability to close Twenty Twenty-One mobile menu in some browsers. Replaces amp-lightbox with an amp-bind solution. Also improves button focus persistence and nav menu scrolling. #5692, #5699
  • Catch InvalidService exception when amp_is_available() (and friends) is called before plugins_loaded. #5704
  • Update PWA plugin API calls for v0.6. #5657
  • Add export exclusions to .gitattributes file. #5690
  • Disable lazy-loading during AMP_Scribd_Embed_Handler_Test to fix tests in WP 5.7-alpha. #5705

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), David Riccitelli (@ziodave), John Watkins (@johnwatkins0), Kasper Myram (@kmyram), naveen (@naveen17797), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), 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.9-built.

2.0.8

09 Dec 22:18
09af21a
Compare
Choose a tag to compare

Three weeks after the 2.0.6/2.0.7 release, this 2.0.8 release includes a couple enhancements. See milestone with 5 issues/PRs and full diff.

Changelog

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), John Watkins (johnwatkins0), Joshua Wold (jwold), Kasper Myram (kmyram), Milind More (milindmore22), Pascal Birchler (swissspidy), Pierre Gordon (pierlon), 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.8-built.

2.0.7

19 Nov 23:44
d61a8cf
Compare
Choose a tag to compare

In the 2.0.6 release, it turns out that the upgrade to Composer v2 (#5551, #5568) could cause a conflict with WordPress sites that are managed with Composer. So this 2.0.7 release milestone includes just one change: downgrading Composer back to v1 (#5610, #5609). No other code changes are included. See full diff.

Props

Alain Schlesser (schlessera), Artem Russakovskii (archon810), John Watkins (johnwatkins0), Maciej Maćkowiak (maciejmackowiak), Pierre Gordon (pierlon), 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.7-built.

2.0.6

17 Nov 22:05
2acc034
Compare
Choose a tag to compare

A month after the 2.0.5 release, this 2.0.6 maintenance release includes minor bugfixes and enhancements. See milestone with 4 issues and 15 PRs. See also full diff.

Changelog

CSS

  • Support @-moz-document url-prefix() Firefox CSS hack by transforming into @supports (-moz-appearance:meterbar). This fixes AMP-compatibility for Twenty Nineteen. This also fixes plugin suppression for blocks with Gutenberg 9.2.1. #5530

Embeds

  • Re-register Facebook embed handler. #5548
  • Skip Facebook embed test if oEmbed endpoint is down. #5528

Sanitization & Validation

  • Prevent generating invalid width/height for amp-iframe when fill layout is detected via inline style. #5514, #5513
  • Raise validation error if width or height attribute is invalid. #5516
  • Fix typo class-amp-iframe-sanitizer.php. #5522

Settings Screen

  • Improve logic around WP core file imports to prevent fatal error. #5537, #5539

Routing

  • Update amp_is_available() to check for cron & WP-CLI. #5546, #5547

Infrastructure

  • Add support for Composer v2. #5543, #5551, #5568, #5601
  • Fix Travis build issues. #5599
  • Use patches from GitHub to patch PHP-CSS-Parser. #5556
  • Fix PHPUnit tests in WordPress 5.6-beta1. #5531

Mobile Redirection

  • Prevent AMP-to-AMP linking for link with Mustache template variables. #5509

Optimizer

  • Fix typo in readme. #5535

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), Alex (Alexays), Dominik Ritter (dritter), Ian Jenkins (jenkoian), James Osborne (jamesozzie), John Watkins (johnwatkins0), Joshua Wold (jwold), Kasper Myram (kmyram), Pascal Birchler (swissspidy), Pierre Gordon (pierlon), Robert O'Rourke (roborourke), Seamus Lee (seamuslee001), 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.6-built.