Edit File by line
/home/zeestwma/redstone.../wp-admin/includes
File: class-wp-debug-data.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Class for providing debug data based on a users WordPress environment.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Site_Health
[5] Fix | Delete
* @since 5.2.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
#[AllowDynamicProperties]
[9] Fix | Delete
class WP_Debug_Data {
[10] Fix | Delete
/**
[11] Fix | Delete
* Calls all core functions to check for updates.
[12] Fix | Delete
*
[13] Fix | Delete
* @since 5.2.0
[14] Fix | Delete
*/
[15] Fix | Delete
public static function check_for_updates() {
[16] Fix | Delete
wp_version_check();
[17] Fix | Delete
wp_update_plugins();
[18] Fix | Delete
wp_update_themes();
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Static function for generating site debug data when required.
[23] Fix | Delete
*
[24] Fix | Delete
* @since 5.2.0
[25] Fix | Delete
* @since 5.3.0 Added database charset, database collation,
[26] Fix | Delete
* and timezone information.
[27] Fix | Delete
* @since 5.5.0 Added pretty permalinks support information.
[28] Fix | Delete
* @since 6.7.0 Modularized into separate theme-oriented methods.
[29] Fix | Delete
*
[30] Fix | Delete
* @throws ImagickException
[31] Fix | Delete
*
[32] Fix | Delete
* @return array The debug data for the site.
[33] Fix | Delete
*/
[34] Fix | Delete
public static function debug_data() {
[35] Fix | Delete
/*
[36] Fix | Delete
* Set up the array that holds all debug information.
[37] Fix | Delete
*
[38] Fix | Delete
* When iterating through the debug data, the ordering of the sections
[39] Fix | Delete
* occurs in insertion-order of the assignments into this array.
[40] Fix | Delete
*
[41] Fix | Delete
* This is the single assignment of the sections before filtering. Null-entries will
[42] Fix | Delete
* be automatically be removed.
[43] Fix | Delete
*/
[44] Fix | Delete
$info = array(
[45] Fix | Delete
'wp-core' => self::get_wp_core(),
[46] Fix | Delete
'wp-paths-sizes' => self::get_wp_paths_sizes(),
[47] Fix | Delete
'wp-dropins' => self::get_wp_dropins(),
[48] Fix | Delete
'wp-active-theme' => self::get_wp_active_theme(),
[49] Fix | Delete
'wp-parent-theme' => self::get_wp_parent_theme(),
[50] Fix | Delete
'wp-themes-inactive' => self::get_wp_themes_inactive(),
[51] Fix | Delete
'wp-mu-plugins' => self::get_wp_mu_plugins(),
[52] Fix | Delete
'wp-plugins-active' => self::get_wp_plugins_active(),
[53] Fix | Delete
'wp-plugins-inactive' => self::get_wp_plugins_inactive(),
[54] Fix | Delete
'wp-media' => self::get_wp_media(),
[55] Fix | Delete
'wp-server' => self::get_wp_server(),
[56] Fix | Delete
'wp-database' => self::get_wp_database(),
[57] Fix | Delete
'wp-constants' => self::get_wp_constants(),
[58] Fix | Delete
'wp-filesystem' => self::get_wp_filesystem(),
[59] Fix | Delete
);
[60] Fix | Delete
[61] Fix | Delete
/*
[62] Fix | Delete
* Remove null elements from the array. The individual methods are
[63] Fix | Delete
* allowed to return `null`, which communicates that the category
[64] Fix | Delete
* of debug data isn't relevant and shouldn't be passed through.
[65] Fix | Delete
*/
[66] Fix | Delete
$info = array_filter(
[67] Fix | Delete
$info,
[68] Fix | Delete
static function ( $section ) {
[69] Fix | Delete
return isset( $section );
[70] Fix | Delete
}
[71] Fix | Delete
);
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Filters the debug information shown on the Tools -> Site Health -> Info screen.
[75] Fix | Delete
*
[76] Fix | Delete
* Plugin or themes may wish to introduce their own debug information without creating
[77] Fix | Delete
* additional admin pages. They can utilize this filter to introduce their own sections
[78] Fix | Delete
* or add more data to existing sections.
[79] Fix | Delete
*
[80] Fix | Delete
* Array keys for sections added by core are all prefixed with `wp-`. Plugins and themes
[81] Fix | Delete
* should use their own slug as a prefix, both for consistency as well as avoiding
[82] Fix | Delete
* key collisions. Note that the array keys are used as labels for the copied data.
[83] Fix | Delete
*
[84] Fix | Delete
* All strings are expected to be plain text except `$description` that can contain
[85] Fix | Delete
* inline HTML tags (see below).
[86] Fix | Delete
*
[87] Fix | Delete
* @since 5.2.0
[88] Fix | Delete
*
[89] Fix | Delete
* @param array $args {
[90] Fix | Delete
* The debug information to be added to the core information page.
[91] Fix | Delete
*
[92] Fix | Delete
* This is an associative multi-dimensional array, up to three levels deep.
[93] Fix | Delete
* The topmost array holds the sections, keyed by section ID.
[94] Fix | Delete
*
[95] Fix | Delete
* @type array ...$0 {
[96] Fix | Delete
* Each section has a `$fields` associative array (see below), and each `$value` in `$fields`
[97] Fix | Delete
* can be another associative array of name/value pairs when there is more structured data
[98] Fix | Delete
* to display.
[99] Fix | Delete
*
[100] Fix | Delete
* @type string $label Required. The title for this section of the debug output.
[101] Fix | Delete
* @type string $description Optional. A description for your information section which
[102] Fix | Delete
* may contain basic HTML markup, inline tags only as it is
[103] Fix | Delete
* outputted in a paragraph.
[104] Fix | Delete
* @type bool $show_count Optional. If set to `true`, the amount of fields will be included
[105] Fix | Delete
* in the title for this section. Default false.
[106] Fix | Delete
* @type bool $private Optional. If set to `true`, the section and all associated fields
[107] Fix | Delete
* will be excluded from the copied data. Default false.
[108] Fix | Delete
* @type array $fields {
[109] Fix | Delete
* Required. An associative array containing the fields to be displayed in the section,
[110] Fix | Delete
* keyed by field ID.
[111] Fix | Delete
*
[112] Fix | Delete
* @type array ...$0 {
[113] Fix | Delete
* An associative array containing the data to be displayed for the field.
[114] Fix | Delete
*
[115] Fix | Delete
* @type string $label Required. The label for this piece of information.
[116] Fix | Delete
* @type mixed $value Required. The output that is displayed for this field.
[117] Fix | Delete
* Text should be translated. Can be an associative array
[118] Fix | Delete
* that is displayed as name/value pairs.
[119] Fix | Delete
* Accepted types: `string|int|float|(string|int|float)[]`.
[120] Fix | Delete
* @type string $debug Optional. The output that is used for this field when
[121] Fix | Delete
* the user copies the data. It should be more concise and
[122] Fix | Delete
* not translated. If not set, the content of `$value`
[123] Fix | Delete
* is used. Note that the array keys are used as labels
[124] Fix | Delete
* for the copied data.
[125] Fix | Delete
* @type bool $private Optional. If set to `true`, the field will be excluded
[126] Fix | Delete
* from the copied data, allowing you to show, for example,
[127] Fix | Delete
* API keys here. Default false.
[128] Fix | Delete
* }
[129] Fix | Delete
* }
[130] Fix | Delete
* }
[131] Fix | Delete
* }
[132] Fix | Delete
*/
[133] Fix | Delete
$info = apply_filters( 'debug_information', $info );
[134] Fix | Delete
[135] Fix | Delete
return $info;
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* Gets the WordPress core section of the debug data.
[140] Fix | Delete
*
[141] Fix | Delete
* @since 6.7.0
[142] Fix | Delete
*
[143] Fix | Delete
* @return array
[144] Fix | Delete
*/
[145] Fix | Delete
private static function get_wp_core(): array {
[146] Fix | Delete
// Save few function calls.
[147] Fix | Delete
$permalink_structure = get_option( 'permalink_structure' );
[148] Fix | Delete
$is_ssl = is_ssl();
[149] Fix | Delete
$users_can_register = get_option( 'users_can_register' );
[150] Fix | Delete
$blog_public = get_option( 'blog_public' );
[151] Fix | Delete
$default_comment_status = get_option( 'default_comment_status' );
[152] Fix | Delete
$environment_type = wp_get_environment_type();
[153] Fix | Delete
$core_version = wp_get_wp_version();
[154] Fix | Delete
$core_updates = get_core_updates();
[155] Fix | Delete
$core_update_needed = '';
[156] Fix | Delete
[157] Fix | Delete
if ( is_array( $core_updates ) ) {
[158] Fix | Delete
foreach ( $core_updates as $core => $update ) {
[159] Fix | Delete
if ( 'upgrade' === $update->response ) {
[160] Fix | Delete
/* translators: %s: Latest WordPress version number. */
[161] Fix | Delete
$core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version );
[162] Fix | Delete
} else {
[163] Fix | Delete
$core_update_needed = '';
[164] Fix | Delete
}
[165] Fix | Delete
}
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
$fields = array(
[169] Fix | Delete
'version' => array(
[170] Fix | Delete
'label' => __( 'Version' ),
[171] Fix | Delete
'value' => $core_version . $core_update_needed,
[172] Fix | Delete
'debug' => $core_version,
[173] Fix | Delete
),
[174] Fix | Delete
'site_language' => array(
[175] Fix | Delete
'label' => __( 'Site Language' ),
[176] Fix | Delete
'value' => get_locale(),
[177] Fix | Delete
),
[178] Fix | Delete
'user_language' => array(
[179] Fix | Delete
'label' => __( 'User Language' ),
[180] Fix | Delete
'value' => get_user_locale(),
[181] Fix | Delete
),
[182] Fix | Delete
'timezone' => array(
[183] Fix | Delete
'label' => __( 'Timezone' ),
[184] Fix | Delete
'value' => wp_timezone_string(),
[185] Fix | Delete
),
[186] Fix | Delete
'home_url' => array(
[187] Fix | Delete
'label' => __( 'Home URL' ),
[188] Fix | Delete
'value' => get_bloginfo( 'url' ),
[189] Fix | Delete
'private' => true,
[190] Fix | Delete
),
[191] Fix | Delete
'site_url' => array(
[192] Fix | Delete
'label' => __( 'Site URL' ),
[193] Fix | Delete
'value' => get_bloginfo( 'wpurl' ),
[194] Fix | Delete
'private' => true,
[195] Fix | Delete
),
[196] Fix | Delete
'permalink' => array(
[197] Fix | Delete
'label' => __( 'Permalink structure' ),
[198] Fix | Delete
'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ),
[199] Fix | Delete
'debug' => $permalink_structure,
[200] Fix | Delete
),
[201] Fix | Delete
'https_status' => array(
[202] Fix | Delete
'label' => __( 'Is this site using HTTPS?' ),
[203] Fix | Delete
'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ),
[204] Fix | Delete
'debug' => $is_ssl,
[205] Fix | Delete
),
[206] Fix | Delete
'multisite' => array(
[207] Fix | Delete
'label' => __( 'Is this a multisite?' ),
[208] Fix | Delete
'value' => is_multisite() ? __( 'Yes' ) : __( 'No' ),
[209] Fix | Delete
'debug' => is_multisite(),
[210] Fix | Delete
),
[211] Fix | Delete
'user_registration' => array(
[212] Fix | Delete
'label' => __( 'Can anyone register on this site?' ),
[213] Fix | Delete
'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ),
[214] Fix | Delete
'debug' => $users_can_register,
[215] Fix | Delete
),
[216] Fix | Delete
'blog_public' => array(
[217] Fix | Delete
'label' => __( 'Is this site discouraging search engines?' ),
[218] Fix | Delete
'value' => $blog_public ? __( 'No' ) : __( 'Yes' ),
[219] Fix | Delete
'debug' => $blog_public,
[220] Fix | Delete
),
[221] Fix | Delete
'default_comment_status' => array(
[222] Fix | Delete
'label' => __( 'Default comment status' ),
[223] Fix | Delete
'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ),
[224] Fix | Delete
'debug' => $default_comment_status,
[225] Fix | Delete
),
[226] Fix | Delete
'environment_type' => array(
[227] Fix | Delete
'label' => __( 'Environment type' ),
[228] Fix | Delete
'value' => $environment_type,
[229] Fix | Delete
'debug' => $environment_type,
[230] Fix | Delete
),
[231] Fix | Delete
);
[232] Fix | Delete
[233] Fix | Delete
// Conditionally add debug information for multisite setups.
[234] Fix | Delete
if ( is_multisite() ) {
[235] Fix | Delete
$site_id = get_current_blog_id();
[236] Fix | Delete
[237] Fix | Delete
$fields['site_id'] = array(
[238] Fix | Delete
'label' => __( 'Site ID' ),
[239] Fix | Delete
'value' => $site_id,
[240] Fix | Delete
'debug' => $site_id,
[241] Fix | Delete
);
[242] Fix | Delete
[243] Fix | Delete
$network_query = new WP_Network_Query();
[244] Fix | Delete
$network_ids = $network_query->query(
[245] Fix | Delete
array(
[246] Fix | Delete
'fields' => 'ids',
[247] Fix | Delete
'number' => 100,
[248] Fix | Delete
'no_found_rows' => false,
[249] Fix | Delete
)
[250] Fix | Delete
);
[251] Fix | Delete
[252] Fix | Delete
$site_count = 0;
[253] Fix | Delete
foreach ( $network_ids as $network_id ) {
[254] Fix | Delete
$site_count += get_blog_count( $network_id );
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
$fields['site_count'] = array(
[258] Fix | Delete
'label' => __( 'Site count' ),
[259] Fix | Delete
'value' => $site_count,
[260] Fix | Delete
);
[261] Fix | Delete
[262] Fix | Delete
$fields['network_count'] = array(
[263] Fix | Delete
'label' => __( 'Network count' ),
[264] Fix | Delete
'value' => $network_query->found_networks,
[265] Fix | Delete
);
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
$fields['user_count'] = array(
[269] Fix | Delete
'label' => __( 'User count' ),
[270] Fix | Delete
'value' => get_user_count(),
[271] Fix | Delete
);
[272] Fix | Delete
[273] Fix | Delete
// WordPress features requiring processing.
[274] Fix | Delete
$wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) );
[275] Fix | Delete
[276] Fix | Delete
if ( ! is_wp_error( $wp_dotorg ) ) {
[277] Fix | Delete
$fields['dotorg_communication'] = array(
[278] Fix | Delete
'label' => __( 'Communication with WordPress.org' ),
[279] Fix | Delete
'value' => __( 'WordPress.org is reachable' ),
[280] Fix | Delete
'debug' => 'true',
[281] Fix | Delete
);
[282] Fix | Delete
} else {
[283] Fix | Delete
$fields['dotorg_communication'] = array(
[284] Fix | Delete
'label' => __( 'Communication with WordPress.org' ),
[285] Fix | Delete
'value' => sprintf(
[286] Fix | Delete
/* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */
[287] Fix | Delete
__( 'Unable to reach WordPress.org at %1$s: %2$s' ),
[288] Fix | Delete
gethostbyname( 'wordpress.org' ),
[289] Fix | Delete
$wp_dotorg->get_error_message()
[290] Fix | Delete
),
[291] Fix | Delete
'debug' => $wp_dotorg->get_error_message(),
[292] Fix | Delete
);
[293] Fix | Delete
}
[294] Fix | Delete
[295] Fix | Delete
return array(
[296] Fix | Delete
'label' => __( 'WordPress' ),
[297] Fix | Delete
'fields' => $fields,
[298] Fix | Delete
);
[299] Fix | Delete
}
[300] Fix | Delete
[301] Fix | Delete
/**
[302] Fix | Delete
* Gets the WordPress drop-in section of the debug data.
[303] Fix | Delete
*
[304] Fix | Delete
* @since 6.7.0
[305] Fix | Delete
*
[306] Fix | Delete
* @return array
[307] Fix | Delete
*/
[308] Fix | Delete
private static function get_wp_dropins(): array {
[309] Fix | Delete
// Get a list of all drop-in replacements.
[310] Fix | Delete
$dropins = get_dropins();
[311] Fix | Delete
[312] Fix | Delete
// Get drop-ins descriptions.
[313] Fix | Delete
$dropin_descriptions = _get_dropins();
[314] Fix | Delete
[315] Fix | Delete
$fields = array();
[316] Fix | Delete
foreach ( $dropins as $dropin_key => $dropin ) {
[317] Fix | Delete
$fields[ sanitize_text_field( $dropin_key ) ] = array(
[318] Fix | Delete
'label' => $dropin_key,
[319] Fix | Delete
'value' => $dropin_descriptions[ $dropin_key ][0],
[320] Fix | Delete
'debug' => 'true',
[321] Fix | Delete
);
[322] Fix | Delete
}
[323] Fix | Delete
[324] Fix | Delete
return array(
[325] Fix | Delete
'label' => __( 'Drop-ins' ),
[326] Fix | Delete
'show_count' => true,
[327] Fix | Delete
'description' => sprintf(
[328] Fix | Delete
/* translators: %s: wp-content directory name. */
[329] Fix | Delete
__( '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.' ),
[330] Fix | Delete
'<code>' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '</code>'
[331] Fix | Delete
),
[332] Fix | Delete
'fields' => $fields,
[333] Fix | Delete
);
[334] Fix | Delete
}
[335] Fix | Delete
[336] Fix | Delete
/**
[337] Fix | Delete
* Gets the WordPress server section of the debug data.
[338] Fix | Delete
*
[339] Fix | Delete
* @since 6.7.0
[340] Fix | Delete
*
[341] Fix | Delete
* @return array
[342] Fix | Delete
*/
[343] Fix | Delete
private static function get_wp_server(): array {
[344] Fix | Delete
// Populate the server debug fields.
[345] Fix | Delete
if ( function_exists( 'php_uname' ) ) {
[346] Fix | Delete
$server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) );
[347] Fix | Delete
} else {
[348] Fix | Delete
$server_architecture = 'unknown';
[349] Fix | Delete
}
[350] Fix | Delete
[351] Fix | Delete
$php_version_debug = PHP_VERSION;
[352] Fix | Delete
// Whether PHP supports 64-bit.
[353] Fix | Delete
$php64bit = ( PHP_INT_SIZE * 8 === 64 );
[354] Fix | Delete
[355] Fix | Delete
$php_version = sprintf(
[356] Fix | Delete
'%s %s',
[357] Fix | Delete
$php_version_debug,
[358] Fix | Delete
( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) )
[359] Fix | Delete
);
[360] Fix | Delete
[361] Fix | Delete
if ( $php64bit ) {
[362] Fix | Delete
$php_version_debug .= ' 64bit';
[363] Fix | Delete
}
[364] Fix | Delete
[365] Fix | Delete
$fields = array();
[366] Fix | Delete
[367] Fix | Delete
$fields['server_architecture'] = array(
[368] Fix | Delete
'label' => __( 'Server architecture' ),
[369] Fix | Delete
'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ),
[370] Fix | Delete
'debug' => $server_architecture,
[371] Fix | Delete
);
[372] Fix | Delete
$fields['httpd_software'] = array(
[373] Fix | Delete
'label' => __( 'Web server' ),
[374] Fix | Delete
'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ),
[375] Fix | Delete
'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ),
[376] Fix | Delete
);
[377] Fix | Delete
$fields['php_version'] = array(
[378] Fix | Delete
'label' => __( 'PHP version' ),
[379] Fix | Delete
'value' => $php_version,
[380] Fix | Delete
'debug' => $php_version_debug,
[381] Fix | Delete
);
[382] Fix | Delete
$fields['php_sapi'] = array(
[383] Fix | Delete
'label' => __( 'PHP SAPI' ),
[384] Fix | Delete
'value' => PHP_SAPI,
[385] Fix | Delete
'debug' => PHP_SAPI,
[386] Fix | Delete
);
[387] Fix | Delete
[388] Fix | Delete
// Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values.
[389] Fix | Delete
if ( ! function_exists( 'ini_get' ) ) {
[390] Fix | Delete
$fields['ini_get'] = array(
[391] Fix | Delete
'label' => __( 'Server settings' ),
[392] Fix | Delete
'value' => sprintf(
[393] Fix | Delete
/* translators: %s: ini_get() */
[394] Fix | Delete
__( 'Unable to determine some settings, as the %s function has been disabled.' ),
[395] Fix | Delete
'ini_get()'
[396] Fix | Delete
),
[397] Fix | Delete
'debug' => 'ini_get() is disabled',
[398] Fix | Delete
);
[399] Fix | Delete
} else {
[400] Fix | Delete
$fields['max_input_variables'] = array(
[401] Fix | Delete
'label' => __( 'PHP max input variables' ),
[402] Fix | Delete
'value' => ini_get( 'max_input_vars' ),
[403] Fix | Delete
);
[404] Fix | Delete
$fields['time_limit'] = array(
[405] Fix | Delete
'label' => __( 'PHP time limit' ),
[406] Fix | Delete
'value' => ini_get( 'max_execution_time' ),
[407] Fix | Delete
);
[408] Fix | Delete
[409] Fix | Delete
if ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) {
[410] Fix | Delete
$fields['memory_limit'] = array(
[411] Fix | Delete
'label' => __( 'PHP memory limit' ),
[412] Fix | Delete
'value' => WP_Site_Health::get_instance()->php_memory_limit,
[413] Fix | Delete
);
[414] Fix | Delete
$fields['admin_memory_limit'] = array(
[415] Fix | Delete
'label' => __( 'PHP memory limit (only for admin screens)' ),
[416] Fix | Delete
'value' => ini_get( 'memory_limit' ),
[417] Fix | Delete
);
[418] Fix | Delete
} else {
[419] Fix | Delete
$fields['memory_limit'] = array(
[420] Fix | Delete
'label' => __( 'PHP memory limit' ),
[421] Fix | Delete
'value' => ini_get( 'memory_limit' ),
[422] Fix | Delete
);
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
$fields['max_input_time'] = array(
[426] Fix | Delete
'label' => __( 'Max input time' ),
[427] Fix | Delete
'value' => ini_get( 'max_input_time' ),
[428] Fix | Delete
);
[429] Fix | Delete
$fields['upload_max_filesize'] = array(
[430] Fix | Delete
'label' => __( 'Upload max filesize' ),
[431] Fix | Delete
'value' => ini_get( 'upload_max_filesize' ),
[432] Fix | Delete
);
[433] Fix | Delete
$fields['php_post_max_size'] = array(
[434] Fix | Delete
'label' => __( 'PHP post max size' ),
[435] Fix | Delete
'value' => ini_get( 'post_max_size' ),
[436] Fix | Delete
);
[437] Fix | Delete
}
[438] Fix | Delete
[439] Fix | Delete
if ( function_exists( 'curl_version' ) ) {
[440] Fix | Delete
$curl = curl_version();
[441] Fix | Delete
[442] Fix | Delete
$fields['curl_version'] = array(
[443] Fix | Delete
'label' => __( 'cURL version' ),
[444] Fix | Delete
'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ),
[445] Fix | Delete
);
[446] Fix | Delete
} else {
[447] Fix | Delete
$fields['curl_version'] = array(
[448] Fix | Delete
'label' => __( 'cURL version' ),
[449] Fix | Delete
'value' => __( 'Not available' ),
[450] Fix | Delete
'debug' => 'not available',
[451] Fix | Delete
);
[452] Fix | Delete
}
[453] Fix | Delete
[454] Fix | Delete
// SUHOSIN.
[455] Fix | Delete
$suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) );
[456] Fix | Delete
[457] Fix | Delete
$fields['suhosin'] = array(
[458] Fix | Delete
'label' => __( 'Is SUHOSIN installed?' ),
[459] Fix | Delete
'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ),
[460] Fix | Delete
'debug' => $suhosin_loaded,
[461] Fix | Delete
);
[462] Fix | Delete
[463] Fix | Delete
// Imagick.
[464] Fix | Delete
$imagick_loaded = extension_loaded( 'imagick' );
[465] Fix | Delete
[466] Fix | Delete
$fields['imagick_availability'] = array(
[467] Fix | Delete
'label' => __( 'Is the Imagick library available?' ),
[468] Fix | Delete
'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ),
[469] Fix | Delete
'debug' => $imagick_loaded,
[470] Fix | Delete
);
[471] Fix | Delete
[472] Fix | Delete
// Pretty permalinks.
[473] Fix | Delete
$pretty_permalinks_supported = got_url_rewrite();
[474] Fix | Delete
[475] Fix | Delete
$fields['pretty_permalinks'] = array(
[476] Fix | Delete
'label' => __( 'Are pretty permalinks supported?' ),
[477] Fix | Delete
'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ),
[478] Fix | Delete
'debug' => $pretty_permalinks_supported,
[479] Fix | Delete
);
[480] Fix | Delete
[481] Fix | Delete
// Check if a .htaccess file exists.
[482] Fix | Delete
if ( is_file( ABSPATH . '.htaccess' ) ) {
[483] Fix | Delete
// If the file exists, grab the content of it.
[484] Fix | Delete
$htaccess_content = file_get_contents( ABSPATH . '.htaccess' );
[485] Fix | Delete
[486] Fix | Delete
// Filter away the core WordPress rules.
[487] Fix | Delete
$filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) );
[488] Fix | Delete
$filtered_htaccess_content = ! empty( $filtered_htaccess_content );
[489] Fix | Delete
[490] Fix | Delete
if ( $filtered_htaccess_content ) {
[491] Fix | Delete
/* translators: %s: .htaccess */
[492] Fix | Delete
$htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' );
[493] Fix | Delete
} else {
[494] Fix | Delete
/* translators: %s: .htaccess */
[495] Fix | Delete
$htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' );
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
$fields['htaccess_extra_rules'] = array(
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function