Skip to content

Commit 7f2af0d

Browse files
authored
Merge pull request #141 from wp-media/branch-2.8.11
2.8.11
2 parents 674cc6b + 915292b commit 7f2af0d

File tree

9 files changed

+81
-6
lines changed

9 files changed

+81
-6
lines changed

inc/3rd-party/3rd-party.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@
3333
require( WP_ROCKET_3RD_PARTY_PATH . 'all-in-one-seo-pack.php' );
3434
require( WP_ROCKET_3RD_PARTY_PATH . 'wp-rest-api.php' );
3535
require( WP_ROCKET_3RD_PARTY_PATH . 'page-builder/beaver-builder.php' );
36+
require( WP_ROCKET_3RD_PARTY_PATH . 'page-builder/thrive-visual-editor.php' );

inc/3rd-party/buddypress.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,22 @@ function __deactivate_rocket_lazyload_on_buddypress_profil_pages( $run_filter )
2424
return $run_filter;
2525
}
2626

27+
/**
28+
* Excludes BuddyPress's plupload from JS minification
29+
*
30+
* Exclude it to prevent an error after minification/concatenation preventing the image upload from working correctly
31+
*
32+
* @since 2.8.10
33+
* @author Remy Perona
34+
*
35+
* @param Array $excluded_handle An array of JS handles enqueued in WordPress
36+
* @return Array the updated array of handles
37+
*/
38+
add_filter( 'rocket_excluded_handle_js', '__rocket_exclude_js_buddypress' );
39+
function __rocket_exclude_js_buddypress( $excluded_handle ) {
40+
$excluded_handle[] = 'bp-plupload';
41+
42+
return $excluded_handle;
43+
}
44+
2745
endif;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
3+
4+
if ( function_exists( 'tve_editor_url' ) ) {
5+
/**
6+
* Forces Thrive Visual Editor’s bot detection to assume a human visitor.
7+
*
8+
* @since 2.8.11
9+
* @author Remy Perona
10+
*
11+
* @param boolean|integer $bot_detection 1|0 when crawler has|not been detected, FALSE when user agent string is unavailable
12+
* @return integer
13+
*/
14+
add_filter( 'tve_dash_is_crawler', '__return_zero', PHP_INT_MAX );
15+
}

