Wikis Email Cleaner
Wikis Email Cleaner is a WordPress plugin that directly fetches subscribers from The Newsletter Plugin and displays or processes their details as needed. It streamlines subscriber management by integrating with The Newsletter Plugin’s API, making it easier to access and utilize subscriber data for your site.
by wikiwyrhead · github.com/wikiwyrhead/wikis-email-cleaner · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/wikiwyrhead/wikis-email-cleaner/archive/refs/heads/main.zipA professional email cleaning tool for The Newsletter Plugin. Validates emails, unsubscribes invalid ones, logs actions, and exports to CSV. Includes admin interface, scheduled scans, revalidation, migration tool, and email alerts.
Features
- Email Validation: Comprehensive email validation including syntax, domain, MX record, and SMTP checks
- Revalidation System: Periodically re-checks existing emails for validity, with admin UI for managing revalidation candidates and results
- Migration Tool: Easily set up new database tables and migrate settings for revalidation from the admin page
- Newsletter Plugin Integration: Seamless integration with The Newsletter Plugin using official hooks and filters
- Automated Cleaning & Revalidation: Scheduled scans and revalidation to automatically identify and unsubscribe invalid emails
- Real-time Validation: Validate emails during subscription process to prevent invalid subscriptions
- Detailed Logging: Complete audit trail of all validation activities with CSV export
- Admin Dashboard: User-friendly interface for monitoring and managing email cleaning
- Configurable & Improved Settings: Advanced configuration options for validation, revalidation, and automation with safer defaults
- Email Notifications: Optional email reports after scan or revalidation completion
Revalidation System
The revalidation system allows you to periodically re-check the validity of existing emails. It includes:
- Admin UI for viewing and managing revalidation candidates
- Batch processor and queue manager for efficient handling
- Scheduler for automated revalidation and queue population
- Migration tool to set up new tables and migrate settings (trigger from admin page with
?action=migrate)
Migration Tool
To set up the new revalidation system, visit the revalidation admin page and add ?action=migrate to the URL. This will create the necessary database tables and migrate any required settings.
Configuration
General Settings
- Enable Automatic Cleaning: Turn on/off scheduled email cleaning
- Enable Revalidation: Turn on/off periodic revalidation of existing emails
- Minimum Valid Score: Set threshold for email validity (0-100)
- Scan Frequency: Choose how often to run automatic scans (hourly/daily/weekly)
- Revalidation Frequency: Choose how often to run revalidation (daily/weekly/monthly)
Validation Settings
- Enable Deep Validation: Perform SMTP and MX record checks (slower but more accurate)
- Validate on Subscription: Check emails during subscription process
- Subscription Minimum Score: Lower threshold for new subscriptions
- Deep Validate on Confirmation: Run deep validation when users confirm subscription
- Handle Bounces & Complaints: Automatically process bounced emails and spam complaints
Notification Settings
- Send Email Notifications: Receive email reports after scans or revalidation
- Notification Email: Email address for receiving reports
Advanced Settings
- Log Retention Days: How long to keep validation logs (1-365 days)
- Batch Size: Number of emails to process per batch (10-1000)
- Preserve Data on Uninstall: Keep plugin data when uninstalling
Usage
Manual Email Scan
- Go to Email Cleaner dashboard
- Click "Scan All Emails" button
- Monitor progress and review results
- Export results to CSV if needed
Viewing Logs
- Navigate to Email Cleaner → Logs
- Use filters to find specific validation results
- Export logs to CSV for external analysis
Scheduled Scans
- Enable "Automatic Cleaning" in settings
- Choose scan frequency
- Plugin will automatically scan and clean emails based on schedule
Revalidation
- Enable "Revalidation" in settings
- Choose revalidation frequency
- Plugin will automatically re-check email validity based on schedule
Email Validation Process
The plugin uses a multi-step validation process:
- Syntax Check: Validates email format using WordPress standards
- Disposable Email Detection: Checks against known disposable email providers
- Role-based Email Detection: Identifies generic role-based emails (admin@, info@, etc.)
- Domain Validation: Verifies domain exists and has MX records
- SMTP Validation (Deep mode): Tests SMTP server connectivity
- Scoring: Assigns score based on validation results (0-100)
Integration with Newsletter Plugin
The plugin integrates with The Newsletter Plugin using official hooks:
newsletter_subscription: Validates emails during subscriptionnewsletter_user_confirmed: Validates on user confirmationnewsletter_user_unsubscribed: Logs unsubscription eventsnewsletter_user_bounced: Handles bounced emailsnewsletter_user_complained: Processes spam complaints
Database Tables
The plugin creates two database tables:
wp_wikis_email_cleaner_logs: Stores validation resultswp_wikis_email_cleaner_scan_summary: Stores scan summaries
Security Features
- Nonce Verification: All AJAX requests use WordPress nonces
- Capability Checks: Admin functions require
manage_optionscapability - Data Sanitization: All input data is properly sanitized
- SQL Injection Prevention: Uses WordPress prepared statements
- File Protection: Upload directories protected with .htaccess
Performance Considerations
- Batch Processing: Large email lists processed in configurable batches
- Caching: Validation results cached to avoid duplicate checks
- Background Processing: Scheduled scans run via WordPress cron
- Memory Management: Automatic cleanup of old logs and temporary files
Troubleshooting
Common Issues
-
Plugin won't activate
- Ensure The Newsletter Plugin is installed and active
- Check PHP version (7.4+ required)
- Verify WordPress version (5.5+ required)
-
Scans not running automatically
- Check if automatic cleaning is enabled in settings
- Verify WordPress cron is working properly
- Check server logs for any errors
-
Deep validation not working
- Ensure server can make outbound connections on port 25
- Check if hosting provider blocks SMTP connections
- Try disabling deep validation and use basic validation only
-
Revalidation not working
- Ensure revalidation is enabled in settings
- Check if there are any pending revalidation tasks in the admin UI
- Verify that the revalidation frequency is set correctly
Debug Mode
To enable debug logging, add this to your wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
Check /wp-content/debug.log for plugin-related messages.
Hooks and Filters
Actions
wikis_email_cleaner_init: Fired when plugin is initializedwikis_email_cleaner_auto_unsubscribed: Fired when email is automatically unsubscribedwikis_email_cleaner_problematic_email: Fired when problematic email is detected
Filters
wikis_email_cleaner_validation_score: Modify validation scorewikis_email_cleaner_disposable_domains: Modify disposable domains listwikis_email_cleaner_batch_size: Modify batch processing size
Support
For support and bug reports:
- Check the troubleshooting section above
- Review WordPress and server error logs
- Create an issue on the plugin repository
- Contact the plugin author
License
This plugin is licensed under the GPLv2 or later.
Changelog
Version 1.1.0
- New revalidation system for periodic email re-checks
- Migration tool for new DB tables and settings
- Batch processor, queue manager, and scheduler for revalidation
- Improved settings for safer defaults
- Bug fix: undefined constant in revalidation admin
Version 1.0.0
- Initial release
- Email validation with scoring system
- Newsletter Plugin integration
- Automated cleaning with scheduling
- Admin dashboard and settings
- Logging and CSV export
- Email notifications
Credits
Developed by wikiwyrhead for integration with The Newsletter Plugin.
Contributing
Contributions are welcome! Please follow WordPress coding standards and include tests for new features.