Make WordPress Core


Ignore:
Timestamp:
06/22/2020 05:24:34 PM (4 years ago)
Author:
desrosj
Message:

General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.

“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the $new_whitelist_options global variable) are removed. A new ticket has been opened to explore renaming the $new_whitelist_options variable (#50434).

Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.

Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.

Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/wpBlacklistCheck.php

    r46586 r48121  
    44 * @group comment
    55 */
    6 class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
     6class Tests_WP_Blocklist_Check extends WP_UnitTestCase {
    77
    8     public function test_should_return_true_when_content_matches_blacklist_keys() {
     8    public function test_should_return_true_when_content_matches_blocklist_keys() {
    99        $author       = 'Sting';
    1010        $author_email = 'sting@example.com';
     
    1414        $user_agent   = '';
    1515
    16         update_option( 'blacklist_keys', "well\nfoo" );
     16        update_option( 'blocklist_keys', "well\nfoo" );
    1717
    18         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     18        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    1919
    2020        $this->assertTrue( $result );
     
    2424     * @ticket 37208
    2525     */
    26     public function test_should_return_true_when_content_with_html_matches_blacklist_keys() {
     26    public function test_should_return_true_when_content_with_html_matches_blocklist_keys() {
    2727        $author       = 'Sting';
    2828        $author_email = 'sting@example.com';
     
    3232        $user_agent   = '';
    3333
    34         update_option( 'blacklist_keys', "halfway\nfoo" );
     34        update_option( 'blocklist_keys', "halfway\nfoo" );
    3535
    36         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     36        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    3737
    3838        $this->assertTrue( $result );
    3939    }
    4040
    41     public function test_should_return_true_when_author_matches_blacklist_keys() {
     41    public function test_should_return_true_when_author_matches_blocklist_keys() {
    4242        $author       = 'Sideshow Mel';
    4343        $author_email = 'mel@example.com';
     
    4747        $user_agent   = '';
    4848
    49         update_option( 'blacklist_keys', "sideshow\nfoo" );
     49        update_option( 'blocklist_keys', "sideshow\nfoo" );
    5050
    51         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     51        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    5252
    5353        $this->assertTrue( $result );
    5454    }
    5555
    56     public function test_should_return_true_when_url_matches_blacklist_keys() {
     56    public function test_should_return_true_when_url_matches_blocklist_keys() {
    5757        $author       = 'Rainier Wolfcastle';
    5858        $author_email = 'rainier@wolfcastle.com';
     
    6262        $user_agent   = '';
    6363
    64         update_option( 'blacklist_keys', "example\nfoo" );
     64        update_option( 'blocklist_keys', "example\nfoo" );
    6565
    66         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     66        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    6767
    6868        $this->assertTrue( $result );
     
    7272     * @ticket 37208
    7373     */
    74     public function test_should_return_true_when_link_matches_blacklist_keys() {
     74    public function test_should_return_true_when_link_matches_blocklist_keys() {
    7575        $author       = 'Rainier Wolfcastle';
    7676        $author_email = 'rainier@wolfcastle.com';
     
    8080        $user_agent   = '';
    8181
    82         update_option( 'blacklist_keys', '/spam/' );
     82        update_option( 'blocklist_keys', '/spam/' );
    8383
    84         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     84        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    8585
    8686        $this->assertTrue( $result );
     
    9595        $user_agent   = '';
    9696
    97         update_option( 'blacklist_keys', "sideshow\nfoobar" );
     97        update_option( 'blocklist_keys', "sideshow\nfoobar" );
    9898
    99         $result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
     99        $result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
    100100
    101101        $this->assertFalse( $result );
Note: See TracChangeset for help on using the changeset viewer.