r/ProWordPress • u/Rob_Art • 13h ago
Two-way calendar sync in a booking plugin: secret iCal feeds or the Google/Microsoft APIs? What's bitten you?
I'm building the calendar side of a booking plugin and would like to hear from people who've shipped this, before I make the same mistakes.
Bookings going out are done: each staff member gets a private iCal feed they can subscribe to. The hard part is busy times coming in, so that a dentist's personal appointment in Google Calendar blocks that slot on the booking page.
The plan right now:
- Poll each person's secret iCal address (Google, Apple and Outlook all offer one) every few minutes with WP-Cron plus a real server cron
- Store only start/end/all-day busy blocks, not titles or attendees
- Expand RRULEs (with EXDATE and RECURRENCE-ID overrides) for a rolling window of 90 days or so
- Normalise everything to UTC, keeping the source TZID for DST edges
- Show a "last checked" time per calendar and alert the admin when a feed fails or goes stale
Avoiding OAuth for now: no app verification, no tokens to store or refresh, and it works the same for all three providers.
Questions for anyone who's done it:
- Is polling iCal good enough, or does the delay (Google's published feeds can lag) cause real double bookings in practice?
- Which RRULE or time zone edge cases broke for you? Floating times, all-day events across DST, Outlook's Windows time zone names?
- Did you parse ICS yourself or use a library (sabre/vobject or similar)? Was it worth the dependency in a distributed plugin?
- If you went OAuth with push notifications instead, was the verification and maintenance cost worth it?
Happy to share what I end up with.