WordPress Theme Performance

When people are looking for a wordpress theme they very rarely are looking at the performance of it.  The person is looking at how pretty the design is and if it fits their site.  There is however a lot more to it then simple the design of the wordpress.  A wordpress theme can add a lot of extra CPU and memory usage depending on how it’s designed.

I’m seeing more and more where wordpress themes are not using style.css or at least .css for their style sheets.  More and more they are using style.php which in turn simply outputs the style sheet.  This sort of setup suddenly requires an extra PHP process every page load thus increased memory as well to compensate.  The fact it’s just going to output CSS still does not matter it’s really bad to be doing.  This is especially bad when a wordpress blog is running say wp-super-cache they’re probably trying to serve everything via html files.  Well that purpose is defeated when every page load PHP is loading up to serve their style sheet.  Now as to why more themes are doing this I’m not sure maybe it’s make them look more professional in the eyes of the users I have no idea.

Of course if you see style sheets being displayed via php you also get the same thing with java script.  All the js files become js.php with simply the javascript being output in the php file.  There is no actual using of PHP logic besides the print “js stuff”

There is one other problem I see quite a bit and that’s extra features included in the theme.  For example we’ve had several users use themes with phpthumb included.  The theme was using it in several places to make smaller images of portions.  Along with that they also did not configure it properly and some bots found it and started using the install to generate thumbnails for other web sites.
That’s just a few examples but I would advise anyone when installing a wordpress theme take a look at what it offers and what it’s doing.  If it’s using php files everywhere you might want to see if it’s actually necessary.  If they include extra features or include third party scripts you might want to check if they even set it up properly.  I would not rely on the theme developers on these sort of things.  I’ve seen some free themes not even doing relative paths properly resulting in serving images and such via their own demo of their script.  So I really would not trust the theme maker has done a great job with the other aspects of the theme.

This entry was posted in Tips. Bookmark the permalink.

4 Responses to WordPress Theme Performance

  1. Definitely agree with you, Tony! Way to much WP themes out there that are too bloated, too badly constructed (elegantthemes.com uses about 30+ php files for a theme, with lots of includes) or, indeed, serve CSS as PHP (whoever came up with that could do with a few lessons of web development).

    In my opinion, a theme should be light-weight, have proper construction (so proper usage of HTML elements, proper headings nesting like only one h1) and perform well.

  2. Tony says:

    All the PHP includes to generate the page is not that big of a deal when you do caching. The problem is when all the css, js even some images become PHP files that it’s a huge issue. Suddenly there are tons of requests to the web server for PHP processes. Each one will require it’s own process due to them all needing to spawn at the same time. So for a site with 5 of them it would require a pool of 5 PHP processes at all times. So that means lots of extra memory usage and CPU depending on how often it’s necessary to respawn them.

  3. Roger says:

    I think one reason for putting the ccs file into a php file its because you can use php to compress the css code, of course on gzip enabled servers like HawkHost this benefit becomes a waste of resources since the web server does it anyway.

    for some reason people have the idea than compressing your website will give you better performance. This may be so for dial up conections, but for a DSL conection you will never notice the diference.

    besides, CPU utilization has always been a bigger problem than bandwidth in most cases, even with HTML content and with the popularization of PHP more now then ever.

  4. Mary says:

    I am trying to find help on sliders in the Thunder theme by Hawk Themes.
    Can you point me in the right direction. Cant find them anywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *