=== N8 Manager Events ===
Tags: events, event calendar, tickets, shortcode, woocommerce
Requires at least: 6.7.2
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 2.0.8
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Publish event cards and detail pages with venues, organizers, lineups and ticket links. Includes an optional WooCommerce product import.

== Description ==

Connect your N8 Manager instance and choose the events for this WordPress website. Automatically synchronize selected events and embed their N8 ticketshops. Each website has its own selection; no per-event export configuration in N8 Manager is required.

N8 Manager Events adds independent event content to WordPress. It works without WooCommerce, FooEvents, a paid account or a specific theme.

Features:

* Native WordPress blocks: N8 Event Cards and N8 Event Accordion, with server-rendered editor previews and per-block filters.
* Accessible accordion listings work without frontend JavaScript. Upcoming published events are shown by default.

* Per-website event selection with search and background synchronization in small batches.
* Custom HTTPS instance domains and subdirectories; read-only bearer authentication.
* Preserve existing N8-linked event URLs, optional local text/image overrides, draft or immediate publication.
* On failed sync keep existing events; withdrawn/deselected events become drafts only after a complete successful sync.
* Integrated N8 iframe resizing and scrolling without executing arbitrary pasted JavaScript.

* Event cards through [event_cards] or [ecm_events].
* Event detail pages and archives for classic and block themes; theme overrides are respected.
* Start and end dates and times, venues, organizers, categories, lineups and featured images.
* Consistent upcoming, ongoing, past, sold-out, cancelled and postponed states.
* Ticket links, optional administrator-managed embeds and fallback links.
* Responsive layouts, Dark and Light themes, live design preview and accessible copy-link feedback.
* Password protection for event details, structured data and REST metadata.
* Event metadata revisions and validated REST fields. Connection keys and import identities are not exposed through REST.
* Optional, paginated WooCommerce product copying into event drafts. Existing values are preserved when filling missing data.
* Data retention on uninstall by default.

The current administration interface is German and translation-ready. A translation template is included. Date formats and the timezone follow your WordPress settings.

This plugin does not process payments, create tickets, manage seat inventories or migrate FooEvents attendees, tickets or orders. Product dates detected from titles must be reviewed before publishing imported drafts.

= External services and privacy =

The plugin has no telemetry, license server, automatic remote code downloads, external fonts or required external API. Installing or activating it does not require sending event data to a service.

N8 Manager is an external event and ticketing service: https://n8manager.de/ . It may be commercially operated and may require a service account. The site administrator chooses the instance URL; there is no default connection or central telemetry. Create a read-only website key once at your instance's /admin/wordpress_events.php page, then explicitly connect in Events > N8 Manager and select the events for this website.

The server contacts the selected HTTPS instance at /integrations/wordpress_events.php to retrieve a catalogue and the selected event IDs. It sends the read key only in the Authorization header, never to visitors, image hosts, or redirect targets. No WordPress visitor or customer records are sent by this sync. Event images on the configured instance are copied into the local media library. Background jobs run approximately every 15 minutes through WordPress Cron, with bounded batches, timeouts and failure backoff.

An N8 ticket iframe connects the visitor's browser directly to the configured instance when loaded, exposing ordinary connection information such as the visitor's IP and browser headers to that service. Checkout, cookies, payment and any service-side tracking are managed by that instance. Review its operator's service terms and privacy policy and configure your site's consent tools as required. Those documents depend on the independently operated instance; the plugin does not impose a single operator or provider domain. Link-only ticket mode remains available. The plugin itself does not forward checkout events to advertising platforms.

Pasted legacy N8 iframe snippets are accepted as input to extract the ticket URL. Additional JavaScript is not executed. Existing stored snippets are retained until an administrator edits them; output always uses the plugin's own iframe renderer and bundled JavaScript.

The Facebook and WhatsApp share links open those services only when clicked. Instagram and TikTok buttons copy the event URL locally; they do not contact those platforms. Facebook: https://www.facebook.com/privacy/policy/ and https://www.facebook.com/terms.php . WhatsApp: https://www.whatsapp.com/legal/privacy-policy and https://www.whatsapp.com/legal/terms-of-service . The email link opens the visitor's mail application.

