Edit File by line
/home/zeestwma/ajeebong.../wp-admin/includes
File: dashboard.php
?>
[1500] Fix | Delete
[1501] Fix | Delete
<# } else { #>
[1502] Fix | Delete
<?php
[1503] Fix | Delete
printf(
[1504] Fix | Delete
/* translators: %s: Meetup organization documentation URL. */
[1505] Fix | Delete
__( 'There are no events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?' ),
[1506] Fix | Delete
__( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
[1507] Fix | Delete
);
[1508] Fix | Delete
?>
[1509] Fix | Delete
<# } #>
[1510] Fix | Delete
</li>
[1511] Fix | Delete
</script>
[1512] Fix | Delete
<?php
[1513] Fix | Delete
}
[1514] Fix | Delete
[1515] Fix | Delete
/**
[1516] Fix | Delete
* 'WordPress Events and News' dashboard widget.
[1517] Fix | Delete
*
[1518] Fix | Delete
* @since 2.7.0
[1519] Fix | Delete
* @since 4.8.0 Removed popular plugins feed.
[1520] Fix | Delete
*/
[1521] Fix | Delete
function wp_dashboard_primary() {
[1522] Fix | Delete
$feeds = array(
[1523] Fix | Delete
'news' => array(
[1524] Fix | Delete
[1525] Fix | Delete
/**
[1526] Fix | Delete
* Filters the primary link URL for the 'WordPress Events and News' dashboard widget.
[1527] Fix | Delete
*
[1528] Fix | Delete
* @since 2.5.0
[1529] Fix | Delete
*
[1530] Fix | Delete
* @param string $link The widget's primary link URL.
[1531] Fix | Delete
*/
[1532] Fix | Delete
'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
[1533] Fix | Delete
[1534] Fix | Delete
/**
[1535] Fix | Delete
* Filters the primary feed URL for the 'WordPress Events and News' dashboard widget.
[1536] Fix | Delete
*
[1537] Fix | Delete
* @since 2.3.0
[1538] Fix | Delete
*
[1539] Fix | Delete
* @param string $url The widget's primary feed URL.
[1540] Fix | Delete
*/
[1541] Fix | Delete
'url' => apply_filters( 'dashboard_primary_feed', __( 'https://wordpress.org/news/feed/' ) ),
[1542] Fix | Delete
[1543] Fix | Delete
/**
[1544] Fix | Delete
* Filters the primary link title for the 'WordPress Events and News' dashboard widget.
[1545] Fix | Delete
*
[1546] Fix | Delete
* @since 2.3.0
[1547] Fix | Delete
*
[1548] Fix | Delete
* @param string $title Title attribute for the widget's primary link.
[1549] Fix | Delete
*/
[1550] Fix | Delete
'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
[1551] Fix | Delete
'items' => 2,
[1552] Fix | Delete
'show_summary' => 0,
[1553] Fix | Delete
'show_author' => 0,
[1554] Fix | Delete
'show_date' => 0,
[1555] Fix | Delete
),
[1556] Fix | Delete
'planet' => array(
[1557] Fix | Delete
[1558] Fix | Delete
/**
[1559] Fix | Delete
* Filters the secondary link URL for the 'WordPress Events and News' dashboard widget.
[1560] Fix | Delete
*
[1561] Fix | Delete
* @since 2.3.0
[1562] Fix | Delete
*
[1563] Fix | Delete
* @param string $link The widget's secondary link URL.
[1564] Fix | Delete
*/
[1565] Fix | Delete
'link' => apply_filters(
[1566] Fix | Delete
'dashboard_secondary_link',
[1567] Fix | Delete
/* translators: Link to the Planet website of the locale. */
[1568] Fix | Delete
__( 'https://planet.wordpress.org/' )
[1569] Fix | Delete
),
[1570] Fix | Delete
[1571] Fix | Delete
/**
[1572] Fix | Delete
* Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget.
[1573] Fix | Delete
*
[1574] Fix | Delete
* @since 2.3.0
[1575] Fix | Delete
*
[1576] Fix | Delete
* @param string $url The widget's secondary feed URL.
[1577] Fix | Delete
*/
[1578] Fix | Delete
'url' => apply_filters(
[1579] Fix | Delete
'dashboard_secondary_feed',
[1580] Fix | Delete
/* translators: Link to the Planet feed of the locale. */
[1581] Fix | Delete
__( 'https://planet.wordpress.org/feed/' )
[1582] Fix | Delete
),
[1583] Fix | Delete
[1584] Fix | Delete
/**
[1585] Fix | Delete
* Filters the secondary link title for the 'WordPress Events and News' dashboard widget.
[1586] Fix | Delete
*
[1587] Fix | Delete
* @since 2.3.0
[1588] Fix | Delete
*
[1589] Fix | Delete
* @param string $title Title attribute for the widget's secondary link.
[1590] Fix | Delete
*/
[1591] Fix | Delete
'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
[1592] Fix | Delete
[1593] Fix | Delete
/**
[1594] Fix | Delete
* Filters the number of secondary link items for the 'WordPress Events and News' dashboard widget.
[1595] Fix | Delete
*
[1596] Fix | Delete
* @since 4.4.0
[1597] Fix | Delete
*
[1598] Fix | Delete
* @param string $items How many items to show in the secondary feed.
[1599] Fix | Delete
*/
[1600] Fix | Delete
'items' => apply_filters( 'dashboard_secondary_items', 3 ),
[1601] Fix | Delete
'show_summary' => 0,
[1602] Fix | Delete
'show_author' => 0,
[1603] Fix | Delete
'show_date' => 0,
[1604] Fix | Delete
),
[1605] Fix | Delete
);
[1606] Fix | Delete
[1607] Fix | Delete
wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
[1608] Fix | Delete
}
[1609] Fix | Delete
[1610] Fix | Delete
/**
[1611] Fix | Delete
* Displays the WordPress events and news feeds.
[1612] Fix | Delete
*
[1613] Fix | Delete
* @since 3.8.0
[1614] Fix | Delete
* @since 4.8.0 Removed popular plugins feed.
[1615] Fix | Delete
*
[1616] Fix | Delete
* @param string $widget_id Widget ID.
[1617] Fix | Delete
* @param array $feeds Array of RSS feeds.
[1618] Fix | Delete
*/
[1619] Fix | Delete
function wp_dashboard_primary_output( $widget_id, $feeds ) {
[1620] Fix | Delete
foreach ( $feeds as $type => $args ) {
[1621] Fix | Delete
$args['type'] = $type;
[1622] Fix | Delete
echo '<div class="rss-widget">';
[1623] Fix | Delete
wp_widget_rss_output( $args['url'], $args );
[1624] Fix | Delete
echo '</div>';
[1625] Fix | Delete
}
[1626] Fix | Delete
}
[1627] Fix | Delete
[1628] Fix | Delete
/**
[1629] Fix | Delete
* Displays file upload quota on dashboard.
[1630] Fix | Delete
*
[1631] Fix | Delete
* Runs on the {@see 'activity_box_end'} hook in wp_dashboard_right_now().
[1632] Fix | Delete
*
[1633] Fix | Delete
* @since 3.0.0
[1634] Fix | Delete
*
[1635] Fix | Delete
* @return true|void True if not multisite, user can't upload files, or the space check option is disabled.
[1636] Fix | Delete
*/
[1637] Fix | Delete
function wp_dashboard_quota() {
[1638] Fix | Delete
if ( ! is_multisite() || ! current_user_can( 'upload_files' )
[1639] Fix | Delete
|| get_site_option( 'upload_space_check_disabled' )
[1640] Fix | Delete
) {
[1641] Fix | Delete
return true;
[1642] Fix | Delete
}
[1643] Fix | Delete
[1644] Fix | Delete
$quota = get_space_allowed();
[1645] Fix | Delete
$used = get_space_used();
[1646] Fix | Delete
[1647] Fix | Delete
if ( $used > $quota ) {
[1648] Fix | Delete
$percentused = '100';
[1649] Fix | Delete
} else {
[1650] Fix | Delete
$percentused = ( $used / $quota ) * 100;
[1651] Fix | Delete
}
[1652] Fix | Delete
[1653] Fix | Delete
$used_class = ( $percentused >= 70 ) ? ' warning' : '';
[1654] Fix | Delete
$used = round( $used, 2 );
[1655] Fix | Delete
$percentused = number_format( $percentused );
[1656] Fix | Delete
[1657] Fix | Delete
?>
[1658] Fix | Delete
<h3 class="mu-storage"><?php _e( 'Storage Space' ); ?></h3>
[1659] Fix | Delete
<div class="mu-storage">
[1660] Fix | Delete
<ul>
[1661] Fix | Delete
<li class="storage-count">
[1662] Fix | Delete
<?php
[1663] Fix | Delete
$text = sprintf(
[1664] Fix | Delete
/* translators: %s: Number of megabytes. */
[1665] Fix | Delete
__( '%s MB Space Allowed' ),
[1666] Fix | Delete
number_format_i18n( $quota )
[1667] Fix | Delete
);
[1668] Fix | Delete
printf(
[1669] Fix | Delete
'<a href="%1$s">%2$s<span class="screen-reader-text"> (%3$s)</span></a>',
[1670] Fix | Delete
esc_url( admin_url( 'upload.php' ) ),
[1671] Fix | Delete
$text,
[1672] Fix | Delete
/* translators: Hidden accessibility text. */
[1673] Fix | Delete
__( 'Manage Uploads' )
[1674] Fix | Delete
);
[1675] Fix | Delete
?>
[1676] Fix | Delete
</li><li class="storage-count <?php echo $used_class; ?>">
[1677] Fix | Delete
<?php
[1678] Fix | Delete
$text = sprintf(
[1679] Fix | Delete
/* translators: 1: Number of megabytes, 2: Percentage. */
[1680] Fix | Delete
__( '%1$s MB (%2$s%%) Space Used' ),
[1681] Fix | Delete
number_format_i18n( $used, 2 ),
[1682] Fix | Delete
$percentused
[1683] Fix | Delete
);
[1684] Fix | Delete
printf(
[1685] Fix | Delete
'<a href="%1$s" class="musublink">%2$s<span class="screen-reader-text"> (%3$s)</span></a>',
[1686] Fix | Delete
esc_url( admin_url( 'upload.php' ) ),
[1687] Fix | Delete
$text,
[1688] Fix | Delete
/* translators: Hidden accessibility text. */
[1689] Fix | Delete
__( 'Manage Uploads' )
[1690] Fix | Delete
);
[1691] Fix | Delete
?>
[1692] Fix | Delete
</li>
[1693] Fix | Delete
</ul>
[1694] Fix | Delete
</div>
[1695] Fix | Delete
<?php
[1696] Fix | Delete
}
[1697] Fix | Delete
[1698] Fix | Delete
/**
[1699] Fix | Delete
* Displays the browser update nag.
[1700] Fix | Delete
*
[1701] Fix | Delete
* @since 3.2.0
[1702] Fix | Delete
* @since 5.8.0 Added a special message for Internet Explorer users.
[1703] Fix | Delete
*
[1704] Fix | Delete
* @global bool $is_IE
[1705] Fix | Delete
*/
[1706] Fix | Delete
function wp_dashboard_browser_nag() {
[1707] Fix | Delete
global $is_IE;
[1708] Fix | Delete
[1709] Fix | Delete
$notice = '';
[1710] Fix | Delete
$response = wp_check_browser_version();
[1711] Fix | Delete
[1712] Fix | Delete
if ( $response ) {
[1713] Fix | Delete
if ( $is_IE ) {
[1714] Fix | Delete
$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.' );
[1715] Fix | Delete
} elseif ( $response['insecure'] ) {
[1716] Fix | Delete
$msg = sprintf(
[1717] Fix | Delete
/* translators: %s: Browser name and link. */
[1718] Fix | Delete
__( "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." ),
[1719] Fix | Delete
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
[1720] Fix | Delete
);
[1721] Fix | Delete
} else {
[1722] Fix | Delete
$msg = sprintf(
[1723] Fix | Delete
/* translators: %s: Browser name and link. */
[1724] Fix | Delete
__( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
[1725] Fix | Delete
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
[1726] Fix | Delete
);
[1727] Fix | Delete
}
[1728] Fix | Delete
[1729] Fix | Delete
$browser_nag_class = '';
[1730] Fix | Delete
if ( ! empty( $response['img_src'] ) ) {
[1731] Fix | Delete
$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];
[1732] Fix | Delete
[1733] Fix | Delete
$notice .= '<div class="alignright browser-icon"><img src="' . esc_url( $img_src ) . '" alt="" /></div>';
[1734] Fix | Delete
$browser_nag_class = ' has-browser-icon';
[1735] Fix | Delete
}
[1736] Fix | Delete
$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";
[1737] Fix | Delete
[1738] Fix | Delete
$browsehappy = 'https://browsehappy.com/';
[1739] Fix | Delete
$locale = get_user_locale();
[1740] Fix | Delete
if ( 'en_US' !== $locale ) {
[1741] Fix | Delete
$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
[1742] Fix | Delete
}
[1743] Fix | Delete
[1744] Fix | Delete
if ( $is_IE ) {
[1745] Fix | Delete
$msg_browsehappy = sprintf(
[1746] Fix | Delete
/* translators: %s: Browse Happy URL. */
[1747] Fix | Delete
__( 'Learn how to <a href="%s" class="update-browser-link">browse happy</a>' ),
[1748] Fix | Delete
esc_url( $browsehappy )
[1749] Fix | Delete
);
[1750] Fix | Delete
} else {
[1751] Fix | Delete
$msg_browsehappy = sprintf(
[1752] Fix | Delete
/* translators: 1: Browser update URL, 2: Browser name, 3: Browse Happy URL. */
[1753] Fix | Delete
__( '<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>' ),
[1754] Fix | Delete
esc_attr( $response['update_url'] ),
[1755] Fix | Delete
esc_html( $response['name'] ),
[1756] Fix | Delete
esc_url( $browsehappy )
[1757] Fix | Delete
);
[1758] Fix | Delete
}
[1759] Fix | Delete
[1760] Fix | Delete
$notice .= '<p>' . $msg_browsehappy . '</p>';
[1761] Fix | Delete
$notice .= '<p class="hide-if-no-js"><a href="" class="dismiss" aria-label="' . esc_attr__( 'Dismiss the browser warning panel' ) . '">' . __( 'Dismiss' ) . '</a></p>';
[1762] Fix | Delete
$notice .= '<div class="clear"></div>';
[1763] Fix | Delete
}
[1764] Fix | Delete
[1765] Fix | Delete
/**
[1766] Fix | Delete
* Filters the notice output for the 'Browse Happy' nag meta box.
[1767] Fix | Delete
*
[1768] Fix | Delete
* @since 3.2.0
[1769] Fix | Delete
*
[1770] Fix | Delete
* @param string $notice The notice content.
[1771] Fix | Delete
* @param array|false $response An array containing web browser information, or
[1772] Fix | Delete
* false on failure. See wp_check_browser_version().
[1773] Fix | Delete
*/
[1774] Fix | Delete
echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[1775] Fix | Delete
}
[1776] Fix | Delete
[1777] Fix | Delete
/**
[1778] Fix | Delete
* Adds an additional class to the browser nag if the current version is insecure.
[1779] Fix | Delete
*
[1780] Fix | Delete
* @since 3.2.0
[1781] Fix | Delete
*
[1782] Fix | Delete
* @param string[] $classes Array of meta box classes.
[1783] Fix | Delete
* @return string[] Modified array of meta box classes.
[1784] Fix | Delete
*/
[1785] Fix | Delete
function dashboard_browser_nag_class( $classes ) {
[1786] Fix | Delete
$response = wp_check_browser_version();
[1787] Fix | Delete
[1788] Fix | Delete
if ( $response && $response['insecure'] ) {
[1789] Fix | Delete
$classes[] = 'browser-insecure';
[1790] Fix | Delete
}
[1791] Fix | Delete
[1792] Fix | Delete
return $classes;
[1793] Fix | Delete
}
[1794] Fix | Delete
[1795] Fix | Delete
/**
[1796] Fix | Delete
* Checks if the user needs a browser update.
[1797] Fix | Delete
*
[1798] Fix | Delete
* @since 3.2.0
[1799] Fix | Delete
*
[1800] Fix | Delete
* @return array|false Array of browser data on success, false on failure.
[1801] Fix | Delete
*/
[1802] Fix | Delete
function wp_check_browser_version() {
[1803] Fix | Delete
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
[1804] Fix | Delete
return false;
[1805] Fix | Delete
}
[1806] Fix | Delete
[1807] Fix | Delete
$key = md5( $_SERVER['HTTP_USER_AGENT'] );
[1808] Fix | Delete
[1809] Fix | Delete
$response = get_site_transient( 'browser_' . $key );
[1810] Fix | Delete
[1811] Fix | Delete
if ( false === $response ) {
[1812] Fix | Delete
$url = 'http://api.wordpress.org/core/browse-happy/1.1/';
[1813] Fix | Delete
$options = array(
[1814] Fix | Delete
'body' => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),
[1815] Fix | Delete
'user-agent' => 'WordPress/' . wp_get_wp_version() . '; ' . home_url( '/' ),
[1816] Fix | Delete
);
[1817] Fix | Delete
[1818] Fix | Delete
if ( wp_http_supports( array( 'ssl' ) ) ) {
[1819] Fix | Delete
$url = set_url_scheme( $url, 'https' );
[1820] Fix | Delete
}
[1821] Fix | Delete
[1822] Fix | Delete
$response = wp_remote_post( $url, $options );
[1823] Fix | Delete
[1824] Fix | Delete
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
[1825] Fix | Delete
return false;
[1826] Fix | Delete
}
[1827] Fix | Delete
[1828] Fix | Delete
/**
[1829] Fix | Delete
* Response should be an array with:
[1830] Fix | Delete
* 'platform' - string - A user-friendly platform name, if it can be determined
[1831] Fix | Delete
* 'name' - string - A user-friendly browser name
[1832] Fix | Delete
* 'version' - string - The version of the browser the user is using
[1833] Fix | Delete
* 'current_version' - string - The most recent version of the browser
[1834] Fix | Delete
* 'upgrade' - boolean - Whether the browser needs an upgrade
[1835] Fix | Delete
* 'insecure' - boolean - Whether the browser is deemed insecure
[1836] Fix | Delete
* 'update_url' - string - The url to visit to upgrade
[1837] Fix | Delete
* 'img_src' - string - An image representing the browser
[1838] Fix | Delete
* 'img_src_ssl' - string - An image (over SSL) representing the browser
[1839] Fix | Delete
*/
[1840] Fix | Delete
$response = json_decode( wp_remote_retrieve_body( $response ), true );
[1841] Fix | Delete
[1842] Fix | Delete
if ( ! is_array( $response ) ) {
[1843] Fix | Delete
return false;
[1844] Fix | Delete
}
[1845] Fix | Delete
[1846] Fix | Delete
set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );
[1847] Fix | Delete
}
[1848] Fix | Delete
[1849] Fix | Delete
return $response;
[1850] Fix | Delete
}
[1851] Fix | Delete
[1852] Fix | Delete
/**
[1853] Fix | Delete
* Displays the PHP update nag.
[1854] Fix | Delete
*
[1855] Fix | Delete
* @since 5.1.0
[1856] Fix | Delete
*/
[1857] Fix | Delete
function wp_dashboard_php_nag() {
[1858] Fix | Delete
$response = wp_check_php_version();
[1859] Fix | Delete
[1860] Fix | Delete
if ( ! $response ) {
[1861] Fix | Delete
return;
[1862] Fix | Delete
}
[1863] Fix | Delete
[1864] Fix | Delete
if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
[1865] Fix | Delete
// The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
[1866] Fix | Delete
[1867] Fix | Delete
if ( $response['is_lower_than_future_minimum'] ) {
[1868] Fix | Delete
$message = sprintf(
[1869] Fix | Delete
/* translators: %s: The server PHP version. */
[1870] Fix | Delete
__( '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.' ),
[1871] Fix | Delete
PHP_VERSION
[1872] Fix | Delete
);
[1873] Fix | Delete
} else {
[1874] Fix | Delete
$message = sprintf(
[1875] Fix | Delete
/* translators: %s: The server PHP version. */
[1876] Fix | Delete
__( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.' ),
[1877] Fix | Delete
PHP_VERSION
[1878] Fix | Delete
);
[1879] Fix | Delete
}
[1880] Fix | Delete
} elseif ( $response['is_lower_than_future_minimum'] ) {
[1881] Fix | Delete
$message = sprintf(
[1882] Fix | Delete
/* translators: %s: The server PHP version. */
[1883] Fix | Delete
__( '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.' ),
[1884] Fix | Delete
PHP_VERSION
[1885] Fix | Delete
);
[1886] Fix | Delete
} else {
[1887] Fix | Delete
$message = sprintf(
[1888] Fix | Delete
/* translators: %s: The server PHP version. */
[1889] Fix | Delete
__( 'Your site is running on an outdated version of PHP (%s), which should be updated.' ),
[1890] Fix | Delete
PHP_VERSION
[1891] Fix | Delete
);
[1892] Fix | Delete
}
[1893] Fix | Delete
?>
[1894] Fix | Delete
<p class="bigger-bolder-text"><?php echo $message; ?></p>
[1895] Fix | Delete
[1896] Fix | Delete
<p><?php _e( 'What is PHP and how does it affect my site?' ); ?></p>
[1897] Fix | Delete
<p>
[1898] Fix | Delete
<?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&#8217;s performance.' ); ?>
[1899] Fix | Delete
<?php
[1900] Fix | Delete
if ( ! empty( $response['recommended_version'] ) ) {
[1901] Fix | Delete
printf(
[1902] Fix | Delete
/* translators: %s: The minimum recommended PHP version. */
[1903] Fix | Delete
__( 'The minimum recommended version of PHP is %s.' ),
[1904] Fix | Delete
$response['recommended_version']
[1905] Fix | Delete
);
[1906] Fix | Delete
}
[1907] Fix | Delete
?>
[1908] Fix | Delete
</p>
[1909] Fix | Delete
[1910] Fix | Delete
<p class="button-container">
[1911] Fix | Delete
<?php
[1912] Fix | Delete
printf(
[1913] Fix | Delete
'<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>',
[1914] Fix | Delete
esc_url( wp_get_update_php_url() ),
[1915] Fix | Delete
__( 'Learn more about updating PHP' ),
[1916] Fix | Delete
/* translators: Hidden accessibility text. */
[1917] Fix | Delete
__( '(opens in a new tab)' )
[1918] Fix | Delete
);
[1919] Fix | Delete
?>
[1920] Fix | Delete
</p>
[1921] Fix | Delete
<?php
[1922] Fix | Delete
[1923] Fix | Delete
wp_update_php_annotation();
[1924] Fix | Delete
wp_direct_php_update_button();
[1925] Fix | Delete
}
[1926] Fix | Delete
[1927] Fix | Delete
/**
[1928] Fix | Delete
* Adds an additional class to the PHP nag if the current version is insecure.
[1929] Fix | Delete
*
[1930] Fix | Delete
* @since 5.1.0
[1931] Fix | Delete
*
[1932] Fix | Delete
* @param string[] $classes Array of meta box classes.
[1933] Fix | Delete
* @return string[] Modified array of meta box classes.
[1934] Fix | Delete
*/
[1935] Fix | Delete
function dashboard_php_nag_class( $classes ) {
[1936] Fix | Delete
$response = wp_check_php_version();
[1937] Fix | Delete
[1938] Fix | Delete
if ( ! $response ) {
[1939] Fix | Delete
return $classes;
[1940] Fix | Delete
}
[1941] Fix | Delete
[1942] Fix | Delete
if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
[1943] Fix | Delete
$classes[] = 'php-no-security-updates';
[1944] Fix | Delete
} elseif ( $response['is_lower_than_future_minimum'] ) {
[1945] Fix | Delete
$classes[] = 'php-version-lower-than-future-minimum';
[1946] Fix | Delete
}
[1947] Fix | Delete
[1948] Fix | Delete
return $classes;
[1949] Fix | Delete
}
[1950] Fix | Delete
[1951] Fix | Delete
/**
[1952] Fix | Delete
* Displays the Site Health Status widget.
[1953] Fix | Delete
*
[1954] Fix | Delete
* @since 5.4.0
[1955] Fix | Delete
*/
[1956] Fix | Delete
function wp_dashboard_site_health() {
[1957] Fix | Delete
$get_issues = get_transient( 'health-check-site-status-result' );
[1958] Fix | Delete
[1959] Fix | Delete
$issue_counts = array();
[1960] Fix | Delete
[1961] Fix | Delete
if ( false !== $get_issues ) {
[1962] Fix | Delete
$issue_counts = json_decode( $get_issues, true );
[1963] Fix | Delete
}
[1964] Fix | Delete
[1965] Fix | Delete
if ( ! is_array( $issue_counts ) || ! $issue_counts ) {
[1966] Fix | Delete
$issue_counts = array(
[1967] Fix | Delete
'good' => 0,
[1968] Fix | Delete
'recommended' => 0,
[1969] Fix | Delete
'critical' => 0,
[1970] Fix | Delete
);
[1971] Fix | Delete
}
[1972] Fix | Delete
[1973] Fix | Delete
$issues_total = $issue_counts['recommended'] + $issue_counts['critical'];
[1974] Fix | Delete
?>
[1975] Fix | Delete
<div class="health-check-widget">
[1976] Fix | Delete
<div class="health-check-widget-title-section site-health-progress-wrapper loading hide-if-no-js">
[1977] Fix | Delete
<div class="site-health-progress">
[1978] Fix | Delete
<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">
[1979] Fix | Delete
<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
[1980] Fix | Delete
<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
[1981] Fix | Delete
</svg>
[1982] Fix | Delete
</div>
[1983] Fix | Delete
<div class="site-health-progress-label">
[1984] Fix | Delete
<?php if ( false === $get_issues ) : ?>
[1985] Fix | Delete
<?php _e( 'No information yet&hellip;' ); ?>
[1986] Fix | Delete
<?php else : ?>
[1987] Fix | Delete
<?php _e( 'Results are still loading&hellip;' ); ?>
[1988] Fix | Delete
<?php endif; ?>
[1989] Fix | Delete
</div>
[1990] Fix | Delete
</div>
[1991] Fix | Delete
[1992] Fix | Delete
<div class="site-health-details">
[1993] Fix | Delete
<?php if ( false === $get_issues ) : ?>
[1994] Fix | Delete
<p>
[1995] Fix | Delete
<?php
[1996] Fix | Delete
printf(
[1997] Fix | Delete
/* translators: %s: URL to Site Health screen. */
[1998] Fix | Delete
__( '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.' ),
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function