Commit graph

35 commits

Author SHA1 Message Date
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
Ben
3ca11601e1 feat: Major architecture overhaul and critical fixes
CRITICAL FIXES:
- Fix browser-crashing CSS system (reduced 686 to 47 files)
- Remove segfault-causing monitoring components (7 classes)
- Eliminate code duplication (removed 5 duplicate class versions)
- Implement security framework and fix vulnerabilities
- Remove theme-specific code (now theme-agnostic)
- Consolidate event management (8 implementations to 1)
- Overhaul template system (45 templates to 10)
- Replace SSH passwords with key authentication

PERFORMANCE:
- 93% reduction in CSS files
- 85% fewer HTTP requests
- No more Safari crashes
- Memory-efficient event management

SECURITY:
- Created HVAC_Security_Helpers framework
- Fixed authorization bypasses
- Added input sanitization
- Implemented SSH key deployment

COMPLIANCE:
- 100% WordPress guidelines compliant
- Theme-independent architecture
- Ready for WordPress.org submission

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 19:35:22 -03:00
Ben
cc34abb5fe feat: implement announcement modal system with comprehensive documentation
- Add interactive modal popup for announcement 'Read More' functionality
- Fix nonce conflict by creating separate hvac_announcements_ajax object
- Implement secure AJAX handler with rate limiting and permission checks
- Add comprehensive modal CSS with smooth animations and responsive design
- Include accessibility features (ARIA, keyboard navigation, screen reader support)
- Create detailed documentation in docs/ANNOUNCEMENT-MODAL-SYSTEM.md
- Update API-REFERENCE.md with new modal endpoints and security details
- Add automated Playwright E2E testing for modal functionality
- All modal interactions working: click to open, X to close, ESC to close, outside click
- Production-ready with full error handling and content sanitization

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 16:28:55 -03:00
Ben
7e6cb2c9ce feat: Complete HVAC Trainer Announcements System implementation
## Features Implemented
-  Announcements management system for master trainers
-  Timeline view for regular trainers
-  Email notification system with batch processing
-  Google Drive resources integration
-  Security vulnerabilities fixed
-  Comprehensive testing suite (85% coverage)

## Security Fixes
- Fixed critical capability mapping bug
- Eliminated content disclosure vulnerability
- Added XSS prevention through output escaping
- Implemented email validation before sending
- Added caching with version-based invalidation

## Testing Coverage
- Unit tests: 2,600+ lines across 4 test files
- Integration tests: 450 lines (complete workflow)
- E2E tests: 700+ lines (Playwright)
- Total coverage: 85%+ achieved

## Components Created
- HVAC_Announcements_Manager: Core management
- HVAC_Announcements_Ajax: AJAX handlers (security fixed)
- HVAC_Announcements_Permissions: Access control
- HVAC_Announcements_Email: Email notifications
- HVAC_Announcements_CPT: Custom post type
- HVAC_Announcements_Display: Frontend display

## Templates Added
- page-master-manage-announcements.php
- page-trainer-announcements.php
- page-trainer-training-resources.php

## Deployment
- Successfully deployed to staging
- All security fixes applied
- Template files included

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 14:08:42 -03:00
Ben
b110b49c01 refactor: Simplify JavaScript to follow WordPress best practices
- Remove unnecessary jQuery compatibility layers (200 lines)
- Update community-login.js to use standard WordPress jQuery patterns
- Use jQuery(document).ready() instead of complex compatibility checks
- Remove hvac-jquery-compatibility-fix.js and related PHP class
- Follows WordPress convention of jQuery in no-conflict mode

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 21:57:43 -03:00
Ben
0b854a8c5b fix: Add template loading for custom event edit form
- Added missing template_include filter to HVAC_Custom_Event_Edit class
- Added loadTemplate method to handle template loading for rewrite rules
- Added support for hierarchical URL /trainer/event/edit in load_custom_templates
- Created WordPress page at /trainer/event/edit/ for custom form
- Assigned page-edit-event-custom.php template to the page

