/* translators: %s: Meetup organization documentation URL. */
__( 'There are no events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?' ),
__( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
* 'WordPress Events and News' dashboard widget.
* @since 4.8.0 Removed popular plugins feed.
function wp_dashboard_primary() {
* Filters the primary link URL for the 'WordPress Events and News' dashboard widget.
* @param string $link The widget's primary link URL.
'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
* Filters the primary feed URL for the 'WordPress Events and News' dashboard widget.
* @param string $url The widget's primary feed URL.
'url' => apply_filters( 'dashboard_primary_feed', __( 'https://wordpress.org/news/feed/' ) ),
* Filters the primary link title for the 'WordPress Events and News' dashboard widget.
* @param string $title Title attribute for the widget's primary link.
'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
* Filters the secondary link URL for the 'WordPress Events and News' dashboard widget.
* @param string $link The widget's secondary link URL.
'dashboard_secondary_link',
/* translators: Link to the Planet website of the locale. */
__( 'https://planet.wordpress.org/' )
* Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget.
* @param string $url The widget's secondary feed URL.
'dashboard_secondary_feed',
/* translators: Link to the Planet feed of the locale. */
__( 'https://planet.wordpress.org/feed/' )
* Filters the secondary link title for the 'WordPress Events and News' dashboard widget.
* @param string $title Title attribute for the widget's secondary link.
'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
* Filters the number of secondary link items for the 'WordPress Events and News' dashboard widget.
* @param string $items How many items to show in the secondary feed.
'items' => apply_filters( 'dashboard_secondary_items', 3 ),
wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
* Displays the WordPress events and news feeds.
* @since 4.8.0 Removed popular plugins feed.
* @param string $widget_id Widget ID.
* @param array $feeds Array of RSS feeds.
function wp_dashboard_primary_output( $widget_id, $feeds ) {
foreach ( $feeds as $type => $args ) {
echo '<div class="rss-widget">';
wp_widget_rss_output( $args['url'], $args );
* Displays file upload quota on dashboard.
* Runs on the {@see 'activity_box_end'} hook in wp_dashboard_right_now().
* @return true|void True if not multisite, user can't upload files, or the space check option is disabled.
function wp_dashboard_quota() {
if ( ! is_multisite() || ! current_user_can( 'upload_files' )
|| get_site_option( 'upload_space_check_disabled' )
$quota = get_space_allowed();
$used = get_space_used();
$percentused = ( $used / $quota ) * 100;
$used_class = ( $percentused >= 70 ) ? ' warning' : '';
$used = round( $used, 2 );
$percentused = number_format( $percentused );
<h3 class="mu-storage"><?php _e( 'Storage Space' ); ?></h3>
<li class="storage-count">
/* translators: %s: Number of megabytes. */
__( '%s MB Space Allowed' ),
number_format_i18n( $quota )
'<a href="%1$s">%2$s<span class="screen-reader-text"> (%3$s)</span></a>',
esc_url( admin_url( 'upload.php' ) ),
/* translators: Hidden accessibility text. */
</li><li class="storage-count <?php echo $used_class; ?>">
/* translators: 1: Number of megabytes, 2: Percentage. */
__( '%1$s MB (%2$s%%) Space Used' ),
number_format_i18n( $used, 2 ),
'<a href="%1$s" class="musublink">%2$s<span class="screen-reader-text"> (%3$s)</span></a>',
esc_url( admin_url( 'upload.php' ) ),
/* translators: Hidden accessibility text. */
* Displays the browser update nag.
* @since 5.8.0 Added a special message for Internet Explorer users.
function wp_dashboard_browser_nag() {
$response = wp_check_browser_version();
$msg = __( 'Internet Explorer does not give you the best WordPress experience. Switch to Microsoft Edge, or another more modern browser to get the most from your site.' );
} elseif ( $response['insecure'] ) {
/* translators: %s: Browser name and link. */
__( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
/* translators: %s: Browser name and link. */
__( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
if ( ! empty( $response['img_src'] ) ) {
$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];
$notice .= '<div class="alignright browser-icon"><img src="' . esc_url( $img_src ) . '" alt="" /></div>';
$browser_nag_class = ' has-browser-icon';
$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";
$browsehappy = 'https://browsehappy.com/';
$locale = get_user_locale();
if ( 'en_US' !== $locale ) {
$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
$msg_browsehappy = sprintf(
/* translators: %s: Browse Happy URL. */
__( 'Learn how to <a href="%s" class="update-browser-link">browse happy</a>' ),
$msg_browsehappy = sprintf(
/* translators: 1: Browser update URL, 2: Browser name, 3: Browse Happy URL. */
__( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ),
esc_attr( $response['update_url'] ),
esc_html( $response['name'] ),
$notice .= '<p>' . $msg_browsehappy . '</p>';
$notice .= '<p class="hide-if-no-js"><a href="" class="dismiss" aria-label="' . esc_attr__( 'Dismiss the browser warning panel' ) . '">' . __( 'Dismiss' ) . '</a></p>';
$notice .= '<div class="clear"></div>';
* Filters the notice output for the 'Browse Happy' nag meta box.
* @param string $notice The notice content.
* @param array|false $response An array containing web browser information, or
* false on failure. See wp_check_browser_version().
echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
* Adds an additional class to the browser nag if the current version is insecure.
* @param string[] $classes Array of meta box classes.
* @return string[] Modified array of meta box classes.
function dashboard_browser_nag_class( $classes ) {
$response = wp_check_browser_version();
if ( $response && $response['insecure'] ) {
$classes[] = 'browser-insecure';
* Checks if the user needs a browser update.
* @return array|false Array of browser data on success, false on failure.
function wp_check_browser_version() {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
$key = md5( $_SERVER['HTTP_USER_AGENT'] );
$response = get_site_transient( 'browser_' . $key );
if ( false === $response ) {
$url = 'http://api.wordpress.org/core/browse-happy/1.1/';
'body' => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),
'user-agent' => 'WordPress/' . wp_get_wp_version() . '; ' . home_url( '/' ),
if ( wp_http_supports( array( 'ssl' ) ) ) {
$url = set_url_scheme( $url, 'https' );
$response = wp_remote_post( $url, $options );
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
* Response should be an array with:
* 'platform' - string - A user-friendly platform name, if it can be determined
* 'name' - string - A user-friendly browser name
* 'version' - string - The version of the browser the user is using
* 'current_version' - string - The most recent version of the browser
* 'upgrade' - boolean - Whether the browser needs an upgrade
* 'insecure' - boolean - Whether the browser is deemed insecure
* 'update_url' - string - The url to visit to upgrade
* 'img_src' - string - An image representing the browser
* 'img_src_ssl' - string - An image (over SSL) representing the browser
$response = json_decode( wp_remote_retrieve_body( $response ), true );
if ( ! is_array( $response ) ) {
set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );
* Displays the PHP update nag.
function wp_dashboard_php_nag() {
$response = wp_check_php_version();
if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
// The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
if ( $response['is_lower_than_future_minimum'] ) {
/* translators: %s: The server PHP version. */
__( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.' ),
/* translators: %s: The server PHP version. */
__( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.' ),
} elseif ( $response['is_lower_than_future_minimum'] ) {
/* translators: %s: The server PHP version. */
__( 'Your site is running on an outdated version of PHP (%s), which soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.' ),
/* translators: %s: The server PHP version. */
__( 'Your site is running on an outdated version of PHP (%s), which should be updated.' ),
<p class="bigger-bolder-text"><?php echo $message; ?></p>
<p><?php _e( 'What is PHP and how does it affect my site?' ); ?></p>
<?php _e( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site’s performance.' ); ?>
if ( ! empty( $response['recommended_version'] ) ) {
/* translators: %s: The minimum recommended PHP version. */
__( 'The minimum recommended version of PHP is %s.' ),
$response['recommended_version']
<p class="button-container">
'<a class="button button-primary" href="%1$s" target="_blank">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
esc_url( wp_get_update_php_url() ),
__( 'Learn more about updating PHP' ),
/* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
wp_update_php_annotation();
wp_direct_php_update_button();
* Adds an additional class to the PHP nag if the current version is insecure.
* @param string[] $classes Array of meta box classes.
* @return string[] Modified array of meta box classes.
function dashboard_php_nag_class( $classes ) {
$response = wp_check_php_version();
if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
$classes[] = 'php-no-security-updates';
} elseif ( $response['is_lower_than_future_minimum'] ) {
$classes[] = 'php-version-lower-than-future-minimum';
* Displays the Site Health Status widget.
function wp_dashboard_site_health() {
$get_issues = get_transient( 'health-check-site-status-result' );
if ( false !== $get_issues ) {
$issue_counts = json_decode( $get_issues, true );
if ( ! is_array( $issue_counts ) || ! $issue_counts ) {
$issues_total = $issue_counts['recommended'] + $issue_counts['critical'];
<div class="health-check-widget">
<div class="health-check-widget-title-section site-health-progress-wrapper loading hide-if-no-js">
<div class="site-health-progress">
<svg aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
<div class="site-health-progress-label">
<?php if ( false === $get_issues ) : ?>
<?php _e( 'No information yet…' ); ?>
<?php _e( 'Results are still loading…' ); ?>
<div class="site-health-details">
<?php if ( false === $get_issues ) : ?>
/* translators: %s: URL to Site Health screen. */
__( 'Site health checks will automatically run periodically to gather information about your site. You can also <a href="%s">visit the Site Health screen</a> to gather information about your site now.' ),