Title: [Plugin: kk Star Ratings] Adding Microdata information
Last modified: August 20, 2016

---

# [Plugin: kk Star Ratings] Adding Microdata information

 *  Resolved [mishta](https://wordpress.org/support/users/mishta/)
 * (@mishta)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-kk-star-ratings-adding-microdata-information/)
 * I am trying to integrate into the code Microdata information.
    To do so I altered
   the original code of **kk-star-ratings/kk-ratings.php** by adding some info.
 *     ```
       public function markup($id=false)
       		{
       			$markup = '<div itemscope itemtype="http://data-vocabulary.org/Review-aggregate" class="kk-ratings open">
       						  <span>'.(!$id?get_the_ID():$id).'</span>
       						  <div class="stars-turned-on"> </div>
       						  <!--.stars-turned-on-->
       						  <div class="hover-panel">
       							  <a href="javascript:void();" rel="star-1"></a>
       							  <a href="javascript:void();" rel="star-2"></a>
       							  <a href="javascript:void();" rel="star-3"></a>
       							  <a href="javascript:void();" rel="star-4"></a>
       							  <a href="javascript:void();" rel="star-5"></a>
       						  </div>
       						  <!--.hover-panel-->
       						  <div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="casting-desc">'.$this->options['init_msg'].'</div>
       						  <div class="casting-thanks">Thanks!</div>
       						  <div class="casting-error">AAn error occurred!</div>
       						  <!--.casting-desc-->
       						</div>
       						<!--.kk-ratings-->';
       			$markup .= $this->options['clear']? '<br clear="both" />' : '';
   
       			return $markup;
       		}
       ```
   
 * The resulted code in html page is:
 *     ```
       <div itemscope="" itemtype="http://data-vocabulary.org/Review-aggregate" class="kk-ratings" style="float: left; opacity: 1; ">
       						  <span>33</span>
       						  <div class="stars-turned-on stars-turned-strict" style="display: block; width: 100%; "> </div>
       						  <!--.stars-turned-on-->
       						  <div class="hover-panel">
       							  <a href="javascript:void();" rel="star-1" style="display: block; " class=""></a>
       							  <a href="javascript:void();" rel="star-2" style="display: block; " class=""></a>
       							  <a href="javascript:void();" rel="star-3" style="display: block; " class=""></a>
       							  <a href="javascript:void();" rel="star-4" style="display: block; " class=""></a>
       							  <a href="javascript:void();" rel="star-5" class="" style="display: block; "></a>
       						  </div>
       						  <!--.hover-panel-->
       						  <div itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating" class="casting-desc" style="display: block; ">5/5 from 1 votes</div>
       						  <div class="casting-thanks" style="display: none; ">Thanks!</div>
       						  <div class="casting-error">An error occurred!</div>
       						  <!--.casting-desc-->
       						</div>
       ```
   
 * I need to add the rating markings. I do not know how to do that…
    I am sure this
   will lead to a new version of the plugin …. The code: `<div itemprop="rating"
   itemscope="" itemtype="http://data-vocabulary.org/Rating" class="casting-desc"
   style="display: block; ">5/5 from 1 votes</div>`
 * needs to be changed to …
 * `<div itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating"
   class="casting-desc" style="display: block; "><span itemprop="average">5</span
   >/<span itemprop="best">5</span> from <span itemprop="votes">1</span> votes</
   div>`
 * [http://wordpress.org/extend/plugins/kk-star-ratings/](http://wordpress.org/extend/plugins/kk-star-ratings/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Kamal Khan](https://wordpress.org/support/users/bhittani/)
 * (@bhittani)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-kk-star-ratings-adding-microdata-information/#post-2622152)
 * For your custom description (meta info) you can use jquery to handle this.
 * I don’t think this will be an appropriate option to have this in a new version.
 *  Thread Starter [mishta](https://wordpress.org/support/users/mishta/)
 * (@mishta)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-kk-star-ratings-adding-microdata-information/#post-2622166)
 * I do not know if you are aware of the tendencies, but if take a look at Google
   Webmaster Tools you will see that Google have a testing tool for testing this:
   [Rich Snippets Testing Tool](http://www.google.com/webmasters/tools/richsnippets).
   
   This means that Google encourages the use of this and I can reassure you that
   microdata is really working. All that I wrote above makes me believe that THIS
   HAS TO BE IN THE NEW VERSION!
 *  [melissaaggie98@gmail.com](https://wordpress.org/support/users/melissaaggie98gmailcom/)
 * (@melissaaggie98gmailcom)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-kk-star-ratings-adding-microdata-information/#post-2622209)
 * I completely agree! Please put this in the new version, for GD Star Ratings already
   has this feature and it definitely helps drive traffic to your site from Google
   searches.
 * GD Star Ratings is way too complicated though and doesn’t work as well as your
   plugin does. If you were able to add this feature in a new version, yours would
   be the best option out there.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: kk Star Ratings] Adding Microdata information’ is closed to 
new replies.

 * ![](https://ps.w.org/kk-star-ratings/assets/icon-256x256.jpg?rev=2140680)
 * [kk Star Ratings - Rate Post & Collect User Feedbacks](https://wordpress.org/plugins/kk-star-ratings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/kk-star-ratings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/kk-star-ratings/)
 * [Active Topics](https://wordpress.org/support/plugin/kk-star-ratings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/kk-star-ratings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/kk-star-ratings/reviews/)

## Tags

 * [itemprop](https://wordpress.org/support/topic-tag/itemprop/)
 * [microdata](https://wordpress.org/support/topic-tag/microdata/)
 * [rich snippets](https://wordpress.org/support/topic-tag/rich-snippets/)

 * 3 replies
 * 3 participants
 * Last reply from: [melissaaggie98@gmail.com](https://wordpress.org/support/users/melissaaggie98gmailcom/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-kk-star-ratings-adding-microdata-information/#post-2622209)
 * Status: resolved