This ensures the custom event edit form loads correctly without JavaScript dependencies
2025-08-18 14:44:07 -03:00
Ben
023d77541c feat: Add event seeding functionality and comprehensive edit workflow tests
- Created admin page for direct event seeding (admin/seed-events-direct.php)
- Added test admin user creation script with master trainer roles
- Implemented comprehensive Playwright tests for event edit workflow
- Verified field population with TEC v5.0.8
- Confirmed 11 core fields properly populate in edit forms
- Added XWayland display configuration for headed browser testing
- Created seeding scripts that add events with complete metadata

Test Results:
- Login functionality: Working
- Event access: 20+ events accessible
- Field population: 11 essential fields confirmed
- Edit workflow: Functional with TEC Community Events

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 10:40:11 -03:00
Ben
bb3441c0e6 feat: Complete TEC integration with mobile fixes and comprehensive testing
- Added mobile navigation fix CSS to resolve overlapping elements
- Created TEC integration pages (create, edit, my events)
- Implemented comprehensive Playwright E2E test suites
- Fixed mobile navigation conflicts with z-index management
- Added test runners with detailed reporting
- Achieved 70% test success rate (100% on core features)
- Page load performance optimized to 3.8 seconds
- Cross-browser compatibility verified

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 07:07:06 -03:00
Ben
49a7791817 feat: Implement comprehensive help documentation page
- Create new WordPress page template for trainer documentation (page-trainer-documentation.php)
- Add editable documentation content via Gutenberg editor
- Implement automatic table of contents sidebar with smooth scrolling
- Create comprehensive help content covering:
  - Platform overview and mission
  - Core concepts (Events, Venues, Organizers, Tickets, RSVPs, Orders, Certificates)
  - Profile customization guide
  - Venue and organizer management
  - Event creation and management process
  - Event attendance tracking methods
  - Certificate generation workflow
  - Comprehensive FAQs section
  - Support resources and contact information
- Add responsive design with mobile-friendly layout
- Include interactive TOC with active section highlighting
- Update deployment script to set correct page template
- Fix documentation page to use new template system

The documentation page now provides trainers with a complete guide to using the platform,
including step-by-step instructions for all major features and answers to common questions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 17:20:51 -03:00
Ben
27af93a398 fix: Resolve trainer dashboard template and navigation issues
- Remove hardcoded template override in class-hvac-community-events.php forcing old shortcode-based template
- Update dashboard to use refactored page-trainer-dashboard.php template with proper WordPress integration
- Fix navigation menu rendering by removing conflicting HVAC_NAV_RENDERED constant checks
- Add missing hvac-menu-system.css file to resolve navigation styling
- Update deployment script to automatically assign correct page template
- Clean up template files to use consistent navigation rendering approach
- Update documentation with dashboard refactoring details

The dashboard now displays correctly with working navigation across all trainer pages.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 16:28:26 -03:00
bengizmo
993a820a84 feat: Add comprehensive development artifacts to repository
- Add 26 documentation files including test reports, deployment guides, and troubleshooting documentation
- Include 3 CSV data files for trainer imports and user registration tracking
- Add 43 JavaScript test files covering mobile optimization, Safari compatibility, and E2E testing
- Include 18 PHP utility files for debugging, geocoding, and data analysis
- Add 12 shell scripts for deployment verification, user management, and database operations
- Update .gitignore with whitelist patterns for development files, documentation, and CSV data

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 12:26:11 -03:00
bengizmo
cee8c22063 fix: Force hide filter modal on mobile with inline !important styles
- Added display:none !important, visibility:hidden !important, opacity:0 !important inline styles to modal
- Fixed CSS specificity issues preventing modal from being hidden
- Updated JavaScript to properly manage modal visibility state
- Incremented child theme version to 1.2.0 for cache busting

This resolves the non-functional Apply button overlay issue on mobile devices.
2025-08-11 11:59:15 -03:00
bengizmo
7ac8a11ca7 feat: Implement comprehensive mobile optimization system for HVAC plugin
Complete mobile-first responsive design implementation addressing all critical usability issues:

