Top 10 – Popular posts plugin for WordPress - Version 2.2.1

Version Description

  • Bug fixes:
    • Fixed array declaration to support PHP < 5.4
Download this release

Release Info

Developer Ajay
Plugin Icon 128x128 Top 10 – Popular posts plugin for WordPress
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.2.0 to 2.2.1

Files changed (4) hide show
  1. admin/admin.php +2 -2
  2. admin/class-stats.php +5 -5
  3. readme.txt +12 -7
  4. top-10.php +1 -1
admin/admin.php CHANGED
@@ -405,8 +405,8 @@ function tptn_adminmenu() {
405
 
406
  $tptn_stats_screen = new Top_Ten_Statistics;
407
 
408
- $plugin_page = add_submenu_page( 'tptn_options', __( "View Popular Posts", 'tptn' ), __( "View Popular Posts", 'tptn' ), 'manage_options', 'tptn_popular_posts', [ $tptn_stats_screen, 'plugin_settings_page' ] );
409
- add_action( "load-$plugin_page", [ $tptn_stats_screen, 'screen_option' ] );
410
  add_action( 'admin_head-'. $plugin_page, 'tptn_adminhead' );
411
 
412
  }
405
 
406
  $tptn_stats_screen = new Top_Ten_Statistics;
407
 
408
+ $plugin_page = add_submenu_page( 'tptn_options', __( "View Popular Posts", 'tptn' ), __( "View Popular Posts", 'tptn' ), 'manage_options', 'tptn_popular_posts', array( $tptn_stats_screen, 'plugin_settings_page' ) );
409
+ add_action( "load-$plugin_page", array( $tptn_stats_screen, 'screen_option' ) );
410
  add_action( 'admin_head-'. $plugin_page, 'tptn_adminhead' );
411
 
412
  }
admin/class-stats.php CHANGED
@@ -134,13 +134,13 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
134
 
135
  $wpdb->delete(
136
  "{$wpdb->base_prefix}top_ten",
137
- [ 'postnumber' => $id ],
138
- [ '%d' ]
139
  );
140
  $wpdb->delete(
141
  "{$wpdb->base_prefix}top_ten_daily",
142
- [ 'postnumber' => $id ],
143
- [ '%d' ]
144
  );
145
  }
146
 
