[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> class-wp-debug-data.php (source)

   1  <?php
   2  /**
   3   * Class for providing debug data based on a users WordPress environment.
   4   *
   5   * @package WordPress
   6   * @subpackage Site_Health
   7   * @since 5.2.0
   8   */
   9  
  10  class WP_Debug_Data {
  11      /**
  12       * Calls all core functions to check for updates.
  13       *
  14       * @since 5.2.0
  15       */
  16  	public static function check_for_updates() {
  17          wp_version_check();
  18          wp_update_plugins();
  19          wp_update_themes();
  20      }
  21  
  22      /**
  23       * Static function for generating site debug data when required.
  24       *
  25       * @since 5.2.0
  26       * @since 5.3.0 Added database charset, database collation,
  27       *              and timezone information.
  28       * @since 5.5.0 Added pretty permalinks support information.
  29       *
  30       * @throws ImagickException
  31       * @global wpdb $wpdb WordPress database abstraction object.
  32       *
  33       * @return array The debug data for the site.
  34       */
  35  	public static function debug_data() {
  36          global $wpdb;
  37  
  38          // Save few function calls.
  39          $upload_dir             = wp_upload_dir();
  40          $permalink_structure    = get_option( 'permalink_structure' );
  41          $is_ssl                 = is_ssl();
  42          $is_multisite           = is_multisite();
  43          $users_can_register     = get_option( 'users_can_register' );
  44          $blog_public            = get_option( 'blog_public' );
  45          $default_comment_status = get_option( 'default_comment_status' );
  46          $environment_type       = wp_get_environment_type();
  47          $core_version           = get_bloginfo( 'version' );
  48          $core_updates           = get_core_updates();
  49          $core_update_needed     = '';
  50  
  51          if ( is_array( $core_updates ) ) {
  52              foreach ( $core_updates as $core => $update ) {
  53                  if ( 'upgrade' === $update->response ) {
  54                      /* translators: %s: Latest WordPress version number. */
  55                      $core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version );
  56                  } else {
  57                      $core_update_needed = '';
  58                  }
  59              }
  60          }
  61  
  62          // Set up the array that holds all debug information.
  63          $info = array();
  64  
  65          $info['wp-core'] = array(
  66              'label'  => __( 'WordPress' ),
  67              'fields' => array(
  68                  'version'                => array(
  69                      'label' => __( 'Version' ),
  70                      'value' => $core_version . $core_update_needed,
  71                      'debug' => $core_version,
  72                  ),
  73                  'site_language'          => array(
  74                      'label' => __( 'Site Language' ),
  75                      'value' => get_locale(),
  76                  ),
  77                  'user_language'          => array(
  78                      'label' => __( 'User Language' ),
  79                      'value' => get_user_locale(),
  80                  ),
  81                  'timezone'               => array(
  82                      'label' => __( 'Timezone' ),
  83                      'value' => wp_timezone_string(),
  84                  ),
  85                  'home_url'               => array(
  86                      'label'   => __( 'Home URL' ),
  87                      'value'   => get_bloginfo( 'url' ),
  88                      'private' => true,
  89                  ),
  90                  'site_url'               => array(
  91                      'label'   => __( 'Site URL' ),
  92                      'value'   => get_bloginfo( 'wpurl' ),
  93                      'private' => true,
  94                  ),
  95                  'permalink'              => array(
  96                      'label' => __( 'Permalink structure' ),
  97                      'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ),
  98                      'debug' => $permalink_structure,
  99                  ),
 100                  'https_status'           => array(
 101                      'label' => __( 'Is this site using HTTPS?' ),
 102                      'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ),
 103                      'debug' => $is_ssl,
 104                  ),
 105                  'multisite'              => array(
 106                      'label' => __( 'Is this a multisite?' ),
 107                      'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ),
 108                      'debug' => $is_multisite,
 109                  ),
 110                  'user_registration'      => array(
 111                      'label' => __( 'Can anyone register on this site?' ),
 112                      'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ),
 113                      'debug' => $users_can_register,
 114                  ),
 115                  'blog_public'            => array(
 116                      'label' => __( 'Is this site discouraging search engines?' ),
 117                      'value' => $blog_public ? __( 'No' ) : __( 'Yes' ),
 118                      'debug' => $blog_public,
 119                  ),
 120                  'default_comment_status' => array(
 121                      'label' => __( 'Default comment status' ),
 122                      'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ),
 123                      'debug' => $default_comment_status,
 124                  ),
 125                  'environment_type'       => array(
 126                      'label' => __( 'Environment type' ),
 127                      'value' => $environment_type,
 128                      'debug' => $environment_type,
 129                  ),
 130              ),
 131          );
 132  
 133          if ( ! $is_multisite ) {
 134              $info['wp-paths-sizes'] = array(
 135                  'label'  => __( 'Directories and Sizes' ),
 136                  'fields' => array(),
 137              );
 138          }
 139  
 140          $info['wp-dropins'] = array(
 141              'label'       => __( 'Drop-ins' ),
 142              'show_count'  => true,
 143              'description' => sprintf(
 144                  /* translators: %s: wp-content directory name. */
 145                  __( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ),
 146                  '<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'
 147              ),
 148              'fields'      => array(),
 149          );
 150  
 151          $info['wp-active-theme'] = array(
 152              'label'  => __( 'Active Theme' ),
 153              'fields' => array(),
 154          );
 155  
 156          $info['wp-parent-theme'] = array(
 157              'label'  => __( 'Parent Theme' ),
 158              'fields' => array(),
 159          );
 160  
 161          $info['wp-themes-inactive'] = array(
 162              'label'      => __( 'Inactive Themes' ),
 163              'show_count' => true,
 164              'fields'     => array(),
 165          );
 166  
 167          $info['wp-mu-plugins'] = array(
 168              'label'      => __( 'Must Use Plugins' ),
 169              'show_count' => true,
 170              'fields'     => array(),
 171          );
 172  
 173          $info['wp-plugins-active'] = array(
 174              'label'      => __( 'Active Plugins' ),
 175              'show_count' => true,
 176              'fields'     => array(),
 177          );
 178  
 179          $info['wp-plugins-inactive'] = array(
 180              'label'      => __( 'Inactive Plugins' ),
 181              'show_count' => true,
 182              'fields'     => array(),
 183          );
 184  
 185          $info['wp-media'] = array(
 186              'label'  => __( 'Media Handling' ),
 187              'fields' => array(),
 188          );
 189  
 190          $info['wp-server'] = array(
 191              'label'       => __( 'Server' ),
 192              'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host&#8217;s assistance.' ),
 193              'fields'      => array(),
 194          );
 195  
 196          $info['wp-database'] = array(
 197              'label'  => __( 'Database' ),
 198              'fields' => array(),
 199          );
 200  
 201          // Check if WP_DEBUG_LOG is set.
 202          $wp_debug_log_value = __( 'Disabled' );
 203  
 204          if ( is_string( WP_DEBUG_LOG ) ) {
 205              $wp_debug_log_value = WP_DEBUG_LOG;
 206          } elseif ( WP_DEBUG_LOG ) {
 207              $wp_debug_log_value = __( 'Enabled' );
 208          }
 209  
 210          // Check CONCATENATE_SCRIPTS.
 211          if ( defined( 'CONCATENATE_SCRIPTS' ) ) {
 212              $concatenate_scripts       = CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );
 213              $concatenate_scripts_debug = CONCATENATE_SCRIPTS ? 'true' : 'false';
 214          } else {
 215              $concatenate_scripts       = __( 'Undefined' );
 216              $concatenate_scripts_debug = 'undefined';
 217          }
 218  
 219          // Check COMPRESS_SCRIPTS.
 220          if ( defined( 'COMPRESS_SCRIPTS' ) ) {
 221              $compress_scripts       = COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' );
 222              $compress_scripts_debug = COMPRESS_SCRIPTS ? 'true' : 'false';
 223          } else {
 224              $compress_scripts       = __( 'Undefined' );
 225              $compress_scripts_debug = 'undefined';
 226          }
 227  
 228          // Check COMPRESS_CSS.
 229          if ( defined( 'COMPRESS_CSS' ) ) {
 230              $compress_css       = COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' );
 231              $compress_css_debug = COMPRESS_CSS ? 'true' : 'false';
 232          } else {
 233              $compress_css       = __( 'Undefined' );
 234              $compress_css_debug = 'undefined';
 235          }
 236  
 237          // Check WP_ENVIRONMENT_TYPE.
 238          if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {
 239              $wp_environment_type = WP_ENVIRONMENT_TYPE;
 240          } else {
 241              $wp_environment_type = __( 'Undefined' );
 242          }
 243  
 244          $info['wp-constants'] = array(
 245              'label'       => __( 'WordPress Constants' ),
 246              'description' => __( 'These settings alter where and how parts of WordPress are loaded.' ),
 247              'fields'      => array(
 248                  'ABSPATH'             => array(
 249                      'label'   => 'ABSPATH',
 250                      'value'   => ABSPATH,
 251                      'private' => true,
 252                  ),
 253                  'WP_HOME'             => array(
 254                      'label' => 'WP_HOME',
 255                      'value' => ( defined( 'WP_HOME' ) ? WP_HOME : __( 'Undefined' ) ),
 256                      'debug' => ( defined( 'WP_HOME' ) ? WP_HOME : 'undefined' ),
 257                  ),
 258                  'WP_SITEURL'          => array(
 259                      'label' => 'WP_SITEURL',
 260                      'value' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : __( 'Undefined' ) ),
 261                      'debug' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : 'undefined' ),
 262                  ),
 263                  'WP_CONTENT_DIR'      => array(
 264                      'label' => 'WP_CONTENT_DIR',
 265                      'value' => WP_CONTENT_DIR,
 266                  ),
 267                  'WP_PLUGIN_DIR'       => array(
 268                      'label' => 'WP_PLUGIN_DIR',
 269                      'value' => WP_PLUGIN_DIR,
 270                  ),
 271                  'WP_MEMORY_LIMIT'     => array(
 272                      'label' => 'WP_MEMORY_LIMIT',
 273                      'value' => WP_MEMORY_LIMIT,
 274                  ),
 275                  'WP_MAX_MEMORY_LIMIT' => array(
 276                      'label' => 'WP_MAX_MEMORY_LIMIT',
 277                      'value' => WP_MAX_MEMORY_LIMIT,
 278                  ),
 279                  'WP_DEBUG'            => array(
 280                      'label' => 'WP_DEBUG',
 281                      'value' => WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),
 282                      'debug' => WP_DEBUG,
 283                  ),
 284                  'WP_DEBUG_DISPLAY'    => array(
 285                      'label' => 'WP_DEBUG_DISPLAY',
 286                      'value' => WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ),
 287                      'debug' => WP_DEBUG_DISPLAY,
 288                  ),
 289                  'WP_DEBUG_LOG'        => array(
 290                      'label' => 'WP_DEBUG_LOG',
 291                      'value' => $wp_debug_log_value,
 292                      'debug' => WP_DEBUG_LOG,
 293                  ),
 294                  'SCRIPT_DEBUG'        => array(
 295                      'label' => 'SCRIPT_DEBUG',
 296                      'value' => SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ),
 297                      'debug' => SCRIPT_DEBUG,
 298                  ),
 299                  'WP_CACHE'            => array(
 300                      'label' => 'WP_CACHE',
 301                      'value' => WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ),
 302                      'debug' => WP_CACHE,
 303                  ),
 304                  'CONCATENATE_SCRIPTS' => array(
 305                      'label' => 'CONCATENATE_SCRIPTS',
 306                      'value' => $concatenate_scripts,
 307                      'debug' => $concatenate_scripts_debug,
 308                  ),
 309                  'COMPRESS_SCRIPTS'    => array(
 310                      'label' => 'COMPRESS_SCRIPTS',
 311                      'value' => $compress_scripts,
 312                      'debug' => $compress_scripts_debug,
 313                  ),
 314                  'COMPRESS_CSS'        => array(
 315                      'label' => 'COMPRESS_CSS',
 316                      'value' => $compress_css,
 317                      'debug' => $compress_css_debug,
 318                  ),
 319                  'WP_ENVIRONMENT_TYPE' => array(
 320                      'label' => 'WP_ENVIRONMENT_TYPE',
 321                      'value' => $wp_environment_type,
 322                      'debug' => $wp_environment_type,
 323                  ),
 324                  'DB_CHARSET'          => array(
 325                      'label' => 'DB_CHARSET',
 326                      'value' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : __( 'Undefined' ) ),
 327                      'debug' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined' ),
 328                  ),
 329                  'DB_COLLATE'          => array(
 330                      'label' => 'DB_COLLATE',
 331                      'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ),
 332                      'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ),
 333                  ),
 334              ),
 335          );
 336  
 337          $is_writable_abspath            = wp_is_writable( ABSPATH );
 338          $is_writable_wp_content_dir     = wp_is_writable( WP_CONTENT_DIR );
 339          $is_writable_upload_dir         = wp_is_writable( $upload_dir['basedir'] );
 340          $is_writable_wp_plugin_dir      = wp_is_writable( WP_PLUGIN_DIR );
 341          $is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) );
 342  
 343          $info['wp-filesystem'] = array(
 344              'label'       => __( 'Filesystem Permissions' ),
 345              'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ),
 346              'fields'      => array(
 347                  'wordpress'  => array(
 348                      'label' => __( 'The main WordPress directory' ),
 349                      'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ),
 350                      'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ),
 351                  ),
 352                  'wp-content' => array(
 353                      'label' => __( 'The wp-content directory' ),
 354                      'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
 355                      'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ),
 356                  ),
 357                  'uploads'    => array(
 358                      'label' => __( 'The uploads directory' ),
 359                      'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
 360                      'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ),
 361                  ),
 362                  'plugins'    => array(
 363                      'label' => __( 'The plugins directory' ),
 364                      'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
 365                      'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ),
 366                  ),
 367                  'themes'     => array(
 368                      'label' => __( 'The themes directory' ),
 369                      'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ),
 370                      'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ),
 371                  ),
 372              ),
 373          );
 374  
 375          // Conditionally add debug information for multisite setups.
 376          if ( is_multisite() ) {
 377              $network_query = new WP_Network_Query();
 378              $network_ids   = $network_query->query(
 379                  array(
 380                      'fields'        => 'ids',
 381                      'number'        => 100,
 382                      'no_found_rows' => false,
 383                  )
 384              );
 385  
 386              $site_count = 0;
 387              foreach ( $network_ids as $network_id ) {
 388                  $site_count += get_blog_count( $network_id );
 389              }
 390  
 391              $info['wp-core']['fields']['site_count'] = array(
 392                  'label' => __( 'Site count' ),
 393                  'value' => $site_count,
 394              );
 395  
 396              $info['wp-core']['fields']['network_count'] = array(
 397                  'label' => __( 'Network count' ),
 398                  'value' => $network_query->found_networks,
 399              );
 400          }
 401  
 402          $info['wp-core']['fields']['user_count'] = array(
 403              'label' => __( 'User count' ),
 404              'value' => get_user_count(),
 405          );
 406  
 407          // WordPress features requiring processing.
 408          $wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) );
 409  
 410          if ( ! is_wp_error( $wp_dotorg ) ) {
 411              $info['wp-core']['fields']['dotorg_communication'] = array(
 412                  'label' => __( 'Communication with WordPress.org' ),
 413                  'value' => __( 'WordPress.org is reachable' ),
 414                  'debug' => 'true',
 415              );
 416          } else {
 417              $info['wp-core']['fields']['dotorg_communication'] = array(
 418                  'label' => __( 'Communication with WordPress.org' ),
 419                  'value' => sprintf(
 420                      /* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */
 421                      __( 'Unable to reach WordPress.org at %1$s: %2$s' ),
 422                      gethostbyname( 'wordpress.org' ),
 423                      $wp_dotorg->get_error_message()
 424                  ),
 425                  'debug' => $wp_dotorg->get_error_message(),
 426              );
 427          }
 428  
 429          // Remove accordion for Directories and Sizes if in Multisite.
 430          if ( ! $is_multisite ) {
 431              $loading = __( 'Loading&hellip;' );
 432  
 433              $info['wp-paths-sizes']['fields'] = array(
 434                  'wordpress_path' => array(
 435                      'label' => __( 'WordPress directory location' ),
 436                      'value' => untrailingslashit( ABSPATH ),
 437                  ),
 438                  'wordpress_size' => array(
 439                      'label' => __( 'WordPress directory size' ),
 440                      'value' => $loading,
 441                      'debug' => 'loading...',
 442                  ),
 443                  'uploads_path'   => array(
 444                      'label' => __( 'Uploads directory location' ),
 445                      'value' => $upload_dir['basedir'],
 446                  ),
 447                  'uploads_size'   => array(
 448                      'label' => __( 'Uploads directory size' ),
 449                      'value' => $loading,
 450                      'debug' => 'loading...',
 451                  ),
 452                  'themes_path'    => array(
 453                      'label' => __( 'Themes directory location' ),
 454                      'value' => get_theme_root(),
 455                  ),
 456                  'themes_size'    => array(
 457                      'label' => __( 'Themes directory size' ),
 458                      'value' => $loading,
 459                      'debug' => 'loading...',
 460                  ),
 461                  'plugins_path'   => array(
 462                      'label' => __( 'Plugins directory location' ),
 463                      'value' => WP_PLUGIN_DIR,
 464                  ),
 465                  'plugins_size'   => array(
 466                      'label' => __( 'Plugins directory size' ),
 467                      'value' => $loading,
 468                      'debug' => 'loading...',
 469                  ),
 470                  'database_size'  => array(
 471                      'label' => __( 'Database size' ),
 472                      'value' => $loading,
 473                      'debug' => 'loading...',
 474                  ),
 475                  'total_size'     => array(
 476                      'label' => __( 'Total installation size' ),
 477                      'value' => $loading,
 478                      'debug' => 'loading...',
 479                  ),
 480              );
 481          }
 482  
 483          // Get a list of all drop-in replacements.
 484          $dropins = get_dropins();
 485  
 486          // Get dropins descriptions.
 487          $dropin_descriptions = _get_dropins();
 488  
 489          // Spare few function calls.
 490          $not_available = __( 'Not available' );
 491  
 492          foreach ( $dropins as $dropin_key => $dropin ) {
 493              $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(
 494                  'label' => $dropin_key,
 495                  'value' => $dropin_descriptions[ $dropin_key ][0],
 496                  'debug' => 'true',
 497              );
 498          }
 499  
 500          // Populate the media fields.
 501          $info['wp-media']['fields']['image_editor'] = array(
 502              'label' => __( 'Active editor' ),
 503              'value' => _wp_image_editor_choose(),
 504          );
 505  
 506          // Get ImageMagic information, if available.
 507          if ( class_exists( 'Imagick' ) ) {
 508              // Save the Imagick instance for later use.
 509              $imagick             = new Imagick();
 510              $imagemagick_version = $imagick->getVersion();
 511          } else {
 512              $imagemagick_version = __( 'Not available' );
 513          }
 514  
 515          $info['wp-media']['fields']['imagick_module_version'] = array(
 516              'label' => __( 'ImageMagick version number' ),
 517              'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionNumber'] : $imagemagick_version ),
 518          );
 519  
 520          $info['wp-media']['fields']['imagemagick_version'] = array(
 521              'label' => __( 'ImageMagick version string' ),
 522              'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionString'] : $imagemagick_version ),
 523          );
 524  
 525          $imagick_version = phpversion( 'imagick' );
 526  
 527          $info['wp-media']['fields']['imagick_version'] = array(
 528              'label' => __( 'Imagick version' ),
 529              'value' => ( $imagick_version ) ? $imagick_version : __( 'Not available' ),
 530          );
 531  
 532          if ( ! function_exists( 'ini_get' ) ) {
 533              $info['wp-media']['fields']['ini_get'] = array(
 534                  'label' => __( 'File upload settings' ),
 535                  'value' => sprintf(
 536                      /* translators: %s: ini_get() */
 537                      __( 'Unable to determine some settings, as the %s function has been disabled.' ),
 538                      'ini_get()'
 539                  ),
 540                  'debug' => 'ini_get() is disabled',
 541              );
 542          } else {
 543              // Get the PHP ini directive values.
 544              $post_max_size       = ini_get( 'post_max_size' );
 545              $upload_max_filesize = ini_get( 'upload_max_filesize' );
 546              $max_file_uploads    = ini_get( 'max_file_uploads' );
 547              $effective           = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) );
 548  
 549              // Add info in Media section.
 550              $info['wp-media']['fields']['file_uploads']        = array(
 551                  'label' => __( 'File uploads' ),
 552                  'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ),
 553                  'debug' => 'File uploads is turned off',
 554              );
 555              $info['wp-media']['fields']['post_max_size']       = array(
 556                  'label' => __( 'Max size of post data allowed' ),
 557                  'value' => $post_max_size,
 558              );
 559              $info['wp-media']['fields']['upload_max_filesize'] = array(
 560                  'label' => __( 'Max size of an uploaded file' ),
 561                  'value' => $upload_max_filesize,
 562              );
 563              $info['wp-media']['fields']['max_effective_size']  = array(
 564                  'label' => __( 'Max effective file size' ),
 565                  'value' => size_format( $effective ),
 566              );
 567              $info['wp-media']['fields']['max_file_uploads']    = array(
 568                  'label' => __( 'Max number of files allowed' ),
 569                  'value' => number_format( $max_file_uploads ),
 570              );
 571          }
 572  
 573          // If Imagick is used as our editor, provide some more information about its limitations.
 574          if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
 575              $limits = array(
 576                  'area'   => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ),
 577                  'disk'   => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ),
 578                  'file'   => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ),
 579                  'map'    => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ),
 580                  'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ),
 581                  'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ),
 582              );
 583  
 584              $limits_debug = array(
 585                  'imagick::RESOURCETYPE_AREA'   => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ),
 586                  'imagick::RESOURCETYPE_DISK'   => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ),
 587                  'imagick::RESOURCETYPE_FILE'   => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ),
 588                  'imagick::RESOURCETYPE_MAP'    => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ),
 589                  'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ),
 590                  'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ),
 591              );
 592  
 593              $info['wp-media']['fields']['imagick_limits'] = array(
 594                  'label' => __( 'Imagick Resource Limits' ),
 595                  'value' => $limits,
 596                  'debug' => $limits_debug,
 597              );
 598  
 599              try {
 600                  $formats = Imagick::queryFormats( '*' );
 601              } catch ( Exception $e ) {
 602                  $formats = array();
 603              }
 604  
 605              $info['wp-media']['fields']['imagemagick_file_formats'] = array(
 606                  'label' => __( 'ImageMagick supported file formats' ),
 607                  'value' => ( empty( $formats ) ) ? __( 'Unable to determine' ) : implode( ', ', $formats ),
 608                  'debug' => ( empty( $formats ) ) ? 'Unable to determine' : implode( ', ', $formats ),
 609              );
 610          }
 611  
 612          // Get GD information, if available.
 613          if ( function_exists( 'gd_info' ) ) {
 614              $gd = gd_info();
 615          } else {
 616              $gd = false;
 617          }
 618  
 619          $info['wp-media']['fields']['gd_version'] = array(
 620              'label' => __( 'GD version' ),
 621              'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ),
 622              'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),
 623          );
 624  
 625          $gd_image_formats     = array();
 626          $gd_supported_formats = array(
 627              'GIF Create' => 'GIF',
 628              'JPEG'       => 'JPEG',
 629              'PNG'        => 'PNG',
 630              'WebP'       => 'WebP',
 631              'BMP'        => 'BMP',
 632              'AVIF'       => 'AVIF',
 633              'HEIF'       => 'HEIF',
 634              'TIFF'       => 'TIFF',
 635              'XPM'        => 'XPM',
 636          );
 637  
 638          foreach ( $gd_supported_formats as $format_key => $format ) {
 639              $index = $format_key . ' Support';
 640              if ( isset( $gd[ $index ] ) && $gd[ $index ] ) {
 641                  array_push( $gd_image_formats, $format );
 642              }
 643          }
 644  
 645          if ( ! empty( $gd_image_formats ) ) {
 646              $info['wp-media']['fields']['gd_formats'] = array(
 647                  'label' => __( 'GD supported file formats' ),
 648                  'value' => implode( ', ', $gd_image_formats ),
 649              );
 650          }
 651  
 652          // Get Ghostscript information, if available.
 653          if ( function_exists( 'exec' ) ) {
 654              $gs = exec( 'gs --version' );
 655  
 656              if ( empty( $gs ) ) {
 657                  $gs       = $not_available;
 658                  $gs_debug = 'not available';
 659              } else {
 660                  $gs_debug = $gs;
 661              }
 662          } else {
 663              $gs       = __( 'Unable to determine if Ghostscript is installed' );
 664              $gs_debug = 'unknown';
 665          }
 666  
 667          $info['wp-media']['fields']['ghostscript_version'] = array(
 668              'label' => __( 'Ghostscript version' ),
 669              'value' => $gs,
 670              'debug' => $gs_debug,
 671          );
 672  
 673          // Populate the server debug fields.
 674          if ( function_exists( 'php_uname' ) ) {
 675              $server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) );
 676          } else {
 677              $server_architecture = 'unknown';
 678          }
 679  
 680          $php_version_debug = PHP_VERSION;
 681          // Whether PHP supports 64-bit.
 682          $php64bit = ( PHP_INT_SIZE * 8 === 64 );
 683  
 684          $php_version = sprintf(
 685              '%s %s',
 686              $php_version_debug,
 687              ( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) )
 688          );
 689  
 690          if ( $php64bit ) {
 691              $php_version_debug .= ' 64bit';
 692          }
 693  
 694          if ( function_exists( 'php_sapi_name' ) ) {
 695              $php_sapi = php_sapi_name();
 696          } else {
 697              $php_sapi = 'unknown';
 698          }
 699  
 700          $info['wp-server']['fields']['server_architecture'] = array(
 701              'label' => __( 'Server architecture' ),
 702              'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ),
 703              'debug' => $server_architecture,
 704          );
 705          $info['wp-server']['fields']['httpd_software']      = array(
 706              'label' => __( 'Web server' ),
 707              'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ),
 708              'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ),
 709          );
 710          $info['wp-server']['fields']['php_version']         = array(
 711              'label' => __( 'PHP version' ),
 712              'value' => $php_version,
 713              'debug' => $php_version_debug,
 714          );
 715          $info['wp-server']['fields']['php_sapi']            = array(
 716              'label' => __( 'PHP SAPI' ),
 717              'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ),
 718              'debug' => $php_sapi,
 719          );
 720  
 721          // Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values.
 722          if ( ! function_exists( 'ini_get' ) ) {
 723              $info['wp-server']['fields']['ini_get'] = array(
 724                  'label' => __( 'Server settings' ),
 725                  'value' => sprintf(
 726                      /* translators: %s: ini_get() */
 727                      __( 'Unable to determine some settings, as the %s function has been disabled.' ),
 728                      'ini_get()'
 729                  ),
 730                  'debug' => 'ini_get() is disabled',
 731              );
 732          } else {
 733              $info['wp-server']['fields']['max_input_variables'] = array(
 734                  'label' => __( 'PHP max input variables' ),
 735                  'value' => ini_get( 'max_input_vars' ),
 736              );
 737              $info['wp-server']['fields']['time_limit']          = array(
 738                  'label' => __( 'PHP time limit' ),
 739                  'value' => ini_get( 'max_execution_time' ),
 740              );
 741  
 742              if ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) {
 743                  $info['wp-server']['fields']['memory_limit']       = array(
 744                      'label' => __( 'PHP memory limit' ),
 745                      'value' => WP_Site_Health::get_instance()->php_memory_limit,
 746                  );
 747                  $info['wp-server']['fields']['admin_memory_limit'] = array(
 748                      'label' => __( 'PHP memory limit (only for admin screens)' ),
 749                      'value' => ini_get( 'memory_limit' ),
 750                  );
 751              } else {
 752                  $info['wp-server']['fields']['memory_limit'] = array(
 753                      'label' => __( 'PHP memory limit' ),
 754                      'value' => ini_get( 'memory_limit' ),
 755                  );
 756              }
 757  
 758              $info['wp-server']['fields']['max_input_time']      = array(
 759                  'label' => __( 'Max input time' ),
 760                  'value' => ini_get( 'max_input_time' ),
 761              );
 762              $info['wp-server']['fields']['upload_max_filesize'] = array(
 763                  'label' => __( 'Upload max filesize' ),
 764                  'value' => ini_get( 'upload_max_filesize' ),
 765              );
 766              $info['wp-server']['fields']['php_post_max_size']   = array(
 767                  'label' => __( 'PHP post max size' ),
 768                  'value' => ini_get( 'post_max_size' ),
 769              );
 770          }
 771  
 772          if ( function_exists( 'curl_version' ) ) {
 773              $curl = curl_version();
 774  
 775              $info['wp-server']['fields']['curl_version'] = array(
 776                  'label' => __( 'cURL version' ),
 777                  'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ),
 778              );
 779          } else {
 780              $info['wp-server']['fields']['curl_version'] = array(
 781                  'label' => __( 'cURL version' ),
 782                  'value' => $not_available,
 783                  'debug' => 'not available',
 784              );
 785          }
 786  
 787          // SUHOSIN.
 788          $suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) );
 789  
 790          $info['wp-server']['fields']['suhosin'] = array(
 791              'label' => __( 'Is SUHOSIN installed?' ),
 792              'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ),
 793              'debug' => $suhosin_loaded,
 794          );
 795  
 796          // Imagick.
 797          $imagick_loaded = extension_loaded( 'imagick' );
 798  
 799          $info['wp-server']['fields']['imagick_availability'] = array(
 800              'label' => __( 'Is the Imagick library available?' ),
 801              'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ),
 802              'debug' => $imagick_loaded,
 803          );
 804  
 805          // Pretty permalinks.
 806          $pretty_permalinks_supported = got_url_rewrite();
 807  
 808          $info['wp-server']['fields']['pretty_permalinks'] = array(
 809              'label' => __( 'Are pretty permalinks supported?' ),
 810              'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ),
 811              'debug' => $pretty_permalinks_supported,
 812          );
 813  
 814          // Check if a .htaccess file exists.
 815          if ( is_file( ABSPATH . '.htaccess' ) ) {
 816              // If the file exists, grab the content of it.
 817              $htaccess_content = file_get_contents( ABSPATH . '.htaccess' );
 818  
 819              // Filter away the core WordPress rules.
 820              $filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) );
 821              $filtered_htaccess_content = ! empty( $filtered_htaccess_content );
 822  
 823              if ( $filtered_htaccess_content ) {
 824                  /* translators: %s: .htaccess */
 825                  $htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' );
 826              } else {
 827                  /* translators: %s: .htaccess */
 828                  $htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' );
 829              }
 830  
 831              $info['wp-server']['fields']['htaccess_extra_rules'] = array(
 832                  'label' => __( '.htaccess rules' ),
 833                  'value' => $htaccess_rules_string,
 834                  'debug' => $filtered_htaccess_content,
 835              );
 836          }
 837  
 838          // Populate the database debug fields.
 839          if ( is_resource( $wpdb->dbh ) ) {
 840              // Old mysql extension.
 841              $extension = 'mysql';
 842          } elseif ( is_object( $wpdb->dbh ) ) {
 843              // mysqli or PDO.
 844              $extension = get_class( $wpdb->dbh );
 845          } else {
 846              // Unknown sql extension.
 847              $extension = null;
 848          }
 849  
 850          $server = $wpdb->get_var( 'SELECT VERSION()' );
 851  
 852          if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
 853              $client_version = $wpdb->dbh->client_info;
 854          } else {
 855              // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved
 856              if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) {
 857                  $client_version = $matches[0];
 858              } else {
 859                  $client_version = null;
 860              }
 861          }
 862  
 863          $info['wp-database']['fields']['extension'] = array(
 864              'label' => __( 'Extension' ),
 865              'value' => $extension,
 866          );
 867  
 868          $info['wp-database']['fields']['server_version'] = array(
 869              'label' => __( 'Server version' ),
 870              'value' => $server,
 871          );
 872  
 873          $info['wp-database']['fields']['client_version'] = array(
 874              'label' => __( 'Client version' ),
 875              'value' => $client_version,
 876          );
 877  
 878          $info['wp-database']['fields']['database_user'] = array(
 879              'label'   => __( 'Database username' ),
 880              'value'   => $wpdb->dbuser,
 881              'private' => true,
 882          );
 883  
 884          $info['wp-database']['fields']['database_host'] = array(
 885              'label'   => __( 'Database host' ),
 886              'value'   => $wpdb->dbhost,
 887              'private' => true,
 888          );
 889  
 890          $info['wp-database']['fields']['database_name'] = array(
 891              'label'   => __( 'Database name' ),
 892              'value'   => $wpdb->dbname,
 893              'private' => true,
 894          );
 895  
 896          $info['wp-database']['fields']['database_prefix'] = array(
 897              'label'   => __( 'Table prefix' ),
 898              'value'   => $wpdb->prefix,
 899              'private' => true,
 900          );
 901  
 902          $info['wp-database']['fields']['database_charset'] = array(
 903              'label'   => __( 'Database charset' ),
 904              'value'   => $wpdb->charset,
 905              'private' => true,
 906          );
 907  
 908          $info['wp-database']['fields']['database_collate'] = array(
 909              'label'   => __( 'Database collation' ),
 910              'value'   => $wpdb->collate,
 911              'private' => true,
 912          );
 913  
 914          $info['wp-database']['fields']['max_allowed_packet'] = array(
 915              'label' => __( 'Max allowed packet size' ),
 916              'value' => self::get_mysql_var( 'max_allowed_packet' ),
 917          );
 918  
 919          $info['wp-database']['fields']['max_connections'] = array(
 920              'label' => __( 'Max connections number' ),
 921              'value' => self::get_mysql_var( 'max_connections' ),
 922          );
 923  
 924          // List must use plugins if there are any.
 925          $mu_plugins = get_mu_plugins();
 926  
 927          foreach ( $mu_plugins as $plugin_path => $plugin ) {
 928              $plugin_version = $plugin['Version'];
 929              $plugin_author  = $plugin['Author'];
 930  
 931              $plugin_version_string       = __( 'No version or author information is available.' );
 932              $plugin_version_string_debug = 'author: (undefined), version: (undefined)';
 933  
 934              if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
 935                  /* translators: 1: Plugin version number. 2: Plugin author name. */
 936                  $plugin_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
 937                  $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );
 938              } else {
 939                  if ( ! empty( $plugin_author ) ) {
 940                      /* translators: %s: Plugin author name. */
 941                      $plugin_version_string       = sprintf( __( 'By %s' ), $plugin_author );
 942                      $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );
 943                  }
 944  
 945                  if ( ! empty( $plugin_version ) ) {
 946                      /* translators: %s: Plugin version number. */
 947                      $plugin_version_string       = sprintf( __( 'Version %s' ), $plugin_version );
 948                      $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );
 949                  }
 950              }
 951  
 952              $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
 953                  'label' => $plugin['Name'],
 954                  'value' => $plugin_version_string,
 955                  'debug' => $plugin_version_string_debug,
 956              );
 957          }
 958  
 959          // List all available plugins.
 960          $plugins        = get_plugins();
 961          $plugin_updates = get_plugin_updates();
 962          $transient      = get_site_transient( 'update_plugins' );
 963  
 964          $auto_updates = array();
 965  
 966          $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' );
 967  
 968          if ( $auto_updates_enabled ) {
 969              $auto_updates = (array) get_site_option( 'auto_update_plugins', array() );
 970          }
 971  
 972          foreach ( $plugins as $plugin_path => $plugin ) {
 973              $plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive';
 974  
 975              $plugin_version = $plugin['Version'];
 976              $plugin_author  = $plugin['Author'];
 977  
 978              $plugin_version_string       = __( 'No version or author information is available.' );
 979              $plugin_version_string_debug = 'author: (undefined), version: (undefined)';
 980  
 981              if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
 982                  /* translators: 1: Plugin version number. 2: Plugin author name. */
 983                  $plugin_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
 984                  $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );
 985              } else {
 986                  if ( ! empty( $plugin_author ) ) {
 987                      /* translators: %s: Plugin author name. */
 988                      $plugin_version_string       = sprintf( __( 'By %s' ), $plugin_author );
 989                      $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );
 990                  }
 991  
 992                  if ( ! empty( $plugin_version ) ) {
 993                      /* translators: %s: Plugin version number. */
 994                      $plugin_version_string       = sprintf( __( 'Version %s' ), $plugin_version );
 995                      $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );
 996                  }
 997              }
 998  
 999              if ( array_key_exists( $plugin_path, $plugin_updates ) ) {
1000                  /* translators: %s: Latest plugin version number. */
1001                  $plugin_version_string       .= ' ' . sprintf( __( '(Latest version: %s)' ), $plugin_updates[ $plugin_path ]->update->new_version );
1002                  $plugin_version_string_debug .= sprintf( ' (latest version: %s)', $plugin_updates[ $plugin_path ]->update->new_version );
1003              }
1004  
1005              if ( $auto_updates_enabled ) {
1006                  if ( isset( $transient->response[ $plugin_path ] ) ) {
1007                      $item = $transient->response[ $plugin_path ];
1008                  } elseif ( isset( $transient->no_update[ $plugin_path ] ) ) {
1009                      $item = $transient->no_update[ $plugin_path ];
1010                  } else {
1011                      $item = array(
1012                          'id'            => $plugin_path,
1013                          'slug'          => '',
1014                          'plugin'        => $plugin_path,
1015                          'new_version'   => '',
1016                          'url'           => '',
1017                          'package'       => '',
1018                          'icons'         => array(),
1019                          'banners'       => array(),
1020                          'banners_rtl'   => array(),
1021                          'tested'        => '',
1022                          'requires_php'  => '',
1023                          'compatibility' => new stdClass(),
1024                      );
1025                      $item = wp_parse_args( $plugin, $item );
1026                  }
1027  
1028                  $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, (object) $item );
1029  
1030                  if ( ! is_null( $auto_update_forced ) ) {
1031                      $enabled = $auto_update_forced;
1032                  } else {
1033                      $enabled = in_array( $plugin_path, $auto_updates, true );
1034                  }
1035  
1036                  if ( $enabled ) {
1037                      $auto_updates_string = __( 'Auto-updates enabled' );
1038                  } else {
1039                      $auto_updates_string = __( 'Auto-updates disabled' );
1040                  }
1041  
1042                  /**
1043                   * Filters the text string of the auto-updates setting for each plugin in the Site Health debug data.
1044                   *
1045                   * @since 5.5.0
1046                   *
1047                   * @param string $auto_updates_string The string output for the auto-updates column.
1048                   * @param string $plugin_path         The path to the plugin file.
1049                   * @param array  $plugin              An array of plugin data.
1050                   * @param bool   $enabled             Whether auto-updates are enabled for this item.
1051                   */
1052                  $auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled );
1053  
1054                  $plugin_version_string       .= ' | ' . $auto_updates_string;
1055                  $plugin_version_string_debug .= ', ' . $auto_updates_string;
1056              }
1057  
1058              $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
1059                  'label' => $plugin['Name'],
1060                  'value' => $plugin_version_string,
1061                  'debug' => $plugin_version_string_debug,
1062              );
1063          }
1064  
1065          // Populate the section for the currently active theme.
1066          global $_wp_theme_features;
1067          $theme_features = array();
1068  
1069          if ( ! empty( $_wp_theme_features ) ) {
1070              foreach ( $_wp_theme_features as $feature => $options ) {
1071                  $theme_features[] = $feature;
1072              }
1073          }
1074  
1075          $active_theme  = wp_get_theme();
1076          $theme_updates = get_theme_updates();
1077          $transient     = get_site_transient( 'update_themes' );
1078  
1079          $active_theme_version       = $active_theme->version;
1080          $active_theme_version_debug = $active_theme_version;
1081  
1082          $auto_updates         = array();
1083          $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'theme' );
1084          if ( $auto_updates_enabled ) {
1085              $auto_updates = (array) get_site_option( 'auto_update_themes', array() );
1086          }
1087  
1088          if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) {
1089              $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version'];
1090  
1091              /* translators: %s: Latest theme version number. */
1092              $active_theme_version       .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_update_new_version );
1093              $active_theme_version_debug .= sprintf( ' (latest version: %s)', $theme_update_new_version );
1094          }
1095  
1096          $active_theme_author_uri = $active_theme->display( 'AuthorURI' );
1097  
1098          if ( $active_theme->parent_theme ) {
1099              $active_theme_parent_theme = sprintf(
1100                  /* translators: 1: Theme name. 2: Theme slug. */
1101                  __( '%1$s (%2$s)' ),
1102                  $active_theme->parent_theme,
1103                  $active_theme->template
1104              );
1105              $active_theme_parent_theme_debug = sprintf(
1106                  '%s (%s)',
1107                  $active_theme->parent_theme,
1108                  $active_theme->template
1109              );
1110          } else {
1111              $active_theme_parent_theme       = __( 'None' );
1112              $active_theme_parent_theme_debug = 'none';
1113          }
1114  
1115          $info['wp-active-theme']['fields'] = array(
1116              'name'           => array(
1117                  'label' => __( 'Name' ),
1118                  'value' => sprintf(
1119                      /* translators: 1: Theme name. 2: Theme slug. */
1120                      __( '%1$s (%2$s)' ),
1121                      $active_theme->name,
1122                      $active_theme->stylesheet
1123                  ),
1124              ),
1125              'version'        => array(
1126                  'label' => __( 'Version' ),
1127                  'value' => $active_theme_version,
1128                  'debug' => $active_theme_version_debug,
1129              ),
1130              'author'         => array(
1131                  'label' => __( 'Author' ),
1132                  'value' => wp_kses( $active_theme->author, array() ),
1133              ),
1134              'author_website' => array(
1135                  'label' => __( 'Author website' ),
1136                  'value' => ( $active_theme_author_uri ? $active_theme_author_uri : __( 'Undefined' ) ),
1137                  'debug' => ( $active_theme_author_uri ? $active_theme_author_uri : '(undefined)' ),
1138              ),
1139              'parent_theme'   => array(
1140                  'label' => __( 'Parent theme' ),
1141                  'value' => $active_theme_parent_theme,
1142                  'debug' => $active_theme_parent_theme_debug,
1143              ),
1144              'theme_features' => array(
1145                  'label' => __( 'Theme features' ),
1146                  'value' => implode( ', ', $theme_features ),
1147              ),
1148              'theme_path'     => array(
1149                  'label' => __( 'Theme directory location' ),
1150                  'value' => get_stylesheet_directory(),
1151              ),
1152          );
1153  
1154          if ( $auto_updates_enabled ) {
1155              if ( isset( $transient->response[ $active_theme->stylesheet ] ) ) {
1156                  $item = $transient->response[ $active_theme->stylesheet ];
1157              } elseif ( isset( $transient->no_update[ $active_theme->stylesheet ] ) ) {
1158                  $item = $transient->no_update[ $active_theme->stylesheet ];
1159              } else {
1160                  $item = array(
1161                      'theme'        => $active_theme->stylesheet,
1162                      'new_version'  => $active_theme->version,
1163                      'url'          => '',
1164                      'package'      => '',
1165                      'requires'     => '',
1166                      'requires_php' => '',
1167                  );
1168              }
1169  
1170              $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
1171  
1172              if ( ! is_null( $auto_update_forced ) ) {
1173                  $enabled = $auto_update_forced;
1174              } else {
1175                  $enabled = in_array( $active_theme->stylesheet, $auto_updates, true );
1176              }
1177  
1178              if ( $enabled ) {
1179                  $auto_updates_string = __( 'Enabled' );
1180              } else {
1181                  $auto_updates_string = __( 'Disabled' );
1182              }
1183  
1184              /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */
1185              $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled );
1186  
1187              $info['wp-active-theme']['fields']['auto_update'] = array(
1188                  'label' => __( 'Auto-updates' ),
1189                  'value' => $auto_updates_string,
1190                  'debug' => $auto_updates_string,
1191              );
1192          }
1193  
1194          $parent_theme = $active_theme->parent();
1195  
1196          if ( $parent_theme ) {
1197              $parent_theme_version       = $parent_theme->version;
1198              $parent_theme_version_debug = $parent_theme_version;
1199  
1200              if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) {
1201                  $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version'];
1202  
1203                  /* translators: %s: Latest theme version number. */
1204                  $parent_theme_version       .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version );
1205                  $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version );
1206              }
1207  
1208              $parent_theme_author_uri = $parent_theme->display( 'AuthorURI' );
1209  
1210              $info['wp-parent-theme']['fields'] = array(
1211                  'name'           => array(
1212                      'label' => __( 'Name' ),
1213                      'value' => sprintf(
1214                          /* translators: 1: Theme name. 2: Theme slug. */
1215                          __( '%1$s (%2$s)' ),
1216                          $parent_theme->name,
1217                          $parent_theme->stylesheet
1218                      ),
1219                  ),
1220                  'version'        => array(
1221                      'label' => __( 'Version' ),
1222                      'value' => $parent_theme_version,
1223                      'debug' => $parent_theme_version_debug,
1224                  ),
1225                  'author'         => array(
1226                      'label' => __( 'Author' ),
1227                      'value' => wp_kses( $parent_theme->author, array() ),
1228                  ),
1229                  'author_website' => array(
1230                      'label' => __( 'Author website' ),
1231                      'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ),
1232                      'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ),
1233                  ),
1234                  'theme_path'     => array(
1235                      'label' => __( 'Theme directory location' ),
1236                      'value' => get_template_directory(),
1237                  ),
1238              );
1239  
1240              if ( $auto_updates_enabled ) {
1241                  if ( isset( $transient->response[ $parent_theme->stylesheet ] ) ) {
1242                      $item = $transient->response[ $parent_theme->stylesheet ];
1243                  } elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) {
1244                      $item = $transient->no_update[ $parent_theme->stylesheet ];
1245                  } else {
1246                      $item = array(
1247                          'theme'        => $parent_theme->stylesheet,
1248                          'new_version'  => $parent_theme->version,
1249                          'url'          => '',
1250                          'package'      => '',
1251                          'requires'     => '',
1252                          'requires_php' => '',
1253                      );
1254                  }
1255  
1256                  $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
1257  
1258                  if ( ! is_null( $auto_update_forced ) ) {
1259                      $enabled = $auto_update_forced;
1260                  } else {
1261                      $enabled = in_array( $parent_theme->stylesheet, $auto_updates, true );
1262                  }
1263  
1264                  if ( $enabled ) {
1265                      $parent_theme_auto_update_string = __( 'Enabled' );
1266                  } else {
1267                      $parent_theme_auto_update_string = __( 'Disabled' );
1268                  }
1269  
1270                  /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */
1271                  $parent_theme_auto_update_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $parent_theme, $enabled );
1272  
1273                  $info['wp-parent-theme']['fields']['auto_update'] = array(
1274                      'label' => __( 'Auto-update' ),
1275                      'value' => $parent_theme_auto_update_string,
1276                      'debug' => $parent_theme_auto_update_string,
1277                  );
1278              }
1279          }
1280  
1281          // Populate a list of all themes available in the install.
1282          $all_themes = wp_get_themes();
1283  
1284          foreach ( $all_themes as $theme_slug => $theme ) {
1285              // Exclude the currently active theme from the list of all themes.
1286              if ( $active_theme->stylesheet === $theme_slug ) {
1287                  continue;
1288              }
1289  
1290              // Exclude the currently active parent theme from the list of all themes.
1291              if ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) {
1292                  continue;
1293              }
1294  
1295              $theme_version = $theme->version;
1296              $theme_author  = $theme->author;
1297  
1298              // Sanitize.
1299              $theme_author = wp_kses( $theme_author, array() );
1300  
1301              $theme_version_string       = __( 'No version or author information is available.' );
1302              $theme_version_string_debug = 'undefined';
1303  
1304              if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) {
1305                  /* translators: 1: Theme version number. 2: Theme author name. */
1306                  $theme_version_string       = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author );
1307                  $theme_version_string_debug = sprintf( 'version: %s, author: %s', $theme_version, $theme_author );
1308              } else {
1309                  if ( ! empty( $theme_author ) ) {
1310                      /* translators: %s: Theme author name. */
1311                      $theme_version_string       = sprintf( __( 'By %s' ), $theme_author );
1312                      $theme_version_string_debug = sprintf( 'author: %s, version: (undefined)', $theme_author );
1313                  }
1314  
1315                  if ( ! empty( $theme_version ) ) {
1316                      /* translators: %s: Theme version number. */
1317                      $theme_version_string       = sprintf( __( 'Version %s' ), $theme_version );
1318                      $theme_version_string_debug = sprintf( 'author: (undefined), version: %s', $theme_version );
1319                  }
1320              }
1321  
1322              if ( array_key_exists( $theme_slug, $theme_updates ) ) {
1323                  /* translators: %s: Latest theme version number. */
1324                  $theme_version_string       .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] );
1325                  $theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] );
1326              }
1327  
1328              if ( $auto_updates_enabled ) {
1329                  if ( isset( $transient->response[ $theme_slug ] ) ) {
1330                      $item = $transient->response[ $theme_slug ];
1331                  } elseif ( isset( $transient->no_update[ $theme_slug ] ) ) {
1332                      $item = $transient->no_update[ $theme_slug ];
1333                  } else {
1334                      $item = array(
1335                          'theme'        => $theme_slug,
1336                          'new_version'  => $theme->version,
1337                          'url'          => '',
1338                          'package'      => '',
1339                          'requires'     => '',
1340                          'requires_php' => '',
1341                      );
1342                  }
1343  
1344                  $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
1345  
1346                  if ( ! is_null( $auto_update_forced ) ) {
1347                      $enabled = $auto_update_forced;
1348                  } else {
1349                      $enabled = in_array( $theme_slug, $auto_updates, true );
1350                  }
1351  
1352                  if ( $enabled ) {
1353                      $auto_updates_string = __( 'Auto-updates enabled' );
1354                  } else {
1355                      $auto_updates_string = __( 'Auto-updates disabled' );
1356                  }
1357  
1358                  /**
1359                   * Filters the text string of the auto-updates setting for each theme in the Site Health debug data.
1360                   *
1361                   * @since 5.5.0
1362                   *
1363                   * @param string   $auto_updates_string The string output for the auto-updates column.
1364                   * @param WP_Theme $theme               An object of theme data.
1365                   * @param bool     $enabled             Whether auto-updates are enabled for this item.
1366                   */
1367                  $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled );
1368  
1369                  $theme_version_string       .= ' | ' . $auto_updates_string;
1370                  $theme_version_string_debug .= ', ' . $auto_updates_string;
1371              }
1372  
1373              $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array(
1374                  'label' => sprintf(
1375                      /* translators: 1: Theme name. 2: Theme slug. */
1376                      __( '%1$s (%2$s)' ),
1377                      $theme->name,
1378                      $theme_slug
1379                  ),
1380                  'value' => $theme_version_string,
1381                  'debug' => $theme_version_string_debug,
1382              );
1383          }
1384  
1385          // Add more filesystem checks.
1386          if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) {
1387              $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR );
1388  
1389              $info['wp-filesystem']['fields']['mu-plugins'] = array(
1390                  'label' => __( 'The must use plugins directory' ),
1391                  'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ),
1392                  'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ),
1393              );
1394          }
1395  
1396          /**
1397           * Add to or modify the debug information shown on the Tools -> Site Health -> Info screen.
1398           *
1399           * Plugin or themes may wish to introduce their own debug information without creating
1400           * additional admin pages. They can utilize this filter to introduce their own sections
1401           * or add more data to existing sections.
1402           *
1403           * Array keys for sections added by core are all prefixed with `wp-`. Plugins and themes
1404           * should use their own slug as a prefix, both for consistency as well as avoiding
1405           * key collisions. Note that the array keys are used as labels for the copied data.
1406           *
1407           * All strings are expected to be plain text except `$description` that can contain
1408           * inline HTML tags (see below).
1409           *
1410           * @since 5.2.0
1411           *
1412           * @param array $args {
1413           *     The debug information to be added to the core information page.
1414           *
1415           *     This is an associative multi-dimensional array, up to three levels deep.
1416           *     The topmost array holds the sections, keyed by section ID.
1417           *
1418           *     @type array ...$0 {
1419           *         Each section has a `$fields` associative array (see below), and each `$value` in `$fields`
1420           *         can be another associative array of name/value pairs when there is more structured data
1421           *         to display.
1422           *
1423           *         @type string $label       Required. The title for this section of the debug output.
1424           *         @type string $description Optional. A description for your information section which
1425           *                                   may contain basic HTML markup, inline tags only as it is
1426           *                                   outputted in a paragraph.
1427           *         @type bool   $show_count  Optional. If set to `true`, the amount of fields will be included
1428           *                                   in the title for this section. Default false.
1429           *         @type bool   $private     Optional. If set to `true`, the section and all associated fields
1430           *                                   will be excluded from the copied data. Default false.
1431           *         @type array  $fields {
1432           *             Required. An associative array containing the fields to be displayed in the section,
1433           *             keyed by field ID.
1434           *
1435           *             @type array ...$0 {
1436           *                 An associative array containing the data to be displayed for the field.
1437           *
1438           *                 @type string $label    Required. The label for this piece of information.
1439           *                 @type mixed  $value    Required. The output that is displayed for this field.
1440           *                                        Text should be translated. Can be an associative array
1441           *                                        that is displayed as name/value pairs.
1442           *                                        Accepted types: `string|int|float|(string|int|float)[]`.
1443           *                 @type string $debug    Optional. The output that is used for this field when
1444           *                                        the user copies the data. It should be more concise and
1445           *                                        not translated. If not set, the content of `$value`
1446           *                                        is used. Note that the array keys are used as labels
1447           *                                        for the copied data.
1448           *                 @type bool   $private  Optional. If set to `true`, the field will be excluded
1449           *                                        from the copied data, allowing you to show, for example,
1450           *                                        API keys here. Default false.
1451           *             }
1452           *         }
1453           *     }
1454           * }
1455           */
1456          $info = apply_filters( 'debug_information', $info );
1457  
1458          return $info;
1459      }
1460  
1461      /**
1462       * Returns the value of a MySQL system variable.
1463       *
1464       * @since 5.9.0
1465       *
1466       * @global wpdb $wpdb WordPress database abstraction object.
1467       *
1468       * @param string $mysql_var Name of the MySQL system variable.
1469       * @return string|null The variable value on success. Null if the variable does not exist.
1470       */
1471  	public static function get_mysql_var( $mysql_var ) {
1472          global $wpdb;
1473  
1474          $result = $wpdb->get_row(
1475              $wpdb->prepare( 'SHOW VARIABLES LIKE %s', $mysql_var ),
1476              ARRAY_A
1477          );
1478  
1479          if ( ! empty( $result ) && array_key_exists( 'Value', $result ) ) {
1480              return $result['Value'];
1481          }
1482  
1483          return null;
1484      }
1485  
1486      /**
1487       * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket.
1488       *
1489       * @since 5.2.0
1490       *
1491       * @param array  $info_array Information gathered from the `WP_Debug_Data::debug_data()` function.
1492       * @param string $data_type  The data type to return, either 'info' or 'debug'.
1493       * @return string The formatted data.
1494       */
1495  	public static function format( $info_array, $data_type ) {
1496          $return = "`\n";
1497  
1498          foreach ( $info_array as $section => $details ) {
1499              // Skip this section if there are no fields, or the section has been declared as private.
1500              if ( empty( $details['fields'] ) || ( isset( $details['private'] ) && $details['private'] ) ) {
1501                  continue;
1502              }
1503  
1504              $section_label = 'debug' === $data_type ? $section : $details['label'];
1505  
1506              $return .= sprintf(
1507                  "### %s%s ###\n\n",
1508                  $section_label,
1509                  ( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' )
1510              );
1511  
1512              foreach ( $details['fields'] as $field_name => $field ) {
1513                  if ( isset( $field['private'] ) && true === $field['private'] ) {
1514                      continue;
1515                  }
1516  
1517                  if ( 'debug' === $data_type && isset( $field['debug'] ) ) {
1518                      $debug_data = $field['debug'];
1519                  } else {
1520                      $debug_data = $field['value'];
1521                  }
1522  
1523                  // Can be array, one level deep only.
1524                  if ( is_array( $debug_data ) ) {
1525                      $value = '';
1526  
1527                      foreach ( $debug_data as $sub_field_name => $sub_field_value ) {
1528                          $value .= sprintf( "\n\t%s: %s", $sub_field_name, $sub_field_value );
1529                      }
1530                  } elseif ( is_bool( $debug_data ) ) {
1531                      $value = $debug_data ? 'true' : 'false';
1532                  } elseif ( empty( $debug_data ) && '0' !== $debug_data ) {
1533                      $value = 'undefined';
1534                  } else {
1535                      $value = $debug_data;
1536                  }
1537  
1538                  if ( 'debug' === $data_type ) {
1539                      $label = $field_name;
1540                  } else {
1541                      $label = $field['label'];
1542                  }
1543  
1544                  $return .= sprintf( "%s: %s\n", $label, $value );
1545              }
1546  
1547              $return .= "\n";
1548          }
1549  
1550          $return .= '`';
1551  
1552          return $return;
1553      }
1554  
1555      /**
1556       * Fetch the total size of all the database tables for the active database user.
1557       *
1558       * @since 5.2.0
1559       *
1560       * @return int The size of the database, in bytes.
1561       */
1562  	public static function get_database_size() {
1563          global $wpdb;
1564          $size = 0;
1565          $rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A );
1566  
1567          if ( $wpdb->num_rows > 0 ) {
1568              foreach ( $rows as $row ) {
1569                  $size += $row['Data_length'] + $row['Index_length'];
1570              }
1571          }
1572  
1573          return (int) $size;
1574      }
1575  
1576      /**
1577       * Fetch the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`.
1578       * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`.
1579       *
1580       * @since 5.2.0
1581       *
1582       * @return array The sizes of the directories, also the database size and total installation size.
1583       */
1584  	public static function get_sizes() {
1585          $size_db    = self::get_database_size();
1586          $upload_dir = wp_get_upload_dir();
1587  
1588          /*
1589           * We will be using the PHP max execution time to prevent the size calculations
1590           * from causing a timeout. The default value is 30 seconds, and some
1591           * hosts do not allow you to read configuration values.
1592           */
1593          if ( function_exists( 'ini_get' ) ) {
1594              $max_execution_time = ini_get( 'max_execution_time' );
1595          }
1596  
1597          // The max_execution_time defaults to 0 when PHP runs from cli.
1598          // We still want to limit it below.
1599          if ( empty( $max_execution_time ) ) {
1600              $max_execution_time = 30;
1601          }
1602  
1603          if ( $max_execution_time > 20 ) {
1604              // If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent
1605              // edge-case timeouts that may happen after the size loop has finished running.
1606              $max_execution_time -= 2;
1607          }
1608  
1609          // Go through the various installation directories and calculate their sizes.
1610          // No trailing slashes.
1611          $paths = array(
1612              'wordpress_size' => untrailingslashit( ABSPATH ),
1613              'themes_size'    => get_theme_root(),
1614              'plugins_size'   => WP_PLUGIN_DIR,
1615              'uploads_size'   => $upload_dir['basedir'],
1616          );
1617  
1618          $exclude = $paths;
1619          unset( $exclude['wordpress_size'] );
1620          $exclude = array_values( $exclude );
1621  
1622          $size_total = 0;
1623          $all_sizes  = array();
1624  
1625          // Loop over all the directories we want to gather the sizes for.
1626          foreach ( $paths as $name => $path ) {
1627              $dir_size = null; // Default to timeout.
1628              $results  = array(
1629                  'path' => $path,
1630                  'raw'  => 0,
1631              );
1632  
1633              if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) {
1634                  if ( 'wordpress_size' === $name ) {
1635                      $dir_size = recurse_dirsize( $path, $exclude, $max_execution_time );
1636                  } else {
1637                      $dir_size = recurse_dirsize( $path, null, $max_execution_time );
1638                  }
1639              }
1640  
1641              if ( false === $dir_size ) {
1642                  // Error reading.
1643                  $results['size']  = __( 'The size cannot be calculated. The directory is not accessible. Usually caused by invalid permissions.' );
1644                  $results['debug'] = 'not accessible';
1645  
1646                  // Stop total size calculation.
1647                  $size_total = null;
1648              } elseif ( null === $dir_size ) {
1649                  // Timeout.
1650                  $results['size']  = __( 'The directory size calculation has timed out. Usually caused by a very large number of sub-directories and files.' );
1651                  $results['debug'] = 'timeout while calculating size';
1652  
1653                  // Stop total size calculation.
1654                  $size_total = null;
1655              } else {
1656                  if ( null !== $size_total ) {
1657                      $size_total += $dir_size;
1658                  }
1659  
1660                  $results['raw']   = $dir_size;
1661                  $results['size']  = size_format( $dir_size, 2 );
1662                  $results['debug'] = $results['size'] . " ({$dir_size} bytes)";
1663              }
1664  
1665              $all_sizes[ $name ] = $results;
1666          }
1667  
1668          if ( $size_db > 0 ) {
1669              $database_size = size_format( $size_db, 2 );
1670  
1671              $all_sizes['database_size'] = array(
1672                  'raw'   => $size_db,
1673                  'size'  => $database_size,
1674                  'debug' => $database_size . " ({$size_db} bytes)",
1675              );
1676          } else {
1677              $all_sizes['database_size'] = array(
1678                  'size'  => __( 'Not available' ),
1679                  'debug' => 'not available',
1680              );
1681          }
1682  
1683          if ( null !== $size_total && $size_db > 0 ) {
1684              $total_size    = $size_total + $size_db;
1685              $total_size_mb = size_format( $total_size, 2 );
1686  
1687              $all_sizes['total_size'] = array(
1688                  'raw'   => $total_size,
1689                  'size'  => $total_size_mb,
1690                  'debug' => $total_size_mb . " ({$total_size} bytes)",
1691              );
1692          } else {
1693              $all_sizes['total_size'] = array(
1694                  'size'  => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ),
1695                  'debug' => 'not available',
1696              );
1697          }
1698  
1699          return $all_sizes;
1700      }
1701  }


Generated : Fri Aug 19 08:20:02 2022 Cross-referenced by PHPXref