inc/admin/ui/js/options.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ jQuery( document ).ready( function($){
218218
if( response.msg == 'SUCCESS' ) {
219219
title = sawpr.successSupportTitle;
220220
text = sawpr.successSupportText;
221+
confirmButtonText = 'OK';
222+
confirmButtonColor = '#3085d6';
221223
type = "success";
222224

223225
// Reset the values

inc/admin/upgrader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ function rocket_upgrader() {
3535
}
3636

3737
update_option( WP_ROCKET_SLUG, $options );
38+
39+
// Empty OPCache to prevent issue where plugin is updated but still showing as old version in WP admin
40+
if ( function_exists( 'opcache_reset' ) ) {
41+
opcache_reset();
42+
}
3843
} else {
3944
if ( empty( $_POST ) && rocket_valid_key() ) {
4045
rocket_check_key( 'transient_30' );

inc/common/purge.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,19 @@ function rocket_clean_post( $post_id ) {
164164
// Add urls page to purge every time a post is save
165165
$cache_purge_pages = get_rocket_option( 'cache_purge_pages' );
166166
if ( $cache_purge_pages ) {
167+
global $blog_id;
168+
169+
$home_url = get_option( 'home' );
170+
171+
if ( ! empty( $blog_id ) && is_multisite() ) {
172+
switch_to_blog( $blog_id );
173+
$home_url = get_option( 'home' );
174+
restore_current_blog();
175+
}
176+
167177
foreach( $cache_purge_pages as $page ) {
168-
array_push( $purge_urls, home_url( $page ) );
178+
$page = trailingslashit( $home_url ) . $page;
179+
array_push( $purge_urls, $page );
169180
}
170181
}
171182

inc/front/process.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@
169169
if ( $detect->isMobile() && ! $detect->isTablet() ) {
170170
$filename .= '-mobile';
171171
}
172+
173+
if ( strpos( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ) {
174+
// Create a hidden empty file for mobile detection on NGINX with the Rocket NGINX configuration
175+
$nginx_mobile_detect_file = $request_uri_path . '/.mobile-active';
176+
177+
if ( ! file_exists( $nginx_mobile_detect_file ) ) {
178+
touch( $nginx_mobile_detect_file );
179+
}
180+
}
172181
}
173182

174183
// Rename the caching filename for SSL URLs

inc/functions/files.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function rocket_clean_home( $lang = '' ) {
455455

456456
// Delete homepage
457457
if ( $files = glob( $root . '/{index,index-*}.{html,html_gzip}', GLOB_BRACE|GLOB_NOSORT ) ) {
458-
foreach ( $files as $file ) { // no array map to use @
458+
foreach ( $files as $file ) { // no array map to use @
459459
@unlink( $file );
460460
}
461461
}
@@ -466,6 +466,13 @@ function rocket_clean_home( $lang = '' ) {
466466
rocket_rrmdir( $dir );
467467
}
468468
}
469+
470+
// Remove the hidden empty file for mobile detection on NGINX with the Rocket NGINX configuration
471+
if ( $nginx_mobile_detect_files = glob( $root . '/.mobile-active', GLOB_BRACE|GLOB_NOSORT ) ) {
472+
foreach ( $nginx_mobile_detect_files as $nginx_mobile_detect_file ) { // no array map to use @
473+
@unlink( $nginx_mobile_detect_file );
474+
}
475+
}
469476

470477
/**
471478
* Fires after the home cache file was deleted
@@ -760,7 +767,7 @@ function rocket_rrmdir( $dir, $dirs_to_preserve = array() ) {
760767
$dir = untrailingslashit( $dir );
761768

762769
/**
763-
* Fires after a file/directory cache was deleted
770+
* Fires before a file/directory cache is deleted
764771
*
765772
* @since 1.1.0
766773
*
@@ -769,6 +776,13 @@ function rocket_rrmdir( $dir, $dirs_to_preserve = array() ) {
769776
*/
770777
do_action( 'before_rocket_rrmdir', $dir, $dirs_to_preserve );
771778

779+
// Remove the hidden empty file for mobile detection on NGINX with the Rocket NGINX configuration
780+
$nginx_mobile_detect_file = $dir . '/.mobile-active';
781+
782+
if ( file_exists( $nginx_mobile_detect_file ) ) {
783+
@unlink( $nginx_mobile_detect_file );
784+
}
785+
772786
if ( ! is_dir( $dir ) ) {
773787
@unlink( $dir );
774788
return;
@@ -795,7 +809,7 @@ function rocket_rrmdir( $dir, $dirs_to_preserve = array() ) {
795809
@rmdir($dir);
796810

797811
/**
798-
* Fires before a file/directory cache was deleted
812+
* Fires after a file/directory cache was deleted
799813
*
800814
* @since 1.1.0
801815
*

wp-rocket.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: WP Rocket
44
Plugin URI: http://www.wp-rocket.me
55
Description: The best WordPress performance plugin.
6-
Version: 2.8.10
6+
Version: 2.8.11
77
Code Name: Ilum
88
Author: WP Rocket
99
Contributors: Jonathan Buttigieg, Julio Potier, Remy Perona
@@ -19,7 +19,7 @@
1919
defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );
2020

2121
// Rocket defines
22-
define( 'WP_ROCKET_VERSION' , '2.8.10' );
22+
define( 'WP_ROCKET_VERSION' , '2.8.11' );
2323
define( 'WP_ROCKET_PRIVATE_KEY' , false );
2424
define( 'WP_ROCKET_SLUG' , 'wp_rocket_settings' );
2525
define( 'WP_ROCKET_WEB_MAIN' , 'http://support.wp-rocket.me/' );

0 commit comments

Comments
 (0)