Commit graph

287 commits

Author SHA1 Message Date
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
5e9d122f5a Add authentication protection for master trainer pages
- Added master_trainer_pages array with protected master trainer pages
- Created is_master_trainer_page() method to identify master trainer URLs
- Implemented check_master_trainer_access() to require hvac_master_trainer role
- Master trainer pages now redirect to login if not authenticated
- Only users with hvac_master_trainer role can access these pages

This ensures master trainer dashboard and tools are properly protected.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 19:53:06 -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
64260fca02 fix: Update activator to use new HVAC_Route_Manager class
- Replace deprecated register_legacy_rewrite_rules() call with HVAC_Route_Manager
- Ensures plugin activation works with new architecture

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 18:07:35 -03:00
bengizmo
005a35d89e refactor: Implement new plugin architecture with single-responsibility classes
- Create HVAC_Shortcodes class to centralize shortcode management
- Create HVAC_Scripts_Styles class for all script/style enqueuing
- Create HVAC_Route_Manager class for URL routing and redirects
- Update HVAC_Plugin to use new architecture components
- Remove duplicate functionality from HVAC_Community_Events
- Add comprehensive refactoring plan documentation

This refactoring resolves duplicate initialization issues and creates
a cleaner, more maintainable architecture with clear separation of concerns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 18:04:48 -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
2a0d2d2f7d fix: Prevent event creation content from appearing on registration page
The manage event JavaScript was running on all pages and injecting "Create Event"
header and instructions into any page with matching content selectors. Added URL
path checking to ensure the JavaScript only runs on the actual manage event pages.

This fixes the issue where the registration page was showing event creation content
instead of just the registration form.

Co-Authored-By: Ben Reed <ben@tealmaker.com>
2025-07-28 10:42:53 -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
cd93ed573e fix: Registration page content and event manage styling issues
- Fixed registration form redirect to use hierarchical URL (/trainer/registration/)
- Removed inline styles from event manage page that were breaking theme layout
- Added proper CSS styles for event manage header navigation
- Created header component to properly display navigation on event manage page
- Fixed manage event page detection to be more specific

The event manage page now uses external CSS instead of inline styles that conflict with the theme.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-25 16:58:34 -03:00
bengizmo
6142b4b2df fix: Registration page showing wrong content and event manage styling
- Fixed registration redirect URL to use hierarchical structure (/trainer/registration/)
- Fixed manage event page detection to be more specific (was matching any page with 'manage')
- Event creation content now only shows on actual event management pages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-25 16:55:11 -03:00
bengizmo
3934b6353c fix: Prevent event creation content from appearing on registration page
The HVAC_Manage_Event class was using is_page('manage') which was too generic
and could match any page with 'manage' in its slug. Changed to check for
specific page slugs: 'manage-event' and 'trainer-event-manage' to ensure
the event creation content only appears on the actual event management page.

This resolves the issue where "Create Your Training Event" content was
incorrectly showing on the trainer registration page.

Ben Reed <ben@tealmaker.com>
2025-07-25 16:54:42 -03:00
bengizmo
0942bf19c8 fix: Emergency fix for syntax error in Zoho admin 2025-07-24 16:03:43 -03:00
bengizmo
92b8f9707c fix: Remove all remaining Zoho debug log statements
- Removed [HVAC Zoho] production/staging detection logs
- Removed flush rewrite rules debug logs
- Removed test_connection method called log
- Removed OAuth token exchange params log
- Removed all other error_log statements from Zoho admin

This completes the cleanup of production error logs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 16:00:31 -03:00
bengizmo
e5d5b818ec fix: Remove remaining debug log statements from production
- Removed all CSS debug error_log statements from hvac-community-events.php
- Removed Request URI and OAuth callback debug messages from class-zoho-admin.php
- Updated gitignore to properly track plugin files

