Performance: Common action hooks
MEDIUM IMPACT
This affects how and when code runs during page load and user interaction, impacting load speed and responsiveness.
<?php add_action('wp_enqueue_scripts', function() { wp_enqueue_script('custom-js'); }); ?>
<?php add_action('wp_head', function() { heavy_database_query(); }); ?>| Pattern | Server Processing | Rendering Delay | User Interaction Impact | Verdict |
|---|---|---|---|---|
| Heavy action hook on 'wp_head' | High CPU usage | Blocks rendering | Delays interactivity | [X] Bad |
| Proper script enqueue on 'wp_enqueue_scripts' | Minimal CPU usage | Non-blocking | Fast interactivity | [OK] Good |