An advanced SKU management system with automated filtering, logging, and cleanup capabilities for WooCommerce products. This plugin helps maintain clean product catalogs by automatically managing products with empty or blocked SKUs.
- Automated SKU Filtering: Automatically detect and handle products with empty or blocked SKUs
- Bulk Product Cleanup: Remove unwanted products in bulk operations
- Scheduled Cleanup: Automated background cleanup with configurable schedules
- Real-time Monitoring: Monitor product changes and SKU modifications in real-time
- Blocked SKU Lists: Maintain lists of SKUs that should be automatically removed
- Regex Pattern Support: Use regular expressions for advanced SKU pattern matching
- Exact Match Filtering: Block specific SKUs with exact string matching
- Dynamic SKU Validation: Real-time validation during product creation/update
- Comprehensive Activity Logs: Track all plugin activities with detailed logging
- Filterable Log Views: Filter logs by action type, date, and product information
- Log Retention Management: Automatic cleanup of old logs with configurable retention periods
- Real-time Dashboard: Live statistics and recent activity monitoring
- Modern Dashboard: Clean, responsive admin interface with real-time statistics
- Quick Actions Panel: Easy access to common tasks and settings
- Bulk Operations: Perform bulk actions on products and SKUs
- AJAX-powered Interface: Smooth user experience with asynchronous operations
- WordPress: 5.0 or higher
- WooCommerce: 5.0 or higher
- PHP: 7.4 or higher
- MySQL: 5.6 or higher
- Download the plugin ZIP file
- Go to Plugins > Add New in your WordPress admin
- Click Upload Plugin and select the ZIP file
- Click Install Now and then Activate
- Extract the plugin files to
/wp-content/plugins/ys-sku-manager/ - Go to Plugins in your WordPress admin
- Find "WooCommerce SKU Manager" and click Activate
wp plugin install ys-sku-manager.zip --activate- After activation, go to WooCommerce > SKU Manager
- Configure your settings in the Settings tab
- Add blocked SKUs in the Blocked SKUs tab
- Monitor activity in the Logs tab
- Auto Delete Empty SKU: Automatically delete products without SKUs
- Auto Delete Blocked SKU: Automatically delete products with blocked SKUs
- Delete Immediately: Delete products immediately or move to trash first
- Cleanup Schedule: Set automated cleanup frequency (hourly, daily, weekly)
- Log Retention Days: Number of days to keep activity logs (default: 30)
- Log Level: Control the verbosity of logging
The main dashboard provides:
- Product Statistics: Total products, products without SKUs, blocked SKUs count
- Recent Activity: Latest plugin actions and changes
- Quick Actions: Direct links to common tasks
- System Status: Current plugin status and health
- Go to SKU Manager > Blocked SKUs
- Enter the SKU or pattern to block
- Optionally add a description
- Choose between exact match or regex pattern
- Click Add Blocked SKU
- Exact Match:
TEMP-001(blocks exactly this SKU) - Regex Pattern:
^TEMP-(blocks all SKUs starting with "TEMP-") - Regex Pattern:
.*-TEST$(blocks all SKUs ending with "-TEST")
- Go to SKU Manager > Dashboard
- Click Run Cleanup to manually trigger cleanup
- Review the results in the activity logs
- Configure automatic cleanup in Settings
- Choose frequency: hourly, daily, or weekly
- Monitor results in the Logs section
- Go to SKU Manager > Logs
- Use filters to view specific action types
- Navigate through pages for historical data
- Clear old logs when needed
- Product Deleted: Products removed by the plugin
- Product Trashed: Products moved to trash
- Blocked SKU Added: New SKUs added to blocklist
- Cleanup Completed: Automated cleanup operations
- Settings Changed: Configuration modifications
// Triggered when a product is filtered
do_action('ysm_product_filtered', $product_id, $reason, $sku);
// Triggered after cleanup completion
do_action('ysm_cleanup_completed', $deleted_count);
// Triggered when a blocked SKU is added
do_action('ysm_blocked_sku_added', $sku, $pattern, $is_regex);// Modify cleanup query limits
apply_filters('ysm_cleanup_limit', 100);
// Customize log retention period
apply_filters('ysm_log_retention_days', 30);
// Modify blocked SKU check
apply_filters('ysm_is_sku_blocked', $is_blocked, $sku);The plugin creates three custom tables:
Stores all plugin activity logs with detailed information.
Maintains the list of blocked SKUs and patterns.
Stores plugin configuration settings.
$ysm = new YasirSKUManager();
$is_blocked = $ysm->is_sku_blocked('TEMP-001');$ysm = new YasirSKUManager();
$ysm->add_blocked_sku('CUSTOM-SKU', 'Custom description', false);$ysm = new YasirSKUManager();
$ysm->log_action('custom_action', 'Custom message', 'admin', $product_id);- Nonce Verification: All AJAX requests are protected with WordPress nonces
- Capability Checks: Admin functions require proper user capabilities
- Data Sanitization: All user inputs are properly sanitized
- SQL Injection Prevention: Prepared statements for all database queries
- XSS Protection: Output escaping for all displayed data
- Efficient Queries: Optimized database queries with proper indexing
- Batch Processing: Bulk operations process items in batches
- Caching: Strategic caching of frequently accessed data
- Background Processing: Heavy operations run in background
- Resource Management: Automatic cleanup of temporary data
- Ensure WooCommerce is installed and activated
- Check PHP error logs for any fatal errors
- Verify database permissions
- Check if WordPress cron is working properly
- Verify cleanup schedule settings
- Review activity logs for error messages
- Check if "Auto Delete" settings are enabled
- Verify blocked SKU patterns are correct
- Review product status and permissions
Enable WordPress debug mode to see detailed error messages:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);- Initial release
- Core SKU management functionality
- Automated cleanup system
- Activity logging
- Admin dashboard interface
- Blocked SKU management
- Regex pattern support
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Follow WordPress coding standards
- Add appropriate tests
- Submit a pull request
This plugin is licensed under the GPL v2 or later.
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.
Yasir Shabbir
- Website: https://yasirshabbir.com
- Plugin URI: https://yasirshabbir.com
For support and questions:
- Create an issue on GitHub
- Visit the plugin support forum
- Contact the developer directly
- Export/Import: Backup and restore blocked SKU lists
- Advanced Filters: More sophisticated filtering options
- Email Notifications: Alerts for cleanup activities
- API Integration: REST API endpoints for external integrations
- Multi-site Support: Enhanced multisite compatibility
- Performance Analytics: Detailed performance metrics
Made with โค๏ธ for the WordPress community