Site Health: Add missing actions to tests.

This change adds missing actions for several tests. This ensures that the user is provided with a next step, whenever possible.

Also, change the URL displayed in the WordPress.org communication test description to `api.wordpress.org` for accuracy.

Props: garrett-eclipse, Clorith, vaishalipanchal.
Fixes #46734.
Built from https://develop.svn.wordpress.org/trunk@45170


git-svn-id: http://core.svn.wordpress.org/trunk@44979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-04-12 17:40:53 +00:00
parent 5bafb4ea2d
commit 6afe73667c
6 changed files with 82 additions and 25 deletions

View File

@ -363,6 +363,10 @@
display: none;
}
.health-check-accordion-panel a .dashicons {
text-decoration: none;
}
/* Better position for the WordPress admin notices and update nag. */
.site-health .notice {
margin: 5px 22px 15px 20px;

File diff suppressed because one or more lines are too long

View File

@ -363,6 +363,10 @@
display: none;
}
.health-check-accordion-panel a .dashicons {
text-decoration: none;
}
/* Better position for the WordPress admin notices and update nag. */
.site-health .notice {
margin: 5px 20px 15px 22px;

File diff suppressed because one or more lines are too long

View File

@ -289,7 +289,11 @@ class WP_Site_Health {
'<p>%s</p>',
__( 'Plugins extend your site&#8217;s functionality with things like contact forms, ecommerce and much more. That means they have deep access to your site, so it&#8217;s vital to keep them up to date.' )
),
'actions' => '',
'actions' => sprintf(
'<p><a href="%s">%s</a></p>',
esc_url( admin_url( 'plugins.php' ) ),
__( 'Manage your plugins' )
),
'test' => 'plugin_version',
);
@ -335,6 +339,12 @@ class WP_Site_Health {
$plugins_need_update
)
);
$result['actions'] .= sprintf(
'<p><a href="%s">%s</a></p>',
esc_url( admin_url( 'plugins.php?plugin_status=upgrade' ) ),
__( 'Update your plugins' )
);
} else {
if ( 1 === $plugins_active ) {
$result['description'] .= sprintf(
@ -378,6 +388,12 @@ class WP_Site_Health {
),
__( 'Inactive plugins are tempting targets for attackers. If you&#8217;re not going to use a plugin, we recommend you remove it.' )
);
$result['actions'] .= sprintf(
'<p><a href="%s">%s</a></p>',
esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ),
__( 'Manage inactive plugins' )
);
}
return $result;
@ -405,7 +421,11 @@ class WP_Site_Health {
'<p>%s</p>',
__( 'Themes add your site&#8217;s look and feel. It&#8217;s important to keep them up to date, to stay consistent with your brand and keep your site secure.' )
),
'actions' => '',
'actions' => sprintf(
'<p><a href="%s">%s</a></p>',
esc_url( admin_url( 'themes.php' ) ),
__( 'Manage your themes' )
),
'test' => 'theme_version',
);
@ -627,10 +647,10 @@ class WP_Site_Health {
),
'description' => sprintf(
'<p>%s</p>',
__( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your sites performance.' )
__( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.' )
),
'actions' => sprintf(
'<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
esc_url( wp_get_update_php_url() ),
__( 'Learn more about updating PHP' ),
/* translators: accessibility text */
@ -716,12 +736,18 @@ class WP_Site_Health {
),
'description' => sprintf(
'<p>%s</p><p>%s</p>',
__( 'PHP modules perform most of the tasks on the server that make your site run.' ),
__( 'PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.' ),
sprintf(
/* translators: %s: Link to the hosting group page about recommended PHP modules. */
__( 'The Hosting team maintains a list of those modules, both recommended and required, in <a href="%s">the team handbook</a>.' ),
/* translators: The address to describe PHP modules and their use. */
esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) )
__( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in %s.' ),
sprintf(
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
/* translators: Localized team handbook, if one exists. */
esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),
__( 'the team handbook' ),
/* translators: accessibility text */
__( '(opens in a new tab)' )
)
)
),
'actions' => '',
@ -912,9 +938,16 @@ class WP_Site_Health {
),
'description' => sprintf(
'<p>%s</p>',
__( 'The SQL server is the database where WordPress stores all your sites content and settings' )
__( 'The SQL server is a required piece of software for the database WordPress uses to store all your site&#8217;s content and settings.' )
),
'actions' => sprintf(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
/* translators: Localized version of WordPress requirements if one exists. */
esc_url( __( 'https://wordpress.org/about/requirements/' ) ),
__( 'Read more about what WordPress requires to run.' ),
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'actions' => '',
'test' => 'sql_server',
);
@ -1008,7 +1041,7 @@ class WP_Site_Health {
'<p>%s</p>',
sprintf(
/* translators: %s: Version number. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater.' ),
__( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater. Please contact your server administrator.' ),
'5.5.3'
)
);
@ -1028,7 +1061,7 @@ class WP_Site_Health {
'<p>%s</p>',
sprintf(
/* translators: %s: Version number. */
__( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater.' ),
__( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater. Please contact your server administrator.' ),
'5.5.0'
)
);
@ -1063,7 +1096,7 @@ class WP_Site_Health {
'<p>%s</p>',
sprintf(
/* translators: 1: Name of the library, 2: Number of version. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer.' ),
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
'mysqlnd',
'5.0.9'
)
@ -1079,7 +1112,7 @@ class WP_Site_Health {
'<p>%s</p>',
sprintf(
/* translators: 1: Name of the library, 2: Number of version. */
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer.' ),
__( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
'libmysql',
'5.5.3'
)
@ -1134,11 +1167,20 @@ class WP_Site_Health {
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( 'wordpress.org' ),
gethostbyname( 'api.wordpress.org' ),
$wp_dotorg->get_error_message()
)
)
);
$result['actions'] = sprintf(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%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' ) ),
__( 'Get help resolving this issue.' ),
/* translators: accessibility text */
__( '(opens in a new tab)' )
);
}
return $result;
@ -1169,7 +1211,14 @@ class WP_Site_Health {
'<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' => '',
'actions' => sprintf(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%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://wordpress.org/support/article/debugging-in-wordpress/' ) ),
__( 'Read about debugging in WordPress.' ),
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'test' => 'is_in_debug_mode',
);
@ -1232,12 +1281,12 @@ class WP_Site_Health {
__( 'An HTTPS connection is needed for many features on the web today, it also gains the trust of your visitors by helping to protecting their online privacy.' )
),
'actions' => sprintf(
'<p><a href="%s">%s</a></p>',
esc_url(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
/* translators: Documentation explaining HTTPS and why it should be used. */
__( 'https://wordpress.org/support/article/why-should-i-use-https/' )
),
__( 'Read more about why you should use HTTPS' )
esc_url( __( 'https://wordpress.org/support/article/why-should-i-use-https/' ) ),
__( 'Read more about why you should use HTTPS' ),
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'test' => 'https_status',
);

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta2-45169';
$wp_version = '5.2-beta2-45170';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.