Find a Trainer Direct Test"; // Try to load WordPress $wp_load_paths = [ __DIR__ . '/../../../wp-load.php', __DIR__ . '/../../../../wp-load.php', dirname(__DIR__) . '/../../../wp-load.php' ]; $wp_loaded = false; foreach ($wp_load_paths as $path) { if (file_exists($path)) { try { require_once $path; $wp_loaded = true; echo "

✓ WordPress loaded from: $path

"; break; } catch (Exception $e) { echo "

✗ Failed to load WordPress from: $path - " . $e->getMessage() . "

"; } } else { echo "

- wp-load.php not found at: $path

"; } } if (!$wp_loaded) { die('

FATAL: Could not load WordPress

'); } // Test WordPress basics echo "

WordPress Environment Test

"; echo "

WordPress version: " . get_bloginfo('version') . "

"; echo "

Site URL: " . get_site_url() . "

"; echo "

Plugin directory: " . WP_PLUGIN_DIR . "

"; // Test plugin loading echo "

Plugin Loading Test

"; // Check if HVAC plugin is active if (is_plugin_active('hvac-community-events/hvac-community-events.php')) { echo "

✓ HVAC plugin is active

"; } else { echo "

✗ HVAC plugin is NOT active

"; } // Check if HVAC plugin function exists if (function_exists('hvac_community_events')) { echo "

✓ hvac_community_events function exists

"; try { $plugin = hvac_community_events(); echo "

✓ Plugin instance created: " . get_class($plugin) . "

"; } catch (Exception $e) { echo "

✗ Plugin instantiation failed: " . $e->getMessage() . "

"; } } else { echo "

✗ hvac_community_events function does not exist

"; } // Test Find a Trainer class echo "

Find a Trainer Class Test

"; if (class_exists('HVAC_Find_Trainer_Page')) { echo "

✓ HVAC_Find_Trainer_Page class exists

"; try { $find_trainer = HVAC_Find_Trainer_Page::get_instance(); echo "

✓ Find a Trainer instance created

"; } catch (Exception $e) { echo "

✗ Find a Trainer instantiation failed: " . $e->getMessage() . "

"; } } else { echo "

✗ HVAC_Find_Trainer_Page class does not exist

"; } // Check file existence echo "

File Existence Test

"; $critical_files = [ 'hvac-community-events.php', 'includes/class-hvac-plugin.php', 'includes/find-trainer/class-hvac-find-trainer-page.php', 'includes/find-trainer/class-hvac-mapgeo-integration.php', 'assets/css/find-trainer.css', 'assets/js/find-trainer.js' ]; $plugin_dir = WP_PLUGIN_DIR . '/hvac-community-events/'; foreach ($critical_files as $file) { $full_path = $plugin_dir . $file; if (file_exists($full_path)) { echo "

✓ $file exists

"; } else { echo "

✗ $file MISSING

"; } } // Test page existence echo "

Page Existence Test

"; $page = get_page_by_path('find-a-trainer'); if ($page) { echo "

✓ find-a-trainer page exists (ID: {$page->ID})

"; echo "

Page status: {$page->post_status}

"; echo "

Page title: {$page->post_title}

"; } else { echo "

✗ find-a-trainer page does not exist in database

"; } // Test direct URL echo "

URL Test

"; $find_trainer_url = home_url('/find-a-trainer/'); echo "

Expected URL: $find_trainer_url

"; // Test shortcodes echo "

Shortcode Test

"; if (shortcode_exists('hvac_find_trainer')) { echo "

✓ hvac_find_trainer shortcode exists

"; } else { echo "

✗ hvac_find_trainer shortcode does not exist

"; } if (shortcode_exists('hvac_trainer_directory')) { echo "

✓ hvac_trainer_directory shortcode exists

"; } else { echo "

✗ hvac_trainer_directory shortcode does not exist

"; } echo "

Memory and Environment

"; echo "

Memory usage: " . number_format(memory_get_usage() / 1024 / 1024, 2) . " MB

"; echo "

Memory limit: " . ini_get('memory_limit') . "

"; echo "

Max execution time: " . ini_get('max_execution_time') . "

"; echo "

Test Complete

"; echo "

If all tests pass but the page still shows error, check the server error logs for specific PHP errors.

";