Top 10 – Popular posts plugin for WordPress - Version 2.2.2

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.2
Comparing to
See all releases

Code changes from version 2.2.1 to 2.2.2

Files changed (3) hide show
  1. admin/class-stats.php +10 -10
  2. readme.txt +1 -1
  3. top-10.php +1 -1
admin/class-stats.php CHANGED
@@ -33,11 +33,11 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
33
  *
34
  */
35
  public function __construct() {
36
- parent::__construct( [
37
  'singular' => __( 'popular_post', 'tptn' ), //singular name of the listed records
38
  'plural' => __( 'popular_posts', 'tptn' ), //plural name of the listed records
39
  // 'ajax' => false //does this table support ajax?
40
- ] );
41
  }
42
 
43
  /**
@@ -273,7 +273,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
273
  * @return array
274
  */
275
  function get_columns() {
276
- $columns = [
277
  'cb' => '<input type="checkbox" />',
278
  'title' => __( 'Title', 'tptn' ),
279
  'total_count' => __( 'Total visits', 'tptn' ),
@@ -281,7 +281,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
281
  'post_type' => __( 'Post type', 'tptn' ),
282
  'author' => __( 'Author', 'tptn' ),
283
  'date' => __( 'Date', 'tptn' ),
284
- ];
285
 
286
  /**
287
  * Filter the columns displayed in the Posts list table.
@@ -313,9 +313,9 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
313
  * @return array
314
  */
315
  public function get_bulk_actions() {
316
- $actions = [
317
  'bulk-delete' => __( 'Delete Count', 'tptn' )
318
- ];
319
  return $actions;
320
  }
321
 
@@ -335,11 +335,11 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
335
 
336
  $total_items = self::record_count();
337
 
338
- $this->set_pagination_args( [
339
  'total_items' => $total_items, //WE have to calculate the total number of items
340
  'per_page' => $per_page, //WE have to determine how many items to show on a page
341
  'total_pages' => ceil( $total_items / $per_page ) //WE have to calculate the total number of pages
342
- ] );
343
 
344
  $this->items = self::get_popular_posts( $per_page, $current_page );
345
  }
@@ -436,11 +436,11 @@ class Top_Ten_Statistics {
436
  */
437
  public function screen_option() {
438
  $option = 'per_page';
439
- $args = [
440
  'label' => __( 'Popular Posts', 'tptn' ),
441
  'default' => 20,
442
  'option' => 'pop_posts_per_page'
443
- ];
444
  add_screen_option( $option, $args );
445
  $this->pop_posts_obj = new Top_Ten_Statistics_Table();
446
  }
33
  *
34
  */
35
  public function __construct() {
36
+ parent::__construct( array(
37
  'singular' => __( 'popular_post', 'tptn' ), //singular name of the listed records
38
  'plural' => __( 'popular_posts', 'tptn' ), //plural name of the listed records
39
  // 'ajax' => false //does this table support ajax?
40
+ ) );
41
  }
42
 
43
  /**
273
  * @return array
274
  */
275
  function get_columns() {
276
+ $columns = array(
277
  'cb' => '<input type="checkbox" />',
278
  'title' => __( 'Title', 'tptn' ),
279
  'total_count' => __( 'Total visits', 'tptn' ),
281
  'post_type' => __( 'Post type', 'tptn' ),
282
  'author' => __( 'Author', 'tptn' ),
283
  'date' => __( 'Date', 'tptn' ),
284
+ );
285
 
286
  /**
287
  * Filter the columns displayed in the Posts list table.
313
  * @return array
314
  */
315
  public function get_bulk_actions() {
316
+ $actions = array(
317
  'bulk-delete' => __( 'Delete Count', 'tptn' )
318
+ );
319
  return $actions;
320
  }
321
 
335
 
336
  $total_items = self::record_count();
337
 
338
+ $this->set_pagination_args( array(
339
  'total_items' => $total_items, //WE have to calculate the total number of items
340
  'per_page' => $per_page, //WE have to determine how many items to show on a page
341
  'total_pages' => ceil( $total_items / $per_page ) //WE have to calculate the total number of pages
342
+ ) );
343
 
344
  $this->items = self::get_popular_posts( $per_page, $current_page );
345
  }
436
  */
437
  public function screen_option() {
438
  $option = 'per_page';
439
+ $args = array(
440
  'label' => __( 'Popular Posts', 'tptn' ),
441
  'default' => 20,
442
  'option' => 'pop_posts_per_page'
443
+ );
444
  add_screen_option( $option, $args );
445
  $this->pop_posts_obj = new Top_Ten_Statistics_Table();
446
  }
readme.txt CHANGED
@@ -171,7 +171,7 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
171
 
172
  == Changelog ==
173
 
174
- = 2.2.1 =
175
 
176
  * Bug fixes:
177
  * Fixed array declaration to support PHP < 5.4
171
 
172
  == Changelog ==
173
 
174
+ = 2.2.2 =
175
 
176
  * Bug fixes:
177
  * Fixed array declaration to support PHP < 5.4
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.1
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.2
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * Text Domain: tptn