Simple lightweight shortcode to add 5-star ratings anywhere.
Add accessible, attractive 5-star ratings anywhere on your site with a simple shortcode. The plugin uses Font Awesome icons via their SVG + JavaScript method.
This plugin is based on Hugh Lashbrooke’s Starter Plugin, a robust and GPL-licensed code template for creating a standards-compliant WordPress plugin.
<i>
or <span>
elements in HTML output[rating stars="3.0"] (Displays 3 stars out of 5)
[rating stars="2.5"] (Displays 2½ stars out of 5)
[rating stars="4.0"] (Displays 4 stars out of 5)
[rating stars="5.5"] (Incorrect usage but will display 5 stars out of 5)
In the 2nd example, the raw output will be like this before processing:
<span class="fsrs"> <span class="fsrs-stars"> <i class="fsrs-fas fa-fw fa-star"></i> <i class="fsrs-fas fa-fw fa-star"></i> <i class="fsrs-fas fa-fw fa-star-half-alt"></i> <i class="fsrs-far fa-fw fa-star"></i> <i class="fsrs-far fa-fw fa-star"></i> </span> <span class="hide fsrs-text fsrs-text__hidden" aria-hidden="false">2.5 out of 5</span> <span class="lining fsrs-text fsrs-text__visible" aria-hidden="true">2.5</span> </span><h3>Translations</h3>
* English: Default language, always included
Would you like to help translate Five-Star Ratings Shortcode into your own language? You can do that here!
This plugin includes these third-party libraries in its package.
/wp-content/plugins/
directoryThis plugin adds accessible, attractive 5-star ratings anywhere on your site with a simple shortcode. The plugin uses Font Awesome icons via their SVG + JavaScript method.
I’d love to hear your feedback. In particular, tell me about your experience configuring the plugin. Are the instructions clear? Do I need to reword them? Did I leave out something crucial? You get the drift.
I’m looking for collaborators to improve the code. If you are an experienced WordPress programmer, hit me up!
Feel free to send a donation to my Paypal account. Or buy me a beer if you’re in town.
creation of dynamic property is deprecated error
function add_menu_item()
to avoid undefined variable $page
function register_settings()
since incorrect nesting means output can never happen( is_a( $post, 'WP_Post' )
check to enqueue_fa_scripts()
to prevent non-object error2021-01-07
Tested up to WordPress 5.6
BUGFIX: fix undefined variable