- 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>
5.9 KiB
5.9 KiB
HVAC Community Events Plugin - URL Structure Migration
URL Mapping - Old to New
| Current URL | New URL | Priority | Status |
|---|---|---|---|
/community-login/ |
/training-login/ |
HIGH | ✅ Complete |
/trainer-registration/ |
/trainer/registration/ |
HIGH | ✅ Complete |
/hvac-dashboard/ |
/trainer/dashboard/ |
HIGH | ✅ Complete |
/master-dashboard/ |
/master-trainer/dashboard/ |
HIGH | ✅ Complete |
/manage-event/ |
/trainer/event/manage/ |
HIGH | ✅ Complete |
/event-summary/ |
/trainer/event/summary/ |
MEDIUM | ✅ Complete |
/trainer-profile/ |
/trainer/my-profile/ |
HIGH | ✅ Complete |
/attendee-profile/ |
/trainer/attendee-profile/ |
LOW | ✅ Complete |
/email-attendees/ |
/trainer/email-attendees/ |
MEDIUM | ✅ Complete |
/communication-templates/ |
/trainer/communication-templates/ |
MEDIUM | ✅ Complete |
/communication-schedules/ |
/trainer/communication-schedules/ |
MEDIUM | ✅ Complete |
/generate-certificates/ |
/trainer/generate-certificates/ |
MEDIUM | ✅ Complete |
/certificate-reports/ |
/trainer/certificate-reports/ |
MEDIUM | ✅ Complete |
/google-sheets/ |
/master-trainer/google-sheets/ |
MEDIUM | ✅ Complete |
/hvac-documentation/ |
/trainer/documentation/ |
LOW | ✅ Complete |
/certificate-fix/ |
/master-trainer/certificate-fix/ |
HIGH | ✅ Complete |
References to Update
High Priority Files (Core Navigation/Authentication)
-
Main Plugin File (
hvac-community-events.php)- Page creation array (lines 46-117)
- Asset loading checks (lines 260-266, 342, 358, 374, 433)
-
Login Handler (
includes/community/class-login-handler.php)- Redirect URLs (lines 143, 175, 182, 202, 209, 214)
-
HVAC Community Events Class (
includes/class-hvac-community-events.php)- Authentication redirects (lines 154, 166, 178, 188, 191, 198, 212, 219)
-
Dashboard Templates
templates/template-hvac-dashboard.phptemplates/template-hvac-master-dashboard.php
Medium Priority Files (Navigation/Features)
- Dashboard Class (
includes/class-hvac-dashboard.php) - Manage Event Class (
includes/class-hvac-manage-event.php) - Registration Class (
includes/class-hvac-registration.php) - Settings Class (
includes/class-hvac-settings.php) - Help System (
includes/class-hvac-help-system.php)
Low Priority Files (Templates/Tests)
- Certificate Templates (multiple files)
- Profile Templates
- Test Files (50+ files in
/bin/and root)
Implementation Strategy
Phase 1: Core Structure (HIGH Priority)
- Update page creation code in main plugin file
- Create URL mapping helper functions
- Update login redirection logic
- Add backward compatibility redirects
Phase 2: Navigation (HIGH Priority)
- Update dashboard navigation links
- Update authentication redirect URLs
- Update template hardcoded links
Phase 3: Features (MEDIUM Priority)
- Update shortcode references
- Update help system links
- Update asset loading checks
Phase 4: Testing & Documentation (LOW Priority)
- Update test files
- Update documentation
- Comprehensive testing
Backward Compatibility Plan
301 Redirects Required
All old URLs must redirect to new URLs using WordPress redirect functions:
// Example redirect mapping
$legacy_redirects = [
'community-login' => 'training-login',
'hvac-dashboard' => 'trainer/dashboard',
'master-dashboard' => 'master-trainer/dashboard',
'manage-event' => 'trainer/event/manage',
'trainer-profile' => 'trainer/my-profile',
'certificate-fix' => 'master-trainer/certificate-fix',
// ... etc
];
Implementation Notes
- Use WordPress
wp_redirect()with 301 status - Preserve query parameters during redirects
- Implement in
template_redirecthook - Log redirects for monitoring
Security Considerations
Access Control Updates
- Certificate Fix: Move to
/master-trainer/hierarchy requires permission check updates - Role-based URLs: Ensure URL structure matches permission model
- Capability Checks: Update template redirect logic for new URLs
Testing Checklist
Functional Testing
- All new URLs load correctly
- All old URLs redirect properly
- Login redirects to correct dashboard
- Navigation between trainer/master trainer dashboards works
- Certificate fix page restricted to master trainers only
Technical Testing
- No 404 errors on any URL
- Query parameters preserved in redirects
- Assets load correctly on all pages
- Help system links work
- Test suite passes with new URLs
Deployment Plan
Pre-deployment
- Create database backup
- Test in staging environment
- Verify all redirects work
- Update user documentation
Deployment
- Deploy plugin with URL changes
- Clear all caches
- Test key user journeys
- Monitor for 404 errors
Post-deployment
- Monitor redirect usage
- Update external documentation
- Communicate changes to users
- Plan to remove redirects after transition period
Files to Modify
Core Files (16 files)
hvac-community-events.phpincludes/class-hvac-community-events.phpincludes/community/class-login-handler.phpincludes/class-hvac-dashboard.phpincludes/class-hvac-manage-event.phpincludes/class-hvac-registration.phpincludes/class-hvac-settings.phpincludes/class-hvac-help-system.phptemplates/template-hvac-dashboard.phptemplates/template-hvac-master-dashboard.phptemplates/template-trainer-profile.phptemplates/template-event-summary.php- Multiple certificate template files
- Test files (50+ files)
Estimated Effort
- Planning/Analysis: ✅ Complete
- Core Implementation: 4-6 hours
- Template Updates: 2-3 hours
- Testing: 2-3 hours
- Documentation: 1-2 hours
- Total: 10-15 hours