Asset CleanUp: Page Speed Booster - Version 1.2.8.9

Version Description

  • Only trigger specific actions when necessary to avoid the use of extra server resources
  • Make sure "ver" query string is stripped on request only for the front-end view; Avoid removing the license info from the database when resetting everything (unless the admin chooses to remove the license info too for a complete uninstall)
  • Updated the way temporary data is stored (from $_SESSION to WordPress transient) for more effective use of server resources
Download this release

Release Info

Developer gabelivan
Plugin Icon 128x128 Asset CleanUp: Page Speed Booster
Version 1.2.8.9
Comparing to
See all releases

Code changes from version 1.2.8.8 to 1.2.8.9

classes/Main.php CHANGED
@@ -925,6 +925,13 @@ class Main
925
'plugin_settings' => $wpacuSettings->getAll()
926
);
927
928
// [wpacu_lite]
929
if ($this->isUpdateable) {
930
// [/wpacu_lite]
925
'plugin_settings' => $wpacuSettings->getAll()
926
);
927
928
+ $data['wpacu_page_just_updated'] = false;
929
+
930
+ if (get_transient('wpacu_page_just_updated')) {
931
+ $data['wpacu_page_just_updated'] = true;
932
+ delete_transient('wpacu_page_just_updated');
933
+ }
934
+
935
// [wpacu_lite]
936
if ($this->isUpdateable) {
937
// [/wpacu_lite]
classes/Update.php CHANGED
@@ -67,7 +67,10 @@ HTML;
67
public function initAfterPluginsLoaded()
68
{
69
if (! is_admin() && Main::instance()->settings['frontend_show']) {
70
- add_action( 'wp', array( $this, 'frontendUpdate' ), 9 );
71
add_action( 'template_redirect', array( $this, 'redirectAfterFrontEndUpdate' ) );
72
}
73
}
@@ -79,13 +82,6 @@ HTML;
79
*/
80
public function frontendUpdate()
81
{
82
- @session_start();
83
-
84
- if (isset($_SESSION['wpacu_page_just_updated'])) {
85
- define('WPACU_PAGE_JUST_UPDATED', true);
86
- unset($_SESSION['wpacu_page_just_updated']);
87
- }
88
-
89
$postId = 0;
90
91
if (Main::instance()->currentPostId > 0) {
@@ -183,7 +179,7 @@ HTML;
183
184
$location .= $extraParamsSign . http_build_query($paramsToAdd) . '#wpacu_wrap_assets';
185
186
- $_SESSION['wpacu_page_just_updated'] = true;
187
188
wp_safe_redirect($location);
189
exit();
67
public function initAfterPluginsLoaded()
68
{
69
if (! is_admin() && Main::instance()->settings['frontend_show']) {
70
+ if (! empty($_POST)) {
71
+ add_action( 'wp', array( $this, 'frontendUpdate' ), 9 );
72
+ }
73
+
74
add_action( 'template_redirect', array( $this, 'redirectAfterFrontEndUpdate' ) );
75
}
76
}
82
*/
83
public function frontendUpdate()
84
{
85
$postId = 0;
86
87
if (Main::instance()->currentPostId > 0) {
179
180
$location .= $extraParamsSign . http_build_query($paramsToAdd) . '#wpacu_wrap_assets';
181
182
+ set_transient('wpacu_page_just_updated', 1, 30);
183
184
wp_safe_redirect($location);
185
exit();
freemius-load.php CHANGED
@@ -19,10 +19,7 @@ if ( ! function_exists( 'wpassetcleanup_fs' )
19
'is_premium' => false,
20
'has_addons' => false,
21
'has_paid_plans' => false,
22
-
23
- 'enable_anonymous' => true,
24
- 'anonymous_mode' => true,
25
-
26
'menu' => array(
27
'slug' => WPACU_PLUGIN_ID . '_settings',
28
'override_exact' => true,
19
'is_premium' => false,
20
'has_addons' => false,
21
'has_paid_plans' => false,
22
+ 'anonymous_mode' => true,
23
'menu' => array(
24
'slug' => WPACU_PLUGIN_ID . '_settings',
25
'override_exact' => true,
freemius/templates/admin-notice-gabe-bkp.php DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- $dismiss_text = fs_text_x_inline( 'Dismiss', 'as close a window', 'dismiss' );
14
- ?>
15
- <div<?php if ( ! empty( $VARS['id'] ) ) : ?> data-id="<?php echo $VARS['id'] ?>"<?php endif ?><?php if ( ! empty( $VARS['manager_id'] ) ) : ?> data-manager-id="<?php echo $VARS['manager_id'] ?>"<?php endif ?>
16
- <?php
17
- // [wpacu_lite]
18
- // Hide "opt-in" notice that has "We made a few tweaks to the plugin"
19
- if ($VARS['manager_id'] === 'wp-asset-clean-up' && strpos($VARS['message'], 'made a few tweaks to the plugin') !== false) {
20
- ?>
21
- style="display: none !important;"
22
- <?php
23
- }
24
-
25
- $isWpacuPage = isset($_GET['page']) && (strpos($_GET['page'], 'wpassetcleanup_') !== false);
26
-
27
- $wpacuShowNoticePluginTitle = true;
28
-
29
- if ( $VARS['id'] === 'activation_pending' ) {
30
- if ( ! $isWpacuPage ) {
31
- ?>
32
- style="display: none !important;"
33
- <?php
34
- } else {
35
- $wpacuShowNoticePluginTitle = false;
36
- }
37
- }
38
-
39
-
40
- // [/wpacu_lite]
41
- ?>
42
- class="<?php
43
- switch ( $VARS['type'] ) {
44
- case 'error':
45
- echo 'error form-invalid';
46
- break;
47
- case 'promotion':
48
- echo 'updated promotion';
49
- break;
50
- case 'update':
51
- // echo 'update-nag update';
52
- // break;
53
- case 'success':
54
- default:
55
- echo 'updated success';
56
- break;
57
- }
58
- ?> fs-notice<?php if ( ! empty( $VARS['sticky'] ) ) {
59
- echo ' fs-sticky';
60
- } ?><?php if ( ! empty( $VARS['plugin'] ) ) {
61
- echo ' fs-has-title';
62
- } ?>"><?php if ( ! empty( $VARS['plugin'] ) && $wpacuShowNoticePluginTitle ) { ?>
63
- <label class="fs-plugin-title"><?php echo $VARS['plugin'] ?></label>
64
- <?php } ?>
65
- <?php if ( ! empty( $VARS['sticky'] ) ) : ?>
66
- <div class="fs-close"><i class="dashicons dashicons-no"
67
- title="<?php echo esc_attr( $dismiss_text ) ?>"></i> <span><?php echo esc_html( $dismiss_text ) ?></span>
68
- </div>
69
- <?php endif ?>
70
- <div class="fs-notice-body">
71
- <?php if ( ! empty( $VARS['title'] ) ) : ?><b><?php echo $VARS['title'] ?></b> <?php endif ?>
72
- <?php echo $VARS['message'] ?>
73
- </div>
74
- </div>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: pagespeed, page speed, dequeue, performance, gtmetrix
4
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7GJZCW6RD8ECS
5
Requires at least: 4.0
6
Tested up to: 5.0.1
7
- Stable tag: 1.2.8.8
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
@@ -122,7 +122,7 @@ In case the assets are not loading for you, please write me on the forum and I w
122
123
= I do not know or I'm not sure which assets to unload on my pages. What should I do? =
124
125
- If that's the case, then it's advisable to consult with a developer (ideally the person who helped you with your website) to give you assistance in unloading the unused assets.
126
127
== Screenshots ==
128
1. When editing a post/page (custom post type as well) a meta box will load with the asset list
@@ -131,6 +131,11 @@ If that's the case, then it's advisable to consult with a developer (ideally the
131
4. Scripts (.JS) are selected for site-wide unload
132
133
== Changelog ==
134
= 1.2.8.8 =
135
* Option to clean any license data after everything is reset in case the Pro version was used before on the same website
136
* Removed "Opt In" option from the non-sensitive diagnostic tracking until it will get replaced with a smoother version
4
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7GJZCW6RD8ECS
5
Requires at least: 4.0
6
Tested up to: 5.0.1
7
+ Stable tag: 1.2.8.9
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
122
123
= I do not know or I'm not sure which assets to unload on my pages. What should I do? =
124
125
+ With the recently released "Test Mode" feature, you can safely unload assets on your web pages without affecting the pages' functionality for the regular visitors. It will unload CSS & JavaScript files that you selected ONLY for yourself (logged-in administrator). That's recommended in case you have any doubts about whether you should applying a specific setting or unload any asset. Once you've been through the trial and error and your website is lighter, you can deactivate "Test Mode" and the changes will apply for everyone. Then, test the page speed score of your website :)
126
127
== Screenshots ==
128
1. When editing a post/page (custom post type as well) a meta box will load with the asset list
131
4. Scripts (.JS) are selected for site-wide unload
132
133
== Changelog ==
134
+ = 1.2.8.9 =
135
+ * Only trigger specific actions when necessary to avoid the use of extra server resources
136
+ * Make sure "ver" query string is stripped on request only for the front-end view; Avoid removing the license info from the database when resetting everything (unless the admin chooses to remove the license info too for a complete uninstall)
137
+ * Updated the way temporary data is stored (from $_SESSION to WordPress transient) for more effective use of server resources
138
+
139
= 1.2.8.8 =
140
* Option to clean any license data after everything is reset in case the Pro version was used before on the same website
141
* Removed "Opt In" option from the non-sensitive diagnostic tracking until it will get replaced with a smoother version
templates/settings-frontend.php CHANGED
@@ -11,7 +11,7 @@ if (! isset($data)) {
11
<div id="wpacu_wrap_assets">
12
<?php
13
if ($data['is_updateable']) {
14
- if (defined('WPACU_PAGE_JUST_UPDATED')) {
15
$updateClass = new \WpAssetCleanUp\Update;
16
?>
17
<div class="wpacu-updated-frontend"><em>
11
<div id="wpacu_wrap_assets">
12
<?php
13
if ($data['is_updateable']) {
14
+ if ($data['wpacu_page_just_updated']) {
15
$updateClass = new \WpAssetCleanUp\Update;
16
?>
17
<div class="wpacu-updated-frontend"><em>
wpacu.php CHANGED
@@ -2,13 +2,13 @@
2
/*
3
* Plugin Name: Asset CleanUp: Page Speed Booster
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
- * Version: 1.2.8.8
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages to reduce HTTP Requests and have the website load faster
7
* Author: Gabriel Livan
8
* Author URI: http://gabelivan.com/
9
*/
10
11
- define('WPACU_PLUGIN_VERSION', '1.2.8.8');
12
13
// Exit if accessed directly
14
if (! defined('ABSPATH')) {
2
/*
3
* Plugin Name: Asset CleanUp: Page Speed Booster
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
+ * Version: 1.2.8.9
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages to reduce HTTP Requests and have the website load faster
7
* Author: Gabriel Livan
8
* Author URI: http://gabelivan.com/
9
*/
10
11
+ define('WPACU_PLUGIN_VERSION', '1.2.8.9');
12
13
// Exit if accessed directly
14
if (! defined('ABSPATH')) {