22 April 2009 - 7:13pmVersion 0.3
I’ve just released version 0.3 of the Google Calendar Feed Parser. This update was a quick one but definitely deserved a new version number. Since I wrote the plugin I’ve received feedback from many users indicating that PHP’s file_get_contents() would not work on their hosting provider. A few of these users posted alternative code that used cURL instead and that fixed the problem for everyone. Today, the author of onigoetz.ch left this comment on my blog about some work he did to the plugin. Specifically, he mentioned a function called wp_remote_get(). I wasn’t able to find that function in the documentation for WordPress, but searching for it led me to what I think he may have meant: a function called wp_remote_fopen(). This is essentially a wrapper function for retrieving the contents of a file from a URL and will first try using fopen() and, if that fails, fall back on using cURL.
I’ve updated the code to use that function which should come as a relief to many who were forced to hack at the plugin’s code to get it to work on their hosting provider. A big thanks to onigoetz.ch for making me aware of that function!