All in One SEO Pack - Version 3.2.4

Version Description

Download this release

Release Info

Developer hallsofmontezuma
Plugin Icon 128x128 All in One SEO Pack
Version 3.2.4
Comparing to
See all releases

Code changes from version 3.2.3 to 3.2.4

aioseop_class.php CHANGED
@@ -4613,7 +4613,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4613
  $tax_noindex = $aioseop_options['aiosp_tax_noindex'];
4614
  }
4615
 
4616
- if ( is_front_page() ) {
4617
  return $this->get_robots_meta_string( false, false );
4618
  }
4619
 
@@ -4640,14 +4640,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4640
  $aiosp_nofollow = $this->get_noindex_nofollow_meta_value( 'nofollow' );
4641
  }
4642
 
4643
- if ( 'on' === $aiosp_noindex ||
4644
- ( is_singular() && ! empty( $aioseop_options['aiosp_paginated_noindex'] ) && $page_number > 1 )
4645
- ) {
4646
  $noindex = true;
4647
  }
4648
- if ( 'on' === $aiosp_nofollow ||
4649
- ( is_singular() && ! empty( $aioseop_options['aiosp_paginated_nofollow'] ) && $page_number > 1 )
4650
- ) {
4651
  $nofollow = true;
4652
  }
4653
 
4613
  $tax_noindex = $aioseop_options['aiosp_tax_noindex'];
4614
  }
4615
 
4616
+ if ( is_front_page() && $page_number === 0 ) {
4617
  return $this->get_robots_meta_string( false, false );
4618
  }
4619
 
4640
  $aiosp_nofollow = $this->get_noindex_nofollow_meta_value( 'nofollow' );
4641
  }
4642
 
4643
+ if ( 'on' === $aiosp_noindex || ( ! empty( $aioseop_options['aiosp_paginated_noindex'] ) && $page_number > 1 ) ) {
 
 
4644
  $noindex = true;
4645
  }
4646
+ if ( 'on' === $aiosp_nofollow || ( ! empty( $aioseop_options['aiosp_paginated_nofollow'] ) && $page_number > 1 ) ) {
 
 
4647
  $nofollow = true;
4648
  }
4649
 
all_in_one_seo_pack.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: All In One SEO Pack
5
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
6
  Description: Out-of-the-box SEO for WordPress. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 50 million downloads since 2007.
7
- Version: 3.2.3
8
  Author: Michael Torbert
9
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
10
  Text Domain: all-in-one-seo-pack
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32
  * The original WordPress SEO plugin.
33
  *
34
  * @package All-in-One-SEO-Pack
35
- * @version 3.2.3
36
  */
37
 
38
  if ( ! defined( 'AIOSEOPPRO' ) ) {
@@ -46,7 +46,7 @@ if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
46
  }
47
  }
48
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
49
- define( 'AIOSEOP_VERSION', '3.2.3' );
50
  }
51
 
52
  /*
4
  Plugin Name: All In One SEO Pack
5
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
6
  Description: Out-of-the-box SEO for WordPress. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 50 million downloads since 2007.
7
+ Version: 3.2.4
8
  Author: Michael Torbert
9
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
10
  Text Domain: all-in-one-seo-pack
32
  * The original WordPress SEO plugin.
33
  *
34
  * @package All-in-One-SEO-Pack
35
+ * @version 3.2.4
36
  */
37
 
38
  if ( ! defined( 'AIOSEOPPRO' ) ) {
46
  }
47
  }
48
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
49
+ define( 'AIOSEOP_VERSION', '3.2.4' );
50
  }
51
 
