Top 10 – Popular posts plugin for WordPress - Version 2.3.1

Version Description

  • Bug fixes:
    • Potential CSRF issue fixed in admin area
Download this release

Release Info

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

Code changes from version 2.3.0 to 2.3.1

Files changed (3) hide show
  1. admin/class-stats.php +12 -3
  2. readme.txt +6 -1
  3. top-10.php +1 -1
admin/class-stats.php CHANGED
@@ -105,12 +105,21 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
105
  // Create the base GROUP BY clause
106
  $groupby = ' ID ';
107
 
108
- // Create the base ORDER BY clause
109
  $orderby = ' total_count DESC ';
110
 
111
  if ( ! empty( $_REQUEST['orderby'] ) ) {
112
  $orderby = esc_sql( $_REQUEST['orderby'] );
113
- $orderby .= ! empty( $_REQUEST['order'] ) ? ' ' . ( $_REQUEST['order'] ) : ' DESC';
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  // Create the base LIMITS clause
@@ -475,7 +484,7 @@ class Top_Ten_Statistics {
475
  <div id="post-body-content">
476
  <div class="meta-box-sortables ui-sortable">
477
  <form method="get">
478
- <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
479
  <?php
480
  // If this is a search?
481
  if ( isset( $_REQUEST['s'] ) ) {
105
  // Create the base GROUP BY clause
106
  $groupby = ' ID ';
107
 
108
+ // Create the base ORDER BY clause.
109
  $orderby = ' total_count DESC ';
110
 
111
  if ( ! empty( $_REQUEST['orderby'] ) ) {
112
  $orderby = esc_sql( $_REQUEST['orderby'] );
113
+
114
+ if ( ! empty( $_REQUEST['order'] ) ) {
115
+ $order = esc_sql( $_REQUEST['order'] );
116
+
117
+ if ( in_array( $order, array( 'asc', 'ASC', 'desc', 'DESC' ) ) ) {
118
+ $orderby .= ' ' . $order;
119
+ } else {
120
+ $orderby .= ' DESC';
121
+ }
122
+ }
123
  }
124
 
125
  // Create the base LIMITS clause
484
  <div id="post-body-content">
485
  <div class="meta-box-sortables ui-sortable">
486
  <form method="get">
487
+ <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ) ?>" />
488
  <?php
489
  // If this is a search?
490
  if ( isset( $_REQUEST['s'] ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
  Requires at least: 3.9
7
- Tested up to: 4.5
8
  License: GPLv2 or later
9
 
10
  Track daily and total visits on your blog posts. Display the count as well as popular and trending posts.
@@ -166,6 +166,11 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
166
 
167
  == Changelog ==
168
 
 
 
 
 
 
169
  = 2.3.0 =
170
 
171
  * Features:
4
  Donate link: https://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
  Requires at least: 3.9
7
+ Tested up to: 4.5.2
8
  License: GPLv2 or later
9
 
10
  Track daily and total visits on your blog posts. Display the count as well as popular and trending posts.
166
 
167
  == Changelog ==
168
 
169
+ = 2.3.1 =
170
+
171
+ * Bug fixes:
172
+ * Potential CSRF issue fixed in admin area
173
+
174
  = 2.3.0 =
175
 
176
  * Features:
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.3.0
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
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.3.1
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+