PluginProbe ʕ •ᴥ•ʔ
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More / 2.10.0
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More v2.10.0
2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.7 2.6.8 2.6.5 2.6.4 2.6.3 2.6.2 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1 1.1.1 1.1.2 1.2.0 2.0 2.1.0 2.1.1 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1
reviews-feed / templates / frontend / post-elements / rating.php
reviews-feed / templates / frontend / post-elements Last commit date
extras 3 weeks ago rating-extras 3 weeks ago rating.php 3 weeks ago text-aliexpress.php 3 weeks ago text-booking.php 3 weeks ago text.php 3 weeks ago
rating.php
50 lines
1 <?php
2
3 /**
4 * Smash Balloon Reviews Feed Rating Template
5 * Adds a star rating, plus a per-provider rating-replacement slot when
6 * the provider's design substitutes stars with a different element
7 * (Booking score badge, Facebook recommendation chip, etc.). The legacy
8 * star block is kept in DOM for backwards compatibility — providers that
9 * substitute it hide `.sb-item-rating-ctn` via CSS scoped to their
10 * `.sbr-provider-<name>` wrapper class (see assets/css/sbr-styles.css).
11 *
12 * @version 1.0 Reviews Feed by Smash Balloon
13 *
14 */
15
16 if (!defined('ABSPATH')) {
17 exit; // Exit if accessed directly
18 }
19
20 $provider_name = $post['provider']['name'] ?? '';
21 ?>
22 <div class="sb-item-rating sb-fs">
23 <span class="sb-relative">
24 <div class='sb-item-rating-ctn'>
25 <?php
26 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Method returns safe SVG HTML
27 echo $this->star_rating_display($post, $settings);
28 ?>
29 </div>
30 </span>
31 <?php
32 // SMASH-782 Phase 2 — per-provider rating-slot inject. Booking renders
33 // a score badge (e.g. "8.7 Very Good") that REPLACES the stars per the
34 // prototype design. The legacy `.sb-item-rating-ctn` above stays in
35 // DOM but is hidden by provider-scoped CSS. Other providers that need
36 // the same treatment in the future drop a file here following the
37 // `rating-extras/<provider>.php` convention.
38 // Whitelist the provider slug (same rationale as item.php — keep raw
39 // `$post['provider']['name']` away from path interpolation).
40 if ($provider_name !== '' && preg_match('/^[a-z][a-z0-9_-]*$/', $provider_name)) {
41 $rating_extras_path = trailingslashit(SBR_PLUGIN_DIR)
42 . 'templates/frontend/post-elements/rating-extras/'
43 . $provider_name . '.php';
44 if (file_exists($rating_extras_path)) {
45 include $rating_extras_path;
46 }
47 }
48 ?>
49 </div>
50