WP Performance Score Booster - Version 1.9.1

Version Description

Download this release

Release Info

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

Code changes from version 1.9 to 1.9.1

Files changed (3) hide show
  1. admin-page.php +39 -8
  2. readme.txt +5 -1
  3. wp-performance-score-booster.php +78 -2
admin-page.php CHANGED
@@ -28,7 +28,7 @@ function wppsb_admin_options() {
28
  if ( isset($_GET['update-applied']) && $_GET['update-applied'] == 'true' ) {
29
  ?>
30
  <div class="updated"><p><strong><?php _e('<strong>Update applied successfully!</strong>', 'wp-performance-score-booster'); ?></strong></p></div>
31
- <?php
32
  }
33
 
34
  // See if the user has posted us some information
@@ -113,6 +113,37 @@ function wppsb_admin_options() {
113
  </td> <td>
114
  <label for="<?php echo $expire_caching; ?>" class="wppsb_settings" style="display: inline;"> <?php _e('Leverage Browser Caching <i>(set expire caching)</i>', 'wp-performance-score-booster'); ?> </label>
115
  </td> </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  </table>
117
  <p><input style="font-size: 15px; color: white; font-weight: bold;" type="submit" value="<?php esc_attr_e('Save Changes', 'wp-performance-score-booster'); ?>" class="button button-primary" name="submit" /></p>
118
  </form>
@@ -122,11 +153,11 @@ function wppsb_admin_options() {
122
  <!-- <img src="//www.gravatar.com/avatar/38b380cf488d8f8c4007cf2015dc16ac.jpg" width="100px" height="100px" /> <br /> -->
123
  <br />
124
  <!-- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-support-this-16x16.png' . '" > '; ?> <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> -->
125
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-rate-this-16x16.png' . '" > '; ?> <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>
126
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-wordpress-16x16.png' . '" > '; ?> <a href="http://wordpress.org/support/plugin/wp-performance-score-booster" target="_blank"> <?php _e('Get support on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
127
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-github-16x16.png' . '" > '; ?> <a href="https://github.com/dipakcg/wp-performance-score-booster" target="_blank"> <?php _e('Contribute development on GitHub', 'wp-performance-score-booster'); ?> </a> </span>
128
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-other-plugins-16x16.png' . '" > '; ?> <a href="http://profiles.wordpress.org/dipakcg#content-plugins" target="_blank"> <?php _e('Get my other plugins', 'wp-performance-score-booster'); ?> </a> </span>
129
- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-twitter-16x16.png' . '" > '; ?>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;"> <?php _e('Version:', 'wp-performance-score-booster'); ?> <strong> <?php echo $wppsb_plugin_version; ?> </strong> </span>
132
  </div>
@@ -149,7 +180,7 @@ function wppsb_admin_options() {
149
  <hr />
150
  <div class="wppsb_rss-widget">
151
  <?php
152
- /* Load the news content from Github url */
153
  $news_content = wp_remote_fopen("https://dipakgajjar.com/public/news-and-updates.html");
154
  echo $news_content;
155
  ?>
@@ -158,7 +189,7 @@ function wppsb_admin_options() {
158
  <td width="1%"> &nbsp; </td>
159
  <td width="51%" valign="top">
160
  <?php
161
- /* Load the referrals content from Github url */
162
  $referrals_content = wp_remote_fopen("https://dipakgajjar.com/public/recommendations.html");
163
  echo $referrals_content;
164
  ?>
28
  if ( isset($_GET['update-applied']) && $_GET['update-applied'] == 'true' ) {
29
  ?>
30
  <div class="updated"><p><strong><?php _e('<strong>Update applied successfully!</strong>', 'wp-performance-score-booster'); ?></strong></p></div>
31
+ <?php
32
  }
33
 
34
  // See if the user has posted us some information
113
  </td> <td>
114
  <label for="<?php echo $expire_caching; ?>" class="wppsb_settings" style="display: inline;"> <?php _e('Leverage Browser Caching <i>(set expire caching)</i>', 'wp-performance-score-booster'); ?> </label>
115
  </td> </tr>
116
+
117
+ <!-- Extra Options - must be added in the future version -->
118
+
119
+ <!--
120
+ <tr> <td colspan="2"> <h2> <?php _e('More settings <i>(optional)</i>', 'wp-performance-score-booster'); ?> </h2> </td> </tr>
121
+
122
+ <tr> <td class="wppsb_onoff">
123
+ <div class="wppsb_onoffswitch">
124
+ <input type="checkbox" name="<?php echo $expire_caching; ?>" <?php checked( $expire_caching_val == 'on',true); ?> class="wppsb_onoffswitch-checkbox" id="<?php echo $expire_caching; ?>" />
125
+ <label class="wppsb_onoffswitch-label" for="<?php echo $expire_caching; ?>">
126
+ <span class="wppsb_onoffswitch-inner"></span>
127
+ <span class="wppsb_onoffswitch-switch"></span>
128
+ </label>
129
+ </div>
130
+ </td> <td>
131
+ <label for="<?php echo $expire_caching; ?>" class="wppsb_settings" style="display: inline;"> <?php _e('Disable Heartbeat API completely', 'wp-performance-score-booster'); ?> </label>
132
+ </td> </tr>
133
+
134
+ <tr> <td class="wppsb_onoff">
135
+ <div class="wppsb_onoffswitch">
136
+ <input type="checkbox" name="<?php echo $expire_caching; ?>" <?php checked( $expire_caching_val == 'on',true); ?> class="wppsb_onoffswitch-checkbox" id="<?php echo $expire_caching; ?>" />
137
+ <label class="wppsb_onoffswitch-label" for="<?php echo $expire_caching; ?>">
138
+ <span class="wppsb_onoffswitch-inner"></span>
139
+ <span class="wppsb_onoffswitch-switch"></span>
140
+ </label>
141
+ </div>
142
+ </td> <td>
143
+ <label for="<?php echo $expire_caching; ?>" class="wppsb_settings" style="display: inline;"> <?php _e('Remove WordPress Emoji scripts', 'wp-performance-score-booster'); ?> </label>
144
+ </td> </tr>
145
+ -->
146
+
147
  </table>
148
  <p><input style="font-size: 15px; color: white; font-weight: bold;" type="submit" value="<?php esc_attr_e('Save Changes', 'wp-performance-score-booster'); ?>" class="button button-primary" name="submit" /></p>
149
  </form>
153
  <!-- <img src="//www.gravatar.com/avatar/38b380cf488d8f8c4007cf2015dc16ac.jpg" width="100px" height="100px" /> <br /> -->
154
  <br />
155
  <!-- <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-support-this-16x16.png' . '" > '; ?> <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> -->
156
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-rate-this-16x16.png' . '" > '; ?> <a href="//wordpress.org/support/plugin/wp-performance-score-booster/reviews/?rate=5#new-post" target="_blank"> <?php _e('Rate this plugin on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
157
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-wordpress-16x16.png' . '" > '; ?> <a href="//wordpress.org/support/plugin/wp-performance-score-booster" target="_blank"> <?php _e('Get support on WordPress.org', 'wp-performance-score-booster'); ?> </a> </span>
158
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-github-16x16.png' . '" > '; ?> <a href="//github.com/dipakcg/wp-performance-score-booster" target="_blank"> <?php _e('Contribute development on GitHub', 'wp-performance-score-booster'); ?> </a> </span>
159
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-other-plugins-16x16.png' . '" > '; ?> <a href="//profiles.wordpress.org/dipakcg#content-plugins" target="_blank"> <?php _e('Get my other plugins', 'wp-performance-score-booster'); ?> </a> </span>
160
+ <span class="wppsb_admin_dev_sidebar"> <?php echo '<img src="' . WPPSB_URL . '/assets/images/wppsb-twitter-16x16.png' . '" > '; ?>Follow me on Twitter: <a href="//twitter.com/dipakcgajjar" target="_blank">@dipakcgajjar</a> </span>
161
  <br />
162
  <span class="wppsb_admin_dev_sidebar" style="float: right;"> <?php _e('Version:', 'wp-performance-score-booster'); ?> <strong> <?php echo $wppsb_plugin_version; ?> </strong> </span>
163
  </div>
180
  <hr />
181
  <div class="wppsb_rss-widget">
182
  <?php
183
+ /* Load the news content from site url */
184
  $news_content = wp_remote_fopen("https://dipakgajjar.com/public/news-and-updates.html");
185
  echo $news_content;
186
  ?>
189
  <td width="1%"> &nbsp; </td>
190
  <td width="51%" valign="top">
191
  <?php
192
+ /* Load the referrals content from site url */
193
  $referrals_content = wp_remote_fopen("https://dipakgajjar.com/public/recommendations.html");
194
  echo $referrals_content;
195
  ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: performance, speed, gzip, booster, query string
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.9
7
- Stable tag: 1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -58,6 +58,10 @@ Alternatively, you can open a [support thread](http://wordpress.org/support/plug
58
  1. Admin Settings
59
 
60
  == Changelog ==
 
 
 
 
61
  = 1.9, November 28, 2017 =
62
  * Completely rewritten
63
  * Fixed few CSS bugs (admin settings)
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.9
7
+ Stable tag: 1.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
58
  1. Admin Settings
59
 
60
  == Changelog ==
61
+ = 1.9.1, May 02, 2017 =
62
+ * Added Review Plugin - admin notice
63
+ * Improved Recommendations tab
64
+
65
  = 1.9, November 28, 2017 =
66
  * Completely rewritten
67
  * Fixed few CSS bugs (admin settings)
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.9
7
  Author: Dipak C. Gajjar
8
  Author URI: https://dipakgajjar.com
9
  Text Domain: wp-performance-score-booster
@@ -16,7 +16,7 @@ include_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); // to is_plugin_activ
16
 
17
  // Define plugin version for future releases
18
  if (!defined('WPPSB_PLUGIN_VERSION')) {
19
- define('WPPSB_PLUGIN_VERSION', '1.9');
20
  }
21
 
22
  define( 'WPPSB_PATH', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) ); // plugin Path
@@ -56,6 +56,29 @@ add_action( 'init', 'wppsb_master_init' );
56
  function wppsb_master_admin_init () {
57
  wppsb_add_stylesheet(); // adds plugin stylesheet
58
  wppsb_update_processor(); // Reload the config (rewrite rules) after applying plugin updates
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
  add_action( 'admin_init', 'wppsb_master_admin_init' );
61
 
@@ -149,6 +172,17 @@ function wppsb_activate_plugin() {
149
 
150
  global $wppsb_remove_query_strings, $wppsb_enable_gzip, $wppsb_expire_caching;
151
  wppsb_htaccess_bakup(); // Backup .htacces before appending any rules
 
 
 
 
 
 
 
 
 
 
 
152
 
153
  // Save default options value in the database
154
  add_option( 'wppsb_plugin_version', WPPSB_PLUGIN_VERSION );
@@ -173,6 +207,48 @@ function wppsb_activate_plugin() {
173
  }
174
  register_activation_hook( __FILE__, 'wppsb_activate_plugin' );
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  function wppsb_htaccess_bakup() {
177
  if (!file_exists( WPPSB_STORAGE_PATH )) {
178
  mkdir( WPPSB_STORAGE_PATH, 0777, true );
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.9.1
7
  Author: Dipak C. Gajjar
8
  Author URI: https://dipakgajjar.com
9
  Text Domain: wp-performance-score-booster
16
 
17
  // Define plugin version for future releases
18
  if (!defined('WPPSB_PLUGIN_VERSION')) {
19
+ define('WPPSB_PLUGIN_VERSION', '1.9.1');
20
  }
21
 
22
  define( 'WPPSB_PATH', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) ); // plugin Path
56
  function wppsb_master_admin_init () {
57
  wppsb_add_stylesheet(); // adds plugin stylesheet
58
  wppsb_update_processor(); // Reload the config (rewrite rules) after applying plugin updates
59
+
60
+ /* BEGIN : Rate this plugin on wordpress */
61
+ // check for admin notice dismissal
62
+ if ( isset( $_GET['wppsb-already-reviewed'] ) ) {
63
+ update_option( 'wppsb_review_notice', "" );
64
+ }
65
+
66
+ // display admin notice after 7 days if clicked 'May be later'
67
+ if ( isset( $_GET['wppsb-review-later'] ) ) {
68
+ update_option( 'wppsb_review_notice', "" );
69
+ $now = strtotime( "now" );
70
+ add_option( 'wppsb_activation_date', $now );
71
+ }
72
+
73
+ $install_date = get_option( 'wppsb_activation_date' );
74
+ $past_date = strtotime( '-10 days' );
75
+
76
+ if ( $past_date >= $install_date ) {
77
+ update_option( 'wppsb_review_notice', "on" );
78
+ $now = strtotime( "now" );
79
+ update_option( 'wppsb_activation_date', $now );
80
+ }
81
+ /* END : Rate this plugin on wordpress */
82
  }
83
  add_action( 'admin_init', 'wppsb_master_admin_init' );
84
 
172
 
173
  global $wppsb_remove_query_strings, $wppsb_enable_gzip, $wppsb_expire_caching;
174
  wppsb_htaccess_bakup(); // Backup .htacces before appending any rules
175
+
176
+ /* Create transient data for submit review admin notice */
177
+ // set_transient( 'wppsb_submit_review_transient', true, 360 );
178
+
179
+ // Rate this plugin on wordpress - check for admin notice dismissal
180
+ if ( FALSE !== get_option( 'wppsb_review_notice' ) ) {
181
+ update_option( 'wppsb_review_notice', "on" );
182
+ }
183
+ else {
184
+ add_option( 'wppsb_review_notice', "on" );
185
+ }
186
 
187
  // Save default options value in the database
188
  add_option( 'wppsb_plugin_version', WPPSB_PLUGIN_VERSION );
207
  }
208
  register_activation_hook( __FILE__, 'wppsb_activate_plugin' );
209
 
210
+
211
+ /* Add admin notice for requesting plugin review */
212
+ add_action( 'admin_notices', 'wppsb_submit_review_notice' );
213
+ function wppsb_submit_review_notice() {
214
+ global $wppsb_plugin_version;
215
+
216
+ /* Display review plugin notice if plugin updated and plugin version is older than 1.9.1.
217
+ This will help boosting plugin review for older installs */
218
+ if ( isset( $_GET['update-applied'] ) && $_GET['update-applied'] == 'true' && $wppsb_plugin_version <= "1.9.1" ) {
219
+ if ( !isset( $_GET['wppsb-already-reviewed'] ) && !isset( $_GET['wppsb-review-later'] ) ) { // if url doesn't contain wppsb-already-reviewed and review-later string
220
+ if ( FALSE !== get_option('wppsb_review_notice' ) ) {
221
+ update_option( 'wppsb_review_notice', "on" );
222
+ }
223
+ }
224
+ }
225
+
226
+ /* Check transient that's been set on plugin activation or check if user has already submitted review */
227
+ // if( get_transient( 'wppsb_submit_review_transient' ) || !get_user_meta( $user_id, 'wppsb_submit_review_dismissed' ) ) {
228
+ if( FALSE !== get_option( 'wppsb_review_notice') && get_option( 'wppsb_review_notice' ) == "on" ) {
229
+
230
+ $notice_contents = "<p> Thank you for using <strong>WP Performance Score Booster</strong>. </p>";
231
+ $notice_contents .= "<p> Could you please do me a BIG favour and give this plugin a 5-star rating on WordPress? It will help me spread the word and boost my motivation. — Dipak C. Gajjar </p>";
232
+ $notice_contents .= "<p> <a href=\"//wordpress.org/support/plugin/wp-performance-score-booster/reviews/?rate=5#new-post\" target=\"_blank\" style=\"font-weight: bold;\">Yes, you deserve it</a> <br /> <a href=\"#\" id=\"willReviewLater\" style=\"font-weight: bold;\">May be later</a> <br /> <a href=\"#\" id=\"alredyReviewed\" style=\"font-weight: bold; cursor: hand;\">I already did it</a> </p>";
233
+ ?>
234
+ <div class="notice notice-info is-dismissible"> <?php _e($notice_contents, 'wp-performance-score-booster'); ?> </div>
235
+ <script>
236
+ jQuery("#alredyReviewed").on('click', function() {
237
+ var loc = location.href;
238
+ loc += loc.indexOf("?") === -1 ? "?" : "&";
239
+ location.href = loc + "wppsb-already-reviewed";
240
+ });
241
+ jQuery("#willReviewLater").on('click', function() {
242
+ var loc = location.href;
243
+ loc += loc.indexOf("?") === -1 ? "?" : "&";
244
+ location.href = loc + "wppsb-review-later";
245
+ });
246
+ </script>
247
+ <?php
248
+ // delete_transient( 'wppsb_submit_review_transient' );
249
+ }
250
+ }
251
+
252
  function wppsb_htaccess_bakup() {
253
  if (!file_exists( WPPSB_STORAGE_PATH )) {
254
  mkdir( WPPSB_STORAGE_PATH, 0777, true );