Fix for “The plugin does not have a valid header”

If you’ve ever seen this error when trying to install a plugin in your WordPress Admin Panel, you have probably considered going on a murderous rampage:

“The plugin does not have a valid header.”

This error is probably due to your list of Plugins being cached in whatever WP Object Cache your blog / site is using. None of the sites you will find when searching Google will tell you this. They will tell you that you have an invalid Plugin Header. You might. But probably, your list of files is cached.

There are 2 problems here:

1) The list of plugins ( $cache_plugins ) is not pluggable

2) the generic error for all missing plugins is “The plugin does not have a valid header”

function validate_plugin($plugin) {
    if ( validate_file($plugin) )
        return new WP_Error('plugin_invalid', 
            __('Invalid plugin path.'));
    if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
        return new WP_Error('plugin_not_found', 
            __('Plugin file does not exist.'));

   $installed_plugins = get_plugins();
   if ( ! isset($installed_plugins[$plugin]) )
       return new WP_Error('no_plugin_header', 
           __('The plugin does not have a valid header.'));
   return 0;
}

TO FIX THIS GARBAGE = in /wp-admin/includes/plugin.php at line 219-ish, comment out the lines below then visit your Plugins list:

// if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
$cache_plugins = array();

// if ( isset($cache_plugins[ $plugin_folder ]) )
// return $cache_plugins[ $plugin_folder ];

When you’re done and everything works, un-comment those lines. If this didn’t fix the problem, then yes, you probably fucked up when creating the Plugin header comment.

Move Your Money

I usually only use this WordPress blog to write about WordPress plugins I write and the occasional funny anecdote, but I wanted to share what I think is an awesome initiative I have found called Move Your Money.

The global financial meltdown of 2008 has been fascinating for me: not the outcome, but reading about what happened. If you know nothing about it, the movie Inside Job is a good place to start I suppose, but it doesn’t really tell the whole story and comes off as a little hack-y.

I read The Big Short . It really ignited my interest to explore the disgusting inner-workings of Wall Street. Mainly after I saw this 60 Minutes episode:

My favorite book on the crisis is Griftopia by Matt Taibbi:

You can also check out these fascinating eps of PBS’s Frontline on Netflix (also Instantly-watchable):

Breaking the Bank, focuses on Bank of America’s accusation of Merrill Lynch
http://www.pbs.org/wgbh/pages/frontline/breakingthebank/view/

Inside the Meltdown, focuses on Hank Paulson and the Bailout
http://www.pbs.org/wgbh/pages/frontline/meltdown/view/

Anyways, these are just a sampling of the things I have watched and read that have filled me with rage, bewilderment, and a complete sense of powerlessness. Yay! I mean really, there is nothing almost anyone could do that would change anything when it comes to Wall Street.

BUT, there are a few things you can do to minimize the financial raping that any one individual bank can thrust onto you.

1) Don’t use Credit Cards

Easier said than done, believe me I know, but I got fed up and just paid off all of my credit cards in full. At the height of the crisis, all of my lenders jacked my APRs to 30% interest. Thanks, assholes. Being lazy and despondent, I made minimum payments and allowed my balance to hover near max. If you ever want to know for sure how bad of an idea that is, take a gander at your credit report. One of the single biggest factors in your credit score is your debt-to-credit ratio. It’s simple math: if you have a $1000 line of credit and are using $995 of it, your score goes down. If you are using 0% of it, your score goes up.

Now, let’s say you have 5 cards that all have balances. You might think to yourself, I should pay off all 5 balances and then cancel 4 of them. Not so fast…. closing accounts fucks with your credit. You can actually do damage by removing them. Does this make any sense? No.

Anyways, I recently paid off my MasterCard and my Chase / Best Buy Card. Those fuckers still charge me $3 a month for the honor of having a $0 balance, but they can’t hurt me anymore financially.

Allie recently paid off her CapitalOne card in full. They keep calling her trying to suggest ways for her to get into financial peril. They suggest taking a vacation, paying bills, taking out a fucking cash advance! When she counters with “No, you assholes raised my APR to 30% without any warning, I am never using this card again” they say “don’t you want to close the account?” she says “no, that will hurt my credit even more.” Their actual response: “Whatever.” Click. Dial Tone.

2) Leave your Big Bank, do your banking at a local Credit Union

Brian Gitman turned me on to this over dinner at the ever elegant and delicious Hooters on Saturday night. From Wikipedia:

credit union is a cooperative financial institution that is owned and controlled by its members and operated for the purpose of promoting thrift, providing credit at reasonable rates, and providing other financial services to its members.[1][2][3] Many credit unions exist to further community development[4] or sustainable international development on a local level.[5]

Here is the definition of a Big Bank. From CapitalOne:
“Take out a cash advance at 30% APR” … “Whatever”

I am only now learning about Credit Unions, so I don’t have anything to report yet, but definitely check this out: http://moveyourmoneyproject.org/

3) Follow the developments of projects like BankSimple

Check it out here: https://www.banksimple.com/

The former lead developer of Twitter, Alex Payne, is working on this project. Once it launches, count me in as one of its first customers.