diff --git a/src/wp-admin/authorize-application.php b/src/wp-admin/authorize-application.php
index 94327b05b7..b2027250f5 100644
--- a/src/wp-admin/authorize-application.php
+++ b/src/wp-admin/authorize-application.php
@@ -12,7 +12,7 @@ require_once __DIR__ . '/admin.php';
$error = null;
$new_password = '';
-// This is the no-js fallback script. Generally this will all be handled by `auth-app.js`
+// This is the no-js fallback script. Generally this will all be handled by `auth-app.js`.
if ( isset( $_POST['action'] ) && 'authorize_application_password' === $_POST['action'] ) {
check_admin_referer( 'authorize_application_password' );
diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php
index 0d697e4566..a21045d291 100644
--- a/src/wp-admin/includes/class-wp-site-health.php
+++ b/src/wp-admin/includes/class-wp-site-health.php
@@ -1513,8 +1513,8 @@ class WP_Site_Health {
* @return array The test results.
*/
public function get_test_https_status() {
- // Enforce fresh HTTPS detection results. This is normally invoked by using cron, but for Site Health it should
- // always rely on the latest results.
+ // Enforce fresh HTTPS detection results. This is normally invoked by using cron,
+ // but for Site Health it should always rely on the latest results.
wp_update_https_detection_errors();
$default_update_url = wp_get_default_update_https_url();
@@ -1541,8 +1541,8 @@ class WP_Site_Health {
);
if ( ! wp_is_using_https() ) {
- // If the website is not using HTTPS, provide more information about whether it is supported and how it can
- // be enabled.
+ // If the website is not using HTTPS, provide more information
+ // about whether it is supported and how it can be enabled.
$result['status'] = 'recommended';
$result['label'] = __( 'Your website does not use HTTPS' );
diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php
index d72c21e2e6..55c00484ac 100644
--- a/src/wp-admin/setup-config.php
+++ b/src/wp-admin/setup-config.php
@@ -453,7 +453,7 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {
$wp_config_perms = fileperms( $path_to_wp_config );
if ( ! empty( $wp_config_perms ) && ! is_writable( $path_to_wp_config ) ) {
$error_message = sprintf(
- /* translators: 1 wp-config.php, 2: Documentation URL. */
+ /* translators: 1: wp-config.php, 2: Documentation URL. */
__( 'You need to make the file %1$s writable before you can save your changes. See Changing File Permissions for more information.' ),
'wp-config.php
',
__( 'https://wordpress.org/support/article/changing-file-permissions/' )
diff --git a/src/wp-includes/class-wp-simplepie-file.php b/src/wp-includes/class-wp-simplepie-file.php
index beb40efbcd..1c2630ae6c 100644
--- a/src/wp-includes/class-wp-simplepie-file.php
+++ b/src/wp-includes/class-wp-simplepie-file.php
@@ -24,8 +24,8 @@ class WP_SimplePie_File extends SimplePie_File {
*
* @since 2.8.0
* @since 3.2.0 Updated to use a PHP5 constructor.
- * @since 5.6.1 Multiple headers are concatenated into a comma-separated string, rather than remaining
- * an array.
+ * @since 5.6.1 Multiple headers are concatenated into a comma-separated string,
+ * rather than remaining an array.
*
* @param string $url Remote file URL.
* @param int $timeout Optional. How long the connection should stay open in seconds.
@@ -70,12 +70,12 @@ class WP_SimplePie_File extends SimplePie_File {
$this->headers = wp_remote_retrieve_headers( $res );
/*
- * SimplePie expects multiple headers to be stored as a comma-separated string, but
- * `wp_remote_retrieve_headers()` returns them as an array, so they need to be
- * converted.
+ * SimplePie expects multiple headers to be stored as a comma-separated string,
+ * but `wp_remote_retrieve_headers()` returns them as an array, so they need
+ * to be converted.
*
- * The only exception to that is the `content-type` header, which should ignore any
- * previous values and only use the last one.
+ * The only exception to that is the `content-type` header, which should ignore
+ * any previous values and only use the last one.
*
* @see SimplePie_HTTP_Parser::new_line().
*/
diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
index 265a9a45b2..9e23dad934 100644
--- a/src/wp-includes/feed.php
+++ b/src/wp-includes/feed.php
@@ -796,8 +796,8 @@ function fetch_feed( $url ) {
$feed = new SimplePie();
$feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
- // We must manually overwrite $feed->sanitize because SimplePie's
- // constructor sets it before we have a chance to set the sanitization class.
+ // We must manually overwrite $feed->sanitize because SimplePie's constructor
+ // sets it before we have a chance to set the sanitization class.
$feed->sanitize = new WP_SimplePie_Sanitize_KSES();
// Register the cache handler using the recommended method for SimplePie 1.3 or later.
diff --git a/src/wp-includes/https-detection.php b/src/wp-includes/https-detection.php
index f834549f95..485bffeb00 100644
--- a/src/wp-includes/https-detection.php
+++ b/src/wp-includes/https-detection.php
@@ -40,8 +40,8 @@ function wp_is_home_url_using_https() {
/**
* Checks whether the current site's URL where WordPress is stored is using HTTPS.
*
- * This checks the URL where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are
- * accessible.
+ * This checks the URL where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder)
+ * are accessible.
*
* @since 5.7.0
* @see site_url()
diff --git a/src/wp-includes/sitemaps.php b/src/wp-includes/sitemaps.php
index 1dfcd1d69c..656fc5ecaa 100644
--- a/src/wp-includes/sitemaps.php
+++ b/src/wp-includes/sitemaps.php
@@ -51,6 +51,7 @@ function wp_sitemaps_get_server() {
*/
function wp_get_sitemap_providers() {
$sitemaps = wp_sitemaps_get_server();
+
return $sitemaps->registry->get_providers();
}
@@ -65,6 +66,7 @@ function wp_get_sitemap_providers() {
*/
function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) {
$sitemaps = wp_sitemaps_get_server();
+
return $sitemaps->registry->add_provider( $name, $provider );
}
@@ -94,12 +96,13 @@ function wp_sitemaps_get_max_urls( $object_type ) {
* @since 5.5.1
*
* @param string $name The sitemap name.
- * @param string $subtype_name The sitemap subtype name. Default empty string.
- * @param int $page The page of the sitemap. Default 1.
+ * @param string $subtype_name The sitemap subtype name. Default empty string.
+ * @param int $page The page of the sitemap. Default 1.
* @return string|false The sitemap URL or false if the sitemap doesn't exist.
*/
function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) {
$sitemaps = wp_sitemaps_get_server();
+
if ( ! $sitemaps ) {
return false;
}
@@ -121,5 +124,6 @@ function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) {
if ( 0 >= $page ) {
$page = 1;
}
+
return $provider->get_sitemap_url( $subtype_name, $page );
}
diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
index 8a94526df2..13c1542e86 100644
--- a/src/wp-includes/user.php
+++ b/src/wp-includes/user.php
@@ -747,7 +747,7 @@ function delete_user_option( $user_id, $option_name, $global = false ) {
*
* @see WP_User_Query
*
- * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query().
+ * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query()
* for more information on accepted arguments.
* @return array List of users.
*/
diff --git a/src/wp-load.php b/src/wp-load.php
index 622865959e..2c20055f15 100644
--- a/src/wp-load.php
+++ b/src/wp-load.php
@@ -25,13 +25,14 @@ if ( ! defined( 'ABSPATH' ) ) {
* The error_reporting() function can be disabled in php.ini. On systems where that is the case,
* it's best to add a dummy function to the wp-config.php file, but as this call to the function
* is run prior to wp-config.php loading, it is wrapped in a function_exists() check.
- *
- * Initialize error reporting to a known set of levels.
- *
- * This will be adapted in wp_debug_mode located in wp-includes/load.php based on WP_DEBUG.
- * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels.
*/
if ( function_exists( 'error_reporting' ) ) {
+ /*
+ * Initialize error reporting to a known set of levels.
+ *
+ * This will be adapted in wp_debug_mode() located in wp-includes/load.php based on WP_DEBUG.
+ * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels.
+ */
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
}
diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php
index 561c9266d4..d412917466 100644
--- a/tests/phpunit/tests/general/template.php
+++ b/tests/phpunit/tests/general/template.php
@@ -568,6 +568,7 @@ class Tests_General_Template extends WP_UnitTestCase {
/**
* @ticket 9862
+ * @ticket 51166
* @dataProvider data_selected_and_checked_with_equal_values
*
* @covers ::selected
@@ -595,6 +596,7 @@ class Tests_General_Template extends WP_UnitTestCase {
/**
* @ticket 9862
+ * @ticket 51166
* @dataProvider data_selected_and_checked_with_non_equal_values
*
* @covers ::selected
diff --git a/tests/phpunit/tests/pluggable.php b/tests/phpunit/tests/pluggable.php
index 3d9b2cc432..460c7b588a 100644
--- a/tests/phpunit/tests/pluggable.php
+++ b/tests/phpunit/tests/pluggable.php
@@ -328,13 +328,13 @@ class Tests_Pluggable extends WP_UnitTestCase {
* @ticket 28020
*/
public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() {
- // Create a test user
+ // Create a test user.
$new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );
- // Set the test user as the current user
+ // Set the test user as the current user.
$current_user = wp_set_current_user( $new_user );
- // Get the test user using get_user_by()
+ // Get the test user using get_user_by().
$from_get_user_by = get_user_by( 'id', $new_user );
$this->assertSame( $current_user, $from_get_user_by );