@@ -392,7 +392,7 @@ class Top_Ten_Statistics {
392
  * @return void
393
  */
394
  public function __construct() {
395
- add_filter( 'set-screen-option', [ __CLASS__, 'set_screen' ], 10, 3 );
396
  }
397
 
398
  public static function set_screen( $status, $option, $value ) {
134
 
135
  $wpdb->delete(
136
  "{$wpdb->base_prefix}top_ten",
137
+ array( 'postnumber' => $id ),
138
+ array( '%d' )
139
  );
140
  $wpdb->delete(
141
  "{$wpdb->base_prefix}top_ten_daily",
142
+ array( 'postnumber' => $id ),
143
+ array( '%d' )
144
  );
145
  }
146
 
392
  * @return void
393
  */
394
  public function __construct() {
395
+ add_filter( 'set-screen-option', array( __CLASS__, 'set_screen' ), 10, 3 );
396
  }
397
 
398
  public static function set_screen( $status, $option, $value ) {
readme.txt CHANGED
@@ -171,6 +171,11 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
171
 
172
  == Changelog ==
173
 
 
 
 
 
 
174
  = 2.2.0 =
175
 
176
  * Features:
@@ -187,7 +192,7 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
187
  * Contributors & above can also update the visit count in the meta box if this is enabled for them
188
  * Category exclusion now works via a filter function vs. multiple lookups, thereby reducing the number of database queries
189
 
190
- * Bugfixes:
191
  * Potential bug when the $wp variable was not detected in rare situations
192
  * In rare cases category exclusion failed when `term_id` didn't match `term_taxonomy_id`
193
 
@@ -210,7 +215,7 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
210
  * Modified: Deprecated "Always display latest post count in the daily lists"
211
  * Modified: timthumb has been deprecated. The script is no longer packaged within Top 10
212
 
213
- * Bugfixes:
214
  * Fixed: Bug in tracking code when not using Ajax
215
  * Fixed: Bug in admin column did not check for the blog_id
216
  * Fixed: Bug where default thumbnail location was not correctly saved
@@ -222,7 +227,7 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
222
  * Features:
223
  * New: Options to choose if you want to delete the Top 10 options and/or data when deleting the plugin
224
 
225
- * Bugfixes:
226
  * Fixed: Metabox update did not work properly in v2.0
227
  * Fixed: Duplicate include files
228
  * Modified: In the mySQL tables, the blog_id default value is set to 1
@@ -235,12 +240,12 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
235
  * Enhancements:
236
  * Modified: Posts are tracked hourly based on the time of the blog and not GMT. This was also the default behaviour of the counter in Top 10 v1.x
237
 
238
- * Bugfixes:
239
  * Fixed: Default thumbnail location saved correctly on the Settings page.
240
 
241
  = 2.0.1 =
242
 
243
- * Bugfixes
244
  * 500/503 errors caused by 2.0.0
245
 
246
  = 2.0.0 =
@@ -256,7 +261,7 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
256
  * Modified: Update and View counts now use query variables instead of external JavaScript files. Check http://goo.gl/yemvyM for sample functions to restore the old method
257
  * Modified: Activating the default styles option will automatically set the thumbnail width and height to 65px, disable author and excerpt and enable crop mode for the thumbnails
258
 
259
- * Bugfixes:
260
  * Fixed: Fix schedule overwrite for the cron job
261
  * Fixed: Incorrect permission lookup in the metabox
262
 
@@ -265,7 +270,7 @@ For previous changelog entries, please refer to the separate changelog.txt file
265
 
266
  == Upgrade Notice ==
267
 
268
- = 2.2.0 =
269
  * New features. Deprecated functions. Upgrade highly recommended. Please do verify your settings after the upgrade.
270
  Check the Changelog for more details
271
 
171
 
172
  == Changelog ==
173
 
174
+ = 2.2.1 =
175
+
176
+ * Bug fixes:
177
+ * Fixed array declaration to support PHP < 5.4
178
+
179
  = 2.2.0 =
180
 
181
  * Features:
192
  * Contributors & above can also update the visit count in the meta box if this is enabled for them
193
  * Category exclusion now works via a filter function vs. multiple lookups, thereby reducing the number of database queries
194
 
195
+ * Bug fixes:
196
  * Potential bug when the $wp variable was not detected in rare situations
197
  * In rare cases category exclusion failed when `term_id` didn't match `term_taxonomy_id`
198
 
215
  * Modified: Deprecated "Always display latest post count in the daily lists"
216
  * Modified: timthumb has been deprecated. The script is no longer packaged within Top 10
217
 
218
+ * Bug fixes:
219
  * Fixed: Bug in tracking code when not using Ajax
220
  * Fixed: Bug in admin column did not check for the blog_id
221
  * Fixed: Bug where default thumbnail location was not correctly saved
227
  * Features:
228
  * New: Options to choose if you want to delete the Top 10 options and/or data when deleting the plugin
229
 
230
+ * Bug fixes:
231
  * Fixed: Metabox update did not work properly in v2.0
232
  * Fixed: Duplicate include files
233
  * Modified: In the mySQL tables, the blog_id default value is set to 1
240
  * Enhancements:
241
  * Modified: Posts are tracked hourly based on the time of the blog and not GMT. This was also the default behaviour of the counter in Top 10 v1.x
242
 
243
+ * Bug fixes:
244
  * Fixed: Default thumbnail location saved correctly on the Settings page.
245
 
246
  = 2.0.1 =
247
 
248
+ * Bug fixes
249
  * 500/503 errors caused by 2.0.0
250
 
251
  = 2.0.0 =
261
  * Modified: Update and View counts now use query variables instead of external JavaScript files. Check http://goo.gl/yemvyM for sample functions to restore the old method
262
  * Modified: Activating the default styles option will automatically set the thumbnail width and height to 65px, disable author and excerpt and enable crop mode for the thumbnails
263
 
264
+ * Bug fixes:
265
  * Fixed: Fix schedule overwrite for the cron job
266
  * Fixed: Incorrect permission lookup in the metabox
267
 
270
 
271
  == Upgrade Notice ==
272
 
273
+ = 2.2.1 =
274
  * New features. Deprecated functions. Upgrade highly recommended. Please do verify your settings after the upgrade.
275
  Check the Changelog for more details
276
 
top-10.php CHANGED
@@ -14,7 +14,7 @@
14
  * Plugin Name: Top 10
15
  * Plugin URI: https://webberzone.com/plugins/top-10/
16
  * Description: Count daily and total visits per post and display the most popular posts based on the number of views
17
- * Version: 2.2.0
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * Text Domain: tptn
14
  * Plugin Name: Top 10
15
  * Plugin URI: https://webberzone.com/plugins/top-10/
16
  * Description: Count daily and total visits per post and display the most popular posts based on the number of views
17
+ * Version: 2.2.1
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * Text Domain: tptn