CRON script configuration ( for automatic events import from .ics feeds).

Please note, the import process is working in that case, when some visitor is open your website page with booking import shortcode.
For start import of .ics feeds in "automatic" way you need to configure the CRON script at the server, for periodically accessing the page with booking import shortcode.

In pure WordPress system it works with pseudo-cron functionality. WordPress Cron is what many people refer to as a "pseudo-cron system". The difference is in how UNIX cron and WordPress Cron take action.

A typical UNIX cron system runs in this order:

  • A time tied to an action occurs.
  • Cron runs the action tied to that time.

With WordPress Cron, it works a little differently:

  • A visitor comes to any page on your WordPress website.
  • WordPress Cron checks each cron event to see whether the scheduled time has been passed.
  • If the scheduled time for that event was passed, then WordPress Cron executes any actions tied to that event.

The detail description about Linux style of CRON commands you can check here. Other example of other CRON commands for other periods of time you can find here.
But usually you can configure your cron script via your server administration panel, like ISP Manager or Cpanel, in easier way via menu and not the commands. Help info about configuration of CRON script in ISP Manager server administration panel you can check here or here (older versions). Help info about configuration of CRON script in Cpanel server administration panel you can check here or here. For more info, please contact support of your hosting. Hosting support should know exactly what server administration panel you are using at your server, and how to configure your CRON script. Note. We do not provide support of configuration CRON at your servers.
Check how to setup the Cron job or read more about Hooking WP-Cron Into the System Task Scheduler, if you are WordPress developer.

You need to define the CRON command to access the page with your import .ics feeds shortcodes, during each 1 hour (or other reasonable period of time). So CRON script will access the page with import .ics feeds shortcodes in your website, and during these times, will be start of import process, from your other services.

Example of CRON command (for every 1 hour to run):

0 * * * * wget -qO- https://your-server.com/your-page-with-import &> /dev/null

Instead of "your-server.com" use your website DNS. In other words the URL like this https://your-server.com/your-page-with-import , it's URL to the page at your website, where you have inserted into the content of this page the import .ics feed shortcode. Check more about import .ics feeds shortcodes.

What fields imported / exported during sync via .ics feeds ?

Each .ics feed can contain info about the event in following fields:
- Event Title
- Event Description (optional field)
- Location
and dates of event, of course.

1) During import of .ics feed from external source into the Booking Calendar, you can assign each such specific field to one of exist fields in the booking form. You can make this assignment at the Booking > Settings > Sync > "General" page in "Import > Assign events fields to specific booking form field" section.

Please note, email field here is not required (but this field is required for the Booking Calendar). So that's why during import of events from .ics feed into the Booking Calendar created new email field and assigned your "Administrator email" from your WordPress website.

2) During export of events from the Booking Calendar into the .ics feed, Booking Calendar assign following values to standard .ics feeds fields: "Title" and "Description".

If you are using the Booking Calendar Free version, so then plugin export into "Title" field following fields (if fields with such names exist in your configuration at Booking > Settings > Form page): 'name' 'firstname' 'secondname' 'lastname'.

In paid versions of Booking Calendar, plugin export into "Title" field of specific event, - configured "Title" of booking that is showing in Calendar Overview (timeline) page in booking pipelines. This configuration you can find at the Booking > Settings General page in "Booking Admin Panel" section, in option "Booking title (admin panel)" - default title of bookings in calendar view mode at Booking Listing page.

As "Description" field, Booking Calendar export all booking data of specific booking. In paid versions of Booking Calendar its configuration of "Content of booking fields data" form from Booking > Settings > Form page.

If you need to remove any booking data (in "Title" and "Description" fields) in your exporting .ics feed, then you can activate this option "Remove booking details in exported .ics feed" at the Booking Manager plugin at menu "oPlugins Panel" > General Settings page. In this case, system will export only booked dates into the .ics feed without any additional details. this option available in Booking Manager update 2.0.12 or newer.

P.S. In case, if you need to make some your customization of such import / export process, so then you can find needed info for import in this file: ../wp-content/plugins/booking-manager/core/wpbc/wpbm-bc-import.php

function function wpbm_ics_import_start( $attr )

and for export in this file: ../wp-content/plugins/booking-manager/core/wpbc/wpbm-bc-export.php

