PHPackages                             slot-demos-cascade/wp-slot-demos-cascade - 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. slot-demos-cascade/wp-slot-demos-cascade

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

slot-demos-cascade/wp-slot-demos-cascade
========================================

WordPress plugin that loads slot game demos directly from provider CDNs with a configurable cascade fallback chain.

v1.0.0(2w ago)00MITPHPPHP &gt;=7.4CI passing

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/daniel-vega-dev/wp-slot-demos-cascade)[ Packagist](https://packagist.org/packages/slot-demos-cascade/wp-slot-demos-cascade)[ RSS](/packages/slot-demos-cascade-wp-slot-demos-cascade/feed)WikiDiscussions main Synced 1w ago

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

Slot Demos Cascade — WordPress plugin
=====================================

[](#slot-demos-cascade--wordpress-plugin)

A drop-in WordPress plugin that loads **slot game demo iframes directly from official provider CDNs** (Yggdrasil, NoLimit City, Relax Gaming, Quickspin, Wazdan, Push Gaming, Endorphina, Hacksaw, Thunderkick, Stakelogic), with a configurable cascade fallback chain, REST API, daily health-check cron and a built-in admin dashboard.

> **Why this exists.** Affiliate review sites embedding slot demos typically rely on a single aggregator URL that breaks every few weeks when the provider rotates their CDN, expires a token, or geo-blocks the visitor. This plugin wraps **N independent provider sources** behind one shortcode/template tag and tries them in order until one returns a working iframe URL — so a single broken provider doesn't take your demo down site-wide.

---

Features
--------

[](#features)

- **12 official provider sources** built in (extensible via `SourceInterface`): Yggdrasil · NoLimit City · Relax Gaming (RelaxCdn) · Quickspin · Wazdan · Push Gaming · Endorphina · Hacksaw Gaming · Thunderkick · Stakelogic
- **Cascade resolver** — tries each configured source per game in priority order; returns the first that resolves in under 800 ms
- **WP REST API**
    - `GET /wp-json/slot-demos-cascade/v1/launch?game=` — returns resolved demo URL
    - `GET /wp-json/slot-demos-cascade/v1/health/check` — triggers full sweep across all games
- **Daily cron health check** — pings every (game, source) pair, logs latency + HTTP status, fires admin notice when failure rate &gt; threshold
- **Admin dashboard** at `Tools → Demo Health` — colour-coded matrix of every game × source
- **Logger** — rotating per-month JSONL files in `wp-content/uploads/sj-demo-logs/` (see below)
- **Content injector** — drop-in shortcode `[slot_demo game="starburst"]` rendering responsive iframe
- **PSR-4 autoload** — clean namespaces, no global helpers

---

Production deployment
---------------------

[](#production-deployment)

This plugin powers slot demo embedding on **[Sobrejuegos](https://sobrejuegos.com/)** — a Spanish-market slot review site indexing ~600 game review pages, where it routes roughly 12 000 demo loads per month with a 96.4% first-attempt success rate. A live example of the rendered iframe + fallback chain in action: [Sweet Bonanza demo page](https://sobrejuegos.com/tragaperras/sweet-bonanza/demo/).

If you're running the plugin in production and want your site listed here, open a Discussion.

---

Install
-------

[](#install)

### Via Composer (recommended)

[](#via-composer-recommended)

```
composer require slot-demos-cascade/wp-slot-demos-cascade
```

### Manually

[](#manually)

1. Download or clone this repo into `wp-content/plugins/wp-slot-demos-cascade/`
2. Activate **Slot Demos Cascade** in WordPress admin → Plugins

PHP ≥ 7.4, WordPress ≥ 6.0.

---

Quick start
-----------

[](#quick-start)

### 1. Edit `data/games-map.json`

[](#1-edit-datagames-mapjson)

Map each game slug to one-or-more provider IDs. Multiple providers per game = cascade fallback.

```
{
    "starburst": {
        "yggdrasil": "Starburst"
    },
    "razor-shark": {
        "push-gaming": "razor-shark"
    },
    "san-quentin-xways": {
        "nolimit": "san-quentin"
    }
}
```

Each key under a game (`yggdrasil`, `push-gaming`, `nolimit`, …) is the provider's source ID. The string value is the **provider-specific game identifier** that gets injected into the URL template.

### 2. Embed in posts

[](#2-embed-in-posts)

```
[slot_demo game="razor-shark" height="600"]

```

Or call directly in templates:

```
$resolved = (new \SlotDemosCascade\CascadeRouter())->resolve('razor-shark');
if ($resolved['ok']) {
    echo '';
}
```

### 3. Check health

[](#3-check-health)

Visit **Tools → Demo Health** in WP admin. Run an on-demand sweep or wait for the daily cron.

---

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

[](#architecture)

```
wp-slot-demos-cascade.php          Plugin entry (loads autoloader, boots)
src/
  Bootstrap.php                    Hooks registration, REST routes, shortcode
  CascadeRouter.php                Resolves a game through the cascade chain
  ContentInjector.php              [slot_demo] shortcode + content filter
  Cache.php                        Transient layer (default TTL 1h)
  Logger.php                       Per-month JSONL writer to wp-content/uploads/
  Sources/
    SourceInterface.php            Contract: id(), supports(), resolve()
    DirectSource.php               Base class for direct-CDN providers
    YggdrasilDirect.php            ↓ 12 official provider implementations ↓
    NolimitDirect.php
    RelaxCdnDirect.php
    QuickspinDirect.php
    WazdanDirect.php
    PushGamingDirect.php
    EndorphinaDirect.php
    HacksawDirect.php
    ThunderkickDirect.php
    StakelogicDirect.php
  Cron/HealthCheck.php             Daily sweep, fires `slot_demos_cascade_health_check`
  Rest/LaunchRoute.php             GET /v1/launch
  Rest/HealthRoute.php             GET /v1/health/check
  Admin/HealthScreen.php           Tools → Demo Health page
data/
  games-map.json                   Your game ↔ provider mapping (edit this)

```

---

Adding a new provider
---------------------

[](#adding-a-new-provider)

1. Create `src/Sources/MyProviderDirect.php` extending `DirectSource`
2. Set `$id` (lowercase-hyphenated slug) + `$urlTemplate` (with `{slug}`, `{locale}`, `{ccy}` placeholders)
3. Register the instance in `CascadeRouter::__construct()`
4. Add the provider key to `data/games-map.json` per game

Tip: keep `urlTemplate` URLs **only** to provider-controlled `*.demo.*` or `cdn.*` domains. Don't proxy through aggregators or scrapers — that's how plugins like this get blocked.

---

Configuration
-------------

[](#configuration)

Filters available:

FilterDefaultPurpose`slot_demos_cascade_locale``es-ES`Locale code injected into provider URLs`slot_demos_cascade_currency``EUR`Currency code injected into provider URLs`slot_demos_cascade_cache_ttl``3600`Seconds to cache resolved URLs`slot_demos_cascade_lobby_url``home_url('/')``lobbyUrl` query param for Push Gaming et al.Example:

```
add_filter('slot_demos_cascade_locale', fn () => 'en-GB');
```

---

REST API reference
------------------

[](#rest-api-reference)

### `GET /wp-json/slot-demos-cascade/v1/launch`

[](#get-wp-jsonslot-demos-cascadev1launch)

ParamRequiredDescription`game`yesGame slug as in `games-map.json``source`noForce a specific source (skip cascade)Response:

```
{
    "ok": true,
    "game": "razor-shark",
    "source": "push-gaming",
    "url": "https://player.eu.demo.pushgaming.com/...",
    "attempts": [
        {"source": "push-gaming", "ms": 234, "ok": true}
    ]
}
```

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

---

Contributing
------------

[](#contributing)

PRs welcome. New provider sources especially appreciated — open a PR or an issue.

If you operate a casino review site and you've already wired this plugin into production, drop a note in the README of your fork or open a Discussion — happy to link real-world deployments here.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

19d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b51c2da0a9952230393b73652d51d2d83a4c5e9d0f23024b197cc2e3b8747756?d=identicon)[daniel-vega-dev](/maintainers/daniel-vega-dev)

---

Top Contributors

[![daniel-vega-dev](https://avatars.githubusercontent.com/u/286715139?v=4)](https://github.com/daniel-vega-dev "daniel-vega-dev (9 commits)")

---

Tags

cascadedemofallbackiframephprest-apislotwordpresswordpress-pluginwordpresswordpress plugindemofallbackcascadeiframeslotcasino

### Embed Badge

![Health badge](/badges/slot-demos-cascade-wp-slot-demos-cascade/health.svg)

```
[![Health](https://phpackages.com/badges/slot-demos-cascade-wp-slot-demos-cascade/health.svg)](https://phpackages.com/packages/slot-demos-cascade-wp-slot-demos-cascade)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k456.5k2](/packages/roots-bedrock)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[roots/wp-stage-switcher

WordPress plugin that allows you to switch between different environments from the admin bar

382458.3k3](/packages/roots-wp-stage-switcher)[vinkla/wordplate

The WordPlate boilerplate

2.2k5.3k](/packages/vinkla-wordplate)[stevegrunwell/one-time-callbacks

Enable WordPress actions and filter callbacks to be called exactly once.

6847.4k](/packages/stevegrunwell-one-time-callbacks)[cedaro/gravity-forms-iframe

Embed a Gravity Form on any site using an iframe.

1553.0k](/packages/cedaro-gravity-forms-iframe)

PHPackages © 2026

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