Top 10 – Popular posts plugin for WordPress - Version 2.5.1

Version Description

  • Bug fixes:
    • Custom CSS did not get upgraded or saved properly
    • Uninstalling the plugin will delete the settings properly
    • Old settings will not be deleted but retained in the database
Download this release

Release Info

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

Code changes from version 2.5.0 to 2.5.1

includes/admin/register-settings.php CHANGED
@@ -711,12 +711,12 @@ function tptn_get_registered_settings() {
711
  'default' => 'no_style',
712
  'options' => tptn_get_styles(),
713
  ),
714
- 'custom_CSS' => array(
715
- 'id' => 'custom_CSS',
716
  'name' => esc_html__( 'Custom CSS', 'top-10' ),
717
  /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
718
  '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>' ),
719
- 'type' => 'textarea',
720
  'options' => '',
721
  ),
722
  )
@@ -959,7 +959,8 @@ function tptn_upgrade_settings() {
959
  // Convert 'blank_output' to the new format: true = 'blank' and false = 'custom_text'.
960
  $settings['blank_output'] = ! empty( $old_settings['blank_output'] ) ? 'blank' : 'custom_text';
961
 
962
- delete_option( 'ald_tptn_settings' );
 
963
  return $settings;
964
 
965
  }
711
  'default' => 'no_style',
712
  'options' => tptn_get_styles(),
713
  ),
714
+ 'custom_css' => array(
715
+ 'id' => 'custom_css',
716
  'name' => esc_html__( 'Custom CSS', 'top-10' ),
717
  /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
718
  '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>' ),
719
+ 'type' => 'css',
720
  'options' => '',
721
  ),
722
  )
959
  // Convert 'blank_output' to the new format: true = 'blank' and false = 'custom_text'.
960
  $settings['blank_output'] = ! empty( $old_settings['blank_output'] ) ? 'blank' : 'custom_text';
961
 
962
+ $settings['custom_css'] = $old_settings['custom_CSS'];
963
+
964
  return $settings;
965
 
966
  }
includes/admin/settings-page.php CHANGED
@@ -276,6 +276,20 @@ function tptn_textarea_callback( $args ) {
276
  }
277
 
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  /**
280
  * Display checboxes.
281
  *
276
  }
277
 
278
 
279
+ /**
280
+ * Display CSS fields.
281
+ *
282
+ * @since 2.5.1
283
+ *
284
+ * @param array $args Array of arguments.
285
+ * @return void
286
+ */
287
+ function tptn_css_callback( $args ) {
288
+
289
+ tptn_textarea_callback( $args );
290
+ }
291
+
292
+
293
  /**
294
  * Display checboxes.
295
  *
includes/deprecated.php CHANGED
@@ -260,7 +260,7 @@ function tptn_default_options() {
260
  'thumb_default_show' => true, // Show default thumb if none found (if false, don't show thumb at all).
261
 
262
  /* Custom styles */
263
- 'custom_CSS' => '', // Custom CSS to style the output.
264
  'include_default_style' => false, // Include default Top 10 style.
265
  'tptn_styles' => 'no_style', // Defaault style is left thubnails.
266
 
260
  'thumb_default_show' => true, // Show default thumb if none found (if false, don't show thumb at all).
261
 
262
  /* Custom styles */
263
+ 'custom_css' => '', // Custom CSS to style the output.
264
  'include_default_style' => false, // Include default Top 10 style.
265
  'tptn_styles' => 'no_style', // Defaault style is left thubnails.
266
 
includes/public/styles.php CHANGED
@@ -12,11 +12,11 @@
12
  */
13
  function tptn_header() {
14
 
15
- $tptn_custom_CSS = stripslashes( tptn_get_option( 'custom_CSS' ) );
16
 
17
  // Add CSS to header.
18
- if ( '' != $tptn_custom_CSS ) {
19
- echo '<style type="text/css">' . $tptn_custom_CSS . '</style>';
20
  }
21
  }
22
  add_action( 'wp_head', 'tptn_header' );
12
  */
13
  function tptn_header() {
14
 
15
+ $tptn_custom_css = stripslashes( tptn_get_option( 'custom_css' ) );
16
 
17
  // Add CSS to header.
18
+ if ( '' != $tptn_custom_css ) {
19
+ echo '<style type="text/css">' . $tptn_custom_css . '</style>';
20
  }
21
  }
22
  add_action( 'wp_head', 'tptn_header' );
readme.txt CHANGED
@@ -165,6 +165,13 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
165
 
166
  == Changelog ==
167
 
 
 
 
 
 
 
 
168
  = 2.5.0 =
169
 
170
  * Features:
@@ -231,7 +238,7 @@ For previous changelog entries, please refer to the separate changelog.txt file
231
 
232
  == Upgrade Notice ==
233
 
234
- = 2.5.0 =
235
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
236
  Check the Changelog for more details
237
 
165
 
166
  == Changelog ==
167
 
168
+ = 2.5.1 =
169
+
170
+ * Bug fixes:
171
+ * Custom CSS did not get upgraded or saved properly
172
+ * Uninstalling the plugin will delete the settings properly
173
+ * Old settings will not be deleted but retained in the database
174
+
175
  = 2.5.0 =
176
 
177
  * Features:
238
 
239
  == Upgrade Notice ==
240
 
241
+ = 2.5.1 =
242
  * Major release! Brand new settings interface so please do verify your settings after the upgrade. Several new features and bug fixes.
243
  Check the Changelog for more details
244
 
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.0
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
14
  * Plugin Name: Top 10
15
  * Plugin URI: https://webberzone.com/plugins/top-10/
16
  * Description: Count daily and total visits per post and display the most popular posts based on the number of views
17
+ * Version: 2.5.1
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+
uninstall.php CHANGED
@@ -16,7 +16,7 @@ if ( ! defined( 'WPINC' ) ) {
16
 
17
  global $wpdb;
18
 
19
- $tptn_settings = get_option( 'ald_tptn_settings' );
20
 
21
  if ( $tptn_settings['uninstall_clean_tables'] ) {
22
 
@@ -35,5 +35,6 @@ if ( $tptn_settings['uninstall_clean_options'] ) {
35
  wp_clear_scheduled_hook( 'tptn_cron_hook' );
36
  }
37
  delete_option( 'ald_tptn_settings' );
 
38
  }
39
 
16
 
17
  global $wpdb;
18
 
19
+ $tptn_settings = get_option( 'tptn_settings' );
20
 
21
  if ( $tptn_settings['uninstall_clean_tables'] ) {
22
 
35
  wp_clear_scheduled_hook( 'tptn_cron_hook' );
36
  }
37
  delete_option( 'ald_tptn_settings' );
38
+ delete_option( 'tptn_settings' );
39
  }
40