PHPackages                             scaramangagency/trustpilot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. scaramangagency/trustpilot

AbandonedArchivedCraft-plugin[API Development](/categories/api)

scaramangagency/trustpilot
==========================

Interact with Trustpilot APIs

1.0.0(4y ago)131MITPHP

Since Oct 20Pushed 3y ago2 watchersCompare

[ Source](https://github.com/scaramangagency/trustpilot)[ Packagist](https://packagist.org/packages/scaramangagency/trustpilot)[ RSS](/packages/scaramangagency-trustpilot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Trustpilot plugin for Craft CMS 3.x
===================================

[](#trustpilot-plugin-for-craft-cms-3x)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.1.0 or later.

Before you begin
----------------

[](#before-you-begin)

The Trustpilot plugin requires a Trustpilot business account that is signed up to the Standard plan, with the Connect module added.

Installing the Trustpilot plugin
--------------------------------

[](#installing-the-trustpilot-plugin)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
    cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
    composer require scaramangagency/trustpilot

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Trustpilot.

You can also visit the [Craft Plugin Store](https://plugins.craftcms.com/), search for *Trustpilot* and click install.

Configuring Trustpilot
----------------------

[](#configuring-trustpilot)

### Assigning user permissions

[](#assigning-user-permissions)

The *Trustpilot* plugin offers granular user permission, which you must add to existing and new user groups.

Define whether a user and/or user group has permission to:

- Manage settings
- View reviews
- Manage comments on reviews
- Send invitations

### Plugin settings

[](#plugin-settings)

The following options are available under the *Settings* tab:

- **Trustpilot username** — Your Trustpilot username.
- **Trustpilot password** — Your Trustpilot password.
- **Trustpilot API Key** — Your Trustpilot API key.
- **Trustpilot API Secret** — Your Trustpilot API secret.

You can learn how to create your API key and API secret by visiting Trustpilot's [own documentation](https://support.trustpilot.com/hc/en-us/articles/207309867-Introduction-to-Trustpilot-APIs#create-api-application-2)

- **Trustpilot website URL** — The website URL attached to your Trustpilot account.
- **Invitation Sender Email** — The email you would like Trustpilot invitations to be sent from.
- **Invitation Sender Name** — The name you would like Trustpilot invitations to be sent from.
- **Invitation Reply-to** — The email address that responses from the invitee should be sent to.

All values can be set to environment variables.

Using Trustpilot in the Control Panel
-------------------------------------

[](#using-trustpilot-in-the-control-panel)

### Invitations

[](#invitations)

#### Send Invitation

[](#send-invitation)

Send an invitation to a customer. Enter their email and name (and optionally a redirect URL, if you wanted to send them to a custom thanks page) and hit ‘Send Invitation’. This will tender an email to be sent within one hour.

You can check that reviews have been tendered by going into your Business account dashboard, and visiting Get Revirws &gt; Overview &gt; See full invitation historu.

#### Generate Review Link

[](#generate-review-link)

Enter a customer name and email, then click generate to get an invitation link. You can then send the link onto your customer manually.

### Reviews

[](#reviews)

Displays all reviews in your Trustpilot account. You can click ‘Add reply’ to add a reply to the review. If you have already added a reply, you can click ‘Edit Reply’ instead, which lets you edit or delete your existing reply.

Using Trustpilot in your templates
----------------------------------

[](#using-trustpilot-in-your-templates)

There are a variety of variables you can use in your templates. Note that each variable returns an object without any styling, so it's on the developer to take those object and add the appropriate markup and styling.

### On Caching

[](#on-caching)

This plugin will make a request to the Trustpilot API for every request. We recommend that the output of the call can be cached either natively with Craft or with a static page cache (which should already be included on your website if it's been efficiently optimised).

### getAllReviews

[](#getallreviews)

Return all reviews.

```
craft.trustpilot.getAllReviews(page, limit, siteId)

```

Field NameDescriptionpageWhen paginating, insert the page you want to retrievelimitFor paginating (or just limiting your result set), select how many reviews to pull from the APIsiteIdThe current site's ID. If you only have one site on your install you can leave this blank, otherwise pass the `siteId` for the site you have added the authorisation to. You can hard-code the site ID if you have only set up authorisation on one of your multi-site installs, otherwise pass the current `siteId` dynamically#### Response

[](#response)

```
{
    "author" => [
        "name" => "Scaramanga Agency",
        "previousReviewCount" => 2
    ],
    "reviewStars" => [
        "count" => 3,
        "image" => "https://api.trustpilot.com/v1/resources/images/stars/3"
    ],
    "reviewTitle" => "Lorem Ipsum Dolor Sit Amet",
    "reviewText" => "Lorem Ipsum Dolor Sit Amet",
    "reviewPosted" => "2021-05-20T09:55:56Z",
    "companyReply" => "Lorem Ipsum Dolor Sit Amet"
}

```

### getProfile

[](#getprofile)

Get your basic profile information.

```
craft.trustpilot.getProfile(siteId)

```

Field NameDescriptionsiteIdThe current site's ID. If you only have one site on your install you can leave this blank, otherwise pass the `siteId` for the site you have added the authorisation to. You can hard-code the site ID if you have only set up authorisation on one of your multi-site installs, otherwise pass the current `siteId` dynamically#### Response

[](#response-1)

```
{
    "websiteUrl" => ""
    "displayName" => "Lorem Ipsum Dolor Sit Amet",
    "trustScore" => 3.6,
    "stars" => 3.5,
    "count" => [
        "total" => 2,
        "oneStar" => 0,
        "twoStars" => 0,
        "threeStars" => 1,
        "fourStars" => 1,
        "fiveStars" => 0
    ]
}

```

### getTrustpilotStarImage

[](#gettrustpilotstarimage)

Get star images for the Trustpilot account set up on the supplied site ID

```
craft.trustpilot.getTrustpilotStarImage(siteId)

```

Field NameDescriptionsiteIdThe current site's ID. If you only have one site on your install you can leave this blank, otherwise pass the `siteId` for the site you have added the authorisation to. You can hard-code the site ID if you have only set up authorisation on one of your multi-site installs, otherwise pass the current `siteId` dynamically#### Response

[](#response-2)

```
{
    "star128x24" => [
        "width" => 128,
        "height" => 24,
        "url" => "//images-static.trustpilot.com/api/stars/3.5/128x24.png"
    ],
    "star256x48" => [
        "width" => 256,
        "height" => 48,
        "url" => "//images-static.trustpilot.com/api/stars/3.5/256x48.png"
    ],
    "star512x96" => [
        "width" => 512,
        "height" => 96,
        "url" => "//images-static.trustpilot.com/api/stars/3.5/512x96.png"
    ],
    "starSvg" => [
        "width" => 128,
        "height" => 24,
        "url" => "//images-static.trustpilot.com/api/stars/3.5/star.svg"
    ],
    "stars" => 3.5
}

```

### getTrustpilotStarText

[](#gettrustpilotstartext)

Get textual representation of the star rating for the Trustpilot account set up on the supplied site ID

```
craft.trustpilot.getTrustpilotStarText(siteId)

```

Field NameDescriptionsiteIdThe current site's ID. If you only have one site on your install you can leave this blank, otherwise pass the `siteId` for the site you have added the authorisation to. You can hard-code the site ID if you have only set up authorisation on one of your multi-site installs, otherwise pass the current `siteId` dynamically#### Response

[](#response-3)

```
{
    "locale": "en-US",
    "string": "Good",
    "stars": 4
}

```

### getTrustpilotPermalinks

[](#gettrustpilotpermalinks)

Get the permalinks (profile URL, embed URL) for the Trustpilot account set up on the supplied site ID

```
craft.trustpilot.getTrustpilotPermalinks(siteId)

```

Field NameDescriptionsiteIdThe current site's ID. If you only have one site on your install you can leave this blank, otherwise pass the `siteId` for the site you have added the authorisation to. You can hard-code the site ID if you have only set up authorisation on one of your multi-site installs, otherwise pass the current `siteId` dynamically#### Response

[](#response-4)

```
{
    "profileUrl"=> "https://www.trustpilot.com/review/XX",
    "evaluateEmbedUrl" => "https://www.trustpilot.com/evaluate/embed/XX",
    "evaluateUrl"=> "https://www.trustpilot.com/evaluate/XX"
}

```

### getTrustpilotIcons

[](#gettrustpiloticons)

Pull the Trustpilot icon resources

```
craft.trustpilot.getTrustpilotIcons()

```

#### Response

[](#response-5)

```
{
    "icon230x230" => [
        "width" => 230,
        "height" => 230,
        "url" => "//images-static.trustpilot.com/api/icons/230x230.png"
    ]
}

```

### getTrustpilotLogos

[](#gettrustpilotlogos)

Pull the Trustpilot logo resources

```
craft.trustpilot.getTrustpilotLogos()

```

#### Response

[](#response-6)

```
{
    "darkBackground": {
        "logo72x18": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo144x36": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo288x72": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo576x144": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logoSvg": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        }
    },
    "lightBackground": {
        "logo72x18": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo144x36": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo288x72": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logo576x144": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        },
        "logoSvg": {
            "url": "//trustpilot.com/image.jpg",
            "width": "400",
            "height": "300"
        }
    }
}

```

---

Brought to you by [Scaramanga Agency](https://scaramanga.agency)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~245 days

Total

2

Last Release

1412d ago

Major Versions

1.0.0 → v2.x-dev2022-06-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6dceab1a706f7546b922c9bacd9168fa94b7ab4e958ed9b36de8a20e296af5f?d=identicon)[scaramangagency](/maintainers/scaramangagency)

---

Top Contributors

[![jsmrtn](https://avatars.githubusercontent.com/u/1694957?v=4)](https://github.com/jsmrtn "jsmrtn (12 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginTrustpilot

### Embed Badge

![Health badge](/badges/scaramangagency-trustpilot/health.svg)

```
[![Health](https://phpackages.com/badges/scaramangagency-trustpilot/health.svg)](https://phpackages.com/packages/scaramangagency-trustpilot)
```

###  Alternatives

[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[craftpulse/craft-typesense

Craft Plugin that synchronises with Typesense

122.7k](/packages/craftpulse-craft-typesense)[jsmrtn/craftagram

Grab Instagram content through the Instagram API

141.3k](/packages/jsmrtn-craftagram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
