Skip to content

Commit 04694fb

Browse files
Site Health: Correct the check for disk space available to safely perform updates.
The `wp-content/upgrade` directory does not exist initially after installation, so the Site Health check could not determine the available disk space until the directory was subsequently created during an update. By testing `WP_CONTENT_DIR` instead, the check can complete successfully. This also brings consistency with similar checks in `_unzip_file_ziparchive()` and `_unzip_file_pclzip()`. Follow-up to [55720], [56401]. Props wbdv, khokansardar, mi5t4n, SergeyBiryukov. Fixes #61602. git-svn-id: https://develop.svn.wordpress.org/trunk@58913 602fd350-edb4-49c9-b593-d223f7449a82
1 parent be4fe64 commit 04694fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-admin/includes/class-wp-site-health.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ public function get_test_plugin_theme_auto_updates() {
18171817
* @return array The test results.
18181818
*/
18191819
public function get_test_available_updates_disk_space() {
1820-
$available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false;
1820+
$available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR ) : false;
18211821

18221822
$result = array(
18231823
'label' => __( 'Disk space available to safely perform updates' ),

0 commit comments

Comments
 (0)