This commit addresses the final two certificate issues reported by the user:
## 1. Fixed Certificate View 404 Error
**Issue:** Clicking 'View' on certificates resulted in 404 error at /hvac-certificate/{token}/ URLs
**Solution:**
- The certificate security system uses custom rewrite rules for secure download URLs
- Added rewrite rule: hvac-certificate/([^/]+)/?$ → index.php?certificate_token=
- WordPress rewrite rules were not properly flushed after plugin updates
- Deploy script now ensures rewrite rules are flushed on every deployment
- This enables the secure token-based certificate download system to function properly
## 2. Enhanced Certificate Duplicate Prevention Display
**Issue:** Users received confusing 'Failed to generate certificates. 1 duplicate(s) skipped.' message
**Solution:**
- Added certificate status checking in Generate Certificates template
- New 'Certificate Status' column shows which attendees already have certificates
- Attendees with existing certificates:
- Show checkmark (✓) instead of checkbox
- Display 'Certificate Issued' status
- Cannot be selected for regeneration
- Are visually distinguished with styling
- Added informative notice explaining duplicate prevention
- Users now see exactly which attendees have certificates before attempting generation
## Technical Implementation:
- Certificate security handler properly validates tokens and serves PDFs
- One-time use tokens with 1-hour expiry for security
- Certificate manager checks for existing certificates per attendee
- UI clearly indicates certificate status to prevent confusion
These fixes complete the certificate functionality restoration, providing a smooth user experience for certificate generation, viewing, and management.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>