Version Description
- Now styles that are loaded in the BODY section of the page are unloaded (if selected); Sometimes, in special cases, within "wp_footer" action (or other similar one such as "get_footer"), wp_enqueue_style is called
Download this release
Release Info
Developer | gabelivan |
Plugin | Asset CleanUp: Page Speed Booster |
Version | 1.2.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.4.1 to 1.2.4.2
- README.md +2 -0
- classes/Main.php +6 -4
- readme.txt +4 -1
- wpacu.php +1 -1
README.md
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
# wp-asset-clean-up
|
2 |
+
WordPress Plugin: Make your Website Load FASTER by preventing specific scripts (.JS) and styles (.CSS) from loading on pages/posts and home page
|
classes/Main.php
CHANGED
@@ -101,15 +101,17 @@ class Main
|
|
101 |
|
102 |
// Front-end View - Unload the assets
|
103 |
if (! isset($_POST[WPACU_PLUGIN_NAME.'_load'])) {
|
|
|
|
|
|
|
104 |
// Unload Scripts - HEAD
|
105 |
add_action('wp_print_scripts', array($this, 'filterScripts'), 100000);
|
106 |
|
107 |
-
// Unload Scripts - FOOTER
|
108 |
// Needs to be triggered very soon as some old plugins/themes use wp_footer() to enqueue scripts
|
|
|
109 |
add_action('wp_print_footer_scripts', array($this, 'filterScripts'), 1);
|
110 |
-
|
111 |
-
// Unload Styles - HEAD only
|
112 |
-
add_action('wp_print_styles', array($this, 'filterStyles'), 100000);
|
113 |
}
|
114 |
|
115 |
// Send an AJAX request to get the list of loaded scripts and styles and print it nicely
|
101 |
|
102 |
// Front-end View - Unload the assets
|
103 |
if (! isset($_POST[WPACU_PLUGIN_NAME.'_load'])) {
|
104 |
+
// Unload Styles - HEAD
|
105 |
+
add_action('wp_print_styles', array($this, 'filterStyles'), 100000);
|
106 |
+
|
107 |
// Unload Scripts - HEAD
|
108 |
add_action('wp_print_scripts', array($this, 'filterScripts'), 100000);
|
109 |
|
110 |
+
// Unload Scripts & Styles - FOOTER
|
111 |
// Needs to be triggered very soon as some old plugins/themes use wp_footer() to enqueue scripts
|
112 |
+
// Sometimes styles are loaded in the BODY section of the page
|
113 |
add_action('wp_print_footer_scripts', array($this, 'filterScripts'), 1);
|
114 |
+
add_action('wp_print_footer_scripts', array($this, 'filterStyles'), 1);
|
|
|
|
|
115 |
}
|
116 |
|
117 |
// Send an AJAX request to get the list of loaded scripts and styles and print it nicely
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: speed, pagespeed, dequeue style, dequeue script, unload style, unload scri
|
|
4 |
Donate link: http://www.gabelivan.com/donate/
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.7
|
7 |
-
Stable tag: 1.2.4.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -92,6 +92,9 @@ If that's the case, then it's advisable to consult with a developer (ideally the
|
|
92 |
4. Scripts (.JS) are selected for site-wide unload
|
93 |
|
94 |
== Changelog ==
|
|
|
|
|
|
|
95 |
= 1.2.4.1 =
|
96 |
* Bug Fix: When the handle's key on update was equal with 0 (for remove global unload), the rule would not be remove *
|
97 |
|
4 |
Donate link: http://www.gabelivan.com/donate/
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.7
|
7 |
+
Stable tag: 1.2.4.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
92 |
4. Scripts (.JS) are selected for site-wide unload
|
93 |
|
94 |
== Changelog ==
|
95 |
+
= 1.2.4.2 =
|
96 |
+
* Now styles that are loaded in the BODY section of the page are unloaded (if selected); Sometimes, in special cases, within "wp_footer" action (or other similar one such as "get_footer"), wp_enqueue_style is called
|
97 |
+
|
98 |
= 1.2.4.1 =
|
99 |
* Bug Fix: When the handle's key on update was equal with 0 (for remove global unload), the rule would not be remove *
|
100 |
|
wpacu.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Asset CleanUp
|
4 |
* Plugin URI: http://www.bitrepository.com/remove-unused-scripts-styles-wordpress-pages.html
|
5 |
-
* Version: 1.2.4.
|
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/
|
2 |
/*
|
3 |
* Plugin Name: WP Asset CleanUp
|
4 |
* Plugin URI: http://www.bitrepository.com/remove-unused-scripts-styles-wordpress-pages.html
|
5 |
+
* Version: 1.2.4.2
|
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/
|