AMP for WordPress - Version 1.0.0

Version Description

(2018-12-05) =

To learn how to use the new features in this release, please see the wiki pages for Adding Theme Support and Implementing Interactivity.

  • Add runtime CSS minification, !important replacement, and tree shaking. See #1048, #1111, #1142, #1320, #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. Props westonruter.
  • Redesign screens for Invalid URLs and Error Index. See #1394, #1361, #1444, #1448, #1452, #1397, #1446, #1364, #1449, #1418, #1451, #1429, #1408, #1414, #1409, #1373, #1462, #1471, #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, #1291, #1264. Props westonruter, AdelDima.
  • Add support for allowing a site subset to be native AMP. See #1235. Props westonruter.
  • Add an admin pointer for updated AMP settings screen for version 1.0. See #1271, #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. Props westonruter, DavidCramer, kienstra.
  • Add AMP support for Twenty Nineteen. See #1587, #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. Props westonruter.
  • Add dynamic handling of validation errors. See #1093, #1063, #1087. Props westonruter.
  • Add AMP validation of blocks. See #1019. Props westonruter.
  • Add AMP-specific functionality to core blocks. See #1026, #1008. Props miina.
  • Add AMP media blocks (when in native AMP mode). See #1155. Props miina.
  • Add embed handler for Gfycat. See #1136. Props miina.
  • Add amp-mathml block. See #1165. Props miina.
  • Add Gutenberg amp-timeago block. See #1168. Props miina.
  • Add amp-fit-text support to text blocks. See #1151. Props miina.
  • Fix handling of font stylesheets with non-HTTPS scheme or scheme-less URLs. See #1077. Props westonruter.
  • Fix issues in displaying native blocks. See #1022. Props miina.
  • Gutenberg: Add AMP Carousel for Gallery and AMP Lightbox features for Gallery and Image. See #1121, #1065, #1187. Props miina, westonruter.
  • Add "Enable AMP" toggle in Gutenberg editor. See #1275, #1230. Props kienstra.
  • Cache post processor response. See #1156, #959. Props ThierryA.
  • Add preload links & resource hints, and optimize order of elements in head. See #1295. Props westonruter.
  • Automatically redirect to ?amp from /amp/ URLs when amp theme support is present. See #1203, #1194. Props westonruter.
  • Incorporate Server Timing API. See #990. Props westonruter.
  • Add information about stylesheets included and excluded in style[amp-custom]. See #1135. Props westonruter.
  • Fetch (local) stylesheets with @import, instead of removing them. See #1181. Props miina.
  • Fetch external stylesheets (which aren't from whitelisted font CDNs) to include in amp-custom style. See #1174. Props miina.
  • Transform CSS selectors according to sanitizer HTML element to AMP component conversions. See #1175. Props miina, westonruter.
  • Rework displaying block validation messages. See #1682. Props miina.
  • Ensure layout attributes are only allowed on supporting elements. See #1075. Props westonruter.
  • Correct the width attribute in col tags to the equivalent CSS rule. See #1064. Props amedina.
  • Ensure that video source elements use HTTPS. See #1274, #976. Props hellofromtonya.
  • Preserve whitespace when serializing the DOM as HTML. See #1309, #1304. Props westonruter.
  • Fix reporting the removal of unrecognized elements. See #1287, #1100. Props hellofromtonya.
  • Remove space from data: url() in stylesheets. See #1164, #1089. Props amedina, JonHendershot, westonruter, mehigh, davisshaver, Mte90.
  • Fix inconsistency between singular and plural. See #1114. Props garrett-eclipse.
  • Disable AMP admin menu option when the AMP Customizer is not enabled or theme support is enabled. See #1080. Props oscarssanchez.
  • Allow spaces around commas in value property lists. See #1112. Props westonruter.
  • Restore admin bar on AMP pages and improve AMP menu items. See #1219. Props westonruter.
  • Remove empty media queries. See #1423. Props korobochkin, westonruter.
  • Update PHP-CSS-Parser and include tree shaker effectiveness in style[amp-custom] manifest comment. See #1650. Props westonruter.
  • Display admin notice if there's no persistent object caching. See #1050. Props oscarssanchez.
  • Re-use styling for unmoderated comments to apply to new accepted/rejected validation errors. See #1458. Props westonruter, johnwatkins0, jacobschweitzer.
  • Update PHP-CSS-Parser to use new calc() support. See #1116, #1284. Props westonruter.
  • Fix parsing CSS selectors which contain commas. See #1286. Props westonruter.
  • Add sanitizer to support amp-o2-player. See #1202. Props juanchaur1.
  • Update contributing.md and add code of conduct. See #1649. Props amedina.
  • Add AMP_Embed_Sanitizer. See #1128. Props juanchaur1.
  • Add AMP_Script_Sanitizer to replace noscript elements with their contents. See #1226. Props westonruter.
  • Update generated tags file to 767. See #1665. Props miina.
  • Fix header image filtering and YouTube header video detection. See #1208. Props westonruter.
  • Improve support for Hulu & Imgur embeds. See #1218. Props miina.
  • Fix integration with WordPress 5.0. See #1520. Props miina.
  • Update spec generated from amphtml to file revision 675 and AMP v1531357871900. See #1312. Props westonruter.
  • Opt-in to CORS mode for external font stylesheet links. See #1289. Props westonruter.
  • PHPCS fixes, including PHP DocBlocks and strict comparisons. See #1002. Props paulschreiber.
  • Fix generation of validation error when element has multiple invalid attributes. See #1461. Props westonruter.
  • Prevent empty term status from being interpreted as new-rejected during bulk change. See #1460. Props westonruter.
  • Add script to create built tag. See #1209. Props westonruter.
  • Fix handling of amp-bind attributes to ensure that > can appear inside attribute values. See #1119. Props westonruter.
  • Tree-shake CSS selectors for HTML elements that target non-active languages. See #1221. Props westonruter.
  • Redirect to post list table in case of admin bar validate request failure. See #1229. Props westonruter.
  • Amend AMP style elements with sourceURL comment for DevTools to be able to perform CSS code coverage. See #1584. Props westonruter.
  • Prevent erroneously tree-shaking keyframe selectors like from, to, and percentages. See #1211. Props westonruter.
  • Add caching of redirect to non-AMP URL when validation errors present. See #1207. Props westonruter.
  • Discontinue using 'latest' version of component scripts. See #1464. Props westonruter.
  • Ensure font stylesheets are requested in CORS mode in both AMP and non-AMP documents. See #1486. Props westonruter.
  • Move any content output during shutdown to be injected before closing body tag. See #1102. Props westonruter.
  • Fix obtaining source for widgets. See #1212. Props westonruter.
  • Address issue where <ul> is converted to an <amp-carousel>. See #1529. Props kienstra.
  • Construct schema.org meta script by appending text node. See #1220. Props westonruter.
  • Eliminate amp-wp-enforced-sizes style from theme support stylesheet. See #1153. Props westonruter.
  • Add support for extracting (pixel) dimensions from SVG images. See #1150. Props westonruter.
  • Ensure redirect is only done if there are unsanitized errors. See #1241. Props westonruter.
  • Deprecate AMP_WP_Utils, in favor of wp_parse_url(). See #995. Props paulschreiber.
  • Add WP-CLI script to test support for blocks. See #845. Props kienstra.
  • Ensure translatable strings in blocks can actually be translated. See #1173. Props miina, swissspidy, westonruter.
  • Look in entire document for Schema.org metadata not just head. See #1664. Props westonruter.
  • Fix title display of Invalid URL page. See #1463. Props amedina.
  • Add native/paired/classic mode to AMP generator meta. See #1465. Props westonruter.
  • Prevent is_amp_endpoint() from triggering notice when called on login, signup, or activate screens. See #1250. Props felixarntz.
  • Support extracting dimensions for single URLs. See #793. Props mjangda, mdbitz.
  • Improve validation and presentation of analytics form. See #1299, #1133, #1296. Props westonruter, AdelDima.
  • Prevent validation of auto-drafts, including when merely accessing New Post screen. See #1301. Props westonruter.
  • Fix inability to move link element due to assigned parent. See #1322. Props westonruter.
  • Gutenberg: Remove 'type' from attributes where 'source' is set. See #1622. Props miina.
  • Gutenberg: Fix displaying validation warning and usage of PHP function. See #1612. Props miina.
  • Fix stretched images in Twenty Seventeen them and Gutenberg. See #1321, #1281, #1237. Props hellofromtonya.
  • Fix image dimension extractor so it does not disregard duplicate images. See #1314. Props lukas9393.
  • Improve organization of third party code. See #1657. Props westonruter.
  • Short-circuit polldaddy shortcode when no poll or survey supplied. See #1621. Props westonruter.
  • Remove redundant version from composer.json and add PHP version requirement. See #1333, #1328, #1334, #1332. Props swissspidy.
  • Add warning when AMP plugin is installed in incorrect directory. See #1593. Props westonruter.
  • Store validation errors in order of occurrence in document. See #1335. Props westonruter.
  • Add .editorconfig file. See #1336, #51. Props swissspidy.
  • Update i18n to make use of updated WP-CLI command. See #1329, #1327, #1341, #1345, #1393. Props swissspidy, felixarntz, westonruter.
  • Use all eligible post types when all_templates_supported is selected. See #1338, #1302, #1344. Props hellofromtonya, westonruter.
  • Address an issue with an invalid embed. See #1661. Props kienstra.
  • Do not show fallback source as active theme if no validation errors. See #1592. Props westonruter.
  • Respect default AMP enabled status when creating a new post in Gutenberg. See #1339. Props hellofromtonya.
  • Fix incorrect attribution of theme as source for content validation errors. See #1467. Props westonruter.
  • Move AMP Settings in editor to after default settings. See #1652. Props miina.
  • Fix conversion of video to amp-video. See #1477. Props westonruter.
  • Add new icon, text, and style to splash notice. See #1470. Props jacobschweitzer.
  • Normalize 'ver' query param in script/style validation errors to prevent recurrence after accepted. See #1346. Props westonruter.
  • Add bing-amp.com to the list of AMP Cache hosts. See #1447. Props westonruter.
  • Add missing tabindex attribute to lightbox images. See #1350. Props amedina.
  • Update AMP spec to 757 (v1811091519050). See #1588. Props westonruter, kienstra.
  • Detect ineffectual post-processor response cache due to high MISS rates and auto-disable. See #1325, #1239. Props hellofromtonya, westonruter.
  • Update regex for tag selectors. See #1534. Props swissspidy, westonruter.
  • Update the validator spec version to 720 and AMP v1534879991178; add support for reference points. See #1315, #1386, #1330. Props westonruter.
  • Update spec from revision 720 to 734. See #1475. Props kienstra.
  • Fix form sanitizer's handling of relative actions by making them absolute. See #1352, #1349. Props ricardobrg.
  • Skip Server-Timing header if not WP_DEBUG and user cannot manage_options. See #1354. Props westonruter.
  • Fetch CSS over HTTP when URL lacks extension; convert font CDN stylesheets @imports to convert to links instead of fetching. See #1357, #1317. Props westonruter.
  • Add WP-CLI command for testing the AMP compatibility of an entire site. See #1183, #1007. Props kienstra, westonruter.
  • Update screenshots. See #1701. Props westonruter, amedina.
  • Update the description of the AMP project in readme file. See #1693. Props amedina.
  • Use new banner images. See #1692. Props cathibosco.
  • Display when validation results are stale due to active theme/plugin changes. See #1375. Props westonruter.
  • Fix displaying of expected notices when theme support enabled by theme. See #1374, #1358. Props westonruter.
  • Update native mode description to mention AMP-first. See #1703. Props westonruter.
  • Fix handling responses to form submissions from an AMP Cache. See #1382, #1356.
  • Replace Gutenberg's deprecated isCleanNewPost selector. See #1387. Props miina.
  • Updates php-css-parser to include fix for parsing calc() with negative values. See #1392. Props westonruter.
  • Add embed support for Twitter timelines via new amp-twitter attributes. See #1396. Props felixarntz.
  • Eliminate obsolete sudo:false from Travis config. See #1651. Props westonruter.
  • Fix tooltip position. See #1472. Props jacobschweitzer.
  • Add error type filters on validation error and invalid URL screens. See #1373. Props kienstra.
  • Default to auto sanitization and tree shaking being enabled. See #1402. Props westonruter.
  • Prevent the admin pointer from staying below the viewport. See #1694. Props kienstra.
  • Omit validation errors sanitized by filter or tree-shaking option; since sanitization is forced, there is no point to store. See (#1413)[https://github.com/ampproject/amp-wp/pull/1413]. Props westonruter.
  • Prevent URL validation from happening during bulk imports. See #1424, #1404. Props westonruter.
  • Normalize invalid URL stored for amp_validated_url post type. See #1436. Props westonruter.
  • Make the default layout responsive for the <amp-ooyala-player> block. See #1585. Props kienstra.
  • Add default values for AMP Timeago block. See #1586. Props kienstra.
  • Expose and store queried object for validated URL; show edit link. See #1426, #1428, #1433. Props westonruter.
  • Re-validate the site when switching modes and show the results in a notice. See #1443. Props kienstra, westonruter.
  • Improve access to AMP admin screens for users who are not administrators. #1437. Props westonruter.
  • Display a welcome notice on the main 'AMP Settings' page. See #1442. Props kienstra.
  • Fix URL protocol validation and parsing attribute values with multiple URLs. See #1411, #1410. Props westonruter.
  • Prevent a notice from appearing in the Compatibility Tool meta box. See #1605. Props kienstra.
  • Restore ability to customize 'amp' query var when theme support added. #1455. Props westonruter.
  • Add slug constants for theme support and post type support. #1456. Props westonruter.
  • Fix ability to add AMP support for custom post types. See #1441. Props westonruter.
  • Fix stretched logo and header issues in Twenty Seventeen. #1419. Props westonruter.
  • Add caption support to all amp-instagram embeds. See #1438, #822. Props chandrapatel.
  • Fix PHP warning generated by calls to idn_to_utf8(). See #1440, #1439. Props kraftbj.
  • Fix PHP fatal error during AMP validation when a plugin uses a class method as an output buffer callback. #1453. Props westonruter.
  • Update minimum PHP version from 5.3.2 to 5.3.6. See #1407, #1406. Props westonruter.
  • Improve package.json and composer.json. See #1405. Props swissspidy.
  • Ensure PHP file generated for use by translate.wordpress.org is free of syntax errors. See #1427, #1416. Props swissspidy, westonruter.

For a full list of the closed issues and merged pull requests in this release, see the 1.0 milestone.

Contributors in this release, including design, development, testing, and project management: Adel Tahri (AdelDima), Alberto Medina (amedina), Anne Louise Currie (alcurrie), Brandon Kraft (kraftbj), Cathi Bosco (cathibosco), Chandra Patel (chandrapatel), Claudio Sossi, Daniel Walmsley (gravityrail), David Cramer (DavidCramer), Felix Arntz (felixarntz), Garrett Hyder (garrett-eclipse), Jacob Schweitzer (jacobschweitzer), John Watkins0 (johnwatkins0), Joshua Wold (jwold), Juan Chaur (juanchaur1), Kevin Coleman (kevincoleman), Leo Postovoit (postphotos), Lukas Hettwer (lukas9393), Mackenzie Hartung (MackenzieHartung), Matthew Denton (mdbitz), Miina Sikk (miina), Mohammad Jangda (mjangda), Pascal Birchler (swissspidy), Oscar Snchez (oscarssanchez), Paul Schreiber (paulschreiber), Ricardo Gonalves (ricardobrg), Ryan Kienstra (kienstra), Thierry Muller (ThierryA), Tonya Mork (hellofromtonya), Weston Ruter (westonruter).

Download this release

Release Info

Developer westonruter
Plugin Icon 128x128 AMP for WordPress
Version 1.0.0
Comparing to
See all releases

Code changes from version 0.7.2 to 1.0.0

Files changed (161) hide show
  1. amp.php +230 -38
  2. assets/css/admin-bar.css +1058 -0
  3. assets/css/admin-tables.css +57 -0
  4. assets/css/amp-default.css +21 -7
  5. assets/css/amp-editor-blocks.css +4 -0
  6. assets/css/amp-post-meta-box.css +13 -0
  7. assets/css/amp-validation-error-taxonomy.css +279 -0
  8. assets/css/amp-validation-single-error-url.css +164 -0
  9. assets/css/amp-validation-tooltips.css +7 -0
  10. assets/images/amp-logo-icon.svg +10 -0
  11. assets/images/amp-welcome-icon.svg +139 -0
  12. assets/images/baseline-check-circle-green.svg +4 -0
  13. assets/images/baseline-error-green.svg +12 -0
  14. assets/images/baseline-error-red.svg +12 -0
  15. assets/images/baseline-error.svg +12 -0
  16. assets/images/down-triangle.svg +3 -0
  17. assets/images/editor-help.svg +1 -0
  18. assets/images/error-rejected.svg +1 -0
  19. assets/js/amp-admin-pointer.js +37 -0
  20. assets/js/amp-block-editor-toggle-compiled.js +76 -0
  21. assets/js/amp-block-validation.js +540 -0
  22. assets/js/amp-blocks-compiled.js +151 -0
  23. assets/js/amp-customize-controls.js +12 -13
  24. assets/js/amp-customize-preview.js +2 -3
  25. assets/js/amp-customizer-design-preview.js +3 -4
  26. assets/js/amp-editor-blocks.js +852 -0
  27. assets/js/amp-post-meta-box.js +7 -7
  28. assets/js/amp-validated-url-post-edit-screen.js +409 -0
  29. assets/js/amp-validated-urls-index.js +34 -0
  30. assets/js/amp-validation-detail-toggle-compiled.js +91 -0
  31. assets/js/amp-validation-single-error-url-details-compiled.js +84 -0
  32. assets/js/amp-validation-tooltips-compiled.js +84 -0
  33. assets/src/amp-block-editor-toggle.js +100 -0
  34. assets/src/amp-validation-detail-toggle.js +102 -0
  35. assets/src/amp-validation-single-error-url-details.js +159 -0
  36. assets/src/amp-validation-tooltips.js +22 -0
  37. back-compat/templates-v0-3/meta-time.php +2 -1
  38. includes/admin/class-amp-admin-pointer.php +143 -0
  39. includes/admin/class-amp-customizer.php +42 -23
  40. includes/admin/class-amp-editor-blocks.php +201 -0
  41. includes/admin/class-amp-post-meta-box.php +146 -7
  42. includes/admin/functions.php +48 -7
  43. includes/amp-frontend-actions.php +7 -24
  44. includes/amp-helper-functions.php +315 -86
  45. includes/amp-post-template-actions.php +7 -9
  46. includes/class-amp-autoloader.php +29 -11
  47. includes/class-amp-cli.php +680 -0
  48. includes/class-amp-http.php +441 -0
  49. includes/class-amp-post-type-support.php +64 -18
  50. includes/class-amp-theme-support.php +1279 -444
  51. includes/{lib/fasterimage/amp-fasterimage.php → deprecated.php} +5 -4
  52. includes/embeds/class-amp-base-embed-handler.php +38 -4
  53. includes/embeds/class-amp-core-block-handler.php +117 -0
  54. includes/embeds/class-amp-dailymotion-embed.php +83 -21
  55. includes/embeds/class-amp-facebook-embed.php +93 -6
  56. includes/embeds/class-amp-gallery-embed.php +85 -15
  57. includes/embeds/class-amp-gfycat-embed-handler.php +81 -0
  58. includes/embeds/class-amp-hulu-embed-handler.php +87 -0
  59. includes/embeds/class-amp-imgur-embed-handler.php +148 -0
  60. includes/embeds/class-amp-instagram-embed.php +122 -7
  61. includes/embeds/class-amp-soundcloud-embed.php +1 -1
  62. includes/embeds/class-amp-twitter-embed.php +244 -13
  63. includes/embeds/class-amp-vimeo-embed.php +87 -28
  64. includes/embeds/class-amp-youtube-embed.php +89 -23
  65. includes/options/class-amp-analytics-options-submenu.php +2 -2
  66. includes/options/class-amp-options-manager.php +369 -14
  67. includes/options/class-amp-options-menu.php +490 -39
  68. includes/options/views/class-amp-analytics-options-submenu-page.php +91 -6
  69. includes/sanitizers/class-amp-allowed-tags-generated.php +4928 -1080
  70. includes/sanitizers/class-amp-audio-sanitizer.php +29 -0
  71. includes/sanitizers/class-amp-base-sanitizer.php +275 -36
  72. includes/sanitizers/class-amp-block-sanitizer.php +137 -0
  73. includes/sanitizers/class-amp-core-theme-sanitizer.php +1151 -0
  74. includes/sanitizers/class-amp-embed-sanitizer.php +47 -0
  75. includes/sanitizers/class-amp-form-sanitizer.php +15 -0
  76. includes/sanitizers/class-amp-gallery-block-sanitizer.php +207 -0
  77. includes/sanitizers/class-amp-iframe-sanitizer.php +32 -34
  78. includes/sanitizers/class-amp-img-sanitizer.php +92 -12
  79. includes/sanitizers/class-amp-o2-player-sanitizer.php +140 -0
  80. includes/sanitizers/class-amp-playbuzz-sanitizer.php +14 -5
  81. includes/sanitizers/class-amp-rule-spec.php +13 -28
  82. includes/sanitizers/class-amp-script-sanitizer.php +49 -0
  83. includes/sanitizers/class-amp-style-sanitizer.php +1913 -266
  84. includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php +380 -136
  85. includes/sanitizers/class-amp-video-sanitizer.php +110 -42
  86. includes/templates/class-amp-content-sanitizer.php +24 -0
  87. includes/templates/class-amp-content.php +48 -22
  88. includes/templates/class-amp-post-template.php +13 -9
  89. includes/utils/class-amp-dom-utils.php +121 -54
  90. includes/utils/class-amp-image-dimension-extractor.php +27 -14
  91. includes/utils/class-amp-validation-utils.php +0 -1822
  92. includes/utils/class-amp-wp-utils.php +44 -3
  93. includes/validation/class-amp-validated-url-post-type.php +2216 -0
  94. includes/validation/class-amp-validation-error-taxonomy.php +2201 -0
  95. includes/validation/class-amp-validation-manager.php +1953 -0
  96. includes/widgets/class-amp-widget-media-video.php +0 -33
  97. includes/widgets/class-amp-widget-recent-comments.php +0 -38
  98. jetpack-helper.php +1 -1
  99. languages/amp-translations.php +340 -0
  100. readme.txt +258 -87
  101. templates/admin/amp-status.php +1 -20
  102. templates/meta-taxonomy.php +8 -2
  103. templates/meta-time.php +2 -1
  104. {includes/lib → third_party}/fasterimage/Exception/InvalidImageException.php +0 -0
  105. {includes/lib → third_party}/fasterimage/ExifParser.php +0 -0
  106. {includes/lib → third_party}/fasterimage/FasterImage.php +1 -1
  107. {includes/lib → third_party}/fasterimage/ImageParser.php +43 -2
  108. third_party/fasterimage/LICENSE +21 -0
  109. third_party/fasterimage/METADATA +14 -0
  110. {includes/lib → third_party}/fasterimage/Stream/Exception/StreamBufferTooSmallException.php +0 -0
  111. {includes/lib → third_party}/fasterimage/Stream/Stream.php +0 -0
  112. {includes/lib → third_party}/fasterimage/Stream/StreamableInterface.php +0 -0
  113. third_party/fastimage/LICENSE +21 -0
  114. third_party/fastimage/METADATA +14 -0
  115. {includes/lib → third_party}/fastimage/class-fastimage.php +40 -2
  116. vendor/autoload.php +7 -0
  117. vendor/composer/ClassLoader.php +441 -0
  118. vendor/composer/LICENSE +21 -0
  119. vendor/composer/autoload_classmap.php +9 -0
  120. vendor/composer/autoload_namespaces.php +10 -0
  121. vendor/composer/autoload_psr4.php +11 -0
  122. vendor/composer/autoload_real.php +52 -0
  123. vendor/composer/autoload_static.php +50 -0
  124. vendor/composer/installed.json +270 -0
  125. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php +50 -0
  126. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php +82 -0
  127. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php +200 -0
  128. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php +105 -0
  129. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php +56 -0
  130. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php +51 -0
  131. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php +23 -0
  132. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php +322 -0
  133. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php +819 -0
  134. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php +12 -0
  135. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php +18 -0
  136. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php +31 -0
  137. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php +15 -0
  138. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php +75 -0
  139. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php +66 -0
  140. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php +69 -0
  141. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php +74 -0
  142. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php +9 -0
  143. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php +197 -0
  144. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php +44 -0
  145. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php +675 -0
  146. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php +175 -0
  147. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php +54 -0
  148. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php +40 -0
  149. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php +32 -0
  150. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcFunction.php +8 -0
  151. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcRuleValueList.php +14 -0
  152. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php +41 -0
  153. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/LineName.php +18 -0
  154. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php +10 -0
  155. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php +9 -0
  156. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php +73 -0
  157. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php +31 -0
  158. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php +24 -0
  159. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php +47 -0
  160. wpcom-helper.php +1 -1
  161. wpcom/class-amp-polldaddy-embed.php +9 -5
amp.php CHANGED
@@ -1,11 +1,11 @@
1
<?php
2
/**
3
* Plugin Name: AMP
4
- * Description: Add AMP support to your WordPress site.
5
- * Plugin URI: https://github.com/automattic/amp-wp
6
* Author: WordPress.com VIP, XWP, Google, and contributors
7
- * Author URI: https://github.com/Automattic/amp-wp/graphs/contributors
8
- * Version: 0.7.2
9
* Text Domain: amp
10
* Domain Path: /languages/
11
* License: GPLv2 or later
@@ -21,18 +21,80 @@
21
function _amp_print_php_version_admin_notice() {
22
?>
23
<div class="notice notice-error">
24
- <p><?php esc_html_e( 'The AMP plugin requires PHP 5.3+. Please contact your host to update your PHP version.', 'amp' ); ?></p>
25
- </div>
26
<?php
27
}
28
- if ( version_compare( phpversion(), '5.3', '<' ) ) {
29
add_action( 'admin_notices', '_amp_print_php_version_admin_notice' );
30
return;
31
}
32
33
define( 'AMP__FILE__', __FILE__ );
34
define( 'AMP__DIR__', dirname( __FILE__ ) );
35
- define( 'AMP__VERSION', '0.7.2' );
36
37
require_once AMP__DIR__ . '/includes/class-amp-autoloader.php';
38
AMP_Autoloader::register();
@@ -42,6 +104,12 @@ require_once AMP__DIR__ . '/includes/amp-helper-functions.php';
42
require_once AMP__DIR__ . '/includes/admin/functions.php';
43
44
register_activation_hook( __FILE__, 'amp_activate' );
45
function amp_activate() {
46
amp_after_setup_theme();
47
if ( ! did_action( 'amp_init' ) ) {
@@ -51,8 +119,14 @@ function amp_activate() {
51
}
52
53
register_deactivation_hook( __FILE__, 'amp_deactivate' );
54
function amp_deactivate() {
55
- // We need to manually remove the amp endpoint
56
global $wp_rewrite;
57
foreach ( $wp_rewrite->endpoints as $index => $endpoint ) {
58
if ( amp_get_slug() === $endpoint[1] ) {
@@ -73,6 +147,9 @@ add_action( 'wp_default_scripts', 'amp_register_default_scripts' );
73
// Ensure async and custom-element/custom-template attributes are present on script tags.
74
add_filter( 'script_loader_tag', 'amp_filter_script_loader_tag', PHP_INT_MAX, 2 );
75
76
/**
77
* Set up AMP.
78
*
@@ -84,6 +161,13 @@ add_filter( 'script_loader_tag', 'amp_filter_script_loader_tag', PHP_INT_MAX, 2
84
function amp_after_setup_theme() {
85
amp_get_slug(); // Ensure AMP_QUERY_VAR is set.
86
87
if ( false === apply_filters( 'amp_is_enabled', true ) ) {
88
return;
89
}
@@ -106,16 +190,27 @@ function amp_init() {
106
*/
107
do_action( 'amp_init' );
108
109
- load_plugin_textdomain( 'amp', false, plugin_basename( AMP__DIR__ ) . '/languages' );
110
-
111
add_rewrite_endpoint( amp_get_slug(), EP_PERMALINK );
112
113
AMP_Theme_Support::init();
114
- AMP_Post_Type_Support::add_post_type_support();
115
add_filter( 'request', 'amp_force_query_var_value' );
116
add_action( 'admin_init', 'AMP_Options_Manager::register_settings' );
117
add_action( 'wp_loaded', 'amp_post_meta_box' );
118
add_action( 'wp_loaded', 'amp_add_options_menu' );
119
add_action( 'parse_query', 'amp_correct_query_when_is_front_page' );
120
121
// Redirect the old url of amp page to the updated url.
@@ -127,10 +222,36 @@ function amp_init() {
127
128
// Add actions for legacy post templates.
129
add_action( 'wp', 'amp_maybe_add_actions' );
130
}
131
132
- // Make sure the `amp` query var has an explicit value.
133
- // Avoids issues when filtering the deprecated `query_string` hook.
134
function amp_force_query_var_value( $query_vars ) {
135
if ( isset( $query_vars[ amp_get_slug() ] ) && '' === $query_vars[ amp_get_slug() ] ) {
136
$query_vars[ amp_get_slug() ] = 1;
@@ -144,6 +265,7 @@ function amp_force_query_var_value( $query_vars ) {
144
* If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page.
145
* It won't need this plugin's template system, nor the frontend actions like the 'rel' link.
146
*
147
* @global WP_Query $wp_query
148
* @since 0.2
149
* @return void
@@ -151,7 +273,7 @@ function amp_force_query_var_value( $query_vars ) {
151
function amp_maybe_add_actions() {
152
153
// Short-circuit when theme supports AMP, as everything is handled by AMP_Theme_Support.
154
- if ( current_theme_supports( 'amp' ) ) {
155
return;
156
}
157
@@ -225,52 +347,111 @@ function amp_correct_query_when_is_front_page( WP_Query $query ) {
225
}
226
227
/**
228
- * Whether this is in 'canonical mode.'
229
*
230
- * Themes can register support for this with `add_theme_support( 'amp' )`.
231
- * Then, this will change the plugin from 'paired mode,' and it won't use its own templates.
232
- * Nor output frontend markup like the 'rel' link. If the theme registers support for AMP with:
233
- * `add_theme_support( 'amp', array( 'template_dir' => 'my-amp-templates' ) )`
234
- * it will retain 'paired mode.
235
*
236
- * @return boolean Whether this is in AMP 'canonical mode'.
237
*/
238
function amp_is_canonical() {
239
- $support = get_theme_support( 'amp' );
240
- if ( true === $support ) {
241
- return true;
242
}
243
- if ( is_array( $support ) ) {
244
- $args = array_shift( $support );
245
- if ( empty( $args['template_dir'] ) ) {
246
- return true;
247
- }
248
}
249
- return false;
250
}
251
252
function amp_load_classes() {
253
_deprecated_function( __FUNCTION__, '0.6' );
254
}
255
256
function amp_add_frontend_actions() {
257
- require_once AMP__DIR__ . '/includes/amp-frontend-actions.php';
258
}
259
260
function amp_add_post_template_actions() {
261
require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
262
require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
263
amp_post_template_init_hooks();
264
}
265
266
function amp_prepare_render() {
267
- add_action( 'template_redirect', 'amp_render' );
268
}
269
270
/**
271
* Render AMP for queried post.
272
*
273
* @since 0.1
274
*/
275
function amp_render() {
276
// Note that queried object is used instead of the ID so that the_preview for the queried post can apply.
@@ -285,6 +466,8 @@ function amp_render() {
285
* Render AMP post template.
286
*
287
* @since 0.5
288
* @param WP_Post|int $post Post.
289
* @global WP_Query $wp_query
290
*/
@@ -317,6 +500,8 @@ function amp_render_post( $post ) {
317
/**
318
* Fires before rendering a post in AMP.
319
*
320
* @since 0.2
321
*
322
* @param int $post_id Post ID.
@@ -338,7 +523,7 @@ function amp_render_post( $post ) {
338
* Uses the priority of 12 for the 'after_setup_theme' action.
339
* Many themes run `add_theme_support()` on the 'after_setup_theme' hook, at the default priority of 10.
340
* And that function's documentation suggests adding it to that action.
341
- * So this enables themes to `add_theme_support( 'amp' )`.
342
* And `amp_init_customizer()` will be able to recognize theme support by calling `amp_is_canonical()`.
343
*
344
* @since 0.4
@@ -350,16 +535,23 @@ add_action( 'plugins_loaded', '_amp_bootstrap_customizer', 9 ); // Should be hoo
350
351
/**
352
* Redirects the old AMP URL to the new AMP URL.
353
* If post slug is updated the amp page with old post slug will be redirected to the updated url.
354
*
355
- * @param string $link New URL of the post.
356
*
357
- * @return string $link URL to be redirected.
358
*/
359
function amp_redirect_old_slug_to_new_url( $link ) {
360
361
- if ( is_amp_endpoint() ) {
362
- $link = trailingslashit( trailingslashit( $link ) . amp_get_slug() );
363
}
364
365
return $link;
1
<?php
2
/**
3
* Plugin Name: AMP
4
+ * Description: Enable AMP on your WordPress site, the WordPress way.
5
+ * Plugin URI: https://amp-wp.org
6
* Author: WordPress.com VIP, XWP, Google, and contributors
7
+ * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
+ * Version: 1.0.0
9
* Text Domain: amp
10
* Domain Path: /languages/
11
* License: GPLv2 or later
21
function _amp_print_php_version_admin_notice() {
22
?>
23
<div class="notice notice-error">
24
+ <p><?php esc_html_e( 'The AMP plugin requires PHP 5.3+. Please contact your host to update your PHP version.', 'amp' ); ?></p>
25
+ </div>
26
<?php
27
}
28
+ if ( version_compare( phpversion(), '5.3.6', '<' ) ) {
29
add_action( 'admin_notices', '_amp_print_php_version_admin_notice' );
30
return;
31
}
32
33
+ /**
34
+ * Print admin notice regarding DOM extension is not installed.
35
+ *
36
+ * @since 1.1
37
+ */
38
+ function _amp_print_php_dom_document_notice() {
39
+ ?>
40
+ <div class="notice notice-error">
41
+ <p><?php esc_html_e( 'The AMP plugin requires DOM extension in PHP. Please contact your host to install DOM extension.', 'amp' ); ?></p>
42
+ </div>
43
+ <?php
44
+ }
45
+ if ( ! class_exists( 'DOMDocument' ) ) {
46
+ add_action( 'admin_notices', '_amp_print_php_dom_document_notice' );
47
+ return;
48
+ }
49
+
50
+ /**
51
+ * Print admin notice when composer install has not been performed.
52
+ *
53
+ * @since 1.0
54
+ */
55
+ function _amp_print_composer_install_admin_notice() {
56
+ ?>
57
+ <div class="notice notice-error">
58
+ <p><?php esc_html_e( 'You appear to be running the AMP plugin from source. Please do `composer install` to finish installation.', 'amp' ); ?></p>
59
+ </div>
60
+ <?php
61
+ }
62
+ if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) || ! file_exists( __DIR__ . '/vendor/sabberworm/php-css-parser' ) ) {
63
+ add_action( 'admin_notices', '_amp_print_composer_install_admin_notice' );
64
+ return;
65
+ }
66
+
67
define( 'AMP__FILE__', __FILE__ );
68
define( 'AMP__DIR__', dirname( __FILE__ ) );
69
+ define( 'AMP__VERSION', '1.0.0' );
70
+
71
+ /**
72
+ * Print admin notice if plugin installed with incorrect slug (which impacts WordPress's auto-update system).
73
+ *
74
+ * @since 1.0
75
+ */
76
+ function _amp_incorrect_plugin_slug_admin_notice() {
77
+ $actual_slug = basename( AMP__DIR__ );
78
+ ?>
79
+ <div class="notice notice-warning">
80
+ <p>
81
+ <?php
82
+ echo wp_kses_post(
83
+ sprintf(
84
+ /* translators: %1$s is the current directory name, and %2$s is the required directory name */
85
+ __( 'You appear to have installed the AMP plugin incorrectly. It is currently installed in the <code>%1$s</code> directory, but it needs to be placed in a directory named <code>%2$s</code>. Please rename the directory. This is important for WordPress plugin auto-updates.', 'amp' ),
86
+ $actual_slug,
87
+ 'amp'
88
+ )
89
+ );
90
+ ?>
91
+ </p>
92
+ </div>
93
+ <?php
94
+ }
95
+ if ( 'amp' !== basename( AMP__DIR__ ) ) {
96
+ add_action( 'admin_notices', '_amp_incorrect_plugin_slug_admin_notice' );
97
+ }
98
99
require_once AMP__DIR__ . '/includes/class-amp-autoloader.php';
100
AMP_Autoloader::register();
104
require_once AMP__DIR__ . '/includes/admin/functions.php';
105
106
register_activation_hook( __FILE__, 'amp_activate' );
107
+
108
+ /**
109
+ * Handle activation of plugin.
110
+ *
111
+ * @since 0.2
112
+ */
113
function amp_activate() {
114
amp_after_setup_theme();
115
if ( ! did_action( 'amp_init' ) ) {
119
}
120
121
register_deactivation_hook( __FILE__, 'amp_deactivate' );
122
+
123
+ /**
124
+ * Handle deactivation of plugin.
125
+ *
126
+ * @since 0.2
127
+ */
128
function amp_deactivate() {
129
+ // We need to manually remove the amp endpoint.
130
global $wp_rewrite;
131
foreach ( $wp_rewrite->endpoints as $index => $endpoint ) {
132
if ( amp_get_slug() === $endpoint[1] ) {
147
// Ensure async and custom-element/custom-template attributes are present on script tags.
148
add_filter( 'script_loader_tag', 'amp_filter_script_loader_tag', PHP_INT_MAX, 2 );
149
150
+ // Ensure crossorigin=anonymous is added to font links.
151
+ add_filter( 'style_loader_tag', 'amp_filter_font_style_loader_tag_with_crossorigin_anonymous', 10, 4 );
152
+
153
/**
154
* Set up AMP.
155
*
161
function amp_after_setup_theme() {
162
amp_get_slug(); // Ensure AMP_QUERY_VAR is set.
163
164
+ /**
165
+ * Filters whether AMP is enabled on the current site.
166
+ *
167
+ * Useful if the plugin is network activated and you want to turn it off on select sites.
168
+ *
169
+ * @since 0.2
170
+ */
171
if ( false === apply_filters( 'amp_is_enabled', true ) ) {
172
return;
173
}
190
*/
191
do_action( 'amp_init' );
192
193
add_rewrite_endpoint( amp_get_slug(), EP_PERMALINK );
194
195
+ add_filter( 'allowed_redirect_hosts', array( 'AMP_HTTP', 'filter_allowed_redirect_hosts' ) );
196
+ AMP_HTTP::purge_amp_query_vars();
197
+ AMP_HTTP::send_cors_headers();
198
+ AMP_HTTP::handle_xhr_request();
199
AMP_Theme_Support::init();
200
+ AMP_Validation_Manager::init();
201
+ add_action( 'init', array( 'AMP_Post_Type_Support', 'add_post_type_support' ), 1000 ); // After post types have been defined.
202
+
203
+ if ( defined( 'WP_CLI' ) ) {
204
+ WP_CLI::add_command( 'amp', new AMP_CLI() );
205
+ }
206
+
207
add_filter( 'request', 'amp_force_query_var_value' );
208
add_action( 'admin_init', 'AMP_Options_Manager::register_settings' );
209
+ add_action( 'wp_loaded', 'amp_editor_core_blocks' );
210
add_action( 'wp_loaded', 'amp_post_meta_box' );
211
+ add_action( 'wp_loaded', 'amp_editor_core_blocks' );
212
add_action( 'wp_loaded', 'amp_add_options_menu' );
213
+ add_action( 'wp_loaded', 'amp_admin_pointer' );
214
add_action( 'parse_query', 'amp_correct_query_when_is_front_page' );
215
216
// Redirect the old url of amp page to the updated url.
222
223
// Add actions for legacy post templates.
224
add_action( 'wp', 'amp_maybe_add_actions' );
225
+
226
+ /*
227
+ * Broadcast plugin updates.
228
+ * Note that AMP_Options_Manager::get_option( 'version', '0.0' ) cannot be used because
229
+ * version was new option added, and in that case default would never be used for a site
230
+ * upgrading from a version prior to 1.0. So this is why get_option() is currently used.
231
+ */
232
+ $options = get_option( AMP_Options_Manager::OPTION_NAME, array() );
233
+ $old_version = isset( $options['version'] ) ? $options['version'] : '0.0';
234
+ if ( AMP__VERSION !== $old_version ) {
235
+ /**
236
+ * Triggers when after amp_init when the plugin version has updated.
237
+ *
238
+ * @param string $old_version Old version.
239
+ */
240
+ do_action( 'amp_plugin_update', $old_version );
241
+ AMP_Options_Manager::update_option( 'version', AMP__VERSION );
242
+ }
243
}
244
245
+ /**
246
+ * Make sure the `amp` query var has an explicit value.
247
+ *
248
+ * This avoids issues when filtering the deprecated `query_string` hook.
249
+ *
250
+ * @since 0.3.3
251
+ *
252
+ * @param array $query_vars Query vars.
253
+ * @return array Query vars.
254
+ */
255
function amp_force_query_var_value( $query_vars ) {
256
if ( isset( $query_vars[ amp_get_slug() ] ) && '' === $query_vars[ amp_get_slug() ] ) {
257
$query_vars[ amp_get_slug() ] = 1;
265
* If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page.
266
* It won't need this plugin's template system, nor the frontend actions like the 'rel' link.
267
*
268
+ * @deprecated This function is not used when 'amp' theme support is added.
269
* @global WP_Query $wp_query
270
* @since 0.2
271
* @return void
273
function amp_maybe_add_actions() {
274
275
// Short-circuit when theme supports AMP, as everything is handled by AMP_Theme_Support.
276
+ if ( current_theme_supports( AMP_Theme_Support::SLUG ) ) {
277
return;
278
}
279
347
}
348
349
/**
350
+ * Whether this is in 'canonical mode'.
351
+ *
352
+ * Themes can register support for this with `add_theme_support( AMP_Theme_Support::SLUG )`:
353
*
354
+ * add_theme_support( AMP_Theme_Support::SLUG );
355
*
356
+ * This will serve templates in native AMP, allowing you to use AMP components in your theme templates.
357
+ * If you want to make available in paired mode, where templates are served in AMP or non-AMP documents, do:
358
+ *
359
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
360
+ * 'paired' => true,
361
+ * ) );
362
+ *
363
+ * Paired mode is also implied if you define a template_dir:
364
+ *
365
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
366
+ * 'template_dir' => 'amp',
367
+ * ) );
368
+ *
369
+ * If you want to have AMP-specific templates in addition to serving native AMP, do:
370
+ *
371
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
372
+ * 'paired' => false,
373
+ * 'template_dir' => 'amp',
374
+ * ) );
375
+ *
376
+ * If you want to force AMP to always be served on a given template, you can use the templates_supported arg,
377
+ * for example to always serve the Category template in AMP:
378
+ *
379
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
380
+ * 'templates_supported' => array(
381
+ * 'is_category' => true,
382
+ * ),
383
+ * ) );
384
+ *
385
+ * Or if you want to force AMP to be used on all templates:
386
+ *
387
+ * add_theme_support( AMP_Theme_Support::SLUG, array(
388
+ * 'templates_supported' => 'all',
389
+ * ) );
390
+ *
391
+ * @see AMP_Theme_Support::read_theme_support()
392
+ * @return boolean Whether this is in AMP 'canonical' mode, that is whether it is native and there is not separate AMP URL current URL.
393
*/
394
function amp_is_canonical() {
395
+ if ( ! current_theme_supports( AMP_Theme_Support::SLUG ) ) {
396
+ return false;
397
}
398
+
399
+ $args = AMP_Theme_Support::get_theme_support_args();
400
+ if ( isset( $args['paired'] ) ) {
401
+ return empty( $args['paired'] );
402
}
403
+
404
+ // If there is a template_dir, then paired mode is implied.
405
+ return empty( $args['template_dir'] );
406
}
407
408
+ /**
409
+ * Load classes.
410
+ *
411
+ * @since 0.2
412
+ * @deprecated As of 0.6 since autoloading is now employed.
413
+ */
414
function amp_load_classes() {
415
_deprecated_function( __FUNCTION__, '0.6' );
416
}
417
418
+ /**
419
+ * Add frontend actions.
420
+ *
421
+ * @since 0.2
422
+ */
423
function amp_add_frontend_actions() {
424
+ add_action( 'wp_head', 'amp_add_amphtml_link' );
425
}
426
427
+ /**
428
+ * Add post template actions.
429
+ *
430
+ * @since 0.2
431
+ * @deprecated This function is not used when 'amp' theme support is added.
432
+ */
433
function amp_add_post_template_actions() {
434
require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
435
require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
436
amp_post_template_init_hooks();
437
}
438
439
+ /**
440
+ * Add action to do post template rendering at template_redirect action.
441
+ *
442
+ * @since 0.2
443
+ * @since 1.0 The amp_render() function is called at template_redirect action priority 11 instead of priority 10.
444
+ * @deprecated This function is not used when 'amp' theme support is added.
445
+ */
446
function amp_prepare_render() {
447
+ add_action( 'template_redirect', 'amp_render', 11 );
448
}
449
450
/**
451
* Render AMP for queried post.
452
*
453
* @since 0.1
454
+ * @deprecated This function is not used when 'amp' theme support is added.
455
*/
456
function amp_render() {
457
// Note that queried object is used instead of the ID so that the_preview for the queried post can apply.
466
* Render AMP post template.
467
*
468
* @since 0.5
469
+ * @deprecated This function is not used when 'amp' theme support is added.
470
+ *
471
* @param WP_Post|int $post Post.
472
* @global WP_Query $wp_query
473
*/
500
/**
501
* Fires before rendering a post in AMP.
502
*
503
+ * This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `is_amp_endpoint()`.
504
+ *
505
* @since 0.2
506
*
507
* @param int $post_id Post ID.
523
* Uses the priority of 12 for the 'after_setup_theme' action.
524
* Many themes run `add_theme_support()` on the 'after_setup_theme' hook, at the default priority of 10.
525
* And that function's documentation suggests adding it to that action.
526
+ * So this enables themes to `add_theme_support( AMP_Theme_Support::SLUG )`.
527
* And `amp_init_customizer()` will be able to recognize theme support by calling `amp_is_canonical()`.
528
*
529
* @since 0.4
535
536
/**
537
* Redirects the old AMP URL to the new AMP URL.
538
+ *
539
* If post slug is updated the amp page with old post slug will be redirected to the updated url.
540
*
541
+ * @since 0.5
542
+ * @deprecated This function is irrelevant when 'amp' theme support is added.
543
*
544
+ * @param string $link New URL of the post.
545
+ * @return string URL to be redirected.
546
*/
547
function amp_redirect_old_slug_to_new_url( $link ) {
548
549
+ if ( is_amp_endpoint() && ! amp_is_canonical() ) {
550
+ if ( current_theme_supports( AMP_Theme_Support::SLUG ) ) {
551
+ $link = add_query_arg( amp_get_slug(), '', $link );
552
+ } else {
553
+ $link = trailingslashit( trailingslashit( $link ) . amp_get_slug() );
554
+ }
555
}
556
557
return $link;
assets/css/admin-bar.css ADDED
@@ -0,0 +1,1058 @@
1
+ /*
2
+ This is forked from core's admin-bar.css from WP 4.9.6
3
+ - Rules for IE<9 have been removed.
4
+ - References to .hover have been replaced with :focus-within (which is not supported in IE11).
5
+ - A universal selector properties have been removed which interferes with AMP shadow elements.
6
+ */
7
+
8
+
9
+ #wpadminbar * {
10
+ height: auto;
11
+ width: auto;
12
+ margin: 0;
13
+ padding: 0;
14
+ /* Removed because interferes with amp-img>img: position: static; */
15
+ text-shadow: none;
16
+ text-transform: none;
17
+ letter-spacing: normal;
18
+ font-size: 13px;
19
+ font-weight: 400;
20
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
21
+ line-height: 32px;
22
+ border-radius: 0;
23
+ box-sizing: content-box;
24
+ transition: none;
25
+ -webkit-font-smoothing: subpixel-antialiased; /* Prevent Safari from switching to standard antialiasing on hover */
26
+ -moz-osx-font-smoothing: auto; /* Prevent Firefox from inheriting from themes that use other values */
27
+ }
28
+
29
+ .rtl #wpadminbar * {
30
+ font-family: Tahoma, sans-serif;
31
+ }
32
+
33
+ html:lang(he-il) .rtl #wpadminbar * {
34
+ font-family: Arial, sans-serif;
35
+ }
36
+
37
+ #wpadminbar .ab-empty-item {
38
+ cursor: default;
39
+ }
40
+
41
+ #wpadminbar .ab-empty-item,
42
+ #wpadminbar a.ab-item,
43
+ #wpadminbar > #wp-toolbar span.ab-label,
44
+ #wpadminbar > #wp-toolbar span.noticon {
45
+ color: #eee;
46
+ }
47
+
48
+ #wpadminbar #wp-admin-bar-site-name a.ab-item,
49
+ #wpadminbar #wp-admin-bar-my-sites a.ab-item {
50
+ white-space: nowrap;
51
+ overflow: hidden;
52
+ text-overflow: ellipsis;
53
+ }
54
+
55
+ #wpadminbar ul li:before,
56
+ #wpadminbar ul li:after {
57
+ content: normal;
58
+ }
59
+
60
+ #wpadminbar a,
61
+ #wpadminbar a:hover,
62
+ #wpadminbar a img,
63
+ #wpadminbar a img:hover {
64
+ outline: none;
65
+ border: none;
66
+ text-decoration: none;
67
+ background: none;
68
+ }
69
+
70
+ #wpadminbar a:focus,
71
+ #wpadminbar a:active,
72
+ #wpadminbar input[type="text"],
73
+ #wpadminbar input[type="password"],
74
+ #wpadminbar input[type="number"],
75
+ #wpadminbar input[type="search"],
76
+ #wpadminbar input[type="email"],
77
+ #wpadminbar input[type="url"],
78
+ #wpadminbar select,
79
+ #wpadminbar textarea,
80
+ #wpadminbar div {
81
+ box-shadow: none;
82
+ outline: none;
83
+ }
84
+
85
+ #wpadminbar {
86
+ direction: ltr;
87
+ color: #ccc;
88
+ font-size: 13px;
89
+ font-weight: 400;
90
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
91
+ line-height: 32px;
92
+ height: 32px;
93
+ position: fixed;
94
+ top: 0;
95
+ left: 0;
96
+ width: 100%;
97
+ min-width: 600px; /* match the min-width of the body in wp-admin.css */
98
+ z-index: 99999;
99
+ background: #23282d;
100
+ }
101
+
102
+ #wpadminbar .ab-sub-wrapper,
103
+ #wpadminbar ul,
104
+ #wpadminbar ul li {
105
+ background: none;
106
+ clear: none;
107
+ list-style: none;
108
+ margin: 0;
109
+ padding: 0;
110
+ position: relative;
111
+ text-indent: 0;
112
+ z-index: 99999;
113
+ }
114
+
115
+ #wpadminbar ul#wp-admin-bar-root-default>li {
116
+ margin-right: 0;
117
+ }
118
+
119
+ #wpadminbar .quicklinks ul {
120
+ text-align: left;
121
+ }
122
+
123
+ #wpadminbar li {
124
+ float: left;
125
+ }
126
+
127
+ #wpadminbar .ab-empty-item {
128
+ outline: none;
129
+ }
130
+
131
+ #wpadminbar .quicklinks .ab-top-secondary > li {
132
+ float: right;
133
+ }
134
+
135
+ #wpadminbar .quicklinks a,
136
+ #wpadminbar .quicklinks .ab-empty-item,
137
+ #wpadminbar .shortlink-input {
138
+ height: 32px;
139
+ display: block;
140
+ padding: 0 10px;
141
+ margin: 0;
142
+ }
143
+
144
+ #wpadminbar .quicklinks > ul > li > a {
145
+ padding: 0 8px 0 7px;
146
+ }
147
+
148
+ #wpadminbar .menupop .ab-sub-wrapper,
149
+ #wpadminbar .shortlink-input {
150
+ margin: 0;
151
+ padding: 0;
152
+ box-shadow: 0 3px 5px rgba(0,0,0,0.2);
153
+ background: #32373c;
154
+ display: none;
155
+ position: absolute;
156
+ float: none;
157
+ }
158
+
159
+ #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper {
160
+ min-width: 100%;
161
+ }
162
+
163
+ #wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper {
164
+ right: 0;
165
+ left: auto;
166
+ }
167
+
168
+ #wpadminbar .ab-submenu {
169
+ padding: 6px 0;
170
+ }
171
+
172
+ #wpadminbar .selected .shortlink-input {
173
+ display: block;
174
+ }
175
+
176
+ #wpadminbar .quicklinks .menupop ul li {
177
+ float: none;
178
+ }
179
+
180
+ #wpadminbar .quicklinks .menupop ul li a strong {
181
+ font-weight: 600;
182
+ }
183
+
184
+ #wpadminbar .quicklinks .menupop ul li .ab-item,
185
+ #wpadminbar .quicklinks .menupop ul li a strong,
186
+ #wpadminbar .quicklinks .menupop:focus-within ul li .ab-item,
187
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item,
188
+ #wpadminbar .shortlink-input {
189
+ line-height: 26px;
190
+ height: 26px;
191
+ white-space: nowrap;
192
+ min-width: 140px;
193
+ }
194
+
195
+ #wpadminbar .shortlink-input {
196
+ width: 200px;
197
+ }
198
+
199
+ #wpadminbar.nojs li:hover > .ab-sub-wrapper,
200
+ #wpadminbar li:focus-within > .ab-sub-wrapper {
201
+ display: block;
202
+ }
203
+
204
+ #wpadminbar .menupop li:hover > .ab-sub-wrapper,
205
+ #wpadminbar .menupop li:focus-within > .ab-sub-wrapper {
206
+ margin-left: 100%;
207
+ margin-top: -32px;
208
+ }
209
+
210
+ #wpadminbar .ab-top-secondary .menupop li:hover > .ab-sub-wrapper,
211
+ #wpadminbar .ab-top-secondary .menupop li:focus-within > .ab-sub-wrapper {
212
+ margin-left: 0;
213
+ left: inherit;
214
+ right: 100%;
215
+ }
216
+
217
+ #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
218
+ #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
219
+ #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
220
+ #wpadminbar .ab-top-menu > li:focus-within > .ab-item {
221
+ background: #32373c;
222
+ color: #00b9eb;
223
+ }
224
+ #wpadminbar .ab-top-menu > li:focus-within > .ab-item {
225
+ background: #32373c;
226
+ color: #00b9eb;
227
+ }
228
+
229
+ #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
230
+ #wpadminbar > #wp-toolbar li:focus-within span.ab-label,
231
+ #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
232
+ color: #00b9eb;
233
+ }
234
+
235
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon,
236
+ #wpadminbar .ab-icon,
237
+ #wpadminbar .ab-item:before {
238
+ position: relative;
239
+ float: left;
240
+ font: normal 20px/1 dashicons;
241
+ speak: none;
242
+ padding: 4px 0;
243
+ -webkit-font-smoothing: antialiased;
244
+ -moz-osx-font-smoothing: grayscale;
245
+ background-image: none !important;
246
+ margin-right: 6px;
247
+ }
248
+
249
+ #wpadminbar .ab-icon:before,
250
+ #wpadminbar .ab-item:before,
251
+ #wpadminbar #adminbarsearch:before {
252
+ color: #a0a5aa;
253
+ color: rgba(240,245,250,0.6);
254
+ }
255
+
256
+ #wpadminbar .ab-icon:before,
257
+ #wpadminbar .ab-item:before,
258
+ #wpadminbar #adminbarsearch:before {
259
+ position: relative;
260
+ transition: all .1s ease-in-out;
261
+ }
262
+
263
+ #wpadminbar .ab-label {
264
+ display: inline-block;
265
+ height: 32px;
266
+ }
267
+
268
+ #wpadminbar .ab-submenu .ab-item {
269
+ color: #b4b9be;
270
+ color: rgba(240,245,250,0.7);
271
+ }
272
+
273
+ #wpadminbar .quicklinks .menupop ul li a,
274
+ #wpadminbar .quicklinks .menupop ul li a strong,
275
+ #wpadminbar .quicklinks .menupop:focus-within ul li a,
276
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
277
+ color: #b4b9be;
278
+ color: rgba(240,245,250,0.7);
279
+ }
280
+
281
+ #wpadminbar .quicklinks .menupop ul li a:hover,
282
+ #wpadminbar .quicklinks .menupop ul li a:focus,
283
+ #wpadminbar .quicklinks .menupop ul li a:hover strong,
284
+ #wpadminbar .quicklinks .menupop ul li a:focus strong,
285
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop:focus-within > a,
286
+ #wpadminbar .quicklinks .menupop:focus-within ul li a:hover,
287
+ #wpadminbar .quicklinks .menupop:focus-within ul li a:focus,
288
+ #wpadminbar .quicklinks .menupop:focus-within ul li div[tabindex]:hover,
289
+ #wpadminbar .quicklinks .menupop:focus-within ul li div[tabindex]:focus,
290
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
291
+ #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
292
+ #wpadminbar li:hover .ab-icon:before,
293
+ #wpadminbar li:hover .ab-item:before,
294
+ #wpadminbar li a:focus .ab-icon:before,
295
+ #wpadminbar li .ab-item:focus:before,
296
+ #wpadminbar li .ab-item:focus .ab-icon:before,
297
+ #wpadminbar li:focus-within .ab-icon:before,
298
+ #wpadminbar li:focus-within .ab-item:before,
299
+ #wpadminbar li:hover #adminbarsearch:before,
300
+ #wpadminbar li #adminbarsearch.adminbar-focused:before {
301
+ color: #00b9eb;
302
+ }
303
+
304
+ #wpadminbar.mobile .quicklinks .ab-icon:before,
305
+ #wpadminbar.mobile .quicklinks .ab-item:before {
306
+ color: #b4b9be;
307
+ }
308
+
309
+ #wpadminbar .menupop .menupop > .ab-item:before,
310
+ #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before {
311
+ position: absolute;
312
+ font: normal 17px/1 dashicons;
313
+ speak: none;
314
+ -webkit-font-smoothing: antialiased;
315
+ -moz-osx-font-smoothing: grayscale;
316
+ }
317
+
318
+ #wpadminbar .menupop .menupop > .ab-item {
319
+ display: block;
320
+ padding-right: 2em;
321
+ }
322
+
323
+ #wpadminbar .menupop .menupop > .ab-item:before {
324
+ top: 1px;
325
+ right: 4px;
326
+ content: "\f139";
327
+ color: inherit;
328
+ }
329
+
330
+ #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item {
331
+ padding-left: 2em;
332
+ padding-right: 1em;
333
+ }
334
+
335
+ #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before {
336
+ top: 1px;
337
+ left: 6px;
338
+ content: "\f141";
339
+ }
340
+
341
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary {
342
+ display: block;
343
+ position: relative;
344
+ right: auto;
345
+ margin: 0;
346
+ box-shadow: none;
347
+ }
348
+
349
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
350
+ #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
351
+ background: #464b50;
352
+ }
353
+
354
+ #wpadminbar .quicklinks .menupop .ab-sub-secondary > li > a:hover,
355
+ #wpadminbar .quicklinks .menupop .ab-sub-secondary > li .ab-item:focus a {
356
+ color: #00b9eb;
357
+ }
358
+
359
+ #wpadminbar .quicklinks a span#ab-updates {
360
+ background: #eee;
361
+ color: #32373c;
362
+ display: inline;
363
+ padding: 2px 5px;
364
+ font-size: 10px;
365
+ font-weight: 600;
366
+ border-radius: 10px;
367
+ }
368
+
369
+ #wpadminbar .quicklinks a:hover span#ab-updates {
370
+ background: #fff;
371
+ color: #000;
372
+ }
373
+
374
+ #wpadminbar .ab-top-secondary {
375
+ float: right;
376
+ }
377
+
378
+ #wpadminbar ul li:last-child,
379
+ #wpadminbar ul li:last-child .ab-item {
380
+ box-shadow: none;
381
+ }
382
+
383
+ /**
384
+ * My Account
385
+ */
386
+ #wp-admin-bar-my-account > ul {
387
+ min-width: 198px;
388
+ }
389
+
390
+ #wp-admin-bar-my-account > .ab-item:before {
391
+ content: "\f110";
392
+ top: 2px;
393
+ float: right;
394
+ margin-left: 6px;
395
+ margin-right: 0;
396
+ }
397
+
398
+ #wp-admin-bar-my-account.with-avatar > .ab-item:before {
399
+ display: none;
400
+ content: none;
401
+ }
402
+
403
+ #wp-admin-bar-my-account.with-avatar > ul {
404
+ min-width: 270px;
405
+ }
406
+
407
+ #wpadminbar #wp-admin-bar-user-actions > li {
408
+ margin-left: 16px;
409
+ margin-right: 16px;
410
+ }
411
+
412
+ #wpadminbar #wp-admin-bar-user-actions.ab-submenu {
413
+ padding: 6px 0 12px;
414
+ }
415
+
416
+ #wpadminbar #wp-admin-bar-my-account.with-avatar #wp-admin-bar-user-actions > li {
417
+ margin-left: 88px;
418
+ }
419
+
420
+ #wpadminbar #wp-admin-bar-user-info {
421
+ margin-top: 6px;
422
+ margin-bottom: 15px;
423
+ height: auto;
424
+ background: none;
425
+ }
426
+
427
+ #wp-admin-bar-user-info .avatar {
428
+ /* TODO: The amp-img>img does not get loaded since the container is initially hidden, and :hover does not trigger a re-calc. Resizing the window does, however. */
429
+ position: absolute;
430
+ left: -72px;
431
+ top: 4px;
432
+ width: 64px;
433
+ height: 64px;
434
+ }
435
+
436
+ #wpadminbar #wp-admin-bar-user-info a {
437
+ background: none;
438
+ height: auto;
439
+ }
440
+
441
+ #wpadminbar #wp-admin-bar-user-info span {
442
+ background: none;
443
+ padding: 0;
444
+ height: 18px;
445
+ }
446
+
447
+ #wpadminbar #wp-admin-bar-user-info .display-name,
448
+ #wpadminbar #wp-admin-bar-user-info .username {
449
+ display: block;
450
+ }
451
+
452
+ #wpadminbar #wp-admin-bar-user-info .username {
453
+ color: #a0a5aa;
454
+ font-size: 11px;
455
+ }
456
+
457
+ #wpadminbar #wp-admin-bar-my-account.with-avatar > .ab-empty-item img,
458
+ #wpadminbar #wp-admin-bar-my-account.with-avatar > a img {
459
+ width: 16px; /* Was auto. */
460
+ height: 16px;
461
+ padding: 0;
462
+ border: 1px solid #82878c;
463
+ background: #eee;
464
+ line-height: 24px;
465
+ vertical-align: middle;
466
+ margin: -4px 0 0 6px;
467
+ float: none;
468
+ display: inline-block; /* Was inline. */
469
+ }
470
+
471
+ /**
472
+ * WP Logo
473
+ */
474
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon {
475
+ width: 15px;
476
+ height: 20px;
477
+ margin-right: 0;
478
+ padding: 6px 0 5px;
479
+ }
480
+
481
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item {
482
+ padding: 0 7px;
483
+ }
484
+
485
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
486
+ content: "\f120";
487
+ top: 2px;
488
+ }
489
+
490
+ /*
491
+ * My Sites & Site Title
492
+ */
493
+ #wpadminbar .quicklinks li .blavatar {
494
+ float: left;
495
+ font: normal 16px/1 dashicons !important;
496
+ speak: none;
497
+ -webkit-font-smoothing: antialiased;
498
+ -moz-osx-font-smoothing: grayscale;
499
+ color: #eee;
500
+ }
501
+
502
+ #wpadminbar .quicklinks li a:hover .blavatar,
503
+ #wpadminbar .quicklinks li a:focus .blavatar,
504
+ #wpadminbar .quicklinks .ab-sub-wrapper .menupop:focus-within > a .blavatar {
505
+ color: #00b9eb;
506
+ }
507
+
508
+ #wpadminbar .quicklinks li .blavatar:before {
509
+ content: "\f120";
510
+ height: 16px;
511
+ width: 16px;
512
+ display: inline-block;
513
+ margin: 6px 8px 0 -2px;
514
+ }
515
+
516
+ #wpadminbar #wp-admin-bar-appearance {
517
+ margin-top: -12px;
518
+ }
519
+
520
+ #wpadminbar #wp-admin-bar-my-sites > .ab-item:before,
521
+ #wpadminbar #wp-admin-bar-site-name > .ab-item:before {
522
+ content: "\f541";
523
+ top: 2px;
524
+ }
525
+
526
+ #wpadminbar #wp-admin-bar-customize > .ab-item:before {
527
+ content: "\f540";
528
+ top: 2px;
529
+ }
530
+
531
+
532
+ #wpadminbar #wp-admin-bar-edit > .ab-item:before {
533
+ content: "\f464";
534
+ top: 2px;
535
+ }
536
+
537
+ #wpadminbar #wp-admin-bar-site-name > .ab-item:before {
538
+ content: "\f226";
539
+ }
540
+
541
+ .wp-admin #wpadminbar #wp-admin-bar-site-name > .ab-item:before {
542
+ content: "\f102";
543
+ }
544
+
545
+
546
+
547
+ /**
548
+ * Comments
549
+ */
550
+ #wpadminbar #wp-admin-bar-comments .ab-icon {
551
+ margin-right: 6px;
552
+ }
553
+
554
+ #wpadminbar #wp-admin-bar-comments .ab-icon:before {
555
+ content: "\f101";
556
+ top: 3px;
557
+ }
558
+
559
+ #wpadminbar #wp-admin-bar-comments .count-0 {
560
+ opacity: .5;
561
+ }
562
+
563
+ /**
564
+ * New Content
565
+ */
566
+ #wpadminbar #wp-admin-bar-new-content .ab-icon:before {
567
+ content: "\f132";
568
+ top: 4px;
569
+ }
570
+
571
+ /**
572
+ * Updates
573
+ */
574
+ #wpadminbar #wp-admin-bar-updates .ab-icon:before {
575
+ content: "\f463";
576
+ top: 2px;
577
+ }
578
+
579
+ /**
580
+ * Search
581
+ */
582
+ #wpadminbar #wp-admin-bar-search .ab-item {
583
+ padding: 0;
584
+ background: transparent;
585
+ }
586
+
587
+ #wpadminbar #adminbarsearch {
588
+ position: relative;
589
+ height: 32px;
590
+ padding: 0 2px;
591
+ z-index: 1;
592
+ }
593
+
594
+ #wpadminbar #adminbarsearch:before {
595
+ position: absolute;
596
+ top: 6px;
597
+ left: 5px;
598
+ z-index: 20;
599
+ font: normal 20px/1 dashicons !important;
600
+ content: "\f179";
601
+ speak: none;
602
+ -webkit-font-smoothing: antialiased;
603
+ -moz-osx-font-smoothing: grayscale;
604
+ }
605
+
606
+ /* The admin bar search field needs to reset many styles that might be inherited from the active Theme CSS. See ticket #40313. */
607
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input {
608
+ display: inline-block;
609
+ float: none;
610
+ position: relative;
611
+ z-index: 30;
612
+ font-size: 13px;
613
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
614
+ line-height: 24px;
615
+ text-indent: 0;
616
+ height: 24px;
617
+ width: 24px;
618
+ max-width: none;
619
+ padding: 0 3px 0 24px;
620
+ margin: 0;
621
+ color: #ccc;
622
+ background-color: rgba( 255, 255, 255, 0 );
623
+ border: none;
624
+ outline: none;
625
+ cursor: pointer;
626
+ box-shadow: none;
627
+ box-sizing: border-box;
628
+ transition-duration: 400ms;
629
+ transition-property: width, background;
630
+ transition-timing-function: ease;
631
+ }
632
+
633
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus {
634
+ z-index: 10;
635
+ color: #000;
636
+ width: 200px;
637
+ background-color: rgba( 255, 255, 255, 0.9 );
638
+ cursor: text;
639
+ border: 0;
640
+ }
641
+
642
+ /* Removed IE hacks. */
643
+
644
+ #wpadminbar #adminbarsearch .adminbar-button {
645
+ display: none;
646
+ }
647
+
648
+ /**
649
+ * Customize support classes
650
+ */
651
+ .no-customize-support .hide-if-no-customize,
652
+ .customize-support .hide-if-customize,
653
+ .no-customize-support #wpadminbar .hide-if-no-customize,
654
+ .no-customize-support.wp-core-ui .hide-if-no-customize,
655
+ .no-customize-support .wp-core-ui .hide-if-no-customize,
656
+ .customize-support #wpadminbar .hide-if-customize,
657
+ .customize-support.wp-core-ui .hide-if-customize,
658
+ .customize-support .wp-core-ui .hide-if-customize {
659
+ display: none;
660
+ }
661
+
662
+ /* Skip link */
663
+ #wpadminbar .screen-reader-text,
664
+ #wpadminbar .screen-reader-text span {
665
+ border: 0;
666
+ clip: rect(1px, 1px, 1px, 1px);
667
+ -webkit-clip-path: inset(50%);
668
+ clip-path: inset(50%);
669
+ height: 1px;
670
+ margin: -1px;
671
+ overflow: hidden;
672
+ padding: 0;
673
+ position: absolute;
674
+ width: 1px;
675
+ word-wrap: normal !important;
676
+ }
677
+
678
+ #wpadminbar .screen-reader-shortcut {
679
+ position: absolute;
680
+ top: -1000em;
681
+ }
682
+
683
+ #wpadminbar .screen-reader-shortcut:focus {
684
+ left: 6px;
685
+ top: 7px;
686
+ height: auto;
687
+ width: auto;
688
+ display: block;
689
+ font-size: 14px;
690
+ font-weight: 600;
691
+ padding: 15px 23px 14px;
692
+ background: #f1f1f1;
693
+ color: #0073aa;
694
+ z-index: 100000;
695
+ line-height: normal;
696
+ text-decoration: none;
697
+ box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
698
+ }
699
+
700
+ /**
701
+ * Removed IE 6-targeted rules
702
+ */
703
+
704
+ /* Removed No @font-face support */
705
+
706
+ @media screen and ( max-width: 782px ) {
707
+ /* Toolbar Touchification*/
708
+ html #wpadminbar {
709
+ height: 46px;
710
+ min-width: 300px;
711
+ }
712
+
713
+ #wpadminbar * {
714
+ font-size: 14px;
715
+ font-weight: 400;
716
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
717
+ line-height: 32px;
718
+ }
719
+
720
+ #wpadminbar .quicklinks > ul > li > a,
721
+ #wpadminbar .quicklinks .ab-empty-item {
722
+ padding: 0;
723
+ height: 46px;
724
+ line-height: 46px;
725
+ width: auto;
726
+ }
727
+
728
+ #wpadminbar .ab-icon {
729
+ font: 40px/1 dashicons !important;
730
+ margin: 0;
731
+ padding: 0;
732
+ width: 52px;
733
+ height: 46px;
734
+ text-align: center;
735
+ }
736
+
737
+ #wpadminbar .ab-icon:before {
738
+ text-align: center;
739
+ }
740
+
741
+ #wpadminbar .ab-submenu {
742
+ padding: 0;
743
+ }
744
+
745
+ #wpadminbar #wp-admin-bar-site-name a.ab-item,
746
+ #wpadminbar #wp-admin-bar-my-sites a.ab-item,
747
+ #wpadminbar #wp-admin-bar-my-account a.ab-item {
748
+ text-overflow: clip;
749
+ }
750
+
751
+ #wpadminbar .ab-label {
752
+ display: none;
753
+ }
754
+
755
+ #wpadminbar .menupop li:hover > .ab-sub-wrapper,
756
+ #wpadminbar .menupop li:focus-within > .ab-sub-wrapper {
757
+ margin-top: -46px;
758
+ }
759
+
760
+ #wpadminbar .ab-top-menu .menupop .ab-sub-wrapper .menupop > .ab-item {
761
+ padding-right: 30px;
762
+ }
763
+
764
+ #wpadminbar .menupop .menupop > .ab-item:before {
765
+ top: 10px;
766
+ right: 6px;
767
+ }
768
+
769
+ #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper .ab-item {
770
+ font-size: 16px;
771
+ padding: 8px 16px;
772
+ }
773
+
774
+ #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper a:empty {
775
+ display: none;
776
+ }
777
+
778
+ /* WP logo */
779
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item {
780
+ padding: 0;
781
+ }
782
+
783
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon {
784
+ padding: 0;
785
+ width: 52px;
786
+ height: 46px;
787
+ text-align: center;
788
+ vertical-align: top;
789
+ }
790
+
791
+ #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
792
+ font: 28px/1 dashicons !important;
793
+ top: -3px;
794
+ }
795
+
796
+ #wpadminbar .ab-icon,
797
+ #wpadminbar .ab-item:before {
798
+ padding: 0;
799
+ }
800
+
801
+ /* My Sites and "Site Title" menu */
802
+ #wpadminbar #wp-admin-bar-my-sites > .ab-item,
803
+ #wpadminbar #wp-admin-bar-site-name > .ab-item,
804
+ #wpadminbar #wp-admin-bar-customize > .ab-item,
805
+ #wpadminbar #wp-admin-bar-edit > .ab-item,
806
+ #wpadminbar #wp-admin-bar-my-account > .ab-item {
807
+ text-indent: 100%;
808
+ white-space: nowrap;
809
+ overflow: hidden;
810
+ width: 52px;
811
+ padding: 0;
812
+ color: #a0a5aa; /* @todo not needed? this text is hidden */
813
+ position: relative;
814
+ }
815
+
816
+ #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon,
817
+ #wpadminbar .ab-icon,
818
+ #wpadminbar .ab-item:before {
819
+ padding: 0;
820
+ margin-right: 0;
821
+ }
822
+
823
+ #wpadminbar #wp-admin-bar-edit > .ab-item:before,
824
+ #wpadminbar #wp-admin-bar-my-sites > .ab-item:before,
825
+ #wpadminbar #wp-admin-bar-site-name > .ab-item:before,
826
+ #wpadminbar #wp-admin-bar-customize > .ab-item:before,
827
+ #wpadminbar #wp-admin-bar-my-account > .ab-item:before {
828
+ display: block;
829
+ text-indent: 0;
830
+ font: normal 32px/1 dashicons;
831
+ speak: none;
832
+ top: 7px;
833
+ width: 52px;
834
+ text-align: center;
835
+ -webkit-font-smoothing: antialiased;
836
+ -moz-osx-font-smoothing: grayscale;
837
+ }
838
+
839
+ #wpadminbar #wp-admin-bar-appearance {
840
+ margin-top: 0;
841
+ }
842
+
843
+ #wpadminbar .quicklinks li .blavatar:before {
844
+ display: none;
845
+ }
846
+
847
+ /* Search */
848
+ #wpadminbar #wp-admin-bar-search {
849
+ display: none;
850
+ }
851
+
852
+ /* New Content */
853
+ #wpadminbar #wp-admin-bar-new-content .ab-icon:before {
854
+ top: 0;
855
+ line-height: 53px;
856
+ height: 46px !important;
857
+ text-align: center;
858
+ width: 52px;
859
+ display: block;
860
+ }
861
+
862
+ /* Updates */
863
+ #wpadminbar #wp-admin-bar-updates {
864
+ text-align: center;
865
+ }
866
+
867
+ #wpadminbar #wp-admin-bar-updates .ab-icon:before {
868
+ top: 3px;
869
+ }
870
+
871
+ /* Comments */
872
+ #wpadminbar #wp-admin-bar-comments .ab-icon {
873
+ margin: 0;
874
+ }
875
+
876
+ #wpadminbar #wp-admin-bar-comments .ab-icon:before {
877
+ display: block;
878
+ font-size: 34px;
879
+ height: 46px;
880
+ line-height: 47px;
881
+ top: 0;
882
+ }
883
+
884
+ /* My Account */
885
+ #wpadminbar #wp-admin-bar-my-account > a {
886
+ position: relative;
887
+ white-space: nowrap;
888
+ text-indent: 150%; /* More than 100% indention is needed since this element has padding */
889
+ width: 28px;
890
+ padding: 0 10px;
891
+ overflow: hidden; /* Prevent link text from forcing horizontal scrolling on mobile */
892
+ }
893
+
894
+ #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
895
+ position: absolute;
896
+ top: 13px;
897
+ right: 10px;
898
+ width: 26px;
899
+ height: 26px;
900
+ }
901
+
902
+ #wpadminbar #wp-admin-bar-user-actions.ab-submenu {
903
+ padding: 0;
904
+ }
905
+
906
+ #wpadminbar #wp-admin-bar-user-actions.ab-submenu img.avatar {
907
+ display: none;
908
+ }
909
+
910
+ #wpadminbar #wp-admin-bar-my-account.with-avatar #wp-admin-bar-user-actions > li {
911
+ margin: 0;
912
+ }
913
+
914
+ #wpadminbar #wp-admin-bar-user-info .display-name {
915
+ height: auto;
916
+ font-size: 16px;
917
+ line-height: 24px;
918
+ color: #eee;
919
+ }
920
+
921
+ #wpadminbar #wp-admin-bar-user-info a {
922
+ padding-top: 4px;
923
+ }
924
+
925
+ #wpadminbar #wp-admin-bar-user-info .username {
926
+ line-height: 0.8 !important;
927
+ margin-bottom: -2px;
928
+ }
929
+
930
+ /* Show only default top level items */
931
+ #wp-toolbar > ul > li {
932
+ display: none;
933
+ }
934
+
935
+ #wpadminbar li#wp-admin-bar-menu-toggle,
936
+ #wpadminbar li#wp-admin-bar-wp-logo,
937
+ #wpadminbar li#wp-admin-bar-my-sites,
938
+ #wpadminbar li#wp-admin-bar-updates,
939
+ #wpadminbar li#wp-admin-bar-site-name,
940
+ #wpadminbar li#wp-admin-bar-customize,
941
+ #wpadminbar li#wp-admin-bar-new-content,
942
+ #wpadminbar li#wp-admin-bar-edit,
943
+ #wpadminbar li#wp-admin-bar-comments,
944
+ #wpadminbar li#wp-admin-bar-my-account {
945
+ display: block;
946
+ }
947
+
948
+ /* Allow dropdown list items to appear normally */
949
+ #wpadminbar li:hover ul li,
950
+ #wpadminbar li:focus-within ul li,
951
+ #wpadminbar li:hover ul li:hover ul li {
952
+ display: list-item;
953
+ }
954
+
955
+ /* Override default min-width so dropdown lists aren't stretched
956
+ to 100% viewport width at responsive sizes. */
957
+ #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper {
958
+ min-width: -webkit-fit-content;
959
+ min-width: -moz-fit-content;
960
+ min-width: fit-content;
961
+ }
962
+
963
+ #wpadminbar ul#wp-admin-bar-root-default > li {
964
+ margin-right: 0;
965
+ }
966
+
967
+ /* Experimental fix for touch toolbar dropdown positioning */
968
+ #wpadminbar .ab-top-menu,
969
+ #wpadminbar .ab-top-secondary,
970
+ #wpadminbar #wp-admin-bar-wp-logo,
971
+ #wpadminbar #wp-admin-bar-my-sites,
972
+ #wpadminbar #wp-admin-bar-site-name,
973
+ #wpadminbar #wp-admin-bar-updates,
974
+ #wpadminbar #wp-admin-bar-comments,
975
+ #wpadminbar #wp-admin-bar-new-content,
976
+ #wpadminbar #wp-admin-bar-edit,
977
+ #wpadminbar #wp-admin-bar-my-account {
978
+ position: static;
979
+ }
980
+
981
+ #wpadminbar #wp-admin-bar-my-account {
982
+ float: right;
983
+ }
984
+
985
+ .network-admin #wpadminbar ul#wp-admin-bar-top-secondary > li#wp-admin-bar-my-account {
986
+ margin-right: 0;
987
+ }
988
+
989
+ /* Realign arrows on taller responsive submenus */
990
+
991
+ #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before {
992
+ top: 10px;
993
+ left: 0;
994
+ }
995
+ }
996
+
997
+ /* Smartphone */
998
+ @media screen and (max-width: 600px) {
999
+ /* Removed: #wpadminbar { position: absolute; } */
1000
+
1001
+ #wp-responsive-overlay {
1002
+ position: fixed;
1003
+ top: 0;
1004
+ left: 0;
1005
+ width: 100%;
1006
+ height: 100%;
1007
+ z-index: 400;
1008
+ }
1009
+
1010
+ #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper {
1011
+ width: 100%;
1012
+ left: 0;
1013
+ }
1014
+
1015
+ #wpadminbar .menupop .menupop > .ab-item:before {
1016
+ display: none;
1017
+ }
1018
+
1019
+ #wpadminbar #wp-admin-bar-wp-logo.menupop .ab-sub-wrapper {
1020
+ margin-left: 0;
1021
+ }
1022
+
1023
+ #wpadminbar .ab-top-menu > .menupop li > .ab-sub-wrapper {
1024
+ margin: 0;
1025
+ width: 100%;
1026
+ top: auto;
1027
+ left: auto;
1028
+ position: relative;
1029
+ }
1030
+
1031
+ #wpadminbar .ab-top-menu > .menupop li > .ab-sub-wrapper .ab-item {
1032
+ font-size: 16px;
1033
+ padding: 6px 15px 19px 30px;
1034
+ }
1035
+
1036
+ #wpadminbar li:hover ul li ul li {
1037
+ display: list-item;
1038
+ }
1039
+
1040
+ #wpadminbar li#wp-admin-bar-wp-logo,
1041
+ #wpadminbar li#wp-admin-bar-updates {
1042
+ display: none;
1043
+ }
1044
+
1045
+ /* Make submenus full-width at this size */
1046
+
1047
+ #wpadminbar .ab-top-menu > .menupop li > .ab-sub-wrapper {
1048
+ position: static;
1049
+ box-shadow: none;
1050
+ }
1051
+ }
1052
+
1053
+ /* Very narrow screens */
1054
+ @media screen and (max-width: 400px) {
1055
+ #wpadminbar li#wp-admin-bar-comments {
1056
+ display: none;
1057
+ }
1058
+ }
assets/css/admin-tables.css ADDED
@@ -0,0 +1,57 @@
1
+ .column-error_status .dashicons-editor-help {
2
+ color: #767676;
3
+ }
4
+ .column-sources .dashicons,
5
+ .column-sources_with_invalid_output .dashicons {
6
+ margin-right: 5px;
7
+ }
8
+ .column-source .dashicons-admin-plugins,
9
+ .column-sources_with_invalid_output .dashicons-admin-plugins {
10
+ color: #64a2e9;
11
+ }
12
+ .column-source .dashicons-admin-appearance,
13
+ .column-sources_with_invalid_output .dashicons-admin-appearance {
14
+ color: #ebb04f;
15
+ }
16
+ .column-source, .dashicons-wordpress-alt,
17
+ .column-sources_with_invalid_output .dashicons-wordpress-alt {
18
+ color: #92b371;
19
+ }
20
+ .amp-logo-icon {
21
+ background-image: url( '../images/amp-logo-icon.svg' );
22
+ background-color: transparent;
23
+ background-size: 20px 20px;
24
+ height: 20px;
25
+ width: 20px;
26
+ display: inline-block;
27
+ }
28
+ .column-error_status .error-status {
29
+ line-height: 20px;
30
+ display: inline-block;
31
+ position: relative;
32
+ vertical-align: top;
33
+ margin-left: 10px;
34
+ }
35
+ td.column-found_elements_and_attributes {
36
+ color: #970010;
37
+ }
38
+ td.column-found_elements_and_attributes div {
39
+ margin-bottom: 0.6rem;
40
+ }
41
+ .column-error_status .dashicons-flag.new {
42
+ color: #d98501;
43
+ }
44
+ .column-error_status .dashicons-yes.new {
45
+ color: #ff0000;
46
+ }
47
+ .column-error_status .dashicons-warning.rejected {
48
+ color: #68c6ff;
49
+ }
50
+ .column-sources .source,
51
+ .column-sources_with_invalid_output .source {
52
+ margin-bottom: 10px;
53
+ display: block;
54
+ }
55
+ .wrap .wp-heading-inline + .page-title-action {
56
+ margin-left: 1rem;
57
+ }
assets/css/amp-default.css CHANGED
@@ -1,11 +1,25 @@
1
- .amp-wp-enforced-sizes {
2
- /** Our sizes fallback is 100vw, and we have a padding on the container; the max-width here prevents the element from overflowing. **/
3
- max-width: 100%;
4
- margin: 0 auto;
5
- }
6
-
7
- .amp-wp-unknown-size img {
8
/** Worst case scenario when we can't figure out dimensions for an image. **/
9
/** Force the image into a box of fixed dimensions and use object-fit to scale. **/
10
object-fit: contain;
11
}
1
+ .amp-wp-unknown-size [src] {
2
/** Worst case scenario when we can't figure out dimensions for an image. **/
3
/** Force the image into a box of fixed dimensions and use object-fit to scale. **/
4
object-fit: contain;
5
}
6
+
7
+ amp-fit-text blockquote,
8
+ amp-fit-text h1,
9
+ amp-fit-text h2,
10
+ amp-fit-text h3,
11
+ amp-fit-text h4,
12
+ amp-fit-text h5,
13
+ amp-fit-text h6 {
14
+ font-size: inherit;
15
+ }
16
+
17
+ /**
18
+ * Override a style rule in Twenty Sixteen and Twenty Seventeen.
19
+ * It set display:none for audio elements.
20
+ * This selector is the same, though it adds body and uses amp-audio instead of audio.
21
+ */
22
+ body amp-audio:not([controls]) {
23
+ display: inline-block;
24
+ height: auto;
25
+ }
assets/css/amp-editor-blocks.css ADDED
@@ -0,0 +1,4 @@
1
+ .is-amp-fit-text + .blocks-font-size > .components-font-size-picker__buttons,
2
+ .is-amp-fit-text + .blocks-font-size > .components-font-size-picker__custom-input {
3
+ display: none;
4
+ }
assets/css/amp-post-meta-box.css CHANGED
@@ -64,3 +64,16 @@
64
line-height: 280%;
65
}
66
}
64
line-height: 280%;
65
}
66
}
67
+
68
+ .amp-block-validation-errors {
69
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
70
+ font-size: 13px;
71
+ line-height: 1.5;
72
+ }
73
+ .amp-block-validation-errors .amp-block-validation-errors__summary {
74
+ margin: 0.5em 0;
75
+ padding: 2px;
76
+ }
77
+ .amp-block-validation-errors .amp-block-validation-errors__list {
78
+ padding-left: 2.5em;
79
+ }
assets/css/amp-validation-error-taxonomy.css ADDED
@@ -0,0 +1,279 @@
1
+ #col-left {
2
+ display: none;
3
+ }
4
+ #col-right {
5
+ float: none;
6
+ width: auto;
7
+ }
8
+
9
+ /* Move the 'All dates' filter to the right of the new status and type filters */
10
+ #filter-by-date {
11
+ float: none;
12
+ }
13
+
14
+ /* Improve column widths */
15
+ td.column-details pre,
16
+ td.column-sources pre {
17
+ overflow: auto;
18
+ }
19
+
20
+ th.column-created_date_gmt,
21
+ th.column-error_type {
22
+ width: 15%;
23
+ }
24
+
25
+ td.column-error .error-code {
26
+ font-family: Consolas, Monaco, monospace;
27
+ }
28
+
29
+ th.column-status {
30
+ width: 15%;
31
+ }
32
+
33
+ .fixed th.column-posts {
34
+ width: 10%;
35
+ }
36
+
37
+ /* Details column */
38
+ .column-details .details-attributes__summary {
39
+ display: flex;
40
+ justify-content: space-between;
41
+ align-items: center;
42
+ }
43
+
44
+ details[open] .details-attributes__summary {
45
+ font-weight: 600;
46
+ margin-bottom: 15px;
47
+ }
48
+
49
+ .column-details .details-attributes__summary::-webkit-details-marker,
50
+ .column-details .notice details > summary::-webkit-details-marker {
51
+ display: none;
52
+ }
53
+ .details-attributes__summary::after,
54
+ .single-error-detail-summary::after {
55
+ order: 99;
56
+ width: 12px;
57
+ height: 12px;
58
+ background-image: url("../images/down-triangle.svg");
59
+ background-size: cover;
60
+ background-position: center;
61
+ content: "";
62
+ }
63
+
64
+ tr.expanded .details-attributes__summary::after,
65
+ details.single-error-detail[open] .single-error-detail-summary::after {
66
+ transform: rotate(180deg);
67
+ }
68
+
69
+ .notice .detailed {
70
+ padding-left: 15px;
71
+ }
72
+
73
+ .notice .detailed details {
74
+ padding-bottom: 16px;
75
+ }
76
+
77
+ .notice .detailed details .detailed {
78
+ padding-left: 32px;
79
+ font-family: Consolas, Monaco, monospace;
80
+ }
81
+
82
+ .details-attributes__title code,
83
+ .notice .detailed summary code {
84
+ display: inline-block;
85
+ min-width: 240px;
86
+ margin-left: 18px;
87
+ font-weight: 600;
88
+ }
89
+
90
+ .details-attributes__title code {
91
+ margin-left: 0;
92
+ }
93
+
94
+ .details-attributes__list {
95
+ margin-top: 0;
96
+ padding-left: 0;
97
+ list-style: none;
98
+ font-family: Consolas, Monaco, monospace;
99
+ }
100
+
101
+ .details-attributes__list li {
102
+ word-break: break-all;
103
+ }
104
+
105
+ .details-attributes__attr {
106
+ font-weight: 600;
107
+ }
108
+
109
+ .column-sources_with_invalid_output details[open] .details-attributes__summary {
110
+ margin-bottom: 5px;
111
+ }
112
+ .column-sources_with_invalid_output details > div {