Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

amp-wp

WordPress plugin for adding AMP support

Subscribe to updates I use amp-wp


Statistics on amp-wp

Number of watchers on Github 1093
Number of open issues 119
Average time to close an issue 2 days
Main language PHP
Average time to merge a PR 2 days
Open pull requests 70+
Closed pull requests 36+
Last commit over 1 year ago
Repo Created about 4 years ago
Repo Last Updated over 1 year ago
Size 8.85 MB
Homepage https://wordpress...
Organization / Authorautomattic
Latest Release0.6.2
Contributors9
Page Updated
Do you use amp-wp? Leave a review!
View open issues (119)
View amp-wp activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating amp-wp for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

AMP for WordPress

Banner Enable Accelerated Mobile Pages (AMP) on your WordPress site.

Contributors: batmoo, joen, automattic, potatomaster, albertomedina, google, xwp, westonruter
Tags: amp, mobile
Requires at least: 4.7
Tested up to: 4.9
Stable tag: 0.6.0
License: GPLv2 or later
Requires PHP: 5.3

Build Status Built with Grunt

Description

This plugin adds support for the Accelerated Mobile Pages (AMP) Project, which is an open source initiative that aims to provide mobile optimized content that can load instantly everywhere.

With the plugin active, all posts on your site will have dynamically generated AMP-compatible versions, accessible by appending /amp/ to the end your post URLs. For example, if your post URL is http://example.com/2016/01/01/amp-on/, you can access the AMP version at http://example.com/2016/01/01/amp-on/amp/. If you do not have pretty permalinks enabled, you can do the same thing by appending ?amp=1, i.e. http://example.com/?p=123&amp=1

Note #1: homepage, the blog index, and archives are not currently supported.

Note #2: this plugin only creates AMP content but does not automatically display it to your users when they visit from a mobile device. That is handled by AMP consumers such as Google Search. For more details, see the AMP Project FAQ.

Follow along with or contribute to the development of this plugin on GitHub. For more information on the plugin, how the plugin works and how to configure and extend it, please see the project wiki.

Screenshots

Post rendered in AMP template.

Post rendered in AMP template.

Customizing appearance of AMP template.

Customizing appearance of AMP template.

Article from New York Post showing customized AMP template.

Article from New York Post showing customized AMP template.

Article from TNW showing customized AMP template.

Article from TNW showing customized AMP template.

Article from Halfbrick showing customized AMP template.

Article from Halfbrick showing customized AMP template.

Installation

  1. Upload the folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. You may need to refresh your permalinks by going to Settings > Permalinks and tapping the Save button.

Changelog

0.7 (unreleased)

  • Add support for canonical AMP, if the theme registers support for it with add_theme_support( 'amp' ). See #857, #856. Props westonruter, kaitnyl, ThierryA.
  • Add support for all default WordPress widgets. See #921, #917. Props kienstra, westonruter.
  • Add support for more default embeds: Issuu, Post, Meetup, Reddit, Screencast, Tumblr, and WordPress Plugin Directory. See #889. Props kaitnyl.
  • Allow native WordPress commenting, in fully valid AMP. See #871, #909. Props DavidCramer, westonruter.
  • Creation of AMP-related notifications, on entering invalid content in the 'classic' editor. See #912. Props kienstra, westonruter, ThierryA.
  • Add output buffering, ensuring the entire page is valid AMP. See #929, #857. Props westonruter, ThierryA.
  • Update the generated sanitizer file to the AMP spec, and simplify the file that generates it. See #929. Props westonruter.
  • Add validation of host names in URLs. See #983. Props rubengonzalezmrf.

See 0.7 milestone.

