Add blocklist subscriptions for automatic weekly sync#2590
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.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…iptions # Conflicts: # includes/wp-admin/import/class-blocklist.php # tests/phpunit/tests/includes/wp-admin/import/class-test-blocklist.php
sync() now returns false when the URL returns no valid domains, preventing subscription to arbitrary URLs that return HTTP 200.
@pfefferle Nice catch! That should be fixed now. |
Replace "A curated list of the worst actors on the fediverse" with clearer wording that describes what to do with the list rather than characterizing the actors. Links IFTAS to their website. Follow-up to #2590.

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.