upskill-event-manager/scripts/fix-find-trainer-page.sh
bengizmo 9055cddae5 feat: Implement comprehensive Find a Trainer feature with MapGeo integration
- 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>
2025-08-04 08:53:34 -03:00

52 lines
No EOL
1.3 KiB
Bash
Executable file

#!/bin/bash
# Fix Find a Trainer page content
# Usage: ./scripts/fix-find-trainer-page.sh
source .env
echo "=== Fixing Find a Trainer Page Content ==="
ssh -o StrictHostKeyChecking=no "$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP" << 'ENDSSH'
cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html
# Update the page with simpler content
wp eval '
$page = get_page_by_path("find-a-trainer");
if ($page) {
// Simpler content without MapGeo shortcode for now
$updated_content = \'<div class="hvac-find-trainer-wrapper">
<div class="hvac-find-trainer-intro">
<p>Find certified HVAC trainers in your area. Use the filters below to discover trainers who match your specific needs.</p>
</div>
<!-- Trainer Directory -->
[hvac_trainer_directory]
<div class="hvac-trainer-cta">
<p>Are you an HVAC Trainer that wants to be listed in our directory?</p>
<a href="/trainer-registration/" class="button">Become a Trainer</a>
</div>
</div>\';
wp_update_post([
"ID" => $page->ID,
"post_content" => $updated_content
]);
echo "Page content updated\n";
} else {
echo "Page not found\n";
}
'
# Clear cache
wp cache flush
ENDSSH
echo "=== Testing Page Load ==="
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://upskill-staging.measurequick.com/find-a-trainer/)
echo "Page returns HTTP $HTTP_CODE"
echo "=== Fix Complete ==="