Make WordPress Core

Changeset 58884


Ignore:
Timestamp:
08/12/2024 04:52:55 AM (4 months ago)
Author:
peterwilsoncc
Message:

Site Health: Check if directories exist before checking size.

Prevents the Site Health Debug tab from stalling when reporting directory sizes if the directory does not exist.

Props clorith, aristath, narenin, kowsar89, hellofromTonya, ironprogrammer, shailu25.
Fixes #61638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r58857 r58884  
    16961696            );
    16971697
     1698            // If the directory does not exist, skip checking it, as it will skew the other results.
     1699            if ( ! is_dir( $path ) ) {
     1700                $all_sizes[ $name ] = array(
     1701                    'path'  => $path,
     1702                    'raw'   => 0,
     1703                    'size'  => __( 'The directory does not exist.' ),
     1704                    'debug' => 'directory not found',
     1705                );
     1706
     1707                continue;
     1708            }
     1709
    16981710            if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {
    16991711                if ( 'wordpress_size' === $name ) {
Note: See TracChangeset for help on using the changeset viewer.