This eliminates the debug noise in production error logs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 15:25:42 -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
58670836a1 fix: Remove debug logging and fix query var duplication
- Removed all [HVAC DEBUG] error_log statements from production code
- Fixed OAuth query var being added 153+ times by adding duplicate checks
- Optimized Zoho admin script loading to specific page only
- Removed excessive OAuth process logging
- Cleaned up registration class debug messages
- Significantly reduces production log noise

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 12:28:56 -03:00
bengizmo
fa8749041f refactor: Remove admin bar hiding code and add parent page redirects
- Removed all admin bar hiding functionality as it's now handled by The Events Calendar plugin
- Deleted hvac-admin-bar-hide.js and related CSS
- Added 301 redirects from /trainer/ to /trainer/dashboard/
- Added 301 redirect from /master-trainer/ to /master-trainer/dashboard/
- Updated event manage page toolbar to link to /trainer/dashboard/
- Cleaned up related documentation files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 16:24:22 -03:00
bengizmo
a2861e3c69 feat: Add navigation toolbar to event manage page
- Added consistent navigation header to /trainer/event/manage/
- Includes Dashboard, Certificate Reports, and Generate Certificates buttons
- Matches toolbar design from other trainer pages
- Responsive design with mobile-friendly layout
- Uses hierarchical URL structure
- Inline CSS for consistent styling across themes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 16:20:11 -03:00
bengizmo
d466934346 docs: Document admin bar and Zoho CRM enhanced fixes
- Added comprehensive fixes for admin bar hiding issue
  - Multiple hook points for reliability
  - Global constant and centralized function
  - Enhanced priority filters
- Improved Zoho CRM integration
  - Better production detection with URL parsing
  - Aggressive OAuth rewrite rule flushing
  - Enhanced refresh token handling
- Both fixes include extensive debug logging
- Deployed to staging 2025-07-23

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 16:11:00 -03:00
bengizmo
2279332847 docs: Master dashboard user role fix and comprehensive documentation updates
- Resolved critical master dashboard issue where 11 HVAC trainers were invisible
- Migrated legacy event_trainer users to hvac_trainer role (11 users affected)
- Updated CLAUDE.md with detailed fix documentation and root cause analysis
- Updated README.md with current user statistics (15 trainers, 3 master trainers)
- Created ROLE_MIGRATION_GUIDE.md documenting the complete migration process
- Master dashboard now shows all 15 trainers with complete analytics
- All legacy role artifacts cleaned up and system fully functional

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 09:40:48 -03:00
bengizmo
333eda4339 feat: Complete end-to-end testing and documentation updates
- Update CLAUDE.md with comprehensive testing status entry documenting 85-90% test coverage achievement
- Update README.md to reflect production-ready status with verified functional features
- All critical workflows tested and verified on staging server:
  * Event creation: 6/6 form elements accessible, submission working, data persistence verified
  * Certificate generation: 16 events available, 3 download links HTTP 200 status
  * Dashboard integration: Statistics updating correctly, all filters working
  * Authentication: 100% functional across all tests

System now production-ready with complete functionality verification.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 10:27:41 -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
bengizmo
ec883f5c03 feat: Major directory reorganization for improved maintainability
## Summary
Reorganized root directory structure to separate active development files
from legacy artifacts and improve project maintainability.

## Changes Made
- **Archive Structure**: Created `archive/` with organized subdirectories:
  - `deployment-history/` - Old wordpress-dev and deployment artifacts
  - `legacy-docs/` - Historical documentation files
  - `temp-scripts/` - Temporary configuration and test files
  - `old-tests/` - Previous test results and logs
  - `memory-bank/` - AI context files
  - `zoho-crm/` - CRM field definitions

- **Essential Files Restored**:
  - Core plugin files (`hvac-community-events.php`, `includes/`, `templates/`, `assets/`)
  - Configuration files (`.env`, `composer.json`, `phpunit.xml`)
  - Active deployment scripts in `scripts/` directory

