Top 10 – Popular posts plugin for WordPress - Version 2.6.0

Version Description

  • Features:

    • New option to disable creation of image thumbnails. Find this under Thumbnail options
    • Thumbnail HTML markup includes srcset and sizes attributes when available. Read Responsive Images in WordPress 4.4
    • New option to turn on debug mode. You can turn this on when requesting support. Find it under the Counter/Tracker tab
    • New option to add the tracker js file on all pages, not just singular pages. Helps with minification/concatenation
    • New date filter in the Popular posts listing page to see the views on a particular date
    • New option to turn ON/OFF the number formatting of the post counts. ON by default
  • Enhancements:

    • Load tracker in footer
    • Renamed top-10-tracker.js to top-10-tracker.min.js
  • Bug fixes:

    • Only delete option if null value is passed to tptn_update_option
    • "Exclude display on these post IDs" moved under Counter section
Download this release

Release Info

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

Code changes from version 2.5.7 to 2.6.0

Files changed (46) hide show
  1. README.md +2 -2
  2. includes/activate-deactivate.php +12 -10
  3. includes/admin/admin-columns.php +12 -36
  4. includes/admin/admin-dashboard.php +4 -4
  5. includes/admin/admin-metabox.php +11 -11
  6. includes/admin/admin.php +27 -8
  7. includes/admin/cache.php +1 -1
  8. includes/admin/class-top-ten-statistics-table.php +61 -170
  9. includes/admin/class-top-ten-statistics.php +149 -0
  10. includes/admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  11. includes/admin/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  12. includes/admin/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  13. includes/admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  14. includes/admin/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  15. includes/admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  16. includes/admin/css/images/ui-icons_222222_256x240.png +0 -0
  17. includes/admin/css/images/ui-icons_2e83ff_256x240.png +0 -0
  18. includes/admin/css/images/ui-icons_454545_256x240.png +0 -0
  19. includes/admin/css/images/ui-icons_888888_256x240.png +0 -0
  20. includes/admin/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  21. includes/admin/css/top-10-admin.css +669 -0
  22. includes/admin/css/top-10-admin.min.css +1 -0
  23. includes/admin/default-settings.php +843 -0
  24. includes/admin/register-settings.php +4 -692
  25. includes/admin/save-settings.php +3 -3
  26. includes/admin/settings-page.php +19 -19
  27. includes/admin/tools.php +14 -14
  28. includes/counter.php +31 -27
  29. includes/cron.php +3 -3
  30. includes/deprecated.php +13 -6
  31. includes/helpers.php +85 -0
  32. includes/js/{top-10-tracker.js → top-10-tracker.min.js} +1 -1
  33. includes/modules/class-top-ten-count-widget.php +3 -9
  34. includes/modules/class-top-ten-widget.php +2 -2
  35. includes/modules/exclusions.php +1 -1
  36. includes/public/display-posts.php +19 -40
  37. includes/public/media.php +151 -34
  38. includes/public/output-generator.php +59 -0
  39. includes/public/styles.php +3 -3
  40. includes/tracker.php +69 -41
  41. languages/top-10-en_US.mo +0 -0
  42. languages/top-10-en_US.po +348 -305
  43. languages/top-10-en_US.pot +348 -305
  44. readme.txt +21 -3
  45. top-10.php +5 -21
  46. uninstall.php +3 -3
README.md CHANGED
@@ -5,9 +5,9 @@
5
 
6
  # Top 10 - Popular posts plugin for WordPress
7
 
8
- __Requires:__ 4.1
9
 
10
- __Tested up to:__ 4.9
11
 
12
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
13
 
5
 
6
  # Top 10 - Popular posts plugin for WordPress
7
 
8
+ __Requires:__ 4.5
9
 
10
+ __Tested up to:__ 5.0
11
 
12
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
13
 
includes/activate-deactivate.php CHANGED
@@ -21,12 +21,12 @@ function tptn_activation_hook( $network_wide ) {
21
  if ( is_multisite() && $network_wide ) {
22
 
23
  // Get all blogs in the network and activate plugin on each one.
24
- $blog_ids = $wpdb->get_col(
25
  "
26
  SELECT blog_id FROM $wpdb->blogs
27
  WHERE archived = '0' AND spam = '0' AND deleted = '0'
28
  "
29
- ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
30
  foreach ( $blog_ids as $blog_id ) {
31
  switch_to_blog( $blog_id );
32
  tptn_single_activate();
@@ -55,9 +55,10 @@ function tptn_single_activate() {
55
  $table_name = $wpdb->base_prefix . 'top_ten';
56
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily';
57
 
58
- if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) { // WPCS: unprepared SQL OK.
59
 
60
- $sql = 'CREATE TABLE ' . $table_name . " (
 
61
  postnumber bigint(20) NOT NULL,
62
  cntaccess bigint(20) NOT NULL,
63
  blog_id bigint(20) NOT NULL DEFAULT '1',
@@ -69,9 +70,10 @@ function tptn_single_activate() {
69
 
70
  }
71
 
72
- if ( $wpdb->get_var( "show tables like '$table_name_daily'" ) != $table_name_daily ) { // WPCS: unprepared SQL OK.
73
 
74
- $sql = 'CREATE TABLE ' . $table_name_daily . " (
 
75
  postnumber bigint(20) NOT NULL,
76
  cntaccess bigint(20) NOT NULL,
77
  dp_date DATETIME NOT NULL,
@@ -89,12 +91,12 @@ function tptn_single_activate() {
89
  // Upgrade table code.
90
  $installed_ver = get_site_option( 'tptn_db_version' );
91
 
92
- if ( $installed_ver != $tptn_db_version ) {
93
 
94
  $sql = 'ALTER TABLE ' . $table_name . ' DROP PRIMARY KEY ';
95
- $wpdb->query( $sql ); // WPCS: unprepared SQL ok.
96
  $sql = 'ALTER TABLE ' . $table_name_daily . ' DROP PRIMARY KEY ';
97
- $wpdb->query( $sql ); // WPCS: unprepared SQL ok.
98
 
99
  $sql = 'CREATE TABLE ' . $table_name . " (
100
  postnumber bigint(20) NOT NULL,
@@ -167,7 +169,7 @@ add_filter( 'wpmu_drop_tables', 'tptn_on_delete_blog' );
167
  function tptn_update_db_check() {
168
  global $tptn_db_version, $network_wide;
169
 
170
- if ( get_site_option( 'tptn_db_version' ) != $tptn_db_version ) {
171
  tptn_activation_hook( $network_wide );
172
  }
173
  }
21
  if ( is_multisite() && $network_wide ) {
22
 
23
  // Get all blogs in the network and activate plugin on each one.
24
+ $blog_ids = $wpdb->get_col( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
25
  "
26
  SELECT blog_id FROM $wpdb->blogs
27
  WHERE archived = '0' AND spam = '0' AND deleted = '0'
28
  "
29
+ );
30
  foreach ( $blog_ids as $blog_id ) {
31
  switch_to_blog( $blog_id );
32
  tptn_single_activate();
55
  $table_name = $wpdb->base_prefix . 'top_ten';
56
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily';
57
 
58
+ if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
59
 
60
+ $sql = 'CREATE TABLE ' . $table_name . // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange
61
+ " (
62
  postnumber bigint(20) NOT NULL,
63
  cntaccess bigint(20) NOT NULL,
64
  blog_id bigint(20) NOT NULL DEFAULT '1',
70
 
71
  }
72
 
73
+ if ( $wpdb->get_var( "show tables like '$table_name_daily'" ) != $table_name_daily ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
74
 
75
+ $sql = 'CREATE TABLE ' . $table_name_daily . // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange
76
+ " (
77
  postnumber bigint(20) NOT NULL,
78
  cntaccess bigint(20) NOT NULL,
79
  dp_date DATETIME NOT NULL,
91
  // Upgrade table code.
92
  $installed_ver = get_site_option( 'tptn_db_version' );
93
 
94
+ if ( $installed_ver != $tptn_db_version ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
95
 
96
  $sql = 'ALTER TABLE ' . $table_name . ' DROP PRIMARY KEY ';
97
+ $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
98
  $sql = 'ALTER TABLE ' . $table_name_daily . ' DROP PRIMARY KEY ';
99
+ $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
100
 
101
  $sql = 'CREATE TABLE ' . $table_name . " (
102
  postnumber bigint(20) NOT NULL,
169
  function tptn_update_db_check() {
170
  global $tptn_db_version, $network_wide;
171
 
172
+ if ( get_site_option( 'tptn_db_version' ) != $tptn_db_version ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
173
  tptn_activation_hook( $network_wide );
174
  }
175
  }
includes/admin/admin-columns.php CHANGED
@@ -6,7 +6,7 @@
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
- * @copyright 2008-2016 Ajay D'Souza
10
  */
11
 
12
  /**** If this file is called directly, abort. ****/
@@ -54,8 +54,8 @@ function tptn_value( $column_name, $id ) {
54
  if ( ( 'tptn_total' === $column_name ) && ( tptn_get_option( 'pv_in_admin' ) ) ) {
55
  $table_name = $wpdb->base_prefix . 'top_ten';
56
 
57
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
58
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->cntaccess : 0 ) );
59
  echo esc_html( $cntaccess );
60
  }
61
 
@@ -66,18 +66,10 @@ function tptn_value( $column_name, $id ) {
66
  $daily_range = tptn_get_option( 'daily_range' );
67
  $hour_range = tptn_get_option( 'hour_range' );
68
 
69
- if ( tptn_get_option( 'daily_midnight' ) ) {
70
- $current_time = current_time( 'timestamp', 0 );
71
- $from_date = $current_time - ( max( 0, ( $daily_range - 1 ) ) * DAY_IN_SECONDS );
72
- $from_date = gmdate( 'Y-m-d 0', $from_date );
73
- } else {
74
- $current_time = current_time( 'timestamp', 0 );
75
- $from_date = $current_time - ( $daily_range * DAY_IN_SECONDS + $hour_range * HOUR_IN_SECONDS );
76
- $from_date = gmdate( 'Y-m-d H', $from_date );
77
- }
78
 
79
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as sum_count FROM {$table_name} WHERE postnumber = %d AND dp_date >= %s AND blog_id = %d GROUP BY postnumber ", $id, $from_date, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
80
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
81
  echo esc_html( $cntaccess );
82
  }
83
 
@@ -85,26 +77,18 @@ function tptn_value( $column_name, $id ) {
85
  if ( ( 'tptn_both' === $column_name ) && ( tptn_get_option( 'pv_in_admin' ) ) ) {
86
  $table_name = $wpdb->base_prefix . 'top_ten';
87
 
88
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
89
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->cntaccess : 0 ) );
90
 
91
  $table_name = $wpdb->base_prefix . 'top_ten_daily';
92
 
93
  $daily_range = tptn_get_option( 'daily_range' );
94
  $hour_range = tptn_get_option( 'hour_range' );
95
 
96
- if ( tptn_get_option( 'daily_midnight' ) ) {
97
- $current_time = current_time( 'timestamp', 0 );
98
- $from_date = $current_time - ( max( 0, ( $daily_range - 1 ) ) * DAY_IN_SECONDS );
99
- $from_date = gmdate( 'Y-m-d 0', $from_date );
100
- } else {
101
- $current_time = current_time( 'timestamp', 0 );
102
- $from_date = $current_time - ( $daily_range * DAY_IN_SECONDS + $hour_range * HOUR_IN_SECONDS );
103
- $from_date = gmdate( 'Y-m-d H', $from_date );
104
- }
105
 
106
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as sum_count FROM {$table_name} WHERE postnumber = %d AND dp_date >= %s AND blog_id = %d GROUP BY postnumber ", $id, $from_date, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
107
- $cntaccess .= ' / ' . number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
108
 
109
  echo esc_html( $cntaccess );
110
  }
@@ -161,15 +145,7 @@ function tptn_column_clauses( $clauses, $wp_query ) {
161
  $daily_range = tptn_get_option( 'daily_range' );
162
  $hour_range = tptn_get_option( 'hour_range' );
163
 
164
- if ( tptn_get_option( 'daily_midnight' ) ) {
165
- $current_time = current_time( 'timestamp', 0 );
166
- $from_date = $current_time - ( max( 0, ( $daily_range - 1 ) ) * DAY_IN_SECONDS );
167
- $from_date = gmdate( 'Y-m-d 0', $from_date );
168
- } else {
169
- $current_time = current_time( 'timestamp', 0 );
170
- $from_date = $current_time - ( $daily_range * DAY_IN_SECONDS + $hour_range * HOUR_IN_SECONDS );
171
- $from_date = gmdate( 'Y-m-d H', $from_date );
172
- }
173
 
174
  $clauses['join'] .= "LEFT OUTER JOIN {$table_name} ON {$wpdb->posts}.ID={$table_name}.postnumber";
175
  $clauses['where'] .= " AND {$table_name}.dp_date >= '$from_date' ";
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
+ * @copyright 2008-2019 Ajay D'Souza
10
  */
11
 
12
  /**** If this file is called directly, abort. ****/
54
  if ( ( 'tptn_total' === $column_name ) && ( tptn_get_option( 'pv_in_admin' ) ) ) {
55
  $table_name = $wpdb->base_prefix . 'top_ten';
56
 
57
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
58
+ $cntaccess = tptn_number_format_i18n( ( ( $resultscount ) ? $resultscount->cntaccess : 0 ) );
59
  echo esc_html( $cntaccess );
60
  }
61
 
66
  $daily_range = tptn_get_option( 'daily_range' );
67
  $hour_range = tptn_get_option( 'hour_range' );
68
 
69
+ $from_date = tptn_get_from_date();
 
 
 
 
 
 
 
 
70
 
71
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as sum_count FROM {$table_name} WHERE postnumber = %d AND dp_date >= %s AND blog_id = %d GROUP BY postnumber ", $id, $from_date, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
72
+ $cntaccess = tptn_number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
73
  echo esc_html( $cntaccess );
74
  }
75
 
77
  if ( ( 'tptn_both' === $column_name ) && ( tptn_get_option( 'pv_in_admin' ) ) ) {
78
  $table_name = $wpdb->base_prefix . 'top_ten';
79
 
80
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
81
+ $cntaccess = tptn_number_format_i18n( ( ( $resultscount ) ? $resultscount->cntaccess : 0 ) );
82
 
83
  $table_name = $wpdb->base_prefix . 'top_ten_daily';
84
 
85
  $daily_range = tptn_get_option( 'daily_range' );
86
  $hour_range = tptn_get_option( 'hour_range' );
87
 
88
+ $from_date = tptn_get_from_date();
 
 
 
 
 
 
 
 
89
 
90
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as sum_count FROM {$table_name} WHERE postnumber = %d AND dp_date >= %s AND blog_id = %d GROUP BY postnumber ", $id, $from_date, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
91
+ $cntaccess .= ' / ' . tptn_number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
92
 
93
  echo esc_html( $cntaccess );
94
  }
145
  $daily_range = tptn_get_option( 'daily_range' );
146
  $hour_range = tptn_get_option( 'hour_range' );
147
 
148
+ $from_date = tptn_get_from_date();
 
 
 
 
 
 
 
 
149
 
150
  $clauses['join'] .= "LEFT OUTER JOIN {$table_name} ON {$wpdb->posts}.ID={$table_name}.postnumber";
151
  $clauses['where'] .= " AND {$table_name}.dp_date >= '$from_date' ";
includes/admin/admin-dashboard.php CHANGED
@@ -8,7 +8,7 @@
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
- * @copyright 2008-2016 Ajay D'Souza
12
  */
13
 
14
  /**** If this file is called directly, abort. ****/
@@ -56,7 +56,7 @@ function tptn_pop_display( $daily = false, $page = 0, $limit = false, $widget =
56
  $output .= '<ul>';
57
  foreach ( $results as $result ) {
58
  $output .= '<li><a href="' . get_permalink( $result['postnumber'] ) . '">' . get_the_title( $result['postnumber'] ) . '</a>';
59
- $output .= ' (' . number_format_i18n( $result['sum_count'] ) . ')';
60
  $output .= '</li>';
61
  }
62
  $output .= '</ul>';
@@ -100,7 +100,7 @@ function tptn_pop_display( $daily = false, $page = 0, $limit = false, $widget =
100
  * @since 1.1
101
  */
102
  function tptn_pop_dashboard() {
103
- echo tptn_pop_display( false, 0, 10, true ); // WPCS: XSS OK.
104
  }
105
 
106
 
@@ -110,7 +110,7 @@ function tptn_pop_dashboard() {
110
  * @since 1.2
111
  */
112
  function tptn_pop_daily_dashboard() {
113
- echo tptn_pop_display( true, 0, 10, true ); // WPCS: XSS OK.
114
  }
115
 
116
 
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
+ * @copyright 2008-2019 Ajay D'Souza
12
  */
13
 
14
  /**** If this file is called directly, abort. ****/
56
  $output .= '<ul>';
57
  foreach ( $results as $result ) {
58
  $output .= '<li><a href="' . get_permalink( $result['postnumber'] ) . '">' . get_the_title( $result['postnumber'] ) . '</a>';
59
+ $output .= ' (' . tptn_number_format_i18n( $result['sum_count'] ) . ')';
60
  $output .= '</li>';
61
  }
62
  $output .= '</ul>';
100
  * @since 1.1
101
  */
102
  function tptn_pop_dashboard() {
103
+ echo tptn_pop_display( false, 0, 10, true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
104
  }
105
 
106
 
110
  * @since 1.2
111
  */
112
  function tptn_pop_daily_dashboard() {
113
+ echo tptn_pop_display( true, 0, 10, true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
114
  }
115
 
116
 
includes/admin/admin-metabox.php CHANGED
@@ -8,7 +8,7 @@
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
- * @copyright 2008-2016 Ajay D'Souza
12
  */
13
 
14
  /**** If this file is called directly, abort. ****/
@@ -79,13 +79,13 @@ function tptn_call_meta_box() {
79
  wp_nonce_field( 'tptn_meta_box', 'tptn_meta_box_nonce' );
80
 
81
  // Get the number of visits for the post being editted.
82
- $resultscount = $wpdb->get_row(
83
  $wpdb->prepare(
84
- "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ",
85
  $post->ID,
86
  get_current_blog_id()
87
  )
88
- ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
89
  $total_count = $resultscount ? $resultscount->cntaccess : 0;
90
 
91
  // Get the post meta.
@@ -142,7 +142,7 @@ function tptn_call_meta_box() {
142
  <em style="color:red">
143
  <?php
144
  /* translators: 1: Plugin name */
145
- printf( __( 'You have %1$s installed. If you are trying to modify the thumbnail, then you will need to make the same change in the %1$s meta box on this page.', 'top-10' ), 'Contextual Related Posts' ); // WPCS: XSS OK.
146
  ?>
147
  </em>
148
  <?php } ?>
@@ -191,23 +191,23 @@ function tptn_save_meta_box( $post_id ) {
191
  $blog_id = get_current_blog_id();
192
 
193
  if ( 0 === $total_count ) {
194
- $wpdb->query(
195
  $wpdb->prepare(
196
- "DELETE FROM {$table_name} WHERE postnumber = %d AND blog_id = %d",
197
  $post_id,
198
  $blog_id
199
  )
200
- ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
201
  } else {
202
- $wpdb->query(
203
  $wpdb->prepare(
204
- "INSERT INTO {$table_name} (postnumber, cntaccess, blog_id) VALUES( %d, %d, %d ) ON DUPLICATE KEY UPDATE cntaccess= %d ",
205
  $post_id,
206
  $total_count,
207
  $blog_id,
208
  $total_count
209
  )
210
- ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
211
  }
212
  }
213
 
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
+ * @copyright 2008-2019 Ajay D'Souza
12
  */
13
 
14
  /**** If this file is called directly, abort. ****/
79
  wp_nonce_field( 'tptn_meta_box', 'tptn_meta_box_nonce' );
80
 
81
  // Get the number of visits for the post being editted.
82
+ $resultscount = $wpdb->get_row( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
83
  $wpdb->prepare(
84
+ "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
85
  $post->ID,
86
  get_current_blog_id()
87
  )
88
+ );
89
  $total_count = $resultscount ? $resultscount->cntaccess : 0;
90
 
91
  // Get the post meta.
142
  <em style="color:red">
143
  <?php
144
  /* translators: 1: Plugin name */
145
+ printf( __( 'You have %1$s installed. If you are trying to modify the thumbnail, then you will need to make the same change in the %1$s meta box on this page.', 'top-10' ), 'Contextual Related Posts' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
146
  ?>
147
  </em>
148
  <?php } ?>
191
  $blog_id = get_current_blog_id();
192
 
193
  if ( 0 === $total_count ) {
194
+ $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
195
  $wpdb->prepare(
196
+ "DELETE FROM {$table_name} WHERE postnumber = %d AND blog_id = %d", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
197
  $post_id,
198
  $blog_id
199
  )
200
+ );
201
  } else {
202
+ $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
203
  $wpdb->prepare(
204
+ "INSERT INTO {$table_name} (postnumber, cntaccess, blog_id) VALUES( %d, %d, %d ) ON DUPLICATE KEY UPDATE cntaccess= %d ", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
205
  $post_id,
206
  $total_count,
207
  $blog_id,
208
  $total_count
209
  )
210
+ );
211
  }
212
  }
213
 
includes/admin/admin.php CHANGED
@@ -25,7 +25,7 @@ if ( ! defined( 'WPINC' ) ) {
25
  * @return void
26
  */
27
  function tptn_add_admin_pages_links() {
28
- global $tptn_settings_page, $tptn_settings_tools_help;
29
 
30
  $tptn_settings_page = add_menu_page( esc_html__( 'Top 10 Settings', 'top-10' ), esc_html__( 'Top 10', 'top-10' ), 'manage_options', 'tptn_options_page', 'tptn_options_page', 'dashicons-editor-ol' );
31
  add_action( "load-$tptn_settings_page", 'tptn_settings_help' ); // Load the settings contextual help.
@@ -41,13 +41,13 @@ function tptn_add_admin_pages_links() {
41
  // Initialise Top 10 Statistics pages.
42
  $tptn_stats_screen = new Top_Ten_Statistics();
43
 
44
- $plugin_page = add_submenu_page( 'tptn_options_page', __( 'Top 10 Popular Posts', 'top-10' ), __( 'Popular Posts', 'top-10' ), 'manage_options', 'tptn_popular_posts', array( $tptn_stats_screen, 'plugin_settings_page' ) );
45
- add_action( "load-$plugin_page", array( $tptn_stats_screen, 'screen_option' ) );
46
- add_action( 'admin_head-' . $plugin_page, 'tptn_adminhead' );
47
 
48
- $plugin_page = add_submenu_page( 'tptn_options_page', __( 'Top 10 Daily Popular Posts', 'top-10' ), __( 'Daily Popular Posts', 'top-10' ), 'manage_options', 'tptn_popular_posts&orderby=daily_count&order=desc', array( $tptn_stats_screen, 'plugin_settings_page' ) );
49
- add_action( "load-$plugin_page", array( $tptn_stats_screen, 'screen_option' ) );
50
- add_action( 'admin_head-' . $plugin_page, 'tptn_adminhead' );
51
 
52
  }
53
  add_action( 'admin_menu', 'tptn_add_admin_pages_links' );
@@ -60,12 +60,26 @@ add_action( 'admin_menu', 'tptn_add_admin_pages_links' );
60
  * @return void
61
  */
62
  function tptn_adminhead() {
 
63
 
64
  wp_enqueue_script( 'jquery' );
65
  wp_enqueue_script( 'jquery-ui-autocomplete' );
66
  wp_enqueue_script( 'jquery-ui-tabs' );
67
  wp_enqueue_script( 'plugin-install' );
 
68
  add_thickbox();
 
 
 
 
 
 
 
 
 
 
 
 
69
  ?>
70
  <script type="text/javascript">
71
  //<![CDATA[
@@ -124,7 +138,7 @@ function tptn_adminhead() {
124
  $.ajax({
125
  type: 'POST',
126
  dataType: 'json',
127
- url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
128
  data: {
129
  action: 'tptn_tag_search',
130
  tax: taxonomy,
@@ -205,6 +219,11 @@ function tptn_adminhead() {
205
  });
206
  });
207
 
 
 
 
 
 
208
  });
209
 
210
  //]]>
25
  * @return void
26
  */
27
  function tptn_add_admin_pages_links() {
28
+ global $tptn_settings_page, $tptn_settings_tools_help, $tptn_settings_popular_posts, $tptn_settings_popular_posts_daily;
29
 
30
  $tptn_settings_page = add_menu_page( esc_html__( 'Top 10 Settings', 'top-10' ), esc_html__( 'Top 10', 'top-10' ), 'manage_options', 'tptn_options_page', 'tptn_options_page', 'dashicons-editor-ol' );
31
  add_action( "load-$tptn_settings_page", 'tptn_settings_help' ); // Load the settings contextual help.
41
  // Initialise Top 10 Statistics pages.
42
  $tptn_stats_screen = new Top_Ten_Statistics();
43
 
44
+ $tptn_settings_popular_posts = add_submenu_page( 'tptn_options_page', __( 'Top 10 Popular Posts', 'top-10' ), __( 'Popular Posts', 'top-10' ), 'manage_options', 'tptn_popular_posts', array( $tptn_stats_screen, 'plugin_settings_page' ) );
45
+ add_action( "load-$tptn_settings_popular_posts", array( $tptn_stats_screen, 'screen_option' ) );
46
+ add_action( 'admin_head-' . $tptn_settings_popular_posts, 'tptn_adminhead' );
47
 
48
+ $tptn_settings_popular_posts_daily = add_submenu_page( 'tptn_options_page', __( 'Top 10 Daily Popular Posts', 'top-10' ), __( 'Daily Popular Posts', 'top-10' ), 'manage_options', 'tptn_popular_posts&orderby=daily_count&order=desc', array( $tptn_stats_screen, 'plugin_settings_page' ) );
49
+ add_action( "load-$tptn_settings_popular_posts_daily", array( $tptn_stats_screen, 'screen_option' ) );
50
+ add_action( 'admin_head-' . $tptn_settings_popular_posts_daily, 'tptn_adminhead' );
51
 
52
  }
53
  add_action( 'admin_menu', 'tptn_add_admin_pages_links' );
60
  * @return void
61
  */
62
  function tptn_adminhead() {
63
+ global $tptn_settings_page, $tptn_settings_tools_help, $tptn_settings_popular_posts, $tptn_settings_popular_posts_daily;
64
 
65
  wp_enqueue_script( 'jquery' );
66
  wp_enqueue_script( 'jquery-ui-autocomplete' );
67
  wp_enqueue_script( 'jquery-ui-tabs' );
68
  wp_enqueue_script( 'plugin-install' );
69
+ wp_enqueue_script( 'jquery-ui-datepicker' );
70
  add_thickbox();
71
+
72
+ $screen = get_current_screen();
73
+
74
+ if ( $screen->id === $tptn_settings_popular_posts || $screen->id === $tptn_settings_popular_posts_daily ) {
75
+ wp_enqueue_style(
76
+ 'tptn-admin-ui-css',
77
+ plugins_url( 'includes/admin/css/top-10-admin.min.css', TOP_TEN_PLUGIN_FILE ),
78
+ false,
79
+ '1.0',
80
+ false
81
+ );
82
+ }
83
  ?>
84
  <script type="text/javascript">
85
  //<![CDATA[
138
  $.ajax({
139
  type: 'POST',
140
  dataType: 'json',
141
+ url: '<?php echo admin_url( 'admin-ajax.php' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>',
142
  data: {
143
  action: 'tptn_tag_search',
144
  tax: taxonomy,
219
  });
220
  });
221
 
222
+ $('.datepicker').datepicker({
223
+ dateFormat: 'd M yy'
224
+ });
225
+
226
+
227
  });
228
 
229
  //]]>
includes/admin/cache.php CHANGED
@@ -96,7 +96,7 @@ function tptn_cache_get_widget_keys() {
96
  WHERE `option_name` LIKE '_transient_tptn_%_widget%'
97
  ";
98
 
99
- $results = $wpdb->get_results( $sql ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
100
 
101
  if ( is_array( $results ) ) {
102
  foreach ( $results as $result ) {
96
  WHERE `option_name` LIKE '_transient_tptn_%_widget%'
97
  ";
98
 
99
+ $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
100
 
101
  if ( is_array( $results ) ) {
102
  foreach ( $results as $result ) {
includes/admin/class-top-ten-statistics-table.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
- * Top 10 Display statistics page.
4
  *
5
  * @package Top_Ten
6
- * @subpackage Top_Ten_Statistics
7
  * @author Ajay D'Souza <me@ajaydsouza.com>
8
  * @license GPL-2.0+
9
  * @link https://webberzone.com
10
- * @copyright 2008-2016 Ajay D'Souza
11
  */
12
 
13
  /**** If this file is called directly, abort. ****/
@@ -27,6 +27,13 @@ if ( ! class_exists( 'WP_List_Table' ) ) {
27
  */
28
  class Top_Ten_Statistics_Table extends WP_List_Table {
29
 
 
 
 
 
 
 
 
30
  /**
31
  * Class constructor.
32
  */
@@ -37,6 +44,9 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
37
  'plural' => __( 'popular_posts', 'top-10' ), // plural name of the listed records.
38
  )
39
  );
 
 
 
40
  }
41
 
42
  /**
@@ -48,21 +58,13 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
48
  *
49
  * @return array Array of popular posts
50
  */
51
- public static function get_popular_posts( $per_page = 5, $page_number = 1, $args = null ) {
52
 
53
  global $wpdb;
54
 
55
  $blog_id = get_current_blog_id();
56
 
57
- if ( tptn_get_option( 'daily_midnight' ) ) {
58
- $current_time = current_time( 'timestamp', 0 );
59
- $from_date = $current_time - ( max( 0, ( tptn_get_option( 'daily_range' ) - 1 ) ) * DAY_IN_SECONDS );
60
- $from_date = gmdate( 'Y-m-d 0', $from_date );
61
- } else {
62
- $current_time = current_time( 'timestamp', 0 );
63
- $from_date = $current_time - ( tptn_get_option( 'daily_range' ) * DAY_IN_SECONDS + tptn_get_option( 'hour_range' ) * HOUR_IN_SECONDS );
64
- $from_date = gmdate( 'Y-m-d H', $from_date );
65
- }
66
 
67
  /* Start creating the SQL */
68
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily AS ttd';
@@ -81,13 +83,13 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
81
 
82
  // Create the JOIN clause.
83
  $join = " INNER JOIN {$wpdb->posts} ON ttt.postnumber=ID ";
84
- $join .= $wpdb->prepare( // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
85
  " LEFT JOIN (
86
- SELECT * FROM {$table_name_daily}
87
- WHERE ttd.dp_date >= %s
88
  ) AS ttd
89
  ON ttt.postnumber=ttd.postnumber
90
- ",
91
  $from_date
92
  );
93
 
@@ -102,7 +104,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
102
  }
103
 
104
  /* If post filter argument is set, do a search for it. */
105
- if ( isset( $args['post-type-filter'] ) && 'All' !== $args['post-type-filter'] ) {
106
  $where .= $wpdb->prepare( " AND $wpdb->posts.post_type = %s ", $args['post-type-filter'] );
107
  }
108
 
@@ -112,17 +114,17 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
112
  // Create the base ORDER BY clause.
113
  $orderby = ' total_count DESC ';
114
 
115
- if ( ! empty( $_REQUEST['orderby'] ) ) { // WPCS: Input var okay.
116
- $orderby = sanitize_text_field( wp_unslash( $_REQUEST['orderby'] ) );
117
 
118
- if ( ! in_array( $orderby, array( 'title', 'daily_count', 'total_count' ) ) ) {
119
  $orderby = ' total_count ';
120
  }
121
 
122
- if ( ! empty( $_REQUEST['order'] ) ) {
123
- $order = sanitize_text_field( wp_unslash( $_REQUEST['order'] ) );
124
 
125
- if ( in_array( $order, array( 'asc', 'ASC', 'desc', 'DESC' ) ) ) {
126
  $orderby .= ' ' . $order;
127
  } else {
128
  $orderby .= ' DESC';
@@ -142,7 +144,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
142
 
143
  $sql = "SELECT $fields FROM {$table_name} $join WHERE 1=1 $where $groupby $orderby $limits";
144
 
145
- $result = $wpdb->get_results( $sql, 'ARRAY_A' ); // WPCS: Unprepared SQL OK.
146
 
147
  return $result;
148
 
@@ -157,14 +159,14 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
157
  public static function delete_post_count( $id ) {
158
  global $wpdb;
159
 
160
- $wpdb->delete(
161
  "{$wpdb->base_prefix}top_ten",
162
  array(
163
  'postnumber' => $id,
164
  ),
165
  array( '%d' )
166
  );
167
- $wpdb->delete(
168
  "{$wpdb->base_prefix}top_ten_daily",
169
  array(
170
  'postnumber' => $id,
@@ -179,7 +181,8 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
179
  * @param string $args Array of arguments.
180
  * @return null|string null|string
181
  */
182
- public static function record_count( $args = null ) {
 
183
  global $wpdb;
184
 
185
  $sql = $wpdb->prepare(
@@ -196,11 +199,11 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
196
  $sql .= $wpdb->prepare( " AND $wpdb->posts.post_title LIKE %s ", '%' . $wpdb->esc_like( $args['search'] ) . '%' );
197
  }
198
 
199
- if ( isset( $args['post-type-filter'] ) && 'All' !== $args['post-type-filter'] ) {
200
  $sql .= $wpdb->prepare( " AND $wpdb->posts.post_type = %s ", $args['post-type-filter'] );
201
  }
202
 
203
- return $wpdb->get_var( $sql ); // WPCS: Unprepared SQL OK.
204
  }
205
 
206
  /**
@@ -225,9 +228,10 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
225
  return $item[ $column_name ];
226
  case 'total_count':
227
  case 'daily_count':
228
- return number_format_i18n( absint( $item[ $column_name ] ) );
229
  default:
230
- return print_r( $item, true ); // Show the whole array for troubleshooting purposes.
 
231
  }
232
  }
233
 
@@ -254,11 +258,12 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
254
  public function column_title( $item ) {
255
 
256
  $delete_nonce = wp_create_nonce( 'tptn_delete_entry' );
 
257
 
258
  $actions = array(
259
  'view' => sprintf( '<a href="%s" target="_blank">' . __( 'View', 'top-10' ) . '</a>', get_permalink( $item['ID'] ) ),
260
  'edit' => sprintf( '<a href="%s">' . __( 'Edit', 'top-10' ) . '</a>', get_edit_post_link( $item['ID'] ) ),
261
- 'delete' => sprintf( '<a href="?page=%s&action=%s&post=%s&_wpnonce=%s">' . __( 'Delete', 'top-10' ) . '</a>', esc_attr( $_REQUEST['page'] ), 'delete', absint( $item['ID'] ), $delete_nonce ),
262
  );
263
 
264
  // Return the title contents.
@@ -411,11 +416,12 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
411
  // Detect when a bulk action is being triggered...
412
  if ( 'delete' === $this->current_action() ) {
413
  // In our file that handles the request, verify the nonce.
414
- $nonce = esc_attr( $_REQUEST['_wpnonce'] );
415
- if ( ! wp_verify_nonce( $nonce, 'tptn_delete_entry' ) ) {
416
- die( esc_html__( 'Are you sure you want to do this', 'top-10' ) );
 
417
  } else {
418
- self::delete_post_count( absint( $_GET['post'] ) );
419
  }
420
  }
421
 
@@ -423,7 +429,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
423
  if ( ( isset( $_REQUEST['action'] ) && 'bulk-delete' === $_REQUEST['action'] )
424
  || ( isset( $_REQUEST['action2'] ) && 'bulk-delete' === $_REQUEST['action2'] )
425
  ) {
426
- $delete_ids = sanitize_text_field( wp_unslash( $_REQUEST['bulk-delete'] ) );
427
 
428
  // Loop over the array of record IDs and delete them.
429
  foreach ( $delete_ids as $id ) {
@@ -442,15 +448,21 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
442
  <div class="alignleft actions">
443
  <?php
444
  if ( 'top' === $which ) {
 
 
 
 
 
 
 
 
 
445
  $post_types = get_post_types(
446
  array(
447
  'public' => true,
448
  )
449
  );
450
- $all = array(
451
- 'all' => 'All',
452
- );
453
- $post_types = $all + $post_types;
454
 
455
  if ( $post_types ) {
456
 
@@ -458,7 +470,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
458
 
459
  foreach ( $post_types as $post_type ) {
460
  $selected = '';
461
- if ( isset( $_REQUEST['post-type-filter'] ) && $_REQUEST['post-type-filter'] === $post_type ) {
462
  $selected = ' selected = "selected"';
463
  }
464
  ?>
@@ -468,139 +480,18 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
468
 
469
  echo '</select>';
470
 
471
- submit_button(
472
- __( 'Filter', 'top-10' ),
473
- 'button',
474
- 'filter_action',
475
- false,
476
- array(
477
- 'id' => 'top-10-query-submit',
478
- )
479
- );
480
  }
481
- }
482
- ?>
483
- </div>
484
- <?php
485
- }
486
- }
487
-
488
- /**
489
- * Top_Ten_Statistics class.
490
- */
491
- class Top_Ten_Statistics {
492
 
493
- /**
494
- * Class instance.
495
- *
496
- * @var class Class instance.
497
- */
498
- public static $instance;
499
 
500
- /**
501
- * WP_List_Table object.
502
- *
503
- * @var object WP_List_Table object.
504
- */
505
- public $pop_posts_obj;
506
-
507
- /**
508
- * Class constructor.
509
- *
510
- * @access public
511
- * @return void
512
- */
513
- public function __construct() {
514
- add_filter( 'set-screen-option', array( __CLASS__, 'set_screen' ), 10, 3 );
515
- }
516
-
517
- /**
518
- * Set screen.
519
- *
520
- * @param string $status Status of screen.
521
- * @param string $option Option name.
522
- * @param string $value Option value.
523
- * @return string Value.
524
- */
525
- public static function set_screen( $status, $option, $value ) {
526
- return $value;
527
- }
528
-
529
- /**
530
- * Plugin settings page
531
- */
532
- public function plugin_settings_page() {
533
- $args = null;
534
  ?>
535
- <div class="wrap">
536
- <h1><?php esc_html_e( 'Top 10 Popular Posts', 'top-10' ); ?></h1>
537
-
538
- <div id="poststuff">
539
- <div id="post-body" class="metabox-holder columns-2">
540
- <div id="post-body-content">
541
- <div class="meta-box-sortables ui-sortable">
542
- <form method="get">
543
- <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
544
- <?php
545
- // If this is a search?
546
- if ( isset( $_REQUEST['s'] ) ) {
547
- $args['search'] = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) );
548
- }
549
- // If this is a post type filter?
550
- if ( isset( $_REQUEST['post-type-filter'] ) ) {
551
- $args['post-type-filter'] = sanitize_text_field( wp_unslash( $_REQUEST['post-type-filter'] ) );
552
- }
553
-
554
- $this->pop_posts_obj->prepare_items( $args );
555
-
556
- $this->pop_posts_obj->search_box( __( 'Search Table', 'top-10' ), 'top-10' );
557
-
558
- $this->pop_posts_obj->display();
559
- ?>
560
- </form>
561
- </div>
562
- </div>
563
- <div id="postbox-container-1" class="postbox-container">
564
- <div id="side-sortables" class="meta-box-sortables ui-sortable">
565
- <?php include_once 'sidebar.php'; ?>
566
- </div><!-- /side-sortables -->
567
- </div><!-- /postbox-container-1 -->
568
- </div><!-- /post-body -->
569
- <br class="clear" />
570
- </div><!-- /poststuff -->
571
  </div>
572
  <?php
573
  }
574
-
575
- /**
576
- * Screen options
577
- */
578
- public function screen_option() {
579
- $option = 'per_page';
580
- $args = array(
581
- 'label' => __( 'Popular Posts', 'top-10' ),
582
- 'default' => 20,
583
- 'option' => 'pop_posts_per_page',
584
- );
585
- add_screen_option( $option, $args );
586
- $this->pop_posts_obj = new Top_Ten_Statistics_Table();
587
- }
588
-
589
- /** Singleton instance */
590
- public static function get_instance() {
591
- if ( ! isset( self::$instance ) ) {
592
- self::$instance = new self();
593
- }
594
- return self::$instance;
595
- }
596
  }
597
 
598
- /**
599
- * Function to initialise stats page.
600
- *
601
- * @since 2.4.2
602
- */
603
- function tptn_stats_page() {
604
- Top_Ten_Statistics::get_instance();
605
- }
606
- add_action( 'plugins_loaded', 'tptn_stats_page' );
1
  <?php
2
  /**
3
+ * Top 10 Display statistics table.
4
  *
5
  * @package Top_Ten
6
+ * @subpackage Top_Ten_Statistics_Table
7
  * @author Ajay D'Souza <me@ajaydsouza.com>
8
  * @license GPL-2.0+
9
  * @link https://webberzone.com
10
+ * @copyright 2008-2019 Ajay D'Souza
11
  */
12
 
13
  /**** If this file is called directly, abort. ****/
27
  */
28
  class Top_Ten_Statistics_Table extends WP_List_Table {
29
 
30
+ /**
31
+ * Holds the post type array elements for translation.
32
+ *
33
+ * @var array
34
+ */
35
+ public $all_post_type;
36
+
37
  /**
38
  * Class constructor.
39
  */
44
  'plural' => __( 'popular_posts', 'top-10' ), // plural name of the listed records.
45
  )
46
  );
47
+ $this->all_post_type = array(
48
+ 'all' => __( 'All post types', 'top-10' ),
49
+ );
50
  }
51
 
52
  /**
58
  *
59
  * @return array Array of popular posts
60
  */
61
+ public function get_popular_posts( $per_page = 5, $page_number = 1, $args = null ) {
62
 
63
  global $wpdb;
64
 
65
  $blog_id = get_current_blog_id();
66
 
67
+ $from_date = tptn_get_from_date( $args['post-date-filter'] );
 
 
 
 
 
 
 
 
68
 
69
  /* Start creating the SQL */
70
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily AS ttd';
83
 
84
  // Create the JOIN clause.
85
  $join = " INNER JOIN {$wpdb->posts} ON ttt.postnumber=ID ";
86
+ $join .= $wpdb->prepare(
87
  " LEFT JOIN (
88
+ SELECT * FROM {$table_name_daily} " . // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
89
+ 'WHERE DATE(ttd.dp_date) = DATE(%s)
90
  ) AS ttd
91
  ON ttt.postnumber=ttd.postnumber
92
+ ',
93
  $from_date
94
  );
95
 
104
  }
105
 
106
  /* If post filter argument is set, do a search for it. */
107
+ if ( isset( $args['post-type-filter'] ) && $this->all_post_type['all'] !== $args['post-type-filter'] ) {
108
  $where .= $wpdb->prepare( " AND $wpdb->posts.post_type = %s ", $args['post-type-filter'] );
109
  }
110
 
114
  // Create the base ORDER BY clause.
115
  $orderby = ' total_count DESC ';
116
 
117
+ if ( ! empty( $_REQUEST['orderby'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
118
+ $orderby = sanitize_text_field( wp_unslash( $_REQUEST['orderby'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
119
 
120
+ if ( ! in_array( $orderby, array( 'title', 'daily_count', 'total_count' ) ) ) { //phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
121
  $orderby = ' total_count ';
122
  }
123
 
124
+ if ( ! empty( $_REQUEST['order'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
125
+ $order = sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
126
 
127
+ if ( in_array( $order, array( 'asc', 'ASC', 'desc', 'DESC' ) ) ) { //phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
128
  $orderby .= ' ' . $order;
129
  } else {
130
  $orderby .= ' DESC';
144
 
145
  $sql = "SELECT $fields FROM {$table_name} $join WHERE 1=1 $where $groupby $orderby $limits";
146
 
147
+ $result = $wpdb->get_results( $sql, 'ARRAY_A' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
148
 
149
  return $result;
150
 
159
  public static function delete_post_count( $id ) {
160
  global $wpdb;
161
 
162
+ $wpdb->delete( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
163
  "{$wpdb->base_prefix}top_ten",
164
  array(
165
  'postnumber' => $id,
166
  ),
167
  array( '%d' )
168
  );
169
+ $wpdb->delete( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
170
  "{$wpdb->base_prefix}top_ten_daily",
171
  array(
172
  'postnumber' => $id,
181
  * @param string $args Array of arguments.
182
  * @return null|string null|string
183
  */
184
+ public function record_count( $args = null ) {
185
+
186
  global $wpdb;
187
 
188
  $sql = $wpdb->prepare(
199
  $sql .= $wpdb->prepare( " AND $wpdb->posts.post_title LIKE %s ", '%' . $wpdb->esc_like( $args['search'] ) . '%' );
200
  }
201
 
202
+ if ( isset( $args['post-type-filter'] ) && $this->all_post_type['all'] !== $args['post-type-filter'] ) {
203
  $sql .= $wpdb->prepare( " AND $wpdb->posts.post_type = %s ", $args['post-type-filter'] );
204
  }
205
 
206
+ return $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
207
  }
208
 
209
  /**
228
  return $item[ $column_name ];
229
  case 'total_count':
230
  case 'daily_count':
231
+ return tptn_number_format_i18n( absint( $item[ $column_name ] ) );
232
  default:
233
+ // Show the whole array for troubleshooting purposes.
234
+ return print_r( $item, true ); //phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r
235
  }
236
  }
237
 
258
  public function column_title( $item ) {
259
 
260
  $delete_nonce = wp_create_nonce( 'tptn_delete_entry' );
261
+ $page = isset( $_REQUEST['page'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
262
 
263
  $actions = array(
264
  'view' => sprintf( '<a href="%s" target="_blank">' . __( 'View', 'top-10' ) . '</a>', get_permalink( $item['ID'] ) ),
265
  'edit' => sprintf( '<a href="%s">' . __( 'Edit', 'top-10' ) . '</a>', get_edit_post_link( $item['ID'] ) ),
266
+ 'delete' => sprintf( '<a href="?page=%s&action=%s&post=%s&_wpnonce=%s">' . __( 'Delete', 'top-10' ) . '</a>', esc_attr( $page ), 'delete', absint( $item['ID'] ), $delete_nonce ),
267
  );
268
 
269
  // Return the title contents.
416
  // Detect when a bulk action is being triggered...
417
  if ( 'delete' === $this->current_action() ) {
418
  // In our file that handles the request, verify the nonce.
419
+ $postid = isset( $_GET['post'] ) ? absint( $_GET['post'] ) : 0;
420
+
421
+ if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), 'tptn_delete_entry' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
422
+ self::delete_post_count( $postid );
423
  } else {
424
+ die( esc_html__( 'Are you sure you want to do this', 'top-10' ) );
425
  }
426
  }
427
 
429
  if ( ( isset( $_REQUEST['action'] ) && 'bulk-delete' === $_REQUEST['action'] )
430
  || ( isset( $_REQUEST['action2'] ) && 'bulk-delete' === $_REQUEST['action2'] )
431
  ) {
432
+ $delete_ids = isset( $_REQUEST['bulk-delete'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['bulk-delete'] ) ) : array();
433
 
434
  // Loop over the array of record IDs and delete them.
435
  foreach ( $delete_ids as $id ) {
448
  <div class="alignleft actions">
449
  <?php
450
  if ( 'top' === $which ) {
451
+ ob_start();
452
+
453
+ // Add date selector.
454
+ $current_time = current_time( 'timestamp', 0 );
455
+ $current_date = gmdate( 'd M Y', $current_time );
456
+
457
+ $post_date = isset( $_REQUEST['post-date-filter'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post-date-filter'] ) ) : $current_date; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
458
+ echo '<input type="text" id="datepicker" class="datepicker" name="post-date-filter" value="' . esc_attr( $post_date ) . '" />';
459
+
460
  $post_types = get_post_types(
461
  array(
462
  'public' => true,
463
  )
464
  );
465
+ $post_types = $this->all_post_type + $post_types;
 
 
 
466
 
467
  if ( $post_types ) {
468
 
470
 
471
  foreach ( $post_types as $post_type ) {
472
  $selected = '';
473
+ if ( isset( $_REQUEST['post-type-filter'] ) && $_REQUEST['post-type-filter'] === $post_type ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
474
  $selected = ' selected = "selected"';
475
  }
476
  ?>
480
 
481
  echo '</select>';
482
 
 
 
 
 
 
 
 
 
 
483
  }
 
 
 
 
 
 
 
 
 
 
 
484
 
485
+ $output = ob_get_clean();
 
 
 
 
 
486
 
487
+ if ( ! empty( $output ) ) {
488
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
489
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'top-10-query-submit' ) );
490
+ }
491
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  </div>
494
  <?php
495
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  }
497
 
 
 
 
 
 
 
 
 
 
includes/admin/class-top-ten-statistics.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Top 10 Display statistics page.
4
+ *
5
+ * @package Top_Ten
6
+ * @subpackage Top_Ten_Statistics
7
+ * @author Ajay D'Souza <me@ajaydsouza.com>
8
+ * @license GPL-2.0+
9
+ * @link https://webberzone.com
10
+ * @copyright 2008-2019 Ajay D'Souza
11
+ */
12
+
13
+ /**** If this file is called directly, abort. ****/
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+
19
+ if ( ! class_exists( 'WP_List_Table' ) ) {
20
+ require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
21
+ }
22
+
23
+ /**
24
+ * Top_Ten_Statistics class.
25
+ */
26
+ class Top_Ten_Statistics {
27
+
28
+ /**
29
+ * Class instance.
30
+ *
31
+ * @var class Class instance.
32
+ */
33
+ public static $instance;
34
+
35
+ /**
36
+ * WP_List_Table object.
37
+ *
38
+ * @var object WP_List_Table object.
39
+ */
40
+ public $pop_posts_obj;
41
+
42
+ /**
43
+ * Class constructor.
44
+ *
45
+ * @access public
46
+ * @return void
47
+ */
48
+ public function __construct() {
49
+ add_filter( 'set-screen-option', array( __CLASS__, 'set_screen' ), 10, 3 );
50
+ }
51
+
52
+ /**
53
+ * Set screen.
54
+ *
55
+ * @param string $status Status of screen.
56
+ * @param string $option Option name.
57
+ * @param string $value Option value.
58
+ * @return string Value.
59
+ */
60
+ public static function set_screen( $status, $option, $value ) {
61
+ return $value;
62
+ }
63
+
64
+ /**
65
+ * Plugin settings page
66
+ */
67
+ public function plugin_settings_page() {
68
+ $args = null;
69
+ if ( isset( $_REQUEST['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
70
+ $page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
71
+ }
72
+ ?>
73
+ <div class="wrap">
74
+ <h1><?php esc_html_e( 'Top 10 Popular Posts', 'top-10' ); ?></h1>
75
+
76
+ <div id="poststuff">
77
+ <div id="post-body" class="metabox-holder columns-2">
78
+ <div id="post-body-content">
79
+ <div class="meta-box-sortables ui-sortable">
80
+ <form method="get">
81
+ <input type="hidden" name="page" value="<?php echo esc_attr( $page ); ?>" />
82
+ <?php
83
+ // If this is a search?
84
+ if ( isset( $_REQUEST['s'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
85
+ $args['search'] = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
86
+ }
87
+ // If this is a post type filter?
88
+ if ( isset( $_REQUEST['post-type-filter'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
89
+ $args['post-type-filter'] = sanitize_text_field( wp_unslash( $_REQUEST['post-type-filter'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
90
+ }
91
+
92
+ // If this is a post date filter?
93
+ if ( isset( $_REQUEST['post-date-filter'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
94
+ $args['post-date-filter'] = sanitize_text_field( wp_unslash( $_REQUEST['post-date-filter'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
95
+ }
96
+
97
+ $this->pop_posts_obj->prepare_items( $args );
98
+
99
+ $this->pop_posts_obj->search_box( __( 'Search Table', 'top-10' ), 'top-10' );
100
+
101
+ $this->pop_posts_obj->display();
102
+ ?>
103
+ </form>
104
+ </div>
105
+ </div>
106
+ <div id="postbox-container-1" class="postbox-container">
107
+ <div id="side-sortables" class="meta-box-sortables ui-sortable">
108
+ <?php include_once 'sidebar.php'; ?>
109
+ </div><!-- /side-sortables -->
110
+ </div><!-- /postbox-container-1 -->
111
+ </div><!-- /post-body -->
112
+ <br class="clear" />
113
+ </div><!-- /poststuff -->
114
+ </div>
115
+ <?php
116
+ }
117
+
118
+ /**
119
+ * Screen options
120
+ */
121
+ public function screen_option() {
122
+ $option = 'per_page';
123
+ $args = array(
124
+ 'label' => __( 'Popular Posts', 'top-10' ),
125
+ 'default' => 20,
126
+ 'option' => 'pop_posts_per_page',
127
+ );
128
+ add_screen_option( $option, $args );
129
+ $this->pop_posts_obj = new Top_Ten_Statistics_Table();
130
+ }
131
+
132
+ /** Singleton instance */
133
+ public static function get_instance() {
134
+ if ( ! isset( self::$instance ) ) {
135
+ self::$instance = new self();
136
+ }
137
+ return self::$instance;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Function to initialise stats page.
143
+ *
144
+ * @since 2.4.2
145
+ */
146
+ function tptn_stats_page() {
147
+ Top_Ten_Statistics::get_instance();
148
+ }
149
+ add_action( 'plugins_loaded', 'tptn_stats_page' );
includes/admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
includes/admin/css/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
includes/admin/css/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
includes/admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
includes/admin/css/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
includes/admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
includes/admin/css/images/ui-icons_222222_256x240.png ADDED
Binary file
includes/admin/css/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
includes/admin/css/images/ui-icons_454545_256x240.png ADDED
Binary file
includes/admin/css/images/ui-icons_888888_256x240.png ADDED
Binary file
includes/admin/css/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
includes/admin/css/top-10-admin.css ADDED
@@ -0,0 +1,669 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.12.1 - 2019-02-05
2
+ * http://jqueryui.com
3
+ * Includes: core.css, datepicker.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=smoothness&cornerRadiusShadow=8px&offsetLeftShadow=-8px&offsetTopShadow=-8px&thicknessShadow=8px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=aaaaaa&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cd0a0a&fcError=cd0a0a&borderColorError=cd0a0a&bgImgOpacityError=95&bgTextureError=glass&bgColorError=fef1ec&iconColorHighlight=2e83ff&fcHighlight=363636&borderColorHighlight=fcefa1&bgImgOpacityHighlight=55&bgTextureHighlight=glass&bgColorHighlight=fbf9ee&iconColorActive=454545&fcActive=212121&borderColorActive=aaaaaa&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=454545&fcHover=212121&borderColorHover=999999&bgImgOpacityHover=75&bgTextureHover=glass&bgColorHover=dadada&iconColorDefault=888888&fcDefault=555555&borderColorDefault=d3d3d3&bgImgOpacityDefault=75&bgTextureDefault=glass&bgColorDefault=e6e6e6&iconColorContent=222222&fcContent=222222&borderColorContent=aaaaaa&bgImgOpacityContent=75&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=222222&fcHeader=222222&borderColorHeader=aaaaaa&bgImgOpacityHeader=75&bgTextureHeader=highlight_soft&bgColorHeader=cccccc&cornerRadius=4px&fsDefault=1.1em&fwDefault=normal&ffDefault=Verdana%2CArial%2Csans-serif
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-zfix {
42
+ width: 100%;
43
+ height: 100%;
44
+ top: 0;
45
+ left: 0;
46
+ position: absolute;
47
+ opacity: 0;
48
+ filter:Alpha(Opacity=0); /* support: IE8 */
49
+ }
50
+
51
+ .ui-front {
52
+ z-index: 100;
53
+ }
54
+
55
+
56
+ /* Interaction Cues
57
+ ----------------------------------*/
58
+ .ui-state-disabled {
59
+ cursor: default !important;
60
+ pointer-events: none;
61
+ }
62
+
63
+
64
+ /* Icons
65
+ ----------------------------------*/
66
+ .ui-icon {
67
+ display: inline-block;
68
+ vertical-align: middle;
69
+ margin-top: -.25em;
70
+ position: relative;
71
+ text-indent: -99999px;
72
+ overflow: hidden;
73
+ background-repeat: no-repeat;
74
+ }
75
+
76
+ .ui-widget-icon-block {
77
+ left: 50%;
78
+ margin-left: -8px;
79
+ display: block;
80
+ }
81
+
82
+ /* Misc visuals
83
+ ----------------------------------*/
84
+
85
+ /* Overlays */
86
+ .ui-widget-overlay {
87
+ position: fixed;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ }
93
+ .ui-datepicker {
94
+ width: 17em;
95
+ padding: .2em .2em 0;
96
+ display: none;
97
+ }
98
+ .ui-datepicker .ui-datepicker-header {
99
+ position: relative;
100
+ padding: .2em 0;
101
+ }
102
+ .ui-datepicker .ui-datepicker-prev,
103
+ .ui-datepicker .ui-datepicker-next {
104
+ position: absolute;
105
+ top: 2px;
106
+ width: 1.8em;
107
+ height: 1.8em;
108
+ }
109
+ .ui-datepicker .ui-datepicker-prev-hover,
110
+ .ui-datepicker .ui-datepicker-next-hover {
111
+ top: 1px;
112
+ }
113
+ .ui-datepicker .ui-datepicker-prev {
114
+ left: 2px;
115
+ }
116
+ .ui-datepicker .ui-datepicker-next {
117
+ right: 2px;
118
+ }
119
+ .ui-datepicker .ui-datepicker-prev-hover {
120
+ left: 1px;
121
+ }
122
+ .ui-datepicker .ui-datepicker-next-hover {
123
+ right: 1px;
124
+ }
125
+ .ui-datepicker .ui-datepicker-prev span,
126
+ .ui-datepicker .ui-datepicker-next span {
127
+ display: block;
128
+ position: absolute;
129
+ left: 50%;
130
+ margin-left: -8px;
131
+ top: 50%;
132
+ margin-top: -8px;
133
+ }
134
+ .ui-datepicker .ui-datepicker-title {
135
+ margin: 0 2.3em;
136
+ line-height: 1.8em;
137
+ text-align: center;
138
+ }
139
+ .ui-datepicker .ui-datepicker-title select {
140
+ font-size: 1em;
141
+ margin: 1px 0;
142
+ }
143
+ .ui-datepicker select.ui-datepicker-month,
144
+ .ui-datepicker select.ui-datepicker-year {
145
+ width: 45%;
146
+ }
147
+ .ui-datepicker table {
148
+ width: 100%;
149
+ font-size: .9em;
150
+ border-collapse: collapse;
151
+ margin: 0 0 .4em;
152
+ }
153
+ .ui-datepicker th {
154
+ padding: .7em .3em;
155
+ text-align: center;
156
+ font-weight: bold;
157
+ border: 0;
158
+ }
159
+ .ui-datepicker td {
160
+ border: 0;
161
+ padding: 1px;
162
+ }
163
+ .ui-datepicker td span,
164
+ .ui-datepicker td a {
165
+ display: block;
166
+ padding: .2em;
167
+ text-align: right;
168
+ text-decoration: none;
169
+ }
170
+ .ui-datepicker .ui-datepicker-buttonpane {
171
+ background-image: none;
172
+ margin: .7em 0 0 0;
173
+ padding: 0 .2em;
174
+ border-left: 0;
175
+ border-right: 0;
176
+ border-bottom: 0;
177
+ }
178
+ .ui-datepicker .ui-datepicker-buttonpane button {
179
+ float: right;
180
+ margin: .5em .2em .4em;
181
+ cursor: pointer;
182
+ padding: .2em .6em .3em .6em;
183
+ width: auto;
184
+ overflow: visible;
185
+ }
186
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
187
+ float: left;
188
+ }
189
+
190
+ /* with multiple calendars */
191
+ .ui-datepicker.ui-datepicker-multi {
192
+ width: auto;
193
+ }
194
+ .ui-datepicker-multi .ui-datepicker-group {
195
+ float: left;
196
+ }
197
+ .ui-datepicker-multi .ui-datepicker-group table {
198
+ width: 95%;
199
+ margin: 0 auto .4em;
200
+ }
201
+ .ui-datepicker-multi-2 .ui-datepicker-group {
202
+ width: 50%;
203
+ }
204
+ .ui-datepicker-multi-3 .ui-datepicker-group {
205
+ width: 33.3%;
206
+ }
207
+ .ui-datepicker-multi-4 .ui-datepicker-group {
208
+ width: 25%;
209
+ }
210
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
211
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
212
+ border-left-width: 0;
213
+ }
214
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
215
+ clear: left;
216
+ }
217
+ .ui-datepicker-row-break {
218
+ clear: both;
219
+ width: 100%;
220
+ font-size: 0;
221
+ }
222
+
223
+ /* RTL support */
224
+ .ui-datepicker-rtl {
225
+ direction: rtl;
226
+ }
227
+ .ui-datepicker-rtl .ui-datepicker-prev {
228
+ right: 2px;
229
+ left: auto;
230
+ }
231
+ .ui-datepicker-rtl .ui-datepicker-next {
232
+ left: 2px;
233
+ right: auto;
234
+ }
235
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
236
+ right: 1px;
237
+ left: auto;
238
+ }
239
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
240
+ left: 1px;
241
+ right: auto;
242
+ }
243
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
244
+ clear: right;
245
+ }
246
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
247
+ float: left;
248
+ }
249
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
250
+ .ui-datepicker-rtl .ui-datepicker-group {
251
+ float: right;
252
+ }
253
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
254
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
255
+ border-right-width: 0;
256
+ border-left-width: 1px;
257
+ }
258
+
259
+ /* Icons */
260
+ .ui-datepicker .ui-icon {
261
+ display: block;
262
+ text-indent: -99999px;
263
+ overflow: hidden;
264
+ background-repeat: no-repeat;
265
+ left: .5em;
266
+ top: .3em;
267
+ }
268
+
269
+ .ui-datepicker {
270
+ border: 1px solid #aaaaaa;
271
+ background: #ffffff;
272
+ color: #222222;
273
+ }
274
+ .ui-datepicker a {
275
+ color: #222222;
276
+ }
277
+
278
+ /* Interaction states
279
+ ----------------------------------*/
280
+ .ui-state-default,
281
+ .ui-widget-content .ui-state-default,
282
+ .ui-widget-header .ui-state-default,
283
+ .ui-button,
284
+
285
+ /* We use html here because we need a greater specificity to make sure disabled
286
+ works properly when clicked or hovered */
287
+ html .ui-button.ui-state-disabled:hover,
288
+ html .ui-button.ui-state-disabled:active {
289
+ border: 1px solid #d3d3d3;
290
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
291
+ font-weight: normal;
292
+ color: #555555;
293
+ }
294
+ .ui-state-default a,
295
+ .ui-state-default a:link,
296
+ .ui-state-default a:visited,
297
+ a.ui-button,
298
+ a:link.ui-button,
299
+ a:visited.ui-button,
300
+ .ui-button {
301
+ color: #555555;
302
+ text-decoration: none;
303
+ }
304
+ .ui-state-hover,
305
+ .ui-widget-content .ui-state-hover,
306
+ .ui-widget-header .ui-state-hover,
307
+ .ui-state-focus,
308
+ .ui-widget-content .ui-state-focus,
309
+ .ui-widget-header .ui-state-focus,
310
+ .ui-button:hover,
311
+ .ui-button:focus {
312
+ border: 1px solid #999999;
313
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
314
+ font-weight: normal;
315
+ color: #212121;
316
+ }
317
+ .ui-state-hover a,
318
+ .ui-state-hover a:hover,
319
+ .ui-state-hover a:link,
320
+ .ui-state-hover a:visited,
321
+ .ui-state-focus a,
322
+ .ui-state-focus a:hover,
323
+ .ui-state-focus a:link,
324
+ .ui-state-focus a:visited,
325
+ a.ui-button:hover,
326
+ a.ui-button:focus {
327
+ color: #212121;
328
+ text-decoration: none;
329
+ }
330
+
331
+ .ui-visual-focus {
332
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
333
+ }
334
+ .ui-state-active,
335
+ .ui-widget-content .ui-state-active,
336
+ .ui-widget-header .ui-state-active,
337
+ a.ui-button:active,
338
+ .ui-button:active,
339
+ .ui-button.ui-state-active:hover {
340
+ border: 1px solid #aaaaaa;
341
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
342
+ font-weight: normal;
343
+ color: #212121;
344
+ }
345
+ .ui-icon-background,
346
+ .ui-state-active .ui-icon-background {
347
+ border: #aaaaaa;
348
+ background-color: #212121;
349
+ }
350
+ .ui-state-active a,
351
+ .ui-state-active a:link,
352
+ .ui-state-active a:visited {
353
+ color: #212121;
354
+ text-decoration: none;
355
+ }
356
+
357
+ /* Interaction Cues
358
+ ----------------------------------*/
359
+ .ui-state-highlight,
360
+ .ui-widget-content .ui-state-highlight,
361
+ .ui-widget-header .ui-state-highlight {
362
+ border: 1px solid #fcefa1;
363
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
364
+ color: #363636;
365
+ }
366
+ .ui-state-checked {
367
+ border: 1px solid #fcefa1;
368
+ background: #fbf9ee;
369
+ }
370
+ .ui-state-highlight a,
371
+ .ui-widget-content .ui-state-highlight a,
372
+ .ui-widget-header .ui-state-highlight a {
373
+ color: #363636;
374
+ }
375
+ .ui-state-error,
376
+ .ui-widget-content .ui-state-error,
377
+ .ui-widget-header .ui-state-error {
378
+ border: 1px solid #cd0a0a;
379
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
380
+ color: #cd0a0a;
381
+ }
382
+ .ui-state-error a,
383
+ .ui-widget-content .ui-state-error a,
384
+ .ui-widget-header .ui-state-error a {
385
+ color: #cd0a0a;
386
+ }
387
+ .ui-state-error-text,
388
+ .ui-widget-content .ui-state-error-text,
389
+ .ui-widget-header .ui-state-error-text {
390
+ color: #cd0a0a;
391
+ }
392
+ .ui-priority-primary,
393
+ .ui-widget-content .ui-priority-primary,
394
+ .ui-widget-header .ui-priority-primary {
395
+ font-weight: bold;
396
+ }
397
+ .ui-priority-secondary,
398
+ .ui-widget-content .ui-priority-secondary,
399
+ .ui-widget-header .ui-priority-secondary {
400
+ opacity: .7;
401
+ filter:Alpha(Opacity=70); /* support: IE8 */
402
+ font-weight: normal;
403
+ }
404
+ .ui-state-disabled,
405
+ .ui-widget-content .ui-state-disabled,
406
+ .ui-widget-header .ui-state-disabled {
407
+ opacity: .35;
408
+ filter:Alpha(Opacity=35); /* support: IE8 */
409
+ background-image: none;
410
+ }
411
+ .ui-state-disabled .ui-icon {
412
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
413
+ }
414
+
415
+ /* Icons
416
+ ----------------------------------*/
417
+
418
+ /* states and images */
419
+ .ui-icon {
420
+ width: 16px;
421
+ height: 16px;
422
+ }
423
+ .ui-icon,
424
+ .ui-widget-content .ui-icon {
425
+ background-image: url("images/ui-icons_222222_256x240.png");
426
+ }
427
+ .ui-widget-header .ui-icon {
428
+ background-image: url("images/ui-icons_222222_256x240.png");
429
+ }
430
+ .ui-state-hover .ui-icon,
431
+ .ui-state-focus .ui-icon,
432
+ .ui-button:hover .ui-icon,
433
+ .ui-button:focus .ui-icon {
434
+ background-image: url("images/ui-icons_454545_256x240.png");
435
+ }
436
+ .ui-state-active .ui-icon,
437
+ .ui-button:active .ui-icon {
438
+ background-image: url("images/ui-icons_454545_256x240.png");
439
+ }
440
+ .ui-state-highlight .ui-icon,
441
+ .ui-button .ui-state-highlight.ui-icon {
442
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
443
+ }
444
+ .ui-state-error .ui-icon,
445
+ .ui-state-error-text .ui-icon {
446
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
447
+ }
448
+ .ui-button .ui-icon {
449
+ background-image: url("images/ui-icons_888888_256x240.png");
450
+ }
451
+
452
+ /* positioning */
453
+ .ui-icon-blank { background-position: 16px 16px; }
454
+ .ui-icon-caret-1-n { background-position: 0 0; }
455
+ .ui-icon-caret-1-ne { background-position: -16px 0; }
456
+ .ui-icon-caret-1-e { background-position: -32px 0; }
457
+ .ui-icon-caret-1-se { background-position: -48px 0; }
458
+ .ui-icon-caret-1-s { background-position: -65px 0; }
459
+ .ui-icon-caret-1-sw { background-position: -80px 0; }
460
+ .ui-icon-caret-1-w { background-position: -96px 0; }
461
+ .ui-icon-caret-1-nw { background-position: -112px 0; }
462
+ .ui-icon-caret-2-n-s { background-position: -128px 0; }
463
+ .ui-icon-caret-2-e-w { background-position: -144px 0; }
464
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
465
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
466
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
467
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
468
+ .ui-icon-triangle-1-s { background-position: -65px -16px; }
469
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
470
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
471
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
472
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
473
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
474
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
475
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
476
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
477
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
478
+ .ui-icon-arrow-1-s { background-position: -65px -32px; }
479
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
480
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
481
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
482
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
483
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
484
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
485
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
486
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
487
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
488
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
489
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
490
+ .ui-icon-arrowthick-1-n { background-position: 1px -48px; }
491
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
492
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
493
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
494
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
495
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
496
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
497
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
498
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
499
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
500
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
501
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
502
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
503
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
504
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
505
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
506
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
507
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
508
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
509
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
510
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
511
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
512
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
513
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
514
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
515
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
516
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
517
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
518
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
519
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
520
+ .ui-icon-extlink { background-position: -32px -80px; }
521
+ .ui-icon-newwin { background-position: -48px -80px; }
522
+ .ui-icon-refresh { background-position: -64px -80px; }
523
+ .ui-icon-shuffle { background-position: -80px -80px; }
524
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
525
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
526
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
527
+ .ui-icon-folder-open { background-position: -16px -96px; }
528
+ .ui-icon-document { background-position: -32px -96px; }
529
+ .ui-icon-document-b { background-position: -48px -96px; }
530
+ .ui-icon-note { background-position: -64px -96px; }
531
+ .ui-icon-mail-closed { background-position: -80px -96px; }
532
+ .ui-icon-mail-open { background-position: -96px -96px; }
533
+ .ui-icon-suitcase { background-position: -112px -96px; }
534
+ .ui-icon-comment { background-position: -128px -96px; }
535
+ .ui-icon-person { background-position: -144px -96px; }
536
+ .ui-icon-print { background-position: -160px -96px; }
537
+ .ui-icon-trash { background-position: -176px -96px; }
538
+ .ui-icon-locked { background-position: -192px -96px; }
539
+ .ui-icon-unlocked { background-position: -208px -96px; }
540
+ .ui-icon-bookmark { background-position: -224px -96px; }
541
+ .ui-icon-tag { background-position: -240px -96px; }
542
+ .ui-icon-home { background-position: 0 -112px; }
543
+ .ui-icon-flag { background-position: -16px -112px; }
544
+ .ui-icon-calendar { background-position: -32px -112px; }
545
+ .ui-icon-cart { background-position: -48px -112px; }
546
+ .ui-icon-pencil { background-position: -64px -112px; }
547
+ .ui-icon-clock { background-position: -80px -112px; }
548
+ .ui-icon-disk { background-position: -96px -112px; }
549
+ .ui-icon-calculator { background-position: -112px -112px; }
550
+ .ui-icon-zoomin { background-position: -128px -112px; }
551
+ .ui-icon-zoomout { background-position: -144px -112px; }
552
+ .ui-icon-search { background-position: -160px -112px; }
553
+ .ui-icon-wrench { background-position: -176px -112px; }
554
+ .ui-icon-gear { background-position: -192px -112px; }
555
+ .ui-icon-heart { background-position: -208px -112px; }
556
+ .ui-icon-star { background-position: -224px -112px; }
557
+ .ui-icon-link { background-position: -240px -112px; }
558
+ .ui-icon-cancel { background-position: 0 -128px; }
559
+ .ui-icon-plus { background-position: -16px -128px; }
560
+ .ui-icon-plusthick { background-position: -32px -128px; }
561
+ .ui-icon-minus { background-position: -48px -128px; }
562
+ .ui-icon-minusthick { background-position: -64px -128px; }
563
+ .ui-icon-close { background-position: -80px -128px; }
564
+ .ui-icon-closethick { background-position: -96px -128px; }
565
+ .ui-icon-key { background-position: -112px -128px; }
566
+ .ui-icon-lightbulb { background-position: -128px -128px; }
567
+ .ui-icon-scissors { background-position: -144px -128px; }
568
+ .ui-icon-clipboard { background-position: -160px -128px; }
569
+ .ui-icon-copy { background-position: -176px -128px; }
570
+ .ui-icon-contact { background-position: -192px -128px; }
571
+ .ui-icon-image { background-position: -208px -128px; }
572
+ .ui-icon-video { background-position: -224px -128px; }
573
+ .ui-icon-script { background-position: -240px -128px; }
574
+ .ui-icon-alert { background-position: 0 -144px; }
575
+ .ui-icon-info { background-position: -16px -144px; }
576
+ .ui-icon-notice { background-position: -32px -144px; }
577
+ .ui-icon-help { background-position: -48px -144px; }
578
+ .ui-icon-check { background-position: -64px -144px; }
579
+ .ui-icon-bullet { background-position: -80px -144px; }
580
+ .ui-icon-radio-on { background-position: -96px -144px; }
581
+ .ui-icon-radio-off { background-position: -112px -144px; }
582
+ .ui-icon-pin-w { background-position: -128px -144px; }
583
+ .ui-icon-pin-s { background-position: -144px -144px; }
584
+ .ui-icon-play { background-position: 0 -160px; }
585
+ .ui-icon-pause { background-position: -16px -160px; }
586
+ .ui-icon-seek-next { background-position: -32px -160px; }
587
+ .ui-icon-seek-prev { background-position: -48px -160px; }
588
+ .ui-icon-seek-end { background-position: -64px -160px; }
589
+ .ui-icon-seek-start { background-position: -80px -160px; }
590
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
591
+ .ui-icon-seek-first { background-position: -80px -160px; }
592
+ .ui-icon-stop { background-position: -96px -160px; }
593
+ .ui-icon-eject { background-position: -112px -160px; }
594
+ .ui-icon-volume-off { background-position: -128px -160px; }
595
+ .ui-icon-volume-on { background-position: -144px -160px; }
596
+ .ui-icon-power { background-position: 0 -176px; }
597
+ .ui-icon-signal-diag { background-position: -16px -176px; }
598
+ .ui-icon-signal { background-position: -32px -176px; }
599
+ .ui-icon-battery-0 { background-position: -48px -176px; }
600
+ .ui-icon-battery-1 { background-position: -64px -176px; }
601
+ .ui-icon-battery-2 { background-position: -80px -176px; }
602
+ .ui-icon-battery-3 { background-position: -96px -176px; }
603
+ .ui-icon-circle-plus { background-position: 0 -192px; }
604
+ .ui-icon-circle-minus { background-position: -16px -192px; }
605
+ .ui-icon-circle-close { background-position: -32px -192px; }
606
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
607
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
608
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
609
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
610
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
611
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
612
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
613
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
614
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
615
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
616
+ .ui-icon-circle-check { background-position: -208px -192px; }
617
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
618
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
619
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
620
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
621
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
622
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
623
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
624
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
625
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
626
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
627
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
628
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
629
+
630
+
631
+ /* Misc visuals
632
+ ----------------------------------*/
633
+
634
+ /* Corner radius */
635
+ .ui-corner-all,
636
+ .ui-corner-top,
637
+ .ui-corner-left,
638
+ .ui-corner-tl {
639
+ border-top-left-radius: 4px;
640
+ }
641
+ .ui-corner-all,
642
+ .ui-corner-top,
643
+ .ui-corner-right,
644
+ .ui-corner-tr {
645
+ border-top-right-radius: 4px;
646
+ }
647
+ .ui-corner-all,
648
+ .ui-corner-bottom,
649
+ .ui-corner-left,
650
+ .ui-corner-bl {
651
+ border-bottom-left-radius: 4px;
652
+ }
653
+ .ui-corner-all,
654
+ .ui-corner-bottom,
655
+ .ui-corner-right,
656
+ .ui-corner-br {
657
+ border-bottom-right-radius: 4px;
658
+ }
659
+
660
+ /* Overlays */
661
+ .ui-widget-overlay {
662
+ background: #aaaaaa;
663
+ opacity: .3;
664
+ filter: Alpha(Opacity=30); /* support: IE8 */
665
+ }
666
+ .ui-widget-shadow {
667
+ -webkit-box-shadow: -8px -8px 8px #aaaaaa;
668
+ box-shadow: -8px -8px 8px #aaaaaa;
669
+ }
includes/admin/css/top-10-admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-datepicker{border:1px solid #aaa;background:#fff;color:#222}.ui-datepicker a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-button .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa}
includes/admin/default-settings.php ADDED
@@ -0,0 +1,843 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Default settings.
4
+ *
5
+ * Functions to register the default settings of the plugin.
6
+ *
7
+ * @link https://webberzone.com
8
+ * @since 2.6.0
9
+ *
10
+ * @package Top 10
11
+ * @subpackage Admin/Register_Settings
12
+ */
13
+
14
+ // If this file is called directly, abort.
15
+ if ( ! defined( 'WPINC' ) ) {
16
+ die;
17
+ }
18
+
19
+
20
+ /**
21
+ * Retrieve the array of plugin settings
22
+ *
23
+ * @since 2.5.0
24
+ *
25
+ * @return array Settings array
26
+ */
27
+ function tptn_get_registered_settings() {
28
+
29
+ $tptn_settings = array(
30
+ 'general' => tptn_settings_general(),
31
+ 'counter' => tptn_settings_counter(),
32
+ 'list' => tptn_settings_list(),
33
+ 'thumbnail' => tptn_settings_thumbnail(),
34
+ 'styles' => tptn_settings_styles(),
35
+ 'maintenance' => tptn_settings_maintenance(),
36
+ );
37
+
38
+ /**
39
+ * Filters the settings array
40
+ *
41
+ * @since 2.5.0
42
+ *
43
+ * @param array $tptn_settings Settings array
44
+ */
45
+ return apply_filters( 'tptn_registered_settings', $tptn_settings );
46
+
47
+ }
48
+
49
+
50
+ /**
51
+ * Retrieve the array of General settings
52
+ *
53
+ * @since 2.6.0
54
+ *
55
+ * @return array General settings array
56
+ */
57
+ function tptn_settings_general() {
58
+
59
+ $settings = array(
60
+ 'trackers' => array(
61
+ 'id' => 'trackers',
62
+ 'name' => esc_html__( 'Enable trackers', 'top-10' ),
63
+ /* translators: 1: Code. */
64
+ 'desc' => '',
65
+ 'type' => 'multicheck',
66
+ 'default' => array(
67
+ 'overall' => 'overall',
68
+ 'daily' => 'daily',
69
+ ),
70
+ 'options' => array(
71
+ 'overall' => esc_html__( 'Overall', 'top-10' ),
72
+ 'daily' => esc_html__( 'Daily', 'top-10' ),
73
+ ),
74
+ ),
75
+ 'cache' => array(
76
+ 'id' => 'cache',
77
+ 'name' => esc_html__( 'Enable cache', 'top-10' ),
78
+ 'desc' => esc_html__( 'If activated, Top 10 will use the Transients API to cache the popular posts output for 1 hour.', 'top-10' ),
79
+ 'type' => 'checkbox',
80
+ 'options' => false,
81
+ ),
82
+ 'cache_time' => array(
83
+ 'id' => 'cache_time',
84
+ 'name' => esc_html__( 'Time to cache', 'top-10' ),
85
+ 'desc' => esc_html__( 'Enter the number of seconds to cache the output.', 'top-10' ),
86
+ 'type' => 'text',
87
+ 'options' => HOUR_IN_SECONDS,
88
+ ),
89
+ 'daily_midnight' => array(
90
+ 'id' => 'daily_midnight',
91
+ 'name' => esc_html__( 'Start daily counts from midnight', 'top-10' ),
92
+ 'desc' => esc_html__( 'Daily counter will display number of visits from midnight. This option is checked by default and mimics the way most normal counters work. Turning this off will allow you to use the hourly setting in the next option.', 'top-10' ),
93
+ 'type' => 'checkbox',
94
+ 'options' => true,
95
+ ),
96
+ 'range_desc' => array(
97
+ 'id' => 'range_desc',
98
+ 'name' => '<strong>' . esc_html__( 'Default custom period range', 'top-10' ) . '</strong>',
99
+ 'desc' => esc_html__( 'The next two options allow you to set the default range for the custom period. This was previously called the daily range. This can be overridden in the widget.', 'top-10' ),
100
+ 'type' => 'descriptive_text',
101
+ ),
102
+ 'daily_range' => array(
103
+ 'id' => 'daily_range',
104
+ 'name' => esc_html__( 'Day(s)', 'top-10' ),
105
+ 'desc' => '',
106
+ 'type' => 'number',
107
+ 'options' => '1',
108
+ 'min' => '0',
109
+ 'size' => 'small',
110
+ ),
111
+ 'hour_range' => array(
112
+ 'id' => 'hour_range',
113
+ 'name' => esc_html__( 'Hour(s)', 'top-10' ),
114
+ 'desc' => '',
115
+ 'type' => 'number',
116
+ 'options' => '0',
117
+ 'min' => '0',
118
+ 'max' => '23',
119
+ 'size' => 'small',
120
+ ),
121
+ 'uninstall_clean_options' => array(
122
+ 'id' => 'uninstall_clean_options',
123
+ 'name' => esc_html__( 'Delete options on uninstall', 'top-10' ),
124
+ 'desc' => esc_html__( 'If this is checked, all settings related to Top 10 are removed from the database if you choose to uninstall/delete the plugin.', 'top-10' ),
125
+ 'type' => 'checkbox',
126
+ 'options' => true,
127
+ ),
128
+ 'uninstall_clean_tables' => array(
129
+ 'id' => 'uninstall_clean_tables',
130
+ 'name' => esc_html__( 'Delete counter data on uninstall', 'top-10' ),
131
+ 'desc' => esc_html__( 'If this is checked, the tables containing the counter statistics are removed from the database if you choose to uninstall/delete the plugin. Keep this unchecked if you choose to reinstall the plugin and do not want to lose your counter data.', 'top-10' ),
132
+ 'type' => 'checkbox',
133
+ 'options' => false,
134
+ ),
135
+ 'show_metabox' => array(
136
+ 'id' => 'show_metabox',
137
+ 'name' => esc_html__( 'Show metabox', 'top-10' ),
138
+ 'desc' => esc_html__( 'This will add the Top 10 metabox on Edit Posts or Add New Posts screens. Also applies to Pages and Custom Post Types.', 'top-10' ),
139
+ 'type' => 'checkbox',
140
+ 'options' => true,
141
+ ),
142
+ 'show_metabox_admins' => array(
143
+ 'id' => 'show_metabox_admins',
144
+ 'name' => esc_html__( 'Limit meta box to Admins only', 'top-10' ),
145
+ 'desc' => esc_html__( 'If selected, the meta box will be hidden from anyone who is not an Admin. By default, Contributors and above will be able to see the meta box. Applies only if the above option is selected.', 'top-10' ),
146
+ 'type' => 'checkbox',
147
+ 'options' => false,
148
+ ),
149
+ 'show_credit' => array(
150
+ 'id' => 'show_credit',
151
+ 'name' => esc_html__( 'Link to Top 10 plugin page', 'top-10' ),
152
+ 'desc' => esc_html__( 'A no-follow link to the plugin homepage will be added as the last item of the popular posts.', 'top-10' ),
153
+ 'type' => 'checkbox',
154
+ 'options' => false,
155
+ ),
156
+ );
157
+
158
+ /**
159
+ * Filters the General settings array
160
+ *
161
+ * @since 2.6.0
162
+ *
163
+ * @param array $settings General settings array
164
+ */
165
+ return apply_filters( 'tptn_settings_general', $settings );
166
+ }
167
+
168
+
169
+ /**
170
+ * Retrieve the array of Counter settings
171
+ *
172
+ * @since 2.6.0
173
+ *
174
+ * @return array Counter settings array
175
+ */
176
+ function tptn_settings_counter() {
177
+
178
+ $settings = array(
179
+ 'add_to' => array(
180
+ 'id' => 'add_to',
181
+ 'name' => esc_html__( 'Display number of views on', 'top-10' ) . ':',
182
+ /* translators: 1: Code. */
183
+ 'desc' => sprintf( esc_html__( 'If you choose to disable this, please add %1$s to your template file where you want it displayed', 'top-10' ), "<code>&lt;?php if ( function_exists( 'echo_tptn_post_count' ) ) { echo_tptn_post_count(); } ?&gt;</code>" ),
184
+ 'type' => 'multicheck',
185
+ 'default' => array(
186
+ 'single' => 'single',
187
+ 'page' => 'page',
188
+ ),
189
+ 'options' => array(
190
+ 'single' => esc_html__( 'Posts', 'top-10' ),
191
+ 'page' => esc_html__( 'Pages', 'top-10' ),
192
+ 'home' => esc_html__( 'Home page', 'top-10' ),
193
+ 'feed' => esc_html__( 'Feeds', 'top-10' ),
194
+ 'category_archives' => esc_html__( 'Category archives', 'top-10' ),
195
+ 'tag_archives' => esc_html__( 'Tag archives', 'top-10' ),
196
+ 'other_archives' => esc_html__( 'Other archives', 'top-10' ),
197
+ ),
198
+ ),
199
+ 'count_disp_form' => array(
200
+ 'id' => 'count_disp_form',
201
+ 'name' => esc_html__( 'Format to display the post views', 'top-10' ),
202
+ /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
203
+ 'desc' => sprintf( esc_html__( 'Use %1$s to display the total count, %2$s for daily count and %3$s for overall counts across all posts. Default display is %4$s', 'top-10' ), '<code>%totalcount%</code>', '<code>%dailycount%</code>', '<code>%overallcount%</code>', '<code>(Visited %totalcount% times, %dailycount% visits today)</code>' ),
204
+ 'type' => 'textarea',
205
+ 'options' => '(Visited %totalcount% times, %dailycount% visits today)',
206
+ ),
207
+ 'count_disp_form_zero' => array(
208
+ 'id' => 'count_disp_form_zero',
209
+ 'name' => esc_html__( 'What do display when there are no visits?', 'top-10' ),
210
+ /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
211
+ 'desc' => esc_html__( "This text applies only when there are 0 hits for the post and it isn't a single page. e.g. if you display post views on the homepage or archives then this text will be used. To override this, just enter the same text as above option.", 'top-10' ),
212
+ 'type' => 'textarea',
213
+ 'options' => 'No visits yet',
214
+ ),
215
+ 'number_format_count' => array(
216
+ 'id' => 'number_format_count',
217
+ 'name' => esc_html__( 'Number format post count', 'top-10' ),
218
+ 'desc' => esc_html__( 'Activating this option will convert the post counts into a number format based on the locale', 'top-10' ),
219
+ 'type' => 'checkbox',
220
+ 'options' => true,
221
+ ),
222
+ 'dynamic_post_count' => array(
223
+ 'id' => 'dynamic_post_count',
224
+ 'name' => esc_html__( 'Always display latest post count', 'top-10' ),
225
+ 'desc' => esc_html__( 'This option uses JavaScript and will increase your page load time. Turn this off if you are not using caching plugins or are OK with displaying older cached counts.', 'top-10' ),
226
+ 'type' => 'checkbox',
227
+ 'options' => false,
228
+ ),
229
+ 'tracker_type' => array(
230
+ 'id' => 'tracker_type',
231
+ 'name' => esc_html__( 'Tracker type', 'top-10' ),
232
+ 'desc' => '',
233
+ 'type' => 'radiodesc',
234
+ 'default' => 'query_based',
235
+ 'options' => tptn_get_tracker_types(),
236
+ ),
237
+ 'tracker_all_pages' => array(
238
+ 'id' => 'tracker_all_pages',
239
+ 'name' => esc_html__( 'Load tracker on all pages', 'top-10' ),
240
+ 'desc' => esc_html__( 'This will load the tracker js on all pages. Helpful if you are running minification/concatenation plugins.', 'top-10' ),
241
+ 'type' => 'checkbox',
242
+ 'options' => false,
243
+ ),
244
+ 'track_users' => array(
245
+ 'id' => 'track_users',
246
+ 'name' => esc_html__( 'Track user groups', 'top-10' ) . ':',
247
+ 'desc' => esc_html__( 'Uncheck above to disable tracking if the current user falls into any one of these groups.', 'top-10' ),
248
+ 'type' => 'multicheck',
249
+ 'default' => array(
250
+ 'editors' => 'editors',
251
+ 'admins' => 'admins',
252
+ ),
253
+ 'options' => array(
254
+ 'authors' => esc_html__( 'Authors', 'top-10' ),
255
+ 'editors' => esc_html__( 'Editors', 'top-10' ),
256
+ 'admins' => esc_html__( 'Admins', 'top-10' ),
257
+ ),
258
+ ),
259
+ 'logged_in' => array(
260
+ 'id' => 'logged_in',
261
+ 'name' => esc_html__( 'Track logged-in users', 'top-10' ),
262
+ 'desc' => esc_html__( 'Uncheck to stop tracking logged in users. Only logged out visitors will be tracked if this is disabled. Unchecking this will override the above setting.', 'top-10' ),
263
+ 'type' => 'checkbox',
264
+ 'options' => true,
265
+ ),
266
+ 'exclude_on_post_ids' => array(
267
+ 'id' => 'exclude_on_post_ids',
268
+ 'name' => esc_html__( 'Exclude display on these post IDs', 'top-10' ),
269
+ 'desc' => esc_html__( 'Comma-separated list of post or page IDs to exclude displaying the top posts on. e.g. 188,320,500', 'top-10' ),
270
+ 'type' => 'numbercsv',
271
+ 'options' => '',
272
+ ),
273
+ 'pv_in_admin' => array(
274
+ 'id' => 'pv_in_admin',
275
+ 'name' => esc_html__( 'Page views in admin', 'top-10' ),
276
+ 'desc' => esc_html__( "Adds three columns called Total Views, Today's Views and Views to All Posts and All Pages. You can selectively disable these by pulling down the Screen Options from the top right of the respective screens.", 'top-10' ),
277
+ 'type' => 'checkbox',
278
+ 'options' => true,
279
+ ),
280
+ 'show_count_non_admins' => array(
281
+ 'id' => 'show_count_non_admins',
282
+ 'name' => esc_html__( 'Show views to non-admins', 'top-10' ),
283
+ 'desc' => esc_html__( "If you disable this then non-admins won't see the above columns or view the independent pages with the top posts.", 'top-10' ),
284
+ 'type' => 'checkbox',
285
+ 'options' => true,
286
+ ),
287
+ 'debug_mode' => array(
288
+ 'id' => 'debug_mode',
289
+ 'name' => esc_html__( 'Debug mode', 'top-10' ),
290
+ 'desc' => esc_html__( 'Setting this to true will force the tracker to display an output in the browser. This is useful if you are having issues and are seeking support.', 'top-10' ),
291
+ 'type' => 'checkbox',
292
+ 'options' => false,
293
+ ),
294
+ );
295
+
296
+ /**
297
+ * Filters the Counter settings array
298
+ *
299
+ * @since 2.6.0
300
+ *
301
+ * @param array $settings Counter settings array
302
+ */
303
+ return apply_filters( 'tptn_settings_counter', $settings );
304
+ }
305
+
306
+
307
+ /**
308
+ * Retrieve the array of List settings
309
+ *
310
+ * @since 2.6.0
311
+ *
312
+ * @return array List settings array
313
+ */
314
+ function tptn_settings_list() {
315
+
316
+ $settings = array(
317
+ 'limit' => array(
318
+ 'id' => 'limit',
319
+ 'name' => esc_html__( 'Number of posts to display', 'top-10' ),
320
+ 'desc' => esc_html__( 'Maximum number of posts that will be displayed in the list. This option is used if you don not specify the number of posts in the widget or shortcodes', 'top-10' ),
321
+ 'type' => 'number',
322
+ 'options' => '10',
323
+ 'size' => 'small',
324
+ ),
325
+ 'how_old' => array(
326
+ 'id' => 'how_old',
327
+ 'name' => esc_html__( 'Published age of posts', 'top-10' ),
328
+ 'desc' => esc_html__( 'This options allows you to only show posts that have been published within the above day range. Applies to both overall posts and daily posts lists. e.g. 365 days will only show posts published in the last year in the popular posts lists. Enter 0 for no restriction.', 'top-10' ),
329
+ 'type' => 'number',
330
+ 'options' => '0',
331
+ ),
332
+ 'post_types' => array(
333
+ 'id' => 'post_types',
334
+ 'name' => esc_html__( 'Post types to include', 'top-10' ),
335
+ 'desc' => esc_html__( 'At least one option should be selected above. Select which post types you want to include in the list of posts. This field can be overridden using a comma separated list of post types when using the manual display.', 'top-10' ),
336
+ 'type' => 'posttypes',
337
+ 'options' => 'post',
338
+ ),
339
+ 'exclude_post_ids' => array(
340
+ 'id' => 'exclude_post_ids',
341
+ 'name' => esc_html__( 'Post/page IDs to exclude', 'top-10' ),
342
+ 'desc' => esc_html__( 'Comma-separated list of post or page IDs to exclude from the list. e.g. 188,320,500', 'top-10' ),
343
+ 'type' => 'numbercsv',
344
+ 'options' => '',
345
+ ),
346
+ 'exclude_cat_slugs' => array(
347
+ 'id' => 'exclude_cat_slugs',
348
+ 'name' => esc_html__( 'Exclude Categories', 'top-10' ),
349
+ 'desc' => esc_html__( 'Comma separated list of category slugs. The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. Does not support custom taxonomies.', 'top-10' ),
350
+ 'type' => 'csv',
351
+ 'options' => '',
352
+ 'size' => 'large',
353
+ 'field_class' => 'category_autocomplete',
354
+ 'field_attributes' => array(
355
+ 'data-wp-taxonomy' => 'category',
356
+ ),
357
+ ),
358
+ 'exclude_categories' => array(
359
+ 'id' => 'exclude_categories',
360
+ 'name' => esc_html__( 'Exclude category IDs', 'top-10' ),
361
+ 'desc' => esc_html__( 'This is a readonly field that is automatically populated based on the above input when the settings are saved. These might differ from the IDs visible in the Categories page which use the term_id. Top 10 uses the term_taxonomy_id which is unique to this taxonomy.', 'top-10' ),
362
+ 'type' => 'text',
363
+ 'options' => '',
364
+ 'readonly' => true,
365
+ ),
366
+ 'customize_output_header' => array(
367
+ 'id' => 'customize_output_header',
368
+ 'name' => '<h3>' . esc_html__( 'Customize the output', 'top-10' ) . '</h3>',
369
+ 'desc' => '',
370
+ 'type' => 'header',
371
+ ),
372
+ 'title' => array(
373
+ 'id' => 'title',
374
+ 'name' => esc_html__( 'Heading of posts', 'top-10' ),
375
+ 'desc' => esc_html__( 'Displayed before the list of the posts as a the master heading', 'top-10' ),
376
+ 'type' => 'text',
377
+ 'options' => '<h3>' . esc_html__( 'Popular posts:', 'top-10' ) . '</h3>',
378
+ 'size' => 'large',
379
+ ),
380
+ 'title_daily' => array(
381
+ 'id' => 'title_daily',
382
+ 'name' => esc_html__( 'Heading of posts for daily/custom period lists', 'top-10' ),
383
+ 'desc' => esc_html__( 'Displayed before the list of the posts as a the master heading', 'top-10' ),
384
+ 'type' => 'text',
385
+ 'options' => '<h3>' . esc_html__( 'Currently trending:', 'top-10' ) . '</h3>',
386
+ 'size' => 'large',
387
+ ),
388
+ 'blank_output' => array(
389
+ 'id' => 'blank_output',
390
+ 'name' => esc_html__( 'Show when no posts are found', 'top-10' ),
391
+ /* translators: 1: Code. */
392
+ 'desc' => sprintf( esc_html__( 'If you choose to disable this, please add %1$s to your template file where you want it displayed', 'top-10' ), "<code>&lt;?php if ( function_exists( 'echo_wherego' ) ) { echo_wherego(); } ?&gt;</code>" ),
393
+ 'type' => 'radio',
394
+ 'default' => 'blank',
395
+ 'options' => array(
396
+ 'blank' => esc_html__( 'Blank output', 'top-10' ),
397
+ 'custom_text' => esc_html__( 'Display custom text', 'top-10' ),
398
+ ),
399
+ ),
400
+ 'blank_output_text' => array(
401
+ 'id' => 'blank_output_text',
402
+ 'name' => esc_html__( 'Custom text', 'top-10' ),
403
+ 'desc' => esc_html__( 'Enter the custom text that will be displayed if the second option is selected above', 'top-10' ),
404
+ 'type' => 'textarea',
405
+ 'options' => esc_html__( 'No top posts yet', 'top-10' ),
406
+ ),
407
+ 'show_excerpt' => array(
408
+ 'id' => 'show_excerpt',
409
+ 'name' => esc_html__( 'Show post excerpt', 'top-10' ),
410
+ 'desc' => '',
411
+ 'type' => 'checkbox',
412
+ 'options' => false,
413
+ ),
414
+ 'excerpt_length' => array(
415
+ 'id' => 'excerpt_length',
416
+ 'name' => esc_html__( 'Length of excerpt (in words)', 'top-10' ),
417
+ 'desc' => '',
418
+ 'type' => 'number',
419
+ 'options' => '10',
420
+ 'size' => 'small',
421
+ ),
422
+ 'show_date' => array(
423
+ 'id' => 'show_date',
424
+ 'name' => esc_html__( 'Show date', 'top-10' ),
425
+ 'desc' => '',
426
+ 'type' => 'checkbox',
427
+ 'options' => false,
428
+ ),
429
+ 'show_author' => array(
430
+ 'id' => 'show_author',
431
+ 'name' => esc_html__( 'Show author', 'top-10' ),
432
+ 'desc' => '',
433
+ 'type' => 'checkbox',
434
+ 'options' => false,
435
+ ),
436
+ 'disp_list_count' => array(
437
+ 'id' => 'disp_list_count',
438
+ 'name' => esc_html__( 'Show number of views', 'top-10' ),
439
+ 'desc' => '',
440
+ 'type' => 'checkbox',
441
+ 'options' => false,
442
+ ),
443
+ 'title_length' => array(
444
+ 'id' => 'title_length',
445
+ 'name' => esc_html__( 'Limit post title length (in characters)', 'top-10' ),
446
+ 'desc' => '',
447
+ 'type' => 'number',
448
+ 'options' => '60',
449
+ 'size' => 'small',
450
+ ),
451
+ 'link_new_window' => array(
452
+ 'id' => 'link_new_window',
453
+ 'name' => esc_html__( 'Open links in new window', 'top-10' ),
454
+ 'desc' => '',
455
+ 'type' => 'checkbox',
456
+ 'options' => false,
457
+ ),
458
+ 'link_nofollow' => array(
459
+ 'id' => 'link_nofollow',
460
+ 'name' => esc_html__( 'Add nofollow to links', 'top-10' ),
461
+ 'desc' => '',
462
+ 'type' => 'checkbox',
463
+ 'options' => false,
464
+ ),
465
+ 'html_wrapper_header' => array(
466
+ 'id' => 'html_wrapper_header',
467
+ 'name' => '<h3>' . esc_html__( 'HTML to display', 'top-10' ) . '</h3>',
468
+ 'desc' => '',
469
+ 'type' => 'header',
470
+ ),
471
+ 'before_list' => array(
472
+ 'id' => 'before_list',
473
+ 'name' => esc_html__( 'Before the list of posts', 'top-10' ),
474
+ 'desc' => '',
475
+ 'type' => 'text',
476
+ 'options' => '<ul>',
477
+ ),
478
+ 'after_list' => array(
479
+ 'id' => 'after_list',
480
+ 'name' => esc_html__( 'After the list of posts', 'top-10' ),
481
+ 'desc' => '',
482
+ 'type' => 'text',
483
+ 'options' => '</ul>',
484
+ ),
485
+ 'before_list_item' => array(
486
+ 'id' => 'before_list_item',
487
+ 'name' => esc_html__( 'Before each list item', 'top-10' ),
488
+ 'desc' => '',
489
+ 'type' => 'text',
490
+ 'options' => '<li>',
491
+ ),
492
+ 'after_list_item' => array(
493
+ 'id' => 'after_list_item',
494
+ 'name' => esc_html__( 'After each list item', 'top-10' ),
495
+ 'desc' => '',
496
+ 'type' => 'text',
497
+ 'options' => '</li>',
498
+ ),
499
+ );
500
+
501
+ /**
502
+ * Filters the List settings array
503
+ *
504
+ * @since 2.6.0
505
+ *
506
+ * @param array $settings List settings array
507
+ */
508
+ return apply_filters( 'tptn_settings_list', $settings );
509
+ }
510
+
511
+
512
+ /**
513
+ * Retrieve the array of Thumbnail settings
514
+ *
515
+ * @since 2.6.0
516
+ *
517
+ * @return array Thumbnail settings array
518
+ */
519
+ function tptn_settings_thumbnail() {
520
+
521
+ $settings = array(
522
+ 'post_thumb_op' => array(
523
+ 'id' => 'post_thumb_op',
524
+ 'name' => esc_html__( 'Location of the post thumbnail', 'top-10' ),
525
+ 'desc' => '',
526
+ 'type' => 'radio',
527
+ 'default' => 'text_only',
528
+ 'options' => array(
529
+ 'inline' => esc_html__( 'Display thumbnails inline with posts, before title', 'top-10' ),
530
+ 'after' => esc_html__( 'Display thumbnails inline with posts, after title', 'top-10' ),
531
+ 'thumbs_only' => esc_html__( 'Display only thumbnails, no text', 'top-10' ),
532
+ 'text_only' => esc_html__( 'Do not display thumbnails, only text', 'top-10' ),
533
+ ),
534
+ ),
535
+ 'thumb_size' => array(
536
+ 'id' => 'thumb_size',
537
+ 'name' => esc_html__( 'Thumbnail size', 'top-10' ),
538
+ /* translators: 1: OTF Regenerate plugin link, 2: Force regenerate plugin link. */
539
+ 'desc' => esc_html__( 'You can choose from existing image sizes above or create a custom size. If you have chosen Custom size above, then enter the width, height and crop settings below. For best results, use a cropped image. If you change the width and/or height below, existing images will not be automatically resized.' ) . '<br />' . sprintf( esc_html__( 'I recommend using %1$s or %2$s to regenerate all image sizes.', 'top-10' ), '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=otf-regenerate-thumbnails&amp;TB_iframe=true&amp;width=600&amp;height=550' ) ) . '" class="thickbox">OTF Regenerate Thumbnails</a>', '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=regenerate-thumbnails&amp;TB_iframe=true&amp;width=600&amp;height=550' ) ) . '" class="thickbox">Regenerate Thumbnails</a>' ),
540
+ 'type' => 'thumbsizes',
541
+ 'default' => 'tptn_thumbnail',
542
+ 'options' => tptn_get_all_image_sizes(),
543
+ ),
544
+ 'thumb_width' => array(
545
+ 'id' => 'thumb_width',
546
+ 'name' => esc_html__( 'Thumbnail width', 'top-10' ),
547
+ 'desc' => '',
548
+ 'type' => 'number',
549
+ 'options' => '250',
550
+ 'size' => 'small',
551
+ ),
552
+ 'thumb_height' => array(
553
+ 'id' => 'thumb_height',
554
+ 'name' => esc_html__( 'Thumbnail height', 'top-10' ),
555
+ 'desc' => '',
556
+ 'type' => 'number',
557
+ 'options' => '250',
558
+ 'size' => 'small',
559
+ ),
560
+ 'thumb_crop' => array(
561
+ 'id' => 'thumb_crop',
562
+ 'name' => esc_html__( 'Hard crop thumbnails', 'top-10' ),
563
+ 'desc' => esc_html__( 'Check this box to hard crop the thumbnails. i.e. force the width and height above vs. maintaining proportions.', 'top-10' ),
564
+ 'type' => 'checkbox',
565
+ 'options' => true,
566
+ ),
567
+ 'thumb_create_sizes' => array(
568
+ 'id' => 'thumb_create_sizes',
569
+ 'name' => esc_html__( 'Generate thumbnail sizes', 'top-10' ),
570
+ 'desc' => esc_html__( 'If you select this option and Custom size is selected above, the plugin will register the image size with WordPress to create new thumbnails. Does not update old images as explained above.', 'top-10' ),
571
+ 'type' => 'checkbox',
572
+ 'options' => true,
573
+ ),
574
+ 'thumb_html' => array(
575
+ 'id' => 'thumb_html',
576
+ 'name' => esc_html__( 'Thumbnail size attributes', 'top-10' ),
577
+ 'desc' => '',
578
+ 'type' => 'radio',
579
+ 'default' => 'html',
580
+ 'options' => array(
581
+ /* translators: %s: Code. */
582
+ 'css' => sprintf( esc_html__( 'Use CSS to set the width and height: e.g. %s', 'top-10' ), '<code>style="max-width:250px;max-height:250px"</code>' ),
583
+ /* translators: %s: Code. */
584
+ 'html' => sprintf( esc_html__( 'Use HTML attributes to set the width and height: e.g. %s', 'top-10' ), '<code>width="250" height="250"</code>' ),
585
+ 'none' => esc_html__( 'No width or height set. You will need to use external styles to force any width or height of your choice.', 'top-10' ),
586
+ ),
587
+ ),
588
+ 'thumb_meta' => array(
589
+ 'id' => 'thumb_meta',
590
+ 'name' => esc_html__( 'Thumbnail meta field name', 'top-10' ),
591
+ 'desc' => esc_html__( 'The value of this field should contain the URL of the image and can be set in the metabox in the Edit Post screen', 'top-10' ),
592
+ 'type' => 'text',
593
+ 'options' => 'post-image',
594
+ ),
595
+ 'scan_images' => array(
596
+ 'id' => 'scan_images',
597
+ 'name' => esc_html__( 'Get first image', 'top-10' ),
598
+ 'desc' => esc_html__( 'The plugin will fetch the first image in the post content if this is enabled. This can slow down the loading of your page if the first image in the followed posts is large in file-size.', 'top-10' ),
599
+ 'type' => 'checkbox',
600
+ 'options' => true,
601
+ ),
602
+ 'thumb_default_show' => array(
603
+ 'id' => 'thumb_default_show',
604
+ 'name' => esc_html__( 'Use default thumbnail?', 'top-10' ),
605
+ 'desc' => esc_html__( 'If checked, when no thumbnail is found, show a default one from the URL below. If not checked and no thumbnail is found, no image will be shown.', 'top-10' ),
606
+ 'type' => 'checkbox',
607
+ 'options' => true,
608
+ ),
609
+ 'thumb_default' => array(
610
+ 'id' => 'thumb_default',
611
+ 'name' => esc_html__( 'Default thumbnail', 'top-10' ),
612
+ 'desc' => esc_html__( 'Enter the full URL of the image that you wish to display if no thumbnail is found. This image will be displayed below.', 'top-10' ),
613
+ 'type' => 'text',
614
+ 'options' => TOP_TEN_PLUGIN_URL . 'default.png',
615
+ 'size' => 'large',
616
+ ),
617
+ );
618
+
619
+ /**
620
+ * Filters the Thumbnail settings array
621
+ *
622
+ * @since 2.6.0
623
+ *
624
+ * @param array $settings Thumbnail settings array
625
+ */
626
+ return apply_filters( 'tptn_settings_thumbnail', $settings );
627
+ }
628
+
629
+
630
+ /**
631
+ * Retrieve the array of Styles settings
632
+ *
633
+ * @since 2.6.0
634
+ *
635
+ * @return array Styles settings array
636
+ */
637
+ function tptn_settings_styles() {
638
+
639
+ $settings = array(
640
+ 'tptn_styles' => array(
641
+ 'id' => 'tptn_styles',
642
+ 'name' => esc_html__( 'Popular posts style', 'top-10' ),
643
+ 'desc' => '',
644
+ 'type' => 'radiodesc',
645
+ 'default' => 'no_style',
646
+ 'options' => tptn_get_styles(),
647
+ ),
648
+ 'custom_css' => array(
649
+ 'id' => 'custom_css',
650
+ 'name' => esc_html__( 'Custom CSS', 'top-10' ),
651
+ /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
652
+ 'desc' => sprintf( esc_html__( 'Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available CSS classes to style.', 'top-10' ), '<a href="' . esc_url( 'http://wordpress.org/plugins/top-10/faq/' ) . '" target="_blank">', '</a>', '<code>', '</code>' ),
653
+ 'type' => 'css',
654
+ 'options' => '',
655
+ ),
656
+ );
657
+
658
+ /**
659
+ * Filters the Styles settings array
660
+ *
661
+ * @since 2.6.0
662
+ *
663
+ * @param array $settings Styles settings array
664
+ */
665
+ return apply_filters( 'tptn_settings_styles', $settings );
666
+ }
667
+
668
+
669
+ /**
670
+ * Retrieve the array of Maintenance settings
671
+ *
672
+ * @since 2.6.0
673
+ *
674
+ * @return array Maintenance settings array
675
+ */
676
+ function tptn_settings_maintenance() {
677
+
678
+ $settings = array(
679
+ 'cron_on' => array(
680
+ 'id' => 'cron_on',
681
+ 'name' => esc_html__( 'Enable scheduled maintenance', 'top-10' ),
682
+ 'desc' => esc_html__( 'Cleaning the database at regular intervals could improve performance, especially on high traffic blogs. Enabling maintenance will automatically delete entries older than 90 days in the daily tables.', 'top-10' ),
683
+ 'type' => 'checkbox',
684
+ 'options' => false,
685
+ ),
686
+ 'cron_range_desc' => array(
687
+ 'id' => 'cron_range_desc',
688
+ 'name' => '<strong>' . esc_html__( 'Time to run maintenance', 'top-10' ) . '</strong>',
689
+ 'desc' => esc_html__( 'The next two options allow you to set the time to run the cron.', 'top-10' ),
690
+ 'type' => 'descriptive_text',
691
+ ),
692
+ 'cron_hour' => array(
693
+ 'id' => 'cron_hour',
694
+ 'name' => esc_html__( 'Hour', 'top-10' ),
695
+ 'desc' => '',
696
+ 'type' => 'number',
697
+ 'options' => '0',
698
+ 'min' => '0',
699
+ 'max' => '23',
700
+ 'size' => 'small',
701
+ ),
702
+ 'cron_min' => array(
703
+ 'id' => 'cron_min',
704
+ 'name' => esc_html__( 'Minute', 'top-10' ),
705
+ 'desc' => '',
706
+ 'type' => 'number',
707
+ 'options' => '0',
708
+ 'min' => '0',
709
+ 'max' => '59',
710
+ 'size' => 'small',
711
+ ),
712
+ 'cron_recurrence' => array(
713
+ 'id' => 'cron_recurrence',
714
+ 'name' => esc_html__( 'Run maintenance', 'top-10' ),
715
+ 'desc' => '',
716
+ 'type' => 'radio',
717
+ 'default' => 'weekly',
718
+ 'options' => array(
719
+ 'daily' => esc_html__( 'Daily', 'top-10' ),
720
+ 'weekly' => esc_html__( 'Weekly', 'top-10' ),
721
+ 'fortnightly' => esc_html__( 'Fortnightly', 'top-10' ),
722
+ 'monthly' => esc_html__( 'Monthly', 'top-10' ),
723
+ ),
724
+ ),
725
+ );
726
+
727
+ /**
728
+ * Filters the Maintenance settings array
729
+ *
730
+ * @since 2.6.0
731
+ *
732
+ * @param array $settings Maintenance settings array
733
+ */
734
+ return apply_filters( 'tptn_settings_maintenance', $settings );
735
+ }
736
+
737
+
738
+ /**
739
+ * Upgrade pre v2.5.0 settings.
740
+ *
741
+ * @since v2.5.0
742
+ * @return array Settings array
743
+ */
744
+ function tptn_upgrade_settings() {
745
+ $old_settings = get_option( 'ald_tptn_settings' );
746
+
747
+ if ( empty( $old_settings ) ) {
748
+ return false;
749
+ }
750
+
751
+ // Start will assigning all the old settings to the new settings and we will unset later on.
752
+ $settings = $old_settings;
753
+
754
+ // Convert the add_to_{x} to the new settings format.
755
+ $add_to = array(
756
+ 'single' => 'add_to_content',
757
+ 'page' => 'count_on_pages',
758
+ 'feed' => 'add_to_feed',
759
+ 'home' => 'add_to_home',
760
+ 'category_archives' => 'add_to_category_archives',
761
+ 'tag_archives' => 'add_to_tag_archives',
762
+ 'other_archives' => 'add_to_archives',
763
+ );
764
+
765
+ foreach ( $add_to as $newkey => $oldkey ) {
766
+ if ( $old_settings[ $oldkey ] ) {
767
+ $settings['add_to'][ $newkey ] = $newkey;
768
+ }
769
+ unset( $settings[ $oldkey ] );
770
+ }
771
+
772
+ // Convert the activate_overall and activate_daily to the new settings format.
773
+ $trackers = array(
774
+ 'overall' => 'activate_overall',
775
+ 'daily' => 'activate_daily',
776
+ );
777
+
778
+ foreach ( $trackers as $newkey => $oldkey ) {
779
+ if ( $old_settings[ $oldkey ] ) {
780
+ $settings['trackers'][ $newkey ] = $newkey;
781
+ }
782
+ unset( $settings[ $oldkey ] );
783
+ }
784
+
785
+ // Convert the track_{x} to the new settings format.
786
+ $track_users = array(
787
+ 'authors' => 'track_authors',
788
+ 'editors' => 'track_editors',
789
+ 'admins' => 'track_admins',
790
+ );
791
+
792
+ foreach ( $track_users as $newkey => $oldkey ) {
793
+ if ( $old_settings[ $oldkey ] ) {
794
+ $settings['track_users'][ $newkey ] = $newkey;
795
+ }
796
+ unset( $settings[ $oldkey ] );
797
+ }
798
+
799
+ // Convert 'blank_output' to the new format: true = 'blank' and false = 'custom_text'.
800
+ $settings['blank_output'] = ! empty( $old_settings['blank_output'] ) ? 'blank' : 'custom_text';
801
+
802
+ $settings['custom_css'] = $old_settings['custom_CSS'];
803
+
804
+ return $settings;
805
+
806
+ }
807
+
808
+
809
+ /**
810
+ * Get the various styles.
811
+ *
812
+ * @since 2.5.0
813
+ * @return array Style options.
814
+ */
815
+ function tptn_get_styles() {
816
+
817
+ $styles = array(
818
+ array(
819
+ 'id' => 'no_style',
820
+ 'name' => esc_html__( 'No styles', 'top-10' ),
821
+ 'description' => esc_html__( 'Select this option if you plan to add your own styles', 'top-10' ) . '<br />',
822
+ ),
823
+ array(
824
+ 'id' => 'text_only',
825
+ 'name' => esc_html__( 'Text only', 'top-10' ),
826
+ 'description' => esc_html__( 'Disable thumbnails and no longer include the default style sheet included in the plugin', 'top-10' ) . '<br />',
827
+ ),
828
+ array(
829
+ 'id' => 'left_thumbs',
830
+ 'name' => esc_html__( 'Left thumbnails', 'top-10' ),
831
+ 'description' => '<br /><img src="' . esc_url( plugins_url( 'includes/admin/images/tptn-left-thumbs.png', TOP_TEN_PLUGIN_FILE ) ) . '" width="350" /> <br />' . esc_html__( 'Enabling this option will set the post thumbnail to be before text. Disabling this option will not revert any settings.', 'top-10' ),
832
+ ),
833
+ );
834
+
835
+ /**
836
+ * Filter the array containing the types of trackers to add your own.
837
+ *
838
+ * @since 2.5.0
839
+ *
840
+ * @param string $trackers Different trackers.
841
+ */
842
+ return apply_filters( 'tptn_get_styles', $styles );
843
+ }
includes/admin/register-settings.php CHANGED
@@ -67,7 +67,7 @@ function tptn_get_option( $key = '', $default = null ) {
67
  * Update an option
68
  *
69
  * Updates an tptn setting value in both the db and the global variable.
70
- * Warning: Passing in an empty, false or null string value will remove
71
  * the key from the tptn_options array.
72
  *
73
  * @since 2.5.0
@@ -76,15 +76,15 @@ function tptn_get_option( $key = '', $default = null ) {
76
  * @param string|bool|int $value The value to set the key to.
77
  * @return boolean True if updated, false if not.
78
  */
79
- function tptn_update_option( $key = '', $value = false ) {
80
 
81
  // If no key, exit.
82
  if ( empty( $key ) ) {
83
  return false;
84
  }
85
 
86
- // If no value, delete.
87
- if ( empty( $value ) ) {
88
  $remove_option = tptn_delete_option( $key );
89
  return $remove_option;
90
  }
@@ -211,589 +211,6 @@ function tptn_register_settings() {
211
  add_action( 'admin_init', 'tptn_register_settings' );
212
 
213
 
214
- /**
215
- * Retrieve the array of plugin settings
216
- *
217
- * @since 2.5.0
218
- *
219
- * @return array Settings array
220
- */
221
- function tptn_get_registered_settings() {
222
-
223
- $tptn_settings = array(
224
- /*** General settings */
225
- 'general' => apply_filters(
226
- 'tptn_settings_general',
227
- array(
228
- 'trackers' => array(
229
- 'id' => 'trackers',
230
- 'name' => esc_html__( 'Enable trackers', 'top-10' ),
231
- /* translators: 1: Code. */
232
- 'desc' => '',
233
- 'type' => 'multicheck',
234
- 'default' => array(
235
- 'overall' => 'overall',
236
- 'daily' => 'daily',
237
- ),
238
- 'options' => array(
239
- 'overall' => esc_html__( 'Overall', 'top-10' ),
240
- 'daily' => esc_html__( 'Daily', 'top-10' ),
241
- ),
242
- ),
243
- 'cache' => array(
244
- 'id' => 'cache',
245
- 'name' => esc_html__( 'Enable cache', 'top-10' ),
246
- 'desc' => esc_html__( 'If activated, Top 10 will use the Transients API to cache the popular posts output for 1 hour.', 'top-10' ),
247
- 'type' => 'checkbox',
248
- 'options' => false,
249
- ),
250
- 'cache_time' => array(
251
- 'id' => 'cache_time',
252
- 'name' => esc_html__( 'Time to cache', 'top-10' ),
253
- 'desc' => esc_html__( 'Enter the number of seconds to cache the output.', 'top-10' ),
254
- 'type' => 'text',
255
- 'options' => HOUR_IN_SECONDS,
256
- ),
257
- 'daily_midnight' => array(
258
- 'id' => 'daily_midnight',
259
- 'name' => esc_html__( 'Start daily counts from midnight', 'top-10' ),
260
- 'desc' => esc_html__( 'Daily counter will display number of visits from midnight. This option is checked by default and mimics the way most normal counters work. Turning this off will allow you to use the hourly setting in the next option.', 'top-10' ),
261
- 'type' => 'checkbox',
262
- 'options' => true,
263
- ),
264
- 'range_desc' => array(
265
- 'id' => 'range_desc',
266
- 'name' => '<strong>' . esc_html__( 'Default custom period range', 'top-10' ) . '</strong>',
267
- 'desc' => esc_html__( 'The next two options allow you to set the default range for the custom period. This was previously called the daily range. This can be overridden in the widget.', 'top-10' ),
268
- 'type' => 'descriptive_text',
269
- ),
270
- 'daily_range' => array(
271
- 'id' => 'daily_range',
272
- 'name' => esc_html__( 'Day(s)', 'top-10' ),
273
- 'desc' => '',
274
- 'type' => 'number',
275
- 'options' => '1',
276
- 'min' => '0',
277
- 'size' => 'small',
278
- ),
279
- 'hour_range' => array(
280
- 'id' => 'hour_range',
281
- 'name' => esc_html__( 'Hour(s)', 'top-10' ),
282
- 'desc' => '',
283
- 'type' => 'number',
284
- 'options' => '0',
285
- 'min' => '0',
286
- 'max' => '23',
287
- 'size' => 'small',
288
- ),
289
- 'uninstall_clean_options' => array(
290
- 'id' => 'uninstall_clean_options',
291
- 'name' => esc_html__( 'Delete options on uninstall', 'top-10' ),
292
- 'desc' => esc_html__( 'If this is checked, all settings related to Top 10 are removed from the database if you choose to uninstall/delete the plugin.', 'top-10' ),
293
- 'type' => 'checkbox',
294
- 'options' => true,
295
- ),
296
- 'uninstall_clean_tables' => array(
297
- 'id' => 'uninstall_clean_tables',
298
- 'name' => esc_html__( 'Delete counter data on uninstall', 'top-10' ),
299
- 'desc' => esc_html__( 'If this is checked, the tables containing the counter statistics are removed from the database if you choose to uninstall/delete the plugin. Keep this unchecked if you choose to reinstall the plugin and do not want to lose your counter data.', 'top-10' ),
300
- 'type' => 'checkbox',
301
- 'options' => false,
302
- ),
303
- 'show_metabox' => array(
304
- 'id' => 'show_metabox',
305
- 'name' => esc_html__( 'Show metabox', 'top-10' ),
306
- 'desc' => esc_html__( 'This will add the Top 10 metabox on Edit Posts or Add New Posts screens. Also applies to Pages and Custom Post Types.', 'top-10' ),
307
- 'type' => 'checkbox',
308
- 'options' => true,
309
- ),
310
- 'show_metabox_admins' => array(
311
- 'id' => 'show_metabox_admins',
312
- 'name' => esc_html__( 'Limit meta box to Admins only', 'top-10' ),
313
- 'desc' => esc_html__( 'If selected, the meta box will be hidden from anyone who is not an Admin. By default, Contributors and above will be able to see the meta box. Applies only if the above option is selected.', 'top-10' ),
314
- 'type' => 'checkbox',
315
- 'options' => false,
316
- ),
317
- 'show_credit' => array(
318
- 'id' => 'show_credit',
319
- 'name' => esc_html__( 'Link to Top 10 plugin page', 'top-10' ),
320
- 'desc' => esc_html__( 'A no-follow link to the plugin homepage will be added as the last item of the popular posts.', 'top-10' ),
321
- 'type' => 'checkbox',
322
- 'options' => false,
323
- ),
324
- )
325
- ),
326
- /*** Output settings */
327
- 'counter' => apply_filters(
328
- 'tptn_settings_counter',
329
- array(
330
- 'add_to' => array(
331
- 'id' => 'add_to',
332
- 'name' => esc_html__( 'Display number of views on', 'top-10' ) . ':',
333
- /* translators: 1: Code. */
334
- 'desc' => sprintf( esc_html__( 'If you choose to disable this, please add %1$s to your template file where you want it displayed', 'top-10' ), "<code>&lt;?php if ( function_exists( 'echo_tptn_post_count' ) ) { echo_tptn_post_count(); } ?&gt;</code>" ),
335
- 'type' => 'multicheck',
336
- 'default' => array(
337
- 'single' => 'single',
338
- 'page' => 'page',
339
- ),
340
- 'options' => array(
341
- 'single' => esc_html__( 'Posts', 'top-10' ),
342
- 'page' => esc_html__( 'Pages', 'top-10' ),
343
- 'home' => esc_html__( 'Home page', 'top-10' ),
344
- 'feed' => esc_html__( 'Feeds', 'top-10' ),
345
- 'category_archives' => esc_html__( 'Category archives', 'top-10' ),
346
- 'tag_archives' => esc_html__( 'Tag archives', 'top-10' ),
347
- 'other_archives' => esc_html__( 'Other archives', 'top-10' ),
348
- ),
349
- ),
350
- 'count_disp_form' => array(
351
- 'id' => 'count_disp_form',
352
- 'name' => esc_html__( 'Format to display the post views', 'top-10' ),
353
- /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
354
- 'desc' => sprintf( esc_html__( 'Use %1$s to display the total count, %2$s for daily count and %3$s for overall counts across all posts. Default display is %4$s', 'top-10' ), '<code>%totalcount%</code>', '<code>%dailycount%</code>', '<code>%overallcount%</code>', '<code>(Visited %totalcount% times, %dailycount% visits today)</code>' ),
355
- 'type' => 'textarea',
356
- 'options' => '(Visited %totalcount% times, %dailycount% visits today)',
357
- ),
358
- 'count_disp_form_zero' => array(
359
- 'id' => 'count_disp_form_zero',
360
- 'name' => esc_html__( 'What do display when there are no visits?', 'top-10' ),
361
- /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
362
- 'desc' => esc_html__( "This text applies only when there are 0 hits for the post and it isn't a single page. e.g. if you display post views on the homepage or archives then this text will be used. To override this, just enter the same text as above option.", 'top-10' ),
363
- 'type' => 'textarea',
364
- 'options' => 'No visits yet',
365
- ),
366
- 'dynamic_post_count' => array(
367
- 'id' => 'dynamic_post_count',
368
- 'name' => esc_html__( 'Always display latest post count', 'top-10' ),
369
- 'desc' => esc_html__( 'This option uses JavaScript and will increase your page load time. Turn this off if you are not using caching plugins or are OK with displaying older cached counts.', 'top-10' ),
370
- 'type' => 'checkbox',
371
- 'options' => false,
372
- ),
373
- 'tracker_type' => array(
374
- 'id' => 'tracker_type',
375
- 'name' => esc_html__( 'Tracker type', 'top-10' ),
376
- 'desc' => '',
377
- 'type' => 'radiodesc',
378
- 'default' => 'query_based',
379
- 'options' => tptn_get_tracker_types(),
380
- ),
381
- 'track_users' => array(
382
- 'id' => 'track_users',
383
- 'name' => esc_html__( 'Track user groups', 'top-10' ) . ':',
384
- 'desc' => esc_html__( 'Uncheck above to disable tracking if the current user falls into any one of these groups.', 'top-10' ),
385
- 'type' => 'multicheck',
386
- 'default' => array(
387
- 'editors' => 'editors',
388
- 'admins' => 'admins',
389
- ),
390
- 'options' => array(
391
- 'authors' => esc_html__( 'Authors', 'top-10' ),
392
- 'editors' => esc_html__( 'Editors', 'top-10' ),
393
- 'admins' => esc_html__( 'Admins', 'top-10' ),
394
- ),
395
- ),
396
- 'logged_in' => array(
397
- 'id' => 'logged_in',
398
- 'name' => esc_html__( 'Track logged-in users', 'top-10' ),
399
- 'desc' => esc_html__( 'Uncheck to stop tracking logged in users. Only logged out visitors will be tracked if this is disabled. Unchecking this will override the above setting.', 'top-10' ),
400
- 'type' => 'checkbox',
401
- 'options' => true,
402
- ),
403
- 'pv_in_admin' => array(
404
- 'id' => 'pv_in_admin',
405
- 'name' => esc_html__( 'Page views in admin', 'top-10' ),
406
- 'desc' => esc_html__( "Adds three columns called Total Views, Today's Views and Views to All Posts and All Pages. You can selectively disable these by pulling down the Screen Options from the top right of the respective screens.", 'top-10' ),
407
- 'type' => 'checkbox',
408
- 'options' => true,
409
- ),
410
- 'show_count_non_admins' => array(
411
- 'id' => 'show_count_non_admins',
412
- 'name' => esc_html__( 'Show views to non-admins', 'top-10' ),
413
- 'desc' => esc_html__( "If you disable this then non-admins won't see the above columns or view the independent pages with the top posts.", 'top-10' ),
414
- 'type' => 'checkbox',
415
- 'options' => true,
416
- ),
417
- )
418
- ),
419
- /*** List settings */
420
- 'list' => apply_filters(
421
- 'tptn_settings_list',
422
- array(
423
- 'limit' => array(
424
- 'id' => 'limit',
425
- 'name' => esc_html__( 'Number of posts to display', 'top-10' ),
426
- 'desc' => esc_html__( 'Maximum number of posts that will be displayed in the list. This option is used if you don not specify the number of posts in the widget or shortcodes', 'top-10' ),
427
- 'type' => 'number',
428
- 'options' => '10',
429
- 'size' => 'small',
430
- ),
431
- 'how_old' => array(
432
- 'id' => 'how_old',
433
- 'name' => esc_html__( 'Published age of posts', 'top-10' ),
434
- 'desc' => esc_html__( 'This options allows you to only show posts that have been published within the above day range. Applies to both overall posts and daily posts lists. e.g. 365 days will only show posts published in the last year in the popular posts lists. Enter 0 for no restriction.', 'top-10' ),
435
- 'type' => 'number',
436
- 'options' => '0',
437
- ),
438
- 'post_types' => array(
439
- 'id' => 'post_types',
440
- 'name' => esc_html__( 'Post types to include', 'top-10' ),
441
- 'desc' => esc_html__( 'At least one option should be selected above. Select which post types you want to include in the list of posts. This field can be overridden using a comma separated list of post types when using the manual display.', 'top-10' ),
442
- 'type' => 'posttypes',
443
- 'options' => 'post',
444
- ),
445
- 'exclude_post_ids' => array(
446
- 'id' => 'exclude_post_ids',
447
- 'name' => esc_html__( 'Post/page IDs to exclude', 'top-10' ),
448
- 'desc' => esc_html__( 'Comma-separated list of post or page IDs to exclude from the list. e.g. 188,320,500', 'top-10' ),
449
- 'type' => 'numbercsv',
450
- 'options' => '',
451
- ),
452
- 'exclude_cat_slugs' => array(
453
- 'id' => 'exclude_cat_slugs',
454
- 'name' => esc_html__( 'Exclude Categories', 'top-10' ),
455
- 'desc' => esc_html__( 'Comma separated list of category slugs. The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. Does not support custom taxonomies.', 'top-10' ),
456
- 'type' => 'csv',
457
- 'options' => '',
458
- 'size' => 'large',
459
- 'field_class' => 'category_autocomplete',
460
- 'field_attributes' => array(
461
- 'data-wp-taxonomy' => 'category',
462
- ),
463
- ),
464
- 'exclude_categories' => array(
465
- 'id' => 'exclude_categories',
466
- 'name' => esc_html__( 'Exclude category IDs', 'top-10' ),
467
- 'desc' => esc_html__( 'This is a readonly field that is automatically populated based on the above input when the settings are saved. These might differ from the IDs visible in the Categories page which use the term_id. Top 10 uses the term_taxonomy_id which is unique to this taxonomy.', 'top-10' ),
468
- 'type' => 'text',
469
- 'options' => '',
470
- 'readonly' => true,
471
- ),
472
- 'customize_output_header' => array(
473
- 'id' => 'customize_output_header',
474
- 'name' => '<h3>' . esc_html__( 'Customize the output', 'top-10' ) . '</h3>',
475
- 'desc' => '',
476
- 'type' => 'header',
477
- ),
478
- 'title' => array(
479
- 'id' => 'title',
480
- 'name' => esc_html__( 'Heading of posts', 'top-10' ),
481
- 'desc' => esc_html__( 'Displayed before the list of the posts as a the master heading', 'top-10' ),
482
- 'type' => 'text',
483
- 'options' => '<h3>' . esc_html__( 'Popular posts:', 'top-10' ) . '</h3>',
484
- 'size' => 'large',
485
- ),
486
- 'title_daily' => array(
487
- 'id' => 'title_daily',
488
- 'name' => esc_html__( 'Heading of posts for daily/custom period lists', 'top-10' ),
489
- 'desc' => esc_html__( 'Displayed before the list of the posts as a the master heading', 'top-10' ),
490
- 'type' => 'text',
491
- 'options' => '<h3>' . esc_html__( 'Currently trending:', 'top-10' ) . '</h3>',
492
- 'size' => 'large',
493
- ),
494
- 'blank_output' => array(
495
- 'id' => 'blank_output',
496
- 'name' => esc_html__( 'Show when no posts are found', 'top-10' ),
497
- /* translators: 1: Code. */
498
- 'desc' => sprintf( esc_html__( 'If you choose to disable this, please add %1$s to your template file where you want it displayed', 'top-10' ), "<code>&lt;?php if ( function_exists( 'echo_wherego' ) ) { echo_wherego(); } ?&gt;</code>" ),
499
- 'type' => 'radio',
500
- 'default' => 'blank',
501
- 'options' => array(
502
- 'blank' => esc_html__( 'Blank output', 'top-10' ),
503
- 'custom_text' => esc_html__( 'Display custom text', 'top-10' ),
504
- ),
505
- ),
506
- 'blank_output_text' => array(
507
- 'id' => 'blank_output_text',
508
- 'name' => esc_html__( 'Custom text', 'top-10' ),
509
- 'desc' => esc_html__( 'Enter the custom text that will be displayed if the second option is selected above', 'top-10' ),
510
- 'type' => 'textarea',
511
- 'options' => esc_html__( 'No top posts yet', 'top-10' ),
512
- ),
513
- 'show_excerpt' => array(
514
- 'id' => 'show_excerpt',
515
- 'name' => esc_html__( 'Show post excerpt', 'top-10' ),
516
- 'desc' => '',
517
- 'type' => 'checkbox',
518
- 'options' => false,
519
- ),
520
- 'excerpt_length' => array(
521
- 'id' => 'excerpt_length',
522
- 'name' => esc_html__( 'Length of excerpt (in words)', 'top-10' ),
523
- 'desc' => '',
524
- 'type' => 'number',
525
- 'options' => '10',
526
- 'size' => 'small',
527
- ),
528
- 'show_date' => array(
529
- 'id' => 'show_date',
530
- 'name' => esc_html__( 'Show date', 'top-10' ),
531
- 'desc' => '',
532
- 'type' => 'checkbox',
533
- 'options' => false,
534
- ),
535
- 'show_author' => array(
536
- 'id' => 'show_author',
537
- 'name' => esc_html__( 'Show author', 'top-10' ),
538
- 'desc' => '',
539
- 'type' => 'checkbox',
540
- 'options' => false,
541
- ),
542
- 'disp_list_count' => array(
543
- 'id' => 'disp_list_count',
544
- 'name' => esc_html__( 'Show number of views', 'top-10' ),
545
- 'desc' => '',
546
- 'type' => 'checkbox',
547
- 'options' => false,
548
- ),
549
- 'title_length' => array(
550
- 'id' => 'title_length',
551
- 'name' => esc_html__( 'Limit post title length (in characters)', 'top-10' ),
552
- 'desc' => '',
553
- 'type' => 'number',
554
- 'options' => '60',
555
- 'size' => 'small',
556
- ),
557
- 'link_new_window' => array(
558
- 'id' => 'link_new_window',
559
- 'name' => esc_html__( 'Open links in new window', 'top-10' ),
560
- 'desc' => '',
561
- 'type' => 'checkbox',
562
- 'options' => false,
563
- ),
564
- 'link_nofollow' => array(
565
- 'id' => 'link_nofollow',
566
- 'name' => esc_html__( 'Add nofollow to links', 'top-10' ),
567
- 'desc' => '',
568
- 'type' => 'checkbox',
569
- 'options' => false,
570
- ),
571
- 'exclude_on_post_ids' => array(
572
- 'id' => 'exclude_on_post_ids',
573
- 'name' => esc_html__( 'Exclude display on these post IDs', 'top-10' ),
574
- 'desc' => esc_html__( 'Comma-separated list of post or page IDs to exclude displaying the top posts on. e.g. 188,320,500', 'top-10' ),
575
- 'type' => 'numbercsv',
576
- 'options' => '',
577
- ),
578
- 'html_wrapper_header' => array(
579
- 'id' => 'html_wrapper_header',
580
- 'name' => '<h3>' . esc_html__( 'HTML to display', 'top-10' ) . '</h3>',
581
- 'desc' => '',
582
- 'type' => 'header',
583
- ),
584
- 'before_list' => array(
585
- 'id' => 'before_list',
586
- 'name' => esc_html__( 'Before the list of posts', 'top-10' ),
587
- 'desc' => '',
588
- 'type' => 'text',
589
- 'options' => '<ul>',
590
- ),
591
- 'after_list' => array(
592
- 'id' => 'after_list',
593
- 'name' => esc_html__( 'After the list of posts', 'top-10' ),
594
- 'desc' => '',
595
- 'type' => 'text',
596
- 'options' => '</ul>',
597
- ),
598
- 'before_list_item' => array(
599
- 'id' => 'before_list_item',
600
- 'name' => esc_html__( 'Before each list item', 'top-10' ),
601
- 'desc' => '',
602
- 'type' => 'text',
603
- 'options' => '<li>',
604
- ),
605
- 'after_list_item' => array(
606
- 'id' => 'after_list_item',
607
- 'name' => esc_html__( 'After each list item', 'top-10' ),
608
- 'desc' => '',
609
- 'type' => 'text',
610
- 'options' => '</li>',
611
- ),
612
- )
613
- ),
614
- /*** Thumbnail settings */
615
- 'thumbnail' => apply_filters(
616
- 'tptn_settings_thumbnail',
617
- array(
618
- 'post_thumb_op' => array(
619
- 'id' => 'post_thumb_op',
620
- 'name' => esc_html__( 'Location of the post thumbnail', 'top-10' ),
621
- 'desc' => '',
622
- 'type' => 'radio',
623
- 'default' => 'text_only',
624
- 'options' => array(
625
- 'inline' => esc_html__( 'Display thumbnails inline with posts, before title', 'top-10' ),
626
- 'after' => esc_html__( 'Display thumbnails inline with posts, after title', 'top-10' ),
627
- 'thumbs_only' => esc_html__( 'Display only thumbnails, no text', 'top-10' ),
628
- 'text_only' => esc_html__( 'Do not display thumbnails, only text', 'top-10' ),
629
- ),
630
- ),
631
- 'thumb_size' => array(
632
- 'id' => 'thumb_size',
633
- 'name' => esc_html__( 'Thumbnail size', 'top-10' ),
634
- /* translators: 1: OTF Regenerate plugin link, 2: Force regenerate plugin link. */
635
- 'desc' => esc_html__( 'You can choose from existing image sizes above or create a custom size. If you have chosen Custom size above, then enter the width, height and crop settings below. For best results, use a cropped image. If you change the width and/or height below, existing images will not be automatically resized.' ) . '<br />' . sprintf( esc_html__( 'I recommend using %1$s or %2$s to regenerate all image sizes.', 'top-10' ), '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=otf-regenerate-thumbnails&amp;TB_iframe=true&amp;width=600&amp;height=550' ) ) . '" class="thickbox">OTF Regenerate Thumbnails</a>', '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=regenerate-thumbnails&amp;TB_iframe=true&amp;width=600&amp;height=550' ) ) . '" class="thickbox">Regenerate Thumbnails</a>' ),
636
- 'type' => 'thumbsizes',
637
- 'default' => 'tptn_thumbnail',
638
- 'options' => tptn_get_all_image_sizes(),
639
- ),
640
- 'thumb_width' => array(
641
- 'id' => 'thumb_width',
642
- 'name' => esc_html__( 'Thumbnail width', 'top-10' ),
643
- 'desc' => '',
644
- 'type' => 'number',
645
- 'options' => '250',
646
- 'size' => 'small',
647
- ),
648
- 'thumb_height' => array(
649
- 'id' => 'thumb_height',
650
- 'name' => esc_html__( 'Thumbnail height', 'top-10' ),
651
- 'desc' => '',
652
- 'type' => 'number',
653
- 'options' => '250',
654
- 'size' => 'small',
655
- ),
656
- 'thumb_crop' => array(
657
- 'id' => 'thumb_crop',
658
- 'name' => esc_html__( 'Hard crop thumbnails', 'top-10' ),
659
- 'desc' => esc_html__( 'Check this box to hard crop the thumbnails. i.e. force the width and height above vs. maintaining proportions.', 'top-10' ),
660
- 'type' => 'checkbox',
661
- 'options' => true,
662
- ),
663
- 'thumb_html' => array(
664
- 'id' => 'thumb_html',
665
- 'name' => esc_html__( 'Thumbnail size attributes', 'top-10' ),
666
- 'desc' => '',
667
- 'type' => 'radio',
668
- 'default' => 'html',
669
- 'options' => array(
670
- /* translators: %s: Code. */
671
- 'css' => sprintf( esc_html__( 'Use CSS to set the width and height: e.g. %s', 'top-10' ), '<code>style="max-width:250px;max-height:250px"</code>' ),
672
- /* translators: %s: Code. */
673
- 'html' => sprintf( esc_html__( 'Use HTML attributes to set the width and height: e.g. %s', 'top-10' ), '<code>width="250" height="250"</code>' ),
674
- 'none' => esc_html__( 'No width or height set. You will need to use external styles to force any width or height of your choice.', 'top-10' ),
675
- ),
676
- ),
677
- 'thumb_meta' => array(
678
- 'id' => 'thumb_meta',
679
- 'name' => esc_html__( 'Thumbnail meta field name', 'top-10' ),
680
- 'desc' => esc_html__( 'The value of this field should contain the URL of the image and can be set in the metabox in the Edit Post screen', 'top-10' ),
681
- 'type' => 'text',
682
- 'options' => 'post-image',
683
- ),
684
- 'scan_images' => array(
685
- 'id' => 'scan_images',
686
- 'name' => esc_html__( 'Get first image', 'top-10' ),
687
- 'desc' => esc_html__( 'The plugin will fetch the first image in the post content if this is enabled. This can slow down the loading of your page if the first image in the followed posts is large in file-size.', 'top-10' ),
688
- 'type' => 'checkbox',
689
- 'options' => true,
690
- ),
691
- 'thumb_default_show' => array(
692
- 'id' => 'thumb_default_show',
693
- 'name' => esc_html__( 'Use default thumbnail?', 'top-10' ),
694
- 'desc' => esc_html__( 'If checked, when no thumbnail is found, show a default one from the URL below. If not checked and no thumbnail is found, no image will be shown.', 'top-10' ),
695
- 'type' => 'checkbox',
696
- 'options' => true,
697
- ),
698
- 'thumb_default' => array(
699
- 'id' => 'thumb_default',
700
- 'name' => esc_html__( 'Default thumbnail', 'top-10' ),
701
- 'desc' => esc_html__( 'Enter the full URL of the image that you wish to display if no thumbnail is found. This image will be displayed below.', 'top-10' ),
702
- 'type' => 'text',
703
- 'options' => TOP_TEN_PLUGIN_URL . 'default.png',
704
- 'size' => 'large',
705
- ),
706
- )
707
- ),
708
- /*** Styles settings */
709
- 'styles' => apply_filters(
710
- 'tptn_settings_styles',
711
- array(
712
- 'tptn_styles' => array(
713
- 'id' => 'tptn_styles',
714
- 'name' => esc_html__( 'Popular posts style', 'top-10' ),
715
- 'desc' => '',
716
- 'type' => 'radiodesc',
717
- 'default' => 'no_style',
718
- 'options' => tptn_get_styles(),
719
- ),
720
- 'custom_css' => array(
721
- 'id' => 'custom_css',
722
- 'name' => esc_html__( 'Custom CSS', 'top-10' ),
723
- /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
724
- 'desc' => sprintf( esc_html__( 'Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available CSS classes to style.', 'top-10' ), '<a href="' . esc_url( 'http://wordpress.org/plugins/top-10/faq/' ) . '" target="_blank">', '</a>', '<code>', '</code>' ),
725
- 'type' => 'css',
726
- 'options' => '',
727
- ),
728
- )
729
- ),
730
- /*** Maintenance settings */
731
- 'maintenance' => apply_filters(
732
- 'tptn_settings_maintenance',
733
- array(
734
- 'cron_on' => array(
735
- 'id' => 'cron_on',
736
- 'name' => esc_html__( 'Enable scheduled maintenance', 'top-10' ),
737
- 'desc' => esc_html__( 'Cleaning the database at regular intervals could improve performance, especially on high traffic blogs. Enabling maintenance will automatically delete entries older than 90 days in the daily tables.', 'top-10' ),
738
- 'type' => 'checkbox',
739
- 'options' => false,
740
- ),
741
- 'cron_range_desc' => array(
742
- 'id' => 'cron_range_desc',
743
- 'name' => '<strong>' . esc_html__( 'Time to run maintenance', 'top-10' ) . '</strong>',
744
- 'desc' => esc_html__( 'The next two options allow you to set the time to run the cron.', 'top-10' ),
745
- 'type' => 'descriptive_text',
746
- ),
747
- 'cron_hour' => array(
748
- 'id' => 'cron_hour',
749
- 'name' => esc_html__( 'Hour', 'top-10' ),
750
- 'desc' => '',
751
- 'type' => 'number',
752
- 'options' => '0',
753
- 'min' => '0',
754
- 'max' => '23',
755
- 'size' => 'small',
756
- ),
757
- 'cron_min' => array(
758
- 'id' => 'cron_min',
759
- 'name' => esc_html__( 'Minute', 'top-10' ),
760
- 'desc' => '',
761
- 'type' => 'number',
762
- 'options' => '0',
763
- 'min' => '0',
764
- 'max' => '59',
765
- 'size' => 'small',
766
- ),
767
- 'cron_recurrence' => array(
768
- 'id' => 'cron_recurrence',
769
- 'name' => esc_html__( 'Run maintenance', 'top-10' ),
770
- 'desc' => '',
771
- 'type' => 'radio',
772
- 'default' => 'weekly',
773
- 'options' => array(
774
- 'daily' => esc_html__( 'Daily', 'top-10' ),
775
- 'weekly' => esc_html__( 'Weekly', 'top-10' ),
776
- 'fortnightly' => esc_html__( 'Fortnightly', 'top-10' ),
777
- 'monthly' => esc_html__( 'Monthly', 'top-10' ),
778
- ),
779
- ),
780
- )
781
- ),
782
- );
783
-
784
- /**
785
- * Filters the settings array
786
- *
787
- * @since 2.5.0
788
- *
789
- * @param array $tptn_setings Settings array
790
- */
791
- return apply_filters( 'tptn_registered_settings', $tptn_settings );
792
-
793
- }
794
-
795
-
796
-
797
  /**
798
  * Flattens tptn_get_registered_settings() into $setting[id] => $setting[type] format.
799
  *
@@ -902,108 +319,3 @@ function tptn_settings_reset() {
902
  delete_option( 'tptn_settings' );
903
  }
904
 
905
- /**
906
- * Upgrade pre v2.5.0 settings.
907
- *
908
- * @since v2.5.0
909
- * @return array Settings array
910
- */
911
- function tptn_upgrade_settings() {
912
- $old_settings = get_option( 'ald_tptn_settings' );
913
-
914
- if ( empty( $old_settings ) ) {
915
- return false;
916
- }
917
-
918
- // Start will assigning all the old settings to the new settings and we will unset later on.
919
- $settings = $old_settings;
920
-
921
- // Convert the add_to_{x} to the new settings format.
922
- $add_to = array(
923
- 'single' => 'add_to_content',
924
- 'page' => 'count_on_pages',
925
- 'feed' => 'add_to_feed',
926
- 'home' => 'add_to_home',
927
- 'category_archives' => 'add_to_category_archives',
928
- 'tag_archives' => 'add_to_tag_archives',
929
- 'other_archives' => 'add_to_archives',
930
- );
931
-
932
- foreach ( $add_to as $newkey => $oldkey ) {
933
- if ( $old_settings[ $oldkey ] ) {
934
- $settings['add_to'][ $newkey ] = $newkey;
935
- }
936
- unset( $settings[ $oldkey ] );
937
- }
938
-
939
- // Convert the activate_overall and activate_daily to the new settings format.
940
- $trackers = array(
941
- 'overall' => 'activate_overall',
942
- 'daily' => 'activate_daily',
943
- );
944
-
945
- foreach ( $trackers as $newkey => $oldkey ) {
946
- if ( $old_settings[ $oldkey ] ) {
947
- $settings['trackers'][ $newkey ] = $newkey;
948
- }
949
- unset( $settings[ $oldkey ] );
950
- }
951
-
952
- // Convert the track_{x} to the new settings format.
953
- $track_users = array(
954
- 'authors' => 'track_authors',
955
- 'editors' => 'track_editors',
956
- 'admins' => 'track_admins',
957
- );
958
-
959
- foreach ( $track_users as $newkey => $oldkey ) {
960
- if ( $old_settings[ $oldkey ] ) {
961
- $settings['track_users'][ $newkey ] = $newkey;
962
- }
963
- unset( $settings[ $oldkey ] );
964
- }
965
-
966
- // Convert 'blank_output' to the new format: true = 'blank' and false = 'custom_text'.
967
- $settings['blank_output'] = ! empty( $old_settings['blank_output'] ) ? 'blank' : 'custom_text';
968
-
969
- $settings['custom_css'] = $old_settings['custom_CSS'];
970
-
971
- return $settings;
972
-
973
- }
974
-
975
- /**
976
- * Get the various styles.
977
- *
978
- * @since 2.5.0
979
- * @return array Style options.
980
- */
981
- function tptn_get_styles() {
982
-
983
- $styles = array(
984
- array(
985
- 'id' => 'no_style',
986
- 'name' => esc_html__( 'No styles', 'top-10' ),
987
- 'description' => esc_html__( 'Select this option if you plan to add your own styles', 'top-10' ) . '<br />',
988
- ),
989
- array(
990
- 'id' => 'text_only',
991
- 'name' => esc_html__( 'Text only', 'top-10' ),
992
- 'description' => esc_html__( 'Disable thumbnails and no longer include the default style sheet included in the plugin', 'top-10' ) . '<br />',
993
- ),
994
- array(
995
- 'id' => 'left_thumbs',
996
- 'name' => esc_html__( 'Left thumbnails', 'top-10' ),
997
- 'description' => '<br /><img src="' . esc_url( plugins_url( 'includes/admin/images/tptn-left-thumbs.png', TOP_TEN_PLUGIN_FILE ) ) . '" width="350" /> <br />' . esc_html__( 'Enabling this option will set the post thumbnail to be before text. Disabling this option will not revert any settings.', 'top-10' ),
998
- ),
999
- );
1000
-
1001
- /**
1002
- * Filter the array containing the types of trackers to add your own.
1003
- *
1004
- * @since 2.5.0
1005
- *
1006
- * @param string $trackers Different trackers.
1007
- */
1008
- return apply_filters( 'tptn_get_styles', $styles );
1009
- }
67
  * Update an option
68
  *
69
  * Updates an tptn setting value in both the db and the global variable.
70
+ * Warning: Passing in a null value will remove
71
  * the key from the tptn_options array.
72
  *
73
  * @since 2.5.0
76
  * @param string|bool|int $value The value to set the key to.
77
  * @return boolean True if updated, false if not.
78
  */
79
+ function tptn_update_option( $key = '', $value = null ) {
80
 
81
  // If no key, exit.
82
  if ( empty( $key ) ) {
83
  return false;
84
  }
85
 
86
+ // If null value, delete.
87
+ if ( is_null( $value ) ) {
88
  $remove_option = tptn_delete_option( $key );
89
  return $remove_option;
90
  }
211
  add_action( 'admin_init', 'tptn_register_settings' );
212
 
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  /**
215
  * Flattens tptn_get_registered_settings() into $setting[id] => $setting[type] format.
216
  *
319
  delete_option( 'tptn_settings' );
320
  }
321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/save-settings.php CHANGED
@@ -31,18 +31,18 @@ function tptn_settings_sanitize( $input = array() ) {
31
  global $tptn_settings;
32
 
33
  // This should be set if a form is submitted, so let's save it in the $referrer variable.
34
- if ( empty( $_POST['_wp_http_referer'] ) ) {
35
  return $input;
36
  }
37
 
38
- parse_str( sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ), $referrer ); // Input var okay.
39
 
40
  // Get the various settings we've registered.
41
  $settings = tptn_get_registered_settings();
42
  $settings_types = tptn_get_registered_settings_types();
43
 
44
  // Check if we need to set to defaults.
45
- $reset = isset( $_POST['settings_reset'] );
46
 
47
  if ( $reset ) {
48
  tptn_settings_reset();
31
  global $tptn_settings;
32
 
33
  // This should be set if a form is submitted, so let's save it in the $referrer variable.
34
+ if ( empty( $_POST['_wp_http_referer'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
35
  return $input;
36
  }
37
 
38
+ parse_str( sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ), $referrer ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
39
 
40
  // Get the various settings we've registered.
41
  $settings = tptn_get_registered_settings();
42
  $settings_types = tptn_get_registered_settings_types();
43
 
44
  // Check if we need to set to defaults.
45
+ $reset = isset( $_POST['settings_reset'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
46
 
47
  if ( $reset ) {
48
  tptn_settings_reset();
includes/admin/settings-page.php CHANGED
@@ -24,7 +24,7 @@ if ( ! defined( 'WPINC' ) ) {
24
  * @return void
25
  */
26
  function tptn_options_page() {
27
- $active_tab = isset( $_GET['tab'] ) && array_key_exists( sanitize_key( wp_unslash( $_GET['tab'] ) ), tptn_get_settings_sections() ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : 'general'; // Input var okay.
28
 
29
  ob_start();
30
  ?>
@@ -110,7 +110,7 @@ function tptn_options_page() {
110
  </div><!-- /.wrap -->
111
 
112
  <?php
113
- echo ob_get_clean(); // WPCS: XSS OK.
114
  }
115
 
116
  /**
@@ -177,7 +177,7 @@ function tptn_header_callback( $args ) {
177
  * @param string $html HTML string.
178
  * @param array $args Arguments array.
179
  */
180
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
181
  }
182
 
183
 
@@ -217,7 +217,7 @@ function tptn_text_callback( $args ) {
217
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
218
 
219
  /** This filter has been defined in settings-page.php */
220
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
221
  }
222
 
223
 
@@ -272,7 +272,7 @@ function tptn_textarea_callback( $args ) {
272
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
273
 
274
  /** This filter has been defined in settings-page.php */
275
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
276
  }
277
 
278
 
@@ -303,17 +303,17 @@ function tptn_checkbox_callback( $args ) {
303
  // First, we read the options collection.
304
  global $tptn_settings;
305
 
306
- $checked = ! empty( $tptn_settings[ $args['id'] ] ) ? checked( 1, $tptn_settings[ $args['id'] ], false ) : '';
307
  $default = isset( $args['options'] ) ? $args['options'] : '';
308
- $set = isset( $tptn_settings[ $args['id'] ] ) ? $tptn_settings[ $args['id'] ] : '';
 
309
 
310
  $html = sprintf( '<input type="hidden" name="tptn_settings[%1$s]" value="-1" />', sanitize_key( $args['id'] ) );
311
  $html .= sprintf( '<input type="checkbox" id="tptn_settings[%1$s]" name="tptn_settings[%1$s]" value="1" %2$s />', sanitize_key( $args['id'] ), $checked );
312
- $html .= ( $set <> $default ) ? '<em style="color:orange"> ' . esc_html__( 'Modified from default setting', 'top-10' ) . '</em>' : '';
313
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
314
 
315
  /** This filter has been defined in settings-page.php */
316
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
317
  }
318
 
319
 
@@ -349,7 +349,7 @@ function tptn_multicheck_callback( $args ) {
349
  }
350
 
351
  /** This filter has been defined in settings-page.php */
352
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
353
  }
354
 
355
 
@@ -383,7 +383,7 @@ function tptn_radio_callback( $args ) {
383
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
384
 
385
  /** This filter has been defined in settings-page.php */
386
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
387
  }
388
 
389
 
@@ -418,7 +418,7 @@ function tptn_radiodesc_callback( $args ) {
418
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
419
 
420
  /** This filter has been defined in settings-page.php */
421
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
422
  }
423
 
424
 
@@ -461,7 +461,7 @@ function tptn_thumbsizes_callback( $args ) {
461
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
462
 
463
  /** This filter has been defined in settings-page.php */
464
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
465
  }
466
 
467
 
@@ -494,7 +494,7 @@ function tptn_number_callback( $args ) {
494
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
495
 
496
  /** This filter has been defined in settings-page.php */
497
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
498
  }
499
 
500
 
@@ -533,7 +533,7 @@ function tptn_select_callback( $args ) {
533
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
534
 
535
  /** This filter has been defined in settings-page.php */
536
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
537
  }
538
 
539
 
@@ -551,7 +551,7 @@ function tptn_descriptive_text_callback( $args ) {
551
  $html = '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
552
 
553
  /** This filter has been defined in settings-page.php */
554
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
555
  }
556
 
557
 
@@ -602,7 +602,7 @@ function tptn_posttypes_callback( $args ) {
602
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
603
 
604
  /** This filter has been defined in settings-page.php */
605
- echo apply_filters( 'tptn_after_setting_output', $html, $args ); // WPCS: XSS OK.
606
  }
607
 
608
 
@@ -615,7 +615,7 @@ function tptn_posttypes_callback( $args ) {
615
  */
616
  function tptn_tags_search() {
617
 
618
- if ( ! isset( $_REQUEST['tax'] ) ) {
619
  wp_die( 0 );
620
  }
621
 
@@ -629,7 +629,7 @@ function tptn_tags_search() {
629
  wp_die( -1 );
630
  }
631
 
632
- $s = wp_unslash( $_REQUEST['q'] );
633
 
634
  $comma = _x( ',', 'tag delimiter' );
635
  if ( ',' !== $comma ) {
24
  * @return void
25
  */
26
  function tptn_options_page() {
27
+ $active_tab = isset( $_GET['tab'] ) && array_key_exists( sanitize_key( wp_unslash( $_GET['tab'] ) ), tptn_get_settings_sections() ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
28
 
29
  ob_start();
30
  ?>
110
  </div><!-- /.wrap -->
111
 
112
  <?php
113
+ echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
114
  }
115
 
116
  /**
177
  * @param string $html HTML string.
178
  * @param array $args Arguments array.
179
  */
180
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
181
  }
182
 
183
 
217
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
218
 
219
  /** This filter has been defined in settings-page.php */
220
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
221
  }
222
 
223
 
272
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
273
 
274
  /** This filter has been defined in settings-page.php */
275
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
276
  }
277
 
278
 
303
  // First, we read the options collection.
304
  global $tptn_settings;
305
 
 
306
  $default = isset( $args['options'] ) ? $args['options'] : '';
307
+ $set = isset( $tptn_settings[ $args['id'] ] ) ? $tptn_settings[ $args['id'] ] : tptn_get_default_option( $args['id'] );
308
+ $checked = ! empty( $set ) ? checked( 1, (int) $set, false ) : '';
309
 
310
  $html = sprintf( '<input type="hidden" name="tptn_settings[%1$s]" value="-1" />', sanitize_key( $args['id'] ) );
311
  $html .= sprintf( '<input type="checkbox" id="tptn_settings[%1$s]" name="tptn_settings[%1$s]" value="1" %2$s />', sanitize_key( $args['id'] ), $checked );
312
+ $html .= ( $set <> $default ) ? '<em style="color:orange"> ' . esc_html__( 'Modified from default setting', 'top-10' ) . '</em>' : ''; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
313
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
314
 
315
  /** This filter has been defined in settings-page.php */
316
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
317
  }
318
 
319
 
349
  }
350
 
351
  /** This filter has been defined in settings-page.php */
352
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
353
  }
354
 
355
 
383
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
384
 
385
  /** This filter has been defined in settings-page.php */
386
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
387
  }
388
 
389
 
418
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
419
 
420
  /** This filter has been defined in settings-page.php */
421
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
422
  }
423
 
424
 
461
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
462
 
463
  /** This filter has been defined in settings-page.php */
464
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
465
  }
466
 
467
 
494
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
495
 
496
  /** This filter has been defined in settings-page.php */
497
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
498
  }
499
 
500
 
533
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
534
 
535
  /** This filter has been defined in settings-page.php */
536
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
537
  }
538
 
539
 
551
  $html = '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
552
 
553
  /** This filter has been defined in settings-page.php */
554
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
555
  }
556
 
557
 
602
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
603
 
604
  /** This filter has been defined in settings-page.php */
605
+ echo apply_filters( 'tptn_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
606
  }
607
 
608
 
615
  */
616
  function tptn_tags_search() {
617
 
618
+ if ( ! isset( $_REQUEST['tax'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
619
  wp_die( 0 );
620
  }
621
 
629
  wp_die( -1 );
630
  }
631
 
632
+ $s = isset( $_REQUEST['q'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['q'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
633
 
634
  $comma = _x( ',', 'tag delimiter' );
635
  if ( ',' !== $comma ) {
includes/admin/tools.php CHANGED
@@ -91,7 +91,7 @@ function tptn_tools_page() {
91
  <?php esc_html_e( 'Deletes and reinitializes the primary key in the database tables. If the above function gives an error, then you can run the below code in phpMyAdmin or Adminer. Remember to backup your database first!', 'top-10' ); ?>
92
  </p>
93
  <p>
94
- <code style="display:block;"><?php echo tptn_recreate_primary_key_html(); // WPCS: XSS ok. ?></code>
95
  </p>
96
 
97
  <h2 style="padding-left:0px"><?php esc_html_e( 'Reset database', 'top-10' ); ?></h2>
@@ -143,7 +143,7 @@ function tptn_tools_page() {
143
  </div><!-- /.wrap -->
144
 
145
  <?php
146
- echo ob_get_clean(); // WPCS: XSS OK.
147
  }
148
 
149
  /**
@@ -161,9 +161,9 @@ function tptn_clean_duplicates( $daily = false ) {
161
  $table_name .= '_daily';
162
  }
163
 
164
- $wpdb->query( 'CREATE TEMPORARY TABLE ' . $table_name . '_temp AS SELECT * FROM ' . $table_name . ' GROUP BY postnumber' ); // WPCS: unprepared SQL OK.
165
- $wpdb->query( "TRUNCATE TABLE $table_name" ); // WPCS: unprepared SQL OK.
166
- $wpdb->query( 'INSERT INTO ' . $table_name . ' SELECT * FROM ' . $table_name . '_temp' ); // WPCS: unprepared SQL OK.
167
  }
168
 
169
 
@@ -183,7 +183,7 @@ function tptn_merge_blogids( $daily = false ) {
183
  }
184
 
185
  if ( $daily ) {
186
- $wpdb->query( // WPCS: unprepared SQL OK.
187
  "
188
  INSERT INTO `$table_name` (postnumber, cntaccess, dp_date, blog_id) (
189
  SELECT
@@ -198,7 +198,7 @@ function tptn_merge_blogids( $daily = false ) {
198
  "
199
  );
200
  } else {
201
- $wpdb->query( // WPCS: unprepared SQL OK.
202
  "
203
  INSERT INTO `$table_name` (postnumber, cntaccess, blog_id) (
204
  SELECT
@@ -213,7 +213,7 @@ function tptn_merge_blogids( $daily = false ) {
213
  );
214
  }
215
 
216
- $wpdb->query( "DELETE FROM $table_name WHERE blog_id = 0" ); // WPCS: unprepared SQL OK.
217
  }
218
 
219
  /**
@@ -229,15 +229,15 @@ function tptn_recreate_primary_key() {
229
 
230
  $wpdb->hide_errors();
231
 
232
- if ( $wpdb->query( $wpdb->prepare( "SHOW INDEXES FROM {$table_name} WHERE Key_name = %s", 'PRIMARY' ) ) ) {
233
- $wpdb->query( 'ALTER TABLE ' . $table_name . ' DROP PRIMARY KEY ' ); // WPCS: unprepared SQL OK.
234
  }
235
- if ( $wpdb->query( $wpdb->prepare( "SHOW INDEXES FROM {$table_name_daily} WHERE Key_name = %s", 'PRIMARY' ) ) ) {
236
- $wpdb->query( 'ALTER TABLE ' . $table_name_daily . ' DROP PRIMARY KEY ' ); // WPCS: unprepared SQL OK.
237
  }
238
 
239
- $wpdb->query( 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY(postnumber, blog_id) ' ); // WPCS: unprepared SQL OK.
240
- $wpdb->query( 'ALTER TABLE ' . $table_name_daily . ' ADD PRIMARY KEY(postnumber, dp_date, blog_id) ' ); // WPCS: unprepared SQL OK.
241
 
242
  $wpdb->show_errors();
243
  }
91
  <?php esc_html_e( 'Deletes and reinitializes the primary key in the database tables. If the above function gives an error, then you can run the below code in phpMyAdmin or Adminer. Remember to backup your database first!', 'top-10' ); ?>
92
  </p>
93
  <p>
94
+ <code style="display:block;"><?php echo tptn_recreate_primary_key_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></code>
95
  </p>
96
 
97
  <h2 style="padding-left:0px"><?php esc_html_e( 'Reset database', 'top-10' ); ?></h2>
143
  </div><!-- /.wrap -->
144
 
145
  <?php
146
+ echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
147
  }
148
 
149
  /**
161
  $table_name .= '_daily';
162
  }
163
 
164
+ $wpdb->query( 'CREATE TEMPORARY TABLE ' . $table_name . '_temp AS SELECT * FROM ' . $table_name . ' GROUP BY postnumber' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange
165
+ $wpdb->query( "TRUNCATE TABLE $table_name" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
166
+ $wpdb->query( 'INSERT INTO ' . $table_name . ' SELECT * FROM ' . $table_name . '_temp' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
167
  }
168
 
169
 
183
  }
184
 
185
  if ( $daily ) {
186
+ $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
187
  "
188
  INSERT INTO `$table_name` (postnumber, cntaccess, dp_date, blog_id) (
189
  SELECT
198
  "
199
  );
200
  } else {
201
+ $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
202
  "
203
  INSERT INTO `$table_name` (postnumber, cntaccess, blog_id) (
204
  SELECT
213
  );
214
  }
215
 
216
+ $wpdb->query( "DELETE FROM $table_name WHERE blog_id = 0" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
217
  }
218
 
219
  /**
229
 
230
  $wpdb->hide_errors();
231
 
232
+ if ( $wpdb->query( $wpdb->prepare( "SHOW INDEXES FROM {$table_name} WHERE Key_name = %s", 'PRIMARY' ) ) ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
233
+ $wpdb->query( 'ALTER TABLE ' . $table_name . ' DROP PRIMARY KEY ' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange
234
  }
235
+ if ( $wpdb->query( $wpdb->prepare( "SHOW INDEXES FROM {$table_name_daily} WHERE Key_name = %s", 'PRIMARY' ) ) ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
236
+ $wpdb->query( 'ALTER TABLE ' . $table_name_daily . ' DROP PRIMARY KEY ' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange
237
  }
238
 
239
+ $wpdb->query( 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY(postnumber, blog_id) ' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange
240
+ $wpdb->query( 'ALTER TABLE ' . $table_name_daily . ' ADD PRIMARY KEY(postnumber, dp_date, blog_id) ' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange
241
 
242
  $wpdb->show_errors();
243
  }
includes/counter.php CHANGED
@@ -19,7 +19,7 @@ function tptn_pc_content( $content ) {
19
  $add_to = tptn_get_option( 'add_to', false );
20
 
21
  if ( isset( $post ) ) {
22
- if ( in_array( $post->ID, $exclude_on_post_ids ) ) {
23
  return $content; // Exit without adding related posts.
24
  }
25
  }
@@ -96,7 +96,7 @@ function echo_tptn_post_count( $echo = 1 ) {
96
  $nonce = wp_create_nonce( $nonce_action );
97
 
98
  if ( tptn_get_option( 'dynamic_post_count' ) ) {
99
- $output = '<div class="tptn_counter" id="tptn_counter_' . $id . '"><script type="text/javascript" data-cfasync="false" src="' . $home_url . '?top_ten_id=' . $id . '&amp;view_counter=1&amp;_wpnonce=' . $nonce . '"></script></div>';
100
  } else {
101
  $output = '<div class="tptn_counter" id="tptn_counter_' . $id . '">' . get_tptn_post_count( $id ) . '</div>';
102
  }
@@ -111,7 +111,7 @@ function echo_tptn_post_count( $echo = 1 ) {
111
  $output = apply_filters( 'tptn_view_post_count', $output );
112
 
113
  if ( $echo ) {
114
- echo $output; // WPCS: XSS OK.
115
  } else {
116
  return $output;
117
  }
@@ -136,34 +136,34 @@ function get_tptn_post_count( $id = false, $blog_id = false ) {
136
 
137
  // Total count per post.
138
  if ( ( false !== strpos( $count_disp_form, '%totalcount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%totalcount%' ) ) ) {
139
- if ( ( 0 == $totalcntaccess ) && ( ! is_singular() ) ) {
140
  $count_disp_form_zero = str_replace( '%totalcount%', $totalcntaccess, $count_disp_form_zero );
141
  } else {
142
- $count_disp_form = str_replace( '%totalcount%', ( 0 == $totalcntaccess ? $totalcntaccess + 1 : $totalcntaccess ), $count_disp_form );
143
  }
144
  }
145
 
146
  // Now process daily count.
147
  if ( ( false !== strpos( $count_disp_form, '%dailycount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%dailycount%' ) ) ) {
148
  $cntaccess = get_tptn_post_count_only( $id, 'daily' );
149
- if ( ( 0 == $totalcntaccess ) && ( ! is_singular() ) ) {
150
  $count_disp_form_zero = str_replace( '%dailycount%', $cntaccess, $count_disp_form_zero );
151
  } else {
152
- $count_disp_form = str_replace( '%dailycount%', ( 0 == $cntaccess ? $cntaccess + 1 : $cntaccess ), $count_disp_form );
153
  }
154
  }
155
 
156
  // Now process overall count.
157
  if ( ( false !== strpos( $count_disp_form, '%overallcount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%overallcount%' ) ) ) {
158
  $cntaccess = get_tptn_post_count_only( $id, 'overall' );
159
- if ( ( 0 == $cntaccess ) && ( ! is_singular() ) ) {
160
  $count_disp_form_zero = str_replace( '%overallcount%', $cntaccess, $count_disp_form_zero );
161
  } else {
162
- $count_disp_form = str_replace( '%overallcount%', ( 0 == $cntaccess ? $cntaccess + 1 : $cntaccess ), $count_disp_form );
163
  }
164
  }
165
 
166
- if ( ( 0 == $totalcntaccess ) && ( ! is_singular() ) ) {
167
  return apply_filters( 'tptn_post_count', $count_disp_form_zero );
168
  } else {
169
  return apply_filters( 'tptn_post_count', $count_disp_form );
@@ -197,32 +197,36 @@ function get_tptn_post_count_only( $id = false, $count = 'total', $blog_id = fal
197
  if ( $id > 0 ) {
198
  switch ( $count ) {
199
  case 'total':
200
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // WPCS: unprepared SQL OK.
201
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->cntaccess : 0 ) );
202
  break;
203
  case 'daily':
204
  $daily_range = tptn_get_option( 'daily_range' );
205
  $hour_range = tptn_get_option( 'hour_range' );
206
 
207
- if ( tptn_get_option( 'daily_midnight' ) ) {
208
- $current_time = current_time( 'timestamp', 0 );
209
- $from_date = $current_time - ( max( 0, ( $daily_range - 1 ) ) * DAY_IN_SECONDS );
210
- $from_date = gmdate( 'Y-m-d 0', $from_date );
211
- } else {
212
- $current_time = current_time( 'timestamp', 0 );
213
- $from_date = $current_time - ( $daily_range * DAY_IN_SECONDS + $hour_range * HOUR_IN_SECONDS );
214
- $from_date = gmdate( 'Y-m-d H', $from_date );
215
- }
216
-
217
- $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as sum_count FROM {$table_name_daily} WHERE postnumber = %d AND blog_id = %d AND dp_date >= %s GROUP BY postnumber ", array( $id, $blog_id, $from_date ) ) ); // WPCS: unprepared SQL OK.
218
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
219
  break;
220
  case 'overall':
221
- $resultscount = $wpdb->get_row( 'SELECT SUM(cntaccess) as sum_count FROM ' . $table_name ); // WPCS: unprepared SQL OK.
222
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
223
  break;
224
  }
225
- return apply_filters( 'tptn_post_count_only', $cntaccess );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  } else {
227
  return 0;
228
  }
19
  $add_to = tptn_get_option( 'add_to', false );
20
 
21
  if ( isset( $post ) ) {
22
+ if ( in_array( $post->ID, $exclude_on_post_ids ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
23
  return $content; // Exit without adding related posts.
24
  }
25
  }
96
  $nonce = wp_create_nonce( $nonce_action );
97
 
98
  if ( tptn_get_option( 'dynamic_post_count' ) ) {
99
+ $output = '<div class="tptn_counter" id="tptn_counter_' . $id . '"><script type="text/javascript" data-cfasync="false" src="' . $home_url . '?top_ten_id=' . $id . '&amp;view_counter=1&amp;_wpnonce=' . $nonce . '"></script></div>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
100
  } else {
101
  $output = '<div class="tptn_counter" id="tptn_counter_' . $id . '">' . get_tptn_post_count( $id ) . '</div>';
102
  }
111
  $output = apply_filters( 'tptn_view_post_count', $output );
112
 
113
  if ( $echo ) {
114
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
115
  } else {
116
  return $output;
117
  }
136
 
137
  // Total count per post.
138
  if ( ( false !== strpos( $count_disp_form, '%totalcount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%totalcount%' ) ) ) {
139
+ if ( ( 0 === (int) $totalcntaccess ) && ( ! is_singular() ) ) {
140
  $count_disp_form_zero = str_replace( '%totalcount%', $totalcntaccess, $count_disp_form_zero );
141
  } else {
142
+ $count_disp_form = str_replace( '%totalcount%', ( 0 === (int) $totalcntaccess ? $totalcntaccess + 1 : $totalcntaccess ), $count_disp_form );
143
  }
144
  }
145
 
146
  // Now process daily count.
147
  if ( ( false !== strpos( $count_disp_form, '%dailycount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%dailycount%' ) ) ) {
148
  $cntaccess = get_tptn_post_count_only( $id, 'daily' );
149
+ if ( ( 0 === (int) $totalcntaccess ) && ( ! is_singular() ) ) {
150
  $count_disp_form_zero = str_replace( '%dailycount%', $cntaccess, $count_disp_form_zero );
151
  } else {
152
+ $count_disp_form = str_replace( '%dailycount%', ( 0 === (int) $cntaccess ? $cntaccess + 1 : $cntaccess ), $count_disp_form );
153
  }
154
  }
155
 
156
  // Now process overall count.
157
  if ( ( false !== strpos( $count_disp_form, '%overallcount%' ) ) || ( false !== strpos( $count_disp_form_zero, '%overallcount%' ) ) ) {
158
  $cntaccess = get_tptn_post_count_only( $id, 'overall' );
159
+ if ( ( 0 === (int) $cntaccess ) && ( ! is_singular() ) ) {
160
  $count_disp_form_zero = str_replace( '%overallcount%', $cntaccess, $count_disp_form_zero );
161
  } else {
162
+ $count_disp_form = str_replace( '%overallcount%', ( 0 === (int) $cntaccess ? $cntaccess + 1 : $cntaccess ), $count_disp_form );
163
  }
164
  }
165
 
166
+ if ( ( 0 === (int) $totalcntaccess ) && ( ! is_singular() ) ) {
167
  return apply_filters( 'tptn_post_count', $count_disp_form_zero );
168
  } else {
169
  return apply_filters( 'tptn_post_count', $count_disp_form );
197
  if ( $id > 0 ) {
198
  switch ( $count ) {
199
  case 'total':
200
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, cntaccess as visits FROM {$table_name} WHERE postnumber = %d AND blog_id = %d ", $id, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
 
201
  break;
202
  case 'daily':
203
  $daily_range = tptn_get_option( 'daily_range' );
204
  $hour_range = tptn_get_option( 'hour_range' );
205
 
206
+ $from_date = tptn_get_from_date();
207
+
208
+ $resultscount = $wpdb->get_row( $wpdb->prepare( "SELECT postnumber, SUM(cntaccess) as visits FROM {$table_name_daily} WHERE postnumber = %d AND blog_id = %d AND dp_date >= %s GROUP BY postnumber ", array( $id, $blog_id, $from_date ) ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
 
 
 
 
 
 
 
 
 
209
  break;
210
  case 'overall':
211
+ $resultscount = $wpdb->get_row( 'SELECT SUM(cntaccess) as visits FROM ' . $table_name ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
 
212
  break;
213
  }
214
+
215
+ $visits = ( $resultscount ) ? $resultscount->visits : 0;
216
+
217
+ $string = tptn_number_format_i18n( $visits );
218
+
219
+ /**
220
+ * Returns the post count.
221
+ *
222
+ * @since 2.6.0
223
+ *
224
+ * @param string $string Formatted post count.
225
+ * @param mixed $id Post ID.
226
+ * @param string $count Which count to return? total, daily or overall.
227
+ * @param bool $blog_id Blog ID.
228
+ */
229
+ return apply_filters( 'tptn_post_count_only', $string, $id, $count, $blog_id );
230
  } else {
231
  return 0;
232
  }
includes/cron.php CHANGED
@@ -30,12 +30,12 @@ function tptn_cron() {
30
  $from_date = strtotime( "-{$delete_from} DAY", $current_time );
31
  $from_date = gmdate( 'Y-m-d H', $from_date );
32
 
33
- $resultscount = $wpdb->query(
34
  $wpdb->prepare(
35
- "DELETE FROM {$table_name_daily} WHERE dp_date <= %s ",
36
  $from_date
37
  )
38
- ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
39
 
40
  }
41
  add_action( 'tptn_cron_hook', 'tptn_cron' );
30
  $from_date = strtotime( "-{$delete_from} DAY", $current_time );
31
  $from_date = gmdate( 'Y-m-d H', $from_date );
32
 
33
+ $resultscount = $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
34
  $wpdb->prepare(
35
+ "DELETE FROM {$table_name_daily} WHERE dp_date <= %s ", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
36
  $from_date
37
  )
38
+ );
39
 
40
  }
41
  add_action( 'tptn_cron_hook', 'tptn_cron' );
includes/deprecated.php CHANGED
@@ -76,10 +76,17 @@ function tptn_add_viewed_count( $content = '' ) {
76
 
77
  if ( is_singular() && 'draft' !== $post->post_status ) {
78
 
79
- $current_user = wp_get_current_user(); // Let's get the current user.
80
- $post_author = ( $current_user->ID == $post->post_author ) ? true : false; // Is the current user the post author?
81
- $current_user_admin = ( current_user_can( 'manage_options' ) ) ? true : false; // Is the current user an admin?
82
- $current_user_editor = ( ( current_user_can( 'edit_others_posts' ) ) && ( ! current_user_can( 'manage_options' ) ) ) ? true : false; // Is the current user an editor?
 
 
 
 
 
 
 
83
 
84
  $include_code = true;
85
  if ( ( $post_author ) && ( empty( $track_users['authors'] ) ) ) {
@@ -127,7 +134,7 @@ function tptn_add_viewed_count( $content = '' ) {
127
  */
128
  $output = apply_filters( 'tptn_viewed_count', $output );
129
 
130
- echo $output; // WPCS: XSS OK.
131
  }
132
  }
133
  }
@@ -148,7 +155,7 @@ function tptn_add_tracker( $echo = true ) {
148
  _deprecated_function( __FUNCTION__, '2.4.0' );
149
 
150
  if ( $echo ) {
151
- echo tptn_add_viewed_count( '' ); // WPCS: XSS OK.
152
  } else {
153
  return tptn_add_viewed_count( '' );
154
  }
76
 
77
  if ( is_singular() && 'draft' !== $post->post_status ) {
78
 
79
+ // Let's get the current user.
80
+ $current_user = wp_get_current_user();
81
+
82
+ // Is the current user the post author?
83
+ $post_author = ( $current_user->ID == $post->post_author ) ? true : false; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
84
+
85
+ // Is the current user an admin?
86
+ $current_user_admin = ( current_user_can( 'manage_options' ) ) ? true : false;
87
+
88
+ // Is the current user an editor?
89
+ $current_user_editor = ( ( current_user_can( 'edit_others_posts' ) ) && ( ! current_user_can( 'manage_options' ) ) ) ? true : false;
90
 
91
  $include_code = true;
92
  if ( ( $post_author ) && ( empty( $track_users['authors'] ) ) ) {
134
  */
135
  $output = apply_filters( 'tptn_viewed_count', $output );
136
 
137
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
138
  }
139
  }
140
  }
155
  _deprecated_function( __FUNCTION__, '2.4.0' );
156
 
157
  if ( $echo ) {
158
+ echo tptn_add_viewed_count( '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
159
  } else {
160
  return tptn_add_viewed_count( '' );
161
  }
includes/helpers.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Helper functions
4
+ *
5
+ * @package Top_Ten
6
+ */
7
+
8
+ /**
9
+ * Function to delete all rows in the posts table.
10
+ *
11
+ * @since 1.3
12
+ * @param bool $daily Daily flag.
13
+ */
14
+ function tptn_trunc_count( $daily = true ) {
15
+ global $wpdb;
16
+
17
+ $table_name = $wpdb->base_prefix . 'top_ten';
18
+ if ( $daily ) {
19
+ $table_name .= '_daily';
20
+ }
21
+
22
+ $sql = "TRUNCATE TABLE $table_name";
23
+ $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
24
+ }
25
+
26
+
27
+ /**
28
+ * Retrieve the from date for the query
29
+ *
30
+ * @since 2.6.0
31
+ *
32
+ * @param string $time A date/time string.
33
+ * @return string From date
34
+ */
35
+ function tptn_get_from_date( $time = null ) {
36
+
37
+ $current_time = isset( $time ) ? strtotime( $time ) : current_time( 'timestamp', 0 );
38
+
39
+ if ( tptn_get_option( 'daily_midnight' ) ) {
40
+ $from_date = $current_time - ( max( 0, ( tptn_get_option( 'daily_range' ) - 1 ) ) * DAY_IN_SECONDS );
41
+ $from_date = gmdate( 'Y-m-d 0', $from_date );
42
+ } else {
43
+ $from_date = $current_time - ( tptn_get_option( 'daily_range' ) * DAY_IN_SECONDS + tptn_get_option( 'hour_range' ) * HOUR_IN_SECONDS );
44
+ $from_date = gmdate( 'Y-m-d H', $from_date );
45
+ }
46
+
47
+ /**
48
+ * Retrieve the from date for the query
49
+ *
50
+ * @since 2.6.0
51
+ *
52
+ * @param string $time From date.
53
+ */
54
+ return apply_filters( 'tptn_get_from_date', $from_date );
55
+ }
56
+
57
+
58
+ /**
59
+ * Convert float number to format based on the locale if number_format_count is true.
60
+ *
61
+ * @since 2.6.0
62
+ *
63
+ * @param float $number The number to convert based on locale.
64
+ * @param int $decimals Optional. Precision of the number of decimal places. Default 0.
65
+ * @return string Converted number in string format.
66
+ */
67
+ function tptn_number_format_i18n( $number, $decimals = 0 ) {
68
+
69
+ $formatted = $number;
70
+
71
+ if ( tptn_get_option( 'number_format_count' ) ) {
72
+ $formatted = number_format_i18n( $number );
73
+ }
74
+
75
+ /**
76
+ * Filters the number formatted based on the locale.
77
+ *
78
+ * @since 2.6.0
79
+ *
80
+ * @param string $formatted Converted number in string format.
81
+ * @param float $number The number to convert based on locale.
82
+ * @param int $decimals Precision of the number of decimal places.
83
+ */
84
+ return apply_filters( 'number_format_i18n', $formatted, $number, $decimals );
85
+ }
includes/js/{top-10-tracker.js → top-10-tracker.min.js} RENAMED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){var data={'action':'tptn_tracker','top_ten_id':ajax_tptn_tracker.top_ten_id,'top_ten_blog_id':ajax_tptn_tracker.top_ten_blog_id,'activate_counter':ajax_tptn_tracker.activate_counter};jQuery.post(ajax_tptn_tracker.ajax_url,data);});
1
+ jQuery(document).ready(function($){var data={'action':'tptn_tracker','top_ten_id':ajax_tptn_tracker.top_ten_id,'top_ten_blog_id':ajax_tptn_tracker.top_ten_blog_id,'activate_counter':ajax_tptn_tracker.activate_counter,'top_ten_debug':ajax_tptn_tracker.top_ten_debug};jQuery.post(ajax_tptn_tracker.ajax_url,data);});
includes/modules/class-top-ten-count-widget.php CHANGED
@@ -6,7 +6,7 @@
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
- * @copyright 2008-2016 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
@@ -101,23 +101,17 @@ class Top_Ten_Count_Widget extends WP_Widget {
101
  * @param array $instance Saved values from database.
102
  */
103
  public function widget( $args, $instance ) {
104
- global $wpdb;
105
-
106
- $table_name = $wpdb->base_prefix . 'top_ten';
107
 
108
  $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'] );
109
 
110
- $resultscount = $wpdb->get_row( 'SELECT SUM(cntaccess) as sum_count FROM ' . $table_name ); // WPCS: unprepared SQL OK.
111
- $cntaccess = number_format_i18n( ( ( $resultscount ) ? $resultscount->sum_count : 0 ) );
112
-
113
  $output = $args['before_widget'];
114
  $output .= $args['before_title'] . $title . $args['after_title'];
115
 
116
- $output .= $cntaccess;
117
 
118
  $output .= $args['after_widget'];
119
 
120
- echo $output; // WPCS: XSS OK.
121
 
122
  } //ending function widget
123
 
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
+ * @copyright 2008-2019 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
101
  * @param array $instance Saved values from database.
102
  */
103
  public function widget( $args, $instance ) {
 
 
 
104
 
105
  $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'] );
106
 
 
 
 
107
  $output = $args['before_widget'];
108
  $output .= $args['before_title'] . $title . $args['after_title'];
109
 
110
+ $output .= get_tptn_post_count_only( 1, 'overall', 0 );
111
 
112
  $output .= $args['after_widget'];
113
 
114
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
115
 
116
  } //ending function widget
117
 
includes/modules/class-top-ten-widget.php CHANGED
@@ -6,7 +6,7 @@
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
- * @copyright 2008-2016 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
@@ -298,7 +298,7 @@ class Top_Ten_Widget extends WP_Widget {
298
 
299
  $output .= $args['after_widget'];
300
 
301
- echo $output; // WPCS: XSS OK.
302
 
303
  } //ending function widget
304
 
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
+ * @copyright 2008-2019 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
298
 
299
  $output .= $args['after_widget'];
300
 
301
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
302
 
303
  } //ending function widget
304
 
includes/modules/exclusions.php CHANGED
@@ -18,7 +18,7 @@ function tptn_exclude_post_ids( $exclude_post_ids ) {
18
 
19
  $exclude_post_ids = (array) $exclude_post_ids;
20
 
21
- $tptn_post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE `meta_key` = 'tptn_post_meta'", ARRAY_A );
22
 
23
  foreach ( $tptn_post_metas as $tptn_post_meta ) {
24
  $meta_value = maybe_unserialize( $tptn_post_meta['meta_value'] );
18
 
19
  $exclude_post_ids = (array) $exclude_post_ids;
20
 
21
+ $tptn_post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE `meta_key` = 'tptn_post_meta'", ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
22
 
23
  foreach ( $tptn_post_metas as $tptn_post_meta ) {
24
  $meta_value = maybe_unserialize( $tptn_post_meta['meta_value'] );
includes/public/display-posts.php CHANGED
@@ -22,7 +22,7 @@ function tptn_pop_posts( $args ) {
22
  global $tptn_settings;
23
 
24
  // if set, save $exclude_categories.
25
- if ( isset( $args['exclude_categories'] ) && '' != $args['exclude_categories'] ) { // WPCS: loose comparison ok.
26
  $exclude_categories = explode( ',', $args['exclude_categories'] );
27
  $args['strict_limit'] = false;
28
  }
@@ -127,7 +127,7 @@ function tptn_pop_posts( $args ) {
127
  $resultid = tptn_object_id_cur_lang( $result->ID );
128
 
129
  // If this is NULL or already processed ID or matches current post then skip processing this loop.
130
- if ( ! $resultid || in_array( $resultid, $processed_results ) ) {
131
  continue;
132
  }
133
 
@@ -154,7 +154,7 @@ function tptn_pop_posts( $args ) {
154
 
155
  $p_in_c = false; // Variable to check if post exists in a particular category.
156
  foreach ( $categorys as $cat ) { // Loop to check if post exists in excluded category.
157
- $p_in_c = ( in_array( $cat->cat_ID, $exclude_categories ) ) ? true : false;
158
  if ( $p_in_c ) {
159
  break; // Skip loop execution and go to the next step.
160
  }
@@ -173,7 +173,7 @@ function tptn_pop_posts( $args ) {
173
  }
174
 
175
  if ( $args['show_date'] ) {
176
- $output .= '<span class="tptn_date"> ' . mysql2date( get_option( 'date_format', 'd/m/y' ), $result->post_date ) . '</span> ';
177
  }
178
 
179
  if ( $args['show_excerpt'] ) {
@@ -182,29 +182,16 @@ function tptn_pop_posts( $args ) {
182
 
183
  if ( $args['disp_list_count'] ) {
184
 
185
- $tptn_list_count = '(' . number_format_i18n( $sum_count ) . ')';
186
-
187
- /**
188
- * Filter the formatted list count text.
189
- *
190
- * @since 2.1.0
191
- *
192
- * @param string $tptn_list_count Formatted list count
193
- * @param int $sum_count Post count
194
- * @param object $result Post object
195
- */
196
- $tptn_list_count = apply_filters( 'tptn_list_count', $tptn_list_count, $sum_count, $result );
197
-
198
- $output .= ' <span class="tptn_list_count">' . $tptn_list_count . '</span>';
199
  }
200
 
201
  $tptn_list = '';
202
  /**
203
- * Filter Formatted list item with link and and thumbnail.
204
  *
205
  * @since 2.2.0
206
  *
207
- * @param string $tptn_list
208
  * @param object $result Object of the current post result
209
  * @param array $args Array of arguments
210
  */
@@ -340,15 +327,7 @@ function get_tptn_pop_posts( $args = array() ) {
340
 
341
  $blog_id = get_current_blog_id();
342
 
343
- if ( $args['daily_midnight'] ) {
344
- $current_time = current_time( 'timestamp', 0 );
345
- $from_date = $current_time - ( max( 0, ( $args['daily_range'] - 1 ) ) * DAY_IN_SECONDS );
346
- $from_date = gmdate( 'Y-m-d 0', $from_date );
347
- } else {
348
- $current_time = current_time( 'timestamp', 0 );
349
- $from_date = $current_time - ( $args['daily_range'] * DAY_IN_SECONDS + $args['hour_range'] * HOUR_IN_SECONDS );
350
- $from_date = gmdate( 'Y-m-d H', $from_date );
351
- }
352
 
353
  /**
354
  *
@@ -357,21 +336,21 @@ function get_tptn_pop_posts( $args = array() ) {
357
  */
358
 
359
  // Fields to return.
360
- $fields[] = 'ID';
361
- $fields[] = 'postnumber';
362
- $fields[] = ( $args['daily'] ) ? 'SUM(cntaccess) as sum_count' : 'cntaccess as sum_count';
363
 
364
  $fields = implode( ', ', $fields );
365
 
366
  // Create the JOIN clause.
367
- $join = " INNER JOIN {$wpdb->posts} ON postnumber=ID ";
368
 
369
  // Create the base WHERE clause.
370
- $where .= $wpdb->prepare( ' AND blog_id = %d ', $blog_id ); // Posts need to be from the current blog only.
371
- $where .= " AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'inherit') "; // Show published posts and attachments.
372
 
373
  if ( $args['daily'] ) {
374
- $where .= $wpdb->prepare( ' AND dp_date >= %s ', $from_date ); // Only fetch posts that are tracked after this date.
375
  }
376
 
377
  // Convert exclude post IDs string to array so it can be filtered.
@@ -387,7 +366,7 @@ function get_tptn_pop_posts( $args = array() ) {
387
  // Convert it back to string.
388
  $exclude_post_ids = implode( ',', array_filter( $exclude_post_ids ) );
389
 
390
- if ( '' != $exclude_post_ids ) { // WPCS: loose comparison ok.
391
  $where .= " AND $wpdb->posts.ID NOT IN ({$exclude_post_ids}) ";
392
  }
393
  $where .= " AND $wpdb->posts.post_type IN ('" . join( "', '", $post_types ) . "') "; // Array of post types.
@@ -460,7 +439,7 @@ function get_tptn_pop_posts( $args = array() ) {
460
  $sql = "SELECT DISTINCT $fields FROM {$table_name} $join WHERE 1=1 $where $groupby $orderby $limits";
461
 
462
  if ( $args['posts_only'] ) { // Return the array of posts only if the variable is set.
463
- $results = $wpdb->get_results( $sql, ARRAY_A ); // WPCS: unprepared SQL OK.
464
 
465
  /**
466
  * Filter the array of top post IDs.
@@ -473,7 +452,7 @@ function get_tptn_pop_posts( $args = array() ) {
473
  return apply_filters( 'tptn_pop_posts_array', $results, $args );
474
  }
475
 
476
- $results = $wpdb->get_results( $sql ); // WPCS: unprepared SQL OK.
477
 
478
  /**
479
  * Filter object containing post IDs of popular posts
@@ -501,7 +480,7 @@ function tptn_show_pop_posts( $args = null ) {
501
  $args .= '&is_manual=1';
502
  }
503
 
504
- echo tptn_pop_posts( $args ); // WPCS: XSS OK.
505
  }
506
 
507
 
22
  global $tptn_settings;
23
 
24
  // if set, save $exclude_categories.
25
+ if ( isset( $args['exclude_categories'] ) && '' != $args['exclude_categories'] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
26
  $exclude_categories = explode( ',', $args['exclude_categories'] );
27
  $args['strict_limit'] = false;
28
  }
127
  $resultid = tptn_object_id_cur_lang( $result->ID );
128
 
129
  // If this is NULL or already processed ID or matches current post then skip processing this loop.
130
+ if ( ! $resultid || in_array( $resultid, $processed_results ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
131
  continue;
132
  }
133
 
154
 
155
  $p_in_c = false; // Variable to check if post exists in a particular category.
156
  foreach ( $categorys as $cat ) { // Loop to check if post exists in excluded category.
157
+ $p_in_c = ( in_array( $cat->cat_ID, $exclude_categories ) ) ? true : false; // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
158
  if ( $p_in_c ) {
159
  break; // Skip loop execution and go to the next step.
160
  }
173
  }
174
 
175
  if ( $args['show_date'] ) {
176
+ $output .= '<span class="tptn_date"> ' . tptn_date( $args, $result ) . '</span> ';
177
  }
178
 
179
  if ( $args['show_excerpt'] ) {
182
 
183
  if ( $args['disp_list_count'] ) {
184
 
185
+ $output .= ' <span class="tptn_list_count">' . tptn_list_count( $args, $result, $sum_count ) . '</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
  $tptn_list = '';
189
  /**
190
+ * Filter to add content to the end of each item in the list.
191
  *
192
  * @since 2.2.0
193
  *
194
+ * @param string $tptn_list Empty string at the end of each list item.
195
  * @param object $result Object of the current post result
196
  * @param array $args Array of arguments
197
  */
327
 
328
  $blog_id = get_current_blog_id();
329
 
330
+ $from_date = tptn_get_from_date();
 
 
 
 
 
 
 
 
331
 
332
  /**
333
  *
336
  */
337
 
338
  // Fields to return.
339
+ $fields[] = "{$table_name}.postnumber";
340
+ $fields[] = ( $args['daily'] ) ? "SUM({$table_name}.cntaccess) as sum_count" : "{$table_name}.cntaccess as sum_count";
341
+ $fields[] = "{$wpdb->posts}.ID";
342
 
343
  $fields = implode( ', ', $fields );
344
 
345
  // Create the JOIN clause.
346
+ $join = " INNER JOIN {$wpdb->posts} ON {$table_name}.postnumber={$wpdb->posts}.ID ";
347
 
348
  // Create the base WHERE clause.
349
+ $where .= $wpdb->prepare( " AND {$table_name}.blog_id = %d ", $blog_id ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
350
+ $where .= " AND ({$wpdb->posts}.post_status = 'publish' OR {$wpdb->posts}.post_status = 'inherit') "; // Show published posts and attachments.
351
 
352
  if ( $args['daily'] ) {
353
+ $where .= $wpdb->prepare( " AND {$table_name}.dp_date >= %s ", $from_date ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
354
  }
355
 
356
  // Convert exclude post IDs string to array so it can be filtered.
366
  // Convert it back to string.
367
  $exclude_post_ids = implode( ',', array_filter( $exclude_post_ids ) );
368
 
369
+ if ( '' != $exclude_post_ids ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
370
  $where .= " AND $wpdb->posts.ID NOT IN ({$exclude_post_ids}) ";
371
  }
372
  $where .= " AND $wpdb->posts.post_type IN ('" . join( "', '", $post_types ) . "') "; // Array of post types.
439
  $sql = "SELECT DISTINCT $fields FROM {$table_name} $join WHERE 1=1 $where $groupby $orderby $limits";
440
 
441
  if ( $args['posts_only'] ) { // Return the array of posts only if the variable is set.
442
+ $results = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
443
 
444
  /**
445
  * Filter the array of top post IDs.
452
  return apply_filters( 'tptn_pop_posts_array', $results, $args );
453
  }
454
 
455
+ $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
456
 
457
  /**
458
  * Filter object containing post IDs of popular posts
480
  $args .= '&is_manual=1';
481
  }
482
 
483
+ echo tptn_pop_posts( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
484
  }
485
 
486
 
includes/public/media.php CHANGED
@@ -11,14 +11,14 @@
11
  * @since 2.0.0
12
  */
13
  function tptn_add_image_sizes() {
14
- global $tptn_settings;
15
 
16
- if ( ! in_array( $tptn_settings['thumb_size'], get_intermediate_image_sizes() ) ) {
17
- $tptn_settings['thumb_size'] = 'tptn_thumbnail';
18
  }
19
 
20
  // Add image sizes if 'tptn_thumbnail' is selected or the selected thumbnail size is no longer valid.
21
- if ( 'tptn_thumbnail' === tptn_get_option( 'thumb_size' ) ) {
22
  $width = tptn_get_option( 'thumb_width', 150 );
23
  $height = tptn_get_option( 'thumb_height', 150 );
24
  $crop = tptn_get_option( 'thumb_crop', true );
@@ -95,7 +95,7 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
95
  if ( $postimage ) {
96
  $postimage_id = tptn_get_attachment_id_from_url( $postimage );
97
 
98
- if ( false != wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) ) ) {
99
  $postthumb = wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) );
100
  $postimage = $postthumb[0];
101
  }
@@ -105,7 +105,7 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
105
 
106
  // If there is no thumbnail found, check the post thumbnail.
107
  if ( ! $postimage ) {
108
- if ( false != get_post_thumbnail_id( $result->ID ) ) {
109
  $postthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $result->ID ), array( $args['thumb_width'], $args['thumb_height'] ) );
110
  $postimage = $postthumb[0];
111
  }
@@ -122,7 +122,7 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
122
  if ( $postimage ) {
123
  $postimage_id = tptn_get_attachment_id_from_url( $postimage );
124
 
125
- if ( false != wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) ) ) {
126
  $postthumb = wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) );
127
  $postimage = $postthumb[0];
128
  }
@@ -189,35 +189,41 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
189
  $postimage = preg_replace( '~http://~', 'https://', $postimage );
190
  }
191
 
192
- if ( 'css' == $args['thumb_html'] ) {
193
- $thumb_html = 'style="max-width:' . $args['thumb_width'] . 'px;max-height:' . $args['thumb_height'] . 'px;"';
194
- } elseif ( 'html' == $args['thumb_html'] ) {
195
- $thumb_html = 'width="' . $args['thumb_width'] . '" height="' . $args['thumb_height'] . '"';
196
- } else {
197
- $thumb_html = '';
198
- }
199
 
200
  /**
201
- * Filters the thumbnail HTML and allows a filter function to add any more HTML if needed.
202
  *
203
- * @since 2.2.0
204
  *
205
- * @param string $thumb_html Thumbnail HTML
206
  */
207
- $thumb_html = apply_filters( 'tptn_thumb_html', $thumb_html );
208
 
209
- $class = $args['class'] . ' tptn_' . $pick;
 
 
 
 
 
 
 
210
 
211
  /**
212
- * Filters the thumbnail classes and allows a filter function to add any more classes if needed.
213
  *
214
- * @since 2.2.0
215
  *
216
- * @param string $thumb_html Thumbnail HTML
217
  */
218
- $class = apply_filters( 'tptn_thumb_class', $class );
 
 
 
 
 
 
219
 
220
- $output .= '<img src="' . $postimage . '" alt="' . $post_title . '" title="' . $post_title . '" ' . $thumb_html . ' class="' . $class . '" />';
221
  }
222
 
223
  /**
@@ -232,22 +238,133 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
232
  return apply_filters( 'tptn_get_the_post_thumbnail', $output, $args, $postimage );
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
  /**
237
  * Get the first child image in the post.
238
  *
239
  * @since 1.9.8
240
- * @param mixed $postID Post ID.
241
  * @param int $thumb_width Thumb width.
242
  * @param int $thumb_height Thumb height.
243
  * @return string Location of thumbnail
244
  */
245
- function tptn_get_first_image( $postID, $thumb_width, $thumb_height ) {
246
  $args = array(
247
  'numberposts' => 1,
248
  'order' => 'ASC',
249
  'post_mime_type' => 'image',
250
- 'post_parent' => $postID,
251
  'post_status' => null,
252
  'post_type' => 'attachment',
253
  );
@@ -264,7 +381,7 @@ function tptn_get_first_image( $postID, $thumb_width, $thumb_height ) {
264
  * @since 1.9.10.1
265
  *
266
  * @param array $image_attributes[0] URL of the image
267
- * @param int $postID Post ID
268
  */
269
  return apply_filters( 'tptn_get_first_image', $image_attributes[0] );
270
  }
@@ -288,7 +405,7 @@ function tptn_get_attachment_id_from_url( $attachment_url = '' ) {
288
  $attachment_id = false;
289
 
290
  // If there is no url, return.
291
- if ( '' == $attachment_url ) {
292
  return;
293
  }
294
 
@@ -305,7 +422,7 @@ function tptn_get_attachment_id_from_url( $attachment_url = '' ) {
305
  $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
306
 
307
  // Finally, run a custom database query to get the attachment ID from the modified attachment URL.
308
- $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = %s AND wposts.post_type = 'attachment'", $attachment_url ) );
309
 
310
  }
311
 
@@ -339,12 +456,12 @@ function tptn_get_thumb_size( $args ) {
339
  $thumb_height = $tptn_thumb_size['height'];
340
  }
341
 
342
- if ( empty( $thumb_width ) || ( $args['is_widget'] && $thumb_width != $args['thumb_width'] ) ) {
343
  $thumb_width = $args['thumb_width'];
344
  $args['thumb_html'] = 'css';
345
  }
346
 
347
- if ( empty( $thumb_height ) || ( $args['is_widget'] && $thumb_height != $args['thumb_height'] ) ) {
348
  $thumb_height = $args['thumb_height'];
349
  $args['thumb_html'] = 'css';
350
  }
@@ -378,14 +495,14 @@ function tptn_get_all_image_sizes( $size = '' ) {
378
  $intermediate_image_sizes = get_intermediate_image_sizes();
379
 
380
  foreach ( $intermediate_image_sizes as $_size ) {
381
- if ( in_array( $_size, array( 'thumbnail', 'medium', 'large' ) ) ) {
382
 
383
  $sizes[ $_size ]['name'] = $_size;
384
  $sizes[ $_size ]['width'] = get_option( $_size . '_size_w' );
385
  $sizes[ $_size ]['height'] = get_option( $_size . '_size_h' );
386
  $sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' );
387
 
388
- if ( ( 0 == $sizes[ $_size ]['width'] ) && ( 0 == $sizes[ $_size ]['height'] ) ) {
389
  unset( $sizes[ $_size ] );
390
  }
391
  } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
11
  * @since 2.0.0
12
  */
13
  function tptn_add_image_sizes() {
14
+ $thumb_size = tptn_get_option( 'thumb_size' );
15
 
16
+ if ( ! in_array( $thumb_size, get_intermediate_image_sizes() ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
17
+ $thumb_size = 'tptn_thumbnail';
18
  }
19
 
20
  // Add image sizes if 'tptn_thumbnail' is selected or the selected thumbnail size is no longer valid.
21
+ if ( 'tptn_thumbnail' === $thumb_size && tptn_get_option( 'thumb_create_sizes' ) ) {
22
  $width = tptn_get_option( 'thumb_width', 150 );
23
  $height = tptn_get_option( 'thumb_height', 150 );
24
  $crop = tptn_get_option( 'thumb_crop', true );
95
  if ( $postimage ) {
96
  $postimage_id = tptn_get_attachment_id_from_url( $postimage );
97
 
98
+ if ( false != wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
99
  $postthumb = wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) );
100
  $postimage = $postthumb[0];
101
  }
105
 
106
  // If there is no thumbnail found, check the post thumbnail.
107
  if ( ! $postimage ) {
108
+ if ( false != get_post_thumbnail_id( $result->ID ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
109
  $postthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $result->ID ), array( $args['thumb_width'], $args['thumb_height'] ) );
110
  $postimage = $postthumb[0];
111
  }
122
  if ( $postimage ) {
123
  $postimage_id = tptn_get_attachment_id_from_url( $postimage );
124
 
125
+ if ( false != wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
126
  $postthumb = wp_get_attachment_image_src( $postimage_id, array( $args['thumb_width'], $args['thumb_height'] ) );
127
  $postimage = $postthumb[0];
128
  }
189
  $postimage = preg_replace( '~http://~', 'https://', $postimage );
190
  }
191
 
192
+ $class = $args['class'] . ' tptn_' . $pick;
 
 
 
 
 
 
193
 
194
  /**
195
+ * Filters the thumbnail classes and allows a filter function to add any more classes if needed.
196
  *
197
+ * @since 2.2.0
198
  *
199
+ * @param string $class Thumbnail Class
200
  */
201
+ $attr['class'] = apply_filters( 'tptn_thumb_class', $class );
202
 
203
+ /**
204
+ * Filters the thumbnail alt.
205
+ *
206
+ * @since 2.6.0
207
+ *
208
+ * @param string $post_title Thumbnail alt attribute
209
+ */
210
+ $attr['alt'] = apply_filters( 'tptn_thumb_alt', $post_title );
211
 
212
  /**
213
+ * Filters the thumbnail title.
214
  *
215
+ * @since 2.6.0
216
  *
217
+ * @param string $post_title Thumbnail title attribute
218
  */
219
+ $attr['title'] = apply_filters( 'tptn_thumb_title', $post_title );
220
+
221
+ $attr['thumb_html'] = $args['thumb_html'];
222
+ $attr['thumb_width'] = $args['thumb_width'];
223
+ $attr['thumb_height'] = $args['thumb_height'];
224
+
225
+ $output .= tptn_get_image_html( $postimage, $attr );
226
 
 
227
  }
228
 
229
  /**
238
  return apply_filters( 'tptn_get_the_post_thumbnail', $output, $args, $postimage );
239
  }
240
 
241
+ /**
242
+ * Get an HTML img element
243
+ *
244
+ * @since 2.6.0
245
+ *
246
+ * @param string $attachment_url Image URL.
247
+ * @param array $attr Attributes for the image markup.
248
+ * @return string HTML img element or empty string on failure.
249
+ */
250
+ function tptn_get_image_html( $attachment_url, $attr = array() ) {
251
+
252
+ // If there is no url, return.
253
+ if ( '' == $attachment_url ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
254
+ return;
255
+ }
256
+
257
+ $default_attr = array(
258
+ 'src' => $attachment_url,
259
+ 'thumb_html' => tptn_get_option( 'thumb_html', 'html' ),
260
+ 'thumb_width' => tptn_get_option( 'thumb_width', 150 ),
261
+ 'thumb_height' => tptn_get_option( 'thumb_height', 150 ),
262
+ );
263
+
264
+ $attr = wp_parse_args( $attr, $default_attr );
265
+
266
+ $hwstring = tptn_get_image_hwstring( $attr );
267
+
268
+ // Generate 'srcset' and 'sizes' if not already present.
269
+ if ( empty( $attr['srcset'] ) ) {
270
+ $attachment_id = tptn_get_attachment_id_from_url( $attachment_url );
271
+ $image_meta = wp_get_attachment_metadata( $attachment_id );
272
+
273
+ if ( is_array( $image_meta ) ) {
274
+ $size_array = array( absint( $attr['thumb_width'] ), absint( $attr['thumb_height'] ) );
275
+ $srcset = wp_calculate_image_srcset( $size_array, $attachment_url, $image_meta, $attachment_id );
276
+ $sizes = wp_calculate_image_sizes( $size_array, $attachment_url, $image_meta, $attachment_id );
277
+
278
+ if ( $srcset && ( $sizes || ! empty( $attr['sizes'] ) ) ) {
279
+ $attr['srcset'] = $srcset;
280
+
281
+ if ( empty( $attr['sizes'] ) ) {
282
+ $attr['sizes'] = $sizes;
283
+ }
284
+ }
285
+ }
286
+ }
287
+
288
+ // Unset attributes we don't want to display.
289
+ unset( $attr['thumb_html'] );
290
+ unset( $attr['thumb_width'] );
291
+ unset( $attr['thumb_height'] );
292
+
293
+ /**
294
+ * Filters the list of attachment image attributes.
295
+ *
296
+ * @since 2.6.0
297
+ *
298
+ * @param array $attr Attributes for the image markup.
299
+ * @param string $attachment_url Image URL.
300
+ */
301
+ $attr = apply_filters( 'tptn_get_image_attributes', $attr, $attachment_url );
302
+ $attr = array_map( 'esc_attr', $attr );
303
+
304
+ $html = '<img ' . $hwstring;
305
+ foreach ( $attr as $name => $value ) {
306
+ $html .= " $name=" . '"' . $value . '"';
307
+ }
308
+ $html .= ' />';
309
+
310
+ return apply_filters( 'tptn_get_image_html', $html );
311
+ }
312
+
313
+
314
+ /**
315
+ * Retrieve width and height attributes using given width and height values.
316
+ *
317
+ * @since 2.6.0
318
+ *
319
+ * @param array $args Argument array.
320
+ *
321
+ * @return string Height-width string.
322
+ */
323
+ function tptn_get_image_hwstring( $args = array() ) {
324
+
325
+ $default_args = array(
326
+ 'thumb_html' => tptn_get_option( 'thumb_html', 'html' ),
327
+ 'thumb_width' => tptn_get_option( 'thumb_width', 150 ),
328
+ 'thumb_height' => tptn_get_option( 'thumb_height', 150 ),
329
+ );
330
+
331
+ $args = wp_parse_args( $args, $default_args );
332
+
333
+ if ( 'css' === $args['thumb_html'] ) {
334
+ $thumb_html = ' style="max-width:' . $args['thumb_width'] . 'px;max-height:' . $args['thumb_height'] . 'px;" ';
335
+ } elseif ( 'html' === $args['thumb_html'] ) {
336
+ $thumb_html = ' width="' . $args['thumb_width'] . '" height="' . $args['thumb_height'] . '" ';
337
+ } else {
338
+ $thumb_html = '';
339
+ }
340
+
341
+ /**
342
+ * Filters the thumbnail HTML and allows a filter function to add any more HTML if needed.
343
+ *
344
+ * @since 2.2.0
345
+ *
346
+ * @param string $thumb_html Thumbnail HTML.
347
+ * @param array $args Argument array.
348
+ */
349
+ return apply_filters( 'tptn_thumb_html', $thumb_html, $args );
350
+ }
351
+
352
 
353
  /**
354
  * Get the first child image in the post.
355
  *
356
  * @since 1.9.8
357
+ * @param mixed $postid Post ID.
358
  * @param int $thumb_width Thumb width.
359
  * @param int $thumb_height Thumb height.
360
  * @return string Location of thumbnail
361
  */
362
+ function tptn_get_first_image( $postid, $thumb_width, $thumb_height ) {
363
  $args = array(
364
  'numberposts' => 1,
365
  'order' => 'ASC',
366
  'post_mime_type' => 'image',
367
+ 'post_parent' => $postid,
368
  'post_status' => null,
369
  'post_type' => 'attachment',
370
  );
381
  * @since 1.9.10.1
382
  *
383
  * @param array $image_attributes[0] URL of the image
384
+ * @param int $postid Post ID
385
  */
386
  return apply_filters( 'tptn_get_first_image', $image_attributes[0] );
387
  }
405
  $attachment_id = false;
406
 
407
  // If there is no url, return.
408
+ if ( '' == $attachment_url ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
409
  return;
410
  }
411
 
422
  $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
423
 
424
  // Finally, run a custom database query to get the attachment ID from the modified attachment URL.
425
+ $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = %s AND wposts.post_type = 'attachment'", $attachment_url ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
426
 
427
  }
428
 
456
  $thumb_height = $tptn_thumb_size['height'];
457
  }
458
 
459
+ if ( empty( $thumb_width ) || ( $args['is_widget'] && $thumb_width != $args['thumb_width'] ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
460
  $thumb_width = $args['thumb_width'];
461
  $args['thumb_html'] = 'css';
462
  }
463
 
464
+ if ( empty( $thumb_height ) || ( $args['is_widget'] && $thumb_height != $args['thumb_height'] ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
465
  $thumb_height = $args['thumb_height'];
466
  $args['thumb_html'] = 'css';
467
  }
495
  $intermediate_image_sizes = get_intermediate_image_sizes();
496
 
497
  foreach ( $intermediate_image_sizes as $_size ) {
498
+ if ( in_array( $_size, array( 'thumbnail', 'medium', 'large' ) ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
499
 
500
  $sizes[ $_size ]['name'] = $_size;
501
  $sizes[ $_size ]['width'] = get_option( $_size . '_size_w' );
502
  $sizes[ $_size ]['height'] = get_option( $_size . '_size_h' );
503
  $sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' );
504
 
505
+ if ( ( 0 == $sizes[ $_size ]['width'] ) && ( 0 == $sizes[ $_size ]['height'] ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
506
  unset( $sizes[ $_size ] );
507
  }
508
  } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
includes/public/output-generator.php CHANGED
@@ -317,3 +317,62 @@ function tptn_list_link( $args, $result ) {
317
  return apply_filters( 'tptn_list_link', $output, $result, $args );
318
 
319
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  return apply_filters( 'tptn_list_link', $output, $result, $args );
318
 
319
  }
320
+
321
+
322
+ /**
323
+ * Returns the title of each list item.
324
+ *
325
+ * @since 2.6.0
326
+ *
327
+ * @param array $args Array of arguments.
328
+ * @param object $result Object of the current post result.
329
+ * @return string Formatted post date
330
+ */
331
+ function tptn_date( $args, $result ) {
332
+
333
+ $date = mysql2date( get_option( 'date_format', 'd/m/y' ), $result->post_date );
334
+
335
+ /**
336
+ * Filter the post title of each list item.
337
+ *
338
+ * @since 2.6.0
339
+ *
340
+ * @param string $date Title of the post.
341
+ * @param object $result Object of the current post result
342
+ * @param array $args Array of arguments
343
+ */
344
+ return apply_filters( 'tptn_date', $date, $result, $args );
345
+
346
+ }
347
+
348
+
349
+ /**
350
+ * Returns the title of each list item.
351
+ *
352
+ * @since 2.6.0
353
+ *
354
+ * @param array $args Array of arguments.
355
+ * @param object $result Object of the current post result.
356
+ * @param int $visits Number of visits.
357
+ * @return string Formatted post date
358
+ */
359
+ function tptn_list_count( $args, $result, $visits ) {
360
+
361
+ $tptn_list_count = '(' . tptn_number_format_i18n( $visits ) . ')';
362
+
363
+ /**
364
+ * Filter the formatted list count text.
365
+ *
366
+ * @since 2.1.0
367
+ *
368
+ * @param string $visits Formatted list count
369
+ * @param int $sum_count Post count
370
+ * @param object $result Post object
371
+ * @param array $args Array of arguments.
372
+ * @param int $visits Number of visits.
373
+ */
374
+ return apply_filters( 'tptn_list_count', $tptn_list_count, $visits, $result, $args, $visits );
375
+
376
+ }
377
+
378
+
includes/public/styles.php CHANGED
@@ -15,8 +15,8 @@ function tptn_header() {
15
  $tptn_custom_css = stripslashes( tptn_get_option( 'custom_css' ) );
16
 
17
  // Add CSS to header.
18
- if ( '' != $tptn_custom_css ) { // WPCS: loose comparison ok.
19
- echo '<style type="text/css">' . $tptn_custom_css . '</style>'; // WPCS: XSS ok.
20
  }
21
  }
22
  add_action( 'wp_head', 'tptn_header' );
@@ -28,7 +28,7 @@ add_action( 'wp_head', 'tptn_header' );
28
  function tptn_heading_styles() {
29
 
30
  if ( 'left_thumbs' === tptn_get_option( 'tptn_styles' ) ) {
31
- wp_register_style( 'tptn-style-left-thumbs', plugins_url( 'css/default-style.css', TOP_TEN_PLUGIN_FILE ) );
32
  wp_enqueue_style( 'tptn-style-left-thumbs' );
33
 
34
  $width = tptn_get_option( 'thumb_width' );
15
  $tptn_custom_css = stripslashes( tptn_get_option( 'custom_css' ) );
16
 
17
  // Add CSS to header.
18
+ if ( '' != $tptn_custom_css ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
19
+ echo '<style type="text/css">' . $tptn_custom_css . '</style>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
20
  }
21
  }
22
  add_action( 'wp_head', 'tptn_header' );
28
  function tptn_heading_styles() {
29
 
30
  if ( 'left_thumbs' === tptn_get_option( 'tptn_styles' ) ) {
31
+ wp_register_style( 'tptn-style-left-thumbs', plugins_url( 'css/default-style.css', TOP_TEN_PLUGIN_FILE ), array(), '1.0' );
32
  wp_enqueue_style( 'tptn-style-left-thumbs' );
33
 
34
  $width = tptn_get_option( 'thumb_width' );
includes/tracker.php CHANGED
@@ -17,7 +17,7 @@ function tptn_enqueue_scripts() {
17
  $track_users = tptn_get_option( 'track_users' );
18
  $trackers = tptn_get_option( 'trackers' );
19
 
20
- if ( is_singular() && '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?
@@ -40,10 +40,11 @@ function tptn_enqueue_scripts() {
40
 
41
  if ( $include_code ) {
42
 
43
- $id = absint( $post->ID );
44
  $blog_id = get_current_blog_id();
45
  $activate_counter = ! empty( $trackers['overall'] ) ? 1 : 0; // It's 1 if we're updating the overall count.
46
  $activate_counter = $activate_counter + ( ! empty( $trackers['daily'] ) ? 10 : 0 ); // It's 10 if we're updating the daily count.
 
47
 
48
  if ( 'query_based' === tptn_get_option( 'tracker_type' ) ) {
49
  $home_url = home_url( '/' );
@@ -69,6 +70,7 @@ function tptn_enqueue_scripts() {
69
  'top_ten_id' => $id,
70
  'top_ten_blog_id' => $blog_id,
71
  'activate_counter' => $activate_counter,
 
72
  'tptn_rnd' => wp_rand( 1, time() ),
73
  );
74
 
@@ -79,7 +81,7 @@ function tptn_enqueue_scripts() {
79
  */
80
  $ajax_tptn_tracker = apply_filters( 'tptn_tracker_script_args', $ajax_tptn_tracker );
81
 
82
- wp_enqueue_script( 'tptn_tracker', plugins_url( 'includes/js/top-10-tracker.js', TOP_TEN_PLUGIN_FILE ), array( 'jquery' ) );
83
 
84
  wp_localize_script( 'tptn_tracker', 'ajax_tptn_tracker', $ajax_tptn_tracker );
85
 
@@ -96,7 +98,7 @@ add_action( 'wp_enqueue_scripts', 'tptn_enqueue_scripts' );
96
  * @since 2.0.0
97
  *
98
  * @param array $vars Query variables array.
99
- * @return array $Query variables array with Top 10 parameters appended
100
  */
101
  function tptn_query_vars( $vars ) {
102
  // Add these to the list of queryvars that WP gathers.
@@ -105,7 +107,15 @@ function tptn_query_vars( $vars ) {
105
  $vars[] = 'activate_counter';
106
  $vars[] = 'view_counter';
107
  $vars[] = 'top_ten_debug';
108
- return $vars;
 
 
 
 
 
 
 
 
109
  }
110
  add_filter( 'query_vars', 'tptn_query_vars' );
111
 
@@ -118,7 +128,6 @@ add_filter( 'query_vars', 'tptn_query_vars' );
118
  * @param object $wp WordPress object.
119
  */
120
  function tptn_parse_request( $wp ) {
121
- global $wpdb;
122
 
123
  if ( empty( $wp ) ) {
124
  global $wp;
@@ -128,34 +137,17 @@ function tptn_parse_request( $wp ) {
128
  return;
129
  }
130
 
131
- $table_name = $wpdb->base_prefix . 'top_ten';
132
- $top_ten_daily = $wpdb->base_prefix . 'top_ten_daily';
133
- $str = '';
134
 
135
- if ( array_key_exists( 'top_ten_id', $wp->query_vars ) && array_key_exists( 'activate_counter', $wp->query_vars ) && '' !== $wp->query_vars['top_ten_id'] ) {
136
 
137
  $id = absint( $wp->query_vars['top_ten_id'] );
138
  $blog_id = absint( $wp->query_vars['top_ten_blog_id'] );
139
  $activate_counter = absint( $wp->query_vars['activate_counter'] );
140
 
141
- if ( $id > 0 ) {
142
-
143
- if ( ( 1 === $activate_counter ) || ( 11 === $activate_counter ) ) {
144
-
145
- $tt = $wpdb->query( $wpdb->prepare( "INSERT INTO {$table_name} (postnumber, cntaccess, blog_id) VALUES( %d, '1', %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
146
-
147
- $str .= ( false === $tt ) ? 'tte' : 'tt' . $tt;
148
- }
149
-
150
- if ( ( 10 === $activate_counter ) || ( 11 === $activate_counter ) ) {
151
-
152
- $current_date = gmdate( 'Y-m-d H', current_time( 'timestamp', 0 ) );
153
-
154
- $ttd = $wpdb->query( $wpdb->prepare( "INSERT INTO {$top_ten_daily} (postnumber, cntaccess, dp_date, blog_id) VALUES( %d, '1', %s, %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $current_date, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
155
-
156
- $str .= ( false === $ttd ) ? ' ttde' : ' ttd' . $ttd;
157
- }
158
- }
159
 
160
  // If the debug parameter is set then we output $str else we send a No Content header.
161
  if ( array_key_exists( 'top_ten_debug', $wp->query_vars ) && 1 === absint( $wp->query_vars['top_ten_debug'] ) ) {
@@ -169,7 +161,7 @@ function tptn_parse_request( $wp ) {
169
  // Stop anything else from loading as it is not needed.
170
  exit;
171
 
172
- } elseif ( array_key_exists( 'top_ten_id', $wp->query_vars ) && array_key_exists( 'view_counter', $wp->query_vars ) && '' !== $wp->query_vars['top_ten_id'] ) {
173
 
174
  $id = absint( $wp->query_vars['top_ten_id'] );
175
 
@@ -178,7 +170,7 @@ function tptn_parse_request( $wp ) {
178
  $output = get_tptn_post_count( $id );
179
 
180
  header( 'content-type: application/x-javascript' );
181
- echo 'document.write("' . $output . '");'; // WPCS: XSS OK.
182
 
183
  // Stop anything else from loading as it is not needed.
184
  exit;
@@ -197,21 +189,51 @@ add_action( 'parse_request', 'tptn_parse_request' );
197
  */
198
  function tptn_tracker_parser() {
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  global $wpdb;
201
 
202
  $table_name = $wpdb->base_prefix . 'top_ten';
203
  $top_ten_daily = $wpdb->base_prefix . 'top_ten_daily';
204
  $str = '';
205
 
206
- $id = isset( $_POST['top_ten_id'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['top_ten_id'] ) ) ) : 0; // WPCS: CSRF ok.
207
- $blog_id = isset( $_POST['top_ten_blog_id'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['top_ten_blog_id'] ) ) ) : 0; // WPCS: CSRF ok.
208
- $activate_counter = isset( $_POST['activate_counter'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['activate_counter'] ) ) ) : 0; // WPCS: CSRF ok.
209
-
210
  if ( $id > 0 ) {
211
 
212
  if ( ( 1 === $activate_counter ) || ( 11 === $activate_counter ) ) {
213
 
214
- $tt = $wpdb->query( $wpdb->prepare( "INSERT INTO {$table_name} (postnumber, cntaccess, blog_id) VALUES( %d, '1', %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
215
 
216
  $str .= ( false === $tt ) ? 'tte' : 'tt' . $tt;
217
  }
@@ -220,18 +242,24 @@ function tptn_tracker_parser() {
220
 
221
  $current_date = gmdate( 'Y-m-d H', current_time( 'timestamp', 0 ) );
222
 
223
- $ttd = $wpdb->query( $wpdb->prepare( "INSERT INTO {$top_ten_daily} (postnumber, cntaccess, dp_date, blog_id) VALUES( %d, '1', %s, %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $current_date, $blog_id ) ); // DB call ok; no-cache ok; WPCS: unprepared SQL OK.
224
 
225
  $str .= ( false === $ttd ) ? ' ttde' : ' ttd' . $ttd;
226
  }
227
  }
228
 
229
- echo esc_html( $str );
230
-
231
- wp_die();
 
 
 
 
 
 
 
 
232
  }
233
- add_action( 'wp_ajax_nopriv_tptn_tracker', 'tptn_tracker_parser' );
234
- add_action( 'wp_ajax_tptn_tracker', 'tptn_tracker_parser' );
235
 
236
 
237
  /**
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?
40
 
41
  if ( $include_code ) {
42
 
43
+ $id = is_singular() ? absint( $post->ID ) : 0;
44
  $blog_id = get_current_blog_id();
45
  $activate_counter = ! empty( $trackers['overall'] ) ? 1 : 0; // It's 1 if we're updating the overall count.
46
  $activate_counter = $activate_counter + ( ! empty( $trackers['daily'] ) ? 10 : 0 ); // It's 10 if we're updating the daily count.
47
+ $top_ten_debug = absint( tptn_get_option( 'debug_mode' ) );
48
 
49
  if ( 'query_based' === tptn_get_option( 'tracker_type' ) ) {
50
  $home_url = home_url( '/' );
70
  'top_ten_id' => $id,
71
  'top_ten_blog_id' => $blog_id,
72
  'activate_counter' => $activate_counter,
73
+ 'top_ten_debug' => $top_ten_debug,
74
  'tptn_rnd' => wp_rand( 1, time() ),
75
  );
76
 
81
  */
82
  $ajax_tptn_tracker = apply_filters( 'tptn_tracker_script_args', $ajax_tptn_tracker );
83
 
84
+ wp_enqueue_script( 'tptn_tracker', plugins_url( 'includes/js/top-10-tracker.min.js', TOP_TEN_PLUGIN_FILE ), array( 'jquery' ), '1.0', true );
85
 
86
  wp_localize_script( 'tptn_tracker', 'ajax_tptn_tracker', $ajax_tptn_tracker );
87
 
98
  * @since 2.0.0
99
  *
100
  * @param array $vars Query variables array.
101
+ * @return array Query variables array with Top 10 parameters appended
102
  */
103
  function tptn_query_vars( $vars ) {
104
  // Add these to the list of queryvars that WP gathers.
107
  $vars[] = 'activate_counter';
108
  $vars[] = 'view_counter';
109
  $vars[] = 'top_ten_debug';
110
+
111
+ /**
112
+ * Function to add additional queries to query_vars.
113
+ *
114
+ * @since 2.6.0
115
+ *
116
+ * @param array $vars Updated Query variables array with Top 10 queries added.
117
+ */
118
+ return apply_filters( 'tptn_query_vars', $vars );
119
  }
120
  add_filter( 'query_vars', 'tptn_query_vars' );
121
 
128
  * @param object $wp WordPress object.
129
  */
130
  function tptn_parse_request( $wp ) {
 
131
 
132
  if ( empty( $wp ) ) {
133
  global $wp;
137
  return;
138
  }
139
 
140
+ if ( array_key_exists( 'top_ten_id', $wp->query_vars ) && empty( $wp->query_vars['top_ten_id'] ) ) {
141
+ exit;
142
+ }
143
 
144
+ if ( array_key_exists( 'top_ten_id', $wp->query_vars ) && array_key_exists( 'activate_counter', $wp->query_vars ) && ! empty( $wp->query_vars['top_ten_id'] ) ) {
145
 
146
  $id = absint( $wp->query_vars['top_ten_id'] );
147
  $blog_id = absint( $wp->query_vars['top_ten_blog_id'] );
148
  $activate_counter = absint( $wp->query_vars['activate_counter'] );
149
 
150
+ $str = tptn_update_count( $id, $blog_id, $activate_counter );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  // If the debug parameter is set then we output $str else we send a No Content header.
153
  if ( array_key_exists( 'top_ten_debug', $wp->query_vars ) && 1 === absint( $wp->query_vars['top_ten_debug'] ) ) {
161
  // Stop anything else from loading as it is not needed.
162
  exit;
163
 
164
+ } elseif ( array_key_exists( 'top_ten_id', $wp->query_vars ) && array_key_exists( 'view_counter', $wp->query_vars ) && ! empty( $wp->query_vars['top_ten_id'] ) ) {
165
 
166
  $id = absint( $wp->query_vars['top_ten_id'] );
167
 
170
  $output = get_tptn_post_count( $id );
171
 
172
  header( 'content-type: application/x-javascript' );
173
+ echo 'document.write("' . $output . '");'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
174
 
175
  // Stop anything else from loading as it is not needed.
176
  exit;
189
  */
190
  function tptn_tracker_parser() {
191
 
192
+ $id = isset( $_POST['top_ten_id'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['top_ten_id'] ) ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
193
+ $blog_id = isset( $_POST['top_ten_blog_id'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['top_ten_blog_id'] ) ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
194
+ $activate_counter = isset( $_POST['activate_counter'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['activate_counter'] ) ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
195
+ $top_ten_debug = isset( $_POST['top_ten_debug'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['top_ten_debug'] ) ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
196
+
197
+ $str = tptn_update_count( $id, $blog_id, $activate_counter );
198
+
199
+ // If the debug parameter is set then we output $str else we send a No Content header.
200
+ if ( 1 === $top_ten_debug ) {
201
+ echo esc_html( $str );
202
+ } else {
203
+ header( 'HTTP/1.0 204 No Content' );
204
+ header( 'Cache-Control: max-age=15, s-maxage=0' );
205
+ }
206
+
207
+ wp_die();
208
+ }
209
+ add_action( 'wp_ajax_nopriv_tptn_tracker', 'tptn_tracker_parser' );
210
+ add_action( 'wp_ajax_tptn_tracker', 'tptn_tracker_parser' );
211
+
212
+
213
+ /**
214
+ * Function to update the count in the database.
215
+ *
216
+ * @since 2.6.0
217
+ *
218
+ * @param int $id Post ID.
219
+ * @param int $blog_id Blog ID.
220
+ * @param int $activate_counter Activate counter flag.
221
+ *
222
+ * @return string Response on database update.
223
+ */
224
+ function tptn_update_count( $id, $blog_id, $activate_counter ) {
225
+
226
  global $wpdb;
227
 
228
  $table_name = $wpdb->base_prefix . 'top_ten';
229
  $top_ten_daily = $wpdb->base_prefix . 'top_ten_daily';
230
  $str = '';
231
 
 
 
 
 
232
  if ( $id > 0 ) {
233
 
234
  if ( ( 1 === $activate_counter ) || ( 11 === $activate_counter ) ) {
235
 
236
+ $tt = $wpdb->query( $wpdb->prepare( "INSERT INTO {$table_name} (postnumber, cntaccess, blog_id) VALUES( %d, '1', %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
237
 
238
  $str .= ( false === $tt ) ? 'tte' : 'tt' . $tt;
239
  }
242
 
243
  $current_date = gmdate( 'Y-m-d H', current_time( 'timestamp', 0 ) );
244
 
245
+ $ttd = $wpdb->query( $wpdb->prepare( "INSERT INTO {$top_ten_daily} (postnumber, cntaccess, dp_date, blog_id) VALUES( %d, '1', %s, %d ) ON DUPLICATE KEY UPDATE cntaccess= cntaccess+1 ", $id, $current_date, $blog_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
246
 
247
  $str .= ( false === $ttd ) ? ' ttde' : ' ttd' . $ttd;
248
  }
249
  }
250
 
251
+ /**
252
+ * Filter the response on database update.
253
+ *
254
+ * @since 2.6.0
255
+ *
256
+ * @param string $str Response string.
257
+ * @param int $id Post ID.
258
+ * @param int $blog_id Blog ID.
259
+ * @param int $activate_counter Activate counter flag.
260
+ */
261
+ return apply_filters( 'tptn_update_count', $str, $id, $blog_id, $activate_counter );
262
  }
 
 
263
 
264
 
265
  /**
languages/top-10-en_US.mo CHANGED
Binary file
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: 2018-11-03 23:06+0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
@@ -13,7 +13,7 @@ msgstr ""
13
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;esc_html__;esc_attr__;esc_html_e;"
14
  "esc_attr_e\n"
15
  "X-Poedit-Basepath: ..\n"
16
- "X-Generator: Poedit 2.1.1\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: .\n"
@@ -44,7 +44,7 @@ msgid "Popular posts by <a href=\"%s\" target=\"_blank\">Top 10 plugin</a>"
44
  msgstr ""
45
 
46
  #: includes/admin/admin-dashboard.php:127 includes/admin/admin.php:44
47
- #: includes/admin/class-top-ten-statistics-table.php:581
48
  msgid "Popular Posts"
49
  msgstr ""
50
 
@@ -113,7 +113,7 @@ msgstr ""
113
  msgid "Top 10"
114
  msgstr ""
115
 
116
- #: includes/admin/admin.php:34 includes/admin/admin.php:317
117
  msgid "Settings"
118
  msgstr ""
119
 
@@ -125,8 +125,7 @@ msgstr ""
125
  msgid "Tools"
126
  msgstr ""
127
 
128
- #: includes/admin/admin.php:44
129
- #: includes/admin/class-top-ten-statistics-table.php:536
130
  msgid "Top 10 Popular Posts"
131
  msgstr ""
132
 
@@ -134,11 +133,11 @@ msgstr ""
134
  msgid "Top 10 Daily Popular Posts"
135
  msgstr ""
136
 
137
- #: includes/admin/admin.php:188
138
  msgid "New information not saved. Do you wish to leave the page?"
139
  msgstr ""
140
 
141
- #: includes/admin/admin.php:271
142
  #, php-format
143
  msgid ""
144
  "Thank you for using <a href=\"%1$s\" target=\"_blank\">Top 10</a>! Please <a "
@@ -146,15 +145,15 @@ msgid ""
146
  "\"_blank\">WordPress.org</a>"
147
  msgstr ""
148
 
149
- #: includes/admin/admin.php:339 includes/admin/sidebar.php:55
150
  msgid "Support"
151
  msgstr ""
152
 
153
- #: includes/admin/admin.php:340
154
  msgid "Donate"
155
  msgstr ""
156
 
157
- #: includes/admin/admin.php:341
158
  msgid "Contribute"
159
  msgstr ""
160
 
@@ -162,286 +161,166 @@ msgstr ""
162
  msgid "Top 10 cache has been cleared"
163
  msgstr ""
164
 
165
- #: includes/admin/class-top-ten-statistics-table.php:36
166
  msgid "popular_post"
167
  msgstr ""
168
 
169
- #: includes/admin/class-top-ten-statistics-table.php:37
170
  msgid "popular_posts"
171
  msgstr ""
172
 
173
- #: includes/admin/class-top-ten-statistics-table.php:210
 
 
 
 
174
  msgid "No popular posts available."
175
  msgstr ""
176
 
177
- #: includes/admin/class-top-ten-statistics-table.php:259
178
  msgid "View"
179
  msgstr ""
180
 
181
- #: includes/admin/class-top-ten-statistics-table.php:260
182
  msgid "Edit"
183
  msgstr ""
184
 
185
- #: includes/admin/class-top-ten-statistics-table.php:261
186
  msgid "Delete"
187
  msgstr ""
188
 
189
- #: includes/admin/class-top-ten-statistics-table.php:284
190
  msgid "Y/m/d g:i:s a"
191
  msgstr ""
192
 
193
- #: includes/admin/class-top-ten-statistics-table.php:292
194
  #, php-format
195
  msgid "%s ago"
196
  msgstr ""
197
 
198
- #: includes/admin/class-top-ten-statistics-table.php:294
199
  msgid "Y/m/d"
200
  msgstr ""
201
 
202
- #: includes/admin/class-top-ten-statistics-table.php:333
203
  #: includes/modules/class-top-ten-count-widget.php:53
204
  #: includes/modules/class-top-ten-widget.php:80
205
  msgid "Title"
206
  msgstr ""
207
 
208
- #: includes/admin/class-top-ten-statistics-table.php:334
209
  msgid "Total visits"
210
  msgstr ""
211
 
212
- #: includes/admin/class-top-ten-statistics-table.php:335
213
  msgid "Daily visits"
214
  msgstr ""
215
 
216
- #: includes/admin/class-top-ten-statistics-table.php:336
217
  msgid "Post type"
218
  msgstr ""
219
 
220
- #: includes/admin/class-top-ten-statistics-table.php:337
221
  msgid "Author"
222
  msgstr ""
223
 
224
- #: includes/admin/class-top-ten-statistics-table.php:338
225
  msgid "Date"
226
  msgstr ""
227
 
228
- #: includes/admin/class-top-ten-statistics-table.php:372
229
  msgid "Delete Count"
230
  msgstr ""
231
 
232
- #: includes/admin/class-top-ten-statistics-table.php:416
233
  msgid "Are you sure you want to do this"
234
  msgstr ""
235
 
236
- #: includes/admin/class-top-ten-statistics-table.php:472
237
  msgid "Filter"
238
  msgstr ""
239
 
240
- #: includes/admin/class-top-ten-statistics-table.php:556
241
  msgid "Search Table"
242
  msgstr ""
243
 
244
- #: includes/admin/help-tab.php:35 includes/admin/help-tab.php:126
245
- #, php-format
246
- msgid ""
247
- "For more information or how to get support visit the <a href=\"%1$s"
248
- "\">WebberZone support site</a>."
249
- msgstr ""
250
-
251
- #: includes/admin/help-tab.php:37 includes/admin/help-tab.php:128
252
- #, php-format
253
- msgid ""
254
- "Support queries should be posted in the <a href=\"%1$s\">WordPress.org "
255
- "support forums</a>."
256
- msgstr ""
257
-
258
- #: includes/admin/help-tab.php:40 includes/admin/help-tab.php:131
259
- #, php-format
260
- msgid ""
261
- "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug "
262
- "reports only)."
263
- msgstr ""
264
-
265
- #: includes/admin/help-tab.php:49 includes/admin/help-tab.php:140
266
- #: includes/admin/settings-page.php:125
267
- msgid "General"
268
- msgstr ""
269
-
270
- #: includes/admin/help-tab.php:51
271
- msgid "This screen provides the basic settings for configuring Top 10."
272
- msgstr ""
273
-
274
- #: includes/admin/help-tab.php:52
275
- msgid ""
276
- "Enable the trackers and cache, configure basic tracker settings and "
277
- "uninstall settings."
278
- msgstr ""
279
-
280
- #: includes/admin/help-tab.php:59 includes/admin/settings-page.php:126
281
- msgid "Counter/Tracker"
282
- msgstr ""
283
-
284
- #: includes/admin/help-tab.php:61
285
- msgid ""
286
- "This screen provides settings to tweak the display counter and the tracker."
287
- msgstr ""
288
-
289
- #: includes/admin/help-tab.php:62
290
- msgid ""
291
- "Choose where to display the counter and customize the text. Select the type "
292
- "of tracker and which user groups to track."
293
- msgstr ""
294
-
295
- #: includes/admin/help-tab.php:69 includes/admin/settings-page.php:127
296
- msgid "Posts list"
297
- msgstr ""
298
-
299
- #: includes/admin/help-tab.php:71
300
- msgid ""
301
- "This screen provides settings to tweak the output of the list of popular "
302
- "posts."
303
- msgstr ""
304
-
305
- #: includes/admin/help-tab.php:72
306
- msgid ""
307
- "Set the number of posts, which categories or posts to exclude, customize "
308
- "what to display and specific basic HTML markup used to create the posts."
309
- msgstr ""
310
-
311
- #: includes/admin/help-tab.php:79 includes/admin/settings-page.php:128
312
- msgid "Thumbnail"
313
- msgstr ""
314
-
315
- #: includes/admin/help-tab.php:81
316
- msgid ""
317
- "This screen provides settings to tweak the thumbnail that can be displayed "
318
- "for each post in the list."
319
- msgstr ""
320
-
321
- #: includes/admin/help-tab.php:82
322
- msgid ""
323
- "Set the location and size of the thumbnail. Additionally, you can choose "
324
- "additional sources for the thumbnail i.e. a meta field, first image or a "
325
- "default thumbnail when nothing is available."
326
- msgstr ""
327
-
328
- #: includes/admin/help-tab.php:89 includes/admin/settings-page.php:129
329
- msgid "Styles"
330
- msgstr ""
331
-
332
- #: includes/admin/help-tab.php:91
333
- msgid ""
334
- "This screen provides options to control the look and feel of the popular "
335
- "posts list."
336
- msgstr ""
337
-
338
- #: includes/admin/help-tab.php:92
339
- msgid ""
340
- "Choose for default set of styles or add your own custom CSS to tweak the "
341
- "display of the posts."
342
- msgstr ""
343
-
344
- #: includes/admin/help-tab.php:99 includes/admin/settings-page.php:130
345
- msgid "Maintenance"
346
- msgstr ""
347
-
348
- #: includes/admin/help-tab.php:101
349
- msgid "This screen provides options to control the maintenance cron."
350
- msgstr ""
351
-
352
- #: includes/admin/help-tab.php:102
353
- msgid "Choose how often to run maintenance and at what time of the day."
354
- msgstr ""
355
-
356
- #: includes/admin/help-tab.php:142
357
- msgid ""
358
- "This screen provides some tools that help maintain certain features of Top "
359
- "10."
360
- msgstr ""
361
-
362
- #: includes/admin/help-tab.php:143
363
- msgid ""
364
- "Clear the cache, reset the popular posts tables plus some miscellaneous "
365
- "fixes for older versions of Top 10."
366
- msgstr ""
367
-
368
- #: includes/admin/register-settings.php:230
369
  msgid "Enable trackers"
370
  msgstr ""
371
 
372
- #: includes/admin/register-settings.php:239
373
  #: includes/modules/class-top-ten-widget.php:95
374
  msgid "Overall"
375
  msgstr ""
376
 
377
- #: includes/admin/register-settings.php:240
378
- #: includes/admin/register-settings.php:774
379
  msgid "Daily"
380
  msgstr ""
381
 
382
- #: includes/admin/register-settings.php:245
383
  msgid "Enable cache"
384
  msgstr ""
385
 
386
- #: includes/admin/register-settings.php:246
387
  msgid ""
388
  "If activated, Top 10 will use the Transients API to cache the popular posts "
389
  "output for 1 hour."
390
  msgstr ""
391
 
392
- #: includes/admin/register-settings.php:252
393
  msgid "Time to cache"
394
  msgstr ""
395
 
396
- #: includes/admin/register-settings.php:253
397
  msgid "Enter the number of seconds to cache the output."
398
  msgstr ""
399
 
400
- #: includes/admin/register-settings.php:259
401
  msgid "Start daily counts from midnight"
402
  msgstr ""
403
 
404
- #: includes/admin/register-settings.php:260
405
  msgid ""
406
  "Daily counter will display number of visits from midnight. This option is "
407
  "checked by default and mimics the way most normal counters work. Turning "
408
  "this off will allow you to use the hourly setting in the next option."
409
  msgstr ""
410
 
411
- #: includes/admin/register-settings.php:266
412
  msgid "Default custom period range"
413
  msgstr ""
414
 
415
- #: includes/admin/register-settings.php:267
416
  msgid ""
417
  "The next two options allow you to set the default range for the custom "
418
  "period. This was previously called the daily range. This can be overridden "
419
  "in the widget."
420
  msgstr ""
421
 
422
- #: includes/admin/register-settings.php:272
423
  msgid "Day(s)"
424
  msgstr ""
425
 
426
- #: includes/admin/register-settings.php:281
427
  msgid "Hour(s)"
428
  msgstr ""
429
 
430
- #: includes/admin/register-settings.php:291
431
  msgid "Delete options on uninstall"
432
  msgstr ""
433
 
434
- #: includes/admin/register-settings.php:292
435
  msgid ""
436
  "If this is checked, all settings related to Top 10 are removed from the "
437
  "database if you choose to uninstall/delete the plugin."
438
  msgstr ""
439
 
440
- #: includes/admin/register-settings.php:298
441
  msgid "Delete counter data on uninstall"
442
  msgstr ""
443
 
444
- #: includes/admin/register-settings.php:299
445
  msgid ""
446
  "If this is checked, the tables containing the counter statistics are removed "
447
  "from the database if you choose to uninstall/delete the plugin. Keep this "
@@ -449,93 +328,93 @@ msgid ""
449
  "counter data."
450
  msgstr ""
451
 
452
- #: includes/admin/register-settings.php:305
453
  msgid "Show metabox"
454
  msgstr ""
455
 
456
- #: includes/admin/register-settings.php:306
457
  msgid ""
458
  "This will add the Top 10 metabox on Edit Posts or Add New Posts screens. "
459
  "Also applies to Pages and Custom Post Types."
460
  msgstr ""
461
 
462
- #: includes/admin/register-settings.php:312
463
  msgid "Limit meta box to Admins only"
464
  msgstr ""
465
 
466
- #: includes/admin/register-settings.php:313
467
  msgid ""
468
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
469
  "default, Contributors and above will be able to see the meta box. Applies "
470
  "only if the above option is selected."
471
  msgstr ""
472
 
473
- #: includes/admin/register-settings.php:319
474
  msgid "Link to Top 10 plugin page"
475
  msgstr ""
476
 
477
- #: includes/admin/register-settings.php:320
478
  msgid ""
479
  "A no-follow link to the plugin homepage will be added as the last item of "
480
  "the popular posts."
481
  msgstr ""
482
 
483
- #: includes/admin/register-settings.php:332
484
  msgid "Display number of views on"
485
  msgstr ""
486
 
487
- #: includes/admin/register-settings.php:334
488
- #: includes/admin/register-settings.php:498
489
  #, php-format
490
  msgid ""
491
  "If you choose to disable this, please add %1$s to your template file where "
492
  "you want it displayed"
493
  msgstr ""
494
 
495
- #: includes/admin/register-settings.php:341
496
  msgid "Posts"
497
  msgstr ""
498
 
499
- #: includes/admin/register-settings.php:342
500
  msgid "Pages"
501
  msgstr ""
502
 
503
- #: includes/admin/register-settings.php:343
504
  msgid "Home page"
505
  msgstr ""
506
 
507
- #: includes/admin/register-settings.php:344
508
  msgid "Feeds"
509
  msgstr ""
510
 
511
- #: includes/admin/register-settings.php:345
512
  msgid "Category archives"
513
  msgstr ""
514
 
515
- #: includes/admin/register-settings.php:346
516
  msgid "Tag archives"
517
  msgstr ""
518
 
519
- #: includes/admin/register-settings.php:347
520
  msgid "Other archives"
521
  msgstr ""
522
 
523
- #: includes/admin/register-settings.php:352
524
  msgid "Format to display the post views"
525
  msgstr ""
526
 
527
- #: includes/admin/register-settings.php:354
528
  #, php-format
529
  msgid ""
530
  "Use %1$s to display the total count, %2$s for daily count and %3$s for "
531
  "overall counts across all posts. Default display is %4$s"
532
  msgstr ""
533
 
534
- #: includes/admin/register-settings.php:360
535
  msgid "What do display when there are no visits?"
536
  msgstr ""
537
 
538
- #: includes/admin/register-settings.php:362
539
  msgid ""
540
  "This text applies only when there are 0 hits for the post and it isn't a "
541
  "single page. e.g. if you display post views on the homepage or archives then "
@@ -543,89 +422,129 @@ msgid ""
543
  "option."
544
  msgstr ""
545
 
546
- #: includes/admin/register-settings.php:368
 
 
 
 
 
 
 
 
 
 
547
  msgid "Always display latest post count"
548
  msgstr ""
549
 
550
- #: includes/admin/register-settings.php:369
551
  msgid ""
552
  "This option uses JavaScript and will increase your page load time. Turn this "
553
  "off if you are not using caching plugins or are OK with displaying older "
554
  "cached counts."
555
  msgstr ""
556
 
557
- #: includes/admin/register-settings.php:375
558
  msgid "Tracker type"
559
  msgstr ""
560
 
561
- #: includes/admin/register-settings.php:383
 
 
 
 
 
 
 
 
 
 
562
  msgid "Track user groups"
563
  msgstr ""
564
 
565
- #: includes/admin/register-settings.php:384
566
  msgid ""
567
  "Uncheck above to disable tracking if the current user falls into any one of "
568
  "these groups."
569
  msgstr ""
570
 
571
- #: includes/admin/register-settings.php:391
572
  msgid "Authors"
573
  msgstr ""
574
 
575
- #: includes/admin/register-settings.php:392
576
  msgid "Editors"
577
  msgstr ""
578
 
579
- #: includes/admin/register-settings.php:393
580
  msgid "Admins"
581
  msgstr ""
582
 
583
- #: includes/admin/register-settings.php:398
584
  msgid "Track logged-in users"
585
  msgstr ""
586
 
587
- #: includes/admin/register-settings.php:399
588
  msgid ""
589
  "Uncheck to stop tracking logged in users. Only logged out visitors will be "
590
  "tracked if this is disabled. Unchecking this will override the above setting."
591
  msgstr ""
592
 
593
- #: includes/admin/register-settings.php:405
 
 
 
 
 
 
 
 
 
 
594
  msgid "Page views in admin"
595
  msgstr ""
596
 
597
- #: includes/admin/register-settings.php:406
598
  msgid ""
599
  "Adds three columns called Total Views, Today's Views and Views to All Posts "
600
  "and All Pages. You can selectively disable these by pulling down the Screen "
601
  "Options from the top right of the respective screens."
602
  msgstr ""
603
 
604
- #: includes/admin/register-settings.php:412
605
  msgid "Show views to non-admins"
606
  msgstr ""
607
 
608
- #: includes/admin/register-settings.php:413
609
  msgid ""
610
  "If you disable this then non-admins won't see the above columns or view the "
611
  "independent pages with the top posts."
612
  msgstr ""
613
 
614
- #: includes/admin/register-settings.php:425
 
 
 
 
 
 
 
 
 
 
615
  msgid "Number of posts to display"
616
  msgstr ""
617
 
618
- #: includes/admin/register-settings.php:426
619
  msgid ""
620
  "Maximum number of posts that will be displayed in the list. This option is "
621
  "used if you don not specify the number of posts in the widget or shortcodes"
622
  msgstr ""
623
 
624
- #: includes/admin/register-settings.php:433
625
  msgid "Published age of posts"
626
  msgstr ""
627
 
628
- #: includes/admin/register-settings.php:434
629
  msgid ""
630
  "This options allows you to only show posts that have been published within "
631
  "the above day range. Applies to both overall posts and daily posts lists. e."
@@ -633,43 +552,43 @@ msgid ""
633
  "posts lists. Enter 0 for no restriction."
634
  msgstr ""
635
 
636
- #: includes/admin/register-settings.php:440
637
  msgid "Post types to include"
638
  msgstr ""
639
 
640
- #: includes/admin/register-settings.php:441
641
  msgid ""
642
  "At least one option should be selected above. Select which post types you "
643
  "want to include in the list of posts. This field can be overridden using a "
644
  "comma separated list of post types when using the manual display."
645
  msgstr ""
646
 
647
- #: includes/admin/register-settings.php:447
648
  msgid "Post/page IDs to exclude"
649
  msgstr ""
650
 
651
- #: includes/admin/register-settings.php:448
652
  msgid ""
653
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
654
  "188,320,500"
655
  msgstr ""
656
 
657
- #: includes/admin/register-settings.php:454
658
  msgid "Exclude Categories"
659
  msgstr ""
660
 
661
- #: includes/admin/register-settings.php:455
662
  msgid ""
663
  "Comma separated list of category slugs. The field above has an autocomplete "
664
  "so simply start typing in the starting letters and it will prompt you with "
665
  "options. Does not support custom taxonomies."
666
  msgstr ""
667
 
668
- #: includes/admin/register-settings.php:466
669
  msgid "Exclude category IDs"
670
  msgstr ""
671
 
672
- #: includes/admin/register-settings.php:467
673
  msgid ""
674
  "This is a readonly field that is automatically populated based on the above "
675
  "input when the settings are saved. These might differ from the IDs visible "
@@ -677,144 +596,134 @@ msgid ""
677
  "term_taxonomy_id which is unique to this taxonomy."
678
  msgstr ""
679
 
680
- #: includes/admin/register-settings.php:474
681
  msgid "Customize the output"
682
  msgstr ""
683
 
684
- #: includes/admin/register-settings.php:480
685
  msgid "Heading of posts"
686
  msgstr ""
687
 
688
- #: includes/admin/register-settings.php:481
689
- #: includes/admin/register-settings.php:489
690
  msgid "Displayed before the list of the posts as a the master heading"
691
  msgstr ""
692
 
693
- #: includes/admin/register-settings.php:483
694
  msgid "Popular posts:"
695
  msgstr ""
696
 
697
- #: includes/admin/register-settings.php:488
698
  msgid "Heading of posts for daily/custom period lists"
699
  msgstr ""
700
 
701
- #: includes/admin/register-settings.php:491
702
  msgid "Currently trending:"
703
  msgstr ""
704
 
705
- #: includes/admin/register-settings.php:496
706
  msgid "Show when no posts are found"
707
  msgstr ""
708
 
709
- #: includes/admin/register-settings.php:502
710
  msgid "Blank output"
711
  msgstr ""
712
 
713
- #: includes/admin/register-settings.php:503
714
  msgid "Display custom text"
715
  msgstr ""
716
 
717
- #: includes/admin/register-settings.php:508
718
  msgid "Custom text"
719
  msgstr ""
720
 
721
- #: includes/admin/register-settings.php:509
722
  msgid ""
723
  "Enter the custom text that will be displayed if the second option is "
724
  "selected above"
725
  msgstr ""
726
 
727
- #: includes/admin/register-settings.php:511 includes/deprecated.php:173
728
  msgid "No top posts yet"
729
  msgstr ""
730
 
731
- #: includes/admin/register-settings.php:515
732
  msgid "Show post excerpt"
733
  msgstr ""
734
 
735
- #: includes/admin/register-settings.php:522
736
  msgid "Length of excerpt (in words)"
737
  msgstr ""
738
 
739
- #: includes/admin/register-settings.php:530
740
  msgid "Show date"
741
  msgstr ""
742
 
743
- #: includes/admin/register-settings.php:537
744
  msgid "Show author"
745
  msgstr ""
746
 
747
- #: includes/admin/register-settings.php:544
748
  msgid "Show number of views"
749
  msgstr ""
750
 
751
- #: includes/admin/register-settings.php:551
752
  msgid "Limit post title length (in characters)"
753
  msgstr ""
754
 
755
- #: includes/admin/register-settings.php:559
756
  msgid "Open links in new window"
757
  msgstr ""
758
 
759
- #: includes/admin/register-settings.php:566
760
  msgid "Add nofollow to links"
761
  msgstr ""
762
 
763
- #: includes/admin/register-settings.php:573
764
- msgid "Exclude display on these post IDs"
765
- msgstr ""
766
-
767
- #: includes/admin/register-settings.php:574
768
- msgid ""
769
- "Comma-separated list of post or page IDs to exclude displaying the top posts "
770
- "on. e.g. 188,320,500"
771
- msgstr ""
772
-
773
- #: includes/admin/register-settings.php:580
774
  msgid "HTML to display"
775
  msgstr ""
776
 
777
- #: includes/admin/register-settings.php:586
778
  msgid "Before the list of posts"
779
  msgstr ""
780
 
781
- #: includes/admin/register-settings.php:593
782
  msgid "After the list of posts"
783
  msgstr ""
784
 
785
- #: includes/admin/register-settings.php:600
786
  msgid "Before each list item"
787
  msgstr ""
788
 
789
- #: includes/admin/register-settings.php:607
790
  msgid "After each list item"
791
  msgstr ""
792
 
793
- #: includes/admin/register-settings.php:620
794
  msgid "Location of the post thumbnail"
795
  msgstr ""
796
 
797
- #: includes/admin/register-settings.php:625
798
  msgid "Display thumbnails inline with posts, before title"
799
  msgstr ""
800
 
801
- #: includes/admin/register-settings.php:626
802
  msgid "Display thumbnails inline with posts, after title"
803
  msgstr ""
804
 
805
- #: includes/admin/register-settings.php:627
806
  msgid "Display only thumbnails, no text"
807
  msgstr ""
808
 
809
- #: includes/admin/register-settings.php:628
810
  msgid "Do not display thumbnails, only text"
811
  msgstr ""
812
 
813
- #: includes/admin/register-settings.php:633
814
  msgid "Thumbnail size"
815
  msgstr ""
816
 
817
- #: includes/admin/register-settings.php:635
818
  msgid ""
819
  "You can choose from existing image sizes above or create a custom size. If "
820
  "you have chosen Custom size above, then enter the width, height and crop "
@@ -822,179 +731,313 @@ msgid ""
822
  "width and/or height below, existing images will not be automatically resized."
823
  msgstr ""
824
 
825
- #: includes/admin/register-settings.php:635
826
  #, php-format
827
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
828
  msgstr ""
829
 
830
- #: includes/admin/register-settings.php:642
831
  #: includes/modules/class-top-ten-widget.php:145
832
  msgid "Thumbnail width"
833
  msgstr ""
834
 
835
- #: includes/admin/register-settings.php:650
836
  #: includes/modules/class-top-ten-widget.php:139
837
  msgid "Thumbnail height"
838
  msgstr ""
839
 
840
- #: includes/admin/register-settings.php:658
841
  msgid "Hard crop thumbnails"
842
  msgstr ""
843
 
844
- #: includes/admin/register-settings.php:659
845
  msgid ""
846
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
847
  "above vs. maintaining proportions."
848
  msgstr ""
849
 
850
- #: includes/admin/register-settings.php:665
 
 
 
 
 
 
 
 
 
 
 
851
  msgid "Thumbnail size attributes"
852
  msgstr ""
853
 
854
- #: includes/admin/register-settings.php:671
855
  #, php-format
856
  msgid "Use CSS to set the width and height: e.g. %s"
857
  msgstr ""
858
 
859
- #: includes/admin/register-settings.php:673
860
  #, php-format
861
  msgid "Use HTML attributes to set the width and height: e.g. %s"
862
  msgstr ""
863
 
864
- #: includes/admin/register-settings.php:674
865
  msgid ""
866
  "No width or height set. You will need to use external styles to force any "
867
  "width or height of your choice."
868
  msgstr ""
869
 
870
- #: includes/admin/register-settings.php:679
871
  msgid "Thumbnail meta field name"
872
  msgstr ""
873
 
874
- #: includes/admin/register-settings.php:680
875
  msgid ""
876
  "The value of this field should contain the URL of the image and can be set "
877
  "in the metabox in the Edit Post screen"
878
  msgstr ""
879
 
880
- #: includes/admin/register-settings.php:686
881
  msgid "Get first image"
882
  msgstr ""
883
 
884
- #: includes/admin/register-settings.php:687
885
  msgid ""
886
  "The plugin will fetch the first image in the post content if this is "
887
  "enabled. This can slow down the loading of your page if the first image in "
888
  "the followed posts is large in file-size."
889
  msgstr ""
890
 
891
- #: includes/admin/register-settings.php:693
892
  msgid "Use default thumbnail?"
893
  msgstr ""
894
 
895
- #: includes/admin/register-settings.php:694
896
  msgid ""
897
  "If checked, when no thumbnail is found, show a default one from the URL "
898
  "below. If not checked and no thumbnail is found, no image will be shown."
899
  msgstr ""
900
 
901
- #: includes/admin/register-settings.php:700
902
- #: includes/admin/settings-page.php:687
903
  msgid "Default thumbnail"
904
  msgstr ""
905
 
906
- #: includes/admin/register-settings.php:701
907
  msgid ""
908
  "Enter the full URL of the image that you wish to display if no thumbnail is "
909
  "found. This image will be displayed below."
910
  msgstr ""
911
 
912
- #: includes/admin/register-settings.php:714
913
  msgid "Popular posts style"
914
  msgstr ""
915
 
916
- #: includes/admin/register-settings.php:722
917
  msgid "Custom CSS"
918
  msgstr ""
919
 
920
- #: includes/admin/register-settings.php:724
921
  #, php-format
922
  msgid ""
923
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
924
  "CSS classes to style."
925
  msgstr ""
926
 
927
- #: includes/admin/register-settings.php:736
928
  msgid "Enable scheduled maintenance"
929
  msgstr ""
930
 
931
- #: includes/admin/register-settings.php:737
932
  msgid ""
933
  "Cleaning the database at regular intervals could improve performance, "
934
  "especially on high traffic blogs. Enabling maintenance will automatically "
935
  "delete entries older than 90 days in the daily tables."
936
  msgstr ""
937
 
938
- #: includes/admin/register-settings.php:743
939
  msgid "Time to run maintenance"
940
  msgstr ""
941
 
942
- #: includes/admin/register-settings.php:744
943
  msgid "The next two options allow you to set the time to run the cron."
944
  msgstr ""
945
 
946
- #: includes/admin/register-settings.php:749
947
  msgid "Hour"
948
  msgstr ""
949
 
950
- #: includes/admin/register-settings.php:759
951
  msgid "Minute"
952
  msgstr ""
953
 
954
- #: includes/admin/register-settings.php:769
955
  msgid "Run maintenance"
956
  msgstr ""
957
 
958
- #: includes/admin/register-settings.php:775
959
  msgid "Weekly"
960
  msgstr ""
961
 
962
- #: includes/admin/register-settings.php:776
963
  msgid "Fortnightly"
964
  msgstr ""
965
 
966
- #: includes/admin/register-settings.php:777
967
  msgid "Monthly"
968
  msgstr ""
969
 
970
- #: includes/admin/register-settings.php:986
971
  msgid "No styles"
972
  msgstr ""
973
 
974
- #: includes/admin/register-settings.php:987
975
  msgid "Select this option if you plan to add your own styles"
976
  msgstr ""
977
 
978
- #: includes/admin/register-settings.php:991
979
  msgid "Text only"
980
  msgstr ""
981
 
982
- #: includes/admin/register-settings.php:992
983
  msgid ""
984
  "Disable thumbnails and no longer include the default style sheet included in "
985
  "the plugin"
986
  msgstr ""
987
 
988
- #: includes/admin/register-settings.php:996
989
  msgid "Left thumbnails"
990
  msgstr ""
991
 
992
- #: includes/admin/register-settings.php:997
993
  msgid ""
994
  "Enabling this option will set the post thumbnail to be before text. "
995
  "Disabling this option will not revert any settings."
996
  msgstr ""
997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  #: includes/admin/save-settings.php:51
999
  msgid ""
1000
  "Settings have been reset to their default values. Reload this page to view "
@@ -1210,11 +1253,11 @@ msgstr ""
1210
  msgid "Once quarterly"
1211
  msgstr ""
1212
 
1213
- #: includes/deprecated.php:171
1214
  msgid "<h3>Popular Posts</h3>"
1215
  msgstr ""
1216
 
1217
- #: includes/deprecated.php:172
1218
  msgid "<h3>Daily Popular</h3>"
1219
  msgstr ""
1220
 
@@ -1304,7 +1347,7 @@ msgid ""
1304
  "posts only."
1305
  msgstr ""
1306
 
1307
- #: includes/public/display-posts.php:232
1308
  #, php-format
1309
  msgid ""
1310
  "Popular posts by <a href=\"%1$s\" rel=\"nofollow\" %2$s>Top 10 plugin</a>"
@@ -1326,19 +1369,19 @@ msgstr ""
1326
  msgid " by "
1327
  msgstr ""
1328
 
1329
- #: includes/tracker.php:248
1330
  msgid "Query variable based"
1331
  msgstr ""
1332
 
1333
- #: includes/tracker.php:249
1334
  msgid "Uses query variables to record visits"
1335
  msgstr ""
1336
 
1337
- #: includes/tracker.php:253
1338
  msgid "Ajaxurl based"
1339
  msgstr ""
1340
 
1341
- #: includes/tracker.php:254
1342
  msgid ""
1343
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1344
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: Top 10\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2019-02-09 17:23+0530\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
13
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;esc_html__;esc_attr__;esc_html_e;"
14
  "esc_attr_e\n"
15
  "X-Poedit-Basepath: ..\n"
16
+ "X-Generator: Poedit 2.2\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: .\n"
44
  msgstr ""
45
 
46
  #: includes/admin/admin-dashboard.php:127 includes/admin/admin.php:44
47
+ #: includes/admin/class-top-ten-statistics.php:124
48
  msgid "Popular Posts"
49
  msgstr ""
50
 
113
  msgid "Top 10"
114
  msgstr ""
115
 
116
+ #: includes/admin/admin.php:34 includes/admin/admin.php:336
117
  msgid "Settings"
118
  msgstr ""
119
 
125
  msgid "Tools"
126
  msgstr ""
127
 
128
+ #: includes/admin/admin.php:44 includes/admin/class-top-ten-statistics.php:74
 
129
  msgid "Top 10 Popular Posts"
130
  msgstr ""
131
 
133
  msgid "Top 10 Daily Popular Posts"
134
  msgstr ""
135
 
136
+ #: includes/admin/admin.php:202
137
  msgid "New information not saved. Do you wish to leave the page?"
138
  msgstr ""
139
 
140
+ #: includes/admin/admin.php:290
141
  #, php-format
142
  msgid ""
143
  "Thank you for using <a href=\"%1$s\" target=\"_blank\">Top 10</a>! Please <a "
145
  "\"_blank\">WordPress.org</a>"
146
  msgstr ""
147
 
148
+ #: includes/admin/admin.php:358 includes/admin/sidebar.php:55
149
  msgid "Support"
150
  msgstr ""
151
 
152
+ #: includes/admin/admin.php:359
153
  msgid "Donate"
154
  msgstr ""
155
 
156
+ #: includes/admin/admin.php:360
157
  msgid "Contribute"
158
  msgstr ""
159
 
161
  msgid "Top 10 cache has been cleared"
162
  msgstr ""
163
 
164
+ #: includes/admin/class-top-ten-statistics-table.php:43
165
  msgid "popular_post"
166
  msgstr ""
167
 
168
+ #: includes/admin/class-top-ten-statistics-table.php:44
169
  msgid "popular_posts"
170
  msgstr ""
171
 
172
+ #: includes/admin/class-top-ten-statistics-table.php:48
173
+ msgid "All post types"
174
+ msgstr ""
175
+
176
+ #: includes/admin/class-top-ten-statistics-table.php:213
177
  msgid "No popular posts available."
178
  msgstr ""
179
 
180
+ #: includes/admin/class-top-ten-statistics-table.php:264
181
  msgid "View"
182
  msgstr ""
183
 
184
+ #: includes/admin/class-top-ten-statistics-table.php:265
185
  msgid "Edit"
186
  msgstr ""
187
 
188
+ #: includes/admin/class-top-ten-statistics-table.php:266
189
  msgid "Delete"
190
  msgstr ""
191
 
192
+ #: includes/admin/class-top-ten-statistics-table.php:289
193
  msgid "Y/m/d g:i:s a"
194
  msgstr ""
195
 
196
+ #: includes/admin/class-top-ten-statistics-table.php:297
197
  #, php-format
198
  msgid "%s ago"
199
  msgstr ""
200
 
201
+ #: includes/admin/class-top-ten-statistics-table.php:299
202
  msgid "Y/m/d"
203
  msgstr ""
204
 
205
+ #: includes/admin/class-top-ten-statistics-table.php:338
206
  #: includes/modules/class-top-ten-count-widget.php:53
207
  #: includes/modules/class-top-ten-widget.php:80
208
  msgid "Title"
209
  msgstr ""
210
 
211
+ #: includes/admin/class-top-ten-statistics-table.php:339
212
  msgid "Total visits"
213
  msgstr ""
214
 
215
+ #: includes/admin/class-top-ten-statistics-table.php:340
216
  msgid "Daily visits"
217
  msgstr ""
218
 
219
+ #: includes/admin/class-top-ten-statistics-table.php:341
220
  msgid "Post type"
221
  msgstr ""
222
 
223
+ #: includes/admin/class-top-ten-statistics-table.php:342
224
  msgid "Author"
225
  msgstr ""
226
 
227
+ #: includes/admin/class-top-ten-statistics-table.php:343
228
  msgid "Date"
229
  msgstr ""
230
 
231
+ #: includes/admin/class-top-ten-statistics-table.php:377
232
  msgid "Delete Count"
233
  msgstr ""
234
 
235
+ #: includes/admin/class-top-ten-statistics-table.php:424
236
  msgid "Are you sure you want to do this"
237
  msgstr ""
238
 
239
+ #: includes/admin/class-top-ten-statistics-table.php:489
240
  msgid "Filter"
241
  msgstr ""
242
 
243
+ #: includes/admin/class-top-ten-statistics.php:99
244
  msgid "Search Table"
245
  msgstr ""
246
 
247
+ #: includes/admin/default-settings.php:62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  msgid "Enable trackers"
249
  msgstr ""
250
 
251
+ #: includes/admin/default-settings.php:71
252
  #: includes/modules/class-top-ten-widget.php:95
253
  msgid "Overall"
254
  msgstr ""
255
 
256
+ #: includes/admin/default-settings.php:72
257
+ #: includes/admin/default-settings.php:719
258
  msgid "Daily"
259
  msgstr ""
260
 
261
+ #: includes/admin/default-settings.php:77
262
  msgid "Enable cache"
263
  msgstr ""
264
 
265
+ #: includes/admin/default-settings.php:78
266
  msgid ""
267
  "If activated, Top 10 will use the Transients API to cache the popular posts "
268
  "output for 1 hour."
269
  msgstr ""
270
 
271
+ #: includes/admin/default-settings.php:84
272
  msgid "Time to cache"
273
  msgstr ""
274
 
275
+ #: includes/admin/default-settings.php:85
276
  msgid "Enter the number of seconds to cache the output."
277
  msgstr ""
278
 
279
+ #: includes/admin/default-settings.php:91
280
  msgid "Start daily counts from midnight"
281
  msgstr ""
282
 
283
+ #: includes/admin/default-settings.php:92
284
  msgid ""
285
  "Daily counter will display number of visits from midnight. This option is "
286
  "checked by default and mimics the way most normal counters work. Turning "
287
  "this off will allow you to use the hourly setting in the next option."
288
  msgstr ""
289
 
290
+ #: includes/admin/default-settings.php:98
291
  msgid "Default custom period range"
292
  msgstr ""
293
 
294
+ #: includes/admin/default-settings.php:99
295
  msgid ""
296
  "The next two options allow you to set the default range for the custom "
297
  "period. This was previously called the daily range. This can be overridden "
298
  "in the widget."
299
  msgstr ""
300
 
301
+ #: includes/admin/default-settings.php:104
302
  msgid "Day(s)"
303
  msgstr ""
304
 
305
+ #: includes/admin/default-settings.php:113
306
  msgid "Hour(s)"
307
  msgstr ""
308
 
309
+ #: includes/admin/default-settings.php:123
310
  msgid "Delete options on uninstall"
311
  msgstr ""
312
 
313
+ #: includes/admin/default-settings.php:124
314
  msgid ""
315
  "If this is checked, all settings related to Top 10 are removed from the "
316
  "database if you choose to uninstall/delete the plugin."
317
  msgstr ""
318
 
319
+ #: includes/admin/default-settings.php:130
320
  msgid "Delete counter data on uninstall"
321
  msgstr ""
322
 
323
+ #: includes/admin/default-settings.php:131
324
  msgid ""
325
  "If this is checked, the tables containing the counter statistics are removed "
326
  "from the database if you choose to uninstall/delete the plugin. Keep this "
328
  "counter data."
329
  msgstr ""
330
 
331
+ #: includes/admin/default-settings.php:137
332
  msgid "Show metabox"
333
  msgstr ""
334
 
335
+ #: includes/admin/default-settings.php:138
336
  msgid ""
337
  "This will add the Top 10 metabox on Edit Posts or Add New Posts screens. "
338
  "Also applies to Pages and Custom Post Types."
339
  msgstr ""
340
 
341
+ #: includes/admin/default-settings.php:144
342
  msgid "Limit meta box to Admins only"
343
  msgstr ""
344
 
345
+ #: includes/admin/default-settings.php:145
346
  msgid ""
347
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
348
  "default, Contributors and above will be able to see the meta box. Applies "
349
  "only if the above option is selected."
350
  msgstr ""
351
 
352
+ #: includes/admin/default-settings.php:151
353
  msgid "Link to Top 10 plugin page"
354
  msgstr ""
355
 
356
+ #: includes/admin/default-settings.php:152
357
  msgid ""
358
  "A no-follow link to the plugin homepage will be added as the last item of "
359
  "the popular posts."
360
  msgstr ""
361
 
362
+ #: includes/admin/default-settings.php:181
363
  msgid "Display number of views on"
364
  msgstr ""
365
 
366
+ #: includes/admin/default-settings.php:183
367
+ #: includes/admin/default-settings.php:392
368
  #, php-format
369
  msgid ""
370
  "If you choose to disable this, please add %1$s to your template file where "
371
  "you want it displayed"
372
  msgstr ""
373
 
374
+ #: includes/admin/default-settings.php:190
375
  msgid "Posts"
376
  msgstr ""
377
 
378
+ #: includes/admin/default-settings.php:191
379
  msgid "Pages"
380
  msgstr ""
381
 
382
+ #: includes/admin/default-settings.php:192
383
  msgid "Home page"
384
  msgstr ""
385
 
386
+ #: includes/admin/default-settings.php:193
387
  msgid "Feeds"
388
  msgstr ""
389
 
390
+ #: includes/admin/default-settings.php:194
391
  msgid "Category archives"
392
  msgstr ""
393
 
394
+ #: includes/admin/default-settings.php:195
395
  msgid "Tag archives"
396
  msgstr ""
397
 
398
+ #: includes/admin/default-settings.php:196
399
  msgid "Other archives"
400
  msgstr ""
401
 
402
+ #: includes/admin/default-settings.php:201
403
  msgid "Format to display the post views"
404
  msgstr ""
405
 
406
+ #: includes/admin/default-settings.php:203
407
  #, php-format
408
  msgid ""
409
  "Use %1$s to display the total count, %2$s for daily count and %3$s for "
410
  "overall counts across all posts. Default display is %4$s"
411
  msgstr ""
412
 
413
+ #: includes/admin/default-settings.php:209
414
  msgid "What do display when there are no visits?"
415
  msgstr ""
416
 
417
+ #: includes/admin/default-settings.php:211
418
  msgid ""
419
  "This text applies only when there are 0 hits for the post and it isn't a "
420
  "single page. e.g. if you display post views on the homepage or archives then "
422
  "option."
423
  msgstr ""
424
 
425
+ #: includes/admin/default-settings.php:217
426
+ msgid "Number format post count"
427
+ msgstr ""
428
+
429
+ #: includes/admin/default-settings.php:218
430
+ msgid ""
431
+ "Activating this option will convert the post counts into a number format "
432
+ "based on the locale"
433
+ msgstr ""
434
+
435
+ #: includes/admin/default-settings.php:224
436
  msgid "Always display latest post count"
437
  msgstr ""
438
 
439
+ #: includes/admin/default-settings.php:225
440
  msgid ""
441
  "This option uses JavaScript and will increase your page load time. Turn this "
442
  "off if you are not using caching plugins or are OK with displaying older "
443
  "cached counts."
444
  msgstr ""
445
 
446
+ #: includes/admin/default-settings.php:231
447
  msgid "Tracker type"
448
  msgstr ""
449
 
450
+ #: includes/admin/default-settings.php:239
451
+ msgid "Load tracker on all pages"
452
+ msgstr ""
453
+
454
+ #: includes/admin/default-settings.php:240
455
+ msgid ""
456
+ "This will load the tracker js on all pages. Helpful if you are running "
457
+ "minification/concatenation plugins."
458
+ msgstr ""
459
+
460
+ #: includes/admin/default-settings.php:246
461
  msgid "Track user groups"
462
  msgstr ""
463
 
464
+ #: includes/admin/default-settings.php:247
465
  msgid ""
466
  "Uncheck above to disable tracking if the current user falls into any one of "
467
  "these groups."
468
  msgstr ""
469
 
470
+ #: includes/admin/default-settings.php:254
471
  msgid "Authors"
472
  msgstr ""
473
 
474
+ #: includes/admin/default-settings.php:255
475
  msgid "Editors"
476
  msgstr ""
477
 
478
+ #: includes/admin/default-settings.php:256
479
  msgid "Admins"
480
  msgstr ""
481
 
482
+ #: includes/admin/default-settings.php:261
483
  msgid "Track logged-in users"
484
  msgstr ""
485
 
486
+ #: includes/admin/default-settings.php:262
487
  msgid ""
488
  "Uncheck to stop tracking logged in users. Only logged out visitors will be "
489
  "tracked if this is disabled. Unchecking this will override the above setting."
490
  msgstr ""
491
 
492
+ #: includes/admin/default-settings.php:268
493
+ msgid "Exclude display on these post IDs"
494
+ msgstr ""
495
+
496
+ #: includes/admin/default-settings.php:269
497
+ msgid ""
498
+ "Comma-separated list of post or page IDs to exclude displaying the top posts "
499
+ "on. e.g. 188,320,500"
500
+ msgstr ""
501
+
502
+ #: includes/admin/default-settings.php:275
503
  msgid "Page views in admin"
504
  msgstr ""
505
 
506
+ #: includes/admin/default-settings.php:276
507
  msgid ""
508
  "Adds three columns called Total Views, Today's Views and Views to All Posts "
509
  "and All Pages. You can selectively disable these by pulling down the Screen "
510
  "Options from the top right of the respective screens."
511
  msgstr ""
512
 
513
+ #: includes/admin/default-settings.php:282
514
  msgid "Show views to non-admins"
515
  msgstr ""
516
 
517
+ #: includes/admin/default-settings.php:283
518
  msgid ""
519
  "If you disable this then non-admins won't see the above columns or view the "
520
  "independent pages with the top posts."
521
  msgstr ""
522
 
523
+ #: includes/admin/default-settings.php:289
524
+ msgid "Debug mode"
525
+ msgstr ""
526
+
527
+ #: includes/admin/default-settings.php:290
528
+ msgid ""
529
+ "Setting this to true will force the tracker to display an output in the "
530
+ "browser. This is useful if you are having issues and are seeking support."
531
+ msgstr ""
532
+
533
+ #: includes/admin/default-settings.php:319
534
  msgid "Number of posts to display"
535
  msgstr ""
536
 
537
+ #: includes/admin/default-settings.php:320
538
  msgid ""
539
  "Maximum number of posts that will be displayed in the list. This option is "
540
  "used if you don not specify the number of posts in the widget or shortcodes"
541
  msgstr ""
542
 
543
+ #: includes/admin/default-settings.php:327
544
  msgid "Published age of posts"
545
  msgstr ""
546
 
547
+ #: includes/admin/default-settings.php:328
548
  msgid ""
549
  "This options allows you to only show posts that have been published within "
550
  "the above day range. Applies to both overall posts and daily posts lists. e."
552
  "posts lists. Enter 0 for no restriction."
553
  msgstr ""
554
 
555
+ #: includes/admin/default-settings.php:334
556
  msgid "Post types to include"
557
  msgstr ""
558
 
559
+ #: includes/admin/default-settings.php:335
560
  msgid ""
561
  "At least one option should be selected above. Select which post types you "
562
  "want to include in the list of posts. This field can be overridden using a "
563
  "comma separated list of post types when using the manual display."
564
  msgstr ""
565
 
566
+ #: includes/admin/default-settings.php:341
567
  msgid "Post/page IDs to exclude"
568
  msgstr ""
569
 
570
+ #: includes/admin/default-settings.php:342
571
  msgid ""
572
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
573
  "188,320,500"
574
  msgstr ""
575
 
576
+ #: includes/admin/default-settings.php:348
577
  msgid "Exclude Categories"
578
  msgstr ""
579
 
580
+ #: includes/admin/default-settings.php:349
581
  msgid ""
582
  "Comma separated list of category slugs. The field above has an autocomplete "
583
  "so simply start typing in the starting letters and it will prompt you with "
584
  "options. Does not support custom taxonomies."
585
  msgstr ""
586
 
587
+ #: includes/admin/default-settings.php:360
588
  msgid "Exclude category IDs"
589
  msgstr ""
590
 
591
+ #: includes/admin/default-settings.php:361
592
  msgid ""
593
  "This is a readonly field that is automatically populated based on the above "
594
  "input when the settings are saved. These might differ from the IDs visible "
596
  "term_taxonomy_id which is unique to this taxonomy."
597
  msgstr ""
598
 
599
+ #: includes/admin/default-settings.php:368
600
  msgid "Customize the output"
601
  msgstr ""
602
 
603
+ #: includes/admin/default-settings.php:374
604
  msgid "Heading of posts"
605
  msgstr ""
606
 
607
+ #: includes/admin/default-settings.php:375
608
+ #: includes/admin/default-settings.php:383
609
  msgid "Displayed before the list of the posts as a the master heading"
610
  msgstr ""
611
 
612
+ #: includes/admin/default-settings.php:377
613
  msgid "Popular posts:"
614
  msgstr ""
615
 
616
+ #: includes/admin/default-settings.php:382
617
  msgid "Heading of posts for daily/custom period lists"
618
  msgstr ""
619
 
620
+ #: includes/admin/default-settings.php:385
621
  msgid "Currently trending:"
622
  msgstr ""
623
 
624
+ #: includes/admin/default-settings.php:390
625
  msgid "Show when no posts are found"
626
  msgstr ""
627
 
628
+ #: includes/admin/default-settings.php:396
629
  msgid "Blank output"
630
  msgstr ""
631
 
632
+ #: includes/admin/default-settings.php:397
633
  msgid "Display custom text"
634
  msgstr ""
635
 
636
+ #: includes/admin/default-settings.php:402
637
  msgid "Custom text"
638
  msgstr ""
639
 
640
+ #: includes/admin/default-settings.php:403
641
  msgid ""
642
  "Enter the custom text that will be displayed if the second option is "
643
  "selected above"
644
  msgstr ""
645
 
646
+ #: includes/admin/default-settings.php:405 includes/deprecated.php:180
647
  msgid "No top posts yet"
648
  msgstr ""
649
 
650
+ #: includes/admin/default-settings.php:409
651
  msgid "Show post excerpt"
652
  msgstr ""
653
 
654
+ #: includes/admin/default-settings.php:416
655
  msgid "Length of excerpt (in words)"
656
  msgstr ""
657
 
658
+ #: includes/admin/default-settings.php:424
659
  msgid "Show date"
660
  msgstr ""
661
 
662
+ #: includes/admin/default-settings.php:431
663
  msgid "Show author"
664
  msgstr ""
665
 
666
+ #: includes/admin/default-settings.php:438
667
  msgid "Show number of views"
668
  msgstr ""
669
 
670
+ #: includes/admin/default-settings.php:445
671
  msgid "Limit post title length (in characters)"
672
  msgstr ""
673
 
674
+ #: includes/admin/default-settings.php:453
675
  msgid "Open links in new window"
676
  msgstr ""
677
 
678
+ #: includes/admin/default-settings.php:460
679
  msgid "Add nofollow to links"
680
  msgstr ""
681
 
682
+ #: includes/admin/default-settings.php:467
 
 
 
 
 
 
 
 
 
 
683
  msgid "HTML to display"
684
  msgstr ""
685
 
686
+ #: includes/admin/default-settings.php:473
687
  msgid "Before the list of posts"
688
  msgstr ""
689
 
690
+ #: includes/admin/default-settings.php:480
691
  msgid "After the list of posts"
692
  msgstr ""
693
 
694
+ #: includes/admin/default-settings.php:487
695
  msgid "Before each list item"
696
  msgstr ""
697
 
698
+ #: includes/admin/default-settings.php:494
699
  msgid "After each list item"
700
  msgstr ""
701
 
702
+ #: includes/admin/default-settings.php:524
703
  msgid "Location of the post thumbnail"
704
  msgstr ""
705
 
706
+ #: includes/admin/default-settings.php:529
707
  msgid "Display thumbnails inline with posts, before title"
708
  msgstr ""
709
 
710
+ #: includes/admin/default-settings.php:530
711
  msgid "Display thumbnails inline with posts, after title"
712
  msgstr ""
713
 
714
+ #: includes/admin/default-settings.php:531
715
  msgid "Display only thumbnails, no text"
716
  msgstr ""
717
 
718
+ #: includes/admin/default-settings.php:532
719
  msgid "Do not display thumbnails, only text"
720
  msgstr ""
721
 
722
+ #: includes/admin/default-settings.php:537
723
  msgid "Thumbnail size"
724
  msgstr ""
725
 
726
+ #: includes/admin/default-settings.php:539
727
  msgid ""
728
  "You can choose from existing image sizes above or create a custom size. If "
729
  "you have chosen Custom size above, then enter the width, height and crop "
731
  "width and/or height below, existing images will not be automatically resized."
732
  msgstr ""
733
 
734
+ #: includes/admin/default-settings.php:539
735
  #, php-format
736
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
737
  msgstr ""
738
 
739
+ #: includes/admin/default-settings.php:546
740
  #: includes/modules/class-top-ten-widget.php:145
741
  msgid "Thumbnail width"
742
  msgstr ""
743
 
744
+ #: includes/admin/default-settings.php:554
745
  #: includes/modules/class-top-ten-widget.php:139
746
  msgid "Thumbnail height"
747
  msgstr ""
748
 
749
+ #: includes/admin/default-settings.php:562
750
  msgid "Hard crop thumbnails"
751
  msgstr ""
752
 
753
+ #: includes/admin/default-settings.php:563
754
  msgid ""
755
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
756
  "above vs. maintaining proportions."
757
  msgstr ""
758
 
759
+ #: includes/admin/default-settings.php:569
760
+ msgid "Generate thumbnail sizes"
761
+ msgstr ""
762
+
763
+ #: includes/admin/default-settings.php:570
764
+ msgid ""
765
+ "If you select this option and Custom size is selected above, the plugin will "
766
+ "register the image size with WordPress to create new thumbnails. Does not "
767
+ "update old images as explained above."
768
+ msgstr ""
769
+
770
+ #: includes/admin/default-settings.php:576
771
  msgid "Thumbnail size attributes"
772
  msgstr ""
773
 
774
+ #: includes/admin/default-settings.php:582
775
  #, php-format
776
  msgid "Use CSS to set the width and height: e.g. %s"
777
  msgstr ""
778
 
779
+ #: includes/admin/default-settings.php:584
780
  #, php-format
781
  msgid "Use HTML attributes to set the width and height: e.g. %s"
782
  msgstr ""
783
 
784
+ #: includes/admin/default-settings.php:585
785
  msgid ""
786
  "No width or height set. You will need to use external styles to force any "
787
  "width or height of your choice."
788
  msgstr ""
789
 
790
+ #: includes/admin/default-settings.php:590
791
  msgid "Thumbnail meta field name"
792
  msgstr ""
793
 
794
+ #: includes/admin/default-settings.php:591
795
  msgid ""
796
  "The value of this field should contain the URL of the image and can be set "
797
  "in the metabox in the Edit Post screen"
798
  msgstr ""
799
 
800
+ #: includes/admin/default-settings.php:597
801
  msgid "Get first image"
802
  msgstr ""
803
 
804
+ #: includes/admin/default-settings.php:598
805
  msgid ""
806
  "The plugin will fetch the first image in the post content if this is "
807
  "enabled. This can slow down the loading of your page if the first image in "
808
  "the followed posts is large in file-size."
809
  msgstr ""
810
 
811
+ #: includes/admin/default-settings.php:604
812
  msgid "Use default thumbnail?"
813
  msgstr ""
814
 
815
+ #: includes/admin/default-settings.php:605
816
  msgid ""
817
  "If checked, when no thumbnail is found, show a default one from the URL "
818
  "below. If not checked and no thumbnail is found, no image will be shown."
819
  msgstr ""
820
 
821
+ #: includes/admin/default-settings.php:611 includes/admin/settings-page.php:687
 
822
  msgid "Default thumbnail"
823
  msgstr ""
824
 
825
+ #: includes/admin/default-settings.php:612
826
  msgid ""
827
  "Enter the full URL of the image that you wish to display if no thumbnail is "
828
  "found. This image will be displayed below."
829
  msgstr ""
830
 
831
+ #: includes/admin/default-settings.php:642
832
  msgid "Popular posts style"
833
  msgstr ""
834
 
835
+ #: includes/admin/default-settings.php:650
836
  msgid "Custom CSS"
837
  msgstr ""
838
 
839
+ #: includes/admin/default-settings.php:652
840
  #, php-format
841
  msgid ""
842
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
843
  "CSS classes to style."
844
  msgstr ""
845
 
846
+ #: includes/admin/default-settings.php:681
847
  msgid "Enable scheduled maintenance"
848
  msgstr ""
849
 
850
+ #: includes/admin/default-settings.php:682
851
  msgid ""
852
  "Cleaning the database at regular intervals could improve performance, "
853
  "especially on high traffic blogs. Enabling maintenance will automatically "
854
  "delete entries older than 90 days in the daily tables."
855
  msgstr ""
856
 
857
+ #: includes/admin/default-settings.php:688
858
  msgid "Time to run maintenance"
859
  msgstr ""
860
 
861
+ #: includes/admin/default-settings.php:689
862
  msgid "The next two options allow you to set the time to run the cron."
863
  msgstr ""
864
 
865
+ #: includes/admin/default-settings.php:694
866
  msgid "Hour"
867
  msgstr ""
868
 
869
+ #: includes/admin/default-settings.php:704
870
  msgid "Minute"
871
  msgstr ""
872
 
873
+ #: includes/admin/default-settings.php:714
874
  msgid "Run maintenance"
875
  msgstr ""
876
 
877
+ #: includes/admin/default-settings.php:720
878
  msgid "Weekly"
879
  msgstr ""
880
 
881
+ #: includes/admin/default-settings.php:721
882
  msgid "Fortnightly"
883
  msgstr ""
884
 
885
+ #: includes/admin/default-settings.php:722
886
  msgid "Monthly"
887
  msgstr ""
888
 
889
+ #: includes/admin/default-settings.php:820
890
  msgid "No styles"
891
  msgstr ""
892
 
893
+ #: includes/admin/default-settings.php:821
894
  msgid "Select this option if you plan to add your own styles"
895
  msgstr ""
896
 
897
+ #: includes/admin/default-settings.php:825
898
  msgid "Text only"
899
  msgstr ""
900
 
901
+ #: includes/admin/default-settings.php:826
902
  msgid ""
903
  "Disable thumbnails and no longer include the default style sheet included in "
904
  "the plugin"
905
  msgstr ""
906
 
907
+ #: includes/admin/default-settings.php:830
908
  msgid "Left thumbnails"
909
  msgstr ""
910
 
911
+ #: includes/admin/default-settings.php:831
912
  msgid ""
913
  "Enabling this option will set the post thumbnail to be before text. "
914
  "Disabling this option will not revert any settings."
915
  msgstr ""
916
 
917
+ #: includes/admin/help-tab.php:35 includes/admin/help-tab.php:126
918
+ #, php-format
919
+ msgid ""
920
+ "For more information or how to get support visit the <a href=\"%1$s"
921
+ "\">WebberZone support site</a>."
922
+ msgstr ""
923
+
924
+ #: includes/admin/help-tab.php:37 includes/admin/help-tab.php:128
925
+ #, php-format
926
+ msgid ""
927
+ "Support queries should be posted in the <a href=\"%1$s\">WordPress.org "
928
+ "support forums</a>."
929
+ msgstr ""
930
+
931
+ #: includes/admin/help-tab.php:40 includes/admin/help-tab.php:131
932
+ #, php-format
933
+ msgid ""
934
+ "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug "
935
+ "reports only)."
936
+ msgstr ""
937
+
938
+ #: includes/admin/help-tab.php:49 includes/admin/help-tab.php:140
939
+ #: includes/admin/settings-page.php:125
940
+ msgid "General"
941
+ msgstr ""
942
+
943
+ #: includes/admin/help-tab.php:51
944
+ msgid "This screen provides the basic settings for configuring Top 10."
945
+ msgstr ""
946
+
947
+ #: includes/admin/help-tab.php:52
948
+ msgid ""
949
+ "Enable the trackers and cache, configure basic tracker settings and "
950
+ "uninstall settings."
951
+ msgstr ""
952
+
953
+ #: includes/admin/help-tab.php:59 includes/admin/settings-page.php:126
954
+ msgid "Counter/Tracker"
955
+ msgstr ""
956
+
957
+ #: includes/admin/help-tab.php:61
958
+ msgid ""
959
+ "This screen provides settings to tweak the display counter and the tracker."
960
+ msgstr ""
961
+
962
+ #: includes/admin/help-tab.php:62
963
+ msgid ""
964
+ "Choose where to display the counter and customize the text. Select the type "
965
+ "of tracker and which user groups to track."
966
+ msgstr ""
967
+
968
+ #: includes/admin/help-tab.php:69 includes/admin/settings-page.php:127
969
+ msgid "Posts list"
970
+ msgstr ""
971
+
972
+ #: includes/admin/help-tab.php:71
973
+ msgid ""
974
+ "This screen provides settings to tweak the output of the list of popular "
975
+ "posts."
976
+ msgstr ""
977
+
978
+ #: includes/admin/help-tab.php:72
979
+ msgid ""
980
+ "Set the number of posts, which categories or posts to exclude, customize "
981
+ "what to display and specific basic HTML markup used to create the posts."
982
+ msgstr ""
983
+
984
+ #: includes/admin/help-tab.php:79 includes/admin/settings-page.php:128
985
+ msgid "Thumbnail"
986
+ msgstr ""
987
+
988
+ #: includes/admin/help-tab.php:81
989
+ msgid ""
990
+ "This screen provides settings to tweak the thumbnail that can be displayed "
991
+ "for each post in the list."
992
+ msgstr ""
993
+
994
+ #: includes/admin/help-tab.php:82
995
+ msgid ""
996
+ "Set the location and size of the thumbnail. Additionally, you can choose "
997
+ "additional sources for the thumbnail i.e. a meta field, first image or a "
998
+ "default thumbnail when nothing is available."
999
+ msgstr ""
1000
+
1001
+ #: includes/admin/help-tab.php:89 includes/admin/settings-page.php:129
1002
+ msgid "Styles"
1003
+ msgstr ""
1004
+
1005
+ #: includes/admin/help-tab.php:91
1006
+ msgid ""
1007
+ "This screen provides options to control the look and feel of the popular "
1008
+ "posts list."
1009
+ msgstr ""
1010
+
1011
+ #: includes/admin/help-tab.php:92
1012
+ msgid ""
1013
+ "Choose for default set of styles or add your own custom CSS to tweak the "
1014
+ "display of the posts."
1015
+ msgstr ""
1016
+
1017
+ #: includes/admin/help-tab.php:99 includes/admin/settings-page.php:130
1018
+ msgid "Maintenance"
1019
+ msgstr ""
1020
+
1021
+ #: includes/admin/help-tab.php:101
1022
+ msgid "This screen provides options to control the maintenance cron."
1023
+ msgstr ""
1024
+
1025
+ #: includes/admin/help-tab.php:102
1026
+ msgid "Choose how often to run maintenance and at what time of the day."
1027
+ msgstr ""
1028
+
1029
+ #: includes/admin/help-tab.php:142
1030
+ msgid ""
1031
+ "This screen provides some tools that help maintain certain features of Top "
1032
+ "10."
1033
+ msgstr ""
1034
+
1035
+ #: includes/admin/help-tab.php:143
1036
+ msgid ""
1037
+ "Clear the cache, reset the popular posts tables plus some miscellaneous "
1038
+ "fixes for older versions of Top 10."
1039
+ msgstr ""
1040
+
1041
  #: includes/admin/save-settings.php:51
1042
  msgid ""
1043
  "Settings have been reset to their default values. Reload this page to view "
1253
  msgid "Once quarterly"
1254
  msgstr ""
1255
 
1256
+ #: includes/deprecated.php:178
1257
  msgid "<h3>Popular Posts</h3>"
1258
  msgstr ""
1259
 
1260
+ #: includes/deprecated.php:179
1261
  msgid "<h3>Daily Popular</h3>"
1262
  msgstr ""
1263
 
1347
  "posts only."
1348
  msgstr ""
1349
 
1350
+ #: includes/public/display-posts.php:219
1351
  #, php-format
1352
  msgid ""
1353
  "Popular posts by <a href=\"%1$s\" rel=\"nofollow\" %2$s>Top 10 plugin</a>"
1369
  msgid " by "
1370
  msgstr ""
1371
 
1372
+ #: includes/tracker.php:276
1373
  msgid "Query variable based"
1374
  msgstr ""
1375
 
1376
+ #: includes/tracker.php:277
1377
  msgid "Uses query variables to record visits"
1378
  msgstr ""
1379
 
1380
+ #: includes/tracker.php:281
1381
  msgid "Ajaxurl based"
1382
  msgstr ""
1383
 
1384
+ #: includes/tracker.php:282
1385
  msgid ""
1386
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1387
  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: 2018-11-03 23:07+0000\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
9
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
@@ -14,7 +14,7 @@ msgstr ""
14
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;esc_html__;esc_attr__;esc_html_e;"
15
  "esc_attr_e\n"
16
  "X-Poedit-Basepath: ..\n"
17
- "X-Generator: Poedit 2.1.1\n"
18
  "X-Poedit-SourceCharset: UTF-8\n"
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
  "X-Poedit-SearchPath-0: .\n"
@@ -45,7 +45,7 @@ msgid "Popular posts by <a href=\"%s\" target=\"_blank\">Top 10 plugin</a>"
45
  msgstr ""
46
 
47
  #: includes/admin/admin-dashboard.php:127 includes/admin/admin.php:44
48
- #: includes/admin/class-top-ten-statistics-table.php:581
49
  msgid "Popular Posts"
50
  msgstr ""
51
 
@@ -114,7 +114,7 @@ msgstr ""
114
  msgid "Top 10"
115
  msgstr ""
116
 
117
- #: includes/admin/admin.php:34 includes/admin/admin.php:317
118
  msgid "Settings"
119
  msgstr ""
120
 
@@ -126,8 +126,7 @@ msgstr ""
126
  msgid "Tools"
127
  msgstr ""
128
 
129
- #: includes/admin/admin.php:44
130
- #: includes/admin/class-top-ten-statistics-table.php:536
131
  msgid "Top 10 Popular Posts"
132
  msgstr ""
133
 
@@ -135,11 +134,11 @@ msgstr ""
135
  msgid "Top 10 Daily Popular Posts"
136
  msgstr ""
137
 
138
- #: includes/admin/admin.php:188
139
  msgid "New information not saved. Do you wish to leave the page?"
140
  msgstr ""
141
 
142
- #: includes/admin/admin.php:271
143
  #, php-format
144
  msgid ""
145
  "Thank you for using <a href=\"%1$s\" target=\"_blank\">Top 10</a>! Please <a "
@@ -147,15 +146,15 @@ msgid ""
147
  "\"_blank\">WordPress.org</a>"
148
  msgstr ""
149
 
150
- #: includes/admin/admin.php:339 includes/admin/sidebar.php:55
151
  msgid "Support"
152
  msgstr ""
153
 
154
- #: includes/admin/admin.php:340
155
  msgid "Donate"
156
  msgstr ""
157
 
158
- #: includes/admin/admin.php:341
159
  msgid "Contribute"
160
  msgstr ""
161
 
@@ -163,286 +162,166 @@ msgstr ""
163
  msgid "Top 10 cache has been cleared"
164
  msgstr ""
165
 
166
- #: includes/admin/class-top-ten-statistics-table.php:36
167
  msgid "popular_post"
168
  msgstr ""
169
 
170
- #: includes/admin/class-top-ten-statistics-table.php:37
171
  msgid "popular_posts"
172
  msgstr ""
173
 
174
- #: includes/admin/class-top-ten-statistics-table.php:210
 
 
 
 
175
  msgid "No popular posts available."
176
  msgstr ""
177
 
178
- #: includes/admin/class-top-ten-statistics-table.php:259
179
  msgid "View"
180
  msgstr ""
181
 
182
- #: includes/admin/class-top-ten-statistics-table.php:260
183
  msgid "Edit"
184
  msgstr ""
185
 
186
- #: includes/admin/class-top-ten-statistics-table.php:261
187
  msgid "Delete"
188
  msgstr ""
189
 
190
- #: includes/admin/class-top-ten-statistics-table.php:284
191
  msgid "Y/m/d g:i:s a"
192
  msgstr ""
193
 
194
- #: includes/admin/class-top-ten-statistics-table.php:292
195
  #, php-format
196
  msgid "%s ago"
197
  msgstr ""
198
 
199
- #: includes/admin/class-top-ten-statistics-table.php:294
200
  msgid "Y/m/d"
201
  msgstr ""
202
 
203
- #: includes/admin/class-top-ten-statistics-table.php:333
204
  #: includes/modules/class-top-ten-count-widget.php:53
205
  #: includes/modules/class-top-ten-widget.php:80
206
  msgid "Title"
207
  msgstr ""
208
 
209
- #: includes/admin/class-top-ten-statistics-table.php:334
210
  msgid "Total visits"
211
  msgstr ""
212
 
213
- #: includes/admin/class-top-ten-statistics-table.php:335
214
  msgid "Daily visits"
215
  msgstr ""
216
 
217
- #: includes/admin/class-top-ten-statistics-table.php:336
218
  msgid "Post type"
219
  msgstr ""
220
 
221
- #: includes/admin/class-top-ten-statistics-table.php:337
222
  msgid "Author"
223
  msgstr ""
224
 
225
- #: includes/admin/class-top-ten-statistics-table.php:338
226
  msgid "Date"
227
  msgstr ""
228
 
229
- #: includes/admin/class-top-ten-statistics-table.php:372
230
  msgid "Delete Count"
231
  msgstr ""
232
 
233
- #: includes/admin/class-top-ten-statistics-table.php:416
234
  msgid "Are you sure you want to do this"
235
  msgstr ""
236
 
237
- #: includes/admin/class-top-ten-statistics-table.php:472
238
  msgid "Filter"
239
  msgstr ""
240
 
241
- #: includes/admin/class-top-ten-statistics-table.php:556
242
  msgid "Search Table"
243
  msgstr ""
244
 
245
- #: includes/admin/help-tab.php:35 includes/admin/help-tab.php:126
246
- #, php-format
247
- msgid ""
248
- "For more information or how to get support visit the <a href=\"%1$s"
249
- "\">WebberZone support site</a>."
250
- msgstr ""
251
-
252
- #: includes/admin/help-tab.php:37 includes/admin/help-tab.php:128
253
- #, php-format
254
- msgid ""
255
- "Support queries should be posted in the <a href=\"%1$s\">WordPress.org "
256
- "support forums</a>."
257
- msgstr ""
258
-
259
- #: includes/admin/help-tab.php:40 includes/admin/help-tab.php:131
260
- #, php-format
261
- msgid ""
262
- "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug "
263
- "reports only)."
264
- msgstr ""
265
-
266
- #: includes/admin/help-tab.php:49 includes/admin/help-tab.php:140
267
- #: includes/admin/settings-page.php:125
268
- msgid "General"
269
- msgstr ""
270
-
271
- #: includes/admin/help-tab.php:51
272
- msgid "This screen provides the basic settings for configuring Top 10."
273
- msgstr ""
274
-
275
- #: includes/admin/help-tab.php:52
276
- msgid ""
277
- "Enable the trackers and cache, configure basic tracker settings and "
278
- "uninstall settings."
279
- msgstr ""
280
-
281
- #: includes/admin/help-tab.php:59 includes/admin/settings-page.php:126
282
- msgid "Counter/Tracker"
283
- msgstr ""
284
-
285
- #: includes/admin/help-tab.php:61
286
- msgid ""
287
- "This screen provides settings to tweak the display counter and the tracker."
288
- msgstr ""
289
-
290
- #: includes/admin/help-tab.php:62
291
- msgid ""
292
- "Choose where to display the counter and customize the text. Select the type "
293
- "of tracker and which user groups to track."
294
- msgstr ""
295
-
296
- #: includes/admin/help-tab.php:69 includes/admin/settings-page.php:127
297
- msgid "Posts list"
298
- msgstr ""
299
-
300
- #: includes/admin/help-tab.php:71
301
- msgid ""
302
- "This screen provides settings to tweak the output of the list of popular "
303
- "posts."
304
- msgstr ""
305
-
306
- #: includes/admin/help-tab.php:72
307
- msgid ""
308
- "Set the number of posts, which categories or posts to exclude, customize "
309
- "what to display and specific basic HTML markup used to create the posts."
310
- msgstr ""
311
-
312
- #: includes/admin/help-tab.php:79 includes/admin/settings-page.php:128
313
- msgid "Thumbnail"
314
- msgstr ""
315
-
316
- #: includes/admin/help-tab.php:81
317
- msgid ""
318
- "This screen provides settings to tweak the thumbnail that can be displayed "
319
- "for each post in the list."
320
- msgstr ""
321
-
322
- #: includes/admin/help-tab.php:82
323
- msgid ""
324
- "Set the location and size of the thumbnail. Additionally, you can choose "
325
- "additional sources for the thumbnail i.e. a meta field, first image or a "
326
- "default thumbnail when nothing is available."
327
- msgstr ""
328
-
329
- #: includes/admin/help-tab.php:89 includes/admin/settings-page.php:129
330
- msgid "Styles"
331
- msgstr ""
332
-
333
- #: includes/admin/help-tab.php:91
334
- msgid ""
335
- "This screen provides options to control the look and feel of the popular "
336
- "posts list."
337
- msgstr ""
338
-
339
- #: includes/admin/help-tab.php:92
340
- msgid ""
341
- "Choose for default set of styles or add your own custom CSS to tweak the "
342
- "display of the posts."
343
- msgstr ""
344
-
345
- #: includes/admin/help-tab.php:99 includes/admin/settings-page.php:130
346
- msgid "Maintenance"
347
- msgstr ""
348
-
349
- #: includes/admin/help-tab.php:101
350
- msgid "This screen provides options to control the maintenance cron."
351
- msgstr ""
352
-
353
- #: includes/admin/help-tab.php:102
354
- msgid "Choose how often to run maintenance and at what time of the day."
355
- msgstr ""
356
-
357
- #: includes/admin/help-tab.php:142
358
- msgid ""
359
- "This screen provides some tools that help maintain certain features of Top "
360
- "10."
361
- msgstr ""
362
-
363
- #: includes/admin/help-tab.php:143
364
- msgid ""
365
- "Clear the cache, reset the popular posts tables plus some miscellaneous "
366
- "fixes for older versions of Top 10."
367
- msgstr ""
368
-
369
- #: includes/admin/register-settings.php:230
370
  msgid "Enable trackers"
371
  msgstr ""
372
 
373
- #: includes/admin/register-settings.php:239
374
  #: includes/modules/class-top-ten-widget.php:95
375
  msgid "Overall"
376
  msgstr ""
377
 
378
- #: includes/admin/register-settings.php:240
379
- #: includes/admin/register-settings.php:774
380
  msgid "Daily"
381
  msgstr ""
382
 
383
- #: includes/admin/register-settings.php:245
384
  msgid "Enable cache"
385
  msgstr ""
386
 
387
- #: includes/admin/register-settings.php:246
388
  msgid ""
389
  "If activated, Top 10 will use the Transients API to cache the popular posts "
390
  "output for 1 hour."
391
  msgstr ""
392
 
393
- #: includes/admin/register-settings.php:252
394
  msgid "Time to cache"
395
  msgstr ""
396
 
397
- #: includes/admin/register-settings.php:253
398
  msgid "Enter the number of seconds to cache the output."
399
  msgstr ""
400
 
401
- #: includes/admin/register-settings.php:259
402
  msgid "Start daily counts from midnight"
403
  msgstr ""
404
 
405
- #: includes/admin/register-settings.php:260
406
  msgid ""
407
  "Daily counter will display number of visits from midnight. This option is "
408
  "checked by default and mimics the way most normal counters work. Turning "
409
  "this off will allow you to use the hourly setting in the next option."
410
  msgstr ""
411
 
412
- #: includes/admin/register-settings.php:266
413
  msgid "Default custom period range"
414
  msgstr ""
415
 
416
- #: includes/admin/register-settings.php:267
417
  msgid ""
418
  "The next two options allow you to set the default range for the custom "
419
  "period. This was previously called the daily range. This can be overridden "
420
  "in the widget."
421
  msgstr ""
422
 
423
- #: includes/admin/register-settings.php:272
424
  msgid "Day(s)"
425
  msgstr ""
426
 
427
- #: includes/admin/register-settings.php:281
428
  msgid "Hour(s)"
429
  msgstr ""
430
 
431
- #: includes/admin/register-settings.php:291
432
  msgid "Delete options on uninstall"
433
  msgstr ""
434
 
435
- #: includes/admin/register-settings.php:292
436
  msgid ""
437
  "If this is checked, all settings related to Top 10 are removed from the "
438
  "database if you choose to uninstall/delete the plugin."
439
  msgstr ""
440
 
441
- #: includes/admin/register-settings.php:298
442
  msgid "Delete counter data on uninstall"
443
  msgstr ""
444
 
445
- #: includes/admin/register-settings.php:299
446
  msgid ""
447
  "If this is checked, the tables containing the counter statistics are removed "
448
  "from the database if you choose to uninstall/delete the plugin. Keep this "
@@ -450,93 +329,93 @@ msgid ""
450
  "counter data."
451
  msgstr ""
452
 
453
- #: includes/admin/register-settings.php:305
454
  msgid "Show metabox"
455
  msgstr ""
456
 
457
- #: includes/admin/register-settings.php:306
458
  msgid ""
459
  "This will add the Top 10 metabox on Edit Posts or Add New Posts screens. "
460
  "Also applies to Pages and Custom Post Types."
461
  msgstr ""
462
 
463
- #: includes/admin/register-settings.php:312
464
  msgid "Limit meta box to Admins only"
465
  msgstr ""
466
 
467
- #: includes/admin/register-settings.php:313
468
  msgid ""
469
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
470
  "default, Contributors and above will be able to see the meta box. Applies "
471
  "only if the above option is selected."
472
  msgstr ""
473
 
474
- #: includes/admin/register-settings.php:319
475
  msgid "Link to Top 10 plugin page"
476
  msgstr ""
477
 
478
- #: includes/admin/register-settings.php:320
479
  msgid ""
480
  "A no-follow link to the plugin homepage will be added as the last item of "
481
  "the popular posts."
482
  msgstr ""
483
 
484
- #: includes/admin/register-settings.php:332
485
  msgid "Display number of views on"
486
  msgstr ""
487
 
488
- #: includes/admin/register-settings.php:334
489
- #: includes/admin/register-settings.php:498
490
  #, php-format
491
  msgid ""
492
  "If you choose to disable this, please add %1$s to your template file where "
493
  "you want it displayed"
494
  msgstr ""
495
 
496
- #: includes/admin/register-settings.php:341
497
  msgid "Posts"
498
  msgstr ""
499
 
500
- #: includes/admin/register-settings.php:342
501
  msgid "Pages"
502
  msgstr ""
503
 
504
- #: includes/admin/register-settings.php:343
505
  msgid "Home page"
506
  msgstr ""
507
 
508
- #: includes/admin/register-settings.php:344
509
  msgid "Feeds"
510
  msgstr ""
511
 
512
- #: includes/admin/register-settings.php:345
513
  msgid "Category archives"
514
  msgstr ""
515
 
516
- #: includes/admin/register-settings.php:346
517
  msgid "Tag archives"
518
  msgstr ""
519
 
520
- #: includes/admin/register-settings.php:347
521
  msgid "Other archives"
522
  msgstr ""
523
 
524
- #: includes/admin/register-settings.php:352
525
  msgid "Format to display the post views"
526
  msgstr ""
527
 
528
- #: includes/admin/register-settings.php:354
529
  #, php-format
530
  msgid ""
531
  "Use %1$s to display the total count, %2$s for daily count and %3$s for "
532
  "overall counts across all posts. Default display is %4$s"
533
  msgstr ""
534
 
535
- #: includes/admin/register-settings.php:360
536
  msgid "What do display when there are no visits?"
537
  msgstr ""
538
 
539
- #: includes/admin/register-settings.php:362
540
  msgid ""
541
  "This text applies only when there are 0 hits for the post and it isn't a "
542
  "single page. e.g. if you display post views on the homepage or archives then "
@@ -544,89 +423,129 @@ msgid ""
544
  "option."
545
  msgstr ""
546
 
547
- #: includes/admin/register-settings.php:368
 
 
 
 
 
 
 
 
 
 
548
  msgid "Always display latest post count"
549
  msgstr ""
550
 
551
- #: includes/admin/register-settings.php:369
552
  msgid ""
553
  "This option uses JavaScript and will increase your page load time. Turn this "
554
  "off if you are not using caching plugins or are OK with displaying older "
555
  "cached counts."
556
  msgstr ""
557
 
558
- #: includes/admin/register-settings.php:375
559
  msgid "Tracker type"
560
  msgstr ""
561
 
562
- #: includes/admin/register-settings.php:383
 
 
 
 
 
 
 
 
 
 
563
  msgid "Track user groups"
564
  msgstr ""
565
 
566
- #: includes/admin/register-settings.php:384
567
  msgid ""
568
  "Uncheck above to disable tracking if the current user falls into any one of "
569
  "these groups."
570
  msgstr ""
571
 
572
- #: includes/admin/register-settings.php:391
573
  msgid "Authors"
574
  msgstr ""
575
 
576
- #: includes/admin/register-settings.php:392
577
  msgid "Editors"
578
  msgstr ""
579
 
580
- #: includes/admin/register-settings.php:393
581
  msgid "Admins"
582
  msgstr ""
583
 
584
- #: includes/admin/register-settings.php:398
585
  msgid "Track logged-in users"
586
  msgstr ""
587
 
588
- #: includes/admin/register-settings.php:399
589
  msgid ""
590
  "Uncheck to stop tracking logged in users. Only logged out visitors will be "
591
  "tracked if this is disabled. Unchecking this will override the above setting."
592
  msgstr ""
593
 
594
- #: includes/admin/register-settings.php:405
 
 
 
 
 
 
 
 
 
 
595
  msgid "Page views in admin"
596
  msgstr ""
597
 
598
- #: includes/admin/register-settings.php:406
599
  msgid ""
600
  "Adds three columns called Total Views, Today's Views and Views to All Posts "
601
  "and All Pages. You can selectively disable these by pulling down the Screen "
602
  "Options from the top right of the respective screens."
603
  msgstr ""
604
 
605
- #: includes/admin/register-settings.php:412
606
  msgid "Show views to non-admins"
607
  msgstr ""
608
 
609
- #: includes/admin/register-settings.php:413
610
  msgid ""
611
  "If you disable this then non-admins won't see the above columns or view the "
612
  "independent pages with the top posts."
613
  msgstr ""
614
 
615
- #: includes/admin/register-settings.php:425
 
 
 
 
 
 
 
 
 
 
616
  msgid "Number of posts to display"
617
  msgstr ""
618
 
619
- #: includes/admin/register-settings.php:426
620
  msgid ""
621
  "Maximum number of posts that will be displayed in the list. This option is "
622
  "used if you don not specify the number of posts in the widget or shortcodes"
623
  msgstr ""
624
 
625
- #: includes/admin/register-settings.php:433
626
  msgid "Published age of posts"
627
  msgstr ""
628
 
629
- #: includes/admin/register-settings.php:434
630
  msgid ""
631
  "This options allows you to only show posts that have been published within "
632
  "the above day range. Applies to both overall posts and daily posts lists. e."
@@ -634,43 +553,43 @@ msgid ""
634
  "posts lists. Enter 0 for no restriction."
635
  msgstr ""
636
 
637
- #: includes/admin/register-settings.php:440
638
  msgid "Post types to include"
639
  msgstr ""
640
 
641
- #: includes/admin/register-settings.php:441
642
  msgid ""
643
  "At least one option should be selected above. Select which post types you "
644
  "want to include in the list of posts. This field can be overridden using a "
645
  "comma separated list of post types when using the manual display."
646
  msgstr ""
647
 
648
- #: includes/admin/register-settings.php:447
649
  msgid "Post/page IDs to exclude"
650
  msgstr ""
651
 
652
- #: includes/admin/register-settings.php:448
653
  msgid ""
654
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
655
  "188,320,500"
656
  msgstr ""
657
 
658
- #: includes/admin/register-settings.php:454
659
  msgid "Exclude Categories"
660
  msgstr ""
661
 
662
- #: includes/admin/register-settings.php:455
663
  msgid ""
664
  "Comma separated list of category slugs. The field above has an autocomplete "
665
  "so simply start typing in the starting letters and it will prompt you with "
666
  "options. Does not support custom taxonomies."
667
  msgstr ""
668
 
669
- #: includes/admin/register-settings.php:466
670
  msgid "Exclude category IDs"
671
  msgstr ""
672
 
673
- #: includes/admin/register-settings.php:467
674
  msgid ""
675
  "This is a readonly field that is automatically populated based on the above "
676
  "input when the settings are saved. These might differ from the IDs visible "
@@ -678,144 +597,134 @@ msgid ""
678
  "term_taxonomy_id which is unique to this taxonomy."
679
  msgstr ""
680
 
681
- #: includes/admin/register-settings.php:474
682
  msgid "Customize the output"
683
  msgstr ""
684
 
685
- #: includes/admin/register-settings.php:480
686
  msgid "Heading of posts"
687
  msgstr ""
688
 
689
- #: includes/admin/register-settings.php:481
690
- #: includes/admin/register-settings.php:489
691
  msgid "Displayed before the list of the posts as a the master heading"
692
  msgstr ""
693
 
694
- #: includes/admin/register-settings.php:483
695
  msgid "Popular posts:"
696
  msgstr ""
697
 
698
- #: includes/admin/register-settings.php:488
699
  msgid "Heading of posts for daily/custom period lists"
700
  msgstr ""
701
 
702
- #: includes/admin/register-settings.php:491
703
  msgid "Currently trending:"
704
  msgstr ""
705
 
706
- #: includes/admin/register-settings.php:496
707
  msgid "Show when no posts are found"
708
  msgstr ""
709
 
710
- #: includes/admin/register-settings.php:502
711
  msgid "Blank output"
712
  msgstr ""
713
 
714
- #: includes/admin/register-settings.php:503
715
  msgid "Display custom text"
716
  msgstr ""
717
 
718
- #: includes/admin/register-settings.php:508
719
  msgid "Custom text"
720
  msgstr ""
721
 
722
- #: includes/admin/register-settings.php:509
723
  msgid ""
724
  "Enter the custom text that will be displayed if the second option is "
725
  "selected above"
726
  msgstr ""
727
 
728
- #: includes/admin/register-settings.php:511 includes/deprecated.php:173
729
  msgid "No top posts yet"
730
  msgstr ""
731
 
732
- #: includes/admin/register-settings.php:515
733
  msgid "Show post excerpt"
734
  msgstr ""
735
 
736
- #: includes/admin/register-settings.php:522
737
  msgid "Length of excerpt (in words)"
738
  msgstr ""
739
 
740
- #: includes/admin/register-settings.php:530
741
  msgid "Show date"
742
  msgstr ""
743
 
744
- #: includes/admin/register-settings.php:537
745
  msgid "Show author"
746
  msgstr ""
747
 
748
- #: includes/admin/register-settings.php:544
749
  msgid "Show number of views"
750
  msgstr ""
751
 
752
- #: includes/admin/register-settings.php:551
753
  msgid "Limit post title length (in characters)"
754
  msgstr ""
755
 
756
- #: includes/admin/register-settings.php:559
757
  msgid "Open links in new window"
758
  msgstr ""
759
 
760
- #: includes/admin/register-settings.php:566
761
  msgid "Add nofollow to links"
762
  msgstr ""
763
 
764
- #: includes/admin/register-settings.php:573
765
- msgid "Exclude display on these post IDs"
766
- msgstr ""
767
-
768
- #: includes/admin/register-settings.php:574
769
- msgid ""
770
- "Comma-separated list of post or page IDs to exclude displaying the top posts "
771
- "on. e.g. 188,320,500"
772
- msgstr ""
773
-
774
- #: includes/admin/register-settings.php:580
775
  msgid "HTML to display"
776
  msgstr ""
777
 
778
- #: includes/admin/register-settings.php:586
779
  msgid "Before the list of posts"
780
  msgstr ""
781
 
782
- #: includes/admin/register-settings.php:593
783
  msgid "After the list of posts"
784
  msgstr ""
785
 
786
- #: includes/admin/register-settings.php:600
787
  msgid "Before each list item"
788
  msgstr ""
789
 
790
- #: includes/admin/register-settings.php:607
791
  msgid "After each list item"
792
  msgstr ""
793
 
794
- #: includes/admin/register-settings.php:620
795
  msgid "Location of the post thumbnail"
796
  msgstr ""
797
 
798
- #: includes/admin/register-settings.php:625
799
  msgid "Display thumbnails inline with posts, before title"
800
  msgstr ""
801
 
802
- #: includes/admin/register-settings.php:626
803
  msgid "Display thumbnails inline with posts, after title"
804
  msgstr ""
805
 
806
- #: includes/admin/register-settings.php:627
807
  msgid "Display only thumbnails, no text"
808
  msgstr ""
809
 
810
- #: includes/admin/register-settings.php:628
811
  msgid "Do not display thumbnails, only text"
812
  msgstr ""
813
 
814
- #: includes/admin/register-settings.php:633
815
  msgid "Thumbnail size"
816
  msgstr ""
817
 
818
- #: includes/admin/register-settings.php:635
819
  msgid ""
820
  "You can choose from existing image sizes above or create a custom size. If "
821
  "you have chosen Custom size above, then enter the width, height and crop "
@@ -823,179 +732,313 @@ msgid ""
823
  "width and/or height below, existing images will not be automatically resized."
824
  msgstr ""
825
 
826
- #: includes/admin/register-settings.php:635
827
  #, php-format
828
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
829
  msgstr ""
830
 
831
- #: includes/admin/register-settings.php:642
832
  #: includes/modules/class-top-ten-widget.php:145
833
  msgid "Thumbnail width"
834
  msgstr ""
835
 
836
- #: includes/admin/register-settings.php:650
837
  #: includes/modules/class-top-ten-widget.php:139
838
  msgid "Thumbnail height"
839
  msgstr ""
840
 
841
- #: includes/admin/register-settings.php:658
842
  msgid "Hard crop thumbnails"
843
  msgstr ""
844
 
845
- #: includes/admin/register-settings.php:659
846
  msgid ""
847
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
848
  "above vs. maintaining proportions."
849
  msgstr ""
850
 
851
- #: includes/admin/register-settings.php:665
 
 
 
 
 
 
 
 
 
 
 
852
  msgid "Thumbnail size attributes"
853
  msgstr ""
854
 
855
- #: includes/admin/register-settings.php:671
856
  #, php-format
857
  msgid "Use CSS to set the width and height: e.g. %s"
858
  msgstr ""
859
 
860
- #: includes/admin/register-settings.php:673
861
  #, php-format
862
  msgid "Use HTML attributes to set the width and height: e.g. %s"
863
  msgstr ""
864
 
865
- #: includes/admin/register-settings.php:674
866
  msgid ""
867
  "No width or height set. You will need to use external styles to force any "
868
  "width or height of your choice."
869
  msgstr ""
870
 
871
- #: includes/admin/register-settings.php:679
872
  msgid "Thumbnail meta field name"
873
  msgstr ""
874
 
875
- #: includes/admin/register-settings.php:680
876
  msgid ""
877
  "The value of this field should contain the URL of the image and can be set "
878
  "in the metabox in the Edit Post screen"
879
  msgstr ""
880
 
881
- #: includes/admin/register-settings.php:686
882
  msgid "Get first image"
883
  msgstr ""
884
 
885
- #: includes/admin/register-settings.php:687
886
  msgid ""
887
  "The plugin will fetch the first image in the post content if this is "
888
  "enabled. This can slow down the loading of your page if the first image in "
889
  "the followed posts is large in file-size."
890
  msgstr ""
891
 
892
- #: includes/admin/register-settings.php:693
893
  msgid "Use default thumbnail?"
894
  msgstr ""
895
 
896
- #: includes/admin/register-settings.php:694
897
  msgid ""
898
  "If checked, when no thumbnail is found, show a default one from the URL "
899
  "below. If not checked and no thumbnail is found, no image will be shown."
900
  msgstr ""
901
 
902
- #: includes/admin/register-settings.php:700
903
- #: includes/admin/settings-page.php:687
904
  msgid "Default thumbnail"
905
  msgstr ""
906
 
907
- #: includes/admin/register-settings.php:701
908
  msgid ""
909
  "Enter the full URL of the image that you wish to display if no thumbnail is "
910
  "found. This image will be displayed below."
911
  msgstr ""
912
 
913
- #: includes/admin/register-settings.php:714
914
  msgid "Popular posts style"
915
  msgstr ""
916
 
917
- #: includes/admin/register-settings.php:722
918
  msgid "Custom CSS"
919
  msgstr ""
920
 
921
- #: includes/admin/register-settings.php:724
922
  #, php-format
923
  msgid ""
924
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
925
  "CSS classes to style."
926
  msgstr ""
927
 
928
- #: includes/admin/register-settings.php:736
929
  msgid "Enable scheduled maintenance"
930
  msgstr ""
931
 
932
- #: includes/admin/register-settings.php:737
933
  msgid ""
934
  "Cleaning the database at regular intervals could improve performance, "
935
  "especially on high traffic blogs. Enabling maintenance will automatically "
936
  "delete entries older than 90 days in the daily tables."
937
  msgstr ""
938
 
939
- #: includes/admin/register-settings.php:743
940
  msgid "Time to run maintenance"
941
  msgstr ""
942
 
943
- #: includes/admin/register-settings.php:744
944
  msgid "The next two options allow you to set the time to run the cron."
945
  msgstr ""
946
 
947
- #: includes/admin/register-settings.php:749
948
  msgid "Hour"
949
  msgstr ""
950
 
951
- #: includes/admin/register-settings.php:759
952
  msgid "Minute"
953
  msgstr ""
954
 
955
- #: includes/admin/register-settings.php:769
956
  msgid "Run maintenance"
957
  msgstr ""
958
 
959
- #: includes/admin/register-settings.php:775
960
  msgid "Weekly"
961
  msgstr ""
962
 
963
- #: includes/admin/register-settings.php:776
964
  msgid "Fortnightly"
965
  msgstr ""
966
 
967
- #: includes/admin/register-settings.php:777
968
  msgid "Monthly"
969
  msgstr ""
970
 
971
- #: includes/admin/register-settings.php:986
972
  msgid "No styles"
973
  msgstr ""
974
 
975
- #: includes/admin/register-settings.php:987
976
  msgid "Select this option if you plan to add your own styles"
977
  msgstr ""
978
 
979
- #: includes/admin/register-settings.php:991
980
  msgid "Text only"
981
  msgstr ""
982
 
983
- #: includes/admin/register-settings.php:992
984
  msgid ""
985
  "Disable thumbnails and no longer include the default style sheet included in "
986
  "the plugin"
987
  msgstr ""
988
 
989
- #: includes/admin/register-settings.php:996
990
  msgid "Left thumbnails"
991
  msgstr ""
992
 
993
- #: includes/admin/register-settings.php:997
994
  msgid ""
995
  "Enabling this option will set the post thumbnail to be before text. "
996
  "Disabling this option will not revert any settings."
997
  msgstr ""
998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
999
  #: includes/admin/save-settings.php:51
1000
  msgid ""
1001
  "Settings have been reset to their default values. Reload this page to view "
@@ -1211,11 +1254,11 @@ msgstr ""
1211
  msgid "Once quarterly"
1212
  msgstr ""
1213
 
1214
- #: includes/deprecated.php:171
1215
  msgid "<h3>Popular Posts</h3>"
1216
  msgstr ""
1217
 
1218
- #: includes/deprecated.php:172
1219
  msgid "<h3>Daily Popular</h3>"
1220
  msgstr ""
1221
 
@@ -1305,7 +1348,7 @@ msgid ""
1305
  "posts only."
1306
  msgstr ""
1307
 
1308
- #: includes/public/display-posts.php:232
1309
  #, php-format
1310
  msgid ""
1311
  "Popular posts by <a href=\"%1$s\" rel=\"nofollow\" %2$s>Top 10 plugin</a>"
@@ -1327,19 +1370,19 @@ msgstr ""
1327
  msgid " by "
1328
  msgstr ""
1329
 
1330
- #: includes/tracker.php:248
1331
  msgid "Query variable based"
1332
  msgstr ""
1333
 
1334
- #: includes/tracker.php:249
1335
  msgid "Uses query variables to record visits"
1336
  msgstr ""
1337
 
1338
- #: includes/tracker.php:253
1339
  msgid "Ajaxurl based"
1340
  msgstr ""
1341
 
1342
- #: includes/tracker.php:254
1343
  msgid ""
1344
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1345
  msgstr ""
3
  msgstr ""
4
  "Project-Id-Version: Top 10\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2019-02-09 17:24+0530\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
9
  "Language-Team: WebberZone <plugins@webberzone.com>\n"
14
  "X-Poedit-KeywordsList: __;_e;_c;__ngettext;esc_html__;esc_attr__;esc_html_e;"
15
  "esc_attr_e\n"
16
  "X-Poedit-Basepath: ..\n"
17
+ "X-Generator: Poedit 2.2\n"
18
  "X-Poedit-SourceCharset: UTF-8\n"
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
  "X-Poedit-SearchPath-0: .\n"
45
  msgstr ""
46
 
47
  #: includes/admin/admin-dashboard.php:127 includes/admin/admin.php:44
48
+ #: includes/admin/class-top-ten-statistics.php:124
49
  msgid "Popular Posts"
50
  msgstr ""
51
 
114
  msgid "Top 10"
115
  msgstr ""
116
 
117
+ #: includes/admin/admin.php:34 includes/admin/admin.php:336
118
  msgid "Settings"
119
  msgstr ""
120
 
126
  msgid "Tools"
127
  msgstr ""
128
 
129
+ #: includes/admin/admin.php:44 includes/admin/class-top-ten-statistics.php:74
 
130
  msgid "Top 10 Popular Posts"
131
  msgstr ""
132
 
134
  msgid "Top 10 Daily Popular Posts"
135
  msgstr ""
136
 
137
+ #: includes/admin/admin.php:202
138
  msgid "New information not saved. Do you wish to leave the page?"
139
  msgstr ""
140
 
141
+ #: includes/admin/admin.php:290
142
  #, php-format
143
  msgid ""
144
  "Thank you for using <a href=\"%1$s\" target=\"_blank\">Top 10</a>! Please <a "
146
  "\"_blank\">WordPress.org</a>"
147
  msgstr ""
148
 
149
+ #: includes/admin/admin.php:358 includes/admin/sidebar.php:55
150
  msgid "Support"
151
  msgstr ""
152
 
153
+ #: includes/admin/admin.php:359
154
  msgid "Donate"
155
  msgstr ""
156
 
157
+ #: includes/admin/admin.php:360
158
  msgid "Contribute"
159
  msgstr ""
160
 
162
  msgid "Top 10 cache has been cleared"
163
  msgstr ""
164
 
165
+ #: includes/admin/class-top-ten-statistics-table.php:43
166
  msgid "popular_post"
167
  msgstr ""
168
 
169
+ #: includes/admin/class-top-ten-statistics-table.php:44
170
  msgid "popular_posts"
171
  msgstr ""
172
 
173
+ #: includes/admin/class-top-ten-statistics-table.php:48
174
+ msgid "All post types"
175
+ msgstr ""
176
+
177
+ #: includes/admin/class-top-ten-statistics-table.php:213
178
  msgid "No popular posts available."
179
  msgstr ""
180
 
181
+ #: includes/admin/class-top-ten-statistics-table.php:264
182
  msgid "View"
183
  msgstr ""
184
 
185
+ #: includes/admin/class-top-ten-statistics-table.php:265
186
  msgid "Edit"
187
  msgstr ""
188
 
189
+ #: includes/admin/class-top-ten-statistics-table.php:266
190
  msgid "Delete"
191
  msgstr ""
192
 
193
+ #: includes/admin/class-top-ten-statistics-table.php:289
194
  msgid "Y/m/d g:i:s a"
195
  msgstr ""
196
 
197
+ #: includes/admin/class-top-ten-statistics-table.php:297
198
  #, php-format
199
  msgid "%s ago"
200
  msgstr ""
201
 
202
+ #: includes/admin/class-top-ten-statistics-table.php:299
203
  msgid "Y/m/d"
204
  msgstr ""
205
 
206
+ #: includes/admin/class-top-ten-statistics-table.php:338
207
  #: includes/modules/class-top-ten-count-widget.php:53
208
  #: includes/modules/class-top-ten-widget.php:80
209
  msgid "Title"
210
  msgstr ""
211
 
212
+ #: includes/admin/class-top-ten-statistics-table.php:339
213
  msgid "Total visits"
214
  msgstr ""
215
 
216
+ #: includes/admin/class-top-ten-statistics-table.php:340
217
  msgid "Daily visits"
218
  msgstr ""
219
 
220
+ #: includes/admin/class-top-ten-statistics-table.php:341
221
  msgid "Post type"
222
  msgstr ""
223
 
224
+ #: includes/admin/class-top-ten-statistics-table.php:342
225
  msgid "Author"
226
  msgstr ""
227
 
228
+ #: includes/admin/class-top-ten-statistics-table.php:343
229
  msgid "Date"
230
  msgstr ""
231
 
232
+ #: includes/admin/class-top-ten-statistics-table.php:377
233
  msgid "Delete Count"
234
  msgstr ""
235
 
236
+ #: includes/admin/class-top-ten-statistics-table.php:424
237
  msgid "Are you sure you want to do this"
238
  msgstr ""
239
 
240
+ #: includes/admin/class-top-ten-statistics-table.php:489
241
  msgid "Filter"
242
  msgstr ""
243
 
244
+ #: includes/admin/class-top-ten-statistics.php:99
245
  msgid "Search Table"
246
  msgstr ""
247
 
248
+ #: includes/admin/default-settings.php:62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  msgid "Enable trackers"
250
  msgstr ""
251
 
252
+ #: includes/admin/default-settings.php:71
253
  #: includes/modules/class-top-ten-widget.php:95
254
  msgid "Overall"
255
  msgstr ""
256
 
257
+ #: includes/admin/default-settings.php:72
258
+ #: includes/admin/default-settings.php:719
259
  msgid "Daily"
260
  msgstr ""
261
 
262
+ #: includes/admin/default-settings.php:77
263
  msgid "Enable cache"
264
  msgstr ""
265
 
266
+ #: includes/admin/default-settings.php:78
267
  msgid ""
268
  "If activated, Top 10 will use the Transients API to cache the popular posts "
269
  "output for 1 hour."
270
  msgstr ""
271
 
272
+ #: includes/admin/default-settings.php:84
273
  msgid "Time to cache"
274
  msgstr ""
275
 
276
+ #: includes/admin/default-settings.php:85
277
  msgid "Enter the number of seconds to cache the output."
278
  msgstr ""
279
 
280
+ #: includes/admin/default-settings.php:91
281
  msgid "Start daily counts from midnight"
282
  msgstr ""
283
 
284
+ #: includes/admin/default-settings.php:92
285
  msgid ""
286
  "Daily counter will display number of visits from midnight. This option is "
287
  "checked by default and mimics the way most normal counters work. Turning "
288
  "this off will allow you to use the hourly setting in the next option."
289
  msgstr ""
290
 
291
+ #: includes/admin/default-settings.php:98
292
  msgid "Default custom period range"
293
  msgstr ""
294
 
295
+ #: includes/admin/default-settings.php:99
296
  msgid ""
297
  "The next two options allow you to set the default range for the custom "
298
  "period. This was previously called the daily range. This can be overridden "
299
  "in the widget."
300
  msgstr ""
301
 
302
+ #: includes/admin/default-settings.php:104
303
  msgid "Day(s)"
304
  msgstr ""
305
 
306
+ #: includes/admin/default-settings.php:113
307
  msgid "Hour(s)"
308
  msgstr ""
309
 
310
+ #: includes/admin/default-settings.php:123
311
  msgid "Delete options on uninstall"
312
  msgstr ""
313
 
314
+ #: includes/admin/default-settings.php:124
315
  msgid ""
316
  "If this is checked, all settings related to Top 10 are removed from the "
317
  "database if you choose to uninstall/delete the plugin."
318
  msgstr ""
319
 
320
+ #: includes/admin/default-settings.php:130
321
  msgid "Delete counter data on uninstall"
322
  msgstr ""
323
 
324
+ #: includes/admin/default-settings.php:131
325
  msgid ""
326
  "If this is checked, the tables containing the counter statistics are removed "
327
  "from the database if you choose to uninstall/delete the plugin. Keep this "
329
  "counter data."
330
  msgstr ""
331
 
332
+ #: includes/admin/default-settings.php:137
333
  msgid "Show metabox"
334
  msgstr ""
335
 
336
+ #: includes/admin/default-settings.php:138
337
  msgid ""
338
  "This will add the Top 10 metabox on Edit Posts or Add New Posts screens. "
339
  "Also applies to Pages and Custom Post Types."
340
  msgstr ""
341
 
342
+ #: includes/admin/default-settings.php:144
343
  msgid "Limit meta box to Admins only"
344
  msgstr ""
345
 
346
+ #: includes/admin/default-settings.php:145
347
  msgid ""
348
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
349
  "default, Contributors and above will be able to see the meta box. Applies "
350
  "only if the above option is selected."
351
  msgstr ""
352
 
353
+ #: includes/admin/default-settings.php:151
354
  msgid "Link to Top 10 plugin page"
355
  msgstr ""
356
 
357
+ #: includes/admin/default-settings.php:152
358
  msgid ""
359
  "A no-follow link to the plugin homepage will be added as the last item of "
360
  "the popular posts."
361
  msgstr ""
362
 
363
+ #: includes/admin/default-settings.php:181
364
  msgid "Display number of views on"
365
  msgstr ""
366
 
367
+ #: includes/admin/default-settings.php:183
368
+ #: includes/admin/default-settings.php:392
369
  #, php-format
370
  msgid ""
371
  "If you choose to disable this, please add %1$s to your template file where "
372
  "you want it displayed"
373
  msgstr ""
374
 
375
+ #: includes/admin/default-settings.php:190
376
  msgid "Posts"
377
  msgstr ""
378
 
379
+ #: includes/admin/default-settings.php:191
380
  msgid "Pages"
381
  msgstr ""
382
 
383
+ #: includes/admin/default-settings.php:192
384
  msgid "Home page"
385
  msgstr ""
386
 
387
+ #: includes/admin/default-settings.php:193
388
  msgid "Feeds"
389
  msgstr ""
390
 
391
+ #: includes/admin/default-settings.php:194
392
  msgid "Category archives"
393
  msgstr ""
394
 
395
+ #: includes/admin/default-settings.php:195
396
  msgid "Tag archives"
397
  msgstr ""
398
 
399
+ #: includes/admin/default-settings.php:196
400
  msgid "Other archives"
401
  msgstr ""
402
 
403
+ #: includes/admin/default-settings.php:201
404
  msgid "Format to display the post views"
405
  msgstr ""
406
 
407
+ #: includes/admin/default-settings.php:203
408
  #, php-format
409
  msgid ""
410
  "Use %1$s to display the total count, %2$s for daily count and %3$s for "
411
  "overall counts across all posts. Default display is %4$s"
412
  msgstr ""
413
 
414
+ #: includes/admin/default-settings.php:209
415
  msgid "What do display when there are no visits?"
416
  msgstr ""
417
 
418
+ #: includes/admin/default-settings.php:211
419
  msgid ""
420
  "This text applies only when there are 0 hits for the post and it isn't a "
421
  "single page. e.g. if you display post views on the homepage or archives then "
423
  "option."
424
  msgstr ""
425
 
426
+ #: includes/admin/default-settings.php:217
427
+ msgid "Number format post count"
428
+ msgstr ""
429
+
430
+ #: includes/admin/default-settings.php:218
431
+ msgid ""
432
+ "Activating this option will convert the post counts into a number format "
433
+ "based on the locale"
434
+ msgstr ""
435
+
436
+ #: includes/admin/default-settings.php:224
437
  msgid "Always display latest post count"
438
  msgstr ""
439
 
440
+ #: includes/admin/default-settings.php:225
441
  msgid ""
442
  "This option uses JavaScript and will increase your page load time. Turn this "
443
  "off if you are not using caching plugins or are OK with displaying older "
444
  "cached counts."
445
  msgstr ""
446
 
447
+ #: includes/admin/default-settings.php:231
448
  msgid "Tracker type"
449
  msgstr ""
450
 
451
+ #: includes/admin/default-settings.php:239
452
+ msgid "Load tracker on all pages"
453
+ msgstr ""
454
+
455
+ #: includes/admin/default-settings.php:240
456
+ msgid ""
457
+ "This will load the tracker js on all pages. Helpful if you are running "
458
+ "minification/concatenation plugins."
459
+ msgstr ""
460
+
461
+ #: includes/admin/default-settings.php:246
462
  msgid "Track user groups"
463
  msgstr ""
464
 
465
+ #: includes/admin/default-settings.php:247
466
  msgid ""
467
  "Uncheck above to disable tracking if the current user falls into any one of "
468
  "these groups."
469
  msgstr ""
470
 
471
+ #: includes/admin/default-settings.php:254
472
  msgid "Authors"
473
  msgstr ""
474
 
475
+ #: includes/admin/default-settings.php:255
476
  msgid "Editors"
477
  msgstr ""
478
 
479
+ #: includes/admin/default-settings.php:256
480
  msgid "Admins"
481
  msgstr ""
482
 
483
+ #: includes/admin/default-settings.php:261
484
  msgid "Track logged-in users"
485
  msgstr ""
486
 
487
+ #: includes/admin/default-settings.php:262
488
  msgid ""
489
  "Uncheck to stop tracking logged in users. Only logged out visitors will be "
490
  "tracked if this is disabled. Unchecking this will override the above setting."
491
  msgstr ""
492
 
493
+ #: includes/admin/default-settings.php:268
494
+ msgid "Exclude display on these post IDs"
495
+ msgstr ""
496
+
497
+ #: includes/admin/default-settings.php:269
498
+ msgid ""
499
+ "Comma-separated list of post or page IDs to exclude displaying the top posts "
500
+ "on. e.g. 188,320,500"
501
+ msgstr ""
502
+
503
+ #: includes/admin/default-settings.php:275
504
  msgid "Page views in admin"
505
  msgstr ""
506
 
507
+ #: includes/admin/default-settings.php:276
508
  msgid ""
509
  "Adds three columns called Total Views, Today's Views and Views to All Posts "
510
  "and All Pages. You can selectively disable these by pulling down the Screen "
511
  "Options from the top right of the respective screens."
512
  msgstr ""
513
 
514
+ #: includes/admin/default-settings.php:282
515
  msgid "Show views to non-admins"
516
  msgstr ""
517
 
518
+ #: includes/admin/default-settings.php:283
519
  msgid ""
520
  "If you disable this then non-admins won't see the above columns or view the "
521
  "independent pages with the top posts."
522
  msgstr ""
523
 
524
+ #: includes/admin/default-settings.php:289
525
+ msgid "Debug mode"
526
+ msgstr ""
527
+
528
+ #: includes/admin/default-settings.php:290
529
+ msgid ""
530
+ "Setting this to true will force the tracker to display an output in the "
531
+ "browser. This is useful if you are having issues and are seeking support."
532
+ msgstr ""
533
+
534
+ #: includes/admin/default-settings.php:319
535
  msgid "Number of posts to display"
536
  msgstr ""
537
 
538
+ #: includes/admin/default-settings.php:320
539
  msgid ""
540
  "Maximum number of posts that will be displayed in the list. This option is "
541
  "used if you don not specify the number of posts in the widget or shortcodes"
542
  msgstr ""
543
 
544
+ #: includes/admin/default-settings.php:327
545
  msgid "Published age of posts"
546
  msgstr ""
547
 
548
+ #: includes/admin/default-settings.php:328
549
  msgid ""
550
  "This options allows you to only show posts that have been published within "
551
  "the above day range. Applies to both overall posts and daily posts lists. e."
553
  "posts lists. Enter 0 for no restriction."
554
  msgstr ""
555
 
556
+ #: includes/admin/default-settings.php:334
557
  msgid "Post types to include"
558
  msgstr ""
559
 
560
+ #: includes/admin/default-settings.php:335
561
  msgid ""
562
  "At least one option should be selected above. Select which post types you "
563
  "want to include in the list of posts. This field can be overridden using a "
564
  "comma separated list of post types when using the manual display."
565
  msgstr ""
566
 
567
+ #: includes/admin/default-settings.php:341
568
  msgid "Post/page IDs to exclude"
569
  msgstr ""
570
 
571
+ #: includes/admin/default-settings.php:342
572
  msgid ""
573
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
574
  "188,320,500"
575
  msgstr ""
576
 
577
+ #: includes/admin/default-settings.php:348
578
  msgid "Exclude Categories"
579
  msgstr ""
580
 
581
+ #: includes/admin/default-settings.php:349
582
  msgid ""
583
  "Comma separated list of category slugs. The field above has an autocomplete "
584
  "so simply start typing in the starting letters and it will prompt you with "
585
  "options. Does not support custom taxonomies."
586
  msgstr ""
587
 
588
+ #: includes/admin/default-settings.php:360
589
  msgid "Exclude category IDs"
590
  msgstr ""
591
 
592
+ #: includes/admin/default-settings.php:361
593
  msgid ""
594
  "This is a readonly field that is automatically populated based on the above "
595
  "input when the settings are saved. These might differ from the IDs visible "
597
  "term_taxonomy_id which is unique to this taxonomy."
598
  msgstr ""
599
 
600
+ #: includes/admin/default-settings.php:368
601
  msgid "Customize the output"
602
  msgstr ""
603
 
604
+ #: includes/admin/default-settings.php:374
605
  msgid "Heading of posts"
606
  msgstr ""
607
 
608
+ #: includes/admin/default-settings.php:375
609
+ #: includes/admin/default-settings.php:383
610
  msgid "Displayed before the list of the posts as a the master heading"
611
  msgstr ""
612
 
613
+ #: includes/admin/default-settings.php:377
614
  msgid "Popular posts:"
615
  msgstr ""
616
 
617
+ #: includes/admin/default-settings.php:382
618
  msgid "Heading of posts for daily/custom period lists"
619
  msgstr ""
620
 
621
+ #: includes/admin/default-settings.php:385
622
  msgid "Currently trending:"
623
  msgstr ""
624
 
625
+ #: includes/admin/default-settings.php:390
626
  msgid "Show when no posts are found"
627
  msgstr ""
628
 
629
+ #: includes/admin/default-settings.php:396
630
  msgid "Blank output"
631
  msgstr ""
632
 
633
+ #: includes/admin/default-settings.php:397
634
  msgid "Display custom text"
635
  msgstr ""
636
 
637
+ #: includes/admin/default-settings.php:402
638
  msgid "Custom text"
639
  msgstr ""
640
 
641
+ #: includes/admin/default-settings.php:403
642
  msgid ""
643
  "Enter the custom text that will be displayed if the second option is "
644
  "selected above"
645
  msgstr ""
646
 
647
+ #: includes/admin/default-settings.php:405 includes/deprecated.php:180
648
  msgid "No top posts yet"
649
  msgstr ""
650
 
651
+ #: includes/admin/default-settings.php:409
652
  msgid "Show post excerpt"
653
  msgstr ""
654
 
655
+ #: includes/admin/default-settings.php:416
656
  msgid "Length of excerpt (in words)"
657
  msgstr ""
658
 
659
+ #: includes/admin/default-settings.php:424
660
  msgid "Show date"
661
  msgstr ""
662
 
663
+ #: includes/admin/default-settings.php:431
664
  msgid "Show author"
665
  msgstr ""
666
 
667
+ #: includes/admin/default-settings.php:438
668
  msgid "Show number of views"
669
  msgstr ""
670
 
671
+ #: includes/admin/default-settings.php:445
672
  msgid "Limit post title length (in characters)"
673
  msgstr ""
674
 
675
+ #: includes/admin/default-settings.php:453
676
  msgid "Open links in new window"
677
  msgstr ""
678
 
679
+ #: includes/admin/default-settings.php:460
680
  msgid "Add nofollow to links"
681
  msgstr ""
682
 
683
+ #: includes/admin/default-settings.php:467
 
 
 
 
 
 
 
 
 
 
684
  msgid "HTML to display"
685
  msgstr ""
686
 
687
+ #: includes/admin/default-settings.php:473
688
  msgid "Before the list of posts"
689
  msgstr ""
690
 
691
+ #: includes/admin/default-settings.php:480
692
  msgid "After the list of posts"
693
  msgstr ""
694
 
695
+ #: includes/admin/default-settings.php:487
696
  msgid "Before each list item"
697
  msgstr ""
698
 
699
+ #: includes/admin/default-settings.php:494
700
  msgid "After each list item"
701
  msgstr ""
702
 
703
+ #: includes/admin/default-settings.php:524
704
  msgid "Location of the post thumbnail"
705
  msgstr ""
706
 
707
+ #: includes/admin/default-settings.php:529
708
  msgid "Display thumbnails inline with posts, before title"
709
  msgstr ""
710
 
711
+ #: includes/admin/default-settings.php:530
712
  msgid "Display thumbnails inline with posts, after title"
713
  msgstr ""
714
 
715
+ #: includes/admin/default-settings.php:531
716
  msgid "Display only thumbnails, no text"
717
  msgstr ""
718
 
719
+ #: includes/admin/default-settings.php:532
720
  msgid "Do not display thumbnails, only text"
721
  msgstr ""
722
 
723
+ #: includes/admin/default-settings.php:537
724
  msgid "Thumbnail size"
725
  msgstr ""
726
 
727
+ #: includes/admin/default-settings.php:539
728
  msgid ""
729
  "You can choose from existing image sizes above or create a custom size. If "
730
  "you have chosen Custom size above, then enter the width, height and crop "
732
  "width and/or height below, existing images will not be automatically resized."
733
  msgstr ""
734
 
735
+ #: includes/admin/default-settings.php:539
736
  #, php-format
737
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
738
  msgstr ""
739
 
740
+ #: includes/admin/default-settings.php:546
741
  #: includes/modules/class-top-ten-widget.php:145
742
  msgid "Thumbnail width"
743
  msgstr ""
744
 
745
+ #: includes/admin/default-settings.php:554
746
  #: includes/modules/class-top-ten-widget.php:139
747
  msgid "Thumbnail height"
748
  msgstr ""
749
 
750
+ #: includes/admin/default-settings.php:562
751
  msgid "Hard crop thumbnails"
752
  msgstr ""
753
 
754
+ #: includes/admin/default-settings.php:563
755
  msgid ""
756
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
757
  "above vs. maintaining proportions."
758
  msgstr ""
759
 
760
+ #: includes/admin/default-settings.php:569
761
+ msgid "Generate thumbnail sizes"
762
+ msgstr ""
763
+
764
+ #: includes/admin/default-settings.php:570
765
+ msgid ""
766
+ "If you select this option and Custom size is selected above, the plugin will "
767
+ "register the image size with WordPress to create new thumbnails. Does not "
768
+ "update old images as explained above."
769
+ msgstr ""
770
+
771
+ #: includes/admin/default-settings.php:576
772
  msgid "Thumbnail size attributes"
773
  msgstr ""
774
 
775
+ #: includes/admin/default-settings.php:582
776
  #, php-format
777
  msgid "Use CSS to set the width and height: e.g. %s"
778
  msgstr ""
779
 
780
+ #: includes/admin/default-settings.php:584
781
  #, php-format
782
  msgid "Use HTML attributes to set the width and height: e.g. %s"
783
  msgstr ""
784
 
785
+ #: includes/admin/default-settings.php:585
786
  msgid ""
787
  "No width or height set. You will need to use external styles to force any "
788
  "width or height of your choice."
789
  msgstr ""
790
 
791
+ #: includes/admin/default-settings.php:590
792
  msgid "Thumbnail meta field name"
793
  msgstr ""
794
 
795
+ #: includes/admin/default-settings.php:591
796
  msgid ""
797
  "The value of this field should contain the URL of the image and can be set "
798
  "in the metabox in the Edit Post screen"
799
  msgstr ""
800
 
801
+ #: includes/admin/default-settings.php:597
802
  msgid "Get first image"
803
  msgstr ""
804
 
805
+ #: includes/admin/default-settings.php:598
806
  msgid ""
807
  "The plugin will fetch the first image in the post content if this is "
808
  "enabled. This can slow down the loading of your page if the first image in "
809
  "the followed posts is large in file-size."
810
  msgstr ""
811
 
812
+ #: includes/admin/default-settings.php:604
813
  msgid "Use default thumbnail?"
814
  msgstr ""
815
 
816
+ #: includes/admin/default-settings.php:605
817
  msgid ""
818
  "If checked, when no thumbnail is found, show a default one from the URL "
819
  "below. If not checked and no thumbnail is found, no image will be shown."
820
  msgstr ""
821
 
822
+ #: includes/admin/default-settings.php:611 includes/admin/settings-page.php:687
 
823
  msgid "Default thumbnail"
824
  msgstr ""
825
 
826
+ #: includes/admin/default-settings.php:612
827
  msgid ""
828
  "Enter the full URL of the image that you wish to display if no thumbnail is "
829
  "found. This image will be displayed below."
830
  msgstr ""
831
 
832
+ #: includes/admin/default-settings.php:642
833
  msgid "Popular posts style"
834
  msgstr ""
835
 
836
+ #: includes/admin/default-settings.php:650
837
  msgid "Custom CSS"
838
  msgstr ""
839
 
840
+ #: includes/admin/default-settings.php:652
841
  #, php-format
842
  msgid ""
843
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
844
  "CSS classes to style."
845
  msgstr ""
846
 
847
+ #: includes/admin/default-settings.php:681
848
  msgid "Enable scheduled maintenance"
849
  msgstr ""
850
 
851
+ #: includes/admin/default-settings.php:682
852
  msgid ""
853
  "Cleaning the database at regular intervals could improve performance, "
854
  "especially on high traffic blogs. Enabling maintenance will automatically "
855
  "delete entries older than 90 days in the daily tables."
856
  msgstr ""
857
 
858
+ #: includes/admin/default-settings.php:688
859
  msgid "Time to run maintenance"
860
  msgstr ""
861
 
862
+ #: includes/admin/default-settings.php:689
863
  msgid "The next two options allow you to set the time to run the cron."
864
  msgstr ""
865
 
866
+ #: includes/admin/default-settings.php:694
867
  msgid "Hour"
868
  msgstr ""
869
 
870
+ #: includes/admin/default-settings.php:704
871
  msgid "Minute"
872
  msgstr ""
873
 
874
+ #: includes/admin/default-settings.php:714
875
  msgid "Run maintenance"
876
  msgstr ""
877
 
878
+ #: includes/admin/default-settings.php:720
879
  msgid "Weekly"
880
  msgstr ""
881
 
882
+ #: includes/admin/default-settings.php:721
883
  msgid "Fortnightly"
884
  msgstr ""
885
 
886
+ #: includes/admin/default-settings.php:722
887
  msgid "Monthly"
888
  msgstr ""
889
 
890
+ #: includes/admin/default-settings.php:820
891
  msgid "No styles"
892
  msgstr ""
893
 
894
+ #: includes/admin/default-settings.php:821
895
  msgid "Select this option if you plan to add your own styles"
896
  msgstr ""
897
 
898
+ #: includes/admin/default-settings.php:825
899
  msgid "Text only"
900
  msgstr ""
901
 
902
+ #: includes/admin/default-settings.php:826
903
  msgid ""
904
  "Disable thumbnails and no longer include the default style sheet included in "
905
  "the plugin"
906
  msgstr ""
907
 
908
+ #: includes/admin/default-settings.php:830
909
  msgid "Left thumbnails"
910
  msgstr ""
911
 
912
+ #: includes/admin/default-settings.php:831
913
  msgid ""
914
  "Enabling this option will set the post thumbnail to be before text. "
915
  "Disabling this option will not revert any settings."
916
  msgstr ""
917
 
918
+ #: includes/admin/help-tab.php:35 includes/admin/help-tab.php:126
919
+ #, php-format
920
+ msgid ""
921
+ "For more information or how to get support visit the <a href=\"%1$s"
922
+ "\">WebberZone support site</a>."
923
+ msgstr ""
924
+
925
+ #: includes/admin/help-tab.php:37 includes/admin/help-tab.php:128
926
+ #, php-format
927
+ msgid ""
928
+ "Support queries should be posted in the <a href=\"%1$s\">WordPress.org "
929
+ "support forums</a>."
930
+ msgstr ""
931
+
932
+ #: includes/admin/help-tab.php:40 includes/admin/help-tab.php:131
933
+ #, php-format
934
+ msgid ""
935
+ "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug "
936
+ "reports only)."
937
+ msgstr ""
938
+
939
+ #: includes/admin/help-tab.php:49 includes/admin/help-tab.php:140
940
+ #: includes/admin/settings-page.php:125
941
+ msgid "General"
942
+ msgstr ""
943
+
944
+ #: includes/admin/help-tab.php:51
945
+ msgid "This screen provides the basic settings for configuring Top 10."
946
+ msgstr ""
947
+
948
+ #: includes/admin/help-tab.php:52
949
+ msgid ""
950
+ "Enable the trackers and cache, configure basic tracker settings and "
951
+ "uninstall settings."
952
+ msgstr ""
953
+
954
+ #: includes/admin/help-tab.php:59 includes/admin/settings-page.php:126
955
+ msgid "Counter/Tracker"
956
+ msgstr ""
957
+
958
+ #: includes/admin/help-tab.php:61
959
+ msgid ""
960
+ "This screen provides settings to tweak the display counter and the tracker."
961
+ msgstr ""
962
+
963
+ #: includes/admin/help-tab.php:62
964
+ msgid ""
965
+ "Choose where to display the counter and customize the text. Select the type "
966
+ "of tracker and which user groups to track."
967
+ msgstr ""
968
+
969
+ #: includes/admin/help-tab.php:69 includes/admin/settings-page.php:127
970
+ msgid "Posts list"
971
+ msgstr ""
972
+
973
+ #: includes/admin/help-tab.php:71
974
+ msgid ""
975
+ "This screen provides settings to tweak the output of the list of popular "
976
+ "posts."
977
+ msgstr ""
978
+
979
+ #: includes/admin/help-tab.php:72
980
+ msgid ""
981
+ "Set the number of posts, which categories or posts to exclude, customize "
982
+ "what to display and specific basic HTML markup used to create the posts."
983
+ msgstr ""
984
+
985
+ #: includes/admin/help-tab.php:79 includes/admin/settings-page.php:128
986
+ msgid "Thumbnail"
987
+ msgstr ""
988
+
989
+ #: includes/admin/help-tab.php:81
990
+ msgid ""
991
+ "This screen provides settings to tweak the thumbnail that can be displayed "
992
+ "for each post in the list."
993
+ msgstr ""
994
+
995
+ #: includes/admin/help-tab.php:82
996
+ msgid ""
997
+ "Set the location and size of the thumbnail. Additionally, you can choose "
998
+ "additional sources for the thumbnail i.e. a meta field, first image or a "
999
+ "default thumbnail when nothing is available."
1000
+ msgstr ""
1001
+
1002
+ #: includes/admin/help-tab.php:89 includes/admin/settings-page.php:129
1003
+ msgid "Styles"
1004
+ msgstr ""
1005
+
1006
+ #: includes/admin/help-tab.php:91
1007
+ msgid ""
1008
+ "This screen provides options to control the look and feel of the popular "
1009
+ "posts list."
1010
+ msgstr ""
1011
+
1012
+ #: includes/admin/help-tab.php:92
1013
+ msgid ""
1014
+ "Choose for default set of styles or add your own custom CSS to tweak the "
1015
+ "display of the posts."
1016
+ msgstr ""
1017
+
1018
+ #: includes/admin/help-tab.php:99 includes/admin/settings-page.php:130
1019
+ msgid "Maintenance"
1020
+ msgstr ""
1021
+
1022
+ #: includes/admin/help-tab.php:101
1023
+ msgid "This screen provides options to control the maintenance cron."
1024
+ msgstr ""
1025
+
1026
+ #: includes/admin/help-tab.php:102
1027
+ msgid "Choose how often to run maintenance and at what time of the day."
1028
+ msgstr ""
1029
+
1030
+ #: includes/admin/help-tab.php:142
1031
+ msgid ""
1032
+ "This screen provides some tools that help maintain certain features of Top "
1033
+ "10."
1034
+ msgstr ""
1035
+
1036
+ #: includes/admin/help-tab.php:143
1037
+ msgid ""
1038
+ "Clear the cache, reset the popular posts tables plus some miscellaneous "
1039
+ "fixes for older versions of Top 10."
1040
+ msgstr ""
1041
+
1042
  #: includes/admin/save-settings.php:51
1043
  msgid ""
1044
  "Settings have been reset to their default values. Reload this page to view "
1254
  msgid "Once quarterly"
1255
  msgstr ""
1256
 
1257
+ #: includes/deprecated.php:178
1258
  msgid "<h3>Popular Posts</h3>"
1259
  msgstr ""
1260
 
1261
+ #: includes/deprecated.php:179
1262
  msgid "<h3>Daily Popular</h3>"
1263
  msgstr ""
1264
 
1348
  "posts only."
1349
  msgstr ""
1350
 
1351
+ #: includes/public/display-posts.php:219
1352
  #, php-format
1353
  msgid ""
1354
  "Popular posts by <a href=\"%1$s\" rel=\"nofollow\" %2$s>Top 10 plugin</a>"
1370
  msgid " by "
1371
  msgstr ""
1372
 
1373
+ #: includes/tracker.php:276
1374
  msgid "Query variable based"
1375
  msgstr ""
1376
 
1377
+ #: includes/tracker.php:277
1378
  msgid "Uses query variables to record visits"
1379
  msgstr ""
1380
 
1381
+ #: includes/tracker.php:281
1382
  msgid "Ajaxurl based"
1383
  msgstr ""
1384
 
1385
+ #: includes/tracker.php:282
1386
  msgid ""
1387
  "Uses admin-ajax.php which is inbuilt within WordPress to process the tracker"
1388
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Tags: popular posts, top 10, counter, top posts, daily popular, page views, stat
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
- Requires at least: 4.1
7
- Tested up to: 4.9
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.
@@ -170,6 +170,24 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
170
 
171
  == Changelog ==
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  = 2.5.7 =
174
 
175
  * Enhancements:
@@ -285,7 +303,7 @@ For previous changelog entries, please refer to the separate changelog.txt file
285
 
286
  == Upgrade Notice ==
287
 
288
- = 2.5.4 =
289
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
290
  Check the Changelog for more details
291
 
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
+ Requires at least: 4.5
7
+ Tested up to: 5.0
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.
170
 
171
  == Changelog ==
172
 
173
+ = 2.6.0 =
174
+
175
+ * Features:
176
+ * New option to disable creation of image thumbnails. Find this under Thumbnail options
177
+ * Thumbnail HTML markup includes `srcset` and `sizes` attributes when available. Read [Responsive Images in WordPress 4.4](https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/)
178
+ * New option to turn on debug mode. You can turn this on when requesting support. Find it under the Counter/Tracker tab
179
+ * New option to add the tracker js file on all pages, not just singular pages. Helps with minification/concatenation
180
+ * New date filter in the Popular posts listing page to see the views on a particular date
181
+ * New option to turn ON/OFF the number formatting of the post counts. ON by default
182
+
183
+ * Enhancements:
184
+ * Load tracker in footer
185
+ * Renamed top-10-tracker.js to top-10-tracker.min.js
186
+
187
+ * Bug fixes:
188
+ * Only delete option if null value is passed to tptn_update_option
189
+ * "Exclude display on these post IDs" moved under Counter section
190
+
191
  = 2.5.7 =
192
 
193
  * Enhancements:
303
 
304
  == Upgrade Notice ==
305
 
306
+ = 2.6.0 =
307
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
308
  Check the Changelog for more details
309
 
top-10.php CHANGED
@@ -8,13 +8,13 @@
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
- * @copyright 2008-2016 Ajay D'Souza
12
  *
13
  * @wordpress-plugin
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.5.7
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
@@ -110,31 +110,13 @@ function tptn_get_settings() {
110
  }
111
 
112
 
113
- /**
114
- * Function to delete all rows in the posts table.
115
- *
116
- * @since 1.3
117
- * @param bool $daily Daily flag.
118
- */
119
- function tptn_trunc_count( $daily = true ) {
120
- global $wpdb;
121
-
122
- $table_name = $wpdb->base_prefix . 'top_ten';
123
- if ( $daily ) {
124
- $table_name .= '_daily';
125
- }
126
-
127
- $sql = "TRUNCATE TABLE $table_name";
128
- $wpdb->query( $sql ); // WPCS: unprepared SQL OK.
129
- }
130
-
131
-
132
  /*
133
  *---------------------------------------------------------------------------*
134
  * Top 10 modules
135
  *---------------------------------------------------------------------------*
136
  */
137
 
 
138
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/register-settings.php';
139
  require_once TOP_TEN_PLUGIN_DIR . 'includes/activate-deactivate.php';
140
  require_once TOP_TEN_PLUGIN_DIR . 'includes/public/display-posts.php';
@@ -145,6 +127,7 @@ require_once TOP_TEN_PLUGIN_DIR . 'includes/l10n.php';
145
  require_once TOP_TEN_PLUGIN_DIR . 'includes/counter.php';
146
  require_once TOP_TEN_PLUGIN_DIR . 'includes/tracker.php';
147
  require_once TOP_TEN_PLUGIN_DIR . 'includes/cron.php';
 
148
  require_once TOP_TEN_PLUGIN_DIR . 'includes/formatting.php';
149
  require_once TOP_TEN_PLUGIN_DIR . 'includes/modules/shortcode.php';
150
  require_once TOP_TEN_PLUGIN_DIR . 'includes/modules/exclusions.php';
@@ -169,6 +152,7 @@ if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
169
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-metabox.php';
170
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-columns.php';
171
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-dashboard.php';
 
172
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/class-top-ten-statistics-table.php';
173
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/cache.php';
174
 
8
  * @author Ajay D'Souza <me@ajaydsouza.com>
9
  * @license GPL-2.0+
10
  * @link https://webberzone.com
11
+ * @copyright 2008-2019 Ajay D'Souza
12
  *
13
  * @wordpress-plugin
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.6.0
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
110
  }
111
 
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  /*
114
  *---------------------------------------------------------------------------*
115
  * Top 10 modules
116
  *---------------------------------------------------------------------------*
117
  */
118
 
119
+ require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/default-settings.php';
120
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/register-settings.php';
121
  require_once TOP_TEN_PLUGIN_DIR . 'includes/activate-deactivate.php';
122
  require_once TOP_TEN_PLUGIN_DIR . 'includes/public/display-posts.php';
127
  require_once TOP_TEN_PLUGIN_DIR . 'includes/counter.php';
128
  require_once TOP_TEN_PLUGIN_DIR . 'includes/tracker.php';
129
  require_once TOP_TEN_PLUGIN_DIR . 'includes/cron.php';
130
+ require_once TOP_TEN_PLUGIN_DIR . 'includes/helpers.php';
131
  require_once TOP_TEN_PLUGIN_DIR . 'includes/formatting.php';
132
  require_once TOP_TEN_PLUGIN_DIR . 'includes/modules/shortcode.php';
133
  require_once TOP_TEN_PLUGIN_DIR . 'includes/modules/exclusions.php';
152
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-metabox.php';
153
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-columns.php';
154
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/admin-dashboard.php';
155
+ require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/class-top-ten-statistics.php';
156
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/class-top-ten-statistics-table.php';
157
  require_once TOP_TEN_PLUGIN_DIR . 'includes/admin/cache.php';
158
 
uninstall.php CHANGED
@@ -6,7 +6,7 @@
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
- * @copyright 2008-2016 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
@@ -23,8 +23,8 @@ if ( $tptn_settings['uninstall_clean_tables'] ) {
23
  $table_name = $wpdb->base_prefix . 'top_ten';
24
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily';
25
 
26
- $wpdb->query( "DROP TABLE $table_name" ); // WPCS: unprepared SQL OK.
27
- $wpdb->query( "DROP TABLE $table_name_daily" ); // WPCS: unprepared SQL OK.
28
  delete_option( 'tptn_db_version' );
29
 
30
  }
6
  * @author Ajay D'Souza <me@ajaydsouza.com>
7
  * @license GPL-2.0+
8
  * @link https://webberzone.com
9
+ * @copyright 2008-2019 Ajay D'Souza
10
  */
11
 
12
  // If this file is called directly, abort.
23
  $table_name = $wpdb->base_prefix . 'top_ten';
24
  $table_name_daily = $wpdb->base_prefix . 'top_ten_daily';
25
 
26
+ $wpdb->query( "DROP TABLE $table_name" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
27
+ $wpdb->query( "DROP TABLE $table_name_daily" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
28
  delete_option( 'tptn_db_version' );
29
 
30
  }