[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-site-health.php (summary)

(no description)

File Size: 1990 lines (61 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Site_Health:: (27 methods):
  __construct()
  enqueue_scripts()
  prepare_sql_data()
  check_wp_version_check_exists()
  get_test_wordpress_version()
  get_test_plugin_version()
  get_test_theme_version()
  get_test_php_version()
  test_php_extension_availability()
  get_test_php_extensions()
  get_test_sql_server()
  get_test_utf8mb4_support()
  get_test_dotorg_communication()
  get_test_is_in_debug_mode()
  get_test_https_status()
  get_test_ssl_support()
  get_test_scheduled_events()
  get_test_background_updates()
  get_test_loopback_requests()
  get_test_http_requests()
  get_test_rest_availability()
  get_tests()
  admin_body_class()
  wp_schedule_test_init()
  get_cron_tasks()
  has_missed_cron()
  can_perform_loopback()


Class: WP_Site_Health  - X-Ref

Class for looking up a site's health based on a user's WordPress environment.

__construct()   X-Ref
WP_Site_Health constructor.

since: 5.2.0

enqueue_scripts()   X-Ref
Enqueues the site health scripts.

since: 5.2.0

prepare_sql_data()   X-Ref
Run the SQL version checks.

These values are used in later tests, but the part of preparing them is more easily managed early
in the class for ease of access and discovery.

since: 5.2.0

check_wp_version_check_exists()   X-Ref
Test if `wp_version_check` is blocked.

It's possible to block updates with the `wp_version_check` filter, but this can't be checked during an
AJAX call, as the filter is never introduced then.

This filter overrides a normal page request if it's made by an admin through the AJAX call with the
right query argument to check for this.

since: 5.2.0

get_test_wordpress_version()   X-Ref
Tests for WordPress version and outputs it.

Gives various results depending on what kind of updates are available, if any, to encourage the
user to install security updates as a priority.

return: array The test result.
since: 5.2.0

get_test_plugin_version()   X-Ref
Test if plugins are outdated, or unnecessary.

The tests checks if your plugins are up to date, and encourages you to remove any that are not in use.

return: array The test result.
since: 5.2.0

get_test_theme_version()   X-Ref
Test if themes are outdated, or unnecessary.

The tests checks if your site has a default theme (to fall back on if there is a need), if your themes
are up to date and, finally, encourages you to remove any themes that are not needed.

return: array The test results.
since: 5.2.0

get_test_php_version()   X-Ref
Test if the supplied PHP version is supported.

return: array The test results.
since: 5.2.0

test_php_extension_availability( $extension = null, $function = null )   X-Ref
Check if the passed extension or function are available.

Make the check for available PHP modules into a simple boolean operator for a cleaner test runner.

param: string $extension Optional. The extension name to test. Default null.
param: string $function  Optional. The function name to test. Default null.
return: bool Whether or not the extension and function are available.
since: 5.2.0

get_test_php_extensions()   X-Ref
Test if required PHP modules are installed on the host.

This test builds on the recommendations made by the WordPress Hosting Team
as seen at https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions

return: array
since: 5.2.0

get_test_sql_server()   X-Ref
Test if the SQL server is up to date.

return: array The test results.
since: 5.2.0

get_test_utf8mb4_support()   X-Ref
Test if the database server is capable of using utf8mb4.

return: array The test results.
since: 5.2.0

get_test_dotorg_communication()   X-Ref
Test if the site can communicate with WordPress.org.

return: array The test results.
since: 5.2.0

get_test_is_in_debug_mode()   X-Ref
Test if debug information is enabled.

When WP_DEBUG is enabled, errors and information may be disclosed to site visitors, or it may be
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.

return: array The test results.
since: 5.2.0

get_test_https_status()   X-Ref
Test if your site is serving content over HTTPS.

Many sites have varying degrees of HTTPS support, the most common of which is sites that have it
enabled, but only if you visit the right site address.

return: array The test results.
since: 5.2.0

get_test_ssl_support()   X-Ref
Check if the HTTP API can handle SSL/TLS requests.

return: array The test results.
since: 5.2.0

get_test_scheduled_events()   X-Ref
Test if scheduled events run as intended.

If scheduled events are not running, this may indicate something with WP_Cron is not working as intended,
or that there are orphaned events hanging around from older code.

return: array The test results.
since: 5.2.0

get_test_background_updates()   X-Ref
Test if WordPress can run automated background updates.

Background updates in WordPress are primarily used for minor releases and security updates. It's important
to either have these working, or be aware that they are intentionally disabled for whatever reason.

return: array The test results.
since: 5.2.0

get_test_loopback_requests()   X-Ref
Test if loopbacks work as expected.

A loopback is when WordPress queries itself, for example to start a new WP_Cron instance, or when editing a
plugin or theme. This has shown itself to be a recurring issue as code can very easily break this interaction.

return: array The test results.
since: 5.2.0

get_test_http_requests()   X-Ref
Test if HTTP requests are blocked.

It's possible to block all outgoing communication (with the possibility of whitelisting hosts) via the
HTTP API. This may create problems for users as many features are running as services these days.

return: array The test results.
since: 5.2.0

get_test_rest_availability()   X-Ref
Test if the REST API is accessible.

Various security measures may block the REST API from working, or it may have been disabled in general.
This is required for the new block editor to work, so we explicitly test for this.

return: array The test results.
since: 5.2.0

get_tests()   X-Ref
Return a set of tests that belong to the site status page.

Each site status test is defined here, they may be `direct` tests, that run on page load, or `async` tests
which will run later down the line via JavaScript calls to improve page performance and hopefully also user
experiences.

return: array The list of tests to run.
since: 5.2.0

admin_body_class( $body_class )   X-Ref
Add a class to the body HTML tag.

Filters the body class string for admin pages and adds our own class for easier styling.

param: string $body_class The body class string.
return: string The modified body class string.
since: 5.2.0

wp_schedule_test_init()   X-Ref
Initiate the WP_Cron schedule test cases.

since: 5.2.0

get_cron_tasks()   X-Ref
Populate our list of cron events and store them to a class-wide variable.

since: 5.2.0

has_missed_cron()   X-Ref
Check if any scheduled tasks have been missed.

Returns a boolean value of `true` if a scheduled task has been missed and ends processing. If the list of
crons is an instance of WP_Error, return the instance instead of a boolean value.

return: bool|WP_Error true if a cron was missed, false if it wasn't. WP_Error if the cron is set to that.
since: 5.2.0

can_perform_loopback()   X-Ref
Run a loopback test on our site.

Loopbacks are what WordPress uses to communicate with itself to start up WP_Cron, scheduled posts,
make sure plugin or theme edits don't cause site failures and similar.

return: object The test results.
since: 5.2.0



Generated: Mon Jul 22 01:00:03 2019 Cross-referenced by PHPXref 0.7.1