=== AMP === Contributors: automattic, xwp, google, westonruter, ryankienstra, batmoo, stubgo, albertomedina, tweetythierry, joshuawold, postphotos Tags: amp, mobile Requires at least: 4.9 Tested up to: 5.0 Stable tag: 1.0.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Requires PHP: 5.3.6 Enable AMP on your WordPress site, the WordPress way. == Description == The AMP Project is an open-source initiative aiming to make the web better for all. AMP enables web experiences that are consistently fast, beautiful and high-performing across distribution platforms. The Official AMP Plugin for WordPress supports fully integrated AMP publishing for WordPress sites, with robust capabilities and granular publisher controls. Features and capabilities provided by the plugin include: - **Compatibility Tool**: to assist the development of AMP experiences by enabling AMP debugging with detailed information about validation errors that may exist, the markup/scripts causing them, and the specific components on site (e.g theme, plugin, core) responsible for that page content. - **CSS Tree Shaking**: to assist in dealing with cases where the defined CSS rules on a site exceed the CSS size limit allowed on single AMP pages. - **Core Theme Support**: enabling full AMP validity for four default themes (i.e. Twenty Fifteen, Twenty Sixteen, Twenty Seventeen, Twenty Nineteen). - **Gutenberg Support**: enabling AMP content creation fully integrated with Gutenberg. - **AMP-first Experiences support**: enabling full-site AMP experiences without sacrificing the flexibility of the platform, or the fidelity of content. - **Many Optimizations**: A myriad of code, performance, and developer experience improvements: from customization flexibility, to better UI flows, internationalization, accessibility, etc. With the official AMP plugin for WordPress, the WordPress ecosystem is provided with the capabilities and tools it needs to build world-class AMP experiences without deviating from its standard, flexible, and well-known content creation workflow. == Installation == 1. Upload the folder to the `/wp-content/plugins/` directory. 1. Activate the plugin through the 'Plugins' menu in WordPress. 1. If you currently use older versions of the plugin in `Classic mode`, it is strongly encouraged to migrate to `Paired` or `Native mode`. == Getting Started == To learn more about the plugin and start leveraging its capabilities to power your AMP content creation workflow check [the official AMP plugin product site](https://amp-wp.org). If you are a developer, we encourage you to follow along or [contribute](https://github.com/ampproject/amp-wp/blob/develop/contributing.md) to the development of this plugin on GitHub. == Screenshots == 1. Theme support enables you to reuse the active theme's templates and stylesheets; all WordPress features (menus, widgets, comments) are available in AMP. 1. Many themes can be served as AMP without any changes; the default experience is as if JavaScript is turned off in the browser since scripts are removed. 1. Classic templates are still available, but they are are limited. Not only do they differ from the active theme, any validation errors are silently sanitized. 1. Switch from Classic to Paired or Native modes in AMP settings screen. You may need to disable the admin bar in AMP if your theme has a larger amount of CSS. 1. Make the entire site available in AMP or pick specific post types and templates; you can also opt-out on per-post basis. 1. Plugin checks for AMP validity and will indicate when either: no issues are found, new issues need moderation, or issues block AMP from being served. 1. The editor will surface validation issues during content authoring. The specific blocks with validation errors are indicated. 1. Validated URLs include the list of validation errors encountered, giving control over whether sanitization for a validation error is accepted or rejected. 1. Styles added by themes and plugins are automatically concatenated, minified, and tree-shaken to try to keep the total under 50KB of inline CSS. 1. A WP-CLI command is provided to check the URLs on a site for AMP validity. Results are available in the admin for inspection. == Changelog == = 1.0.1 (2018-12-12) = - Add check for required iconv extension. See [#1727](https://github.com/ampproject/amp-wp/pull/1727). Props westonruter. - Plugin Conflict: Also using Give plugin currently creates 500 server error when viewing /wp-admin/. See [#1720](https://github.com/ampproject/amp-wp/issues/1720). Props KZeni, westonruter. - Fix Plugin Conflict with Give plugin (previously created 500 server error when viewing site admin). See [#1725](https://github.com/ampproject/amp-wp/pull/1725). Props KZeni. - Second argument of the_title filter is an Int not WP_Post. See [#1723](https://github.com/ampproject/amp-wp/pull/1723). Props lesterchan, westonruter. - Prevent image with caption from overflowing its container in Classic mode. See [#1728](https://github.com/ampproject/amp-wp/pull/1728). Props kienstra. - Ensure Schema.org meta data has correct date. See [#1721](https://github.com/ampproject/amp-wp/pull/1721). Props westonruter. See [1.0.1 release](https://github.com/ampproject/amp-wp/releases/tag/1.0.1). = 1.0.0 (2018-12-05) = To learn how to use the new features in this release, please see the documentation for [Serving Strategies](https://amp-wp.org/documentation/how-the-plugin-works/amp-plugin-serving-strategies/) and [Implementing Interactivity](https://amp-wp.org/documentation/playbooks/implementing-interactivity/). - **Add runtime CSS minification, `!important` replacement, and tree shaking.** See [#1048](https://github.com/ampproject/amp-wp/pull/1048), [#1111](https://github.com/ampproject/amp-wp/pull/1111), [#1142](https://github.com/ampproject/amp-wp/pull/1142), [#1320](https://github.com/ampproject/amp-wp/pull/1320), [#1073](https://github.com/ampproject/amp-wp/issues/1073). Props westonruter, hellofromtonya, amedina, pbakaus, igrigorik, camelburrito. - **Keep track of new validation errors and add ability to accept/reject in order to allow or block AMP for a given URL.** See [#1003](https://github.com/ampproject/amp-wp/issues/1003). Props westonruter. - **Redesign screens for Invalid URLs and Error Index.** See [#1394](https://github.com/ampproject/amp-wp/pull/1394), [#1361](https://github.com/ampproject/amp-wp/issues/1361), [#1444](https://github.com/ampproject/amp-wp/pull/1444), [#1448](https://github.com/ampproject/amp-wp/pull/1448), [#1452](https://github.com/ampproject/amp-wp/pull/1452), [#1397](https://github.com/ampproject/amp-wp/pull/1397), [#1446](https://github.com/ampproject/amp-wp/pull/1446), [#1364](https://github.com/ampproject/amp-wp/issues/1364), [#1449](https://github.com/ampproject/amp-wp/pull/1449), [#1418](https://github.com/ampproject/amp-wp/pull/1418), [#1451](https://github.com/ampproject/amp-wp/pull/1451), [#1429](https://github.com/ampproject/amp-wp/pull/1429), [#1408](https://github.com/ampproject/amp-wp/pull/1408), [#1414](https://github.com/ampproject/amp-wp/pull/1414), [#1409](https://github.com/ampproject/amp-wp/pull/1409), [#1373](https://github.com/ampproject/amp-wp/pull/1473), [#1462](https://github.com/ampproject/amp-wp/pull/1462), [#1471](https://github.com/ampproject/amp-wp/pull/1471), [#1485](https://github.com/ampproject/amp-wp/pull/1485). Props kienstra, johnwatkins0, miina, jacobschweitzer, westonruter. - **Extend admin screen options to add `amp` theme support without any coding required.** Toggle between classic, paired, and native. Includes options for whether sanitization should be done by default and whether tree shaking should always be allowed. See [#1199](https://github.com/ampproject/amp-wp/pull/1199), [#1291](https://github.com/ampproject/amp-wp/pull/1291), [#1264](https://github.com/ampproject/amp-wp/issues/1264). Props westonruter, AdelDima. - **Add support for allowing a site subset to be native AMP.** See [#1235](https://github.com/ampproject/amp-wp/pull/1235). Props westonruter. - Add an admin pointer for updated AMP settings screen for version 1.0. See [#1271](https://github.com/ampproject/amp-wp/pull/1271), [#1254](https://github.com/ampproject/amp-wp/issues/1254). Props kienstra. - Add support for three core themes (Twenty Fifteen, Twenty Sixteen, Twenty Seventeen) so that they can be used out of the box with AMP theme support added without needing to create a child theme. See [#1074](https://github.com/ampproject/amp-wp/pull/1074). Props westonruter, DavidCramer, kienstra. - Add AMP support for Twenty Nineteen. See [#1587](https://github.com/ampproject/amp-wp/pull/1587), [#1619](https://github.com/ampproject/amp-wp/pull/1619). Props westonruter. - Add AMP menu item to admin bar on frontend with indication of AMP validation status; accessing an AMP URL that has unaccepted validation errors will redirect to the non-AMP page and cause the AMP admin bar item to indicate the failure, along with a link to access the validation results. See [#1199](https://github.com/ampproject/amp-wp/pull/1199). Props westonruter. - Add dynamic handling of validation errors. See [#1093](https://github.com/ampproject/amp-wp/pull/1093), [#1063](https://github.com/ampproject/amp-wp/pull/1063), [#1087](https://github.com/ampproject/amp-wp/issues/1087). Props westonruter. - Add AMP validation of blocks. See [#1019](https://github.com/ampproject/amp-wp/pull/1019). Props westonruter. - Add AMP-specific functionality to core blocks. See [#1026](https://github.com/ampproject/amp-wp/pull/1026), [#1008](https://github.com/ampproject/amp-wp/issues/1008). Props miina. - Add AMP media blocks (when in native AMP mode). See [#1155](https://github.com/ampproject/amp-wp/pull/1155). Props miina. - Add embed handler for Gfycat. See [#1136](https://github.com/ampproject/amp-wp/pull/1136). Props miina. - Add amp-mathml block. See [#1165](https://github.com/ampproject/amp-wp/pull/1165). Props miina. - Add Gutenberg amp-timeago block. See [#1168](https://github.com/ampproject/amp-wp/pull/1168). Props miina. - Add `amp-fit-text` support to text blocks. See [#1151](https://github.com/ampproject/amp-wp/pull/1151). Props miina. - Fix handling of font stylesheets with non-HTTPS scheme or scheme-less URLs. See [#1077](https://github.com/ampproject/amp-wp/pull/1077). Props westonruter. - Fix issues in displaying native blocks. See [#1022](https://github.com/ampproject/amp-wp/pull/1022). Props miina. - Gutenberg: Add AMP Carousel for Gallery and AMP Lightbox features for Gallery and Image. See [#1121](https://github.com/ampproject/amp-wp/pull/1121), [#1065](https://github.com/ampproject/amp-wp/issues/1065), [#1187](https://github.com/ampproject/amp-wp/pull/1187). Props miina, westonruter. - Add "Enable AMP" toggle in Gutenberg editor. See [#1275](https://github.com/ampproject/amp-wp/pull/1275), [#1230](https://github.com/ampproject/amp-wp/issues/1230). Props kienstra. - Cache post processor response. See [#1156](https://github.com/ampproject/amp-wp/pull/1156), [#959](https://github.com/ampproject/amp-wp/issues/959). Props ThierryA. - Add preload links & resource hints, and optimize order of elements in head. See [#1295](https://github.com/ampproject/amp-wp/pull/1295). Props westonruter. - Automatically redirect to `?amp` from `/amp/` URLs when `amp` theme support is present. See [#1203](https://github.com/ampproject/amp-wp/pull/1203), [#1194](https://github.com/ampproject/amp-wp/pull/1194). Props westonruter. - Incorporate Server Timing API. See [#990](https://github.com/ampproject/amp-wp/issues/990). Props westonruter. - Add information about stylesheets included and excluded in `style[amp-custom]`. See [#1135](https://github.com/ampproject/amp-wp/pull/1135). Props westonruter. - Fetch (local) stylesheets with `@import`, instead of removing them. See [#1181](https://github.com/ampproject/amp-wp/pull/1181). Props miina. - Fetch external stylesheets (which aren't from whitelisted font CDNs) to include in amp-custom style. See [#1174](https://github.com/ampproject/amp-wp/pull/1174). Props miina. - Transform CSS selectors according to sanitizer HTML element to AMP component conversions. See [#1175](https://github.com/ampproject/amp-wp/pull/1175). Props miina, westonruter. - Rework displaying block validation messages. See [#1682](https://github.com/ampproject/amp-wp/pull/1682). Props miina. - Ensure layout attributes are only allowed on supporting elements. See [#1075](https://github.com/ampproject/amp-wp/pull/1075). Props westonruter. - Correct the width attribute in `col` tags to the equivalent CSS rule. See [#1064](https://github.com/ampproject/amp-wp/pull/1064). Props amedina. - Ensure that video `source` elements use HTTPS. See [#1274](https://github.com/ampproject/amp-wp/pull/1274), [#976](https://github.com/ampproject/amp-wp/issues/976). Props hellofromtonya. - Preserve whitespace when serializing the DOM as HTML. See [#1309](https://github.com/ampproject/amp-wp/pull/1309), [#1304](https://github.com/ampproject/amp-wp/issues/1304). Props westonruter. - Fix reporting the removal of unrecognized elements. See [#1287](https://github.com/ampproject/amp-wp/pull/1287), [#1100](https://github.com/ampproject/amp-wp/issues/1100). Props hellofromtonya. - Remove space from `data: url()` in stylesheets. See [#1164](https://github.com/ampproject/amp-wp/pull/1164/), [#1089](https://github.com/ampproject/amp-wp/issues/1089). Props amedina, JonHendershot, westonruter, mehigh, davisshaver, Mte90. - Fix inconsistency between singular and plural. See [#1114](https://github.com/ampproject/amp-wp/pull/1114). Props garrett-eclipse. - Disable AMP admin menu option when the AMP Customizer is not enabled or theme support is enabled. See [#1080](https://github.com/ampproject/amp-wp/pull/1080). Props oscarssanchez. - Allow spaces around commas in value property lists. See [#1112](https://github.com/ampproject/amp-wp/pull/1112). Props westonruter. - Restore admin bar on AMP pages and improve AMP menu items. See [#1219](https://github.com/ampproject/amp-wp/pull/1219). Props westonruter. - Remove empty media queries. See [#1423](https://github.com/ampproject/amp-wp/pull/1423). Props korobochkin, westonruter. - Update PHP-CSS-Parser and include tree shaker effectiveness in `style[amp-custom]` manifest comment. See [#1650](https://github.com/ampproject/amp-wp/pull/1650). Props westonruter. - Display admin notice if there's no persistent object caching. See [#1050](https://github.com/ampproject/amp-wp/pull/1050). Props oscarssanchez. - Re-use styling for unmoderated comments to apply to new accepted/rejected validation errors. See [#1458](https://github.com/ampproject/amp-wp/pull/1458). Props westonruter, johnwatkins0, jacobschweitzer. - Update PHP-CSS-Parser to use new calc() support. See [#1116](https://github.com/ampproject/amp-wp/pull/1116), [#1284](https://github.com/ampproject/amp-wp/pull/1284). Props westonruter. - Fix parsing CSS selectors which contain commas. See [#1286](https://github.com/ampproject/amp-wp/pull/1286). Props westonruter. - Add sanitizer to support `amp-o2-player`. See [#1202](https://github.com/ampproject/amp-wp/pull/1202). Props juanchaur1. - Update contributing.md and add code of conduct. See [#1649](https://github.com/ampproject/amp-wp/pull/1649). Props amedina. - Add `AMP_Embed_Sanitizer`. See [#1128](https://github.com/ampproject/amp-wp/pull/1128). Props juanchaur1. - Add `AMP_Script_Sanitizer` to replace `noscript` elements with their contents. See [#1226](https://github.com/ampproject/amp-wp/pull/1226). Props westonruter. - Update generated tags file to 767. See [#1665](https://github.com/ampproject/amp-wp/pull/1665). Props miina. - Fix header image filtering and YouTube header video detection. See [#1208](https://github.com/ampproject/amp-wp/pull/1208). Props westonruter. - Improve support for Hulu & Imgur embeds. See [#1218](https://github.com/ampproject/amp-wp/pull/1218). Props miina. - Fix integration with WordPress 5.0. See [#1520](https://github.com/ampproject/amp-wp/pull/1520). Props miina. - Update spec generated from amphtml to file revision 675 and AMP v1531357871900. See [#1312](https://github.com/ampproject/amp-wp/pull/1312). Props westonruter. - Opt-in to CORS mode for external font stylesheet links. See [#1289](https://github.com/ampproject/amp-wp/pull/1289). Props westonruter. - PHPCS fixes, including PHP DocBlocks and strict comparisons. See [#1002](https://github.com/ampproject/amp-wp/pull/1002). Props paulschreiber. - Fix generation of validation error when element has multiple invalid attributes. See [#1461](https://github.com/ampproject/amp-wp/pull/1461). Props westonruter. - Prevent empty term status from being interpreted as new-rejected during bulk change. See [#1460](https://github.com/ampproject/amp-wp/pull/1460). Props westonruter. - Add script to create built tag. See [#1209](https://github.com/ampproject/amp-wp/pull/1209). Props westonruter. - Fix handling of amp-bind attributes to ensure that `“>”` can appear inside attribute values. See [#1119](https://github.com/ampproject/amp-wp/pull/1119). Props westonruter. - Tree-shake CSS selectors for HTML elements that target non-active languages. See [#1221](https://github.com/ampproject/amp-wp/pull/1221). Props westonruter. - Redirect to post list table in case of admin bar validate request failure. See [#1229](https://github.com/ampproject/amp-wp/pull/1229). Props westonruter. - Amend AMP style elements with sourceURL comment for DevTools to be able to perform CSS code coverage. See [#1584](https://github.com/ampproject/amp-wp/pull/1584). Props westonruter. - Prevent erroneously tree-shaking keyframe selectors like `from`, `to`, and percentages. See [#1211](https://github.com/ampproject/amp-wp/pull/1211). Props westonruter. - Add caching of redirect to non-AMP URL when validation errors present. See [#1207](https://github.com/ampproject/amp-wp/pull/1207). Props westonruter. - Discontinue using 'latest' version of component scripts. See [#1464](https://github.com/ampproject/amp-wp/pull/1464). Props westonruter. - Ensure font stylesheets are requested in CORS mode in both AMP and non-AMP documents. See [#1486](https://github.com/ampproject/amp-wp/pull/1486). Props westonruter. - Move any content output during shutdown to be injected before closing body tag. See [#1102](https://github.com/ampproject/amp-wp/pull/1102). Props westonruter. - Fix obtaining source for widgets. See [#1212](https://github.com/ampproject/amp-wp/pull/1212). Props westonruter. - Address issue where `