Dax

Big Fuck Up in Wordpress 2.5 & WP-SuperCache 0.61

April 11th, 2008 · 33 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!

→ 33 CommentsTags: Work

Increase Draft Limit: WP Plugin

February 8th, 2008 · 31 Comments

In addition to secretly wrecking the Object Caching Database in one of their recent releases, Wordpress also removed the usable number of drafts from the Write Post page.

In previous Wordpress versions, your Write Post page listed a few dozen drafts. Now, it lists 3 and I don’t think they’re in any kind of chronological order. In addition, I found the new search and sort system they devised to wade through all your old drafts to be monkey shit. For example, where in the flying fuck are the page numbers? That’s why I wrote this plugin.

Increase Draft Limit will show all of your drafts on your Write Post page. If you want to limit that to 10 or 20, just open the file and change 99999 to 10 or 20.

Download Increase Draft Limit

→ 31 CommentsTags: Wordpress Plugins

Fix Corrupt Serialized Data

January 18th, 2008 · 14 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;
}

→ 14 CommentsTags: Work

The Prodigal Cigars Return!

December 14th, 2007 · 31 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)

→ 31 CommentsTags: Work

Fuck You Gmail!

December 13th, 2007 · 29 Comments

she-he.jpg

Why the fuck is an advertisement for “He-She Escorts” showing up in my Gmail?

And if someone wanted a He-She Escort, would this be the best way to pick up the client? There’s a reason prostitutes are called “ladies of the evening” and “professionals”. That’s purchasing sex with a side of self-respect.

A “She He” does not exactly ooze class with a sly wink to your trousers. Actually…what would?

CONTEST!

Okay, this is my Dax Biggnuts Contest for 2007, which ends when the ball drops. Whoever can think of the classiest name for a transsexual prostitute wins a link on my sidebar.

Da Rules

1. You have to post your classy transsexual prostitute name somewhere on your blog and link to this post.
2. Your entry must be submitted before I wake up and check my email Jan 1.
3. Here are some off-limits entries because I already thought of them:
Hot Totties
Sausage Queens
Wacky Wavy Inflatable Arm Flailing Tubemen

Goodnight.

UPDATE

If my trackbacks don’t work, post a comment pointing to your blog post. I know you’re good for it.

Also, this contest is open to non-SEO people too.

→ 29 CommentsTags: The Shaft

Me in a Sugarplastic Video

September 25th, 2007 · 7 Comments

See if you can spot me in this Sugarplastic Music Video

I’ll give you a hint: it’s almost exactly 1 minute in.

→ 7 CommentsTags: Ass Kicking