=== ICS Calendar === Contributors: room34 Donate link: https://icscalendar.com Tags: iCalendar, Google Calendar, Office 365, events, ICS feed Requires at least: 4.9 Tested up to: 6.8 Requires PHP: 7.0 Stable tag: 11.5.13 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Easily add any iCalendar feed (Google Calendar, Microsoft 365, iCloud Calendar, etc.) to your WordPress site. Auto-updating, loads of options. == Description == Using a simple shortcode, you can turn any iCalendar subscription (ICS) feed (Google Calendar, Microsoft Office 365, Apple iCloud, Airbnb, Vrbo, and many more) into a seamlessly integrated, auto-updating, zero-maintenance WordPress calendar. Continue to manage your events in the calendar software you're already using! You'll automatically have an up-to-date calendar in your WordPress website with no extra work. Display your calendar in month, list or week view. Many additional customization options are available. See our [User Guide](https://icscalendar.com/user-guide/) for full details. **No API keys required!** **Works with ANY calendar software** that generates a public iCalendar subscription link. = Live Preview = You can preview your own calendar in any ICS Calendar view at our website: [icscalendar.com/preview](https://icscalendar.com/preview/) = Shortcode Builder = We've made it easier than ever to get started using ICS Calendar with our new online shortcode builder: [icscalendar.com/shortcode-builder](https://icscalendar.com/shortcode-builder/) = Language Support = All date strings (days of the week, months, etc.) are automatically translated into your site's configured language (under **Settings > General > Language**) and date/time formats using core WordPress functionality. All text content for the calendar itself is displayed as-is from the feed. The small amount of additional front-end displayed text generated by the plugin defaults to U.S. English, but also supports the following translations: Chinese, Danish, Dutch, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Russian, Spanish and Swedish. Please contact us if you would like us to add support for your language! _This plugin includes the PHP ICS Parser library by Jonathan Goode, John Grogg and Martin Thoma (MIT license)._ == Installation == Once the plugin is installed and activated, use the shortcode below (adding your own ICS feed URL between the quotation marks) to insert a calendar into your pages. Use our online [Shortcode Builder](https://icscalendar.com/shortcode-builder/) to easily create a customized shortcode, or consult the [User Guide](https://icscalendar.com/user-guide) for more information. `[ics_calendar url=""]` Be sure you are using the _iCalendar subscription (ICS)_ URL (i.e. for importing into a calendar program), not the URL for viewing a calendar in a web browser. To test if you have the correct URL, paste it directly into your browser address bar. It should download an `.ics` file, not display the calendar in the browser. == Frequently Asked Questions == = How do I find my calendar's ICS feed URL? = Different calendar systems have different ways to obtain the feed URL. You may need to consult your calendar software's documentation for assistance. Find instructions for commonly used calendars below. You will also need to make sure that your calendar is public. Private calendars cannot be accessed by this plugin. _Documentation quick links:_ * [Google Calendar](https://support.google.com/calendar/answer/37083#link) * [Microsoft Office 365](https://support.office.com/en-us/article/share-your-calendar-in-outlook-on-the-web-7ecef8ae-139c-40d9-bae2-a23977ee58d5) * [Apple iCloud](https://www.macobserver.com/tips/quick-tip/icloud-configure-public-calendar) = How do I insert a calendar into my page? = Use this shortcode, inserting your ICS feed URL between the quotation marks: `[ics_calendar url=""]` Be sure you are using the _iCalendar subscription (ICS)_ URL (i.e. for importing into a calendar program), not the URL for viewing a calendar in a web browser. To test if you have the correct URL, paste it directly into your browser address bar. It should download an `.ics` file, not display the calendar in the browser. = Can I combine multiple calendars? = Yes! You can combine multiple calendars by including more than one feed URL in the `url` parameter. __Separate the calendar URLs with one space or a pipe `|` character.__ Do not include any other delimiter characters, as they will be interpreted as part of the URL. = Why isn't my calendar loading? = This may be due to your server's configuration. This plugin requires either the PHP cURL extensions, or the `allow_url_fopen` PHP setting to be turned on. Check your PHP configuration or your server administrator if you think this may be the issue. You can also add `debug="true"` to your shortcode and view your page to see debugging output which may provide additional details about any connection issues. = Why isn't my calendar updating? = For performance, this plugin uses WordPress transients to store retrieved calendar data for one hour between requests to the calendar source server. If you have updated events that are not showing up in your page, visit the **ICS Calendar** page in your site admin and click the **Clear Cached Calendar Data** button. Third-party caching plugins may interfere with ICS Calendar's feed syncing. If you are using a caching plugin and your calendar is not updating, try using the [AJAX](https://icscalendar.com/icsdocs/#ajax) option in your shortcode. = Why are event times an hour off after Daylight Saving Time begins? = PHP has two different ways of defining timezones: as a number of hours offset from GMT/UTC (e.g. "UTC-5"), or as a continent/city combination (e.g. "America/Chicago"). Timezones using UTC offsets do not handle Daylight Saving Time correctly (as noted in the [PHP documentation](https://www.php.net/manual/en/timezones.others.php)). Please check your WordPress timezone settings (__Settings > General > Timezone__). If it is set to a UTC offset, change it to the city closest to your location, in the same timezone. As of version 6.0 you can also set the timezone within the shortcode using the `tz` parameter. (Again, be sure to use a named region/city timezone, not a UTC offset.) = Additional documentation and support = Our [User Guide](https://icscalendar.com/user-guide/) includes extensive documentation of all features of the plugin, is frequently updated, and is translated into all languages supported by the plugin. = Feature requests = The paid [ICS Calendar Pro](https://icscalendar.com) add-on includes additional layout options, tools for customizing the calendar's appearance more easily than directly editing CSS, an improved insertion tool, and more. We are also constantly adding new features and refinements to _both_ the free and paid versions. If you have suggestions for features you'd like to see or any other additional input, please let us know by following the support link on the admin page or in the [WordPress support forums](https://wordpress.org/support/plugin/ics-calendar/)! The base plugin will always be free to use. == Changelog == = 11.5.13 - 2025.07.23 = * Added **Default shortcode** setting on the ICS Calendar Settings admin page. This is useful for sites that will contain a large number of calendar shortcodes with mostly identical parameters. Individual shortcodes' settings will override the default, but only need to include the parameters that are unique. * Added [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage) code comments where relevant. * i18n: Updated translation strings. = 11.5.12.7 - 2025.07.20 = * Admin: Added **Permanent feed URL mask IDs** setting, to address an issue with Cloudflare (and possibly other caching systems) where pages may continue to request old masked feed URL IDs after they have been cleared/expired. * CSS: Added `!important` to `text-align` and `vertical-align` in month grid views to force override of theme CSS. * Miscellaneous: Minor code refactoring. * i18n: Fixed text domain for two translation strings on admin page; updated translation strings. = 11.5.12.6 - 2025.07.12 = * CSS: Added `!important` to margin and padding on list elements in month grid views to force override of theme CSS. = 11.5.12.5 - 2025.07.03 = * Admin: * Changed order of tabs. * Added conditional to hide Settings tab if user doesn't have administrator-level access. * Updated link list on Getting Started page. * Updated presentation of ICS Calendar Pro promotion and admin sidebar postbox. * Minor CSS tweaks. * i18n: Updated translation strings. = 11.5.12.4 - 2025.06.20 = * Added `$trim` parameter to `R34ICS::_url_get_contents()` method (defaults to `true`). This was added because of an observed issue with ICS feeds generated by the Simply Schedule Appointments plugin, which contain several lines of blank space at the beginning. The ics-parser library ICS Calendar uses specifically checks for `BEGIN:VCALENDAR` as the first line in the file when validating input, causing these feeds to fail to load. Trimming the retrieved data prior to parsing resolves the issue. = 11.5.12.3 - 2025.06.20 = * Fixed issue with the `r34ics_purge_calendar_transients()` function (the function used by the **Clear Cached Calendar Data** utility) that was causing the **Transient (cache) expiration** setting to get reset. This problem was exacerbated by the change introduced in version 11.5.12 that automatically runs the utility every time the ICS Calendar settings are saved. (A SQL statement in the function needed backslashes added for literal underscores.) = 11.5.12.2 - 2025.06.12 = * On Multisite installations, added "network active" plugins to System Report. = 11.5.12.1 - 2025.06.04 = * Fixed bug in new `r34ics_colors_match_theme_json()` that prevented transient storage of the adjusted CSS color palette. * Added logic to `r34ics_colors_match_theme_json()` to handle situations where dark mode is on but the theme's color palette has too few colors defined. (Previously any remaining ICS Calendar colors were being kept at their defaults; they're now being inverted using an `hsl()` color formula.) = 11.5.12 - 2025.06.03 = * Block Themes / Site Editor Styles: * Added **Match calendar color palette to current Block Theme colors** setting. For sites that are using color palettes defined in a Block Theme or with the Site Editor, this option automatically replaces ICS Calendar's default neutral gray color palette with closest-match colors from your theme's color palette. _Note: This is a BETA feature and is still in development. Added and/or modified several color-related functions in `functions.php`. [Feedback](https://icscalendar.com/support) on this feature is welcomed._ * Modified CSS and some logic for `solidcolors` and `whitetext` to accommodate the **Dark mode** option under the new **Match calendar color palette to current Block Theme colors** setting. * **Clear Cached Calendar Data** utility now runs automatically when saving ICS Calendar settings or Site Editor configuration, so any changes to these settings will take effect immediately without needing to manually run the utility. * Bug Fixes: Fixed issue in Week view that might cause "Double timezone specification" PHP fatal errors after changes introduced in version 11.5.11.1. * i18n: Updated translation strings. = 11.5.11.1 - 2025.05.28 = * Changed output of `r34ics_first_day_of()` and `r34ics_last_day_of()` functions to be strings in `Y-m-d` format, rather than Unix timestamps. This resolves a timezone related issue where the returned date may actually be one day earlier than intended, causing Month view to display one extra past month, showing only the events on the last day of that month. (Note: Because the output of these functions has changed, corresponding changes were made to code that handles the output of the functions where they are called in `class-r34ics.php`.) = 11.5.11 - 2025.05.16 = * Event downloads (`eventdl`): * Added "Save to your calendar" text in addition to icon. You can revert to the previous icon-only display by changing the shortcode parameter from `eventdl="true"` to `eventdl="minimal"`. * Fixed output errors in downloaded `.ics` files when the event includes the `EXDATE` or `RDATE` property. * Admin page: Updated promotional content. * CSS: Removed base64 encoding on embedded SVG background images, to reduce data size and eliminate unnecessary obfuscation. * i18n: Updated translation strings. = 11.5.10.1 - 2025.05.09 = * Bug fix: Basic and List views now handle `paginationposition="both"` correctly. * Improved error handling in `r34ics_uniqid_url()` function and `R34ICS::shortcode_defaults_merge()` method. = 11.5.10 - 2025.05.02 = * Actions and Filters: * Added actions to Month and Week view templates: `r34ics_display_calendar_after_day_label` and `r34ics_display_calendar_after_events_list`. As the names indicate, these actions allow for custom output after the day label and day events lists for each day in the table in these views. Hooked functions have access to four input parameters: `$view`, `$args`, `$date` and `$day_events`. = 11.5.9.1 - 2025.04.28 = * Modified `r34ics_url_tester_result_debug` hook to be able to account for situations where the response is empty. * Vendors: * ics-parser: Changed timezone string mappings for "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius" and "FLE Standard Time" from "Europe/Kiev" to "Europe/Helsinki". This is because the ics-parser library uses the spelling "Kiev", whereas ICS Calendar code uses the spelling "Kyiv". This discrepancy was causing time calculation issues, specifically for Microsoft source calendars, which use the "FLE Standard Time" designation. "Europe/Helsinki" was chosen to avoid alternate spelling confusion, and also because "FLE" stands for "Finland Latvia Estonia", making Helsinki a more logical choice than Kyiv. (Both cities share the same timezone rules.) = 11.5.9 - 2025.04.24 = * Added `wp_get_remote()` status check to System Report; refactored System Report to use transients. = 11.5.8 - 2025.04.22 = * Removed `r34ics_ajax_bypass_nonce` option. Nonce has now been removed from ICS Calendar AJAX requests altogether, as the requests do not have the ability to write to the database, making the nonce unnecessary. The nonce has consistently caused issues with AJAX requests in conjunction with third-party caching plugins. * CSS tweaks on admin page. * i18n: * Removed disused translation strings. * Removed Norwegian Nynorsk translation files, due to consistent issues with Poedit machine translations. = 11.5.7.1 - 2025.04.11 = * Bug fix: Added exception handling to prevent a fatal error if `r34ics_date()` is passed a timezone string that is not a valid format recognized by the PHP `DateTimeZone` class. * Bug fix: Removed extraneous pagination close tag in list view that may cause the pagination HTML to break if the last item on a "page" is a multi-day event. * Changed scope of special date range handling in week view. = 11.5.7 - 2025.03.07 = * Modified activation process to jump directly to **Getting Started** tab of admin page. * Redesigned **Getting Started** tab and sidebar of admin page. * i18n: Updated translation files, added missing text strings. = 11.5.6.1 - 2025.03.06 = * Updated help text on Settings page. = 11.5.6 - 2025.02.26 = * Added `none` as a valid option for the `monthnav` parameter, allowing for hiding the month navigation altogether. (Useful when showing month view in a kiosk environment or other settings where the user doesn't need the ability to switch the view to a different month.) * Bumped 'tested up to' to 6.7.2. = 11.5.5 - 2025.02.24 = * Added support for using [HTML color names](https://www.w3schools.com/colors/colors_names.asp) in the shortcode, in addition to hex colors, via the new `r34ics_color_name2hex()` function. = 11.5.4.2 - 2025.02.18 = * Made calls to `php_uname()` in System Report conditional; some servers may remove support for this function for security reasons. Also replaced call to `phpversion()` with `PHP_VERSION` constant, with a conditional in case the constant is undefined. These changes should resolve issues where the ICS Calendar admin page does not load properly on servers with these security measures in place. * Updated copyright terms regarding ICS Calendar name and branding assets. = 11.5.4.1 - 2025.02.10 = * Refactored `r34ics_date()` to use `wp_date()` after applying its offset and other input standardizations, rather than duplicating the code of `wp_date()`. This also resolves an issue where in some rare cases, the passed-in timezone may not be handled correctly. * Added missing event timezone inputs to `r34ics_date()` calls in the `R34ICS::event_description_html()` method and `r34ics_multiday_date_label()` function. Without timezones, date ranges for multi-day events could be one day "off" in the event descriptions and labels after the aforementioned refactoring of `r34ics_date()`. * Fixed incorrect date display issues in `R34ICS::event_description_html()`. _Note: Version 11.5.4 was withdrawn due to this issue, which was discovered a few minutes after its release._ * Modified event sorting for multi-day events starting on the same date. Now, list-style views (list, basic) will show these events sorted by earliest ending date. Table-style views (month, week), will show the events sorted by the _latest_ ending date, which helps to reduce situations where events "break" between days in the layout when using `combinemultiday`. = 11.5.3.2 - 2025.02.07 = * Bug fix: Resolved possible fatal error caused if new `r34ics_i18n_locales()` function added in 11.5.3.1 runs on a logged-out front-end page. = 11.5.3.1 - 2025.02.06 = * Fixed bug with `reverse` and `pagination` on Basic and List views that would cause the wrong "page" to display on load. * i18n: Updated translation strings. Added logic to force the plugin's embedded translation files to take precedence over any downloaded community translation files in the `WP_LANG_DIR/plugins` directory. = 11.5.3 - 2025.02.03 = * Fixed issue with pagination in list view that would include the next single-day event(s) on a "page" when a multi-day event was the correctly counted "last" item on the page. * Modified handling of `pagination="1"` in Basic and List views, to literally mean 1 event, rather than being interpreted as a boolean "true" and defaulting to 5 events per page. Setting `pagination="true"` will still default to 5 per page. List view also now omits the month/year headers when displaying one event per page. * Modified handling of `count` and `pagination` parameters to force positive integer values. = 11.5.2.1 - 2025.02.03 = * Added `r34ics_comparison_string()` function to process strings for comparison purposes. Used by features added to `R34ICS::r34ics_display_calendar_exclude_event()` in 11.5.2 to filter events by category, accounting for possible formatting issues with accented letters. * Modified shortcode logic to force certain parameter values to all-lowercase. This allows the input values to be case-insensitive; previously, non-lowercase values would be treated as invalid. Applies primarily to parameters that have defined arrays of accepted values, e.g. [`columnlabels`](https://icscalendar.com/icsdocs#columnlabels) or [`extendmultiday`](https://icscalendar.com/icsdocs#extendmultiday). = 11.5.2 - 2025.01.31 = * Added `category` attribute to allow filtering events by category. Multiple categories may be included, using the pipe character `|` as a delimiter. Category names used must exactly match the category names in the feed (case-insensitive). _Currently this feature simply excludes events that are not in one of the designated categories. A future update will add support for color-coded categories, similar to the current support for multiple feeds in one calendar shortcode._ **Note:** This feature requires that your ICS feed data includes the [`CATEGORIES`](https://icalendar.org/iCalendar-RFC-5545/3-8-1-2-categories.html) property, which is not widely supported by most popular calendar software. = 11.5.1.3 - 2025.01.22 = * Modified logic for `maskinfo` that would remove the info hover box on multi-day events with specified start and end times. = 11.5.1.2 - 2025.01.20 = * Miscellaneous: * Added `r34ics_ajax_bypass_nonce` status to System Report. = 11.5.1.1 - 2025.01.08 = * Bug fixes: * Added logic to trim extraneous spaces from the beginning and end of all attribute values when parsing the shortcode, and in sanitization logic in `r34ics-ajax.php`. * Added `r34ics_color_key_allowed()` function and updated `r34ics_select_allowed()` to merge custom allowed fields with `wp_kses_allowed_html('post')`. This resolves issues with the color key (legend) that were introduced with changes in v. 11.5.0 and 11.5.1. * Changed `r34ics_minify_css()` handling of whitespace to resolve issues when output is fed through `wp_kses_post()`. * Fixed duplicate description output that may result with ALTREP handling introduced in 11.5.1. * Fixed handling of feed parsing failures that would cause a fatal error unless the `debug` parameter is set in the shortcode. = 11.5.1 - 2025.01.07 = * Functional enhancements: * Added protected `R34ICS::_event_field_handling()` method to facilitate complex logic (i.e. too much to fit in one line of code) when assigning values in the `$event_item` array in `R34ICS::display_calendar()` and related functions. This includes the new `r34ics_event_field_handling` filter for additional external processing of event data. (If working with the filter, be aware that it is currently only applied to the `eventdesc` value.) This functionality was specifically added to accommodate changes needed for the ALTREP property described below, but it is open-ended to support additional future enhancements. * iCalendar spec support: * Added limited support for Thunderbird's use of the [ALTREP](https://icalendar.org/iCalendar-RFC-5545/3-2-1-alternate-text-representation.html) parameter in event descriptions. Thunderbird does not appear to conform to the spec — the `ALTREP` value is not wrapped in quotation marks. However, since this is our first observation of ALTREP in use, our solution is tailored to the Thunderbird output we have observed. Additional feedback on this feature is welcomed. * PHP deprecation notices: * Modified the `event_description_html()`, `event_label_html()` and `event_sublabel_html()` methods of `R34ICS` to return empty strings rather than null or false values when empty. * Added `?: ''` empty string fallback value to all instances of `wp_kses_post()` added in version 11.5.0, to work around "Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated" warnings. This should technically be addressed within the WordPress core `wp_kses_no_null()` function. We have opened a Trac ticket. If the core function is modified to handle null values, the then-superfluous `?: ''` will be removed from these function calls in a future update. = 11.5.0 - 2025.01.03 = * i18n: * Added `translators:` comments for each translation string containing placeholders. * Changed text domain from `r34ics` to `ics-calendar` to conform with [WordPress Plugin Directory requirements](https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#text-domains). _Translation files included within the plugin have been correspondingly updated, but if you are using third-party translations or a plugin such as [Say What](https://wordpress.org/plugins/say-what/), you may need to update them with the new text domain._ * Replaced `%s` translation string placeholders with `%1$s`. * Replaced uses of unescaped `_e()` and `__()` functions with the corresponding escaped functions `esc_html_e()`, `esc_html__()`, `esc_attr_e()` and `esc_attr__()`, as appropriate. * Updated all translation files to reflect the above changes. * Miscellaneous: * Added extra sanitization functionality to handling of form inputs on Settings page and `r34ics-ajax.php`. * Added text escaping functions to dynamic plugin output in templates. * Added `r34ics_select_allowed()` function. * Fixed CSS padding issue with week numbers in month and week views. * Replaced uses of certain standard PHP functions such as `json_encode()`, `mt_rand()`, `parse_url()` and `strip_tags()` with their WordPress-specific equivalents (e.g. `wp_json_encode()`, `wp_rand()`, `wp_parse_url()` and `wp_strip_tags()`). * Updated handling of server variables in System Report. * Vendors: * Updated embedded ics-parser library to version 3.4.1 (with namespace change to prevent plugin conflicts, and removal of variables from error messages due to [Plugin Check](https://wordpress.org/plugins/plugin-check) reporting them as coding errors). = Full Changelog = _Changelog truncated here due to WordPress repository requirements._ Please see `changelog.txt` for older logs.