=== 404ops Event Calendar Tickets ===
Contributors: spwhite
Tags: events, calendar, event calendar, recurring events, tickets
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.12.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Recurring events, six calendar views, and Stripe or PayPal ticket sales with QR check-in -- with no artificial free-tier limits.

== Description ==

Event Calendar Tickets is an events calendar and ticketing plugin. Create one-off or recurring events, publish them in six calendar views, sell tickets through Stripe or PayPal, and check attendees in at the door with a QR scan.

**Free, with no artificial limits:**

* Recurring events (RFC 5545 rules, exceptions, extra dates), with daylight-saving edge cases flagged.
* Month, Week, Day, List, Photo and Map views, a block and shortcodes, iCal feeds and schema.org data.
* Stripe or PayPal tickets with capacity limits, emails, CSV export and QR check-in, including an offline-capable door page.
* Reserved seating with seat maps and held seat choice.
* A waitlist for sold-out tickets: offer a freed seat, held and emailed, from the Waitlist screen.
* Refunds and cancelled tickets free their seats automatically.
* Online and hybrid events: the join link goes to ticket holders only, with times in the event's and the visitor's timezone.
* Sales and attendance reports by event and ticket type, with check-in rates and CSV export.
* Import from The Events Calendar, All-in-One Event Calendar or a CSV, with a 30-day undo.
* Venues, organizers, community submissions, badges and signed outbound webhooks.

**No nags, ever.** No admin advertising, upsell interstitials, padlocked menu items or review popups. Pro is named once, on its own Settings tab.

**Pro** adds series passes, bulk editing across a series, discount codes (including groups of events and per-date limits), waitlist auto-promotion, native Zoom/Meet meeting creation, attendee email campaigns with unsubscribe links, and a per-event sales and check-in report.

**Optional AI drafting (bring your own connection).** Choose OpenAI, Anthropic, Google Gemini, OpenRouter, Ollama (local), or an OpenAI-compatible (custom URL) provider to draft events from text, a web page or a poster image, plus schedules and promotional copy. Without an AI connection configured, drafting actions make no AI-related request. The AI only creates drafts you review, never publishes, and never touches money or attendee data.

== External services ==
Nothing is sent anywhere on activation. This plugin contacts an outside service only for a feature you connect or switch on. The FAQ entry "What external services does this plugin contact?" carries each service's full terms and privacy links.

* **Stripe** (`api.stripe.com`): when you connect and test your own Stripe keys, create a ticket Checkout Session, or process a signed payment webhook.
* **PayPal** (`api-m.paypal.com`, and `api-m.sandbox.paypal.com` in sandbox mode): only if you connect it, for Test Connection, order creation and capture, webhook verification and refund reconciliation.
* **AI drafting** (OpenAI `api.openai.com`, Anthropic `api.anthropic.com`, Google Gemini `generativelanguage.googleapis.com`, OpenRouter `openrouter.ai`, Ollama or an OpenAI-compatible URL you enter): only the one provider you connect, only when you use an AI feature, and with your own key.
* **AI Draft URL fetch**: retrieves the page text (and any schema.org event data on it) from the URL you paste, only when you request that draft. A poster you choose for drafting is sent only to your AI provider.
* **Video meetings (Pro, your own connection):** Zoom (`zoom.us`, `api.zoom.us`) or Google Calendar (`oauth2.googleapis.com`, `www.googleapis.com`), only when you use Create meeting. The event's title, start time and length are sent.
* **Address geocoding** (off by default): each click sends the address to OpenStreetMap Nominatim (`nominatim.openstreetmap.org`).
* **Map tiles** (off by default): visitors' browsers request tiles from the tile host you configure.
* **Outbound webhooks** (off until you add an endpoint): choose signed generic JSON or native Slack/Discord for `order.paid` and `attendee.checked_in`. Generic JSON includes buyer/attendee details; native chat contains only the event name. Deliveries go to your chosen public HTTPS endpoint; that service's terms apply.
* **Usage statistics**: none are transmitted. Settings and onboarding previews stay local.

== Installation ==
1. Upload the plugin files to `/wp-content/plugins/404ops-event-calendar-tickets`, or install
   through the WordPress plugins screen directly.
