WordPress Debug Theme

Yoast Debug ThemeWarning: major geekery ahead! Sometimes you need to see what’s wrong with a WordPress install, and you need to see it fast. I’ve had a set of hacks around for a while to do that, but finally started combining it into a WordPress Debug Theme. This theme is quite simple for now, as it only does a few things, but does them quite effectively.

The first thing it does, on the homepage of the blog you’ve activated it on, is show the most important constants for that blog (see this screenshot). It shows you the important URL’s, editor and memory settings etc.

On subpages it will show you something else: the page type, all the query vars that are set and the SQL query for that page. I’ve found that just doing a print_r or var_dump of $wp_query is hard to read, this theme tries to be a bit smarter about that, see these examples.

This theme also works in the preview, so that might be enough in a lot of cases. It also works great together with Donncha’s Theme Tester, as Alex Leonard mentioned in the comments. Be warned that you might want to remove this theme from live sites though!

So all you have to do to use this is download it, upload it to your server and activate it.

If you’re a developer this theme might come in handy sometimes, I’d love to know if you use it and what you’d add, maybe we can turn this into something super useful together.

Tags: ,


Yoast.com runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

49 Responses

  1. Alex LeonardBy Alex Leonard on 14 October, 2009

    Hey Joost,

    That’s a great idea – definitely going to check that out.

    Could work very well in tandem with Theme Tester by Donncha

    • Joost de ValkBy Joost de Valk on 14 October, 2009

      Hmm that’s a bloody good idea, will add that to the post :)

    • Joost de ValkBy Joost de Valk on 14 October, 2009

      Post updated :)

  2. Abraham VeghBy Abraham Vegh on 14 October, 2009

    Awesome concept! Can’t wait to use this!

  3. RobineBy Robine on 14 October, 2009

    Fantastic ^^ I think a lot of WordPress users will find this very usefull!

  4. JessieBy Jessie on 14 October, 2009

    Awesome theme! Helped me out at our site with a few things. Keep up the work!

  5. scribuBy scribu on 14 October, 2009

    I would include at least the titles of the posts so that it’s easier to find out what you’re looking at.

    Neat ideea, by the way.

    • Joost de ValkBy Joost de Valk on 14 October, 2009

      Yeah good idea, will do on single posts / pages :)

  6. webmasters_byBy webmasters_by on 14 October, 2009

    Thank you very much! this a very useful thing!

  7. Mark MarshallBy Mark Marshall on 14 October, 2009

    What a cool idea. I have installed on one of my test sites. There is lots of info that I do not understand yet, but it will be fun to explore and learn.

    Thank you for taking the time to build and release this.

    mark

  8. Tony DewBy Tony Dew on 14 October, 2009

    GREAT idea! Thank you very much for this.

  9. Sepehr LajevardiBy Sepehr Lajevardi on 14 October, 2009

    You did it! thanks ;)

  10. AbbanBy Abban on 14 October, 2009

    That’s a fantastic idea! Thanks!

  11. GillianBy Gillian on 15 October, 2009

    Awesomeness!!! Thanks for sharing!!

  12. Flow InteractiveBy Flow Interactive on 15 October, 2009

    Thanks for sharing I know this will come in useful!

  13. VerycheekyBy Verycheeky on 15 October, 2009

    Will try this out on a few sites of mine that are acting slow and tired, thank you for taking the time to create this and help make wordpress ROCK! Cheers!

  14. FoxinniBy Foxinni on 15 October, 2009

    Nice work dude! Very good idea for a theme. Will keep this in mind as soon as stuff start going off the rails if you know what i mean. d:

    M

  15. Edward CaissieBy Edward Caissie on 15 October, 2009

    This is definitely going on my “Look-See” list … thanks for releasing it!

  16. DarrenBy Darren on 15 October, 2009

    hehe I’ll enjoy messing around with this. Could be a cool idea to incorporate this into a normal theme, so site admins can at the click of a link, find out any problems with their site..

  17. mikeBy mike on 16 October, 2009

    How do I use this theme? Where do I add it? Thanks for the hard work.

  18. AaronBy Aaron on 16 October, 2009

    It would be really great if you could dump the globals for $current_user, $current_blog, and $current_site also. (the last 2 are WPMU).

  19. XaboomBy Xaboom on 19 October, 2009

    Nice work man ! Awesome idea for a theme .

  20. webxfunBy webxfun on 19 October, 2009

    it is great,thanks

  21. Stephen RBy Stephen R on 20 October, 2009

    In WP 2.9 we’re gaining the ability to register a theme directory. With that in mind, it would be smart to turn this into a *plugin*, thus:

    1) A customized version of the Theme Tester plugin that includes your debug theme.
    2) Activating the plugin registers the Debug theme’s directory and activates it for the admin only.

    This is just a cleaner and easier way to use the combination of the two, and a natural extension of your idea. One thing to update, one thing to activate, not fuss no muss.

    (Especially as I can’t think of *any* circumstance where an admin would want the Debug Theme activated for regular visitors!)

    • Joost de ValkBy Joost de Valk on 20 October, 2009

      Great idea, doing that soon!

  22. Jeff ByrnesBy Jeff Byrnes on 20 October, 2009

    AWESOME. Thanks!

  23. Marty ThornleyBy Marty Thornley on 24 October, 2009

    This sounds like a great tool. But I actually was expecting something else – more like a theme debugger plugin. I have had a lot of clients that want to use some theme or other as a starting point and I have to hunt down all the missing hooks and missing statements.

    Just throwing an idea out there, for a plugin that would test a theme, allowing you click through each page and tell you what template is being used, then maybe lists all the standard hooks and lets you know what is missing and where. Maybe in the footer or something it would list all the template files in the theme and suggest improvements (missing 404.php, missing search.php, for example) Very similar to what this looks like, but testing the theme.

    Now THAT would be cool.

  24. Stephen RBy Stephen R on 25 October, 2009

    Hi again. I don’t mean to spam your comments, but anyone interested in your debug theme might also be interested in my “Log Deprecated Calls” plugin: http://striderweb.com/nerdaphernalia/features/wp-log-deprecated-calls/

