Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into enhancement/2204-d…
Browse files Browse the repository at this point in the history
…efault-amp-endpoint
  • Loading branch information
pierlon committed Feb 24, 2020
2 parents 5f55c09 + b059e63 commit 8ecb280
Show file tree
Hide file tree
Showing 13 changed files with 352 additions and 1,010 deletions.
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"ext-spl": "*",
"cweagans/composer-patches": "1.6.7",
"fasterimage/fasterimage": "1.5.0",
"sabberworm/php-css-parser": "8.3.0"
"sabberworm/php-css-parser": "dev-master#134f4e6"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "0.6.2",
"mikey179/vfsstream": "1.6.8",
"phpcompatibility/phpcompatibility-wp": "2.1.0",
"roave/security-advisories": "dev-master",
"sirbrillig/phpcs-variable-analysis": "2.6.2",
"wp-cli/wp-cli": "2.4.0",
"sirbrillig/phpcs-variable-analysis": "2.8.1",
"wp-cli/wp-cli": "2.4.1",
"wp-coding-standards/wpcs": "2.2.1",
"xwp/wp-dev-lib": "1.5.0"
},
Expand All @@ -42,6 +42,7 @@
"patches": {
"sabberworm/php-css-parser": {
"Fix parsing CSS selectors which contain commas <https://github.com/sabberworm/PHP-CSS-Parser/pull/138>": "https://github.com/sabberworm/PHP-CSS-Parser/commit/fa139f65c5b098ae652c970b25e6eb03fc495eb4.diff",
"Fix validation of selectors": "patches/php-css-parser-138-extended.patch",
"Validate name-start code points for identifier <https://github.com/sabberworm/PHP-CSS-Parser/pull/185>": "patches/php-css-parser-pull-185.patch"
}
}
Expand All @@ -55,5 +56,12 @@
"psr-4": {
"Amp\\AmpWP\\Tests\\": "tests/php/src/"
}
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
"no-api": true
}
]
}
64 changes: 30 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/admin/class-amp-admin-pointers.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function get_pointers() {
'description' => implode(
' ',
[
esc_html__( 'The Stories experience is being extracted from the AMP plugin into a separate standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ),
esc_html__( 'The Stories experience is being extracted into a standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( 'https://amp-wp.org/documentation/amp-stories/exporting-stories/' ),
Expand Down
6 changes: 3 additions & 3 deletions includes/options/class-amp-options-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ public static function render_stories_deprecation_notice() {
) {
printf(
'<div class="notice notice-warning"><p>%s %s</p></div>',
esc_html__( 'The Stories experience is being extracted from the AMP plugin into a separate standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ),
esc_html__( 'The Stories experience is being extracted into a standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ),
sprintf(
'<a href="%s" target="_blank">%s</a>',
esc_url( 'https://amp-wp.org/documentation/amp-stories/exporting-stories/' ),
Expand All @@ -603,7 +603,7 @@ public static function render_stories_deprecation_notice() {
} elseif ( ! self::is_stories_experience_enabled() && 'toplevel_page_' . self::OPTION_NAME === get_current_screen()->id ) {
printf(
'<div class="notice notice-info"><p>%s</p></div>',
esc_html__( 'The Stories experience has been removed from the AMP plugin. This beta feature is being split into a separate standalone plugin which will be available for installation soon.', 'amp' )
esc_html__( 'The Stories experience is being extracted into a standalone plugin which will be available soon.', 'amp' )
);
}
}
Expand All @@ -628,7 +628,7 @@ public static function render_stories_deprecation_editor_notice() {
}
);
} )( window.wp );",
wp_json_encode( __( 'The Stories experience is being extracted from the AMP plugin into a separate standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ) ),
wp_json_encode( __( 'The Stories experience is being extracted into a standalone plugin which will be available soon. Please back up or export your existing Stories as they will not be available in the next version of the AMP plugin.', 'amp' ) ),
wp_json_encode( __( 'View how to export your Stories', 'amp' ) )
);

Expand Down
2 changes: 1 addition & 1 deletion includes/sanitizers/class-amp-allowed-tags-generated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15428,7 +15428,7 @@ class AMP_Allowed_Tags_Generated {
),
'validate_keyframes' => false,
),
'max_bytes' => 50000,
'max_bytes' => 75000,
'max_bytes_spec_url' => 'https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#maximum-size',
),
'tag_spec' => array(
Expand Down
4 changes: 2 additions & 2 deletions includes/sanitizers/class-amp-style-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ public function sanitize() {
* As with hooks, lower priorities mean they should be included first.
* The higher the priority value, the more likely it will be that the
* stylesheet will be among those excluded due to STYLESHEET_TOO_LONG when
* concatenated CSS reaches 50KB.
* concatenated CSS reaches 75KB.
*
* @todo This will eventually need to be abstracted to not be CMS-specific, allowing for the prioritization scheme to be defined by configuration.
*
Expand Down Expand Up @@ -1442,7 +1442,7 @@ private function get_parsed_stylesheet( $stylesheet, $options = [] ) {
$parsed = null;
$cache_key = null;
$cached = true;
$cache_group = 'amp-parsed-stylesheet-v25'; // This should be bumped whenever the PHP-CSS-Parser is updated or parsed format is updated.
$cache_group = 'amp-parsed-stylesheet-v26'; // This should be bumped whenever the PHP-CSS-Parser is updated or parsed format is updated.

$cache_impacting_options = array_merge(
wp_array_slice_assoc(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@ public static function render_single_url_error_details( $validation_error, $term
echo wp_kses_post(
sprintf(
/* translators: 1: Documentation URL, 2: Documentation URL, 3: !important */
__( 'AMP allows you to <a href="%1$s">style your pages using CSS</a> in much the same way as regular HTML pages, however there are some <a href="%2$s">restrictions</a>. Nevertheless, the AMP plugin automatically inlines external stylesheets, transforms %3$s qualifiers, and uses tree shaking to remove the majority of CSS rules that do not apply to the current page. Nevertheless, AMP does have a 50KB limit and tree shaking cannot always reduce the amount of CSS under this limit; when this happens an excessive CSS error will result.', 'amp' ),
__( 'AMP allows you to <a href="%1$s">style your pages using CSS</a> in much the same way as regular HTML pages, however there are some <a href="%2$s">restrictions</a>. Nevertheless, the AMP plugin automatically inlines external stylesheets, transforms %3$s qualifiers, and uses tree shaking to remove the majority of CSS rules that do not apply to the current page. Nevertheless, AMP does have a 75KB limit and tree shaking cannot always reduce the amount of CSS under this limit; when this happens an excessive CSS error will result.', 'amp' ),
'https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/',
'https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/',
'<code>!important</code>'
Expand Down
Loading

0 comments on commit 8ecb280

Please sign in to comment.