kk Star Ratings - Version 5.3.4

Version Description

Download this release

Release Info

Developer bhittani
Plugin Icon 128x128 kk Star Ratings
Version 5.3.4
Comparing to
See all releases

Code changes from version 5.3.3 to 5.3.4

CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
 
 
 
 
 
 
 
8
  ## [5.3.3] - 2022-09-03
9
 
10
  ### Fixed
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
 
8
+ ## [5.3.4] - 2022-09-06
9
+
10
+ ### Fixed
11
+
12
+ - Unnecessary duplicate queries during post hydration has been fixed.
13
+
14
  ## [5.3.3] - 2022-09-03
15
 
16
  ### Fixed
index.php CHANGED
@@ -10,7 +10,7 @@
10
  * Author URI: http://bhittani.com
11
  * Text Domain: kk-star-ratings
12
  * Domain Path: /languages
13
- * Version: 5.3.3
14
  * License: GPLv2 or later
15
  */
16
 
10
  * Author URI: http://bhittani.com
11
  * Text Domain: kk-star-ratings
12
  * Domain Path: /languages
13
+ * Version: 5.3.4
14
  * License: GPLv2 or later
15
  */
16
 
languages/kk-star-ratings.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: kk Star Ratings 5.3.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/kk-star-ratings\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-10-03T10:49:51+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: kk-star-ratings\n"
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: kk Star Ratings 5.3.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/kk-star-ratings\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-10-06T15:02:10+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: kk-star-ratings\n"
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: star ratings, votings, rate posts, ajax ratings, infinite stars, unlimited
6
  Requires at least: 5.0
7
  Requires PHP: 7.2
8
  Tested up to: 6.0
9
- Stable tag: 5.3.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Requires at least: 5.0
7
  Requires PHP: 7.2
8
  Tested up to: 6.0
9
+ Stable tag: 5.3.4
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
src/core/wp/actions/the_post.php CHANGED
@@ -25,9 +25,13 @@ if (! defined('KK_STAR_RATINGS')) {
25
 
26
  function the_post(WP_Post $post, WP_Query $query = null): void
27
  {
 
 
28
  $id = $post->ID;
29
 
30
- if (metadata_exists('post', $id, meta_prefix('avg'))) {
 
 
31
  // v5
32
  // if (metadata_exists('post', $id, meta_prefix('count_default'))) {
33
  // $count = max((int) post_meta($id, 'count_default'), 0);
@@ -69,4 +73,6 @@ function the_post(WP_Post $post, WP_Query $query = null): void
69
  'ratings_default' => $ratings,
70
  ]);
71
  }
 
 
72
  }
25
 
26
  function the_post(WP_Post $post, WP_Query $query = null): void
27
  {
28
+ static $patched = [];
29
+
30
  $id = $post->ID;
31
 
32
+ if (! in_array($id, $patched)
33
+ && metadata_exists('post', $id, meta_prefix('avg'))
34
+ ) {
35
  // v5
36
  // if (metadata_exists('post', $id, meta_prefix('count_default'))) {
37
  // $count = max((int) post_meta($id, 'count_default'), 0);
73
  'ratings_default' => $ratings,
74
  ]);
75
  }
76
+
77
+ $patched[] = $id;
78
  }