Top 10 – Popular posts plugin for WordPress - Version 2.4.2

Version Description

  • Bug fixes:
    • The plugin will no longer generate any notices if post author is missing
    • Fixed T_FUNCTION error in admin area on blogs running on PHP versions before 5.3
    • Fixed bug where any special characters in the post title would break the output
Download this release

Release Info

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

Code changes from version 2.4.1 to 2.4.2

admin/class-stats.php CHANGED
@@ -553,6 +553,12 @@ class Top_Ten_Statistics {
553
  }
554
  }
555
 
556
- add_action( 'plugins_loaded', function () {
 
 
 
 
 
557
  Top_Ten_Statistics::get_instance();
558
- } );
 
553
  }
554
  }
555
 
556
+ /**
557
+ * Function to initialise stats page.
558
+ *
559
+ * @since 2.4.2
560
+ */
561
+ function tptn_stats_page() {
562
  Top_Ten_Statistics::get_instance();
563
+ }
564
+ add_action( 'plugins_loaded', 'tptn_stats_page' );
includes/public/media.php CHANGED
@@ -73,7 +73,7 @@ function tptn_get_the_post_thumbnail( $args = array() ) {
73
  $result = $args['postid'];
74
  }
75
 
76
- $post_title = $result->post_title;
77
 
78
  /**
79
  * Filters the title and alt message for thumbnails.
73
  $result = $args['postid'];
74
  }
75
 
76
+ $post_title = esc_attr( $result->post_title );
77
 
78
  /**
79
  * Filters the title and alt message for thumbnails.
includes/public/output-generator.php CHANGED
@@ -222,8 +222,8 @@ function tptn_post_title( $args, $result ) {
222
  function tptn_author( $args, $result ) {
223
 
224
  $author_info = get_userdata( $result->post_author );
225
- $author_link = get_author_posts_url( $author_info->ID );
226
- $author_name = ucwords( trim( stripslashes( $author_info->display_name ) ) );
227
 
228
  /**
229
  * Filter the author name.
@@ -235,7 +235,11 @@ function tptn_author( $args, $result ) {
235
  */
236
  $author_name = apply_filters( 'tptn_author_name', $author_name, $author_info );
237
 
238
- $tptn_author = '<span class="tptn_author"> ' . __( ' by ', 'top-10' ) . '<a href="' . $author_link . '">' . $author_name . '</a></span> ';
 
 
 
 
239
 
240
  /**
241
  * Filter the text with the author details.
222
  function tptn_author( $args, $result ) {
223
 
224
  $author_info = get_userdata( $result->post_author );
225
+ $author_link = ( false === $author_info ) ? '' : get_author_posts_url( $author_info->ID );
226
+ $author_name = ( false === $author_info ) ? '' : ucwords( trim( stripslashes( $author_info->display_name ) ) );
227
 
228
  /**
229
  * Filter the author name.
235
  */
236
  $author_name = apply_filters( 'tptn_author_name', $author_name, $author_info );
237
 
238
+ if ( ! empty( $author_name ) ) {
239
+ $tptn_author = '<span class="crp_author"> ' . __( ' by ', 'contextual-related-posts' ) . '<a href="' . $author_link . '">' . $author_name . '</a></span> ';
240
+ } else {
241
+ $tptn_author = '';
242
+ }
243
 
244
  /**
245
  * Filter the text with the author details.
readme.txt CHANGED
@@ -165,7 +165,15 @@ add_filter( 'manage_edit-projects_sortable_columns', 'tptn_column_register_sorta
165
 
166
  == Changelog ==
167
 
 
 
 
 
 
 
 
168
  = 2.4.1 =
 
169
  * Bug fixes:
170
  * Fixes fatal error caused on installs which have versions below PHP5.6
171
 
165
 
166
  == Changelog ==
167
 
168
+ = 2.4.2 =
169
+
170
+ * Bug fixes:
171
+ * The plugin will no longer generate any notices if post author is missing
172
+ * Fixed T_FUNCTION error in admin area on blogs running on PHP versions before 5.3
173
+ * Fixed bug where any special characters in the post title would break the output
174
+
175
  = 2.4.1 =
176
+
177
  * Bug fixes:
178
  * Fixes fatal error caused on installs which have versions below PHP5.6
179
 
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.4.1
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.4.2
18
  * Author: Ajay D'Souza
19
  * Author URI: https://webberzone.com
20
  * License: GPL-2.0+