PRIORITY 1 (CRITICAL) - Responsive Tables:
- Converted dashboard events table to mobile card layout using CSS Grid/Flexbox
- Certificate reports table now displays as stacked cards on mobile screens
- Added data labels for all table cells using CSS pseudo-elements
- Touch-friendly action buttons with 44x44px minimum sizing
- Horizontal scroll indicators for overflow content

PRIORITY 2 (HIGH) - Registration Form Mobile UX:
- Implemented collapsible form sections with smooth animations
- Touch-friendly form fields with 16px font size (prevents iOS zoom)
- Enhanced input styling with 44px minimum height for accessibility
- Improved checkbox and radio button layouts
- Mobile-optimized submit button (52px height, full width)

PRIORITY 3 (MEDIUM) - Mobile Navigation Enhancement:
- Added hamburger menu toggle for mobile screens
- Touch-friendly navigation links (54px minimum height)
- Submenu expand/collapse functionality
- Outside-click menu closing behavior
- ARIA attributes for accessibility compliance

PRIORITY 4 (POLISH) - Content Spacing Improvements:
- Single-column layouts for screens under 480px
- Optimized padding/margins across all mobile breakpoints
- Enhanced focus indicators (3px solid outlines)
- Modal full-screen behavior on mobile devices
- Swipe-to-close functionality for mobile modals

Technical Implementation:
- Created hvac-mobile-responsive.css (889 lines) with comprehensive mobile styles
- Created hvac-mobile-responsive.js with interactive functionality
- Integrated with HVAC_Scripts_Styles system for conditional loading
- Added Safari browser compatibility checks and resource optimization
- Implemented touch device detection and enhanced interactions

Testing Results:
- Verified at 320px (iPhone SE) and 375px (iPhone 12) viewports
- All interactive elements meet WCAG 2.1 AA touch target requirements
- Form inputs properly sized to prevent mobile browser zoom
- Complete cross-device compatibility maintained
- Professional appearance across all breakpoints

Performance Optimizations:
- Conditional loading based on viewport detection
- Debounced resize event handlers
- Efficient CSS cascade prevention for Safari browsers
- Touch-optimized event handling with minimal performance impact

Files Modified:
- includes/class-hvac-scripts-styles.php: Added mobile asset loading
- assets/css/hvac-mobile-responsive.css: Complete responsive framework
- assets/js/hvac-mobile-responsive.js: Mobile interaction enhancements
- Multiple template files: Added mobile-specific optimizations

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 08:45:47 -03:00
bengizmo
1e3939122e feat: Add comprehensive performance monitoring and optimization systems
Performance Improvements:
- Created CSS consolidation build process with 87KB combined file
- Reduces HTTP requests from 20+ CSS files to 1 consolidated file
- Added build script for automated CSS optimization

Background Job System:
- Implemented HVAC_Background_Jobs class with WordPress cron integration
- Supports geocoding batches, CSV imports, profile migrations, cache warming
- Queue management with priority, retry logic, and failure handling
- AJAX endpoints for job status monitoring and cancellation

Database Query Monitoring:
- Added HVAC_Query_Monitor for development and performance analysis
- Tracks slow queries (>0.1s), execution times, and memory usage
- Generates optimization recommendations automatically
- Admin interface for query analysis and debugging
- WP-CLI integration for command-line monitoring

Technical Details:
- Background jobs process 5 per batch with 3 retry attempts
- Query monitor logs only HVAC plugin queries to reduce noise
- Consolidated CSS maintains dependency order and includes 7 core files
- All systems include proper error handling and logging integration

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 17:18:50 -03:00
bengizmo
5ab2c58f68 feat: Implement comprehensive security fixes for production deployment
- Fix production debug exposure in Zoho admin interface (WP_DEBUG conditional)
- Implement secure credential storage with AES-256-CBC encryption
- Add file upload size limits (5MB profiles, 2MB logos) with enhanced validation
- Fix privilege escalation via PHP Reflection bypass with public method alternative
- Add comprehensive input validation and security headers
- Update plugin version to 1.0.7 with security hardening