Trackbacks

  1. [...] Debug Theme (by Joost de Valk)When your WordPress installs fail and you need more information, the debug theme is perfect. On the home page, it displays the important URL’s, editor, memory setting, etc. On sub pages it shows the page type, all the query vars that are set and the SQL query for that particular page. [...]

  2. [...] Debug Theme (by Joost de Valk) When your WordPress installs fail and you need more information, the debug theme is perfect. On the home page, it displays the important URL’s, editor, memory setting, etc. On sub pages it shows the page type, all the query vars that are set and the SQL query for that particular page. [...]

  3. [...] WordPress Debug ThemeSometimes you need to see what’s wrong with a WordPress install, and you need to see it fast. This shows you the important URL’s, editor, and memory settings, etc. On subpages it will show you something else: the page type, all the query vars that are set and the SQL query for that page. When just doing a print_r or var_dump of $wp_query is hard to read, but this theme tries to be a bit smarter about that. This theme also works in the preview, so that might be enough in a lot of cases. [...]

  4. [...] WordPress Debug Theme Sometimes you need to see what’s wrong with a WordPress install, and you need to see it fast. This shows you the important URL’s, editor, and memory settings, etc. On subpages it will show you something else: the page type, all the query vars that are set and the SQL query for that page. When just doing a print_r or var_dump of $wp_query is hard to read, but this theme tries to be a bit smarter about that. This theme also works in the preview, so that might be enough in a lot of cases. [...]

  5. [...] WordPress Debug ThemeSometimes you need to see what’s wrong with a WordPress install, and you need to see it fast. This shows you the important URL’s, editor, and memory settings, etc. On subpages it will show you something else: the page type, all the query vars that are set and the SQL query for that page. When just doing a print_r or var_dump of $wp_query is hard to read, but this theme tries to be a bit smarter about that. This theme also works in the preview, so that might be enough in a lot of cases. [...]