Ticket #46573: 46573.diff
File 46573.diff, 6.3 KB (added by , 6 years ago) |
---|
-
Gruntfile.js
diff --git a/Gruntfile.js b/Gruntfile.js index a27fc2b735..f40fa336cf 100644
a b module.exports = function(grunt) { 263 263 [ WORKING_DIR + 'wp-admin/js/tags-box.js' ]: [ './src/js/_enqueues/admin/tags-box.js' ], 264 264 [ WORKING_DIR + 'wp-admin/js/tags-suggest.js' ]: [ './src/js/_enqueues/admin/tags-suggest.js' ], 265 265 [ WORKING_DIR + 'wp-admin/js/tags.js' ]: [ './src/js/_enqueues/admin/tags.js' ], 266 [ WORKING_DIR + 'wp-admin/js/site-health.js' ]: [ './src/js/_enqueues/admin/site-health.js' ], 266 267 [ WORKING_DIR + 'wp-admin/js/theme-plugin-editor.js' ]: [ './src/js/_enqueues/wp/theme-plugin-editor.js' ], 267 268 [ WORKING_DIR + 'wp-admin/js/theme.js' ]: [ './src/js/_enqueues/wp/theme.js' ], 268 269 [ WORKING_DIR + 'wp-admin/js/updates.js' ]: [ './src/js/_enqueues/wp/updates.js' ], -
src/wp-admin/admin-ajax.php
diff --git a/src/wp-admin/admin-ajax.php b/src/wp-admin/admin-ajax.php index 93c32393e0..e0194ceba8 100644
a b $core_actions_post = array( 131 131 'edit-theme-plugin-file', 132 132 'wp-privacy-export-personal-data', 133 133 'wp-privacy-erase-personal-data', 134 'health-check-site-status-result', 135 'health-check-dotorg-communication', 136 'health-check-is-in-debug-mode', 137 'health-check-background-updates', 138 'health-check-loopback-requests', 134 139 ); 135 140 136 141 // Deprecated -
src/wp-admin/css/wp-admin.css
diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index 14c10f9cd9..b475cf0aaf 100644
a b 12 12 @import url(widgets.css); 13 13 @import url(site-icon.css); 14 14 @import url(l10n.css); 15 @import url(site-health.css); -
src/wp-admin/includes/ajax-actions.php
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 474319e75c..cb39a2ee4f 100644
a b function wp_ajax_wp_privacy_erase_personal_data() { 4858 4858 4859 4859 wp_send_json_success( $response ); 4860 4860 } 4861 4862 /** 4863 * Ajax handler for site health checks on server communication. 4864 * 4865 * @since 5.2.0 4866 */ 4867 function wp_ajax_health_check_dotorg_communication() { 4868 check_ajax_referer( 'health-check-site-status' ); 4869 4870 if ( ! current_user_can( 'install_plugins' ) ) { 4871 wp_send_json_error(); 4872 } 4873 4874 if ( ! class_exists( 'WP_Site_Health' ) ) { 4875 require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); 4876 } 4877 4878 $site_health = new WP_Site_Health(); 4879 wp_send_json_success( $site_health->get_test_dotorg_communication() ); 4880 } 4881 4882 /** 4883 * Ajax handler for site health checks on debug mode. 4884 * 4885 * @since 5.2.0 4886 */ 4887 function wp_ajax_health_check_is_in_debug_mode() { 4888 wp_verify_nonce( 'health-check-site-status' ); 4889 4890 if ( ! current_user_can( 'install_plugins' ) ) { 4891 wp_send_json_error(); 4892 } 4893 4894 if ( ! class_exists( 'WP_Site_Health' ) ) { 4895 require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); 4896 } 4897 4898 $site_health = new WP_Site_Health(); 4899 wp_send_json_success( $site_health->get_test_is_in_debug_mode() ); 4900 } 4901 4902 /** 4903 * Ajax handler for site health checks on background updates. 4904 * 4905 * @since 5.2.0 4906 */ 4907 function wp_ajax_health_check_background_updates() { 4908 check_ajax_referer( 'health-check-site-status' ); 4909 4910 if ( ! current_user_can( 'install_plugins' ) ) { 4911 wp_send_json_error(); 4912 } 4913 4914 if ( ! class_exists( 'WP_Site_Health' ) ) { 4915 require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); 4916 } 4917 4918 $site_health = new WP_Site_Health(); 4919 wp_send_json_success( $site_health->get_test_background_updates() ); 4920 } 4921 4922 4923 /** 4924 * Ajax handler for site health checks on loopback requests. 4925 * 4926 * @since 5.2.0 4927 */ 4928 function wp_ajax_health_check_loopback_requests() { 4929 check_ajax_referer( 'health-check-site-status' ); 4930 4931 if ( ! current_user_can( 'install_plugins' ) ) { 4932 wp_send_json_error(); 4933 } 4934 4935 if ( ! class_exists( 'WP_Site_Health' ) ) { 4936 require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); 4937 } 4938 4939 $site_health = new WP_Site_Health(); 4940 wp_send_json_success( $site_health->get_test_loopback_requests() ); 4941 } 4942 4943 /** 4944 * Ajax handler for site health check to update the result status. 4945 * 4946 * @since 5.2.0 4947 */ 4948 function wp_ajax_health_check_site_status_result() { 4949 check_ajax_referer( 'health-check-site-status-result' ); 4950 4951 if ( ! current_user_can( 'install_plugins' ) ) { 4952 wp_send_json_error(); 4953 } 4954 4955 set_transient( 'health-check-site-status-result', wp_json_encode( $_POST['counts'] ) ); 4956 4957 wp_send_json_success(); 4958 } -
src/wp-admin/menu.php
diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index f4490b7bf3..ca9357b89b 100644
a b $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', 263 263 $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' ); 264 264 $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' ); 265 265 $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' ); 266 $submenu['tools.php'][20] = array( __( 'Site Health' ), 'install_plugins', 'site-health.php' ); 266 267 if ( is_multisite() && ! is_main_site() ) { 267 268 $submenu['tools.php'][25] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' ); 268 269 } -
src/wp-includes/script-loader.php
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index a3ca60e75e..5bba581d8f 100644
a b function wp_default_scripts( &$scripts ) { 1688 1688 ) 1689 1689 ); 1690 1690 1691 $scripts->add( 'site-health', "/wp-admin/js/site-health$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 ); 1692 1691 1693 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 ); 1692 1694 did_action( 'init' ) && $scripts->localize( 1693 1695 'updates', … … function wp_default_styles( &$styles ) { 1933 1935 $styles->add( 'site-icon', "/wp-admin/css/site-icon$suffix.css" ); 1934 1936 $styles->add( 'l10n', "/wp-admin/css/l10n$suffix.css" ); 1935 1937 $styles->add( 'code-editor', "/wp-admin/css/code-editor$suffix.css", array( 'wp-codemirror' ) ); 1938 $styles->add( 'site-health', "/wp-admin/css/site-health$suffix.css" ); 1936 1939 1937 1940 $styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n' ) ); 1938 1941