-
Notifications
You must be signed in to change notification settings - Fork 82
Add domain blocklist importer #2589
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
Conversation
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 domain blocklist importer feature to enable bulk importing of blocked domains from external sources. It supports multiple formats including Mastodon CSV exports and simple domain-per-line text files, with a quick-import button for the IFTAS DNI list.
Key Changes:
- New
Blocklistimporter class with CSV parsing and URL import capabilities - Bulk
add_site_blocks()method inModerationclass for efficient batch imports - Import UI with file upload and URL import options, including IFTAS DNI quick-import
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
includes/wp-admin/import/class-blocklist.php |
Core importer implementation with CSV parsing, file upload, and URL import functionality |
includes/class-moderation.php |
Added bulk add_site_blocks() method for efficient batch domain blocking |
includes/wp-admin/import/load.php |
Registered the blocklist importer in WordPress import system |
tests/phpunit/tests/includes/wp-admin/import/class-test-blocklist.php |
Comprehensive test suite with 17 tests for CSV parsing edge cases |
.github/changelog/2589-from-description |
Changelog entry for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
If I use an email like identifier for a domain, instead of ignoring it, the script fails completely. is |
|
When you use an email as domain in a CSV!
|
…tests - Add #moderation anchor to settings link for direct navigation. - Wrap Moderation section with ID for anchor targeting. - Add tests confirming email-like identifiers are gracefully skipped.
|
Hm, I'm unable to reproduce that. e5659cd added tests for it that succeed, too. |

Fixes #2474
Proposed changes:
Blocklistimporter class for bulk importing domain blocklistsadd_site_blocks()bulk method toModerationclass for efficient imports#domainheader) and simple domain-per-line text filesOther information:
Testing instructions:
npm run env-test -- --filter Test_BlocklistChangelog entry
Changelog Entry Details
Significance
Type
Message
Add domain blocklist importer for bulk importing blocked domains.