<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dr. Scott M. Baker &#187; web publishing</title>
	<atom:link href="http://www.smbaker.com/category/web-publishing/feed" rel="self" type="application/rss+xml" />
	<link>http://www.smbaker.com</link>
	<description>Scott&#039;s project and hobby site</description>
	<lastBuildDate>Thu, 09 Sep 2010 02:36:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress and mod_rewrite</title>
		<link>http://www.smbaker.com/wordpress-and-mod_rewrite</link>
		<comments>http://www.smbaker.com/wordpress-and-mod_rewrite#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:01:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress-and-mod_rewrite</guid>
		<description><![CDATA[Apologies in advance that this is a long and confusing post…
Part 1: The problem
I decided I wanted to migrate my old Land of Devastation website at http://www.landofdev.com/ over to a subsection of http://www.smbaker.com/. There are several reasons for this, chief among them being that the Land of Devastation website doesn’t really stand by itself and [...]]]></description>
			<content:encoded><![CDATA[<p>Apologies in advance that this is a long and confusing post…</p>
<p>Part 1: The problem</p>
<p>I decided I wanted to migrate my old Land of Devastation website at <a href="http://www.landofdev.com/">http://www.landofdev.com/</a> over to a subsection of <a href="http://www.smbaker.com/">http://www.smbaker.com/</a>. There are several reasons for this, chief among them being that the Land of Devastation website doesn’t really stand by itself and doesn’t have a whole lot of pages. I’d rather discuss all of my door games together at my main site.</p>
<p>So, as part of the process I setup my provider to map the domain name <a href="http://www.landofdev.com">www.landofdev.com</a> into my existing <a href="http://www.smbaker.com">www.smbaker.com</a> website at a subdirectory of /landofdev. All I needed to do then was some simple rewriting or redirecting of pages that well into /landofdev/ to send them to the appropriate location in the main website.</p>
<p>Well, I thought it would be simple…</p>
<p>Part 2: Understanding mod_rewrite and wordpress</p>
<p>I spent a great deal of time one night trying to figure out how the wordpress mod_rewrite rules worked, and more specifically trying to figure out how to internally rewrite pages from one of my domains into another. Let’s start by looking at the rules that wordpress puts into the .htaccess file:</p>
<p><code>&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;</code></p>
<p>If you’re familiar with mod_rewrite then this probably makes a lot of sense to you. If you’re not familiar with mod_rewrite, then let me explain it. The first RewriteCond checks to see if the current request maps to an existing file. If it does, then the remainder of the rule is skipped. The second RewriteCond checks to see if the current request maps to an existing directory. If it does then the remainder of the rule is skipped. These two checks allow you to mix static webpages on your site with Wordpress permalinks. For example, say my website has a file:</p>
<p><code>/foo/bar.html</code></p>
<p>If a user request arrives for /foo, then the ‘-d’ rule sees this and aborts any further rewriting. If a request comes in for /foo/bar.html then the ‘-f’ rule sees this and aborts further rewriting. On the other hand if a request arrives for “/foobar/some-permalink”, then this request will be rewritten since /foobar/some-permalink is neither an existing file nor an existing directory.</p>
<p>Finally, the last line of the rule is the RewriteRule. It says to that anything that has made it this far should be rewritten to /index.php. Index.php is the main entrypoint for your wordpress site. The result is that anything that didn’t exist as a file or a directory gets sent to inedx.php where wordpress can do with it whatever it wants (normally, interpreting the URL as a permalink).</p>
<p>Part 3 – What I wanted to do and why it doesn’t work</p>
<p>Late one night I decided I wanted requests on my site for /landofdev/ to be rewritten to /games. “games” was a permalink on the website. This sounds like a pretty simple rewrite rule, doesn’t it? You might think of coding it up like:</p>
<p><code>RewriteRule ^/landofdev/$ /games [L]</code></p>
<p>Unfortunately, it doesn’t work. Not worth a damn. The RewriteRule itself goes off as expected, rewriting a request for landofdev/ to /games. Then it hits the wordpress rewrite rules, which further rewrite /games as /index.php. So far, so good – we’ve managed to route our request into wordpress. However, wordpress doesn’t really care what the page was rewritten to. It uses the REQUEST_URI variable from the web server when parsing the permalink. Mod_rewrite doesn’t modify the REQUEST_URI. So, although my little rewrite rule managed to get /landofdev/ routed to the right place, wordpress never saw the “/games” that I’d intended to rewrite it to, instead getting “/” out of REQUEST_URI, trying to find a permalink named “landofdev” and failing with a 404 error.</p>
<p>minor confusing footnote – the reason REQUEST_URI for <a href="http://www.landofdev.com/">http://www.landofdev.com/</a> contained in “/” instead of “/landofdev/” is because of whatever mojo the web provider is doing to map that domain into that subdirectory.</p>
<p>Part 4: How I bent wordpress to my will</p>
<p>I eventually solved with problem with an ugly hack. I placed a wordpress index.php inside of /landofdev/ on the website and added an ugly little if statement to it.</p>
<p><code>&lt;?php<br />
define('WP_USE_THEMES', true);<br />
if ($_SERVER[REQUEST_URI] == “/”)  {<br />
    $_SERVER[REQUEST_URI] = “/games”<br />
}<br />
require('../wordpress/wp-blog-header.php');<br />
?&gt;</code></p>
<p>Additional if statements could be added to remap additional pages, and you can also use wp_rewrite to help out a bit (one if statement to do a blanket redirect of everything in /landofdev, plus wp_rewrite regex rules to send individual pages to the right spots)</p>
<p>One small point of clarification – you might have expected me to use “/landofdev” in the if statement rather than “/”. On the website, “/landofdev” is actually representing an alternate domain name. I’m not sure exactly how godaddy does this, whether it’s a virtual host or some other magic, but the REQUEST_URI that show up at /landofdev are relative to the directory. Thus if someone requests <a href="http://www.landofdev.com/">http://www.landofdev.com/</a>” it arrives in the /landofdev directory with a REQUEST_URI of “/”.</p>
<p>Finally, if someone does have a *better* way to do this, I’m looking for suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/wordpress-and-mod_rewrite/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding custom CSS to a wordpress blog post</title>
		<link>http://www.smbaker.com/adding-custom-css-to-a-wordpress-blog-post</link>
		<comments>http://www.smbaker.com/adding-custom-css-to-a-wordpress-blog-post#comments</comments>
		<pubDate>Fri, 12 Feb 2010 23:39:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/?p=432</guid>
		<description><![CDATA[In the previous post, I showed how to create fancy mouseover buttons in wordpress without having to resort to the ugliness  javascript. However, the post finished up with one very big issue&#8230;.. You can&#8217;t include CSS definitions in a wordpress blog post because they need to be placed in the header of your blog.
Well, there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous post, I showed how to create fancy mouseover buttons in wordpress without having to resort to the ugliness  javascript. However, the post finished up with one very big issue&#8230;.. You can&#8217;t include CSS definitions in a wordpress blog post because they need to be placed in the header of your blog.</p>
<p>Well, there&#8217;s a very simple fix for that, although it&#8217;ll require a little bit of modifications to the header.php files of your themes. Enter this code into the header.php file of the theme that you&#8217;re using. A safe place to put it is right before the &lt;/head&gt; tag.</p>
<pre class="noscrollpre">&lt;?php
  if ($custom_css = get_post_meta($post-&gt;ID, 'custom_css', true)) {
    echo '&lt;style type="text/css"&gt;' . $custom_css . '&lt;/style&gt;';
  }
?&gt;</pre>
<p>Once you&#8217;ve done this, all you need to do is to create a custom field called &#8216;custom_css&#8217; on your blog posts and put your custom CSS in there. It ought to look something like this:</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/customcssfields.jpg"><img class="alignnone size-full wp-image-433" title="customcssfields" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/customcssfields.jpg" alt="" width="659" height="156" /></a></p>
<p>The &#8216;Value&#8217; text entry box is small and somewhat inconvenient to type in, but you still fit an awful lot of CSS in there. For example, for the Rollover Button tutorial I needed to include about a dozen lines of custom css.</p>
<p>One caveat is that it&#8217;s unclear exactly what will happen if you have multiple blog posts displayed on the same page and you&#8217;ve created conflicting CSS for them. I&#8217;d suggest being careful and keep ponential conflicts in mind, or do what I do and operate your blog in one-post-per-page mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/adding-custom-css-to-a-wordpress-blog-post/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating mouseover buttons in wordpress using CSS</title>
		<link>http://www.smbaker.com/creating-mouseover-buttons-in-wordpress-using-css</link>
		<comments>http://www.smbaker.com/creating-mouseover-buttons-in-wordpress-using-css#comments</comments>
		<pubDate>Fri, 12 Feb 2010 22:30:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/creating-mouseover-buttons-in-wordpress-using-css</guid>
		<description><![CDATA[One of the issues that I ran into when porting my websites over to wordpress was the lack of built-in image mouseover capabilities. My previous website used dreamweaver, and had mouseover using javascript built-in. Of course, one simple way to do this would be to copy the javascript over from the old site into the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the issues that I ran into when porting my websites over to wordpress was the lack of built-in image mouseover capabilities. My previous website used dreamweaver, and had mouseover using javascript built-in. Of course, one simple way to do this would be to copy the javascript over from the old site into the new. However, that’s kind of messy. The javascript was a kludge in the first place and require tricks to preload the images so the mouseover would not be delayed. So, I sought out on the web for the “new way” to do mouseover, and what I found was called CSS sprites. Here is a brief introduction on how CSS sprites work.</p>
<p>Let’s start by making some button images. We’ll need two of them, one for the button’s normal state and the other for the mouseover state. I used a simple paint program to create these two buttons.</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_up.jpg"><img style="display: inline; border-width: 0px;" title="buttondemo_up" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_up.jpg" border="0" alt="buttondemo_up" width="80" height="32" /></a> This will be our “up” state button. It’s a little darker and has normal text.</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_down.jpg"><img style="display: inline; border-width: 0px;" title="buttondemo_down" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_down.jpg" border="0" alt="buttondemo_down" width="80" height="32" /></a> This one will be our “down” (or mouseover) button. It has bold text and a lighter color.</p>
<p>Our first step is to combine these images. Individually they are each 80&#215;32 pixels in size. We’ll create a new image that is 160&#215;32 pixels and put the up image on the left half and the down image on the right half. The combined image looks like this:</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_rollover.jpg"><img style="display: inline; border-width: 0px;" title="buttondemo_rollover" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/buttondemo_rollover.jpg" border="0" alt="buttondemo_rollover" width="160" height="32" /></a></p>
<p>Let’s start by creating the HTML where our link will go. Rather than using a tradition &lt;img&gt; tag, we’re going to use a &lt;span&gt; tag. Here is the html:</p>
<pre class="noscrollpre">&lt;a class=”smbakerbutton” href=”http://www.smbaker.com”&gt;&lt;span&gt;smbaker!&lt;/span&gt;&lt;/a&gt;</pre>
<p>As usual, the hyperlink is made with an &lt;a&gt; tag. That should look very normal to everyone. The button itself is going to be displayed in the &lt;span&gt; tag – that’s where things get weird. Where’s the button, you say? Well it goes inside some CSS that we’re going to write.</p>
<pre class="noscrollpre">.smbakerbutton {
    display: block;
    width: 80px;
    height: 32px;
    background: url(smbakerbutton_rollover.jpg) no-repeat 0 0;
}</pre>
<p>Let&#8217;s examing this code in detail. The display: block tells the browser to render this as a block-level element. &#8216;width&#8217; and &#8216;height&#8217; are the height of our button (which is one half the width of the double-wide image that we created). The &#8216;background&#8217; statement says to use our image as a background image. So what this has done is to turn our hyperlink into a 80&#215;32 rectangle with our button image as the background.</p>
<p>Next we need to handle the mouseover state:</p>
<pre class="noscrollpre">.smbakerbutton:hover {
    background-position: -80px 0;
}</pre>
<p>So what we&#8217;ve down is every time the mouse is over the button, we shift the background image 80 pixels&#8230;. Well since our image is 160 pixels wide, and the other half of the image is the &#8220;down&#8221; state of the button, that&#8217;s going to cause our button to display the &#8220;down&#8221; state.</p>
<p>Finally, we don&#8217;t want the text in the span tag to be displayed, so we&#8217;ll turn off the span&#8217;s text output:</p>
<pre class="noscrollpre">.smbakerbutton span {
    display: none
}</pre>
<p>Here is what our button looks like. You can mouseover it and it should change state:</p>
<p><a class="smbakerbutton" href="http://www.smbaker.com/"><span>smbaker!</span></a></p>
<p>Here is all of the CSS in one big block:</p>
<pre class="noscrollpre">.smbakerbutton {
    display: block;
    width: 80px;
    height: 32px;
    background: url(smbakerbutton_rollover.jpg) no-repeat 0 0;
}
.smbakerbutton:hover {
    background-position: -80px 0;
}
.smbakerbutton span {
    display: none
}
</pre>
<p>Remember that the CSS needs to go in your stylesheet, or needs to otherwise end up in the header of the page. Putting the CSS in the body of a wordpress post won&#8217;t work. I&#8217;ll tell you a way to get around that in the next blog entry!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/creating-mouseover-buttons-in-wordpress-using-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing the &#8216;/etc/hosts&#8217; on your Vista or Windows 7 Computer</title>
		<link>http://www.smbaker.com/editing-the-etchosts-on-your-vista-or-windows-7-computer</link>
		<comments>http://www.smbaker.com/editing-the-etchosts-on-your-vista-or-windows-7-computer#comments</comments>
		<pubDate>Fri, 12 Feb 2010 17:39:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/?p=406</guid>
		<description><![CDATA[When migrating a domain over to a new provider, one of the things that you might run into is the need to wait a day or two for the DNS record to propagate. DNS is the service that maps your host name to an IP address that can be resolved on the network.
Something that a [...]]]></description>
			<content:encoded><![CDATA[<p>When migrating a domain over to a new provider, one of the things that you might run into is the need to wait a day or two for the DNS record to propagate. DNS is the service that maps your host name to an IP address that can be resolved on the network.</p>
<p>Something that a lot of people may not know is that you can bypass DNS entirely on your local computer by editing your /etc/hosts file. The /etc/hosts file contains static linkings between hostname and IP address. It&#8217;s been used in the Linux world for a long time. However, windows puts it in a strange place. In Windows Vista and Windows 7, the file name is:</p>
<blockquote><p>c:\Windows\System32\drivers\etc\hosts</p></blockquote>
<p>You&#8217;re also going to need administrate privileges to edit the file. The easiest way to do it is to simply use notepad. Search for notepad using the windows start button, but rather than left-clicking on notepad, right click and select &#8220;<em>Run As Administrator</em>&#8220;. Windows will do the usual user access control screen flash and prompt you to ok administrator privileges. Once that&#8217;s done and notepad is on screen, simply use File:Open and enter the pathname <code>c:\Windows\System32\drivers\etc\hosts</code>.</p>
<p>Entries in the file are pretty simple. They&#8217;re just an IP address followed by some whitespace and a list of hostnames. For example, if I wanted to link the IP 123.456.789.012 to both www.mysite.com and mysite.com, I could enter the following:</p>
<blockquote><p>123.456.789.012 www.mysite.com mysite.com</p></blockquote>
<p>Make sure not to mess with the entries for 127.0.0.1, ::1, or localhost. Those are special entries that programs on your computer can use to identify your computer itself. </p>
<p>Remember that once your domain names changes actually take affect in the DNS system to remove the manual settings from the hosts file. If you leave them in permanently, then you would be masking potential DNS failures as well as setting yourself up for a great deal of confusion in the future if your provider ever changes your IP address. </p>
<p>I found this technique pretty handy for migrating new domains over to my shared hosting account. I could create the new site on the new provider, migrate all of the files and get the site setup using the changes that I wanted, and then do the little <code>hosts</code> trick to preview the site as it would appear to users. Once everything was to my satisfaction, then I contacted the domain registrar to move the actual DNS records. </p>
<p>One potential gotcha &#8212; I found that occasionally it would take a while for applications on the computer to learn of the changes to the <code>hosts</code> file. This was particularly bad with Internet explorer. If you have a web browser open and looking at the hostname before you change, you might need to exit the browser and restart it for the changes to take effect. In the worst case, rebooting your computer would solve the issue. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/editing-the-etchosts-on-your-vista-or-windows-7-computer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More wordpress benchmarks on godaddy hosting</title>
		<link>http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting</link>
		<comments>http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting#comments</comments>
		<pubDate>Wed, 03 Feb 2010 01:12:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/more-wordpress-benchmarks-on-godaddy-hosting</guid>
		<description><![CDATA[Ran a few more tests and have some conclusive results… This time we’re going to see the difference between my original database (that had external access enabled) and migration to a new database (that has external access disabled). 
Experiment conditions – A random URL fetched every 5 minutes from a pool of 27 URLs. Only [...]]]></description>
			<content:encoded><![CDATA[<p>Ran a few more tests and have some conclusive results… This time we’re going to see the difference between my original database (that had external access enabled) and migration to a new database (that has external access disabled). </p>
<p>Experiment conditions – A random URL fetched every 5 minutes from a pool of 27 URLs. Only the HTML is fetched, no images or other files. Web hosting using godaddy unlimited linux plan. Database with direct external access enabled. WP-Super-Cache enabled in half cache mode. </p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/histoorighalfcacherand1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="histo-orig-halfcache-rand-1" border="0" alt="histo-orig-halfcache-rand-1" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/histoorighalfcacherand1_thumb.jpg" width="644" height="346" /></a> </p>
<p>The numbers were chosen particularly to cause a lot of cache misses (27 pages with a 5 minute interval is greater than the cache expiration time). Approximately 32% of the page retrievals resulted in cache hits resulting in less than 1 second retrieval time. A total of 71% of the retrievals occurred in 2 seconds or less, and 85% in 3 seconds or less. Those are the retrievals that I’d consider acceptable. However, 7% of the requests took greater than 10 seconds. That’s getting into the range where people will think a site is down or unresponsive. 4% of them took 20 seconds or more. Two of the requests actually failed due to database timeout. </p>
<p>One of the options when I created this database was whether or not to enable external direct database access. I originally chose this option so that I could do easy database backups via mysql to my linux boxes at home. According to the godaddy website, databases with external access are hosted on a different server than those without. For this reason, I decided to re-import the wordpress site into a database without external direct access and see if there was a difference in performance.</p>
<p>Experimental conditions – same as above, but database with external direct access disabled.</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/histohalfcacherand1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="histo-halfcache-rand-1" border="0" alt="histo-halfcache-rand-1" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/histohalfcacherand1_thumb.jpg" width="644" height="346" /></a> </p>
<p>This time 97% of the requests were 2 seconds or less, and 100% were 3 seconds or less. There were no page retrievals over 3 seconds. There were no timeouts. </p>
<p>This is good news as these are finally numbers that I’m confident will lead to a successful website using wordpress. I’m not sure whether the issue was that the databases that allow external direct access are slower than those that do not, or simply that I’ve been lucky enough that I migrated to a database server that receives less load than the others. Pinging the two servers (the original one that allowed external access and the new one that does not) reveals that they are as expected two different IP addresses, and likely two different servers. </p>
<p>I’ll keep monitoring the site with a long-term benchmark to see whether the new performance continues to be acceptable. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Live Writer</title>
		<link>http://www.smbaker.com/windows-live-writer</link>
		<comments>http://www.smbaker.com/windows-live-writer#comments</comments>
		<pubDate>Tue, 02 Feb 2010 00:37:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>
		<category><![CDATA[Windows Live Writer]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/windows-live-writer</guid>
		<description><![CDATA[The next phase in the experiment is to play around with some editors. At the moment, I’m testing ‘Windows Live Writer’. 
Installation was fairly easy from Microsoft’s site with a few caveats. The installer automatically tries to install a bunch of Microsoft bloatware that I didn’t want (Mail, etc). It also wants to set my [...]]]></description>
			<content:encoded><![CDATA[<p>The next phase in the experiment is to play around with some editors. At the moment, I’m testing ‘Windows Live Writer’. </p>
<p>Installation was fairly easy from Microsoft’s site with a few caveats. The installer automatically tries to install a bunch of Microsoft bloatware that I didn’t want (Mail, etc). It also wants to set my default search provider to Bing (YUCK!) and set my default homepage to MSN (even bigger YUCK!). Any application software that dares attempt to touch my search or homepage settings automatically deserves placement in the ‘hall of shame’. So, –1 points for trying to muck with settings that it shouldn’t muck with.</p>
<p>Okay, so now we got the installer installing Windows Live and only Windows Live. That’s good news. It automatically prompts me for blog settings and I enter the info for my site. It detects that XMLRPC is disabled on the site, so we have a quick interlude to login and enable it. It now tries to download the theme for my site and fails with an undecipherable error message (something like “Windows live failed to download the theme from your website”). Okay, that’s useful. Well, previewing the theme is not very important. My brain is good enough to render the page in living color even if Windows Live Writer is not.</p>
<p>The next thing is does is pop up a page to enter a new post. That’s where I am right now, typing into the post. There’s a dropdown for setting categories, easy enough. There’s a text box for settings tags. Up at the top is a &lt;Publish&gt; button. I’m going to click that and see what happens. </p>
<p>The publish button popped up a quick dialog that showed the post being uploaded and then claimed it would show me the new post of my site. Well…. it tried but my site’s home page is set to a static page instead of the blog page. Can’t really fault the software for this unexpected yet minor inconvenience. Click my blog link, and there it is…. This page is exactly where it’s supposed to be, looking like it should. Now lets hit &lt;Publish&gt; again and see if it updates it.</p>
<p>Yep, update works as expected.</p>
<p>How about I put in a <a href="http://www.smbaker.com/">hyperlink</a>. It’s time for a table with a couple of images:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="200"><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/manx4_6401.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="manx4_640[1]" border="0" alt="manx4_640[1]" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/manx4_6401_thumb.jpg" width="244" height="184" /></a> </td>
<td valign="top" width="200"><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/manx5_6401.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="manx5_640[1]" border="0" alt="manx5_640[1]" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/02/manx5_6401_thumb.jpg" width="244" height="184" /></a> </td>
</tr>
</tbody>
</table>
<p>Interestingly enough, when I typed in some URLs for the above pictures, it seems to have downloaded them and thinks it’s going to re-upload them. Well, I can see where that would be useful when creating posts, but I think it would also be quite handy to be able to enter a link to an existing image.</p>
<p>Problems (just a laundry list of things that I can’t seem to get to work properly) &#8211; </p>
<ul>
<li>I can’t figure out how to set the page template when creating a new page. My site uses a variety of custom templates for different classes of pages.</li>
<li>Copying a formatted page out of my web browser and pasting it into Windows Live Writer didn’t preserve the html tables. Tables are preserved when using the wordpress built-in editor, so copying the page into wordpress and then editing it later with Windows Live Writer is an option. </li>
</ul>
<p>Generally I find the editor pleasant and easy to use. It’s certainly better than using the built-in wordpress editor. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/windows-live-writer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optiming wordpress with WP-Cache</title>
		<link>http://www.smbaker.com/optiming-wordpress-with-wp-cache</link>
		<comments>http://www.smbaker.com/optiming-wordpress-with-wp-cache#comments</comments>
		<pubDate>Sat, 30 Jan 2010 06:09:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/?p=118</guid>
		<description><![CDATA[In the last entry, I was fretting over lousy database performance adversely affecting  wordpress. Since then I had a chance to install WP-Super-Cache and evaluate the effects. I&#8217;m operating it in &#8220;half cache&#8221; mode at the moment, and may try operating it in full cache mode later. This benchmark ran for approximately 8 hours and [...]]]></description>
			<content:encoded><![CDATA[<p>In the last entry, I was fretting over lousy database performance adversely affecting  wordpress. Since then I had a chance to install WP-Super-Cache and evaluate the effects. I&#8217;m operating it in &#8220;half cache&#8221; mode at the moment, and may try operating it in full cache mode later. This benchmark ran for approximately 8 hours and measured the time to fetch the same page over and over again.</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-halfcache-point1.gif"><img class="alignnone size-full wp-image-123" title="histo-halfcache-point1" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-halfcache-point1.gif" alt="" width="591" height="316" /></a></p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-halfcache-point1.gif"></a><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-halfcache-point1.bmp"></a></p>
<p>As we can see, the horrid performance that we were experiencing without caching is now gone. 98% of the requests occur in 0.2 seconds, which is the same time as fetching a static page from a static (non-wordpress) website. 2% of the requests take about 1.3 seconds and those are likely the cache misses. There were none of the aberrant 10-second or 20-second spikes that were so pesky when operating directly on the database. WP-Super-Cache is clearly a win when it comes to masking bad database performance.</p>
<p>This has eliminated the primary concern that I had with migrating to wordpress/godaddy &#8212; page generation times in the 10&#8217;s of seconds are not acceptable.</p>
<p>The remaining concern is ease of authoring. Authoring and in general mucking-around with wordpress administration inherently must use the the database. This means that it can&#8217;t take much advantage of WP-Super-Cache/WP-Cache. If the website becomes too onerous to maintain, then I&#8217;d still have to abandon the idea.  As just about everything is becoming dynamic these days, this hilights the importance of looking past simple static page fetching speed and evaluating your provider&#8217;s database performance. As time goes by, websites are going to use more database, not less.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/optiming-wordpress-with-wp-cache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Godaddy database / wordpress performance</title>
		<link>http://www.smbaker.com/godaddy-database-wordpress-performance</link>
		<comments>http://www.smbaker.com/godaddy-database-wordpress-performance#comments</comments>
		<pubDate>Fri, 29 Jan 2010 21:59:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web publishing]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.smbaker.com/wordpress/?p=43</guid>
		<description><![CDATA[This site is in part a great big experiment to see if I want to a) change all of my hosting over to godaddy and b) use wordpress as a publishing platform. My initial impressions were good as wordpress seems like a usable platform. I was able to port many of the pages from my [...]]]></description>
			<content:encoded><![CDATA[<p>This site is in part a great big experiment to see if I want to a) change all of my hosting over to godaddy and b) use wordpress as a publishing platform. My initial impressions were good as wordpress seems like a usable platform. I was able to port many of the pages from my old site over to here.</p>
<blockquote><p>Updated &#8212; I did, for the most part, resolve this issue to my satisfaction by changing some database parameters and adding a cache mod to Wordpress. Full details, with updated benchmarks using the new configuration can be found on this page: <a href="http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting">http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting</a></p></blockquote>
<p>However, no sooner did I get to doing some serious site work and I experienced a &lt;gasp!&gt; timeout from the website. I haven&#8217;t had a timeout on one of my websites that I can remember in years. So I decided to go to the root page of the wordpress blog and hit the refresh button. Sure enough, there was a bunch of variability in the page generation time.</p>
<p>Being a network guy, I constructed some simple benchmarks and set them to work for about a two hour period while I was off to lunch. Let&#8217;s cut to the chase, the first histogram is below.</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-nocache-point1.bmp"></a></p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-nocache-point1.gif"><img class="alignnone size-full wp-image-125" title="histo-nocache-point1" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-nocache-point1.gif" alt="" width="591" height="316" /></a></p>
<p>So what we have a bove is a histogram that shows page retrieval time on the x-axis and number of pages on the y axis. I repeatedly fetched the wordpres homepage (<a href="http://www.smbaker.com/wordpress/">http://www.smbaker.com/wordpress/</a>) of this website every 15 seconds and ran this test for about two hours.</p>
<p>Experimental conditions &#8211; the website is a simple wordpress CMS configuration, about a dozen pages online at the time of the benchmark. The WP-Super-Cache/WP-Cache addons are not enabled. The website is receiving no other traffic than what is being generated by the benchmark. The test was run from 11:00am to 1:00pm pacific time. Web package is the godaddy &#8216;unlimited plan&#8217;.</p>
<p>The first thing we notice is that 72% of the pages were served in 0.6 seconds or less. 84% of the pages were served in 1 second or less. Unfortunately, that&#8217;s where the good news ends. 8% of the pages took over 2.5 seconds or more to fetch. IMO, once we start getting to more than a couple seconds that&#8217;s where websites start looking sluggish. So, 8% of the people who visit this very simple wordpress site will experience a sluggish site. Let&#8217;s look into the outlying data a bit closer.</p>
<p>4% of the pages took more than 5 seconds. Of that, 2% of the pages actually took more than 10 seconds. 10 seconds???? A couple of page retrievals took in excess of 20 seconds. This is the year 2010, not the year 1995.</p>
<p>The first thing to do is to factor out non-server related factors. Things like my PC here at home, my ISP, the network connections between my ISP and godaddy, routers, dropped packets, etc. All of the stuff that makes the Internet unpredictable. I was thinking of this ahead of time and I ran a benchmark fetching a static non-wordpress page at the same time as the above benchmark. The &#8220;static&#8221; page has no PHP. It doesn&#8217;t use any database access. Here&#8217;s a histogram of its&#8217; behavior:</p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-static-point1.bmp"></a></p>
<p><a href="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-static-point1.gif"><img class="alignnone size-full wp-image-126" title="histo-static-point1" src="http://www.smbaker.com/wordpress/wp-content/uploads/2010/01/histo-static-point1.gif" alt="" width="591" height="316" /></a></p>
<p>Here we can see that on a non-dynamic/non-database page, all of the accesses occur in 0.2 seconds or less. That&#8217;s enough to convince me that the issue isn&#8217;t my ISP, my home computer, or any router in the pipe.</p>
<p>As further anecdotal evidence while trying to update this blog post, I experienced three incidents of timeouts and &#8220;page unavailable&#8221; errors when trying to commit changes to this draft. I&#8217;ve also experienced six more incidents of extremely long load times (greater than 20 seconds) while trying to open simple wordpress interface pages (the edit page, the categories page, etc). I suspect that the database performance is even worse at storing information than retrieving it.</p>
<blockquote><p>Updated &#8212; Read the follow-up entry: <a href="http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting">http://www.smbaker.com/more-wordpress-benchmarks-on-godaddy-hosting</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.smbaker.com/godaddy-database-wordpress-performance/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
