init_hooks(); } /** * Initialize hooks */ private function init_hooks() { // Add debugging scripts to find-a-trainer page add_action('wp_footer', [$this, 'add_safari_debugging_script']); // Add debugging info to page source add_action('wp_head', [$this, 'add_debug_info_to_head']); // AJAX handler for debug logging add_action('wp_ajax_hvac_safari_debug', [$this, 'handle_safari_debug_ajax']); add_action('wp_ajax_nopriv_hvac_safari_debug', [$this, 'handle_safari_debug_ajax']); } /** * Check if current page is find-a-trainer */ private function is_find_trainer_page() { return is_page('find-a-trainer') || strpos($_SERVER['REQUEST_URI'], 'find-a-trainer') !== false; } /** * Add debug info to page head */ public function add_debug_info_to_head() { if (!$this->is_find_trainer_page()) { return; } $browser_detection = HVAC_Browser_Detection::instance(); $browser_info = $browser_detection->get_browser_info(); ?> is_find_trainer_page()) { return; } ?> $browser_detection->get_browser_info(), 'find_trainer_assets' => class_exists('HVAC_Find_Trainer_Assets') ? HVAC_Find_Trainer_Assets::instance()->get_compatibility_info() : 'Class not found', 'server_info' => [ 'php_version' => PHP_VERSION, 'wp_version' => get_bloginfo('version'), 'theme' => get_template(), 'plugins' => get_option('active_plugins'), ] ]; } }