Performance: Plugin security (nonces, sanitization)
MEDIUM IMPACT
This concept affects page load speed indirectly by preventing unnecessary server processing and reducing security risks that could cause slowdowns or crashes.
<?php // Check nonce and sanitize input if (isset($_POST['my_nonce']) && wp_verify_nonce($_POST['my_nonce'], 'my_action')) { $value = sanitize_text_field($_POST['data'] ?? ''); update_option('my_option', $value); } ?>
<?php // No nonce check and no sanitization if (isset($_POST['data'])) { $value = $_POST['data']; update_option('my_option', $value); } ?>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No nonce or sanitization | 0 | 0 | 0 | [X] Bad |
| With nonce and sanitization | 0 | 0 | 0 | [OK] Good |