[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

(no description)

File Size: 2851 lines (92 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Site_Health:: (40 methods):
  __construct()
  show_site_health_tab()
  get_instance()
  enqueue_scripts()
  perform_test()
  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_php_default_timezone()
  get_test_php_sessions()
  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_plugin_theme_auto_updates()
  get_test_loopback_requests()
  get_test_http_requests()
  get_test_rest_availability()
  get_test_file_uploads()
  get_test_authorization_header()
  get_tests()
  admin_body_class()
  wp_schedule_test_init()
  get_cron_tasks()
  has_missed_cron()
  has_late_cron()
  detect_plugin_theme_auto_update_issues()
  can_perform_loopback()
  maybe_create_scheduled_event()
  wp_cron_scheduled_check()
  is_development_environment()


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

show_site_health_tab( $tab )   X-Ref
Output the content of a tab in the Site Health screen.

param: string $tab Slug of the current tab being displayed.
since: 5.8.0

get_instance()   X-Ref
Return an instance of the WP_Site_Health class, or create one if none exist yet.

return: WP_Site_Health|null
since: 5.4.0

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

since: 5.2.0

perform_test( $callback )   X-Ref
Run a Site Health test directly.

return: mixed|void
param: callable $callback
since: 5.4.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 standard 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.

Сhecks 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_name = null, $function_name = null, $constant_name = null, $class_name = 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.

return: bool Whether or not the extension and function are available.
param: string $extension_name Optional. The extension name to test. Default null.
param: string $function_name  Optional. The function name to test. Default null.
param: string $constant_name  Optional. The constant name to test for. Default null.
param: string $class_name     Optional. The class name to test for. Default null.
since: 5.2.0
since: 5.3.0 The `$constant_name` and `$class_name` parameters were added.

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_php_default_timezone()   X-Ref
Test if the PHP default timezone is set to UTC.

return: array The test results.
since: 5.3.1

get_test_php_sessions()   X-Ref
Test if there's an active PHP session that can affect loopback requests.

return: array The test results.
since: 5.5.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 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
since: 5.7.0 Updated to rely on {@see wp_is_using_https()} and {@see wp_is_https_supported()}.

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_plugin_theme_auto_updates()   X-Ref
Test if plugin and theme auto-updates appear to be configured correctly.

return: array The test results.
since: 5.5.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 allowing certain
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_test_file_uploads()   X-Ref
Test if 'file_uploads' directive in PHP.ini is turned off.

return: array The test results.
since: 5.5.0

get_test_authorization_header()   X-Ref
Tests if the Authorization header has the expected values.

return: array
since: 5.6.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
since: 5.6.0 Added support for `has_rest` and `permissions`.

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.

return: string The modified body class string.
param: string $body_class The 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, returns the instance instead of a boolean value.

return: bool|WP_Error True if a cron was missed, false if not. WP_Error if the cron is set to that.
since: 5.2.0

has_late_cron()   X-Ref
Check if any scheduled tasks are late.

Returns a boolean value of `true` if a scheduled task is late and ends processing.

If the list of crons is an instance of WP_Error, returns the instance instead of a boolean value.

return: bool|WP_Error True if a cron is late, false if not. WP_Error if the cron is set to that.
since: 5.3.0

detect_plugin_theme_auto_update_issues()   X-Ref
Check for potential issues with plugin and theme auto-updates.

Though there is no way to 100% determine if plugin and theme auto-updates are configured
correctly, a few educated guesses could be made to flag any conditions that would
potentially cause unexpected behaviors.

return: object The test results.
since: 5.5.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

maybe_create_scheduled_event()   X-Ref
Create a weekly cron event, if one does not already exist.

since: 5.4.0

wp_cron_scheduled_check()   X-Ref
Run our scheduled event to check and update the latest site health status for the website.

since: 5.4.0

is_development_environment()   X-Ref
Checks if the current environment type is set to 'development' or 'local'.

return: bool True if it is a development environment, false if not.
since: 5.6.0



Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1