0.6.0 (2018-01-23)

  • Add support for the page post type. A new page.php is introduced with template parts factored out (html-start.php, header.php, footer.php, html-end.php) and re-used from single.php. Note that AMP URLs will end in ?amp instead of /amp/. See #825. Props technosailor, ThierryA, westonruter.
  • Add AMP post preview button alongside non-AMP preview button. See #813. Props ThierryA, westonruter.
  • Add ability to disable AMP on a per-post basis via toggle in publish metabox. See #813. Props ThierryA, westonruter.
  • Add AMP settings admin screen for managing which post types have AMP support, eliminating the requirement to add add_post_type_support() calls in theme or plugin. See #811. Props ThierryA, westonruter.
  • Add generator meta tag for AMP. See #810. Props vaporwavre.
  • Add code quality checking via phpcs, eslint, jscs, and jshint. See #795. Props westonruter.
  • Add autoloader to reduce complexity. See #828. Props mikeschinkel, westonruter, ThierryA.
  • Fix Polldaddy amd SoundCloud embeds. Add vanilla WordPress embed test page. A new bin/create-embed-test-post.php wp-cli script is introduced. See #829. Props kienstra, westonruter, ThierryA.
  • Merge AMP Customizer into main Customizer. See #819. Props kaitnyl, westonruter.
  • Update AMP HTML tags and attributes. A new bin/amphtml-update.sh bash script is introduced. Fixes Playbuzz. See #823. Props kienstra, ThierryA, westonruter.
  • Remove erroneous hash from id on amp-wp-header. See #853. Props eshannon3.

See 0.6 milestone.

0.5.1 (2017-08-17)

  • Fix: issues with invalid tags not being stripped out (e.g. script tags) (h/t tmmbecker, fahmi182, pppdog, seejacobscott, RavanH, jenniejj, lkraav, simonrperry for the reports).
  • Fix: issues with dimension extraction for protocol-less and relative URLs (h/t ktmn for the report).

0.5 (2017-08-04)

  • Whitelist Sanitizer: Replace Blacklist Sanitizer with a whitelist-based approach using the AMP spec (props delputnam)
  • Image Dimensions: Replace fastimage with fasterimage for PHP 5.4+. Enables faster downloads and wider support (props gititon)
  • Embed Handlers: Added support for Vimeo, SoundCloud, Pinterest (props amedina) and PlayBuzz (props lysk88)
  • Analytics: UI for easier addition of analytics tags (props amedina)
  • Fix: parse query strings properly (props amyevans)
  • Fix: Old slug redirect for AMP URLs (props rahulsprajapati)
  • Fix: Handle issues with data uri images in CSS (props trepmal)
  • Fix: Add amp-video js for amp-video tags (props ptbello)
  • Fix: Output CSS for feature image (props mjangda)
  • Fix: Fix attribute when adding AMP Mustache lib (props luigitec)
  • Fix: Various documentation updates (props piersb, bhhaskin)
  • Fix: PHP Warnings from register_customizer_ui (props jahvi)
  • Fix: Coding Standards (props paulschreiber)

0.4.2 (2016-10-13)

  • Fix: Prevent validation errors for html tag (h/t Maxime2 and everyone else that reported this error)
  • Fix: Handle variable name conflict that was causing content_max_width to be ignored (h/t mimancillas)
  • Fix: Prevent errors when nodes don't have attributes (h/t stephenmax)
  • Fix: Back-compat for 4.5 (add sanitize_hex_color function, h/t xotihcan)
  • Fix: Handle gif featured images (h/t protocolil)
  • Documentation updates (props troyxmccall)

0.4.1 (2016-10-10)

  • Fix: Don't fire the_content for featured image output
  • Fix: Don't show comment link when disabled and no comments on post (h/t neotrope)
  • Fix: strip !important from inline styles (h/t compointdesigner and enriccardonagmailcom)

0.4 (2016-10-06)

  • New template: spiffy, shiny, and has the fresh theme smell (props allancole and the Automattic Theme Team).
  • Warning: The template update has potential breaking changes. Please see https://wordpress.org/support/topic/v0-4-whats-new-and-possible-breaking-changes/
  • AMP Customizer: Pick your colors and make the template your own (props DrewAPicture and 10up)
  • Fix: support for inline styles (props coreymckrill).
  • Fix: no more fatal errors when tags not supported by post type (props david-binda)
  • Fix: no more unnecessary <br> tags.
  • Fix: sanitize children of removed nodes (like empty <a> tags) (props Maxime2).
  • Fix: no more broken YouTube URLs with multiple ?s.
  • Fix: properly handle tel and sms schemes (h/t soundstrategies).
  • Fix: remove amp endpoint on deactivate.
  • New filter: amp_pre_get_permalink if you want a completely custom AMP permalink.

