About this plugin
Init Review System adds a clean and customizable 5-star rating system to your WordPress site. Votes are stored via REST API, tracked with localStorage, and the average score is auto-calculated and optionally displayed with schema markup.
Built to be lightweight, developer-friendly, and easy to integrate into any theme or custom UI. 9+.
This plugin is part of the Init Plugin Suite — a collection of minimalist, fast, and developer-focused tools for WordPress.
com/brokensmile2103/init-review-system
Highlights:
- NEW: Block Editor (Gutenberg) support — 4 blocks, one per shortcode
- NEW: Abilities API support (WordPress 6.9+) — 3 read-only abilities
- 5-star voting via frontend
- Multi-criteria review support
- Emoji Reactions with Login Enforcement
- Average score display
- Optional login requirement
- Optional strict IP checking
- REST API for vote submission
- JSON-LD schema for SEO
- Works with any post type
- Minimal, theme-friendly UI
Features
- Block Editor (Gutenberg) blocks: Review Score, Review Widget, Review Criteria, Reactions Bar — each with a live server-side preview in the editor
- Abilities API (WordPress 6.9+): review score, criteria reviews, and reactions summary exposed as discoverable, executable abilities via wp_get_abilities() and the wp-abilities/v1 REST namespace
- 5-star rating system
- Multi-criteria review scoring (up to 5 custom criteria)
- Emoji-based reactions bar with live counts (requires login)
- REST API endpoint for reactions: /wp-json/initrsys/v1/reactions/toggle
- Reactions stored in both post meta and dedicated user ↔ post mapping table
- Accessibility-ready with aria-pressed + aria-live updates
- Shortcode-based integration
- Auto-insert blocks before/after content or comments
- Optional login + IP check to prevent abuse
- REST API endpoint: /wp-json/initrsys/v1/vote
- Developer filters and extensible architecture
- No jQuery, only minimal assets loaded when needed
Block Editor (Gutenberg)
Four dynamic blocks are available under their own Init Review System category in the block inserter — no shortcodes needed if you prefer working entirely in the editor:
- Review Score — equivalent to [init_review_score]
- Review Widget — equivalent to [init_review_system]
- Review Criteria — equivalent to [init_review_criteria]
- Reactions Bar — equivalent to [init_reactions]
Each block shares the exact same rendering code as its shortcode, so switching between the Block Editor and shortcodes never changes the output. serverSideRender ) is shown right in the editor as you configure it.
Abilities API (WordPress 6.9+)
9 and above, Init Review System registers three read-only abilities under the init-review-system category:
- init-review-system/get-review-score — average score and vote count for a post
- init-review-system/get-criteria-reviews — criteria breakdown and a page of written reviews for a post
- init-review-system/get-reactions-summary — emoji reaction counts for a post
These are discoverable and executable via PHP ( wp_get_abilities() ), and — for sites that opt into exposing it — the wp-abilities/v1 REST namespace. Actions that write data (voting, submitting a review, toggling a reaction) are intentionally not exposed as abilities, since an ability can be discovered and invoked directly by an AI agent or automation tool — voting/reviewing/reacting on a visitor’s behalf should never happen without the visitor’s own, in-context action.
9, it silently does nothing and the rest of the plugin is unaffected.
Usage
[init_review_system]
Displays interactive 5-star voting block.
Attributes:
– id: Post ID (default: current post)
– class: Custom CSS class
– schema: true|false – Output JSON-LD schema markup
[init_review_score]
Displays average score (read-only).
Attributes:
– id: Post ID (default: current post)
– icon: true|false – Show star icon (default: false)
– sub: true|false – Show /5 subtext (default: true)
– show_count: true|false – Show the vote count (default: false)
– class: Custom CSS class (multiple classes separated by spaces are supported)
– hide_if_empty: true|false – Hide if no reviews (default: false)
[init_review_criteria]
Displays multi-criteria review block.
Attributes:
– id: Post ID (default: current post)
– class: Custom CSS class
– schema: true|false – Output schema markup (default: false)
– per_page: Number of reviews to show (default: 0 = all)
– paged: Current review page number (default: 1)
[init_reactions]
Displays emoji reactions bar under a post.
Attributes:
– id: Post ID (default: current post)
– class: Custom CSS class
– require_login: Always true (login required)
Filters for Developers
This plugin provides filters and actions to let developers customize auto-insert behavior, schema output, review permissions, and REST API logic.
init_plugin_suite_review_system_auto_insert_enabled_score
Enable or disable automatic score output (before/after content).
Applies to: Frontend filter
Params: bool $enabled, string $position, string $post_type
init_plugin_suite_review_system_auto_insert_enabled_vote
Enable or disable automatic voting block insertion.
Applies to: Frontend filter
Params: bool $enabled, string $position, string $post_type
init_plugin_suite_review_system_default_score_shortcode
Change the default shortcode used for score auto-insertion.
Applies to: Frontend
Params: string $shortcode
init_plugin_suite_review_system_default_vote_shortcode
Change the default shortcode used for voting block auto-insertion.
Applies to: Frontend
Params: string $shortcode
init_plugin_suite_review_system_require_login
Force login for submitting reviews, even if disabled in settings.
Applies to: REST /submit-criteria-review
Params: bool $require_login
init_plugin_suite_review_system_min_len_for_ws_check
Adjust minimum length threshold for triggering no-whitespace check.
Applies to: Backend + JS precheck
Params: int $threshold (default 20 )
init_plugin_suite_review_system_repetition_threshold
Adjust repetition threshold for detecting excessive word repetition.
Applies to: Backend + JS precheck
Params: int $threshold (default 8 )
init_plugin_suite_review_system_schema_type
, Book, Product, Course ).
Applies to: Shortcode output
Params: string $type, string $post_type
init_plugin_suite_review_system_schema_data
Modify JSON-LD schema output array.
Applies to: Shortcode output
Params: array $data, int $post_id, string $schema_type
init_plugin_suite_review_system_after_vote
Run custom logic after a single-star vote is submitted.
Applies to: REST /vote
Params: int $post_id, float $score, float $avg_score, int $total_votes
init_plugin_suite_review_system_after_criteria_review
Trigger custom logic after a multi-criteria review is submitted.
Applies to: REST /submit-criteria-review
Params: int $post_id, int $user_id, float $avg_score, string $review_content, array $scores
init_plugin_suite_review_system_get_reaction_types
Customize available reaction types (labels + emojis).
Applies to: Reactions system
Params: array $types
init_plugin_suite_review_system_reaction_meta_key
Customize the meta key used for storing reaction counts.
Applies to: Reaction counts storage
Params: string $meta_key, string $rx_key
init_plugin_suite_review_system_criteria
Override the criteria list for a specific post. 1 applies to both the [init_review_criteria] display and the REST API.
Applies to: Criteria display, REST API, abilities
Params: array|null $criteria, int $post_id
1)
Decide whether the current visitor may read/submit review data for a post. By default: publicly viewable posts, or posts the user can read_post.
Applies to: REST API, abilities
Params: bool $can_view, WP_Post $post
1)
g. only trust the header set by your own reverse proxy).
Applies to: Strict IP check
Params: string $ip
1)
Return false to stop the main front-end stylesheet from being loaded on every page (if you load it yourself).
Applies to: Frontend
Params: bool $enqueue (default true )
1)
Fires after an admin approves, rejects, or deletes reviews (single or bulk).
Params: string $action, int[] $review_ids, int $affected_rows
JavaScript events
Dispatch init-review-system:criteria-loaded on document after injecting review markup via AJAX (safe to fire multiple times). initReviewSystemReactions() ) after injecting a reactions bar.
init_plugin_suite_review_system_ttl
Set TTL (in seconds) for object cache on review queries. 19. Return 0 to disable caching entirely, or any other value to change the duration.
Cache is stored via wp_cache_set with group init_review_system and is automatically invalidated on new review submission and on admin approve/reject/delete.
Applies to: REST get reviews, get total reviews
e. 5 * MINUTE_IN_SECONDS )
License
This plugin is licensed under the GPLv2 or later.
You are free to use, modify, and distribute it under the same license.