diff --git a/core/helpers/class-stats.php b/core/helpers/class-stats.php index 70027f9..6bfd921 100644 --- a/core/helpers/class-stats.php +++ b/core/helpers/class-stats.php @@ -1070,6 +1070,7 @@ public static function get_most_helpful($limit = null, $post_type = null) $query = maybe_unserialize($query); $posts = []; + $results = []; if ($query->found_posts) { foreach ($query->posts as $post_id): @@ -1079,10 +1080,8 @@ public static function get_most_helpful($limit = null, $post_type = null) endforeach; if (1 < count($posts)) { - arsort($posts); - $results = []; $posts = array_slice($posts, 0, $limit, true); foreach ($posts as $post_id => $value): @@ -1164,6 +1163,7 @@ public static function get_least_helpful($limit = null, $post_type = null) $query = maybe_unserialize($query); $posts = []; + $results = []; if ($query->found_posts) { foreach ($query->posts as $post_id): @@ -1173,10 +1173,8 @@ public static function get_least_helpful($limit = null, $post_type = null) endforeach; if (1 < count($posts)) { - arsort($posts); - - $results = []; + $posts = array_slice($posts, 0, $limit, true); foreach ($posts as $post_id => $value): diff --git a/helpful.php b/helpful.php index 3781cae..bd344e5 100644 --- a/helpful.php +++ b/helpful.php @@ -2,7 +2,7 @@ /** * Plugin Name: Helpful * Description: Add a fancy feedback form under your posts or post-types and ask your visitors a question. Give them the abbility to vote with yes or no. - * Version: 4.4.65 + * Version: 4.4.66 * Author: Pixelbart * Author URI: https://pixelbart.de * Text Domain: helpful diff --git a/readme.txt b/readme.txt index 828c1e0..e54c974 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: helpful, poll, feedback, reviews, vote, review, voting Requires at least: 4.6 Tested up to: 5.8 Requires PHP: 5.6.20 -Stable tag: 4.4.65 +Stable tag: 4.4.66 License: MIT License License URI: https://opensource.org/licenses/MIT