Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30932 closed feature request (wontfix)

Store blacklist_keys in a separate table

Reported by: ott's profile ott Owned by:
Milestone: Priority: normal
Severity: minor Version: 4.1
Component: Comments Keywords:
Focuses: Cc:

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)

#1 @SergeyBiryukov
10 years ago

  • Keywords blacklist_keys moderation keys blocklist removed

#2 @MikeHansenMe
10 years ago

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.

#3 @pento
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to 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.

Note: See TracTickets for help on using tickets.