<?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/" version="2.0">

<channel>
	<title>Ross Hanney</title>
	
	<link>http://rhanney.co.uk</link>
	<description>Hello. I'm a web developer from the UK, specialising in WordPress, PHP and stuff like that.</description>
	<lastBuildDate>Fri, 24 Feb 2012 21:02:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/rosshanney" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="rosshanney" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">rosshanney</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>A Fresh Coat of Paint</title>
		<link>http://rhanney.co.uk/2012/02/24/a-fresh-coat-of-paint/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-fresh-coat-of-paint</link>
		<comments>http://rhanney.co.uk/2012/02/24/a-fresh-coat-of-paint/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 21:02:04 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://rhanney.co.uk/?p=1264</guid>
		<description><![CDATA[I&#8217;ve been wanting to redesign my site for a while now. The old design was looking&#8230; old, and to be honest, pretty cringe-worthy. When I created the original design, I was just getting stared with WordPress, so didn&#8217;t fully understand the theme development process. I&#8217;ve certainly learnt a lot more in the last couple of years. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to redesign my site for a while now. The old design was looking&#8230; old, and to be honest, pretty cringe-worthy.</p>
<p>When I created the original design, I was just getting stared with WordPress, so didn&#8217;t fully understand the theme development process. I&#8217;ve certainly learnt a lot more in the last couple of years.</p>
<p><span id="more-1264"></span></p>
<p>So, here&#8217;s the new design!</p>
<p>I&#8217;m more of a coder than a designer, so I decided to keep things simple and clean, with plenty of whitespace (or greyspace?). You might even call it &#8220;minimal&#8221;, possibly?</p>
<p>It should be pretty speedy, too. I&#8217;ve kept <abbr>HTTP</abbr> requests to a minimum, making use of as much <abbr>CSS3</abbr> snazziness as possible.</p>
<p>Try it on your iPad / phone, it&#8217;s responsive too!</p>
<p>Anyhoo, I&#8217;m quite pleased with it, I think. It turned out to be one of those projects where you&#8217;ve been working on it for so long that you can no longer decide whether it&#8217;s brilliant, awful or somewhere in between.</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/Wy_dMJ8otwQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2012/02/24/a-fresh-coat-of-paint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.7.2</title>
		<link>http://rhanney.co.uk/2011/12/13/google-calendar-events-0-7-2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-7-2</link>
		<comments>http://rhanney.co.uk/2011/12/13/google-calendar-events-0-7-2/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 21:27:55 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=1146</guid>
		<description><![CDATA[It&#8217;s been a long time since I&#8217;ve updated Google Calendar Events. I&#8217;ve had very little time to work on the plugin lately, due to other projects that have had to take precedence. A couple of months back, I did begin a major rewrite of the plugin, with all sorts of snazzy improvements, but it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I&#8217;ve updated <a href="http://wordpress.org/extend/plugins/google-calendar-events/">Google Calendar Events</a>. I&#8217;ve had very little time to work on the plugin lately, due to other projects that have had to take precedence.</p>
<p>A couple of months back, I did begin a major rewrite of the plugin, with all sorts of snazzy improvements, but it&#8217;s a long way off release worthy, or even beta worthy, at present. I&#8217;ll continue to work on it when I can, but I thought I&#8217;d better fix a couple of minor (yet annoying) bugs in the current version for the time being.</p>
<p><span id="more-1146"></span></p>
<p>The fixes in 0.7.2 are as follows:</p>
<ul>
<li>There was an issue with the &#8220;More details&#8221; Google Calendar page link. The URL wasn&#8217;t constructed correctly, which resulted in the event details defaulting to the UTC timezone. This only affected the simple display options (not the event display builder), but is fixed now.</li>
<li>Previously, setting the cache duration to 0 would be ignored, causing caching to still occur. Setting this to 0 should now work correctly.</li>
<li>With <code>FORCE_SSL_ADMIN</code> enabled, the plugin&#8217;s Ajax requests would fail in most cases, preventing month navigation. This shouldn&#8217;t be the case any longer.</li>
</ul>
<p>Also, an <a href="http://core.trac.wordpress.org/ticket/19510">issue</a> brought up in the WordPress core Trac recently made me realise I&#8217;d been using the wrong method (an incorrect hook) for enqueuing the plugin CSS and JavaScript, which could potentially cause an issue with the newly released 3.3 version of WordPress. I don&#8217;t think the issue would have affected Google Calendar Events, as I had <code>is_admin()</code> checks in place, but better to be safe (and correct) than sorry!</p>
<p>Before updating, remember that if you&#8217;ve made any changes to the main plugin stylesheet (<code>google-calendar-events/css/gce-style.css</code>), you should take a backup first, as changes <em>will</em> be overwritten during the update. If you&#8217;ve used the &#8220;Custom stylsheet URL&#8221; method instead, you shouldn&#8217;t need to worry about this!</p>
<p>You can <a href="http://downloads.wordpress.org/plugin/google-calendar-events.0.7.2.zip">download the update</a> from the plugin directory, or simply update from your WordPress admin.</p>
<p>Feedback, bug reports and feature requests are always welcome. You can add a comment below (or on the <a href="http://rhanney.co.uk/plugins/google-calendar-events/#comments">plugin homepage</a>), or <a href="http://rhanney.co.uk/contact/">send me an email</a>.</p>
<p>Thanks!</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/e5pXDSJRMvc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/12/13/google-calendar-events-0-7-2/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.7.1</title>
		<link>http://rhanney.co.uk/2011/07/17/google-calendar-events-0-7-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-7-1</link>
		<comments>http://rhanney.co.uk/2011/07/17/google-calendar-events-0-7-1/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 11:35:53 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=1139</guid>
		<description><![CDATA[This is just a bug fix release, nothing particularly exciting, I&#8217;m afraid. Here&#8217;s a quick overview of the changes: Weird AJAX Bug An odd bug was causing AJAX enabled calendar grids to disappear, or just get stuck loading, when navigating between months. It took me quite a while to replicate it, which was very frustrating, [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a bug fix release, nothing particularly exciting, I&#8217;m afraid. Here&#8217;s a quick overview of the changes:</p>
<p><span id="more-1139"></span></p>
<h3>Weird <abbr>AJAX</abbr> Bug</h3>
<p>An odd bug was causing <abbr>AJAX</abbr> enabled calendar grids to disappear, or just get stuck loading, when navigating between months. It took me quite a while to replicate it, which was very frustrating, as several people had reported the same issue but I had no idea what was going on!</p>
<p>Anyway, I finally tracked down the problem. It was due to me being an idiot and not really understanding how <a href="http://php.net/manual/en/function.preg-replace-callback.php"><code>preg_replace_callback</code></a> works.</p>
<h3>Stupid Timezones</h3>
<p>Timezones are confusing. If I ever make another plugin, please remind me to make sure it has <em>nothing</em> to do with dates and times.</p>
<p>Hopefully, this release should fix an issue causing all-day events to continue to be displayed even after they have ended.</p>
<h3>Tooltip Date Title Bug</h3>
<p>In some cases, the title settings for <abbr>AJAX</abbr> grids were being ignored during <abbr>AJAX</abbr> requests. This release should fix that too. Many thanks to <a href="http://swyattyoung.com/">S. Wyatt Young</a> for bringing my attention to this problem.</p>
<h3>Output Sanitisation</h3>
<p>Output sanitisation was a bit lacking in some places, but should be much improved now.</p>
<h3>Caching Empty Feeds</h3>
<p>Previously, the plugin did not cache feeds that returned no events. This meant that if you were displaying a list or grid of events from several feeds, one or more of which were empty, <abbr>HTTP</abbr> requests would be made for the empty feeds on every page load, which is slow.</p>
<hr />
<p>Many thanks to everyone who reported the above issues, and helped with testing the fixes. It is very much appreciated!</p>
<p>As always, bug reports, feature requests and any other feedback can be left in the comments on the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/">plugin homepage</a>, or on this post.</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/hxE30y4sJpI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/07/17/google-calendar-events-0-7-1/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.7</title>
		<link>http://rhanney.co.uk/2011/06/25/google-calendar-events-0-7/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-7</link>
		<comments>http://rhanney.co.uk/2011/06/25/google-calendar-events-0-7/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 18:26:48 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=1112</guid>
		<description><![CDATA[Version 0.7 fixes a few bugs and adds a few minor features. Bugs Timezone issues: dates and times should now display in the correct timezone, regardless of the WordPress timezone setting. The plugin &#8220;Timezone adjustment&#8221; option should now work correctly [link-path] shortcode: this Event Display Builder shortcode has been changed to [url] to address an [...]]]></description>
			<content:encoded><![CDATA[<p>Version 0.7 fixes a few bugs and adds a few minor features.</p>
<p><span id="more-1112"></span></p>
<hr />
<h3>Bugs</h3>
<ul>
<li><strong>Timezone issues:</strong> dates and times should now display in the correct timezone, regardless of the WordPress timezone setting. The plugin &#8220;Timezone adjustment&#8221; option should now work correctly</li>
<li><strong><code>[link-path]</code> shortcode:</strong> this <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder/">Event Display Builder</a> shortcode has been changed to <code>[url]</code> to address an issue preventing it from working correctly</li>
<li><strong>Hidden page lists in Opera:</strong> page lists should now display correctly in Opera</li>
</ul>
<hr />
<h3>Features / Enhancements</h3>
<h5>Descending order</h5>
<p>Lists can now be displayed in descending order. This can be useful if you&#8217;re showing a list of past events. There&#8217;s a new drop-down box in the widget settings where you can choose the order. If you&#8217;re using the shortcode, there&#8217;s a new <code>order</code> parameter that can be set to <code>asc</code> or <code>desc</code>.</p>
<h5>New Event Display Builder shortcodes</h5>
<p><code>[cal-id]</code> and <code>[event-id]</code> shortcodes have been added. These output unique identifiers assigned by Google for the calendar (feed) or event. These are most useful for constructing links to the XML or ical feeds for a single event.<br />
For example, to construct the link to the <code>.ics</code> feed for a single event, you can enter the following into the Event Display Builder:</p>
<div class="highlight"><pre class="niji_code niji_html" style="">&lt;a href=<span class="niji_string">&quot;http://www.google.com/calendar/ical/[cal-id]/public/full/[event-id]&quot;</span>&gt;<span class="niji_default">ics feed</span>&lt;/a&gt;</pre></div>
<h5>New Event Display Builder parameters</h5>
<p>Two new parameters have been added. The first is <code>offset</code>. This can be applied to the date / time based shortcodes, and essentially adds an offset (in seconds, can be negative) to dates / times before they are formatted and displayed.<br />
The second is <code>autolink</code>. This parameter can be applied to the <code>description</code> shortcode, and controls whether or not URLs entered in the description field in Google Calendar will be automatically made into &#8220;clickable&#8221; links.</p>
<h5>CSS Classes</h5>
<p>The plugin now adds classes to calendar grid cells to indicate whether the day that the cell represents is in the past or the future. Past days get a <code>gce-day-past</code> class and future days get <code>gce-day-future</code>.</p>
<h5>Tidier <abbr>CSS</abbr></h5>
<p>The <abbr>CSS</abbr> stylesheet that the plugin provides had a few <code>!important</code> declarations in it, which made overriding certain styles difficult. These have been removed. Other minor tweaks have been made too.<br />
I&#8217;ve added a new general option that, when enabled, adds another stylesheet that contains much of the old <abbr>CSS</abbr>. This is to prevent layouts of sites using 0.6 and below from going wonky straight away. It would be a good idea to adjust your <abbr>CSS</abbr> so that you don&#8217;t need this enabled. It will be removed at some point.</p>
<h5>All Feeds</h5>
<p>Previously, if you didn&#8217;t enter a feed <abbr>ID</abbr> into the widget settings, an error message would be displayed. The shortcode would display only feed 1 if the <code>id</code> parameter was omitted. Now, the plugin will display all feeds in these cases. This is more consistent, useful and intuitive. You can still specify comma-separated lists of feeds <abbr>ID</abbr>s as before too.</p>
<hr />
<p>Many thanks to those who downloaded, tested and provided feedback on the <a href="http://rhanney.co.uk/2011/06/11/google-calendar-events-0-7-beta">beta of 0.7</a>. It is very much appreciated!</p>
<p>Any feedback on the new version is also welcomed. Please leave a comment below, or on the <a href="http://rhanney.co.uk/plugins/google-calendar-events/">main plugin homepage</a>, or <a href="http://rhanney.co.uk/contact">send me an email</a>.</p>
<p>You can download 0.7 from the <a href="http://wordpress.org/extend/plugins/google-calendar-events">plugin directory</a>.</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/rLm6Hg6njb8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/06/25/google-calendar-events-0-7/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.7 Beta</title>
		<link>http://rhanney.co.uk/2011/06/11/google-calendar-events-0-7-beta/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-7-beta</link>
		<comments>http://rhanney.co.uk/2011/06/11/google-calendar-events-0-7-beta/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 10:41:42 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=1083</guid>
		<description><![CDATA[0.6 has been out for a while, long enough for a couple of bugs to appear! I expected a few, as a lot of code was changed in the last release. Also, my to-do list has been gradually filling up with lots of suggestions for little enhancements here and there. So, I&#8217;m going to combine [...]]]></description>
			<content:encoded><![CDATA[<p>0.6 has been out for a while, long enough for a couple of bugs to appear! I expected a few, as a lot of code was changed in the last release. Also, my to-do list has been gradually filling up with lots of suggestions for little enhancements here and there. So, I&#8217;m going to combine these fixes and enhancements into a new version, 0.7.</p>
<p><span id="more-1083"></span></p>
<hr />
<h3>Bugs</h3>
<p>Here&#8217;s a list of the bugs that 0.7 will (hopefully!) address:</p>
<ul>
<li><strong>Timezone issues:</strong> The last release introduced a bug that causes times / dates to be displayed in UTC, regardless of the &#8216;Timezone adjustment&#8217; setting. This can be worked around by ensuring that the WordPress timezone (Settings &gt; General) is set to a city and not a UTC+/- offset, but that&#8217;s hardly an ideal solution. This also affects the <code>[if-now]</code>, <code>[if-started]</code> and similar event display builder shortcodes. Some general faffing with date functions should have fixed this</li>
<li><strong><code>[link-path]</code> shortcode:</strong> This shortcode isn&#8217;t behaving correctly. It has been changed to <code>[url]</code> to fix this</li>
<li><strong>Opera CSS issue:</strong> There is a stray <code>content:none</code> is the CSS. I can&#8217;t remember why it&#8217;s there, but it certainly shouldn&#8217;t be! It causes an odd bug in Opera, preventing page lists from appearing. I&#8217;ve removed it</li>
</ul>
<hr />
<h3>Enhancements</h3>
<p>The enhancements 0.7 will incorporate:</p>
<ul>
<li><strong>Descending order:</strong> The order of events in lists can be changed from ascending to descending, which is useful for lists of past events</li>
<li><strong><code>[event-id]</code> and <code>[cal-id]</code> shortcodes:</strong> These allow you to output the unique IDs that Google assigns to events and calendars. They&#8217;re useful for constructing links to iCal feeds, for the whole calendar or just individual events</li>
<li><strong>CSS classes:</strong> The plugin will now add <code>gce-day-past</code> and <code>gce-day-future</code> classes to calendar grid cells, so you can style them differently. Also, depending on whether &#8216;today&#8217; has some events, either <code>gce-today-has-events</code> or <code>gce-today-no-events</code> will be added (in addition to <code>gce-today</code>)</li>
<li><strong><code>offset</code> parameter:</strong> There&#8217;s a new <code>offset</code> parameter for the date / time event display builder shortcodes. This allows you to adjust the date / time (by a number of seconds) before it is displayed. This is most useful currently for changing the end date of all day events, so that they appear to end on the &#8216;correct&#8217; day. It&#8217;s used like this: <code>[end-date offset="-1"]</code></li>
<li><strong><code>autolink</code> parameter:</strong> URLs in the description field are currently automatically made into links. This is still the case by default, but can now be disabled with: <code>[description autolink="false"]</code></li>
<li><strong>Tidier CSS:</strong> There are a few <code>!important</code> declarations in the CSS, which makes overriding certain things difficult and is pretty bad practice. These have been removed. There&#8217;s a new general option that allows you to continue to include the &#8216;old&#8217; CSS stuff, so that existing layouts don&#8217;t go wonky</li>
</ul>
<p>I think that&#8217;s it. I might add a couple of other bits and bobs before release if I get chance. I&#8217;ll properly document all this stuff when 0.7 is released.</p>
<hr />
<p>Also, I&#8217;m gradually going through the code and ensuring it conforms to the <a href="http://codex.wordpress.org/WordPress_Coding_Standards">WordPress coding standards</a>, so there may be a little inconsistency in coding style in various places at the moment. Sorry about that if you&#8217;re reading the source!</p>
<p>I&#8217;d really appreciate some feedback on any of the various bug fixes and enhancements. Testing the timezone stuff would be especially helpful. If anyone could test and give feedback on the following, that would be great:</p>
<ul>
<li>The WordPress timezone should no longer have any effect on the display of dates / times</li>
<li>The WordPress timezone <em>should</em> have an effect on stuff that requires the current time as a reference, such as some event display builder shortcodes (below), but it should no longer matter whether it is set to a city or a UTC+/- offset</li>
<li>The &#8216;Timezone adjustment&#8217; option in the feed settings should work correctly</li>
<li>The following event display builder shortcodes should work properly and be accurate:
<ul>
<li><code>[if-now]</code></li>
<li><code>[if-not-now]</code></li>
<li><code>[if-started]</code></li>
<li><code>[if-not-started]</code></li>
<li><code>[if-ended]</code></li>
<li><code>[if-not-ended]</code></li>
<li><code>[start-human]</code></li>
<li><code>[end-human]</code></li>
</ul>
</li>
</ul>
<p>To test the beta, please download the <a href="http://downloads.wordpress.org/plugin/google-calendar-events.zip">development version</a> of the plugin. Leave comments below, or on the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/">plugin homepage</a>. You can <a href="http://www.rhanney.co.uk/contact">send me an email</a> too, if you like. Thanks!</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/7yOBjalGPX8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/06/11/google-calendar-events-0-7-beta/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>First Patch</title>
		<link>http://rhanney.co.uk/2011/05/25/first-patch/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=first-patch</link>
		<comments>http://rhanney.co.uk/2011/05/25/first-patch/#comments</comments>
		<pubDate>Wed, 25 May 2011 18:54:57 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=1071</guid>
		<description><![CDATA[Only two characters&#8230; well, more like minus two, but still, awesome!]]></description>
			<content:encoded><![CDATA[<p>Only two characters&#8230; well, more like minus two, but still, <a href="http://core.trac.wordpress.org/changeset/18033">awesome</a>!</p>
<p><span id="more-1071"></span></p>
<p><img class="size-full wp-image-1077" title="patch" src="http://www.rhanney.co.uk/wp/wp-content/uploads/2011/05/patch.png" alt="" width="630" height="540" /></p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/mztIgqlxOO0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/05/25/first-patch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.6</title>
		<link>http://rhanney.co.uk/2011/04/29/google-calendar-events-0-6/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-6</link>
		<comments>http://rhanney.co.uk/2011/04/29/google-calendar-events-0-6/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 09:04:17 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=978</guid>
		<description><![CDATA[I know that it&#8217;s not been long since the last release, but 0.5 exacerbated a few annoying, and long-running, problems that the plugin had. I&#8217;ve had some spare time over the last week (yay for Easter!), so I decided to really get to grips with these issues, and hopefully eradicate them. I didn&#8217;t &#8216;officially&#8217; announce [...]]]></description>
			<content:encoded><![CDATA[<p>I know that it&#8217;s not been long since the last release, but 0.5 exacerbated a few annoying, and long-running, problems that the plugin had.</p>
<p>I&#8217;ve had some spare time over the last week (yay for Easter!), so I decided to really get to grips with these issues, and hopefully eradicate them.</p>
<p><span id="more-978"></span></p>
<p>I didn&#8217;t &#8216;officially&#8217; announce a beta this time around, as I had some brilliant assistance from <a href="http://theminster.org">Derek and Tom</a>, who tested several iterations of the in-development code and helped to iron out many issues and bugs along the way. Many thanks again to them!</p>
<p>Here&#8217;s a run-down of the changes:</p>
<hr />
<h3>Memory</h3>
<p>The plugin has always had issues with memory, especially with large numbers of events and feeds. The changes in 0.5, that allowed you to specify a much greater date retrieval range and therefore potentially retrieve many more events, really pushed things too far and have caused many people&#8217;s sites to run into their (perfectly reasonable) PHP memory limits.</p>
<p>Unfortunately, the major cause of the memory issues was the <a href="http://simplepie.org">SimplePie</a> feed parser on which the plugin relied to do much of the hard work. SimplePie (with some help from WordPress&#8217; <code>class-feed.php</code>) took care of feed retrieval, feed parsing and caching, meaning the plugin didn&#8217;t have to be bothered about any of this. However, the memory problems were too great to ignore any longer; SimplePie had to go!</p>
<p>Don&#8217;t get me wrong, SimplePie is great, it made things really simple (hence the name, I guess), but I just don&#8217;t think it&#8217;s quite the right solution for the plugin any longer.</p>
<p>So, the plugin now takes care of retrieval, parsing and caching itself. The result is a <em>massive</em> reduction in memory usage.</p>
<p>Don&#8217;t hold me to any figures, but I&#8217;ve done quite a bit of unscientific testing, and the reduction is roughly between 75-90%.</p>
<hr />
<h3>Caching</h3>
<p>As I mentioned above, caching wasn&#8217;t directly controlled by the plugin in 0.5 and below. While this made things simple from a coding point of view, it wasn&#8217;t ideal. I won&#8217;t go into the details, as it&#8217;s complicated (and boring) but essentially the plugin created far too many caches of feed data, and never really cleaned up expired caches. Also, the feed data was cached in a completely raw state, meaning it was enormous and had to be processed from scratch each time. On top of that, the plugin couldn&#8217;t really keep track of what cached data existed, so it couldn&#8217;t be cleared on demand.</p>
<p>All of the problems above are addressed in 0.6:</p>
<ul>
<li><strong>One feed, one cache</strong> &#8211; Now, there is one cache of feed data per feed. That&#8217;s it. You don&#8217;t need to worry about your database filling up with useless cached data, as the same cache will always be overwritten for each feed.</li>
<li><strong>Much less is cached</strong> &#8211; Now, the plugin caches processed data rather than the raw feed. This means that only useful information is stored. All the extra stuff sent along with the feed that the plugin doesn&#8217;t need is discarded, so there&#8217;s much less to keep in the database.</li>
<li><strong>Only processed once</strong> &#8211; As I said, the plugin processes the feed before caching it. Therefore some of the work only needs to be done once per cache, rather than every time a grid or list is requested.</li>
<li><strong>Refresh on demand</strong> &#8211; There&#8217;s a new &#8216;Refresh&#8217; option for each feed you have added. This will clear the cache of the feed, forcing it to be recreated next time a grid or list is requested. This means it is no longer necessary to faff about changing the cache duration option to 0 in order to retrieve the most up-to-date data.</li>
</ul>
<p>Of course, none of this solves the problem of existing, useless feed data that has been created by previous versions of the plugin. To address this, I have built in some functionality that detects whether you&#8217;re upgrading from 0.5 or below, and asks you whether or not you&#8217;d like to empty your database of expired cached data. This appears the first time you visit the plugin options screen after upgrading.</p>
<p><img class="alignnone size-full wp-image-1020" title="Clear cache message" src="http://www.rhanney.co.uk/wp/wp-content/uploads/2011/04/clear-transients.png" alt="The message displayed to users asking if they want to clear expired cached data" width="630" height="196" /></p>
<p>I would definitely recommend that you <em>do</em> clear the useless cached data, but you can choose to ignore it.</p>
<hr />
<h3>General Performance</h3>
<p>I&#8217;ve done a bit of a &#8216;performance overhaul&#8217; of the plugin. I fired up <a href="http://www.xdebug.org">XDebug</a> and <a href="http://sourceforge.net/projects/wincachegrind">WinCacheGrind</a> and looked for bottlenecks. I&#8217;m sure that there&#8217;s more optimisation that could be done, but now the plugin should:</p>
<ul>
<li><strong>Load faster</strong> &#8211; You may not notice it, but page load times should be faster due to generally more efficient code.</li>
<li><strong>Make fewer database queries</strong> &#8211; Maybe only a couple fewer here and there, but the less database hits, the better.</li>
<li><strong>Be quicker on AJAX requests</strong> &#8211; The plugin checks more carefully to ensure that only necessary stuff is done on AJAX requests. This should make month navigation in AJAX grids a <em>little</em> faster.</li>
</ul>
<p>These bits and bobs may not sound much, but every little helps, especially on high traffic sites. Coupled with the major memory usage and caching improvements, the plugin is a much more efficient piece of software than it used to be.</p>
<hr />
<h3>Error Handling</h3>
<p>Another handy side effect of the changes is that I was able to put together an improved error handling system.</p>
<p>In previous versions of the plugin, using multiple feeds in one grid / list, if any of the feeds were not parsed successfully, no events would be displayed, even if the remaining feeds were fine. Now, the plugin will ignore &#8216;broken&#8217; feeds and continue to display events from any working feeds.</p>
<p>As a logged-in admin user, you will see error messages explaining the problems that are preventing each feed from being displayed. These messages are much more specific to the problem than the generic message displayed in previous versions of the plugin.</p>
<hr />
<h3>Other Changes / Additions</h3>
<p>I&#8217;ve also implemented a few other miscellaneous things:</p>
<ul>
<li><strong>Optimise event retrieval</strong> &#8211; There&#8217;s a new option in the general plugin settings. When enabled, the plugin will use experimental parameter of the Google Data Protocol, called <code><a href="http://code.google.com/apis/gdata/docs/2.0/reference.html#fields">fields</a></code>. This parameter allows the plugin to specify exactly what data it needs, so that Google doesn&#8217;t send back any extra information that isn&#8217;t useful. This makes the feed data much smaller, meaning it takes less time to transfer, less time to process and uses less memory, resulting in a significant performance improvement. However, this is an experimental feature, so Google could potentially remove or change it an any time, <em>possibly</em> causing the plugin to break. Even though this is unlikely, I&#8217;ve made it an option rather than hard-code it into the plugin, just in case. Hopefully, Google will make this a &#8216;proper&#8217; feature eventually&#8230; it&#8217;s awesome!</li>
<li><strong>Custom stylesheet</strong> &#8211; If you specify a custom stylesheet, it will be included <em>as well as</em> the default stylesheet, rather than <em>instead of</em>. This is so that if the custom stylesheet gets deleted or overwritten (for example, during plugin updates, as quite a few people have experienced!), the default one will still be there to ensure that the basic CSS rules required to prevent things going wonky are in place. This also means you don&#8217;t need to make a copy of the default stylesheet, you add only the CSS you want to change / override.</li>
<li><strong>Uninstall</strong> &#8211; If you delete the plugin via the WordPress plugin admin screen, it will &#8216;uninstall&#8217; itself. This means it will remove all trace of itself from your database, including saved feeds and cached data.</li>
<li><strong>Now doesn&#8217;t mean now</strong> &#8211; In version 0.5, if you used the &#8216;Now&#8217; option of either of the &#8216;Retrieve events from&#8217; or &#8216;Retrieve events until&#8217; settings, the plugin interpreted this as literally now, to the second. This had the effect of reducing the cache duration to 1 second, regardless of the cache duration option. In this version, the plugin rounds now to the previous minute, so that the minimum cache duration is also 1 minute when using the &#8216;Now&#8217; options (unless you set the cache duration lower, but&#8230; don&#8217;t!). Events in Google Calendar are only precise to minutes anyway.</li>
<li><strong>Check for PHP 5.2</strong> &#8211; The plugin requires PHP 5.2, as it now makes use of <code><a href="http://php.net/manual/en/function.json-decode.php">json_decode</a></code>. The plugin has required PHP 5 for a long time, so this shouldn&#8217;t affect many, if any, existing users. There&#8217;s now a check to ensure that PHP 5.2+ is installed, if not, the plugin won&#8217;t activate and will display a message explaining why not. WordPress itself will also require PHP 5.2 (<a href="http://wpdevel.wordpress.com/2011/03/18/wordpress-3-2-the-plan-faster-lighter/">5.2.4 to be exact</a>) as of version 3.2. I got the idea and implementation for this from <a href="http://yoast.com/requires-php-52">Yoast</a>.</li>
<li><strong>Improved multi-day event handling</strong> &#8211; Multi-day events are now handled correctly. They used to display outside of the specified date retrieval range, they don&#8217;t any more (Thanks <a href="http://silvermine.org.au/">Chris</a>!).</li>
<li><strong>More event display builder shortcodes</strong> &#8211; I&#8217;ve added 3 new shortcodes: <code>[if-multi-day]</code>, <code>[if-single-day]</code> and <code>[length]</code>. Take a look at the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder/">event display builder guide</a> for explanations of these.</li>
<li><strong>Improved &#8216;human&#8217; time differences</strong> &#8211; For the <code>[start-human]</code> and <code>[end-human]</code> event display builder shortcodes, the plugin was using the WordPress <code><a href="http://codex.wordpress.org/Function_Reference/human_time_diff">human_time_diff</a></code> function. It works well, but is limited to minutes, hours and days. So, the plugin now uses an improved version of this function, as suggested in a <a href="http://core.trac.wordpress.org/ticket/9272">WordPress trac ticket by Viper007Bond</a>, which displays weeks, months and years too.</li>
</ul>
<hr />
<h3>Bug fixes</h3>
<p>I&#8217;ve fixed a couple of bugs too:</p>
<ul>
<li><strong>Missing <code>ctz</code> parameter</strong> &#8211; Links created in the event display builder (with <code>[link]</code> or <code>[link-path]</code>) were missing the current timezone (<code>ctz</code>) parameter. This meant that anyone not currently logged into a Google account who clicked on one of these links would see event times in UTC time, rather than the correct timezone (Thanks to <a href="http://www.wctrust.org">Jodi</a> for spotting and reporting this).</li>
<li><strong>Clickable URLs</strong> &#8211; When using the simple display options, URLs in the description of an event would be automatically made into a &#8216;proper&#8217; link. This should have occurred in the event display builder too, but didn&#8217;t. It does now (Thanks to <a href="http://www.drawuslines.com">Jim</a> for pointing this out).</li>
<li><strong><code>HTTPS</code> URLs</strong> &#8211; At some point, Google seems to have changed the default protocol for calendar feed URLs to <code>https</code>. On some server configurations, these <code>https</code> URLs failed to work (although simply changing <code>https</code> to <code>http</code> fixed the problem). <em>Another</em> side effect of the changes in this release is that this problem can be avoided, so both protocols should work just fine.</li>
</ul>
<hr />
<p>I think that&#8217;s about it. I&#8217;m hoping this release will be well received, as although it doesn&#8217;t add any terribly exciting features, it does solve some long running problems, which will allow the<a href="http://www.rhanney.co.uk/2011/04/18/google-calendar-events-0-5"> features added in 0.5</a> to really be used to their full potential.</p>
<p>You can update the plugin automatically from within your WordPress admin, or download it from the <a href="http://wordpress.org/extend/plugins/google-calendar-events">plugin directory</a>.</p>
<p>Bug reports, feature requests, questions and any other feedback is always welcome. You can leave a comment below or on the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events">plugin homepage</a>, or <a href="http://www.rhanney.co.uk/contact">send me an email</a>.</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/n5qJt5zjFfs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/04/29/google-calendar-events-0-6/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.5</title>
		<link>http://rhanney.co.uk/2011/04/18/google-calendar-events-0-5/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-5</link>
		<comments>http://rhanney.co.uk/2011/04/18/google-calendar-events-0-5/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 14:12:39 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=932</guid>
		<description><![CDATA[Version 0.5 of my WordPress plugin, Google Calendar Events, has been released! 0.5 contains a couple of new features, which between them encompass a large proportion of the feature requests I have received over the last few months. Here&#8217;s a brief overview of the new stuff: Event Display Builder The old display options were pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Version 0.5 of my WordPress plugin, <a href="http://www.rhanney.co.uk/plugins/google-calendar-events">Google Calendar Events</a>, has been released!</p>
<p>0.5 contains a couple of new features, which between them encompass a large proportion of the feature requests I have received over the last few months. Here&#8217;s a brief overview of the new stuff:</p>
<p><span id="more-932"></span></p>
<hr />
<h3>Event Display Builder</h3>
<p>The old display options were pretty inflexible, and made things like showing the start and end time on the same line impossible, without hacking about with the code. The event display builder makes things such as this much easier.</p>
<p>I won&#8217;t go into too much depth here, as I&#8217;ve written an <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder">extensive guide</a>, with examples, on how to use the feature. Some of the things that are now possible, that were previously difficult / impossible, are listed below:</p>
<ul>
<li><strong>Handling of all-day events</strong> &#8211; Previously, you couldn&#8217;t differentiate between all-day and normal events, so start and end times for all-day events would be displayed as &#8217;12:00 am&#8217;, which could be confusing. Now, using the <code><a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder#shortcode-if-all-day">[if-all-day]</a></code> and <code><a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder#shortcode-if-not-all-day">[if-not-all-day]</a></code> shortcodes in the event display builder, you could display something like &#8216;All day&#8217; rather than the start / end times for all-day events, whilst still showing the start / end times for &#8216;normal&#8217; events.</li>
<li><strong>HTML and Markdown parsing</strong> &#8211; If you enter HTML into any of the Google Calendar fields (title, location, description) it is sent as plain text in the feed data. Now, using the <code><a href="http://rhanney.co.uk/plugins/google-calendar-events/event-display-builder#attribute-html">html</a></code> attribute, the plugin can convert the plain text back to HTML and display it as such. Markdown can also be parsed (if you have PHP Markdown installed), using the <code><a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder#attribute-markdown">markdown</a></code> attribute. Thanks go to <a href="http://lunasea-studios.com">James Hicks</a> for the Markdown stuff.</li>
<li><strong>Greater control over the markup</strong> &#8211; You can now use whatever markup you like to structure the event information. This also allows you to change the ordering of the event information, or display several things on the same line, or make the event title into a link, or anything you like! You can also generate feed-specific CSS classes using the <code><a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder#shortcode-feed-id">[feed-id]</a></code> shortcode.</li>
</ul>
<p>If you have ideas for any other useful shortcodes for the event display builder, or have noticed any bugs, please let me know in the <a href="#respond">comments</a> below, or <a href="http://rhanney.co.uk/plugins/google-calendar-events/event-display-builder#respond">here</a>.</p>
<hr />
<h3>Flexible Event Retrieval Date Range</h3>
<p>Previously, the date ranges you could specify for retrieval of events from a feed were very limiting. You could retrieve from 00:00 &#8216;today&#8217;, or from the beginning of the month, but that&#8217;s it. With the new &#8216;Retrieve events from&#8217; and &#8216;Retrieve events until&#8217; settings you have much greater control over the date range.</p>
<p>The options you can choose from are as follows:</p>
<ul>
<li>Now</li>
<li>00:00 today</li>
<li>Start of current week</li>
<li>Start of current month</li>
<li>End of current month</li>
<li>The beginning of time (<em>Retrieve from only</em>)</li>
<li>The end of time (<em>Retrieve until only</em>)</li>
<li>Specific date / time</li>
</ul>
<p>However, you can also specify an offset, in seconds, to the above options (except for the last three), allowing a lot of flexibility. Here&#8217;s a few examples:</p>
<ul>
<li><strong>Date range required:</strong>All of time!
<ul>
<li><strong>Retrieve events from: </strong> The beginning of time</li>
<li><strong>Retrieve events until: </strong> The end of time</li>
</ul>
</li>
<li><strong>Date range required:</strong>The past
<ul>
<li><strong>Retrieve events from: </strong> The beginning of time</li>
<li><strong>Retrieve events until: </strong> Now</li>
</ul>
</li>
<li><strong>Date range required:</strong>The future
<ul>
<li><strong>Retrieve events from: </strong> Now</li>
<li><strong>Retrieve events until: </strong> The end of time</li>
</ul>
</li>
<li><strong>Date range required:</strong>Today
<ul>
<li><strong>Retrieve events from: </strong> 00:00 today</li>
<li><strong>Retrieve events until: </strong> 00:00 today, with an offset of 86400</li>
</ul>
</li>
<li><strong>Date range required:</strong>This week
<ul>
<li><strong>Retrieve events from: </strong> Start of current week</li>
<li><strong>Retrieve events until: </strong> Start of current week, with an offset of 604800</li>
</ul>
</li>
<li><strong>Date range required:</strong>Last week
<ul>
<li><strong>Retrieve events from: </strong> Start of current week, with an offset of -604800</li>
<li><strong>Retrieve events until: </strong> Start of current week</li>
</ul>
</li>
<li><strong>Date range required:</strong>The past 12 hours and the next 12 hours
<ul>
<li><strong>Retrieve events from: </strong> Now, with an offset of -43200</li>
<li><strong>Retrieve events until: </strong> Now, with an offset of 43200</li>
</ul>
</li>
<li><strong>Date range required:</strong>April 2011
<ul>
<li><strong>Retrieve events from: </strong> Specific date / time (1301616000)</li>
<li><strong>Retrieve events until: </strong> Specific date / time (1304208000)</li>
</ul>
</li>
</ul>
<p>These are just a few ideas, there&#8217;s lots of other possibilities too.</p>
<hr />
<h3>Custom Error Message</h3>
<p>These are the two main error messages that the plugin displays if something has gone wrong:</p>
<p><code>The following feeds were not parsed successfully: 1. Please check that the feed URLs are correct and that the feeds have public sharing enabled.</code></p>
<p><code>No valid Feed IDs have been entered for this widget. Please check that you have entered the IDs correctly and that the Feeds have not been deleted.</code></p>
<p>You probably don&#8217;t want your site visitors to see these messages, so you can now specify a custom error message to display to non-admin users. As a logged-in admin user, you will still see the above messages.</p>
<hr />
<p>You can upgrade to this version of the plugin through your WordPress admin, or by downloading from the WordPress <a href="http://wordpress.org/extend/plugins/google-calendar-events">plugin directory</a>.</p>
<p>Many thanks to those that downloaded and tested the <a href="http://rhanney.co.uk/2011/03/21/google-calendar-events-0-5-beta">beta</a> of version 0.5!</p>
<p>As always, any feedback is greatly appreciated. Add a comment below, or on the <a href="http://rhanney.co.uk/plugins/google-calendar-events">plugin homepage</a>, or send me an email via the <a href="http://rhanney.co.uk/contact">contact form</a>.</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/K1VMBZg-bUM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/04/18/google-calendar-events-0-5/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events, 0.5 beta</title>
		<link>http://rhanney.co.uk/2011/03/21/google-calendar-events-0-5-beta/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-5-beta</link>
		<comments>http://rhanney.co.uk/2011/03/21/google-calendar-events-0-5-beta/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 22:10:36 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=686</guid>
		<description><![CDATA[Version 0.5 has now been released! Please take a look at this post for details on the release. Over the last couple of weeks, I managed to find a little time to spend developing my WordPress plugin, Google Calendar Events. I&#8217;ve implemented a couple of features / enhancements that I&#8217;m quite excited about, as I [...]]]></description>
			<content:encoded><![CDATA[<p class="bold">Version 0.5 has now been released! Please take a look at <a href="http://rhanney.co.uk/2011/04/18/google-calendar-events-0-5">this post</a> for details on the release.</p>
<p>Over the last couple of weeks, I managed to find a little time to spend developing my WordPress plugin, <a href="http://rhanney.co.uk/plugins/google-calendar-events">Google Calendar Events</a>. I&#8217;ve implemented a couple of features / enhancements that I&#8217;m quite excited about, as I think they really add a lot of flexibility.</p>
<p><span id="more-686"></span></p>
<p>These features also encompass a large proportion of the requests I have had over the last few months, and should prevent a lot of the inelegant hacks that have been required to do various things in the past.</p>
<p>I have had to make some fairly significant changes to the code in order to implement the features, so I don&#8217;t want to release 0.5 straight away, just in case I&#8217;ve introduced (or re-introduced) any bugs. Any feedback on this beta &#8216;release&#8217; would be greatly appreciated!</p>
<p>You can download the beta from the <a href="http://wordpress.org/extend/plugins/google-calendar-events/download">plugin directory</a> (choose the &#8216;Development Version&#8217;). The beta version will still say it is 0.4.1 in the WordPress plugin admin, as I haven&#8217;t changed the readme file yet.</p>
<p>Here&#8217;s a quick explanation of the new stuff / changes:</p>
<hr />
<h3>Event Display Builder</h3>
<p>I&#8217;m quite pleased with this feature, it&#8217;s pretty snazzy! I can&#8217;t really take much credit for it though, much of the concept and code behind it is &#8216;borrowed&#8217; from the WordPress <a href="http://codex.wordpress.org/Shortcode_API">shortcode API</a>.</p>
<p>The event display builder allows you customise the information that is displayed for each event in the grid tooltips or list. This is done by specifying a HTML structure containing shortcodes that will be replaced by the relevant event information when the grid or list is generated.</p>
<p>A brief explanation of the available shortcodes is below. I&#8217;ll write a more in-depth guide to these before release.</p>
<table>
<tbody>
<tr>
<th style="min-width: 150px;">Shortcode</th>
<th>Explanation</th>
</tr>
<tr>
<td><code>[event-title]</code></td>
<td>The title of the event (possible attributes: <code>html</code>, <code>markdown</code>)</td>
</tr>
<tr>
<td><code>[start-time]</code></td>
<td>The start time of the event. Will use the time format specified in the feed settings (or if this has been omitted, the default WordPress time format)</td>
</tr>
<tr>
<td><code>[start-date]</code></td>
<td>The start date of the event. Will use the date format specified in the feed settings (or if this has been omitted, the default WordPress date format)</td>
</tr>
<tr>
<td><code>[start-custom]</code></td>
<td>The start time / date of the event. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</td>
</tr>
<tr>
<td><code>[start-human]</code></td>
<td>The difference between the start time of the event and the time now, in human-readable format, such as &#8217;1 hour&#8217;, &#8217;4 days&#8217;, &#8217;15 mins&#8217;</td>
</tr>
<tr>
<td><code>[end-time]</code></td>
<td>The end time of the event. Will use the time format specified in the feed settings (or if this has been omitted, the default WordPress time format)</td>
</tr>
<tr>
<td><code>[end-date]</code></td>
<td>The end date of the event. Will use the date format specified in the feed settings (or if this has been omitted, the default WordPress date format)</td>
</tr>
<tr>
<td><code>[end-custom]</code></td>
<td>The end time / date of the event. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</td>
</tr>
<tr>
<td><code>[end-human]</code></td>
<td>The difference between the end time of the event and the time now, in human-readable format, such as &#8217;1 hour&#8217;, &#8217;4 days&#8217;, &#8217;15 mins&#8217;</td>
</tr>
<tr>
<td><code>[location]</code></td>
<td>The location of the event (possible attributes: <code>html</code>, <code>markdown</code>)</td>
</tr>
<tr>
<td><code>[maps-link]…[/maps-link]</code></td>
<td>A link to Google Maps. Utilises the information in the location field to search Google Maps. The link text should be specified between the opening and closing shortcode tags (possible attributes: <code>newwindow</code>)</td>
</tr>
<tr>
<td><code>[description]</code></td>
<td>The description of the event (possible attributes: <code>html</code>, <code>markdown</code>, <code>limit</code>)</td>
</tr>
<tr>
<td><code>[link]…[/link]</code></td>
<td>A link to the Google Calendar page for the event. The link text should be specified between the opening and closing shortcode tags (possible attributes: <code>newwindow</code>)</td>
</tr>
<tr>
<td><code>[link-path]</code></td>
<td>The raw URL to the Google Calendar page for the event</td>
</tr>
<tr>
<td><code>[feed-id]</code></td>
<td>The ID of the feed from which the event comes. Useful for constructing feed specific CSS classes</td>
</tr>
<tr>
<td><code>[feed-title]</code></td>
<td>The title of the feed from which the event comes</td>
</tr>
<tr>
<td><code>[timezone]</code></td>
<td>The timezone of the feed from which the event comes</td>
</tr>
</tbody>
</table>
<p>In addition to the above shortcodes, there are also logical / conditional shortcodes. Anything you enter between the opening and closing tags of the following shortcodes (including any further shortcodes!) will only be displayed if its conditions are met:</p>
<table>
<tbody>
<tr>
<th style="min-width: 150px;">Shortcode</th>
<th>Condition</th>
</tr>
<tr>
<td><code>[if-all-day]…[/if-all-day]</code></td>
<td>The event is an all-day event</td>
</tr>
<tr>
<td><code>[if-not-all-day]…[/if-not-all-day]</code></td>
<td>The event is not an all-day event</td>
</tr>
<tr>
<td><code>[if-title]…[/if-title]</code></td>
<td>The event title is not empty</td>
</tr>
<tr>
<td><code>[if-description]…[/if-description]</code></td>
<td>The event description is not empty</td>
</tr>
<tr>
<td><code>[if-location]…[/if-location]</code></td>
<td>The event location is not empty</td>
</tr>
<tr>
<td><code>[if-tooltip]…[/if-tooltip]</code></td>
<td>This is to be displayed in a tooltip</td>
</tr>
<tr>
<td><code>[if-list]…[/if-list]</code></td>
<td>This is to be displayed in a list</td>
</tr>
<tr>
<td><code>[if-now]…[/if-now]</code></td>
<td>The event is taking place now (after the start time, but before the end time)</td>
</tr>
<tr>
<td><code>[if-not-now]…[/if-not-now]</code></td>
<td>The event is not taking place now (may have ended or not yet started)</td>
</tr>
<tr>
<td><code>[if-started]…[/if-started]</code></td>
<td>The event has started (even if it has also ended)</td>
</tr>
<tr>
<td><code>[if-not-started]…[/if-not-started]</code></td>
<td>The event has not started</td>
</tr>
<tr>
<td><code>[if-ended]…[/if-ended]</code></td>
<td>The event has ended</td>
</tr>
<tr>
<td><code>[if-not-ended]…[/if-not-ended]</code></td>
<td>The event has not ended (even if it hasn&#8217;t started)</td>
</tr>
<tr>
<td><code>[if-first]…[/if-first]</code></td>
<td>The event is the first of the day</td>
</tr>
<tr>
<td><code>[if-not-first]…[/if-not-first]</code></td>
<td>The event is not the first of the day</td>
</tr>
</tbody>
</table>
<p>The possible attributes mentioned in the above tables are explained here:</p>
<table>
<tbody>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Explanation</th>
</tr>
<tr>
<td><code>html</code></td>
<td><code>true</code> or <code>false</code></td>
<td>Whether or not to parse HTML that has been entered in the relevant field.</td>
</tr>
<tr>
<td><code>markdown</code></td>
<td><code>true</code> or <code>false</code></td>
<td>Whether or not to parse Markdown that has been entered in the relevant field. This requires <a href="http://michelf.com/projects/php-markdown">PHP Markdown</a> to be installed</td>
</tr>
<tr>
<td><code>limit</code></td>
<td>A positive integer</td>
<td>The word limit for the field (it probably isn&#8217;t a good idea to use this in conjunction with the <code>html</code> attribute, as it could cause tags to become unbalanced)</td>
</tr>
<tr>
<td><code>format</code></td>
<td>A <a href="http://php.net/manual/en/function.date.php">PHP date format</a> string</td>
<td>The date / time format to use</td>
</tr>
<tr>
<td><code>newwindow</code></td>
<td><code>true</code> or <code>false</code></td>
<td>Whether or not the link should open in a new window / tab</td>
</tr>
</tbody>
</table>
<p>Here&#8217;s an example of the sort of thing you could enter in the event display builder field:</p>
<div class="highlight"><pre class="niji_code niji_html" style="">&lt;div class=<span class="niji_string">&quot;gce-tooltip-event&quot;</span>&gt;<span class="niji_default">[event-title] ([feed-title])</span>&lt;/div&gt;<span class="niji_default">
[if-not-all-day]</span>&lt;div&gt;<span class="niji_default"></span>&lt;strong&gt;<span class="niji_default">Time:</span>&lt;/strong&gt;<span class="niji_default"> From [start-time] until [end-time]</span>&lt;/div&gt;<span class="niji_default">[/if-not-all-day]
[if-all-day]</span>&lt;div&gt;<span class="niji_default"></span>&lt;strong&gt;<span class="niji_default">Time:</span>&lt;/strong&gt;<span class="niji_default"> All day</span>&lt;/div&gt;<span class="niji_default">[/if-all-day]
[if-location]</span>&lt;div&gt;<span class="niji_default"></span>&lt;strong&gt;<span class="niji_default">At: </span>&lt;/strong&gt;<span class="niji_default"> [maps-link newwindow=<span class="niji_string">&quot;true&quot;</span>][location][/maps-link]</span>&lt;/div&gt;<span class="niji_default">[/if-location]
[if-description]</span>&lt;div&gt;<span class="niji_default"></span>&lt;strong&gt;<span class="niji_default">Description:</span>&lt;/strong&gt;<span class="niji_default"> [description html=<span class="niji_string">&quot;true&quot;</span>]</span>&lt;/div&gt;[/if-description]</pre></div>
<p>This would result in a tooltip something like the following:</p>
<p><img class="alignnone size-full wp-image-743" title="Example" src="http://rhanney.co.uk/wp/wp-content/uploads/2011/03/example.png" alt="Event display builder example" width="390" height="323" /></p>
<p>Notice that the event display builder has allowed the following things, that were previously difficult / impossible:</p>
<ul>
<li>Differentiation between all-day and &#8216;normal&#8217; events</li>
<li>Display of feed titles</li>
<li>Parsing of HTML entered in Google Calendar fields</li>
<li>Linking to Google Maps</li>
<li>Customisation of where information is displayed (start and end time on same line, for example)</li>
<li>Ability to specify your own HTML and CSS classes, allowing for more styling possibilities</li>
</ul>
<p>Obviously, this is a little more complex than the &#8216;old&#8217; display options from current versions of the plugin and may take a little getting used to, especially for those without any knowledge of HTML. For this reason (and for backwards compatibility) the plugin still has the old display options available.</p>
<hr />
<h3>Flexible Retrieval Date / Time Range</h3>
<p>In previous versions of the plugin, there wasn&#8217;t much flexibility in the date / time range of when events would be retrieved from the Google Calendar feed. The new options offer much more control, making the following ranges simple to set up:</p>
<ul>
<li><strong>This month</strong>
<ul>
<li><em>Retrieve events from</em>: Start of this month</li>
<li><em>Retrieve events until</em>: End of this month</li>
</ul>
</li>
<li><strong>The past</strong>
<ul>
<li><em>Retrieve events from</em>: The beginning of time</li>
<li><em>Retrieve events until</em>: Now</li>
</ul>
</li>
<li><strong>The future</strong>
<ul>
<li><em>Retrieve events from</em>: Now</li>
<li><em>Retrieve events until</em>: The end of time</li>
</ul>
</li>
<li><strong>The next 7 days (including today)</strong>
<ul>
<li><em>Retrieve events from</em>: 00:00 today</li>
<li><em>Retrieve events until</em>: Number of days (7)</li>
</ul>
</li>
<li><strong>1 hour ago until 1 hour from now</strong>
<ul>
<li><em>Retrieve events from</em>: Number of seconds (-3600)</li>
<li><em>Retrieve events until</em>: Number of seconds (3600)</li>
</ul>
</li>
<li><strong>Events currently occuring</strong>
<ul>
<li><em>Retrieve events from</em>: Now</li>
<li><em>Retrieve events until</em>: Now</li>
</ul>
</li>
<li><strong>Today until Christmas Day 2021</strong>
<ul>
<li><em>Retrieve events from</em>: 00:00 today</li>
<li><em>Retrieve events until</em>: Specific date (1640390400)</li>
</ul>
</li>
</ul>
<p>These are just a few examples, of course there are lots of other possibilities. Note that it may be necessary to reduce the cache duration when using smaller time ranges, to ensure that the plugin remains &#8216;up-to-date&#8217;.</p>
<hr />
<h3>Error Message</h3>
<p>The error messages that the plugin outputs when something has gone wrong aren&#8217;t particularly friendly, and it&#8217;s unlikely that you&#8217;ll want your regular site visitors to see them. So, in the General Options for the plugin, you can now specify an error message that regular users will see if <em>any</em> error occurs that prevents the grid list from being displayed. Logged-in admin users will still see the old error messages, that give more information on the problem.</p>
<hr />
<h3>Memory</h3>
<p>Previously, the plugin was loading SimplePie all the time, even when not needed. I <em>think</em> this may have been the cause of the memory limit issues that several people experienced. Now the plugin should only load SimplePie when it actually needs it!</p>
<hr />
<p>Any feedback (good or bad!) on any of the new stuff would be very much appreciated. Obviously, this is just a &#8216;beta&#8217; at the moment, so there may be some horrible bug lurking! I wouldn&#8217;t recommend that you use this on a live site, yet!<br />
Specifically, feedback on the following would be great:</p>
<ul>
<li><strong>Event display builder</strong> &#8211; any shortcode combinations that don&#8217;t work / produce unexpected results? Any ideas for more shortcodes?</li>
<li><strong>Date / time range options</strong> &#8211; are they accurate, especially in timezones other than UTC? Ideas for more options?</li>
<li><strong>Memory</strong> &#8211; if you were previously experiencing memory limit issues, are they resolved / better / worse now?</li>
<li><strong>Updating from previous versions</strong> &#8211; are your settings carried across properly?</li>
<li><strong>Usability</strong> &#8211; are the new options easy to understand? Are more instructions required?</li>
</ul>
<p>Please use the comments below, or <a href="http://rhanney.co.uk/contact">contact me</a> directly.</p>
<p>Just in case you missed the link at the top, the beta can be downloaded <a href="http://wordpress.org/extend/plugins/google-calendar-events/download">here</a> (choose the &#8216;Development Version&#8217;). The beta version will still say it is 0.4.1 in the WordPress plugin admin, as I haven&#8217;t changed the readme file yet.</p>
<p>Thanks!</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/FjbPntqqWyU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/03/21/google-calendar-events-0-5-beta/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Google Calendar Events 0.4.1</title>
		<link>http://rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-calendar-events-0-4-1</link>
		<comments>http://rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 12:09:26 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[WP Plugins]]></category>

		<guid isPermaLink="false">http://www.rhanney.co.uk/?p=648</guid>
		<description><![CDATA[It&#8217;s been a long time coming, but here it is, another update to my WordPress plugin, Google Calendar Events! I&#8217;m afraid it isn&#8217;t particularly exciting, as it is really only a bug fix release (albeit one that fixes a rather annoying and long-running bug). There are a few things to explain though: Timezone Bug Fix [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time coming, but here it is, another update to my WordPress plugin, <a href="http://wordpress.org/extend/plugins/google-calendar-events">Google Calendar Events</a>!</p>
<p>I&#8217;m afraid it isn&#8217;t particularly exciting, as it is really only a bug fix release (albeit one that fixes a rather annoying and long-running bug). There are a few things to explain though:</p>
<p><span id="more-648"></span></p>
<hr />
<h3>Timezone Bug Fix</h3>
<p>The bug caused the plugin to retrieve and display events from the previous day, even if the &#8216;Show past events&#8230;&#8217; setting was disabled. This meant that, for many people who used the plugin to display a list of upcoming events, some of the events shown ended the previous day (confusing and rubbish).</p>
<p>The reason this occurred is due to the way Google Calendar handles date parameters that are sent to it, meaning that in some timezones (well, any really, except <abbr title="Coordinated Universal Time">UTC</abbr>), events outside of the required date range were retrieved.</p>
<p>To get around this, I have implemented a further check that ensures that events that have ended before the required start time (usually 00:00 &#8216;today&#8217;) are not displayed <em>even if</em> they have been retrieved.</p>
<p>The knock-on effect of this has is that the &#8216;Maximum number of events to retrieve&#8217; setting can no longer be relied upon for the purposes of displaying an exact number of events. Therefore I have added a further option to the widget settings / shortcode parameters, explained below:</p>
<p>(Many thanks to <a href="http://dhechler.com">David</a> and <a href="http://www.fcdesign.net">Jamie</a> for their assistance with identifying / fixing the bug)</p>
<hr />
<h3>Maximum Number of Events to Display Option</h3>
<p>Previously, if you wanted to display events from the same feed in both a grid and list, but wanted to show a <em>different number</em> of events in each, you had to add two seperate feeds in the plugin with different values for the &#8216;Maximum number of events to retrieve&#8217; option. With this new option, you can add one feed (setting the number of events to retrieve to the higher value) and use it for both the grid and list, specifying the number of events to display in the widget / shortcode settings.</p>
<p>The widget option is fairly self explanatory; there is simply a new textbox into which you enter the required number of events to display.</p>
<p><img class="alignnone size-full wp-image-655" title="New widget option" src="http://www.rhanney.co.uk/wp/wp-content/uploads/2011/01/new-widget-option.png" alt="Screenshot showing new widget option" width="295" height="76" /></p>
<p>For the shortcode, a new parameter has been added (<code>max</code>), which you use something like this:</p>
<div class="highlight"><pre class="niji_code niji_text" style="">[google-calendar-events id=&quot;1&quot; type=&quot;list-grouped&quot; title=&quot;Events on&quot; max=&quot;5&quot;]</pre></div>
<p>If you want to display all the events that have been retrieved, set this to 0.</p>
<p><span class="bold">Note</span>: As mentioned earlier, the &#8216;Maximum number of events to retrieve&#8217; setting can&#8217;t be relied upon for displaying an exact number of events (whereas this new option can), so it should be set to retrieve a few more events that you actually require, to allow for the timezone issue (and also caching). Don&#8217;t set it to retrieve hundreds of events if you only want it to display 3 though! 5-10 more than required should be plenty for most cases.</p>
<hr />
<h3>Extra Bits and Bobs</h3>
<p>I took the opportunity to also add / fix a few extra things that I have been meaning to do:</p>
<ul>
<li><strong><abbr title="Internationalization">i18n</abbr> fix</strong>: There was a slight error with the language files path, which has now been corrected</li>
<li><strong>widget_title filter support</strong>: Props to <a href="http://lunasea-studios.com">James</a>!</li>
<li><strong>Hungarian translation</strong>: Many thanks to <a href="http://ek.klog.hu">Takács Dániel</a> for this (apologies for the delay)!</li>
<li><strong>Minification of qTip plugin</strong>: Minification reduces its size by more than half. I&#8217;ve no idea why I didn&#8217;t do this from the beginning</li>
</ul>
<hr />
<p>Now that the timezone bug has been eradicated (fingers crossed!), I can concentrate on adding snazzy features. I can&#8217;t promise anything, as I&#8217;m quite busy with other things at the moment, but I&#8217;ll try to ensure gaps between releases are not quite as large as between 0.4 and 0.4.1!</p>
<p><a href="http://wordpress.org/extend/plugins/google-calendar-events">Download</a> the new version from the WordPress plugin directory, or update automatically from within your WordPress admin.</p>
<p>As usual, all feedback is appreciated. Add comments here, or on the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events">main plugin page</a>. Thanks!</p>
<img src="http://feeds.feedburner.com/~r/rosshanney/~4/07nw4nscv5U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
	</channel>
</rss>

