WP-PostRatings 2.0.0
-
WP-PostRatings 2.0.0 is a total rewrite of the plugin with Claude Code to make it more modern and testable. There will be breaking changes. Please do test it https://github.com/lesterchan/wp-postratings/archive/refs/heads/master.zip
WP-PostRatings 2.0.0 requires WordPress 6.8 and PHP 8.2. A site on an older stack is simply not offered the update, so if WP-PostRatings has stopped appearing in your updates list, that is why.
Settings migrate on the first admin page load. The fifteen postratings_* rows, plus the shared stats_display and stats_mostlimit rows, are folded into one wp_postratings_options row, and postratings_db_version and postratings_options_version become a single wp_postratings_version. Code reading the old rows directly will find them gone.
Update all seven WP-Stats plugins together. WP-Stats, WP-PostRatings, WP-Polls, WP-EMail, WP-PostViews, WP-DownloadManager and WP-DraftsForFriends shared two unprefixed rows, stats_display and stats_mostlimit. 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 “show”, so a block you had switched off may reappear — switch it off again under Ratings -> Settings -> WP-Stats, where the setting and the entries-per-list figure now live.
The settings screen is at Ratings -> Settings, with Ratings Options and Ratings Templates as two tabs of it. admin.php?page=wp-postratings-options is now admin.php?page=wp-postratings-settings. The capability is still manage_ratings.
Two Google rich snippet settings became one, defaulting to No. “Enable Google Rich Snippets?” and “Enable Ratings In Rich Snippets?” are now Show ratings in Google results?. The old markup declared schema.org/Article, and Google shows ratings only for Book, Course, Event, Local Business, Movie, Organization, Product, Recipe, Software App and a few subtypes — so on an ordinary post it never produced a rich result.
If you filtered wp_postratings_schema_itemtype to a supported type, you were 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 Product to collect stars is spammy structured markup, and it costs a manual action.
Rating images are now CSS shapes. 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 — the FAQ shows how to register a shape instead, which survives updates.
Custom CSS needs updating. Every class and id is slug-prefixed now: .post-ratings is now .wp-postratings; .post-ratings-image is gone, because there is no img tag any more; the wrapper id is wp-postratings-123 rather than post-ratings-123; and the stylesheet is css/wp-postratings.css rather than postratings-css.css, with no -rtl variant.
Colour, size, spacing and hover colour are CSS custom properties, so most overrides become a one-line change. See the FAQ.
Renamed with no shim left behind: the rate_post action is now wp_postratings_rate_post, with the same three arguments; RATINGS_IMG_EXT is now WP_POSTRATINGS_IMG_EXT; and every class is WP_PostRatings_* rather than Postratings_*.
The template tags — the_ratings(), get_highest_rated(), get_most_rated() and the rest — and the twenty-two wp_postratings_* filters are unchanged.
“Header That Contains The IP” now reads only the first valid address 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.
Custom JavaScript. The markup carries no inline onmouseover or onclick handlers and there is no jQuery. Code calling current_rating() or rate_post() in the browser must be rewritten against the delegated listener in js/wp-postratings.js.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.