Automattic\WooCommerce\Internal\Admin
SiteHealth::get_woocommerce_site_health_tests │ protected │ WC 1.0
Get the registry of WooCommerce Site Health tests.
Each entry describes one test:
- label: visible test name in Site Health.
- badge:
'security'or'performance'. - check: callable returning bool (true = good) or array (empty = good, otherwise context for description/actions).
- good: result data when the check passes (label, description).
- fail: result data when the check fails (status defaults to
'recommended', label, description, optional actions).
Label, status, and description may be callables that receive the check context.
Method of the class: SiteHealth{}
No Hooks.
Returns
Array
Usage
// protected - for code of main (parent) or child class $result = $this->get_woocommerce_site_health_tests(): array;
SiteHealth::get_woocommerce_site_health_tests() SiteHealth::get woocommerce site health tests code WC 11.0.0
protected function get_woocommerce_site_health_tests(): array {
return array(
'woocommerce_secure_connection' => array(
'label' => __( 'WooCommerce secure connection', 'woocommerce' ),
'badge' => 'security',
'check' => array( $this, 'is_store_using_secure_connection' ),
'good' => array(
'label' => __( 'WooCommerce store uses a secure connection', 'woocommerce' ),
'description' => __( 'Customer data is protected by HTTPS on your store pages.', 'woocommerce' ),
),
'fail' => array(
'status' => 'critical',
'label' => __( 'WooCommerce store is not using a secure connection', 'woocommerce' ),
'description' => __( 'WooCommerce strongly recommends serving your entire store over HTTPS to help keep customer data secure.', 'woocommerce' ),
'actions' => array(
array(
'url' => 'https://woocommerce.com/document/ssl-and-https/',
'label' => __( 'Learn more about HTTPS', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_uploads_directory_protection' => array(
'label' => __( 'WooCommerce uploads directory protection', 'woocommerce' ),
'badge' => 'security',
'check' => array( $this, 'is_uploads_directory_protected' ),
'good' => array(
'label' => __( 'WooCommerce uploads directory is protected', 'woocommerce' ),
'description' => __( 'The directory used for downloadable product files is not browsable from the web.', 'woocommerce' ),
),
'fail' => array(
'status' => function ( ?array $context ) {
return ! empty( $context['unverified'] ) ? 'recommended' : 'critical';
},
'label' => function ( ?array $context ) {
return ! empty( $context['unverified'] )
? __( 'WooCommerce could not verify uploads directory protection', 'woocommerce' )
: __( 'WooCommerce uploads directory is browsable from the web', 'woocommerce' );
},
'description' => function ( ?array $context ) {
return ! empty( $context['unverified'] )
? __( 'A loopback request to the WooCommerce uploads directory failed, so WooCommerce could not confirm whether directory browsing is disabled. Check your server configuration or try again later.', 'woocommerce' )
: __( 'Directory browsing can expose downloadable product files. Configure your web server to prevent directory indexing for the WooCommerce uploads directory.', 'woocommerce' );
},
'actions' => array(
array(
'url' => 'https://woocommerce.com/document/digital-downloadable-product-handling/#protecting-your-uploads-directory',
'label' => __( 'Learn how to protect downloads', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_template_overrides' => array(
'label' => __( 'WooCommerce template overrides', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => ! $this->has_outdated_template_overrides(),
'good' => array(
'label' => __( 'WooCommerce template overrides are up to date', 'woocommerce' ),
'description' => __( 'The active theme does not contain outdated WooCommerce template overrides.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'Your theme contains outdated WooCommerce template overrides', 'woocommerce' ),
'description' => __( 'Outdated template overrides may not be compatible with the current version of WooCommerce.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-status#status-table-templates' ),
'label' => __( 'View affected templates', 'woocommerce' ),
),
array(
'url' => 'https://woocommerce.com/document/template-structure/',
'label' => __( 'Learn more about templates', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_maxmind_geolocation' => array(
'label' => __( 'WooCommerce MaxMind geolocation', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => ! $this->needs_maxmind_license_key(),
'good' => array(
'label' => __( 'WooCommerce geolocation is configured', 'woocommerce' ),
'description' => __( 'Your store does not require further MaxMind geolocation configuration.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce geolocation needs a MaxMind license key', 'woocommerce' ),
'description' => __( 'A MaxMind license key is required when the default customer location uses geolocation.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=integration§ion=maxmind_geolocation' ),
'label' => __( 'Configure MaxMind geolocation', 'woocommerce' ),
),
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=general' ),
'label' => __( 'Change default customer location', 'woocommerce' ),
),
),
),
),
'woocommerce_download_method' => array(
'label' => __( 'WooCommerce download method', 'woocommerce' ),
'badge' => 'security',
'check' => fn() => 'redirect' !== get_option( 'woocommerce_file_download_method' ),
'good' => array(
'label' => __( 'WooCommerce uses a supported download method', 'woocommerce' ),
'description' => __( 'Your store is not configured to use the deprecated Redirect only download method.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce is using the deprecated Redirect only download method', 'woocommerce' ),
'description' => __( 'Redirect only is deprecated for downloadable products. Choose a different download method, or allow redirects only as a fallback.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=products§ion=downloadable' ),
'label' => __( 'Review download settings', 'woocommerce' ),
),
),
),
),
'woocommerce_database_tables' => array(
'label' => __( 'WooCommerce database tables', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => WC_Install::get_missing_base_tables(),
'good' => array(
'label' => __( 'WooCommerce database tables are present', 'woocommerce' ),
'description' => __( 'All required WooCommerce database tables exist.', 'woocommerce' ),
),
'fail' => array(
'status' => 'critical',
'label' => __( 'WooCommerce database tables are missing', 'woocommerce' ),
'description' => fn( array $missing_tables ) => sprintf(
/* translators: %s: Comma-separated list of missing database tables. */
__( 'One or more tables required for WooCommerce to function are missing: %s.', 'woocommerce' ),
implode( ', ', $missing_tables )
),
'actions' => array(
array(
'url' => wp_nonce_url( admin_url( 'admin.php?page=wc-status&tab=tools&action=verify_db_tables' ), 'debug_action' ),
'label' => __( 'Check database tables again', 'woocommerce' ),
),
),
),
),
'woocommerce_hpos_sync_on_read' => array(
'label' => __( 'WooCommerce HPOS sync on read', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => ! $this->should_show_hpos_sync_on_read_status(),
'good' => array(
'label' => __( 'WooCommerce HPOS sync on read does not require attention', 'woocommerce' ),
'description' => __( 'Your current order storage configuration is not affected by the HPOS sync-on-read change.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce HPOS sync on read is disabled', 'woocommerce' ),
'description' => __( 'Compatibility mode for HPOS no longer pulls order changes made to the posts database back into orders automatically. Review this if custom code modifies orders outside WooCommerce.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=advanced§ion=features' ),
'label' => __( 'Review order storage settings', 'woocommerce' ),
),
array(
'url' => 'https://developer.woocommerce.com/2026/02/16/hpos-sync-on-read-to-be-disabled-by-default-in-woocommerce-10-7/',
'label' => __( 'Learn more about this change', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_legacy_shipping_methods' => array(
'label' => __( 'WooCommerce legacy shipping methods', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => ! $this->has_legacy_shipping_methods_enabled(),
'good' => array(
'label' => __( 'WooCommerce legacy shipping methods are not enabled', 'woocommerce' ),
'description' => __( 'Your store is not using deprecated legacy shipping methods.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce legacy shipping methods are enabled', 'woocommerce' ),
'description' => __( 'Legacy shipping methods are deprecated. Set up rates with shipping zones instead.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=shipping' ),
'label' => __( 'Review shipping zones', 'woocommerce' ),
),
array(
'url' => 'https://woocommerce.com/document/setting-up-shipping-zones/',
'label' => __( 'Learn more about shipping zones', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_shipping_methods' => array(
'label' => __( 'WooCommerce shipping methods', 'woocommerce' ),
'badge' => 'performance',
'check' => fn() => ! $this->needs_shipping_methods(),
'good' => array(
'label' => __( 'WooCommerce shipping methods are configured', 'woocommerce' ),
'description' => __( 'Your store does not need additional shipping method setup.', 'woocommerce' ),
),
'fail' => array(
'status' => 'critical',
'label' => __( 'WooCommerce shipping is enabled but no shipping methods are configured', 'woocommerce' ),
'description' => __( 'Customers cannot purchase physical goods until at least one shipping method is available.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=shipping' ),
'label' => __( 'Set up shipping methods', 'woocommerce' ),
),
array(
'url' => 'https://woocommerce.com/document/setting-up-shipping-zones/',
'label' => __( 'Learn more about shipping zones', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_approved_download_directories_sync' => array(
'label' => __( 'WooCommerce approved download directories', 'woocommerce' ),
'badge' => 'security',
'check' => fn() => ! WC_Admin_Notices::has_notice( 'download_directories_sync_complete' ),
'good' => array(
'label' => __( 'WooCommerce approved download directories do not require review', 'woocommerce' ),
'description' => __( 'There is no completed approved download directories sync waiting for review.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce approved download directories need review', 'woocommerce' ),
'description' => __( 'The approved product download directories list was updated. Review it to confirm downloadable product files remain protected.', 'woocommerce' ),
'actions' => array(
array(
'url' => admin_url( 'admin.php?page=wc-settings&tab=products§ion=download_urls' ),
'label' => __( 'Review approved directories', 'woocommerce' ),
),
array(
'url' => wp_nonce_url(
add_query_arg( 'wc-hide-notice', 'download_directories_sync_complete', admin_url( 'site-health.php' ) ),
'woocommerce_hide_notices_nonce',
'_wc_notice_nonce'
),
'label' => __( 'Mark as reviewed', 'woocommerce' ),
),
array(
'url' => 'https://woocommerce.com/document/approved-download-directories',
'label' => __( 'Learn more about approved directories', 'woocommerce' ),
'new_tab' => true,
),
),
),
),
'woocommerce_com_extension_updates' => array(
'label' => __( 'WooCommerce.com plugin updates', 'woocommerce' ),
'badge' => 'security',
'check' => fn() => ! $this->has_outdated_woocommerce_com_plugins(),
'good' => array(
'label' => __( 'WooCommerce.com plugin updates do not require attention', 'woocommerce' ),
'description' => __( 'Your store can receive WooCommerce.com plugin updates, or no outdated WooCommerce.com plugins were found.', 'woocommerce' ),
),
'fail' => array(
'label' => __( 'WooCommerce.com plugin updates require attention', 'woocommerce' ),
'description' => __( 'Your store might be at risk because it is running old versions of WooCommerce plugins. Connect your store to WooCommerce.com to get updates and streamlined support for your subscriptions.', 'woocommerce' ),
'actions' => array(
array(
'url' => $this->get_woocommerce_com_extensions_url(),
'label' => __( 'Connect your store', 'woocommerce' ),
),
),
),
),
);
}