Top 10 – Popular posts plugin for WordPress - Version 2.9.4

Version Description

Release post: https://webberzone.com/blog/top-10-v2-9-0/

  • Bug fixes:
    • .json file error when trying to import tables in the Tools page
Download this release

Release Info

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

Code changes from version 2.9.3 to 2.9.4

Files changed (5) hide show
  1. changelog.txt +11 -0
  2. includes/admin/import-export.php +8 -8
  3. phpcs.ruleset.xml +17 -0
  4. readme.txt +11 -14
  5. top-10.php +1 -1
changelog.txt CHANGED
@@ -1,5 +1,16 @@
1
  This file holds the archive of changelog entries
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.6.3 =
4
 
5
  * Enhancements:
1
  This file holds the archive of changelog entries
2
 
3
+ = 2.7.0 =
4
+
5
+ Release post: [https://webberzone.com/blog/top-10-v2-7-0/](https://webberzone.com/blog/top-10-v2-7-0/)
6
+
7
+ * Features:
8
+ * Recreate the Top 10 database tables. You can find the button in the Tools page. Backup your database first
9
+ * New export/import interface to export and import the Top 10 tables and settings
10
+
11
+ * Enhancements:
12
+ * `tptn_views` shortcode adds a new parameter 'count' to explicitly set the count type. Choose from daily, total or overall. This is overridden if daily is set to 0 (backwards compatibility)
13
+
14
  = 2.6.3 =
15
 
16
  * Enhancements:
includes/admin/import-export.php CHANGED
@@ -82,7 +82,7 @@ function tptn_exim_page() {
82
  <?php esc_html_e( 'Click the buttons below to export the overall and the daily tables. The file is downloaded as an CSV file which you should be able to edit in Excel or any other compatible software.', 'top-10' ); ?>
83
  <?php esc_html_e( 'If you are using WordPress Multisite then this will include the counts across all sites as the plugin uses a single table to store counts.', 'top-10' ); ?>
84
  </p>
85
- <p><input type="hidden" name="tptn_action" value="export_settings" /></p>
86
  <p>
87
  <?php submit_button( esc_html__( 'Export overall tables', 'top-10' ), 'primary', 'tptn_export_total', false ); ?>
88
  <?php submit_button( esc_html__( 'Export daily tables', 'top-10' ), 'primary', 'tptn_export_daily', false ); ?>
@@ -116,7 +116,7 @@ function tptn_exim_page() {
116
  <?php submit_button( esc_html__( 'Import Daily CSV', 'top-10' ), 'primary', 'tptn_import_daily', false ); ?>
117
  </p>
118
 
119
- <input type="hidden" name="tptn_action" value="import_settings" />
120
  <?php wp_nonce_field( 'tptn_import_nonce', 'tptn_import_nonce' ); ?>
121
  </form>
122
 
@@ -141,14 +141,14 @@ function tptn_exim_page() {
141
 
142
 
143
  /**
144
- * Process a settings export that generates a .json file of the shop settings
145
  *
146
  * @since 2.7.0
147
  */
148
  function tptn_export_tables() {
149
  global $wpdb;
150
 
151
- if ( empty( $_POST['tptn_action'] ) || 'export_settings' !== $_POST['tptn_action'] ) {
152
  return;
153
  }
154
 
@@ -224,14 +224,14 @@ function tptn_export_tables() {
224
  add_action( 'admin_init', 'tptn_export_tables' );
225
 
226
  /**
227
- * Process a settings export that generates a .json file of the shop settings
228
  *
229
  * @since 2.7.0
230
  */
231
  function tptn_import_tables() {
232
  global $wpdb;
233
 
234
- if ( empty( $_POST['tptn_action'] ) || 'import_settings' !== $_POST['tptn_action'] ) {
235
  return;
236
  }
237
 
@@ -306,10 +306,10 @@ function tptn_import_tables() {
306
  exit;
307
 
308
  }
309
- add_action( 'admin_init', 'tptn_import_tables' );
310
 
311
  /**
312
- * Process a settings export that generates a .json file of the shop settings
313
  *
314
  * @since 2.7.0
315
  */
82
  <?php esc_html_e( 'Click the buttons below to export the overall and the daily tables. The file is downloaded as an CSV file which you should be able to edit in Excel or any other compatible software.', 'top-10' ); ?>
83
  <?php esc_html_e( 'If you are using WordPress Multisite then this will include the counts across all sites as the plugin uses a single table to store counts.', 'top-10' ); ?>
84
  </p>
85
+ <p><input type="hidden" name="tptn_action" value="export_tables" /></p>
86
  <p>
87
  <?php submit_button( esc_html__( 'Export overall tables', 'top-10' ), 'primary', 'tptn_export_total', false ); ?>
88
  <?php submit_button( esc_html__( 'Export daily tables', 'top-10' ), 'primary', 'tptn_export_daily', false ); ?>
116
  <?php submit_button( esc_html__( 'Import Daily CSV', 'top-10' ), 'primary', 'tptn_import_daily', false ); ?>
117
  </p>
118
 
119
+ <input type="hidden" name="tptn_action" value="import_tables" />
120
  <?php wp_nonce_field( 'tptn_import_nonce', 'tptn_import_nonce' ); ?>
121
  </form>
122
 
141
 
142
 
143
  /**
144
+ * Process a settings export that generates a .csv file of the Top 10 table.
145
  *
146
  * @since 2.7.0
147
  */
148
  function tptn_export_tables() {
149
  global $wpdb;
150
 
151
+ if ( empty( $_POST['tptn_action'] ) || 'export_tables' !== $_POST['tptn_action'] ) {
152
  return;
153
  }
154
 
224
  add_action( 'admin_init', 'tptn_export_tables' );
225
 
226
  /**
227
+ * Process a .csv file to import the table into the database.
228
  *
229
  * @since 2.7.0
230
  */
231
  function tptn_import_tables() {
232
  global $wpdb;
233
 
234
+ if ( empty( $_POST['tptn_action'] ) || 'import_tables' !== $_POST['tptn_action'] ) {
235
  return;
236
  }
237
 
306
  exit;
307
 
308
  }
309
+ add_action( 'admin_init', 'tptn_import_tables', 9 );
310
 
311
  /**
312
+ * Process a settings export that generates a .json file of the Top 10 settings
313
  *
314
  * @since 2.7.0
315
  */
phpcs.ruleset.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <ruleset name="WordPress Coding Standards for Plugins">
3
+ <description>Generally-applicable sniffs for WordPress plugins</description>
4
+
5
+ <exclude-pattern>*/node_modules/*</exclude-pattern>
6
+ <exclude-pattern>*/vendor/*</exclude-pattern>
7
+ <exclude-pattern>*/tests/*</exclude-pattern>
8
+ <exclude-pattern>*/index.php</exclude-pattern>
9
+
10
+ <rule ref="WordPress" />
11
+
12
+ <!-- Add in some extra rules from other standards. -->
13
+ <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
14
+ <rule ref="Generic.Commenting.Todo"/>
15
+ <rule ref="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
16
+
17
+ </ruleset>
readme.txt CHANGED
@@ -2,9 +2,10 @@
2
  Tags: popular posts, top 10, counter, top posts, daily popular, page views, statistics, tracker
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
- Stable tag: 2.9.3
6
  Requires at least: 4.9
7
- Tested up to: 5.4
 
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.
@@ -160,6 +161,13 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
160
 
161
  == Changelog ==
162
 
 
 
 
 
 
 
 
163
  = 2.9.3 =
164
 
165
  Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
@@ -217,22 +225,11 @@ Release post: [https://webberzone.com/blog/top-10-v2-8-0/](https://webberzone.co
217
  * New page in the network admin menu to view the popular posts across the network
218
  * Also delete transients and other settings on uninstall
219
 
220
- = 2.7.0 =
221
-
222
- Release post: [https://webberzone.com/blog/top-10-v2-7-0/](https://webberzone.com/blog/top-10-v2-7-0/)
223
-
224
- * Features:
225
- * Recreate the Top 10 database tables. You can find the button in the Tools page. Backup your database first
226
- * New export/import interface to export and import the Top 10 tables and settings
227
-
228
- * Enhancements:
229
- * `tptn_views` shortcode adds a new parameter 'count' to explicitly set the count type. Choose from daily, total or overall. This is overridden if daily is set to 0 (backwards compatibility)
230
-
231
  For previous changelog entries, please refer to the separate changelog.txt file or [Github Releases page](https://github.com/WebberZone/top-10/releases)
232
 
233
 
234
  == Upgrade Notice ==
235
 
236
- = 2.9.3 =
237
  Bug fixes and new features; Check the Changelog for more details or the release posts on https://webberzone.com
238
 
2
  Tags: popular posts, top 10, counter, top posts, daily popular, page views, statistics, tracker
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
+ Stable tag: 2.9.4
6
  Requires at least: 4.9
7
+ Tested up to: 5.5
8
+ Requires PHP: 5.6
9
  License: GPLv2 or later
10
 
11
  Track daily and total visits on your blog posts. Display the count as well as popular and trending posts.
161
 
162
  == Changelog ==
163
 
164
+ = 2.9.4 =
165
+
166
+ Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
167
+
168
+ * Bug fixes:
169
+ * .json file error when trying to import tables in the Tools page
170
+
171
  = 2.9.3 =
172
 
173
  Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
225
  * New page in the network admin menu to view the popular posts across the network
226
  * Also delete transients and other settings on uninstall
227
 
 
 
 
 
 
 
 
 
 
 
 
228
  For previous changelog entries, please refer to the separate changelog.txt file or [Github Releases page](https://github.com/WebberZone/top-10/releases)
229
 
230
 
231
  == Upgrade Notice ==
232
 
233
+ = 2.9.4 =
234
  Bug fixes and new features; Check the Changelog for more details or the release posts on https://webberzone.com
235
 
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.9.3
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.9.4
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+