Dax

Big Fuck Up in Wordpress 2.5 & WP-SuperCache 0.61

April 11th, 2008 · 12 Comments

I don’t know if this is a fuck up in Wordpress or wp-supercache or if it’s just me being an idiot, but I’ve noticed it happening on a few sites.

For example: Weird Asian News

Right now, that link is displaying the home page content. And so is every page on the site that had not been cached before the Cache Impotence Bug!

Fuck you, new readers!

Bug Symptoms:
After running smoothly and sexily for a random amount of time (like an hour), your brand new Wordpress install will do this shitty stuff:
/feed/ permanently displays the index page.
/comments/feed/ permanently displays the index page
ALL NEW PAGES that hadn’t yet been super cached permanently display the index page!

If you find that all your Wordpress pages are belong to us — “us” being the index.php request that gobbles up all your content, you can fix it by doing the following.

1. Don’t upgrade anything. It’s not fixed. (Maybe it is, but I would still do the following)
2. Go into your WP Super Cache Manager page
3. Add “index.php” to the list of “Accepted filenames, rejected URIs”:
wp-.*.php
index.php

4. Click Save.
5. Delete all items in your cache.

The reason I think this is getting fucked is because somewhere in the WP-SuperCache logic, “index.php” is getting cached. After that happens, all modrewrite htaccess requests that are usually fed through index.php to be parsed and printed as per the Wordpress core, are instead referred to the super cache of index.php.

That means all old supercache pages work fine, but every page that doesn’t have a cached version of itself lying around, gets the home page. This bug will not appear if you are logged in or have commented in the past because by definition, you bypass the static supercache.

By the way, if this is a bug and not me fucking something up, maybe it’s time for the Wordpress developers to get back to coding a good core instead of arguing with the MoveableType crew like fucking children. You guys fix the Object Cache in Wordpress Mu yet? Why didn’t this supercache stuff get integrated into the 2.5 release?

Cute backend though.

UPDATE

Apparently I’m not the only one: Michael Park

Donncha O Caoimh // Apr 11, 2008 at 4:33 pm

If you try the latest code from http://svn.wp-plugins.org/wp-super-cache/trunk I think you’ll find that problem is gone.

BTW - you should redirect /index.php to / to avoid duplicate content and/or pagerank dilution problems.”

You rock, Donncha! That’s good news, but for all the people I was helping debug this problem, that is too many steps and too complicated. I still recommend going my way and adding index.php to the reject URL list. That way you can be SURE it’s fixed.

Everyone who runs a big site needs to make sure they take some safety measures. This bug is hard as hell to spot in the wild and when you have a digg-critical site or an article on the line, thousands of people could blow you off upon encountering a non-working /feed/. Not to mention how worthless it is to have archives that simply won’t load. People don’t remember the URL and they don’t come back.

WP Super Cache should be integrated into WP itself.
1. It’s an awesome addition that takes an already awesome product to an enterprise level.
2. Anyone — even the smallest blogger — can get nailed with traffic out of nowhere and a non-responsive WP looks bad.
3. Millions of small users debugging the cache would be worth it for the sake of the few flagship, power users who make the software look good.

Oh and shit, thanks for the quick response!

→ 12 CommentsTags: Work The Jerk

Fix Corrupt Serialized Data

January 18th, 2008 · 5 Comments

I just had to deal with a shitload of serialized php data that had become corrupted with Windows carriage returns.

Errors like this were produced:

Notice: unserialize(): Error at offset 1060 of 41775.

If you’re getting that on a call to unserialize, it’s very likely that your string lengths do not match your serialized data. That looks something like this:

s:3:”fuck”;

In my example, fuck is four letters long, yet unserialize is told to read in 3 characters. That will produce an error that looks like this:

Error at offset 8 of 11 bytes

You can change that above 3 to a 4 pretty easily, but it’s much harder if your file is 300K long.

Here’s a function that will re-measure all your serialized strings and let you unserialize them. You’ll still have fucked up characters, but at least you’ll get your data back.