The plugin stores event content, venue and organizer details in the WordPress database, plus short-lived rendered card caches and per-user validation/import notices. It does not collect attendee or payment data. Uninstalling retains event data unless an administrator explicitly enables deletion in Events > Settings. Media files and WooCommerce source products are always retained.

== Installation ==

1. In WordPress, open Plugins > Add New > Upload Plugin and select the event-cards-manager ZIP.
2. Install and activate it. WordPress 6.7.2+ and PHP 8.1+ are required.
3. Create an event under Events, enter its start date and publish it.
4. Add [event_cards] to a Shortcode block on a page.
5. Optionally publish venues and organizers before selecting them in events.
6. Use Events > Design to customize the appearance.

When upgrading from 0.6.1, replace the plugin through WordPress's upload/update flow. Keep a backup first. Existing event IDs, metadata keys, categories and shortcode names are retained. Do not uninstall the old version to upgrade it.

== Frequently Asked Questions ==

= How do I choose the design? =

Events > Design offers Dark and Light with an optional accent color. Select a color or enter #RRGGBB; clearing it restores the theme default. Button text uses automatic black/white contrast; accent text brightness is adjusted when needed. Both use explicit surface and text colors so event components remain readable against light and dark site backgrounds. The live preview uses the production component stylesheet, supports desktop/mobile widths and a light/dark preview background, and updates before saving. Save to apply the chosen theme to the public site. Existing custom values are retained until a new theme is saved; their stored values are preserved afterwards. The preview is a sample, not a copy of your active WordPress theme or an external ticket shop.


= Can I change the event URL base? =

Yes. Events > Settings lets administrators set separate global bases for events (including the archive) and event categories. Defaults are event and event-bereich. Known conflicts with WordPress routes, existing pages, post types and taxonomies are rejected for new bases. Rewrite rules refresh automatically after saving. Existing event IDs and shortcodes remain unchanged. Old routes are released; update external links or configure redirects separately. Pretty permalinks must be enabled. Custom routes registered outside the standard WordPress post-type/taxonomy APIs may still require manual checks.


= Does this work without WooCommerce? =

Yes. WooCommerce is only needed when you use the optional product import. The event editor, cards, pages and ticket links are independent.

= How do I configure the cards? =

Use Events > Shortcode or insert examples such as:

[event_cards limit="9" columns="3"]
[event_cards bereich="festivals" tickets_only="true"]
[event_cards status="past" sort="date_desc"]
[event_cards include="12,34" exclude="56" image_ratio="poster"]

The limit is 1–99. Supported sorts are date_asc, date_desc, title_asc and menu_order. When include and exclude overlap, excluded IDs are removed. Events without a start date and password-protected events are excluded from public cards. The legacy ecm_events alias remains available.

= How are ongoing and past events determined? =

An event remains in current cards through its end date, or through its start date if no end date is set, using the site's timezone. Status filters and badges use the same calendar-day rule. A manually assigned Past status also hides an event from current cards. End times are displayed in structured data but do not remove cards halfway through a day.

= What happens when ticket sales are disabled? =

Ticket mode None hides the entire ticket section, including any stored fallback URL. Past, cancelled and sold-out events do not display purchase links or embeds. A configured notice may remain visible in an enabled ticket section. Stored ticket information is retained so that an administrator can deliberately re-enable it later.

= Can I keep existing N8 embeds and URLs? =

Yes. Existing N8 iframe snippets are read for their ticket URL. Known N8 resize and scroll messages are handled by the bundled integration, with origin, frame and event-ID validation. Automatic imports reuse an existing event only when its N8 ticket URL matches unambiguously. Additional pasted scripts are not executed; custom advertising integrations require their own consent-aware implementation.

= What does the product import update? =

New imports create event drafts. Reimporting with the fill-missing option preserves populated fields, status, ticket configuration, image and assigned categories. It only fills missing data. Internal WooCommerce products use their product page as the ticket destination. Orders, payments and FooEvents ticket data are not copied or changed.