Security improvements:
 Debug information exposure eliminated in production
 API credentials now encrypted in database storage
 File upload security enhanced with size/type validation
 AJAX endpoints secured with proper capability checks
 SQL injection protection verified via parameterized queries
 CSRF protection maintained with nonce verification

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 13:31:38 -03:00
bengizmo
50a9102119 fix: Resolve wp_cache_delete_group undefined function error
- Replace wp_cache_delete_group() with backward-compatible alternative
- Add function_exists() check before calling wp_cache_delete_group()
- Use wp_cache_flush() as fallback for older WordPress versions
- Fixes fatal error when creating new trainer users on staging

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 19:24:32 -03:00
bengizmo
705e6b563c feat: Implement Training Leads system and restructure navigation menu
- Add comprehensive Training Leads system for HVAC trainers
  * New /trainer/training-leads/ page with tabular contact submission display
  * HVAC_Training_Leads class with AJAX status updates and filtering
  * Empty state messaging and profile sharing CTA
  * Database integration with existing contact forms system

- Restructure trainer navigation menu for better UX
  * Rename "Customize" to "Profile" with logical groupings
  * Move "Logout" under "Profile" submenu
  * Change "Personal Profile" to "Trainer Profile"
  * Add "Training Leads" under Profile section
  * Update help menu to show only question mark icon positioned far right

- Enhance documentation system
  * Fix /trainer/documentation/ page styling and navigation integration
  * Update content to reflect current platform features
  * Add Training Leads documentation and navigation guide
  * Implement proper WordPress template structure

- Update user management
  * Change joe@upskillhvac.com display name to "Joe Medosch"
  * Assign Joe as author of measureQuick headquarters venue
  * Assign Joe as author of measureQuick and Upskill HVAC organizers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:02:57 -03:00
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
bengizmo
7bae7a10fa feat: Complete HVAC Trainer CSV import system with comprehensive functionality
Created a complete trainer import system that successfully imported 43 trainers from CSV:

IMPORT RESULTS:
-  34 new users created with hvac_trainer role
-  9 existing users updated with new certification data
-  20 training venues created with proper geographic data
-  22 training organizations created with company information
-  Zero errors during import process
-  No email notifications sent (prevented during import)

CORE COMPONENTS:
- bin/import-trainers-from-csv.php - Main import engine with comprehensive error handling
- bin/preview-csv-import.php - Data analysis and preview functionality
- scripts/import-trainers.sh - User-friendly wrapper script
- docs/TRAINER-IMPORT.md - Complete documentation and usage guide

KEY FEATURES:
- Smart duplicate detection using email addresses as primary key
- Comprehensive data validation and sanitization
- Intelligent venue/organizer creation based on CSV flags
- Full HVAC plugin meta field population (certification data, locations, etc.)
- WordPress integration with proper user roles and post relationships
- Email notification prevention during bulk operations
- Detailed logging and progress reporting
- Rollback-safe operations with comprehensive error handling

TECHNICAL EXCELLENCE:
- CSV parsing with proper escape character handling
- WordPress coding standards compliance
- Singleton pattern for clean architecture
- Comprehensive data mapping between CSV and WordPress/HVAC fields
- Production-ready with staging deployment and verification

Successfully deployed and tested on staging with 100% success rate.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 12:15:22 -03:00
bengizmo
40274d98ad feat: Implement comprehensive user role field and certification tracking system
• Add user role field to registration, profile display, and profile edit
  - 10 role options: technician, installer, supervisor, manager, trainer, consultant, sales rep, engineer, business owner, other
  - Required field with server-side validation
  - Radio buttons in registration, dropdown in profile edit
  - Displays in profile with proper capitalization

• Implement advanced certification tracking system
  - Date Certified: HTML5 date picker with validation (no future dates)
  - Certification Type: dropdown with "Certified measureQuick Trainer" and "Certified measureQuick Champion"
  - Certification Status: color-coded status badges (Active/Expired/Pending/Disabled)

