Top 10 – Popular posts plugin for WordPress - Version 2.9.1

Version Description

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

  • Bug fixes:
    • Published age of posts parameter was no longer working
    • Importing settings should now work properly - previously checkboxes all ended up being enabled
    • In rare cases, the tracker would throw PHP errors e.g. on search results page where no posts were loaded and tracker was enabled to load on all pages
Download this release

Release Info

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

Code changes from version 2.9.0 to 2.9.1

includes/admin/admin.php CHANGED
File without changes
includes/admin/import-export.php CHANGED
@@ -390,4 +390,4 @@ function tptn_process_settings_import() {
390
  exit;
391
 
392
  }
393
- add_action( 'admin_init', 'tptn_process_settings_import' );
390
  exit;
391
 
392
  }
393
+ add_action( 'admin_init', 'tptn_process_settings_import', 9 );
includes/admin/index.php CHANGED
File without changes
includes/public/display-posts.php CHANGED
@@ -373,7 +373,9 @@ function get_tptn_pop_posts( $args = array() ) {
373
 
374
  // How old should the posts be?
375
  if ( $args['how_old'] ) {
376
- $where .= $wpdb->prepare( " AND $wpdb->posts.post_date > %s ", current_time( 'Y-m-d H:m:s' ) - ( $args['how_old'] * DAY_IN_SECONDS ) );
 
 
377
  }
378
 
379
  if ( isset( $args['include_cat_ids'] ) && ! empty( $args['include_cat_ids'] ) ) {
373
 
374
  // How old should the posts be?
375
  if ( $args['how_old'] ) {
376
+ $how_old_date = tptn_get_from_date( null, $args['how_old'] + 1, 0 );
377
+
378
+ $where .= $wpdb->prepare( " AND $wpdb->posts.post_date > %s ", $how_old_date );
379
  }
380
 
381
  if ( isset( $args['include_cat_ids'] ) && ! empty( $args['include_cat_ids'] ) ) {
includes/tracker.php CHANGED
@@ -14,10 +14,14 @@
14
  function tptn_enqueue_scripts() {
15
  global $post, $ajax_tptn_tracker;
16
 
 
 
 
 
17
  $track_users = tptn_get_option( 'track_users' );
18
  $trackers = tptn_get_option( 'trackers' );
19
 
20
- if ( ( is_singular() || tptn_get_option( 'tracker_all_pages' ) ) && 'draft' !== $post->post_status && ! is_customize_preview() ) {
21
 
22
  $current_user = wp_get_current_user(); // Let's get the current user.
23
  $post_author = ( $current_user->ID === $post->post_author ) ? true : false; // Is the current user the post author?
14
  function tptn_enqueue_scripts() {
15
  global $post, $ajax_tptn_tracker;
16
 
17
+ if ( ! is_object( $post ) ) {
18
+ return;
19
+ }
20
+
21
  $track_users = tptn_get_option( 'track_users' );
22
  $trackers = tptn_get_option( 'trackers' );
23
 
24
+ if ( ( is_singular() || tptn_get_option( 'tracker_all_pages' ) ) && ( 'draft' !== $post->post_status ) && ! is_customize_preview() ) {
25
 
26
  $current_user = wp_get_current_user(); // Let's get the current user.
27
  $post_author = ( $current_user->ID === $post->post_author ) ? true : false; // Is the current user the post author?
languages/top-10-en_US.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Top 10\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2020-04-15 09:49+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
@@ -1603,19 +1603,19 @@ msgstr ""
1603
  msgid " by "
1604
  msgstr ""
1605
 
1606
- #: includes/tracker.php:276
1607
  msgid "Query variable based"
1608
  msgstr ""
1609
 
1610
- #: includes/tracker.php:277
1611
  msgid "Uses query variables to record visits"
1612
  msgstr ""
1613
 
1614
- #: includes/tracker.php:281
1615
  msgid "Ajaxurl based"
1616
  msgstr ""
1617
 
1618
- #: includes/tracker.php:282
1619
  msgid ""
1620
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1621
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: Top 10\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2020-04-20 18:40+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
1603
  msgid " by "
1604
  msgstr ""
1605
 
1606
+ #: includes/tracker.php:280
1607
  msgid "Query variable based"
1608
  msgstr ""
1609
 
1610
+ #: includes/tracker.php:281
1611
  msgid "Uses query variables to record visits"
1612
  msgstr ""
1613
 
1614
+ #: includes/tracker.php:285
1615
  msgid "Ajaxurl based"
1616
  msgstr ""
1617
 
1618
+ #: includes/tracker.php:286
1619
  msgid ""
1620
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1621
  msgstr ""
languages/top-10-en_US.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Top 10\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2020-04-15 09:49+0100\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
9
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
@@ -1604,19 +1604,19 @@ msgstr ""
1604
  msgid " by "
1605
  msgstr ""
1606
 
1607
- #: includes/tracker.php:276
1608
  msgid "Query variable based"
1609
  msgstr ""
1610
 
1611
- #: includes/tracker.php:277
1612
  msgid "Uses query variables to record visits"
1613
  msgstr ""
1614
 
1615
- #: includes/tracker.php:281
1616
  msgid "Ajaxurl based"
1617
  msgstr ""
1618
 
1619
- #: includes/tracker.php:282
1620
  msgid ""
1621
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1622
  msgstr ""
3
  msgstr ""
4
  "Project-Id-Version: Top 10\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2020-04-20 18:40+0100\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
9
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
1604
  msgid " by "
1605
  msgstr ""
1606
 
1607
+ #: includes/tracker.php:280
1608
  msgid "Query variable based"
1609
  msgstr ""
1610
 
1611
+ #: includes/tracker.php:281
1612
  msgid "Uses query variables to record visits"
1613
  msgstr ""
1614
 
1615
+ #: includes/tracker.php:285
1616
  msgid "Ajaxurl based"
1617
  msgstr ""
1618
 
1619
+ #: includes/tracker.php:286
1620
  msgid ""
1621
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1622
  msgstr ""
readme.txt CHANGED
@@ -160,6 +160,15 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
160
 
161
  == Changelog ==
162
 
 
 
 
 
 
 
 
 
 
163
  = 2.9.0 =
164
 
165
  Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
160
 
161
  == Changelog ==
162
 
163
+ = 2.9.1 =
164
+
165
+ Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
166
+
167
+ * Bug fixes:
168
+ * Published age of posts parameter was no longer working
169
+ * Importing settings should now work properly - previously checkboxes all ended up being enabled
170
+ * In rare cases, the tracker would throw PHP errors e.g. on search results page where no posts were loaded and tracker was enabled to load on all pages
171
+
172
  = 2.9.0 =
173
 
174
  Release post: [https://webberzone.com/blog/top-10-v2-9-0/](https://webberzone.com/blog/top-10-v2-9-0/)
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.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.9.1
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+