Documents the iterative debugging of user sync on production:
version constant mismatch, GET search criteria fix, error reporting
priority, phone/name validation, and spam account cleanup.
Final result: 64/64 active trainers syncing to Zoho CRM.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix sync_users search: pass criteria in URL query string instead of
as data parameter (GET requests ignore body data), which caused every
user search to fail and fall through to create
- Improve validate_api_response to check Zoho-specific error codes
before generic HTTP errors, and include field-level detail in messages
- Add Last_Name fallback to display_name/username when meta is empty
- Sanitize Phone to digits-only, require 10+ digits, omit if invalid
- Bump HVAC_PLUGIN_VERSION to 2.2.11 to bust browser cache
Result: 65/65 trainers now sync successfully (was 0/65).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zoho CRM sync appeared connected but silently failed to write data due to
unvalidated API responses. Sync methods now validate Zoho responses before
updating hashes, ensuring failed records re-sync on next run. Also fixes
staging detection to use wp_parse_url hostname parsing instead of fragile
strpos matching, adds admin UI for resetting sync hashes, and bumps
HVAC_PLUGIN_VERSION to 2.2.11 to bust browser cache for updated JS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fixed CSS bug where Near Me button HTML was replaced without .hvac-btn-text
wrapper class, causing layout issues on mobile when text became visible
- Applied fix to all 5 locations: loading state, success state, error reset,
clear filters, and remove location filter
- Added notification when Near Me filter returns no results within 100km radius
to improve UX feedback
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Champions are identified by "Certified measureQuick Champion" certification.
Unlike Trainers, Champions do not offer public training, so they display
differently:
- White marker outline (vs green for Trainers)
- Show only state, not city, in sidebar and info windows
- No "View Profile" button or modal popup on click
- Sorted to end of trainer list (after all Trainers)
- Non-clickable card styling
Code review fixes (Gemini 3):
- Fixed location formatting to handle empty city gracefully
- Added secondary sort by name for stable ordering
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace single trainer list with a tabbed sidebar interface:
- Three tabs with dynamic counts for each category
- Venue cards with icon, name, location, and upcoming events count
- Event cards with date badge, title, venue, and cost
- Visibility toggles moved from map overlay to sidebar header
- Context-aware search placeholder based on active tab
- Client-side filtering for instant search results
- Info button and modal with usage instructions and map legend
- Keyboard navigation for tabs (arrow keys)
- All lists sync with map viewport on pan/zoom
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add venue taxonomies and filter /find-training to show only approved labs:
- Create venue_type, venue_equipment, venue_amenities taxonomies
- Filter venue markers by mq-approved-lab taxonomy term
- Add equipment and amenities badges to venue modal
- Add venue contact form with AJAX handler and email notification
- Include POC (Point of Contact) meta for each training lab
9 approved training labs configured:
- Fast Track Learning Lab, Progressive Training Lab, NAVAC Technical Training Center
- Stevens Equipment Phoenix/Johnstown, San Jacinto College, Johnstone Supply
- TruTech Tools Training Center (new), Auer Steel & Heating Supply (new)
Note: Venues not displaying on map - to be debugged next session.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add viewport sync: sidebar shows only trainers visible in map area
- Add mouseover event on markers showing info window on hover
- Set optimized:false on markers for reliable hover events
- Add legacy URL redirects (/find-a-trainer → /find-training)
- Remove deprecated find-a-trainer page from Page Manager
- Update Status.md with session changes
- Bump version to 2.2.4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements /find-training page with Google Maps JavaScript API:
- Interactive map showing trainers (teal) and venues (orange) markers
- MarkerClusterer for dense areas
- Filter by State, Certification, Training Format
- Search by name/location
- "Near Me" geolocation with proximity filtering
- Trainer profile modal with contact form
- Venue info modal with upcoming events
- 301 redirect from /find-a-trainer to /find-training
- Auto-geocoding for new TEC venues via Google API
Multi-model code review fixes (GPT-5, Gemini 3, Zen MCP):
- Added missing contact form AJAX handler with rate limiting
- Fixed XSS risk in InfoWindow (DOM creation vs inline onclick)
- Added caching for filter dropdown queries (1-hour TTL)
- Added AJAX abort handling to prevent race conditions
- Replaced alert() with inline error notifications
New files:
- includes/find-training/class-hvac-find-training-page.php
- includes/find-training/class-hvac-training-map-data.php
- includes/find-training/class-hvac-venue-geocoding.php
- templates/page-find-training.php
- assets/js/find-training-map.js
- assets/js/find-training-filters.js
- assets/css/find-training-map.css
- assets/images/marker-trainer.svg
- assets/images/marker-venue.svg
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed menu system call from non-existent method to correct one:
- HVAC_Menu_System::instance()->render_master_trainer_menu()
+ HVAC_Master_Menu_System::instance()->render_master_menu()
Fixes fatal PHP error when accessing /master-trainer/edit-trainer-profile/
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify CLAUDE.md to focus on essential development guidance
- Remove redundant agent workflow documentation
- Add Technical Debt section documenting TEC Community Events dependency
- Update Status.md with completed TEC CE dependency analysis session
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Initialize HVAC_Master_Dashboard_Data during plugin init to ensure
AJAX handler is registered for all requests (not just template loads)
- Accept both hvac_ajax_nonce and hvac_master_dashboard_nonce for
backward compatibility with existing JavaScript
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Object.defineProperty interceptor to catch iMapsData assignment before IGM plugin corrupts it
- Detect and repair markers with corrupted coordinates (Lat == Lng) using backup lat/lng keys
- Remove PHP query injections that caused 500 errors
- Increase safety timeouts from 6s to 30s for slower resource loading
- Remove Safari blocker bug in find-trainer assets
- Update debug script for mapgeo integration testing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add generate_sync_hash(), should_sync(), and should_sync_user() helper methods
- Modify all 5 sync methods to check hashes before syncing
- Add 'skipped' count to track unchanged records
- Update scheduled sync to aggregate and log skipped counts
This fixes the issue where 59 items were synced every scheduled run even
when no WordPress records had changed.
- Load HVAC_Zoho_Scheduled_Sync on ALL requests (not just admin)
so WP-Cron can find custom schedules and action hooks
- Add add_option hook for first-time setting creation
- Explicitly call schedule_sync() in save_settings() to ensure
scheduling works even when option value hasn't changed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix Client ID regex to allow lowercase letters
- Update HVAC_Zoho_CRM_Auth to use encrypted storage for all operations
- Update class-zoho-admin.php to use HVAC_Secure_Storage for credential retrieval
- Update OAuth callback to use secure storage for token storage
- Update Status.md with blocking production issue (400 Bad Request)
Note: Issue persists on production - needs further investigation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1. Created zoho-admin.css (was missing, causing 404)
- Added styles for Zoho admin page layout
- Card styling, form tables, sync buttons, status messages
2. Fixed jQuery not defined on master-trainer pages
- Changed inject_inline_content hook from wp_head to wp_footer
- Ensures jQuery is loaded before inline script executes
Note: "message channel closed" error is a browser extension issue,
not a code problem (typically ad blockers intercepting message passing)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1. OAuth CSRF Protection:
- Added state parameter to OAuth authorization URL
- Generate and store state in transient (10 min expiry)
- Validate state on callback with timing-safe comparison
2. Debug Log Sanitization:
- Added sanitize_log_message() to mask credentials in logs
- Patterns mask client_id, client_secret, access_token, refresh_token
- Error handlers only expose file paths in WP_DEBUG mode
3. Move Inline JS to External File:
- Moved ~100 lines of inline JS to assets/js/zoho-admin.js
- Added redirectUri and oauthUrl to wp_localize_script
- Better CSP compliance and caching
4. Updated .gitignore to track includes/admin/ and includes/zoho/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed initializeAdminComponents hook from admin_init to admin_menu
with priority 5. WordPress fires admin_menu before admin_init, so
the Zoho admin submenu was being registered too late to appear.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace WooCommerce sync with Event Tickets (Tickets Commerce) support
- Add sync_attendees() for Contacts + Campaign Members
- Add sync_rsvps() for Leads + Campaign Members
- Fix user roles filter (hvac_trainer/hvac_master_trainer)
- Fix event query to include past events
- Update admin UI with new sync buttons
- Correct meta keys for Tickets Commerce (_tec_tickets_commerce_*)
- Correct meta keys for RSVPs (_tribe_rsvp_*)
Dry-run tested on staging:
- Events: 20 records
- Trainers: 53 records
- Attendees: 79 records
- RSVPs: 4 records
- Orders: 52 records
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added authentication support for Master Trainer page tests
- Improved security endpoint validation (accepts 400/403 status codes)
- Added cookie clearing before security tests to ensure logout
- Enhanced error reporting and test output clarity
- Better handling of authenticated vs public page testing
- More accurate security check validation logic
- Fix version mismatch (2.0.0 → 2.1.5 in main plugin file)
- Fix modal FOUC (CSS defaults to display:none, JS adds .active class)
- Replace direct error_log() with HVAC_Logger for conditional debug logging
- All logging now respects WP_DEBUG flag for production cleanliness
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Fix z-index conflict where announcement modal (999999) was higher than WordPress media modals (160000)
- Reduce announcement modal z-index to 100000 to allow WordPress media library to stack on top
- Remove duplicate TinyMCE initialization that was unnecessary
- Add custom "Add Media" button that renders when modal opens (prevents hidden modal issues)
- Improve page detection with multi-layered approach (URL path, template, slug, queried object)
- Move script loading to footer for better WordPress editor compatibility
Technical Details:
- WordPress core media modals use z-index 160000-160010
- Custom plugin modals should use 100000-159000 range to avoid conflicts
- wp_editor() with media_buttons => true in hidden modals causes auto-open issues
- Solution: media_buttons => false + custom button added via JavaScript when modal opens
Testing:
- Verified with MCP Playwright browser automation
- Media modal now properly appears above announcement modal
- All form functionality preserved
- Screenshot verification shows correct stacking order
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Resolves missing data on /master-trainer/trainers/ page by adding the JavaScript
file that handles AJAX loading of trainer statistics and table data.
✅ Changes:
- Created assets/js/hvac-master-trainers-overview.js
- Handles AJAX calls to load trainer stats and filtered trainer lists
- Implements filter change handlers for status, region, and search
- Includes debounced search input for better UX
- Initializes interactive table elements after load
- Updated includes/class-hvac-master-trainers-overview.php
- Added enqueue_scripts() method to properly load the JS file
- Registers wp_enqueue_scripts action hook
- Detects master trainer pages via shortcode or template slug
- Ensures jQuery dependency is met
The page was showing navigation and filters but no data because the JavaScript
to make AJAX calls to hvac_master_trainers_stats and hvac_master_trainers_filter
actions was completely missing.
Tested on staging and deployed to production.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes three critical production issues discovered on upskillhvac.com:
✅ Dashboard Fatal Errors (class-hvac-dashboard-data.php):
- Added class_exists('Tribe__Events__Main') checks before accessing TEC constants
- Prevents fatal errors when TEC plugin loads after our code
- Applied to get_total_events_count(), get_upcoming_events_count(), and get_past_events_count()
- Gracefully returns 0 when TEC is not available
✅ Event Edit Security Check Failure (page-edit-event-custom.php):
- Fixed nonce action mismatch: changed 'hvac_edit_event' to 'hvac_event_action'
- Aligns with HVAC_Event_Manager::NONCE_ACTION constant
- Resolves "Security check failed" error on event update forms
✅ Google Drive Folder Update:
- Updated embedded folder ID from 16uDRkFcaEqKUxfBek9VbfbAIeFV77nZG to 1-SDHGR9Ix6BmUVTHa3wI99K0rwfWL-vs
- Applied to templates/page-trainer-resources.php (trainer resources page)
- Applied to includes/class-hvac-announcements-display.php (shortcode default)
- Updated tests/unit/test-announcements-display.php (test references)
All changes tested and verified on production.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## TEC Integration Fixes
- **FIXED**: Iframe infinite loop resolved by user correcting TEC Community URLs from /network/ to /community/
- **CREATED**: hvac-tec-integration.css with comprehensive styling for TEC forms
- **VALIDATED**: TEC edit forms now load properly with all fields visible and styled
## Investigation Results
- ✅ Template rendering issue resolved - iframe no longer creates redirect loop
- ✅ CSS 404 errors eliminated with proper stylesheet creation
- ✅ Form accessibility confirmed - all TEC fields display correctly
- ❌ Form submission still returns "Security check failed" - requires custom form approach
## Technical Implementation
- Added comprehensive CSS styling for TEC integration pages
- Implemented proper form field styling matching HVAC design system
- Enhanced responsive design for mobile compatibility
- Added loading states and error handling styles
## Files Modified
- `assets/css/hvac-tec-integration.css` (new): Complete TEC integration stylesheet
- `.claude/settings.local.json`: Updated SSH permissions for debugging
## Root Cause Analysis
The original iframe loop was caused by URL mismatch between plugin configuration
(/events/network/) and actual TEC Community URLs (/events/community/).
Form submission issues indicate need for custom WordPress form implementation.
## Next Steps
Implement custom WordPress event form following best practices to eliminate
dependency on TEC Community Events plugin limitations and provide complete
field control with native WordPress security.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update hook names from tribe_* to tec_* prefix for TEC 5.0+ compatibility
- Replace non-existent tribe_events_community_submission_before_save with actual tec_events_community_before_save_submission
- Replace non-existent tribe_events_community_submission_success with actual tribe_community_event_save_updated
- Update method signatures to match correct hook parameters
- Maintain WordPress transient caching implementation for performance
- Remove JavaScript form override to prevent security conflicts
- Add proper debug logging for hook validation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper AJAX nonce distribution to page-master-trainers.php
- Implement security authentication for both dashboard and trainers pages
- Fix template-level nonce initialization for HVAC AJAX system
- Maintain WordPress security best practices throughout implementation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major modernization of HVAC plugin for PHP 8+ with full backward compatibility:
CORE MODERNIZATION:
- Implement strict type declarations throughout codebase
- Modernize main plugin class with PHP 8+ features
- Convert array syntax to modern PHP format
- Add constructor property promotion where applicable
- Enhance security helpers with modern PHP patterns
COMPATIBILITY FIXES:
- Fix PHP 8.1+ enum compatibility (convert to class constants)
- Fix union type compatibility (true|WP_Error → bool|WP_Error)
- Remove mixed type declarations for PHP 8.0 compatibility
- Add default arms to match expressions preventing UnhandledMatchError
- Fix method naming inconsistency (ensureRegistrationAccess callback)
- Add null coalescing in TEC integration for strict type compliance
DEPLOYMENT STATUS:
✅ Successfully deployed and tested on staging
✅ Site functional at https://upskill-staging.measurequick.com✅ Expert code review completed with GPT-5 validation
✅ MCP Playwright testing confirms functionality
Ready for production deployment when requested.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add Docker plugin management script for staging integration
- Implement Docker environment configuration template and verification
- Add comprehensive Docker environment status documentation
- Enhance master trainer test suite with certificate diagnostics and profile management
- Extend test framework page objects with new navigation methods
- Update gitignore patterns to prevent temporary test files from commits
- Configure Claude permissions for Docker test execution
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add 90+ test files including E2E, unit, and integration tests
- Implement Page Object Model (POM) architecture
- Add Docker testing environment with comprehensive services
- Include modernized test framework with error recovery
- Add specialized test suites for master trainer and trainer workflows
- Update .gitignore to properly track test infrastructure
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated .claude/settings.local.json with additional read permissions
for accessing .claude directory and agents.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added wordpress-plugin-pro: Expert WordPress plugin developer for custom plugins and TEC integration
- Added wordpress-code-reviewer: Security-focused WordPress code review specialist
- Added wordpress-troubleshooter: WordPress debugging and issue diagnosis specialist
- Added wordpress-tester: Comprehensive WordPress testing and validation specialist
- Added wordpress-deployment-engineer: WordPress deployment and staging management specialist
- Added php-pro: General PHP development specialist for WordPress plugin development
- Updated .gitignore to include .claude/agents/ directory and agent files
These specialized agents provide comprehensive WordPress development capabilities
referenced in CLAUDE.md for systematic plugin development, testing, and deployment.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed registration form not displaying due to missing HVAC_Security_Helpers dependency
- Added require_once for dependencies in class-hvac-shortcodes.php render_registration()
- Fixed event edit HTTP 500 error by correcting class instantiation to HVAC_Event_Manager
- Created comprehensive E2E test suite with MCP Playwright integration
- Achieved 70% test success rate with both issues fully resolved
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive memory entry documenting the complete Master Trainer
area audit and implementation work completed on 2025-08-23.
Documents:
- 5 missing pages implemented with full functionality
- Navigation improvements and UX cleanup
- 4 new manager classes with WordPress best practices
- Security, performance, and testing implementation
- 16 new files and 8,438+ lines of production-ready code
References detailed technical documentation in
MASTER-TRAINER-AUDIT-IMPLEMENTATION.md for future maintenance.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Systematic audit and implementation of missing Master Trainer functionality
with comprehensive WordPress best practices and security implementation.
## Features Implemented
- Master Events Overview (/master-trainer/events/) - KPI dashboard with filtering
- Import/Export Data Management (/master-trainer/import-export/) - CSV operations
- Communication Templates (/trainer/communication-templates/) - Professional templates
- Enhanced Announcements (/master-trainer/announcements/) - Dynamic shortcode integration
- Pending Approvals System (/master-trainer/pending-approvals/) - Workflow management
## Navigation & UX Improvements
- Removed redundant Events link from top-level navigation menu
- Reorganized administrative functions under Tools dropdown
- Enhanced navigation clarity and professional appearance
- Full responsive design with accessibility compliance
## Architecture & Security
- 5 new singleton manager classes following WordPress patterns
- Comprehensive role-based access control (hvac_master_trainer)
- Complete security implementation (nonces, sanitization, escaping)
- Performance optimizations with transient caching and conditional loading
- Professional error handling and user feedback systems
## Files Added (16 new files)
- 4 manager classes: Import/Export, Events Overview, Pending Approvals, Communication Templates
- 4 CSS files with responsive design and accessibility features
- 4 JavaScript files with AJAX functionality and error handling
- 2 new templates: Import/Export, Pending Approvals
- 2 enhanced templates: Events Overview, Communication Templates
## Files Modified (14 files)
- Core system integration in Plugin, Page Manager, Scripts/Styles classes
- Navigation system cleanup in Master Menu System
- Enhanced access control and role management
- Template updates for dynamic content integration
## Testing & Deployment
- Comprehensive testing with Playwright automation
- Successful staging deployment and verification
- All 5 missing pages now fully functional
- Navigation improvements verified working
Resolves master trainer area audit requirements with production-ready implementation.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>