I know that title sounds like it might be for a hair gel, but it’s actually for a new WordPress plugin I’ve had developed called “Scripts Manager”.
Here’s the situation I’ve been in umpteen times, and I’m sure you’ve either hit it yourself or at least you will eventually, it’s just a matter of time.
First the background…
You just activate the plugin and it’s done.
Usually, either the code has to go into the header above the </head> tag, or it needs to go into the footer, just above the </body> tag.
The only way that WordPress allows you to do this is to go into the theme editor and update the themes header.php or footer.php to include your code.
Now that might seem okay, but in practice what happens is a few weeks down the line, a new version of your theme is released and you update it. Or you find a better theme and decide to use that instead.
This has happened to me, and I figure it must have happened to you too.
When you update or change your theme, all the code modifications you put in get overwritten. D’oh!
More than once I’ve found I have several days tracking missing from one of my sites, all because I forgot to get the tracking code and place it into the updated version of the theme. (I use the StatCounter.com tracking service, and it’s well worth it.)
You’d think I’d learn, but it just seems to be one of my blind spots…
At this point you might be smugly thinking, “Ah, I use the free Google Analytics for my tracking, and I have a plugin that does that for me.”
My advice for what it’s worth is to get rid of GA immediately. This is a prime example of the case where many people follow the crowd and put themselves in a situation where they hadn’t even considered the consequences.
This is what those consequences can be…
If you use GA or AdSense, then a competitor can pay a few dollars and find every single one of your websites. (I’ve actually done this myself to study the structure of how one of my competitors was working his network of sites.)
And of course the other BIG downside to GA and AdSense is that if you upset Google, they can easily de-index ALL your sites because you’ve kindly let them know where they all are by adding tracking code to them.
The crowd is often wrong (1 in 5 times – 80:20 rule), and if you think hard about things and then follow a different path you’re much more likely to have the edge and to succeed.
That’s been my personal experience.
So I decide to get this plugin created to end once and for all the problem of updating and changing themes, and losing my StatCounter code.
And of course, I made it a little more flexible than I actually needed it to be, because… well you never know when it might come in handy.
In that section, there are global areas where the contents of each will appear on every post and page.
These global areas are for:-
- Header Scripts
- Footer Scripts
- Onload Scripts
That last one is for those unusual little instances where you need to run the script after the rest of the page has been loaded.
(I found recently that by using this plugin, it solved a problem with a script where all the pages on my blog were being blanked out in the Opera browser, but not in IE, FireFox or Safari. Very strange, but now fixed.)
And then we took it a little bit further, because in some cases you might only want your code to appear on certain pages.
So on every page and post in the admin panel, there’s a new section underneath the editor where you can either:-
- Overwrite the global settings.
- Append BEFORE the global settings.
- Append AFTER the global settings.
Between the global and the post/page settings, this gives you total flexibility over where your scripts are active on your site.
On Friday (5th) afternoon, 50 copies of the plugin will be available for just $7. When all 50 copies are gone I’ll set the regular price, but you’ll get it at a very nice discount until then.
Watch for a new blog post tomorrow.