Instant Articles for WP - Version 4.0.3

Version Description

Download this release

Release Info

Developer vkama
Plugin Icon 128x128 Instant Articles for WP
Version 4.0.3
Comparing to
See all releases

Code changes from version 4.0.2 to 4.0.3

facebook-instant-articles.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
- * Version: 4.0.2
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -68,7 +68,7 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
68
 
69
  defined( 'ABSPATH' ) || die( 'Shame on you' );
70
 
71
- define( 'IA_PLUGIN_VERSION', '4.0.2' );
72
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
73
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
74
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
+ * Version: 4.0.3
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
68
 
69
  defined( 'ABSPATH' ) || die( 'Shame on you' );
70
 
71
+ define( 'IA_PLUGIN_VERSION', '4.0.3' );
72
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
73
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
74
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: trrine, olethomas, bjornjohansen, dekode, automattic, facebook
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.8
6
- Stable tag: 4.0.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.8
6
+ Stable tag: 4.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
vendor/autoload.php CHANGED
@@ -2,6 +2,6 @@
2
 
3
  // autoload.php @generated by Composer
4
 
5
- require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837::getLoader();
2
 
3
  // autoload.php @generated by Composer
4
 
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf36cb54df1aca911ac0e2796769910db::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -53,8 +53,9 @@ class ClassLoader
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
56
-
57
  private $classMapAuthoritative = false;
 
 
58
 
59
  public function getPrefixes()
60
  {
@@ -271,6 +272,26 @@ class ClassLoader
271
  return $this->classMapAuthoritative;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Registers this instance as an autoloader.
276
  *
@@ -313,29 +334,34 @@ class ClassLoader
313
  */
314
  public function findFile($class)
315
  {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
  // class map lookup
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
- if ($this->classMapAuthoritative) {
326
  return false;
327
  }
 
 
 
 
 
 
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
- if ($file === null) {
 
 
 
 
337
  // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
  }
340
 
341
  return $file;
@@ -348,9 +374,13 @@ class ClassLoader
348
 
349
  $first = $class[0];
350
  if (isset($this->prefixLengthsPsr4[$first])) {
351
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
- if (0 === strpos($class, $prefix)) {
353
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
 
 
 
 
354
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
  return $file;
356
  }
@@ -399,6 +429,8 @@ class ClassLoader
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
 
 
402
  }
403
  }
404
 
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
 
56
  private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
 
60
  public function getPrefixes()
61
  {
272
  return $this->classMapAuthoritative;
273
  }
274
 
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
  /**
296
  * Registers this instance as an autoloader.
297
  *
334
  */
335
  public function findFile($class)
336
  {
 
 
 
 
 
337
  // class map lookup
338
  if (isset($this->classMap[$class])) {
339
  return $this->classMap[$class];
340
  }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
  return false;
343
  }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
 
351
  $file = $this->findFileWithExtension($class, '.php');
352
 
353
  // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
  $file = $this->findFileWithExtension($class, '.hh');
356
  }
357
 
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
  // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
  }
366
 
367
  return $file;
374
 
375
  $first = $class[0];
376
  if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
+ $length = $this->prefixLengthsPsr4[$first][$search];
384
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
  return $file;
386
  }
429
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
  return $file;
431
  }
432
+
433
+ return false;
434
  }
435
  }
436
 
vendor/composer/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
 
