Tag: mysql

Custom Shortstat Plugin

A very handy plugin that I use for web stats is Jeff Minard’s WordPress port of Shortstat, which is a script that Shaun Inman originally wrote.

Shortstat Plugin Conflict

It appears that Jeff recently updated the Shortstat plugin to version 1.3 and that there was a conflict with another great plugin, Google Sitemap Generator. After some research on WebKeyDesign, I found that the 2.7 version of Google Sitemap Generator conflicts with the 1.3 version of the Shortstat plugin. But the 2.7.1 version works fine. If you have not updated Sitemap to 2.7.1, first do that then download the new 1.3 version of Shortstat and set that up. This should make both plugins work.

Shortstat Slows Down WordPress Dashboard

As if the Dashboard was not slow enough some days, Shortstat adds even more delay due to the IP address lookup that it does. You can disable this feature if you do not particularly care about what country your visitors are from. Most webmasters want to know what state or region in the USA, instead of the country, so for many webmasters this feature is not specific enough. To disable the feature just go to line 119 and look for the following code:

$coinfo = @file('http://www.hostip.info/api/get.html?ip=' . $ip);
$country_string = explode(':',$coinfo[0]);
$country = trim($country_string[1]);

Change the code to this:

// $coinfo = @file('http://www.hostip.info/api/get.html?ip=' . $ip);
// $country_string = explode(':',$coinfo[0]);
// $country = trim($country_string[1]);
$country = '(Private Address) (XX)';

The Dashboard will still be slow due to feeds but Shortstat will not add to the delay.

Shortstat Database Data

If you take a quick look at the stats that you get, you can tell that they can start to add up and that while these stats are adequate for a quick daily glance, they are not really something to keep for a year or even more than a few months, so what you eventually need to do is zap the stats from time to time.

Shortstat adds two tables to the WordPress database: ss_stats and ss_search. I personally zap ss_stats more often than ss_search, since ss_search has the data for sites that refer to me and what searches people have used on my weblog. You can however zap both tables. If you have your log hosted on cPanel or have access to just phpMyAdmin you can easily do this. You will need to select only the two tables, and none of the other tables or you could end up deleting your blog data!!! Make sure you backup first. You can reference my Optimize Your MySQL Databases instructions, which should help you understand the process a bit better. The only difference is that instead of optimizing the table, you will be choosing to empty the selected table.

Continue reading

Filed under: WordPressTagged with: , , , , , , , ,

Speeding Up WordPress

Now this may seem rather obvious, but many WordPress users enable an option that slows down postings even when the option actually warns you that this slows down postings. If WordPress just seems slow to you when you are adding content, make sure that under Options – Discussion Options – Attempt to notify any Weblogs linked to from the article is cleared and not checked. This will stop WordPress from pinging multiple websites and slowing down the posting process.

For speeding up WordPress for viewing, you need to install WP-Cache 2, which is an excellent plugin and in my opinion one of the top essential WordPress plugins.

Once your WordPress databases grow, you should definitely take the time to optimize your MySQL databses. The process is quite simple and the benefit is immediate.

Filed under: WordPressTagged with: , , , , , , ,