glitchr / omnireview
Omnireview: what customers say of an establishment elsewhere - its rating, its reviews, replying as the establishment, inviting a customer to review, the link to leave one - whoever hosts them: Google (omnireview/google), Tripadvisor (omnireview/tripadvisor), Trustpilot (omnireview/trustpilot), each
Requires
- php: >=8.2
- symfony/http-client-contracts: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.0
- symfony/cache: ^6.4|^7.0|^8.0
- symfony/cache-contracts: ^3.0
- symfony/config: ^6.4|^7.0|^8.0
- symfony/dependency-injection: ^6.4|^7.0|^8.0
- symfony/http-client: ^6.4|^7.0|^8.0
- symfony/http-kernel: ^6.4|^7.0|^8.0
- twig/twig: ^3.0
Suggests
- omnireview/google: Google: Places API (rating, reviews) and Business Profile API (all reviews, replying, for the owner)
- omnireview/tripadvisor: Tripadvisor Content API: rating, reviews, the link to write one
- omnireview/trustpilot: Trustpilot: TrustScore, reviews, replies and invitations
- symfony/cache-contracts: With Twig: what the functions show kept in a cache, within each platform's terms
- symfony/config: In a Symfony application: the configuration of Omnireview\Bridge\Symfony\OmnireviewBundle
- symfony/dependency-injection: In a Symfony application: the services of Omnireview\Bridge\Symfony\OmnireviewBundle
- symfony/http-kernel: In a Symfony application: Omnireview\Bridge\Symfony\OmnireviewBundle itself
- twig/twig: With Twig: Omnireview\Bridge\Twig\OmnireviewExtension, omnireview_widget() and the others
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-15 13:23:19 UTC
README
One contract for what customers say of an establishment elsewhere - its rating, its reviews, replying as the establishment, inviting a customer to leave one, the link to write one - whoever hosts them: Google, Tripadvisor, Trustpilot.
$google = $registry->rating('google'); // a gateway that gives a rating $rating = $google->rating(new Place('ChIJLU7jZClu5kcR4PcOOO6p3I0')); $rating->value; $rating->count; $rating->url; // 4.6, 128, the place on Google Maps foreach ($registry->reviews('google')->reviews($place, 3) as $review) { $review->author; $review->publishedAt; $review->url; // always shown with them } $registry->get('google')->terms(); // how long it may be kept, how it must be credited
This package holds the contract (GatewayInterface and the capabilities it may give:
RatingInterface, ReviewsInterface, ReplyInterface, InviteInterface, WriteUrlInterface;
GatewayFactory, Registry), the models (Place, Rating, Review, Reply, Invitation,
Terms, Capabilities), a bridge for Symfony and one for Twig. It needs no framework: PHP and
symfony/http-client-contracts. Each platform is a package of its own:
| Package | Gives | Kept | Reviews per call |
|---|---|---|---|
omnireview/google |
rating, reviews, write-url; reply with the owner's access | never (the place ID only) | 5 (Places), 50 (Business Profile, the owner) |
omnireview/tripadvisor |
rating, reviews, write-url | per Tripadvisor's Caching Policy, pages not indexed | 5 |
omnireview/trustpilot |
rating, reviews, write-url; reply and invite with a business user | 24 hours | 100 |
Shown as theirs, never as the site's own
Each gateway declares its platform's terms (Terms): how long what it gives may be kept, how
many reviews one call gives, what must be shown with it (the platform's name or logo, each
author, a link back), whether pages that show it must stay out of search engines - read in each
platform's documentation, with the address they were read at (Terms::$source).
The Twig bridge keeps to them: a rating and its reviews are always shown with their origin,
their date and their link, kept in the cache no longer than the platform allows - and
never as JSON-LD: reviews collected by a third party are not the site's to mark up as its own
AggregateRating (see Google's review snippet guidelines).
Documentation
- Installation and a first rating
- Models
- Gateways: the contract, what each gives, writing one
- Symfony and Twig
- The Docker harness: bare PHP, the console
Plain PHP
composer require glitchr/omnireview omnireview/google
$registry = new Registry([new GoogleGatewayFactory()], [ 'google' => ['factory' => 'google', 'options' => ['api_key' => getenv('GOOGLE_PLACES_KEY'), 'language' => 'fr']], ]);
No bundle, no container: a factory per platform package, the registry built by hand.
Symfony
Omnireview\Bridge\Symfony\OmnireviewBundle does that wiring, and registers the Twig functions
(docs/symfony.md); its components are not required by this package.
omnireview: gateways: google: { factory: google, options: { api_key: '%env(GOOGLE_PLACES_KEY)%', language: fr } }
{{ omnireview_widget('google', place_id) }}
Docker
cd docker && cp .env.dist .env docker compose run --rm omnireview gateways docker compose run --rm omnireview bare # plain PHP: no bundle, no container, and what PHP loaded docker compose run --rm omnireview test
Responsibility
glitchr/omnireview and its omnireview/* providers are independent, unofficial clients: none is
affiliated with, endorsed by or sponsored by the services it reaches. Each service keeps its own
terms (keys, display and attribution rules, caching limits, quotas), named with a link in the
"Responsibility" section of the README of each provider that reaches one. The MIT licence covers
this code only and grants no right to any service or to its data.
Whoever installs and runs these packages is responsible for complying with those terms, for obtaining whatever they require, and for any use made of what they return. The authors publish them free of charge, make no commercial use of them, and accept no liability for how they are used (see LICENSE).
License: MIT since 2026-10-09; earlier versions remain published under LGPL-3.0-or-later.