Monday, 19 December 2011


Today I did some more KML / Google Earth debugging. I found that my KML was working correctly on my live website, but not my local dev website. So I performed the same actions on both the local and live KML, using Fiddler to record the HTTP requests. Then I used Beyond Compare to compare each request between the Live and dev versions. There were a few differences, but the main one was that the Live website used target="_blank" on the links, which worked, while the dev site didn't use target, and the links didn't work.

So I added target="_blank" to the dev site, and now that works as well. Phew!

Later, I checked the Google KML Reference, and it does actually say:

Targets are ignored when included in HTML written directly into the KML; all such links are opened as if the target is set to _blank. Any specified targets are ignored.

HTML that is contained in an iFrame, however, or dynamically generated with JavaScript or DHTML, will use target="_self" as the default. Other targets can be specified and are supported.

However, what it does not say is that target must be set to _blank for links to KML to work. Still, if I had read that earlier it probably would have given me enough of a prompt to discover that the target property was the problem, which would have saved me hours of work discovering that myself.

After sorting that out, I ran the IIS Site Analysis on my dev site. One of the errors it came up with was that the wordpress author link went to a 404 not found error page. I did some googling and found a few posts on the wordpress forums where people were having the same problem, but no solutions were given. Then I found this page: WordPress Authors Page 404 Page Not Found Error.

I did what the author suggested (altering the value of wp_users.user_nicename in the database to have no spaces), and it worked nicely. Now the author link works and no more 404. Interestingly, I noted that all the other users (subscribers) already had user_nicename so that it contained dashes instead of spaces, my author nicename was the only one with spaces.

Another thing I found from the Site Analysis, was that it had a 404 error for the cite attribute of a blockquote. I had just put the name of the person who the quote came from as the cite, it wasn't a URL, so no wonder it 404'd. Looking it up (Quotations: The BLOCKQUOTE and Q elements), I found that what I'd done is incorrect, and it should be a URI.

I had quite a few links on my blog where I had just used the link text 'here', e.g.

This is tenth post in my series on how to be a boring blogger, you can read the first post <a href="/link/to/post" title="How to be a boring blogger part 1 - blah blah blah">here</a>

However, the IIS Site analysis report flagged these for having non-relevant link text. I had always thought that so long as you used the title text to explain what the link was, then it didn't matter that you used non-relevant anchor text. But investigating this, I found that the purpose of the title attribute is to convey extra information about the link: W3C - The title attribute, and is not really given much relevance by search engines: SEOmoz - Link Title Attribute and its SEO Benefit. Another useful link I found on link titles was this one, linked to from the SEOMoz article: RNIB Web Access Centre - TITLE attributes.

So I started to change my link text to be more like:

This is tenth post in my series on how to be a boring blogger, you can read the first post here: <a href="/link/to/post">How to be a boring blogger part 1 - blah blah blah</a>

I only left the title attribute in if it gave more info than the anchor text.

When doing this, I noticed that some posts seemed to be duplicated. I thought I had turned off post revision in Wordpress, but when I checked, I couldn't even find a setting for it. I think that probably I used to have a posts revision plugin installed, and turned it off in the plugin. But then subsequently I must have uninstalled the plugin.

So I found some info on how to turn the posts revision off - add define('WP_POST_REVISIONS', false); to wp-config.php. And I also found a plugin that removes all post revisions from the database: Better Delete Revision. So I installed and ran that, then deactivated it. It removed a load of post revisions, reducing the database size by quite a bit. Nice!

With that done, I finished off my job of replacing all the links with the anchor text 'here'. I did this by exporting the wp_posts table using phpMyAdmin, then opening the saved sql file in gedit text editor. Then I just did a find '>here<' to find any links that needed changing.

I still have a lot more things brought up by the IIS Site Analyzer that I need to fix, but they will have to wait until tomorrow now.

In other news, it was revealed today that North Korean dictator Kim Jong-il died a couple of days ago. I checked the Juche Songun blog, and they have a post where you can leave your condolences: Сообщение о кончине товарища Ким Чен Ира. It seems strange that people would leave messages of condolence to Kim Jong-il, but when you consider people leaving messages there have an image of Stalin for an avatar, I guess it's not so weird.

On the news they had someone saying that the North Koreans are much smaller and weigh much less than South Koreans due to malnutrition. I wonder how they got this information? Did they go into North Korea and measure lots of Koreans? If they had done this government consent, I certainly doubt they would have got an accurate sample. If they did it without government consent I certainly doubt their sample was of a reasonable size and spread over a reasonable area.

I wonder if they also considered whether South Koreans were taller and heavier due to eating foods full of growth hormones and artificial additives. It would also be interesting to know how Chinese Koreans compared in weight and height to those living in North and South Korea.

For the moment I hope that the North, South, and America don't try provoking each other, as they seem prone to do. Just leave North Korea alone while it settles down with Kim Jong-eun as leader, and hopefully he will be a better (for the people) leader than his father. I'm not sure if he will ever live up to titles of his father though, such as World’s Best Ideal Leader with Versatile Talents, Humankind’s Greatest Musical Genius, and Master of the Computer Who Surprised the World (list of titles used to refer to Kim Jong-il by North Korean state television).

No comments: