=== 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.5.4 Requires PHP: 7.0 Stable tag: 11.2.2 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.2.2 - 2024.06.07 = * Admin: * ICS Feed URL Tester enhancements. Added suggestions for handling some common situations that may cause a feed request to fail or return incorrect results. * CSS refinements. * Fixed a bug that caused ICS Feed URL Tester to always return an unknown error after changes introduced in version 11.1.0. * Updated action links on Plugins page. * Shortcode: * Added `feedlabelindesc` parameter and related functionality. * Miscellaneous: * Added `R34ICS::shortcode_feed_array_params` property and logic to split pipe-delimited, feed-related parameters into arrays for easier logic elsewhere, plus related functionality, including `r34ics_shortcode_feed_array_params` filter. (This is used by `feedlabelindesc` and may be used by other future enhancements.) * Modified `r34ics_has_desc()` function to support `feedlabelindesc`. = 11.2.1 - 2024.05.30 = * Shortcode: * Added `eventlocaltime` parameter. Will display all times in the local timezone of the individual event, if applicable. Note: When this parameter is used, the timezone abbreviation `T` will automatically be appended to the `timeformat` parameter while parsing the shortcode. * Added support for `T` (timezone abbreviation) in `timeformat` parameter. Note: Currently only supports placing `T` at the end of the string. (The timezone abbreviation will be inserted at the end of the time output, regardless of where `T` appears in the `timeformat` string.) * Admin: * Reordered Settings tab items. = 11.2.0 - 2024.05.29 = * Admin: * Fixed issue after introduction of tabbed layout on ICS Calendar admin page that would cause the wrong tab to load after clicking buttons on the Utilities tab. * Added "System Report" link in sidebar. * Shortcode: * Added `fulldateintable` parameter. By default, month and list views show only the day number in the table on desktop breakpoints, and use the date format defined by the `format` parameter for mobile breakpoints. When `fulldateintable="true"` is set, the `format` value will be used to display the date in the table on desktop as well. * Miscellaneous: * Added check for `R34ICS` class already being defined, to prevent a potential fatal error on plugin activation. * Added list of valid view names to allow fallback to month view if an invalid name is used. Use the new `r34ics_views` filter to add any custom view template names to the list. * Modified loading logic to run `r34ics_update()` if the version number has *changed*, not just if it has increased. * Updated protected properties of the `R34ICS` class. * Hotfix: * Modified CSS to prevent display of AJAX "loading" animation being stuck after the calendar loads. = 11.1.0 - 2024.05.22 = * Admin: * Redesigned admin screen with tabbed layout for improved usability, relabeled some elements, and updated links to User Guide documentation. Refactored associated code into discrete methods. Removed legacy JavaScript that was no longer in use. * AJAX: * Added new **Always use AJAX to render calendars** admin setting. This will automatically force all calendars on the site to render asynchronously using AJAX. * Restructured AJAX rendering and added a JavaScript interval to automatically refresh all AJAX-loaded calendars on the same frequency as the site's configured **Transient (cache) expiration** setting. (Minimum of 300 seconds.) Provides a way for pages containing calendars to be left open indefinitely (e.g. for kiosk displays) and receive updates. * Parameters: * Added new `hidecancelledevents` and `hidetentativeevents` shortcode parameters. These hide events with a `STATUS` value of `CANCELLED` or `TENTATIVE`, respectively. * Miscellaneous: * Added fallback to get event URL from the URI property if it exists. The iCalendar spec includes a [URI](https://icalendar.org/iCalendar-RFC-5545/3-3-13-uri.html) property, but not a URL property. However in our practical experience the URL property is commonly used by calendar vendors. * Replaced several instances of null coalescing operators (`?? null`) with short ternary operators (`?: ''`) setting empty strings rather than null values for event properties. This should not produce any noticeable changes in most cases, but may occasionally allow for values to be returned that have been missing in the output under the old logic. * Updated the set of fields that are masked by the `maskinfo` parameter to account for changes in the ics-parser library. * i18n: Updated translation strings. = 11.0.1.2 - 2024.05.15 = * Added `R34ICS::get_list_style_views()` and `r34ics_list_style_views` filter to allow external addition of list-style views for certain conditional logic. * Performance improvements: Narrowed rough parsed date ranges defined in `R34ICS::display_calendar_date_range()` to reduce memory usage and processing time for calendars with a large number of recurring events. * Admin page layout adjustments. * Debugging: Removed restriction that only reports dynamic peak of memory usage if debug level is set to 2 or higher. * Bumped 'tested up to' version to 6.5.3. = 11.0.1.1 - 2024.05.02 = * Developer: * Added `r34ics_display_calendar_after_args` action. = 11.0.1 - 2024.05.02 = * Basic/list views: * Pagination: changed default pagination count to 5 instead of using `posts_per_page` site option; cast pagination value as integer when set; fixed missing `#` in previous/next pagination URLs. Fixed two jQuery bugs. * Week view: * Modified change from version 11.0.0.3 to adapt when the window is resized between phone and non-phone breakpoints. (The previous fix depended on the size of the window on initial page load.) * Admin: * Added `r34ics_is_block_editor()` function, and logic to prevent unnecessary processing potentially occurring on Block Editor screens. * Developer: * Added two new actions: `r34ics_shortcode_before_display_calendar` and `r34ics_shortcode_after_display_calendar`. These actions fire off in `R34ICS::shortcode()` before and after the call to `R34ICS::display_calendar()`. * Corrected `add_action()` to `add_filter()` for `r34ics_display_calendar_exclude_event` in `class-r34ics.php`. * Miscellaneous: * Removed logic to run `gzdecode()` in `R34ICS::_url_get_contents()` because `wp_remote_get()` already does that. Eliminates appearance of numerous related PHP warnings in log files. = 11.0.0.3 - 2024.04.23 = * Week view: * Fixed JavaScript issue of containers not extending to the full width in mobile "list"-style layout when switching between weeks. * ICS feed request functionality: * Updated `R34ICS::_url_get_contents()` to address some additional edge case issues introduced with the switch to `wp_remote_get()` in version 11.0.0 that were not fully resolved by the 11.0.0.1 update. Specifically, added customized handling of 301 and 302 redirects to use the `Location` header returned in the response object, rather than relying on the built-in redirection in `wp_remote_get()`, which was causing some hosts (including Google Calendar) to reject the request. * Added **Use legacy feed request method** option on settings page, and corresponding `R34ICS::_url_get_contents_legacy()` method. For sites that are still not successfully retrieving feeds with the fixes added in 11.0.0.1, this option reverts to using the old method for requesting feeds using cURL and fopen functions. * Updated debugging tools for internal testing during development. (Note: Version 11.0.0.2 was intentionally removed due to a logistical issue.) = 11.0.0.1 - 2024.04.18 = * Fixes an issue with HTTP headers in the new method of retrieving ICS feeds. The issue was hotfixed approximately one hour after the initial release, but some sites may have picked up the update within that hour. This update also increases the timeout from 5 to 30 seconds, to address potential issues with retrieving very large ICS files. = 11.0.0 - 2024.04.18 = **PLEASE NOTE: This version includes a significant rewrite of the function that retrieves the contents of ICS feed URLs. It is now using the built-in `wp_remote_get()` WordPress function (instead of PHP cURL and fopen functions as before), so it _should_ be fully compatible with all existing installations. However, if you encounter any new issues, please visit the [WordPress Support Forums](https://wordpress.org/support/plugin/ics-calendar/) for assistance.** * Admin Settings: * Added **Allow access to these hostnames that resolve to reserved IP addresses** setting. This allows sites to access calendar servers on the same physical IP address as the web server, or within the same internal network. Previously this needed to be handled using custom PHP code as outlined in [this blog post](https://icscalendar.com/how-to-retrieve-feed-urls-over-a-local-network-private-reserved-ip-addresses-in-ics-calendar-10-12-2-and-later/). * Code Refactoring: * Replaced previous cURL and fopen logic with `wp_remote_get()` in `R34ICS::_url_get_contents()` method. Correspondingly, deprecated the `curlopts` and `method` parameters. _Note: The second and fourth parameters of the protected method `R34ICS::_url_get_contents()` were **removed** rather than deprecated. No external plugins should be using this method other than ICS Calendar Pro, which has been correspondingly updated._ * Removed admin notice checking for presence of cURL or fopen functions. * WordPress Playground: * Added `r34ics_is_playground()` function to detect if running in [WordPress Playground](https://playground.wordpress.net). * Miscellaneous: * Added missing fourth parameter to `r34ics_event_description_html` action. * Changed Room 34 Creative Services logo link on admin page sidebar. * Fixed PHP warning in `r34ics_system_report()` in rare situations where `get_option('active_plugins')` returns a plugin that is not included in `get_plugins()`. (May occur if the plugin has been manually removed from the file system.) * Modified `R34ICS::event_description_html()` to handle `$event['start_time']` and `$event['end_time']` as alternatives to `$event['start']` and `$event['end']`. * Updated header details in `ics-calendar.php`. * a11y: * Changed CSS for `.ics-calendar-arrow-nav > *.inactive` to completely hide inactive arrow navigation elements (e.g. "Previous" while on first month, "Today" while on current month, etc.) rather than screening back their opacity. Modified jQuery corresponding to these elements to dynamically add `aria-hidden="true"` when `inactive` class is added. * i18n: * Added and updated translation strings. * Bumped 'tested up to' version to 6.5.2. = 10.14.1.5 - 2024.04.05 = * AJAX: * Fixed logic that replaces `FILTER_SANITIZE_STRING` (introduced in version 10.13.1.1) to properly account for array values in shortcode parameters. * List and basic views: * Eliminated unnecessary JavaScript fade-in on load, except when `pagination` or `ajax` option is in use. = 10.14.1.4 - 2024.04.01 = * General: * Fixed issue with `extendmultiday` where it would extend one-day events as well as multi-day events. * List and basic views: * Added detection of the "current" page when pagination is turned on. The page will now automatically load with the page containing the current date displayed, instead of the first page, making list and basic views with pagination more useful when `pastdays` is set to include past events in the list. (Note: The pagination is set independently of the date, so it's possible the page may still load with a few past events displaying before the current date's events, but the current date's events *will* be on the page.) * Minor template code refactoring. * Month and week views: * Added call to `r34ics_show_hide_headers()` function when clicking "Show past events" on mobile, as a possible solution to a client-side issue with date headers not displaying when the window is left open over a break between months. (Due to the nature of the bug, it can only be tested at the transition between months.) = 10.14.1.3 - 2024.03.08 = * AJAX: * Added failure handling that will retry the AJAX request up to 5 times in situations where the AJAX response is only `1` instead of the proper calendar HTML output. After the fifth failure, AJAX will report `ICS Calendar AJAX request failed for element...` to the JavaScript console. (Previous versions would fail in this way after one attempt.) * Bug fix: * Modified conditional introduced in version 10.14.1.2, to resolve possible `Undefined array key "VALUE"` PHP warnings. * Misc: * Removed unnecessary `global $wp_locale;` line from all templates. * Added `changelog.txt` and moved older changelogs to that file; truncated changelog in `readme.txt` to comply with WordPress repository requirements. * Bumped 'tested up to' version to 6.5. = 10.14.1.2 - 2024.03.06 = * Added a workaround for a possible issue with the [ics-parser](https://github.com/u01jmg3/ics-parser) library on recurrence exclusions (`EXDATE`) where excluded event dates are still being included in the output array. * Updated embedded ics-parser library to v. 3.3.1 (carrying over existing modifications). = 10.14.1.1 - 2024.02.21 = * JavaScript: * Replaced `wp_localize_script()` with the now-preferred `wp_add_inline_script()` in `R34ICS::enqueue_scripts()` method. Fixes an issue where the "localized" script was not actually rendering in the page in some situations. * Modified logic that hides "Show past events" on mobile month/week views, when there are no past events in the current month, to account for the `.month_list_all` class (an ICS Calendar Pro-only feature). = 10.14.1 - 2024.01.25 = * Added **Remove "Add ICS Calendar" button in Classic Editor** admin option to leverage the existing `r34ics_display_add_calendar_button` action without the need for custom PHP code. * Added `r34ics_purge_calendar_transients` action to allow external cleanup functions to fire off on the **Clear Cached Calendar Data** utility. * JavaScript: added type casting to `r34ics_boolean_check()` function to prevent occasional AJAX loading errors. * i18n: New translation strings. = 10.14.0 - 2024.01.11 = * AJAX: * Encapsulated AJAX client-side logic in a new `r34ics_ajax_init()` function, and added `r34ics_ajax_start` and `r34ics_ajax_end` events. * Two changes to address the issue of AJAX requests occasionally outputting only "1" instead of the calendar: 1. Added a check on the `R34ICS::display_calendar()` method for transient data containing only "1" instead of the calendar, bypassing the transient cache if true. 2. Added handling to the AJAX output itself to suppress display of the "1" if it still occurs, and write an error message to the console. We are still investigating the root cause of this issue. * JavaScript: * Added JavaScript version of `r34ics_boolean_check()` function. * List view: * Added text underline to events that have a clickable description when the `toggle` option is turned on, to give users a visual cue. = Full Changelog = _Changelog truncated here due to WordPress repository requirements._ Please see `changelog.txt` for older logs.