Version Description
Download this release
Release Info
Developer | diegoquinteiro |
Plugin | Instant Articles for WP |
Version | 3.2.1 |
Comparing to | |
See all releases |
Code changes from version 3.2 to 3.2.1
- class-instant-articles-publisher.php +5 -0
- facebook-instant-articles.php +2 -2
- feed-template.php +5 -0
- meta-box/class-instant-articles-meta-box.php +1 -0
- meta-box/meta-box-template.php +8 -1
- readme.txt +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.json +69 -68
- vendor/facebook/graph-sdk/composer.json +4 -3
- vendor/facebook/graph-sdk/src/Facebook/Facebook.php +2 -2
- vendor/facebook/graph-sdk/src/Facebook/FacebookBatchRequest.php +0 -2
- vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAchievement.php +0 -1
- vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPage.php +22 -0
- vendor/facebook/graph-sdk/src/Facebook/Http/GraphRawResponse.php +1 -1
- vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php +11 -3
- vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/RandomBytesPseudoRandomStringGenerator.php +59 -0
- vendor/symfony/css-selector/Parser/Reader.php +0 -2
- wpcom-helper.php +50 -0
class-instant-articles-publisher.php
CHANGED
@@ -57,6 +57,11 @@ class Instant_Articles_Publisher {
|
|
57 |
// Transform the post to an Instant Article.
|
58 |
$adapter = new Instant_Articles_Post( $post );
|
59 |
|
|
|
|
|
|
|
|
|
|
|
60 |
$article = $adapter->to_instant_article();
|
61 |
|
62 |
// Skip empty articles or articles missing title.
|
57 |
// Transform the post to an Instant Article.
|
58 |
$adapter = new Instant_Articles_Post( $post );
|
59 |
|
60 |
+
// Allow to disable post submit via filter
|
61 |
+
if ( false === apply_filters( 'instant_articles_should_submit_post', true, $adapter ) ) {
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
$article = $adapter->to_instant_article();
|
66 |
|
67 |
// Skip empty articles or articles missing title.
|
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: 3.2
|
8 |
* Text Domain: instant-articles
|
9 |
* License: GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -61,7 +61,7 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
|
|
61 |
|
62 |
defined( 'ABSPATH' ) || die( 'Shame on you' );
|
63 |
|
64 |
-
define( 'IA_PLUGIN_VERSION', '3.1' );
|
65 |
define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
|
66 |
define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
|
67 |
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: 3.2.1
|
8 |
* Text Domain: instant-articles
|
9 |
* License: GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
61 |
|
62 |
defined( 'ABSPATH' ) || die( 'Shame on you' );
|
63 |
|
64 |
+
define( 'IA_PLUGIN_VERSION', '3.2.1' );
|
65 |
define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
|
66 |
define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
|
67 |
define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
|
feed-template.php
CHANGED
@@ -21,6 +21,11 @@ $last_modified = null;
|
|
21 |
<?php
|
22 |
$instant_article_post = new Instant_Articles_Post( get_post( get_the_id() ) );
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
// If we’re OK with a limited post set: Do not include posts with empty content -- FB will complain.
|
25 |
if ( defined( 'INSTANT_ARTICLES_LIMIT_POSTS' ) && INSTANT_ARTICLES_LIMIT_POSTS && ! strlen( trim( $instant_article_post->get_the_content() ) ) ) {
|
26 |
continue;
|
21 |
<?php
|
22 |
$instant_article_post = new Instant_Articles_Post( get_post( get_the_id() ) );
|
23 |
|
24 |
+
// Allow to disable post submit via filter
|
25 |
+
if ( false === apply_filters( 'instant_articles_should_submit_post', true, $instant_article_post ) ) {
|
26 |
+
continue;
|
27 |
+
}
|
28 |
+
|
29 |
// If we’re OK with a limited post set: Do not include posts with empty content -- FB will complain.
|
30 |
if ( defined( 'INSTANT_ARTICLES_LIMIT_POSTS' ) && INSTANT_ARTICLES_LIMIT_POSTS && ! strlen( trim( $instant_article_post->get_the_content() ) ) ) {
|
31 |
continue;
|
meta-box/class-instant-articles-meta-box.php
CHANGED
@@ -84,6 +84,7 @@ class Instant_Articles_Meta_Box {
|
|
84 |
$published = 'publish' === $post->post_status;
|
85 |
$dev_mode = false;
|
86 |
$force_submit = get_post_meta( $post_id, Instant_Articles_Publisher::FORCE_SUBMIT_KEY, true );
|
|
|
87 |
|
88 |
Instant_Articles_Wizard::menu_items();
|
89 |
$settings_page_href = Instant_Articles_Wizard::get_url();
|
84 |
$published = 'publish' === $post->post_status;
|
85 |
$dev_mode = false;
|
86 |
$force_submit = get_post_meta( $post_id, Instant_Articles_Publisher::FORCE_SUBMIT_KEY, true );
|
87 |
+
$should_submit_post = apply_filters( 'instant_articles_should_submit_post', true, $adapter );
|
88 |
|
89 |
Instant_Articles_Wizard::menu_items();
|
90 |
$settings_page_href = Instant_Articles_Wizard::get_url();
|
meta-box/meta-box-template.php
CHANGED
@@ -18,7 +18,14 @@ use Facebook\InstantArticles\Client\ServerMessage;
|
|
18 |
</a>
|
19 |
<?php endif; ?>
|
20 |
|
21 |
-
<?php if ( ! $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
<p>
|
23 |
<b>
|
24 |
<span class="dashicons dashicons-media-document"></span>
|
18 |
</a>
|
19 |
<?php endif; ?>
|
20 |
|
21 |
+
<?php if ( ! $shoud_publish_post ) : ?>
|
22 |
+
<p>
|
23 |
+
<b>
|
24 |
+
<span class="dashicons dashicons-no-alt"></span>
|
25 |
+
This post will not be submitted to Instant Articles due to a rule created in your site.
|
26 |
+
</b>
|
27 |
+
</p>
|
28 |
+
<?php elseif ( ! $published ) : ?>
|
29 |
<p>
|
30 |
<b>
|
31 |
<span class="dashicons dashicons-media-document"></span>
|
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.6
|
6 |
-
Stable tag: 3.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.6
|
6 |
+
Stable tag: 3.2.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitaeb01722e65852ffc8e599ee34208923::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit6908494315138775469765f169c8289c
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
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\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit6908494315138775469765f169c8289c
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitaeb01722e65852ffc8e599ee34208923
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitaeb01722e65852ffc8e599ee34208923', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitaeb01722e65852ffc8e599ee34208923', '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\ComposerStaticInitaeb01722e65852ffc8e599ee34208923::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\ComposerStaticInitaeb01722e65852ffc8e599ee34208923::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequireaeb01722e65852ffc8e599ee34208923($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequireaeb01722e65852ffc8e599ee34208923($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
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'c65d09b6820da036953a371c8c73a9b1' => __DIR__ . '/..' . '/facebook/graph-sdk/src/Facebook/polyfills.php',
|
@@ -122,9 +122,9 @@ class ComposerStaticInit6908494315138775469765f169c8289c
|
|
122 |
public static function getInitializer(ClassLoader $loader)
|
123 |
{
|
124 |
return \Closure::bind(function () use ($loader) {
|
125 |
-
$loader->prefixLengthsPsr4 =
|
126 |
-
$loader->prefixDirsPsr4 =
|
127 |
-
$loader->classMap =
|
128 |
|
129 |
}, null, ClassLoader::class);
|
130 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitaeb01722e65852ffc8e599ee34208923
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'c65d09b6820da036953a371c8c73a9b1' => __DIR__ . '/..' . '/facebook/graph-sdk/src/Facebook/polyfills.php',
|
122 |
public static function getInitializer(ClassLoader $loader)
|
123 |
{
|
124 |
return \Closure::bind(function () use ($loader) {
|
125 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitaeb01722e65852ffc8e599ee34208923::$prefixLengthsPsr4;
|
126 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitaeb01722e65852ffc8e599ee34208923::$prefixDirsPsr4;
|
127 |
+
$loader->classMap = ComposerStaticInitaeb01722e65852ffc8e599ee34208923::$classMap;
|
128 |
|
129 |
}, null, ClassLoader::class);
|
130 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,49 +1,72 @@
|
|
1 |
[
|
2 |
{
|
3 |
-
"name": "
|
4 |
-
"version": "
|
5 |
-
"version_normalized": "2.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
-
"url": "https://
|
9 |
-
"reference": "
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
},
|
11 |
"require": {
|
12 |
-
"php": ">=5.
|
13 |
},
|
14 |
-
"time": "
|
15 |
"type": "library",
|
16 |
-
"
|
|
|
|
|
|
|
|
|
|
|
17 |
"autoload": {
|
18 |
-
"
|
19 |
-
"
|
|
|
|
|
|
|
20 |
]
|
21 |
},
|
22 |
"notification-url": "https://packagist.org/downloads/",
|
23 |
"license": [
|
24 |
-
"
|
25 |
],
|
26 |
-
"
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
},
|
34 |
{
|
35 |
"name": "facebook/graph-sdk",
|
36 |
-
"version": "5.
|
37 |
-
"version_normalized": "5.
|
38 |
"source": {
|
39 |
"type": "git",
|
40 |
"url": "https://github.com/facebook/php-graph-sdk.git",
|
41 |
-
"reference": "
|
42 |
},
|
43 |
"dist": {
|
44 |
"type": "zip",
|
45 |
-
"url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/
|
46 |
-
"reference": "
|
47 |
"shasum": ""
|
48 |
},
|
49 |
"require": {
|
@@ -55,9 +78,10 @@
|
|
55 |
"phpunit/phpunit": "~4.0"
|
56 |
},
|
57 |
"suggest": {
|
58 |
-
"guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client"
|
|
|
59 |
},
|
60 |
-
"time": "2016-
|
61 |
"type": "library",
|
62 |
"extra": {
|
63 |
"branch-alias": {
|
@@ -80,70 +104,47 @@
|
|
80 |
"authors": [
|
81 |
{
|
82 |
"name": "Facebook",
|
83 |
-
"homepage": "https://github.com/facebook/
|
84 |
}
|
85 |
],
|
86 |
"description": "Facebook SDK for PHP",
|
87 |
-
"homepage": "https://github.com/facebook/
|
88 |
"keywords": [
|
89 |
"facebook",
|
90 |
"sdk"
|
91 |
]
|
92 |
},
|
93 |
{
|
94 |
-
"name": "
|
95 |
-
"version": "
|
96 |
-
"version_normalized": "2.
|
97 |
"source": {
|
98 |
"type": "git",
|
99 |
-
"url": "https://
|
100 |
-
"reference": "
|
101 |
-
},
|
102 |
-
"dist": {
|
103 |
-
"type": "zip",
|
104 |
-
"url": "https://api.github.com/repos/symfony/css-selector/zipball/71c8c3a04c126300c37089b1baa7c6322dfb845f",
|
105 |
-
"reference": "71c8c3a04c126300c37089b1baa7c6322dfb845f",
|
106 |
-
"shasum": ""
|
107 |
},
|
108 |
"require": {
|
109 |
-
"php": ">=5.
|
110 |
},
|
111 |
-
"time": "
|
112 |
"type": "library",
|
113 |
-
"
|
114 |
-
"branch-alias": {
|
115 |
-
"dev-master": "2.8-dev"
|
116 |
-
}
|
117 |
-
},
|
118 |
-
"installation-source": "dist",
|
119 |
"autoload": {
|
120 |
-
"
|
121 |
-
"
|
122 |
-
},
|
123 |
-
"exclude-from-classmap": [
|
124 |
-
"/Tests/"
|
125 |
]
|
126 |
},
|
127 |
"notification-url": "https://packagist.org/downloads/",
|
128 |
"license": [
|
129 |
-
"
|
130 |
-
],
|
131 |
-
"authors": [
|
132 |
-
{
|
133 |
-
"name": "Jean-François Simon",
|
134 |
-
"email": "jeanfrancois.simon@sensiolabs.com"
|
135 |
-
},
|
136 |
-
{
|
137 |
-
"name": "Fabien Potencier",
|
138 |
-
"email": "fabien@symfony.com"
|
139 |
-
},
|
140 |
-
{
|
141 |
-
"name": "Symfony Community",
|
142 |
-
"homepage": "https://symfony.com/contributors"
|
143 |
-
}
|
144 |
],
|
145 |
-
"description": "
|
146 |
-
"homepage": "
|
|
|
|
|
|
|
|
|
|
|
147 |
},
|
148 |
{
|
149 |
"name": "facebook/facebook-instant-articles-sdk-php",
|
1 |
[
|
2 |
{
|
3 |
+
"name": "symfony/css-selector",
|
4 |
+
"version": "v2.8.14",
|
5 |
+
"version_normalized": "2.8.14.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
+
"url": "https://github.com/symfony/css-selector.git",
|
9 |
+
"reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9"
|
10 |
+
},
|
11 |
+
"dist": {
|
12 |
+
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/symfony/css-selector/zipball/981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
|
14 |
+
"reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
|
15 |
+
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
18 |
+
"php": ">=5.3.9"
|
19 |
},
|
20 |
+
"time": "2016-11-03 07:52:58",
|
21 |
"type": "library",
|
22 |
+
"extra": {
|
23 |
+
"branch-alias": {
|
24 |
+
"dev-master": "2.8-dev"
|
25 |
+
}
|
26 |
+
},
|
27 |
+
"installation-source": "dist",
|
28 |
"autoload": {
|
29 |
+
"psr-4": {
|
30 |
+
"Symfony\\Component\\CssSelector\\": ""
|
31 |
+
},
|
32 |
+
"exclude-from-classmap": [
|
33 |
+
"/Tests/"
|
34 |
]
|
35 |
},
|
36 |
"notification-url": "https://packagist.org/downloads/",
|
37 |
"license": [
|
38 |
+
"MIT"
|
39 |
],
|
40 |
+
"authors": [
|
41 |
+
{
|
42 |
+
"name": "Jean-François Simon",
|
43 |
+
"email": "jeanfrancois.simon@sensiolabs.com"
|
44 |
+
},
|
45 |
+
{
|
46 |
+
"name": "Fabien Potencier",
|
47 |
+
"email": "fabien@symfony.com"
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"name": "Symfony Community",
|
51 |
+
"homepage": "https://symfony.com/contributors"
|
52 |
+
}
|
53 |
+
],
|
54 |
+
"description": "Symfony CssSelector Component",
|
55 |
+
"homepage": "https://symfony.com"
|
56 |
},
|
57 |
{
|
58 |
"name": "facebook/graph-sdk",
|
59 |
+
"version": "5.4.2",
|
60 |
+
"version_normalized": "5.4.2.0",
|
61 |
"source": {
|
62 |
"type": "git",
|
63 |
"url": "https://github.com/facebook/php-graph-sdk.git",
|
64 |
+
"reference": "2839246e971aef150650196acbb46d47e5207370"
|
65 |
},
|
66 |
"dist": {
|
67 |
"type": "zip",
|
68 |
+
"url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/2839246e971aef150650196acbb46d47e5207370",
|
69 |
+
"reference": "2839246e971aef150650196acbb46d47e5207370",
|
70 |
"shasum": ""
|
71 |
},
|
72 |
"require": {
|
78 |
"phpunit/phpunit": "~4.0"
|
79 |
},
|
80 |
"suggest": {
|
81 |
+
"guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
|
82 |
+
"paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
|
83 |
},
|
84 |
+
"time": "2016-11-15 14:34:16",
|
85 |
"type": "library",
|
86 |
"extra": {
|
87 |
"branch-alias": {
|
104 |
"authors": [
|
105 |
{
|
106 |
"name": "Facebook",
|
107 |
+
"homepage": "https://github.com/facebook/php-graph-sdk/contributors"
|
108 |
}
|
109 |
],
|
110 |
"description": "Facebook SDK for PHP",
|
111 |
+
"homepage": "https://github.com/facebook/php-graph-sdk",
|
112 |
"keywords": [
|
113 |
"facebook",
|
114 |
"sdk"
|
115 |
]
|
116 |
},
|
117 |
{
|
118 |
+
"name": "apache/log4php",
|
119 |
+
"version": "2.3.0",
|
120 |
+
"version_normalized": "2.3.0.0",
|
121 |
"source": {
|
122 |
"type": "git",
|
123 |
+
"url": "https://git-wip-us.apache.org/repos/asf/logging-log4php.git",
|
124 |
+
"reference": "8c6df2481cd68d0d211d38f700406c5f0a9de0c2"
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
},
|
126 |
"require": {
|
127 |
+
"php": ">=5.2.7"
|
128 |
},
|
129 |
+
"time": "2012-10-26 09:13:25",
|
130 |
"type": "library",
|
131 |
+
"installation-source": "source",
|
|
|
|
|
|
|
|
|
|
|
132 |
"autoload": {
|
133 |
+
"classmap": [
|
134 |
+
"src/main/php/"
|
|
|
|
|
|
|
135 |
]
|
136 |
},
|
137 |
"notification-url": "https://packagist.org/downloads/",
|
138 |
"license": [
|
139 |
+
"Apache-2.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
],
|
141 |
+
"description": "A versatile logging framework for PHP",
|
142 |
+
"homepage": "http://logging.apache.org/log4php/",
|
143 |
+
"keywords": [
|
144 |
+
"log",
|
145 |
+
"logging",
|
146 |
+
"php"
|
147 |
+
]
|
148 |
},
|
149 |
{
|
150 |
"name": "facebook/facebook-instant-articles-sdk-php",
|
vendor/facebook/graph-sdk/composer.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
{
|
2 |
-
"name": "facebook/
|
3 |
"description": "Facebook SDK for PHP",
|
4 |
"keywords": ["facebook", "sdk"],
|
5 |
"type": "library",
|
6 |
-
"homepage": "https://github.com/facebook/
|
7 |
"license": "Facebook Platform",
|
8 |
"authors": [
|
9 |
{
|
10 |
"name": "Facebook",
|
11 |
-
"homepage": "https://github.com/facebook/
|
12 |
}
|
13 |
],
|
14 |
"require": {
|
@@ -20,6 +20,7 @@
|
|
20 |
"guzzlehttp/guzzle": "~5.0"
|
21 |
},
|
22 |
"suggest": {
|
|
|
23 |
"guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client"
|
24 |
},
|
25 |
"autoload": {
|
1 |
{
|
2 |
+
"name": "facebook/graph-sdk",
|
3 |
"description": "Facebook SDK for PHP",
|
4 |
"keywords": ["facebook", "sdk"],
|
5 |
"type": "library",
|
6 |
+
"homepage": "https://github.com/facebook/php-graph-sdk",
|
7 |
"license": "Facebook Platform",
|
8 |
"authors": [
|
9 |
{
|
10 |
"name": "Facebook",
|
11 |
+
"homepage": "https://github.com/facebook/php-graph-sdk/contributors"
|
12 |
}
|
13 |
],
|
14 |
"require": {
|
20 |
"guzzlehttp/guzzle": "~5.0"
|
21 |
},
|
22 |
"suggest": {
|
23 |
+
"paragonie/random_compat": "Provides a better CSPRNG option in PHP 5",
|
24 |
"guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client"
|
25 |
},
|
26 |
"autoload": {
|
vendor/facebook/graph-sdk/src/Facebook/Facebook.php
CHANGED
@@ -53,12 +53,12 @@ class Facebook
|
|
53 |
/**
|
54 |
* @const string Version number of the Facebook PHP SDK.
|
55 |
*/
|
56 |
-
const VERSION = '5.
|
57 |
|
58 |
/**
|
59 |
* @const string Default Graph API version for requests.
|
60 |
*/
|
61 |
-
const DEFAULT_GRAPH_VERSION = 'v2.
|
62 |
|
63 |
/**
|
64 |
* @const string The name of the environment variable that contains the app ID.
|
53 |
/**
|
54 |
* @const string Version number of the Facebook PHP SDK.
|
55 |
*/
|
56 |
+
const VERSION = '5.4.2';
|
57 |
|
58 |
/**
|
59 |
* @const string Default Graph API version for requests.
|
60 |
*/
|
61 |
+
const DEFAULT_GRAPH_VERSION = 'v2.8';
|
62 |
|
63 |
/**
|
64 |
* @const string The name of the environment variable that contains the app ID.
|
vendor/facebook/graph-sdk/src/Facebook/FacebookBatchRequest.php
CHANGED
@@ -168,8 +168,6 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
|
|
168 |
|
169 |
/**
|
170 |
* Prepares the requests to be sent as a batch request.
|
171 |
-
*
|
172 |
-
* @return string
|
173 |
*/
|
174 |
public function prepareRequestsForBatch()
|
175 |
{
|
168 |
|
169 |
/**
|
170 |
* Prepares the requests to be sent as a batch request.
|
|
|
|
|
171 |
*/
|
172 |
public function prepareRequestsForBatch()
|
173 |
{
|
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAchievement.php
CHANGED
@@ -28,7 +28,6 @@ namespace Facebook\GraphNodes;
|
|
28 |
*
|
29 |
* @package Facebook
|
30 |
*/
|
31 |
-
|
32 |
class GraphAchievement extends GraphNode
|
33 |
{
|
34 |
/**
|
28 |
*
|
29 |
* @package Facebook
|
30 |
*/
|
|
|
31 |
class GraphAchievement extends GraphNode
|
32 |
{
|
33 |
/**
|
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPage.php
CHANGED
@@ -37,6 +37,8 @@ class GraphPage extends GraphNode
|
|
37 |
'best_page' => '\Facebook\GraphNodes\GraphPage',
|
38 |
'global_brand_parent_page' => '\Facebook\GraphNodes\GraphPage',
|
39 |
'location' => '\Facebook\GraphNodes\GraphLocation',
|
|
|
|
|
40 |
];
|
41 |
|
42 |
/**
|
@@ -99,6 +101,26 @@ class GraphPage extends GraphNode
|
|
99 |
return $this->getField('location');
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
/**
|
103 |
* Returns the page access token for the admin user.
|
104 |
*
|
37 |
'best_page' => '\Facebook\GraphNodes\GraphPage',
|
38 |
'global_brand_parent_page' => '\Facebook\GraphNodes\GraphPage',
|
39 |
'location' => '\Facebook\GraphNodes\GraphLocation',
|
40 |
+
'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
|
41 |
+
'picture' => '\Facebook\GraphNodes\GraphPicture',
|
42 |
];
|
43 |
|
44 |
/**
|
101 |
return $this->getField('location');
|
102 |
}
|
103 |
|
104 |
+
/**
|
105 |
+
* Returns CoverPhoto of the Page.
|
106 |
+
*
|
107 |
+
* @return GraphCoverPhoto|null
|
108 |
+
*/
|
109 |
+
public function getCover()
|
110 |
+
{
|
111 |
+
return $this->getField('cover');
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Returns Picture of the Page.
|
116 |
+
*
|
117 |
+
* @return GraphPicture|null
|
118 |
+
*/
|
119 |
+
public function getPicture()
|
120 |
+
{
|
121 |
+
return $this->getField('picture');
|
122 |
+
}
|
123 |
+
|
124 |
/**
|
125 |
* Returns the page access token for the admin user.
|
126 |
*
|
vendor/facebook/graph-sdk/src/Facebook/Http/GraphRawResponse.php
CHANGED
@@ -129,7 +129,7 @@ class GraphRawResponse
|
|
129 |
if (strpos($line, ': ') === false) {
|
130 |
$this->setHttpResponseCodeFromHeader($line);
|
131 |
} else {
|
132 |
-
list($key, $value) = explode(': ', $line);
|
133 |
$this->headers[$key] = $value;
|
134 |
}
|
135 |
}
|
129 |
if (strpos($line, ': ') === false) {
|
130 |
$this->setHttpResponseCodeFromHeader($line);
|
131 |
} else {
|
132 |
+
list($key, $value) = explode(': ', $line, 2);
|
133 |
$this->headers[$key] = $value;
|
134 |
}
|
135 |
}
|
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php
CHANGED
@@ -38,7 +38,7 @@ class PseudoRandomStringGeneratorFactory
|
|
38 |
*
|
39 |
* @param PseudoRandomStringGeneratorInterface|string|null $generator
|
40 |
*
|
41 |
-
* @throws InvalidArgumentException If the pseudo random string generator must be set to "mcrypt", "openssl", or "urandom", or be an instance of Facebook\PseudoRandomString\PseudoRandomStringGeneratorInterface.
|
42 |
*
|
43 |
* @return PseudoRandomStringGeneratorInterface
|
44 |
*/
|
@@ -52,6 +52,9 @@ class PseudoRandomStringGeneratorFactory
|
|
52 |
return $generator;
|
53 |
}
|
54 |
|
|
|
|
|
|
|
55 |
if ('mcrypt' === $generator) {
|
56 |
return new McryptPseudoRandomStringGenerator();
|
57 |
}
|
@@ -62,7 +65,7 @@ class PseudoRandomStringGeneratorFactory
|
|
62 |
return new UrandomPseudoRandomStringGenerator();
|
63 |
}
|
64 |
|
65 |
-
throw new InvalidArgumentException('The pseudo random string generator must be set to "mcrypt", "openssl", or "urandom", or be an instance of Facebook\PseudoRandomString\PseudoRandomStringGeneratorInterface');
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -74,8 +77,13 @@ class PseudoRandomStringGeneratorFactory
|
|
74 |
*/
|
75 |
private static function detectDefaultPseudoRandomStringGenerator()
|
76 |
{
|
|
|
|
|
|
|
|
|
|
|
77 |
// Since openssl_random_pseudo_bytes() can sometimes return non-cryptographically
|
78 |
-
// secure pseudo-random strings (in rare cases), we check for mcrypt_create_iv()
|
79 |
if (function_exists('mcrypt_create_iv')) {
|
80 |
return new McryptPseudoRandomStringGenerator();
|
81 |
}
|
38 |
*
|
39 |
* @param PseudoRandomStringGeneratorInterface|string|null $generator
|
40 |
*
|
41 |
+
* @throws InvalidArgumentException If the pseudo random string generator must be set to "random_bytes", "mcrypt", "openssl", or "urandom", or be an instance of Facebook\PseudoRandomString\PseudoRandomStringGeneratorInterface.
|
42 |
*
|
43 |
* @return PseudoRandomStringGeneratorInterface
|
44 |
*/
|
52 |
return $generator;
|
53 |
}
|
54 |
|
55 |
+
if ('random_bytes' === $generator) {
|
56 |
+
return new RandomBytesPseudoRandomStringGenerator();
|
57 |
+
}
|
58 |
if ('mcrypt' === $generator) {
|
59 |
return new McryptPseudoRandomStringGenerator();
|
60 |
}
|
65 |
return new UrandomPseudoRandomStringGenerator();
|
66 |
}
|
67 |
|
68 |
+
throw new InvalidArgumentException('The pseudo random string generator must be set to "random_bytes", "mcrypt", "openssl", or "urandom", or be an instance of Facebook\PseudoRandomString\PseudoRandomStringGeneratorInterface');
|
69 |
}
|
70 |
|
71 |
/**
|
77 |
*/
|
78 |
private static function detectDefaultPseudoRandomStringGenerator()
|
79 |
{
|
80 |
+
// Check for PHP 7's CSPRNG first to keep mcrypt deprecation messages from appearing in PHP 7.1.
|
81 |
+
if (function_exists('random_bytes')) {
|
82 |
+
return new RandomBytesPseudoRandomStringGenerator();
|
83 |
+
}
|
84 |
+
|
85 |
// Since openssl_random_pseudo_bytes() can sometimes return non-cryptographically
|
86 |
+
// secure pseudo-random strings (in rare cases), we check for mcrypt_create_iv() next.
|
87 |
if (function_exists('mcrypt_create_iv')) {
|
88 |
return new McryptPseudoRandomStringGenerator();
|
89 |
}
|
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/RandomBytesPseudoRandomStringGenerator.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright 2016 Facebook, Inc.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
namespace Facebook\PseudoRandomString;
|
25 |
+
|
26 |
+
use Facebook\Exceptions\FacebookSDKException;
|
27 |
+
|
28 |
+
class RandomBytesPseudoRandomStringGenerator implements PseudoRandomStringGeneratorInterface
|
29 |
+
{
|
30 |
+
use PseudoRandomStringGeneratorTrait;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @const string The error message when generating the string fails.
|
34 |
+
*/
|
35 |
+
const ERROR_MESSAGE = 'Unable to generate a cryptographically secure pseudo-random string from random_bytes(). ';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @throws FacebookSDKException
|
39 |
+
*/
|
40 |
+
public function __construct()
|
41 |
+
{
|
42 |
+
if (!function_exists('random_bytes')) {
|
43 |
+
throw new FacebookSDKException(
|
44 |
+
static::ERROR_MESSAGE .
|
45 |
+
'The function random_bytes() does not exist.'
|
46 |
+
);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @inheritdoc
|
52 |
+
*/
|
53 |
+
public function getPseudoRandomString($length)
|
54 |
+
{
|
55 |
+
$this->validateLength($length);
|
56 |
+
|
57 |
+
return $this->binToHex(random_bytes($length), $length);
|
58 |
+
}
|
59 |
+
}
|
vendor/symfony/css-selector/Parser/Reader.php
CHANGED
@@ -118,8 +118,6 @@ class Reader
|
|
118 |
$this->position += $length;
|
119 |
}
|
120 |
|
121 |
-
/**
|
122 |
-
*/
|
123 |
public function moveToEnd()
|
124 |
{
|
125 |
$this->position = $this->length;
|
118 |
$this->position += $length;
|
119 |
}
|
120 |
|
|
|
|
|
121 |
public function moveToEnd()
|
122 |
{
|
123 |
$this->position = $this->length;
|
wpcom-helper.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Wrap the wpcom tracking pixel to comply with the FBIA spec
|
4 |
+
// https://developers.facebook.com/docs/instant-articles/reference/analytics
|
5 |
+
function wpcom_fbia_stats_pixel() {
|
6 |
+
global $post;
|
7 |
+
|
8 |
+
if ( ! defined( 'INSTANT_ARTICLES_SLUG' ) ) {
|
9 |
+
return;
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! is_feed( INSTANT_ARTICLES_SLUG ) ) {
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
|
16 |
+
// Stop wpcom adding the tracking pixel
|
17 |
+
remove_filter( 'the_content', 'add_bug_to_feed', 100 );
|
18 |
+
|
19 |
+
add_filter( 'the_content', '_wpcom_fbia_stats_pixel', 100 );
|
20 |
+
|
21 |
+
}
|
22 |
+
add_action( 'template_redirect', 'wpcom_fbia_stats_pixel' );
|
23 |
+
|
24 |
+
function _wpcom_fbia_stats_pixel( $content ) {
|
25 |
+
global $post, $current_blog;
|
26 |
+
|
27 |
+
if ( ! is_feed() ) {
|
28 |
+
return $content;
|
29 |
+
}
|
30 |
+
|
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=' . $post->ID . '&subd=' . str_replace( '.wordpress.com', '', $current_blog->domain ) . '&ref=&feed=1';
|
34 |
+
|
35 |
+
$fbia_pixel = '
|
36 |
+
<figure class="op-tracker">
|
37 |
+
<iframe>
|
38 |
+
<script>
|
39 |
+
var x = new Image(); x.src = "' . esc_js( $url ) . '&rand=" +Math.random();
|
40 |
+
</script>
|
41 |
+
</iframe>
|
42 |
+
</figure>';
|
43 |
+
|
44 |
+
return $content . $fbia_pixel;
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
// make sure these function run in wp.com environment where `plugins_loaded` is already fired when loading the plugin
|
49 |
+
add_action( 'after_setup_theme', 'instant_articles_load_textdomain' );
|
50 |
+
add_action( 'after_setup_theme', 'instant_articles_load_compat' );
|