| 开发者 | brokensmile.2103 |
|---|---|
| 更新时间 | 2025年11月5日 19:23 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
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. Now with multi-criteria reviews and an emoji reactions system for richer user interaction.
This plugin is part of the Init Plugin Suite — a collection of minimalist, fast, and developer-focused tools for WordPress.
GitHub repository: https://github.com/brokensmile2103/init-review-system
Highlights:
/wp-content/plugins/Not by default. You can enable it in plugin settings.
Yes. You can enable strict IP check to prevent duplicate votes.
Yes, it works with any post type that uses the_content() or comment_form().
Yes. You can define up to 5 custom criteria and show them using the provided shortcode.
No. The plugin currently supports only a 5-star scale.
init_plugin_suite_review_system_get_reviews_by_user_id()paged, per_page) just like the post-based fetcherwp_posts to exclude orphaned reviewscriteria_scores for direct UI renderinginit_plugin_suite_review_system_get_total_pages_by_user_id()status)1 for UX consistency)absint(), max(), typed values)$wpdb->prepare() — no unbound parametersTotal = Avg × Count (rounded to 2 decimals)esc_html() / esc_attr()) following PHPCSedit_others_posts (Editor+) can view or interact with the metaboxsave_post handler validates nonce + capability, protects against unauthorized POST submissionssanitize_text_field( wp_unslash() ) before casting to float/int<style> tags — every style moved to inline attribute (WordPress admin standard)Require double-click to rate.hovering.hovering class persists across mouseleave while pendinginit_plugin_suite_review_system_get_reviews_by_post_id():$post_id = 0, orphaned reviews are now automatically excluded (posts that no longer exist across all CPTs).[init_review_criteria] enhanced:paged to control review pagination.$paged dynamically to init_plugin_suite_review_system_get_reviews_by_post_id()..init-review-inline-msg for messages, .init-review-criteria-error for criteria validation (with dark mode support)/reactions/toggle now requires login: enforced is_user_logged_in() and nonce validationpermission_callback for /reactions/toggle now only allows logged-in users[init_reactions] updated: require_login is always true, ensuring consistent frontend behaviordisabled state for buttons; guest users always see counts but cannot interact.is-disabled style keeps emoji + counts fully visible, while visually indicating login requirementaria-pressed accurately and support is-active state for current user reactionid for total counter span (irs-total-reactions-{post_id}) to support JS live updates.init-reaction-total (font weight, spacing, responsive display)aria-live="polite" for screen reader updatesinit_reactions table (user↔post map)init_plugin_suite_review_system_get_reaction_typesinit_plugin_suite_review_system_reaction_meta_keydbDelta()esc_html(), esc_attr(), and wp_kses() for frontend safetyuninstall.php to clean up plugin options when uninstalledreadme.txt[init_review_system] for 5-star voting block[init_review_score] for average score display/wp-json/initrsys/v1/vote with conditional login and nonce checklocalStorage for guest usersAggregateRating