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

<channel>
	<title>Rad Geek's Projects</title>
	<atom:link href="http://projects.radgeek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://projects.radgeek.com</link>
	<description>the software industry of a secessionist republic of one</description>
	<pubDate>Fri, 09 May 2008 01:19:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>FeedWordPress 0.993: WordPress 2.5.1 compatibility and a couple new features</title>
		<link>http://projects.radgeek.com/2008/05/08/feedwordpress-0993-wordpress-251-compatibility-and-a-couple-new-features/</link>
		<comments>http://projects.radgeek.com/2008/05/08/feedwordpress-0993-wordpress-251-compatibility-and-a-couple-new-features/#comments</comments>
		<pubDate>Fri, 09 May 2008 01:14:45 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<category><![CDATA[Compatibility]]></category>

		<category><![CDATA[FeedWordPress 0.992]]></category>

		<category><![CDATA[FeedWordPress 0.993]]></category>

		<category><![CDATA[Fixes]]></category>

		<category><![CDATA[WordPress 2.5]]></category>

		<category><![CDATA[WordPress 2.5.1]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/?p=53</guid>
		<description><![CDATA[FeedWordPress version 0.993 is now available for download.

There are a few new features that I am in the midst of working on for an upcoming release of FeedWordPress, but I have released version 0.993 now in order to resolve the critical compatability issue with WordPress 2.5.1. I am still doing compatibility testing to see whether [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/feedwordpress/feedwordpress.0.993.zip">FeedWordPress version 0.993 is now available for download.</a></p>

<p>There are a few new features that I am in the midst of working on for an upcoming release of FeedWordPress, but I have released version 0.993 now in order to resolve <a href="http://projects.radgeek.com/2008/04/27/feedwordpress-and-wordpress-251-compatability-issue/">the critical compatability issue with WordPress 2.5.1</a>. I am still doing compatibility testing to see whether there are any kinks in compatibility with WordPress 2.5.x, but upgrading to this release should eliminate the fatal error that prevented 2.5.1 users from accessing the Syndication Options and the feed settings pages from within the WordPress pages. There are some small bug fixes and the beginning groundwork for some features that will become more fleshed out in the upcoming, more feature-rich release, which aren&#8217;t worth going into in detail; besides those, here is what&#8217;s new since FeedWordPress 0.992:</p>

<ul>
<li><p><strong>WORDPRESS 2.5.1 COMPATIBILITY:</strong> FeedWordPress should now be compatible
with WordPress 2.5.1.</p></li>
<li><p><strong>WORDPRESS 2.5 INTERFACE IMPROVEMENTS:</strong> FeedWordPress&#8217;s Dashboard
interface has undergone several cosmetic changes that should help it
integrate better with the WordPress Dashboard interface in WordPress
version 2.5.x.</p></li>
<li><p><strong>SYNDICATED POSTS CAN BE MARKED AS &#8220;PENDING REVIEW&#8221;:</strong> WordPress 2.3 users
can now take advantage of WordPress&#8217;s new &#8220;Pending Review&#8221; features for
incoming syndicated posts. Posts marked as &#8220;Pending Review&#8221; are not
published immediately, but are marked as ready to be reviewed by an
Administrator or Editor, who can then choose to publish the post or
hold it back. If you want to review syndicated posts from a particular
feed, or from all feeds, before they are posted, then use
Syndication &#8211;> Syndicated Sites &#8211;> Edit or Syndication &#8211;> Options to
change the settings for handling new posts.</p></li>
<li><p><strong>AWARE OF NEW URI FOR del.icio.us FEEDS:</strong> Previous releases of
FeedWordPress already automatically split del.icio.us tags up
appropriately appropriately when generating categories. (del.icio.us
feeds smoosh all the tags into a single <code>&lt;dc:subject&gt;</code> element,
separated by spaces; FeedWordPress un-smooshes them into multiple
categories by separating them at whitespace.) Unfortunately, del.icio.us
recently broke the existing behavior by changing host names for their
feeds from del.icio.us to feeds.delicious.com. Version 0.993 accounts
for the new host name and un-breaks the tag splitting.</p></li>
</ul>

<p><strong>If you have put off upgrading to WordPress 2.5.1 due to this bug, and plan to upgrade after installing FeedWordPress 0.993, please remember</strong> that <em>after</em> you upgrade WordPress, <a href="http://projects.radgeek.com/2008/04/18/compatability-bugs-and-possible-quick-fixes-for-issues-with-feedwordpress-after-upgrading-to-wordpress-25/">you will need to reinstall the FeedWordPress MagpieRSS upgrades</a> in order to keep your feed parsing from getting broken.</p>

<p>Enjoy! As I mentioned, I&#8217;m actively working on a release, probably due sometime before the end of the month, including bug fixes and a few significant new features, so let me know about any ongoing issues that you may still have. </p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/05/08/feedwordpress-0993-wordpress-251-compatibility-and-a-couple-new-features/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FeedWordPress and WordPress 2.5.1 compatability issue</title>
		<link>http://projects.radgeek.com/2008/04/27/feedwordpress-and-wordpress-251-compatability-issue/</link>
		<comments>http://projects.radgeek.com/2008/04/27/feedwordpress-and-wordpress-251-compatability-issue/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 17:41:25 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[Compatibility]]></category>

		<category><![CDATA[FeedWordPress 0.992]]></category>

		<category><![CDATA[WordPress 2.5]]></category>

		<category><![CDATA[WordPress 2.5.1]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/?p=52</guid>
		<description><![CDATA[I wanted to post a quick note because I have received several reports of a serious compatability issue between FeedWordPress and the most recent public release of WordPress, version 2.5.1. Although FWP is broadly compatible with the initial release of WordPress 2.5, the recent update apparently eliminates an interface function that FeedWordPress used to display [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to post a quick note because I have received several reports of a serious compatability issue between FeedWordPress and the most recent public release of WordPress, version 2.5.1. Although FWP is broadly compatible with the initial release of WordPress 2.5, the recent update apparently eliminates an interface function that FeedWordPress used to display a box for selecting categories in the Syndication options and the feed settings pages. Since the function no longer exists in WordPress 2.5.1, it means that a fatal PHP error (shown either by a prematurely cut-off display, or in the form of a printed PHP error message) will be triggered if you attempt to use either of these pages in the WordPress Dashboard. (As far as I know, syndication will continue to work fine with WordPress 2.5.1; the error will prevent you from changing configuration settings from within the WordPress Dashboard.)</p>

<p>This problem should, hopefully, be something that it won&#8217;t be too hard to fix once I am able to sit down and work on it. Unfortunately, the release came after I had left to visit family in Alabama, so I can&#8217;t get to making the fix until I return home early in the upcoming week. Once I do, I&#8217;ll release an immediate compatability fix, and then return to work on a more thorough update, which I hope to release sometime during the month of May.</p>

<p>I&#8217;ll check back in with y&#8217;all once I&#8217;ve gotten home.</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/04/27/feedwordpress-and-wordpress-251-compatability-issue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compatability bugs and possible quick fixes for issues with FeedWordPress after upgrading to WordPress 2.5</title>
		<link>http://projects.radgeek.com/2008/04/18/compatability-bugs-and-possible-quick-fixes-for-issues-with-feedwordpress-after-upgrading-to-wordpress-25/</link>
		<comments>http://projects.radgeek.com/2008/04/18/compatability-bugs-and-possible-quick-fixes-for-issues-with-feedwordpress-after-upgrading-to-wordpress-25/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 21:59:38 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[Compatability]]></category>

		<category><![CDATA[FeedWordPress 0.992]]></category>

		<category><![CDATA[FeedWordPress 0.993]]></category>

		<category><![CDATA[Fixes]]></category>

		<category><![CDATA[MagpieRSS]]></category>

		<category><![CDATA[WordPress 2.5]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/?p=51</guid>
		<description><![CDATA[WordPress 2.5 was recently released, and as a result many FeedWordPress users have upgraded their blogs to the latest version of WordPress. I am currently in the process of testing for any compatability issues between WordPress 2.5 and the development version of FeedWordPress (0.993a); if I notice any definite problems, then I will make them [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codex.wordpress.org/Version_2.5">WordPress 2.5</a> was recently released, and as a result many FeedWordPress users have upgraded their blogs to the latest version of WordPress. I am currently in the process of testing for any compatability issues between WordPress 2.5 and the development version of FeedWordPress (0.993a); if I notice any definite problems, then I will make them high-priority bug fixes and try to push out the release of 0.993 as quickly as possible. (That probably means either tonight, or some time around the end of the month, depending on when I find any problems that I may find.) If you have tried using FeedWordPress with WordPress 2.5, either in version 0.992 or in the current <q>trunk</q> development version, and have noticed any problems since the upgrade that aren&#8217;t fixed by what I&#8217;m about to suggest, then please feel free to report them in the comments here or <a href="http://radgeek.com/contact">to me by e-mail</a>, as you prefer. The most helpful bug reports are those that state, in as much detail as possible, (1) what precisely is going wrong, (2) under what conditions, (3) with what version of FeedWordPress, (4) under what version of PHP, and, if the problem is with syndicating posts, then (5) with which feeds at which specific URIs. If you are getting symptoms of a fatal error (either a printed error message or a blank screen where a page should be), then you can also help me out a lot by copying and pasting the contents of the error message into your report, or, if you have a blank screen, checking the bottom of your web server&#8217;s error logs to see if there is a PHP error report down there, and, if so, copying and pasting that.</p>

<p>That said, one of the most common sources of error reports when new versions of WordPress are released come not from a real compatability issue, but rather from the fact that, if you&#8217;re not careful, upgrading your copy of WordPress will downgrade your copy of MagpieRSS from the newer version shipped with FWP to the very old and busted version that WordPress continues, for whatever reason, to ship with new releases of WordPress.</p>

<h3>Diagnosis</h3>

<p>Here are the most common symptoms of this problem:</p>

<ul>
<li>Some feeds (notably, feeds produced by Blogger and other Atom 1.0 feeds) stop syndicating post contents. You get the headline of the post and nothing else.</li>
<li>Some feeds (notably, those produced by blogs hosted at WordPress.com (!)) start appearing with just the capital letter <q>A</q> as the <q>content</q> of the post.</li>
<li>Categories stop being properly syndicated. Everything is placed in <q>Uncategorized</q> or in bizarre, mashed-up categories (only one per post) that seem to contain several category names.</li>
<li>Podcast attachments are no longer syndicated.</li>
</ul>

<p>And so on, and so forth. If you notice these problems with your feeds just after you&#8217;ve upgraded your copy of WordPress, it&#8217;s probably because you need to re-install the MagpieRSS upgrade.</p>

<h3>Cure</h3>

<p>Here&#8217;s how you do that. In the FeedWordPress plugin directory (<code>wp-content/plugins/feedwordpress/</code>, relative to your WordPress installation), there is a directory called <code>MagpieRSS-upgrade</code>, which contains, or at least at one point contained, two files, <code>rss.php</code> and <code>rss-functions.php</code>. If you still have these files, you need to copy them to your WordPress <code>wp-includes</code> directory, where they will overwrite the older version of MagpieRSS that ships with WordPress. If you do not (because, for example, you moved them rather than copying them when you first installed FeedWordPress), then you can get new copies of these files by downloading the latest version of FeedWordPress, and extracting these two files from the archive.</p>

<h3>Etiology and pognosis for the patient</h3>

<p>The reason that this happens is that every installation of WordPress includes a <em>very</em> old version of MagpieRSS, the library that FeedWordPress uses to parse the feeds that it syndicates. As of the 2.5 release, WordPress <em>still</em> ships with <a href="http://trac.wordpress.org/browser/tags/2.5/wp-includes/rss.php">a package derived from MagpieRSS 0.51</a>, which is the same version <a href="http://trac.wordpress.org/browser/tags/1.5/wp-includes/rss-functions.php">it shipped with when I started work on FeedWordPress three years ago</a>. This version of MagpieRSS is adequate for what WordPress needs it to do (basically, fetch headlines for the Dashboard from a select few feeds), but it was already outdated three years ago, and it is especially outdated now&#8211;it could not handle multiple categories; it could not handle enclosures, it could not translate feeds in alternate encodings; and, importantly, it cannot correctly handle Atom 1.0 feeds (now the default for Blogger feeds) or feeds with MediaRSS extensions (now the default for WordPress.com feeds). Unfortunately, since there <em>is</em> a version of MagpieRSS, which is loaded every time you load WordPress, it is hard to drop in a newer version which can do these things without causing errors from the collision in function and class names.</p>

<p>The solution I settled on was the bundled MagpieRSS upgrades, which in the past I sometimes described as <q>optional,</q> but which now really are mandatory if you hope to do any serious syndication in the modern environment. Users can avoid collisions by copying the upgrade so that it just <em>overwrites</em> the older version in <code>wp-includes</code>. Problem solved for the time being.</p>

<p>But the downside of this solution is that every time an upgrade of WordPress comes out, it comes out with older versions of the MagpieRSS package included, and when you overwrite all the files in wp-includes with the newer files from the WordPress release, one of the things you overwrite is your upgraded copy of <code>rss.php</code>. Meaning that, unless you remember to re-upgrade MagpieRSS every time you upgrade WordPress (something which is easy enough to forget), it breaks your syndication until you remember, or I remind you, to re-do the upgrade.</p>

<p>I frankly consider this a design flaw in FeedWordPress, but it&#8217;s not a flaw that is easy for me to fix. I am considering different ways of getting around it, and honestly the most likely solution at this point is probably simply to abandon MagpieRSS and package another feed parsing package (such as <a href="http://simplepie.org/">SimplePie</a>) in the <code>feedwordpress</code> plugin directory, where upgrades to the WordPress core code cannot interfere with it. But doing that will involve pretty dramatically refactoring some of FeedWordPress&#8217;s internal workings, and that may take a while. In the meantime, if you have a working aggregator, you should probably apply this quick fix and see how many of your problems it solves.</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/04/18/compatability-bugs-and-possible-quick-fixes-for-issues-with-feedwordpress-after-upgrading-to-wordpress-25/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Humanized History URI and directory fixed</title>
		<link>http://projects.radgeek.com/2008/03/01/humanized-history-uri-and-directory-fixed/</link>
		<comments>http://projects.radgeek.com/2008/03/01/humanized-history-uri-and-directory-fixed/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 07:22:07 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[Humanized History for WordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2008/03/01/humanized-history-uri-and-directory-fixed/</guid>
		<description><![CDATA[Thanks to some help from the folks at the WordPress Plugin Directory, the URI and the plugin directory for Humanized History for WordPress are no longer affected by my boneheaded typo. You can now review and download the plugin from the URIs that God intended, http://wordpress.org/extend/plugins/humanized-history-for-wordpress/ and http://downloads.wordpress.org/plugin/humanized-history-for-wordpress.zip. Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>Thanks to some help from the folks at the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a>, the URI and the plugin directory for Humanized History for WordPress are no longer affected by my boneheaded typo. You can now review and download the plugin from the URIs that God intended, <a href="http://wordpress.org/extend/plugins/humanized-history-for-wordpress/">http://wordpress.org/extend/plugins/humanized-history-for-wordpress/</a> and <a href="http://downloads.wordpress.org/plugin/humanized-history-for-wordpress.zip">http://downloads.wordpress.org/plugin/humanized-history-for-wordpress.zip</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/03/01/humanized-history-uri-and-directory-fixed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Humanized History 2008.02.10 released</title>
		<link>http://projects.radgeek.com/2008/02/10/humanized-history-20080210-released/</link>
		<comments>http://projects.radgeek.com/2008/02/10/humanized-history-20080210-released/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 18:07:25 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[Humanized History for WordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2008/02/10/humanized-history-20080210-released/</guid>
		<description><![CDATA[Version 2008.02.10 of Humanized History for WordPress is now available for download.

This release fixes a bug in the initial release, version 2007.10.08, which could cause the plugin to insert inappropriate HTML code into your blog&#8217;s feeds (thus making them invalid Atom or RSS) under certain conditions.

It is also the first public release of Humanized History [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://downloads.wordpress.org/plugin/humanized-history-for-feedwordpress.2008.02.10.zip">Version 2008.02.10 of Humanized History for WordPress is now available for download.</a></p>

<p>This release fixes a bug in the initial release, version 2007.10.08, which could cause the plugin to insert inappropriate HTML code into your blog&#8217;s feeds (thus making them invalid Atom or RSS) under certain conditions.</p>

<p>It is also the first public release of Humanized History to be <a href="http://wordpress.org/extend/plugins/humanized-history-for-feedwordpress/">listed in the WordPress Plugins Directory</a> and hosted in the <a href="http://wp-plugins.org/">WordPress Plugins Repository</a>. This has required a bit of re-arranging in plugin files; if you notice anything that seems amiss, let me know.</p>

<p>Incidentally, the current URI for my plugin, <a href="http://wordpress.org/extend/plugins/humanized-history-for-feedwordpress/">http://wordpress.org/extend/plugins/humanized-history-for-feedwordpress/</a>, is the result of making a typo in the process of applying for the hosting. I have written in to the Repository administrators to get it fixed to what it should be, <a href="http://wordpress.org/extend/plugins/humanized-history-for-wordpress/">http://wordpress.org/extend/plugins/humanized-history-for-wordpress/</a>. I don&#8217;t know how long it will take to get it fixed. But in any case, in the meantime, I&#8217;ll just say here that, in spite of the URI, my plugin has nothing in particular to do with <a href="http://projects.radgeek.com/feedwordpress/">FeedWordPress</a>, except in that they are both written by the same author. You can happily use Humanized History without FeedWordPress, or FeedWordPress without Humanized History, or both together at the same time, as you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/02/10/humanized-history-20080210-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FeedWordPress 0.992: author remapping and URI bug fix</title>
		<link>http://projects.radgeek.com/2008/02/04/feedwordpress-0992-author-remapping-and-uri-bug-fix/</link>
		<comments>http://projects.radgeek.com/2008/02/04/feedwordpress-0992-author-remapping-and-uri-bug-fix/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 02:42:40 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2008/02/04/feedwordpress-0992-author-remapping-and-uri-bug-fix/</guid>
		<description><![CDATA[FeedWordPress 0.992 is now available for download.

Since I&#8217;ve had to spend time either traveling or working on other projects, it&#8217;s been longer than I would have liked since the last update of FeedWordPress. This release is a rather limited one: it fixes one outstanding bug and adds one major new feature:


BUG RELATED TO URIS CONTAINING [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/feedwordpress/feedwordpress.0.992.zip">FeedWordPress 0.992 is now available for download.</a></p>

<p>Since I&#8217;ve had to spend time either traveling or working on other projects, it&#8217;s been longer than I would have liked since the last update of FeedWordPress. This release is a rather limited one: it fixes one outstanding bug and adds one major new feature:</p>

<ol>
<li><p><strong>BUG RELATED TO URIS CONTAINING AMPERSAND CHARACTERS FIXED:</strong> A bug in
WordPress 2.x&#8217;s handling of URIs in Blogroll links created problems for
updating any feeds whose URIs included an ampersand character, such as
Google News RSS feeds and other feeds that have multiple parameters
passed through HTTP GET. If you experienced this bug, the most likely
effect was that FeedWordPress simply would not import new posts from a
feed when instructred to do so, returning a &#8220;0 new posts&#8221; response. In
other cases, it might lead to unpredictable results from feed updates,
such as importing posts which were not contained in the feed being
syndicated, but which did appear elsewhere on the same website. This bug
has, hopefully, been resolved, by correcting for the bug in WordPress.</p></li>
<li><p><strong>NEW FEATURE - AUTHOR RE-MAPPING:</strong> I&#8217;ve been promising this one to my e-mail 
correspondents for a couple of months now; and I&#8217;m happy to announce that I&#8217;ve been able to polish
up the preliminary implementation that I was working on late last year and make it ready for general
consumption. FeedWordPress now offers a new feature in the site-wide Syndication Options 
(Syndication &#8211;> Options), and in the settings for each syndicated feed (Syndication &#8211;> Syndicated
Sites &#8211;> Edit). You can now create re-mapping rules to determine how author names in a feed are
translated into usernames within the WordPress database.</p>

<p>Traditionally, what FeedWordPress has done, when adding a post, is to take the author information
from the feed and search the WordPress database to determine whether there is a username with
the same name or e-mail address. If it found a match, then the new post would be assigned to that
user. If there was no match, then FeedWordPress would consult the settings for the feed, or the 
global default settings, for what to do with an <q>unfamiliar author.</q> These could be set by the
administrator from within the WordPress Dashbard, with three options: (1) create a new user 
account with the same name as the author, and assign the new post to that new user; (2) filter out
the post rather than adding it to the database; or (3) assign the new post to a default user (user #1
in the WordPress database, i.e. the site administrator).</p>

<p>With the new re-mapping feature, you have considerably more control over what FeedWordPress 
does with post authorship data from the feed. In the settings for each syndicated feed (Syndication
&#8211;> Syndicated Sites &#8211;> Edit), you can now define rules that tell FeedWordPress what to do with
each particular author name on that feed &#8212; to filter out all posts by that author, or to assign posts
by that author to any username that you like. You can also tell FeedWordPress what to do with
usernames that aren&#8217;t listed in your rules, and which don&#8217;t match any of the users already in the
WordPress database &#8212; to filter out the posts, or to assign them to any username you like, or to 
create a new username to match the new author, or to follow the default setting for new author
names on all feeds. The site-wide default setting can be changed using Options &#8211;> Syndication.</p>

<p>So, for example, one of my friends runs a FeedWordPress aggregator site that syndicates
<a href="http://praxeology.net/blog/feed/">http://praxeology.net/blog/feed/</a>. The problem is that, like an increasing number of WordPress 
blogs out there, all the posts on this blog are attributed to <q>Administrator.</q> For those visiting 
the blog directly, it&#8217;s clear that <q>Administrator</q> is the blogger; but when someone aggregates 
the blog on another website, the naming now mistakenly implies that the Administrator of the 
<em>aggregator</em> website is the author of the post. (It also means that if two or more blogs both 
attribute their posts to <q>Administrator,</q> the aggregator site will mistakenly treat all of the 
posts from all of those blogs as being by the same author.) With the new re-mapping feature, you 
could now define a rule that would attribute posts by <q>Administrator</q> from the praxeology.net 
feed to a different username &#8212; in this case, <q>Roderick Long.</q> Problem solved. Huzzah!</p></li>
</ol>

<p>One more note before I go. I regret that I haven&#8217;t been able to develop FeedWordPress more actively than I currently am developing it, or to spend as much time handling and responding to bug reports as I would like. I originally created FeedWordPress for my own use, and made it available to others in the hope that it would be useful, so the best guarantee of getting a feature added or a bug identified and quickly fixed has always been whether it&#8217;s one that I personally encountered, or one of my friends encountered, in the course of using it. But I&#8217;m really very pleased with how much uptake and interest there has been for FeedWordPress. Ideally I would like to devote much more time to FeedWordPress development and support than I currently do. But I earn my living freelance, by the hour or by the project, and I do have to pay my rent every month, so the only way that I can keep up with this on more than a limited and casual basis is if the donations from FeedWordPress users allow me to free up the time needed to work on FeedWordPress, rather than spending the same time looking for paying gigs.</p>

<p>So, if you would like to see more regular upgrades and bugfixes, and more rapid replies to your support questions, I&#8217;d urge you to consider how much ongoing development and support for FWP is worth to you, and consider making a contribution through the project donation jar at <a href="http://projects.radgeek.com/feedwordpress/">http://projects.radgeek.com/feedwordpress/</a>. It&#8217;s in your hands, and anything you can offer will help. (If I had $5 for everyone who ever sent me a FeedWordPress tech support question, I&#8217;d be flush for the next several years&#8230;.)</p>

<p>Thanks,<br />
-C</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2008/02/04/feedwordpress-0992-author-remapping-and-uri-bug-fix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FeedWordPress 0.991: bug fixes, reorganization, minor features added &#8212; and MU compatability</title>
		<link>http://projects.radgeek.com/2007/11/22/feedwordpress-0991-bug-fixes-reorganization-minor-features-added-and-mu-compatability/</link>
		<comments>http://projects.radgeek.com/2007/11/22/feedwordpress-0991-bug-fixes-reorganization-minor-features-added-and-mu-compatability/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 07:35:46 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2007/11/22/feedwordpress-0991-bug-fixes-reorganization-minor-features-added-and-mu-compatability/</guid>
		<description><![CDATA[FeedWordPress 0.991 is now available for download.

Version 0.991 fixes some bugs that were present in version 0.99, adds a couple of minor features, reorganizes the file structure of the archive, and adds one very significant change. Let&#8217;s start with the significant change, which I am very happy to announce:


WORDPRESS MU COMPATABILITY: FeedWordPress should now be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/feedwordpress/feedwordpress.0.991.zip">FeedWordPress 0.991 is now available for download</a>.</p>

<p>Version 0.991 fixes some bugs that were present in version 0.99, adds a couple of minor features, reorganizes the file structure of the archive, and adds one very significant change. Let&#8217;s start with the significant change, which I am <em>very</em> happy to announce:</p>

<ul>
<li><strong>WORDPRESS MU COMPATABILITY:</strong> FeedWordPress should now be compatible with
recent releases of WordPress MU. Once FeedWordPress is made available
as a plugin, each individual blog can choose to activate FeedWordPress
and syndicate content from its own set of contributors.</li>
</ul>

<p>And now on to the bug fixes:</p>

<ul>
<li><p><strong>BUG RELATED TO INTERNATIONAL CHARACTERS IN AUTHOR NAMES FIXED:</strong> Due to a
subtle incompatability between the way that FeedWordPress generated new
user information, and the way that WordPress 2.0 and later added new
authors to the database, FeedWordPress might end up creating duplicate
authors, or throwing a critical error message, when it encountered
authors whose names included international characters. This
incompatability has now been fixed; hopefully, authors with
international characters in their names should now be handled properly.</p></li>
<li><p><strong>media:content BUG IN MAGPIERSS FIXED:</strong> A bug in MagpieRSS&#8217;s handling of
namespaced elements has been fixed. Among other things, this bug caused
items containing a Yahoo MediaRSS <code>&lt;media:content&gt;</code> element (such as
many of the feeds produced by wordpress.com) to be represented
incorrectly, with only a capital &#8220;A&#8221; where the content of the post
should have been. Feeds containing <code>&lt;media:content&gt;</code> elements should now
be syndicated correctly.</p></li>
<li><p><strong>MAGPIE WARNINGS NO LONGER DISPLAYED BY DEFAULT:</strong> A number of MagpieRSS warnings or error messages that were displayed when performing an automatic update are no longer displayed, unless debugging parameters have been explicitly enabled.</p></li>
</ul>

<p>Some minor bugs in the administrative interface have also been fixed.</p>

<p>I have received some feature requests concerning the new updating system that I introduced in <a href="http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/">FeedWordPress 0.99</a>. Under the old system, there was a (needlessly complicated) system for having FeedWordPress poll its feeds for updates, which could be activated with a cron script on a regular schedule, thus keeping FeedWordPress up to date. In version 0.99, I replaced this with a much simpler system, in which FeedWordPress would <em>automatically</em> poll its feeds, according to a certain schedule, when users visited your website. (Of course, a cron script could still be used to make sure that this was activated on a regular schedule.) However, some users wrote me that they preferred that visitors not have to wait for the polling to finish before the page loads. So, I&#8217;ve added an HTTP parameter which gives you the option. If you prefer not to use WordPress&#8217;s cron-less automatic updates, you can now use the <code>update_feedwordpress</code> parameter instead. Here&#8217;s how it works:</p>

<ul>
<li><p>Leave <q>Automatic Updates</q> turned off. This will ensure that FeedWordPress polls for updates only when you tell it to do so.</p></li>
<li><p>Add a line something like the following to your crontab:</p>

<pre><code>*/15 * * * * curl --silent http://www.zyx.com/blog/?update_feedwordpress=1
</code></pre>

<p>&#8230; replacing <code>http://www.zyx.com/blog/</code> with the address of the blog where FeedWordPress is installed. This line will instruct FeedWordPress to poll for updates once every 15 minutes. If you have left <q>Automatic Updates</q> off, it will <em>only</em> check for updates on the 15 minute interval.</p></li>
</ul>

<p>If you prefer the cron-less update method, then that&#8217;s still available; just go to <strong>Options &#8211;> Syndication</strong> and turn Automatic Updates on.</p>

<p>Finally, a word about the re-organization of the archive. <a href="http://wordpress.org/extend/plugins/feedwordpress/">FeedWordPress is now listed in, and hosted by, the kind folks at the WordPress Plugin Directory</a>. In line with their style guide about how to organize archives, I have moved the main plugin files &#8212; <code>feedwordpress.php</code> and <code>syndication-options.php</code> &#8212; to the root directory of the archive, and I have relocated the MagpieRSS upgrade to a subdirectory called, creatively enough, <code>MagpieRSS-upgrade</code>. However, please remember that in order to take advantage of the MagpieRSS upgrade &#8212; which you will definitely <em>want</em> to take advantage of, unless you don&#8217;t care about Atom 1.0 feeds, proper handling of multiple categories, or several bug fixes &#8212; you must still copy the contents of the <code>MagpieRSS-upgrade</code> directory to the <code>wp-includes</code> folder of your WordPress installation.</p>

<p>Enjoy, and have a wonderful Thanksgiving, y&#8217;all.</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2007/11/22/feedwordpress-0991-bug-fixes-reorganization-minor-features-added-and-mu-compatability/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Humanized History for WordPress 2007.10.08</title>
		<link>http://projects.radgeek.com/2007/10/08/humanized-history-for-wordpress-20071008/</link>
		<comments>http://projects.radgeek.com/2007/10/08/humanized-history-for-wordpress-20071008/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 20:28:49 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[Humanized History for WordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2007/10/08/humanized-history-for-wordpress-20071008/</guid>
		<description><![CDATA[A new Humanized History plugin for WordPress 2.x is now available for download.

The plugin was inspired by the points that Aza Raskin made at Humanized 2006-04-25: No More Pages?


  Of course, this page-chunking phenomenon isn&#8217;t limited to search sites. It&#8217;s used everywhere from blogs to forums, from e-commerce sites to e-mail programs. And it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>A new <a href="http://projects.radgeek.com/humanized-history-for-wordpress/">Humanized History plugin for WordPress 2.x</a> is now <a href="http://projects.radgeek.com/download/humanized-history.tar.gz">available for download</a>.</p>

<p>The plugin was inspired by the points that Aza Raskin made at <a href="http://www.humanized.com/weblog/2006/04/25/no_more_more_pages/">Humanized 2006-04-25: No More Pages?</a></p>

<blockquote>
  <p>Of course, this page-chunking phenomenon isn&#8217;t limited to search sites. It&#8217;s used everywhere from blogs to forums, from e-commerce sites to e-mail programs. And it&#8217;s surprising how often one finds oneself just giving up and going somewhere else when one has reached the end of a page.</p>
  
  <p>The problem is that every time a user is required to click to the next page, they are pulled from the world of content to the world of navigation: they are no longer thinking about what they are reading, but about about how to get more to read. Because it breaks their <a href="http://humanized.com/about/#rule5">train of thought</a> and forces them to stop reading, it gives them the opportunity to leave the site. And a lot of the time, they do.</p>
  
  <p>The take away? Don&#8217;t force the user to ask for more content: <em>just give it to them</em>.</p>
</blockquote>

<p>The <a href="http://projects.radgeek.com/humanized-history-for-wordpress/">Humanized History for WordPress</a> plugin allows you to just give it to your readers. The trick was to develop a way for the plugin to make those posts &#8212; potentially hundreds of posts stretching over several years &#8212;  <em>all available</em> to readers without making them <em>wait</em> for everything to download. (Not only would that make everyone wait for those posts to download; it would also make the website completely inaccessible for mobile devices and other alternative web platforms.) The solution to the problem was some PHP on the back end, and a little bit of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">unobtrusive JavaScript</a> on the front end, inspired by <a href="http://www.humanized.com/weblog/2006/04/28/reading_humanized/">Humanized&#8217;s implementation</a>, which work together to automatically display the older posts as you scroll down towards the bottom. That way, for users with conventional web browsers there&#8217;s always more waiting for you to read as you scroll down (at least, until you reach the earliest post). But mobile users and other people who have JavaScript turned off can still access the website the same way they already were, with no substantial change.</p>

<p>I implemented a version of this trick on a couple of other websites that I run (<a href="http://radgeek.com/gt/2007/03/19/fiddling_while/">1</a>, <a href="http://radgeek.com/gt/2007/04/01/humanitarian_interventions/">2</a>) using a bit of ugly spit-and-bailing-wire kludgery in the WordPress templates before I bothered to sit down and package it up as a plugin. But I think it&#8217;s a neat feature, and I&#8217;ve gotten a couple of requests for help in implementing it on other WordPress weblogs. Hopefully this release should make that easier to do.</p>

<p>The plugin has a couple of weak or kludgy aspects, which are probably inevitable due to certain limitations of WordPress. Be sure that you read the <a href="http://projects.radgeek.com/humanized-history-for-wordpress/install/">installation instructions</a> and the section on <a href="http://projects.radgeek.com/humanized-history-for-wordpress/templates-and-styling">templates and styling</a> carefully. To make good use of this plugin you will, unfortunately, probably need at least a passing familiarity with editing WordPress templates. </p>

<p>Let me know what you think &#8212; and whether you notice anything weird or broken. Enjoy, and scroll on!</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2007/10/08/humanized-history-for-wordpress-20071008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to deal with dates and timestamps in WordPress</title>
		<link>http://projects.radgeek.com/2007/09/25/how-to-deal-with-dates-and-timestamps-in-wordpress/</link>
		<comments>http://projects.radgeek.com/2007/09/25/how-to-deal-with-dates-and-timestamps-in-wordpress/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 23:59:33 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2007/09/25/how-to-deal-with-dates-and-timestamps-in-wordpress/</guid>
		<description><![CDATA[If I hadn&#8217;t moved across the country recently, I probably never would have discovered a bug in how FeedWordPress handles the timestamps of syndicated posts. Fortunately, I did, and this bug is fixed in the recently-released version 0.99.

To explain what I mean, I&#8217;ll have to back up a bit, first.

There are a couple things that [...]]]></description>
			<content:encoded><![CDATA[<p>If I hadn&#8217;t moved across the country recently, I probably never would have discovered a bug in how FeedWordPress handles the timestamps of syndicated posts. Fortunately, I did, and this bug is fixed in <a href="http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/">the recently-released version 0.99</a>.</p>

<p>To explain what I mean, I&#8217;ll have to back up a bit, first.</p>

<p>There are a couple things that FeedWordPress uses date and time information for:</p>

<ol>
<li><p><strong>Dating new posts:</strong> When a new post comes in over a feed, FeedWordPress uses the date and time information reported by feeds to date posts appropriately in the WordPress database. This means parsing date and time information and putting the resulting timestamps into the database.</p></li>
<li><p><strong>Checking for updates to existing posts:</strong> After a post has been imported into the WordPress database, FeedWordPress will keep checking to see whether the feed reports any updates to that post. This means comparing the last-updated timestamp on the feed to the last-updated timestamp in the database to see which version is newer.</p></li>
</ol>

<p>The problem that I noticed came about because FeedWordPress was trying to do something sensible and easy to handle <em>time zones</em> when it was doing all this. Date/time handling in WordPress is fairly easy, <em>once you understand what to do</em>, but it is certainly anything but sensible, and therein lies the problem.</p>

<p>Part of the problem is, as usual, the stack of programs on top of which FeedWordPress has to sit. In order to get dates from the feed, FeedWordPress has to process two different human-readable date formats. RSS feeds use <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a> (or something like it), which FeedWordPress can convert to a Unix timestamp using the PHP <a href="http://us.php.net/strtotime"><code>strtotime()</code></a> function. Atom feeds use the <a href="http://www.w3.org/TR/NOTE-datetime">W3C DateTime Format</a>, which FeedWordPress can convert to a Unix timestamp using a custom function provided by MagpieRSS, called <code>parse_w3cdtf()</code>. Unix timestamps supposedly do not vary by time zone: a Unix timestamp for a particular time is defined as the number of seconds between that time and 12:00 midnight on January 1, 1970 <em>Greenwich Mean Time</em>. So both <code>strtotime()</code> and <code>parse_w3cdtf()</code> make use of the time zone data provided by the format that they handle, and use it to convert the date-time information to a timestamp based on GMT.</p>

<p>So far so good. Now, when converting a syndicated item into a post for the WordPress database, FeedWordPress has to generate <em>four</em> different timestamps: <code>post_date</code>, which gives the date and time that the post was first published <em>in the local time zone</em>; <code>post_date_gmt</code>, which gives the date and time that the post was first published <em>in Greenwich Mean Time</em>; <code>post_modified</code>, which gives the <em>local</em> date and time that the post was last modified; and <code>post_modified_gmt</code>, which gives the <em>GMT</em> date and time that the post was last modified. These fields are stored in the WordPress database as <a href="http://dev.mysql.com/doc/refman/5.0/en/datetime.html">MySQL DATETIME objects</a>. WordPress later converts them back into Unix timestamps whenever it is necessary for formatting purposes. Here is how I did this in version 0.981:</p>

<pre><code>$post['post_date'] = date('Y-m-d H:i:s',
    (!is_null($post['epoch']['issued'])
    ? $post['epoch']['issued']
    : $post['epoch']['modified']));
$post['post_modified'] = date('Y-m-d H:i:s',
    $post['epoch']['modified']);
$post['post_date_gmt'] = gmdate('Y-m-d H:i:s',
    (!is_null($post['epoch']['issued'])
    ? $post['epoch']['issued']
    : $post['epoch']['modified']));
$post['post_modified_gmt'] = gmdate('Y-m-d H:i:s',
    $post['epoch']['modified']);
</code></pre>

<p>The <code>$post['epoch']</code> array contains the Unix timestamps that FeedWordPress got from the feed. The PHP <a href="http://us3.php.net/manual/en/function.date.php"><code>date()</code></a> function formats a Unix timestamp relative to the local time zone. The <a href="http://us3.php.net/manual/en/function.gmdate.php"><code>gmdate()</code></a> function formats it relative to Greenwich Mean Time. Given that I need local and Greenwich representations of the date and time that the post was first published, and of the date and time that the post was last updated, this seems like the sensible thing to do. But in spite of (or because of) its seeming so sensible, this way of generating post timestamps introduces a subtle bug. More on that later.</p>

<p>When determining whether or not a post has been updated, FeedWordPress uses two items of information: the last-updated date and time provided by the feed, and the last-updated date and time stored in the database. In order to get these two dates into a common format so that they can be compared, FeedWordPress  uses either <code>strtotime()</code> or <code>parse_w3cdtf()</code> to convert the feed&#8217;s last-updated date and time to a Unix timestamp, and it uses the MySQL function <a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp"><code>UNIX_TIMESTAMP()</code></a> to get a Unix timestamp from the  last-updated date and time in the database. So here is how I did this in version 0.981:</p>

<pre><code>    $guid = $post['guid'];
    $result = $wpdb-&gt;get_row("
    SELECT id, guid, UNIX_TIMESTAMP(post_modified) AS modified
    FROM $wpdb-&gt;posts WHERE guid='$guid'
    ");

    if (!$result) :
        $freshness = 2; // New content
    elseif ($post['epoch']['modified'] &gt; $result-&gt;modified) :
        $freshness = 1; // Updated content
    else :
        $freshness = 0;
    endif;
</code></pre>

<p><code>strtotime()</code> and <code>parse_w3cdtf()</code> take account of time zone data; <code>UNIX_TIMESTAMP()</code> presumes that the time is in the local time zone. So, I just need to feed it the DATETIME object that&#8217;s in the local time zone &#8212; <code>post_modified</code> instead of <code>post_modified_gmt</code>, right? Wrong. Again, in spite of (or because of) its seeming so sensible, this way of comparing timestamps introduces a subtle bug.</p>

<p>Here&#8217;s what was wrong with both of these sensible steps: <strong>in any given WordPress installation, there are <em>three</em> potentially distinct <q>local time zones</q> that you have to consider</strong>:</p>

<ol>
<li><p>The local time zone of the web server on which WordPress is running (usually set by the web server&#8217;s administrator);</p></li>
<li><p>The local time zone of the MySQL server that provides the WordPress database (usually set by the MySQL server&#8217;s administrator);</p></li>
<li><p>The local time zone set by the user in WordPress&#8217;s <q>General Options</q> page (set by the blog owner);</p></li>
</ol>

<p>If any of these differ from each other, then the mismatch could cause problems for the way that older versions of FeedWordPress handled dates.</p>

<p>When the PHP date and time functions convert back and forth between human-readable formats and Unix time stamps, they do so relative to the web server&#8217;s local time zone. When MySQL converts a DATETIME object to a Unix timestamp, it does so relative to the MySQL server&#8217;s local time zone. When WordPress prepares dates and times for storage in the database, or processes them for sorting and displaying posts, it does so relative to WordPress&#8217;s local time zone, as set under General Options.</p>

<p>So, when FeedWordPress used the PHP date and time functions to generate <code>post_date</code> and <code>post_modified</code>, it used <em>the wrong time zone</em> &#8212; WordPress expects these to be local times <em>in the time zone set under General Options</em>, but the PHP functions use the <em>web server&#8217;s</em> local time zone. If the user has set a different time zone from the web server&#8217;s default time zone, then this date and time information will be incorrect. In order to get the <em>correct</em> time, we need to get the time zone information from the WordPress database, and then manually apply that offset, rather than leaning on PHP&#8217;s date and time functions. So here is how we do this task in FeedWordPress 0.99:</p>

<pre><code>// Dealing with timestamps in WordPress is so fucking fucked.
$offset = (int) get_option('gmt_offset') * 60 * 60;
$this-&gt;post['post_date'] =
    gmdate('Y-m-d H:i:s', $this-&gt;published() + $offset);
$this-&gt;post['post_modified'] =
    gmdate('Y-m-d H:i:s', $this-&gt;updated() + $offset);
$this-&gt;post['post_date_gmt'] =
    gmdate('Y-m-d H:i:s', $this-&gt;published());
$this-&gt;post['post_modified_gmt'] =
    gmdate('Y-m-d H:i:s', $this-&gt;updated());
</code></pre>

<p>Note that we use <code>gmdate()</code> in all cases, because we are doing the time zone offset manually rather than letting PHP do it for us.</p>

<p>On the other hand, when FeedWordPress used the MySQL date and time functions to convert MySQL DATETIME objects to Unix timestamps, it used the wrong time zone again &#8212; since it was using <code>post_modified</code>, and in the older versions of FeedWordPress <code>post_modified</code> was generated using PHP date and time functions, the time was a local time relative to the <em>web server&#8217;s</em> time zone. But <code>UNIX_TIMESTAMP()</code> presumes that the time it is given is a local time relative to the <em>MySQL server&#8217;s</em> time zone. Usually this difference should cause no problem, since the web server and the MySQL server are the same machine, or if not the same machine, at least machines that are located in the same place as one another. But if that assumption ever fails, <code>UNIX_TIMESTAMP()</code> will return the wrong time&#8211;a time that is either a few hours before, or a few hours after, the real last-updated time. Which will mean that posts either get updated when there&#8217;s nothing new to update, or don&#8217;t get updated even when there is something new to include.</p>

<p>So we need to convert the MySQL DATETIME value to a Unix timestamp in a context where we know, and can set, the right time zone for the conversion. In this case, the best thing to do is to get the <em>GMT</em> date and time of the last update (in order to avoid issues that might arise from changes in the local timezone setting in WordPress), and then manually convert that into a Unix timestamp using a function that works relative to GMT. So here&#8217;s how FeedWordPress 0.99 checks the update times against each other:</p>

<pre><code>$guid = $wpdb-&gt;escape($this-&gt;guid());

$result = $wpdb-&gt;get_row("
SELECT id, guid, post_modified_gmt
FROM $wpdb-&gt;posts WHERE guid='$guid'
");

preg_match('/([0-9]+)-([0-9]+)-([0-9]+) ([0-9]+):([0-9]+):([0-9]+)/',
    $result-&gt;post_modified_gmt, $backref);
$updated = gmmktime($backref[4], $backref[5], $backref[6],
    $backref[2], $backref[3], $backref[1]);
if (!$result) :
    $this-&gt;_freshness = 2; // New content
elseif ($this-&gt;updated() &gt; $updated) :
    $this-&gt;_freshness = 1; // Updated content
    $this-&gt;_wp_id = $result-&gt;id;
else :
    $this-&gt;_freshness = 0; // Same old, same old
    $this-&gt;_wp_id = $result-&gt;id;
endif;
</code></pre>

<p><code>post_modified_gmt</code> always returns the string representation of a MySQL DATETIME object; the regular expression breaks that representation down into its component parts; and the PHP function <a href="http://us3.php.net/gmmktime"><code>gmmktime()</code></a> reassembles those parts into a Unix timestamp. (You might worry that using the PHP date and time functions might reintroduce the first problem, since it doesn&#8217;t account for the local time zone set in WordPress. But since everything is guaranteed to be in GMT, this problem doesn&#8217;t arise.)</p>

<p>Strictly speaking, it would probably be better to use MySQL functions, instead of a regular expression, to extract the parts of the MySQL DATETIME object, since ostensibly MySQL knows more about its internal formats than PHP does. In practice this is not likely to make a difference, but it&#8217;s likely that in future releases of FeedWordPress I&#8217;ll change the section to something more like this:</p>

<pre><code>$guid = $wpdb-&gt;escape($this-&gt;guid());

$result = $wpdb-&gt;get_row("
SELECT
    id, guid,
    YEAR(post_modified_gmt) AS year,
    MONTH(post_modified_gmt) AS month,
    DAYOFMONTH(post_modified_gmt) AS day, 
    HOUR(post_modified_gmt) AS hour,
    MINUTE(post_modified_gmt) AS minute,
    SECOND(post_modified_gmt) AS second
FROM $wpdb-&gt;posts WHERE guid='$guid'
");

if (!$result) :
    $this-&gt;_freshness = 2; // New content
else:
    $updated = gmmktime(
        $result-&gt;hour, $result-&gt;minute, $result-&gt;second,
        $result-&gt;month, $result-&gt;day, $result-&gt;year
    );
    if ($this-&gt;updated() &gt; $updated) :
        $this-&gt;_freshness = 1; // Updated content
        $this-&gt;_wp_id = $result-&gt;id;
    else :
        $this-&gt;_freshness = 0; // Same old, same old
        $this-&gt;_wp_id = $result-&gt;id;
    endif;
endif;
</code></pre>

<p>Oh, and in case you were wondering, the reason that <a href="http://www.alek.com/worldguide/north-america/united-states/transport/" style="color: #000; text-decoration: none; ">moving across the country</a> helped me find this out is that I moved from Eastern Time to Pacific Time, and I changed the default time zone on one of my web servers before I changed the default time zone on my MySQL server. The mismatch exposed this bug while I was doing testing for <a href="http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/">the most recent release of FeedWordPress</a>. Not particularly interesting, but it did expose a bug to fix, and I hope the guide to time zone issues that resulted may be of some interest.</p>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2007/09/25/how-to-deal-with-dates-and-timestamps-in-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FeedWordPress 0.99 is hereby released; enjoy WordPress 2.2 and 2.3 compatability, bug fixes, major new features, and updates without cron</title>
		<link>http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/</link>
		<comments>http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 01:05:49 +0000</pubDate>
		<dc:creator>Rad Geek</dc:creator>
		
		<category><![CDATA[FeedWordPress]]></category>

		<guid isPermaLink="false">http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/</guid>
		<description><![CDATA[
Update 2007-11-21: FeedWordPress 0.99 is now out of date. You can download the latest release &#8212; 0.991 at the time of this writing &#8212; from the project homepage.


The public (non-beta) release of FeedWordPress version 0.99 is now available for download.

There have been changes to the way that FeedWordPress&#8217;s code is organized since version 0.98. If [...]]]></description>
			<content:encoded><![CDATA[<div class="note">
<p><strong>Update 2007-11-21:</strong> FeedWordPress 0.99 is now out of date. You can download the latest release &#8212; 0.991 at the time of this writing &#8212; from <a href="http://projects.radgeek.com/feedwordpress/">the project homepage</a>.</p>
</div>

<p><a href="http://projects.radgeek.com/download/feedwordpress-0.99.tar.gz">The public (non-beta) release of <strong>FeedWordPress version 0.99</strong> is now available for download.</a></p>

<p>There have been changes to the way that FeedWordPress&#8217;s code is organized since version 0.98. If you successfully installed either of the beta releases, you don&#8217;t need to do anything special to install the current release. However, if you are upgrading from version 0.98 or before, be sure to see the <strong>installation instructions</strong> below.</p>

<h3>Changes since version 0.98</h3>

<p>This release provides compatibility with WordPress 2.2 and 2.3. It has been extensively tested against WordPress version 2.2.3 and the version 2.3 release candidate. I think that all the compatibility issues have been hammered out; of course, if you notice any problems, please let me know and I&#8217;ll get on a bugfix as soon as possible.</p>

<p>Version 0.99 also includes an overhaul to the user interface, some significant new features, and a number of bug fixes:</p>

<ul>
<li><p><strong>AUTOMATIC UPDATES WITHOUT CRON:</strong> FeedWordPress now allows you to
automatically schedule checks for new posts without using external task
scheduling tools such as cron. In order to enable automatic updates, go
to <strong>Syndication &#8211;> Options</strong> and set &#8220;Check for new posts&#8221; to
&#8220;automatically.&#8221; When this option is turned on, FeedWordPress will check for new posts 
automatically (1) when someone views your page, (2) if it has been ten minutes (or 
whatever interval you set) since the last time someone viewed your page. This offers a 
way to keep FeedWordPress up-to-date without having to schedule a cron script. It also
simplifies the process of updating if you do choose to use a cron script &#8212; just have curl 
fetch your home page on a fixed schedule (so, for example, I would execute
<code>curl http://feministblogs.org/</code> every 15 minutes to keep Feminist Blogs up-to-date).
Note that this is not the same thing as precisely scheduled updates &#8212; at a minimum, 
FeedWordPress will not check for new posts unless and until the next time somebody 
views your page. But for practical purposes it does allow you to keep your aggregator 
updated without having to run cron, and it is as close to precisely scheduled updates as 
you can get without using real scheduling tools such as cron.</p>

<p>An important side-effect of the changes to the update system is that if
you were previously using the cron job and the <code>update-feeds.php</code> script
to schedule updates, you need to change your cron set-up. The old
<code>update-feeds.php</code> script no longer exists. Instead, if you wish to use
a cron job to guarantee updates on a particular schedule, you should
have the cron job fetch the front page of your blog (for example, by
using <code>curl http://www.zyx.com/blog/ &gt; /dev/null</code>) instead of activating
the <code>update-feeds.php</code> script. If automatic updates have been enabled,
fetching the front page will automatically trigger the update process.</p></li>
<li><p><strong>INTERFACE REORGANIZATION:</strong> All FeedWordPress functions are now located
under a top-level &#8220;Syndication&#8221; menu in the WordPress Dashboard. To
manage the list of syndicated sites, manually check for new posts on
one or more feeds, or syndicate a new site, you should use the main page
under <strong>Syndication</strong>. To change global settings for FeedWordPress,
you should use <strong>Syndication &#8211;> Options</strong>.</p></li>
<li><p><strong>FILE STRUCTURE REORGANIZATION:</strong> Due to a combination of changing styles
for FeedWordPress plugins and lingering bugs in the FeedWordPress admin
menu code, the code for FeedWordPress is now contained in two different
PHP files, which should be installed together in a subdirectory of your
plugins directory named <code>feedwordpress</code>. (See README.text for
installation and upgrade instructions relating to the change.)</p></li>
<li><p><strong>MULTIPLE CATEGORIES SETTING:</strong> Some feeds use non-standard methods to
indicate multiple categories within a single category element. (The most
popular site to do this is del.icio.us, which separates tags with a
space.) FeedWordPress now allows you to set an optional setting, for any
feed which does this, indicating the character or characters used to
divide multiple categories, using a Perl-compatible regular expression.
(In the case of del.icio.us feeds, FeedWordPress will automatically use
\s for the pattern without your having to do any further configuration.)
To turn this setting on, simply use the &#8220;Edit&#8221; link for the feed that
you want to turn it on for.</p></li>
<li><p><strong>REGULAR EXPRESSION BUG FIXED:</strong> Eliminated a minor bug in the regular
expressions for e-mail addresses (used in parsing RSS <code>author</code>
elements), which could produce unsightly error messages for some users
parsing RSS 2.0 feeds.</p></li>
<li><p><strong>DATE / UPDATE BUG FIXED:</strong> A bug in date handling was eliminated that may
have caused problems if any of (1) WordPress, or (2) PHP, or (3) your
web server, or (4) your MySQL server, has been set to use a different
time zone from the one that any of the others is set to use. If
FeedWordPress has not been properly updating updated posts, or has been
updating posts when there shouldn&#8217;t be any changes for the update, this
release may solve that problem.</p></li>
<li><p><strong>GOOGLE READER BUGS FIXED:</strong> A couple of bugs that made it difficult for
FeedWordPress to interact with Google Reader public feeds have been
fixed. Firstly, if you encountered an error message reading &#8220;There was a
problem adding the newsfeed. [SQL: ]&#8221; when you tried to add the feed,
the cause of this error has been fixed. Secondly, if you succeeded in
getting FeedWordPress to check a Google Reader feed, only to find that
the title of posts had junk squashed on to the end of them, that bug
has been fixed too. To fix this bug, you must install the newest version
of the optional MagpieRSS upgrade.</p></li>
<li><p><strong>FILTER PARAMETERS:</strong> Due to an old, old bug in WordPress 1.5.0 (which was
what was available back when I first wrote the filter interface),
FeedWordPress has traditionally only passed one parameter to
syndicated<em>item and syndicated</em>post filters functions &#8212; an array
containing either the Magpie representation of a syndicated item from
the feed, or the database representation of a post about to be inserted
into the WordPress database. If you needed information about the feed
that the item came from, this was accessible only through a pair of
global variables, $fwp<em>channel and $fwp</em>feedmeta.</p>

<p>Since it&#8217;s been a pretty long time since WordPress 1.5.0 was in
widespread usage, I have gone ahead and added an optional second
parameter to the invocation of the syndicated<em>item and syndicated</em>post
filters. If you have written a filter for FeedWordPress that uses either
of these hooks, you can now register that filter to accept 2 parameters.
If you do so, the second parameter will be a SyndicatedPost object,
which, among other things, allows you to access information about the
feed from which an item is syndicated using the $post->feed and the
$post->feedmeta elements (where $post is the name of the second
parameter).</p>

<p>NOTE THAT THE OLD GLOBAL VARIABLES ARE STILL AVAILABLE, for the time
being at least, so existing filters will not break with the upgrade.
They should be considered deprecated, however, and may be eliminated in
the future.</p></li>
<li><p><strong>FILTER CHANGE / BUGFIX:</strong> the array that is passed as the first argument
syndicated<em>post filters no longer is no longer backslash-escaped for
MySQL when filters are called. This was originally a bug, or an
oversight; the contents of the array should only be escaped for the
database <em>after</em> they have gone through all filters. IF YOU HAVE WRITTEN
ANY syndicated</em>post FILTERS THAT PRESUME THE OLD BEHAVIOR OF PASSING IN
STRINGS THAT ARE ALREADY BACKSLASH-ESCAPED, UPDATE YOUR FILTERS
ACCORDINGLY.</p></li>
<li><p><strong>OTHER MINOR BUGFIXES AND INTERNAL CHANGES:</strong> The internal architecture of
FeedWordPress has been significantly changed to make the code more
modular and clean; hopefully this should help reduce the number of
compatibility updates that are needed, and make them easier and quicker
when they are needed.</p></li>
</ul>

<h3>Installation instructions</h3>

<p>To <em>upgrade</em> an existing installation of FeedWordPress to version 0.99:</p>

<ol>
<li><p>Download the FeedWordPress archive in zip or gzipped tar format and
extract the files on your computer. </p></li>
<li><p>If you are upgrading from <strong>version 0.98 or earlier</strong>, then you need to
create a new directory named <code>feedwordpress</code> in the <code>wp-content/plugins</code>
directory of your WordPress installation, and you also need to <em>delete</em>
your existing <code>wp-content/update-feeds.php</code> and
<code>wp-content/plugins/feedwordpress.php</code> files. The file structure for
FeedWordPress has changed and the files from your old version will not
be overwritten, which could cause conflicts if you leave them in place.</p></li>
<li><p>Upload the new PHP files to <code>wp-content/plugins/feedwordpress</code>,
overwriting any existing FeedWordPress files that are there. Also be
sure to upgrade <code>wp-includes/rss.php</code> and
<code>wp-includes/rss-functions.php</code> if you use the optional MagpieRSS
upgrade, or don&#8217;t use it yet but do want to syndicate Atom 1.0 feeds.</p></li>
<li><p>If you are upgrading from <strong>version 0.96 or earlier</strong>, <strong>immediately</strong> log
in to the WordPress Dashboard, and go to Options &#8211;> Syndicated. Follow
the directions to launch the database upgrade procedure. The new
versions of FeedWordPress incorporate some long-needed improvements, but
old meta-data needs to be updated to prevent duplicate posts and other
possible maladies. If you&#8217;re upgrading an existing installation, updates
and FeedWordPress template functions <em>will not work</em> until you&#8217;ve done
the upgrade. Then take a coffee break while the upgrade runs. It should,
hopefully, finish within a few minutes even on relatively large
databases.</p></li>
<li><p>If you are upgrading from <strong>version 0.98 or earlier</strong>, note that the old
<code>update-feeds.php</code> has been eliminated in favor of a (hopefully) more
humane method for automatic updating. If you used a cron job for
scheduled updates, it will not work anymore, but there is another,
simpler method which will. See <a href="http://projects.radgeek.com/feedwordpress/install/#setting-up-feed-updates">Setting Up Feed Updates</a> to get
scheduled updates back on track.</p></li>
<li><p>Enjoy your new installation of FeedWordPress.</p></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://projects.radgeek.com/2007/09/24/feedwordpress-099-is-hereby-released-enjoy-wordpress-22-and-23-compatability-bug-fixes-major-new-features-and-updates-without-cron/feed/</wfw:commentRss>
		</item>
	<div id="pager-links">
<ul class="navigation">
<li class="prev" id="pager-prev-link"><a href="http://projects.radgeek.com/feed/page/2/">&laquo; older posts</a></li>
<li class="next" id="pager-next-link"></li>
</ul>
</div>
</channel>
</rss>
