Performancing Metrics

Archive for 'wordpress'

Generic Stats WordPress Plugin on version 1.2

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Just another short little note to say that the Generic Stats plugin has been upgraded.

There are no MAJOR changes.

Here are the changes that HAVE been made:

  • * Updated look & feel of admin page
  • * Changed to use new “get options” methods
  • * Added pretty little “Plugin Appreciation” box on the Admin page
  • * Updated links to the plugin’s pages

Go read more about this plugin here:

Generic Stats Plugin

Please Link 2 Me Plugin updated to version 1.5

So, just a short post to say that the “Please Link 2 Me” WordPress plugin has been updated to version 1.5

Here’s a copy of the “changelog” section in the readme.txt:

= 1.5 =
* 2009/11/01
* Fixed changelog

= 1.4 =
* 2009/11/01
* Recoded to use new Options methods
* Changed look & feel of admin section
* Added option to modify size of TextArea (the box for link code)
* Changed main URLs for the plugin
* Added ability to add the box to a Page

I had 2 updates today because I had a copy/paste issue with the documentation. It’s been a long day.

You can read more about it the plugin here: Please Link 2 Me WordPress Plugin

Shell Script for Automating WordPress updates for multiple blogs

Many moons ago I read Joost de Valk’s blog post about upgrading and installing WordPress from SVN. Since then, every blog I maintain I use the WordPress svn repository to check out, and to update using the simple command of “svn sw“.

But even with that ease, it can get a bit tedious to upgrade 10 blogs, for instance.

So, as all “script writers” that are in between TV Series do, I wrote a script to automate this.

Read more

Updated my plugins – Please Read This!

I’ve updated my 3 WordPress plugins:

WordPress Generic Statistics Plugin

Please Link 2 Me

Hotlink 2 Link

I fell prey to the whole “serializing serialized options”. In the words of DD32:

Ahah! One of those people who insist on passing serialized data to update_option()…

Honestly: update_option() serializes any non-string data thats passed to it allready, get_option() will unserialize on return as well, In some cases you can end up with PHP double-serializing the string which while your code works fine with, it can create higher load on PHP..

My advice to all plugin developers: Just pass the data in and let the API do the serializing…

(Nothing really negitive towards you meant by this message)

(That wasn’t directed at me, but I did learn from it)

So, please update.

Warning

BUT! And this is a BIG BUT!

This upgrade will corrupt any previous settings you had. I’m really sorry about this. And believe me, any pain you go through because of this, I’ve already felt. I just had to upgrade 12 blogs, and manually re-add the settings that were removed. :-(

WordPress 2.6 is out and it’s Turbo Charged

It’s finally here. And a month ahead of schedule.

Why am I so excited for a new release of WordPress?

If you read my “Google Gears and WordPress” post, you’ll see. Working from a South African internet connection (the miserable iBurst to be exact), I REALLY appreciate the fact that it is now MUCH quicker to do things like place images and links inside my posts.

What else is new in this version of WordPress?

Here’s a video to highlight the major changes:

  • Post Revisions: Wiki-like tracking of edits
  • Press This!: Post from wherever you are on the web
  • Theme Previews: See it before your audience does
  • Word count!
  • Image captions
  • Bulk management of plugins
  • Full SSL support

For descriptions of these, visit the WordPress Development blog.

Hotlink 2 Link WordPress Plugin

Here’s a new plugin I’ve written for WordPress users who want to benefit from everybody who hotlinks to their images.

A little background on HotLinking

If you write an article and place an image in your post, that image most likely sits on your web server. Every time somebody views your post, that person’s browser will download the image.

If somebody else likes this image, they can put it in their own article in 2 ways:


Read more

WordPress 2.6 and Google Gears

ANOTHER UPDATE: WordPress 2.6 is out. When you’ve finished reading the article below (which I recommend :-) ), come watch the video about it’s new features in my post “WordPress 2.6 is out and it’s Turbo Charged

So, there I was, having just upgraded my local Windows installation of WordPress so that I could update one of my plugins when I noticed a new piece of text on the top right hand side of my screen:

Speed Up!

