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 version: " . get_bloginfo('version') . "
"; echo "Site URL: " . get_site_url() . "
"; echo "Plugin directory: " . WP_PLUGIN_DIR . "
"; // Test plugin loading 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 "✓ 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 exists
"; } else { echo "✗ $file MISSING
"; } } // Test page existence 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 "Expected URL: $find_trainer_url
"; // Test shortcodes 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 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 "If all tests pass but the page still shows error, check the server error logs for specific PHP errors.
";