A lightweight, secure, and highly scalable wishlist plugin for WooCommerce. Built with a focus on performance, clean architecture, and seamless Telegram integration for real-time business insights.
- Core Wishlist: AJAX-powered "Add to Wishlist" buttons and a fast grid-based wishlist view via the
[my_wishlist]shortcode. - Asynchronous Notifications: Telegram alerts are processed in the background via WP-Cron (5 min interval) to ensure zero impact on site performance.
- Queue System: Robust event queue with status tracking (Pending / Sent / Failed / Skipped).
- Intelligent Deduplication: Prevents notification spam during AJAX race conditions using a 15-second time window per user/product/event.
- Retry Engine: Automatic delivery attempts (up to 3 times) with detailed error logging in the admin panel.
- Professional Admin UI: Full-featured event monitoring dashboard built on the native
WP_List_Tableclass with a "Retry Now" row action.
- Singleton Pattern: Ensures a single point of entry and state management for the entire plugin.
- Strategy Pattern: The notification engine uses a
Provider_Interface, making it easy to add new channels (Slack, Email, SMS) without changing core logic. - Decoupled Logger: The event capture logic is separated from the delivery logic. The system logs events immediately and processes them asynchronously.
- Lifecycle Management: Environment checks (PHP version, WooCommerce dependency) are performed during activation to prevent system crashes.
- Trigger: User clicks the "Add to Wishlist" button on a product page.
- Security: JavaScript retrieves a WP Nonce for CSRF protection.
- Validation: The server verifies authentication, the nonce, and the unique product ID.
- Data Persistence: Updates are stored in
user_meta(key:_my_wishlist_products). - Event Capture: The
Event_Loggercaptures the interaction and pushes it to the custom database queue if it's not a duplicate.
- Cron Trigger: Every 5 minutes, the
Wishlist_Workeris activated. - Batch Processing: The worker fetches the oldest
pendingorfailed(with attempts < 3) events. - Provider Validation: Checks if the Telegram provider is active and if the specific event type is enabled in settings.
- Dispatch: Sends the payload to Telegram Bot API via
wp_remote_post. - Status Update: Updates the database with the result (success/failure) and increments the attempt counter.
- Backend: PHP 8.1+, WordPress Settings API, WP_List_Table.
- Frontend: Vanilla-style jQuery, CSS3 Grid.
- Integrations: Telegram Bot API (Secure HTML formatting).
- Upload: Copy the
adaptation-wishlistfolder to your/wp-content/plugins/directory. - Activate: Go to 'Plugins' in WordPress Admin and activate "Adaptation WooCommerce Wishlist".
- Configure:
- Navigate to Wishlist Notifications -> Settings (look for the Telegram icon in the sidebar).
- Enter your Telegram Bot Token and Chat ID.
- Select which events to track (Product Added / Product Removed).
- Shortcode: Create a new page and insert
[my_wishlist]to display the user's wishlist. - Monitoring: View all delivery statuses and errors in the Event Logs tab.