=== Minitickets ===
Contributors: minitickets
Tags: events, tickets, ticketing, calendar, event pages
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show your Minitickets events on your WordPress site: a ticket widget, a plain list, a block, shortcodes, and a page on your site for each event.

== Description ==

Minitickets sells tickets for events. This plugin puts your upcoming public events on your own site:

* **The ticket widget** – `[minitickets]`: cards with the cover, the date in the event's time zone, the city, the price and a ticket button. The button opens your event page on Minitickets in a new tab; nothing is bought inside your page.
* **A plain list** – `[minitickets_events]`: rendered by WordPress from your public feed, so it works without JavaScript and search engines read it. Cached for ten minutes.
* **A block** – «Minitickets events» in the block editor, with the same settings.
* **Elementor** – put either shortcode in Elementor's Shortcode widget.
* **Event pages** (1.1.0) – turn on «Make a page on this site for each event» in Settings → Minitickets: each upcoming public event gets its own page on your site (`/events/<event>/`, the address word is a setting) and the list of all of them at `/events/`. You enter an event once, on Minitickets; the page follows it.

= Event pages =

The pages are posts of the type `minitickets_event` (in the REST API too, so Elementor's Theme Builder, the block editor and themes can use them). They are refreshed from your feed every 15 minutes by WP-Cron, at once with «Sync now», and soon after you save the settings.

* Each page shows the cover, the date and time in the event's own time zone, the place (only the city when the venue is hidden), the price («from …», «Free», «Sold out»), the description and a «Buy tickets» button to the event page on Minitickets (new tab; tagged utm_source=wordpress, utm_medium=<your host>, utm_campaign=<your ref>). The page carries schema.org Event data; its canonical address stays your own.
* **What the sync rewrites**: the title, the content (the description), the fields `minitickets_start_at`, `minitickets_start_ts`, `minitickets_end_at`, `minitickets_timezone`, `minitickets_online`, `minitickets_venue_name`, `minitickets_venue_address`, `minitickets_city`, `minitickets_price_from`, `minitickets_currency`, `minitickets_is_free`, `minitickets_sold_out`, `minitickets_url`, `minitickets_cover_url`, and the featured image it downloaded. Change those on Minitickets.
* **What stays yours**: «Your text on this page» (shown under the description), the excerpt, a featured image you choose, and anything else you add.
* An event that ended or left your feed goes to draft (never deleted) and comes back if the event does. A page you put in draft or in the trash yourself is left alone, and a page you delete for good (or that leaves an emptied trash) is not made again. If Minitickets cannot be read, nothing changes.
* Covers are downloaded into your media library once each (only from Minitickets' storage, at most 5 MB); until then the page shows the cover from Minitickets.
* At most the next 50 events are synced.
* With «titles open these pages» ticked, `[minitickets_events]` links each title to its page here.

Sales from your site show in each event's Sources on Minitickets; add a placement label (`ref`) to tell the home page from the calendar.

= Shortcode attributes =

`[minitickets promoter="your-slug" search="watch party" tag="comedy" limit="6" theme="light" accent="#4f46e5" lang="en" minimal="true" show_logo="false" bg_fill="false" ref="home_page" inherit_ref_param="ref"]`

* `promoter`, `user` or `event` – whose events (a promoter's slug, an account's id, or one event's slug). Left out: the organizer from Settings → Minitickets.
* `search` – only events with all these words in the title or description.
* `tag` – only events with this Minitickets tag or category (its slug).
* `limit` – how many (1–20).
* `theme` – `light` or `dark`; `accent` – the button colour; `lang` – `en` or `ru`.
* `minimal` – compact rows with no pictures; `show_logo="false"` – no «Tickets by Minitickets» line; `bg_fill="false"` – a transparent background.
* `ref` – a label carried on the ticket links as utm_campaign; `inherit_ref_param="ref"` – take it from the page's own `?ref=` when the page has one.

`[minitickets_events promoter="your-slug" limit="10" search="…" tag="…" ref="calendar" lang="en"]` – the plain list (limit 1–50).

== External services ==

This plugin shows data from the Minitickets service (https://minitickets.com), which the site owner uses to sell tickets.

* The widget loads the script https://minitickets.com/embed.js in the visitor's browser, which shows a frame from https://minitickets.com/embed/… with the organizer's upcoming public events. The visitor's browser sends the usual request data (address, browser, the page's host) to Minitickets. No cookie is set by the frame.
* The plain list is read by your server from https://minitickets.com/api/widget/<promoter|user>/<id>/events.json (with the limit, filters, ref and your site's host), at most once per ten minutes per list. No visitor data is sent.
* With event pages on, your server reads the same feed every 15 minutes and downloads each event's cover once from Minitickets' storage (Supabase Storage). No visitor data is sent.

Minitickets terms: https://minitickets.com/terms – privacy policy: https://minitickets.com/privacy

== Installation ==

1. Download minitickets.zip from «Widget for your site» on Minitickets (or https://minitickets.com/wordpress/minitickets.zip).
2. In WordPress: Plugins → Add New → Upload Plugin, choose the file, Install, Activate.
3. Settings → Minitickets: choose «Promoter page» or «My events», paste your slug or account id (shown in «Widget for your site»), save.
4. Add `[minitickets]` to a page, or the «Minitickets events» block, or the shortcode in Elementor's Shortcode widget.
5. For a page per event: tick «Make a page on this site for each event», save, then «Sync now».

== Frequently Asked Questions ==

= Does checkout happen on my site? =

No. Ticket buttons open the event page on Minitickets in a new tab, where checkout is safe.

= Which events are shown? =

Upcoming public events only. Drafts and events shared by link only are never listed. A hidden venue is shown as its city.

= My event page says «Page not found». =

Open Settings → Permalinks and press Save once, and check that no page of yours uses the same address word (Settings → Minitickets → Address).

= Can I add an event here? =

No: events come from Minitickets, so you enter each one once. You can add your own text to each page.

== Changelog ==

= 1.1.0 =
* Event pages: a page on your site for each upcoming event (post type `minitickets_event`, archive at /events/, each page at /events/<the event's address on Minitickets>/), synced every 15 minutes and with «Sync now»; your own text on each page is never overwritten.
* schema.org Event data on each event page; the cover downloaded into the media library once.
* `[minitickets_events]` can link titles to the event pages.
* «Delete the event pages when the plugin is deleted» (off by default).
* A «[shortcode]» in an event's description is shown as text, never run; a page you delete for good stays deleted.

= 1.0.0 =
* The ticket widget shortcode, the plain list shortcode, the block, and the settings page.
