: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'database_size' => array(
'label' => __( 'Database size' ),
'label' => __( 'Total installation size' ),
// Get a list of all drop-in replacements.
$dropins = get_dropins();
// Get dropins descriptions.
$dropin_descriptions = _get_dropins();
// Spare few function calls.
$not_available = __( 'Not available' );
foreach ( $dropins as $dropin_key => $dropin ) {
$info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array(
'value' => $dropin_descriptions[ $dropin_key ][0],
// Populate the media fields.
$info['wp-media']['fields']['image_editor'] = array(
'label' => __( 'Active editor' ),
'value' => _wp_image_editor_choose(),
// Get ImageMagic information, if available.
if ( class_exists( 'Imagick' ) ) {
// Save the Imagick instance for later use.
$imagick = new Imagick();
$imagemagick_version = $imagick->getVersion();
$imagemagick_version = __( 'Not available' );
$info['wp-media']['fields']['imagick_module_version'] = array(
'label' => __( 'ImageMagick version number' ),
'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionNumber'] : $imagemagick_version ),
$info['wp-media']['fields']['imagemagick_version'] = array(
'label' => __( 'ImageMagick version string' ),
'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionString'] : $imagemagick_version ),
$imagick_version = phpversion( 'imagick' );
$info['wp-media']['fields']['imagick_version'] = array(
'label' => __( 'Imagick version' ),
'value' => ( $imagick_version ) ? $imagick_version : __( 'Not available' ),
if ( ! function_exists( 'ini_get' ) ) {
$info['wp-media']['fields']['ini_get'] = array(
'label' => __( 'File upload settings' ),
/* translators: %s: ini_get() */
__( 'Unable to determine some settings, as the %s function has been disabled.' ),
'debug' => 'ini_get() is disabled',
// Get the PHP ini directive values.
$file_uploads = ini_get( 'file_uploads' );
$post_max_size = ini_get( 'post_max_size' );
$upload_max_filesize = ini_get( 'upload_max_filesize' );
$max_file_uploads = ini_get( 'max_file_uploads' );
$effective = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) );
// Add info in Media section.
$info['wp-media']['fields']['file_uploads'] = array(
'label' => __( 'File uploads' ),
'value' => $file_uploads ? __( 'Enabled' ) : __( 'Disabled' ),
'debug' => $file_uploads,
$info['wp-media']['fields']['post_max_size'] = array(
'label' => __( 'Max size of post data allowed' ),
'value' => $post_max_size,
$info['wp-media']['fields']['upload_max_filesize'] = array(
'label' => __( 'Max size of an uploaded file' ),
'value' => $upload_max_filesize,
$info['wp-media']['fields']['max_effective_size'] = array(
'label' => __( 'Max effective file size' ),
'value' => size_format( $effective ),
$info['wp-media']['fields']['max_file_uploads'] = array(
'label' => __( 'Max number of files allowed' ),
'value' => number_format( $max_file_uploads ),
// If Imagick is used as our editor, provide some more information about its limitations.
if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ),
'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ),
'file' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ),
'map' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ),
'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ),
'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ),
'time' => ( defined( 'imagick::RESOURCETYPE_TIME' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_TIME ) : $not_available ),
'imagick::RESOURCETYPE_AREA' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ),
'imagick::RESOURCETYPE_DISK' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ),
'imagick::RESOURCETYPE_FILE' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ),
'imagick::RESOURCETYPE_MAP' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ),
'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ),
'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ),
'imagick::RESOURCETYPE_TIME' => ( defined( 'imagick::RESOURCETYPE_TIME' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_TIME ) : 'not available' ),
$info['wp-media']['fields']['imagick_limits'] = array(
'label' => __( 'Imagick Resource Limits' ),
'debug' => $limits_debug,
$formats = Imagick::queryFormats( '*' );
} catch ( Exception $e ) {
$info['wp-media']['fields']['imagemagick_file_formats'] = array(
'label' => __( 'ImageMagick supported file formats' ),
'value' => ( empty( $formats ) ) ? __( 'Unable to determine' ) : implode( ', ', $formats ),
'debug' => ( empty( $formats ) ) ? 'Unable to determine' : implode( ', ', $formats ),
// Get GD information, if available.
if ( function_exists( 'gd_info' ) ) {
$info['wp-media']['fields']['gd_version'] = array(
'label' => __( 'GD version' ),
'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ),
'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),
$gd_image_formats = array();
$gd_supported_formats = array(
foreach ( $gd_supported_formats as $format_key => $format ) {
$index = $format_key . ' Support';
if ( isset( $gd[ $index ] ) && $gd[ $index ] ) {
array_push( $gd_image_formats, $format );
if ( ! empty( $gd_image_formats ) ) {
$info['wp-media']['fields']['gd_formats'] = array(
'label' => __( 'GD supported file formats' ),
'value' => implode( ', ', $gd_image_formats ),
// Get Ghostscript information, if available.
if ( function_exists( 'exec' ) ) {
$gs = exec( 'gs --version' );
$gs_debug = 'not available';
$gs = __( 'Unable to determine if Ghostscript is installed' );
$info['wp-media']['fields']['ghostscript_version'] = array(
'label' => __( 'Ghostscript version' ),
// Populate the server debug fields.
if ( function_exists( 'php_uname' ) ) {
$server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) );
$server_architecture = 'unknown';
$php_version_debug = PHP_VERSION;
// Whether PHP supports 64-bit.
$php64bit = ( PHP_INT_SIZE * 8 === 64 );
( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) )
$php_version_debug .= ' 64bit';
$info['wp-server']['fields']['server_architecture'] = array(
'label' => __( 'Server architecture' ),
'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ),
'debug' => $server_architecture,
$info['wp-server']['fields']['httpd_software'] = array(
'label' => __( 'Web server' ),
'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ),
'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ),
$info['wp-server']['fields']['php_version'] = array(
'label' => __( 'PHP version' ),
'debug' => $php_version_debug,
$info['wp-server']['fields']['php_sapi'] = array(
'label' => __( 'PHP SAPI' ),
// Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values.
if ( ! function_exists( 'ini_get' ) ) {
$info['wp-server']['fields']['ini_get'] = array(
'label' => __( 'Server settings' ),
/* translators: %s: ini_get() */
__( 'Unable to determine some settings, as the %s function has been disabled.' ),
'debug' => 'ini_get() is disabled',
$info['wp-server']['fields']['max_input_variables'] = array(
'label' => __( 'PHP max input variables' ),
'value' => ini_get( 'max_input_vars' ),
$info['wp-server']['fields']['time_limit'] = array(
'label' => __( 'PHP time limit' ),
'value' => ini_get( 'max_execution_time' ),
if ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) {
$info['wp-server']['fields']['memory_limit'] = array(
'label' => __( 'PHP memory limit' ),
'value' => WP_Site_Health::get_instance()->php_memory_limit,
$info['wp-server']['fields']['admin_memory_limit'] = array(
'label' => __( 'PHP memory limit (only for admin screens)' ),
'value' => ini_get( 'memory_limit' ),
$info['wp-server']['fields']['memory_limit'] = array(
'label' => __( 'PHP memory limit' ),
'value' => ini_get( 'memory_limit' ),
$info['wp-server']['fields']['max_input_time'] = array(
'label' => __( 'Max input time' ),
'value' => ini_get( 'max_input_time' ),
$info['wp-server']['fields']['upload_max_filesize'] = array(
'label' => __( 'Upload max filesize' ),
'value' => ini_get( 'upload_max_filesize' ),
$info['wp-server']['fields']['php_post_max_size'] = array(
'label' => __( 'PHP post max size' ),
'value' => ini_get( 'post_max_size' ),
if ( function_exists( 'curl_version' ) ) {
$info['wp-server']['fields']['curl_version'] = array(
'label' => __( 'cURL version' ),
'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ),
$info['wp-server']['fields']['curl_version'] = array(
'label' => __( 'cURL version' ),
'value' => $not_available,
'debug' => 'not available',
$suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) );
$info['wp-server']['fields']['suhosin'] = array(
'label' => __( 'Is SUHOSIN installed?' ),
'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ),
'debug' => $suhosin_loaded,
$imagick_loaded = extension_loaded( 'imagick' );
$info['wp-server']['fields']['imagick_availability'] = array(
'label' => __( 'Is the Imagick library available?' ),
'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ),
'debug' => $imagick_loaded,
$pretty_permalinks_supported = got_url_rewrite();
$info['wp-server']['fields']['pretty_permalinks'] = array(
'label' => __( 'Are pretty permalinks supported?' ),
'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ),
'debug' => $pretty_permalinks_supported,
// Check if a .htaccess file exists.
if ( is_file( ABSPATH . '.htaccess' ) ) {
// If the file exists, grab the content of it.
$htaccess_content = file_get_contents( ABSPATH . '.htaccess' );
// Filter away the core WordPress rules.
$filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) );
$filtered_htaccess_content = ! empty( $filtered_htaccess_content );
if ( $filtered_htaccess_content ) {
/* translators: %s: .htaccess */
$htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' );
/* translators: %s: .htaccess */
$htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' );
$info['wp-server']['fields']['htaccess_extra_rules'] = array(
'label' => __( '.htaccess rules' ),
'value' => $htaccess_rules_string,
'debug' => $filtered_htaccess_content,
$date = new DateTime( 'now', new DateTimeZone( 'UTC' ) );
$info['wp-server']['fields']['current'] = array(
'label' => __( 'Current time' ),
'value' => $date->format( DateTime::ATOM ),
$info['wp-server']['fields']['utc-time'] = array(
'label' => __( 'Current UTC time' ),
'value' => $date->format( DateTime::RFC850 ),
$info['wp-server']['fields']['server-time'] = array(
'label' => __( 'Current Server time' ),
'value' => wp_date( 'c', $_SERVER['REQUEST_TIME'] ),
// Populate the database debug fields.
if ( is_object( $wpdb->dbh ) ) {
$extension = get_class( $wpdb->dbh );
// Unknown sql extension.
$server = $wpdb->get_var( 'SELECT VERSION()' );
$client_version = $wpdb->dbh->client_info;
$info['wp-database']['fields']['extension'] = array(
'label' => __( 'Extension' ),
$info['wp-database']['fields']['server_version'] = array(
'label' => __( 'Server version' ),
$info['wp-database']['fields']['client_version'] = array(
'label' => __( 'Client version' ),
'value' => $client_version,
$info['wp-database']['fields']['database_user'] = array(
'label' => __( 'Database username' ),
'value' => $wpdb->dbuser,
$info['wp-database']['fields']['database_host'] = array(
'label' => __( 'Database host' ),
'value' => $wpdb->dbhost,
$info['wp-database']['fields']['database_name'] = array(
'label' => __( 'Database name' ),
'value' => $wpdb->dbname,
$info['wp-database']['fields']['database_prefix'] = array(
'label' => __( 'Table prefix' ),
'value' => $wpdb->prefix,
$info['wp-database']['fields']['database_charset'] = array(
'label' => __( 'Database charset' ),
'value' => $wpdb->charset,
$info['wp-database']['fields']['database_collate'] = array(
'label' => __( 'Database collation' ),
'value' => $wpdb->collate,
$info['wp-database']['fields']['max_allowed_packet'] = array(
'label' => __( 'Max allowed packet size' ),
'value' => self::get_mysql_var( 'max_allowed_packet' ),
$info['wp-database']['fields']['max_connections'] = array(
'label' => __( 'Max connections number' ),
'value' => self::get_mysql_var( 'max_connections' ),
// List must use plugins if there are any.
$mu_plugins = get_mu_plugins();
foreach ( $mu_plugins as $plugin_path => $plugin ) {
$plugin_version = $plugin['Version'];
$plugin_author = $plugin['Author'];
$plugin_version_string = __( 'No version or author information is available.' );
$plugin_version_string_debug = 'author: (undefined), version: (undefined)';
if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) {
/* translators: 1: Plugin version number. 2: Plugin author name. */
$plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author );
$plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author );
if ( ! empty( $plugin_author ) ) {
/* translators: %s: Plugin author name. */
$plugin_version_string = sprintf( __( 'By %s' ), $plugin_author );
$plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author );
if ( ! empty( $plugin_version ) ) {
/* translators: %s: Plugin version number. */
$plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version );
$plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version );
$info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array(
'label' => $plugin['Name'],
'value' => $plugin_version_string,
'debug' => $plugin_version_string_debug,
// List all available plugins.
$plugins = get_plugins();
$plugin_updates = get_plugin_updates();
$transient = get_site_transient( 'update_plugins' );
$auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' );
if ( $auto_updates_enabled ) {