Blank Page after WP Super Cache upgrade

Blank.
Today, I upgraded my WordPress version to 3.0.

As usual, this has been a necessary pain.
As usual, the automatic upgrade failed.
As usual, my qtranslate version was said to be incompatible and I had to tweak it a little (setting it to 3.0 for me).

But, far more annoying, after I upgraded WP Super Cache, and for the second time, the visitors could only see a blank page visiting my site.

I had had the same issue on the last update and had to tweak the wp-cache source files but I was hoping that such a big thing would be corrected in the next version. Before I submit a fix to the author, here is the way I solved it on my system.

The problem was in my case that the plugin was properly caching the page, generating a nice html static file. It was also properly detecting the page had been cached on the second visit and still properly get the file name.

Then, it was doing this:

include( $cache_file );

Doesn’t tilt? Remember, the plugin had generated an html file. Including it from php just resulted in a Parse error.

So, here is my fix. just replaced the include by:

switch(array_pop(explode('.', $cache_file)))
{
	case 'php':
		include( $cache_file );
		break;
	default:
		readfile( $cache_file );
		break; 					
}

On the version I use (0.9.9.3), it is located in wp-content/plugin/wp-cache/wp-cache-phase1.php, line 212.

If you turned on crompression, the code located just above is probably faulty too.

Of course, the fix is not nice either as I should not rely on the file extension to detect its type but I am lazy (and a bit sick).
A nicer way would be to ensure that everything is cached is in a proper php format and keep the include method. (meaning, adding “?>” and “<?php” respectively at the top and bottom of the html files.

  1. No comments yet.

  1. No trackbacks yet.