Skip to content

Conversation

@obenland
Copy link
Member

@obenland obenland commented Dec 4, 2025

Proposed changes:

  • Add Blocklist_Subscriptions class to manage remote blocklist URLs with automatic weekly syncing.
  • Move CSV parsing logic from importer to Blocklist_Subscriptions for better separation of concerns.
  • Add settings UI to manage subscriptions with hostname display and full URL in tooltip.
  • Add AJAX handlers for add/remove subscription operations.
  • Hide IFTAS quick-import button when already subscribed.
  • Add unit tests for subscription management.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to Settings → ActivityPub → Moderation tab.
  • Add a blocklist subscription URL and verify it appears with hostname display.
  • Hover over hostname to see full URL in tooltip.
  • Remove a subscription and verify it's removed.
  • Click "Subscribe to IFTAS DNI List" button.
  • Verify the IFTAS button hides after subscribing.
  • Go to Tools → Import → Domain Blocklist.
  • Import from URL with subscribe checkbox checked.
  • Verify weekly cron is scheduled: wp cron event list | grep blocklist.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Add blocklist subscriptions for automatic weekly synchronization of remote blocklists.

- 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
@obenland obenland requested a review from Copilot December 4, 2025 22:00
Copilot finished reviewing on behalf of obenland December 4, 2025 22:04
Copy link

Copilot AI left a 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_Subscriptions class 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants