upskill-event-manager/scripts/debug-mapgeo-integration.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

72 lines
No EOL
2.4 KiB
Bash
Executable file

#!/bin/bash
# Debug MapGeo integration
# Usage: ./scripts/debug-mapgeo-integration.sh
source .env
echo "=== Debugging MapGeo Integration ==="
# First, deploy the debug version
echo "Deploying debug version..."
scripts/deploy.sh staging 2>&1 | tail -n 5
echo -e "\n=== Triggering page load to generate debug output ==="
curl -s -o /dev/null https://upskill-staging.measurequick.com/find-a-trainer/
sleep 2
echo -e "\n=== Checking debug output ==="
ssh -o StrictHostKeyChecking=no "$UPSKILL_STAGING_SSH_USER@$UPSKILL_STAGING_IP" << 'ENDSSH'
cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html
# Enable debug logging temporarily
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_DEBUG_DISPLAY false --raw
# Clear any old debug log
> wp-content/debug.log
# Load the page to trigger the filter
curl -s -o /dev/null http://localhost/find-a-trainer/
# Wait a moment for log to be written
sleep 1
# Check the debug log for our MapGeo debug output
echo "=== MapGeo Debug Output ==="
grep "HVAC MapGeo Debug" wp-content/debug.log 2>/dev/null || echo "No MapGeo debug output found"
# Also check for any MapGeo-related errors
echo -e "\n=== MapGeo Related Errors ==="
grep -i "mapgeo\|igm_" wp-content/debug.log 2>/dev/null | head -n 20 || echo "No MapGeo errors found"
# Check if MapGeo plugin is active
echo -e "\n=== MapGeo Plugin Status ==="
wp plugin list | grep -i geo || echo "No geo/map plugins found"
# Check what filters are registered for igm_add_meta
echo -e "\n=== Checking registered filters ==="
wp eval '
global $wp_filter;
if (isset($wp_filter["igm_add_meta"])) {
echo "Filters registered for igm_add_meta:\n";
foreach ($wp_filter["igm_add_meta"] as $priority => $callbacks) {
echo " Priority $priority:\n";
foreach ($callbacks as $id => $callback) {
if (is_array($callback["function"])) {
$class = is_object($callback["function"][0]) ? get_class($callback["function"][0]) : $callback["function"][0];
echo " - " . $class . "::" . $callback["function"][1] . " (accepts " . $callback["accepted_args"] . " args)\n";
} else {
echo " - " . $callback["function"] . " (accepts " . $callback["accepted_args"] . " args)\n";
}
}
}
} else {
echo "No filters registered for igm_add_meta\n";
}
'
ENDSSH
echo -e "\n=== Debug Complete ==="