function fixFuckedData($data){

  $splits = preg_split("/s:([0-9]*):/”, $data);
  preg_match_all(”/s:([0-9]*):/”, $data, $lengths);
  $lengths = $lengths[1];

  for($i = 0; $i < sizeof($splits)-1; $i++){
    $text = $splits[$i+1];
    $pos = strpos($text, '";');
    $text = substr($text, 1, $pos-1);
    $text_len = strlen($text);
    if($lengths[$i] != $text_len)
      $lengths[$i] = $text_len;
      //echo "{$lengths[$i]} -> $text_len\n”;
  }
  //var_dump($lengths);
  //var_dump(unserialize($data));

  $return = $splits[0];
  for($i = 0; $i < sizeof($splits)-1; $i++){
    $return .= "s:{$lengths[$i]}:";
    $return .= $splits[$i+1];
  }
  return $return;
}

→ 5 CommentsTags: Work The Jerk

The Prodigal Cigars Return!

December 14th, 2007 · 9 Comments

2110775235_59c3979969.jpg

While in Las Vegas last Wednesday, I made a plan to be extra classy at a fancy sushi bar. I made the pre-game call of buying a box of cigars in case of a Class Emergency. Needless to say, while being classy, I lost the cigars in a suite party at the Wynn.

Today my cigars (and box) have returned to me!

The awesome people at the Rubicon Project — a company that helps you optimize your ad space — followed the plight of my lost cigars over at seowife.com and came to the rescue.

TRP hosted the suite party (and a crap load of other great parties around Vegas), and apparently didn’t mind hauling a box of someone else’s cigars home with them. Some less classy people probably would have smoked all my cigars and then given the box to one of their kids despite the inherent mixed anti-smoking messages that gives a kid as a rite of passage and glimpse into a world of intricate ritual practices that the human mind is addicted to like crack — but they didn’t. They overnighted them back to me in a cigar friendly environment and with a free T-shirt.

Thanks, Rubicon people! You guys are one class act. This also proves something I’ve been saying since I saw it on Family Guy.

“Things always work out if you just do whatever you want without thinking about the consequences.” -Peter Griffin

If you want to make some money, go read about money and making it at therubiconproject.com.

Picture of my re-united with my cigars:
2111535552_48c9cda64a.jpg

Picture of a Rubicon party that I wish was tonight:

pubcon2008-068.jpg

(photo courtesy of shoemoney.com)

→ 9 CommentsTags: Work The Jerk

SES San Jose…BLOODBATH!

August 29th, 2007 · 6 Comments

SES San Jose 2007 was even more awesome than usual this year. To prove how awesome it was, I am going to divulge the criteria on which I grade all vacations and trade shows.

Pianos: 9/10

If making 80 bucks playing through my 2 hour repertoire at the Fairmont hotel wasn’t awesome enough, then how about playing the hidden piano at the Googleplex? Pretty awesome if you ask me. For those of you who don’t know, the Googleplex is the top secret office/headquarters of Google.com. If you think you can get in whenever you please, you’re in for a fucking surprise because that place is tighter than the firewall at an elementary school.

For a nefarious internet “spammer” to get in and beat that piano up for a minute or two is pretty awesome.

The piano portion of this trip would be a 10 out of 10, however, there is no video of me playing the piano inside the Googleplex; and also, for all the hotel managers in the world, when a guy walks up to you with a hot girl after the piano has been locked up and says, “She wants to hear me play the piano,” there is no amount of rules or regulations that justify you in saying, “no.” Be a fucking guy, you dicks. I don’t understand how these people sleep at night.

Mayhem 7/10

Drinking, fights, blood, sewing people onto bed spreads; these are the things of a great outing. Several instances come to mind. Some people were caught up in a hotel lobby water fight. Shoemoney had to get his knee sewn shut — but not with stitches, with manliness.

Buds 10/10

I don’t think I’ve met as many new SEO people since my first Webmaster World. The people in this industry are more fun than in any other — and better looking, with the exception of the porn industry. So meeting new ones is always awesome. My facebook notifier has been ticking like a stock machine since I got back.

Overall: 26

As you can see, a 26 is pretty fun. See you in Vegas!

→ 6 CommentsTags: Work The Jerk

Spamming Tip!

July 25th, 2007 · 9 Comments

multiple-man.jpg

Every social networking site needs to send you an email to activate your account.

Instead of setting up a shitload of throw-away yahoo or gmail accounts, try this.

Buy a domain name like jerkmail.com or something like that.

Set the domain to forward all emails sent to that domain to your real email address.

Sign up for an unlimited number of accounts on your favorite social networking site. and tell Firefox to remember all the users/passwords.

Remember, if it’s not illegal, who the fuck cares?

UPDATE

Woops! I fucked up the comments when I upgraded my theme. They work now. Also, here’s a tip from Eugeniu

or you can forward them all to an email address which you pipe to a
php script that will automatically confirm the email ,)

That is a great idea. But it’s not going to work for a model who’s just trying to vote on her own contest submission and doesn’t know what the fuck PHP is.

→ 9 CommentsTags: Work The Jerk

Google Saved My Life

June 15th, 2007 · 1 Comment

google-pope1.jpg

Daven did a post like this today, so I figured I’d join in on the insane fun.

Yesterday my computer crashed. Massive hard drive failure. It was a RAID 0 drive lame reasons so the data is permafucked.

For those of you who didn’t understand that, RAID 0 Harddrives are like going down the freeway with each of your legs in two different cars. If one car runs out of gas and if you aren’t Jackie Chan, you are hosed.

I am hosed. Or at least I would have been.

Google saved my fucking life.

I recently moved all of my shit to Google. Documents to Google Documents, I sent all my existing email accounts to new Gmail accounts to use Gmail’s spam filtering.

Did you know you could do that? Use Gmail to download mail from another mail account and then use that gmail account from now on instead of your old Spammed to Death one? Well you can do that.

I lost a lot of psd’s etc in the hard drive crash, but what I didn’t lose was four books and a mountain of really fucking important email.

Google, you saved all my shit. I guess that makes us even for Vicodin stuff.

→ 1 CommentTags: Work The Jerk