diff --git a/amp.php b/amp.php index 883aaa78bc5..76164b750c1 100644 --- a/amp.php +++ b/amp.php @@ -5,7 +5,7 @@ * Plugin URI: https://amp-wp.org * Author: AMP Project Contributors * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors - * Version: 1.1.0 + * Version: 1.1.1 * Text Domain: amp * Domain Path: /languages/ * License: GPLv2 or later @@ -115,7 +115,7 @@ function _amp_print_build_needed_notice() { define( 'AMP__FILE__', __FILE__ ); define( 'AMP__DIR__', dirname( __FILE__ ) ); -define( 'AMP__VERSION', '1.1.0' ); +define( 'AMP__VERSION', '1.1.1' ); /** * Print admin notice if plugin installed with incorrect slug (which impacts WordPress's auto-update system). diff --git a/bin/tag-built.sh b/bin/tag-built.sh index 88fc02f7ccc..1665521a250 100755 --- a/bin/tag-built.sh +++ b/bin/tag-built.sh @@ -2,11 +2,15 @@ set -e -tag=$(git describe --tags) +tag=$(cat build/amp.php | grep 'Version:' | sed 's/.*: //') if [[ -z "$tag" ]]; then - echo "Error: Unable to determine tag." + echo "Error: Unable to determine tag from build/amp.php." exit 1 fi +if ! git rev-parse "$tag" >/dev/null 2>&1; then + echo "Error: Tag does not exist: $tag" + exit 2 +fi built_tag="$tag-built" if git rev-parse "$built_tag" >/dev/null 2>&1; then @@ -19,8 +23,9 @@ if ! git diff-files --quiet || ! git diff-index --quiet --cached HEAD --; then exit 3 fi -git checkout "$tag" -npm run build +if [[ -e built ]]; then + rm -rf built +fi mkdir built git clone . built/ cd built diff --git a/contributing.md b/contributing.md index bf6fd9cf605..54cebb34303 100644 --- a/contributing.md +++ b/contributing.md @@ -169,9 +169,10 @@ Contributors who want to make a new release, follow these steps: 7. Run `npm run deploy` to commit the plugin to WordPress.org. 8. Confirm the release is available on WordPress.org; try installing it on a WordPress install and confirm it works. 9. Publish GitHub release. -10. Create built release tag: `git fetch --tags && git checkout $(git tag | tail -n1) && ./bin/tag-built.sh` (then add link from release) -11. Create a new branch off of the release branch (e.g. `update/develop-with-1.0.x`), merge `develop` into it and resolve conflicts (e.g. with version), and then open pull request to merge changes into `develop`. -12. Merge release tag into `master`. -13. Publish release blog post, including link to GitHub release. -14. Close the GitHub milestone and project. -15. Make announcements. +10. Create built release tag (from the just-created `build` directory): `git fetch --tags && ./bin/tag-built.sh` (then add link from release) +11. For new major/minor releases, create a release branch from the tag. Patch versions are made from the release branch. +12. Bump `Stable tag` in the `readme.txt`/`readme.md` in `develop`. Cherry-pick other changes as necessary. +13. Merge release tag into `master`. +14. Publish release blog post, including link to GitHub release. +15. Close the GitHub milestone and project. +16. Make announcements. diff --git a/includes/class-amp-comment-walker.php b/includes/class-amp-comment-walker.php index c5b3f3c79c3..811b98b7e91 100644 --- a/includes/class-amp-comment-walker.php +++ b/includes/class-amp-comment-walker.php @@ -6,7 +6,8 @@ * @package AMP */ -_deprecated_file( __FILE__, '1.1', null, esc_html__( 'AMP_Comment_Walker functionality has been moved to AMP_Comments_Sanitizer.', 'amp' ) ); +/* translators: 1: AMP_Comment_Walker. 2: AMP_Comments_Sanitizer. */ +_deprecated_file( __FILE__, '1.1', null, sprintf( esc_html__( '%1$s functionality has been moved to %2$s.', 'amp' ), 'AMP_Comment_Walker', 'AMP_Comments_Sanitizer' ) ); /** * Class AMP_Comment_Walker diff --git a/includes/class-amp-service-worker.php b/includes/class-amp-service-worker.php index 0dfb36295d7..bc70a78ee9b 100644 --- a/includes/class-amp-service-worker.php +++ b/includes/class-amp-service-worker.php @@ -83,7 +83,8 @@ public static function add_query_var( $vars ) { */ public static function add_cdn_script_caching( $service_workers ) { if ( ! ( $service_workers instanceof WP_Service_Worker_Scripts ) ) { - _doing_it_wrong( __METHOD__, esc_html__( 'Please update to PWA v0.2. Expected argument to be WP_Service_Worker_Cache_Registry.', 'amp' ), '1.1' ); + /* translators: %s: WP_Service_Worker_Cache_Registry. */ + _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Please update to PWA v0.2. Expected argument to be %s.', 'amp' ), 'WP_Service_Worker_Cache_Registry' ), '1.1' ); return; } diff --git a/includes/options/class-amp-options-manager.php b/includes/options/class-amp-options-manager.php index c270c2a522b..8bd4b7ef1f8 100644 --- a/includes/options/class-amp-options-manager.php +++ b/includes/options/class-amp-options-manager.php @@ -537,7 +537,7 @@ public static function handle_updated_theme_support_option() { if ( is_wp_error( $validation ) ) { $review_messages[] = esc_html( sprintf( - /* translators: %1$s is the error message, %2$s is the error code */ + /* translators: 1: error message. 2: error code. */ __( 'However, there was an error when checking the AMP validity for your site.', 'amp' ), $validation->get_error_message(), $validation->get_error_code() @@ -616,7 +616,7 @@ public static function handle_updated_theme_support_option() { if ( $new_errors > 0 && $invalid_url_screen_url ) { $message .= ' ' . wp_kses_post( sprintf( - /* translators: %1$s is URL to review issues, %2$s is count of new errors */ + /* translators: 1: URL to review issues. 2: count of new errors. */ _n( 'Please also review %2$s issue which may need to be fixed (for one URL at least).', 'Please also review %2$s issues which may need to be fixed (for one URL at least).', diff --git a/includes/options/class-amp-options-menu.php b/includes/options/class-amp-options-menu.php index 17b85185692..3ea8476ae03 100644 --- a/includes/options/class-amp-options-menu.php +++ b/includes/options/class-amp-options-menu.php @@ -210,7 +210,7 @@ public function render_theme_support() { %s', diff --git a/includes/options/views/class-amp-analytics-options-submenu-page.php b/includes/options/views/class-amp-analytics-options-submenu-page.php index 655275f48ad..68c0ef3e27e 100644 --- a/includes/options/views/class-amp-analytics-options-submenu-page.php +++ b/includes/options/views/class-amp-analytics-options-submenu-page.php @@ -106,7 +106,7 @@ public function render_title( $has_entries = false ) { /* translators: 1: AMP Analytics docs URL. 2: AMP for WordPress analytics docs URL. 3: AMP analytics code reference. 4: amp-analytics, 5: {. 6: }. 7: ', // Test protection against wp_targeted_link_rel JSON corruption. + 'sources' => array( + array( + 'type' => 'theme', + 'name' => 'twentyseventeen', + ), + ), + ), array( 'code' => 'new', 'sources' => array( @@ -451,6 +461,7 @@ function( $stored_error ) { $error_groups = array( AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_ACK_ACCEPTED_STATUS, AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_ACK_REJECTED_STATUS, + AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_ACK_REJECTED_STATUS, AMP_Validation_Error_Taxonomy::VALIDATION_ERROR_NEW_ACCEPTED_STATUS, );