I once laughed when a friend used WordPress 2.7′s auto plugin installer and temporarily hosed his blog.  He had uploaded a zipped file that wasn’t a plugin at all.  All he had to do was remember his shared hosting login and delete the plugin from the directory.  But it made for some comical  “OMG, what did I just do” moments.

Today I had a similar panic moment.  Half asleep, I uploaded a zipped file called jeromes-query-diagnostics.zip and clicked “install” using the plugin installer.   The plugin failed, but to my horror my blog now displayed a hundred lines of some weird text and had a php error up top.  The text appeared in both the admin panel and on the blog itself.  Since the plugin had automatically deactivated itself, I could skip that step.  Here were the additional steps I took in my panicked state.

  1. First I deleted the plugin from my plugin folder.  Unfortunately, I still saw lines and lines of text in both my admin panel and on my blog itself.
  2. I unzipped the plugin and read the files in a text editor, nothing there that looked like it changed anything.
  3. I read the error message and it pointed to another plugin.  So I deactivated all plugins.  Still no luck, but the error message changed.
  4. Now the error message pointed to my wp-pluggable file.  I opened that file in a code editor and checked the line causing the error.  Comparing it to a backup, it hadn’t changed.
  5. Next I uploaded a backup copy of every file in my wp-includes directory.  No luck.
  6. I checked my theme templates for any sign of change in the header, functions, or main templates. No changes compared to backup copies.
  7. I tried Googling the plugin itself to see if anyone had reported a similar error, nope.
  8. Now I googled some of the text and found it belonged to the gnu public license.  I tried renaming the license.txt file in my main directory, no success.
  9. Searching all my directories for license.txt, I found another in my plugin directory.  Duh!  Deleting that fixed the problem.

Turns out WordPress thinks anything in the wp-content/plugins directory is a plugin and executes it. The plugin had dumped a text file into the directory without creating it’s own folder.  Lesson learned.  Check all zipped files locally before using the auto-installer.  Don’t play with your settings when tired.  Finally, don’t take your anger out on your kids, even if they are banging the tv in the room with the wii controller while you are trying to fix your blog.  Now I feel bad for yelling at my kids to get the hell out of the room.  With any luck they will grow up hating blogs.