Subscribe via

Widget Bugs or Features in WordPress 2.5?


This might be useful for WordPress widget developers out there. I wasn’t going to post this before, but I just found that another developer ran into the exact same issue. So hopefully the 10 minutes I spend writing this post can help save somebody hours of debug.

After WordPress 2.5 released I found that my NowThen Photo Display widget broke the sidebar management page in WordPress adminitration. I took the longest time to figure out why, but the root of the problem was that the new WordPress 2.5 actually executes widget code in the wp-admin area. I have no idea why this is the case. Is this a bug or a feature of the new 2.5 code? I can see it as a feature in a sense that, if the code is not able to executed properly in the wp-admin area, then it should not be added to the front-end. If that’s the case, I would expect an error message rather than a broken sidebar management page.

Anyhow, here are a couple of tips that I have if your plugin breaks after the upgrade: Read on…

Make WP-PostViews Work with WP-Super-Cache

In response to JTPratt’s comment on my post, ‘Make Popularity Contest Work with WP-Super-Cache,’ I am releasing a modification of Lester Chan’s WP-PostViews plugin to support counting using Javascript. Please try it out to see if this works for you.

A side note to Lester Chan and Richer Yang (WP-PostViews and WP-PostViews Plus authors repectively). Please feel free to contact me about incorporating these changes into WP-PostViews and/or WP-PostViews Plus so that it can be officially committed to the wp-plugins.org repository. I would create my own version of WP-PostViews in the repository, but do not want to steal your thunder :).

Read on…

Creating a Staging WordPress Blog for Testing

Over the past few months, I’ve been meaning to create a staging WordPress blog that is an exact replica of my production OMNINOGGIN blog so I can test major feature changes before releasing them to my production site.  I have to admit that there are many other interesting things to spend time on (see also: Make Popularity Contest Work with WP-Super-Cache and NowThen Photo Display WordPress Plugin) so I have been lagging at getting this task done.  Fortunately the WordPress 2.5 released was enough to motivate me to get this done.  My goal in this post is to provide a step-by-step set of instructions (or checklist) for getting this task done.  I run Apache 2.2.8, MySQL 5.0.51a, and PHP 5.2.5 on a FreeBSD 7.0 machine that I have complete control over.  Keep in mind that these steps will vary depending on how your blog is configured.  It is a good checklist nonetheless so without further ado:

Read on…

Make Popularity Contest Work with WP-Super-Cache

Previously I wrote ‘Make Your WordPress 10X faster During Traffic Storms‘, which is a post about automatically turning WP-[Super]-Cache on/off and automatically switching your WordPress theme to a lighter theme during heavy traffic. One of the main reasons that I had this setup was because I could not get statistics to work with WP-Super-Cache (i.e. my chCounter & Popularity Contest plugin is hosed).

After some tinkering, I was able to get chCounter and Popularity Contest to work with WP-Super-Cache. This involves using javascript to count instead of PHP. chCounter was a simple change, but Popularity Contest was a bit more challenging. Usually I would immediately post the “How-to” here, or rather release the modded plugin to the public myself, but I believe that I shouldn’t step on Alex King’s shoes (the original developer of Popularity Contest). I’ve sent the Popularity Contest code to Alex for code review. He’s been doing some of the same work, and hopefully he can incorporate some of my changes into the plugin and release it to the public soon.

If anybody would like to use my version of the Popularity Contest before Alex King releases it to the public, you may download the WordPress 2.3.3 and WordPress 2.5 compatible version here:
Read on…

WP-Super-Cache Released!

What more can I say but “GPL FTW”. This is what happens when you release something under GPL and do not put in much effort in supporting it. Someone else takes it over and releases a better version of your own code leaving the consumers to benefit! Donncha O Chaoimh from Holy Shmoly! released WP-Super-Cache, a WordPress caching plugin built on top of WP-Cache. From Holy Shmoly!, here are the differences between WP-Super-Cache and WP-Cache:

  1. A plugin and hooks system. A common complaint with WP Cache was that hacking was required to make it work nicely with other plugins. Now you can take advantage of the simple plugin system built in to change how or when pages are cached. Use do_cacheaction() and add_cacheaction() like you would with WordPress hooks. Plugins can add their own options to the admin page too.
  2. Works well with WordPress MU in VHOST or non-VHOST configuration. Each blog’s cache files are identified to improve performance.
  3. Normal WP-Cache files are now split in two. Meta files go in their own directory making it much faster to scan and update the cache.
  4. Includes this WP-Cache and protected posts fix.
  5. Automatically disable gzip compression in WordPress instead of dying.
  6. As Akismet and other spam fighting tools have improved, the cache will only be invalidated if a comment is definitely not spam.
  7. Version 0.2 supports gzip compression

Did you see that? Supports gzip compression! Finally, an easy way to enable gzip and WP-Cache. The best part of all of this is that the automatic WP-Cache enabling method still works for this plugin since it was built on top of WP-Cache. I encourage everybody to upgrade!

Make Your WordPress 10X faster During Traffic Storms


This tutorial will augment the technique of automatically enabling WP-Cache during heavy load with the ability to switch to a low-bandwidth WordPress theme at the same time.

Few reasons to do this

1. WP-Cache messes with your site statistics, so you do not want to leave it on when your site is not being hammered.
2. You don’t want to use a bandwidth efficient theme all the time because it’s not pretty-lookin’.
3. During traffic storms (e.g. Digg Effect), every 1/100 second optimization tweak counts.
4. If you host your site on a shared host, you will most likely have a bandwidth quota. Switching to a leaner theme conserves your bandwidth (duh!)
5. If you host your site on a home connection, your upload is not up to par with most hosting services, so you need to use that small pipe efficiently.
6. Each “IMG” tag, even if it’s a 1×1 pixel gif, requires an HTTP request to your web server. If you have 10 images on your page, and 10 users are loading your page, that’s 100 simultaneous calls to your server already. Leaner themes usually means less/no images, giving Apache some break.
7. If you’re server is non-uber, you don’t deserve to administer it.
Read on…

Automatically Turn on WP-Cache During Traffic Storms


I am a semi-fan of WP-Cache. On the good side, it reduces strain on apache by staticising WordPress pages. On the bad side, it messes with my site statistics and makes development hard (I always forget that the page I’m working on is being cached). I like my statistics, but what if I suddenly get a traffic storm? If my site gets dugg, there is no time to worry about statistics. I would need all the help I can get to serve pages efficiently. This is why WP-Cache should be off by default and automatically turned on during traffic storms. Read on…

WP-Cache, the Untold Way to Set It Up

WP-Cache is a WordPress plugin that improves your WordPress speed by caching a static version of each dynamic page request and deliverying that static version for subsequent requests to that page. This in combination with WordPress internal cache, Apache cache, eAccelerator op code cache, and Varnish proxy cache provides the ultimate setup to combat traffic storms if your article gets dugg. *Note* that there is also a method that helps you turn on WP-Cache on demand (only during traffic storms), but I will discuss that in a later article.

If you’ve ever tried to install the WP-Cache plugin for WordPress just by uploading to the wp-content/plugins directory and activating it via WordPress Plugins administration, then you know that 99% of the time that method will not work because of some file permission problems.

Here is the proper way to do it: Read on…