Performance: Common filter hooks
MEDIUM IMPACT
This affects how quickly WordPress processes and modifies data during page load and user interactions.
<?php add_filter('the_content', function($content) { return $content . ' '; }); ?>
<?php add_filter('the_content', function($content) { for ($i=0; $i<1000; $i++) { $content .= ' '; } return $content; }); ?>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy filter with loops | N/A (server-side) | N/A | N/A | [X] Bad |
| Lightweight filter with simple string concat | N/A (server-side) | N/A | N/A | [OK] Good |