Commit e4f20d9daf for wordpress.org
commit e4f20d9daf61b60853c17a6fff1fc62e1d91ca50
Author: Sergey Biryukov <sergeybiryukov.ru@gmail.com>
Date: Mon Feb 2 10:45:43 2026 +0000
Site Health: Correct the check for a static `robots.txt` file.
This ensures that the file existence is properly detected when WordPress is located in a subdirectory while the home URL points to the website root.
Follow-up to [59890].
Props timse201, mukesh27.
Fixes #64580.
Built from https://develop.svn.wordpress.org/trunk@61577
git-svn-id: http://core.svn.wordpress.org/trunk@60888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php
index ceae392fd2..9f914ab882 100644
--- a/wp-admin/includes/class-wp-debug-data.php
+++ b/wp-admin/includes/class-wp-debug-data.php
@@ -505,12 +505,12 @@ class WP_Debug_Data {
}
// Check if a robots.txt file exists.
- if ( is_file( ABSPATH . 'robots.txt' ) ) {
+ if ( is_file( get_home_path() . 'robots.txt' ) ) {
// If the file exists, turn debug info to true.
$robotstxt_debug = true;
/* translators: %s: robots.txt */
- $robotstxt_string = sprintf( __( 'There is a static %s file in your installation folder. WordPress cannot dynamically serve one.' ), 'robots.txt' );
+ $robotstxt_string = sprintf( __( 'Your site is using a static %s file. WordPress cannot dynamically serve one.' ), 'robots.txt' );
} elseif ( got_url_rewrite() ) {
// No robots.txt file available and rewrite rules in place, turn debug info to false.
$robotstxt_debug = false;
@@ -522,7 +522,7 @@ class WP_Debug_Data {
$robotstxt_debug = true;
/* translators: %s: robots.txt */
- $robotstxt_string = sprintf( __( 'WordPress cannot dynamically serve a %s file due to a lack of rewrite rule support' ), 'robots.txt' );
+ $robotstxt_string = sprintf( __( 'WordPress cannot dynamically serve a %s file due to a lack of rewrite rule support.' ), 'robots.txt' );
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index ac0201e095..4dad369d15 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61576';
+$wp_version = '7.0-alpha-61577';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.