When checking get_defined_vars() on an empty template file my theme loads over 70000 lines of output. Before even including elements on a page all of this is loaded.
- Is this correct?
- Is there any way to reduce it or remove unnecessary variables?
- Do all wp_rewrite rules have to be available for every page load?
Your installation might be ⦠less than optimal.
Using my Mini Theme, no plugins and the following code on the front page right after the opening
body
tag â¦â¦ I get:
Still too much for my taste. Keep in mind many plugin and theme developers forget to keep the global namespace clean. Depending on the quality of the addons you have installed your results might be much higher.
And yes, you need those rewrite rules. Some slugs are translated, and translation can change on each request. So they have to be always available.
print_r
in myheader.php
on 3.5.1 and got nowhere near 70000 lines though. I got about 2110 and that includes some post body content. Also,print_r
orvar_dump
are formatted representations, remember. Things are not actually stored in memory that way.Are you actually experiencing a problem? Or is this preemptive?
counts using toscho’s code, for the sake of comparison