Little update: It would appear that this has now been renamed to “Turbo”

Who is WordPress to tell ME, the king of speed on a PC, to SPEED UP!?!?!
;-)

But, always one to improve on a process, I clicked it, and this is what I saw:

WordPress 2.6 and Google Gears helps speed things up while blogging

What is Google Gears?

Google Gears is a browser add-on from Google that enables web applications such as Google Reader and Google Docs to feel more like an offline application like MS Word or Excel.

It does this by storing information on your machine allowing you to read, edit and update “data” from the internet without actually being connected. And then, the next time you connect to the internet it synchronises with the website, uploading any changes you’ve made, and downloading any changes/updates that have been made on the site.

At least, that’s the very basic explanation of it.

Google Gears and WordPress

So, how about an example, using your friendly neighbourhood blogging platform?

Having installed the Google Gears plugin for my browser, I clicked the “Enable Google Gears” button, and this is what I saw:

WordPress using Google Gears to download required information to speed things up

As you can see, my browser is downloading all the information it needs so that WordPress doesn’t need to connect to the internet for certain information.

What has WordPress made faster

As a side note and introduction to what has been sped up, here’s a little rant.

I personally LOVE the changes that were implemented with WordPress 2.5.

But, some of the new features (and features I’ve just started using now that I use the Visual Editor) just aren’t as cool thanks to the not-so-great internet speeds in South Africa.

For example, if you want to create a link. Every time you click the link icon in the editor’s toolbar, it has to download the same stuff over and over…

Well, it looks to me like the WordPress Google Gears implementation has solved that. The link and the “insert embedded media” popups are now instantaneous!

WordPress using Google Gears to help speed up the process of adding a link

Thank you to whoever decided to do this.

It also seems that switching between each “pane” in the admin section is a LOT faster… Believe me, working on the South African tubes (via iBurst), this makes a HUGE difference!

Google will be PROUD!

All I can say is, this is going to give Google Gears the much needed attention that they’ve so far been lacking. Especially since out of all Google’s products, it’s only the Google Reader and Google Docs products that utilise Google Gears.

What you can do with WordPress

In response to a few questions by Mary on my post about using WAMP to install WordPress on your Windows Machine, I’ve decided to write a post and see if I can help her (and anybody else who needs it).

First, an introduction.

Everybody should have a website

I FULLY believe that everybody should have a website. Even more so if you run a business.

In South Africa, if you’re technically inclined (or, can just follow a few simple instructions) you could have your own website up and running in about 4 hours for about R1000 a year.

If you’re not really a technical person and you’d need to hire somebody to help you, then it may cost anywhere from R3000 for setup, and R1000 a year after that. Of course, this depends on the complexity of your website and your requirements.

With it being so easy, you really have no excuse for not having a site.

Why you should use WordPress

WordPress, in my opinion, is the best software for running anything from very simple websites to sites of medium complexity.

You can use it if you only need a couple pages containing the following information:

  • Home page
  • About page, with info about you and your company
  • Contact page – NEVER forget to have one of these

But, thanks to a whole lot of WordPress plugins (or just using some extra built-in functionality), you can use your WordPress installation to do the following:

  • Have a built-in forum
  • Create a mailing list to keep people up to date with your product listings, perhaps
  • Have a website with more than one user contributing to it. For example: a news website
  • Create a blog – you KNOW it’s all the craze now :D

What will my site look like?

OK, so Mary’s first question was: “I’m not sure if (and how) I can integrate my own design as I am not willing to use any ready-made templates”.

What ready-made templates is she talking about? Well, one of the benefits of using WordPress is that a LOT of people have created free templates that you can just upload to your installation to change the way your website looks.

As an example, just do a search in Google for free WordPress Templates or for free WordPress themes.

Of course, because they ARE available for free on the internet, you might not have a unique looking website.

To combat this, you could hire a WordPress template designer to design a custom look for your website, or, you could download one of the free templates and customise it to make it look unique.

Another option is to design your own theme however you normally do it, and then convert it for use with WordPress. This is obviously the route that I would recommend to Mary.

