by WebKeyDesign | Nov 9, 2005 | WordPress
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.
Shortstat in Blue
One last thing that I like to do with Shortstat is change the color design. For some reason the red links really bother me, but since I started changing it I ended up adding color to the columns too. Here is kind of what it looks like in blue:

Custom 1.3 Shortstat Plugin
If you like the blue scheme and want to disable the IP lookup feature, you can download the plugin with the complete changes here:
wpshortstat.blue.txt
You can copy and paste the code into the Plugin Editor or rename the file to wp-shortstat.php and upload it to your server.
Custom Shortstat Plugin for WordPress 2.0
Since WordPress 2.0 came out I redid the changes, see WordPress 2.0 Shortstat Plugin.
by WebKeyDesign | Nov 7, 2005 | Networking
If you read my previous post on Troubleshooting Ports on DSL, then perhaps you will get the whole idea on how to forward ports, but as I discovered, powering off your routers may cause packet loss afterwards.
In a typical DSL setup your main DSL modem provide DHCP services, and although there is only one physical ethernet port that it connects to, unless you specifically setup the DSL modem to forward all traffic to your LAN router, chances are a reset could send packets to another ip address and all of a sudden your packets get lost going to a different ip.
To work around this, you either have to be careful about how you reset your routers or force the DSL modem to route everything to one IP address, therefore losing some of the firewall protection that the DSL modem is providing.
Here is a proper way to reset your home network and routers.
1. Turn off everything. This includes computers, routers, DSL modem.
2. Power on the DSL Modem first. Wait a few minutes until the LAN and WAN lights turn solid, usually green.
3. Power on your home router, the Linksys, Netgear, D-Link, or whatever brand you have.
4. After a couple of minutes, turn on the computers and other devices on your network.
5. Verify the NAT on the DSL modem is still setup properly and that the home router is connecting to the DSL modem with the correct IP address.
For the Cisco 678 ADSL modem, telnet into it and type:
show nat
The last lines that come up will show the last packets that were sent and what local ip they were sent to. It should be 10.0.0.2 for the 678, unless you changed it.
by WebKeyDesign | Nov 7, 2005 | SEO
If you are trying to improve search engine traffic, one way to help make your site bot friendly is to remove javascript from your pages. If you do not want to remove your javascript navigation completely, a nice compromise is to actually externalize javascript. You can go ahead and place your scripts in a separate directory, and then use the robots.txt file to disallow search engines from indexing this directory.
<head>
<script language="JavaScript" src="\myscriptsdirectory\external.js" type="text/javascript"></script>
</head>
This will cut down on the size of your overall web page, and let your content actually dominate the percentage of the text.
by WebKeyDesign | Nov 4, 2005 | 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.
by WebKeyDesign | Nov 3, 2005 | Networking
Recently I decided to upgrade my DSL broadband connection from Qwest. The upgrade would give me twice the download bandwidth of before and so I thought it was a great idea. However, I started having a lot of problems soon after the connection was upgraded. Most annoying were the web browser issues, where certain sites would come up as being unreachable or timing out due to no response. Most of the time I would just hit refresh and the web site would come up. The DSL connection feeds a small LAN network and so it was not just one computer, but all of them that were having this problem.
This problem is really the result of packet loss or DNS reponse, or as many techs call it DNS timeouts. On a slower connection, you might never experience this issue, but as your connection increases in speed, lag times from certain servers does become more apparant, and you can not assume that because your internet connection just quadrupled in speed, that the servers that you are communicating with will suddenly give your requests more responsive attention. It just does not work that way.
My LAN runs a Window2003 Server with DNS, so I started with this first. All the other computers point to Windows Server as their primary DNS Server. After making sure that DNS was running properly on the server, and that it too was having the same problem, I researched it and found this Microsoft Technote:
Some DNS Name Queries Are Unsuccessful After You Upgrade Your DNS Server to Windows Server 2003
It appears that Windows2003 supports extended DNS information, and that some routers are not letting these UDP packets through because they are larger than usual.
This issue occurs because of the Extension Mechanisms for DNS (EDNS0) functionality that is supported in Windows Server 2003 DNS.
ENDS0 permits the use of larger User Datagram Protocol (UDP) packet sizes. However, some firewall programs may not permit UDP packets that are larger than 512 bytes. As a result, these DNS packets may be blocked by the firewall.
The easy fix is of course to turn off ENDS0.
1. Install the Dnscmd.exe program from the Windows Server 2003 Support Tools. To install the Windows Support Tools, right-click Suptools.msi in the Support\Tools folder on the Windows Server 2003 CD-ROM, and then click Install. Follow the steps in the Windows Support Tools Setup Wizard to complete the installation of the Windows Support Tools.
2. At a command prompt, type the following command, and then press ENTER:
dnscmd /config /enableednsprobes 0
This did help the problem some, but did not make it go away completely, and chances are that if you just have one computer with broadband and you are having the same problem, then you need to start looking at something called the MTU setting.
DSL Reports has more detailed information on MTU settings, but the short story is that MTU is the maximum size packet you can send through your broadband connection to your ISP, without your router splitting it up. Think of it as the maximum occupancy of your connection. The most it can carry at once.
A simple test to find out what your highest MTU setting can be is to open a DOS Prompt and type:
ping -f -l 1472 www.webkeydesign.com
You can ping any server or website you want, but do not ping a site like Google, because Google has multiple servers, and you will end up pinging different ones possibly and get inaccurate results. Pick a specific IP or a site you know only has one server.
If you get the message: packet need to be fragmented, then you need to decrease the number 1472 by 1, until you no longer get that message. If you did not get that message, then you can try adding 1, until you get the highest value that does not fragment. Once you have that number, then just add 28 to that number and that is your MTU. Most setups will work with 1492.
If you are using Mac OS X, you can try using the Network Utility in the Utilities Folder, or just try the 1492 setting for starters.
Now comes the configuration part, you have to change the MTU in all your computers and in all of your routers (broadband modem and wireless router if you have a second router). Most likely your router is defaulting to 1500, so you will definitely need to change that. The MTU setting is network card specific, so you will need to make changes for each network adaptor.
Once you made the changes, the DNS Timeouts should be gone. If they are not then check with your ISP to make sure that you have the right DNS Server addresses. As a general rule with wireless routers or small home office routers, you should type in the DNS addresses into each computer, and not depend on the router for your DNS server. Most small routers have a hard time with serving as primary DNS, so it works out better to just type in the ISP DNS addresses into each computer. If you are running DNS locally with a Windows Server or Linux Server, then you usually can just use the local server as the primary DNS, and type in the ISP addresses as backups.
Additional Info:
How To Find MAX MTU?