=== Calendar² by BSquared ===
Contributors: bsquaredsoftware
Tags: events, calendar, event calendar, recurring events, venues
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A fast, simple events calendar for busy sites: events, venues, organisers, repeating events, and month, list and day views.

== Description ==

Calendar² gives a site a "what's on" section that readers can browse and editors can keep up to date without fuss. It's built for sites like a local news site, a venue or a community group that list hundreds of events a month and can't afford a slow calendar.

Editors get one clear box for the details that matter: date and time, cost, venue, organiser, website, status (for example canceled or postponed) and an optional repeat schedule written as a sentence ("Every week on Tuesday and Thursday, 10 times"). Readers get a month grid, a list and a day view at /events/, with search and a filter panel (category, tag, venue, organiser, day of the week, time of day, price and place) that works without JavaScript.

Events are ordinary WordPress posts, so featured images, revisions, comments, sitemaps and SEO plugins work as usual. Every date of a repeating event is stored in a small indexed table, so a calendar page reads a handful of rows instead of working out repeats on every page view.

**Features**

* Events, venues, organisers and event categories (each with an optional colour), under one "Calendar²" menu with its own user permissions.
* An event editor for the block editor and the classic editor: start and end, all day, timezone (the site's by default), cost as free text ("Free", "$15", "$15–$55"), venue (pick, search or add a new one), organiser, website, status and a "featured" flag.
* Repeating events: daily, weekly on chosen days, monthly (on a day number or, for example, "the third Saturday") or yearly, every N, ending never, after N times or on a date. You can skip individual dates.
* Month, list and day views, single event, venue and organiser pages, with schema.org event data for search engines.
* Search and filter: a keyword box plus a filter panel (a drawer above the calendar or a sidebar beside it) for category, tag, venue, organiser, day of the week, time of day, price band and city, region or country. Pick several values in one filter to widen it; combine filters to narrow it. Filtered pages have their own addresses, so they can be bookmarked and shared, and you choose under Calendar² → Settings → Filters which filters to offer, their order, the price bands and the time-of-day boundaries.
* The `[calendar2]` shortcode to put a calendar on any page, and `[calendar2_upcoming]` for a short list of what's coming up.
* An iCal feed of upcoming events that readers can subscribe to, and "Add to calendar" links on each event.
* An events list in the admin that shows what's coming up first, with date, category, venue and source filters, Quick Edit for dates, cost and status, Duplicate, and bulk "Mark canceled" and "Feature".
* Category merging that keeps old category addresses working.
* A guided switch from The Events Calendar on the same site: a dry run, a private preview, the switch itself and a roll-back, with old event addresses and `[tribe_events]` shortcodes kept working.
* Importing events from another site that runs The Events Calendar, with WP-CLI (`wp calendar2 import tec-rest <url>`).
* Optional clean-up of past events after a number of days, and WP-CLI commands to rebuild and tidy the calendar.
* Personal-data export and erasure (Tools → Export/Erase Personal Data) for the contact details stored with submitted events.

Public event submissions and scheduled imports from other calendars (iCal, RSS, sites running The Events Calendar) are in Calendar² Pro, a separate plugin from the same team. Everything listed above is in this free plugin, with no limits and no account needed.

The plugin's interface is written in US English and ships with a British English (en_GB) translation.

== External services ==

Calendar² doesn't contact any service on its own. It makes outbound connections only when you ask it to, as described below.

* **Importing from a site running The Events Calendar** (`wp calendar2 import tec-rest <url>`): Calendar² reads that site's public REST API (`<url>/wp-json/tribe/events/v1/…`) at the address you give. The request identifies itself as `Calendar2/<version> (+https://bsquared.software)`; nothing about your site is sent. That site's own terms and privacy policy apply.
* **Event images during an import:** each event's image is downloaded from the source site into your Media Library (WordPress's own `media_sideload_image`). If an image can't be copied, the event shows it from the source site's address instead, so readers' browsers load it from there.
* **Photon (WordPress.com image CDN), opt-in:** only if you pass `--image-proxy=photon` to the import command, images that the source site blocks are fetched through `https://i0.wp.com/`, a service run by Automattic. [Terms of service](https://wordpress.com/tos/) · [Privacy policy](https://automattic.com/privacy/).
* **Links readers can follow:** "Add to calendar" and "Subscribe" links open Google Calendar (`calendar.google.com`), and venue addresses link to Google Maps (`google.com/maps`). Nothing is sent until a reader clicks. [Google Terms](https://policies.google.com/terms) · [Google Privacy Policy](https://policies.google.com/privacy).

The guided switch from The Events Calendar reads that plugin's data on your own site and makes no outside connections.

== Installation ==

1. Install Calendar² from Plugins → Add New, or upload the `bsquared-calendar` folder to `/wp-content/plugins/`.
2. Activate it.
3. Add events under **Calendar² → Add New**, and review **Calendar² → Settings**. Your calendar is at `/events/`.

If The Events Calendar is active, Calendar² runs alongside it without taking over its addresses. Go to **Calendar² → Migrate** when you're ready to move across.

== Frequently Asked Questions ==

= What happens to my events if I deactivate or delete the plugin? =

Deactivating never deletes anything. Deleting the plugin removes its events, venues, organisers, categories and settings only if you ticked "Delete all events, venues, organizers, categories and settings when the plugin is deleted" under Calendar² → Settings.

= Which timezone are event times in? =

Each event has a timezone, which defaults to the site's (Settings → General). All-day events are whole calendar days and appear on the same dates whatever the timezone.

= Can I move from The Events Calendar? =

Yes. Under Calendar² → Migrate, a dry run shows exactly what will happen, a private preview lets you check the result, and only then does the switch take over your existing events, venues, organisers and categories in place, keeping their IDs, images and addresses. You can switch back afterwards.

Sites running Events Calendar Pro move across too. Repeating events keep their rule, checked against the dates Pro stored; a date edited on its own becomes its own event; Series you made become tags; and Pro's per-date and series addresses redirect. The `[tribe_events_list]` and `[tribe:event-details]` shortcodes keep working, and the dry run lists every page that uses another TEC shortcode. With Calendar² Pro, Event Aggregator schedules become feeds, created switched off.

= Does it work with my theme? =

The calendar uses your theme's fonts, colours and buttons, with one accent colour you can set under Calendar² → Settings. It works with block themes and classic themes.

If your theme overrides Calendar²'s templates, check `calendar2/parts/view.php` in your theme after updating to 1.2.0: a copy made before 1.2.0 has no filter panel. Add `Template::part( 'parts/filters', $calendar2_args );` where you want the panel and `Template::part( 'parts/chips', $calendar2_args );` for the active-filter chips, or start again from the plugin's `templates/parts/view.php`. Refresh a copy of `parts/bar.php` made before 1.2.0 too: the old one doesn't carry the active filters into a new search.

= Can visitors send in their own events? =

That's part of Calendar² Pro, which adds a submission form with a moderation queue. Without it, a page that holds the `[calendar2_submit]` shortcode shows nothing to visitors.

= Is Calendar² fast on a big calendar? =

That's what it's built for. Repeating events are expanded once into an indexed table, and calendar pages, search and the iCal feed read only the rows they show.

== Screenshots ==

1. Month view: multi-day events as bars, a colour dot per category, featured events starred, and ongoing events folded into one line per week.
2. List view with event images, grouped by month, with recurring events labelled.
3. A single event page: date and time, cost, venue with a map link, organiser and add-to-calendar buttons.
4. Search and filter: the keyword box and the filter panel, with the active filters shown as chips you can remove one at a time.
5. The event editor: simple date and time fields, repeat rules in one row (here weekly on Mondays, 8 times), and venue and organiser pickers.
6. The events list in the admin: upcoming/past, source, category and venue filters, with dates, venues and repeat rules at a glance.

== Third-party data ==

The table that maps Windows time zone names (as written by Outlook and Exchange) to IANA time zones comes from the Unicode CLDR project's `windowsZones.xml`, used under the Unicode License v3. Copyright © 1991-2026 Unicode, Inc. The licence text is in `src/Import/Ics/WindowsZones.php`.

== Upgrade Notice ==

= 1.2.0 =
Adds the filter panel. After the update, the filter index is built in the background, in batches run by WordPress's scheduled tasks; on a big calendar that takes a while. Until it finishes, the day, time-of-day, price and place filters are ignored, and everything else works as usual.

== Changelog ==

= 1.2.1 =
* Fixed: the filter panel showed the "Apply filters" button twice.

= 1.2.0 =
* New filter panel for the calendar: category, tag, venue, organiser, day of the week, time of day, price band and city, region or country, shown as a drawer above the calendar or a sidebar beside it. Pick several values in one filter to widen it; combine filters to narrow it. The active filters show as chips you can remove one at a time, and every filtered page has its own address, so it can be bookmarked and shared. It works without JavaScript.
* New Calendar² → Settings → Filters screen: which filters to offer and in what order, the layout, the price bands and the time-of-day boundaries.
* The `[calendar2]` and `[calendar2_upcoming]` shortcodes take the same filters as attributes (`tag`, `venue`, `organizer`, `day`, `time`, `price`, `city`, `region`, `country`).
* After the update the filter index is built in the background. Until it finishes, the day, time-of-day, price and place filters are left out and everything else works as usual. `wp calendar2 rebuild` shows its progress.
* Switching from The Events Calendar now covers Events Calendar Pro. Repeating events keep their rule, checked against the dates Pro had stored, with any skipped or added dates kept. When no rule fits, the exact dates are kept. A date edited on its own becomes its own event. Series you made become tags, and Series made for a repeat are set to draft.
* Events Calendar Pro's addresses redirect after the switch: a date's own page goes to the event showing that date, the "all dates" page and a Series page go to the event or its tag, and Pro's per-date IDs go to the event.
* Tag archives list events as well as posts, when the tag has published events. Hidden events stay hidden.
* The `[tribe_events_list]` shortcode shows Calendar²'s upcoming events list, and `[tribe:event-details]` shows the event's details where the author placed it. The dry run lists every page, post and widget that uses a TEC shortcode, and what each will show after the switch.
* Event Aggregator schedules can become Calendar² Pro feeds at the switch, created switched off. Each feed's first run only records what it already holds, so nothing is overwritten.
* New "Also on" list in the event editor: extra one-off dates, each with its own times, with or without a repeat rule. iCal import and export carry them as RDATE.
* Repeat rules can now be "every year on the nth (or last) weekday of a month", such as the fourth Thursday of November.
* WP-CLI and the switch-back screen say more precisely what happens to repeating events when you switch back.
* Imports: Google Calendar descriptions sent as HTML show as formatted text. Before this, they showed the HTML tags as text, and links in them broke.
* "Add to calendar": the Google Calendar link keeps the blank line between the event description and the event link. Before this, the two ran together on one line.
* Event editor: when an event has more dates than the server accepts in one save (PHP's `max_input_vars`), the editor says so when it opens and leaves the event as it was, instead of saving it cut short.
* Fixed a PHP warning when another plugin's tag query asks for several post types at once.

= 1.1.0 =
* Search results: event prices now carry the right currency. A new Currency setting (automatic from the site language, or chosen) applies, and a price written with £ or € uses that currency. Before this, every price was marked as US dollars.
* Search results: all-day events show the right dates when the event's time zone differs from the site's.
* Search results: an event is no longer marked up when its venue has no street or town, since search engines need an address.
* New "Default event image" setting, shown for events without their own image and given to search engines. Images under 720 pixels wide are left out of the markup.
* Hidden events no longer output structured data, and hidden or password-protected events are left out of the WordPress sitemap.
* Switching from The Events Calendar: its "trash past events" setting now carries over for every period it offers. Before this, 3, 6 and 9 months and 2 and 3 years became "Keep forever". The Past events setting gains 270 days, 2 years and 3 years. Sites that already switched keep their period where 1.0.0 stored it, and past events start moving to the Trash on that schedule after the update. If Settings → Past events shows "Keep forever" after a switch you made with 1.0.0, check it and choose the period you want.
* Imports: an imported event, venue or organiser that someone deleted is no longer imported again on the next run. Before this, emptying the Trash (which WordPress does after 30 days) brought deleted items back. Events moved to the Trash automatically (gone from their feed, or past-event clean-up) can still come back when WordPress empties the Trash, as before. Events that 1.0.x moved to the Trash automatically and that are still there when you update may be remembered as deleted once the Trash is emptied.
* Switching from The Events Calendar: preparing a large site writes in batches, frees memory between batches and carries on in a fresh WP-CLI process instead of stalling, so big calendars switch in less time and memory.
* For developers: new hooks for add-ons (an event's status changing, an event being duplicated, and where add-ons can add details to a single event). See the add-on API notes.
* Personal-data export and erasure (Tools → Export/Erase Personal Data) now include any extra details a site's Calendar² Pro submission form collects, alongside the submitter's name, email and phone. Uninstalling with "delete data" on removes them too.

= 1.0.0 =
* First public release: events, venues, organisers and categories; repeating events; month, list and day views with search and filters; the `[calendar2]` and `[calendar2_upcoming]` shortcodes; an iCal feed; the admin events list with Quick Edit, Duplicate and bulk actions; the guided switch from The Events Calendar; WP-CLI import from another site running The Events Calendar; past-event clean-up; personal-data export and erasure; and a British English translation.