But, how do you do that? Well, if you’re OK with basic programming in PHP, you could take a look at the WordPress guide to coding WordPress themes and templates.

Or, you could hire somebody (like me ;-) ) to take your website layout and create a template that is compatible with WordPress.

How to publish your WordPress website

So, now that you’ve tested your WordPress website using the guide to install WordPress on your computer, and then you’ve gone through and created your own theme, you need to upload it for the world to see.

To do that, you need to do the following things:

  1. Get a web host – I recommend the on I use for my South African sites -> www.anno.co.za
  2. Ensure your web host allows MySQL databases and PHP websites
  3. Follow the instructions for Installing WordPress (it’s a little different to installing it on your computer)
  4. Change the settings of your site as appropriate
  5. Upload your WordPress theme and enable it
  6. Write all the pages you need!

It is that easy.

Of course, as I mentioned before, you could hire somebody to do all the technical stuff for you. Then you can rely on them to set up your site and lay it out correctly for optimal search engine crawling (which could help rank you website higher, helping you get more visitors).

So, Mary, hopefully you found this article interesting and helpful as a starting guide.

If anybody has any questions, post them in the comments section below, and I’ll see if I can answer them.

WordPress SEO Title Tag for Theme Designers

Everybody knows that H1 tags are supposed to “highlight” the most important heading on the page.

Whether this really helps with a site’s SEO is still up for debate, but in my opinion, having a good document structure can only help.

In most (if not all) WordPress themes, it’s the Blog’s Title/Name that gets the honour of wearing this badge. But your Blog’s Name shouldn’t necessarily have this honour on page’s that have a “main topic”. i.e.: Single Post pages.

So, what I recommend that all WordPress theme designers do is use H1 tags for your post’s Title on the post’s page, and use H1 around your Blog’s Name for all the other pages.

Here’s the code I use to do this:

For the Blog’s Name

a.k.a. bloginfo(‘name’) – This is usually in the header.php file, just replace the “H1″ before and after the Name with the following:

<?php echo (!is_single()) ? "h1" : "h2"; ?>

So, your Blog Info tags might look like the following now:

<<?php echo (!is_single()) ? "h1" : "h2"; ?> class="blog_title">
    <a title="Home: <?php bloginfo('name'); ?> " href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a>
</<?php echo (!is_single()) ? "h1" : "h2"; ?>>

(Of course, this doesn’t take into account that you’ve replaced the php calls to your Blog’s Name and URL with hardcoded versions once you’ve implemented a theme on your site).

Replace the H2 tag for your Post Title

And now, of course, you need to do the opposite for your post titles.

You need to replace the H2 tags that normally surround the Post Title (a.k.a. the_title()) with the following:

<?php echo (is_single()) ? "h1" : "h2"; ?>

This is usually in the index.php file, unless you have a template page specifically for single posts, in which case it will be in “single.php” (and then, you could probably just put “H1″, as this template will only be used for the Single Post pages).

So, you might have something that looks like the following now:

<<?php echo (is_single()) ? "h1" : "h2"; ?> class="title">
    <a id="post-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
        <?php the_title(); ?>
    </a>
</<?php echo (is_single()) ? "h1" : "h2"; ?>>

CSS Styling your titles

If you’re using a theme designed by somebody else, it might not be as simple as just replacing the H1/H2 tags with the above code, because you might find that the H1 tag has it’s own specific style, as opposed to the Blog Title/Name having a style class.

Now, I’m no designer, so this might not be the best advice, but here’s what I’ve done to work around it.

In the H1 tag (well, the Blog Name tag as it stands after the changes above) you can see I added a class=”blog_title”. And in my style.css file, I changed all the references to “H1” to “.blog_title“.

I hope this makes sense. Let me know if you agree or disagree with me.

Install WordPress on your Windows Machine

Whether you downloaded WordPress 2.5 or you would just like to test your theme or plugin on your own machine before uploading it to your site, I feel having an instance of WordPress running on your machine is a must.

Anyway, I’m sure there are quite a few tutorials for this out there, but I’ll write it here for my own reference, as well as yours…

Download WAMP

