{"id":387,"date":"2006-02-08T22:29:53","date_gmt":"2006-02-08T22:29:53","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-postratings\/"},"modified":"2026-08-10T02:46:06","modified_gmt":"2026-08-10T02:46:06","slug":"wp-postratings","status":"publish","type":"plugin","link":"https:\/\/vec.wordpress.org\/plugins\/wp-postratings\/","author":259,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.0","stable_tag":"2.0.0","tested":"7.0.3","requires":"6.8","requires_php":"8.2","requires_plugins":null,"header_name":"WP-PostRatings","header_author":"Lester 'GaMerZ' Chan","header_description":"","assets_banners_color":"0e1116","last_updated":"2026-08-10 02:46:06","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/lesterchan.net\/site\/donation\/","header_plugin_uri":"https:\/\/lesterchan.net\/portfolio\/programming\/php\/","header_author_uri":"https:\/\/lesterchan.net","rating":4.3,"author_block_rating":0,"active_installs":30000,"downloads":2279772,"num_ratings":179,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.00":{"tag":"1.00","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.00beta":{"tag":"1.00beta","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.01":{"tag":"1.01","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.02":{"tag":"1.02","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.02a":{"tag":"1.02a","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.03":{"tag":"1.03","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.03(wp1.52)":{"tag":"1.03(wp1.52)","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.04":{"tag":"1.04","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.05":{"tag":"1.05","author":"GamerZ","date":"2007-03-17 07:18:59"},"1.10":{"tag":"1.10","author":"GamerZ","date":"2007-04-08 03:30:51"},"1.11":{"tag":"1.11","author":"GamerZ","date":"2007-06-13 17:35:32"},"1.20":{"tag":"1.20","author":"GamerZ","date":"2007-09-30 08:20:00"},"1.30":{"tag":"1.30","author":"GamerZ","date":"2008-06-10 07:34:59"},"1.31":{"tag":"1.31","author":"GamerZ","date":"2008-07-20 09:44:11"},"1.40":{"tag":"1.40","author":"GamerZ","date":"2009-02-07 13:57:02"},"1.50":{"tag":"1.50","author":"GamerZ","date":"2011-02-17 09:02:08"},"1.65":{"tag":"1.65","author":"GamerZ","date":"2013-07-01 01:39:51"},"1.77":{"tag":"1.77","author":"GamerZ","date":"2014-02-21 00:54:02"},"1.78":{"tag":"1.78","author":"GamerZ","date":"2014-04-17 01:21:36"},"1.79":{"tag":"1.79","author":"GamerZ","date":"2014-09-05 13:30:57"},"1.80":{"tag":"1.80","author":"GamerZ","date":"2014-12-18 03:24:32"},"1.81":{"tag":"1.81","author":"GamerZ","date":"2015-04-21 14:24:49"},"1.82":{"tag":"1.82","author":"GamerZ","date":"2015-08-08 13:11:39"},"1.83":{"tag":"1.83","author":"GamerZ","date":"2015-11-26 02:25:48"},"1.83.1":{"tag":"1.83.1","author":"GamerZ","date":"2015-11-26 06:53:18"},"1.83.2":{"tag":"1.83.2","author":"GamerZ","date":"2016-04-19 04:51:49"},"1.84":{"tag":"1.84","author":"GamerZ","date":"2016-12-08 03:54:10"},"1.84.1":{"tag":"1.84.1","author":"GamerZ","date":"2017-05-09 12:26:28"},"1.85":{"tag":"1.85","author":"GamerZ","date":"2017-11-20 08:52:53"},"1.86":{"tag":"1.86","author":"GamerZ","date":"2018-12-19 05:10:03"},"1.86.1":{"tag":"1.86.1","author":"GamerZ","date":"2018-12-21 10:08:21"},"1.86.2":{"tag":"1.86.2","author":"GamerZ","date":"2018-12-26 10:13:19"},"1.87":{"tag":"1.87","author":"GamerZ","date":"2019-10-23 03:27:02"},"1.88":{"tag":"1.88","author":"GamerZ","date":"2020-05-20 01:45:30"},"1.89":{"tag":"1.89","author":"GamerZ","date":"2020-08-12 11:45:03"},"1.89.1":{"tag":"1.89.1","author":"GamerZ","date":"2022-02-05 06:22:19"},"1.90":{"tag":"1.90","author":"GamerZ","date":"2022-08-31 08:19:20"},"1.91":{"tag":"1.91","author":"GamerZ","date":"2023-07-03 12:49:40"},"1.91.1":{"tag":"1.91.1","author":"GamerZ","date":"2023-08-09 03:05:28"},"1.91.2":{"tag":"1.91.2","author":"GamerZ","date":"2024-07-16 13:07:04"},"1.91.3":{"tag":"1.91.3","author":"GamerZ","date":"2026-07-24 16:40:28"},"2.0.0":{"tag":"2.0.0","author":"GamerZ","date":"2026-08-10 02:46:06"}},"upgrade_notice":{"2.0.0":"<p>Requires WordPress 6.8 and PHP 8.2.<\/p>\n\n<p><strong>Settings migrate on the first admin page load.<\/strong> The fifteen <code>postratings_*<\/code> rows, plus the shared <code>stats_display<\/code> and <code>stats_mostlimit<\/code> rows, are folded into one <code>wp_postratings_options<\/code> row, and <code>postratings_db_version<\/code> and <code>postratings_options_version<\/code> become a single <code>wp_postratings_version<\/code>. Code reading the old rows directly will find them gone.<\/p>\n\n<p><strong>Update all seven WP-Stats plugins together.<\/strong> WP-Stats, WP-PostRatings, WP-Polls, WP-EMail, WP-PostViews, WP-DownloadManager and WP-DraftsForFriends shared two unprefixed rows, <code>stats_display<\/code> and <code>stats_mostlimit<\/code>. Each now keeps its own copy and deletes the shared rows once it has read them, so whichever you update first takes them from the rest. A missing row means &quot;show&quot;, so a block you had switched off may reappear \u2014 switch it off again under <strong>Ratings -&gt; Settings -&gt; WP-Stats<\/strong>, where the setting and the entries-per-list figure now live.<\/p>\n\n<p><strong>The settings screen is at Ratings -&gt; Settings<\/strong>, with Ratings Options and Ratings Templates as two tabs of it. <code>admin.php?page=wp-postratings-options<\/code> is now <code>admin.php?page=wp-postratings-settings<\/code>. The capability is still <code>manage_ratings<\/code>.<\/p>\n\n<p><strong>Two Google rich snippet settings became one, defaulting to No.<\/strong> &quot;Enable Google Rich Snippets?&quot; and &quot;Enable Ratings In Rich Snippets?&quot; are now <strong>Show ratings in Google results?<\/strong>. The old markup declared <code>schema.org\/Article<\/code>, and Google shows ratings only for Book, Course, Event, Local Business, Movie, Organization, Product, Recipe, Software App and a few subtypes \u2014 so on an ordinary post it never produced a rich result.<\/p>\n\n<p>If you filtered <code>wp_postratings_schema_itemtype<\/code> to a supported type, you <em>were<\/em> getting a real rich result, and it stops until you select that same type in the new setting. The filter still runs and still has the last word. Pick a type only if the content genuinely is that thing: marking a blog post as a <code>Product<\/code> to collect stars is spammy structured markup, and it costs a manual action.<\/p>\n\n<p><strong>Rating images are now CSS shapes.<\/strong> The 16 image sets are 9 shapes; whichever set you had is mapped to the matching shape automatically. A custom image folder falls back to stars \u2014 the FAQ shows how to register a shape instead, which survives updates.<\/p>\n\n<p><strong>Custom CSS needs updating.<\/strong> Every class and id is slug-prefixed now:<\/p>\n\n<ul>\n<li><code>.post-ratings<\/code> is now <code>.wp-postratings<\/code><\/li>\n<li><code>.post-ratings-image<\/code> is gone; there is no `` any more<\/li>\n<li>the wrapper id is <code>wp-postratings-123<\/code>, not <code>post-ratings-123<\/code><\/li>\n<li>the stylesheet is <code>css\/wp-postratings.css<\/code>, not <code>postratings-css.css<\/code>, and there is no <code>-rtl<\/code> variant<\/li>\n<\/ul>\n\n<p>Colour, size, spacing and hover colour are CSS custom properties, so most overrides become a one-line change. See the FAQ.<\/p>\n\n<p><strong>Renamed with no shim left behind:<\/strong><\/p>\n\n<ul>\n<li>the <code>rate_post<\/code> action is now <code>wp_postratings_rate_post<\/code>, with the same three arguments<\/li>\n<li><code>RATINGS_IMG_EXT<\/code> is now <code>WP_POSTRATINGS_IMG_EXT<\/code><\/li>\n<li>every class is <code>WP_PostRatings_*<\/code> rather than <code>Postratings_*<\/code><\/li>\n<\/ul>\n\n<p>The template tags \u2014 <code>the_ratings()<\/code>, <code>get_highest_rated()<\/code>, <code>get_most_rated()<\/code> and the rest \u2014 and the twenty-two <code>wp_postratings_*<\/code> filters are unchanged.<\/p>\n\n<p><strong>&quot;Header That Contains The IP&quot; now reads only the first valid address<\/strong> rather than storing the whole chain. Rating logs recorded through it before the update no longer match, so a few visitors may be able to rate once more. Clear the field unless you are behind a reverse proxy.<\/p>\n\n<p><strong>Custom JavaScript.<\/strong> The markup carries no inline <code>onmouseover<\/code> or <code>onclick<\/code> handlers and there is no jQuery. Code calling <code>current_rating()<\/code> or <code>rate_post()<\/code> in the browser must be rewritten against the delegated listener in <code>js\/wp-postratings.js<\/code>.<\/p>"},"ratings":{"1":19,"2":3,"3":9,"4":15,"5":133},"assets_icons":{"icon.svg":{"filename":"icon.svg","revision":978014,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3639532,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3639532,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":{"wp-postratings\/ratings":{"$schema":"https:\/\/schemas.wp.org\/trunk\/block.json","apiVersion":3,"name":"wp-postratings\/ratings","version":"2.0.0","title":"Ratings","category":"widgets","icon":"star-filled","description":"A rating control for a post, or its result on its own.","keywords":["rating","ratings","vote","stars"],"textdomain":"wp-postratings","attributes":{"id":{"type":"number","default":0},"results":{"type":"boolean","default":false}},"supports":{"html":false,"multiple":true,"reusable":false},"editorScript":"file:.\/index.js"}},"tagged_versions":["1.00","1.00beta","1.01","1.02","1.02a","1.03","1.03(wp1.52)","1.04","1.05","1.10","1.11","1.20","1.30","1.31","1.40","1.50","1.65","1.77","1.78","1.79","1.80","1.81","1.82","1.83","1.83.1","1.83.2","1.84","1.84.1","1.85","1.86","1.86.1","1.86.2","1.87","1.88","1.89","1.89.1","1.90","1.91","1.91.1","1.91.2","1.91.3","2.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3639889,"resolution":"1","location":"assets","locale":"","width":1100,"height":1930},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3639889,"resolution":"2","location":"assets","locale":"","width":1100,"height":1872},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3639889,"resolution":"3","location":"assets","locale":"","width":1100,"height":2512},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3639889,"resolution":"4","location":"assets","locale":"","width":1000,"height":372},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3639889,"resolution":"5","location":"assets","locale":"","width":1440,"height":620}},"screenshots":{"1":"Ratings -&gt; Settings: the shape, the scale, who may rate, and how a repeat is spotted","2":"The Templates tab, holding the markup of the control and of every result","3":"Ratings -&gt; Logs, every vote with who cast it, filterable by user and by rating","4":"The control in a post with a star under the pointer, and the same rating read-only below","5":"The Ratings block in the editor, previewing the control for the post it is pointed at, with the sidebar choosing that post and whether the rating can be cast or only read"}},"plugin_section":[],"plugin_tags":[221,86,2295,8203,9827],"plugin_category":[53,56,59],"plugin_contributors":[77620],"plugin_business_model":[],"class_list":["post-387","plugin","type-plugin","status-publish","hentry","plugin_tags-ajax","plugin_tags-post","plugin_tags-rating","plugin_tags-ratings","plugin_tags-vote","plugin_category-ratings-and-reviews","plugin_category-social-and-sharing","plugin_category-utilities-and-tools","plugin_contributors-gamerz","plugin_committers-gamerz"],"banners":{"banner":"https:\/\/ps.w.org\/wp-postratings\/assets\/banner-772x250.png?rev=3639532","banner_2x":"https:\/\/ps.w.org\/wp-postratings\/assets\/banner-1544x500.png?rev=3639532","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/wp-postratings\/assets\/icon.svg?rev=978014","icon":"https:\/\/ps.w.org\/wp-postratings\/assets\/icon.svg?rev=978014","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-postratings\/assets\/screenshot-1.png?rev=3639889","caption":"Ratings -&gt; Settings: the shape, the scale, who may rate, and how a repeat is spotted"},{"src":"https:\/\/ps.w.org\/wp-postratings\/assets\/screenshot-2.png?rev=3639889","caption":"The Templates tab, holding the markup of the control and of every result"},{"src":"https:\/\/ps.w.org\/wp-postratings\/assets\/screenshot-3.png?rev=3639889","caption":"Ratings -&gt; Logs, every vote with who cast it, filterable by user and by rating"},{"src":"https:\/\/ps.w.org\/wp-postratings\/assets\/screenshot-4.png?rev=3639889","caption":"The control in a post with a star under the pointer, and the same rating read-only below"},{"src":"https:\/\/ps.w.org\/wp-postratings\/assets\/screenshot-5.png?rev=3639889","caption":"The Ratings block in the editor, previewing the control for the post it is pointed at, with the sidebar choosing that post and whether the rating can be cast or only read"}],"raw_content":"<!--section=description-->\n<p>WP-PostRatings adds a rating control to any post, page or custom post type. Visitors pick a value, the vote is posted in the background, and the result appears in its place without a page load.<\/p>\n\n<h3>Features<\/h3>\n\n<ul>\n<li>Nine rating shapes, drawn with CSS rather than shipped as images, so they stay sharp at any size and cost no HTTP requests.<\/li>\n<li>A scale, or a two-way up\/down control, with the rated and unrated colours as settings.<\/li>\n<li>Template tags and a shortcode for the highest rated, most rated, lowest rated and highest scoring posts, optionally within a category, a tag or a time range.<\/li>\n<li>A rating log with sortable columns, filters, bulk delete and Screen Options.<\/li>\n<li>Google rich snippet markup for the post and its aggregate rating.<\/li>\n<li>A sidebar widget, and a section on the WP-Stats page when that plugin is installed.<\/li>\n<\/ul>\n\n<h3>Donations<\/h3>\n\n<p>I spent most of my free time creating, updating, maintaining and supporting these 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.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>The simplest way, and the only one that works in a block theme without editing template files, is the shortcode. Put it in the post or page you want rated:<\/p>\n\n<ul>\n<li><code>[ratings]<\/code> rates the post it appears in.<\/li>\n<li><code>[ratings id=\"1\"]<\/code> shows the rating for post 1, wherever you put it.<\/li>\n<li><code>[ratings id=\"1\" results=\"true\"]<\/code> shows post 1's result without letting anyone vote from there.<\/li>\n<\/ul>\n\n<p>To put ratings on every post automatically, a classic theme can call the template tag from <code>single.php<\/code>, <code>archive.php<\/code> or <code>index.php<\/code>, anywhere inside the loop:<\/p>\n\n<pre><code>&lt;?php the_ratings(); ?&gt;\n<\/code><\/pre>\n\n<p>The settings live at <strong>WP-Admin -&gt; Ratings -&gt; Settings<\/strong>, which has a Settings tab and a Templates tab.<\/p>\n\n<h3>Showing A Rating In A Block<\/h3>\n\n<p>A <strong>Ratings<\/strong> block is available in the editor, under <strong>Widgets<\/strong>. Two settings in the sidebar:<\/p>\n\n<ul>\n<li><strong>Post ID<\/strong> \u2014 leave it at zero to rate the post the block sits in, which is what an empty <code>[ratings]<\/code> does, or give an id to show another post's rating wherever you put the block.<\/li>\n<li><strong>Show the result only<\/strong> \u2014 displays the rating without offering to change it, for putting a post's score somewhere it should not be voted from. This is what <code>results=\"true\"<\/code> does.<\/li>\n<\/ul>\n\n<p>It renders on the server, so the preview in the editor is the real rating rather than an approximation, and changing your shape, colours or templates updates every post showing it without re-saving anything. The preview is deliberately not clickable: rating from the editor would record a real vote.<\/p>\n\n<p><strong>The shortcode still works and is not going anywhere.<\/strong> <code>[ratings]<\/code>, <code>[ratings id=\"1\"]<\/code> and <code>[ratings id=\"1\" results=\"true\"]<\/code> behave exactly as they always have, and a post already containing one needs no change. The block calls the same code the shortcode calls, so the two render identically \u2014 use whichever suits the post.<\/p>\n\n<h3>WP-CLI<\/h3>\n\n<pre><code>wp postratings list\nwp postratings list --limit=50 --format=json\nwp postratings get 42\nwp postratings delete 42 --yes\nwp postratings delete --all --what=logs\n<\/code><\/pre>\n\n<p>A rating lives in two places \u2014 the running totals each post displays, and a row per vote in the log. <code>--what<\/code> chooses which to clear: <code>logs<\/code>, <code>data<\/code> or <code>both<\/code>, and <code>both<\/code> is the default.<\/p>\n\n<h3>REST API<\/h3>\n\n<pre><code>GET  \/wp-json\/postratings\/v1\/post\/&lt;id&gt;\nPOST \/wp-json\/postratings\/v1\/post\/&lt;id&gt;\/rate\n<\/code><\/pre>\n\n<p>Reading is public, because a rating is public. Rating takes the same <code>wp_postratings_&lt;id&gt;-nonce<\/code> the rendered control already carries, passed as a <code>nonce<\/code> parameter, and is subject to the same eligibility and repeat-rating settings as rating through the page.<\/p>\n\n<p>Each response carries the rendered markup as well as the numbers, because your templates and your chosen shape decide what a rating looks like.<\/p>\n\n<p><strong>A refusal answers 403<\/strong>, not 400 \u2014 a rating already cast, a rating off the end of the scale, a bad nonce. 400 is kept for a parameter this plugin never had a chance to look at, and a post that does not exist is 404.<\/p>\n\n<p><strong>These routes are an addition.<\/strong> The <code>admin-ajax.php<\/code> <code>wp_postratings<\/code> action is unchanged and still supported.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Go to <code>WP-Admin -&gt; Ratings -&gt; Settings<\/code> and choose the shape, the scale and who is allowed to rate.<\/li>\n<li>Show the control: type <code>[ratings]<\/code> into a post, add the <strong>Ratings<\/strong> block, or call <code>the_ratings()<\/code> from your theme.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"how%20do%20i%20change%20the%20colour%20of%20the%20ratings%3F\"><h3>How do I change the colour of the ratings?<\/h3><\/dt>\n<dd><p>Go to <code>WP-Admin -&gt; Ratings -&gt; Settings<\/code> and look under <strong>Individual Rating Text and Value<\/strong>. Each step on the scale has its own pair of colour swatches, in the <strong>Rated<\/strong> and <strong>Not rated<\/strong> columns, which is what the old <code>stars_crystal<\/code> and <code>stars_dark<\/code> image sets were for.<\/p>\n\n<p>Hovering uses the rated colour. If you would rather tell \"about to pick\" apart from \"already recorded\", set <code>--wp-postratings-color-hover<\/code> in your theme.<\/p><\/dd>\n<dt id=\"how%20do%20i%20change%20the%20size%2C%20spacing%20or%20hover%20colour%3F\"><h3>How do I change the size, spacing or hover colour?<\/h3><\/dt>\n<dd><p>Anything beyond the two colours is a CSS custom property on <code>.wp-postratings<\/code>, so this is all it takes in your theme:<\/p>\n\n<pre><code>.wp-postratings {\n    --wp-postratings-size: 24px;\n    --wp-postratings-gap: 4px;\n    --wp-postratings-color-hover: #f7c56b;\n}\n<\/code><\/pre>\n\n<p>Before 2.0.0 a different colour meant a whole extra folder of images, which is why the plugin shipped <code>stars<\/code>, <code>stars_crystal<\/code> and <code>stars_dark<\/code> separately. They are all the same shape now.<\/p><\/dd>\n<dt id=\"how%20do%20i%20use%20my%20own%20rating%20shape%3F\"><h3>How do I use my own rating shape?<\/h3><\/dt>\n<dd><p>Register it with the <code>wp_postratings_shapes<\/code> filter. It then appears on the Ratings Options screen like any built-in shape, and unlike the old approach of dropping a folder into <code>wp-content\/plugins\/wp-postratings\/images\/<\/code>, it survives an update.<\/p>\n\n<pre><code>add_filter( 'wp_postratings_shapes', function ( $shapes ) {\n    $shapes['diamond'] = array(\n        'type'  =&gt; 'scale',\n        'label' =&gt; 'Diamonds',\n        'path'  =&gt; 'M12 2l10 10-10 10L2 12z',\n    );\n\n    return $shapes;\n} );\n<\/code><\/pre>\n\n<p>The path is SVG path data drawn in a 24x24 box. For an up\/down control use <code>'type' =&gt; 'updown'<\/code> and supply <code>'up'<\/code> and <code>'down'<\/code> paths instead of <code>'path'<\/code>.<\/p><\/dd>\n<dt id=\"every%20visitor%20can%20rate%20over%20and%20over%2C%20or%20every%20rating%20log%20entry%20shows%20the%20same%20ip\"><h3>Every visitor can rate over and over, or every rating log entry shows the same IP<\/h3><\/dt>\n<dd><p>This is about the <strong>Header That Contains The IP<\/strong> field on the Ratings Options screen.<\/p>\n\n<p>Leave it blank unless your site is genuinely behind a reverse proxy or CDN such as Cloudflare. Blank means the plugin uses the address your web server actually saw, which is what you want on a normal host.<\/p>\n\n<p>If you are behind a proxy, name the exact header your proxy sets, for example <code>HTTP_CF_CONNECTING_IP<\/code> for Cloudflare or <code>HTTP_X_FORWARDED_FOR<\/code> for most load balancers. Two things are worth knowing:<\/p>\n\n<ul>\n<li>A visitor can send any header they like. If you name a header your own stack does not set and overwrite, anyone can put whatever they want in it and rate as many times as they please.<\/li>\n<li><code>X-Forwarded-For<\/code> is a list, <code>client, proxy1, proxy2<\/code>. As of 2.0.0 the plugin reads the first valid address in that list rather than storing the whole string. Before 2.0.0 it stored the whole string, which meant a visitor could append one more address and appear to be somebody new on every request.<\/li>\n<\/ul>\n\n<p>Because the stored value has changed shape, rating logs recorded through such a header before 2.0.0 will not match any more, and some visitors may be able to rate one more time. Logs recorded without the field set are unaffected.<\/p><\/dd>\n<dt id=\"how%20to%20change%20schema%20type%3F\"><h3>How To Change Schema Type?<\/h3><\/dt>\n<dd><pre><code>&lt;?php  \nadd_filter( 'wp_postratings_schema_itemtype', 'wp_postratings_schema_itemtype' );  \nfunction wp_postratings_schema_itemtype( $itemtype ) {  \n    return 'itemscope itemtype=\"https:\/\/schema.org\/Recipe\"';  \n}  \n?&gt;\n<\/code><\/pre>\n\n<p>The default schema type is 'Article', if you want to change it to 'Recipe', you need to make use of the <code>wp_postratings_schema_itemtype<\/code> filter as shown in the sample code above.<\/p><\/dd>\n<dt id=\"how%20to%20add%20your%20site%20logo%20for%20google%20rich%20snippets\"><h3>How To Add Your Site Logo For Google Rich Snippets<\/h3><\/dt>\n<dd><pre><code>&lt;?php  \nadd_filter( 'wp_postratings_site_logo', 'wp_postratings_site_logo' );  \nfunction wp_postratings_site_logo( $url ) {  \n    return 'https:\/\/example.com\/logo.png';  \n}  \n?&gt;\n<\/code><\/pre>\n\n<p>By default, the plugin will use your site header image URL as your site logo. If you want to change it, you need to make use of the <code>wp_postratings_site_logo<\/code> filter as shown in the sample code above.<\/p><\/dd>\n<dt id=\"how%20to%20change%20the%20text%20screen%20readers%20announce%3F\"><h3>How To Change The Text Screen Readers Announce?<\/h3><\/dt>\n<dd><pre><code>add_filter( 'wp_postratings_ratings_image_alt', function ( $label ) {\n    return $label;\n} );\n<\/code><\/pre>\n\n<p>This is the description a screen reader reads out for a displayed rating, such as \"4 votes, average: 3.70 out of 5\". Since 2.0.0 the ratings are drawn with CSS rather than images, so there is no <code>alt<\/code> or <code>title<\/code> attribute involved; the value becomes the <code>aria-label<\/code> on the rating.<\/p>\n\n<p>Returning an empty string removes it, which is what this filter was usually used for. Be aware that it leaves the rating with no accessible name at all, so anyone using a screen reader is told nothing about it. Prefer rewording it over removing it.<\/p><\/dd>\n<dt id=\"how%20to%20display%20comment%20author%20ratings%3F\"><h3>How To Display Comment Author Ratings?<\/h3><\/dt>\n<dd><pre><code>add_filter( 'wp_postratings_display_comment_author_ratings', '__return_true' );\n<\/code><\/pre>\n\n<p>By default, the comment author ratings are not displayed. If you want to display the ratings, you need to make use of the <code>wp_postratings_display_comment_author_ratings<\/code> filter as shown in the sample code above.<\/p><\/dd>\n<dt id=\"how%20to%20change%20the%20cookie%20expiration%20time%3F\"><h3>How To change the cookie expiration time?<\/h3><\/dt>\n<dd><pre><code>function custom_rating_cookie_expiration() {\n    return strtotime( 'tomorrow' ) ;\n}\nadd_filter( 'wp_postratings_cookie_expiration', 'custom_rating_cookie_expiration', 10, 0 );\n<\/code><\/pre>\n\n<p>The default cookie expiration if 'time() + 30000000', if you want to change the lenght of the experation, you need to make use of the <code>wp_postratings_cookie_expiration<\/code> filter as shown in the sample code above.<\/p><\/dd>\n<dt id=\"how%20does%20wp-postratings%20load%20css%3F\"><h3>How Does WP-PostRatings Load CSS?<\/h3><\/dt>\n<dd><p>Most restyling needs no CSS file at all any more: the colours are a setting, and the size, spacing and hover colour are custom properties. See the two questions above first.<\/p>\n\n<p>If you do want to replace the stylesheet wholesale, WP-PostRatings loads <code>wp-postratings.css<\/code> from your theme's directory (or its <code>css\/<\/code> subdirectory) when that file exists, and its own copy otherwise, so an upgrade will not overwrite your styles.<\/p>\n\n<p>Note the filename changed in 2.0.0: it was <code>postratings-css.css<\/code> before. A theme still shipping the old name is simply ignored, and the plugin's own stylesheet loads instead. There is no separate RTL stylesheet any more either, because the rules use logical properties.<\/p><\/dd>\n<dt id=\"how%20to%20use%20ratings%20stats%20with%20widgets%3F\"><h3>How To Use Ratings Stats With Widgets?<\/h3><\/dt>\n<dd><ol>\n<li>Go to <code>WP-Admin -&gt; Appearance -&gt; Widgets<\/code><\/li>\n<li>The widget name is Ratings.<\/li>\n<\/ol><\/dd>\n<dt id=\"to%20display%20lowest%20rated%20post\"><h3>To Display Lowest Rated Post<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_lowest_rated')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_lowest_rated(); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_lowest_rated('both', 0, 10)<\/li>\n<li>The value 'both' will display both the lowest rated posts and pages.<\/li>\n<li>If you want to display the lowest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the lowest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 lowest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20lowest%20rated%20post%20by%20tag\"><h3>To Display Lowest Rated Post By Tag<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_lowest_rated_tag')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_lowest_rated_tag(TAG_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_lowest_rated_tag(TAG_ID, 'both', 0, 10)<\/li>\n<li>Replace TAG_ID will your tag ID. If you want it to span several categories, replace TAG_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the lowest rated posts and pages.<\/li>\n<li>If you want to display the lowest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the lowest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 lowest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20lowest%20rated%20post%20in%20a%20category\"><h3>To Display Lowest Rated Post In A Category<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_lowest_rated_category')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_lowest_rated_category(CATEGORY_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_lowest_rated_category(CATEGORY_ID, 'both', 0, 10)<\/li>\n<li>Replace CATEGORY_ID will your category ID. If you want it to span several categories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the lowest rated posts and pages.<\/li>\n<li>If you want to display the lowest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the lowest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 lowest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20rated%20post\"><h3>To Display Highest Rated Post<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_rated')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_rated(); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_rated('both', 0, 10)<\/li>\n<li>The value 'both' will display both the highest rated posts and pages.<\/li>\n<li>If you want to display the highest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the highest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 highest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20rated%20post%20by%20tag\"><h3>To Display Highest Rated Post By Tag<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_rated_tag')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_rated_tag(TAG_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_rated_tag(TAG_ID, 'both', 0, 10)<\/li>\n<li>Replace TAG_ID will your tag ID. If you want it to span several categories, replace TAG_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the highest rated posts and pages.<\/li>\n<li>If you want to display the highest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the highest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 highest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20rated%20post%20in%20a%20category\"><h3>To Display Highest Rated Post In A Category<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_rated_category')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_rated_category(CATEGORY_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_rated_category(CATEGORY_ID, 'both', 0, 10)<\/li>\n<li>Replace CATEGORY_ID will your category ID. If you want it to span several categories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the highest rated posts and pages.<\/li>\n<li>If you want to display the highest rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the highest rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 highest rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20rated%20post%20within%20a%20given%20period\"><h3>To Display Highest Rated Post Within A Given Period<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_rated_range')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_rated_range('1 day'); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_rated_range('1 day', 'both', 10)<\/li>\n<li>The value '1 day' will be the range that you want. You can use '2 days', '1 month', etc.<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20most%20rated%20post\"><h3>To Display Most Rated Post<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_most_rated')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_most_rated(); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_most_rated('both', 0, 10)<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20most%20rated%20post%20in%20a%20category\"><h3>To Display Most Rated Post In A Category<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_most_rated_category')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_most_rated_category(CATEGORY_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_most_rated_category(CATEGORY_ID, 'both', 0, 10)<\/li>\n<li>Replace CATEGORY_ID will your category ID. If you want it to span several categories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20most%20rated%20post%20within%20a%20given%20period\"><h3>To Display Most Rated Post Within A Given Period<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_most_rated_range')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_most_rated_range('1 day'); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_most_rated_range('1 day', 'both', 10)<\/li>\n<li>The value '1 day' will be the range that you want. You can use '2 days', '1 month', etc.<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20score%20post\"><h3>To Display Highest Score Post<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_score')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_score(); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_score('both', 0, 10)<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20score%20post%20in%20a%20category\"><h3>To Display Highest Score Post In A Category<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_score_category')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_score_category(CATEGORY_ID); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_score_category(CATEGORY_ID, 'both', 0, 10)<\/li>\n<li>Replace CATEGORY_ID will your category ID. If you want it to span several categories, replace CATEGORY_ID with array(1, 2) where 1 and 2 are your categories ID.<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 0 refers to the minimum votes required before the post get shown.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20display%20highest%20score%20post%20within%20a%20given%20period\"><h3>To Display Highest Score Post Within A Given Period<\/h3><\/dt>\n<dd><pre><code>&lt;?php if (function_exists('get_highest_score_range')): ?&gt;\n    &lt;ul&gt;\n        &lt;?php get_highest_score_range('1 day'); ?&gt;\n    &lt;\/ul&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<ul>\n<li>Default: get_highest_score_range('1 day', 'both', 10)<\/li>\n<li>The value '1 day' will be the range that you want. You can use '2 days', '1 month', etc.<\/li>\n<li>The value 'both' will display both the most rated posts and pages.<\/li>\n<li>If you want to display the most rated posts only, replace 'both' with 'post'.<\/li>\n<li>If you want to display the most rated pages only, replace 'both' with 'page'.<\/li>\n<li>The value 10 will display only the top 10 most rated posts\/pages.<\/li>\n<\/ul><\/dd>\n<dt id=\"to%20sort%20highest%2Flowest%20rated%20posts\"><h3>To Sort Highest\/Lowest Rated Posts<\/h3><\/dt>\n<dd><pre><code>$query = new WP_Query( array(\n    'meta_key' =&gt; 'ratings_average',\n    'orderby'  =&gt; 'meta_value_num',\n    'order'    =&gt; 'DESC',\n) );\n<\/code><\/pre>\n\n<p>Or pass the variables in the URL: <code>https:\/\/yoursite.com\/?r_sortby=highest_rated&amp;r_orderby=desc<\/code><\/p>\n\n<p>Replace <code>desc<\/code> with <code>asc<\/code> for the lowest rated posts.<\/p><\/dd>\n<dt id=\"to%20sort%20most%2Fleast%20rated%20posts\"><h3>To Sort Most\/Least Rated Posts<\/h3><\/dt>\n<dd><pre><code>$query = new WP_Query( array(\n    'meta_key' =&gt; 'ratings_users',\n    'orderby'  =&gt; 'meta_value_num',\n    'order'    =&gt; 'DESC',\n) );\n<\/code><\/pre>\n\n<p>Or pass the variables in the URL: <code>https:\/\/yoursite.com\/?r_sortby=most_rated&amp;r_orderby=desc<\/code><\/p>\n\n<p>Replace <code>desc<\/code> with <code>asc<\/code> for the least rated posts.<\/p>\n\n<p>These examples use <code>WP_Query<\/code> rather than <code>query_posts()<\/code>, which the old ones called: <code>query_posts()<\/code> replaces the main query and WordPress has discouraged it for years. To sort the main query instead, use <code>pre_get_posts<\/code>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h3>2.0.0<\/h3>\n\n<ul>\n<li>FIXED: Any post ID could be rated, not only a published one. A visitor who was never signed in could seed <code>ratings_users<\/code>, <code>ratings_score<\/code> and <code>ratings_average<\/code> onto a draft, a pending, a private or a trashed post \u2014 so it arrived already rated on the day it was published \u2014 and the unpublished title was copied into the log table, where the Logs screen then displayed it. On a site that had put <code>%POST_TITLE%<\/code> or <code>%POST_CONTENT%<\/code> into the text template, the reply returned unpublished content directly. Both the AJAX action and the REST route now require a post that is actually publicly viewable<\/li>\n<li>NEW: A <code>wp postratings<\/code> WP-CLI command \u2014 <code>list<\/code>, <code>get<\/code> and <code>delete<\/code>, with <code>--what=logs|data|both<\/code>.<\/li>\n<li>NEW: A <code>postratings\/v1<\/code> REST API for reading a post's rating and casting one. The <code>admin-ajax.php<\/code> <code>wp_postratings<\/code> action is unchanged and still supported.<\/li>\n<li>NEW: A <strong>Ratings<\/strong> block for the editor, with the post id and a results-only toggle in the sidebar. It renders on the server through the same code the shortcode does, so the editor preview is the real rating. The <code>[ratings]<\/code> shortcode is unchanged and still supported \u2014 the block is an addition beside it, nothing needs migrating, and posts already holding a shortcode need no edit.<\/li>\n<li>BREAKING: Requires WordPress 6.8 and PHP 8.2, up from 6.0 and 7.4.<\/li>\n<li>BREAKING: The rating images are gone. All 16 image sets and their 121 GIF and PNG files are replaced by 9 SVG shapes drawn with CSS, so ratings are sharp on every screen and cost no HTTP requests. Your chosen set is migrated automatically to the matching shape: stars, stars_crystal, stars_dark, stars_png and stars_flat_png all become <code>star<\/code>, thumbs becomes <code>thumb<\/code>, and so on. If you added your own folder to <code>images\/<\/code> it will fall back to stars; see the FAQ for how to register a custom shape properly, which unlike the old folder survives an update.<\/li>\n<li>BREAKING: The rating markup has changed completely. A scale is now a group of radio buttons and an up\/down is a pair of buttons, so the control announces itself correctly to screen readers and works from the keyboard. Every class and element id is now prefixed with the plugin slug: <code>.post-ratings<\/code> is <code>.wp-postratings<\/code>, <code>.post-ratings-image<\/code> no longer exists at all, and the wrapper id is <code>wp-postratings-123<\/code> rather than <code>post-ratings-123<\/code>. Colour, size and spacing are CSS custom properties, which is usually a one-line replacement; see the FAQ.<\/li>\n<li>BREAKING: The vote images no longer carry inline <code>onmouseover<\/code>\/<code>onclick<\/code> attributes; hovering and clicking are handled by one delegated listener. Custom CSS or JavaScript that targeted those inline handlers, or that called <code>current_rating()<\/code> or <code>rate_post()<\/code> directly, needs updating.<\/li>\n<li>BREAKING: The <code>rate_post<\/code> action is renamed <code>wp_postratings_rate_post<\/code> and the old name is gone, with no deprecation shim. Its three arguments are unchanged.<\/li>\n<li>BREAKING: Every class is renamed to <code>WP_PostRatings_*<\/code>, and the plugin's own classes are no longer called <code>Postratings_*<\/code>. <code>RATINGS_IMG_EXT<\/code> is now <code>WP_POSTRATINGS_IMG_EXT<\/code>.<\/li>\n<li>BREAKING: The settings screen moved to <code>WP-Admin -&gt; Ratings -&gt; Settings<\/code>, at <code>admin.php?page=wp-postratings-settings<\/code>. Ratings Options and Ratings Templates are the two tabs of that one page rather than two menu entries.<\/li>\n<li>BREAKING: The option rows are renamed. The fifteen <code>postratings_*<\/code> rows become one <code>wp_postratings_options<\/code>, and the two separate version markers become one <code>wp_postratings_version<\/code>. Your settings are migrated automatically on the first load after the update.<\/li>\n<li>BREAKING: The shared, unprefixed <code>stats_display<\/code> and <code>stats_mostlimit<\/code> option rows are no longer read. WP-Stats integration is now two settings of this plugin's own, on the Settings tab, and WP-Stats asks each plugin for its section through the <code>wp_stats_sections<\/code> filter rather than reading anybody's options. Update all seven WP-Stats-aware plugins together; see the Upgrade Notice.<\/li>\n<li>BREAKING: If you set \"Header That Contains The IP\" (for Cloudflare, a load balancer or any reverse proxy), that header is now parsed as the forwarded-for chain it is, and only the first valid address in it is used. Previously the whole header value was stored, so a visitor could rate repeatedly just by appending another address to it. Existing rating logs recorded through such a header will no longer match, so some visitors may be able to rate once more. Leave the field blank unless you are actually behind a proxy. See the FAQ.<\/li>\n<li>BREAKING: \"Ratings Logging Method\" is now \"Check For Repeat Votes\", and it no longer decides whether anything is logged. It never did anything but choose what a returning visitor is matched against, and the two readings pointed opposite ways: a site that picked \"Do Not Log\" or \"Logged By Cookie\" got no ratings log, no rows on the logs screen and no WP-Stats figures, which is not what either choice sounds like. <strong>Every vote is now recorded whatever this is set to.<\/strong> The choices read \"Do Not Check\", \"Check By Cookie\", \"Check By IP Address\", \"Check By Cookie And IP Address\" and \"Check By Username\"; the stored numbers are unchanged, so your setting means what it always meant. The option key inside <code>wp_postratings_options<\/code> is <code>check_method<\/code> rather than <code>logging_method<\/code>, migrated automatically.<\/li>\n<li>BREAKING: The <code>wp_postratings_always_log<\/code> filter is gone. It asked for exactly the behaviour above, which is now the default, and a filter that forces the default does nothing. Sites that would rather <em>not<\/em> keep the record have the opposite filter instead: return false from <code>wp_postratings_log_rating<\/code> and no row is written. The post's own score and vote count are post meta and are updated either way.<\/li>\n<li>BREAKING: The stylesheet is now <code>wp-postratings.css<\/code>, not <code>postratings-css.css<\/code>, and there is no separate RTL stylesheet. If your theme ships its own <code>postratings-css.css<\/code> override it will no longer be picked up; rename it, or better, use the colour setting and the CSS custom properties instead.<\/li>\n<li>NEW: Rewritten as classes under <code>includes\/<\/code>, so the plugin now works installed under any directory name.<\/li>\n<li>NEW: Settings moved to the WordPress Settings API, with the options and templates screens merged into one tabbed page.<\/li>\n<li>NEW: The rating log is now a standard WordPress list table, with sortable columns, bulk delete, a search box and Screen Options.<\/li>\n<li>NEW: The scripts are vanilla JavaScript; the jQuery dependency is gone, and hovering the stars is pure CSS, so nothing runs on mouse move at all.<\/li>\n<li>NEW: Rating colours are a setting, per rating rather than per site: each row of the rating table has its own rated and not-rated colour, with a Reset to default beside them. This replaces the old colour variants of the image sets, where changing colour meant choosing a different set of files.<\/li>\n<li>NEW: <code>wp_postratings_shapes<\/code> lets you register your own rating shape.<\/li>\n<li>NEW: <code>WP_POSTRATINGS_TRUST_PROXY<\/code> and the <code>wp_postratings_trust_proxy<\/code> filter opt into the usual reverse-proxy headers without naming one. \"Header That Contains The IP\" stays the narrow answer -- exactly the one header your proxy sets -- and still wins when both are given; the constant is the broad one, meaning \"try the seven headers proxies commonly use\". WP-Email, WP-Polls, WP-Ban and WP-UserOnline already worked this way; WP-PostRatings was the one that did not.<\/li>\n<li>NEW: <code>wp_postratings_capability<\/code> filters the capability the plugin's screens require, which is still <code>manage_ratings<\/code>.<\/li>\n<li>NEW: The stylesheet honours <code>prefers-color-scheme: dark<\/code>, <code>prefers-contrast: more<\/code> and <code>prefers-reduced-motion: reduce<\/code>.<\/li>\n<li>CHANGED: Ratings display a true percentage instead of being rounded to the nearest half image, so an average of 3.7 out of 5 now fills 74% of the stars rather than showing three and a half.<\/li>\n<li>CHANGED: <code>RATINGS_IMG_EXT<\/code> and <code>wp_postratings_image_extension<\/code> no longer choose anything; there are no image files left to have an extension. The <code>wp_postratings_ratings_image_alt<\/code> filter stays, but it now sets the rating's accessible label rather than an image's alt and title text.<\/li>\n<li>FIXED: The plugin requested an admin stylesheet that had been an empty file since 2020.<\/li>\n<li>FIXED: The per-post lock file was never released, so one was left behind in the server's temporary directory on every single rating.<\/li>\n<li>FIXED: Uninstalling on a multisite network stopped after the first 100 sites, leaving the options and the rating table behind on every site after that.<\/li>\n<li>FIXED: Activating network-wide also stopped after 100 sites.<\/li>\n<li>FIXED: A rating outside the configured scale was recorded as a vote worth nothing, and warned on PHP 8.<\/li>\n<li>FIXED: Comment author ratings never matched by IP, so they had been silently broken since ratings began being stored hashed.<\/li>\n<li>FIXED: The \"numbers\" rating image set could not be saved; it reported success and reverted to stars.<\/li>\n<li>FIXED: Post titles containing an apostrophe were stored in the log with a stray backslash.<\/li>\n<li>FIXED: The rating log always claimed to be sorted \"Descending\" whichever order was chosen.<\/li>\n<li>FIXED: Deleting all rating data left every post's cache holding the values that had just been removed.<\/li>\n<li>FIXED: Numerous PHP 8 warnings on the admin screens and in an unconfigured widget.<\/li>\n<li>NEW: When an up\/down post has no verdict to show, it shows you your own vote instead. A tie points nowhere, so rating a post down and landing on one drew a blank pair that looked exactly like the control you had just clicked \u2014 as though the vote had not been recorded. Your vote is the only direction that can honestly be attributed at that point, so it takes the shape and the label reads \"You rated this down\". A post that <em>does<\/em> have a verdict keeps showing it: one that is 500 to 3 in favour must not read as a thumbs down to the single visitor who disagreed. Your vote comes from the \"already rated\" cookie, or from the rating log when the repeat-vote check is by username. It is deliberately never matched by IP address: behind a proxy or a mobile network many visitors share one address, so that would tell somebody who had never voted that they had<\/li>\n<li>FIXED: An up\/down rating with no verdict was drawn as a vote down. Zero is not a direction: a post nobody has rated, and a post with as many down votes as up, both average zero, and both showed a lit thumbs down. They now show the pair unlit. This also fixes what a site sees after switching from a scale to an up\/down control -- an up\/down vote is worth -1 or +1, so a score off a scale of stars is far too large to be one, and reading it as a direction showed every previously rated post as a thumbs up that no amount of voting down could shift. Such a post now shows the unlit pair until its up\/down votes outweigh its history, and the vote count and score are reported exactly as stored throughout<\/li>\n<li>FIXED: On a dark colour scheme the unrated shapes stayed the light grey chosen for a light page, and glared. The dark default is a custom property set on the container <code>the_ratings()<\/code> adds -- but the widget, and the shortcode and block when asked for results only, print the rating without that container, so nothing they drew ever inherited it. The same was true of the high-contrast default<\/li>\n<\/ul>","raw_excerpt":"Adds an AJAX rating system for your WordPress site&#039;s content.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=387"}],"author":[{"embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gamerz"}],"wp:attachment":[{"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=387"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=387"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=387"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=387"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/vec.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}