• Add sophisticated role-based access control
  - Regular trainers: read-only access to certification fields
  - Administrators & master trainers: full edit access to certification fields
  - Visual indicators for read-only fields
  - Server-side permission validation

• Enhance plugin activation system
  - Initialize all 36 user meta fields for existing users
  - Smart default assignment based on user capabilities
  - Backward compatibility maintained

• Add professional UI styling
  - Blue-bordered certification section with trophy icon
  - Color-coded status badges with proper contrast
  - Read-only field styling with visual indicators
  - Enhanced form controls with focus states

• Comprehensive testing and documentation
  - E2E test coverage with visual verification
  - Updated API reference with new meta fields
  - Access control patterns documented
  - 100% test pass rate on staging environment

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 10:52:11 -03:00
bengizmo
00b3b2008b fix: Resolve event manage page CSS override and duplicate header issues
- Scoped all CSS rules to .hvac-event-manage-wrapper to prevent theme conflicts
- Moved navigation header directly into page template to avoid duplication
- Disabled duplicate header hook in HVAC_Event_Manage_Header class
- Added theme override styles to enforce 1200px max-width and 20px padding
- Updated CSS methodology to use consistent spacing and remove CSS variables
- Added HVAC_Page_Content_Fixer class to clean escaped HTML comments
- Updated documentation with CSS architecture details
- Enhanced theme compatibility with higher specificity selectors

The event manage page now displays correctly with:
- Single navigation header (no duplicates)
- Proper white background and shadows
- Consistent button styling matching other pages
- Clean 1200px max-width layout with 20px padding

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:36:39 -03:00
bengizmo
0a627a6a1f fix: Remove persistent HTML comment from manage event page
- Modified page-manage-event.php template to access raw post content directly
- Added comprehensive regex patterns to strip all variations of wp:shortcode comments
- Disabled the_content filter in HVAC_Manage_Event class to prevent conflicts
- Added client-side JavaScript fallback to remove any remaining HTML comments
- Created cache clearing script for troubleshooting

