=== WHA Puzzle ===
Contributors: webhelpagency
Donate link: http://webhelpagency.com/
Tags: puzzle, jigsaw, game, mind, canvas
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Drag-and-drop jigsaw puzzle game for any page or post. Upload an image, choose the grid size and embed it with a shortcode.

== Description ==

Puzzle is a jigsaw game: a mosaic that has to be assembled from many fragments of various shapes. It is one of the most affordable toys that develop logical thinking, attention, memory and imagination.

The plugin adds a "Puzzle" post type. Each puzzle has its own image, grid size (up to 10x10), canvas colour, ghost-image opacity and a custom congratulations message, and is embedded anywhere with the `[game-puzzle id="N"]` shortcode.

**Features**

* HTML5 canvas game with drag-and-drop pieces, snapping and a red hint outline.
* Start / pause, reset, timer and a solved-puzzles counter.
* Full-screen mode.
* Separate images for desktop and mobile.
* Optional front-end upload so visitors can play with their own picture.
* Completion modal with a custom message and Facebook / Twitter / LinkedIn share links.
* Works in sub-directory installs, custom content directories and multisite.

Video: https://www.youtube.com/watch?v=Ojja8RrFU58

== Installation ==

1. Upload the `wha-puzzle` folder to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate the plugin.
3. Go to **Puzzles > Add New**, set a featured image and the game settings, and publish.
4. Copy the shortcode shown on the edit screen (`[game-puzzle id="N"]`) and paste it into any page or post.

== Frequently Asked Questions ==

= Can visitors use their own image? =

Yes. Enable "Frontend upload" in the puzzle settings and an upload form appears in the game control panel.

= Can I put several puzzles on one page? =

No, one puzzle per page is supported.

== Screenshots ==

1. Individual settings page
2. Game with settings on a normal screen
3. Game in full-screen mode

== Changelog ==

= 1.1.0 =
* Compatibility with PHP 8.x and WordPress 7.1 (no more suppressed notices, undefined-index warnings or removed jQuery APIs).
* Admin assets (jscolor, slider) load only on the Puzzle edit screen and use the jQuery UI slider bundled with WordPress instead of a second copy of jQuery UI.
* Front-end assets load only on pages that contain a puzzle; wp_enqueue_media() is no longer loaded on every page.
* Plugin, uploads and admin-ajax URLs are no longer hard-coded – works in sub-directory installs, custom content dirs and multisite.
* Front-end image upload is protected by a nonce and only accepted for puzzles that allow it; WebP images are accepted.
* Missing featured image shows an admin notice instead of aborting the save.
* Uninstall uses the WordPress API (works with any table prefix and on multisite).
* Text domain unified to "wha-puzzle".
