Skip to content

Commit

Permalink
Merge pull request #209 from wp-media/branch-2.8.22
Browse files Browse the repository at this point in the history
2.8.22
  • Loading branch information
GeekPress authored Oct 18, 2016
2 parents e8ca27c + e2b694e commit 04348c3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 25 deletions.
13 changes: 13 additions & 0 deletions inc/admin/compat/cf-options-5.4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );

$cf_instance = get_rocket_cloudflare_api_instance();
if ( ! is_wp_error( $cf_instance ) ) {
try {
$zone_instance = new CloudFlare\Zone( $cf_instance );
$zone = $zone_instance->zones( $newvalue['cloudflare_domain'] );

if ( isset( $zone->result[0]->id ) ) {
$newvalue['cloudflare_zone_id'] = $zone->result[0]->id;
}
} catch ( Exception $e ) {}
}
14 changes: 14 additions & 0 deletions inc/admin/compat/cf-upgrader-5.4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );

$cf_instance = get_rocket_cloudflare_api_instance();
if ( ! is_wp_error( $cf_instance ) ) {
try {
$zone_instance = new CloudFlare\Zone( $cf_instance );
$zone = $zone_instance->zones( $options['cloudflare_domain'] );

if ( isset( $zone->result[0]->id ) ) {
$options['cloudflare_zone_id'] = $zone->result[0]->id;
update_option( WP_ROCKET_SLUG, $options );
}
} catch ( Exception $e ) {}
}
12 changes: 1 addition & 11 deletions inc/admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,17 +1092,7 @@ function rocket_pre_main_option( $newvalue, $oldvalue ) {

// Update CloudFlare zone ID if CloudFlare domain was changed
if ( isset( $newvalue['cloudflare_domain'], $oldvalue['cloudflare_domain'] ) && $newvalue['cloudflare_domain'] != $oldvalue['cloudflare_domain'] && phpversion() >= '5.4' ) {
$cf_instance = get_rocket_cloudflare_api_instance();
if ( ! is_wp_error( $cf_instance ) ) {
try {
$zone_instance = new CloudFlare\Zone( $cf_instance );
$zone = $zone_instance->zones( $newvalue['cloudflare_domain'] );

if ( isset( $zone->result[0]->id ) ) {
$newvalue['cloudflare_zone_id'] = $zone->result[0]->id;
}
} catch ( Exception $e ) {}
}
require( WP_ROCKET_ADMIN_PATH . 'compat/cf-options-5.4.php' );
}

// Save old CloudFlare settings
Expand Down
13 changes: 1 addition & 12 deletions inc/admin/upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,7 @@ function rocket_new_upgrade( $wp_rocket_version, $actual_version ) {
if ( version_compare( $actual_version, '2.8.21', '<' ) && phpversion() >= '5.4' ) {
$options = get_option( WP_ROCKET_SLUG );
if ( 0 < $options['do_cloudflare'] && $options['cloudflare_domain'] !== '' ) {
$cf_instance = get_rocket_cloudflare_api_instance();
if ( ! is_wp_error( $cf_instance ) ) {
try {
$zone_instance = new CloudFlare\Zone( $cf_instance );
$zone = $zone_instance->zones( $options['cloudflare_domain'] );

if ( isset( $zone->result[0]->id ) ) {
$options['cloudflare_zone_id'] = $zone->result[0]->id;
update_option( WP_ROCKET_SLUG, $options );
}
} catch ( Exception $e ) {}
}
require( WP_ROCKET_ADMIN_PATH . 'compat/cf-upgrader-5.4.php' );
}
}
}
4 changes: 2 additions & 2 deletions wp-rocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: WP Rocket
Plugin URI: https://wp-rocket.me
Description: The best WordPress performance plugin.
Version: 2.8.21
Version: 2.8.22
Code Name: Ilum
Author: WP Media
Contributors: Jonathan Buttigieg, Julio Potier, Remy Perona
Expand All @@ -19,7 +19,7 @@
defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );

// Rocket defines
define( 'WP_ROCKET_VERSION' , '2.8.21' );
define( 'WP_ROCKET_VERSION' , '2.8.22' );
define( 'WP_ROCKET_PRIVATE_KEY' , false );
define( 'WP_ROCKET_SLUG' , 'wp_rocket_settings' );
define( 'WP_ROCKET_WEB_MAIN' , 'http://support.wp-rocket.me/' );
Expand Down

0 comments on commit 04348c3

Please sign in to comment.