Performance: Nonce verification
LOW IMPACT
Nonce verification affects server-side request validation and can indirectly impact page load speed by preventing unnecessary processing of invalid requests.
<?php if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'action_name')) { wp_send_json_error('Invalid nonce'); exit; } ?>
<?php if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'action_name')) { wp_die('Invalid nonce'); } ?>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Late nonce verification after DB queries | N/A | N/A | N/A | [X] Bad |
| Early nonce verification before processing | N/A | N/A | N/A | [OK] Good |