Speed Booster Pack - Version 4.5.1

Version Description

Release Date: 14 April 2021

  • NEW: Simple warning notice about PHP version (when it's below 7.0).
  • Fixed: Deactivation survey didn't show the details textarea.
  • Fixed: LiteSpeed cache cached logged-in users even when the setting was turned off.
Download this release

Release Info

Developer optimocha
Plugin Icon 128x128 Speed Booster Pack
Version 4.5.1
Comparing to
See all releases

Code changes from version 4.5.0 to 4.5.1

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: speed, pagespeed, optimization, core web vitals, cache
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
  Requires PHP: 5.6
8
- Stable tag: 4.5.0
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -103,6 +103,14 @@ All the time! We're always looking for new ways to get this plugin to a better s
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
106
  = 4.5.0 =
107
 
108
  *Release Date: 14 April 2021*
@@ -118,8 +126,7 @@ All the time! We're always looking for new ways to get this plugin to a better s
118
  * **Updated**: Updated Codestar Framework to v2.2.6.
119
  * **Updated**: Updated lazyload.js to v17.7.0.
120
 
121
-
122
- = 4.4.1 =
123
 
124
  *Release Date: 12 March 2021*
125
 
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
  Requires PHP: 5.6
8
+ Stable tag: 4.5.1
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
103
 
104
  == Changelog ==
105
 
106
+ = 4.5.1 =
107
+
108
+ *Release Date: 14 April 2021*
109
+
110
+ * **NEW**: Simple warning notice about PHP version (when it's below 7.0).
111
+ * **Fixed**: Deactivation survey didn't show the details textarea.
112
+ * **Fixed**: LiteSpeed cache cached logged-in users even when the setting was turned off.
113
+
114
  = 4.5.0 =
115
 
116
  *Release Date: 14 April 2021*
126
  * **Updated**: Updated Codestar Framework to v2.2.6.
127
  * **Updated**: Updated lazyload.js to v17.7.0.
128
 
129
+ = 4.4.1.1 =
 
130
 
131
  *Release Date: 12 March 2021*
132
 
admin/js/speed-booster-pack-admin.js CHANGED
@@ -202,7 +202,7 @@
202
  }
203
  }
204
 
205
- if (hash === 'database') {
206
  $.scanDatabaseTables();
207
  }
208
  });
202
  }
203
  }
204
 
205
+ if (hash === 'optimize-database') {
206
  $.scanDatabaseTables();
207
  }
208
  });
