WP Performance Score Booster - Version 1.1.1

Version Description

Download this release

Release Info

Developer dipakcg
Plugin Icon 128x128 WP Performance Score Booster
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

Files changed (2) hide show
  1. readme.txt +10 -6
  2. wp-performance-score-booster.php +26 -13
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Performance Score Booster ===
2
  Contributors: dipakcg
3
- Tags: performance, load, speed, time, remove, query, strings, static, resources, gzip, compression, expire, caching, boost, pingdom, gtmetrix, yslow, pagespeed
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3S8BRPLWLNQ38
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
- Stable tag: 1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,9 +14,9 @@ Helps you to improve your website scores in services like PageSpeed, YSlow, Ping
14
  This plugin helps you to improve your website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix. It will remove any query strings from static resources like CSS & JS files, enable GZIP compression (compress text, html, javascript, css, xml and so on) and set expires caching (leverage browser caching) to improve your site performance scores.
15
 
16
  == Installation ==
17
- 1. Upload the `wp-performance-score-booster` folder to the `/wp-content/plugins/` directory
18
- 2. Activate the plugin through the \'Plugins\' menu in WordPress.
19
- 3. That\'s it!
20
 
21
  == Frequently Asked Questions ==
22
  = What does this plugin do? =
@@ -25,7 +25,8 @@ It helps you to improve your website scores in services like PageSpeed, YSlow, P
25
 
26
  = Any specific requirements for this plugin to work? =
27
 
28
- Yes, First, GZIP compression should be enabled in your web-server (apache?), and second, .htaccess in your root folder must have write permissions (chmod 777).
 
29
 
30
  = Is that it? =
31
 
@@ -35,6 +36,9 @@ Pretty much, yeah.
35
  1. Admin Settings
36
 
37
  == Changelog ==
 
 
 
38
  = 1.1, Aug 31, 2014 =
39
  * Added Admin Options / Settings
40
 
1
  === WP Performance Score Booster ===
2
  Contributors: dipakcg
3
+ Tags: performance, speed, time, query, strings, gzip, compression, caching, boost, pingdom, gtmetrix, yslow, pagespeed
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3S8BRPLWLNQ38
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
+ Stable tag: 1.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
  This plugin helps you to improve your website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix. It will remove any query strings from static resources like CSS & JS files, enable GZIP compression (compress text, html, javascript, css, xml and so on) and set expires caching (leverage browser caching) to improve your site performance scores.
15
 
16
  == Installation ==
17
+ 1. Upload the wp-performance-score-booster folder to the ‘/wp-content/plugins/‘ directory
18
+ 2. Activate the plugin through the Plugins menu in WordPress.
19
+ 3. Thats it!
20
 
21
  == Frequently Asked Questions ==
22
  = What does this plugin do? =
25
 
26
  = Any specific requirements for this plugin to work? =
27
 
28
+ * GZIP compression should be enabled in your web-server (apache?). If not then you can ask your web hosting provider.
29
+ * .htaccess in your WordPress root folder must have write permissions.
30
 
31
  = Is that it? =
32
 
36
  1. Admin Settings
37
 
38
  == Changelog ==
39
+ = 1.1.1, Sept 02, 2014 =
40
+ * Added function (for urls with &ver) to remove query strings from static resources
41
+
42
  = 1.1, Aug 31, 2014 =
43
  * Added Admin Options / Settings
44
 
wp-performance-score-booster.php CHANGED
@@ -4,10 +4,11 @@ Plugin Name: WP Performance Score Booster
4
  Plugin URI: https://github.com/dipakcg/wp-performance-score-booster
5
  Description: Helps you to improve your website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix.
6
  Author: Dipak C. Gajjar
7
- Version: 1.1
8
  Author URI: http://www.dipakgajjar.com/
9
  */
10
 
 
11
  // Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript
12
  add_action( 'admin_init', 'wppsb_add_stylesheet' );
