| 开发者 | gradescom |
|---|---|
| 更新时间 | 2026年12月2日 04:57 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[grades_rating] prints a line such as "4.8 out of 5 from 1,353 reviews" as plain HTML from your server, with no script.gk_pub_...), created in the Grades dashboard under your location's keys.
How it works
Grades Reviews reads the public reviews API of Grades.com and prints your customer reviews in your own theme's design. For the reviews, rating and showcase shortcodes everything happens on your server: the plugin fetches the reviews, caches them, and writes plain HTML, with no JavaScript, no iframe and no request from your visitors' browsers. Only the optional review widgets ([grades_widget]) load from Grades.com in the visitor's browser (see External services).
[grades_reviews] shows a grid or list of reviews, filtered by rating and review site.[grades_rating] prints "4.8 out of 5 from 1,353 reviews".[grades_showcase showcase="..."] shows your Review Showcase: your reviews, picked by rules you set on Grades.com (or count, min_rating, topic, sites, max_age_days, language attributes). Reviews are never shortened, and by default the block links to your Grades.com page (footer_link changes or drops that link).[grades_widget preset="strip|carousel|grid|..."], the "Grades Review Widget" block and the Elementor widget show the Grades.com review widgets (they load from Grades.com, see External services).[grades_widget]: background="transparent" (your colored section shows between the review cards), font="inter|montserrat|open-sans|roboto" (fonts bundled with Grades.com, nothing loads from a third party; or inherit, system, serif), and for the floating badge, pop-ups and tab offset_bottom, offset_side and offset_bottom_mobile (0-200 px, e.g. offset_bottom_mobile="80" above a sticky bar on phones).min_cards="3" on [grades_widget] hides the widget while fewer than 3 reviews qualify (1-10), for example with min_rating="4" on a city page; hide_if_empty then hides its section too.locations="all" (or the ids of the offices a page is about) works on every shortcode, block, Elementor widget and the JSON-LD, with the true combined rating of exactly those locations.aggregateRating for your business (rating and count only, never review text), printed once in the page head; it can join your SEO plugin's entity by @id.grades-reviews/review.php.gk_live_..., scopes reviews:read, reviews:write, companies:read), created at https://my.grades.com/connect?connect=woocommerce. The key is stored with autoload off, sent only from your server and never shown again.[grades_reviews limit="6" min_rating="4" sources="google,yelp" sort="best" layout="grid" show_source="1" show_date="1"]
limit 1-50, default 6min_rating 1-5, default from Settingssources comma separated, default from Settings (empty = all)sort newest (default) or bestlayout grid (default) or listshow_source, show_date 1 or 0max_chars characters shown before "Read more", default 280locations (a key created on a headquarters business) all or location ids, comma separated; default: the key's own businessshow_location 1 puts the office on each review (with locations)[grades_rating] or [grades_rating sources="google" stars="0"] or [grades_rating locations="all"]
Several locations on one site (1.11.0)
Create ONE publishable key on your headquarters (HQ) business at my.grades.com and paste it in Settings > Grades Reviews. Then:
[grades_widget preset="carousel" locations="all"], [grades_rating locations="all"]: every location, with the true combined rating and count.[grades_widget preset="grid" locations="<id>,<id>"] (the location ids are listed in the widget editor's "Which reviews" step at my.grades.com), or a widget saved at my.grades.com with its own choice of locations: [grades_widget widget_id="<saved widget id>"].[grades_showcase showcase="<id>"].show_location="on" (widgets) or show_location="1" ([grades_reviews], [grades_showcase]) names the office on each review.locations, [grades_reviews], [grades_rating], [grades_showcase] and the JSON-LD show the key's own business (as before 1.11.0), while a widget on an HQ key shows all locations by default (as on Grades.com). If Grades.com refuses a value (a location that is not yours), administrators see a short note with the reason where the reviews would be; visitors see nothing.
Movement and layouts (1.15.0)
On [grades_widget], the "Grades Review Widget" block and the Elementor widget:
controls_style on the carousel, spotlight and testimonial: sides (default: round arrows beside the cards), stream (carousel only: a slow continuous row), below (arrows and dots under the cards, the look before) or none (swipe only). Every style swipes on phones.autoplay: Grades.com widgets no longer move by themselves unless you ask (autoplay="on"); the stream moves by default. They pause on hover and stop once a visitor swipes or scrolls.preset="testimonial": one quote at a time on your own section, no card.drawer="on" on the side tab: the reviews open as a full-height drawer on the edge of the page.[grades_widget] with a card layout (carousel, grid, list, masonry, spotlight, wall, video, tab), the "Grades Review Widget" block and the Elementor widget ("Under the widget" section):
rating_position above (over the reviews), below (default) or off (no rating line)footer_link grades (default: your Grades.com page), custom (your own page, set footer_link_url) or none (no link)footer_link_url with footer_link="custom": a full https:// address, up to 300 characters; it opens in a new tab and is not followed (rel="nofollow"). An address that is not valid is dropped and the Grades.com link stays.footer_style bar (default) or text (one quiet line in the widget's font and color)branding on (default) or off (no Grades.com mark; the link reads "Read more reviews")footer_link="custom", footer_link="none" and branding="off" come with Premium.
[grades_showcase] and its block take footer_link and footer_link_url the same way. Example: [grades_widget preset="grid" min_rating="4" rating_position="above" footer_link="custom" footer_link_url="https://example.com/reviews"]. Without these attributes everything looks as before. Your Grades.com plan decides which options take effect (an option outside the plan is simply ignored); visitors without JavaScript get the same link, or none.
Theme override
Create grades-reviews/review.php in your theme. It receives $review (author, rating, site (the review platform: google, yelp, facebook...), source (the same), source_label, text, excerpt, truncated, date, url, response_text, response_date; all text is plain, escape it when printing) and $args.
grades-reviews folder to /wp-content/plugins/, or upload the zip under Plugins > Add New > Upload Plugin.[grades_reviews] to a page, or add the "Grades Reviews" widget to a sidebar.Allow Grades.com for scripts and frames: script-src 'self' https://app.grades.com; frame-src https://app.grades.com (with iframe="1" only frame-src is needed). The widget brings its own styles and fonts inside its frame. The reviews, rating and showcase shortcodes are plain HTML from your server and need style-src 'unsafe-inline', as WordPress itself does.
Every customer whose order reaches the status you chose, unless the order was refunded, canceled or failed by the time the request is due, the customer opted out, your store's consent field says no, or the customer was asked within the cooldown. Nothing depends on what they bought, what they paid or what they might think of you.
Action Scheduler runs on WP-Cron and on admin page loads. On a store with little traffic, a real cron job calling wp-cron.php makes the requests go out on time.
Yes: Test connection on WooCommerce > Grades.com reviews calls the Grades.com API with your key and shows the user, the business and whether review requests can be sent (plan, postal address, paused).
No. The plugin sends it in an X-Grades-Key request header from your server and never prints it. A publishable key can only read your visible reviews anyway.
Every 10 minutes by default (Settings > Grades Reviews > Cache time). "Clear cached reviews" forces a refresh. The Grades API itself updates when your review sources sync.
Visitors see nothing when the key is missing or the API is unreachable; administrators see a notice, and the page source contains an HTML comment such as <!-- grades-reviews: unavailable (http_401) -->. http_401 and http_403 mean a wrong or revoked key, http_429 means rate limiting, request_failed means your server could not reach the API.
Yes. Add hide_if_empty=".your-section" to [grades_widget]: when Grades.com reports that the widget has nothing to show, the plugin hides the closest element with that selector (or only the widget with hide_if_empty="1"). With CSS only: .your-section:has([data-grades-state=empty]){display:none}.
The block is server-rendered and ships without editor JavaScript. On WordPress versions that support PHP-only blocks it appears in the inserter. On older versions use the core "Shortcode" block with [grades_reviews]; the block still renders if it is already in your content or templates.
Only when you switch it on (Settings > Grades Reviews > Structured data; off by default): one JSON-LD block with your business name, your site's URL and an aggregateRating (the rating and the number of ratings). Never a Review item, never review text and never a reviewer's name, for any business. The figures are the true totals of exactly the business named: the key's business, or with "Locations" exactly those locations combined, so name the business (or set the @id of your SEO plugin's entity) that matches. For a healthcare business the same rule applies and the settings screen says so: rating and count only, no review content; leave the box unchecked to print nothing at all.
Google decides that. Its guidelines treat reviews a business collects about itself as self-serving, and it often ignores them for LocalBusiness and Organization markup. The JSON-LD is valid and harmless, but do not expect rich result stars.
Yes, it is off by default. Leave it off if your SEO plugin already outputs a rating for the same business.
wp_kses() stops at a <noscript> element). The link is printed again, its content still escaped.controls_style (sides, stream, below, none) on the carousel, spotlight and testimonial; "Move by itself" now off by default in the block and Elementor (as on Grades.com).preset="testimonial") and drawer="on" for the side tab.[grades_widget], the "Grades Review Widget" block and the Elementor widget take rating_position (above, below, off), footer_link (grades, custom, none), footer_link_url (your own https:// page, with custom), footer_style (bar, text) and branding (on, off) on the card layouts. The rating line and the style work on every plan; on Starter and Pro the Grades.com mark and its link stay ("starter+pro = grades.com branded / premium = can remove"), so your own link, no link and no mark come with Premium. Anything outside your plan is ignored.[grades_showcase] and its block take footer_link and footer_link_url; a link to your own page is marked nofollow, and with none there is no link.min_cards="3" on [grades_widget] hides the widget while fewer than that many reviews qualify (1 to 10), for example on a city page that shows 4 stars and up: a widget with one or two cards can look empty. It then behaves like an empty widget, so hide_if_empty hides it and its section too. A saved widget's own minimum cannot be lowered by the shortcode.[grades_widget widget_id="..."], no preset) now shows exactly as saved: its layout, minimum rating, count, locations and look. Attributes you add override single settings; a min_rating lower than the saved one is ignored (the saved minimum is a floor).mix_locations="off" keeps the newest-first order on a headquarters widget (by default the offices take turns).locations="all" or the ids of some locations on [grades_widget], [grades_reviews], [grades_rating], [grades_showcase], their blocks, the Elementor widget and the JSON-LD (Settings > Structured data > Locations), for a key created on a headquarters business. The rating and count are the true combined figures of exactly those locations. show_location names the office on each review. A saved showcase of any location works with the HQ key.[grades_showcase] and [grades_widget]; visitors still see nothing.@id joins the entity of your SEO plugin, an optional additionalType, and the types MedicalBusiness and ProfessionalService. Rating and count only: never a Review item or review text (a filter that adds one is undone); the settings screen states it for a healthcare business.<div> with its own font size, weight and line height, so theme rules such as article header { font-size: 1.4rem } no longer blow it up. A theme that styled .grades-review header should use .grades-review__head.[grades_widget] reserves the widget's height before the Grades.com script runs, so the page no longer jumps when the widget appears (the carousel, grid, list and masonry follow your column width). The iframe mode (iframe="1") is as tall as the widget too: no blank band under a carousel on desktop.hide_if_empty="1" on [grades_widget] (and "Hide when there is nothing to show" in the block) hides the widget when Grades.com has nothing to show yet; hide_if_empty=".my-section" also hides the closest wrapper with that CSS class, for example your section heading. Themes can listen for the grades:empty event themselves.with_photo="on" on [grades_widget] together with reviewer_picture="photos": only reviews whose reviewer has a photo (where your business confirmed its reviewers' permission on Grades.com; otherwise it is ignored). The rating and review count stay your overall figures.card_style="gradient" ("Grades.com gradient", also in the block and the Elementor widget): the cyan-to-purple ring of the Grades.com review badges as the card border.reviewer_picture="off" (no picture) or reviewer_picture="photos" (the reviewer's photo where your business confirmed its reviewers' permission on Grades.com, initials for everyone else) on [grades_widget] review cards. Initials stay the default.grades_reviews_css filter is stripped of tags (and any "<") before it is added as inline style.wp_print_inline_script_tag() and hex-escaped JSON.wp_kses() right before it is printed; theme widget wrappers with wp_kses_post(); request and form values are sanitized.gradescom, the plugin owner account.[grades_widget], the "Grades Review Widget" block and the Elementor widget: show_summary (a one-line AI summary of your reviews), controls (visitor tabs and filters: sites, stars, sort), sort (newest, highest, lowest), font (inherit, manrope, system, serif), radius (0-24), card_style (bordered, elevated, flat), star_color (hex), translate (show reviews translated into the widget language) and widget_id (a widget saved in your Grades.com dashboard, with its custom CSS). Grades.com uses them only when they are available for your business and plan; otherwise the widget looks exactly as before.[grades_widget] (layout, number of reviews, lowest rating, sites, tags, colors, accent, language, rating display, caption). Inline widgets show live in the Elementor editor; floating ones (badge, pop-ups, side tab) show a note and appear on the published page. Nothing loads unless Elementor is active.grades-reviews-widget), so page builders that cache their output still load it.[grades_widget preset="button"], a "Leave us a review" button to your Grades.com review page (the same page for every visitor).show_reply="on" shows your public reply under each review in the carousel, grid, list, masonry and side tab widgets.theme="auto" follows each visitor's light or dark setting.min_rating still narrows them; the rating and review count next to them always stay your overall figures.accent, a widget takes the accent of your Grades.com review page.[grades_widget preset="pill"]) stays inside the sentence it is placed in instead of breaking the paragraph.[grades_reviews], [grades_showcase], the classic widget and the blocks. Grades.com never sends Yelp review text to websites (rating and link only), so these reviews are left out of the cards, as are reviews without any text; they still count in [grades_rating] and the JSON-LD rating. The list asks for a few more reviews so it still fills up to your limit.[grades_widget] with a publishable key limited to other websites no longer shows an empty box. Admins see why ("Grades.com refused this publishable key for this website...") and visitors get nothing visible, like the other shortcodes.[grades_reviews] shows reviewer names and review ages the same way as [grades_showcase] and the Grades.com widgets ("Jane D.", ages counted in whole days).[grades_rating] on its own line stays inside the content column of block themes such as Twenty Twenty-Five.grades-source-google class. Works with older Grades.com API answers too. Templates get $review['site'] (the platform; source now holds the same value).tags on [grades_widget], [grades_reviews] and [grades_showcase]: show only reviews with one of your review tags, e.g. [grades_widget preset="carousel" tags="service:roofing"] on a Roofing page. A tag with no reviews shows the widget's empty message.preset="pill", a one-line rating pill for a hero or next to a button (variant="plain" without a border, panel="on" opens a small panel of reviews). Free on a claimed Grades.com listing, with the rating strip.show_grade, show_count, show_rating, show_stars, show_rating_word (Excellent, Great, Good), show_source_mark, rating_decimals (1 or 2) and label (a short caption).[grades_widget] and the block: list, masonry, spotlight, summary (your rating with a bar per review site), wall (large reviews that scroll by themselves, for a lobby screen), video (video reviews left on Grades.com), and the floating badge, popup and tab, which sit over your page.lang="es" (Spanish), columns, autoplay, interval, show_dates, show_site, position (left, right), mobile (pop-ups on phones) and height (the wall).[grades_widget preset="strip|carousel|grid"] and the block "Grades Review Widget": the Grades.com review widgets (a rating strip with your grade, a review carousel or a review grid), light or dark, in your accent color. They keep themselves up to date. iframe="1" for themes that strip scripts.[grades_showcase] and the block "Grades Review Showcase": your reviews picked by rules (a saved showcase from your Grades.com dashboard, or count, minimum rating, topic, sites, text length, age, language). Never shortened, with a link to all your reviews.[grades_reviews] (topic, showcase, min_length, max_length, max_age_days, language, seed) switch it to the showcase.show_date="0" now also hides the date of the owner's response.[grades_reviews], [grades_rating], classic widget, server-rendered block, JSON-LD aggregateRating, transient caching.