52
  /*
inc/extlib/OAuth.php DELETED
@@ -1,939 +0,0 @@
1
- <?php
2
- /* OAuth PHP Library
3
- * http://oauth.googlecode.com/svn/code/php/
4
- *
5
- * License: The MIT License
6
- *
7
- * Copyright (c) 2007 Andy Smith
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in
17
- * all copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- * THE SOFTWARE.
26
- *
27
- */
28
- // vim: foldmethod=marker
29
-
30
- /* Generic exception class
31
- */
32
- if ( !class_exists( 'OAuthException' ) ) {
33
- class OAuthException extends Exception {
34
- // pass
35
- }
36
- }
37
-
38
- if ( !class_exists( 'OAuthConsumer' ) ) {
39
- class OAuthConsumer {
40
- public $key;
41
- public $secret;
42
-
43
- function __construct($key, $secret, $callback_url=NULL) {
44
- $this->key = $key;
45
- $this->secret = $secret;
46
- $this->callback_url = $callback_url;
47
- }
48
-
49
- function __toString() {
50
- return "OAuthConsumer[key=$this->key,secret=$this->secret]";
51
- }
52
- }
53
- }
54
-
55
- if ( !class_exists( 'OAuthToken' ) ) {
56
- class OAuthToken {
57
- // access tokens and request tokens
58
- public $key;
59
- public $secret;
60
-
61
- /**
62
- * key = the token
63
- * secret = the token secret
64
- */
65
- function __construct($key, $secret) {
66
- $this->key = $key;
67
- $this->secret = $secret;
68
- }
69
-
70
- /**
71
- * generates the basic string serialization of a token that a server
72
- * would respond to request_token and access_token calls with
73
- */
74
- function to_string() {
75
- return "oauth_token=" .
76
- OAuthUtil::urlencode_rfc3986($this->key) .
77
- "&oauth_token_secret=" .
78
- OAuthUtil::urlencode_rfc3986($this->secret);
79
- }
80
-
81
- function __toString() {
82
- return $this->to_string();
83
- }
84
- }
85
- }
86
-
87
- if ( !class_exists('OAuthSignatureMethod') ) {
88
- /**
89
- * A class for implementing a Signature Method
90
- * See section 9 ("Signing Requests") in the spec
91
- */
92
- abstract class OAuthSignatureMethod {
93
- /**
94
- * Needs to return the name of the Signature Method (ie HMAC-SHA1)
95
- * @return string
96
- */
97
- abstract public function get_name();
98
-
99
- /**
100
- * Build up the signature
101
- * NOTE: The output of this function MUST NOT be urlencoded.
102
- * the encoding is handled in OAuthRequest when the final
103
- * request is serialized
104
- * @param OAuthRequest $request
105
- * @param OAuthConsumer $consumer
106
- * @param OAuthToken $token
107
- * @return string
108
- */
109
- abstract public function build_signature($request, $consumer, $token);
110
-
111
- /**
112
- * Verifies that a given signature is correct
113
- * @param OAuthRequest $request
114
- * @param OAuthConsumer $consumer
115
- * @param OAuthToken $token
116
- * @param string $signature
117
- * @return bool
118
- */
119
- public function check_signature($request, $consumer, $token, $signature) {
120
- $built = $this->build_signature($request, $consumer, $token);
121
-
122
- // Check for zero length, although unlikely here
123
- if (strlen($built) == 0 || strlen($signature) == 0) {
124
- return false;
125
- }
126
-
127
- if (strlen($built) != strlen($signature)) {
128
- return false;
129
- }
130
-
131
- // Avoid a timing leak with a (hopefully) time insensitive compare
132
- $result = 0;
133
- for ($i = 0; $i < strlen($signature); $i++) {
134
- $result |= ord($built{$i}) ^ ord($signature{$i});
135
- }
136
-
137
- return $result == 0;
138
- }
139
- }
140
- }
141
-
142
- if ( !class_exists('OAuthSignatureMethod_HMAC_SHA1') ) {
143
- /**
144
- * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
145
- * where the Signature Base String is the text and the key is the concatenated values (each first
146
- * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
147
- * character (ASCII code 38) even if empty.
148
- * - Chapter 9.2 ("HMAC-SHA1")
149
- */
150
- class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
151
- function get_name() {
152
- return "HMAC-SHA1";
153
- }
154
-
155
- public function build_signature($request, $consumer, $token) {
156
- $base_string = $request->get_signature_base_string();
157
- $request->base_string = $base_string;
158
-
159
- $key_parts = array(
160
- $consumer->secret,
161
- ($token) ? $token->secret : ""
162
- );
163
-
164
- $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
165
- $key = implode('&', $key_parts);
166
-
167
- return base64_encode(hash_hmac('sha1', $base_string, $key, true));
168
- }
169
- }
170
- }
171
-
172
- if ( !class_exists('OAuthSignatureMethod_PLAINTEXT') ) {
173
- /**
174
- * The PLAINTEXT method does not provide any security protection and SHOULD only be used
175
- * over a secure channel such as HTTPS. It does not use the Signature Base String.
176
- * - Chapter 9.4 ("PLAINTEXT")
177
- */
178
- class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
179
- public function get_name() {
180
- return "PLAINTEXT";
181
- }
182
-
183
- /**
184
- * oauth_signature is set to the concatenated encoded values of the Consumer Secret and
185
- * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
186
- * empty. The result MUST be encoded again.
187
- * - Chapter 9.4.1 ("Generating Signatures")
188
- *
189
- * Please note that the second encoding MUST NOT happen in the SignatureMethod, as
190
- * OAuthRequest handles this!
191
- */
192
- public function build_signature($request, $consumer, $token) {
193
- $key_parts = array(
194
- $consumer->secret,
195
- ($token) ? $token->secret : ""
196
- );
197
-
198
- $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
199
- $key = implode('&', $key_parts);
200
- $request->base_string = $key;
201
-
202
- return $key;
203
- }
204
- }
205
- }
206
-
207
-
208
- if ( !class_exists('OAuthSignatureMethod_RSA_SHA1') ) {
209
- /**
210
- * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
211
- * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
212
- * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
213
- * verified way to the Service Provider, in a manner which is beyond the scope of this
214
- * specification.
215
- * - Chapter 9.3 ("RSA-SHA1")
216
- */
217
- abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
218
- public function get_name() {
219
- return "RSA-SHA1";
220
- }
221
-
222
- // Up to the SP to implement this lookup of keys. Possible ideas are:
223
- // (1) do a lookup in a table of trusted certs keyed off of consumer
224
- // (2) fetch via http using a url provided by the requester
225
- // (3) some sort of specific discovery code based on request
226
- //
227
- // Either way should return a string representation of the certificate
228
- protected abstract function fetch_public_cert(&$request);
229
-
230
- // Up to the SP to implement this lookup of keys. Possible ideas are:
231
- // (1) do a lookup in a table of trusted certs keyed off of consumer
232
- //
233
- // Either way should return a string representation of the certificate
234
- protected abstract function fetch_private_cert(&$request);
235
-
236
- public function build_signature($request, $consumer, $token) {
237
- $base_string = $request->get_signature_base_string();
238
- $request->base_string = $base_string;
239
-
240
- // Fetch the private key cert based on the request
241
- $cert = $this->fetch_private_cert($request);
242
-
243
- // Pull the private key ID from the certificate
244
- $privatekeyid = openssl_get_privatekey($cert);
245
-
246
- // Sign using the key
247
- $ok = openssl_sign($base_string, $signature, $privatekeyid);
248
-
249
- // Release the key resource
250
- openssl_free_key($privatekeyid);
251
-
252
- return base64_encode($signature);
253
- }
254
-
255
- public function check_signature($request, $consumer, $token, $signature) {
256
- $decoded_sig = base64_decode($signature);
257
-
258
- $base_string = $request->get_signature_base_string();
259
-
260
- // Fetch the public key cert based on the request
261
- $cert = $this->fetch_public_cert($request);
262
-
263
- // Pull the public key ID from the certificate
264
- $publickeyid = openssl_get_publickey($cert);
265
-
266
- // Check the computed signature against the one passed in the query
267
- $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
268
-
269
- // Release the key resource
270
- openssl_free_key($publickeyid);
271
-
272
- return $ok == 1;
273
- }
274
- }
275
- }
276
-
277
- if ( !class_exists('OAuthRequest') ) {
278
- class OAuthRequest {
279
- protected $parameters;
280
- protected $http_method;
281
- protected $http_url;
282
- // for debug purposes
283
- public $base_string;
284
- public static $version = '1.0';
285
- public static $POST_INPUT = 'php://input';
286
-
287
- function __construct($http_method, $http_url, $parameters=NULL) {
288
- $parameters = ($parameters) ? $parameters : array();
289
- $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
290
- $this->parameters = $parameters;
291
- $this->http_method = $http_method;
292
- $this->http_url = $http_url;
293
- }
294
-
295
-
296
- /**
297
- * attempt to build up a request from what was passed to the server
298
- */
299
- public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
300
- $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
301
- ? 'http'
302
- : 'https';
303
- $http_url = ($http_url) ? $http_url : $scheme .
304
- '://' . $_SERVER['SERVER_NAME'] .
305
- ':' .
306
- $_SERVER['SERVER_PORT'] .
307
- $_SERVER['REQUEST_URI'];
308
- $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];
309
-
310
- // We weren't handed any parameters, so let's find the ones relevant to
311
- // this request.
312
- // If you run XML-RPC or similar you should use this to provide your own
313
- // parsed parameter-list
314
- if (!$parameters) {
315
- // Find request headers
316
- $request_headers = OAuthUtil::get_headers();
317
-
318
- // Parse the query-string to find GET parameters
319
- $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
320
-
321
- // It's a POST request of the proper content-type, so parse POST
322
- // parameters and add those overriding any duplicates from GET
323
- if ($http_method == "POST"
324
- && isset($request_headers['Content-Type'])
325
- && strstr($request_headers['Content-Type'],
326
- 'application/x-www-form-urlencoded')
327
- ) {
328
- $post_data = OAuthUtil::parse_parameters(
329
- file_get_contents(self::$POST_INPUT)
330
- );
331
- $parameters = array_merge($parameters, $post_data);
332
- }
333
-
334
- // We have a Authorization-header with OAuth data. Parse the header
335
- // and add those overriding any duplicates from GET or POST
336
- if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') {
337
- $header_parameters = OAuthUtil::split_header(
338
- $request_headers['Authorization']
339
- );
340
- $parameters = array_merge($parameters, $header_parameters);
341
- }
342
-
343
- }
344
-
345
- return new OAuthRequest($http_method, $http_url, $parameters);
346
- }
347
-
348
- /**
349
- * pretty much a helper function to set up the request
350
- */
351
- public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
352
- $parameters = ($parameters) ? $parameters : array();
353
- $defaults = array("oauth_version" => OAuthRequest::$version,
354
- "oauth_nonce" => OAuthRequest::generate_nonce(),
355
- "oauth_timestamp" => OAuthRequest::generate_timestamp(),
356
- "oauth_consumer_key" => $consumer->key);
357
- if ($token)
358
- $defaults['oauth_token'] = $token->key;
359
-
360
- $parameters = array_merge($defaults, $parameters);
361
-
362
- return new OAuthRequest($http_method, $http_url, $parameters);
363
- }
364
-
365
- public function set_parameter($name, $value, $allow_duplicates = true) {
366
- if ($allow_duplicates && isset($this->parameters[$name])) {
367
- // We have already added parameter(s) with this name, so add to the list
368
- if (is_scalar($this->parameters[$name])) {
369
- // This is the first duplicate, so transform scalar (string)
370
- // into an array so we can add the duplicates
371
- $this->parameters[$name] = array($this->parameters[$name]);
372
- }
373
-
374
- $this->parameters[$name][] = $value;
375
- } else {
376
- $this->parameters[$name] = $value;
377
- }
378
- }
379
-
380
- public function get_parameter($name) {
381
- return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
382
- }
383
-
384
- public function get_parameters() {
385
- return $this->parameters;
386
- }
387
-
388
- public function unset_parameter($name) {
389
- unset($this->parameters[$name]);
390
- }
391
-
392
- /**
393
- * The request parameters, sorted and concatenated into a normalized string.
394
- * @return string
395
- */
396
- public function get_signable_parameters() {
397
- // Grab all parameters
398
- $params = $this->parameters;
399
-
400
- // Remove oauth_signature if present
401
- // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
402
- if (isset($params['oauth_signature'])) {
403
- unset($params['oauth_signature']);
404
- }
405
-
406
- return OAuthUtil::build_http_query($params);
407
- }
408
-
409
- /**
410
- * Returns the base string of this request
411
- *
412
- * The base string defined as the method, the url
413
- * and the parameters (normalized), each urlencoded
414
- * and the concated with &.
415
- */
416
- public function get_signature_base_string() {
417
- $parts = array(
418
- $this->get_normalized_http_method(),
419
- $this->get_normalized_http_url(),
420
- $this->get_signable_parameters()
421
- );
422
-
423
- $parts = OAuthUtil::urlencode_rfc3986($parts);
424
-
425
- return implode('&', $parts);
426
- }
427
-
428
- /**
429
- * just uppercases the http method
430
- */
431
- public function get_normalized_http_method() {
432
- return strtoupper($this->http_method);
433
- }
434
-
435
- /**
436
- * parses the url and rebuilds it to be
437
- * scheme://host/path
438
- */
439
- public function get_normalized_http_url() {
440
- $parts = parse_url($this->http_url);
441
-
442
- $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http';
443
- $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80');
444
- $host = (isset($parts['host'])) ? strtolower($parts['host']) : '';
445
- $path = (isset($parts['path'])) ? $parts['path'] : '';
446
-
447
- if (($scheme == 'https' && $port != '443')
448
- || ($scheme == 'http' && $port != '80')) {
449
- $host = "$host:$port";
450
- }
451
- return "$scheme://$host$path";
452
- }
453
-
454
- /**
455
- * builds a url usable for a GET request
456
- */
457
- public function to_url() {
458
- $post_data = $this->to_postdata();
459
- $out = $this->get_normalized_http_url();
460
- if ($post_data) {
461
- $out .= '?'.$post_data;
462
- }
463
- return $out;
464
- }
465
-
466
- /**
467
- * builds the data one would send in a POST request
468
- */
469
- public function to_postdata() {
470
- return OAuthUtil::build_http_query($this->parameters);
471
- }
472
-
473
- /**
474
- * builds the Authorization: header
475
- */
476
- public function to_header($realm=null) {
477
- $first = true;
478
- if($realm) {
479
- $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
480
- $first = false;
481
- } else
482
- $out = 'Authorization: OAuth';
483
-
484
- $total = array();
485
- foreach ($this->parameters as $k => $v) {
486
- if (substr($k, 0, 5) != "oauth") continue;
487
- if (is_array($v)) {
488
- throw new OAuthException('Arrays not supported in headers');
489
- }
490
- $out .= ($first) ? ' ' : ',';
491
- $out .= OAuthUtil::urlencode_rfc3986($k) .
492
- '="' .
493
- OAuthUtil::urlencode_rfc3986($v) .
494
- '"';
495
- $first = false;
496
- }
497
- return $out;
498
- }
499
-
500
- public function __toString() {
501
- return $this->to_url();
502
- }
503
-
504
-
505
- public function sign_request($signature_method, $consumer, $token) {
506
- $this->set_parameter(
507
- "oauth_signature_method",
508
- $signature_method->get_name(),
509
- false
510
- );
511
- $signature = $this->build_signature($signature_method, $consumer, $token);
512
- $this->set_parameter("oauth_signature", $signature, false);
513
- }
514
-
515
- public function build_signature($signature_method, $consumer, $token) {
516
- $signature = $signature_method->build_signature($this, $consumer, $token);
517
- return $signature;
518
- }
519
-
520
- /**
521
- * util function: current timestamp
522
- */
523
- private static function generate_timestamp() {
524
- return time();
525
- }
526
-
527
- /**
528
- * util function: current nonce
529
- */
530
- private static function generate_nonce() {
531
- $mt = microtime();
532
- $rand = mt_rand();
533
-
534
- return md5($mt . $rand); // md5s look nicer than numbers
535
- }
536
- }
537
- }
538
-
539
- if ( !class_exists('OAuthServer') ) {
540
- class OAuthServer {
541
- protected $timestamp_threshold = 300; // in seconds, five minutes
542
- protected $version = '1.0'; // hi blaine
543
- protected $signature_methods = array();
544
-
545
- protected $data_store;
546
-
547
- function __construct($data_store) {
548
- $this->data_store = $data_store;
549
- }
550
-
551
- public function add_signature_method($signature_method) {
552
- $this->signature_methods[$signature_method->get_name()] =
553
- $signature_method;
554
- }
555
-
556
- // high level functions
557
-
558
- /**
559
- * process a request_token request
560
- * returns the request token on success
561
- */
562
- public function fetch_request_token(&$request) {
563
- $this->get_version($request);
564
-
565
- $consumer = $this->get_consumer($request);
566
-
567
- // no token required for the initial token request
568
- $token = NULL;
569
-
570
- $this->check_signature($request, $consumer, $token);
571
-
572
- // Rev A change
573
- $callback = $request->get_parameter('oauth_callback');
574
- $new_token = $this->data_store->new_request_token($consumer, $callback);
575
-
576
- return $new_token;
577
- }
578
-
579
- /**
580
- * process an access_token request
581
- * returns the access token on success
582
- */
583
- public function fetch_access_token(&$request) {
584
- $this->get_version($request);
585
-
586
- $consumer = $this->get_consumer($request);
587
-
588
- // requires authorized request token
589
- $token = $this->get_token($request, $consumer, "request");
590
-
591
- $this->check_signature($request, $consumer, $token);
592
-
593
- // Rev A change
594
- $verifier = $request->get_parameter('oauth_verifier');
595
- $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);
596
-
597
- return $new_token;
598
- }
599
-
600
- /**
601
- * verify an api call, checks all the parameters
602
- */
603
- public function verify_request(&$request) {
604
- $this->get_version($request);
605
- $consumer = $this->get_consumer($request);
606
- $token = $this->get_token($request, $consumer, "access");
607
- $this->check_signature($request, $consumer, $token);
608
- return array($consumer, $token);
609
- }
610
-
611
- // Internals from here
612
- /**
613
- * version 1
614
- */
615
- private function get_version(&$request) {
616
- $version = $request->get_parameter("oauth_version");
617
- if (!$version) {
618
- // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
619
- // Chapter 7.0 ("Accessing Protected Ressources")
620
- $version = '1.0';
621
- }
622
- if ($version !== $this->version) {
623
- throw new OAuthException("OAuth version '$version' not supported");
624
- }
625
- return $version;
626
- }
627
-
628
- /**
629
- * figure out the signature with some defaults
630
- */
631
- private function get_signature_method($request) {
632
- $signature_method = $request instanceof OAuthRequest
633
- ? $request->get_parameter("oauth_signature_method")
634
- : NULL;
635
-
636
- if (!$signature_method) {
637
- // According to chapter 7 ("Accessing Protected Ressources") the signature-method
638
- // parameter is required, and we can't just fallback to PLAINTEXT
639
- throw new OAuthException('No signature method parameter. This parameter is required');
640
- }
641
-
642
- if (!in_array($signature_method,
643
- array_keys($this->signature_methods))) {
644
- throw new OAuthException(
645
- "Signature method '$signature_method' not supported " .
646
- "try one of the following: " .
647
- implode(", ", array_keys($this->signature_methods))
648
- );
649
- }
650
- return $this->signature_methods[$signature_method];
651
- }
652
-
653
- /**
654
- * try to find the consumer for the provided request's consumer key
655
- */
656
- private function get_consumer($request) {
657
- $consumer_key = $request instanceof OAuthRequest
658
- ? $request->get_parameter("oauth_consumer_key")
659
- : NULL;
660
-
661
- if (!$consumer_key) {
662
- throw new OAuthException("Invalid consumer key");
663
- }
664
-
665
- $consumer = $this->data_store->lookup_consumer($consumer_key);
666
- if (!$consumer) {
667
- throw new OAuthException("Invalid consumer");
668
- }
669
-
670
- return $consumer;
671
- }
672
-
673
- /**
674
- * try to find the token for the provided request's token key
675
- */
676
- private function get_token($request, $consumer, $token_type="access") {
677
- $token_field = $request instanceof OAuthRequest
678
- ? $request->get_parameter('oauth_token')
679
- : NULL;
680
-
681
- $token = $this->data_store->lookup_token(
682
- $consumer, $token_type, $token_field
683
- );
684
- if (!$token) {
685
- throw new OAuthException("Invalid $token_type token: $token_field");
686
- }
687
- return $token;
688
- }
689
-
690
- /**
691
- * all-in-one function to check the signature on a request
692
- * should guess the signature method appropriately
693
- */
694
- private function check_signature($request, $consumer, $token) {
695
- // this should probably be in a different method
696
- $timestamp = $request instanceof OAuthRequest
697
- ? $request->get_parameter('oauth_timestamp')
698
- : NULL;
699
- $nonce = $request instanceof OAuthRequest
700
- ? $request->get_parameter('oauth_nonce')
701
- : NULL;
702
-
703
- $this->check_timestamp($timestamp);
704
- $this->check_nonce($consumer, $token, $nonce, $timestamp);
705
-
706
- $signature_method = $this->get_signature_method($request);
707
-
708
- $signature = $request->get_parameter('oauth_signature');
709
- $valid_sig = $signature_method->check_signature(
710
- $request,
711
- $consumer,
712
- $token,
713
- $signature
714
- );
715
-
716
- if (!$valid_sig) {
717
- throw new OAuthException("Invalid signature");
718
- }
719
- }
720
-
721
- /**
722
- * check that the timestamp is new enough
723
- */
724
- private function check_timestamp($timestamp) {
725
- if( ! $timestamp )
726
- throw new OAuthException(
727
- 'Missing timestamp parameter. The parameter is required'
728
- );
729
-
730
- // verify that timestamp is recentish
731
- $now = time();
732
- if (abs($now - $timestamp) > $this->timestamp_threshold) {
733
- throw new OAuthException(
734
- "Expired timestamp, yours $timestamp, ours $now"
735
- );
736
- }
737
- }
738
-
739
- /**
740
- * check that the nonce is not repeated
741
- */
742
- private function check_nonce($consumer, $token, $nonce, $timestamp) {
743
- if( ! $nonce )
744
- throw new OAuthException(
745
- 'Missing nonce parameter. The parameter is required'
746
- );
747
-
748
- // verify that the nonce is uniqueish
749
- $found = $this->data_store->lookup_nonce(
750
- $consumer,
751
- $token,
752
- $nonce,
753
- $timestamp
754
- );
755
- if ($found) {
756
- throw new OAuthException("Nonce already used: $nonce");
757
- }
758
- }
759
- }
760
- }
761
-
762
- if ( !class_exists('OAuthDataStore') ) {
763
- class OAuthDataStore {
764
- function lookup_consumer($consumer_key) {
765
- // implement me
766
- }
767
-
768
- function lookup_token($consumer, $token_type, $token) {
769
- // implement me
770
- }
771
-
772
- function lookup_nonce($consumer, $token, $nonce, $timestamp) {
773
- // implement me
774
- }
775
-
776
- function new_request_token($consumer, $callback = null) {
777
- // return a new token attached to this consumer
778
- }
779
-
780
- function new_access_token($token, $consumer, $verifier = null) {
781
- // return a new access token attached to this consumer
782
- // for the user associated with this token if the request token
783
- // is authorized
784
- // should also invalidate the request token
785
- }
786
- }
787
- }
788
-
789
- if ( !class_exists('OAuthUtil') ) {
790
- class OAuthUtil {
791
- public static function urlencode_rfc3986($input) {
792
- if (is_array($input)) {
793
- return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
794
- } else if (is_scalar($input)) {
795
- return str_replace(
796
- '+',
797
- ' ',
798
- str_replace('%7E', '~', rawurlencode($input))
799
- );
800
- } else {
801
- return '';
802
- }
803
- }
804
-
805
- // This decode function isn't taking into consideration the above
806
- // modifications to the encoding process. However, this method doesn't
807
- // seem to be used anywhere so leaving it as is.
808
- public static function urldecode_rfc3986($string) {
809
- return urldecode($string);
810
- }
811
-
812
- // Utility function for turning the Authorization: header into
813
- // parameters, has to do some unescaping
814
- // Can filter out any non-oauth parameters if needed (default behaviour)
815
- // May 28th, 2010 - method updated to tjerk.meesters for a speed improvement.
816
- // see http://code.google.com/p/oauth/issues/detail?id=163
817
- public static function split_header($header, $only_allow_oauth_parameters = true) {
818
- $params = array();
819
- if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) {
820
- foreach ($matches[1] as $i => $h) {
821
- $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]);
822
- }
823
- if (isset($params['realm'])) {
824
- unset($params['realm']);
825
- }
826
- }
827
- return $params;
828
- }
829
-
830
- // helper to try to sort out headers for people who aren't running apache
831
- public static function get_headers() {
832
- if (function_exists('apache_request_headers')) {
833
- // we need this to get the actual Authorization: header
834
- // because apache tends to tell us it doesn't exist
835
- $headers = apache_request_headers();
836
-
837
- // sanitize the output of apache_request_headers because
838
- // we always want the keys to be Cased-Like-This and arh()
839
- // returns the headers in the same case as they are in the
840
- // request
841
- $out = array();
842
- foreach ($headers AS $key => $value) {
843
- $key = str_replace(
844
- " ",
845
- "-",
846
- ucwords(strtolower(str_replace("-", " ", $key)))
847
- );
848
- $out[$key] = $value;
849
- }
850
- } else {
851
- // otherwise we don't have apache and are just going to have to hope
852
- // that $_SERVER actually contains what we need
853
- $out = array();
854
- if( isset($_SERVER['CONTENT_TYPE']) )
855
- $out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
856
- if( isset($_ENV['CONTENT_TYPE']) )
857
- $out['Content-Type'] = $_ENV['CONTENT_TYPE'];
858
-
859
- foreach ($_SERVER as $key => $value) {
860
- if (substr($key, 0, 5) == "HTTP_") {
861
- // this is chaos, basically it is just there to capitalize the first
862
- // letter of every word that is not an initial HTTP and strip HTTP
863
- // code from przemek
864
- $key = str_replace(
865
- " ",
866
- "-",
867
- ucwords(strtolower(str_replace("_", " ", substr($key, 5))))
868
- );
869
- $out[$key] = $value;
870
- }
871
- }
872
- }
873
- return $out;
874
- }
875
-
876
- // This function takes a input like a=b&a=c&d=e and returns the parsed
877
- // parameters like this
878
- // array('a' => array('b','c'), 'd' => 'e')
879
- public static function parse_parameters( $input ) {
880
- if (!isset($input) || !$input) return array();
881
-
882
- $pairs = explode('&', $input);
883
-
884
- $parsed_parameters = array();
885
- foreach ($pairs as $pair) {
886
- $split = explode('=', $pair, 2);
887
- $parameter = OAuthUtil::urldecode_rfc3986($split[0]);
888
- $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
889
-
890
- if (isset($parsed_parameters[$parameter])) {
891
- // We have already recieved parameter(s) with this name, so add to the list
892
- // of parameters with this name
893
-
894
- if (is_scalar($parsed_parameters[$parameter])) {
895
- // This is the first duplicate, so transform scalar (string) into an array
896
- // so we can add the duplicates
897
- $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);
898
- }
899
-
900
- $parsed_parameters[$parameter][] = $value;
901
- } else {
902
- $parsed_parameters[$parameter] = $value;
903
- }
904
- }
905
- return $parsed_parameters;
906
- }
907
-
908
- public static function build_http_query($params) {
909
- if (!$params) return '';
910
-
911
- // Urlencode both keys and values
912
- $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
913
- $values = OAuthUtil::urlencode_rfc3986(array_values($params));
914
- $params = array_combine($keys, $values);
915
-
916
- // Parameters are sorted by name, using lexicographical byte value ordering.
917
- // Ref: Spec: 9.1.1 (1)
918
- uksort($params, 'strcmp');
919
-
920
- $pairs = array();
921
- foreach ($params as $parameter => $value) {
922
- if (is_array($value)) {
923
- // If two or more parameters share the same name, they are sorted by their value
924
- // Ref: Spec: 9.1.1 (1)
925
- // June 12th, 2010 - changed to sort because of issue 164 by hidetaka
926
- sort($value, SORT_STRING);
927
- foreach ($value as $duplicate_value) {
928
- $pairs[] = $parameter . '=' . $duplicate_value;
929
- }
930
- } else {
931
- $pairs[] = $parameter . '=' . $value;
932
- }
933
- }
934
- // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
935
- // Each name-value pair is separated by an '&' character (ASCII code 38)
936
- return implode('&', $pairs);
937
- }
938
- }
939
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/extlib/index.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Silence is golden.
5
- */
 
 
 
 
 