13
  function wppsb_add_stylesheet() {
@@ -62,12 +63,16 @@ function wppsb_admin_options() {
62
 
63
  // If 'Remove query strings" checkbox ticked, add filter otherwise remove filter
64
  if ($remove_query_strings_val == 'on') {
65
- add_filter( 'script_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
66
- add_filter( 'style_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
 
 
67
  }
68
  else {
69
- remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
70
- remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
 
 
71
  }
72
 
73
  // If 'Enable GZIP" checkbox ticked, add filter otherwise remove filter
@@ -123,7 +128,7 @@ function wppsb_admin_options() {
123
  <!-- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-other-plugins-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://profiles.wordpress.org/dipakcg#content-plugins" target="_blank"> Get my other plugins </a> </span> -->
124
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-twitter-16x16.png' , __FILE__ ) . '" > '; ?>Follow me on Twitter: <a href="https://twitter.com/dipakcgajjar" target="_blank">@dipakcgajjar</a> </span>
125
  <br />
126
- <span class="wppsb_admin_dev_sidebar" style="float: right;"> Version: <strong> 1.1 </strong> </span>
127
  </div>
128
  </td>
129
  </tr>
@@ -133,9 +138,13 @@ function wppsb_admin_options() {
133
  }
134
 
135
  // Remove query strings from static content
136
- function wppsb_remove_query_strings_filter( $src ) {
137
  $rqs = explode( '?ver', $src );
138
- return $rqs[0];
 
 
 
 
139
  }
140
 
141
  // Enable GZIP Compression
@@ -188,7 +197,7 @@ EOD;
188
 
189
  function wppsb_add_header() {
190
  $head_comment = <<<EOD
191
- <!-- Performance scores of this site is tuned by WP Performance Score Booster plugin v1.1 - http://wordpress.org/plugins/wp-performance-score-booster -->\n
192
  EOD;
193
  echo $head_comment;
194
  }
@@ -199,8 +208,10 @@ function wppsb_activate_plugin() {
199
 
200
  // Save default options value in the database
201
  update_option( 'wppsb_remove_query_strings', 'on' );
202
- add_filter( 'script_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
203
- add_filter( 'style_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
 
 
204
 
205
  if (function_exists('ob_gzhandler') || ini_get('zlib.output_compression')) {
206
  update_option( 'wppsb_enable_gzip', 'on' );
@@ -221,8 +232,10 @@ register_activation_hook( __FILE__, 'wppsb_activate_plugin' );
221
 
222
  function wppsb_deactivate_plugin() {
223
  // Remove filters on plugin deactivate
224
- remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
225
- remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_filter', 15, 1 );
 
 
226
  remove_filter('mod_rewrite_rules', 'wppsb_enable_gzip_filter');
227
  remove_filter('mod_rewrite_rules', 'wppsb_expire_caching_filter');
228
 
4
  Plugin URI: https://github.com/dipakcg/wp-performance-score-booster
5
  Description: Helps you to improve your website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix.
6
  Author: Dipak C. Gajjar
7
+ Version: 1.1.1
8
  Author URI: http://www.dipakgajjar.com/
9
  */
10
 
11
+ // Important: Don't forget to change version number at line line 7, 131 and 200.
12
  // Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript
13
  add_action( 'admin_init', 'wppsb_add_stylesheet' );
14
  function wppsb_add_stylesheet() {
63
 
64
  // If 'Remove query strings" checkbox ticked, add filter otherwise remove filter
65
  if ($remove_query_strings_val == 'on') {
66
+ add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
67
+ add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
68
+ add_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
69
+ add_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
70
  }
71
  else {
72
+ remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
73
+ remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
74
+ remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
75
+ remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
76
  }
77
 
78
  // If 'Enable GZIP" checkbox ticked, add filter otherwise remove filter
128
  <!-- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-other-plugins-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://profiles.wordpress.org/dipakcg#content-plugins" target="_blank"> Get my other plugins </a> </span> -->
129
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-twitter-16x16.png' , __FILE__ ) . '" > '; ?>Follow me on Twitter: <a href="https://twitter.com/dipakcgajjar" target="_blank">@dipakcgajjar</a> </span>
130
  <br />
131
+ <span class="wppsb_admin_dev_sidebar" style="float: right;"> Version: <strong> 1.1.1 </strong> </span>
132
  </div>
133
  </td>
134
  </tr>
138
  }
139
 
140
  // Remove query strings from static content
141
+ function wppsb_remove_query_strings_q( $src ) {
142
  $rqs = explode( '?ver', $src );
143
+ return $rqs[0];
144
+ }
145
+ function wppsb_remove_query_strings_emp( $src ) {
146
+ $rqs = explode( '&ver', $src );
147
+ return $rqs[0];
148
  }
149
 
150
  // Enable GZIP Compression
197
 
198
  function wppsb_add_header() {
199
  $head_comment = <<<EOD
200
+ <!-- Performance scores of this site is tuned by WP Performance Score Booster plugin v1.1.1 - http://wordpress.org/plugins/wp-performance-score-booster -->\n
201
  EOD;
202
  echo $head_comment;
203
  }
208
 
209
  // Save default options value in the database
210
  update_option( 'wppsb_remove_query_strings', 'on' );
211
+ add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
212
+ add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
213
+ add_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
214
+ add_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
215
 
216
  if (function_exists('ob_gzhandler') || ini_get('zlib.output_compression')) {
217
  update_option( 'wppsb_enable_gzip', 'on' );
232
 
233
  function wppsb_deactivate_plugin() {
234
  // Remove filters on plugin deactivate
235
+ remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
236
+ remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
237
+ remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
238
+ remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
239
  remove_filter('mod_rewrite_rules', 'wppsb_enable_gzip_filter');
240
  remove_filter('mod_rewrite_rules', 'wppsb_expire_caching_filter');
241