Performance: XSS prevention
CRITICAL IMPACT
XSS prevention affects page security and user trust, indirectly impacting user experience and interaction speed.
<?php echo esc_html($_GET['user_input']); ?><?php echo $_GET['user_input']; ?>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Direct output of user input | Potentially large if scripts manipulate DOM | Multiple if scripts cause layout changes | High if malicious scripts run | [X] Bad |
| Escaping user input with esc_html() | Minimal DOM impact | No extra reflows | No extra paint cost | [OK] Good |
| Allowing raw HTML input | High if scripts inject elements | Multiple reflows possible | High paint cost | [X] Bad |
| Filtering HTML with wp_kses_post() | Controlled DOM elements | Minimal reflows | Stable paint cost | [OK] Good |