Thanks for taking the time to contribute!
To clone this repository
$ git clone --recursive [email protected]:Automattic/amp-wp.git
The file class-amp-allowed-tags-generated.php
has the AMP specification's allowed tags and attributes. It's used in sanitization.
To update that file:
cd
to the root of this plugin- run
bash bin/amphtml-update.sh
That script is intended for a Linux environment like VVV.
The following script creates a post in order to test support for WordPress media and embeds. To run it:
ssh
into an environment like VVVcd
to the root of this plugin- run
wp eval-file bin/create-embed-test-post.php
- go to the URL that is output in the command line
The following script adds an instance of every default WordPress widget to the first registered sidebar. To run it:
ssh
into an environment like VVVcd
to the root of this plugin- run
wp eval-file bin/add-test-widgets-to-sidebar.php
- There will be a message indicating which sidebar has the widgets. Please visit a page with that sidebar.
The following script creates a post with comments in order to test support for WordPress comments. To run it:
ssh
into an environment like VVVcd
to the root of this plugin- run
wp eval-file bin/create-comments-on-test-post.php
- go to the URL that is output in the command line
Please run these tests in an environment with WordPress unit tests installed, like VVV.
Run tests:
$ phpunit
Run tests with an HTML coverage report:
$ phpunit --coverage-html /tmp/report
When you push a commit to your PR, Travis CI will run the PHPUnit tests and sniffs against the WordPress Coding Standards.
Contributors who want to make a new release, follow these steps:
- Bump plugin versions in
package.json
(×1),package-lock.json
(×1, just donpm install
first),composer.json
(×1), and inamp.php
(×2: the metadata block in the header and also theAMP__VERSION
constant). - Add changelog entry to readme.
- Merge release branch into
master
. - Run
grunt deploy
to to commit the plugin to WordPress.org. - Create new release on GitHub targeting
master
, with the new plugin version as the tag and release title. Attaching theamp.zip
build to the release. Publish.