Opened 12 years ago
Closed 12 years ago
#30932 closed feature request (wontfix)
Store blacklist_keys in a separate table
| Reported by: | ott | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Comments | Version: | 4.1 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
WordPress stores moderation keys in the options table as the blacklist_keys option. When a comment is tested for blocked characters or words it fetches the entire contents of the blacklist_keys option and does a case insensitive sub-string comparison of each line against the author, email address, URL, comment, IP address and user agent. Obviously, this is a linear search and takes at least O(n) time to search the blocklist and O(n) memory to keep it in memory. The wordpress-comment-blacklist blocklist has 16124 entries and takes at least 180 KiB to store in memory. So neither the comparison or the memory requirements are negligible for larger sites. The option blacklist_keys was most likely never designed to store such big blocklists and is rather meant to for blog owner to manually block certain words.
WordPress could instead store the entries of blacklist_keys in a separate database table and search it in O(log n). Is there a chance that this feature is added to WordPress in one of the next versions or should it be implemented as a plugin?
Change History (3)
#3
@
12 years ago
- Milestone Awaiting Review
- Resolution → wontfix
- Status new → closed
Thanks for the feature request, @ott!
This is definitely outside of what we'd do in core, I'd suggest looking at implementing it as a plugin. If you're not sure how to implement a plugin, I'd suggest this post as a good place to start.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I think this would be best as a plugin and not adding an additional table to the db in core. There are many things stored in the options table that could have their own table but that was not how it was designed. The list looks interesting though.