WP Performance Score Booster - Version 1.5

Version Description

This version fixes some theme conflict issues. Options/Settings now moved under 'Settings' menu.

Download this release

Release Info

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

Code changes from version 1.4 to 1.5

assets/css/style.css CHANGED
@@ -3,12 +3,12 @@
3
  }
4
  .wppsb_admin_dev_sidebar_div {
5
  width:300px;
6
- height:300px;
7
  -webkit-border-radius: 10px;
8
  -moz-border-radius: 10px;
9
  border-radius: 10px;
10
  background-color:#FFFFFF;
11
- padding: 20px 0 0 30px;
12
  }
13
  .wppsb_admin_dev_sidebar {
14
  font-size: 13px;
@@ -18,6 +18,9 @@
18
  .wppsb_admin_dev_sidebar a{
19
  text-decoration: none;
20
  }
 
 
 
21
  .news_section {
22
  border-radius: 10px;
23
  background-color: #FFFFFF;
3
  }
4
  .wppsb_admin_dev_sidebar_div {
5
  width:300px;
6
+ height:250px;
7
  -webkit-border-radius: 10px;
8
  -moz-border-radius: 10px;
9
  border-radius: 10px;
10
  background-color:#FFFFFF;
11
+ padding: 10px 0 0 30px;
12
  }
13
  .wppsb_admin_dev_sidebar {
14
  font-size: 13px;
18
  .wppsb_admin_dev_sidebar a{
19
  text-decoration: none;
20
  }
21
+ .wppsb_admin_dev_sidebar img{
22
+ padding: 5px 5px 0 0;
23
+ }
24
  .news_section {
25
  border-radius: 10px;
26
  background-color: #FFFFFF;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dipakcg
3
  Tags: performance, speed, time, query, strings, gzip, compression, caching, boost, pingdom, gtmetrix, yslow, pagespeed, enqueue, scripts
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.4
7
- Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,7 +19,9 @@ This plugin speed-up page load times and improve website scores in services like
19
  * Add Vary: Accept-Encoding header, and
20
  * Set expires caching (leverage browser caching).
21
 
22
- **P.S. It is aways the best policy to open a [support thread](http://wordpress.org/support/plugin/wp-performance-score-booster) first before posting a negative review.**
 
 
23
 
24
  == Installation ==
25
  1. Upload the ‘wp-performance-score-booster’ folder to the ‘/wp-content/plugins/‘ directory
@@ -44,6 +46,13 @@ Pretty much, yeah.
44
  1. Admin Settings
45
 
46
  == Changelog ==
 
 
 
 
 
 
 
47
  = 1.4, Feb 28, 2015 =
48
  * Added News and Updates section in admin options
49
 
@@ -75,4 +84,5 @@ Pretty much, yeah.
75
  * Initial release
76
 
77
  == Upgrade Notice ==
78
- Added Admin Options / Settings.
 
3
  Tags: performance, speed, time, query, strings, gzip, compression, caching, boost, pingdom, gtmetrix, yslow, pagespeed, enqueue, scripts
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.5
7
+ Stable tag: 1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
19
  * Add Vary: Accept-Encoding header, and
20
  * Set expires caching (leverage browser caching).
21
 
22
+ **Follow the development of this plugin on [GitHub](https://github.com/dipakcg/wp-performance-score-booster)**
23
+
24
+ **P.S. It is always the best policy to open a [support thread](http://wordpress.org/support/plugin/wp-performance-score-booster) first before posting any negative review.**
25
 
26
  == Installation ==
27
  1. Upload the ‘wp-performance-score-booster’ folder to the ‘/wp-content/plugins/‘ directory
46
  1. Admin Settings
47
 
48
  == Changelog ==
49
+
50
+ = 1.5, Feb 02, 2016 =
51
+ * Fixed conflict with Divi and Divi Builder
52
+ * Moved Options / Settings under *'Settings'* menu
53
+ * Added *'Settings'* option directly under plugins (installed plugins) page
54
+ * Amended *'News and Updates'* section
55
+
56
  = 1.4, Feb 28, 2015 =
57
  * Added News and Updates section in admin options
58
 
84
  * Initial release
85
 
86
  == Upgrade Notice ==
87
+ = 1.5 =
88
+ This version fixes some theme conflict issues. Options/Settings now moved under 'Settings' menu.
wp-performance-score-booster.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Performance Score Booster
4
  Plugin URI: https://github.com/dipakcg/wp-performance-score-booster
5
  Description: Speed-up page load times and improve website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix.
6
- Version: 1.4
7
  Author: Dipak C. Gajjar
8
  Author URI: https://dipakgajjar.com
9
  Text Domain: wp-performance-score-booster
@@ -14,7 +14,7 @@ if (!defined('WPPSB_PLUGIN_VERSION')) {
14
  define('WPPSB_PLUGIN_VERSION', 'wppsb_plugin_version');
15
  }
16
  if (!defined('WPPSB_PLUGIN_VERSION_NUM')) {
17
- define('WPPSB_PLUGIN_VERSION_NUM', '1.4');
18
  }
19
  update_option(WPPSB_PLUGIN_VERSION, WPPSB_PLUGIN_VERSION_NUM);
20
 
@@ -43,12 +43,9 @@ function wppsb_add_stylesheet() {
43
 
44
  // Remove query strings from static content
45
  function wppsb_remove_query_strings_q( $src ) {
46
- $str_parts = explode( '?ver', $src );
47
- return $str_parts[0];
48
- }
49
- function wppsb_remove_query_strings_emp( $src ) {
50
- $str_parts = explode( '&ver', $src );
51
- return $str_parts[0];
52
  }
53
 
54
  // Enable GZIP Compression
@@ -111,40 +108,14 @@ EOD;
111
  return $vary_accept_encoding_header . $rules;
112
  }
113
 
114
- /* Plan to add in future releases */
115
- // Defer parsing of java-script (to load at last)
116
- /* function defer_parsing_of_js ( $src ) {
117
- if ( FALSE === strpos( $src, '.js' ) )
118
- return $src;
119
- if ( strpos( $src, 'jquery.js' ) )
120
- return $src;
121
- return "$src' defer='defer";
122
- }
123
- add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); */
124
-
125
- // Enqueue scripts in the footer to speed-up page load
126
- /* function footer_enqueue_scripts() {
127
- remove_action('wp_head', 'wp_print_scripts');
128
- // remove_action('wp_head', 'wp_print_head_scripts', 9);
129
- remove_action('wp_head', 'wp_enqueue_scripts', 1);
130
- add_action('wp_footer', 'wp_print_scripts', 5);
131
- // add_action('wp_footer', 'wp_print_head_scripts', 5);
132
- add_action('wp_footer', 'wp_enqueue_scripts', 5);
133
- }
134
- add_action('after_setup_theme', 'footer_enqueue_scripts'); */
135
-
136
  // If 'Remove query strings" checkbox ticked, add filter otherwise remove filter
137
  if (get_option('wppsb_remove_query_strings') == 'on') {
138
  add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
139
  add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
140
- add_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
141
- add_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
142
  }
143
  else {
144
  remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_q');
145
  remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_q');
146
- remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp');
147
- remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp');
148
  }
149
 
150
  function wppsb_admin_options() {
@@ -214,8 +185,9 @@ function wppsb_admin_options() {
214
  </td>
215
  <td style="text-align: left;">
216
  <div class="wppsb_admin_dev_sidebar_div">
217
- <img src="//www.gravatar.com/avatar/38b380cf488d8f8c4007cf2015dc16ac.jpg" width="100px" height="100px" /> <br />
218
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-support-this-16x16.png' , __FILE__ ) . '" > '; ?> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3S8BRPLWLNQ38" target="_blank"> <?php _e('Support this plugin and donate', 'wp-performance-score-booster'); ?> </a> </span>
 
219
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-rate-this-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://wordpress.org/support/view/plugin-reviews/wp-performance-score-booster" target="_blank"> <?php _e('Rate this plugin on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
220
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-wordpress-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://wordpress.org/support/plugin/wp-performance-score-booster" target="_blank"> <?php _e('Get support on on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
221
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-github-16x16.png' , __FILE__ ) . '" > '; ?> <a href="https://github.com/dipakcg/wp-performance-score-booster" target="_blank"> <?php _e('Contribute development on GitHub', 'wp-performance-score-booster'); ?> </a> </span>
@@ -232,31 +204,45 @@ function wppsb_admin_options() {
232
  echo '<hr style="margin-bottom: 2em;" />';
233
  echo '<table cellspacing="0" cellpadding="0" class="news_section"> <tr>';
234
  echo '<td width="50%" valign="top">';
235
- echo '<h1>News & Updates from Dipak C. Gajjar</h1>';
 
236
  echo '<div class="rss-widget">';
237
- wp_widget_rss_output(array(
238
  'url' => 'https://dipakgajjar.com/category/news/feed/?refresh='.rand(10,100).'', // feed URL
239
  'title' => 'News & Updates from Dipak C. Gajjar',
240
  'items' => 3, // nubmer of posts to display
241
  'show_summary' => 1,
242
  'show_author' => 0,
243
  'show_date' => 0
244
- ));
245
- echo '</div> <td width="5%"> &nbsp </td>';
246
- echo '</td> <td valign="top">';
247
- ?>
248
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/dipakcgajjar" data-widget-id="547661367281729536">Tweets by @dipakcgajjar</a>
249
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
 
 
 
250
  <?php echo '</td> </tr> </table>';
251
  }
252
 
253
  // Register admin menu
254
  add_action( 'admin_menu', 'wppsb_add_admin_menu' );
255
  function wppsb_add_admin_menu() {
256
- add_menu_page( __('WP Performance Score Booster Settings', 'wp-performance-score-booster'), __('WP Performance Score Booster', 'wp-performance-score-booster'), 'manage_options', 'wp-performance-score-booster', 'wppsb_admin_options', plugins_url('assets/images/wppsb-icon-24x24.png', __FILE__) );
257
- // add_options_page( __('WP Performance Score Booster Settings', 'wp-performance-score-booster'), __('WP Performance Score Booster', 'wp-performance-score-booster'), 'manage_options', 'wp-performance-score-booster', 'wppsb_admin_options' );
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
260
  // Add header
261
  function wppsb_add_header() {
262
  // Get the plugin version from options (in the database)
@@ -276,8 +262,6 @@ function wppsb_activate_plugin() {
276
  update_option( 'wppsb_remove_query_strings', 'on' );
277
  add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
278
  add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
279
- add_filter( 'script_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
280
- add_filter( 'style_loader_src', 'wppsb_remove_query_strings_emp', 15, 1 );
281
 
282
  if (function_exists('ob_gzhandler') || ini_get('zlib.output_compression')) {
283
  update_option( 'wppsb_enable_gzip', 'on' );
@@ -337,4 +321,6 @@ function wppsb_save_mod_rewrite_rules() {
337
  }
338
  return false;
339
  }
 
 
340
  ?>
3
  Plugin Name: WP Performance Score Booster
4
  Plugin URI: https://github.com/dipakcg/wp-performance-score-booster
5
  Description: Speed-up page load times and improve website scores in services like PageSpeed, YSlow, Pingdom and GTmetrix.
6
+ Version: 1.5
7
  Author: Dipak C. Gajjar
8
  Author URI: https://dipakgajjar.com
9
  Text Domain: wp-performance-score-booster
14
  define('WPPSB_PLUGIN_VERSION', 'wppsb_plugin_version');
15
  }
16
  if (!defined('WPPSB_PLUGIN_VERSION_NUM')) {
17
+ define('WPPSB_PLUGIN_VERSION_NUM', '1.5');
18
  }
19
  update_option(WPPSB_PLUGIN_VERSION, WPPSB_PLUGIN_VERSION_NUM);
20
 
43
 
44
  // Remove query strings from static content
45
  function wppsb_remove_query_strings_q( $src ) {
46
+ if(strpos( $src, '?ver=' ))
47
+ $src = remove_query_arg( 'ver', $src );
48
+ return $src;
 
 
 
49
  }
50
 
51
  // Enable GZIP Compression
108
  return $vary_accept_encoding_header . $rules;
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  // If 'Remove query strings" checkbox ticked, add filter otherwise remove filter
112
  if (get_option('wppsb_remove_query_strings') == 'on') {
113
  add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
114
  add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
 
 
115
  }
116
  else {
117
  remove_filter( 'script_loader_src', 'wppsb_remove_query_strings_q');
118
  remove_filter( 'style_loader_src', 'wppsb_remove_query_strings_q');
 
 
119
  }
120
 
121
  function wppsb_admin_options() {
185
  </td>
186
  <td style="text-align: left;">
187
  <div class="wppsb_admin_dev_sidebar_div">
188
+ <!-- <img src="//www.gravatar.com/avatar/38b380cf488d8f8c4007cf2015dc16ac.jpg" width="100px" height="100px" /> <br /> -->
189
+ <br />
190
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-support-this-16x16.png' , __FILE__ ) . '" > '; ?> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3S8BRPLWLNQ38" target="_blank"> <?php _e('Donate and support this plugin', 'wp-performance-score-booster'); ?> </a> </span>
191
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-rate-this-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://wordpress.org/support/view/plugin-reviews/wp-performance-score-booster" target="_blank"> <?php _e('Rate this plugin on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
192
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-wordpress-16x16.png' , __FILE__ ) . '" > '; ?> <a href="http://wordpress.org/support/plugin/wp-performance-score-booster" target="_blank"> <?php _e('Get support on on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
193
  <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . plugins_url( 'assets/images/wppsb-github-16x16.png' , __FILE__ ) . '" > '; ?> <a href="https://github.com/dipakcg/wp-performance-score-booster" target="_blank"> <?php _e('Contribute development on GitHub', 'wp-performance-score-booster'); ?> </a> </span>
204
  echo '<hr style="margin-bottom: 2em;" />';
205
  echo '<table cellspacing="0" cellpadding="0" class="news_section"> <tr>';
206
  echo '<td width="50%" valign="top">';
207
+ echo '<h2><strong>News & Updates from Dipak C. Gajjar</strong></h2>';
208
+ echo '<hr />';
209
  echo '<div class="rss-widget">';
210
+ /* wp_widget_rss_output(array(
211
  'url' => 'https://dipakgajjar.com/category/news/feed/?refresh='.rand(10,100).'', // feed URL
212
  'title' => 'News & Updates from Dipak C. Gajjar',
213
  'items' => 3, // nubmer of posts to display
214
  'show_summary' => 1,
215
  'show_author' => 0,
216
  'show_date' => 0
217
+ )); */
218
+ /* Load the news content from Dropbox url */
219
+ $news_content = wp_remote_fopen("https://dl.dropboxusercontent.com/u/21966579/news-and-updates.html");
220
+ echo $news_content;
221
+ echo '</div> <td width="5%"> &nbsp </td>';
222
+ echo '</td> <td valign="top">';
223
+ ?>
224
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/dipakcgajjar" data-widget-id="547661367281729536">Tweets by @dipakcgajjar</a>
225
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
226
  <?php echo '</td> </tr> </table>';
227
  }
228
 
229
  // Register admin menu
230
  add_action( 'admin_menu', 'wppsb_add_admin_menu' );
231
  function wppsb_add_admin_menu() {
232
+ // add_menu_page( __('WP Performance Score Booster Settings', 'wp-performance-score-booster'), __('WP Performance Score Booster', 'wp-performance-score-booster'), 'manage_options', 'wp-performance-score-booster', 'wppsb_admin_options', plugins_url('assets/images/wppsb-icon-24x24.png', __FILE__) );
233
+ add_options_page( __('WP Performance Score Booster Settings', 'wp-performance-score-booster'), __('WP Performance Score Booster', 'wp-performance-score-booster'), 'manage_options', 'wp-performance-score-booster', 'wppsb_admin_options' );
234
  }
235
 
236
+ // Add settings link on plugin page
237
+ function dcg_settings_link($links) {
238
+ // $settings_link = '<a href="admin.php?page=wp-performance-score-booster">Settings</a>';
239
+ $settings_link = '<a href="options-general.php?page=wp-performance-score-booster">Settings</a>';
240
+ array_unshift($links, $settings_link);
241
+ return $links;
242
+ }
243
+ $plugin = plugin_basename(__FILE__);
244
+ add_filter("plugin_action_links_$plugin", 'dcg_settings_link' );
245
+
246
  // Add header
247
  function wppsb_add_header() {
248
  // Get the plugin version from options (in the database)
262
  update_option( 'wppsb_remove_query_strings', 'on' );
263
  add_filter( 'script_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
264
  add_filter( 'style_loader_src', 'wppsb_remove_query_strings_q', 15, 1 );
 
 
265
 
266
  if (function_exists('ob_gzhandler') || ini_get('zlib.output_compression')) {
267
  update_option( 'wppsb_enable_gzip', 'on' );
321
  }
322
  return false;
323
  }
324
+
325
+ /* End of plugin */
326
  ?>