承接 anytech/silverstripe-google-reviews 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anytech/silverstripe-google-reviews

Composer 安装命令:

composer require anytech/silverstripe-google-reviews

包简介

elemental block for silverstripe 5 to import and display google reviews using the places api v1

README 文档

README

Elemental block for SilverStripe 5 to import and display Google Reviews using the Google Places API v1.

Features

  • Imports Google Reviews automatically via a CronTask
  • Displays reviews in a configurable Elemental block
  • Controls for minimum star rating, newest/highest order, and result limit
  • SiteConfig fields for API key, Place ID, language, and rating filter

Requirements

  • silverstripe/framework ^5
  • dnadesign/silverstripe-elemental ^5
  • silverstripe/crontask ^3

Installation

composer require anytech/silverstripe-google-reviews

Rebuild and flush: vendor/bin/sake dev/build flush=all

Configuration

Already included _config/anytech-googlereviews.yml:

---
Name: anytech-googlereviews
After:
  - '#coreconfig'
  - '#elementalconfig'
---
SilverStripe\SiteConfig\SiteConfig:
  extensions:
    - anytech\googlereviews\Extensions\SiteConfigGoogleReviewsExtension

SilverStripe\Dev\CronTask\CronTaskController:
  tasks:
    - anytech\googlereviews\Tasks\GoogleReviewsSyncTask

SilverStripe\Core\Injector\Injector:
  Psr\SimpleCache\CacheInterface.appGoogleReviews:
    factory: SilverStripe\Core\Cache\CacheFactory
    constructor:
      namespace: "appGoogleReviews"

Setup

  1. In CMS, go to Settings → Google Reviews.
  2. Enter:
    • Places API Key
    • Place ID
    • Language (e.g. en, en-CA)
    • Optional: Minimum rating to import
  3. Enable Places API (New) in Google Cloud:
    https://console.developers.google.com/apis/api/places.googleapis.com/overview

Cron Sync

Task class: anytech\googlereviews\Tasks\GoogleReviewsSyncTask

Run manually: vendor/bin/sake dev/tasks/GoogleReviewsSyncTask

Elemental Block

Class: anytech\googlereviews\Elements\GoogleReview

CMS Options

  • Max reviews to show
  • Minimum stars
  • Order: Newest / Highest Rated
  • Show avatar
  • Show relative time

Template

Create themes/<yourtheme>/templates/GoogleReviews.ss:

<% if $ShowTitle %>

$Title

<% end_if %> <% loop $Reviews %> <% if $Top.ShowAvatar && $AuthorPhotoURL %> $AuthorName.ATT <% end_if %>
      <div class="meta">
        <strong class="author">
          <% if $AuthorURL %>
            <a href="$AuthorURL" rel="nofollow noopener" target="_blank">$AuthorName</a>
          <% else %>
            $AuthorName
          <% end_if %>
        </strong>

        <% if $Top.ShowRelativeTime && $RelativeTime %>
          <span class="when">$RelativeTime</span>
        <% end_if %>

        <span class="stars" aria-label="Rating $Rating out of 5">
          <% if $Rating >= 1 %>★<% end_if %>
          <% if $Rating >= 2 %>★<% end_if %>
          <% if $Rating >= 3 %>★<% end_if %>
          <% if $Rating >= 4 %>★<% end_if %>
          <% if $Rating >= 5 %>★<% end_if %>

          <% if $Rating < 5 %>
            <% if $Rating < 5 %><% if $Rating < 4 %><% if $Rating < 3 %><% if $Rating < 2 %><% if $Rating < 1 %><% end_if %><% end_if %><% end_if %><% end_if %><% end_if %>
          <% end_if %>
        </span>
      </div>
    </header>

    <p class="text">$Text.XML</p>
  </article>
<% end_loop %>

Optional CSS:

  • client/css/google-reviews.css (exposed via extra.expose)

Error Handling

If Google returns an error JSON block, the sync task echoes the code, status, and message for debugging. Example:

{
  "error": {
    "code": 403,
    "status": "PERMISSION_DENIED",
    "message": "Places API (New) has not been used in this project or it is disabled…"
  }
}

Fix by enabling the API and retrying after propagation.

Directory Structure

src/
  Elements/
    GoogleReview.php
  Extensions/
    SiteConfigGoogleReviewsExtension.php
  Models/
    GoogleReview.php
  Tasks/
    GoogleReviewsSyncTask.php
client/
  css/
    google-reviews.css
_config/
  anytech-googlereviews.yml
composer.json
README.md

License

MIT License — © Kayne Middleton

MIT summary

  • Permissive. Use, modify, distribute, and sublicense commercially.
  • Must keep copyright and license notice.
  • Provided “as is,” no warranty or liability.

anytech/silverstripe-google-reviews 适用场景与选型建议

anytech/silverstripe-google-reviews 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 102 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 anytech/silverstripe-google-reviews 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 anytech/silverstripe-google-reviews 我们能提供哪些服务?
定制开发 / 二次开发

基于 anytech/silverstripe-google-reviews 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 102
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-10