includes/classes/class-sbp-litespeed-cache.php CHANGED
@@ -67,10 +67,12 @@ class SBP_LiteSpeed_Cache extends SBP_Base_Cache {
67
  $lines[] = 'RewriteEngine On';
68
  $lines[] = 'CacheLookup On' . PHP_EOL;
69
 
70
- // Add vary, so the logged in users won't see public cache or other users' caches
71
- $lines[] = '## BEGIN Cache vary for logged in users';
72
- $lines[] = 'RewriteRule .? - [E="Cache-Vary:,wordpress_logged_in_' . COOKIEHASH . '"]';
73
- $lines[] = '## END Cache vary for logged in users' . PHP_EOL;
 
 
74
 
75
  if ( sbp_get_option( 'caching_ls_separate_mobile' ) ) {
76
  $lines[] = '## BEGIN Cache vary for mobile browsers';
67
  $lines[] = 'RewriteEngine On';
68
  $lines[] = 'CacheLookup On' . PHP_EOL;
69
 
70
+ if ( sbp_get_option( 'caching_ls_cache_logged_in_users' ) ) {
71
+ // Add vary, so the logged in users won't see public cache or other users' caches
72
+ $lines[] = '## BEGIN Cache vary for logged in users';
73
+ $lines[] = 'RewriteRule .? - [E="Cache-Vary:,wordpress_logged_in_' . COOKIEHASH . '"]';
74
+ $lines[] = '## END Cache vary for logged in users' . PHP_EOL;
75
+ }
76
 
77
  if ( sbp_get_option( 'caching_ls_separate_mobile' ) ) {
78
  $lines[] = '## BEGIN Cache vary for mobile browsers';
includes/classes/class-sbp-wp-admin.php CHANGED
@@ -9,20 +9,22 @@ if ( ! defined( 'WPINC' ) ) {
9
 
10
  class SBP_WP_Admin {
11
  public function __construct() {
 
12
  add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_links' ], 90 );
13
- if ( is_admin() ) {
14
- add_action( 'admin_init', [ $this, 'set_notices' ] );
15
 
16
- add_action( 'admin_init', [ $this, 'timed_notifications' ] );
17
- add_action( 'admin_init', [ $this, 'welcome_notice' ] );
18
- add_action( 'admin_init', [ $this, 'clear_custom_code_manager' ] );
19
- add_action( 'admin_head', [ $this, 'check_required_file_permissions' ] );
20
 
21
- add_action( 'wp_ajax_sbp_dismiss_intro', [ $this, 'dismiss_intro' ] );
22
- add_action( 'wp_ajax_sbp_dismiss_ccm_backup', [ $this, 'dismiss_custom_code_manager_backup' ] );
 
 
 
 
23
 
24
- add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_deactivation_survey_scripts' ] );
25
- }
 
 
26
 
27
  add_filter( 'plugin_row_meta', [ $this, 'plugin_meta_links' ], 10, 2 );
28
  add_filter( 'plugin_action_links_' . SBP_PLUGIN_BASENAME, [ $this, 'settings_links' ], 10, 2 );
@@ -293,11 +295,21 @@ class SBP_WP_Admin {
293
  }
294
 
295
  public function welcome_notice() {
 
296
  SBP_Notice_Manager::display_notice( 'welcome_notice', sprintf( '<p>' . __( 'Thank you for installing %1$s! You can now visit the %2$ssettings page%3$s to start speeding up your website.', 'speed-booster-pack' ) . '</p>', SBP_PLUGIN_NAME, '<a href="' . admin_url( 'admin.php?page=sbp-settings&dismiss_welcome_notice=true' ) . '">', '</a>' ), 'success', true, 'one_time', 'plugins' );
297
 
298
  if ( isset( $_GET['dismiss_welcome_notice'] ) && $_GET['dismiss_welcome_notice'] == true ) {
299
  SBP_Notice_Manager::dismiss_notice( 'welcome_notice' );
300
  }
 
 
 
 
 
 
 
 
 
301
  }
302
 
303
  public function dismiss_intro() {
@@ -344,11 +356,11 @@ class SBP_WP_Admin {
344
  ' . __( 'I\'m just disabling temporarily.', 'speed-booster-pack' ) . '
345
  </label>
346
  <label>
347
- <input type="radio" name="sbp_reason" value="Other." />
348
  ' . __( 'Other (please specify below)', 'speed-booster-pack' ) . '
349
  </label>
350
  <label>
351
- <textarea name="sbp_deactivation_description" class="widefat" style="display: none;"></textarea>
352
  </label>
353
  <input type="hidden" name="sbp_site_url" value="' . site_url() . '" />
354
  <input type="hidden" name="sbp_version" value="' . SBP_VERSION . '" />
9
 
10
  class SBP_WP_Admin {
11
  public function __construct() {
12
+
13
  add_action( 'admin_bar_menu', [ $this, 'add_admin_bar_links' ], 90 );
 
 
14
 
15
+ if ( ! is_admin() ) { return; }
 
 
 
16
 
17
+ add_action( 'admin_init', [ $this, 'set_notices' ] );
18
+ add_action( 'admin_init', [ $this, 'timed_notifications' ] );
19
+ add_action( 'admin_init', [ $this, 'welcome_notice' ] );
20
+ add_action( 'admin_init', [ $this, 'clear_custom_code_manager' ] );
21
+ add_action( 'admin_head', [ $this, 'check_required_file_permissions' ] );
22
+ add_action( 'admin_init', [ $this, 'upgrade_php_notice' ] );
23
 
24
+ add_action( 'wp_ajax_sbp_dismiss_intro', [ $this, 'dismiss_intro' ] );
25
+ add_action( 'wp_ajax_sbp_dismiss_ccm_backup', [ $this, 'dismiss_custom_code_manager_backup' ] );
26
+
27
+ add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_deactivation_survey_scripts' ] );
28
 
29
  add_filter( 'plugin_row_meta', [ $this, 'plugin_meta_links' ], 10, 2 );
30
  add_filter( 'plugin_action_links_' . SBP_PLUGIN_BASENAME, [ $this, 'settings_links' ], 10, 2 );
295
  }
296
 
297
  public function welcome_notice() {
298
+
299
  SBP_Notice_Manager::display_notice( 'welcome_notice', sprintf( '<p>' . __( 'Thank you for installing %1$s! You can now visit the %2$ssettings page%3$s to start speeding up your website.', 'speed-booster-pack' ) . '</p>', SBP_PLUGIN_NAME, '<a href="' . admin_url( 'admin.php?page=sbp-settings&dismiss_welcome_notice=true' ) . '">', '</a>' ), 'success', true, 'one_time', 'plugins' );
300
 
301
  if ( isset( $_GET['dismiss_welcome_notice'] ) && $_GET['dismiss_welcome_notice'] == true ) {
302
  SBP_Notice_Manager::dismiss_notice( 'welcome_notice' );
303
  }
304
+
305
+ }
306
+
307
+ public function upgrade_php_notice() {
308
+
309
+ if ( version_compare( phpversion(), '7.0', '>=' ) ) { return; }
310
+
311
+ SBP_Notice_Manager::display_notice( 'upgrade_php_notice', '<p><strong>' . SBP_PLUGIN_NAME . '</strong>: ' . __( 'You are using a really old PHP version! In a few months, Speed Booster Pack will stop working with PHP versions below 7.0, so we highly recommend you update PHP to the latest version (or ask your hosting company to do it).', 'speed-booster-pack' ) . '</p>', 'warning', false );
312
+
313
  }
314
 
315
  public function dismiss_intro() {
356
  ' . __( 'I\'m just disabling temporarily.', 'speed-booster-pack' ) . '
357
  </label>
358
  <label>
359
+ <input type="radio" name="sbp_reason" value="Other" />
360
  ' . __( 'Other (please specify below)', 'speed-booster-pack' ) . '
361
  </label>
362
  <label>
363
+ <textarea name="sbp_deactivation_description" class="widefat" placeholder="' . __( 'Details (optional)', 'speed-booster-pack' ) . '"></textarea>
364
  </label>
365
  <input type="hidden" name="sbp_site_url" value="' . site_url() . '" />
366
  <input type="hidden" name="sbp_version" value="' . SBP_VERSION . '" />
includes/sbp-helpers.php CHANGED
@@ -155,22 +155,6 @@ if ( ! function_exists( 'sbp_str_replace_first' ) ) {
155
  }
156
  }
157
 
158
- if ( ! function_exists( 'sbp_get_filesystem' ) ) {
159
- /**
160
- * Return WP_Filesystem instance
161
- *
162
- * @return mixed
163
- */
164
- function sbp_get_filesystem() {
165
- global $wp_filesystem;
166
-
167
- require_once( ABSPATH . '/wp-admin/includes/file.php' );
168
- WP_Filesystem();
169
-
170
- return $wp_filesystem;
171
- }
172
- }
173
-
174
  if ( ! function_exists( 'sbp_posabs' ) ) {
175
  /**
176
  * Returns absolute value of a number. Returns 1 if value is zero.
@@ -515,4 +499,16 @@ if ( ! function_exists( 'sbp_is_wp_config_writable' ) ) {
515
 
516
  return file_exists( $wp_config_file ) && sbp_check_file_permissions( $wp_config_file );
517
  }
 
 
 
 
 
 
 
 
 
 
 
 
518
  }
155
  }
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  if ( ! function_exists( 'sbp_posabs' ) ) {
159
  /**
160
  * Returns absolute value of a number. Returns 1 if value is zero.
499
 
500
  return file_exists( $wp_config_file ) && sbp_check_file_permissions( $wp_config_file );
501
  }
502
+ }
503
+
504
+ if ( ! function_exists( 'sbp_log' ) ) {
505
+
506
+ function sbp_log( $message ) {
507
+
508
+ if ( WP_DEBUG !== true ) { return; }
509
+
510
+ error_log( print_r( $message, true ) );
511
+
512
+ }
513
+
514
  }
speed-booster-pack.php CHANGED
@@ -6,7 +6,7 @@
6
  * Plugin Name: Speed Booster Pack
7
  * Plugin URI: https://speedboosterpack.com
8
  * Description: PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
9
- * Version: 4.5.0
10
  * Author: Optimocha
11
  * Author URI: https://optimocha.com
12
  * License: GPLv3 or later
@@ -32,7 +32,7 @@ define( 'SBP_PLUGIN_NAME', 'Speed Booster Pack' );
32
  /**
33
  * Current plugin version.
34
  */
35
- define( 'SBP_VERSION', '4.5.0' );
36
 
37
  /**
38
  * Plugin website URL.
6
  * Plugin Name: Speed Booster Pack
7
  * Plugin URI: https://speedboosterpack.com
8
  * Description: PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
9
+ * Version: 4.5.1
10
  * Author: Optimocha
11
  * Author URI: https://optimocha.com
12
  * License: GPLv3 or later
32
  /**
33
  * Current plugin version.
34
  */
35
+ define( 'SBP_VERSION', '4.5.1' );
36
 
37
  /**
38
  * Plugin website URL.