WampServer, in short, lets you run a webserver and database (which obviously WordPress needs), on your Windows machine. If you’re lucky enough to be running Linux or an Apple OS, then you can skip this step.

So, anyway, go download WampServer, install it, and you can accept all the default installation settings.

It should install to “c:\wamp”, which makes things nice an easy. If it doesn’t install there, just make a note of where you DO install it…

Once it’s installed, start it by clicking the shortcut. You should see that it’s running by the icon in your task bar next to the time, as seen in the screen shot below:

The icon when WampServer is running

Create a Database for WordPress

We’ll use phpMyAdmin for this step, which is a a Database (DB) admin tool that comes with WampServer.

Click on the icon that I showed you above and you should see the following menu:

phpMyAdmin option on the WampServer meny

Click the “phpMyAdmin” option to open the application up in a new browser window.

In the window that opens, click on the “Add a new User” link, as shown in the screen shot below:

using phpMyAdmin to create a database and user for WordPress

On the next screen, in the section “Add a new User” fill in the following information:

1 – A user/database name, like “wordpress25” (without the quotes)
2 – Change the “drop down” to say local, and it should populate the field with the value “localhost
3 – Choose a password for your user to access the database, like “wp25
4 – Select “Create database with same name and grant all privileges
5 – At the bottom of the page, click on “Go

You can use the following screen shot for guidance:

using phpMyAdmin to create a database and user for WordPress - 2

If this was successful, you should see the following screen:

using phpMyAdmin to create a database and user for WordPress - 3

Download WordPress

Now that your Database is setup, you just need a copy of WordPress to install. You could either download a test version of WordPress 2.5, or download the latest stable version of WordPress.

You can save it in the WAMP directory (see the first section of this page) in the “www” directory. For example: “C:\wamp\www

Then, just unzip it. If you downloaded the WordPress 2.5 copy from this site, then there should be a directory called “wp25“, otherwise it will create a directory called “wordpress“.

Install WordPress

Go into the directory, and edit the following file with notepad (or any text editor): “wp-config-sample.php“.

Replace the following “words” with the ones you used above in when creating the database:

putyourdbnamehere -> wordpress25
usernamehere -> wordpress25
yourpasswordhere -> wp25

If you look at the file, the 3 lines you changed should look like the following (I made the changes bold for ease of reference):

define(‘DB_NAME’, ‘wordpress25‘); // The name of the database
define(‘DB_USER’, ‘wordpress25‘); // Your MySQL username
define(‘DB_PASSWORD’, ‘wp25‘); // …and password

Then save the file as “wp-config.php“. Note that you took out “-sample” from the file name. You can do this by clicking on “File” then “Save As…” and taking out “-sample” from the file name.

Logging into your new WordPress Installation

In your browser, you will now go to the WordPress installation page by going to the following URL/link:

http://localhost/wordpress25

If you’ve been doing everything above while you read, then you should just be able to click the link and you’ll see the following screen (though the screen below is from a WordPress 2.3 installation):

WordPress Installation Screen

Just enter a blog title, like “Local WordPress Test”, enter an email address (not that you will really need it to be real) and click on “Install WordPress”.

You should see the following screen:

Successful WordPress Installation Screen

And, you should have a working copy of WordPress on your Windows Machine.

Just a note, make sure you write down the password that you are shown (or change it straight away in the admin section of WordPress). You won’t be able to recover a lost password via email (without a bit more hard work)…

I really hope this has helped you in some way. If it has, let me know.

And, if you have any questions, let me know as well!

UPDATE:

Shane left a link to his video on this process in the comments below. Here’s his video, which I think is excellent because of how thorough it is.

Another Update:

I was contacted by Hendry from blogbuildingu.com saying he had a tutorial for installing WP under nginx on your windows machine. Here’s what he had to say:

Recently, I’ve written a tutorial on how to install WP under Nginx, soon lighttpd and other options as well, including virtual machines.

The benefit is, nginx only takes 2MB of computer memory, which is much more friendly for desktop environment.

Go check out the article here: http://blogbuildingu.com/wordpress/install-wordpress-wemp