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/checkComment.php

    r46586 r48121  
    55 */
    66class Tests_Comment_CheckComment extends WP_UnitTestCase {
    7     public function test_should_return_true_when_comment_whitelist_is_disabled() {
     7    public function test_should_return_true_when_comment_previously_approved_is_disabled() {
    88        $author       = 'BobtheBuilder';
    99        $author_email = 'bob@example.com';
     
    1414        $comment_type = '';
    1515
    16         update_option( 'comment_whitelist', 0 );
     16        update_option( 'comment_previously_approved', 0 );
    1717        $results = check_comment( $author, $author_email, $author_url, $comment, $author_ip, $user_agent, $comment_type );
    1818        $this->assertTrue( $results );
    1919    }
    2020
    21     public function test_should_return_false_when_comment_whitelist_is_enabled_and_author_does_not_have_approved_comment() {
     21    public function test_should_return_false_when_comment_previously_approved_is_enabled_and_author_does_not_have_approved_comment() {
    2222        $author       = 'BobtheBuilder';
    2323        $author_email = 'bob@example.com';
     
    2828        $comment_type = '';
    2929
    30         update_option( 'comment_whitelist', 1 );
     30        update_option( 'comment_previously_approved', 1 );
    3131        $results = check_comment( $author, $author_email, $author_url, $comment, $author_ip, $user_agent, $comment_type );
    3232        $this->assertFalse( $results );
     
    3434    }
    3535
    36     public function test_should_return_true_when_comment_whitelist_is_enabled_and_author_has_approved_comment() {
     36    public function test_should_return_true_when_comment_previously_approved_is_enabled_and_author_has_approved_comment() {
    3737        $post_id         = self::factory()->post->create();
    3838        $prev_args       = array(
     
    4545        $prev_comment_id = self::factory()->comment->create( $prev_args );
    4646
    47         update_option( 'comment_whitelist', 1 );
     47        update_option( 'comment_previously_approved', 1 );
    4848
    4949        $author       = 'BobtheBuilder';
     
    7070
    7171    public function test_should_return_false_when_content_matches_moderation_key() {
    72         update_option( 'comment_whitelist', 0 );
     72        update_option( 'comment_previously_approved', 0 );
    7373
    7474        $author       = 'WendytheBuilder';
     
    8686
    8787    public function test_should_return_true_when_content_does_not_match_moderation_keys() {
    88         update_option( 'comment_whitelist', 0 );
     88        update_option( 'comment_previously_approved', 0 );
    8989
    9090        $author       = 'WendytheBuilder';
     
    102102
    103103    public function test_should_return_false_when_link_count_exceeds_comment_max_length_setting() {
    104         update_option( 'comment_whitelist', 0 );
     104        update_option( 'comment_previously_approved', 0 );
    105105
    106106        $author       = 'BobtheBuilder';
     
    118118
    119119    public function test_should_return_true_when_link_count_does_not_exceed_comment_max_length_setting() {
    120         update_option( 'comment_whitelist', 0 );
     120        update_option( 'comment_previously_approved', 0 );
    121121
    122122        $author       = 'BobtheBuilder';
     
    136136     * @ticket 28603
    137137     */
    138     public function test_should_return_true_when_comment_whitelist_is_enabled_and_user_has_previously_approved_comments_with_different_email() {
     138    public function test_should_return_true_when_comment_previously_approved_is_enabled_and_user_has_previously_approved_comments_with_different_email() {
    139139        $subscriber_id = $this->factory()->user->create(
    140140            array(
     
    159159        wp_update_user( $subscriber_user );
    160160
    161         update_option( 'comment_whitelist', 1 );
     161        update_option( 'comment_previously_approved', 1 );
    162162
    163163        $results = check_comment( 'foo', 'newsub@example.com', 'http://example.com', 'This is a comment.', '66.155.40.249', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0', 'comment', 4 );
     
    168168     * @ticket 28603
    169169     */
    170     public function test_should_return_false_when_comment_whitelist_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email() {
     170    public function test_should_return_false_when_comment_previously_approved_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email() {
    171171        $subscriber_id = $this->factory()->user->create(
    172172            array(
     
    181181        wp_update_user( $subscriber_user );
    182182
    183         update_option( 'comment_whitelist', 1 );
     183        update_option( 'comment_previously_approved', 1 );
    184184
    185185        $results = check_comment( 'bar', 'zag@example.com', 'http://example.com', 'This is my first comment.', '66.155.40.249', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0', 'comment', 4 );
Note: See TracChangeset for help on using the changeset viewer.