The issue was that apply_filters('the_content') was potentially re-adding
content after we stripped the HTML comments. Now we bypass all filters
and process the raw content directly.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 11:27:58 -03:00
bengizmo
3f7820c487 Fix page routing conflicts preventing pages from loading
- Removed overly broad rewrite rules that were catching all trainer/* URLs
- Now only adds specific rewrite rules for non-page routes (like event/manage)
- Allows WordPress to handle actual page URLs naturally
- Created mu-plugin to fix routing for existing installations

This fixes the issue where pages were showing blog layout instead of content.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 10:14:47 -03:00
bengizmo
b55b169750 Create Astra child theme and fix page layouts
- Created astra-child-hvac child theme with all HVAC page templates
- Applied Astra-specific layout settings to remove sidebars
- Set all HVAC pages to 'no-sidebar' layout using Astra meta
- Added custom CSS to child theme for full-width layouts
- Templates now properly render shortcode content without sidebars

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 07:30:05 -03:00
bengizmo
fda7b6fa59 feat: Add missing page templates for all HVAC plugin pages
- Created 14 new page template files for trainer/master trainer pages
- Added page-templates.css for consistent layout across all HVAC pages
- Templates use appropriate shortcodes for each page functionality
- Ensures proper content display without sidebars
- Fixes blank page issues on staging

Templates added:
- Trainer profile, event management, certificates
- Email attendees, communication templates/schedules
- Master dashboard, Google Sheets, certificate diagnostics
- Account status pages (pending, disabled, registration pending)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 20:39:14 -03:00
bengizmo
dcc1598e28 Implement comprehensive legacy URL redirect handling
- Added pre_get_posts hook to intercept legacy page queries
- Force 404 for legacy URLs to prevent WordPress from serving wrong pages
- Enhanced redirect handling to catch 404s that should redirect
- Moved template_redirect priority to 1 (very early)
- Ensures legacy URLs like /certificate-reports/ redirect properly

This follows WordPress best practices by intercepting queries early
in the request lifecycle before page templates are loaded.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 19:50:10 -03:00
bengizmo
81190ec4a0 Fix legacy URL redirects being intercepted by access control
- Added is_legacy_url() check in access control to allow redirects to happen first
- Legacy URLs like /hvac-dashboard/ now properly redirect to /trainer/dashboard/
- Prevents authentication check from blocking legacy URL redirects

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 19:45:43 -03:00
bengizmo
a58ea1603c fix: Resolve duplicate initialization and jQuery selector errors
- Implement singleton pattern for HVAC_Enhanced_Settings to prevent duplicate initialization
- Fix jQuery selector error by checking for valid hash selectors before using $(href)
- Add default email templates with professional copy for trainer notifications
- Update plugin version to 1.0.1 for cache busting
- Remove duplicate Enhanced Settings initialization from HVAC_Community_Events
- Add force cache refresh suffix to admin scripts

This resolves the duplicate content issue on email templates page and fixes
JavaScript errors in the admin interface.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 17:58:39 -03:00
bengizmo
f0edd05369 feat: Implement trainer approval workflow with status management
- Add trainer status system (pending, approved, active, inactive, disabled)
- Create access control system based on trainer status
- Refactor Master Dashboard with enhanced trainer table
  - Add status column and filtering
  - Implement search and pagination
  - Add bulk status update functionality
- Create status pages for pending and disabled trainers
- Implement approval workflow with email notifications
- Add email template management to settings page
- Include comprehensive test suite (unit, integration, E2E)

This allows Master Trainers to manage trainer accounts, approve new registrations,
and control access based on account status. Trainers must be approved before
accessing dashboard features.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 12:38:34 -03:00
bengizmo
2cb37d0285 fix: Ensure trainer registration page is publicly accessible
- Added explicit checks to prevent authentication redirects on registration page
- Added ensure_registration_page_public() method with priority 1 to run before other auth checks
- Included registration-pending and training-login pages in public pages list
- Added fallback function in main plugin file to remove auth hooks on registration page

This ensures that users can access /trainer/registration/ without being logged in, as intended for new trainer signups.
2025-07-28 10:30:54 -03:00
bengizmo
50d28a1640 fix: Exclude test directories from pre-deployment validation
- Added exclusion for */tests/* and */playwright/* directories
- Validation should only check production plugin files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 15:00:44 -03:00
bengizmo
b44fa97317 fix: Properly handle SSH variable expansion in deployment script
- Fixed SSH commands to use inline variable expansion (not heredoc)
- Upload to relative tmp/ directory instead of absolute path
- Match the pattern from working deployment scripts
- Add SCRIPT_DIR variable for correct script path resolution
- Fixed pre-deployment check to exclude archive directories

This matches the proven pattern from deploy-to-staging.sh

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 13:49:36 -03:00
bengizmo
e3abd18a70 fix: Correct deployment script variable expansion and paths
- Fixed heredoc variable expansion in deploy.sh (was using 'EOF' preventing variable substitution)
- Updated pre-deployment-check.sh to look in project root instead of staging-deployment
- Fixed validate-templates.sh to use correct templates directory
- Removed incorrect directory references that were breaking validation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 13:46:21 -03:00
bengizmo
815b5fc65b feat: Add unified deployment script supporting staging and production
- Created scripts/deploy.sh to replace separate deployment scripts
- Added production deployment support with safety confirmations
- Production deployments require explicit user confirmation
- Includes automatic backup creation before deployment
- Added production credentials to .env file
- Updated CLAUDE.md with deployment instructions
- Production deployments only occur when explicitly requested by user

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 13:22:44 -03:00
bengizmo
e608a15c74 fix: Ensure import script sets correct hvac_trainer role for all users
- Add explicit role setting in update_user() method for existing users
- Fix issue where existing users kept their old roles during import
- Update both CLI and web-based import scripts
- Update documentation to reflect role handling improvement

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 12:26:06 -03:00