Skip to content

Commit

Permalink
Merge pull request #202 from wp-media/branch/2.8.19
Browse files Browse the repository at this point in the history
2.8.19
  • Loading branch information
GeekPress authored Oct 12, 2016
2 parents 4bb4d0e + f66bf6a commit 0f16f34
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion inc/common/cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function __rocket_set_real_ip_cloudflare() {
if ( isset( $_SERVER["REMOTE_ADDR"] ) ) {
$cf_ips_values = rocket_get_cloudflare_ips();

if ( ! is_object( $cf_ips_values ) || ! $cf_ips_values->success ) {
if ( ! is_object( $cf_ips_values ) || ! isset( $cf_ips_values->success ) || ! $cf_ips_values->success ) {
return;
}

Expand Down
12 changes: 6 additions & 6 deletions inc/functions/cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
function get_rocket_cloudflare_instance() {
$cf_email = get_rocket_option( 'cloudflare_email', null );
$cf_api_key = ( defined( 'WP_ROCKET_CF_API_KEY' ) ) ? WP_ROCKET_CF_API_KEY : get_rocket_option( 'cloudflare_api_key', null );

if ( isset( $cf_email, $cf_api_key ) ) {
$cf_instance = ( object ) [ 'auth' => new Cloudflare\Api( $cf_email, $cf_api_key ) ];

try {
$zone_instance = new CloudFlare\Zone( $cf_instance->auth );

if ( $cf_domain = get_rocket_option( 'cloudflare_domain' ) ) {
$zone = $zone_instance->zones( $cf_domain );
$cf_instance->zone_id = $zone->result[0]->id;
$cf_domain = get_rocket_option( 'cloudflare_domain', null );
$zone = $zone_instance->zones( $cf_domain );

if ( isset( $zone->result[0]->id ) ) {
$cf_instance->zone_id = $zone->result[0]->id;
return $cf_instance;
}
} catch( Exception $e ) {}
} catch ( Exception $e ) {}

return false;
}
Expand Down
3 changes: 2 additions & 1 deletion inc/functions/minify.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ function get_rocket_minify_excluded_external_js() {
'js.juicyads.com',
'form.jotformeu.com',
'speakerdeck.com',
'content.jwplatform.com'
'content.jwplatform.com',
'ads.investingchannel.com',
) );

return $excluded_external_js;
Expand Down
6 changes: 3 additions & 3 deletions inc/vendors/CloudFlare/Api.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ protected function request($path, array $data = null, $method = null)
CURLOPT_HEADER => false,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_FOLLOWLOCATION => true,
];

$curl_options = $default_curl_options;
Expand Down Expand Up @@ -219,7 +218,8 @@ protected function request($path, array $data = null, $method = null)
} else {
$url .= '?'.http_build_query($data);
}


@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);

Expand All @@ -235,7 +235,7 @@ protected function request($path, array $data = null, $method = null)
$response = json_decode($http_result);

curl_close($ch);
if ($response->success !== true) {
if (isset($response->success) && $response->success !== true) {
$response->error = $error;
$response->http_code = $http_code;
$response->method = $method;
Expand Down
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.18
Version: 2.8.19
Code Name: Ilum
Author: WP Media
Contributors: Jonathan Buttigieg, Julio Potier, Remy Perona
Expand All @@ -19,7 +19,7 @@
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' );

// Rocket defines
define( 'WP_ROCKET_VERSION' , '2.8.18' );
define( 'WP_ROCKET_VERSION' , '2.8.19' );
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 0f16f34

Please sign in to comment.