function wpbm_export_ics_feed__wpbm_ics( $param = array( 'wh_booking_type' => '1', 'wh_trash' => '' ) ) { 

P.S.S. Disclaimer. Unfortunately we can not start, right now, some personal customization or custom development, because almost have no free time. Check more about new features here https://wpbookingcalendar.com/faq/need-new-feature/
Please note, if you will modify the source code of the Booking Calendar, we will not guaranteed the correct work of plugin and do not support it.

How to start export of bookings in .ics feeds from Booking Calendar ?

1) Requirements. This functionality available in the Booking Calendar update 8.0 or newer version.
So if you are using some older paid version of Booking Calendar, then you can request the new update of Booking Calendar on this page: https://wpbookingcalendar.com/request-update/

2) Requirements. Additionally for ability to export bookings into external websites, like Airbnb, Booking.com, HomeAway, TripAdvisor, VRBO, FlipKey and any other calendar that uses .ics format, you will be need to install Booking Manager plugin update 2.0 or newer ( https://wordpress.org/plugins/booking-manager/ ).

3) Export URLs. Now, when you have installed both plugins, you can start configuring of export bookings into external website.

Please open the Booking > Settings > Sync > Export -ics page.

Configure URLs for each booking resources (in paid versions). In the Booking Calendar Free version, you will see field for configuring URL for your one Default booking resource. Then click on Save changes button.

4) Import .ics in external website. Now you need to check documentation of each other external website, of how to start import of .ics feeds into specific services: Airbnb, Booking.com, HomeAway, TripAdvisor, VRBO, FlipKey

Important! Please note, once you have imported specific .ics feed into external website or application, its does not mean that this operation will be executed periodically. You need to check documentation of specific service (like AirBNB), for ability to import such .ics feeds periodically for having your bookings in external website always up to date.

Example of how to import .ics files in Google Calendar.

If you get error during generating .ics feed or getting just empty space instead of .ics feed.

In case, if you start import of .ics feed into Google Calendar by URL "Other Calendars > Add by URL", then in the point #3 you need to configure URL that ending with wpbm.ics. For example:

/ics/apartment2/wpbm.ics

1) So please try to configure link with wpbm.ics at the end of links at the Booking > Settings > Sync > "Export - .ics" page, like this:

/apartment2ics/wpbm.ics

After this click on icon near specific .ics feed url (check in point #3 in first screenshot point #3), its will open new .ics feed in new browser window. And you have to see .ics feed. Basically in browser window you have to copy full URL and then use it in other services.

2) If you still have an issue. Please recheck your error.log in your server configuration, about any relative errors.
If you can not find error.log file, please contact support of your hosting company about helping in finding this file.
Just to recheck about the reason of this issue. May be you have not activated some PHP module.

3) Be sure that you are using latest versions of Booking Calendar and Booking Manager.

What fields are exported from Booking Calendar to .ics feed?

Booking Calendar export bookings via .ics feeds by assigning these booking form fields to the fields in .ics feed:

SUMMARY

In the Booking Calendar Free version assign to 'SUMMARY' field in .ics feed, one of exist fields from your booking form, that can have names like this 'name', 'firstname', 'secondname', 'lastname'

In the paid versions of Booking Calendar possible to define, what exactly field from the booking form to assign to 'SUMMARY' field in the .ics feed. You can define it at the Booking > Settings General page in "Admin panel" section in the option "Booking title (admin panel)"

DESCRIPTION

Booking Calendar export all bookings details (that you have defined as fields at the Booking > Settings > Form page) to this field 'DESCRIPTION' in the .ics feed.
Please note, in the paid versions, all such bookings details defined at the "Content of booking fields data" form at the Booking > Settings > Form page.

How to start import of .ics feeds into Booking Calendar ?

1) Requirements. This functionality available in the Booking Calendar update 8.0 or newer version.
So if you are using some older paid version of Booking Calendar, then you can request the new update of Booking Calendar on this page: https://wpbookingcalendar.com/request-update/

2) Requirements. Additionally for ability to import bookings from external websites, like Airbnb, Booking.com, HomeAway, TripAdvisor, VRBO, FlipKey and any other calendar that uses .ics format, you will be need to install Booking Manager plugin update 2.0 or newer ( https://wordpress.org/plugins/booking-manager/ ).

3) Getting URL of .ics feed. Now, when you have installed both plugins, you can start configuring of import events/bookings from external website.

