Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/amirsafaridevs/wc-coupon-mobile/archive/refs/heads/main.zipArta WooCommerce Mobile Coupon Plugin
A comprehensive WooCommerce plugin for mobile-based coupon management with SMS notifications and advanced debugging capabilities.
🚀 Features
- Mobile-Based Coupon Management: Associate coupons with specific mobile phone numbers
- Shopping Cart Integration: Display available coupons directly in the WooCommerce cart
- SMS Notifications: Send automatic SMS notifications when users log in
- IPPanel SMS Integration: Built-in integration with IPPanel SMS service
- Advanced Debugging System: Comprehensive logging system with database storage
- Mobile Number Normalization: Consistent mobile number formatting across the system
- WooCommerce Settings Integration: Seamless integration with WooCommerce admin panel
- AJAX-Powered Interface: Modern, responsive admin interface
- Credit Balance Monitoring: Real-time SMS credit balance checking
- Error Handling: Robust error handling and user feedback
📋 Requirements
- WordPress 5.0+
- WooCommerce 3.0+
- PHP 7.4+
- IPPanel SMS account
🛠️ Installation
- Upload the plugin files to
/wp-content/plugins/arta-wc-coupon-mobile/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to WooCommerce > Settings > Arta Mobile Coupons
- Configure your IPPanel API key and SMS settings
- Set up your coupon patterns and mobile restrictions
⚙️ Configuration
SMS Settings
- IPPanel API Key configuration
- SMS pattern selection (with/without name)
- Credit balance monitoring
- Test SMS functionality
Coupon Management
- Mobile restriction settings per coupon
- Usage limits and allowed mobile numbers
- Cart display preferences
- Debug logging configuration
Debug Features
- Real-time debug logging (50 entries limit)
- Mobile number testing tools
- Coupon availability debugging
- SMS sending diagnostics
🏗️ Technical Architecture
The plugin is built using object-oriented PHP following WordPress coding standards and best practices:
Core Classes
Arta_Coupon_Settings: Main settings management and admin interfaceArta_Cart_Coupon_Display: Handles coupon display in shopping cartArta_Coupon_Mobile_Limits: Manages mobile usage limits for couponsArta_Login_Notification: Handles SMS notifications on user login
Key Features
- Custom WooCommerce settings tab with integrated UI
- Database-backed logging system (stored in WordPress options)
- Mobile number normalization for consistent comparisons
- AJAX-powered admin interface for real-time interactions
- Comprehensive error handling and user feedback
📁 File Structure
arta-wc-coupon-mobile/
├── arta-wc-coupon-mobile.php (Main plugin file)
├── include/
│ ├── class/
│ │ ├── Arta_Coupon_Settings.php (Settings management)
│ │ ├── Arta_Cart_Coupon_Display.php (Cart integration)
│ │ ├── Arta_Coupon_Mobile_Limits.php (Usage limits)
│ │ └── Arta_Login_Notification.php (SMS notifications)
│ └── function.php (General functions)
└── README.md (This file)
🔧 Usage
For Administrators
- Create coupons in WooCommerce with mobile restrictions
- Configure SMS settings in the plugin admin panel
- Test SMS functionality using the built-in test tools
- Monitor debug logs for troubleshooting
- Check credit balance and manage SMS costs
For Users
- Log in with a mobile number associated with coupons
- View available coupons in the shopping cart
- Receive SMS notifications with discount codes
- Apply coupons during checkout
🔒 Technical Details
Database Storage
- Plugin settings stored in WordPress options table
- Debug logs stored in
arta_debug_logsoption - SMS errors stored in
arta_sms_errorsoption
API Integration
- IPPanel SMS API for message sending
- Credit balance checking via REST API
- Secure API key management
Mobile Number Handling
- Automatic normalization (removes leading zeros, country codes)
- Consistent formatting across all functions
- Support for various input formats
Security Features
- WordPress nonce verification for AJAX requests
- Input sanitization and validation
- User capability checks for admin functions
🧪 Development
Coding Standards
- WordPress Coding Standards
- PSR-4 autoloading structure
- Object-oriented architecture
- Comprehensive error handling
Testing
- Built-in debug logging system
- Test SMS functionality
- Mobile number validation tools
- Coupon availability debugging
❓ FAQ
How do I set up mobile restrictions for coupons?
- Create a coupon in WooCommerce
- Add custom fields for mobile restrictions
- Configure allowed mobile numbers
- Enable mobile restriction for the coupon
How does the SMS notification system work?
The plugin automatically sends SMS notifications when users log in, including available discount codes for their mobile number.
Can I test the SMS functionality?
Yes, the plugin includes a built-in test SMS feature in the admin panel that allows you to send test messages.
How do I monitor debug logs?
Debug logs are available in the plugin settings panel with a toggle button to show/hide the log display.
What SMS service does this plugin use?
The plugin integrates with IPPanel SMS service for sending messages and checking credit balance.
📸 Screenshots
- Plugin settings page with SMS configuration
- Debug logs display with toggle functionality
- Shopping cart with mobile coupons display
- SMS test functionality in admin panel
📝 Changelog
1.0.0
- Initial release
- Mobile-based coupon management
- SMS notification system
- Advanced debugging capabilities
- WooCommerce integration
- IPPanel SMS API integration
🤝 Support
For support, feature requests, or bug reports, please use the GitHub repository issues section.
📄 License
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
👨💻 Credits
Developed by Amir Safari for WooCommerce mobile coupon management with SMS integration capabilities.
⭐ Star this repository if you find it useful!