This commit implements Phase 1 of the Communication Schedule system, providing:
Core Infrastructure:
- HVAC_Communication_Scheduler: Main controller with cron integration and AJAX handlers
- HVAC_Communication_Schedule_Manager: CRUD operations and database interactions
- HVAC_Communication_Trigger_Engine: Automation logic and recipient management
- HVAC_Communication_Logger: Execution logging and performance tracking
- HVAC_Communication_Installer: Database table creation and management
Features:
- Event-based triggers (before/after event, on registration)
- Custom date scheduling with recurring options
- Flexible recipient targeting (all attendees, confirmed, custom lists)
- Template integration with placeholder replacement
- WordPress cron integration for automated execution
- Comprehensive AJAX API for schedule management
- Template quickstart options for common scenarios
UI Components:
- Communication Schedules page with full management interface
- Form-based schedule creation with validation
- Schedule listing with filtering and status management
- Modal recipient preview functionality
- Pre-configured schedule templates for quick setup
Database Design:
- hvac_communication_schedules: Schedule configurations
- hvac_communication_logs: Execution history and statistics
- hvac_event_communication_tracking: Individual email tracking
The system integrates with existing email templates and provides a foundation
for automated communication workflows for HVAC trainers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create HVAC_Communication_Templates class for managing email templates
- Add template post type with categories and placeholders
- Implement AJAX handlers for CRUD operations
- Create responsive template management interface with modal forms
- Add template manager widget for integration with email forms
- Include placeholder system for dynamic content (attendee_name, event_title, etc.)
- Add default templates for common scenarios (reminders, welcome, certificates)
- Create template management page with category filtering
- Add comprehensive E2E tests for template functionality
- Integrate widget into email attendees page
- Support template save/load/edit/delete operations
- Include CSS styling with responsive design and accessibility features
- Add JavaScript for interactive functionality and form handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove duplicate hvac_trainer_registration shortcode registration
- Fix static vs instance method call in edit profile shortcode
- Add debugging logs to track shortcode registration
- Add comprehensive E2E test for trainer registration page
- Clean up shortcode initialization order
Issue persists with shortcode not being processed on frontend.
Requires further investigation into WordPress shortcode processing.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add complete Google Sheets integration system for HVAC Community Events:
Core Components:
- Google Sheets OAuth 2.0 authentication handler
- Google Sheets manager for spreadsheet creation and data export
- Admin interface with full UI for configuration and operations
- Integration with Master Dashboard data aggregation
Features Implemented:
- Master Report generation with 4 tabs (Overview, Performance, Events, Revenue)
- Event-specific spreadsheets with 3 tabs (Details, Attendees, Financial)
- Connection status monitoring and testing
- Report history tracking and management
- AJAX endpoints for all operations
- Responsive admin interface with loading states
Integration Points:
- Page creation during plugin activation (/google-sheets/)
- Access control matching Master Dashboard permissions
- Navigation integration from Master Dashboard
- CSS loading and template support
- Extended Master Dashboard data class with additional methods
Configuration:
- Template configuration file for Google Cloud setup
- OAuth 2.0 flow with token management and refresh
- Google Sheets API and Drive API integration
- Secure token storage using WordPress options
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added hvac_master_trainer role with special capabilities:
* view_master_dashboard
* view_all_trainer_data
* manage_google_sheets_integration
- Created Master Dashboard page and template:
* System overview with 6 key statistics (events, trainers, revenue)
* Trainer performance analytics table
* All events management with filtering
* System-wide data aggregation across all trainers
- Implemented comprehensive access control:
* Master trainers and administrators can access
* Regular trainers denied with proper error handling
* Non-logged users redirected to login
- Added data aggregation class (HVAC_Master_Dashboard_Data):
* Direct database queries bypass TEC trainer filters
* Aggregates events, tickets, and revenue across all users
* Methods for total events, trainer stats, and events data
- Enhanced template loading and shortcode registration:
* Added [hvac_master_dashboard] shortcode
* Integrated master dashboard template loading
* Uses harmonized CSS framework for consistent styling
- Created comprehensive Playwright test suite:
* Tests administrator and trainer access
* Verifies access control and error handling
* Validates data display and UI rendering
* Includes visual verification with screenshots
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add hvac_master_trainer role with enhanced capabilities including view_master_dashboard, view_all_trainer_data, manage_google_sheets_integration
- Create HVAC_Master_Dashboard_Data class for system-wide analytics aggregating data across all trainers
- Implement Master Dashboard template using existing harmonized CSS framework showing total events, revenue, trainer performance
- Add hvac_master_dashboard shortcode with proper authentication and permission checks
- Update plugin activation to create master trainer role and master dashboard page
- Grant administrators access to all master trainer capabilities
- Add template routing and authentication checks for master dashboard access
- Extend asset loading to include master dashboard styling using existing dashboard CSS
- Create trainer performance analytics table and system overview statistics
- Structure data for future Google Sheets integration compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move HVAC_Manage_Event initialization to proper init() method
- Fix help system initialization (use singleton pattern)
- Add help system to includes list
- Page now properly processes [tribe_community_events] shortcode
- Shows helpful error when TEC Community Events is inactive
- Added HVAC_Manage_Event class to handle shortcode processing
- Ensures do_shortcode() is explicitly called for the page content
- Shows helpful message if TEC Community Events plugin is not active
- Adds authentication check for the manage-event page
This fixes the issue where the raw shortcode was being displayed instead of the event submission form.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The HVAC plugin was overriding The Events Calendar Community Events
shortcode with a custom implementation that displayed a non-functional
form instead of the proper TEC Community Events form. This caused events
to never be created when users submitted the form.
Changes:
- Removed add_shortcode('tribe_community_events', ...) override
- Removed render_tribe_community_events() method
- Removed render_event_submission_form() helper method
The manage-event page now correctly uses The Events Calendar Community
Events plugin shortcode, allowing proper event creation and submission.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Created new HVAC_Certificate_URL_Handler class that intercepts certificate URLs directly
- Hooks into multiple early WordPress actions (plugins_loaded, init, parse_request)
- Bypasses WordPress rewrite rules for more reliable certificate URL handling
- Added early initialization in main plugin file before WordPress routing
- Includes comprehensive test tool for certificate URL verification
This should resolve certificate viewing 404 errors by handling URLs before WordPress routing.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit provides a comprehensive fix for the certificate download 404 errors:
## Problem
Certificate URLs (/hvac-certificate/{token}/) were returning 404 errors even after deployment because WordPress rewrite rules weren't properly registered or flushed.
## Solutions Implemented
### 1. Enhanced Plugin Activation
- Certificate security class is now initialized BEFORE flushing rewrite rules during activation
- This ensures the custom rewrite rule 'hvac-certificate/([^/]+)/?$' is registered
- Activation now properly adds the rule and flushes to make it active
### 2. Added Certificate Fix Admin Page
- New diagnostics page at /certificate-fix/ (admin only)
- Shows certificate system status including:
- Database table status and counts
- Certificate file directory status
- Recent certificate activity
- Includes 'Flush Rewrite Rules' button for manual fixing
- Provides direct test link for rewrite rule verification
### 3. Rewrite Rules Test Tool
- Added test script accessible at /wp-admin/admin.php?test_certificate_rewrite=1
- Shows whether certificate rewrite rules are registered
- Verifies query vars are properly set
- Can manually add and flush rules if missing
### 4. Manual Flush Capability
- Admins can trigger flush via /wp-admin/?hvac_flush_rewrite=1
- Useful for debugging without accessing Certificate Fix page
## User Instructions
If certificate URLs still return 404:
1. Go to /certificate-fix/ page
2. Click 'Flush Rewrite Rules' button
3. Test certificate viewing again
The certificate download system uses secure token-based URLs that expire after 1 hour for security. These URLs must be properly registered with WordPress rewrite rules to function.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Certificate Reports: Complete template rewrite with robust error handling, direct database queries, and proper statistics display
- Fix Generate Certificates: Simplified template with reliable attendee loading, proper form handling, and enhanced user experience
- Fix Create Event: Enhanced TEC Community Events detection with improved shortcode handling and informative messaging
- Fix My Events removal: Systematic elimination of all My Events references, navigation links, and shortcode handlers
- Fix duplicate Help links: Remove tooltip wrapper from Help button to eliminate visual duplication on dashboard
- Add comprehensive error handling and graceful fallbacks throughout certificate system
- Implement mobile-responsive designs with modern CSS styling
- Ensure all fixes are tested and verified with E2E test suite
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Certificate Reports page to properly display certificates with statistics and filtering
- Fix Generate Certificates page to load attendees correctly and resolve PHP errors
- Fix Create Event page to properly detect and use TEC Community Events shortcode
- Remove all My Events navigation links and replace with Certificate Reports links
- Fix help system by removing duplicate navigation elements
- Add comprehensive E2E test suite to verify all fixes and prevent regressions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add navigation buttons to Certificate Reports page for better accessibility
- Improve Generate Certificates page event selection workflow
- Update Create Event page to remove admin area button and add navigation
- Fix Profile page edit link to open in new tab with better UX
- Change dashboard event status display from 'Publish' to 'Published' for clarity
- Remove simplified form notice and admin area redirect from event creation
- Allow TEC Community Events to handle forms natively when available
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Updated comprehensive test data script to use proper deployment configuration
- Fixed test data script file paths and deployment process
- Enhanced login form with better error/success messaging
- Improved Zoho admin interface with detailed OAuth flow
- Fixed login page styling to prevent theme constraints
- Added proper error handling for expired/invalid Zoho tokens
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove duplicate 'My Events' button from dashboard navigation
- Remove duplicate 'Help' link while maintaining tooltip functionality
- Fix 'Create Event' page showing shortcode instead of form by implementing custom shortcode handler
- Fix 'Certificate Reports' critical error by removing problematic debug statements
- Update project documentation with help system details and recent fixes
- Add help system test commands to README.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit addresses the 500 error on the certificate-reports page by:
1. Adding proper error handling to certificate templates
2. Ensuring required classes are loaded in the right order
3. Adding try-catch blocks for better error reporting
4. Creating diagnostic and troubleshooting tools
5. Fixing method signature issues in the certificate manager
The issues were caused by missing database tables or classes not being loaded in the correct order.
Additional improvements:
- Added certificate system diagnostic scripts
- Added comprehensive troubleshooting documentation
- Added automated fix deploy script
- Add detailed logging for email system to track issues
- Use PHP mail() as fallback when wp_mail() fails
- Improve recipient matching and validation
- Add debug tools to diagnose email issues on staging
- Add email system debugging panel for admin users
- Fix direct sending for attendees created from test data
- Handle different email field formats from test attendees
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated the dashboard shortcode render method to use the correct template path.
Added page rendering verification test to ensure shortcodes render properly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements the Email Attendees feature which allows trainers to:
- Email event attendees directly from the Event Summary page
- Filter attendees by ticket type
- Use a rich text editor to compose messages
- Include CC recipients
- Send personalized emails to selected attendees
Includes unit tests, integration tests, and E2E tests to verify functionality.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add profile edit form template
- Implement profile update handler with validation
- Add profile update shortcode registration
- Create E2E test for profile editing
- Support updating personal & business info, location info and training preferences
- Add password change functionality with validation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add robust authentication check in the template file
- Add WordPress hook at template_redirect to prevent unauthorized access
- Update Event Summary Data class with permission methods
- Modify E2E test to check for accessibility after login
- Fix potential errors in the plugin activation code for page creation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add event-summary page to required_pages array in main plugin file
- Update render_event_summary() method to handle event ID from URL
- Update template_include filter to load custom event summary template
- Update dashboard event links to point to new event summary page
- Create comprehensive event summary template with statistics and attendee info
- Add E2E tests for Event Summary Page
- Add documentation for Event Summary functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add trainer-profile page to required_pages array in main plugin file
- Create template-trainer-profile.php with comprehensive profile display
- Implement render_trainer_profile() function in main class
- Add template loading for trainer-profile page
- Create helper script to ensure trainer-profile page exists in WordPress
- Fix shortcode registration in Login_Handler to prevent duplicates
- Add dashboard verification script for testing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix shortcode registration for community login with correct namespace
- Create dedicated page template for community-login page
- Enable template_include filter to properly load custom page templates
- Fix early loading of Login_Handler class
- Update Trainer Login page title and template handling
- Ensure proper shortcode execution on the login page
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement OAuth 2.0 authentication for Zoho CRM
- Add sync functionality for Events → Campaigns, Users → Contacts, Orders → Invoices
- Create staging mode that prevents production syncs from non-production domains
- Build admin interface for sync management
- Add comprehensive field mapping between WordPress and Zoho
- Include test scripts and documentation
- Ensure production sync only on upskillhvac.com domain
- Document enhanced event creation testing improvements
- Add Breeze cache clearing script and integration
- Detail form field mapping discoveries
- Note current validation issues with description field
- Include multiple test approaches implemented
- Update error handling and debugging capabilities
- Add HVAC_Test_User_Factory class with:
* User creation with specific roles
* Multiple role support
* Persona management system
* Account cleanup integration
- Create comprehensive test suite in HVAC_Test_User_Factory_Test.php
- Update testing improvement plan documentation
- Add implementation decisions to project memory bank
- Restructure .gitignore with:
* Whitelist approach for better file management
* Explicit backup exclusions
* Specific bin directory inclusions
Part of the Account Management component from the testing framework improvement plan.
- Refactored fallback submission logic in `class-event-handler.php` to remove `wp_die`/`exit` calls and use redirects for error handling, enabling proper unit testing.
- Implemented meta-data saving (dates, venue, organizer) in the fallback logic using `update_post_meta`.
- Updated unit tests (`test-event-management.php`) to remove `markTestIncomplete` calls related to handler errors and uncommented meta assertions. Unit tests for fallback logic now pass.
- Added Instructions section and Return to Dashboard button to the event form shortcode (`display_event_form_shortcode`).
- Applied basic theme styling classes (`ast-container`, `notice`, `ast-button`) to the event form.
- Updated `docs/implementation_plan.md` to reflect completion of tasks 4.1-4.5 and set focus to Task 5.
Refs: Task 4.1, 4.2, 4.3, 4.4, 4.5
Implements the full HTML structure for the Community Registration form based on requirements, including all specified fields, labels, hints, and basic structure for error display. Adds corresponding JavaScript for dynamic state/province dropdown population.
Creates initial E2E tests (`registration.spec.ts`) for the registration page covering loading, validation scenarios (empty fields, invalid email, password mismatch, weak password), and successful submission. Creates a test data file (`personas.ts`) with sample user data.
Undertakes extensive debugging of failing E2E tests:
- Resolved initial shortcode rendering failure by correctly instantiating the `HVAC_Registration` class.
- Fixed incorrect form ID and submit button selectors in E2E tests.
- Corrected field ID selector (`#business_phone`) in E2E test.
- Refactored form submission handling multiple times (trying `init` hook, `admin_post` hooks, and direct shortcode processing) to address issues with validation error display and success redirects. Reverted to using the `init` hook with transient-based error handling as the most promising path despite current display issues.
- Identified and fixed a fatal PHP error ("Cannot redeclare handle_profile_image_upload") caused by duplicated code during refactoring.
- Troubleshot and resolved Docker volume/cache issues preventing code fixes from taking effect by restarting containers and flushing caches.
- Added and subsequently removed extensive diagnostic logging throughout the PHP classes and main plugin file to trace execution flow.
- Refined Playwright waits in E2E tests, specifically for the dynamically populated state dropdown.
Updates Memory Bank files (`activeContext.md`, `progress.md`) and `docs/implementation_plan.md` to reflect the completed unit test validation (Task 0.6) and the current debugging status of registration E2E tests (Task 1.10).
Current Status:
- Fatal errors resolved, plugin initializes correctly.
- Login E2E tests pass.
- Registration page loads correctly.
- Successful registration E2E test path completes form filling and submission, resulting in the expected redirect.
- Validation error E2E tests still fail as backend errors are not displayed on the frontend after form submission/redirect. Further debugging needed on error display mechanism (likely transient handling or HTML rendering).
Modified Files:
- docs/implementation_plan.md
- memory-bank/activeContext.md
- memory-bank/progress.md
- wordpress-dev/tests/e2e/data/personas.ts (new)
- wordpress-dev/tests/e2e/tests/registration.spec.ts (new)
- wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/assets/js/hvac-registration.js
- wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/hvac-community-events.php
- wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-community-events.php
- wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/class-hvac-registration.php
Implements automatic creation of required plugin pages (Community Login,
Trainer Registration, Trainer Dashboard) upon plugin activation. This
addresses E2E test failures caused by missing pages in the test
environment.
- Adds activation hook in `hvac-community-events.php` to call
`hvac_ce_create_required_pages`.
- The callback function checks for existing pages by slug and creates
them using `wp_insert_post` if missing. Includes debug logging.
Also fixes issues identified during E2E test debugging:
- Corrects fatal error in `includes/community/class-login-handler.php`
by replacing undefined constant `HVAC_COMMUNITY_EVENTS_PATH` with
`HVAC_CE_PLUGIN_DIR`.
- Updates `tests/e2e/tests/login.spec.ts` to use the correct selector
`#wp-submit` for the login form submit button instead of
`button[type="submit"]`.
Documentation updates:
- Adds `docs/automatic-page-creation-plan.md`.
- Updates `README.md` regarding automatic page creation.
- Updates Memory Bank files (`decisionLog.md`, `progress.md`,
`activeContext.md`).
Note: Activation hook logging did not appear during WP-CLI activation,
requiring further investigation if page creation issues persist. E2E
test confirmation pending.