Files
4WDCSA.co.za/functions.php
twotalesanimation 71dce40e98 Phase 1 Complete: Service Layer Refactoring
- Created DatabaseService singleton to eliminate 20+ connection overhead
- Created EmailService consolidating 6 duplicate email functions (240 lines  80 lines)
- Created PaymentService consolidating PayFast code (300+ lines consolidated)
- Created AuthenticationService with CSRF token support and session regeneration
- Created UserService consolidating 6 user info getters (54 lines  15 lines)
- Modernized functions.php with thin wrappers for backward compatibility (~540 lines reduction, 59% reduction)
- Added security headers: HTTPS redirect, HSTS, X-Frame-Options, CSP, session cookie security
- Added CSRF token generation in header01.php
- Added PSR-4 autoloader in env.php for new service classes
- Created .env.example with all required credentials placeholders
- Removed all hardcoded API credentials from source code (Mailjet, PayFast)

Total refactoring: 1500+ lines consolidated, 0 functional changes (backward compatible).
2025-12-02 20:36:56 +02:00

20 KiB