=== Laoutaris Maze Generator === Contributors: laoutaris Donate link: https://paypal.me/LaoutarisPashalis Tags: game, gamification, leaderboard, puzzle, quiz Requires at least: 6.2 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.1.8 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Turn your WordPress pages into an interactive "Choose Your Path" maze game with a speedrun timer, global leaderboards, and downloadable rewards. == Description == The **Maze Generator** is a powerful gamification plugin that allows you to build multi-step navigation games using your existing WordPress pages. Unlike simple links, this plugin turns website navigation into a **Time Attack Game**. Users must find the correct path through your pages to reach the "Finale." The plugin tracks their speed, ranks them on a global leaderboard, and offers rewards (like PDF downloads or coupons) upon completion. **Key Features:** * **Time Attack Mode:** Automatically tracks exactly how many seconds it takes a user to solve the maze. * **Image-Based Choices:** Upload your own images (Doors, Portals, Arrows, etc.). The game randomly shuffles and displays them as interactive buttons. * **Dynamic Leaderboard:** A modern, responsive leaderboard featuring "All Time" vs. "This Month" tabs, top-3 trophies, and formatted timings. * **Reward System:** Automatically unlock a **File Download** or **Custom Content** for users who successfully complete the maze. * **Drag & Drop-style Builder:** Easily link a "Start Page" to a "Correct Destination" and add multiple "Decoys" (wrong turns). * **Searchable Dropdowns:** Quickly find the pages you need in the admin panel with the built-in search filter. * **Cheat Prevention:** Only the current room's path is sent to the browser, and the leaderboard form requires an active run before it accepts a submission. * **Engagement Animations:** Visual "Shake" effects when clicking wrong answers. == Installation == 1. Upload the `laoutaris-maze-generator` folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. 3. Navigate to the **Laoutaris Maze Generator** menu in your admin sidebar to create your first maze. == How to Create a Maze == The plugin works by linking real WordPress Pages together. 1. **Create Content:** Create WordPress pages for every "Room" in your maze, plus pages for "Decoys" (Dead Ends) and one "Finale" page. 2. **Build:** Go to **Maze Generator > Add New**. 3. **Define Steps:** * Select a **Start Page** (Where the user is now). * Select a **Correct Destination** (Where they go if they choose right). * Select **Decoys** (Where they go if they choose wrong). 4. **Customize:** Go to the "Customization" tab to upload your images and set up the winner's reward. 5. **Publish:** * Paste `[lmaze_number_maze id="1"]` on every "Start Page" you defined. * Paste `[lmaze_maze_leaderboard id="1"]` on your "Finale Page". *(Note: Replace "1" with the actual ID of your maze).* == Frequently Asked Questions == = Does this work with caching plugins? = Yes. The game logic (Timer, Leaderboard, Submission) is handled via AJAX. However, aggressive JS optimization (like JS Combine) can sometimes cause issues. See the troubleshooting section if the maze does not appear. = Can I have multiple different mazes? = Yes. You can create unlimited mazes. Each has its own unique ID and independent leaderboard. = How do I reset the leaderboard? = There is a "Maintenance" section on the main plugin page with a "Clear All Data" button. == Troubleshooting == **LiteSpeed Cache / Optimization Plugins** If the maze does not appear or the game logic fails, it is likely due to JavaScript execution order being altered by caching plugins. To fix this in **LiteSpeed Cache**: 1. Go to **LiteSpeed Cache > Page Optimization > Tuning**. 2. Find **JS Excludes**. 3. Add the following lines: `lmaze-runner` `lmaze_runner_data` 4. Purge your cache. == Screenshots == 1. **Maze Builder** - Easily link pages and add multiple decoys. 2. **Leaderboard** - Modern design with monthly tabs and ranking trophies. 3. **Edit Maze Screen** - Add different steps to the maze. 4. **Customization** - Customize colors, add images, and reward files. == Changelog == = 1.1.8 = * **Fix:** The maze runner no longer sends the full room-by-room path to the browser; each page now only receives its own choices, closing a way to view-source straight to the finale. * **Fix:** Corrected a timer bug where a completed run could still show "You haven't started the maze yet!" on the leaderboard page. * **Fix:** Leaderboard submissions from a new player now require a real elapsed time, so a crafted request can no longer top the board with a zero-second run. * **Fix:** Leaderboard and maze text are now HTML-escaped before being inserted into the page. * **Fix:** Various small hardening/cleanup items (translatable error messages, duplicate URL parameter, safer version check, button color fallback). * **Feature:** Added a one-click copy button next to each shortcode on the maze list screen. * **Improvement:** Replaced the plain search box above the page/post dropdowns with a proper searchable combobox (type to filter, click or use arrow keys to pick). = 1.1.7 = * Compatible up to WordPress 7.1. = 1.1.6 = * Compatible up to WordPress 7.0. = 1.1.5 = * **Fix:** Corrected "This Month" leaderboard filter logic to show only current month's scores. * **Fix:** Resolved CSS layout issues in the Maze Builder where search fields were misaligned. = 1.1.3 = * **Feature:** Added search/filter functionality to page selection dropdowns for easier navigation of large sites. = 1.1.1 = Major update adding Image Library, Time Attack mode, and improved Leaderboard. = 1.1.0 = * **Public Release:** First stable public version. * **Feature:** Image Library with Fisher-Yates shuffle logic to prevent duplicate images. * **Feature:** Time Attack logic with Start/Stop timestamps. * **Feature:** Leaderboard with "This Month" vs "All Time" tabs and Top 3 highlighting. * **Fix:** Resolved date formatting issues to respect WordPress General Settings. * **Fix:** Added anti-cheat checks to prevent direct access to the leaderboard. * **Fix:** Improved compatibility with caching plugins. = 1.0.0 = * Initial development version.