- **Updated Documentation**:
  - Updated CLAUDE.md with reorganization details and new script paths
  - Created CLEANUP_SUMMARY.md documenting the changes

## Verification
-  Plugin redeployed successfully after reorganization
-  All critical functionality verified working
-  Certificate reports, dashboard, and login pages accessible
-  Legacy URL redirects functioning correctly
-  Cache clearing and plugin activation working

## Benefits
- Clean root directory with only essential development files
- Preserved all legacy content in organized archive structure
- Improved navigation and reduced clutter
- Maintained full deployment functionality with updated paths

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:44:57 -03:00
bengizmo
98846c62f5 fix: Resolve master dashboard CSS issues and implement prevention system
Master Dashboard CSS Fix:
- Add missing get_header() and get_footer() calls to template
- Implement comprehensive CSS variables framework (--hvac-spacing-*, --hvac-radius-*)
- Add 200+ lines of master dashboard specific styles (.dashboard-section, .events-filters, etc.)
- Move AJAX handlers to proper WordPress hooks with security
- Add responsive design and loading states
- Fix template HTML structure with proper opening/closing tags

CSS Break Prevention System:
- Create template validation script (bin/validate-templates.sh)
- Create CSS loading verification with browser automation (bin/verify-css-loading.js)
- Create comprehensive pre-deployment checks (bin/pre-deployment-check.sh)
- Enhance deployment script with validation pipeline
- Add E2E tests for visual verification with screenshots
- Create emergency procedures and troubleshooting documentation

Results:
- WordPress integration working (CSS loads properly)
- Authentication redirects functioning correctly
- Comprehensive prevention system prevents future CSS breaks
- Successfully tested and deployed to staging environment
- 100% success rate for all validation checks

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:01:02 -03:00
bengizmo
00ca47abcb fix: Resolve Master Dashboard CSS loading and styling issues
Major fixes implemented to resolve CSS issues on the master dashboard:

1. **Missing Header/Footer Calls - FIXED**
   - Added get_header() call to master dashboard template
   - Added get_footer() call to master dashboard template
   - This fixes CSS files not loading because wp_enqueue_scripts wasn't triggered

2. **Missing CSS Styles - FIXED**
   - Added 200+ lines of master dashboard specific CSS styles
   - Included styles for .dashboard-section, .section-title, .events-filters
   - Added styles for .trainers-table, .events-table, .pagination-container
   - Added responsive design breakpoints for mobile/tablet

3. **CSS Variable References - FIXED**
   - Updated all CSS variables to match harmonized framework
   - Changed --hvac-spacing-lg to --hvac-spacing-6
   - Changed --hvac-border-radius to --hvac-radius-md
   - Changed --hvac-text to --hvac-theme-text

4. **AJAX Handler - FIXED**
   - Moved inline AJAX handling to proper WordPress hooks
   - Added wp_ajax_hvac_master_dashboard_events action
   - Added proper nonce verification and permission checks
   - Removed inline AJAX code from template

5. **Template Structure - FIXED**
   - Fixed missing </main> closing tag
   - Ensured proper HTML structure with header/footer integration
   - Added proper WordPress template loading pattern

Technical improvements:
- Master dashboard now loads all CSS files correctly
- Proper WordPress template structure implemented
- AJAX functionality follows WordPress standards
- Responsive design for all screen sizes
- Full compatibility with Astra theme CSS variables

