Time tracking is important – RescueTime

RescueTime

I’ve been using RescueTime for quite a while now. The main thing that I like about it is that after you launch it (in case it’s not on your startup list already) you can forget about it. Oh, and it’s free. Most of other time tracking software require you to push some kind of “record” and “stop” button. When I am working on a project for instance and a friend sends me an instant message or my boss needs to chat with me regarding something important I will more than surely forget to pause the time tracking program. So I will bill my client for the time I used to chat with someone else. That is not fair and can become annoying. It is relatively easy to forget about that. RescueTime runs quietly in your system tray and does all the proper tracking all by itself without you needing to hit some kind of buttons. For example I labeled the applications I use on my project with the name “project”. So, that way at the end of the week I can easily filter out all my data based on that label, so I will know how much time I used on that particular project. Very easy and effective.

As far as portability, I successfully managed to install, configure and use RescueTime on Ubuntu 8.04 and 8.10. However there is still much to do in this direction as there are some issues (for example the terminal window is logged in with a different name almost every time). If you are an advanced python coder and know your way between the lines you should be able to solve this and other problems. Who knows, you might even lend a hand to the boys that maintain the project. Nevertheless, if you don’t need to do some fancy schmancy logging this could work for you. A version for your Mac is also available.

One could argue that saving all that logged data on who knows what server is risky. Well, it’s free, its great features are better than a lot of paid software, no complaints have been addressed yet. No matter how many reasons I find to enforce that RescueTime is so great one thing is for sure: if you can log all your data locally with half the features RescueTime has, do it.

Posted in programs | Tagged , , , | Leave a comment

Happy Holidays from Softinquiry !

Happy Holidays !

Wishing you a “Merry Christmas and a Happy New Year !” This is my last post in 2008 so I just wanted to say I am grateful for everything that I accomplished so far. This year a lot of great things happened to me. Thanks everyone for being there for me when I needed you.

See you next year !

Posted in Uncategorized | Tagged , , | Leave a comment

Having a hard time with StatPress plugin for WordPress

statistics
Some while ago I installed StatPress plugin on one of my blogs. I wanted to see how it worked and if it was indeed a good plugin. After a couple of days I decided that Google Analytics is way better and helps me keep a light load on my blog. Anyway, this plugin showed some interesting data, useful in many cases and it showed it in a pleasant way. However the amount of stress handled by my blog was too big for the purpose of recording some stats. At least Analytics was doing it almost seamless.

Of course that after a while I disabled the plugin without knowing what actually happened in my database. I don’t remember if the plugin had some kind of option to do a less “aggressive” logging or not but the truth is that wp_statpress table generated by the plugin had about 5 Mb (which is definitely not good). Nevertheless the blog was OK; the plugin had been disabled, everything was back to normal; or at least that’s what I thought. A couple of days ago I had to move my hosting to another company. Did a full MySQL backup and one for the home folder. It is important to know that the database backup was created using PhpMyAdmin tool (Export, Save as file, nothing fancy). The whole SQL file was about 7 Mb in size. OK so I had a problem as the maximum limit of an uploaded file on the new host was something like this: “(Max: 102 kKiB)” (yes, I know… what kind of hosting is that ? but it’s better than nothing and no, that’s not a typo, that’s the way it shows up in PhpMyAdmin.

So there was no way I could upload the file that way. I decided to start my Wamp server and to upload the SQL file in a temporary database. After a while PhpMyAdmin timed out. I opened up Navicat and saw that 23 tables were processed. Guess which was the last one ? Yep, it was wp_statpress. I browsed the table and saw exactly 1000 entities. Lots and lots of statistical information. I decided to take a look inside the SQL backup file. I searched for the name of the table and guess what ? There were more than 15.000 lines to be processed. Each line was an actual entity which contained all the imaginable and unimaginable information regarding the visitors of my blog. I don’t remember if the plugin had or not (at least the version I used back then) some kind of option that would have let you clean the logged information from the database whenever you want or from time to time. I didn’t use the plugin more than 2 or 3 days and my blog didn’t receive great amounts of visitors. Imagine what would happen on a large scale blog. Seeing this I sat and thought… “gosh, when I will write a public plugin for WordPress it will have some tables in the database I will make sure to have an option saying something like: “Are you sure you want to wipe out all the settings and data stored so far by this plugin plugin as answers: “No, I’m sure I will be using this again.” and “Yes, get me clean !” just to make sure the user will always have a clean database”. It would be nice to have this implemented in the actual core of WordPress.

Anyway I started by deleting all that was related to wp_statpress first place). Everything went smoothly. I then adjusted the wp-config.php file but something was still not working. The database connection was being established but I was getting this warning:

