Top 10 – Popular posts plugin for WordPress - Version 2.5.4

Version Description

  • Features:

    • New button in the Tools page to delete the pre-2.5.x settings
  • Enhancements:

    • New function tptn_trim_char replaces tptn_max_formatted_content which should now support non-English characters as well
    • Counts in the "Popular Posts" page are now number formatted
  • Bug fixes:

    • Fixed PHP Illegal string offset error
Download this release

Release Info

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

Code changes from version 2.5.3 to 2.5.4

includes/admin/class-top-ten-statistics-table.php CHANGED
@@ -223,7 +223,7 @@ class Top_Ten_Statistics_Table extends WP_List_Table {
223
  return $item[ $column_name ];
224
  case 'total_count':
225
  case 'daily_count':
226
- return intval( $item[ $column_name ] );
227
  default:
228
  return print_r( $item, true ); // Show the whole array for troubleshooting purposes.
229
  }
223
  return $item[ $column_name ];
224
  case 'total_count':
225
  case 'daily_count':
226
+ return number_format_i18n( absint( $item[ $column_name ] ) );
227
  default:
228
  return print_r( $item, true ); // Show the whole array for troubleshooting purposes.
229
  }
includes/admin/save-settings.php CHANGED
@@ -46,7 +46,7 @@ function tptn_settings_sanitize( $input = array() ) {
46
 
47
  if ( $reset ) {
48
  tptn_settings_reset();
49
- $tptn_settings = get_option( 'tptn_settings' );
50
 
51
  add_settings_error( 'tptn-notices', '', __( 'Settings have been reset to their default values. Reload this page to view the updated settings', 'top-10' ), 'error' );
52
 
46
 
47
  if ( $reset ) {
48
  tptn_settings_reset();
49
+ $tptn_settings = tptn_get_settings();
50
 
51
  add_settings_error( 'tptn-notices', '', __( 'Settings have been reset to their default values. Reload this page to view the updated settings', 'top-10' ), 'error' );
52
 
includes/admin/tools.php CHANGED
@@ -36,6 +36,12 @@ function tptn_tools_page() {
36
  add_settings_error( 'tptn-notices', '', esc_html__( 'Top 10 daily popular posts reset', 'top-10' ), 'error' );
37
  }
38
 
 
 
 
 
 
 
39
  /* Clean duplicates */
40
  if ( ( isset( $_POST['tptn_clean_duplicates'] ) ) && ( check_admin_referer( 'tptn-tools-settings' ) ) ) {
41
  tptn_clean_duplicates( true );
@@ -81,12 +87,20 @@ function tptn_tools_page() {
81
  </p>
82
 
83
  <h2 style="padding-left:0px"><?php esc_html_e( 'Other tools', 'top-10' ); ?></h2>
 
 
 
 
 
 
 
84
  <p>
85
  <input name="tptn_merge_blogids" type="submit" id="tptn_merge_blogids" value="<?php esc_attr_e( 'Merge blog ID 0 and 1 post counts', 'top-10' ); ?>" class="button button-secondary" onclick="if (!confirm('<?php esc_attr_e( 'This will merge post counts for blog IDs 0 and 1. Proceed?', 'top-10' ); ?>')) return false;" />
86
  </p>
87
  <p class="description">
88
  <?php esc_html_e( 'This will merge post counts for posts with table entries of 0 and 1', 'top-10' ); ?>
89
  </p>
 
90
  <p>
91
  <input name="tptn_clean_duplicates" type="submit" id="tptn_clean_duplicates" value="<?php esc_attr_e( 'Merge duplicates across blog IDs', 'top-10' ); ?>" class="button button-secondary" onclick="if (!confirm('<?php esc_attr_e( 'This will delete the duplicate entries in the tables. Proceed?', 'top-10' ); ?>')) return false;" />
92
  </p>
36
  add_settings_error( 'tptn-notices', '', esc_html__( 'Top 10 daily popular posts reset', 'top-10' ), 'error' );
37
  }
38
 
39
+ /* Delete old settings */
40
+ if ( ( isset( $_POST['tptn_delete_old_settings'] ) ) && ( check_admin_referer( 'tptn-tools-settings' ) ) ) {
41
+ delete_option( 'ald_tptn_settings' );
42
+ add_settings_error( 'tptn-notices', '', esc_html__( 'Old settings key has been deleted', 'top-10' ), 'error' );
43
+ }
44
+
45
  /* Clean duplicates */
46
  if ( ( isset( $_POST['tptn_clean_duplicates'] ) ) && ( check_admin_referer( 'tptn-tools-settings' ) ) ) {
47
  tptn_clean_duplicates( true );
87
  </p>
88
 
89
  <h2 style="padding-left:0px"><?php esc_html_e( 'Other tools', 'top-10' ); ?></h2>
90
+ <p>
91
+ <input name="tptn_delete_old_settings" type="submit" id="tptn_delete_old_settings" value="<?php esc_attr_e( 'Delete old settings', 'top-10' ); ?>" class="button button-secondary" onclick="if (!confirm('<?php esc_attr_e( 'This will delete the settings before v2.5.x. Proceed?', 'top-10' ); ?>')) return false;" />
92
+ </p>
93
+ <p class="description">
94
+ <?php esc_html_e( 'From v2.5.x, Top 10 stores the settings in a new key in the database. This will delete the old settings for the current blog. It is recommended that you do this at the earliest after upgrade. However, you should do this only if you are comfortable with the new settings.', 'top-10' ); ?>
95
+ </p>
96
+
97
  <p>
98
  <input name="tptn_merge_blogids" type="submit" id="tptn_merge_blogids" value="<?php esc_attr_e( 'Merge blog ID 0 and 1 post counts', 'top-10' ); ?>" class="button button-secondary" onclick="if (!confirm('<?php esc_attr_e( 'This will merge post counts for blog IDs 0 and 1. Proceed?', 'top-10' ); ?>')) return false;" />
99
  </p>
100
  <p class="description">
101
  <?php esc_html_e( 'This will merge post counts for posts with table entries of 0 and 1', 'top-10' ); ?>
102
  </p>
103
+
104
  <p>
105
  <input name="tptn_clean_duplicates" type="submit" id="tptn_clean_duplicates" value="<?php esc_attr_e( 'Merge duplicates across blog IDs', 'top-10' ); ?>" class="button button-secondary" onclick="if (!confirm('<?php esc_attr_e( 'This will delete the duplicate entries in the tables. Proceed?', 'top-10' ); ?>')) return false;" />
106
  </p>
includes/counter.php CHANGED
@@ -58,7 +58,7 @@ function tptn_rss_filter( $content ) {
58
 
59
  $add_to = tptn_get_option( 'add_to' );
60
 
61
- if ( $add_to['feed'] ) {
62
  return $content . '<div class="tptn_counter" id="tptn_counter_' . $id . '">' . get_tptn_post_count( $id ) . '</div>';
63
  } else {
64
  return $content;
58
 
59
  $add_to = tptn_get_option( 'add_to' );
60
 
61
+ if ( ! empty( $add_to['feed'] ) ) {
62
  return $content . '<div class="tptn_counter" id="tptn_counter_' . $id . '">' . get_tptn_post_count( $id ) . '</div>';
63
  } else {
64
  return $content;
includes/deprecated.php CHANGED
@@ -323,3 +323,31 @@ function tptn_read_options() {
323
  }
324
 
325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  }
324
 
325
 
326
+ /**
327
+ * Function to limit content by characters.
328
+ *
329
+ * @since 1.9.8
330
+ *
331
+ * @deprecated 2.5.4
332
+ *
333
+ * @param string $content Content to be used to make an excerpt.
334
+ * @param int $no_of_char Maximum length of excerpt in characters.
335
+ * @return string Formatted content.
336
+ */
337
+ function tptn_max_formatted_content( $content, $no_of_char = -1 ) {
338
+ _deprecated_function( __FUNCTION__, '2.5.4', 'tptn_trim_char()' );
339
+
340
+ $content = tptn_trim_char( $content, $no_of_char );
341
+
342
+ /**
343
+ * Filters formatted content after cropping.
344
+ *
345
+ * @since 1.9.10.1
346
+ *
347
+ * @param string $content Formatted content
348
+ * @param int $no_of_char Maximum length of excerpt in characters
349
+ */
350
+ return apply_filters( 'tptn_max_formatted_content', $content, $no_of_char );
351
+ }
352
+
353
+
includes/formatting.php CHANGED
@@ -46,36 +46,38 @@ function tptn_excerpt( $id, $excerpt_length = 0, $use_excerpt = true ) {
46
 
47
 
48
  /**
49
- * Function to limit content by characters.
50
  *
51
- * @since 1.9.8
52
- * @param string $content Content to be used to make an excerpt.
53
- * @param int $no_of_char Maximum length of excerpt in characters.
54
- * @return string Formatted content.
 
 
 
55
  */
56
- function tptn_max_formatted_content( $content, $no_of_char = -1 ) {
57
- $content = strip_tags( $content );
58
-
59
- if ( ( $no_of_char > 0 ) && ( strlen( $content ) > $no_of_char ) ) {
60
- $no_of_words = preg_split( '/[\s]+/', substr( $content, 0, $no_of_char ) );
61
-
62
- // Break back down into a string of words, but drop the last one if it's chopped off.
63
- if ( substr( $content, $no_of_char, 1 ) === ' ' ) {
64
- $content = implode( ' ', $no_of_words );
65
- } else {
66
- $content = implode( ' ', array_slice( $no_of_words, 0, -1 ) ) . '&hellip;';
67
  }
 
68
  }
69
-
70
  /**
71
- * Filters formatted content after cropping.
72
  *
73
- * @since 1.9.10.1
74
  *
75
- * @param string $content Formatted content
76
- * @param int $no_of_char Maximum length of excerpt in characters
 
 
77
  */
78
- return apply_filters( 'tptn_max_formatted_content', $content, $no_of_char );
79
  }
80
 
81
-
46
 
47
 
48
  /**
49
+ * Truncate a string to a certain length.
50
  *
51
+ * @since 2.5.4
52
+ *
53
+ * @param string $string String to truncate.
54
+ * @param int $count Maximum number of characters to take.
55
+ * @param string $more What to append if $string needs to be trimmed.
56
+ * @param bool $break_words Optionally choose to break words.
57
+ * @return string Truncated string.
58
  */
59
+ function tptn_trim_char( $string, $count = 60, $more = '&hellip;', $break_words = false ) {
60
+ $string = wp_strip_all_tags( $string, true );
61
+ if ( 0 === $count ) {
62
+ return '';
63
+ }
64
+ if ( mb_strlen( $string ) > $count && $count > 0 ) {
65
+ $count -= min( $count, mb_strlen( $more ) );
66
+ if ( ! $break_words ) {
67
+ $string = preg_replace( '/\s+?(\S+)?$/u', '', mb_substr( $string, 0, $count + 1 ) );
 
 
68
  }
69
+ $string = mb_substr( $string, 0, $count ) . $more;
70
  }
 
71
  /**
72
+ * Filters truncated string.
73
  *
74
+ * @since 2.4.0
75
  *
76
+ * @param string $string String to truncate.
77
+ * @param int $count Maximum number of characters to take.
78
+ * @param string $more What to append if $string needs to be trimmed.
79
+ * @param bool $break_words Optionally choose to break words.
80
  */
81
+ return apply_filters( 'tptn_trim_char', $string, $count, $more, $break_words );
82
  }
83
 
 
includes/public/output-generator.php CHANGED
@@ -195,7 +195,7 @@ function tptn_after_list_item( $args, $result ) {
195
  */
196
  function tptn_post_title( $args, $result ) {
197
 
198
- $title = tptn_max_formatted_content( get_the_title( $result->ID ), $args['title_length'] ); // Get the post title and crop it if needed.
199
 
200
  /**
201
  * Filter the post title of each list item.
195
  */
196
  function tptn_post_title( $args, $result ) {
197
 
198
+ $title = tptn_trim_char( get_the_title( $result->ID ), $args['title_length'] ); // Get the post title and crop it if needed.
199
 
200
  /**
201
  * Filter the post title of each list item.
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: 2017-11-18 11:05+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"
@@ -117,7 +117,7 @@ msgstr ""
117
  msgid "Settings"
118
  msgstr ""
119
 
120
- #: includes/admin/admin.php:37 includes/admin/tools.php:56
121
  msgid "Top 10 Tools"
122
  msgstr ""
123
 
@@ -126,6 +126,7 @@ msgid "Tools"
126
  msgstr ""
127
 
128
  #: includes/admin/admin.php:44
 
129
  msgid "Top 10 Popular Posts"
130
  msgstr ""
131
 
@@ -898,7 +899,7 @@ msgid ""
898
  msgstr ""
899
 
900
  #: includes/admin/register-settings.php:695
901
- #: includes/admin/settings-page.php:669
902
  msgid "Default thumbnail"
903
  msgstr ""
904
 
@@ -966,29 +967,29 @@ msgstr ""
966
  msgid "Monthly"
967
  msgstr ""
968
 
969
- #: includes/admin/register-settings.php:978
970
  msgid "No styles"
971
  msgstr ""
972
 
973
- #: includes/admin/register-settings.php:979
974
  msgid "Select this option if you plan to add your own styles"
975
  msgstr ""
976
 
977
- #: includes/admin/register-settings.php:983
978
  msgid "Text only"
979
  msgstr ""
980
 
981
- #: includes/admin/register-settings.php:984
982
  msgid ""
983
  "Disable thumbnails and no longer include the default style sheet included in "
984
  "the plugin"
985
  msgstr ""
986
 
987
- #: includes/admin/register-settings.php:988
988
  msgid "Left thumbnails"
989
  msgstr ""
990
 
991
- #: includes/admin/register-settings.php:989
992
  msgid ""
993
  "Enabling this option will set the post thumbnail to be before text. "
994
  "Disabling this option will not revert any settings."
@@ -1022,7 +1023,7 @@ msgid ""
1022
  "The callback function used for the <strong>%s</strong> setting is missing."
1023
  msgstr ""
1024
 
1025
- #: includes/admin/settings-page.php:298
1026
  msgid "Modified from default setting"
1027
  msgstr ""
1028
 
@@ -1082,45 +1083,49 @@ msgstr ""
1082
  msgid "Top 10 daily popular posts reset"
1083
  msgstr ""
1084
 
1085
- #: includes/admin/tools.php:43
 
 
 
 
1086
  msgid "Duplicate rows cleaned from the tables"
1087
  msgstr ""
1088
 
1089
- #: includes/admin/tools.php:50
1090
  msgid "Post counts across blog IDs 0 and 1 have been merged"
1091
  msgstr ""
1092
 
1093
- #: includes/admin/tools.php:66 includes/admin/tools.php:68
1094
  msgid "Clear cache"
1095
  msgstr ""
1096
 
1097
- #: includes/admin/tools.php:71
1098
  msgid ""
1099
  "Clear the Top 10 cache. This will also be cleared automatically when you "
1100
  "save the settings page."
1101
  msgstr ""
1102
 
1103
- #: includes/admin/tools.php:74
1104
  msgid "Reset database"
1105
  msgstr ""
1106
 
1107
- #: includes/admin/tools.php:76
1108
  msgid "Reset Popular Posts Network-wide"
1109
  msgstr ""
1110
 
1111
- #: includes/admin/tools.php:76
1112
  msgid "Are you sure you want to reset the popular posts?"
1113
  msgstr ""
1114
 
1115
- #: includes/admin/tools.php:77
1116
  msgid "Reset Daily Popular Posts Network-wide"
1117
  msgstr ""
1118
 
1119
- #: includes/admin/tools.php:77
1120
  msgid "Are you sure you want to reset the daily popular posts?"
1121
  msgstr ""
1122
 
1123
- #: includes/admin/tools.php:80
1124
  msgid ""
1125
  "This will reset the Top 10 tables. If you are running Top 10 on multisite "
1126
  "then it will delete the popular posts across the entire network. This cannot "
@@ -1128,31 +1133,47 @@ msgid ""
1128
  "proceeding"
1129
  msgstr ""
1130
 
1131
- #: includes/admin/tools.php:83
1132
  msgid "Other tools"
1133
  msgstr ""
1134
 
1135
- #: includes/admin/tools.php:85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1136
  msgid "Merge blog ID 0 and 1 post counts"
1137
  msgstr ""
1138
 
1139
- #: includes/admin/tools.php:85
1140
  msgid "This will merge post counts for blog IDs 0 and 1. Proceed?"
1141
  msgstr ""
1142
 
1143
- #: includes/admin/tools.php:88
1144
  msgid "This will merge post counts for posts with table entries of 0 and 1"
1145
  msgstr ""
1146
 
1147
- #: includes/admin/tools.php:91
1148
  msgid "Merge duplicates across blog IDs"
1149
  msgstr ""
1150
 
1151
- #: includes/admin/tools.php:91
1152
  msgid "This will delete the duplicate entries in the tables. Proceed?"
1153
  msgstr ""
1154
 
1155
- #: includes/admin/tools.php:94
1156
  msgid ""
1157
  "In older versions, the plugin created entries with duplicate post IDs. "
1158
  "Clicking the button below will merge these duplicate IDs"
2
  msgstr ""
3
  "Project-Id-Version: Top 10\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-11-26 11:13+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"
117
  msgid "Settings"
118
  msgstr ""
119
 
120
+ #: includes/admin/admin.php:37 includes/admin/tools.php:62
121
  msgid "Top 10 Tools"
122
  msgstr ""
123
 
126
  msgstr ""
127
 
128
  #: includes/admin/admin.php:44
129
+ #: includes/admin/class-top-ten-statistics-table.php:529
130
  msgid "Top 10 Popular Posts"
131
  msgstr ""
132
 
899
  msgstr ""
900
 
901
  #: includes/admin/register-settings.php:695
902
+ #: includes/admin/settings-page.php:684
903
  msgid "Default thumbnail"
904
  msgstr ""
905
 
967
  msgid "Monthly"
968
  msgstr ""
969
 
970
+ #: includes/admin/register-settings.php:979
971
  msgid "No styles"
972
  msgstr ""
973
 
974
+ #: includes/admin/register-settings.php:980
975
  msgid "Select this option if you plan to add your own styles"
976
  msgstr ""
977
 
978
+ #: includes/admin/register-settings.php:984
979
  msgid "Text only"
980
  msgstr ""
981
 
982
+ #: includes/admin/register-settings.php:985
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:989
989
  msgid "Left thumbnails"
990
  msgstr ""
991
 
992
+ #: includes/admin/register-settings.php:990
993
  msgid ""
994
  "Enabling this option will set the post thumbnail to be before text. "
995
  "Disabling this option will not revert any settings."
1023
  "The callback function used for the <strong>%s</strong> setting is missing."
1024
  msgstr ""
1025
 
1026
+ #: includes/admin/settings-page.php:312
1027
  msgid "Modified from default setting"
1028
  msgstr ""
1029
 
1083
  msgid "Top 10 daily popular posts reset"
1084
  msgstr ""
1085
 
1086
+ #: includes/admin/tools.php:42
1087
+ msgid "Old settings key has been deleted"
1088
+ msgstr ""
1089
+
1090
+ #: includes/admin/tools.php:49
1091
  msgid "Duplicate rows cleaned from the tables"
1092
  msgstr ""
1093
 
1094
+ #: includes/admin/tools.php:56
1095
  msgid "Post counts across blog IDs 0 and 1 have been merged"
1096
  msgstr ""
1097
 
1098
+ #: includes/admin/tools.php:72 includes/admin/tools.php:74
1099
  msgid "Clear cache"
1100
  msgstr ""
1101
 
1102
+ #: includes/admin/tools.php:77
1103
  msgid ""
1104
  "Clear the Top 10 cache. This will also be cleared automatically when you "
1105
  "save the settings page."
1106
  msgstr ""
1107
 
1108
+ #: includes/admin/tools.php:80
1109
  msgid "Reset database"
1110
  msgstr ""
1111
 
1112
+ #: includes/admin/tools.php:82
1113
  msgid "Reset Popular Posts Network-wide"
1114
  msgstr ""
1115
 
1116
+ #: includes/admin/tools.php:82
1117
  msgid "Are you sure you want to reset the popular posts?"
1118
  msgstr ""
1119
 
1120
+ #: includes/admin/tools.php:83
1121
  msgid "Reset Daily Popular Posts Network-wide"
1122
  msgstr ""
1123
 
1124
+ #: includes/admin/tools.php:83
1125
  msgid "Are you sure you want to reset the daily popular posts?"
1126
  msgstr ""
1127
 
1128
+ #: includes/admin/tools.php:86
1129
  msgid ""
1130
  "This will reset the Top 10 tables. If you are running Top 10 on multisite "
1131
  "then it will delete the popular posts across the entire network. This cannot "
1133
  "proceeding"
1134
  msgstr ""
1135
 
1136
+ #: includes/admin/tools.php:89
1137
  msgid "Other tools"
1138
  msgstr ""
1139
 
1140
+ #: includes/admin/tools.php:91
1141
+ msgid "Delete old settings"
1142
+ msgstr ""
1143
+
1144
+ #: includes/admin/tools.php:91
1145
+ msgid "This will delete the settings before v2.5.x. Proceed?"
1146
+ msgstr ""
1147
+
1148
+ #: includes/admin/tools.php:94
1149
+ msgid ""
1150
+ "From v2.5.x, Top 10 stores the settings in a new key in the database. This "
1151
+ "will delete the old settings for the current blog. It is recommended that "
1152
+ "you do this at the earliest after upgrade. However, you should do this only "
1153
+ "if you are comfortable with the new settings."
1154
+ msgstr ""
1155
+
1156
+ #: includes/admin/tools.php:98
1157
  msgid "Merge blog ID 0 and 1 post counts"
1158
  msgstr ""
1159
 
1160
+ #: includes/admin/tools.php:98
1161
  msgid "This will merge post counts for blog IDs 0 and 1. Proceed?"
1162
  msgstr ""
1163
 
1164
+ #: includes/admin/tools.php:101
1165
  msgid "This will merge post counts for posts with table entries of 0 and 1"
1166
  msgstr ""
1167
 
1168
+ #: includes/admin/tools.php:105
1169
  msgid "Merge duplicates across blog IDs"
1170
  msgstr ""
1171
 
1172
+ #: includes/admin/tools.php:105
1173
  msgid "This will delete the duplicate entries in the tables. Proceed?"
1174
  msgstr ""
1175
 
1176
+ #: includes/admin/tools.php:108
1177
  msgid ""
1178
  "In older versions, the plugin created entries with duplicate post IDs. "
1179
  "Clicking the button below will merge these duplicate IDs"
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: 2017-11-18 11:06+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"
@@ -118,7 +118,7 @@ msgstr ""
118
  msgid "Settings"
119
  msgstr ""
120
 
121
- #: includes/admin/admin.php:37 includes/admin/tools.php:56
122
  msgid "Top 10 Tools"
123
  msgstr ""
124
 
@@ -127,6 +127,7 @@ msgid "Tools"
127
  msgstr ""
128
 
129
  #: includes/admin/admin.php:44
 
130
  msgid "Top 10 Popular Posts"
131
  msgstr ""
132
 
@@ -899,7 +900,7 @@ msgid ""
899
  msgstr ""
900
 
901
  #: includes/admin/register-settings.php:695
902
- #: includes/admin/settings-page.php:669
903
  msgid "Default thumbnail"
904
  msgstr ""
905
 
@@ -967,29 +968,29 @@ msgstr ""
967
  msgid "Monthly"
968
  msgstr ""
969
 
970
- #: includes/admin/register-settings.php:978
971
  msgid "No styles"
972
  msgstr ""
973
 
974
- #: includes/admin/register-settings.php:979
975
  msgid "Select this option if you plan to add your own styles"
976
  msgstr ""
977
 
978
- #: includes/admin/register-settings.php:983
979
  msgid "Text only"
980
  msgstr ""
981
 
982
- #: includes/admin/register-settings.php:984
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:988
989
  msgid "Left thumbnails"
990
  msgstr ""
991
 
992
- #: includes/admin/register-settings.php:989
993
  msgid ""
994
  "Enabling this option will set the post thumbnail to be before text. "
995
  "Disabling this option will not revert any settings."
@@ -1023,7 +1024,7 @@ msgid ""
1023
  "The callback function used for the <strong>%s</strong> setting is missing."
1024
  msgstr ""
1025
 
1026
- #: includes/admin/settings-page.php:298
1027
  msgid "Modified from default setting"
1028
  msgstr ""
1029
 
@@ -1083,45 +1084,49 @@ msgstr ""
1083
  msgid "Top 10 daily popular posts reset"
1084
  msgstr ""
1085
 
1086
- #: includes/admin/tools.php:43
 
 
 
 
1087
  msgid "Duplicate rows cleaned from the tables"
1088
  msgstr ""
1089
 
1090
- #: includes/admin/tools.php:50
1091
  msgid "Post counts across blog IDs 0 and 1 have been merged"
1092
  msgstr ""
1093
 
1094
- #: includes/admin/tools.php:66 includes/admin/tools.php:68
1095
  msgid "Clear cache"
1096
  msgstr ""
1097
 
1098
- #: includes/admin/tools.php:71
1099
  msgid ""
1100
  "Clear the Top 10 cache. This will also be cleared automatically when you "
1101
  "save the settings page."
1102
  msgstr ""
1103
 
1104
- #: includes/admin/tools.php:74
1105
  msgid "Reset database"
1106
  msgstr ""
1107
 
1108
- #: includes/admin/tools.php:76
1109
  msgid "Reset Popular Posts Network-wide"
1110
  msgstr ""
1111
 
1112
- #: includes/admin/tools.php:76
1113
  msgid "Are you sure you want to reset the popular posts?"
1114
  msgstr ""
1115
 
1116
- #: includes/admin/tools.php:77
1117
  msgid "Reset Daily Popular Posts Network-wide"
1118
  msgstr ""
1119
 
1120
- #: includes/admin/tools.php:77
1121
  msgid "Are you sure you want to reset the daily popular posts?"
1122
  msgstr ""
1123
 
1124
- #: includes/admin/tools.php:80
1125
  msgid ""
1126
  "This will reset the Top 10 tables. If you are running Top 10 on multisite "
1127
  "then it will delete the popular posts across the entire network. This cannot "
@@ -1129,31 +1134,47 @@ msgid ""
1129
  "proceeding"
1130
  msgstr ""
1131
 
1132
- #: includes/admin/tools.php:83
1133
  msgid "Other tools"
1134
  msgstr ""
1135
 
1136
- #: includes/admin/tools.php:85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1137
  msgid "Merge blog ID 0 and 1 post counts"
1138
  msgstr ""
1139
 
1140
- #: includes/admin/tools.php:85
1141
  msgid "This will merge post counts for blog IDs 0 and 1. Proceed?"
1142
  msgstr ""
1143
 
1144
- #: includes/admin/tools.php:88
1145
  msgid "This will merge post counts for posts with table entries of 0 and 1"
1146
  msgstr ""
1147
 
1148
- #: includes/admin/tools.php:91
1149
  msgid "Merge duplicates across blog IDs"
1150
  msgstr ""
1151
 
1152
- #: includes/admin/tools.php:91
1153
  msgid "This will delete the duplicate entries in the tables. Proceed?"
1154
  msgstr ""
1155
 
1156
- #: includes/admin/tools.php:94
1157
  msgid ""
1158
  "In older versions, the plugin created entries with duplicate post IDs. "
1159
  "Clicking the button below will merge these duplicate IDs"
3
  msgstr ""
4
  "Project-Id-Version: Top 10\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2017-11-26 11:14+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"
118
  msgid "Settings"
119
  msgstr ""
120
 
121
+ #: includes/admin/admin.php:37 includes/admin/tools.php:62
122
  msgid "Top 10 Tools"
123
  msgstr ""
124
 
127
  msgstr ""
128
 
129
  #: includes/admin/admin.php:44
130
+ #: includes/admin/class-top-ten-statistics-table.php:529
131
  msgid "Top 10 Popular Posts"
132
  msgstr ""
133
 
900
  msgstr ""
901
 
902
  #: includes/admin/register-settings.php:695
903
+ #: includes/admin/settings-page.php:684
904
  msgid "Default thumbnail"
905
  msgstr ""
906
 
968
  msgid "Monthly"
969
  msgstr ""
970
 
971
+ #: includes/admin/register-settings.php:979
972
  msgid "No styles"
973
  msgstr ""
974
 
975
+ #: includes/admin/register-settings.php:980
976
  msgid "Select this option if you plan to add your own styles"
977
  msgstr ""
978
 
979
+ #: includes/admin/register-settings.php:984
980
  msgid "Text only"
981
  msgstr ""
982
 
983
+ #: includes/admin/register-settings.php:985
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:989
990
  msgid "Left thumbnails"
991
  msgstr ""
992
 
993
+ #: includes/admin/register-settings.php:990
994
  msgid ""
995
  "Enabling this option will set the post thumbnail to be before text. "
996
  "Disabling this option will not revert any settings."
1024
  "The callback function used for the <strong>%s</strong> setting is missing."
1025
  msgstr ""
1026
 
1027
+ #: includes/admin/settings-page.php:312
1028
  msgid "Modified from default setting"
1029
  msgstr ""
1030
 
1084
  msgid "Top 10 daily popular posts reset"
1085
  msgstr ""
1086
 
1087
+ #: includes/admin/tools.php:42
1088
+ msgid "Old settings key has been deleted"
1089
+ msgstr ""
1090
+
1091
+ #: includes/admin/tools.php:49
1092
  msgid "Duplicate rows cleaned from the tables"
1093
  msgstr ""
1094
 
1095
+ #: includes/admin/tools.php:56
1096
  msgid "Post counts across blog IDs 0 and 1 have been merged"
1097
  msgstr ""
1098
 
1099
+ #: includes/admin/tools.php:72 includes/admin/tools.php:74
1100
  msgid "Clear cache"
1101
  msgstr ""
1102
 
1103
+ #: includes/admin/tools.php:77
1104
  msgid ""
1105
  "Clear the Top 10 cache. This will also be cleared automatically when you "
1106
  "save the settings page."
1107
  msgstr ""
1108
 
1109
+ #: includes/admin/tools.php:80
1110
  msgid "Reset database"
1111
  msgstr ""
1112
 
1113
+ #: includes/admin/tools.php:82
1114
  msgid "Reset Popular Posts Network-wide"
1115
  msgstr ""
1116
 
1117
+ #: includes/admin/tools.php:82
1118
  msgid "Are you sure you want to reset the popular posts?"
1119
  msgstr ""
1120
 
1121
+ #: includes/admin/tools.php:83
1122
  msgid "Reset Daily Popular Posts Network-wide"
1123
  msgstr ""
1124
 
1125
+ #: includes/admin/tools.php:83
1126
  msgid "Are you sure you want to reset the daily popular posts?"
1127
  msgstr ""
1128
 
1129
+ #: includes/admin/tools.php:86
1130
  msgid ""
1131
  "This will reset the Top 10 tables. If you are running Top 10 on multisite "
1132
  "then it will delete the popular posts across the entire network. This cannot "
1134
  "proceeding"
1135
  msgstr ""
1136
 
1137
+ #: includes/admin/tools.php:89
1138
  msgid "Other tools"
1139
  msgstr ""
1140
 
1141
+ #: includes/admin/tools.php:91
1142
+ msgid "Delete old settings"
1143
+ msgstr ""
1144
+
1145
+ #: includes/admin/tools.php:91
1146
+ msgid "This will delete the settings before v2.5.x. Proceed?"
1147
+ msgstr ""
1148
+
1149
+ #: includes/admin/tools.php:94
1150
+ msgid ""
1151
+ "From v2.5.x, Top 10 stores the settings in a new key in the database. This "
1152
+ "will delete the old settings for the current blog. It is recommended that "
1153
+ "you do this at the earliest after upgrade. However, you should do this only "
1154
+ "if you are comfortable with the new settings."
1155
+ msgstr ""
1156
+
1157
+ #: includes/admin/tools.php:98
1158
  msgid "Merge blog ID 0 and 1 post counts"
1159
  msgstr ""
1160
 
1161
+ #: includes/admin/tools.php:98
1162
  msgid "This will merge post counts for blog IDs 0 and 1. Proceed?"
1163
  msgstr ""
1164
 
1165
+ #: includes/admin/tools.php:101
1166
  msgid "This will merge post counts for posts with table entries of 0 and 1"
1167
  msgstr ""
1168
 
1169
+ #: includes/admin/tools.php:105
1170
  msgid "Merge duplicates across blog IDs"
1171
  msgstr ""
1172
 
1173
+ #: includes/admin/tools.php:105
1174
  msgid "This will delete the duplicate entries in the tables. Proceed?"
1175
  msgstr ""
1176
 
1177
+ #: includes/admin/tools.php:108
1178
  msgid ""
1179
  "In older versions, the plugin created entries with duplicate post IDs. "
1180
  "Clicking the button below will merge these duplicate IDs"
readme.txt CHANGED
@@ -165,6 +165,18 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
165
 
166
  == Changelog ==
167
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  = 2.5.3 =
169
 
170
  * Bug fixes:
@@ -247,7 +259,7 @@ For previous changelog entries, please refer to the separate changelog.txt file
247
 
248
  == Upgrade Notice ==
249
 
250
- = 2.5.3 =
251
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
252
  Check the Changelog for more details
253
 
165
 
166
  == Changelog ==
167
 
168
+ = 2.5.4 =
169
+
170
+ * Features:
171
+ * New button in the Tools page to delete the pre-2.5.x settings
172
+
173
+ * Enhancements:
174
+ * New function `tptn_trim_char` replaces `tptn_max_formatted_content` which should now support non-English characters as well
175
+ * Counts in the "Popular Posts" page are now number formatted
176
+
177
+ * Bug fixes:
178
+ * Fixed PHP Illegal string offset error
179
+
180
  = 2.5.3 =
181
 
182
  * Bug fixes:
259
 
260
  == Upgrade Notice ==
261
 
262
+ = 2.5.4 =
263
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
264
  Check the Changelog for more details
265
 
top-10.php CHANGED
@@ -14,7 +14,7 @@
14
  * Plugin Name: Top 10
15
  * Plugin URI: https://webberzone.com/plugins/top-10/
16
  * Description: Count daily and total visits per post and display the most popular posts based on the number of views
17
- * Version: 2.5.3
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
14
  * Plugin Name: Top 10
15
  * Plugin URI: https://webberzone.com/plugins/top-10/
16
  * Description: Count daily and total visits per post and display the most popular posts based on the number of views
17
+ * Version: 2.5.4
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+