Tests if the database server is capable of using utf8mb4.
Source
public function get_test_dotorg_communication() {
$result = array(
'label' => __( 'Can communicate with WordPress.org' ),
'status' => '',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'Communicating with the WordPress servers is used to check for new versions, and to both install and update WordPress core, themes or plugins.' )
),
'actions' => '',
'test' => 'dotorg_communication',
);
$wp_dotorg = wp_remote_get(
'https://api.wordpress.org',
array(
'timeout' => 10,
)
);
if ( ! is_wp_error( $wp_dotorg ) ) {
$result['status'] = 'good';
} else {
$result['status'] = 'critical';
$result['label'] = __( 'Could not reach WordPress.org' );
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
'<span class="error"><span class="screen-reader-text">%s</span></span> %s',
/* translators: Hidden accessibility text. */
__( 'Error' ),
sprintf(
/* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */
__( 'Your site is unable to reach WordPress.org at %1$s, and returned the error: %2$s' ),
gethostbyname( 'api.wordpress.org' ),
$wp_dotorg->get_error_message()
)
)
);
$result['actions'] = sprintf(
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
/* translators: Localized Support reference. */
esc_url( __( 'https://wordpress.org/support/forums/' ) ),
__( 'Get help resolving this issue.' ),
/* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
);
}
return $result;
}
/**
* Tests if debug information is enabled.
*
* When WP_DEBUG is enabled, errors and information may be disclosed to site visitors,
* or logged to a publicly accessible file.
*
* Debugging is also frequently left enabled after looking for errors on a site,
* as site owners do not understand the implications of this.
*
* @since 5.2.0
*
* @return array The test results.
*/
public function get_test_is_in_debug_mode() {
$result = array(
'label' => __( 'Your site is not set to output debug information' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' )
),
'actions' => sprintf(
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
/* translators: Documentation explaining debugging in WordPress. */
esc_url( __( 'https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/' ) ),
__( 'Learn more about debugging in WordPress.' ),
/* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
),
'test' => 'is_in_debug_mode',
);
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
$result['label'] = __( 'Your site is set to log errors to a potentially public file' );
$result['status'] = str_starts_with( ini_get( 'error_log' ), ABSPATH ) ? 'critical' : 'recommended';
$result['description'] .= sprintf(
'<p>%s</p>',
sprintf(
/* translators: %s: WP_DEBUG_LOG */
__( 'The value, %s, has been added to this website’s configuration file. This means any errors on the site will be written to a file which is potentially available to all users.' ),
'<code>WP_DEBUG_LOG</code>'
)
Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.