Amp Wp Versions Save

Enable AMP on your WordPress site, the WordPress way.

2.2.2

2 years ago

This is a maintenance release, following up on 2.2.1 from 2 months ago. For the full list of issues and pull requests in this release, please see the 2.2.2 milestone with 25 closed issues and 35 merged pull requests (minus dependency updates). See full diff of changes.

Changelog

Sanitization & Conversion

  • Allow native img without any PX-verified exemptions. In the subsequent 2.3 release images will no longer be converted to amp-img/amp-anim by default and native img will be used instead (per #6805). (#6803)
  • Reduce length of specificity-hacked CSS selectors and fix CSS selector conversion to work properly with amp-next-page. (#6909, #6312)
  • Prevent removal of entire picture element tree when sanitizing by promoting child fallback img in conversion to amp-img; add sanitizer argument to retain picture as PX-verified. (#6676, #6896)
  • Replace img with amp-pixel instead of amp-img when sanitizing the Facebook tracking pixel. (#6059, #6965)
  • Disable auto-lightbox by default. (#5122, #6936)
  • Update amphtml validator spec to 2202230359001. (#6956, #6803)
  • Remove obsolete code that strips whitespace around equal signs from meta viewport. (#4742, #6979)

Embeds

  • Improve handling of WordPress post embeds by utilizing amp-wordpress-embed. (#809, #6665)
  • Update gallery shortcode embed handler to account for no shortcode attributes (improving PHP 8 compat). (#6939)

Admin

  • Show validation issues for plugins and themes on AMP setting page after completion of Site Scan; allow copying of issues to clipboard to be shared with theme/plugin authors even when user has DevTools turned off. (#6807, #6835, #7013, #7015)
  • Do async site scanning after theme activation. (#6814, #6859)
  • Add dropdown to select vendors when managing analytics entries. (#6367, #6894)
  • Add plugin suppression indication on plugins list table. (#5340, #6959)
  • Immediately add or remove DevTools-related AMP admin menu items when toggling setting. (#6714, #6878)
  • Improve determination of eligible post types for AMP. (#6883, #6897)
  • Add margins to buttons on Settings screen. (#7001, #7010)
  • Prevent duplication of script for hiding admin bar in onboarding wizard. (#6643, #6877)
  • Parent theme with AMP incompatibilities is greyed-out in the Site Scan results. (#6958, #6859)

Testing

  • Add E2E tests for the nav menu toggles and search UI on core themes. (#5404, #6967, #6933)
  • Bump stable PHP version used in CI and update unit tests to utilize Yoast/wp-test-utils v1.0. (#6466)
  • Fix phpunit tests after postcss update and changes in WP 6.0-alpha. (#6983)

Core Compat

  • Use wp_unique_id()-based block class names instead of uniqid() and reset the disabling of CSS transient caching in affected versions of WordPress/Gutenberg. (#6925, #6949, #7004)
  • Add support for dark mode user toggle in Twenty Twenty-One. (#6783, #6874)
  • Re-insert AMP Preview button whenever editor toolbar changes to ensure button shows up initially in WP 5.6, 5.7, and 5.8. (#6893, #6900)
  • Fix color and position of captions in carousel galleries when links are present. (#6734, #6907)

PHP 8 Compat

  • Harden against possibility of 'Undefined array key url' warning for PHP 8.0. (#6921, #6948)
  • Fix Site Health check for page caching to account for wp_remote_retrieve_header() returning arrays when duplicate response headers are present. (#6937, #6938)
  • Improve checks for image dimensions extraction to avoid possibility of division by zero. (#6968, #6973)

Infrastructure

  • Prevent copying PHP files from src/ into assets/. (#6947, #6952, #6955)
  • Attempt to fix Dependabot auto-merge workflow. (#6975, #6964)

Props

Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Daniel Rueda (@danirueda), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin) Fellyph Cintra (@fellyph), James Osborne (@jamesozzie), John Watkins (@johnwatkins0), Lovekesh Kumar (@thelovekesh), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Nikhil Joshua (@NikhilJoshua), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pooja Killekar (@pooja-muchandikar), Rutvik Savsani (@rutviksavsani), Ryan Welcher (@ryanwelcher), 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.2-built.

2.2.1

2 years ago

This is a maintenance release, following up on 2.2.0 from 2 months ago. This release improves compatibility with changes in WordPress 5.9, including block-based themes like Twenty Twenty-Two. For the full list of issues and pull requests in this release, please see the 2.2.1 milestone with 11 closed issues and 12 merged pull requests (minus dependency updates). See full diff of changes.

Changelog

  • Improve logic for page cache detection in Site Health test and surface more details (#6830, #6849)
  • Optimize the process of deleting AMP data during uninstallation to avoid timeouts (#6840, #6826)
  • Support converting YouTube iframes with 100% width to amp-youtube with fixed-height layout (#6837, #6834)
  • Fix error in during Site Scanning in which “sources is not iterable” is raised (#6846, #6827)
  • Add AMP implementation of skip link for block-based themes in Full Site Editing (#6115, #6823)
  • Add support for responsive Navigation block (#6319, #6838)
  • Fix AMP Lightbox and AMP Carousel for updated Gallery block format in WordPress 5.9 (#6833, #6848)
  • Remove “Add lightbox effect” toggle from Image blocks nested in Gallery block as of WP 5.9 (#6832, #6833, #6871)
  • Fix conflict between Plugin Suppression and AMP validation (#6809, #6812)
  • Handle case in Site Scanning when no scannable URL is available (#6856, #6855)
  • Fix block validation errors caused by amp-fit-text deprecation (#6872)
  • Fix AMP preview button latest WordPress and Gutenberg (#6881)
  • Fix test to account for gutenberg_render_layout_support_flag() (#6850)
  • Update amp-toolbox-php to 0.10.0 and update other npm and composer packages (#6824, #6886)
  • Remove deprecated layout and noloading controls from editor sidebar and prevent empty “AMP Settings” panel from appearing (#6508, #6833)

Props

Alain Schlesser (@schlessera), Alberto Medina (@amedina), Bartosz Gadomski (@bartoszgadomski), Dhaval Parekh (@dhaval-parekh), Edi Amin (@ediamin), Fellyph Cintra (@fellyph), Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), 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.1-built.

2.2.0

2 years ago

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 the script 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 a native_img_used argument on the image sanitizer which is disabled by default, but it will be enabled by default in the next release (since native img will be valid AMP). It is enabled when in the loose sandboxing level. (#6518)
  • Add opt-in to prevent POST forms from being converted to amp-form (with action-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 use fixed-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 new transform_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() and wp_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 and font-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.

2.1.4

2 years ago

This is a maintenance release, following up on 2.1.3 from 2 months ago. (Work is ongoing for the 2.2 release which is due out the end of September.) For the full list of issues and pull requests in this release, please see the 2.1.4 milestone with 11 closed issues and 36 merged pull requests. See full diff of changes.

Changelog

Validation

  • Update AMP validator spec. (#6436, #6530, #6532)
  • Permit the amp-carousel script to be printed on page when there is just amp-lightbox-gallery and no amp-carousel, allowing v0.2 to be used instead of autoloading v0.1. (#6509)
  • Remove muted attribute from amp-video and its video fallback when autoplay is present, preventing AMP validation warnings from occurring. (#6581)
  • Remove extraneous calc() from media queries in Legacy theme, preventing AMP validation warnings from being reported. (#6557, #6559)

Embeds & Media

  • Update the TikTok embed handler to use amp-tiktok component. (#6060, #6558, #6586, #6574)
  • Prevent videos with unknown dimensions from appearing as stretched by giving object-fit:contain styling (as is done for images with unknown dimensions). (#6578, #6571, #6576)
  • Add featured image selector to pre-publish panel to accompany notice recommending that one be set. (#6563, #6580)
  • Recognize WebP images as being aligned with featured image recommendations. (#6536, #6565)

Routing

  • Fix redirect loop when there are multiple spaces in the url. (#6492, #6494)
  • Short-circuit validate_url() when attempting validation requests to other sites (which will always fail). (#6582)

Compatibility

  • Fix fatal error in PHP 8. (#6505, #6506)
  • Prevent wp_enqueue_scripts() notice from appearing on the new block-based Widgets screen. (#6521, #6534)
  • Fix styling issues with visually-hidden components when the latest Gutenberg is active. (#6235, #6585, #6570)
  • Fix display of step icons in Onboarding Wizard sidebar in Safari. (#6490, #6496)

Infrastructure & Misc

  • Fix broken Site Health test for “Transient caching of parsed stylesheets is disabled”, specifically the “Re-enable transient caching” button. (#6549, #6552)
  • Fix issues with service dependencies which could prevent proper activation when using plugins like TGMPA. (#6459, #6529, #6484, #6553)
  • Use built-in caching from actions/setup-node GHA. (#6544, #6541)
  • Decouple tests from external TestCase dependency. (#6539, #6538)
  • Fix PHP 8 unit test GHA job. (#6533, #6525)
  • Add Composer plugin to correctly autoload PHP CSS Parser dependency. (#6472, #6464)
  • Fix test failure in WP 5.8. (#6468)
  • Update Composer dependencies. (#6447)
  • Update JS test snapshots. (#6575)

Props

Alain Schlesser (@schlessera), Alberto Medina (@amedina), @arthur791004, Dhaval Parekh (@dhaval-parekh), Joshua Wold (@jwold), @ktmn, Maitreyie Chavan (@maitreyie-chavan), Milind More (@milindmore22), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Roland Farkas (@rolandfarkasCOM), Thrijith Thankachan (@thrijith), 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.1.4-built.

2.1.3

2 years ago

This 2.1.3 release follows up on 2.1.2 from 6 weeks ago. The key improvements in this release revolve around the Optimizer, paired URL routing, frontend/backend error handling, support for new AMP components, and compatibility with WordPress 5.8.

For the full list of issues and pull requests in this release, please see the 2.1.3 milestone with 6 closed issues and 18 merged pull requests. See full diff of changes.

Changelog

Optimizer

  • Update hero image handling to remove max count. Now when there is a custom logo, header image, and featured image they can all be prerendered in order to reduce LCP. Previously only the first two would only ever be prerendered. (#6435)
  • Ensure site icon in legacy template is identified as a hero image. (#6403)
  • Update amp-toolbox-php to v0.6.0. This includes SSR support for fluid layout, disabling link[rel=modulepreload] on SSR'ed pages (to improve performance), improves handling of resource hints, among other changes.
  • Ensure first entry content in DetermineHeroImages matches .amp-wp-article-content in legacy Reader templates. (#6440)

Routing

  • Fix construction of comment page URLs when a path suffix is used in the paired URL structure. (#6355, #6389)
  • Indicate what entity(s) are blocking the use of the path suffix and legacy reader paired URL structures. (#6339, #6374, #6396)

Error Handling

  • Update error page to support fatal errors (in PHP 7+). (#6421)
  • Add JS error handling to Settings page and Onboarding Wizard, including error screens for dependency load failures and JavaScript being disabled. (#6230, #6320)

Validation

  • Update amphtml spec to 2106240350000. Newly supported components include amp-render, amp-iframely, and amp-stream-gallery. (#6303, #6425)
  • Update means of determining Bento support for components. (#6373)

WordPress 5.8 Compatibility

  • Add data-ampdevmode attribute to regenerator-runtime script when enqueuing Paired Browsing scripts. This fixes a validation issue on WordPress 5.8. (#6416, #6419)
  • Fix test_get_mu_plugins_data for WP 5.8. (#6434)
  • Fix test_amp_get_schemaorg_metadata and test_wrap_widget_callbacks in Gutenberg v10.8 and WP 5.8. (#6366)

Misc

  • Update class name used to display a pending state when retrieving validation counts, preventing conflicts with other plugins that use the same class name. (#6398)
  • Fix incorrect usage of mysql2date() to generate datePublished and dateModified in Schema.org metadata, causing bug in time offsets. (#6316, #6318)
  • Fix incorrect use of _n() in /src/admin/site-health.php. (#6305, #6306)
  • Update codecov GitHub Action. (#6397)

Props

Alain Schlesser (@schlessera), Alberto Medina (@amedina), Dhaval Parekh (@dhaval-parekh), Evan Mattson (@aaemnnosttv), Francesco (@DrLightman), Joshua Wold (@jwold), Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Tor-Björn Fjellner (@tobifjellner), 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.1.3-built.

2.1.2

3 years ago

This 2.1.2 release follows up on 2.1.1 from 10 days ago, fixing bugs reported by a few users and making a couple enhancements.

For the full list of issues and pull requests in this release, please see the 2.1.2 milestone with 3 closed issues and 12 merged pull requests. See full diff of changes.

Changelog

  • Clarify what Paired URL Structures are and when to change them. (#6227, #6229)
  • Account for recursive request parsing in PairedRouting, fixing compatibility with the Custom Permalinks. (#6197)
  • Prevent fatal error in HeroCandidateFiltering when attachment post is not available. (#6256)
  • Defer obtaining URL for Customizer preview until AMP Customizer is accessed to improve WP Admin performance in Reader mode. (#6198)
  • Always provide polyfill for dependencies if WP or Gutenberg plugin is not supported. Ensure onboarding wizard works on WP<5.6. Fixes WP 4.9 + Gutenberg: Uncaught TypeError: Object(...) is not a function on settings page. (#6194, #6225)
  • Bump editor support minimum requirements to prevent errors on post editor in WP<5.6. (#6236, #6193)
  • Avoid possibility of ob_start() being called during output buffer processing to avoid fatal error. The amp_get_schemaorg_metadata() function is now called at template_redirect before output buffer processing. (#6232, #6233)
  • Show HTTP error code when failing to fetch. (#6255)
  • Use last PR commit hash for plugin version code and add query param to cache bust plugin build downloads. (#6259)
  • Fix lint-js job failure for dependabot PRs. (#6253)
  • Fix dependabot username in GHA workflows. (#6254)

Props

Alain Schlesser (@schlessera), Alberto A. Medina (@amedina), Evan Mattson (@aaemnnosttv), Joshua Wold (@jwold), @nbcsteveb, Pierre Gordon (@pierlon), Piotr Delawski (@delawski), 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.1.2-built.

2.1.1

3 years ago

This release follows up on 2.1.0, fixing a couple issues reported since yesterday.

For the full list of issues and pull requests in this release, please see the 2.1.1 milestone with 3 merged pull requests. See full diff of changes.

Changelog

  • Prevent fatal error when another plugin disables AMP via the amp_is_enabled filter but then later it or another plugin/theme tries to call is_amp_endpoint()/amp_is_request(). A _doing_it_wrong() notice is emitted instead of an exception being thrown. (#6181, #6184)
  • Fix incorrect count of unreviewed Validation URLs in in admin menu item. (#6185)

Props

Alain Schlesser (@schlessera), Milind More (@milindmore22), 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.1.1-built.

2.1.0

3 years ago

Some key features in this release include:

  • Customizable Paired URL Structures: For paired AMP sites (using Reader or Transitional template modes) you can finally customize the paired AMP URLs, including using /amp/, ?amp=1, ?amp, or even a completely custom URL scheme.
  • Redesigned AMP Validation in Block Editor: Validation errors in the block editor are now much less obtrusive as they now appear in a sidebar in the block editor. Additionally, validation now happens asynchronously which greatly speeds up saving with DevTools enabled.
  • Hero Image Prerendering: Hero images (like custom logo, header image, and featured image) are identified on the page and they will now get prerendered (skipping lazy-loading) to ensure they do not negatively impact the Largest Contentful Paint (LCP) metric in Core Web Vitals (CWV).
  • Serving AMP scripts as ES modules to modern browsers: To reduce the amount of JavaScript that is served to visitors, modern browsers will now be served module scripts.

For the full list of changes in this release, please see the 2.1 milestone, with 55 closed issues and 98 merged pull requests (minus dependency updates). Read on for the full details.

Changelog

Routing

  • 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. When switching from /amp/ to ?amp=1, redirects will prevent 404s. (#2204, https://github.com/ampproject/amp-wp/pull/5558, #4312, #5861, #5862, #2062, #3357, #4442, #5804)

image

  • 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, #5789, #5859)

Validation and Developer Tools

  • 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)
  • Fix incorrect title for admin bar menu item when dev tools is disabled and on an AMP page. #6124, #6126

Updated design for validation errors on validated URL screen

  • 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)
  • Show error when attempting to validate an AMP-unavailable URL instead of forcing AMP to be available. (#5295, #5296)
  • Asynchronously populate counts for unreviewed validation errors and validated URLs in admin menu and dashboard widget. (#5772, #5900, #6120, #6122)
  • Optimize method of stripping validation response of affixed HTML comments. (#6011, #6021)
  • Prevent paired browsing client script from being sanitized. (#6099)
  • Avoid failing validation requests when response is redirect. (#6069)
  • Use WP Cron to periodically check site URLs for AMP validation, but move behind feature flag filter until Site Scanning is implemented. (#1756, #5515, #5228, #5892)
  • URL validation CLI script contains logic that should be made available outside the CLI script. (#5307, #5306)

Editor

  • 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. (#3821, #5589, #3673, #5929, #2069, #5741, #5304, #5887, #5870)
Before After
Validation errors in block editor before Validation errors in block editor after
  • 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)
Before After
post-sidebar-before post-sidebar-after
  • Eliminate AMP validation from Classic Editor. (#5996)
  • Make parameters to Gutenberg filter callbacks more robust to prevent possible JS error when media library is being filtered. (#5866)

Optimizer

Reader Mode

  • 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)
  • Prevent infinite recursion error when active theme is set to be same as reader theme; ensure generator meta tag indicates reader mode when transitional mode applied. (#5093, #5899)

Embeds

  • Support for PDF embeds in File block. In Gutenberg 10.5, the File block now supports embedding PDFs (see https://github.com/WordPress/gutenberg/pull/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)
  • Fix support for Instagram Reel permalinks. (#6169, #6170)
  • Improve handling of Tumblr embeds by preventing validation errors and a failure to embed. (#4757, #5926)
  • Remove apparently obsolete polldaddy subdomain oEmbed test. (#5654)

CSS and Styling

  • 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)
  • Eliminate obsolete transformation of @-moz-document url-prefix() Firefox CSS hack into @supports (-moz-appearance:meterbar). (#5801, #5998)
  • Escape instances of </style> as <\/style> in parsed (external) stylesheets. (#5937)
  • Make dark mode selector more specific to override light mode CSS properties in Twenty Twenty-One theme. (#5975, #5977)

CLI

Settings Screen

  • Improve discoverability of “Save Changes” button on AMP settings screen. (#5353, #5443)
  • Display SUMMARY marker by preventing inline display. (#6118)

Sanitization and Conversion

  • Disable tap delay by reducing meta viewport to just width=device-width. (#5894, #5903)
  • Add rel="nofollow noreferrer noopener" to amp-wp.org link in form submission message. (#6076, #6082)

Infrastructure and Testing

  • QA Tester Plugin: A new QA Tester Plugin is available which can be installed to greatly facilitate switching between prereleases and builds for unmerged pull requests. (#4767, #4770)
  • Add support for Composer v2. (#5568)
  • Limit linting and fixing to files changed with develop. (#4402, #4441)
  • Switch from Renovate to Dependabot for dependency updates. (#4831)
  • Run tests via GitHub Actions. (#5201)
  • Fix warnings that occur during PHP testing with coverage. (#5224)
  • Add Webpack plugin to ignore JS and PHP asset files when stylesheet used as entrypoint. (#6078)
  • Replace Codecov bash uploader with GHA counterpart. (#6074)
  • Add functional tests for CLI commands. (#3076, #6070)
  • Handle CSS build process with Webpack. (#6057)
  • Use latest WP image for local env; create database during env setup. (#5980)
  • Increase default Jest timeout to 30s. (#5901)
  • Optimize GHA runtime. (#5888)
  • Run ESLint on PR fork without generating report. (#5876)
  • Local env: Ensure default database is created for WP to be installed. (#5974)
  • Only run PHPStan (on all PHP files) in pre-commit hook if there is a modified PHP file. (#5747, #5424, #5438)
  • Add phpcs checks with WordPress-VIP-Go ruleset. (#5742)
  • Fix warnings from @wordpress/no-global-event-listener ESLint rule. (#5731, #5732)
  • Remove obsolete NPM dev dependencies. (#5636, #5669)
  • Improve diff output for PHP files. (#5694)
  • Set php and js coverage threshold to 0.1%. (#5670)
  • Add /vendor to testPathIgnorePatterns for JS unit tests. (#5584)
  • Update CI status badge in readme. (#5583)
  • Helper function assertSimilarMarkup() strips attributes instead of normalizing them. (#5420)
  • WP CLI not bootstrapped in PHPUnit environment. (#5523, #5524)
  • Add theme-unit-test reference site. (#5493)
  • Update Codecov configuration. (#5341)
  • Ignore docs folder when code coverage is being processed. (#5334)

Documentation

  • Eliminate readme.txt in favor of just readme.md. (#5791, #5807, #5815)
  • Compress banner images and logo images with Squoosh. (#6179)
  • Update docs generation. (#5968)
  • Update GitHub issue/PR templates. (#5806)

Removed/Deprecated

  • 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, #4557, #5729)
  • Deprecate obsolete amp_post_template_add_analytics_script(). (#5722)
  • Remove unused images. (#5978)
  • Eliminate redundant legacy method of adding Schema.org metadata. (#5663)

Compatibility

  • Ensure PHP 8 compatibility of plugin. (#5480, #5475)
  • Fix polyfill dependency issues on WP 4.9. (#6100, #6119)

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 A. Medina (@amedina), Artem Russakovskii (@archon810), @dikeii, eD! Thomas (@edequalsawesome), @hasanbahtiar, Ikem (@inaikem), Jason (@jauyong), John Watkins (@johnwatkins0), Joshua Wold (@jwold), Junior Miranda (@juniormiranda89), Kasper Myram (@kmyram), Kristofer Baxter (@kristoferbaxter), @maciejmackowiak, @MackenzieHartung, Marco Ferrari (@marco-msg-ferrari), @martn234, Mike Kormendy (@mkormendy), Milind More (@milindmore22), @ospira, Pascal Birchler (@swissspidy), Pierre Gordon (@pierlon), Piotr Delawski (@delawski), Pradeep Sonawane (@pradeep910), Raja Anbazhagan (@raja-anbazhagan), @ravau, Ryan Kienstra (@kienstra), Sebastian Benz (@sebastianbenz), 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.1.0-built.

2.1.0-RC2

3 years ago

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.0-RC1

3 years ago

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. https://github.com/ampproject/amp-wp/issues/5995, https://github.com/ampproject/amp-wp/pull/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. https://github.com/ampproject/amp-wp/issues/5229, https://github.com/ampproject/amp-wp/pull/6042
  • Support for PDF embeds in File block. In Gutenberg 10.5, the File block now supports embedding PDFs (see https://github.com/WordPress/gutenberg/pull/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. https://github.com/ampproject/amp-wp/issues/6083, https://github.com/ampproject/amp-wp/pull/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). https://github.com/ampproject/amp-wp/pull/6117, https://github.com/ampproject/amp-toolbox-php/issues/84, https://github.com/ampproject/amp-toolbox-php/pull/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. https://github.com/ampproject/amp-wp/pull/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.