=== LiveCasinoData - Live Casino Statistics ===
Contributors: livecasinodata
Donate link: https://livecasinodata.com
Tags: casino, statistics, live casino, crazy time, monopoly live, evolution gaming, live results
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live casino results and statistics on your site: latest-results strip, bonus rate, spins since bonus. Auto-refreshes every 30 seconds. Every game LiveCasinoData tracks.

== Description ==

**LiveCasinoData Widget** puts live casino results on your WordPress site - the same data that powers livecasinodata.com. Built for casino review sites, gambling blogs and affiliate sites.

= What visitors see =

* **Latest results strip** - the last 8-20 outcomes as colour-coded chips, newest first, bonuses highlighted
* **Last result and multiplier**
* **Bonus rate** over the last 100 rounds
* **Spins since bonus** - overall, and per bonus type (Cash Hunt, Coin Flip, Pachinko, Crazy Time, ...)
* **"x ago"** - how fresh the last result is

Everything updates in place every 30 seconds (configurable, 15 s minimum) without a page reload. Polling pauses while the tab is hidden.

= Features =

* **Every live game** - the game picker is filled from the API: whatever LiveCasinoData has live data for (39 games at the time of writing: Crazy Time, Monopoly Live, Funky Time, Dream Catcher, Lightning Roulette, Lightning Dice, Lightning Baccarat, Bac Bo, Mega Wheel, Sweet Bonanza Candyland, Ice Fishing and more)
* **Gutenberg block**, **Elementor widget**, **classic sidebar widget** and **shortcode**
* **Full, compact and mini** layouts - the mini one fits a narrow sidebar
* **Dark, light and auto** themes; every colour is a CSS custom property you can override
* **Smart caching** - all your visitors share one server-side copy, so a busy page still makes at most one API request per interval; the widget key never reaches the browser
* **Automatic updates** - updates appear in Plugins like any other plugin (served from livecasinodata.com)
* **Translation ready** (.pot included)

= Shortcode =

`[livecasinodata]`
`[livecasinodata game="monopoly-live"]`
`[livecasinodata show="compact" results="8" theme="light"]`
`[livecasinodata refresh="60" title="Crazy Time now"]`

Attributes: `game` (slug), `theme` (dark|light|auto), `show` (full|compact|mini), `title`, `results` (0-20 chips, 0 hides the strip), `refresh` (seconds, 0 disables auto-refresh, minimum 15).

= Requirements =

* WordPress 5.8 or higher, PHP 7.4 or higher
* A free API key from https://livecasinodata.com/widget

== Installation ==

1. Download the plugin zip from https://livecasinodata.com/widget
2. Go to Plugins > Add New > Upload Plugin, choose the zip and click Install Now
3. Activate the plugin
4. Go to Settings > LiveCasinoData, paste your API key and click Verify, then Save
5. Add the widget: search "LiveCasinoData" in the block inserter or Elementor, drag "LiveCasinoData Stats" to a sidebar, or use the shortcode

== Frequently Asked Questions ==

= Is the API free? =

Yes. The free key allows 60 requests per minute per site, which the plugin's caching keeps you well under.

= Which games are supported? =

Every game with live data on livecasinodata.com. The list in Settings > LiveCasinoData is loaded from the API and updates itself when new games are added.

= How often is the data updated? =

Results reach our servers within seconds of each round. Your site keeps a copy for 30 seconds (configurable) and the widget refreshes itself every 30 seconds (configurable).

= Does it work with my theme / page builder? =

Yes. Styling is self-contained; there is a native Gutenberg block and Elementor widget, and the shortcode works in any other builder.

= Is attribution required? =

Yes. The "Live data by LiveCasinoData.com" link must stay visible. It is a condition of the free API.

== External services ==

This plugin fetches game statistics from the LiveCasinoData API (https://livecasinodata.com/api/widget/v1) using the API key you enter, and checks https://livecasinodata.com/downloads/wordpress-plugin/update.json for plugin updates. Requests are made from your server, not from visitors' browsers; the only data sent is the API key, the requested game slug, the plugin version and your site URL (as User-Agent). No visitor data is collected. Terms: https://livecasinodata.com/terms - Privacy: https://livecasinodata.com/privacy

== Screenshots ==

1. Full widget, dark theme - results strip, stats and spins since bonus
2. Compact widget in a sidebar, light theme
3. Gutenberg block with live preview and settings panel
4. Elementor widget controls
5. Settings page with API key verification

== Changelog ==

= 1.1.0 =
* New: latest-results strip with colour-coded chips
* New: auto-refresh every 30 s via a same-origin REST proxy (key stays on the server; pauses in hidden tabs; backs off on errors)
* New: game pickers are loaded from the API - every live game, not a fixed list
* New: "auto" theme following the visitor's system setting; CSS custom properties for colours
* New: spins-since-bonus overall + per bonus type for every game (was Crazy Time only)
* New: automatic plugin updates from livecasinodata.com
* New: `results` and `refresh` attributes; refresh interval in Settings
* New: cheap key verification endpoint
* Fixed: front-end script was registered but never loaded
* Fixed: 15 s API timeout could stall page rendering; now 5 s with a 60 s negative cache
* Fixed: PHP 8 warnings on partial API responses
* Fixed: text domain loaded too late on WP 6.7+
* Fixed: deprecated `wp-editor` block dependency
* Fixed: block preview AJAX missing a capability check
* Fixed: unprepared database query on activation
* Fixed: API key was sent in the query string as well as the header
* Added uninstall.php that removes all options and transients

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.1.0 =
Live results strip and auto-refresh. Clear the plugin cache after updating.