2. Activate the plugin through the "Plugins" screen in WordPress.
3. A short setup wizard walks you through your first event, or your import
   from The Events Calendar if one is detected.
4. Configure ticketing, AI, and display options under 404ops -> Events ->
   Settings at any time.

== Frequently Asked Questions ==
= What external services does this plugin contact? =

External requests from this plugin are limited to the configured or explicitly invoked paths listed below. The plugin does not automatically read attendee records for these requests; an administrator's free-form AI description can contain anything that administrator chooses to submit.

* **Stripe** (`api.stripe.com`) is contacted when you connect and test your own Stripe keys, create a ticket Checkout Session, or process a signed payment webhook. Stripe receives the payment and ticket details needed for that operation. Stripe's [Services Agreement](https://stripe.com/legal/ssa) and [Privacy Center](https://stripe.com/privacy) apply.
* **PayPal** (`api-m.paypal.com`, and `api-m.sandbox.paypal.com` while sandbox mode is selected) is contacted only if you connect it: when the Test Connection button verifies the stored credentials, when a ticket checkout creates an order or captures the buyer's approved payment, when a webhook delivery is verified, and when a refund issued in your PayPal dashboard is reconciled. PayPal receives the payment and ticket details needed for that operation; the webhook verification call also receives the delivery's signature headers and event body. PayPal's [User Agreement](https://www.paypal.com/webapps/mpp/ua/useragreement-full) and [Privacy Statement](https://www.paypal.com/webapps/mpp/ua/privacy-full) apply.
* **AI drafting** contacts only the provider you choose and configure (OpenAI, Anthropic, Google Gemini, OpenRouter, Ollama, or an OpenAI-compatible URL), only when you use drafting. It sends the description and draft fields you submit, or, for poster drafting, the image you choose from your Media Library and any notes you type; for promotional-copy drafting it sends the saved event's public fields (title, description, schedule, venue name, categories, cost display, and the online link only when it is public) and the tone note you type; for ask-the-data it sends that fixed aggregate snapshot and the question you type, and it does not automatically read attendee records. OpenAI [Services Agreement](https://openai.com/policies/services-agreement/) and [Privacy](https://openai.com/policies/privacy-policy/), Anthropic [Commercial Terms](https://www.anthropic.com/legal/commercial-terms) and [Privacy](https://www.anthropic.com/legal/privacy), Google Gemini [Terms](https://ai.google.dev/gemini-api/terms) and [Privacy](https://policies.google.com/privacy), and OpenRouter [Terms](https://openrouter.ai/terms) and [Privacy](https://openrouter.ai/privacy) apply to those hosted providers. For Ollama, review your server operator's terms and privacy policy; for a custom URL, review the terms and privacy policy of the operator of that OpenAI-compatible custom URL before configuring it.
* **AI Draft URL fetch** retrieves page text from the URL you paste, only when you request that draft. The destination site's terms and privacy policy apply.
* **Map tiles:** If you turn on map tiles -- off by default -- every visitor's browser requests map tiles directly from the host in the tile URL you configure. The configured tile host's terms and privacy policy apply.
* **Address geocoding:** If you turn on address geocoding -- also off by default -- each click sends the address to the fixed OpenStreetMap Nominatim endpoint (`nominatim.openstreetmap.org`). See Nominatim's [usage policy](https://operations.osmfoundation.org/policies/nominatim/) and OpenStreetMap Foundation [Privacy Policy](https://osmfoundation.org/wiki/Privacy_Policy).
* **Video meeting creation (Pro, bring your own connection):** the free plugin only stores the provider credentials you register, encrypted, and contacts nothing. If the Pro add-on is active and you use the event editor's Create meeting control, it sends the event's title, start time, and length to **Zoom** (`zoom.us`, `api.zoom.us`) through your own Server-to-Server OAuth app, or to **Google Calendar** (`oauth2.googleapis.com`, `www.googleapis.com`) through your own service account and delegated Workspace user to mint a Google Meet link. Zoom's [Terms of Service](https://www.zoom.com/en/trust/terms/) and [Privacy Statement](https://www.zoom.com/en/trust/privacy/privacy-statement/), and Google's [Terms of Service](https://policies.google.com/terms) and [Privacy Policy](https://policies.google.com/privacy), apply. The Google Meet APIs have no service-context path on a plain consumer Gmail domain, so that connection genuinely requires Google Workspace with domain-wide delegation.
* **Anonymous usage statistics** are previewed locally in settings and onboarding. No usage statistics are transmitted, even when the opt-in preference is saved. The plugin has no telemetry sender or endpoint filter.

= Are there any limits? =

Occurrences of a repeating event are generated 24 months ahead and extended
automatically. Calendar and REST requests return at most 200 occurrences per
page, as do the Attendance and Upcoming Events Digest report screens - both
tell you the full total when there is more than fits, so a capped screen is
never silent. CSV exports are complete: they are read in batches rather than
truncated. The one exception is the Attendees screen export, which is capped
at 10,000 rows - and it tells you on screen when a filter actually matches
more than that, including how many are left out. See below. The migration importer processes 100 items per
batch and can be resumed. Import rollback is available for 30
days; URL redirects from imported events are kept permanently so your links
keep working.

= Where is my data stored? =

Everything lives in this site's own database: events, venues, and organizers
as ordinary WordPress posts; the calendar schedule, tickets, orders, and
attendees in the plugin's own tables (`wp_ops404_events_*`). Money is stored
as whole cents, never a float. Stripe API keys and webhook signing secrets,
and the PayPal client secret, are encrypted at rest and are never written to
a log, error message, or export in plaintext. Card numbers are never stored
here at all -- Stripe or PayPal holds those; this plugin only keeps a
transaction reference.

= Is there a public REST API or calendar feed? =

Yes, both read-only and both cover only public events (a draft, private,
password-protected, or "hide from calendar" event never appears in either):

* `GET /wp-json/ops404-events/v1/events` -- occurrences in a date range.
  `per_page` defaults to 50 and is capped at 200; a request asking for more
  is rejected rather than silently truncated.
* `GET /wp-json/ops404-events/v1/occurrences/{id}` -- a single occurrence.
* An iCal subscription feed and single-event download, at `/?ops404_events_ical=1`
  (also reachable at `/events/ical/`) and `/?ops404_events_ics={id}`.

Both the REST routes and the iCal feed can be turned off entirely from
Settings -> Advanced.

= I migrated from The Events Calendar or All-in-One Event Calendar. Can I undo it? =

Yes, for 30 days after the import finishes. Rolling back removes the events,
venues, organizers, and imported ticket history that import batch created --
it never touches the source plugin's own data, and it refuses outright if
a ticket, order, or attendee has been recorded against an imported event
since the import ran, so you can never lose a real sale to an undo button.

**Redirect mappings (old-URL -> new-URL) are kept permanently, even after a
rollback** -- so search engines and bookmarked links never break, no matter
how long ago you rolled the import back. Only the *ability* to roll back
expires after 30 days; the redirects themselves do not.

All-in-One Event Calendar has no venue or organizer post type of its own --
they are plain fields repeated on every event, so the importer builds one
venue/organizer per distinct name it finds (an exact case/whitespace match
merges; a different-looking name, like "Roxy Theatre" next to "The Roxy",
never silently merges with it). Recurring events are checked against
All-in-One Event Calendar's own materialized occurrence history before being
trusted as a series; a pattern that doesn't check out imports as a single
event instead, with a note explaining why, rather than risk a silently wrong
calendar. Ticket types and attendees for an event sold through All-in-One
Event Calendar's paid tickets are not migrated -- that history lives only at
api.time.ly, not in this site's own database, and is unreachable from here.

= How do attendee tickets and door check-in work? =

Every paid or free ticket issues one attendee record with its own unguessable
32-character code, minted from a cryptographically random source -- never
derived from the order or any other id. That code is rendered as a QR code
entirely locally (no third-party QR-generation service ever sees it) and
embedded directly in the confirmation email as an inline image; nothing about
your tickets is ever sent to an outside service to produce them.

The Attendees screen lists every attendee with filters and a CSV export,
capped at 10,000 rows per export. A filter matching more than that says so
on screen, with the real total and how many rows are left out, so you never
find out by counting the file. The export keeps the earliest registrations
and omits the most recent, so exporting again after narrowing the filters
never shifts or repeats the rows you already have. Attendee names and emails
are neutralised against CSV formula injection before export.

The Check-in screen scans or accepts a typed ticket code and requires
`manage_options` by default, same as every other screen in this plugin. Two
surfaces are deliberately non-admin, and both are set by filters: a site can
delegate door duty to another role via the `ops404_events_checkin_capability`
filter (defaults to `manage_options`), so door staff do not need full admin
access; and the community submission form's `ops404_events_submit_cap` filter
(defaults to `edit_posts`, i.e. Authors and up) decides who may propose an
event -- and submitting only ever creates a draft plus a moderation-queue
entry, never a published event. The submission form's per-user rate limit
has its own filter, `ops404_events_submit_rate_limit_seconds` (defaults to
300, i.e. one submission per user per five minutes; 0 turns the limit off).
All three filters keep the final word over their counterparts in the
settings screens: who may submit and the rate-limit window are configurable
under Settings -> General, and a filter overriding either in code simply
wins. No other screen, action, or capability check in this plugin can be
changed this way.

The offline-capable check-in page at `/index.php/ops404-events-checkin/` answers
the same filter and the same door rules on a page of its own: after one
successful online visit, a service worker scoped to that one page
serves the page and the event's attendee manifest from the device's own
cache, so it boots and scans with no network at all. Offline scans are
verdicted against the downloaded manifest and queued on the device;
when connectivity returns, the queue syncs and the server applies each
check-in under the same one-ticket-one-check-in rule as a live scan.
Offline verdicts are provisional against other devices, and the page
says so: an attendee checked in elsewhere during the offline window
scans valid offline and is then reported as superseded after sync, with
the time and user of the check-in that actually won (the first
server-side check-in always wins; a later sync never overwrites it).
The manifest is served only to a user holding the check-in capability,
is never stored in the browser's HTTP cache (only in the service
worker's cache on that device), and carries no attendee email
addresses; it holds a per-attendee random verification token, never a
signing key.

= What happens to my data if I uninstall the plugin? =

Your events, tickets, orders, attendees and settings are kept by default.
To permanently delete that site's data, enable "Remove all plugin data when
the plugin is deleted" in Events > Settings > Advanced before deactivating.
Plugin schedules and temporary data are handled separately from that choice.

On a single site, deactivate and delete the plugin from the Plugins screen.
Free removal requires the standard WordPress cache or the supported
standalone Redis profile documented with the removal tool. If the installed
cache is unsupported, contact your host to reconcile the plugin's cache
entries before changing the cache configuration and retrying removal.

On multisite, use the host-admin removal tool for the matching version from
https://404ops.com/plugins/404ops-events. Shared files can be removed after
all sites and networks deactivate the plugin. Each site's own saved choice
controls whether to keep or permanently remove its data. If Pro is installed,
remove it first. Back up the database and plugin files before removal.

= Can I refund a ticket? =

Refunds are performed from your own Stripe or PayPal dashboard; this plugin
marks the order refunded automatically once the provider confirms it, so
your records stay accurate without a separate step here. A full refund also
voids the order's tickets and frees their seat, so it can be resold or
offered to the next person on the waitlist. To cancel one ticket without a
gateway refund -- a withdrawn comp, a duplicate -- use Cancel ticket on the
Attendees screen: it frees the seat but refunds nothing. A partial refund -- a goodwill credit, a
returned fee -- leaves the order alone: it stays paid and every ticket stays
valid, since the provider's own record is what decides (Stripe's `refunded`
flag on the charge, PayPal's capture status), and a partial refund never
sets it to fully refunded.

= Where can I get help? =

Visit https://supportminer.404ops.com to open a support request.

== Credits ==
The admin screens use two typefaces bundled with the plugin and served from its own files, never from a remote host: Space Grotesk (Copyright 2020 The Space Grotesk Project Authors) and JetBrains Mono (Copyright 2020 The JetBrains Mono Project Authors), both licensed under the SIL Open Font License, Version 1.1 (https://openfontlicense.org). Each licence text ships beside its font in `vendor/404ops/ui-kit/assets/fonts/`. Map views use Leaflet 1.9.4 (https://leafletjs.com, BSD 2-Clause licence, Copyright Volodymyr Agafonkin and CloudMade), bundled unmodified in `assets/vendor/leaflet/` with its licence file. The shared admin interface kit (`404ops/ui-kit`) and the AI client (`404ops/ai-client`, shipped under a plugin-specific namespace in `vendor-prefixed/`) are 404ops' own libraries, licensed GPL-2.0-or-later like this plugin. The plugin bundles no other third-party code.

== Screenshots ==
1. Your next events at a glance, with 30-day activity and this month's sales.

2. All events in one list, with dates, venues and status.

3. Attendees and ticket holders, filterable and exportable to CSV.

4. Ticket sales, revenue, capacity, and sell-through by event.

== Changelog ==

= 1.12.7 =
* Coordinate multisite removal across all sites and networks, and honor each site's saved data-retention choice.
* Delete plugin-owned temporary entries without flushing the installation's shared object cache.

= 1.12.6 =
* Keep the complete series-pass implementation in the separate Pro add-on; preserve unsupported saved ticket data and refuse unknown inventory safely.
* Harden AI connection form nonce handling through the shared client patch.

= 1.12.5 =
* Added: guarded read-only status interfaces for stored aggregate counts.
* Added: five bundled draft language catalogs with checked WordPress loading.
* Improved: development test-session and catalog packaging checks.
= 1.12.4 =
* Maintenance: Plugin Check clean-up: the mailing opt-out queries now bind their table name with a placeholder.

= 1.12.3 =
* Changed: folder, main file and text domain renamed to match the plugin name (404ops-event-calendar-tickets).

= 1.12.2 =
* Updated the licence client (0.3.5): Pro keeps working after a licence expires.

= 1.12.1 =
* Fixed: removed dead links (updated the Zoom terms and privacy links).

= 1.12.0 =
* New: **Free waitlist** — visitors join a sold-out ticket; offer a freed seat from the new Waitlist screen and it is held and emailed with a claim link. Pro auto-promotion offers freed seats on its own.
* New: **Cancel ticket** on the Attendees screen frees a seat without a gateway refund; refunds and cancellations feed the waitlist.
* New: **Online events** — join link for ticket holders only (default), a personal join link in the ticket email, times shown in the event's and the visitor's timezone.
* New: **Reports** — per-ticket-type sales and check-in rates, with CSV. Pro adds an Event report tab with an arrival curve.
* New: **AI drafting** from a poster image, and URL drafts read the page's schema.org event data.
* New (Pro): **discount groups** across events, categories and every date of a series, per-date limits and group minimums; **Email Attendees** with throttled sending, unsubscribe links and a send log.

= 1.11.8 =
* Series passes are now switched on through public filters (`ops404_events_series_pass_supported`, `ops404_events_series_pass_admits`) and ticket-editor column actions that the Pro add-on answers, instead of a licence check in the free plugin. Behaviour is unchanged with or without Pro.

= 1.11.7 =
* Updated the bundled licence client to 0.3.4.

= 1.11.6 =
* Pro update packages now publish with maintenance information and one shared licence client version.

= 1.11.5 =
* Updated the licence client and refreshed wording.

= 1.11.4 =
* Admin headings and menu labels drop the 404ops prefix; dormant telemetry transport removed.

= 1.11.3 =
* Changed: Code-quality clean-up for WordPress.org review: late escaping, input sanitising and documented database access. No change to features.

= 1.11.2 =
* Changed: Bundled libraries updated; translatable strings now use this plugin's text domain.

= 1.11.1 =
* Changed: requires WordPress 7.0 or newer (it was 6.9); tested up to WordPress 7.1.

= 1.11.0 =
* Changed: the plugin now requires WordPress 6.9 or newer and is tested up to WordPress 7.1.
* Changed: Events now sits on the shared 404ops menu. The Overview is the one Events row under 404ops, and the plugin's other screens open from a strip of links at the top of each page. Events, Venues and Organizers keep their own Events menu, and Check-in stays in it so door staff still have a way in from the sidebar.
* Maintenance: the block editor and the front end now use block API version 3 for every Events block.

= 1.10.0 =
* Fixed: the CSV import no longer strips backslashes from venue, organizer and event meta values.
* Maintenance: the plugin now bundles its own prefixed copy of the 404ops UI kit, so its admin screens share one 404ops menu and stylesheet with the other 404ops plugins and each plugin can update its UI independently.
* Maintenance (Pro): uses licence client 0.3, and every Pro add-on now registers its own copy of the licence client so the newest one wins when several are active. Update all 404ops Pro add-ons together.
* Readme: adds an External services section and credits.

= 1.9.1 =
* Maintenance: AI features now use a private, namespaced copy of the AI client and the shared AI connection settings, so each 404ops plugin can update its AI code independently. If you use AI features, re-enter your AI connection once on the AI Connection screen. No other change.

= 1.9.0 =
* New: **Reserved seating** (#7) — a visual seat map per event (free: the incumbent gates this behind its top paid tier), an accessible seat picker at checkout, per-seat pricing overrides, holds that expire honestly, and seat-level QR check-in that admits one seat per scan and says so on a second scan.
* New: **Offline-capable check-in** (#8) — the check-in page keeps scanning through wifi loss after one online visit, with a local manifest, provisional offline verdicts, and reconnect sync where the first server-side check-in wins. Always honest about what offline verdicts mean.

Older releases are listed in CHANGELOG.md.


== Upgrade Notice ==

= 1.12.7 =
Update Free and Pro together. Drain background jobs and PHP requests that
still run an older version. Multisite administrators need the matching
removal tool for uninstall.

= 1.12.5 =
Includes checked draft translations and administrative status reporting. Human linguistic review is separate.
= 1.12.1 =
Removes links that no longer work from the External services section. Text only; safe to update.

= 1.12.0 =
The waitlist, online-event link privacy, ticket cancelling and richer reports are now free; Pro adds discount groups, attendee email campaigns and an event report. Online events now show their join link to ticket holders only unless you choose Everyone. Update the free plugin and Pro together.

= 1.11.3 =
Code-quality clean-up. The admin templates' internal variable names were prefixed. Safe to update.

= 1.11.2 =
Bundled libraries updated. Safe to update.

= 1.11.1 =
Requires WordPress 7.0 or newer (it was 6.9). Safe to update.

= 1.11.0 =
Events moves onto the shared 404ops menu and requires WordPress 6.9 or newer. Safe to update.

= 1.10.0 =
Maintenance release: fixes CSV import dropping backslashes, bundles its own prefixed UI kit; Pro moves to licence client 0.3 (update all 404ops Pro add-ons together). Safe to update.

= 1.9.1 =
Maintenance release: AI features use a private copy of the AI client; re-enter your AI connection once. Safe to update.

= 1.9.0 =
Reserved seating and an offline-capable check-in door. Events without seat maps behave exactly as before. Safe to update.

= 1.8.3 =
Community submissions: submitter notifications, privacy data coverage, and settings controls. Safe to update.

= 1.8.2 =
Community event submissions with a moderation queue. Safe to update; the form only appears where you place the shortcode.

= 1.8.1 =
Internal licensing maintenance; no visible change.


= 1.8.0 =
Adds the free PayPal gateway. Connect it under Settings > Payments with your own PayPal app credentials; Stripe keeps working exactly as before.


= 1.7.0 =
Adds native Zoom / Google Meet meeting creation (Pro). Register your own app with the provider (exact steps on the Meetings tab), paste the credentials under Settings > Meetings, then use Create meeting on the event editor.


= 1.6.0 =
Adds an AI question box on Reports. Requires an AI provider connection (AI Connection screen); the feature is read-only and off until connected.

= 1.3.5 =
Stored AI provider keys are now sealed with authenticated encryption; update recommended.
= 1.3.4 =
Fixes a refund not freeing an attendee's seat (it can now be resold or offered to the waitlist) and restores the onboarding screen's styling.

= 1.0.3 =
Pro now shows an early warning notice before licence-related features would lapse, and no longer keeps a revoked licence active forever on a site whose WP-Cron never runs. Pro users should update.

= 1.0.2 =
Fixes Pro licence activation and update checks against the real licence server. Pro users should update.

= 1.0.1 =
Fixes first-time Pro licence activation. Pro users on a licence that has never activated before should update.

= 1.0.0 =
Initial release.
