AMP for WordPress - Version 2.2.4

Version Description

Download this release

Release Info

Developer westonruter
Plugin Icon 128x128 AMP for WordPress
Version 2.2.4
Comparing to
See all releases

Code changes from version 2.2.3 to 2.2.4

amp.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
- * Version: 2.2.3
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
@@ -15,7 +15,7 @@
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
- define( 'AMP__VERSION', '2.2.3' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
+ * Version: 2.2.4
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
+ define( 'AMP__VERSION', '2.2.4' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
includes/sanitizers/trait-amp-noscript-fallback.php CHANGED
@@ -7,6 +7,7 @@
7
 
8
  use AmpProject\Dom\Document;
9
  use AmpProject\Html\Attribute;
 
10
 
11
  /**
12
  * Trait AMP_Noscript_Fallback
@@ -43,6 +44,15 @@ trait AMP_Noscript_Fallback {
43
  );
44
 
45
  foreach ( AMP_Allowed_Tags_Generated::get_allowed_tag( $tag ) as $tag_spec ) { // Normally 1 iteration.
 
 
 
 
 
 
 
 
 
46
  foreach ( $tag_spec['attr_spec_list'] as $attr_name => $attr_spec ) {
47
  $this->noscript_fallback_allowed_attributes[ $attr_name ] = true;
48
  if ( isset( $attr_spec['alternative_names'] ) ) {
7
 
8
  use AmpProject\Dom\Document;
9
  use AmpProject\Html\Attribute;
10
+ use AmpProject\Html\Tag;
11
 
12
  /**
13
  * Trait AMP_Noscript_Fallback
44
  );
45
 
46
  foreach ( AMP_Allowed_Tags_Generated::get_allowed_tag( $tag ) as $tag_spec ) { // Normally 1 iteration.
47
+ if (
48
+ ! (
49
+ ( isset( $tag_spec['tag_spec']['mandatory_ancestor'] ) && Tag::NOSCRIPT === $tag_spec['tag_spec']['mandatory_ancestor'] )
50
+ ||
51
+ ( isset( $tag_spec['tag_spec']['mandatory_parent'] ) && Tag::NOSCRIPT === $tag_spec['tag_spec']['mandatory_parent'] )
52
+ )
53
+ ) {
54
+ continue;
55
+ }
56
  foreach ( $tag_spec['attr_spec_list'] as $attr_name => $attr_spec ) {
57
  $this->noscript_fallback_allowed_attributes[ $attr_name ] = true;
58
  if ( isset( $attr_spec['alternative_names'] ) ) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: google, xwp, rtcamp, automattic, westonruter, albertomedina, schle
3
  Tags: page experience, performance, amp, mobile, optimization, accelerated mobile pages
4
  Requires at least: 4.9
5
  Tested up to: 5.9
6
- Stable tag: 2.2.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
3
  Tags: page experience, performance, amp, mobile, optimization, accelerated mobile pages
4
  Requires at least: 4.9
5
  Tested up to: 5.9
6
+ Stable tag: 2.2.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
vendor/ampproject/amp-toolbox/resources/local_fallback/rtv/metadata CHANGED
@@ -1 +1 @@
1
- {"ampRuntimeVersion":"012203101844000","ampCssUrl":"https://cdn.ampproject.org/rtv/012203101844000/v0.css","canaryPercentage":"0.005","diversions":["002203172113000","022203101844000","032203172113000","042203231914000","052203101844000","112203172113000"],"ltsRuntimeVersion":"012202230359001","ltsCssUrl":"https://cdn.ampproject.org/rtv/012202230359001/v0.css"}
1
+ {"ampRuntimeVersion":"012203172113000","ampCssUrl":"https://cdn.ampproject.org/rtv/012203172113000/v0.css","canaryPercentage":"0.005","diversions":["002203231914000","022203172113000","032203231914000","042203281422000","052203172113000","112203231914000"],"ltsRuntimeVersion":"012202230359001","ltsCssUrl":"https://cdn.ampproject.org/rtv/012202230359001/v0.css"}
vendor/ampproject/amp-toolbox/src/Optimizer/Transformer/OptimizeHeroImages.php CHANGED
@@ -202,7 +202,11 @@ final class OptimizeHeroImages implements Transformer
202
  $node = $document->body;
203
 
204
  while ($node !== null) {
205
- if (! $node instanceof Element) {
 
 
 
 
206
  $node = NodeWalker::nextNode($node);
207
  continue;
208
  }
202
  $node = $document->body;
203
 
204
  while ($node !== null) {
205
+ if (
206
+ ! $node instanceof Element
207
+ ||
208
+ ( $node->parentNode instanceof Element && $node->parentNode->tagName === Tag::NOSCRIPT )
209
+ ) {
210
  $node = NodeWalker::nextNode($node);
211
  continue;
212
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit7f0b05cab048d5d900f407b218d9ccf6::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInitdbb2594419d5483dd57e44708b78a471::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,12 +53,12 @@ class ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInitdbb2594419d5483dd57e44708b78a471::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequiredbb2594419d5483dd57e44708b78a471($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
@@ -70,7 +70,7 @@ class ComposerAutoloaderInitdbb2594419d5483dd57e44708b78a471
70
  * @param string $file
71
  * @return void
72
  */
73
- function composerRequiredbb2594419d5483dd57e44708b78a471($fileIdentifier, $file)
74
  {
75
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit7f0b05cab048d5d900f407b218d9ccf6
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit7f0b05cab048d5d900f407b218d9ccf6', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit7f0b05cab048d5d900f407b218d9ccf6', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire7f0b05cab048d5d900f407b218d9ccf6($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
70
  * @param string $file
71
  * @return void
72
  */
73
+ function composerRequire7f0b05cab048d5d900f407b218d9ccf6($fileIdentifier, $file)
74
  {
75
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitdbb2594419d5483dd57e44708b78a471
8
  {
9
  public static $files = array (
10
  '356506e5d3d2f49e680971cd925046fa' => __DIR__ . '/..' . '/ampproject/amp-toolbox/include/compatibility-fixes.php',
@@ -1426,9 +1426,9 @@ class ComposerStaticInitdbb2594419d5483dd57e44708b78a471
1426
  public static function getInitializer(ClassLoader $loader)
1427
  {
1428
  return \Closure::bind(function () use ($loader) {
1429
- $loader->prefixLengthsPsr4 = ComposerStaticInitdbb2594419d5483dd57e44708b78a471::$prefixLengthsPsr4;
1430
- $loader->prefixDirsPsr4 = ComposerStaticInitdbb2594419d5483dd57e44708b78a471::$prefixDirsPsr4;
1431
- $loader->classMap = ComposerStaticInitdbb2594419d5483dd57e44708b78a471::$classMap;
1432
 
1433
  }, null, ClassLoader::class);
1434
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6
8
  {
9
  public static $files = array (
10
  '356506e5d3d2f49e680971cd925046fa' => __DIR__ . '/..' . '/ampproject/amp-toolbox/include/compatibility-fixes.php',
1426
  public static function getInitializer(ClassLoader $loader)
1427
  {
1428
  return \Closure::bind(function () use ($loader) {
1429
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6::$prefixLengthsPsr4;
1430
+ $loader->prefixDirsPsr4 = ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6::$prefixDirsPsr4;
1431
+ $loader->classMap = ComposerStaticInit7f0b05cab048d5d900f407b218d9ccf6::$classMap;
1432
 
1433
  }, null, ClassLoader::class);
1434
  }
vendor/composer/installed.json CHANGED
@@ -2,17 +2,17 @@
2
  "packages": [
3
  {
4
  "name": "ampproject/amp-toolbox",
5
- "version": "0.11.0",
6
- "version_normalized": "0.11.0.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/ampproject/amp-toolbox-php.git",
10
- "reference": "26efcaa5350b8998433d63bc6770dc6818971fd2"
11
  },
12
  "dist": {
13
  "type": "zip",
14
- "url": "https://api.github.com/repos/ampproject/amp-toolbox-php/zipball/26efcaa5350b8998433d63bc6770dc6818971fd2",
15
- "reference": "26efcaa5350b8998433d63bc6770dc6818971fd2",
16
  "shasum": ""
17
  },
18
  "require": {
@@ -43,7 +43,7 @@
43
  "mck89/peast": "Needed to minify the AMP script.",
44
  "nette/php-generator": "Needed to generate the validator spec PHP classes and interfaces."
45
  },
46
- "time": "2022-04-01T07:16:35+00:00",
47
  "bin": [
48
  "bin/amp"
49
  ],
@@ -73,7 +73,7 @@
73
  "description": "A collection of AMP tools making it easier to publish and host AMP pages with PHP.",
74
  "support": {
75
  "issues": "https://github.com/ampproject/amp-toolbox-php/issues",
76
- "source": "https://github.com/ampproject/amp-toolbox-php/tree/0.11.0"
77
  },
78
  "install-path": "../ampproject/amp-toolbox"
79
  },
2
  "packages": [
3
  {
4
  "name": "ampproject/amp-toolbox",
5
+ "version": "0.11.1",
6
+ "version_normalized": "0.11.1.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/ampproject/amp-toolbox-php.git",
10
+ "reference": "8392ee46e9e241081b8e9fb1f67c16124d2fcf99"
11
  },
12
  "dist": {
13
  "type": "zip",
14
+ "url": "https://api.github.com/repos/ampproject/amp-toolbox-php/zipball/8392ee46e9e241081b8e9fb1f67c16124d2fcf99",
15
+ "reference": "8392ee46e9e241081b8e9fb1f67c16124d2fcf99",
16
  "shasum": ""
17
  },
18
  "require": {
43
  "mck89/peast": "Needed to minify the AMP script.",
44
  "nette/php-generator": "Needed to generate the validator spec PHP classes and interfaces."
45
  },
46
+ "time": "2022-04-08T05:35:07+00:00",
47
  "bin": [
48
  "bin/amp"
49
  ],
73
  "description": "A collection of AMP tools making it easier to publish and host AMP pages with PHP.",
74
  "support": {
75
  "issues": "https://github.com/ampproject/amp-toolbox-php/issues",
76
+ "source": "https://github.com/ampproject/amp-toolbox-php/tree/0.11.1"
77
  },
78
  "install-path": "../ampproject/amp-toolbox"
79
  },
vendor/composer/installed.php CHANGED
@@ -5,18 +5,18 @@
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '9fa03eb685571e3f262394c8e24aea5a67b7ec6b',
9
  'name' => 'ampproject/amp-wp',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'ampproject/amp-toolbox' => array(
14
- 'pretty_version' => '0.11.0',
15
- 'version' => '0.11.0.0',
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../ampproject/amp-toolbox',
18
  'aliases' => array(),
19
- 'reference' => '26efcaa5350b8998433d63bc6770dc6818971fd2',
20
  'dev_requirement' => false,
21
  ),
22
  'ampproject/amp-wp' => array(
@@ -25,7 +25,7 @@
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
- 'reference' => '9fa03eb685571e3f262394c8e24aea5a67b7ec6b',
29
  'dev_requirement' => false,
30
  ),
31
  'fasterimage/fasterimage' => array(
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '1f1116b81a2a87abe6a4ce86d74df282ace1964e',
9
  'name' => 'ampproject/amp-wp',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'ampproject/amp-toolbox' => array(
14
+ 'pretty_version' => '0.11.1',
15
+ 'version' => '0.11.1.0',
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../ampproject/amp-toolbox',
18
  'aliases' => array(),
19
+ 'reference' => '8392ee46e9e241081b8e9fb1f67c16124d2fcf99',
20
  'dev_requirement' => false,
21
  ),
22
  'ampproject/amp-wp' => array(
25
  'type' => 'wordpress-plugin',
26
  'install_path' => __DIR__ . '/../../',
27
  'aliases' => array(),
28
+ 'reference' => '1f1116b81a2a87abe6a4ce86d74df282ace1964e',
29
  'dev_requirement' => false,
30
  ),
31
  'fasterimage/fasterimage' => array(