PHPackages                             abderrahimghazali/sylius-social-proof-plugin - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. abderrahimghazali/sylius-social-proof-plugin

ActiveSylius-plugin[Utility &amp; Helpers](/categories/utility)

abderrahimghazali/sylius-social-proof-plugin
============================================

Social proof and FOMO widgets for Sylius 2.x — live viewers, recent purchases, sales counter, low stock alerts

v2.0.0(2mo ago)224MITPHPPHP ^8.2CI failing

Since Apr 10Pushed 1mo agoCompare

[ Source](https://github.com/abderrahimghazali/sylius-social-proof-plugin)[ Packagist](https://packagist.org/packages/abderrahimghazali/sylius-social-proof-plugin)[ Docs](https://github.com/abderrahimghazali/sylius-social-proof-plugin)[ RSS](/packages/abderrahimghazali-sylius-social-proof-plugin/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

 [    ![Sylius Logo](https://camo.githubusercontent.com/ea9dddc934264aa7ec01cf3202c500f3d8b04448bce2571bdc74230efddda88f/68747470733a2f2f6d656469612e73796c6975732e636f6d2f73796c6975732d6c6f676f2d3830302e706e67)  ](https://sylius.com)

Sylius Social Proof Plugin
==========================

[](#sylius-social-proof-plugin)

 Social proof and FOMO widgets for [Sylius 2.x](https://sylius.com) — live viewer counts, recent purchase notifications, sales counters, low stock alerts, and custom messages.

 [![CI](https://github.com/abderrahimghazali/sylius-social-proof-plugin/actions/workflows/ci.yaml/badge.svg)](https://github.com/abderrahimghazali/sylius-social-proof-plugin/actions/workflows/ci.yaml) [![Latest Version](https://camo.githubusercontent.com/05a22ba96283b872ba023b8720b19dd866f22d05827d83c56fb89f858421bf60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6162646572726168696d6768617a616c692f73796c6975732d736f6369616c2d70726f6f662d706c7567696e2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-social-proof-plugin) [![PHP Version](https://camo.githubusercontent.com/a48d4145f2c7c1c2505b84956c3d3ef432a1fe8bcd5dd601714ec6bffccd5d59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6162646572726168696d6768617a616c692f73796c6975732d736f6369616c2d70726f6f662d706c7567696e2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-social-proof-plugin) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![Sylius 2.x](https://camo.githubusercontent.com/47390b9b61d6f22d062322df61d2d225ceaf33f7bb75b99592c7ba766049f3e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796c6975732d322e782d677265656e2e737667)](https://sylius.com) [![Symfony 7.x](https://camo.githubusercontent.com/fe777aec93f146d83db2752ebd66562c8d4d1be48fa4a1477c51c0dbab74e381/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d372e782d626c61636b2e737667)](https://symfony.com) [![PHPStan Level 5](https://camo.githubusercontent.com/0729e562e10fac943b16dbb271b4af26488f779a33fc82cc3eef1e37a432c0b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230352d627269676874677265656e2e737667)](https://camo.githubusercontent.com/0729e562e10fac943b16dbb271b4af26488f779a33fc82cc3eef1e37a432c0b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230352d627269676874677265656e2e737667)

---

Features
--------

[](#features)

### Live Viewers

[](#live-viewers)

Displays "X people are viewing this right now" on product pages. Uses a seeded pseudo-random count within a configurable range, refreshed via lightweight polling.

### Recent Purchases

[](#recent-purchases)

Shows "Jean from Paris just bought this" notifications with clickable product links. Queries real Sylius order data with buyer first name and city from billing address. Shows once per session to avoid spam.

### Sales Counter

[](#sales-counter)

Displays "47 sold in the last 24h" on product pages with an animated count-up effect. Configurable lookback period and minimum threshold.

### Low Stock Alert

[](#low-stock-alert)

Shows "Only 3 left in stock!" when product variant stock falls below a configurable threshold. Includes a subtle pulse animation for urgency.

### Custom Message

[](#custom-message)

Display any custom message with an emoji icon, optional link, and dismissible close button. Perfect for announcements, promotions, or seasonal campaigns. Limited to 120 characters.

### Independent Positioning

[](#independent-positioning)

Each widget has its own position setting — place them in any of the 4 screen corners independently:

- Top left
- Top right
- Bottom left
- Bottom right

---

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

[](#requirements)

DependencyVersionPHP^8.2Sylius^2.1Symfony^7.0Installation
------------

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require abderrahimghazali/sylius-social-proof-plugin
```

### 2. Register the bundle

[](#2-register-the-bundle)

```
// config/bundles.php
return [
    // ...
    Abderrahim\SyliusSocialProofPlugin\SyliusSocialProofPlugin::class => ['all' => true],
];
```

### 3. Import routes

[](#3-import-routes)

```
# config/routes/sylius_social_proof.yaml
sylius_social_proof:
    resource: '@SyliusSocialProofPlugin/config/routes.yaml'
```

### 4. Run database migration

[](#4-run-database-migration)

```
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
```

### 5. Seed default widget configurations

[](#5-seed-default-widget-configurations)

```
bin/console social-proof:install
```

This creates the default widgets (all disabled). Enable them from the admin panel.

### 6. Register Stimulus controllers

[](#6-register-stimulus-controllers)

```
// assets/controllers.json
{
    "@abderrahimghazali/sylius-social-proof-plugin": {
        "live-viewers": { "enabled": true, "fetch": "eager" },
        "purchase-toast": { "enabled": true, "fetch": "eager" },
        "sales-counter": { "enabled": true, "fetch": "lazy" },
        "low-stock": { "enabled": true, "fetch": "lazy" }
    }
}
```

### 7. Rebuild assets

[](#7-rebuild-assets)

```
npm run build
```

---

Admin Usage
-----------

[](#admin-usage)

Navigate to **Marketing &gt; Social Proof** in the Sylius admin panel.

Each widget can be independently:

- **Enabled/disabled** via toggle
- **Configured** with type-specific settings
- **Positioned** in any screen corner

### Widget Settings

[](#widget-settings)

WidgetSettingsLive ViewersMin count, max count, refresh interval, positionRecent PurchasesMax notifications, display interval, show city, lookback period, positionSales CounterLookback period (hours), minimum threshold, positionLow StockStock threshold, show exact count, positionCustom MessageMessage (120 chars max), icon (emoji), link URL, link text, dismissible, position---

Architecture
------------

[](#architecture)

```
SyliusSocialProofPlugin/
├── src/
│   ├── Command/InstallCommand.php          # Seeds default widgets
│   ├── Controller/
│   │   ├── Admin/SocialProofWidgetController.php
│   │   └── Shop/
│   │       ├── LiveViewerController.php    # Polling endpoint
│   │       └── RecentPurchaseController.php # Recent purchases API
│   ├── Entity/SocialProofWidget.php        # Single entity with JSON settings
│   ├── Enum/
│   │   ├── WidgetType.php                  # 5 widget types
│   │   └── DisplayPosition.php             # 4 corner positions
│   ├── Service/
│   │   ├── LiveViewerCounter.php           # Seeded pseudo-random count
│   │   ├── RecentPurchaseProvider.php      # Queries Sylius orders, cached 5min
│   │   ├── SalesCounterProvider.php        # SUM(quantity) query, cached 10min
│   │   └── LowStockChecker.php            # Reads variant onHand - onHold
│   └── Twig/
│       ├── SocialProofExtension.php        # Registers functions
│       └── SocialProofRuntime.php          # Lazy-loaded runtime
├── assets/controllers/                     # Stimulus controllers
├── templates/
│   ├── admin/                              # CRUD forms
│   └── shop/                               # Product page + footer widgets
└── translations/                           # EN + FR

```

API Endpoints
-------------

[](#api-endpoints)

EndpointMethodDescription`/api/v2/shop/social-proof/{productId}/live-viewers`GETReturns `{"count": 17}``/api/v2/shop/social-proof/recent-purchases`GETReturns array of recent purchases`/api/v2/shop/social-proof/recent-purchases?productId=X`GETFiltered by product---

Testing
-------

[](#testing)

```
vendor/bin/phpunit
vendor/bin/phpstan analyse
```

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1be9cf8e271987c350c614aa618f0e68c7f7409634e51f8c8fe105490899b0f?d=identicon)[abderrahim.ghazali](/maintainers/abderrahim.ghazali)

---

Top Contributors

[![abderrahimghazali](https://avatars.githubusercontent.com/u/12643883?v=4)](https://github.com/abderrahimghazali "abderrahimghazali (37 commits)")

---

Tags

syliusecommercesylius-pluginsocial prooffomourgencylive-viewers

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abderrahimghazali-sylius-social-proof-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/abderrahimghazali-sylius-social-proof-plugin/health.svg)](https://phpackages.com/packages/abderrahimghazali-sylius-social-proof-plugin)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9017.2k55](/packages/open-dxp-opendxp)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1715.6k12](/packages/2lenet-crudit-bundle)[forumify/forumify-platform

132.0k12](/packages/forumify-forumify-platform)

PHPackages © 2026

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