Performance: add_action and add_filter
MEDIUM IMPACT
These hooks affect how fast WordPress processes and renders content by adding custom code during page load or interaction.
add_filter('the_content', function($content) { return $content . ' '; });
add_filter('the_content', function($content) { for ($i=0; $i<1000; $i++) { $content .= ' '; } return $content; });
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy hook with loops | N/A (server-side) | N/A | N/A | [X] Bad |
| Light hook with simple string append | N/A (server-side) | N/A | N/A | [OK] Good |