0.3.3 (Aug 18, 2016)

  • Handle many more validation errors (props bcampeau and alleyinteractive).
  • New filter: amp_post_template_dir (props mustafauysal).
  • New template: Nav bar is now it's own template part (props jdevalk).
  • Better ratio for YouTube embeds.
  • Fix: better timezone handling (props rinatkhaziev).
  • Fix: better handling of non-int dimensions (like 100%).
  • Fix: better handling of empty dimensions.
  • Fix: autoplay is a bool-like value.
  • Fix: breakage when using the query_string hook (h/t mkuplens).
  • Fix: don't break really large Twitter IDs.
  • Fix: don't break Instagram shortcodes when using URLs with querystrings.
  • Readme improvements (props nickjohnford, sotayamashita)

0.3.2 (Mar 4, 2016)

  • Jetpack Stats support.
  • Better version of Merriweather and use system fonts for sans-serif (props mattmiklic).
  • Move font to stylesheet so it can be more easily overridden (props mattmiklic).
  • Fix: Template loading issues on Windows. (Thanks to everyone who reported this, especially w33zy for pointing out the validate_file issue.)
  • Fix: don't run AMP on post comment feeds (props kraftbj).
  • Fix: un-break pagination when using a static home page with multiple pages.
  • Fix: force amp-iframe to use https to validate correctly (props mister-ben).
  • Fix: validation for target and video/audio attributes.
  • Fix: clipped images in galleries (thanks tobaco).

0.3.1 (Feb 24, 2016)

  • Allow custom query var (props vaurdan).
  • Fix AMP URLs for non-pretty permalinks (props rakuishi).
  • Fix for password-protected posts.
  • Fix dimension extraction for schema-less or relative image URLs.
  • Better fallback for images with no dimensions.
  • Validation fixes for a tags (props kraftbj).
  • Updated AMP boilerplate.
  • Allow on tags for elements (props Steven Evatt).
  • Prefixed class names.

