-
Notifications
You must be signed in to change notification settings - Fork 83
Add blocklist subscriptions for automatic weekly sync #2590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add/blocklist-importer
Are you sure you want to change the base?
Conversation
- Add Blocklist_Subscriptions class to manage remote blocklist URLs - Move CSV parsing logic from importer to Blocklist_Subscriptions - Add settings UI to manage subscriptions with hostname display - Add AJAX handlers for add/remove subscription operations - Schedule weekly cron job to sync all subscriptions - Hide IFTAS button when already subscribed - Add unit tests for subscription management
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a blocklist subscription system that allows automatic weekly synchronization of remote blocklists. The implementation introduces a new Blocklist_Subscriptions class that centralizes all remote blocklist operations (fetching, parsing, importing), moves CSV parsing logic from the importer for better separation of concerns, and integrates with WordPress cron for automated weekly updates.
Key Changes
- New
Blocklist_Subscriptionsclass handles subscription management and syncing with automatic timestamp tracking - Settings UI added to manage subscriptions with hostname display and tooltips showing full URLs
- Importer enhanced with subscription checkbox and support for both one-time imports and subscriptions
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
includes/class-blocklist-subscriptions.php |
New class managing remote blocklist subscriptions with sync, add/remove, and CSV parsing functionality |
includes/wp-admin/class-admin.php |
AJAX handler added for subscription add/remove operations with proper security checks |
includes/wp-admin/class-settings-fields.php |
Settings UI field rendering subscriptions table with add/remove controls and IFTAS quick-import |
includes/wp-admin/import/class-blocklist.php |
Refactored to use Blocklist_Subscriptions for URL imports and added subscription checkbox |
includes/class-scheduler.php |
Registered weekly cron event for automatic blocklist synchronization |
assets/js/activitypub-moderation-admin.js |
JavaScript handlers for subscription management with AJAX and accessibility support |
tests/phpunit/tests/includes/class-test-blocklist-subscriptions.php |
Unit tests for subscription add/remove and validation methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes:
Blocklist_Subscriptionsclass to manage remote blocklist URLs with automatic weekly syncing.Blocklist_Subscriptionsfor better separation of concerns.Other information:
Testing instructions:
wp cron event list | grep blocklist.Changelog entry
Changelog Entry Details
Significance
Type
Message
Add blocklist subscriptions for automatic weekly synchronization of remote blocklists.