1233e8468d37312c813e9c9f42a039dd000

Only then I remembered that because I was in a rush when I created the database backup I forgot to disable all my plugins and widgets (you might want to check this page out before upgrading WordPress). I couldn’t get into the admin interface, my blog wasn’t showing up so I googled for that error and found a cure. I added the following lines in my theme’s functions.php file:

delete_option('widget_text');
delete_option('widget_rss');

Then I cleared my browser’s cache, refreshed the pages a couple of times and everything was back online again. Then I removed the above lines from my file. I was home free :)

I also had some problems with the user permissions on the MySQL databases on the new server so the “Data Transfer” Wizard from Navicat helped here as well.

I hope this story will be of use to someone one day.

Posted in experiences, wordpress | Tagged , , , , , , | 2 Comments

Guest Post Spot Available

If you are interested in writing a guest post for Softinquiry.com feel free to contact me.

Posted in Uncategorized | Tagged , , | Leave a comment

WordPress SEO – optimize your META Keywords & Description manually

I am a big fan of the “All In One SEO Pack” plugin for WordPress. It really helps you make sure your blog is as robot-friendly as it gets. I’m not going to give any details because this post is not about the AIOSP plugin. I’m loving the idea of having such great plugins helping you with what could easily get a really messy task. On the other hand I like to help out myself and write small pieces of code that give me exactly the results I want without having all sort of third-party plugins doing it for me.

What I will try to do is to have 100% dynamical META keywords and descriptions for every page of the blog without using any plugins.

Let’s take a look inside the header.php file of your theme for instance. You should see the lines below somewhere in your file however bare in mind that depending on your theme the following lines might be slightly different:

<meta name="keywords" content="bla,bla,bla" />
<meta name="description" content="bla,bla,bla" />

Before going any further I should make something clear: the keywords attribute should be relevant to the content of the page. That’s a must and everyone knows why. So before defining some static keywords blog-wide (I suggest that 8 should be the maximum number of keywords used) in the header.php file that basically define the area covered by your blog (sports, traveling, etc.) you might want to consider the fact that these keywords will be used for all your posts and pages.

A common form for the description attribute is the following:

<meta name="description" content="<?php bloginfo('description'); ?>" />

description which you can easily define in the admin interface. Well, that again doesn’t serve you any good as the description of your blog might not accurately summarize a certain post (probably none of them).
OK so now we have some static keywords and a general description. Both of them are carried around on your entire blog without actually having something to do with a random particular page. Keywords and description that don’t match the content of the page ? I don’t think anyone wants that. That’s about it with the static keywords and description; problem which I’ve seen on many blogs.

As we move further I will concentrate more on the keywords attribute and leave the description at the end. I for example have three methods for defining the tags for an article:

  • Using the All In One SEO Pack form that shows up whenever you create/edit an article
  • Using the built-in Custom Fields form that like AIOSP form shows up right under the WYSIWYG editor
  • Using the good old Tags form that I’m sure everyone is familiar with.

Of course depending on which plugins you have installed you might have other possibilities of defining tags for a post.

Instead of using some complicated methods to achieve this simple task why not use the already built-in form. You can then call the the_tags() function and have the post’s tags shown right under its content. Of course that’s nothing new, everyone is doing it since like forever. OK so why not using those tags as keywords ? Yesterday it sounded like a good idea for me so I said to myself why not try to put those tags as keywords in the header.php file of my theme. What will we accomplish with this ? Well… nothing much actually except for the fact that all the META keywords will perfectly match the content of any page of my blog.

