Remove Query Strings From Static Resources - Version 1.3.1

Version Description

  • Tested for WordPress 4.6.1
Download this release

Release Info

Developer yourwpexpert
Plugin Icon wp plugin Remove Query Strings From Static Resources
Version 1.3.1
Comparing to
See all releases

Version 1.3.1

Files changed (2) hide show
  1. readme.txt +49 -0
  2. remove-query-strings.php +35 -0
readme.txt ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Remove Query Strings From Static Resources ===
2
+ Contributors: yourwpexpert
3
+ Tags: remove, query, strings, static, resources, pingdom, gtmetrix, yslow, pagespeed
4
+ Requires at least: 3.0.1
5
+ Tested up to: 4.6.1
6
+ Stable tag: 1.3.1
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Remove query strings from static resources like CSS & JS files.
11
+
12
+ == Description ==
13
+ This plugin will remove query strings from static resources like CSS & JS files, and will improve your speed scores in services like PageSpeed, YSlow, Pingdoom and GTmetrix.
14
+
15
+ Resources with a “?” or “&” in the URL are not cached by some proxy caching servers, and moving the query string and encode the parameters into the URL will increase your WordPress site performance significant.
16
+
17
+ == Installation ==
18
+ 1. Upload the `remove-query-strings-from-static-resources` folder to the `/wp-content/plugins/` directory
19
+
20
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
21
+
22
+ 3. That's it!
23
+
24
+ == Changelog ==
25
+
26
+ = 1.3.1 =
27
+
28
+ * Tested for WordPress 4.6.1
29
+
30
+ = 1.3 =
31
+
32
+ * Remove query strings from static resources disabled in admin section
33
+
34
+ * Reverted back to the old remove query strings function, since the new one was to effective
35
+
36
+
37
+ = 1.2 =
38
+
39
+ * Fix for Google Fonts in the dashboard
40
+
41
+ = 1.1 =
42
+
43
+ * Improved to remove even more query strings
44
+
45
+ * Tested for WP 4.0
46
+
47
+ = 1.0 =
48
+
49
+ * First release
remove-query-strings.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Remove query strings from static resources
4
+ Plugin URI: http://www.yourwpexpert.com/remove-query-strings-from-static-resources-wordpress-plugin/
5
+ Description: Remove query strings from static resources like CSS & JS files. This plugin will improve your scores in services like PageSpeed, YSlow, Pingdoom and GTmetrix.
6
+ Author: Your WP Expert
7
+ Version: 1.3.1
8
+ Author URI: http://www.yourwpexpert.com/
9
+ */
10
+ function _remove_query_strings_1( $src ){
11
+ $rqs = explode( '?ver', $src );
12
+ return $rqs[0];
13
+ }
14
+ if ( is_admin() ) {
15
+ // Remove query strings from static resources disabled in admin
16
+ }
17
+
18
+ else {
19
+ add_filter( 'script_loader_src', '_remove_query_strings_1', 15, 1 );
20
+ add_filter( 'style_loader_src', '_remove_query_strings_1', 15, 1 );
21
+ }
22
+
23
+ function _remove_query_strings_2( $src ){
24
+ $rqs = explode( '&ver', $src );
25
+ return $rqs[0];
26
+ }
27
+ if ( is_admin() ) {
28
+ // Remove query strings from static resources disabled in admin
29
+ }
30
+
31
+ else {
32
+ add_filter( 'script_loader_src', '_remove_query_strings_2', 15, 1 );
33
+ add_filter( 'style_loader_src', '_remove_query_strings_2', 15, 1 );
34
+ }
35
+ ?>