Jake Vanderwerf
7 days ago 46d681c6b825d21b3f698d793c4e630c687d90ad
build/gmbreviews/render.php
@@ -17,6 +17,8 @@
   if ($inheritUser) {
      global $post;
      $inheritUser = $post->post_author;
   }else {
      $inheritUser = null;
   }
   try {
      $gmb = JVB()->connect('gmb', $inheritUser);
@@ -55,12 +57,12 @@
      ob_start();
      ?>
      <div class="gmb-reviews">
         <div class="row btw">
         <div class="row center">
         <?php
         if ($showStats && !empty($average) && !empty($total)) {
            ?>
            <p>
               <span class="stars" aria-label="<?= $average ?> out of 5 stars">
               <span class="stars" title="<?= $average ?> out of 5 stars">
                  <?php
                  $fullStars = floor($average);
                  $hasHalfStar = ($average - $fullStars) >= 0.5;
@@ -89,20 +91,21 @@
         }
         ?>
      </div>
         <?php
         if ($showReviewLink && !empty($reviewUrl)) {
            ?>
            <a href="<?=esc_url($reviewUrl)?>"
               class="button"
                  target="_blank"
               rel="noopener noreferrer">
               class="button"
               target="_blank"
               rel="noopener noreferrer">
               <?= jvbIcon('star', ['style' => 'fill']) ?>
               Leave Your Review
            </a>
            <?php
         }
         ?>
      </div>
      <ul>
         <?php
@@ -131,7 +134,7 @@
                        <?= apply_filters('wpautop', $comment) ?>
                     </div>
                  <?php } ?>
                  <cite class="row start nowrap">
                  <cite class="row left nowrap">
                     <?php if (!empty($profilePhoto)) { ?>
                        <img src="<?=esc_url($profilePhoto)?>"
                            alt="<?=esc_attr($reviewer)?>"
@@ -142,7 +145,15 @@
                        </div>
                     <?php } ?>
                     <div class="row start wrap">
                     <div class="row left wrap">
                        <?php if ($showRating && $rating > 0) { ?>
                           <div class="stars" title="<?= $rating ?> out of 5 stars">
                              <?php
                              for ($i = 1; $i <= 5; $i++) {
                                 echo ($i <= $rating) ? jvbIcon('star', ['style' => 'fill']) : jvbIcon('star', ['style' => 'light']);
                              } ?>
                           </div>
                        <?php } ?>
                        <p><?= esc_html($reviewer)?></p>
                        <?php
                        // Date
@@ -153,14 +164,7 @@
                              <?= esc_html($formatted_date) ?>
                           </time>
                        <?php } ?>
                        <?php if ($showRating && $rating > 0) { ?>
                           <div class="stars" aria-label="<?= $rating ?> out of 5 stars">
                              <?php
                              for ($i = 1; $i <= 5; $i++) {
                                 echo ($i <= $rating) ? jvbIcon('star', ['style' => 'fill']) : jvbIcon('star', ['style' => 'light']);
                              } ?>
                           </div>
                        <?php } ?>
                     </div>
                  </cite>
               </blockquote>