= Can my theme override the event templates? =

Yes. Classic themes can supply single-ecm_event.php and archive-ecm_event.php. Block themes can customize the Event Detail and Event Archive templates in the Site Editor. The plugin supplies fallback templates and does not rewrite unrelated HTML, redirects or tracking code.

= Is there an API? =

The standard wp/v2/ecm_event endpoint exposes registered event fields under meta. Normal WordPress authentication and editing permissions apply. Invalid dates, times, references and prices return an error. Raw scripts and migration provenance are not public API fields. Protected event metadata is hidden without the normal password cookie or edit permission.

== Changelog ==

= 2.0.8 =
* Add Event Cards and Event Accordion block variations with shared cached queries and live editor previews.
* Add opt-in tiles and accordion shortcode layouts; preserve existing list appearance.
* Add native keyboard-accessible accordion details and responsive light/dark styles.

= 2.0.7 =
* Large event image, countdown sidebar and ticket shortcut. Typographic lineup with accent separators. Countdown runs locally without API requests and respects event timezone and status.

= 2.0.6 =
* Sharp event detail design, accent flyer corners and date highlight, uniform lineup grid and improved mobile typography.

= 2.0.5 =
* Refined event tiles with flat surfaces, subtle brand-colored icon details and a framed flyer in both themes.

= 2.0.4 =
* Responsive event details layout without an empty poster column beside the description. Event titles follow theme casing and weight.

= 2.0.3 =
* Neutral light-theme surfaces and borders; readable neutral text with bright brand colors, preserving vivid buttons and icons.

= 2.0.2 =
* Neutral black/gray dark theme; restore spacing around ticket headings without adding padding to the embedded shop.

= 2.0.1 =
* Event selection shows upcoming and ongoing events by default, sorted by date. Past events can be shown without losing saved selections.

= 2.0.0 =

* N8 instance connection, per-website event selection, bounded background synchronization and local overrides.
* Integrated N8 iframe handling replaces arbitrary JavaScript execution.
* Preserve existing event identities, URLs, designs, shortcodes and the 1.0.7 query performance fix.

= 1.0.7 =

* Fix severe database load in event and ticket lists by replacing multiplying metadata joins with indexed existence checks.

= 1.0.6 =

* Remove the additional ticket-section padding when an executable embed is displayed. Link-only sections retain their spacing.

= 1.0.5 =

* Add an optional accent color with live picker, hexadecimal input and theme-default reset.
* Automatically choose readable button text and adjust accent text brightness to the selected theme.


= 1.0.4 =

* Replace the complex color editor with Dark and Light themes.
* Rebuild live preview using the production component stylesheet in an isolated frame.
* Add preview backgrounds and responsive widths; fix button hover contrast and ticket spacing.
* Retain old custom settings until a new theme is explicitly saved.


= 1.0.3 =

* Add configurable event/archive and event-category URL bases with validation and known-conflict checks.
* Refresh rewrite rules and event caches only when the bases change.


= 1.0.2 =

* Restore administrator-managed ticket embed/script support on any provider domain for private installations.
* Retain existing snippets unchanged, including N8 resize, scroll, return and tracking handlers.
* No claim of WordPress.org submission compliance for this distribution.

= 1.0.0 =

* Hardened password protection, REST metadata and script editing permissions.
* Added validated fields, event metadata revisions and end times.
* Unified ongoing/past status and ticket availability rules.
* Preserved existing values during product import; added pagination, import locks and result messages.
* Removed site-specific whole-page JavaScript rewriting and redirect interception.
* Added classic and block theme templates, working design variables and reliable sharing scripts.
* Added complete opt-in uninstall cleanup, documentation and a reproducible release package.

== Upgrade Notice ==

= 2.0.0 =

Adds N8 event synchronization and integrated iframe handling. Existing URLs and designs stay intact. Additional pasted JavaScript is no longer executed. Configure the connection and event selection under Events > N8 Manager.