0.3 (Feb 18, 2016)

  • Fetch dimensions for hotlinked images.
  • Add amp-facebook support.
  • Add some new actions and filters (e.g. amp_init).
  • Fix validation errors for [gallery] shortcodes.
  • Fix issues with path validation on Windows.
  • Fix issues with really squeezed layout.
  • Breaking change: style.css no longer contains the `
amp-wp open issues Ask a question     (View All Issues)
  • about 3 years Trigger a doing it wrong when calling is_amp_endpoint() too early
  • about 3 years Facebook Audience Network
  • about 3 years about HTML Links (Anchor link)
  • about 3 years Image sanitizer only verifies if size (width/height) is not set, but doesn't validate empty values
  • about 3 years Incompatibility with old_slug_redirect
  • about 3 years Unicode quotation marks on feat-img throwing AMP error
  • about 3 years 0.4 upgrade and custom templates
  • about 3 years Embed Handler: DailyMotion
  • about 3 years Embed Handler: SoundCloud
  • about 3 years Customizer: Font Selection
  • about 3 years Customizer: Metadata section
  • about 3 years Customizer: Header Logo
  • about 3 years Can I disable AMP on specific post ?
  • about 3 years Content mismatch between AMP and canonical pages
  • about 3 years amp-youtube validate fail
  • about 3 years Add "visit site" link to top of AMP content
  • about 3 years Automatically add Google Analytics (and others?) when they are already enabled
  • about 3 years rel="stylesheet" - Validation: FAIL
  • about 3 years Custom post type template support not working
  • about 3 years remove author or date from meta with provided examples doesn't work anymore
  • about 3 years 0.4 wp_footer introduction break everything
  • about 3 years 0.4 new shiny template means 0.3.3 customized theme via "amp_post_template_file" filter could break?
  • about 3 years Need Support for Pagination
  • about 3 years Reduce need to go three levels deep in Customizer
  • about 3 years Massive spike in AMP errors in Google Search Console
  • about 3 years Accelerated Mobile Pages (AMP) Validation Errors
  • about 3 years Remove categories and tags from meta
  • about 3 years The AMP plugin doesnΒ΄t work with Domain Mapping?
  • about 3 years Validation errros
  • about 3 years AMP version of posts not visible in the Customizer
amp-wp open pull requests (View All Pulls)
  • Adding backwards compatibility for older versions of WordPress
  • Unify wpcom and Jetpack helpers
  • Remove iframe if protocol is http
  • Add support for Archive / Authors / Tags and pagination
  • [WIP] Handle additional validation errors
  • Make sure image exists before trying to fetch via fastimage
  • Modifying class-amp-blacklist-sanitizer to handle tag specific attrib…
  • Remove attributes that start with xml
  • Add AMP template/style editor using the Customizer
  • Add support for pages
  • filter `amp_template_dir` added
  • Update class-amp-base-embed-handler.php
  • some more blacklisted attributes
  • Google has requested we move the amphtml link rel higher up on the page.
  • Fix image tags with `px` in width/height attrs.
  • Prevent query_string filters from blocking AMP display (Issue #391)
  • Switching from template_redirect to template_include
  • Add AMP Customizer
  • allow manual template to override template filter
  • Check that the image exists before passing to FastImage
  • Origin/ampvalidator
  • Add ability to go canonical AMP (AMP-only)
  • Switch back to Google Fonts
  • sanitise language_attributes()
  • Embed fallbacks
  • Make amp page work in secondary languages with WPML
  • Amp faster image
  • Allow AMP posts to be viewed in the Customizer
  • Fix template/meta-author on older versions of WP
  • Allow the new `html_tag_attributes` to be filtered
  • Featured image styles should be merged
  • Update class-amp-img-sanitizer.php
  • Update class-amp-img-sanitizer.php
  • Changes to address issue #604.
  • Added AMP Cache utilities to update AMP cache on post updates.
  • Resubmitting new whitelist sanitizer
  • Add empty logo as a fallback to structure metadata
  • Custom template
  • Add capability to generate AMP-only content (AMP-as-Canonical)
  • Add more support for RTL
  • Add/pages
  • Add Support for Jetpack Related Posts
  • Placing closing tag on line 22 per @JoeMittler catch
  • Move php closing tag beyond new code.
  • Fix for AMP height & width invalid attributes
  • AMP Rewrite endpoint enables infinite loops on relative page links.
  • [WIP] - Add amp-live-list comments
  • Avoid potential issues with get_the_date filters
  • [WIP] Issue #843: Validate Gutenberg blocks for AMP compliance
  • #874 Add analytics to theme support
  • #841 Support for default embeds
  • Support extracting dimensions for single URLs
  • Updating iframe placeholder. Using amp-image instead of a div.
  • For normalizing urls with parameters
  • VIP Review Changes
  • [WIP] Add customizer theme support
  • [WIP] Update sanitization reporting
  • Improve build scripts
  • Fix comments not showing due to caching
  • Issue #864: Remove 'sizes' attribute for <amp-iframe> and <amp-video>.
  • [WIP] Add post embed support
  • Focus first radio button in AMP status
  • [WIP] Issue #842: Plugin AMP validation
  • Keep track of the callbacks run (and their sources) when a filter is applied
  • suppress PHPCS warning for show_admin_bar
  • phpcs: set color=true in output
  • Consistently use wp_parse_url()
  • Fix Backtrack Limit Exhausted
  • Prevent schema.org duplicates
  • Discuss: Remove enforcement of 50KB limit on CSS
amp-wp list of languages used
amp-wp latest release notes
0.6.2 0.6.2

See 0.6.2 changelog.

0.6.1 0.6.1

See 0.6.1 changelog.

0.7-beta1 0.7-beta1

See unreleased 0.7 changelog. See the 0.7 Beta 1 blog post for more info.

Other projects in PHP