=== Star Rating Block ===
Contributors:      snehalpancholi
Tags:              star rating, rating block, gutenberg, review, stars
Requires at least: 6.2
Tested up to:      6.7
Requires PHP:      8.1
Stable tag:        1.0.0
License:           GPL-2.0+
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

A lightweight Gutenberg block for displaying star ratings. Supports full, half, and empty stars with full colour and size customisation. No build step.

== Description ==

**Star Rating Block** adds a native Gutenberg block that lets you display a star rating anywhere in your content. The block supports half-star precision, custom colours for filled and empty states, an optional text label, and an optional numeric display. It is rendered on the server so it works perfectly with full-site editing, page caching, and REST API endpoints.

**Key features:**

* Full, half, and empty star SVG rendering
* Rating from 0 to 10 stars in 0.5 increments
* Configurable maximum stars (1–10)
* Custom fill colour and empty colour via colour picker
* Adjustable star size (12–64 px)
* Optional text label — position above or inline with the stars
* Optional numeric display e.g. (4/5)
* Server-side rendered — no JavaScript required on the frontend
* No external dependencies, no build step, no jQuery
* Accessible: `role="img"` with descriptive `aria-label`
* CSS variables for easy theme overrides

== Installation ==

1. Upload the `star-rating-block` folder to `/wp-content/plugins/`.
2. Activate the plugin through **Plugins → Installed Plugins**.
3. In the block editor, search for **Star Rating Block** or browse the **Text** category.
4. Insert the block and configure it in the right-hand **Block** panel.

== Frequently Asked Questions ==

= Does this block require a page builder? =
No. It works natively inside the WordPress block editor (Gutenberg) available since WordPress 5.0.

= Can I use half stars? =
Yes. The rating attribute accepts 0.5 increments. Set the Rating control to any value such as 3.5 and a half star will appear automatically.

= Does it work with full-site editing (FSE)? =
Yes. The block is server-side rendered and works anywhere blocks are supported, including site editor templates.

= Can I style the stars with my theme's CSS? =
Yes. The block applies CSS custom properties (`--srb-star-color`, `--srb-empty-color`, `--srb-star-size`) to the wrapper element. You can override these in your theme stylesheet.

= Does this block store any data in the database? =
Block attributes are stored in post content as block comment delimiters, which is standard WordPress block behaviour. The plugin itself stores no options and creates no database tables.

= Is this block accessible? =
Yes. The star container uses `role="img"` with a descriptive `aria-label` (e.g. "4 out of 5 stars") so screen readers convey the rating meaningfully.

== Screenshots ==

1. Block in the editor with Inspector Controls open showing rating, colour, and size options.
2. Frontend output with an inline label and numeric display.
3. Half-star example showing 3.5 out of 5.

== Changelog ==

= 1.0.0 =
* Initial release.
* Full, half, and empty SVG star rendering.
* Colour and size controls via Inspector Controls.
* Label (above / inline) and numeric display options.
* Server-side render callback for cache-friendly output.
* Accessible markup with ARIA roles.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade steps required.
