Академический Документы
Профессиональный Документы
Культура Документы
Contributors: GamerZ
Donate link: http://lesterchan.net/site/donation/
Tags: ratings, rating, postratings, postrating, vote, digg, ajax, post
Requires at least: 2.8
Tested up to: 4.5
Stable tag: 1.83.2
Adds an AJAX rating system for your WordPress blog's post/page.
== Description ==
= Build Status =
[![Build Status](https://travis-ci.org/lesterchan/wp-postratings.svg?branch=mast
er)](https://travis-ci.org/lesterchan/wp-postratings)
= Development =
[https://github.com/lesterchan/wp-postratings](https://github.com/lesterchan/wppostratings "https://github.com/lesterchan/wp-postratings")
= Translations =
[http://dev.wp-plugins.org/browser/wp-postratings/i18n/](http://dev.wp-plugins.o
rg/browser/wp-postratings/i18n/ "http://dev.wp-plugins.org/browser/wp-postrating
s/i18n/")
= Credits =
* Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.fl
aticon.com)
* Icons courtesy of [FamFamFam](http://www.famfamfam.com/ "FamFamFam") and [Ever
aldo](http://www.everaldo.com "Everaldo")
= Donations =
I spent most of my free time creating, updating, maintaining and supporting thes
e plugins, if you really love my plugins and could spare me a couple of bucks, I
will really appreciate it. If not feel free to use it without any obligations.
== Changelog ==
= Version 1.83.2 =
* FIXED: Unauthenticated blind SQL injection in ratings_most_orderby(). Props @B
en Bidner from Automattic.
= Version 1.83.1 =
* FIXED: Remove No Results template from the_ratings_results()
= Version 1.83 =
* NEW: Added 'wp_postratings_display_comment_author_ratings' filter
* FIXED: Removing Loading ... because SERP will index the text if the ratings is
at the top of the article
* FIXED: Move wp_postratings_image_extension filter to init()
* FIXED: Show headline, datePublished and image despite there is no ratings
* FIXED: Show post without ratings as well when sorting is done in URL. Props @t
alljosh.
=
*
*
*
*
Version 1.82 =
NEW: Added 'wp_postratings_image_extension' filter
FIXED: Added headline, datePublished, image to Article Schema type
FIXED: Deprecated PHP4 constructor in WordPress 4.3
FIXED: Remove schema code when Rich Snippets is off
= Version 1.81 =
Version 1.78 =
NEW: Uses Dash Icons
NEW: Option to turn off Google Rich Snippets
FIXED: Use SITECOOKIEPATH instead of COOKIEPATH. Props jbrule.
FIXED: If global $id is 0, use get_the_ID(). Props instruite.
FIXED: use esc_attr() and esc_js() to escape characters
= Version 1.77 =
* NEW: Add in %POST_ID% template variables
* FIXED: Ensure Google Rich Snippet only displays in main loop and not in the wi
dget
* FIXED: Removed reviewCount from Google Rich Snippet
* FIXED: Make the ratings widget more optimized
* FIXED: Some widget templates are using postratings_template_mostrated instead
of postratings_template_highestrated
= Version 1.76 =
* FIXED: No longer needing add_post_meta() if update_post_meta() fails
* FIXED: Update 'Individual Rating Text/Value' Display no working due to missing
nonce
* FIXED: Added stripslashes() to remove slashes in the templates
* FIXED: Check whether it is an array to prevent array_key_exists() from throwin
g a warning.
= Version 1.75 =
* Change htmlspecialchars to esc_attr(). Props Ryan Satterfield.
* Change esc_attr() to wp_kses() For itemprop. Props oneTarek.
= Version 1.74 =
* check_rated_username() should be using $user_ID. Props Artem Gordinsky.
= Version 1.73 =
* Add Stars Flat (PNG) Icons. Props hebaf.
* Change Schema From http://schema.org/Product To http://schema.org/Article
= Version 1.72 (11-07-2013) =
* Fixed not logging ratings
* Fixed sorting of ratings logs
= Version 1.71 (10-07-2013) =
* Fixed "unable to delete logs/data"
= Version 1.70 (01-07-2013) =
*
*
*
*
=
*
*
*
*
*
*
*
*
* FIXED: Highest Rated Post Is Now Based On The Ratings Followed By The Number O
f Votes
* FIXED: Added Some Default Styles To postratings-css.css To Ensure That WP-Post
Ratings Does Not Break
= Version 1.04 (01-10-2006) =
* NEW: Ability To Logged By UserName
* NEW: get_highest_rated_sidebar(); To Display The Highest Rated Post On The Sid
ebar
* NEW: Added CSS Class 'post-ratings-image' To All IMG Tags
* FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-PostRatings Will Not
Work
=
*
*
*
*
=
*
*
*
= Usage =
1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`
2. You may place it in archive.php, single.php, post.php or page.php also.
3. Find: `<?php while (have_posts()) : the_post(); ?>`
4. Add Anywhere Below It (The Place You Want The Ratings To Show): `<?php if(fun
ction_exists('the_ratings')) { the_ratings(); } ?>`
* If you DO NOT want the ratings to appear in every post/page, DO NOT use the co
de above. Just type in `[ratings]` into the selected post/page content and it wi
ll embed ratings into that post/page only.
* If you want to embed other post ratings use `[ratings id="1"]`, where 1 is the
ID of the post/page ratings that you want to display.
* If you want to embed other post ratings results, use `[ratings id="1" results=
"true"]`, where 1 is the ID of the post/page ratings results that you want to di
splay.
== Upgrading ==
1. Deactivate `WP-PostRatings` Plugin
2. Open `wp-content/plugins` Folder
3. Put/Overwrite: `Folder: wp-postratings`
4. Activate `WP-PostRatings` Plugin
5. Go to `WP-Admin -> Ratings -> Ratings Templates` and restore all the template
variables to `Default`
6. Go to `WP-Admin -> Appearance -> Widgets` and re-add the Ratings Widget
== Upgrade Notice ==
N/A
== Screenshots ==
1.
2.
3.
4.
5.
6.
Ratings
Ratings
Ratings
Ratings
Log Bottom
Log Top
Options
Templates
Hover
return 'png';
}
add_filter( 'wp_postratings_image_extension', 'custom_rating_image_extension' );
</code>
= How Does WP-PostRatings Load CSS? =
* WP-PostRatings will load `postratings-css.css` from your theme's directory if
it exists.
* If it doesn't exists, it will just load the default 'postratings-css.css' that
comes with WP-PostRatings.
* This will allow you to upgrade WP-PostRatings without worrying about overwriti
ng your ratings styles that you have created.
= How To Use Ratings Stats With Widgets? =
1. Go to `WP-Admin -> Appearance -> Widgets`
2. The widget name is Ratings.
= How To Use Ratings Stats Outside WP Loop? =
= To Display Lowest Rated Post =
* Use:
<code>
<?php if (function_exists('get_lowest_rated')): ?>
<ul>
<?php get_lowest_rated(); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_lowest_rated('both', 0, 10)
* The value 'both' will display both the lowest rated posts and pages.
* If you want to display the lowest rated posts only, replace 'both' with 'post'
.
* If you want to display the lowest rated pages only, replace 'both' with 'page'
.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 lowest rated posts/pages.
= To Display Lowest Rated Post By Tag =
* Use:
<code>
<?php if (function_exists('get_lowest_rated_tag')): ?>
<ul>
<?php get_lowest_rated_tag(TAG_ID); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_lowest_rated_tag(TAG_ID, 'both', 0, 10)
* Replace TAG_ID will your tag ID. If you want it to span several categories, re
place TAG_ID with array(1, 2) where 1 and 2 are your categories ID.
* The value 'both' will display both the lowest rated posts and pages.
* If you want to display the lowest rated posts only, replace 'both' with 'post'
.
* If you want to display the lowest rated pages only, replace 'both' with 'page'
.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 lowest rated posts/pages.
= To Display Lowest Rated Post In A Category =
* Use:
<code>
<ul>
<?php get_highest_rated_category(CATEGORY_ID); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_highest_rated_category(CATEGORY_ID, 'both', 0, 10)
* Replace CATEGORY_ID will your category ID. If you want it to span several cate
gories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories I
D.
* The value 'both' will display both the highest rated posts and pages.
* If you want to display the highest rated posts only, replace 'both' with 'post
'.
* If you want to display the highest rated pages only, replace 'both' with 'page
'.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 highest rated posts/pages.
= To Display Highest Rated Post Within A Given Period =
* Use:
<code>
<?php if (function_exists('get_highest_rated_range')): ?>
<ul>
<?php get_highest_rated_range('1 day'); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_highest_rated_range('1 day', 'both', 10)
* The value '1 day' will be the range that you want. You can use '2 days', '1 mo
nth', etc.
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 10 will display only the top 10 most rated posts/pages.
= To Display Most Rated Post =
* Use:
<code>
<?php if (function_exists('get_most_rated')): ?>
<ul>
<?php get_most_rated(); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_most_rated('both', 0, 10)
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 most rated posts/pages.
= To Display Most Rated Post In A Category =
* Use:
<code>
<?php if (function_exists('get_most_rated_category')): ?>
<ul>
<?php get_most_rated_category(CATEGORY_ID); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_most_rated_category(CATEGORY_ID, 'both', 0, 10)
* Replace CATEGORY_ID will your category ID. If you want it to span several cate
gories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories I
D.
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 most rated posts/pages.
= To Display Most Rated Post Within A Given Period =
* Use:
<code>
<?php if (function_exists('get_most_rated_range')): ?>
<ul>
<?php get_most_rated_range('1 day'); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_most_rated_range('1 day', 'both', 10)
* The value '1 day' will be the range that you want. You can use '2 days', '1 mo
nth', etc.
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 10 will display only the top 10 most rated posts/pages.
= To Display Highest Score Post =
* Use:
<code>
<?php if (function_exists('get_highest_score')): ?>
<ul>
<?php get_highest_score(); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_highest_score('both', 0, 10)
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 most rated posts/pages.
= To Display Highest Score Post In A Category =
* Use:
<code>
<?php if (function_exists('get_highest_score_category')): ?>
<ul>
<?php get_highest_score_category(CATEGORY_ID); ?>
</ul>
<?php endif; ?>
</code>
* Default: get_highest_score_category(CATEGORY_ID, 'both', 0, 10)
* Replace CATEGORY_ID will your category ID. If you want it to span several cate
gories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories I
D.
* The value 'both' will display both the most rated posts and pages.
* If you want to display the most rated posts only, replace 'both' with 'post'.
* If you want to display the most rated pages only, replace 'both' with 'page'.
* The value 0 refers to the minimum votes required before the post get shown.
* The value 10 will display only the top 10 most rated posts/pages.