[wp-hackers] Child themes, theme revisions, and the theme editor

Andrew Nacin wp at andrewnacin.com
Tue Mar 23 05:23:01 UTC 2010


Quoting Mike Schinkel:

> What's more if till be nice if you can sandbox an entire theme because a
> broken php tag in almost any page can bring down a although I know this
> would increase the scope of work.


Thanks for the feedback. It's not scope of work as much as it is impossible.
That's perhaps a strong word, but testing out a template file by simply
including it in a sandbox would result in fatal errors due to undefined
functions. (Checking for only parse errors can only be achieved via CLI.)
And, on the basis of the file name alone, due to the template system and
various hooks, you cannot determine which page on the frontend will use it
(which you would have to be able to do to ensure no errors are simply
because the files weren't included the way the theme intended them to
be). On the other hand, sandboxing functions.php (and any files it may
include) is easy.

As I alluded, functions.php is the important part. It is loaded always,
including in wp-admin, and before any output, therefore any fatal errors
will kill execution and force you to scramble for an FTP editor. On the
other hand, if you have a parse or fatal error in single.php, it'll still
print out the header before showing you a helpful error, and you'll still
have access to the admin area (and the theme editor).


More information about the wp-hackers mailing list