<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>Daily Usability</title>
	<link>http://dailyusability.com</link>
	<description>Usability, Aesthetics and Common Sense</description>
	<pubDate>Sat, 09 Feb 2008 13:08:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>WTF?</title>
		<link>http://dailyusability.com/wtf/</link>
		<comments>http://dailyusability.com/wtf/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 13:08:12 +0000</pubDate>
		<dc:creator>anirudh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dailyusability.com/wtf/</guid>
		<description><![CDATA[  This is an experiment on Usability by Anirudh Sanjeev. Under construction. Run along now.
 ]]></description>
			<content:encoded><![CDATA[<p> This is an experiment on Usability by Anirudh Sanjeev. Under construction. Run along now.</p>
]]></content:encoded>
			<wfw:commentRss>http://dailyusability.com/wtf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OneClick Framework</title>
		<link>http://dailyusability.com/oneclick-framework/</link>
		<comments>http://dailyusability.com/oneclick-framework/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 11:34:45 +0000</pubDate>
		<dc:creator>anirudh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dailyusability.com/?p=9</guid>
		<description><![CDATA[ What is it?
It&#8217;s a framework to allow your plugins and themes to update themselves to the latest versions, so the users are never using the old version. It is just a port from the source code of the OneClick plugin, which featured the ability to instantly upgrade itself.
How do I use it.
Here are the steps [...] ]]></description>
			<content:encoded><![CDATA[<h3>What is it?</h3>
<p>It&#8217;s a framework to allow your plugins and themes to update themselves to the latest versions, so the users are never using the old version. It is just a port from the source code of the OneClick plugin, which featured the ability to instantly upgrade itself.</p>
<h3>How do I use it.</h3>
<p>Here are the steps you need to take to use the OneClick Framework:</p>
<ol>
<li>Download the zip files, and extract into the folder of your plugin/theme, as shown in these screenshots.<br /><a href="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-26-59-pm.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="178" alt="Screenshot - 10_4_2007 , 4_26_59 PM" src="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-26-59-pm-thumb.png" width="240" border="0"></a><br /><a href="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-28-44-pm.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="178" alt="Screenshot - 10_4_2007 , 4_28_44 PM" src="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-28-44-pm-thumb.png" width="240" border="0"></a>
<li>in your php code, first set the three environment variables
<div class="ch_code_container" style="font-family: monospace;height:300px;">
<div style="">Code (php)</div>
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!<a href="http://www.php.net/class_exists"><span style="color: #000066;">class_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;ocframework&#8217;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #808080; font-style: italic;">//very important if more than one plugin is using the framework</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&#8216;framework.php&#8217;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//using framework for a plugin</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//create a new updater object</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$updater</span>=<span style="color: #000000; font-weight: bold;">new</span> ocframework<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//set the versionpath, pointing to a remote textfile containing only the latest version</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$updater</span>-&gt;<span style="color: #006600;">versionpath</span>=<span style="color: #ff0000;">&#8216;http://10.111.10.100/myplugin.txt&#8217;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//set the current version of the plugin.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$updater</span>-&gt;<span style="color: #006600;">version</span>=<span style="color: #ff0000;">&#8216;0.1&#8242;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//set the path of the zip file to be downloaded</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$updater</span>-&gt;<span style="color: #006600;">downloadpath</span>=<span style="color: #ff0000;">&#8216;http://10.111.10.100/myplugin.zip&#8217;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$updater</span>-&gt;<span style="color: #006600;">checkForUpdate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #808080; font-style: italic;">//this returns a boolean value wether an update is available</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$updater</span>-&gt;<span style="color: #006600;">update</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
</ol>
</div>
<p>Essentially you&#8217;re creating a new object, and setting the file where it has to look for the latest version, and the path from which it has to download the zip file.</p>
<li>Requirements for the zip file:<br />It should be uploaded on a stable remote server with a good uptime. Also the files must have a directory with *the same name* as the plugin. So, for myplugin, the screenshot would look like:<br /><a href="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-39-01-pm.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="151" alt="Screenshot - 10_4_2007 , 4_39_01 PM" src="http://dailyusability.com/wp-content/uploads/2007/10/windowslivewritertest-e464screenshot-10-4-2007-4-39-01-pm-thumb.png" width="240" border="0"></a>
<li>That&#8217;s it! You still have to build your plugin or theme though. </li>
</ol>
<h3>How does it work?</h3>
<p>It works by <strong>unzipping the contents of the remote zip file in the parent directory.</strong> so it will unzip the contents of myplugin in /wp-content/plugins/, thus effectively replacing the old version of the folder.</p>
<h3>Suggestions:</h3>
<ol>
<li>Be sure to ask the user before updating the theme. The function checkForUpdate returns a boolean value wether an update is available.
<li>Checking for an update takes up significant amount of resources and time. You might want to incorporate checking for an update everyday or something like that.
<li>Please don&#8217;t update without the user&#8217;s consent. Especially for themes. If the user has made modifications to the theme source code, it will be lost.
<li>All settings will be preserved for plugins and themes. You don&#8217;t need to reactivate the plugin after it&#8217;s updated.
<li>The next version has a feature where it can email the user that an update is available, and they can confirm and plugin/theme is updated.
<li>This framework was written in the span of two hours and hasn&#8217;t been extensively tested. It&#8217;s in beta right now. If you find a bug, email me. Check back for a stable release soon. Unfortunately the framework doesn&#8217;t update itself <img src='http://dailyusability.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<h3>Where can I get support for this?</h3>
<p>If you have any question, leave a comment here and I&#8217;ll try getting back to you. In case you find a bug, have a feature suggestion, or want to help out with the code, send an email to anirudh at anirudhsanjeev dot org</p>
<h3>Who are you?</h3>
<p>I am <a href="http://anirudhsanjeev.org/">Anirudh</a>. I also happened to write the <a href="http://anirudhsanjeev.org/oneclick-plugin/">OneClick plugin for wordpress</a>. This has been downloaded over 12000 times. This website is part of my new project, where I write articles on usability and interface design. It&#8217;s still under construction, as you can see.</p>
<p>Important:</p>
<p>I just found a minor bug that could&#8217;ve deleted your wp-admin folder(not a good thing). Now what you have to do is just add one more line to your code before checking for an update.</p>
<p>If you&#8217;re using it for a plugin, then add $updater-&gt;targetdir=&#8221;../wp-content/plugins/&#8221;; near the other environment variables</p>
<p>If you&#8217;re using it for a theme, then add $updater-&gt;targetdir=&#8221;../wp-content/themes/&#8221;; near the other environment variables</p>
<h2></h2>
<h3>Download</h3>
<p>Download the file: <a href="http://dailyusability.com/ocframework.zip">ocframework.zip</a> (version 0.1)</p>
]]></content:encoded>
			<wfw:commentRss>http://dailyusability.com/oneclick-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://dailyusability.com/hello-world/</link>
		<comments>http://dailyusability.com/hello-world/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 17:41:54 +0000</pubDate>
		<dc:creator>anirudh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[  Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
 ]]></description>
			<content:encoded><![CDATA[<p> Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://dailyusability.com/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
