=== DiceGem Games ===
Contributors: dicegem
Tags: games, html5 games, embed, shortcode, block
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed free HTML5 games from DiceGem: board, card, puzzle, word and arcade games. Shortcode or block, no sign-up.

== Description ==

DiceGem Games adds free browser games to your posts and pages. Pick a game such as chess, solitaire, sudoku or backgammon and it plays right inside your page, on desktop and mobile.

* **One game:** the DiceGem game block, or the shortcode `[dicegem game="klondike"]`.
* **A games grid:** the DiceGem game grid block, or `[dicegem_grid category="board-games" count="6"]`. A click on a card plays the game above the grid.
* **Free, no sign-up:** no account and no API key.
* **Responsive:** games keep their shape on every screen; portrait games get a taller 4:5 frame.
* **Light:** nothing is loaded in wp-admin from outside your site, and the grid script loads only on pages that use a grid.

Optional settings (Settings > DiceGem Games):

* **Publisher ID:** if DiceGem gave you one, it is added to the game address so plays from your site can be counted.
* **Credit link:** off by default. When you turn it on, a small "Play more free games on DiceGem" line is shown under games and grids.
* **Casino-style games:** off by default. These games use virtual credits only; no real money can be won or lost. When on, a "Virtual credits only, no real money. 18+" note is shown under them.
* **Default aspect ratio** for landscape games (16:10 unless you change it).

= Shortcode options =

`[dicegem game="klondike" ratio="4:3"]`

* `game`: the game's slug, as in its address on dicegem.com (dicegem.com/games/**chess**/).
* `width`: optional maximum width, in px or %.
* `ratio`: optional aspect ratio: 16:10, 16:9, 4:3, 3:2, 1:1, 4:5 or 9:16. Default: 16:10 (or the setting), portrait games 4:5 at most 640px wide.

`[dicegem_grid category="card-games" count="12"]`

* `category`: Board Games, Card Games, Puzzle Games, Word Games, Arcade Games or Casino Games (name or slug such as `card-games`). Leave out for all.
* `count`: how many games, 1 to 100 (default 12).

== External services ==

This plugin connects to DiceGem, a free HTML5 games service run by the plugin authors.

* **Game catalog:** your server downloads the public list of games from https://dicegem.com/api/games.json, at most twice a day and when an administrator clicks "Refresh catalog now". The request sends no data about your site or visitors beyond what any web request carries (your server's IP address and the WordPress user agent).
* **The games:** each embedded game is loaded by your visitor's browser in an iframe from https://play.dicegem.com/, and game covers in grids are loaded from dicegem.com. This happens only on pages where you place a game or grid. As with any website, DiceGem receives the visitor's IP address and browser details. The games send anonymous play events (game loaded, started, ended) together with your publisher ID (if set) and the address of the page embedding the game. No account, name or email address is collected.

DiceGem terms of service: https://dicegem.com/terms-of-service/
DiceGem privacy policy: https://dicegem.com/privacy-policy/

The plugin itself sends no telemetry. A suggested paragraph for your privacy policy is added under Settings > Privacy.

== Installation ==

1. Install the plugin from Plugins > Add New, or upload the `dicegem-games` folder to `/wp-content/plugins/`.
2. Activate it.
3. Add the DiceGem game or DiceGem game grid block to a page, or use a shortcode.
4. Optional: visit Settings > DiceGem Games.

== Frequently Asked Questions ==

= Is it really free? =

Yes. There is no account, no key and no fee.

= Do I have to show a link to DiceGem? =

No. The credit link is off by default and the games work the same without it.

= Where do I find a game's slug? =

It is the last part of the game's address on dicegem.com. For https://dicegem.com/games/chess/ the slug is `chess`. The block lets you search games by name instead.

= A game does not show up. Why? =

Visitors see nothing for an unknown slug, while logged-in editors see a short notice. Casino-style games are shown only after you turn them on in the settings. If the game is new, click "Refresh catalog now" under Settings > DiceGem Games.

= Do the games involve real money? =

No. Casino-style games use virtual credits only and pay out nothing. They are hidden unless you turn them on.

== Screenshots ==

1. A game embedded in a post.
2. A games grid; a click plays the game above it.
3. The settings page.
4. The DiceGem game block in the editor.

== Changelog ==

= 1.0.0 =
* First release: game and grid shortcodes and blocks, settings, catalog cache with offline fallback.
