Asset CleanUp: Page Speed Booster - Version 1.2.5.1

Version Description

  • Bug Fix: Better accuracy for determining the current post ID and whether the page is the home page
Download this release

Release Info

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

Code changes from version 1.2.5 to 1.2.5.1

Files changed (4) hide show
  1. classes/Main.php +4 -2
  2. classes/Update.php +9 -4
  3. readme.txt +7 -4
  4. wpacu.php +2 -2
classes/Main.php CHANGED
@@ -1082,9 +1082,11 @@ class Main
1082
$postId = $this->getCurrentPostId();
1083
}
1084
1085
if (! $this->assetsRemoved) {
1086
// For Home Page (latest blog posts)
1087
- if ($postId < 1 && Misc::isHomePage()) {
1088
$this->assetsRemoved = get_option(WPACU_PLUGIN_NAME . '_front_page_no_load');
1089
return $this->assetsRemoved;
1090
} elseif ($postId > 0) {
@@ -1145,7 +1147,7 @@ class Main
1145
}
1146
}
1147
1148
- if (is_singular() && (! $this->currentPostId)) {
1149
global $post;
1150
$this->currentPostId = isset($post->ID) ? $post->ID : 0;
1151
}
1082
$postId = $this->getCurrentPostId();
1083
}
1084
1085
+ $isInAdminPageViaAjax = (is_admin() && defined('DOING_AJAX') && DOING_AJAX);
1086
+
1087
if (! $this->assetsRemoved) {
1088
// For Home Page (latest blog posts)
1089
+ if ($postId < 1 && ($isInAdminPageViaAjax || Misc::isHomePage())) {
1090
$this->assetsRemoved = get_option(WPACU_PLUGIN_NAME . '_front_page_no_load');
1091
return $this->assetsRemoved;
1092
} elseif ($postId > 0) {
1147
}
1148
}
1149
1150
+ if (is_singular() && ($this->currentPostId < 1)) {
1151
global $post;
1152
$this->currentPostId = isset($post->ID) ? $post->ID : 0;
1153
}
classes/Update.php CHANGED
@@ -35,7 +35,11 @@ class Update
35
*/
36
public function frontendUpdate()
37
{
38
- $post = get_post(Main::instance()->currentPostId);
39
40
// Check nonce
41
$nonceName = self::NONCE_FIELD_NAME;
@@ -54,7 +58,7 @@ class Update
54
}
55
56
if (! wp_verify_nonce($_POST[$nonceName], $nonceAction)) {
57
- $postUrlAnchor = get_permalink($post->ID).'#wpacu_wrap_assets';
58
wp_die(
59
sprintf(
60
__('The nonce expired or is not correct, thus the request was not processed. %sPlease retry%s.', WPACU_PLUGIN_NAME),
@@ -65,12 +69,13 @@ class Update
65
);
66
}
67
68
- if (Misc::isHomePage() && ! (isset($post->ID) && $post->ID > 0)) {
69
$wpacuNoLoadAssets = isset($_POST[WPACU_PLUGIN_NAME])
70
? $_POST[WPACU_PLUGIN_NAME] : array();
71
72
$this->updateFrontPage($wpacuNoLoadAssets);
73
- } else {
74
$this->savePost($post->ID, $post);
75
}
76
}
35
*/
36
public function frontendUpdate()
37
{
38
+ $postId = 0;
39
+
40
+ if (Main::instance()->currentPostId > 0) {
41
+ $postId = Main::instance()->currentPostId;
42
+ }
43
44
// Check nonce
45
$nonceName = self::NONCE_FIELD_NAME;
58
}
59
60
if (! wp_verify_nonce($_POST[$nonceName], $nonceAction)) {
61
+ $postUrlAnchor = get_permalink($postId).'#wpacu_wrap_assets';
62
wp_die(
63
sprintf(
64
__('The nonce expired or is not correct, thus the request was not processed. %sPlease retry%s.', WPACU_PLUGIN_NAME),
69
);
70
}
71
72
+ if (Misc::isHomePage() && ! ($postId > 0)) {
73
$wpacuNoLoadAssets = isset($_POST[WPACU_PLUGIN_NAME])
74
? $_POST[WPACU_PLUGIN_NAME] : array();
75
76
$this->updateFrontPage($wpacuNoLoadAssets);
77
+ } elseif ($postId > 0) {
78
+ $post = get_post($postId);
79
$this->savePost($post->ID, $post);
80
}
81
}
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
- === WP Asset CleanUp ===
2
Contributors: gabelivan
3
Tags: speed, pagespeed, dequeue style, dequeue script, unload style, unload script, fast
4
Donate link: https://www.gabelivan.com/donate/
5
Requires at least: 4.0
6
Tested up to: 4.7.8
7
- Stable tag: 1.2.5
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
11
- Make your website load FASTER by preventing specific scripts (.JS) & styles (.CSS) from loading on pages/posts and home page
12
13
== Description ==
14
- * Make your web pages load FASTER with "WP Asset CleanUp"
15
* Faster page load = Happier Visitors = More Conversions
16
17
There are often times when you are using a theme and a number of plugins which are enabled and run on the same page. However, you don't need to use all of them and to improve the speed of your website and make the HTML source code cleaner (convenient for debugging purposes), it's better to prevent those styles and scripts from loading.
@@ -102,6 +102,9 @@ If that's the case, then it's advisable to consult with a developer (ideally the
102
4. Scripts (.JS) are selected for site-wide unload
103
104
== Changelog ==
105
= 1.2.5 =
106
* Bug Fix: Remove JavaScript error from window.btoa() in case the page contains non-latin characters
107
* Added "Get Help" page within the plugin's menu to anyone interested in hiring me or any of my colleagues for professional help related to the plugin or any other WordPress task
1
+ === WP Asset CleanUp (Page Speed Optimizer) ===
2
Contributors: gabelivan
3
Tags: speed, pagespeed, dequeue style, dequeue script, unload style, unload script, fast
4
Donate link: https://www.gabelivan.com/donate/
5
Requires at least: 4.0
6
Tested up to: 4.7.8
7
+ Stable tag: 1.2.5.1
8
License: GPLv3
9
License URI: http://www.gnu.org/licenses/gpl.html
10
11
+ Make your website load FASTER by preventing specific scripts (.JS) & styles (.CSS) from loading on pages/posts and home page. Works best in addition to a cache plugin!
12
13
== Description ==
14
+ * Make your web pages load FASTER with "WP Asset CleanUp (Page Speed Optimizer)"
15
* Faster page load = Happier Visitors = More Conversions
16
17
There are often times when you are using a theme and a number of plugins which are enabled and run on the same page. However, you don't need to use all of them and to improve the speed of your website and make the HTML source code cleaner (convenient for debugging purposes), it's better to prevent those styles and scripts from loading.
102
4. Scripts (.JS) are selected for site-wide unload
103
104
== Changelog ==
105
+ = 1.2.5.1 =
106
+ * Bug Fix: Better accuracy for determining the current post ID and whether the page is the home page
107
+
108
= 1.2.5 =
109
* Bug Fix: Remove JavaScript error from window.btoa() in case the page contains non-latin characters
110
* Added "Get Help" page within the plugin's menu to anyone interested in hiring me or any of my colleagues for professional help related to the plugin or any other WordPress task
wpacu.php CHANGED
@@ -1,8 +1,8 @@
1
<?php
2
/*
3
- * Plugin Name: WP Asset CleanUp
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
- * Version: 1.2.5
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages that you don't need
7
* Author: Gabriel Livan
8
* Author URI: http://www.gabelivan.com/
1
<?php
2
/*
3
+ * Plugin Name: WP Asset CleanUp (Page Speed Optimizer)
4
* Plugin URI: https://wordpress.org/plugins/wp-asset-clean-up/
5
+ * Version: 1.2.5.1
6
* Description: Prevent Chosen Scripts & Styles from loading in Posts/Pages that you don't need
7
* Author: Gabriel Livan
8
* Author URI: http://www.gabelivan.com/