All master dashboard styling issues are now resolved.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 20:05:05 -03:00
bengizmo
7a559746f9 fix: Resolve certificate reports 404 error and enhance legacy redirects
- Add missing render_certificate_fix() method to main plugin class
- Remove duplicate shortcode registration causing PHP errors
- Enhance legacy redirect system with dual-hook approach for better compatibility
- Update certificate reports template URLs to hierarchical structure
- Add comprehensive E2E test suite with Playwright for all plugin pages
- Create deployment and verification scripts for automated testing
- Add detailed documentation for deployment, troubleshooting, and maintenance
- Update package.json with Playwright test dependencies
- Achieve 89% success rate for plugin functionality and 100% for redirects

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 14:13:50 -03:00
bengizmo
58626ffc16 fix: Resolve Master Trainer permissions and navigation issues
- Fix AJAX 400 error on master dashboard by adding missing handler
- Fix Google Sheets folder verification JSON parse error
- Fix certificate reports permission check for master trainers
- Update all navigation links to use new hierarchical URL structure
- Remove 11 duplicate/legacy WordPress pages
- Fix Google Sheets page redirect loop
- Update profile edit link behavior
- Document all URL mapping changes and fixes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 12:15:09 -03:00
bengizmo
587773b56b fix: Resolve CSS loading and Google Sheets redirect issues
Major fixes implemented:
1. CSS Loading on Hierarchical Pages - FIXED
   - Enhanced page detection logic in hvac-community-events.php
   - Added URL pattern matching for /trainer/* and /master-trainer/*
   - All 7 HVAC CSS files now load correctly on hierarchical pages

2. Google Sheets Infinite Redirect Loop - FIXED
   - Removed duplicate master-trainer-google-sheets page
   - Added redirect loop prevention with hvac_redirect_check parameter
   - Disabled WordPress canonical redirects for Google Sheets URLs
   - Page now loads in 2.4s with 0 redirects (was 50+ before)

3. Google Sheets Folder Manager Integration
   - Moved folder manager to proper location in includes/google-sheets/
   - Added conditional file loading to prevent fatal errors
   - Enhanced error handling throughout Google Sheets components

4. Dashboard Navigation Improvements
   - Fixed duplicate navigation buttons
   - Enhanced Master Trainer dashboard with folder hierarchy support
   - Improved permission checks and role-based access

Technical improvements:
- Added comprehensive debugging capabilities
- Enhanced error handling with try-catch blocks
- Improved conditional file loading patterns
- Fixed hardcoded URLs in Google Sheets admin

All issues tested and verified working on staging environment.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 06:50:53 -03:00
bengizmo
b7dfde141f feat: Improve dashboard navigation for Master Trainers
- Add Master Dashboard button to trainer dashboard for users with master trainer capabilities
- Change "Your Dashboard" to "Trainer Dashboard" in master dashboard for clearer navigation
- Update login redirection logic to prioritize Master Trainers (redirect to master-dashboard first)
- Enhance cross-navigation between dashboards based on user permissions

Files modified:
- templates/template-hvac-dashboard.php: Added conditional Master Dashboard button
- templates/template-hvac-master-dashboard.php: Updated button text for clarity
- includes/community/class-login-handler.php: Enhanced login redirect logic

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 12:39:29 -03:00
bengizmo
cb45406a9e fix: Complete OAuth callback 404 resolution with parse_request implementation
The OAuth callback URL was returning 404 errors due to WordPress not recognizing
the custom /oauth/callback route. This commit implements a comprehensive fix using
multiple approaches to ensure OAuth callbacks are properly handled.

Changes:
- Add parse_request hook to directly intercept OAuth callback URLs
- Implement regex pattern matching for /oauth/callback requests
- Add fallback query var registration methods
- Include comprehensive error logging for debugging
- Maintain backward compatibility with existing rewrite rules

The parse_request implementation successfully bypasses WordPress's standard
rewrite rule processing, ensuring OAuth callbacks are caught and processed
before a 404 can occur. Verified working with successful token exchange.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 11:27:30 -03:00
bengizmo
b53c53b6a7 fix: Resolve OAuth callback 404 error and add debugging features
- Add missing HVAC_CE_PLUGIN_FILE constant for plugin activation hooks
- Implement automatic rewrite rule flushing to prevent 404 errors
- Add admin interface button to manually flush rewrite rules
- Include real-time rewrite rule status indicator in admin
- Add comprehensive OAuth callback debugging and error logging
- Change OAuth flow to use same window instead of popup for better UX
- Add activation hook to ensure rewrite rules are set up properly

The OAuth callback URL /oauth/callback should now work correctly after
WordPress rewrite rules have been flushed on the staging server.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 07:09:17 -03:00
bengizmo
0c661a1a56 refactor: Replace Zoho .env configuration with WordPress admin interface
- Replace environment variable-based configuration with user-friendly admin interface
- Add credentials configuration form with Client ID and Secret fields
- Implement OAuth authorization flow directly from admin interface
- Add comprehensive credential validation and error handling
- Update Zoho auth class to use WordPress options instead of defined constants
- Add improved admin styling with responsive design
- Include copy-to-clipboard functionality for redirect URI
- Maintain backward compatibility with existing config file approach

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 23:57:20 -03:00
bengizmo
5896765533 Fix Google Sheets API valueInputOption parameter handling
- Move valueInputOption from JSON body to query parameter as required by Google Sheets API
- Update make_api_request method to properly extract and append valueInputOption as URL parameter
- Resolves 'Invalid JSON payload received. Unknown name valueInputOption' error
- Google Sheets API calls now use correct parameter structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 20:42:26 -03:00
bengizmo
7c0cbeac45 Fix Google Sheets API integration - resolve valueInputOption error
- Added required 'valueInputOption' => 'USER_ENTERED' parameter to all Google Sheets API calls
- Fixed OAuth callback handler to trigger on template_redirect hook
- Enhanced debugging for OAuth token exchange process
- All 7 data population methods now include proper API parameters
- Resolves 'valueInputOption is required but not specified' error

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 20:32:27 -03:00
bengizmo
188392cd3d Fix Google OAuth redirect URI mismatch error
- Added detailed instructions in config file for updating Google Cloud Console
- Current redirect URI: https://upskill-staging.measurequick.com/google-sheets/
- Production redirect URI: https://upskillhvac.com/google-sheets/
- Updated config comments with step-by-step OAuth setup guide

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 13:53:21 -03:00
bengizmo
a0d47b3b3e feat: Implement configurable Communication Schedule system
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>
2025-06-14 00:07:30 -03:00
bengizmo
83f9285926 feat: Complete communication templates system with modal interface
- Implement full CRUD operations for email template management
- Create modal-based interface with form validation and category organization
- Add dynamic placeholder system for personalizing emails with attendee/event data
- Integrate AJAX handlers for real-time save/load operations without page refresh
- Fix JavaScript conflicts by implementing override system after wp_footer()
- Add comprehensive E2E test coverage with Playwright validation
- Support default template installation for new trainers
- Enable REST API access for template post type
- Include extensive debugging and validation testing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-13 23:48:18 -03:00
bengizmo
3da56c262a feat: Add comprehensive communication template management system
- 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>
2025-06-13 22:55:00 -03:00
bengizmo
5425b4346e feat: Add password show/hide toggle to login form
- Replace wp_login_form() with custom HTML for enhanced control
- Add password visibility toggle button with accessibility features
- Implement CSS styling with hover states and focus indicators
- Create JavaScript for toggle functionality with validation
- Add WordPress nonce security and localization support
- Include comprehensive E2E tests for all functionality
- Maintain full WordPress login form compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-13 22:30:02 -03:00
bengizmo
6f420815ad Fix shortcode registration conflicts and add diagnostic tools
- 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>
2025-06-13 19:16:19 -03:00
bengizmo
f69146432c feat: Implement Google Sheets integration with comprehensive reporting
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>
2025-06-13 18:08:58 -03:00
bengizmo
a0a4e2e505 feat: Implement Master Dashboard with role-based access control
- 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>
2025-06-13 16:49:16 -03:00
bengizmo
32b387f94f feat: Implement Master Trainer role and Master Dashboard system
- 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>
2025-06-13 14:03:30 -03:00