Professional Spin Wheel Management System for WordPress
A comprehensive, enterprise-grade spin wheel plugin with REST API, advanced analytics, and mobile app integration capabilities.
Features β’ Installation β’ Documentation β’ API Reference β’ Contributing
- Overview
- Features
- Requirements
- Installation
- Quick Start
- REST API Endpoints
- Shortcodes
- Admin Interface
- Security
- Performance
- Development
- Contributing
- License
T-Work Spin Wheel System is a professional WordPress plugin designed for creating engaging spin wheel campaigns with comprehensive management tools. Built with enterprise-grade security, performance optimization, and mobile-first architecture.
- π‘ Complete Spin Wheel System - Full-featured wheel with customizable prizes and animations
- π REST API - Production-ready API endpoints for mobile app integration
- π Advanced Analytics - Real-time statistics, charts, and comprehensive reporting
- π¨ Professional Admin Interface - Intuitive 11-tab management panel
- π Enterprise Security - Rate limiting, SQL injection protection, XSS prevention
- β‘ High Performance - Object caching, query optimization, scheduled tasks
- π± Mobile Ready - Optimized for mobile apps with JSON responses
| Feature | Description |
|---|---|
| π‘ Spin Wheel System | Complete spin wheel with customizable prizes, colors, animations, and sounds |
| π REST API | Mobile app ready REST API endpoints with rate limiting and authentication |
| π¨ Admin Interface | Comprehensive admin panel with 11 organized tabs for complete control |
| π Analytics Dashboard | Real-time statistics, interactive charts, and detailed reporting |
| π Multiple Prize Types | Support for points, coupons, products, and custom messages |
| βοΈ Highly Customizable | Colors, animations, sounds, limits, probability weights, and more |
| π Enterprise Security | Rate limiting, SQL injection protection, input validation, XSS prevention |
| π± Mobile Ready | Optimized for mobile app integration with JSON responses |
- π€ Export/Import - CSV history export, JSON prizes/settings import/export
- π§ Email Notifications - Automated emails on spin results with customizable templates
- π― Shortcodes -
[spin_wheel],[spin_wheel_stats],[spin_wheel_history] - β‘ AJAX Handlers - Real-time updates, bulk actions, dynamic loading
- π Logging System - Comprehensive logging with database storage and retention
- πΎ Cache Management - Object cache integration for optimal performance
- π§Ή Scheduled Tasks - Daily log cleanup, analytics updates, background processing
- π Statistics - Prize distribution, top users, daily/weekly/monthly stats
- π¨ Frontend Assets - Modern CSS and JavaScript for beautiful frontend display
- π Webhooks Integration - External service integration with event-based triggers
- π Prize Templates - Pre-configured templates for quick prize creation
- π Bulk Operations - Bulk delete, activate/deactivate, and update operations
- π₯ Health Check - System diagnostics, database health, cache status
- πΎ Backup/Restore - Full system backup and restore functionality
- π·οΈ Prize Categories - Organize prizes with categories, colors, and icons
- π Custom Fields - Flexible custom fields per prize for extended data
- π§ͺ A/B Testing - Variant assignment and conversion tracking
- π Conversion Tracking - Event logging and conversion rate calculation
- π API Documentation - Auto-generated API documentation endpoint
- WordPress: 5.0 or higher
- PHP: 7.4 or higher (PHP 8.0+ recommended)
- WooCommerce: 5.0+ (required for coupon prizes)
- MySQL: 5.6+ or MariaDB 10.0+
- Download the plugin ZIP file
- Navigate to Plugins β Add New in WordPress admin
- Click Upload Plugin and select the ZIP file
- Click Install Now and then Activate
- Upload the
twork-spin-wheelfolder to/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Navigate to Spin Wheel in the admin menu to configure
cd wp-content/plugins/
git clone https://github.com/tworksystem/twork-spin-wheel.git-
Activate the Plugin
- Go to Plugins β Find T-Work Spin Wheel System β Click Activate
-
Configure Your First Wheel
- Navigate to Spin Wheel in the admin menu
- Go to the Settings tab
- Configure wheel title, description, colors, and limits
- Set points per spin and daily limits
-
Add Prizes
- Go to the Prizes tab
- Click Add New Prize
- Configure prize type, name, probability weight, and color
- Save your prize
-
Display on Frontend
- Use shortcode:
[spin_wheel wheel_id="1"] - Or integrate via REST API for mobile apps
- Use shortcode:
-
View Analytics
- Go to the Analytics tab
- View real-time statistics and charts
/wp-json/twork/v1/spin-wheel
GET /wp-json/twork/v1/spin-wheel/config/{user_id}Response:
{
"wheel": {
"id": 1,
"title": "Lucky Spin",
"points_per_spin": 100,
"daily_limit": 3
},
"prizes": [...],
"user_spins_today": 2
}POST /wp-json/twork/v1/spin-wheel/spin
Content-Type: application/json
{
"user_id": 123,
"wheel_id": 1
}Response:
{
"success": true,
"prize": {
"id": 5,
"name": "100 Points",
"type": "points",
"value": 100
},
"spins_remaining": 1
}GET /wp-json/twork/v1/spin-wheel/prizes?user_id=123&page=1&per_page=20GET /wp-json/twork/v1/spin-wheel/bannerGET /wp-json/twork/v1/spin-wheel/docsFor authenticated requests, include WordPress nonce or use application passwords:
X-WP-Nonce: {nonce}- Default: 10 requests per minute per IP/user
- Configurable in Advanced tab
- Returns
429 Too Many Requestswhen exceeded
[spin_wheel wheel_id="1" width="320" height="320"]Attributes:
wheel_id- Wheel ID to display (required)width- Wheel width in pixels (default: 320)height- Wheel height in pixels (default: 320)
[spin_wheel_stats user_id="123" show_total_spins="yes" show_points_spent="yes"]Attributes:
user_id- User ID (required)show_total_spins- Show total spins (yes/no)show_points_spent- Show points spent (yes/no)
[spin_wheel_history user_id="123" limit="10"]Attributes:
user_id- User ID (required)limit- Number of entries to display (default: 10)
The plugin provides a comprehensive admin interface with 11 organized tabs:
Configure wheel appearance, limits, colors, animations, and visual effects.
Manage prizes with probability weights, colors, icons, and bulk operations.
View all spin history with filtering, pagination, and export functionality.
Real-time statistics dashboard with charts, prize distribution, and top users.
Export data to CSV/JSON, import prizes, and manage data migration.
Cache management, logging settings, rate limiting, and email notifications.
Pre-configured prize templates for quick prize creation.
External service integration with event-based triggers and authentication.
System diagnostics, database health, cache status, and API testing.
Full system backup and restore functionality with JSON export/import.
Auto-generated API documentation with endpoint details and examples.
The plugin implements enterprise-grade security measures:
- β Rate Limiting - Prevents API abuse with configurable limits
- β SQL Injection Prevention - All queries use prepared statements
- β XSS Protection - Output escaping and input sanitization
- β Input Validation - Comprehensive validation for all inputs
- β Nonce Verification - CSRF protection on all forms
- β Capability Checks - Permission validation for admin functions
- β IP Address Logging - Security audit trail
- β Security Event Logging - Threat detection and monitoring
- All user inputs are sanitized and validated
- Database queries use
$wpdb->prepare() - Output is escaped using WordPress functions
- Nonces are verified on all form submissions
- User capabilities are checked before admin operations
Optimized for high performance with enterprise-grade features:
- β Object Cache Integration - Reduces database queries
- β Database Query Optimization - Efficient queries with proper indexes
- β Scheduled Background Tasks - Daily cleanup and analytics updates
- β Lazy Loading - Assets loaded only when needed
- β Cache Invalidation - Smart cache updates on data changes
- β Efficient Database Indexes - Optimized table structures
- Wheel configurations cached for 1 hour
- User spin counts cached for 5 minutes
- Analytics data cached for 15 minutes
- Cache automatically invalidated on updates
The plugin creates the following database tables:
| Table | Description |
|---|---|
wp_twork_spin_wheels |
Wheel configurations |
wp_twork_spin_wheel_prizes |
Prize definitions |
wp_twork_spin_wheel_history |
Spin history records |
wp_twork_spin_wheel_analytics |
Analytics data |
wp_twork_spin_wheel_logs |
Log entries (optional) |
All tables include proper indexes for optimal query performance.
twork-spin-wheel/
βββ twork-spin-wheel.php # Main plugin file
βββ uninstall.php # Uninstall script
βββ includes/ # Core classes
β βββ class-database.php
β βββ class-rest-api.php
β βββ class-admin.php
β βββ ...
βββ assets/ # Frontend assets
β βββ css/
β βββ js/
βββ languages/ # Translation files
- β WordPress Coding Standards (WPCS) compliant
- β PHPDoc documentation for all functions
- β Proper error handling and exception management
- β Modular architecture with separation of concerns
- β Singleton pattern for main plugin class
The plugin provides various hooks for customization:
// Filter wheel configuration
apply_filters('twork_spin_wheel_config', $config, $wheel_id, $user_id);
// Filter prize result
apply_filters('twork_spin_wheel_prize', $prize, $wheel_id, $user_id);
// Action after spin
do_action('twork_spin_wheel_after_spin', $prize, $wheel_id, $user_id);See CHANGELOG.md for a detailed list of changes.
- Initial release
- Complete spin wheel system
- REST API endpoints
- Admin interface with 11 tabs
- Analytics dashboard
- Export/Import functionality
- Security features
- Performance optimizations
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
feat: 16012026 - Add new feature description
fix: 16012026 - Fix bug description
docs: 16012026 - Update documentation
This plugin is licensed under the GPL v2 or later.
Copyright (C) 2026 T-WORK SYSTEM Co.,Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Maw Kunn Myat
- Email: support@tworksystem.com
- GitHub: @mawkunnmyat
For support, feature requests, or bug reports:
- π§ Email: support@tworksystem.com
- π Issues: GitHub Issues
- π Documentation: Full Documentation
- Built with WordPress best practices
- Follows WordPress Coding Standards
- Optimized for performance and security
- Designed for enterprise use
Made with β€οΈ by Maw Kunn Myat