2
- Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
1
 
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837', 'loadClassLoader'));
25
 
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit36fdde57bb31390b63c9fa4f374d8837
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire36fdde57bb31390b63c9fa4f374d8837($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire36fdde57bb31390b63c9fa4f374d8837($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf36cb54df1aca911ac0e2796769910db
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf36cb54df1aca911ac0e2796769910db', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf36cb54df1aca911ac0e2796769910db', 'loadClassLoader'));
25
 
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf36cb54df1aca911ac0e2796769910db::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitf36cb54df1aca911ac0e2796769910db::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequiref36cb54df1aca911ac0e2796769910db($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequiref36cb54df1aca911ac0e2796769910db($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837
8
  {
9
  public static $files = array (
10
  'c65d09b6820da036953a371c8c73a9b1' => __DIR__ . '/..' . '/facebook/graph-sdk/src/Facebook/polyfills.php',
@@ -375,9 +375,9 @@ class ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837
375
  public static function getInitializer(ClassLoader $loader)
376
  {
377
  return \Closure::bind(function () use ($loader) {
378
- $loader->prefixLengthsPsr4 = ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837::$prefixLengthsPsr4;
379
- $loader->prefixDirsPsr4 = ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837::$prefixDirsPsr4;
380
- $loader->classMap = ComposerStaticInit36fdde57bb31390b63c9fa4f374d8837::$classMap;
381
 
382
  }, null, ClassLoader::class);
383
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf36cb54df1aca911ac0e2796769910db
8
  {
9
  public static $files = array (
10
  'c65d09b6820da036953a371c8c73a9b1' => __DIR__ . '/..' . '/facebook/graph-sdk/src/Facebook/polyfills.php',
375
  public static function getInitializer(ClassLoader $loader)
376
  {
377
  return \Closure::bind(function () use ($loader) {
378
+ $loader->prefixLengthsPsr4 = ComposerStaticInitf36cb54df1aca911ac0e2796769910db::$prefixLengthsPsr4;
379
+ $loader->prefixDirsPsr4 = ComposerStaticInitf36cb54df1aca911ac0e2796769910db::$prefixDirsPsr4;
380
+ $loader->classMap = ComposerStaticInitf36cb54df1aca911ac0e2796769910db::$classMap;
381
 
382
  }, null, ClassLoader::class);
383
  }
vendor/composer/installed.json CHANGED
@@ -26,7 +26,7 @@
26
  "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
27
  "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
28
  },
29
- "time": "2017-04-20 14:15:02",
30
  "type": "library",
31
  "extra": {
32
  "branch-alias": {
@@ -71,7 +71,7 @@
71
  "require": {
72
  "php": ">=5.2.7"
73
  },
74
- "time": "2012-10-26 09:13:25",
75
  "type": "library",
76
  "installation-source": "source",
77
  "autoload": {
@@ -91,6 +91,111 @@
91
  "php"
92
  ]
93
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  {
95
  "name": "squizlabs/php_codesniffer",
96
  "version": "2.9.1",
@@ -115,7 +220,7 @@
115
  "require-dev": {
116
  "phpunit/phpunit": "~4.0"
117
  },
118
- "time": "2017-05-22 02:43:20",
119
  "bin": [
120
  "scripts/phpcs",
121
  "scripts/phpcbf"
@@ -189,7 +294,7 @@
189
  "require": {
190
  "squizlabs/php_codesniffer": "^2.8.1"
191
  },
192
- "time": "2017-03-20 23:17:58",
193
  "type": "library",
194
  "installation-source": "dist",
195
  "notification-url": "https://packagist.org/downloads/",
@@ -211,8 +316,8 @@
211
  },
212
  {
213
  "name": "symfony/css-selector",
214
- "version": "v2.8.22",
215
- "version_normalized": "2.8.22.0",
216
  "source": {
217
  "type": "git",
218
  "url": "https://github.com/symfony/css-selector.git",
@@ -227,7 +332,7 @@
227
  "require": {
228
  "php": ">=5.3.9"
229
  },
230
- "time": "2017-05-01 14:31:55",
231
  "type": "library",
232
  "extra": {
233
  "branch-alias": {
@@ -263,110 +368,5 @@
263
  ],
264
  "description": "Symfony CssSelector Component",
265
  "homepage": "https://symfony.com"
266
- },
267
- {
268
- "name": "facebook/facebook-instant-articles-sdk-php",
269
- "version": "v1.6.1",
270
- "version_normalized": "1.6.1.0",
271
- "source": {
272
- "type": "git",
273
- "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
274
- "reference": "511d15d741796c7da68742e565d98f97464d2d6b"
275
- },
276
- "dist": {
277
- "type": "zip",
278
- "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/511d15d741796c7da68742e565d98f97464d2d6b",
279
- "reference": "511d15d741796c7da68742e565d98f97464d2d6b",
280
- "shasum": ""
281
- },
282
- "require": {
283
- "apache/log4php": "2.3.0",
284
- "facebook/graph-sdk": "~5.0",
285
- "php": "^5.4 || ^7.0",
286
- "symfony/css-selector": "2.8.* || ^3.0"
287
- },
288
- "require-dev": {
289
- "fzaninotto/faker": "^1.6.0",
290
- "phpunit/phpunit": "^4.8",
291
- "squizlabs/php_codesniffer": "^2.6.0"
292
- },
293
- "time": "2017-06-20 13:45:09",
294
- "type": "library",
295
- "installation-source": "dist",
296
- "autoload": {
297
- "psr-4": {
298
- "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
299
- }
300
- },
301
- "notification-url": "https://packagist.org/downloads/",
302
- "license": [
303
- "proprietary"
304
- ],
305
- "authors": [
306
- {
307
- "name": "Facebook",
308
- "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php/contributors"
309
- }
310
- ],
311
- "description": "Facebook Instant Articles SDK for PHP",
312
- "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php",
313
- "keywords": [
314
- "articles",
315
- "facebook",
316
- "instant",
317
- "sdk"
318
- ]
319
- },
320
- {
321
- "name": "facebook/facebook-instant-articles-sdk-extensions-in-php",
322
- "version": "v0.1.1",
323
- "version_normalized": "0.1.1.0",
324
- "source": {
325
- "type": "git",
326
- "url": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php.git",
327
- "reference": "f574ad6230ced8d8159b7b59a41ac6238d8d6353"
328
- },
329
- "dist": {
330
- "type": "zip",
331
- "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-extensions-in-php/zipball/f574ad6230ced8d8159b7b59a41ac6238d8d6353",
332
- "reference": "f574ad6230ced8d8159b7b59a41ac6238d8d6353",
333
- "shasum": ""
334
- },
335
- "require": {
336
- "facebook/facebook-instant-articles-sdk-php": "^1.6",
337
- "php": "^5.4 || ^7.0"
338
- },
339
- "require-dev": {
340
- "phpunit/phpunit": "^4.8"
341
- },
342
- "time": "2017-06-26 19:59:19",
343
- "type": "library",
344
- "installation-source": "dist",
345
- "autoload": {
346
- "psr-4": {
347
- "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
348
- }
349
- },
350
- "notification-url": "https://packagist.org/downloads/",
351
- "license": [
352
- "proprietary"
353
- ],
354
- "authors": [
355
- {
356
- "name": "Facebook",
357
- "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php/contributors"
358
- }
359
- ],
360
- "description": "Facebook Instant Articles SDK Extensions in PHP to transform Instant Articles markup file into AMP",
361
- "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php",
362
- "keywords": [
363
- "amp",
364
- "articles",
365
- "extensions",
366
- "facebook",
367
- "instant",
368
- "instantarticles",
369
- "sdk"
370
- ]
371
  }
372
  ]
26
  "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
27
  "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
28
  },
29
+ "time": "2017-04-20T14:15:02+00:00",
30
  "type": "library",
31
  "extra": {
32
  "branch-alias": {
71
  "require": {
72
  "php": ">=5.2.7"
73
  },
74
+ "time": "2012-10-26T09:13:25+00:00",
75
  "type": "library",
76
  "installation-source": "source",
77
  "autoload": {
91
  "php"
92
  ]
93
  },
94
+ {
95
+ "name": "facebook/facebook-instant-articles-sdk-php",
96
+ "version": "v1.6.1",
97
+ "version_normalized": "1.6.1.0",
98
+ "source": {
99
+ "type": "git",
100
+ "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
101
+ "reference": "511d15d741796c7da68742e565d98f97464d2d6b"
102
+ },
103
+ "dist": {
104
+ "type": "zip",
105
+ "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/511d15d741796c7da68742e565d98f97464d2d6b",
106
+ "reference": "511d15d741796c7da68742e565d98f97464d2d6b",
107
+ "shasum": ""
108
+ },
109
+ "require": {
110
+ "apache/log4php": "2.3.0",
111
+ "facebook/graph-sdk": "~5.0",
112
+ "php": "^5.4 || ^7.0",
113
+ "symfony/css-selector": "2.8.* || ^3.0"
114
+ },
115
+ "require-dev": {
116
+ "fzaninotto/faker": "^1.6.0",
117
+ "phpunit/phpunit": "^4.8",
118
+ "squizlabs/php_codesniffer": "^2.6.0"
119
+ },
120
+ "time": "2017-06-20T13:45:09+00:00",
121
+ "type": "library",
122
+ "installation-source": "dist",
123
+ "autoload": {
124
+ "psr-4": {
125
+ "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
126
+ }
127
+ },
128
+ "notification-url": "https://packagist.org/downloads/",
129
+ "license": [
130
+ "proprietary"
131
+ ],
132
+ "authors": [
133
+ {
134
+ "name": "Facebook",
135
+ "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php/contributors"
136
+ }
137
+ ],
138
+ "description": "Facebook Instant Articles SDK for PHP",
139
+ "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php",
140
+ "keywords": [
141
+ "articles",
142
+ "facebook",
143
+ "instant",
144
+ "sdk"
145
+ ]
146
+ },
147
+ {
148
+ "name": "facebook/facebook-instant-articles-sdk-extensions-in-php",
149
+ "version": "v0.1.1",
150
+ "version_normalized": "0.1.1.0",
151
+ "source": {
152
+ "type": "git",
153
+ "url": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php.git",
154
+ "reference": "f574ad6230ced8d8159b7b59a41ac6238d8d6353"
155
+ },
156
+ "dist": {
157
+ "type": "zip",
158
+ "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-extensions-in-php/zipball/f574ad6230ced8d8159b7b59a41ac6238d8d6353",
159
+ "reference": "f574ad6230ced8d8159b7b59a41ac6238d8d6353",
160
+ "shasum": ""
161
+ },
162
+ "require": {
163
+ "facebook/facebook-instant-articles-sdk-php": "^1.6",
164
+ "php": "^5.4 || ^7.0"
165
+ },
166
+ "require-dev": {
167
+ "phpunit/phpunit": "^4.8"
168
+ },
169
+ "time": "2017-06-26T19:59:19+00:00",
170
+ "type": "library",
171
+ "installation-source": "dist",
172
+ "autoload": {
173
+ "psr-4": {
174
+ "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
175
+ }
176
+ },
177
+ "notification-url": "https://packagist.org/downloads/",
178
+ "license": [
179
+ "proprietary"
180
+ ],
181
+ "authors": [
182
+ {
183
+ "name": "Facebook",
184
+ "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php/contributors"
185
+ }
186
+ ],
187
+ "description": "Facebook Instant Articles SDK Extensions in PHP to transform Instant Articles markup file into AMP",
188
+ "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-extensions-in-php",
189
+ "keywords": [
190
+ "amp",
191
+ "articles",
192
+ "extensions",
193
+ "facebook",
194
+ "instant",
195
+ "instantarticles",
196
+ "sdk"
197
+ ]
198
+ },
199
  {
200
  "name": "squizlabs/php_codesniffer",
201
  "version": "2.9.1",
220
  "require-dev": {
221
  "phpunit/phpunit": "~4.0"
222
  },
223
+ "time": "2017-05-22T02:43:20+00:00",
224
  "bin": [
225
  "scripts/phpcs",
226
  "scripts/phpcbf"
294
  "require": {
295
  "squizlabs/php_codesniffer": "^2.8.1"
296
  },
297
+ "time": "2017-03-20T23:17:58+00:00",
298
  "type": "library",
299
  "installation-source": "dist",
300
  "notification-url": "https://packagist.org/downloads/",
316
  },
317
  {
318
  "name": "symfony/css-selector",
319
+ "version": "v2.8.25",
320
+ "version_normalized": "2.8.25.0",
321
  "source": {
322
  "type": "git",
323
  "url": "https://github.com/symfony/css-selector.git",
332
  "require": {
333
  "php": ">=5.3.9"
334
  },
335
+ "time": "2017-05-01T14:31:55+00:00",
336
  "type": "library",
337
  "extra": {
338
  "branch-alias": {
368
  ],
369
  "description": "Symfony CssSelector Component",
370
  "homepage": "https://symfony.com"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  }
372
  ]
wpcom-helper.php CHANGED
@@ -22,6 +22,7 @@ function wpcom_fbia_remove_stats_pixel() {
22
  add_action( 'template_redirect', 'wpcom_fbia_remove_stats_pixel' );
23
 
24
  function wpcom_fbia_add_stats_pixel( $ia_post ) {
 
25
 
26
  // Get the IA article.
27
  $instant_article = $ia_post->instant_article;
@@ -29,7 +30,7 @@ function wpcom_fbia_add_stats_pixel( $ia_post ) {
29
  // Create the wpcom stats code.
30
  $hostname = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // input var okay
31
 
32
- $url = 'https://pixel.wp.com/b.gif?host=' . $hostname . '&blog=' . $current_blog->blog_id . '&post=' . $post->ID . '&subd=' . str_replace( '.wordpress.com', '', $current_blog->domain ) . '&ref=&feed=1';
33
 
34
  $pixel_html = '<script>
35
  var x = new Image(); x.src = "' . esc_js( $url ) . '&rand=" +Math.random();
22
  add_action( 'template_redirect', 'wpcom_fbia_remove_stats_pixel' );
23
 
24
  function wpcom_fbia_add_stats_pixel( $ia_post ) {
25
+ global $current_blog;
26
 
27
  // Get the IA article.
28
  $instant_article = $ia_post->instant_article;
30
  // Create the wpcom stats code.
31
  $hostname = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // input var okay
32
 
33
+ $url = 'https://pixel.wp.com/b.gif?host=' . $hostname . '&blog=' . $current_blog->blog_id . '&post=' . $ia_post->get_the_id() . '&subd=' . str_replace( '.wordpress.com', '', $current_blog->domain ) . '&ref=&feed=1';
34
 
35
  $pixel_html = '<script>
36
  var x = new Image(); x.src = "' . esc_js( $url ) . '&rand=" +Math.random();