From 489b9e737f33a284a4ef5a9b1a7489a735eca10c Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Wed, 3 Jan 2024 21:57:32 +0000 Subject: [PATCH] Docs: Replace "sanity" with "confidence" for inclusive language. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phrase "sanity check" unnecessarily references mental health. It's an old phrase used to denote an extra step in verifying code works as expected. “The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.” While "sanity check" is a well-known phrase with a specific meaning, "confidence check" is a direct replacement that is more clear of its intent while being more inclusive. Words matter. Follow-up to [49216], [46271], [40583], [38832], [38637], [37409], [33359], [32162], [30346], [30345], [30238], [30055], [29902], [28763], [26141], [25002], [22227], [13428], [12148], [11025], [8927]. Props dartiss, hellofromTonya. Fixes #60187. git-svn-id: https://develop.svn.wordpress.org/trunk@57239 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/post.js | 4 ++-- src/js/_enqueues/vendor/tinymce/utils/form_utils.js | 2 +- src/js/_enqueues/wp/theme.js | 2 +- src/wp-admin/includes/class-pclzip.php | 2 +- src/wp-admin/includes/class-plugin-upgrader.php | 2 +- src/wp-admin/includes/class-theme-upgrader.php | 2 +- src/wp-admin/includes/post.php | 2 +- src/wp-admin/includes/update-core.php | 2 +- src/wp-admin/install.php | 2 +- .../themes/twentytwenty/assets/js/customize-controls.js | 2 +- .../themes/twentytwentyone/inc/template-functions.php | 2 +- src/wp-includes/class-wp-tax-query.php | 2 +- src/wp-includes/class-wpdb.php | 8 ++++---- src/wp-includes/cron.php | 2 +- src/wp-includes/functions.php | 6 +++--- src/wp-includes/post.php | 2 +- src/wp-includes/shortcodes.php | 2 +- src/wp-includes/taxonomy.php | 2 +- tests/phpunit/tests/db/charset.php | 6 +++--- tests/phpunit/tests/formatting/wpTexturize.php | 2 +- tests/phpunit/tests/functions.php | 2 +- tests/phpunit/tests/post.php | 8 ++++---- tests/phpunit/tests/rest-api/rest-users-controller.php | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js index eb577013d5..bba9c17358 100644 --- a/src/js/_enqueues/admin/post.js +++ b/src/js/_enqueues/admin/post.js @@ -1173,7 +1173,7 @@ jQuery( function($) { } /** - * When the dragging stopped make sure we return focus and do a sanity check on the height. + * When the dragging stopped make sure we return focus and do a confidence check on the height. */ function endDrag() { var height, toolbarHeight; @@ -1198,7 +1198,7 @@ jQuery( function($) { $document.off( '.wp-editor-resize' ); - // Sanity check: normalize height to stay within acceptable ranges. + // Confidence check: normalize height to stay within acceptable ranges. if ( height && height > 50 && height < 5000 ) { setUserSetting( 'ed_size', height ); } diff --git a/src/js/_enqueues/vendor/tinymce/utils/form_utils.js b/src/js/_enqueues/vendor/tinymce/utils/form_utils.js index 358ad60a9a..8f8a234c95 100644 --- a/src/js/_enqueues/vendor/tinymce/utils/form_utils.js +++ b/src/js/_enqueues/vendor/tinymce/utils/form_utils.js @@ -199,7 +199,7 @@ function getCSSSize(size) { if (/^[0-9]+$/.test(size)) { size += 'px'; } - // Sanity check, IE doesn't like broken values + // Confidence check, IE doesn't like broken values else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size))) { return ""; } diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 5daf04f7d7..13ed5aab4e 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -1300,7 +1300,7 @@ themes.view.Themes = wp.Backbone.View.extend({ // Find the next model within the collection. nextModel = self.collection.at( self.collection.indexOf( model ) + 1 ); - // Sanity check which also serves as a boundary test. + // Confidence check which also serves as a boundary test. if ( nextModel !== undefined ) { // We have a new theme... diff --git a/src/wp-admin/includes/class-pclzip.php b/src/wp-admin/includes/class-pclzip.php index 3fdade5dd1..963f31178c 100644 --- a/src/wp-admin/includes/class-pclzip.php +++ b/src/wp-admin/includes/class-pclzip.php @@ -1854,7 +1854,7 @@ $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO); - // ----- Sanity check : No threshold if value lower than 1M + // ----- Confidence check : No threshold if value lower than 1M if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); } diff --git a/src/wp-admin/includes/class-plugin-upgrader.php b/src/wp-admin/includes/class-plugin-upgrader.php index 02743f6456..091cfebc18 100644 --- a/src/wp-admin/includes/class-plugin-upgrader.php +++ b/src/wp-admin/includes/class-plugin-upgrader.php @@ -472,7 +472,7 @@ class Plugin_Upgrader extends WP_Upgrader { } $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source ); - if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation. + if ( ! is_dir( $working_directory ) ) { // Confidence check, if the above fails, let's not prevent installation. return $source; } diff --git a/src/wp-admin/includes/class-theme-upgrader.php b/src/wp-admin/includes/class-theme-upgrader.php index 12bd477291..b1cf677839 100644 --- a/src/wp-admin/includes/class-theme-upgrader.php +++ b/src/wp-admin/includes/class-theme-upgrader.php @@ -538,7 +538,7 @@ class Theme_Upgrader extends WP_Upgrader { // Check that the folder contains a valid theme. $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source ); - if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation. + if ( ! is_dir( $working_directory ) ) { // Confidence check, if the above fails, let's not prevent installation. return $source; } diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index b9986d1bde..c93ac71bec 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -452,7 +452,7 @@ function edit_post( $post_data = null ) { $success = wp_update_post( $translated ); - // If the save failed, see if we can sanity check the main fields and try again. + // If the save failed, see if we can confidence check the main fields and try again. if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) { $fields = array( 'post_title', 'post_content', 'post_excerpt' ); diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index ee710d3df3..0c66ad3ee9 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1093,7 +1093,7 @@ function update_core( $from, $to ) { */ apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) ); - // Sanity check the unzipped distribution. + // Confidence check the unzipped distribution. $distro = ''; $roots = array( '/wordpress/', '/wordpress-mu/' ); diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 971392d076..bf102893ff 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -6,7 +6,7 @@ * @subpackage Administration */ -// Sanity check. +// Confidence check. if ( false ) { ?> diff --git a/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js b/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js index 4397cf29c7..ba2d5ad63f 100644 --- a/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js +++ b/src/wp-content/themes/twentytwenty/assets/js/customize-controls.js @@ -69,7 +69,7 @@ // Get accessible colors for the defined background-color and hue. colors = twentyTwentyColor( backgroundColor, accentHue ); - // Sanity check. + // Confidence check. if ( colors.getAccentColor() && 'function' === typeof colors.getAccentColor().toCSS ) { // Update the value for this context. value[ context ] = { diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index 5c1ca0f1e1..4924773dc1 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -367,7 +367,7 @@ function twenty_twenty_one_print_first_instance_of_block( $block_name, $content // Loop blocks. foreach ( $blocks as $block ) { - // Sanity check. + // Confidence check. if ( ! isset( $block['blockName'] ) ) { continue; } diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php index 38841c42b0..58e53ea4a2 100644 --- a/src/wp-includes/class-wp-tax-query.php +++ b/src/wp-includes/class-wp-tax-query.php @@ -505,7 +505,7 @@ class WP_Tax_Query { protected function find_compatible_table_alias( $clause, $parent_query ) { $alias = false; - // Sanity check. Only IN queries use the JOIN syntax. + // Confidence check. Only IN queries use the JOIN syntax. if ( ! isset( $clause['operator'] ) || 'IN' !== $clause['operator'] ) { return $alias; } diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index baba39d91f..d9186b91f4 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -154,7 +154,7 @@ class wpdb { protected $result; /** - * Cached column info, for sanity checking data before inserting. + * Cached column info, for confidence checking data before inserting. * * @since 4.2.0 * @@ -172,7 +172,7 @@ class wpdb { protected $table_charset = array(); /** - * Whether text fields in the current query need to be sanity checked. + * Whether text fields in the current query need to be confidence checked. * * @since 4.2.0 * @@ -1927,7 +1927,7 @@ class wpdb { mysqli_free_result( $this->result ); $this->result = null; - // Sanity check before using the handle. + // Confidence check before using the handle. if ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) { return; } @@ -3516,7 +3516,7 @@ class wpdb { return false; } - // If any of the columns don't have one of these collations, it needs more sanity checking. + // If any of the columns don't have one of these collations, it needs more confidence checking. $safe_collations = array( 'utf8_bin', 'utf8_general_ci', diff --git a/src/wp-includes/cron.php b/src/wp-includes/cron.php index c1837e6051..aadc22b7eb 100644 --- a/src/wp-includes/cron.php +++ b/src/wp-includes/cron.php @@ -874,7 +874,7 @@ function spawn_cron( $gmt_time = 0 ) { return false; } - // Sanity check. + // Confidence check. $crons = wp_get_ready_cron_jobs(); if ( empty( $crons ) ) { return false; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index d270157d1f..c4ecb81f66 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -4284,7 +4284,7 @@ function _wp_die_process_input( $message, $title = '', $args = array() ) { } /** - * Encodes a variable into JSON, with some sanity checks. + * Encodes a variable into JSON, with some confidence checks. * * @since 4.1.0 * @since 5.3.0 No longer handles support for PHP < 5.6. @@ -4300,7 +4300,7 @@ function _wp_die_process_input( $message, $title = '', $args = array() ) { function wp_json_encode( $value, $flags = 0, $depth = 512 ) { $json = json_encode( $value, $flags, $depth ); - // If json_encode() was successful, no need to do more sanity checking. + // If json_encode() was successful, no need to do more confidence checking. if ( false !== $json ) { return $json; } @@ -4315,7 +4315,7 @@ function wp_json_encode( $value, $flags = 0, $depth = 512 ) { } /** - * Performs sanity checks on data that shall be encoded to JSON. + * Performs confidence checks on data that shall be encoded to JSON. * * @ignore * @since 4.1.0 diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index d6b6bc6649..25fefbb621 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3861,7 +3861,7 @@ function wp_untrash_post_comments( $post = null ) { } foreach ( $group_by_status as $status => $comments ) { - // Sanity check. This shouldn't happen. + // Confidence check. This shouldn't happen. if ( 'post-trashed' === $status ) { $status = '0'; } diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php index 24df21d4da..98cd8f71dd 100644 --- a/src/wp-includes/shortcodes.php +++ b/src/wp-includes/shortcodes.php @@ -504,7 +504,7 @@ function do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames ) { $element = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $element ); } - // Looks like we found some crazy unfiltered HTML. Skipping it for sanity. + // Looks like we found some crazy unfiltered HTML. Skipping it for confidence. $element = strtr( $element, $trans ); continue; } diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 59ec5345fe..eaadaad65c 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -2573,7 +2573,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { $tt_id = (int) $wpdb->insert_id; /* - * Sanity check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than + * Confidence check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than * an existing term, then we have unwittingly created a duplicate term. Delete the dupe, and use the term_id * and term_taxonomy_id of the older term instead. Then return out of the function so that the "create" hooks * are not fired. diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php index 1a79ab911f..52eb56a7a8 100644 --- a/tests/phpunit/tests/db/charset.php +++ b/tests/phpunit/tests/db/charset.php @@ -1022,7 +1022,7 @@ class Tests_DB_Charset extends WP_UnitTestCase { $table_name = 'table_collation_check'; $data = array( 'utf8_bin' => array( - // utf8_bin tables don't need extra sanity checking. + // utf8_bin tables don't need extra confidence checking. 'create' => '( a VARCHAR(50) COLLATE utf8_bin )', 'expected' => true, ), @@ -1037,13 +1037,13 @@ class Tests_DB_Charset extends WP_UnitTestCase { 'expected' => false, ), 'utf8_bin + big5_chinese_ci' => array( - // utf8_bin tables don't need extra sanity checking, + // utf8_bin tables don't need extra confidence checking, // except for when they're not just utf8_bin. 'create' => '( a VARCHAR(50) COLLATE utf8_bin, b VARCHAR(50) COLLATE big5_chinese_ci )', 'expected' => false, ), 'utf8_bin + int' => array( - // utf8_bin tables don't need extra sanity checking + // utf8_bin tables don't need extra confidence checking // when the other columns aren't strings. 'create' => '( a VARCHAR(50) COLLATE utf8_bin, b INT )', 'expected' => true, diff --git a/tests/phpunit/tests/formatting/wpTexturize.php b/tests/phpunit/tests/formatting/wpTexturize.php index 3202db4ba7..fa81245c83 100644 --- a/tests/phpunit/tests/formatting/wpTexturize.php +++ b/tests/phpunit/tests/formatting/wpTexturize.php @@ -1788,7 +1788,7 @@ class Tests_Formatting_wpTexturize extends WP_UnitTestCase { } /** - * Extra sanity checks for _wptexturize_pushpop_element() + * Extra confidence checks for _wptexturize_pushpop_element() * * @ticket 28483 * @dataProvider data_element_stack diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index cef6a1eaf5..828184491d 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -229,7 +229,7 @@ class Tests_Functions extends WP_UnitTestCase { $testdir = DIR_TESTDATA . '/images/'; - // Sanity check. + // Confidence check. $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcdefg.png' ), 'Test non-existing file, file name should be unchanged.' ); // Ensure correct images exist. diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index 548c5eb2ca..6e0207add2 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -329,12 +329,12 @@ class Tests_Post extends WP_UnitTestCase { ); stick_post( $post->ID ); - // Sanity check. + // Confidence check. $this->assertTrue( is_sticky( $post->ID ) ); wp_set_current_user( self::$grammarian_id ); - // Sanity check. + // Confidence check. $this->assertFalse( current_user_can( 'publish_posts' ) ); $this->assertTrue( current_user_can( 'edit_others_posts' ) ); $this->assertTrue( current_user_can( 'edit_published_posts' ) ); @@ -367,12 +367,12 @@ class Tests_Post extends WP_UnitTestCase { ); stick_post( $post->ID ); - // Sanity check. + // Confidence check. $this->assertTrue( is_sticky( $post->ID ) ); wp_set_current_user( self::$grammarian_id ); - // Sanity check. + // Confidence check. $this->assertFalse( current_user_can( 'publish_posts' ) ); $this->assertTrue( current_user_can( 'edit_others_posts' ) ); $this->assertTrue( current_user_can( 'edit_published_posts' ) ); diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index ac5b0741e9..2cad1ef032 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -2520,7 +2520,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { ) ); - // Sanity check to ensure the factory created the post correctly. + // Confidence check to ensure the factory created the post correctly. $post = get_post( $test_post ); $this->assertEquals( $user_id, $post->post_author );