modules/aioseop_sitemap.php CHANGED
@@ -2225,9 +2225,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2225
  */
2226
  private function does_addl_sitemap_contain_urls() {
2227
  $is_addl_pages = ! empty( $this->options['aiosp_sitemap_addl_pages'] );
2228
- if ( ! $is_addl_pages &&
2229
- ( 0 !== (int) get_option( 'page_on_front' ) ) &&
2230
- ( 0 !== (int) get_option( 'page_for_posts' ) ) ) {
2231
  return false;
2232
  }
2233
  return true;
2225
  */
2226
  private function does_addl_sitemap_contain_urls() {
2227
  $is_addl_pages = ! empty( $this->options['aiosp_sitemap_addl_pages'] );
2228
+ if ( ! $is_addl_pages && ( 'page' === get_option( 'show_on_front' ) ) ) {
 
 
2229
  return false;
2230
  }
2231
  return true;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: hallsofmontezuma, semperplugins, wpsmort, arnaudbroes
3
  Tags: SEO, Google Search Console, XML Sitemap, meta description, meta title, noindex
4
  Requires at least: 4.7
5
  Tested up to: 5.2
6
- Stable tag: 3.2.3
7
  License: GPLv2 or later
8
  Requires PHP: 5.2.4
9
 
3
  Tags: SEO, Google Search Console, XML Sitemap, meta description, meta title, noindex
4
  Requires at least: 4.7
5
  Tested up to: 5.2
6
+ Stable tag: 3.2.4
7
  License: GPLv2 or later
8
  Requires PHP: 5.2.4
9