| 开发者 | prototipo88 |
|---|---|
| 更新时间 | 2026年7月6日 03:19 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[riaco_reviews] shortcode on any page or widget area.
Every review is a native WordPress post with its own star rating, author, avatar, review date, source platform, and product. Display options, layout, card style, and colours are all configurable directly from the block inspector panel — no CSS editing required.
Why RIACO Reviews?
ServerSideRender. All settings in the Inspector sidebar.[riaco_reviews] — use it in any page, post, widget area, or theme template.auto-fill grid; column count adapts automatically to available width.break-inside: avoid; same adaptive behaviour.--riaco-card-min-width CSS custom property that drives both layouts.product="my-product-slug" (comma-separated slugs for multiple products).Review structured data in a <script type="application/ld+json"> tag in the page footer — no setup required.Review object with reviewBody, reviewRating, author, datePublished, url, and itemReviewed.itemReviewed is driven by the product assigned to the review: set a URL and a schema.org type (Product, SoftwareApplication, LocalBusiness, Organization, Book, Movie, Course, Event, or the generic Thing) on each product in Reviews → Products.itemReviewed.name with type Thing.@graph array — one <script> tag regardless of how many shortcodes are on the page.riaco_reviews_json_ld_data filter to modify or suppress the structured data for individual reviews.riaco_reviews_atts — filter display attributes before renderingriaco_reviews_query_args — modify the WP_Query before it runs (add tax queries, post__in, etc.)riaco_reviews_card_meta — add or modify per-review metadata before the card template receives itriaco_reviews_card_template_path — swap in a custom card template per style or per postriaco_reviews_before_card / riaco_reviews_after_card — inject markup around individual cardsriaco_reviews_before_loop / riaco_reviews_after_loop — inject markup around the whole reviews wrapperriaco_reviews_no_reviews_html — replace the empty-state messageriaco_reviews_layouts / riaco_reviews_card_styles / riaco_reviews_orderby_options — register custom values for layout, card style, and sort orderriaco_reviews_init / riaco_reviews_loaded — plugin lifecycle actions for third-party extensionsriaco_reviews_block_render_atts — map additional Gutenberg block attributes into the render pipelineriaco_reviews_json_ld_data — modify or suppress the structured data object for a single review before it is collected[riaco_reviews]
All parameters:
[riaco_reviews count="6" layout="grid" card_style="default" orderby="date" order="DESC" product="" show_title="1" show_author_name="1" show_avatar="1" show_date="1" show_rating="1" show_source="1" show_product="1" show_shadow="1" min_width="300"]
Colour and typography:
[riaco_reviews card_bg="#ffffff" card_text_color="#444444" card_border_color="#e4e4e7" star_color="#f59e0b" product_bg="#f4f4f5" product_text_color="#18181b" font_size="0.9375" line_height="1.7"]
riaco-reviews folder to the /wp-content/plugins/ directory, or install the plugin through the Plugins > Add New screen in WordPress.[riaco_reviews] to any post, page, or widget area.Yes, RIACO Reviews is completely free and open source under the GPLv2 or later licence.
Yes. The plugin registers a native Gutenberg block (riaco-reviews/reviews-block) with a live server-side preview in the editor. All display settings are in the Inspector sidebar — no shortcode needed when using the block editor.
Yes. Use [riaco_reviews] in any post, page, widget area, or PHP template. All the same options available in the block are available as shortcode attributes.
Go to Reviews > Add New in the WordPress admin. Enter the review headline as the post title and the review text as the main content. Use the Review Details meta box to set the author name, avatar, star rating, review date, and a link to the original source. Assign a Source (platform) and a Product from the sidebar dropdowns.
Go to Reviews > Sources and add a new source. Upload a logo image using the Logo / Image field — the WordPress media uploader is integrated. SVG files are supported for source logos. The logo will appear in the card header (Default and Modern styles) or as text in the Minimal style.
Three styles are available:
Yes. From the block editor Inspector sidebar, open the Card Colours or Typography panel to set card background, text, border, star, and product badge colours, as well as font size and line height. The same options are available as shortcode attributes. All values are injected as CSS custom properties on the wrapper element so they scope to that specific block instance.
Yes. Both the Grid and Masonry layouts use CSS auto-fill / column-width with a configurable minimum card width (default 300 px). Columns are added or removed automatically based on the available container width — no fixed breakpoints are used.
Yes. Every field has an individual show/hide toggle — available both in the block editor Inspector sidebar and as shortcode attributes (show_avatar, show_date, show_rating, etc.). For example, to hide the review date: [riaco_reviews show_date="0"].
Yes. Set orderby="rating" in the shortcode or choose By rating in the block editor Sort Order panel. You can also sort by date (newest or oldest first) or random.
Go to Reviews > Products and create a product entry for each product or subject. When editing a review, select the appropriate product from the Product dropdown in the sidebar. The product name appears as a pill badge on the card.
Yes. Use the product attribute in the shortcode — pass the product slug (the URL-friendly version of the product name):
[riaco_reviews product="my-plugin"]
For multiple products (show reviews matching any of them), pass a comma-separated list:
[riaco_reviews product="plugin-one,plugin-two"]
In the block editor, open the Display Settings panel and choose a product from the Filter by Product dropdown. Selecting "— All Products —" removes the filter.
Yes, using the riaco_reviews_query_args filter. This gives you access to the full WP_Query args array before the query runs — add taxonomy queries, post__in, meta queries, or any other WP_Query parameter. Example:
add_filter( 'riaco_reviews_query_args', function( $args, $atts ) { $args['tax_query'] = [ [ 'taxonomy' => 'riaco_review_product', 'field' => 'slug', 'terms' => 'my-product' ] ]; return $args; }, 10, 2 );
Yes. The plugin automatically outputs schema.org Review structured data in the page footer for every review rendered by a block or shortcode. No configuration is required — the data is picked up by Google and other search engines automatically.
To get the most out of rich results, go to Reviews → Products, edit each product, and set:
Product for physical or digital products, SoftwareApplication for apps and plugins, LocalBusiness for shops and services, etc. Leave it as Thing if unsure.Review object — this is expected and valid. You can validate the structured data with Google's Rich Results Test.
To suppress or modify the structured data for a specific review, use the riaco_reviews_json_ld_data filter (return false to suppress).
Yes. Use the riaco_reviews_card_template_path filter to return the path to your own PHP template file. The filter receives the default path, the card style slug, the post ID, and the meta array, so you can switch templates per style or per review.
No. Activation flushes the rewrite rules so the custom post type and taxonomies register correctly; deactivation flushes them again so the CPT slug is removed cleanly. No custom database tables are created. All review data is stored as standard WordPress post meta.
The plugin loads its CSS only on pages where the block or shortcode is present (wp_enqueue_block_style and on-demand shortcode enqueueing). The block uses server-side rendering, so no JavaScript is loaded on the frontend. All images use the loading="lazy" attribute.
Yes. All user-facing strings are wrapped in WordPress i18n functions and the text domain is riaco-reviews. A .pot file is included in the languages/ directory.
sanitize_text_field() around nonce values read from $_POST in Admin, ReviewSource, and ReviewProduct — resolves PHPCS InputNotSanitized warnings.$plugin variable to $riaco_reviews_plugin to avoid naming conflicts with other plugins.strtotime() truthiness guard in all three card-style templates from if ($ts) to if (false !== $ts) — reviews dated 1970-01-01 now display their date correctly on the frontend.number_format() with number_format_i18n() for the compact star-rating value in the Modern card style.riaco_review_tag renamed to riaco_review_product; the admin menu now shows Reviews → Products instead of Tags.tag → product, show_tag → show_product, tag_bg → product_bg, tag_text_color → product_text_color. Old tag= attribute still accepted for backward compatibility.tagFilter → productFilter, showTag → showProduct, tagBg → productBg, tagTextColor → productTextColor. Old saved blocks continue to render correctly via a compatibility shim..riaco-reviews__card-tag → .riaco-reviews__card-product; --riaco-tag-* custom properties → --riaco-product-*._riaco_tag_url / _riaco_tag_type term meta keys — no manual action needed.Review structured data automatically in the page footer for every rendered review, enabling Google rich results with no configuration.itemReviewed in the structured data is as accurate as possible.riaco_reviews_json_ld_data filter: modify or suppress the JSON-LD object for individual reviews before output.<script> tag with a @graph array rather than one script per shortcode.:focus-visible outlines to all interactive links; improved colour contrast on muted text (date, author handle, source name) to meet WCAG 2.1 AA.prefers-color-scheme: dark (overrideable via block/shortcode colour controls).prefers-reduced-motion guard.heading_level attribute/parameter (default 3) lets you control the HTML heading tag for review titles across block and shortcode.[riaco_reviews] parameters and defaults.strtotime() truthiness check corrected to false !== $ts to handle edge-case epoch dates.manage_categories to manage_options.title attribute added to truncated author names and product badges so full text is accessible on hover.tag shortcode attribute and tagFilter block attribute (renamed to product / productFilter in v1.2.0) let you show only reviews assigned to a specific tag.riaco_review with dedicated admin list table (Author, Rating, Source, Product, Review Date columns).[riaco_reviews] with full attribute support.