<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>geniosity</title>
	
	<link>http://www.geniosity.co.za</link>
	<description>a place of wonder and geekery...</description>
	<lastBuildDate>Wed, 18 Nov 2009 16:05:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/geniosity/musings" /><feedburner:info uri="geniosity/musings" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Why geniosity goes unappreciated at work!</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/5ZXgolVBTcU/</link>
		<comments>http://www.geniosity.co.za/musings/funny/why-geniosity-goes-unappreciated-at-work/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 16:05:07 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=327</guid>
		<description><![CDATA[Here&#8217;s a moment of enlightenment from my favourite comic at XKCD.com
(click to enlarge)

]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a moment of enlightenment from my favourite comic at <a title="geniosity is unappreciated at work" href="http://xkcd.com/664/">XKCD.com</a></p>
<p>(<em>click to enlarge</em>)</p>
<p><a rel="attachment wp-att-328" href="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/11/academia_vs_business.png"><img class="aligncenter size-medium wp-image-328" title="geniosity in academia vs business" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/11/academia_vs_business-300x154.png" alt="geniosity in academia vs business" width="300" height="154" /></a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/hu7Qjd2nqCRpQF__n82VOKXoOek/0/da"><img src="http://feedads.g.doubleclick.net/~a/hu7Qjd2nqCRpQF__n82VOKXoOek/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hu7Qjd2nqCRpQF__n82VOKXoOek/1/da"><img src="http://feedads.g.doubleclick.net/~a/hu7Qjd2nqCRpQF__n82VOKXoOek/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/5ZXgolVBTcU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/funny/why-geniosity-goes-unappreciated-at-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/funny/why-geniosity-goes-unappreciated-at-work/</feedburner:origLink></item>
		<item>
		<title>Generic Stats WordPress Plugin on version 1.2</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/aMVLHFIWPa4/</link>
		<comments>http://www.geniosity.co.za/musings/wordpress/generic-stats-wordpress-plugin-on-version-1-2/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:11:29 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=325</guid>
		<description><![CDATA[Just another short little note to say that the Generic Stats plugin has been upgraded.
There are no MAJOR changes.
Here are the changes that HAVE been made:

* Updated look &#38; feel of admin page
* Changed to use new &#8220;get options&#8221; methods
* Added pretty little &#8220;Plugin Appreciation&#8221; box on the Admin page
* Updated links to the plugin&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Just another short little note to say that the Generic Stats plugin has been upgraded.</p>
<p>There are no MAJOR changes.</p>
<p>Here are the changes that HAVE been made:</p>
<ul>
<li>* Updated look &amp; feel of admin page</li>
<li>* Changed to use new &#8220;get options&#8221; methods</li>
<li>* Added pretty little &#8220;Plugin Appreciation&#8221; box on the Admin page</li>
<li>* Updated links to the plugin&#8217;s pages</li>
</ul>
<p>Go read more about this plugin here:</p>
<p><a title="WordPress Plugin: Generic Stats" href="http://www.geniosity.co.za/tools/wordpress-hacks/generic-statistics-wordpress-plugin/">Generic Stats Plugin</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/NVvfWkKvtkZKdtfO9nZZjM8RsCU/0/da"><img src="http://feedads.g.doubleclick.net/~a/NVvfWkKvtkZKdtfO9nZZjM8RsCU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/NVvfWkKvtkZKdtfO9nZZjM8RsCU/1/da"><img src="http://feedads.g.doubleclick.net/~a/NVvfWkKvtkZKdtfO9nZZjM8RsCU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/aMVLHFIWPa4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/wordpress/generic-stats-wordpress-plugin-on-version-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/wordpress/generic-stats-wordpress-plugin-on-version-1-2/</feedburner:origLink></item>
		<item>
		<title>Please Link 2 Me Plugin updated to version 1.5</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/piM5eBIWtuQ/</link>
		<comments>http://www.geniosity.co.za/musings/wordpress/please-link-2-me-plugin-updated-to-version-1-5/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 22:41:19 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=316</guid>
		<description><![CDATA[So, just a short post to say that the &#8220;Please Link 2 Me&#8221; WordPress plugin has been updated to version 1.5
Here&#8217;s a copy of the &#8220;changelog&#8221; section in the readme.txt:
= 1.5 =
* 2009/11/01
* Fixed changelog
= 1.4 =
* 2009/11/01
* Recoded to use new Options methods
* Changed look &#38; feel of admin section
* Added option to modify [...]]]></description>
			<content:encoded><![CDATA[<p>So, just a short post to say that the &#8220;Please Link 2 Me&#8221; WordPress plugin has been updated to version 1.5</p>
<p>Here&#8217;s a copy of the &#8220;changelog&#8221; section in the readme.txt:</p>
<blockquote><p>= 1.5 =<br />
* 2009/11/01<br />
* Fixed changelog</p>
<p>= 1.4 =<br />
* 2009/11/01<br />
* Recoded to use new Options methods<br />
* Changed look &amp; feel of admin section<br />
* Added option to modify size of TextArea (the box for link code)<br />
* Changed main URLs for the plugin<br />
* Added ability to add the box to a Page</p></blockquote>
<p>I had 2 updates today because I had a copy/paste issue with the documentation. It&#8217;s been a long day.</p>
<p>You can read more about it the plugin here: <a title="WordPress plugin: Please Link 2 Me" href="http://www.geniosity.co.za/tools/wordpress-hacks/please-link-2-me-wordpress-plugin/">Please Link 2 Me WordPress Plugin</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/YbDqEeOjDqYaC3pGqWLZgnyQ0t0/0/da"><img src="http://feedads.g.doubleclick.net/~a/YbDqEeOjDqYaC3pGqWLZgnyQ0t0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YbDqEeOjDqYaC3pGqWLZgnyQ0t0/1/da"><img src="http://feedads.g.doubleclick.net/~a/YbDqEeOjDqYaC3pGqWLZgnyQ0t0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/piM5eBIWtuQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/wordpress/please-link-2-me-plugin-updated-to-version-1-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/wordpress/please-link-2-me-plugin-updated-to-version-1-5/</feedburner:origLink></item>
		<item>
		<title>May the 4th be with you!</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/p5by5EBhZfY/</link>
		<comments>http://www.geniosity.co.za/musings/funny/may-the-4th-be-with-you/#comments</comments>
		<pubDate>Mon, 04 May 2009 13:33:57 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=308</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-307" title="May the force be with you!" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/05/the-force.jpg" alt="May the force be with you!" width="199" height="393" /></p>

<p><a href="http://feedads.g.doubleclick.net/~a/y71_o3PZhsSuYoQi7su-1v6ROJs/0/da"><img src="http://feedads.g.doubleclick.net/~a/y71_o3PZhsSuYoQi7su-1v6ROJs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/y71_o3PZhsSuYoQi7su-1v6ROJs/1/da"><img src="http://feedads.g.doubleclick.net/~a/y71_o3PZhsSuYoQi7su-1v6ROJs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/p5by5EBhZfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/funny/may-the-4th-be-with-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/funny/may-the-4th-be-with-you/</feedburner:origLink></item>
		<item>
		<title>EXCLUSIVE: Google Buys WordPress!</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/HM2kN4IoZcg/</link>
		<comments>http://www.geniosity.co.za/musings/interesting/exclusive-google-buys-wordpress/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 05:47:42 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[interesting]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=293</guid>
		<description><![CDATA[This was obviously an attempt at an April Fool&#8217;s Joke. I must say, I&#8217;m quite impressed with my WordPress/Google Logo  
I was chatting to my cousin a couple of hours ago via IM, and he let slip about the news that Automattic had sold off WordPress to Google.
He knows this because he works with Matt [...]]]></description>
			<content:encoded><![CDATA[<p><em>This was obviously an attempt at an April Fool&#8217;s Joke. I must say, I&#8217;m quite impressed with my WordPress/Google Logo <img src='http://www.geniosity.co.za/genwp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </em></p>
<p><img class="alignright size-full wp-image-292" style="background: #ffffff" title="Google Buys WordPress!" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/03/google-buys-wordpress.png" alt="Google Buys WordPress!" width="175" height="175" />I was chatting to my cousin a couple of hours ago via IM, and he let slip about the news that <a title="Automattic" href="http://automattic.com">Automattic</a> had sold off <a title="WordPress" href="http://www.wordpress.org">WordPress</a> to <a title="Google!" href="http://www.google.com">Google</a>.</p>
<p>He knows this because he works with <a title="Matt Mullenweg" href="http://ma.tt">Matt Mullenweg</a>, but he obviously doesn&#8217;t want me to &#8220;reveal his name&#8221; until the news is made public (which is going to happen in a few hours time apparently). So, for the purpose of this post, let&#8217;s call him Byron.</p>
<p>I asked if he minded if I copied and pasted a part of our conversation about it and he said he didn&#8217;t mind because the news would be released later today anyway. (I&#8217;m guessing it has something to do with the fact that by the time anybody reads my blog, it will have been announced already).</p>
<p><span id="more-293"></span></p>
<blockquote><p><strong>geniosity <span style="font-weight: normal; ">[09:40 PM]:</span></strong></p>
<p><strong><span style="font-weight: normal; ">So, how much did Matt sell it for?!</span></strong></p>
<p><strong>Byron<span style="font-weight: normal; "> <span>[09:40 PM]:</span></span></strong></p>
<p><strong><span style="font-weight: normal; "><span> Sorry, can&#8217;t say that just yet <img src='http://www.geniosity.co.za/genwp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  . But let&#8217;s just say he&#8217;ll be able to buy that Jazz band he always talks about starting. It wasn&#8217;t quite a YouTube deal&#8230; Or maybe it was.</span></span></strong></p>
<div>
<p><strong>geniosity <span style="font-weight: normal;">[09:42 PM]:</span></strong></p>
<p>Who approached who?</p>
<p><strong>Byron</strong><span style="font-weight: normal; "> <span>[09:43 PM]:</span></span></p>
<p>Google approached us. We mentioned that they didn&#8217;t need to buy it, because it&#8217;s not like we&#8217;re in it for the money, but they said that it would be better for their image if they owned the world&#8217;s most popular blogging software.</p>
<p>They were just tired of everybody complaining about the <a title="Blogger" href="http://www.blogger.com/">Blogger</a> platform. It crashes, it&#8217;s insecure, and it&#8217;s just not as cool as WordPress. So they decided to throw in the towel. Don&#8217;t quote me on this, (ok, quote me <img src='http://www.geniosity.co.za/genwp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) but even <strong>Evan Williams</strong> (<em>of <a title="twitter" href="http://twitter.com">Twitter</a> fame and the creator of &#8220;Blogger&#8221;</em>) is embarrassed at the state of Blogger.</p>
<div>
<p><strong>geniosity</strong> <span style="font-weight: normal; ">[09:44 PM]:</span></p>
<p>So will they be moving all blogger blogs to the WordPress platform?</p>
<p><strong>Byron</strong><span style="font-weight: normal; "> <span>[09:44 PM]:</span></span></p>
<p>That <em>will</em> eventually happen. It will take a couple of months, but thanks to the great WordPress community, there&#8217;s already a Blogger importer, so it will just be a case of converting all the boring themes on Blogspot into WP themes, and then ironing out a few of the minor &#8220;missing features&#8221; in the importer, and they&#8217;ll be good to go.</p>
<div>
<p><strong>geniosity</strong> <span style="font-weight: normal; ">[09:45 PM]:</span></p>
<p>What&#8217;ll happen to the Automattic team?</p>
<p><strong>Byron</strong><span style="font-weight: normal; "> <span>[09:46 PM]:</span></span></p>
<p>Well, we&#8217;ve still got other software that we can focus on. We&#8217;ll be working out of the Googleplex, so there&#8217;ll be free food (for a few months at least, because I hear they&#8217;re planning on limiting that due to the current global financial crisis).</p>
<div>
<p><strong>geniosity</strong> <span style="font-weight: normal; ">[09:47 PM]:</span></p>
<p>And did u get anything from this.</p>
<p><strong>Byron</strong><span style="font-weight: normal; "> <span>[09:48 PM]:</span></span></p>
<p>he he he&#8230; I did, and I&#8217;m REALLY happy with it&#8230;</p>
<p><strong>geniosity</strong> <span style="font-weight: normal; ">[09:48 PM]:</span></p>
<p>When&#8217;s it going to be announced?</p>
<p><strong>Byron</strong><span style="font-weight: normal; "> <span>[09:49 PM]:</span></span></p>
<p>Should be in the next few hours. You&#8217;ll probably see something on <strong>Matt Cutt&#8217;s</strong> blog some time on Wednesday morning because he&#8217;s also pretty excited about it. But we&#8217;ll see what he says. (Especially since he already uses WordPress for his blog).</div>
</div>
</div>
</div>
</blockquote>
<p>So, there&#8217; you have it. Was quite an interesting IM conversation.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/UsR9QvbGTGYfp-93cLyRItk-I_c/0/da"><img src="http://feedads.g.doubleclick.net/~a/UsR9QvbGTGYfp-93cLyRItk-I_c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/UsR9QvbGTGYfp-93cLyRItk-I_c/1/da"><img src="http://feedads.g.doubleclick.net/~a/UsR9QvbGTGYfp-93cLyRItk-I_c/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/HM2kN4IoZcg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/interesting/exclusive-google-buys-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/interesting/exclusive-google-buys-wordpress/</feedburner:origLink></item>
		<item>
		<title>FaceBook – You’re doing it wrong!</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/_lo7SLbGqGE/</link>
		<comments>http://www.geniosity.co.za/musings/funny/facebook-youre-doing-it-wrong/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 11:39:00 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/?p=284</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-285" title="How to use FaceBook" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/03/facebook-wrong.jpg" alt="How to use FaceBook" width="420" height="336" /></p>

<p><a href="http://feedads.g.doubleclick.net/~a/q3HmDIzQ5Tnamer2SG_bB_y8PUY/0/da"><img src="http://feedads.g.doubleclick.net/~a/q3HmDIzQ5Tnamer2SG_bB_y8PUY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/q3HmDIzQ5Tnamer2SG_bB_y8PUY/1/da"><img src="http://feedads.g.doubleclick.net/~a/q3HmDIzQ5Tnamer2SG_bB_y8PUY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/_lo7SLbGqGE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/funny/facebook-youre-doing-it-wrong/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/funny/facebook-youre-doing-it-wrong/</feedburner:origLink></item>
		<item>
		<title>Hotlink 2 Link Plugin</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/g8PjfOVIEf4/</link>
		<comments>http://www.geniosity.co.za/tools/wordpress-hacks/hotlink-2-link-plugin/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 11:17:37 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/genwp/?p=277</guid>
		<description><![CDATA[Here is my latest WordPress plugin &#8211; Hotlink 2 Link for WordPress
This plugin will show a popup window if somebody right-clicks on an image and asks them to use specific code which will link to your article.
Below is an image example.

You can read more about this on my blog post:
Hotlink 2 Link WordPress Plugin
This plugin [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my latest WordPress plugin &#8211; <strong>Hotlink 2 Link for WordPress</strong></p>
<p>This plugin will show a popup window if somebody right-clicks on an image and asks them to use specific code which will link to your article.</p>
<p>Below is an image example.</p>
<p><img class="size-full wp-image-188 alignnone" title="Benefit from hotlinking in WordPress" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2008/06/benefit-from-hotlinking-in-wordpress.png" alt="Benefit from hotlinking in WordPress" width="300" height="303" /></p>
<p>You can read more about this on my blog post:</p>
<p><a title="Hotlink 2 Link WordPress Plugin" href="../../musings/wordpress/hotlink-2-link-wordpress-plugin/">Hotlink 2 Link WordPress Plugin</a></p>
<p>This plugin is based on and uses the JavaScript widget &#8220;<a title="LinkMyPics Hotlinking JavaScript Widget" href="http://www.funscripts.net/javascript-widgets/">LinkMyPics</a>&#8220;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ncrRa_55opZWfjSQ7xQt4-sqs4U/0/da"><img src="http://feedads.g.doubleclick.net/~a/ncrRa_55opZWfjSQ7xQt4-sqs4U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ncrRa_55opZWfjSQ7xQt4-sqs4U/1/da"><img src="http://feedads.g.doubleclick.net/~a/ncrRa_55opZWfjSQ7xQt4-sqs4U/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/g8PjfOVIEf4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/tools/wordpress-hacks/hotlink-2-link-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/tools/wordpress-hacks/hotlink-2-link-plugin/</feedburner:origLink></item>
		<item>
		<title>Generic Statistics WordPress plugin</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/TADeGX6YTPQ/</link>
		<comments>http://www.geniosity.co.za/tools/wordpress-hacks/generic-statistics-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 10:51:03 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/genwp/?p=272</guid>
		<description><![CDATA[
The Generic Stats WordPress Plugin is a plugin that allows you to add any statistics tracking code to your WordPress blog without having to edit your WordPress Template&#8217;s code.
It also allows you to specify whether you&#8217;d like the code to be place at the top of your page (before the &#60;body&#62; tag) or at the [...]]]></description>
			<content:encoded><![CDATA[<div class="content clear-block">
<p>The <strong>Generic Stats WordPress Plugin</strong> is a plugin that allows you to add any statistics tracking code to your WordPress blog without having to edit your WordPress Template&#8217;s code.</p>
<p>It also allows you to specify whether you&#8217;d like the code to be place at the top of your page (before the &lt;body&gt; tag) or at the bottom of the page (just after or just before the closing &lt;/body&gt; tag).</p>
<p>This option is due to the fact that some statistics packages, like Google Analytics, prefer that you place the statistics tracking scripts at the top of the page, whereas it is actually recommended that you place all external scripts (external to your site) at the bottom.</p>
<p>The reason it&#8217;s better to place the code at the bottom is just in case the external site is down, it won&#8217;t prevent your site from loading.</p>
<p>Click on the image at the below to see what the plugin looks like on the admin side:</p>
<p><a href="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/02/screenshot-1.png"><img class="aligncenter size-thumbnail wp-image-322" title="Generic Stats WordPress plugin Admin Page" src="http://www.geniosity.co.za/genwp/wp-content/uploads/2009/02/screenshot-1-150x150.png" alt="Generic Stats WordPress plugin Admin Page" width="150" height="150" /></a></p>
<p><a title="Generic Stats Download" href="http://wordpress.org/extend/plugins/generic-stats/"><strong>Click here to download the plugin</strong></a></p>
<p>To be kept aware of updates, please subscribe to the comments feed on this page.<strong><a href="../../musings/wordpress/wordpress-generic-statistics-plugin/"></a></strong></div>

<p><a href="http://feedads.g.doubleclick.net/~a/6r9WxnlXDwKctmCvl0_acDxgjdA/0/da"><img src="http://feedads.g.doubleclick.net/~a/6r9WxnlXDwKctmCvl0_acDxgjdA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6r9WxnlXDwKctmCvl0_acDxgjdA/1/da"><img src="http://feedads.g.doubleclick.net/~a/6r9WxnlXDwKctmCvl0_acDxgjdA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/TADeGX6YTPQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/tools/wordpress-hacks/generic-statistics-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/tools/wordpress-hacks/generic-statistics-wordpress-plugin/</feedburner:origLink></item>
		<item>
		<title>Checking Domain Availability</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/3yl_F2E0tYU/</link>
		<comments>http://www.geniosity.co.za/tools/internet-utilities/checking-domain-availability/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 10:47:54 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Internet Utilities]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/genwp/?p=269</guid>
		<description><![CDATA[
Don&#8217;t Alert Others of your Ideas!
There is one MAIN thing you want to be careful of when checking to see if a domain is available or not, and that is alerting others that somebody is searching for it.
You see, there are some people who monitor searches for domains so that they can quickly register the [...]]]></description>
			<content:encoded><![CDATA[<div class="content clear-block">
<h3>Don&#8217;t Alert Others of your Ideas!</h3>
<p>There is one MAIN thing you want to be careful of when checking to see if a <strong>domain is available</strong> or not, and that is alerting others that somebody is searching for it.</p>
<p>You see, there are some people who monitor searches for domains so that they can quickly register the domain in the hope that you will buy it from them at more than they paid for it.</p>
<p>A good way to prevent this is to use tools available from respected and well known Domain Registrars, such as GoDaddy and Moniker.com.</p>
<h3>Tools to help you</h3>
<p>To facilitate this (because I register domains quite often now, IT&#8217;S A DRUG I TELL YOU!) I have created to search tools that you can install if you use IE7 (Internet Explorer 7) or FireFox web browsers.</p>
<p>You will then be able to just type the domain that you want to check it&#8217;s availability of, and press enter.</p>
<p>To install these &#8220;search engines&#8221;, just click on the &#8220;down arrow&#8221; at the top right of your browser and click on the &#8220;<strong>Add DomainCheck</strong>&#8220;. This Search Engine will use Moniker.com&#8217;s Domain checking service to see if a domain is available to be registered.</p>
<p>The reason I use Moniker.com is because it can check more than one TLD at a time, for example, if you type in &#8220;james&#8221; (without the quotes) and click on the magnifying glass, the Moniker.com results will show you the results for james.com, james.info, james.org, etc. etc. etc&#8230;</p>
<p>You might have also noticed the ability to add the &#8220;<strong>CoZaDomains</strong>&#8221; Search Engine.</p>
<p>This search engine will check the availability of &#8220;<strong>.co.za</strong>&#8221; (South African) domains, using the tool provided by <strong><a href="http://www.anno.co.za/?coupon=geniosity">www.anno.co.za</a></strong> (the site that hosts my website).</p>
<p>Anyway, let me know if you find these tools useful&#8230;</p></div>

<p><a href="http://feedads.g.doubleclick.net/~a/bzNNPA6qr5BusS85mMkLrMLVZeY/0/da"><img src="http://feedads.g.doubleclick.net/~a/bzNNPA6qr5BusS85mMkLrMLVZeY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bzNNPA6qr5BusS85mMkLrMLVZeY/1/da"><img src="http://feedads.g.doubleclick.net/~a/bzNNPA6qr5BusS85mMkLrMLVZeY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/3yl_F2E0tYU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/tools/internet-utilities/checking-domain-availability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/tools/internet-utilities/checking-domain-availability/</feedburner:origLink></item>
		<item>
		<title>Shell Script for Automating WordPress updates for multiple blogs</title>
		<link>http://feedproxy.google.com/~r/geniosity/musings/~3/aYdDW3OJ0I4/</link>
		<comments>http://www.geniosity.co.za/musings/wordpress/shell-script-automate-wordpress-updates-for-multiple-blogs/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 09:55:11 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.geniosity.co.za/musings/?p=250</guid>
		<description><![CDATA[Many moons ago I read Joost de Valk&#8217;s blog post about upgrading and installing WordPress from SVN. Since then, every blog I maintain I use the WordPress svn repository to check out, and to update using the simple command of &#8220;svn sw&#8220;.
But even with that ease, it can get a bit tedious to upgrade 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Many moons ago I read Joost de Valk&#8217;s blog post about <a href="http://yoast.com/upgrading-and-installing-wordpress-from-subversion/">upgrading and installing WordPress from SVN</a>. Since then, every blog I maintain I use the WordPress svn repository to check out, and to update using the simple command of &#8220;<strong>svn sw</strong>&#8220;.</p>
<p>But even with that ease, it can get a bit tedious to upgrade 10 blogs, for instance.</p>
<p>So, as all &#8220;script writers&#8221; that are in between TV Series do, I wrote a script to automate this.<br />
<span id="more-250"></span><br />
To run this script, there are 2 critical requirements:</p>
<p>- You have access to the command line on your server (SSH access)</p>
<p>- Your WordPress directories were checked out of SVN, and so contain all the required &#8220;.svn&#8221; directories.</p>
<p>So, just in time for WordPress 2.7, which has the ability to update at the click of a button from the admin panel, here&#8217;s my script.</p>
<p>A basic rundown of what it does:</p>
<p>- Reads through a text file that you need to create containing the following 3 pieces of info, separated by colons (:)</p>
<ol>
<li> Your site URL without http://. Example: www.geniosity.co.za/musings</li>
<li> The directory your site is in. Example: /path/to/your/site/dir/home/james123/public_html/musings</li>
<li> The first part of the tar file name that will be created with your backup. Example: mus</li>
</ol>
<p>Here&#8217;s what it might look like with the above info:</p>
<p><em>www.geniosity.co.za/musings:/home/james123/public_html/musings:mus</em></p>
<h3>Setup and Execution of the script</h3>
<p>So, your steps to getting this to run successfully are:</p>
<p>1 &#8211; Create the text file containing a list of all your sites and their relevent directories, in the above format. 1 record per site.</p>
<p>2 &#8211; Copy the script below to a relevant directory on your server, and give it executable permissions</p>
<p>3 &#8211; Read the &#8220;<strong>INITIAL SETUP</strong>&#8221; section just below &#8220;<em>YOU MUST CHANGE THESE SETTINGS</em>&#8221; near the top of the script, and create any directories that are needed in this section.</p>
<p>4 &#8211; Update the section where it says &#8220;<em>YOU MUST CHANGE THESE SETTINGS</em>&#8221; with the directories and variabls that are required.</p>
<p>5 &#8211; Run the script. I recommend using the following command:</p>
<p><strong>nohup scriptname.sh &#038;</strong></p>
<p>This will run it in the background, and if you get disconnected for some reason while it&#8217;s running, it will continue in the background.</p>
<h3>The benefits of this script</h3>
<p>The 2 main benefits of this script are:</p>
<p>- Speed and ease of upgrading multiple blogs. As <a href="http://ma.tt">Matt Mullenweg</a> mentioned on a <a href="http://wp-community.org/2008/10/17/episode-45-matt-mullenweg-interview-automattic-acquires-intense-debate-discussion-of-wordcamps/">WordPress Podcast episode</a> while being interviewed by <a href="http://wp-community.org/">Charles Stricklin</a>, if it takes you more than 2 minutes to upgrade your blog, there&#8217;s a problem.</p>
<p>- The second benefit is that this script sends you an email when it completes with the log files generated, as well as the Upgrade Link so you can just click it to upgrade the Database if required.</p>
<h3>Other notes on this script</h3>
<p>Please note, this script does NOT upgrade or backup your blog&#8217;s database. I recommend the &#8220;<a href="http://www.ilfilosofo.com/blog/wp-db-backup">WordPress Database Backup</a>&#8221; Plugin for that.</p>
<p>Also, I cannot guarantee it works for you. As I mentioned, I have tried this on 2 different servers with 2 different hosts, and it worked 100% there. But, for safety&#8217;s sake, do a manual backup the first time to ensure it all goes as planned.</p>
<p>And, if you&#8217;re wondering why I have all the extra brackets in the script, it&#8217;s because of the cool code-folding capabilities in <a href="http://www.jedit.org">jEdit, <a href="http://www.geniosity.co.za/musings/tags/jedit/">the Programmer&#8217;sText editor I use</a>. For a screen shot of this, take a look at the bottom of this post.</p>
<h3>The WordPress Upgrade Script</h3>
<p>If you have any changes or recommendations, feel free to let me know in the comments.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">#{--------------------------   wpUpgrade.sh   -------------------------------- #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># This script will go through a list of your WordPress websites that are       #</span>
<span style="color: #666666; font-style: italic;">#  hosted on the same server, and update them using SVN (if they were initially#</span>
<span style="color: #666666; font-style: italic;">#  installed using SVN).                                                       #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># Please ensure that you have set the carious Variables in the INITIAL SETUP   #</span>
<span style="color: #666666; font-style: italic;">#  section.                                                                    #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># The SITE_INFO variable must point to a text file containing records in the   #</span>
<span style="color: #666666; font-style: italic;">#  following format separated by colons (&quot;:&quot;)                                  #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># www.yoursite.com:/path/to/your/site/dir:filename                             #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># For example:                                                                 #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># www.geniosity.co.za/musings:/home/james123/public_html/musings:musings       #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;"># The last field is the first part of the tar file name that will be generated.#</span>
<span style="color: #666666; font-style: italic;"># For example: musings.20081024_1233.tar.bz2                                   #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">#==============================================================================#</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">#                          MODIFICATION LOG                                    #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">#  DATE       DEVELOPER  VERSION  DESCRIPTION                                  #</span>
<span style="color: #666666; font-style: italic;"># ---------- ----------- -------- -------------------------------------------- #</span>
<span style="color: #666666; font-style: italic;"># 2008/10/24 J. McMullan          Script Written.                              #</span>
<span style="color: #666666; font-style: italic;">#                                                                              #</span>
<span style="color: #666666; font-style: italic;">##############################################################################}#</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
<span style="color: #666666; font-style: italic;">#{--- INITIAL SETUP...</span>
<span style="color: #666666; font-style: italic;">#----------------------</span>
<span style="color: #666666; font-style: italic;">#--- YOU MUST CHANGE THESE SETTINGS</span>
<span style="color: #666666; font-style: italic;">#------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#- The version of WordPress you are upgrading to</span>
<span style="color: #666666; font-style: italic;">#- Example: &quot;2.6.5&quot;</span>
<span style="color: #007800;">NEW_VERSION_OF_WORDPRESS</span>=<span style="color: #ff0000;">&quot;2.6.5&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#- A temporary location for script output</span>
<span style="color: #666666; font-style: italic;">#- Example: /home/userid/tmp</span>
<span style="color: #007800;">TEMP_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>geniosit<span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #666666; font-style: italic;">#- A Directory where you want to place the backup files created</span>
<span style="color: #666666; font-style: italic;">#- Example: /home/userid/backups</span>
<span style="color: #007800;">BACKUP_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>geniosit<span style="color: #000000; font-weight: bold;">/</span>backups
&nbsp;
<span style="color: #666666; font-style: italic;">#- A Directory where this script will output the logs</span>
<span style="color: #666666; font-style: italic;">#- Example: /home/userid/logoutput</span>
<span style="color: #007800;">LOGS_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>geniosit<span style="color: #000000; font-weight: bold;">/</span>scriptsoutput
&nbsp;
<span style="color: #666666; font-style: italic;">#- The text file containing the list of WordPress sites and their directories</span>
<span style="color: #666666; font-style: italic;">#- Example: /home/userid/scripts/wpsites.txt</span>
<span style="color: #007800;">SITE_INFO</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>geniosit<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>wpdirs.txt
&nbsp;
<span style="color: #666666; font-style: italic;">#- The email address where you will receive your messages from the script</span>
<span style="color: #007800;">EMAIL_ADDRESS</span>=<span style="color: #ff0000;">&quot;geniosity@gmail.com&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#- If you want to skip making backups (NOT recommended), change this to TRUE</span>
<span style="color: #007800;">SKIP_BACKUPS</span>=FALSE
&nbsp;
<span style="color: #666666; font-style: italic;">#------</span>
<span style="color: #666666; font-style: italic;">#}--- END INITIAL SETUP...</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################################################################</span>
<span style="color: #666666; font-style: italic;">#==== YOU DON'T NEED TO CHANGE ANYTHING PAST THIS POINT</span>
<span style="color: #666666; font-style: italic;">#=======================================================</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
<span style="color: #666666; font-style: italic;">#{--- VARIABLES</span>
<span style="color: #666666; font-style: italic;">#------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#------------------</span>
<span style="color: #666666; font-style: italic;">#{General Variables</span>
<span style="color: #666666; font-style: italic;">#---</span>
<span style="color: #007800;">THIS_SCRIPT_NAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">RIGHT_NOW</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d_<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">LOG_FILE</span>=<span style="color: #007800;">$LOGS_DIR</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$THIS_SCRIPT_NAME</span>.<span style="color: #007800;">$RIGHT_NOW</span>.log
<span style="color: #007800;">WORDPRESS_SVN_DIRECTORY</span>=<span style="color: #ff0000;">&quot;http://svn.automattic.com/wordpress/tags&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#}----------------------------</span>
<span style="color: #666666; font-style: italic;">#------------------</span>
<span style="color: #666666; font-style: italic;">#{ERROR Variables</span>
<span style="color: #666666; font-style: italic;">#---</span>
&nbsp;
<span style="color: #007800;">errorLocation</span>=
<span style="color: #007800;">errorCode</span>=
<span style="color: #007800;">errorMessage</span>=
&nbsp;
<span style="color: #666666; font-style: italic;">#}----------------------------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#------------------------</span>
<span style="color: #666666; font-style: italic;">#--- END VARIABLES SETUP</span>
<span style="color: #666666; font-style: italic;">#}----------------------------</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################################################################</span>
<span style="color: #666666; font-style: italic;">#{--- FUNCTIONS</span>
<span style="color: #666666; font-style: italic;">#------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Functions for logging output</span>
<span style="color: #666666; font-style: italic;">#----------</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> logtext <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">RIGHT_NOW</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d_<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RIGHT_NOW</span>: $1&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">--append</span> <span style="color: #007800;">$LOG_FILE</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> logsep <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------&quot;</span>  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">--append</span> <span style="color: #007800;">$LOG_FILE</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Functions for sending mails</span>
<span style="color: #666666; font-style: italic;">#----------</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> setupMailEnv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;In Function: setupMailEnv&quot;</span>
    <span style="color: #007800;">TEMP_MAIL_FILE</span>=<span style="color: #007800;">$TEMP_DIR</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$THIS_SCRIPT_NAME</span>.mail
    <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$TEMP_MAIL_FILE</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> createMailFile <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;In Function: createMailFile&quot;</span>
    <span style="color: #007800;">MAIL_DATE_TIME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d_<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MAIL_DATE_TIME</span>: $*&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_MAIL_FILE</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> sendTheMail <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;In Function: sendTheMail&quot;</span>
    logtext <span style="color: #ff0000;">&quot;TEMP_MAIL_FILE=<span style="color: #007800;">$TEMP_MAIL_FILE</span> ++ THIS_SCRIPT_NAME=<span style="color: #007800;">$THIS_SCRIPT_NAME</span> ++ EMAIL_ADDRESS=<span style="color: #007800;">$EMAIL_ADDRESS</span>&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$TEMP_MAIL_FILE</span> <span style="color: #000000; font-weight: bold;">|</span> mailx <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Output from <span style="color: #007800;">$THIS_SCRIPT_NAME</span>&quot;</span> <span style="color: #007800;">$EMAIL_ADDRESS</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Function to validate Required Variables</span>
<span style="color: #666666; font-style: italic;">#----------</span>
<span style="color: #000000; font-weight: bold;">function</span> validateRequiredVariables <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$NEW_VERSION_OF_WORDPRESS</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">90</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;The NEW_VERSION_OF_WORDPRESS variable has not been set. Please ensure this is set to the latest version of Wordpress.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$TEMP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">91</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;The TEMP_DIR variable has not been set. Please ensure this is set to a valid directory before proceeding.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$LOGS_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">92</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;The LOGS_DIR variable has not been set. Please ensure this is set to a valid directory for the log files.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$SITE_INFO</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">93</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;The SITE_INFO variable has not been set. Please ensure this is set the full path and file name for the file containing your list of sites.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$SITE_INFO</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">94</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;It looks like you settings file is empty (or doesn't exist). Please check that the file <span style="color: #007800;">$SITE_INFO</span> is valid (and that the SITE_INFO variable is set correctly).&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$EMAIL_ADDRESS</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: validateRequiredVariables&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">95</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;The EMAIL_ADDRESS variable has not been set. This script needs an email address to notify you when upgrades are complete or if there are any errors..&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Function to log and send error message</span>
<span style="color: #666666; font-style: italic;">#----------</span>
<span style="color: #000000; font-weight: bold;">function</span> logSendErrorMessages <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;ISSUE IN SECTION: <span style="color: #007800;">$errorLocation</span>&quot;</span>
    logtext <span style="color: #ff0000;">&quot;ERROR CODE: <span style="color: #007800;">$errorCode</span>&quot;</span>
    logtext <span style="color: #ff0000;">&quot;ERROR MESSAGE: <span style="color: #007800;">$errorMessage</span>&quot;</span>
    setupMailEnv
    createMailFile <span style="color: #ff0000;">&quot;ISSUE IN SECTION: <span style="color: #007800;">$errorLocation</span>&quot;</span>
    createMailFile <span style="color: #ff0000;">&quot;ERROR CODE: <span style="color: #007800;">$errorCode</span>&quot;</span>
    createMailFile <span style="color: #ff0000;">&quot;ERROR MESSAGE: <span style="color: #007800;">$errorMessage</span>&quot;</span>
    sendTheMail
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Function to send upgrade link and message</span>
<span style="color: #666666; font-style: italic;">#----------</span>
<span style="color: #000000; font-weight: bold;">function</span> sendUpgradeLink <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;SITE: <span style="color: #007800;">$WP_SITE</span>&quot;</span>
    logtext <span style="color: #ff0000;">&quot;MESSAGE: UPGRADED SUCCESSFULLY!&quot;</span>
    logtext <span style="color: #ff0000;">&quot;UPGRADE LINK: http://<span style="color: #007800;">$WP_SITE</span>/wp-admin/upgrade.php&quot;</span>
    setupMailEnv
    createMailFile <span style="color: #ff0000;">&quot;SITE: <span style="color: #007800;">$WP_SITE</span>&quot;</span>
    createMailFile <span style="color: #ff0000;">&quot;MESSAGE: UPGRADED SUCCESSFULLY!&quot;</span>
    createMailFile <span style="color: #ff0000;">&quot;UPGRADE LINK: http://<span style="color: #007800;">$WP_SITE</span>/wp-admin/upgrade.php&quot;</span>
    sendTheMail
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Function to send the log file by mail</span>
<span style="color: #666666; font-style: italic;">#----------</span>
<span style="color: #000000; font-weight: bold;">function</span> sendLogFile <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;About to send log file by mail&quot;</span>
    setupMailEnv
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$LOG_FILE</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_MAIL_FILE</span>
    sendTheMail
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># Function to log and send error message</span>
<span style="color: #666666; font-style: italic;">#----------</span>
<span style="color: #000000; font-weight: bold;">function</span> backupTheDirectory <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    logtext <span style="color: #ff0000;">&quot;In function: backupTheDirectory&quot;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$WP_DIR</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$WP_TAR_FILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">1</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Variables WP_DIR and WP_TAR_FILE are not set correctly.++ WP_SITE=<span style="color: #007800;">$WP_SITE</span> ++ WP_DIR=<span style="color: #007800;">$WP_DIR</span> ++ WP_TAR_FILE=<span style="color: #007800;">$WP_TAR_FILE</span> ++ Ensure the settings file contains proper records&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$BACKUP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">2</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Backup directory does not exist! Please ensure that the directory <span style="color: #007800;">$BACKUP_DIR</span> exists.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$BACKUP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">3</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Backup directory is not writable! Please ensure that the directory <span style="color: #007800;">$BACKUP_DIR</span> has write permissions.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$LOGS_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">4</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Logs directory does not exist! Please ensure that the directory <span style="color: #007800;">$LOGS_DIR</span> exists.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$LOGS_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">5</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Logs directory is not writable! Please ensure that the directory <span style="color: #007800;">$LOGS_DIR</span> has write permissions.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$WP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">6</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;WP_DIR directory does not exist! Please ensure that the directory <span style="color: #007800;">$WP_DIR</span> exists.&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">tar</span> cvfj <span style="color: #007800;">$BACKUP_DIR</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$WP_TAR_FILE</span> <span style="color: #007800;">$WP_DIR</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOG_FILE</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;In Function: backupTheDirectory&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #007800;">$?</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Problem creating tar file.++ WP_TAR_FILE=<span style="color: #007800;">$WP_TAR_FILE</span> ++ WP_DIR=<span style="color: #007800;">$WP_DIR</span> ++ LOG_FILE=<span style="color: #007800;">$LOG_FILE</span>&quot;</span>
        logSendErrorMessages
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#------------------------</span>
<span style="color: #666666; font-style: italic;">#}--- END FUNCTIONS SETUP</span>
<span style="color: #666666; font-style: italic;">################################################################################</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">clear</span>
logtext <span style="color: #ff0000;">&quot;**********************************************************&quot;</span>
logtext <span style="color: #ff0000;">&quot;****         STARTING WORDPRESS UPDATE SCRIPT          ***&quot;</span>
logtext <span style="color: #ff0000;">&quot;**********************************************************&quot;</span>
&nbsp;
validateRequiredVariables
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> WP_RECORD <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$SITE_INFO</span><span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">WP_SITE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$WP_RECORD</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F: <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">WP_DIR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$WP_RECORD</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F: <span style="color: #ff0000;">'{print $2}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">WP_BACKUP_FILE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$WP_RECORD</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F: <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">RIGHT_NOW</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d_<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">WP_TAR_FILE</span>=<span style="color: #007800;">$WP_BACKUP_FILE</span>.<span style="color: #007800;">$RIGHT_NOW</span>.tar.bz2
&nbsp;
    logsep
    logtext <span style="color: #ff0000;">&quot;Processing site: <span style="color: #007800;">$WP_SITE</span>&quot;</span>
    logtext <span style="color: #ff0000;">&quot;Processing directory: <span style="color: #007800;">$WP_DIR</span>&quot;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SKIP_BACKUPS</span> <span style="color: #000000; font-weight: bold;">!</span>= TRUE <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        logtext <span style="color: #ff0000;">&quot;About to do backup for <span style="color: #007800;">$WP_SITE</span>&quot;</span>
        logtext <span style="color: #ff0000;">&quot;tar file will be: <span style="color: #007800;">$WP_TAR_FILE</span>&quot;</span>
        backupTheDirectory
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            logtext <span style="color: #ff0000;">&quot;There was a problem doing the backups for site: <span style="color: #007800;">$WP_SITE</span>. EXITING!&quot;</span>
            sendLogFile
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
        logtext <span style="color: #ff0000;">&quot;Finished doing backups.&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    logsep
    logtext <span style="color: #ff0000;">&quot;Starting upgrades&quot;</span>
&nbsp;
    logtext <span style="color: #ff0000;">&quot;Checking the WP_DIR exists. (<span style="color: #007800;">$WP_DIR</span>)&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$WP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;Checking WP_DIR exists.&quot;</span>
&nbsp;
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">10</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;WP_DIR directory does not exist! Please ensure that the directory <span style="color: #007800;">$WP_DIR</span> exists. EXITING!&quot;</span>
        logSendErrorMessages
        sendLogFile
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    logtext <span style="color: #ff0000;">&quot;Checking the WP_DIR has write permissions&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$WP_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;Checking the WP_DIR has write permissions&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">11</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Logs directory is not writable! Please ensure that the directory <span style="color: #007800;">$WP_DIR</span> has write permissions. EXITING!&quot;</span>
        logSendErrorMessages
        sendLogFile
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$WP_DIR</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;Changing directory to <span style="color: #007800;">$WP_DIR</span>&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">12</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Could not change directory to <span style="color: #007800;">$WP_DIR</span>! EXITING!&quot;</span>
        logSendErrorMessages
        sendLogFile
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">svn</span> sw <span style="color: #007800;">$WORDPRESS_SVN_DIRECTORY</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NEW_VERSION_OF_WORDPRESS</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOG_FILE</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">errorLocation</span>=<span style="color: #ff0000;">&quot;Running svn sw command in <span style="color: #007800;">$WP_DIR</span>&quot;</span>
        <span style="color: #007800;">errorCode</span>=<span style="color: #000000;">13</span>
        <span style="color: #007800;">errorMessage</span>=<span style="color: #ff0000;">&quot;Problem running svn sw command in <span style="color: #007800;">$WP_DIR</span>! EXITING!&quot;</span>
        logSendErrorMessages
        sendLogFile
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$errorCode</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    sendUpgradeLink
&nbsp;
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
logsep
logtext <span style="color: #ff0000;">&quot;FINISHED RUNNING UPGRADES&quot;</span>
&nbsp;
sendLogFile</pre></div></div>

<h3>The jEdit screenshot</h3>
<p><img src="http://www.geniosity.co.za/genwp/wp-content/uploads/2008/11/shell-script-writing-in-jedit.png" alt="" title="Shell Script Writing in jEdit" width="500" height="400" class="alignnone size-full wp-image-268" /></p>

<p><a href="http://feedads.g.doubleclick.net/~a/gQaBVUM5hqaXkeEQfXpfM2ivEfo/0/da"><img src="http://feedads.g.doubleclick.net/~a/gQaBVUM5hqaXkeEQfXpfM2ivEfo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gQaBVUM5hqaXkeEQfXpfM2ivEfo/1/da"><img src="http://feedads.g.doubleclick.net/~a/gQaBVUM5hqaXkeEQfXpfM2ivEfo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/geniosity/musings/~4/aYdDW3OJ0I4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.geniosity.co.za/musings/wordpress/shell-script-automate-wordpress-updates-for-multiple-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.geniosity.co.za/musings/wordpress/shell-script-automate-wordpress-updates-for-multiple-blogs/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.579 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-01-28 18:30:10 --><!-- Compression = gzip -->
