Simple Star Rating Block

Description

Show a star rating anywhere, in seconds. Drop the Simple Star Rating Block into any post, page, or custom post type, set a value from 0 to 5 (half and decimal values render as partial stars), and style it to match your site. Ideal for product reviews, recipe ratings, testimonials, and comparison posts.

Ratings can be typed in manually or pulled dynamically from a custom field — including ACF fields — so a rating stored on the post updates the block automatically. Inside a Query Loop, the block always shows the rating of the correct post.

Development Version can be found on: https://github.com/martinjankov/simple-star-rating-block

Features:

  • Manual or dynamic: Type a rating, or bind the block to a custom field on the post — works with custom post types, including those using a custom REST base.
  • ACF Integration: Pull the rating from an ACF field — just enable « Show in REST » on the ACF Field Group (see screenshot 4).
  • Partial stars: Decimal ratings like 4.3 render as precisely filled stars.
  • Accessible: Screen readers announce a clear « Rated 4.5 out of 5 » label instead of empty markup.
  • Your style: Adjust star color and size per block; the stars scale with your typography.
  • Featherweight: A few hundred bytes of CSS, no external assets, no JavaScript on the front end.

Arbitrary section

Additional Information:

For more advanced usage, you can hook into the block’s filters and actions to extend its functionality. This is particularly useful for developers who want to integrate the star ratings with other plugins or custom code.

Support:

If you encounter any issues or have questions, please contact us directly at martin@martincv.com.

Captures d’écrans

Blocs

Cette extension fournit 1 bloc.

  • Simple Star Rating Block Star Rating Block allows you to display star ratings with manually entered value or pulled from a custom field.

Installation

To install the Simple Star Rating Block plugin, follow these steps:

  1. Upload: Upload the plugin files to the /wp-content/plugins/simple-star-rating-block directory.
  2. Activate: Activate the plugin through the ‘Plugins’ screen in WordPress.
  3. Configuration: Configure the settings to suit your needs via the Gutenberg block settings.

FAQ

How do I add a star rating to a post, page or custom post type?

Simply add the « Star Rating Block » from the Gutenberg block inserter, then set your desired rating or link it to a custom field.

Can I customize the appearance of the star ratings?

Yes, you can customize the size, color, and style of the stars through the block settings in the Gutenberg editor.

I don’t see ACF fields in the Custom Field Key List?

To see the ACF fields in the list you need to enable the ACF Group where the field is to show in the REST API. See screenshot 4 on how to do that.

Avis

Il n’y a aucun avis pour cette extension.

Contributeurs/contributrices & développeurs/développeuses

« Simple Star Rating Block » est un logiciel libre. Les personnes suivantes ont contribué à cette extension.

Contributeurs

“Simple Star Rating Block” a été traduit dans 1 locale. Remerciez l’équipe de traduction pour ses contributions.

Traduisez « Simple Star Rating Block » dans votre langue.

Le développement vous intéresse ?

Parcourir le code, consulter le SVN dépôt, ou s’inscrire au journal de développement par RSS.

Journal des modifications

0.3

  • Accessibility: the block now renders with role="img" and a « Rated X out of 5 » label; individual stars are hidden from screen readers
  • Fixed invalid HTML on the frontend (block-level elements inside an inline wrapper)
  • Ratings are now clamped to the 0–5 range, including values pulled from custom fields
  • Correct post is now used when the block renders inside a Query Loop
  • Custom fields now load correctly in the editor for custom post types with a custom REST base
  • Performance: removed ~13KB of unused CSS from the frontend stylesheet
  • Hardened inline style output
  • Compatibility: tested up to WordPress 7.1
    Release Date – 30 July 2026

0.2

  • Bug fix where default custom fields were not showing in the list
    Release Date – 03 January 2025

0.1.1

  • Enabled to successfully pull custom fields from Custom Post Types
    Release Date – 11 August 2024

0.1.0

  • Initial release
    Release Date – 07 July 2024