Enough with this already, let me give you the code that does all the magic.

1
<meta name="keywords" content="
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
//here we make sure that what's to come will affect only the pages that show the article content
 if (is_single()){ 
 
//here we call the function that is responsible with passing numerous post attributes (tags, content, etc.)
the_post(); 
 
//here we get the array returned by the function
$posttags = get_the_tags(); 
//we make sure that our post has tags
if ($posttags) {  
	//we will use this variable to count how many tags we have
        $i=0; 
	//with every loop we will assign each element to the $tag variable 
        foreach($posttags as $tag) { 
		 //now we will store each keyword into a more friendly array placing a comma after each one
                 $str[$i]=$tag->name . ','; 
		 //here we make sure the first keyword won't be overwritten with the next keyword
                $i++;
	}
}
//here we will store the length of the last word
$len=strlen($str[$i-1]);
 
//here we will make sure that the comma after the last keyword is removed so that we have a tidy keyword list
$str[$i-1]=substr($str[$i-1],0,($len-1)); 
 
 //here we will simply output the list of keywords in its final state
for ($k=0; $k < $i; $k++){ 
	echo $str[$k];
}
}
//if this is not an article page then use those predefined home keywords
else 
{
echo "here will go the keywords matching your home page";} 
?>
39
" />

Due to a tricky set of instructions in GeSHi I had to split the code into those three blocks above. The line numbering however is correct so you should assemble the code easily.

Now that you copied the code above into your header.php file you will see that your articles aren’t showing up on their pages. Why is that ? Because you didn’t call the_post() function in a proper loop. Actually there’s no loop at all there. The actual loop used for displaying the post’s content is in your single.php file. Now we have to undo all the “damage” we caused. Don’t worry, nothing bad happened. All you need to do is to place the following code before your loop (if you don’t know what the loop is, here’s an explanation):

<?php rewind_posts(); ?>

There you go ! Now everything should be working again.

This might not be a viable solution for some of you out there but for me it definitely does the trick. I’m sure that some of you who are advanced PHP programmers will find or already know a simpler method for what I’ve accomplished here. Hopefully the commented lines will help you understand the code and not get in your way while trying to understand it.

As I promised I will now offer a variant of generating the description attribute entirely dynamic, again strictly based on the post page. I thought that a good description would be an actual excerpt of the article. It’s more like a preview after all. The default excerpt (if you don’t write a specific one in the Excerpt box under the WYSIWYG editor) contains the first 55 words of your article. No HTML tags, no nothing, just plain text (well, not actually). So what I’ve accomplished is to have a specific, unique description, again for each and every page of my blog. Here is the code:

1
<meta name="description" content="
2
3
4
5
6
7
8
9
10
11
12
13
<?php
//we make sure that what's to come will affect only pages that show the article content
if (is_single()){
//here we will store the real "tagless" output of the excerpt
$excerpt = strip_tags(get_the_excerpt());
        //and of course here we will output the final excerpt 
        echo $excerpt;
}
//in case we are on the home page for instance we will display the default description
else{
bloginfo('description');
}?>
14
" />

Again, be advised of the code splitting I had to do. Because we called the_post() function in the keywords attribute (which in this case has to be before the description attribute) we don’t need to apply “the fix” again in the single.php file. However if you want to try only the code that affects the description then you will need to call the_post() function right after is_single() function, exactly as shown in the code related to keywords attribute.

Some would say that this whole thing isn’t such a big deal but actually it’s just one idea I had yesterday which I am blogging today. The possibilities are endless. We are limited only by our knowledge and imagination. Please feel free to comment on this idea of mine. You might have something to say that really matters. And as a wrap up, I really hope you enjoyed reading this article and hopefully it will help you in a way or another.

Posted in scripts, wordpress | Tagged , , , , , , | 9 Comments