- Created Find a Trainer page with interactive map and trainer directory - Integrated MapGeo plugin for displaying 45+ geocoded trainer locations - Built advanced filtering system (State/Province, Business Type, Training Format, Training Resources) - Implemented trainer profile cards with View Profile and See Events buttons - Added contact form handler with validation and email notifications - Created database table for tracking contact submissions - Responsive design with mobile-friendly layout - AJAX-powered search and filter functionality - Pagination support for trainer directory - Call to action for trainer registration Technical Implementation: - HVAC_Find_Trainer_Page: Main page handler with custom template - HVAC_MapGeo_Integration: Map marker management for trainer locations - HVAC_Contact_Form_Handler: Form processing with rate limiting - HVAC_Trainer_Directory_Query: Advanced querying with caching - HVAC_Contact_Submissions_Table: Database operations for submissions Tested with existing 53 trainer profiles, 45 geocoded locations Page live at: /find-a-trainer/ Co-Authored-By: Ben Reed <ben@tealmaker.com>
76 lines
No EOL
2.7 KiB
Bash
76 lines
No EOL
2.7 KiB
Bash
#!/bin/bash
|
|
|
|
# Debug Find a Trainer feature
|
|
# Usage: ./scripts/debug-find-trainer.sh
|
|
|
|
source .env
|
|
|
|
echo "=== Debugging Find a Trainer Feature ==="
|
|
|
|
ssh -o StrictHostKeyChecking=no "$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP" << 'ENDSSH'
|
|
cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html
|
|
|
|
echo "=== Checking if classes are loaded ==="
|
|
wp eval '
|
|
echo "HVAC_Find_Trainer_Page exists: " . (class_exists("HVAC_Find_Trainer_Page") ? "Yes" : "No") . "\n";
|
|
echo "HVAC_Trainer_Directory_Query exists: " . (class_exists("HVAC_Trainer_Directory_Query") ? "Yes" : "No") . "\n";
|
|
echo "HVAC_Contact_Form_Handler exists: " . (class_exists("HVAC_Contact_Form_Handler") ? "Yes" : "No") . "\n";
|
|
echo "HVAC_MapGeo_Integration exists: " . (class_exists("HVAC_MapGeo_Integration") ? "Yes" : "No") . "\n";
|
|
'
|
|
|
|
echo -e "\n=== Checking if shortcodes are registered ==="
|
|
wp eval '
|
|
global $shortcode_tags;
|
|
echo "hvac_trainer_directory shortcode: " . (isset($shortcode_tags["hvac_trainer_directory"]) ? "Registered" : "Not registered") . "\n";
|
|
echo "hvac_find_trainer shortcode: " . (isset($shortcode_tags["hvac_find_trainer"]) ? "Registered" : "Not registered") . "\n";
|
|
'
|
|
|
|
echo -e "\n=== Checking page content ==="
|
|
wp eval '
|
|
$page = get_page_by_path("find-a-trainer");
|
|
if ($page) {
|
|
echo "Page ID: " . $page->ID . "\n";
|
|
echo "Page Title: " . $page->post_title . "\n";
|
|
echo "Page Status: " . $page->post_status . "\n";
|
|
echo "Content length: " . strlen($page->post_content) . " characters\n";
|
|
echo "Contains shortcode: " . (strpos($page->post_content, "[hvac_trainer_directory]") !== false ? "Yes" : "No") . "\n";
|
|
} else {
|
|
echo "Page not found\n";
|
|
}
|
|
'
|
|
|
|
echo -e "\n=== Testing shortcode output ==="
|
|
wp eval '
|
|
if (shortcode_exists("hvac_trainer_directory")) {
|
|
$output = do_shortcode("[hvac_trainer_directory]");
|
|
echo "Shortcode output length: " . strlen($output) . " characters\n";
|
|
if (strlen($output) > 0) {
|
|
echo "First 200 chars: " . substr($output, 0, 200) . "...\n";
|
|
} else {
|
|
echo "Shortcode returns empty output\n";
|
|
}
|
|
} else {
|
|
echo "Shortcode not registered\n";
|
|
}
|
|
'
|
|
|
|
echo -e "\n=== Checking trainer profiles ==="
|
|
wp eval '
|
|
$profiles = get_posts([
|
|
"post_type" => "trainer_profile",
|
|
"post_status" => "publish",
|
|
"posts_per_page" => 5
|
|
]);
|
|
echo "Found " . count($profiles) . " trainer profiles\n";
|
|
foreach ($profiles as $p) {
|
|
$public = get_post_meta($p->ID, "is_public_profile", true);
|
|
echo "- " . $p->post_title . " (Public: " . ($public ? "Yes" : "No") . ")\n";
|
|
}
|
|
'
|
|
|
|
echo -e "\n=== Checking PHP errors ==="
|
|
tail -n 20 /home/974670.cloudwaysapps.com/uberrxmprk/public_html/wp-content/debug.log 2>/dev/null || echo "No debug log found or empty"
|
|
|
|
ENDSSH
|
|
|
|
echo "=== Debug Complete ===" |