Version Description
- Fix legend string calculation (Github PR #68 and #72)
- Fix Github star widget
- Add patreon link
Download this release
Release Info
Developer | bhittani |
Plugin | kk Star Ratings |
Version | 2.6.4 |
Comparing to | |
See all releases |
Code changes from version 2.6.3 to 2.6.4
- admin.php +14 -3
- index.php +12 -4
- readme.txt +8 -3
admin.php
CHANGED
@@ -1,10 +1,15 @@
|
|
1 |
<div class="bhittani-framework">
|
2 |
<?php if(isset($sidebar)) : ?>
|
3 |
<div class="bf-wrap-small _right">
|
4 |
-
<!--
|
5 |
-
<a
|
|
|
|
|
|
|
|
|
6 |
kk Star Ratings
|
7 |
</a>
|
|
|
8 |
<br><br>
|
9 |
<!-- Place this tag right after the last button or just before your close body tag. -->
|
10 |
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
|
@@ -161,13 +166,19 @@
|
|
161 |
<code>[total]</code>=total ratings <br />
|
162 |
<code>[avg]</code>=average <br />
|
163 |
<code>[per]</code>=percentage <br />
|
164 |
-
<code>[
|
165 |
<strong>NOTE</strong> <br />
|
166 |
<code>[total]</code> and <code>[avg]</code> is mandatory for Google Rich Snippets to work
|
167 |
',
|
168 |
'field' => 'kksr_legend',
|
169 |
'value' => get_option('kksr_legend')
|
170 |
));
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
BhittaniPlugin_AdminMarkup::select(array(
|
172 |
'title' => 'Position',
|
173 |
'description' => 'Choose the position of the ratings',
|
1 |
<div class="bhittani-framework">
|
2 |
<?php if(isset($sidebar)) : ?>
|
3 |
<div class="bf-wrap-small _right">
|
4 |
+
<!-- Patreon button -->
|
5 |
+
<a href="https://www.patreon.com/bePatron?u=19773871" data-patreon-widget-type="become-patron-button">Become a Patron!</a>
|
6 |
+
<script async src="https://c6.patreon.com/becomePatronButton.bundle.js"></script>
|
7 |
+
<br><br>
|
8 |
+
<!-- Github star -->
|
9 |
+
<a class="github-button" href="https://github.com/kamalkhan/kk-star-ratings" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star kamalkhan/kk-star-ratings on GitHub">
|
10 |
kk Star Ratings
|
11 |
</a>
|
12 |
+
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
13 |
<br><br>
|
14 |
<!-- Place this tag right after the last button or just before your close body tag. -->
|
15 |
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
|
166 |
<code>[total]</code>=total ratings <br />
|
167 |
<code>[avg]</code>=average <br />
|
168 |
<code>[per]</code>=percentage <br />
|
169 |
+
<code>[suffix]</code>=for plural vs singular of votes occurred <br />
|
170 |
<strong>NOTE</strong> <br />
|
171 |
<code>[total]</code> and <code>[avg]</code> is mandatory for Google Rich Snippets to work
|
172 |
',
|
173 |
'field' => 'kksr_legend',
|
174 |
'value' => get_option('kksr_legend')
|
175 |
));
|
176 |
+
BhittaniPlugin_AdminMarkup::input(array(
|
177 |
+
'title' => 'Plural Suffix for number of Votes',
|
178 |
+
'description' => 'Adjust the Suffix for <code>[suffix]</code> placeholder. (e.G. "15 votes" [English] or "15 Bewertungen" [German].)',
|
179 |
+
'field' => 'kksr_suffix_votes',
|
180 |
+
'value' => get_option('kksr_suffix_votes')
|
181 |
+
));
|
182 |
BhittaniPlugin_AdminMarkup::select(array(
|
183 |
'title' => 'Position',
|
184 |
'description' => 'Choose the position of the ratings',
|
index.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: kk Star Ratings
|
5 |
Plugin URI: https://github.com/kamalkhan/kk-star-ratings
|
6 |
Description: Renewed from the ground up(as of v2.0), clean, animated and light weight ratings feature for your blog. With kk Star Ratings, you can <strong>allow your blog posts to be rated by your blog visitors</strong>. It also includes a <strong>widget</strong> which you can add to your sidebar to show the top rated post. Wait! There is more to it. Enjoy the extensive options you can set to customize this plugin.
|
7 |
-
Version: 2.6.
|
8 |
Author: Kamal Khan
|
9 |
Author URI: http://bhittani.com
|
10 |
License: GPLv2 or later
|
@@ -63,6 +63,7 @@ if(!class_exists('BhittaniPlugin_kkStarRatings')) :
|
|
63 |
$Params['ajaxurl'] = admin_url('admin-ajax.php');
|
64 |
$Params['func'] = 'kksr_ajax';
|
65 |
$Params['msg'] = parent::get_options('kksr_init_msg');
|
|
|
66 |
$Params['fuelspeed'] = (int) parent::get_options('kksr_js_fuelspeed');
|
67 |
$Params['thankyou'] = parent::get_options('kksr_js_thankyou');
|
68 |
$Params['error_msg'] = parent::get_options('kksr_js_error');
|
@@ -151,7 +152,8 @@ if(!class_exists('BhittaniPlugin_kkStarRatings')) :
|
|
151 |
$opt_show_in_pages = 0; // 1|0
|
152 |
$opt_unique = 0; // 1|0
|
153 |
$opt_position = 'top-left'; // 'top-left', 'top-right', 'bottom-left', 'bottom-right'
|
154 |
-
|
|
|
155 |
$opt_init_msg = 'Rate this post'; // string
|
156 |
$opt_column = 1; // 1|0
|
157 |
|
@@ -164,6 +166,7 @@ if(!class_exists('BhittaniPlugin_kkStarRatings')) :
|
|
164 |
$Options['kksr_show_in_pages'] = isset($Old_plugin['show_in_pages']) ? $Old_plugin['show_in_pages'] : $opt_show_in_pages;
|
165 |
$Options['kksr_unique'] = isset($Old_plugin['unique']) ? $Old_plugin['unique'] : $opt_unique;
|
166 |
$Options['kksr_position'] = isset($Old_plugin['position']) ? $Old_plugin['position'] : $opt_position;
|
|
|
167 |
$Options['kksr_legend'] = isset($Old_plugin['legend']) ? $Old_plugin['legend'] : $opt_legend;
|
168 |
$Options['kksr_init_msg'] = isset($Old_plugin['init_msg']) ? $Old_plugin['init_msg'] : $opt_init_msg;
|
169 |
$Options['kksr_column'] = isset($Old_plugin['column']) ? $Old_plugin['column'] : $opt_column;
|
@@ -697,10 +700,12 @@ if(!class_exists('BhittaniPlugin_kkStarRatings')) :
|
|
697 |
return parent::get_options('kksr_init_msg');
|
698 |
}
|
699 |
|
|
|
|
|
700 |
$leg = str_replace('[total]', '<span itemprop="ratingCount">'.$votes.'</span>', $legend);
|
701 |
$leg = str_replace('[avg]', '<span itemprop="ratingValue">'.$avg.'</span>', $leg);
|
702 |
$leg = str_replace('[per]', $per .'%', $leg);
|
703 |
-
$leg = str_replace('[
|
704 |
$leg = str_replace('[best]', $best, $leg);
|
705 |
|
706 |
return $leg;
|
@@ -728,11 +733,14 @@ if(!class_exists('BhittaniPlugin_kkStarRatings')) :
|
|
728 |
}
|
729 |
}
|
730 |
|
731 |
-
$kkStarRatings_obj = new BhittaniPlugin_kkStarRatings('bhittani_plugin_kksr', 'kk Star Ratings', '2.6.
|
732 |
|
733 |
// Setup
|
734 |
register_activation_hook(__FILE__, array($kkStarRatings_obj, 'activate'));
|
735 |
|
|
|
|
|
|
|
736 |
// Scripts
|
737 |
add_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'js'));
|
738 |
add_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'css'));
|
4 |
Plugin Name: kk Star Ratings
|
5 |
Plugin URI: https://github.com/kamalkhan/kk-star-ratings
|
6 |
Description: Renewed from the ground up(as of v2.0), clean, animated and light weight ratings feature for your blog. With kk Star Ratings, you can <strong>allow your blog posts to be rated by your blog visitors</strong>. It also includes a <strong>widget</strong> which you can add to your sidebar to show the top rated post. Wait! There is more to it. Enjoy the extensive options you can set to customize this plugin.
|
7 |
+
Version: 2.6.4
|
8 |
Author: Kamal Khan
|
9 |
Author URI: http://bhittani.com
|
10 |
License: GPLv2 or later
|
63 |
$Params['ajaxurl'] = admin_url('admin-ajax.php');
|
64 |
$Params['func'] = 'kksr_ajax';
|
65 |
$Params['msg'] = parent::get_options('kksr_init_msg');
|
66 |
+
$Params['suffix_votes'] = parent::get_options('kksr_suffix_votes');
|
67 |
$Params['fuelspeed'] = (int) parent::get_options('kksr_js_fuelspeed');
|
68 |
$Params['thankyou'] = parent::get_options('kksr_js_thankyou');
|
69 |
$Params['error_msg'] = parent::get_options('kksr_js_error');
|
152 |
$opt_show_in_pages = 0; // 1|0
|
153 |
$opt_unique = 0; // 1|0
|
154 |
$opt_position = 'top-left'; // 'top-left', 'top-right', 'bottom-left', 'bottom-right'
|
155 |
+
$kksr_sufix_votes = 's'; // 's' in english for voteS
|
156 |
+
$opt_legend = '[avg] ([per]) [total] vote[suffix]'; // [total]=total ratings, [avg]=average, [per]=percentage [suffix]=singular/plural
|
157 |
$opt_init_msg = 'Rate this post'; // string
|
158 |
$opt_column = 1; // 1|0
|
159 |
|
166 |
$Options['kksr_show_in_pages'] = isset($Old_plugin['show_in_pages']) ? $Old_plugin['show_in_pages'] : $opt_show_in_pages;
|
167 |
$Options['kksr_unique'] = isset($Old_plugin['unique']) ? $Old_plugin['unique'] : $opt_unique;
|
168 |
$Options['kksr_position'] = isset($Old_plugin['position']) ? $Old_plugin['position'] : $opt_position;
|
169 |
+
$Options['kksr_suffix_votes'] = isset($Old_plugin['kksr_suffix_votes']) ? $Old_plugin['kksr_suffix_votes'] : $kksr_sufix_votes;
|
170 |
$Options['kksr_legend'] = isset($Old_plugin['legend']) ? $Old_plugin['legend'] : $opt_legend;
|
171 |
$Options['kksr_init_msg'] = isset($Old_plugin['init_msg']) ? $Old_plugin['init_msg'] : $opt_init_msg;
|
172 |
$Options['kksr_column'] = isset($Old_plugin['column']) ? $Old_plugin['column'] : $opt_column;
|
700 |
return parent::get_options('kksr_init_msg');
|
701 |
}
|
702 |
|
703 |
+
$pluralSuffix = parent::get_options('kksr_suffix_votes');
|
704 |
+
|
705 |
$leg = str_replace('[total]', '<span itemprop="ratingCount">'.$votes.'</span>', $legend);
|
706 |
$leg = str_replace('[avg]', '<span itemprop="ratingValue">'.$avg.'</span>', $leg);
|
707 |
$leg = str_replace('[per]', $per .'%', $leg);
|
708 |
+
$leg = str_replace('[suffix]', $votes == 1 ? '' : $pluralSuffix, $leg);
|
709 |
$leg = str_replace('[best]', $best, $leg);
|
710 |
|
711 |
return $leg;
|
733 |
}
|
734 |
}
|
735 |
|
736 |
+
$kkStarRatings_obj = new BhittaniPlugin_kkStarRatings('bhittani_plugin_kksr', 'kk Star Ratings', '2.6.4');
|
737 |
|
738 |
// Setup
|
739 |
register_activation_hook(__FILE__, array($kkStarRatings_obj, 'activate'));
|
740 |
|
741 |
+
//Uninstall
|
742 |
+
// TODO: include 'register_uninstall_hook() '
|
743 |
+
|
744 |
// Scripts
|
745 |
add_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'js'));
|
746 |
add_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'css'));
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== kk Star Ratings ===
|
2 |
Contributors: bhittani
|
3 |
-
Donate link: https://
|
4 |
Tags: star ratings, votings, rate posts, ajax ratings, infinite stars, unlimited stars, google rich snippets
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.2.4
|
7 |
-
Tested up to: 5.1
|
8 |
-
Stable tag: 2.6.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -125,6 +125,11 @@ Visit the help tab in the settings to find out what you can do.
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
|
|
128 |
= 2.6.3 =
|
129 |
* Fix previous commit 2.6.2
|
130 |
|
1 |
=== kk Star Ratings ===
|
2 |
Contributors: bhittani
|
3 |
+
Donate link: https://www.patreon.com/bePatron?u=19773871
|
4 |
Tags: star ratings, votings, rate posts, ajax ratings, infinite stars, unlimited stars, google rich snippets
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.2.4
|
7 |
+
Tested up to: 5.1.1
|
8 |
+
Stable tag: 2.6.4
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 2.6.4 =
|
129 |
+
* Fix legend string calculation (Github PR #68 and #72)
|
130 |
+
* Fix Github star widget
|
131 |
+
* Add patreon link
|
132 |
+
|
133 |
= 2.6.3 =
|
134 |
* Fix previous commit 2.6.2
|
135 |
|