Jetpack Top post widget (display post views)

Use this code in child theme or custom snipets plugin:

/**
 * Top Posts Widget: add post views below each post.
 */
function jetpackme_add_views_top_posts( $post_id ) {
if( function_exists( 'stats_get_csv' ) ) {
     $stats_query = "page_stats_for_" . $post_id;

     if ( false === ( $special_query_results = get_transient( $stats_query ) ) ) {
       $stat_options = "post_id=".$post_id."&days=-1";
       $post_stats = stats_get_csv( 'postviews', $stat_options );
       $special_query_results = $post_stats[0]["views"];
       set_transient( $stats_query, $special_query_results, 6 * HOUR_IN_SECONDS );
     }

     if (($special_query_results != null) && ($special_query_results > 10))
     {
       echo "<div class="top_posts_views">" . number_format($special_query_results) . " прочита</div>";
     }
}
}

add_action( 'jetpack_widget_top_posts_after_post', 'jetpackme_add_views_top_posts' );

based on ths article:
https://shkspr.mobi/blog/2016/04/displaying-wordpress-posts-jetpack-statistics-using-stats_get_csv/