Google Calendar Events, 0.5

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’s a brief overview of the new stuff:


Event Display Builder

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.

I won’t go into too much depth here, as I’ve written an extensive guide, with examples, on how to use the feature. Some of the things that are now possible, that were previously difficult / impossible, are listed below:

  • Handling of all-day events – Previously, you couldn’t differentiate between all-day and normal events, so start and end times for all-day events would be displayed as ’12:00 am’, which could be confusing. Now, using the [if-all-day] and [if-not-all-day] shortcodes in the event display builder, you could display something like ‘All day’ rather than the start / end times for all-day events, whilst still showing the start / end times for ‘normal’ events.
  • HTML and Markdown parsing – 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 html 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 markdown attribute. Thanks go to James Hicks for the Markdown stuff.
  • Greater control over the markup – 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 [feed-id] shortcode.

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 comments below, or here.


Flexible Event Retrieval Date Range

Previously, the date ranges you could specify for retrieval of events from a feed were very limiting. You could retrieve from 00:00 ‘today’, or from the beginning of the month, but that’s it. With the new ‘Retrieve events from’ and ‘Retrieve events until’ settings you have much greater control over the date range.

The options you can choose from are as follows:

  • Now
  • 00:00 today
  • Start of current week
  • Start of current month
  • End of current month
  • The beginning of time (Retrieve from only)
  • The end of time (Retrieve until only)
  • Specific date / time

However, you can also specify an offset, in seconds, to the above options (except for the last three), allowing a lot of flexibility. Here’s a few examples:

  • Date range required:All of time!
    • Retrieve events from: The beginning of time
    • Retrieve events until: The end of time
  • Date range required:The past
    • Retrieve events from: The beginning of time
    • Retrieve events until: Now
  • Date range required:The future
    • Retrieve events from: Now
    • Retrieve events until: The end of time
  • Date range required:Today
    • Retrieve events from: 00:00 today
    • Retrieve events until: 00:00 today, with an offset of 86400
  • Date range required:This week
    • Retrieve events from: Start of current week
    • Retrieve events until: Start of current week, with an offset of 604800
  • Date range required:Last week
    • Retrieve events from: Start of current week, with an offset of -604800
    • Retrieve events until: Start of current week
  • Date range required:The past 12 hours and the next 12 hours
    • Retrieve events from: Now, with an offset of -43200
    • Retrieve events until: Now, with an offset of 43200
  • Date range required:April 2011
    • Retrieve events from: Specific date / time (1301616000)
    • Retrieve events until: Specific date / time (1304208000)

These are just a few ideas, there’s lots of other possibilities too.


Custom Error Message

These are the two main error messages that the plugin displays if something has gone wrong:

The following feeds were not parsed successfully: 1. Please check that the feed URLs are correct and that the feeds have public sharing enabled.

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.

You probably don’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.


You can upgrade to this version of the plugin through your WordPress admin, or by downloading from the WordPress plugin directory.

Many thanks to those that downloaded and tested the beta of version 0.5!

As always, any feedback is greatly appreciated. Add a comment below, or on the plugin homepage, or send me an email via the contact form.

48 Responses

  1. Hi, I believe I’ve found a bug in 0.5
    If current month has no events and the user navigates to next month in widget calendar, he can no longer navigate back to current month.

    Reply
  2. When entering a calendar XML url from from Google into a feeds URL field, “https://” is reduced to “http://” causing the plugin to incorrectly display calendar entries.

    Is there a way to revert to the previous version of the plugin?

    Reply
  3. Ross, I updated to the newest version and got no widget calendar, but the following:

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1218828 bytes) in /home/content/99/6576099/html/wp-includes/functions.php on line 1007

    Yikes! What do I do now? Is it possible to revert to the old plugin?

    Thanks, Jim

    Reply
  4. I get this error when I try to active on my wordpress site

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /homepages/33/d247427820/htdocs/durhambiker/wp-content/plugins/google-calendar-events/inc/gce-parser.php on line 150

    Reply
  5. Hi Ross,
    I still can’t get a widget to work following upgrading to version 0.5. I deactivated it, deleted it, and uploaded version 4.1 as you instructed. NO small widget calendar appears on pages though. Curiously all the settings of the old install remain. Am I not deleting the old plugin thoroughly enough?

    Reply
  6. I’ve tried deleting and reinstalling several times. With zipped and unzipped versions. I’ve checked the server to make sure nothing remained after deleting, too. No luck.

    Reply
  7. I was surprised to find Google Calendar Widget activated, so I deactivated it. My WP control panel shows GCE installed, stylesheet linked from “wordpress/wp-content/uploads/css/gce-style.css” and GCE settings normal. The same way they worked for months prior to trying 0.5. Reverting to 0.4.1 isn’t happening, though. Some cache problem? I’m stumped.

    Reply
  8. No caching plugins installed. Here’s what I’m thinking now. Somehow I got two installations of WP on my server. I was reluctant to mess with it, since things were generally okay, and I was afraid of having to mess with .htcaccess, etc.—or worse yet, rebuild the site! So there may be a hitch with that. But the directory where GCE formerely lived and thrived is exactly where I put it again this time, without luck. It may be time for that long-avoided “housecleaning.”

    Reply
  9. HI Ross,
    I have trouble with the new version displaying only “Today’s Specials.”
    I’ve got 4 Google Calendar feeds. Each is set like this: “From 00:00 today” (0 offset) to “00:00 today” (8640 offset). Trouble is, it displays events half way into tomorrow.
    Luckily I tried this on my development server, and it’s not on my live blog. Any ideas?

    Reply
  10. Tried the dev version. It seems better now. Here’s a question, though. In addition to daily events I have a concurrent week-long event. Now “Today’s Specials” begins yesterday, the beginning of that multi-day event. I guess I should get in the habit of entering that type as an event repeating daily for the duration of the event, rather than one event lasting until X?
    Thanks for your help.

    Reply
  11. Excellent plugin. Would it be possible to have an additional “Retrieve events from” option? I’m thinking of “publish-date”.

    That way, I can schedule posts in advance and still have the plugin showing the events. They would even show different info, which would be useful too.

    Please, correct me if the current plugin version works that way already – then I just haven’t figured out how.

    Reply
  12. The plugin was working fine until I noticed it’s calling events from yesterday. I use it as a widget titled, “Today’s Specials!” Time zones on each calendar feed and the whole site are set to New York. Each feed is set to: Retrieve Events from 00:00 today until 00:00 today offset 86400. Any ideas how to fix this? I “refreshed” feeds, too.
    Thanks,
    Jim

    Reply
  13. Hello,

    Here we are in August 2011 and I want to show a calender of only October 2011 events for a festival taking place in October. I want the WordPress page to only show October on load and not the current month. I am using the AJAX display. I am using the ‘Retrieve Events From’ specific date/time feature using the unix codes for Oct 1 and Oct 31.

    What am I doing wrong?

    Thanks,
    Erik

    Reply

Leave a Reply