Skip to content
Docs
Get RestroPress

Filter

rpress_tools_health_checks

Updated
On this page

Filters the setup health checks shown on the Tools Health Check tab.

Runs after the core checks (required pages, service modes, store hours, payment gateways, permalinks and diagnostics) have been collected. Each check is an array with the keys label, status, message, action and url. A status of good, warning or critical is shown with a readable label; any status other than good counts toward the needs-attention total.

Parameters#

ParameterTypeDescription
$checksarrayList of check arrays, each with label, status, message, action and url keys.

Return value#

array. The list of health checks.

Example#

function my_add_health_check( $checks ) {
	$checks[] = array(
		'label'   => __( 'My integration', 'my-plugin' ),
		'status'  => get_option( 'my_api_key' ) ? 'good' : 'warning',
		'message' => __( 'The API key is required for live order sync.', 'my-plugin' ),
		'action'  => __( 'Open Settings', 'my-plugin' ),
		'url'     => admin_url( 'admin.php?page=rpress-settings' ),
	);
	return $checks;
}
add_filter( 'rpress_tools_health_checks', 'my_add_health_check' );

Source#

Applied in:

  • includes/admin/tools.php (line 255), in rpress_tools_get_health_checks()

See also#

Was this page helpful?