diff --git a/Gruntfile.js b/Gruntfile.js index 0d421488f79..725b78af2a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -110,7 +110,7 @@ module.exports = function( grunt ) { var commitHash, lsOutput, versionAppend, paths; commitHash = stdout.shift(); lsOutput = stdout.shift(); - versionAppend = commitHash + '-' + new Date().toISOString().replace( /\.\d+/, '' ).replace( /-|:/g, '' ); + versionAppend = new Date().toISOString().replace( /\.\d+/, '' ).replace( /-|:/g, '' ) + '-' + commitHash; paths = lsOutput.trim().split( /\n/ ).filter( function( file ) { return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*|webpack.*|languages\/README.*)/.test( file ); diff --git a/amp.php b/amp.php index ab892aca2d9..18f7d03d359 100644 --- a/amp.php +++ b/amp.php @@ -5,7 +5,7 @@ * Plugin URI: https://github.com/automattic/amp-wp * Author: WordPress.com VIP, XWP, Google, and contributors * Author URI: https://github.com/Automattic/amp-wp/graphs/contributors - * Version: 1.0-beta4 + * Version: 1.0-RC1 * Text Domain: amp * Domain Path: /languages/ * License: GPLv2 or later @@ -49,7 +49,7 @@ function _amp_print_composer_install_admin_notice() { define( 'AMP__FILE__', __FILE__ ); define( 'AMP__DIR__', dirname( __FILE__ ) ); -define( 'AMP__VERSION', '1.0-beta4' ); +define( 'AMP__VERSION', '1.0-RC1' ); require_once AMP__DIR__ . '/includes/class-amp-autoloader.php'; AMP_Autoloader::register(); @@ -177,6 +177,24 @@ function amp_init() { // Add actions for legacy post templates. add_action( 'wp', 'amp_maybe_add_actions' ); + + /* + * Broadcast plugin updates. + * Note that AMP_Options_Manager::get_option( 'version', '0.0' ) cannot be used because + * version was new option added, and in that case default would never be used for a site + * upgrading from a version prior to 1.0. So this is why get_option() is currently used. + */ + $options = get_option( AMP_Options_Manager::OPTION_NAME, array() ); + $old_version = isset( $options['version'] ) ? $options['version'] : '0.0'; + if ( AMP__VERSION !== $old_version ) { + /** + * Triggers when after amp_init when the plugin version has updated. + * + * @param string $old_version Old version. + */ + do_action( 'amp_plugin_update', $old_version ); + AMP_Options_Manager::update_option( 'version', AMP__VERSION ); + } } /** diff --git a/assets/css/amp-validation-error-taxonomy.css b/assets/css/amp-validation-error-taxonomy.css index ed56caf5a35..937ca08159d 100644 --- a/assets/css/amp-validation-error-taxonomy.css +++ b/assets/css/amp-validation-error-taxonomy.css @@ -203,14 +203,14 @@ details.single-error-detail[open] .single-error-detail-summary::after { body.taxonomy-amp_validation_error .wp-list-table .new th, body.taxonomy-amp_validation_error .wp-list-table .new td, tr.expanded.new + tr > td:first-of-type, -body.post-type-amp_invalid_url .wp-list-table .new th, -body.post-type-amp_invalid_url .wp-list-table .new td { +body.post-type-amp_validated_url .wp-list-table .new th, +body.post-type-amp_validated_url .wp-list-table .new td { background-color: #fef7f1; } body.taxonomy-amp_validation_error .wp-list-table .new th.check-column, tr.expanded.new + tr > td:first-of-type, -body.post-type-amp_invalid_url .wp-list-table .new th.check-column { +body.post-type-amp_validated_url .wp-list-table .new th.check-column { border-left: 4px solid #d54e21; } diff --git a/assets/css/amp-validation-single-error-url.css b/assets/css/amp-validation-single-error-url.css index d8a8db2510b..63ba02c8b4e 100644 --- a/assets/css/amp-validation-single-error-url.css +++ b/assets/css/amp-validation-single-error-url.css @@ -110,7 +110,7 @@ table.striped > tbody > tr.even { display: none; } -.amp-invalid-url a { +.amp-validated-url a { text-decoration: none; } diff --git a/assets/js/amp-invalid-url-post-edit-screen.js b/assets/js/amp-validated-url-post-edit-screen.js similarity index 99% rename from assets/js/amp-invalid-url-post-edit-screen.js rename to assets/js/amp-validated-url-post-edit-screen.js index 60fcd9880bb..72c45575412 100644 --- a/assets/js/amp-invalid-url-post-edit-screen.js +++ b/assets/js/amp-validated-url-post-edit-screen.js @@ -1,6 +1,6 @@ -/* exported ampInvalidUrlPostEditScreen */ +/* exported ampValidatedUrlPostEditScreen */ -const ampInvalidUrlPostEditScreen = ( function() { // eslint-disable-line no-unused-vars +const ampValidatedUrlPostEditScreen = ( function() { // eslint-disable-line no-unused-vars let component = { data: { l10n: { diff --git a/assets/js/amp-invalid-urls-index.js b/assets/js/amp-validated-urls-index.js similarity index 83% rename from assets/js/amp-invalid-urls-index.js rename to assets/js/amp-validated-urls-index.js index 49ff6b7d887..3cc1572c599 100644 --- a/assets/js/amp-invalid-urls-index.js +++ b/assets/js/amp-validated-urls-index.js @@ -1,6 +1,6 @@ -/* exported ampInvalidUrlsIndex */ +/* exported ampValidatedUrlsIndex */ -const ampInvalidUrlsIndex = ( function() { // eslint-disable-line no-unused-vars +const ampValidatedUrlsIndex = ( function() { // eslint-disable-line no-unused-vars let component = { classes: {} }; diff --git a/includes/amp-helper-functions.php b/includes/amp-helper-functions.php index f3adc45d045..777f70b120f 100644 --- a/includes/amp-helper-functions.php +++ b/includes/amp-helper-functions.php @@ -196,7 +196,7 @@ function amp_add_amphtml_link() { // Check to see if there are known unaccepted validation errors for this URL. if ( current_theme_supports( AMP_Theme_Support::SLUG ) ) { - $validation_errors = AMP_Invalid_URL_Post_Type::get_invalid_url_validation_errors( $current_url, array( 'ignore_accepted' => true ) ); + $validation_errors = AMP_Validated_URL_Post_Type::get_invalid_url_validation_errors( $current_url, array( 'ignore_accepted' => true ) ); $error_count = count( $validation_errors ); if ( $error_count > 0 ) { echo "