upskill-event-manager/debug-find-trainer-error.php
Ben c3e7fe9140 feat: comprehensive HVAC plugin development framework and modernization
## Major Enhancements

### 🏗️ Architecture & Infrastructure
- Implement comprehensive Docker testing infrastructure with hermetic environment
- Add Forgejo Actions CI/CD pipeline for automated deployments
- Create Page Object Model (POM) testing architecture reducing test duplication by 90%
- Establish security-first development patterns with input validation and output escaping

### 🧪 Testing Framework Modernization
- Migrate 146+ tests from 80 duplicate files to centralized architecture
- Add comprehensive E2E test suites for all user roles and workflows
- Implement WordPress error detection with automatic site health monitoring
- Create robust browser lifecycle management with proper cleanup

### 📚 Documentation & Guides
- Add comprehensive development best practices guide
- Create detailed administrator setup documentation
- Establish user guides for trainers and master trainers
- Document security incident reports and migration guides

### 🔧 Core Plugin Features
- Enhance trainer profile management with certification system
- Improve find trainer functionality with advanced filtering
- Strengthen master trainer area with content management
- Add comprehensive venue and organizer management

### 🛡️ Security & Reliability
- Implement security-first patterns throughout codebase
- Add comprehensive input validation and output escaping
- Create secure credential management system
- Establish proper WordPress role-based access control

### 🎯 WordPress Integration
- Strengthen singleton pattern implementation across all classes
- Enhance template hierarchy with proper WordPress integration
- Improve page manager with hierarchical URL structure
- Add comprehensive shortcode and menu system

### 🔍 Developer Experience
- Add extensive debugging and troubleshooting tools
- Create comprehensive test data seeding scripts
- Implement proper error handling and logging
- Establish consistent code patterns and standards

### 📊 Performance & Optimization
- Optimize database queries and caching strategies
- Improve asset loading and script management
- Enhance template rendering performance
- Streamline user experience across all interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 11:26:10 -03:00

85 lines
No EOL
3.2 KiB
PHP

<?php
/**
* Debug script to identify Find a Trainer page error
* Upload to staging wp-content/plugins/hvac-community-events/ directory
*/
// Enable WordPress debugging
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Start output buffering to catch any errors
ob_start();
// Try to load WordPress
$wp_config_path = dirname(__DIR__) . '/../../../wp-config.php';
if (!file_exists($wp_config_path)) {
$wp_config_path = dirname(__DIR__) . '/../../../../wp-config.php';
}
if (file_exists($wp_config_path)) {
require_once $wp_config_path;
echo "WordPress loaded successfully.\n";
echo "Plugin directory: " . WP_PLUGIN_DIR . "\n";
echo "HVAC Plugin path: " . WP_PLUGIN_DIR . '/hvac-community-events/hvac-community-events.php' . "\n";
// Check if HVAC plugin file exists
$hvac_plugin_file = WP_PLUGIN_DIR . '/hvac-community-events/hvac-community-events.php';
echo "HVAC plugin file exists: " . (file_exists($hvac_plugin_file) ? 'YES' : 'NO') . "\n";
// Check if Find a Trainer class file exists
$find_trainer_file = WP_PLUGIN_DIR . '/hvac-community-events/includes/find-trainer/class-hvac-find-trainer-page.php';
echo "Find Trainer class file exists: " . (file_exists($find_trainer_file) ? 'YES' : 'NO') . "\n";
// Test instantiation of main plugin class
try {
echo "Testing plugin instantiation...\n";
if (function_exists('hvac_community_events')) {
$plugin = hvac_community_events();
echo "Main plugin instance created: " . get_class($plugin) . "\n";
} else {
echo "ERROR: hvac_community_events function not found\n";
}
// Test Find a Trainer class
echo "Testing Find a Trainer class...\n";
if (class_exists('HVAC_Find_Trainer_Page')) {
$find_trainer = HVAC_Find_Trainer_Page::get_instance();
echo "Find a Trainer instance created: " . get_class($find_trainer) . "\n";
} else {
echo "ERROR: HVAC_Find_Trainer_Page class not found\n";
}
// Test if find-a-trainer page exists
echo "Testing find-a-trainer page...\n";
$page = get_page_by_path('find-a-trainer');
if ($page) {
echo "Find a trainer page exists: ID " . $page->ID . "\n";
echo "Page status: " . $page->post_status . "\n";
} else {
echo "ERROR: find-a-trainer page not found in database\n";
}
} catch (Exception $e) {
echo "EXCEPTION: " . $e->getMessage() . "\n";
echo "File: " . $e->getFile() . "\n";
echo "Line: " . $e->getLine() . "\n";
echo "Stack trace:\n" . $e->getTraceAsString() . "\n";
} catch (Error $e) {
echo "FATAL ERROR: " . $e->getMessage() . "\n";
echo "File: " . $e->getFile() . "\n";
echo "Line: " . $e->getLine() . "\n";
echo "Stack trace:\n" . $e->getTraceAsString() . "\n";
}
} else {
echo "ERROR: WordPress wp-config.php not found\n";
echo "Checked paths:\n";
echo "- " . dirname(__DIR__) . '/../../../wp-config.php' . "\n";
echo "- " . dirname(__DIR__) . '/../../../../wp-config.php' . "\n";
}
$output = ob_get_clean();
echo "<pre>" . htmlspecialchars($output) . "</pre>";