Performance: User capability checks
MEDIUM IMPACT
User capability checks affect page interaction responsiveness and conditional content rendering speed.
<?php $can_manage = current_user_can('manage_options'); if($can_manage) { echo '<div>Admin Panel</div>'; } ?>
<?php if(current_user_can('manage_options')) { echo '<div>Admin Panel</div>'; } ?>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Repeated current_user_can() calls | No direct DOM impact | 0 | 0 | [X] Bad |
| Cached capability check variable | No direct DOM impact | 0 | 0 | [OK] Good |