Version Description
- Update output buffer handling (#29)
- Fix purge cache request handling (#31)
Download this release
Release Info
| Developer | keycdn |
| Plugin | |
| Version | 2.0.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.2 to 2.0.3
- cdn-enabler.php +2 -2
- inc/cdn_enabler.class.php +4 -4
- inc/cdn_enabler_engine.class.php +8 -8
- readme.txt +5 -1
cdn-enabler.php
CHANGED
|
@@ -6,7 +6,7 @@ Description: Simple and fast WordPress content delivery network (CDN) integratio
|
|
| 6 |
Author: KeyCDN
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
License: GPLv2 or later
|
| 9 |
-
Version: 2.0.
|
| 10 |
*/
|
| 11 |
|
| 12 |
/*
|
|
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 32 |
}
|
| 33 |
|
| 34 |
// constants
|
| 35 |
-
define( 'CDN_ENABLER_VERSION', '2.0.
|
| 36 |
define( 'CDN_ENABLER_MIN_PHP', '5.6' );
|
| 37 |
define( 'CDN_ENABLER_MIN_WP', '5.1' );
|
| 38 |
define( 'CDN_ENABLER_FILE', __FILE__ );
|
| 6 |
Author: KeyCDN
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
License: GPLv2 or later
|
| 9 |
+
Version: 2.0.3
|
| 10 |
*/
|
| 11 |
|
| 12 |
/*
|
| 32 |
}
|
| 33 |
|
| 34 |
// constants
|
| 35 |
+
define( 'CDN_ENABLER_VERSION', '2.0.3' );
|
| 36 |
define( 'CDN_ENABLER_MIN_PHP', '5.6' );
|
| 37 |
define( 'CDN_ENABLER_MIN_WP', '5.1' );
|
| 38 |
define( 'CDN_ENABLER_FILE', __FILE__ );
|
inc/cdn_enabler.class.php
CHANGED
|
@@ -295,7 +295,7 @@ final class CDN_Enabler {
|
|
| 295 |
* get default settings
|
| 296 |
*
|
| 297 |
* @since 2.0.0
|
| 298 |
-
* @change 2.0.
|
| 299 |
*
|
| 300 |
* @param string $settings_type default `system` settings
|
| 301 |
* @return array $system_default_settings|$default_settings only default system settings or all default settings
|
|
@@ -317,8 +317,8 @@ final class CDN_Enabler {
|
|
| 317 |
'.gif',
|
| 318 |
'.jpeg',
|
| 319 |
'.jpg',
|
| 320 |
-
'.json',
|
| 321 |
'.js',
|
|
|
|
| 322 |
'.mp3',
|
| 323 |
'.mp4',
|
| 324 |
'.pdf',
|
|
@@ -554,7 +554,7 @@ final class CDN_Enabler {
|
|
| 554 |
* process purge cache request
|
| 555 |
*
|
| 556 |
* @since 1.0.5
|
| 557 |
-
* @change 2.0.
|
| 558 |
*/
|
| 559 |
|
| 560 |
public static function process_purge_cache_request() {
|
|
@@ -578,7 +578,7 @@ final class CDN_Enabler {
|
|
| 578 |
$response = self::purge_cdn_cache();
|
| 579 |
|
| 580 |
// redirect to same page
|
| 581 |
-
wp_safe_redirect(
|
| 582 |
|
| 583 |
// set transient for purge notice
|
| 584 |
if ( is_admin() ) {
|
| 295 |
* get default settings
|
| 296 |
*
|
| 297 |
* @since 2.0.0
|
| 298 |
+
* @change 2.0.3
|
| 299 |
*
|
| 300 |
* @param string $settings_type default `system` settings
|
| 301 |
* @return array $system_default_settings|$default_settings only default system settings or all default settings
|
| 317 |
'.gif',
|
| 318 |
'.jpeg',
|
| 319 |
'.jpg',
|
|
|
|
| 320 |
'.js',
|
| 321 |
+
'.json',
|
| 322 |
'.mp3',
|
| 323 |
'.mp4',
|
| 324 |
'.pdf',
|
| 554 |
* process purge cache request
|
| 555 |
*
|
| 556 |
* @since 1.0.5
|
| 557 |
+
* @change 2.0.3
|
| 558 |
*/
|
| 559 |
|
| 560 |
public static function process_purge_cache_request() {
|
| 578 |
$response = self::purge_cdn_cache();
|
| 579 |
|
| 580 |
// redirect to same page
|
| 581 |
+
wp_safe_redirect( remove_query_arg( array( '_cache', '_action', '_wpnonce' ) ) );
|
| 582 |
|
| 583 |
// set transient for purge notice
|
| 584 |
if ( is_admin() ) {
|
inc/cdn_enabler_engine.class.php
CHANGED
|
@@ -71,24 +71,24 @@ final class CDN_Enabler_Engine {
|
|
| 71 |
* end output buffering and rewrite contents if applicable
|
| 72 |
*
|
| 73 |
* @since 2.0.0
|
| 74 |
-
* @change 2.0.
|
| 75 |
*
|
| 76 |
* @param string $contents contents from the output buffer
|
| 77 |
* @param integer $phase bitmask of PHP_OUTPUT_HANDLER_* constants
|
| 78 |
-
* @return string $contents|$rewritten_contents rewritten contents if applicable, unchanged otherwise
|
| 79 |
*/
|
| 80 |
|
| 81 |
private static function end_buffering( $contents, $phase ) {
|
| 82 |
|
| 83 |
if ( $phase & PHP_OUTPUT_HANDLER_FINAL || $phase & PHP_OUTPUT_HANDLER_END ) {
|
| 84 |
-
if ( self::bypass_rewrite() ) {
|
| 85 |
-
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
$rewritten_contents = self::rewriter( $contents );
|
| 89 |
|
| 90 |
-
|
|
|
|
| 91 |
}
|
|
|
|
|
|
|
| 92 |
}
|
| 93 |
|
| 94 |
|
| 71 |
* end output buffering and rewrite contents if applicable
|
| 72 |
*
|
| 73 |
* @since 2.0.0
|
| 74 |
+
* @change 2.0.3
|
| 75 |
*
|
| 76 |
* @param string $contents contents from the output buffer
|
| 77 |
* @param integer $phase bitmask of PHP_OUTPUT_HANDLER_* constants
|
| 78 |
+
* @return string $contents|$rewritten_contents rewritten contents from the output buffer if applicable, unchanged otherwise
|
| 79 |
*/
|
| 80 |
|
| 81 |
private static function end_buffering( $contents, $phase ) {
|
| 82 |
|
| 83 |
if ( $phase & PHP_OUTPUT_HANDLER_FINAL || $phase & PHP_OUTPUT_HANDLER_END ) {
|
| 84 |
+
if ( ! self::bypass_rewrite() ) {
|
| 85 |
+
$rewritten_contents = self::rewriter( $contents );
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
return $rewritten_contents;
|
| 88 |
+
}
|
| 89 |
}
|
| 90 |
+
|
| 91 |
+
return $contents;
|
| 92 |
}
|
| 93 |
|
| 94 |
|
readme.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
Contributors: keycdn
|
| 3 |
Tags: cdn, content delivery network, content distribution network
|
| 4 |
Requires at least: 5.1
|
| 5 |
-
Tested up to: 5.
|
| 6 |
Requires PHP: 5.6
|
| 7 |
Stable tag: trunk
|
| 8 |
License: GPLv2 or later
|
|
@@ -47,6 +47,10 @@ CDN Enabler captures page contents and rewrites URLs to be served by the designa
|
|
| 47 |
|
| 48 |
== Changelog ==
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
= 2.0.2 =
|
| 51 |
* Update URL matcher in rewriter (#28)
|
| 52 |
* Update full URL rewrite (#28)
|
| 2 |
Contributors: keycdn
|
| 3 |
Tags: cdn, content delivery network, content distribution network
|
| 4 |
Requires at least: 5.1
|
| 5 |
+
Tested up to: 5.7
|
| 6 |
Requires PHP: 5.6
|
| 7 |
Stable tag: trunk
|
| 8 |
License: GPLv2 or later
|
| 47 |
|
| 48 |
== Changelog ==
|
| 49 |
|
| 50 |
+
= 2.0.3 =
|
| 51 |
+
* Update output buffer handling (#29)
|
| 52 |
+
* Fix purge cache request handling (#31)
|
| 53 |
+
|
| 54 |
= 2.0.2 =
|
| 55 |
* Update URL matcher in rewriter (#28)
|
| 56 |
* Update full URL rewrite (#28)
|
