Make WordPress Core

Changeset 58891


Ignore:
Timestamp:
08/13/2024 06:39:34 PM (4 months ago)
Author:
hellofromTonya
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.

Reviewed by hellofromTonya.
Merges [58884] to the 6.6 branch.

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

Location:
branches/6.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.6

  • branches/6.6/src/wp-admin/includes/class-wp-debug-data.php

    r58408 r58891  
    16711671            );
    16721672
     1673            // If the directory does not exist, skip checking it, as it will skew the other results.
     1674            if ( ! is_dir( $path ) ) {
     1675                $all_sizes[ $name ] = array(
     1676                    'path'  => $path,
     1677                    'raw'   => 0,
     1678                    'size'  => __( 'The directory does not exist.' ),
     1679                    'debug' => 'directory not found',
     1680                );
     1681
     1682                continue;
     1683            }
     1684
    16731685            if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {
    16741686                if ( 'wordpress_size' === $name ) {
Note: See TracChangeset for help on using the changeset viewer.