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>
1.5 KiB
1.5 KiB
WordPress Template Validation Guide
MANDATORY TEMPLATE STRUCTURE
Every WordPress template MUST follow this exact structure:
<?php
/**
* Template Name: [Template Name]
*/
// Security check
if (!defined('ABSPATH')) {
exit;
}
// Auth and permission checks here...
// CRITICAL: Always call get_header()
get_header();
?>
<div id="primary" class="content-area primary ast-container">
<main id="main" class="site-main">
<!-- Your template content here -->
</main>
</div>
<?php
// CRITICAL: Always call get_footer()
get_footer();
?>
VALIDATION CHECKLIST
Before any template goes live:
get_header()called at template startget_footer()called at template end- Proper WordPress container structure
- Security check with
ABSPATH - Permission checks for protected pages
- CSS classes match existing framework
- AJAX handlers use proper WordPress hooks
COMMON MISTAKES TO AVOID
- Missing header/footer calls - Breaks all CSS loading
- Inline AJAX instead of wp_ajax hooks - Security issues
- Hardcoded URLs - Breaks on different environments
- Missing nonce verification - Security vulnerabilities
- Custom CSS classes without corresponding CSS - Broken styling
TESTING REQUIREMENTS
Every template must pass:
- Visual test with screenshots
- CSS loading verification
- AJAX functionality test
- Mobile responsiveness check
- Authentication flow test