From e5182a316f359760aa9e8fd675d48479ba7b4b81 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 29 Jun 2024 23:33:26 +0000 Subject: [PATCH] Update simple-status.php --- simple-status.php | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/simple-status.php b/simple-status.php index 21bc96a..a92c3e7 100644 --- a/simple-status.php +++ b/simple-status.php @@ -1,26 +1,16 @@ 'GET', - 'callback' => 'custom_health_check', - )); -}); - -function custom_health_check() { - error_log('Health check endpoint hit.'); - // Perform basic checks here (e.g., database connectivity) - if (is_wp_error($response = wp_remote_get(home_url()))) { - return new WP_Error('site_down', 'Site is down', array('status' => 500)); +function add_simple_tracking_code() { + $tracking_code_path = plugin_dir_path(__FILE__) . 'tracking-code.php'; + if (file_exists($tracking_code_path)) { + include $tracking_code_path; } - - return new WP_REST_Response(array('status' => 'UP'), 200); } +add_action('wp_head', 'add_simple_tracking_code');