Make WordPress Core


Ignore:
Timestamp:
06/22/2020 05:24:34 PM (5 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/multisite/siteDetails.php

    r47122 r48121  
    1010    class Tests_Multisite_Site_Details extends WP_UnitTestCase {
    1111        /**
    12          * @dataProvider data_whitelisted_options
     12         * @dataProvider data_allowed_options
    1313         *
    1414         * @ticket 40063
    1515         */
    16         public function test_update_whitelisted_option_deletes_site_details_cache( $whitelisted_option, $temporary_value ) {
     16        public function test_update_allowed_option_deletes_site_details_cache( $allowed_option, $temporary_value ) {
    1717            $site = get_site();
    1818
    19             $original_value = $site->$whitelisted_option;
    20             update_option( $whitelisted_option, $temporary_value );
     19            $original_value = $site->$allowed_option;
     20            update_option( $allowed_option, $temporary_value );
    2121
    2222            $cached_result = wp_cache_get( $site->id, 'site-details' );
    2323
    2424            /* Reset to original value. */
    25             update_option( $whitelisted_option, $original_value );
     25            update_option( $allowed_option, $original_value );
    2626
    2727            $this->assertFalse( $cached_result );
     
    2929
    3030        /**
    31          * @dataProvider data_whitelisted_options
     31         * @dataProvider data_allowed_options
    3232         *
    3333         * @ticket 40063
    3434         */
    35         public function test_update_whitelisted_option_deletes_blog_details_cache( $whitelisted_option, $temporary_value ) {
     35        public function test_update_allowed_option_deletes_blog_details_cache( $allowed_option, $temporary_value ) {
    3636            $blog_details = get_blog_details();
    3737
    38             $original_value = $blog_details->$whitelisted_option;
    39             update_option( $whitelisted_option, $temporary_value );
     38            $original_value = $blog_details->$allowed_option;
     39            update_option( $allowed_option, $temporary_value );
    4040
    4141            $cached_result = wp_cache_get( $blog_details->id, 'blog-details' );
    4242
    4343            /* Reset to original value. */
    44             update_option( $whitelisted_option, $original_value );
     44            update_option( $allowed_option, $original_value );
    4545
    4646            $this->assertFalse( $cached_result );
     
    4848
    4949        /**
    50          * @dataProvider data_whitelisted_options
     50         * @dataProvider data_allowed_options
    5151         *
    5252         * @ticket 40063
    5353         */
    54         public function test_update_whitelisted_option_does_not_delete_site_cache( $whitelisted_option, $temporary_value ) {
     54        public function test_update_allowed_option_does_not_delete_site_cache( $allowed_option, $temporary_value ) {
    5555            $site = get_site();
    5656
    57             $original_value = $site->$whitelisted_option;
    58             update_option( $whitelisted_option, $temporary_value );
     57            $original_value = $site->$allowed_option;
     58            update_option( $allowed_option, $temporary_value );
    5959
    6060            $cached_result = wp_cache_get( $site->id, 'sites' );
    6161
    6262            /* Reset to original value. */
    63             update_option( $whitelisted_option, $original_value );
     63            update_option( $allowed_option, $original_value );
    6464
    6565            $this->assertNotFalse( $cached_result );
     
    6767
    6868        /**
    69          * @dataProvider data_whitelisted_options
     69         * @dataProvider data_allowed_options
    7070         *
    7171         * @ticket 40063
    7272         */
    73         public function test_update_whitelisted_option_does_not_delete_short_blog_details_cache( $whitelisted_option, $temporary_value ) {
     73        public function test_update_allowed_option_does_not_delete_short_blog_details_cache( $allowed_option, $temporary_value ) {
    7474            $blog_details = get_blog_details( null, false );
    7575
    76             $original_value = get_option( $whitelisted_option );
    77             update_option( $whitelisted_option, $temporary_value );
     76            $original_value = get_option( $allowed_option );
     77            update_option( $allowed_option, $temporary_value );
    7878
    7979            $cached_result = wp_cache_get( $blog_details->id . 'short', 'blog-details' );
    8080
    8181            /* Reset to original value. */
    82             update_option( $whitelisted_option, $original_value );
     82            update_option( $allowed_option, $original_value );
    8383
    8484            $this->assertNotFalse( $cached_result );
     
    8686
    8787        /**
    88          * @dataProvider data_whitelisted_options
     88         * @dataProvider data_allowed_options
    8989         *
    9090         * @ticket 40063
    9191         */
    92         public function test_update_whitelisted_option_does_not_update_sites_last_changed( $whitelisted_option, $temporary_value ) {
     92        public function test_update_allowed_option_does_not_update_sites_last_changed( $allowed_option, $temporary_value ) {
    9393            $last_changed = wp_cache_get_last_changed( 'sites' );
    9494
    95             $original_value = get_option( $whitelisted_option );
    96             update_option( $whitelisted_option, $temporary_value );
     95            $original_value = get_option( $allowed_option );
     96            update_option( $allowed_option, $temporary_value );
    9797
    9898            $new_last_changed = wp_cache_get_last_changed( 'sites' );
    9999
    100100            /* Reset to original value. */
    101             update_option( $whitelisted_option, $original_value );
     101            update_option( $allowed_option, $original_value );
    102102
    103103            $this->assertSame( $new_last_changed, $last_changed );
    104104        }
    105105
    106         public function data_whitelisted_options() {
     106        public function data_allowed_options() {
    107107            return array(
    108108                array( 'blogname', 'Custom Site' ),
Note: See TracChangeset for help on using the changeset viewer.