Performance: Data escaping (output)
MEDIUM IMPACT
Data escaping affects page security and rendering stability by preventing injection attacks and layout breaks.
<?php echo esc_html( $user_input ); ?>
<?php echo $user_input; ?>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Raw output without escaping | Potentially complex if injected HTML adds nodes | Multiple reflows if layout shifts occur | Higher paint cost due to unstable layout | [X] Bad |
| Output with esc_html() escaping | Stable DOM nodes count | Single layout pass | Minimal paint cost with stable layout | [OK] Good |