First of all you need to get URL of .ics feed, from where you want to import the events/bookings.
Let make example based on Google Calendar. At other websites, you need to check help documentation where exactly you can find URL of .ics feeds: Airbnb, Booking.com, HomeAway, TripAdvisor, VRBO, FlipKey

3.1) Open Google Calendar then mouse over specific calendar and click on settings icon at right side near specific calendar, then click on "Settings and Sharing" link.
Google Calendar settings and sharing

3.2) Scroll to "Integrate calendar" section, and copy URL of "Secret address in iCal format"
Google Calendar Secret address in iCal format

4) Inserting Booking Manager import shortcode(s). You will be need to insert the Booking Manager Shortcode for importing of events into some post or page.
The easiest way todo this is clicking on "Booking Manager" button in edit content toolbar:

Then in popup dialog switch to the "Import .ics feed into WPBC" tab.
Paste URL to your .ics feed in specific feed, and configure other parameters, like booking resource (in paid versions), where you want to import bookings, start and end date of import and other parameters.

Please read more about manual configuration of Booking Manager import shortcode at this page.

5) Publish such page(s)

Please note, now, when someone will visit this page, the import process from this specific .ics feed will start into the booking resource, which you have specified in booking manager shortcode.

When you will visit such page, so then you will see how many bookings was imported:

6) CRON. Its means that you need to visit such page periodically for start importing of bookings that can be created at other website. The best way its to configure CRON at your server for periodic access such page(s) and import of bookings from different sources. Please read more about CRON .
Probably you will be need to contact your server administrator or support of hosting, if you will have some difficulties with configuring CRON at your server.

Repeat steps 3 - 6 for different .ics feeds from different sources and for different booking resources (in paid versions of Booking Calendar).

7) TIP. As you can see from Booking Manager Shortcode, you can define in shortcode different URL to .ics feed and specific booking resource (in paid version). Using such shortcodes in different pages give a great flexibility to import from different .ics feeds (sources) into the same resource. Like one page for import from Airbnb and other page with different shortcode for importing from booking.com or Google Calendar. Also you can define different time interval in your CRON for accessing different pages and its means to start import of bookings with different intensity.

Configuration import events from public Google Calendar

01. To get Google Calendar API key please follow this instruction:

  1. Go to Google Developer Console: https://console.developers.google.com. And then click on Credentials link.

  2. If you do not have projects yet, please click "Create Project".

  3. Give your project a name and click "Create".

  4. Click on "Create credentials" to expand dropdown list and select "API Key".

  5. Click on your "API Key" to edit it.

  6. Copy "API Key" (later we will paste it into Google API Key field at Booking > Settings > Sync > Google Calendar Events Import page in your WP admin panel). Then be sure to select "Key restriction" as "None" and click on Save button.

    Please be sure that you have NOT restricted the Google API key, otherwise its can be reason of not ability to import events.

  7. Now in the sidebar click on "Library", and then click on "Calendar API" link


  8. Click on "ENABLE" link to enable your Google Calendar API


02. Set Your Calendar to Public:

  1. Navigate to your Google calendars.

  2. Open the settings for the calendar.


  3. Navigate to Access permissions section. Click the checkbox to "Make available to public". Do not select other option (be sure that was selected "See all events details"). Save settings.


03. Find Your Calendar ID:

  1. Navigate to your Google calendars.

  2. Open the settings for the calendar.


  3. Now copy the Calendar ID to use in the Booking > Settings > Sync > Google Calendar Events Import page in your WP admin panel for "Calendar ID" field(s).

    Please be sure to use the Calendar ID in format like XXXXXX@group.calendar.google.com (or XXXXXX@gmail.com)

    Do not use the entire XML feed URL (starting from http) and do not use simple ID (term before @), like: XXXXXX.


04. Test Import of Google Calendar Events:

  1. Open your WordPress admin panel and Navigate to Booking > Settings > Sync > Import Google Calendar Events page.

  2. Paste your Google API Key and Google Calendar ID into specific fields. Important! Please be sure that you do not paste any white spaces at the beginning or ending of API Key or Google Calendar ID. Save the changes.
    In the paid versions of Booking Calendar you can assign at this page different Google Calendar ID for the different booking resources.


  3. Open Booking Listing page and switch to the "Actions toolbar", then click on "Import" button.

  4. In popup dialog configure your parameters (during first test import, please be sure that you selected time interval, where for sure exist your Google Calendar Events). And then click on Import button.

  5. You have to see your imported events. Reload the page to see them as bookings.