Download the PHP package justinholtweb/craft-stars without Composer
On this page you can find all versions of the php package justinholtweb/craft-stars. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justinholtweb/craft-stars
More information about justinholtweb/craft-stars
Files in justinholtweb/craft-stars
Package craft-stars
Short Description Review & testimonial management for Craft CMS — star ratings, moderation, schema.org markup, and spam protection.
License proprietary
Informations about the package craft-stars
Stars — Reviews & Comments for Craft CMS 5
A structured reviews and comments system for Craft CMS: star ratings, threaded comments, four-state moderation, pros/cons, admin responses, a submitter blocklist, pluggable captcha, spam protection, and schema.org JSON-LD markup.
Requirements
- Craft CMS 5.0+
- PHP 8.2+
Installation
Features
- Star ratings — configurable max (1-5 or 1-10)
- Threaded comments — a full comment system on entries with configurable reply depth
- Four-state moderation — pending, approved, rejected, spam (reviews and comments)
- Pros & cons — optional structured pro/con lists per review
- Admin responses — reply to reviews from the CP with timestamp
- Blocklist — block submitters by email, IP, or user id
- Pluggable captcha — reCAPTCHA v3, reCAPTCHA v2, hCaptcha, or Cloudflare Turnstile
- Spam protection — honeypot, per-IP rate limiting, submission time check
- Login gating — optionally require login (and auto-fill author details)
- Schema.org — JSON-LD output with
Review+AggregateRatingmarkup - Email notifications — new submissions to moderators, replies to comment authors
- User permissions — separate permission tiers for reviews, comments, and the blocklist
- Bulk actions — approve, reject, mark as spam, block author
- Craft 5 native element editor — sidebar fields, metadata, element chips
Usage
Frontend Form
With Pros & Cons
AJAX Submission
Displaying Reviews
Rating Distribution
Schema.org Markup
Place in your <head> to output valid JSON-LD for Google Rich Results:
Twig API Reference
| Method | Returns | Description |
|---|---|---|
craft.reviews.forEntry(entry) |
ReviewQuery |
Approved reviews for an entry, newest first |
craft.reviews.averageRating(entry) |
float |
Average rating (approved only) |
craft.reviews.count(entry) |
int |
Count of approved reviews |
craft.reviews.distribution(entry) |
array |
{1: n, 2: n, ...} rating histogram |
craft.reviews.schemaOrg(entry) |
string |
JSON-LD <script> tag |
All methods accept an Entry object or an entry ID integer.
Comments
Stars also provides a threaded comment system on entries, with the same moderation, spam protection, and login-gating as reviews.
Comment Form
Displaying Comments
The simplest way to render a full nested thread is the bundled recursive macro,
fed by craft.comments.tree(entry):
Or build it yourself — each comment in the tree exposes its replies via
.children:
Reply nesting is capped by the Max Comment Depth setting; deeper replies are automatically attached at the deepest allowed level.
craft.comments API
| Method | Returns | Description |
|---|---|---|
craft.comments.tree(entry) |
Comment[] |
Approved comments as a nested tree (replies on .children) |
craft.comments.forEntry(entry) |
CommentQuery |
Approved comments for an entry, oldest first |
craft.comments.topLevel(entry) |
CommentQuery |
Approved top-level comments (no replies) |
craft.comments.replies(comment) |
array |
Approved replies to a comment |
craft.comments.count(entry) |
int |
Count of approved comments |
Configuration
All settings are available in the CP under Stars > Settings. You can also override them in config/stars.php:
Permissions
| Permission | Description |
|---|---|
stars:viewReviews |
View the Reviews section in the CP |
stars:manageReviews |
Create and edit reviews |
stars:moderateReviews |
Approve, reject, and mark as spam |
stars:respondToReviews |
Add admin responses |
stars:deleteReviews |
Delete reviews |
Admin users have all permissions by default.
Events
The plugin uses standard Craft element events. You can listen for review saves, deletes, etc.:
Development
The plugin ships with a test suite built on Codeception and Craft's test framework. DDEV provides PHP and a database (no local PHP install required):
The suite boots a real Craft application, installs the plugin (running its migration), and exercises the services against a live database.
Roadmap
- Verified purchase badge
- Review voting (helpful/not helpful)
- Media attachments (photos)
- Import/export tools
- GraphQL support