=== MeetPure Events ===
Contributors: meetpure, rajuru
Tags: events, meetpure, shortcode, event listing, event calendar
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 0.1.28
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display events from your MeetPure account on any WordPress page or post using simple shortcodes.

== Description ==

MeetPure Events connects your WordPress site to the [MeetPure](https://meetpure.events) platform. It fetches your published events via the MeetPure API and displays them in a beautiful, responsive card grid. Individual events open in a full detail page — with cover image, date, location, description, speakers, agenda, and a CTA button — all without leaving your site.

**Features**

* Responsive event card grid with cover image, date badge, event type, and CTA button
* Full single event detail page: description, location, speakers, agenda
* Automatic page title and featured image taken from the event
* Configurable cards-per-row, event count, and section heading
* Support for past events toggle
* Flexible link routing: internal detail page or direct link to meetpure.events
* 5-minute transient cache to minimise API calls
* Theme-inheriting styles via CSS custom properties

== Installation ==

1. In your WordPress admin go to **Plugins → Add New**.
2. Search for **MeetPure Events** or click **Upload Plugin** and select the ZIP file.
3. Click **Install Now**, then **Activate**.
4. Go to **Settings → MeetPure Events** and enter your API Token and Default Team ID.

== Configuration ==

Go to **Settings → MeetPure Events** and fill in:

* **API Token** — Your MeetPure API token (found in your MeetPure account settings).
* **Default Team ID** — The team whose events are displayed by default.
* **Number of Events** — How many events to show per grid (1–100, default 10).
* **Single Event Page** — Select the page that contains `[meetpure_event]` for individual event detail views.

== Usage ==

= Events Grid =

Place the following shortcode on any page or post to display a grid of upcoming events:

    [meetpure_events]

**Available attributes:**

* `team_id` — Override the default team ID for this instance only. Default: *(from settings)*
* `count` — Max events to display (1–100). Default: *(from settings)*
* `title` — Section heading. Pass `title=""` to hide it. Default: `Events`
* `per_row` — Cards per row on large screens (1–6). Default: `3`
* `include_past` — Set to `"true"` to include past events. Default: `false`
* `link_to` — Where cards link: `auto`, `internal`, or `external`. Default: `auto`

`link_to` values:

* `auto` — Links to the Single Event Page if configured, otherwise to meetpure.events.
* `internal` — Always links to the local Single Event Page.
* `external` — Always links to meetpure.events.

**Examples:**

    [meetpure_events]

    [meetpure_events count="6" per_row="2" title="Upcoming Events"]

    [meetpure_events team_id="abc123" include_past="true" title="All Events"]

    [meetpure_events link_to="external"]

= Single Event Detail =

Add the following shortcode to a dedicated page to render a full event detail view:

    [meetpure_event]

When accessed via `?meetpure_event=EVENT_ID` in the URL (linked automatically from the grid), it displays the matching event. You can also hardcode a specific event:

    [meetpure_event event_id="VoUfH"]

**Available attributes:**

* `event_id` — MeetPure event ID. Default: *(read from URL query string)*

= Setting up Individual Event Pages =

1. Create a new WordPress page (e.g. "Event") and add `[meetpure_event]` to its content. Publish it.
2. In **Settings → MeetPure Events**, select that page under **Single Event Page**. Save.
3. Event cards in your grid will now link to `yoursite.com/event/?meetpure_event=EVENT_ID`.
4. The page title, featured image, and document title are automatically replaced with the event's data.

== Frequently Asked Questions ==

= Where do I find my API Token and Team ID? =

Log in to your [MeetPure account](https://meetpure.events), go to your account settings, and copy your API token. Your Team ID is shown in the team/organisation settings.

= Events are not showing up — what should I check? =

1. Confirm your API Token and Default Team ID are correct in the plugin settings.
2. Make sure your team has published events.
3. If you've recently saved settings, the cache has been cleared. Try refreshing the page.

= Can I show events from multiple teams on the same page? =

Yes — use multiple `[meetpure_events]` shortcodes, each with a different `team_id` attribute.

= Can I show past events? =

Yes — add `include_past="true"` to the shortcode: `[meetpure_events include_past="true"]`

= How does caching work? =

API responses are cached for 5 minutes using WordPress transients. Saving the plugin settings clears the cache immediately.

= Can I customise the HTML layout of the event cards or detail page? =

Yes — the plugin supports template overrides. Copy the template you want to change from the plugin's `templates/` folder into a `meetpure-events/` folder inside your active theme, then edit freely. Your changes survive plugin updates.

    wp-content/themes/your-theme/meetpure-events/events-list.php   ← events grid
    wp-content/themes/your-theme/meetpure-events/event-template.php ← single event detail

Child themes are checked before parent themes.

= Can I customise the styles? =

Yes — add custom CSS in the WordPress Customizer (Additional CSS) or your theme stylesheet targeting the plugin's classes such as `.meetpure-card`, `.meetpure-single-event`, `.meetpure-badge`, etc. The plugin also inherits your theme's colour palette automatically via CSS custom properties.



Yes — you can paste the shortcodes into any page builder that supports WordPress shortcodes (Elementor, Divi, WPBakery, etc.).

== External Services ==

This plugin connects to the **MeetPure Events platform** (`https://meetpure.events`) to fetch and display event information.

= MeetPure Events API =

**What it is used for:** The plugin retrieves your team's published events and individual event details from the MeetPure Events platform API so they can be displayed on your WordPress site via the `[meetpure_events]` and `[meetpure_event]` shortcodes.

**What data is sent and when:**

* When the `[meetpure_events]` shortcode is rendered, the plugin sends an HTTP GET request to `https://meetpure.events/api/v1/events` containing: your API token (in the `X-API-Key` header), your team ID (in the `X-Team-Id` header), a requested event count, a status filter (`published`), and optionally a start date to filter out past events. API responses are cached for 5 minutes using WordPress transients; no request is made while a valid cache entry exists.
* When the `[meetpure_event]` shortcode is rendered (or the single event detail page is loaded), the plugin sends an HTTP GET request to `https://meetpure.events/api/v1/events/{event_id}` containing your API token (in the `X-API-Key` header). This request is also cached for 5 minutes.
* No visitor/end-user data is collected or transmitted — only the site owner's API credentials and the requested event identifiers are sent.

**Service provider:** MeetPure Events (`https://meetpure.events`)

* [Terms of Service](https://meetpure.com/tou)
* [Privacy Policy](https://meetpure.com/privacy-policy)

== Changelog ==

= 0.1.4 =
* Compatibility: tested up to WordPress 6.9.
* Update plugin URI to https://meetpure.events/integrations.

= 0.1.2 =
* Fix: events grid spacing now resists theme `gap` overrides via `!important` and an adjacent-sibling margin fallback.
* New `min_width` shortcode attribute on `[meetpure_events]` to tune the wrap breakpoint per instance.

= 0.1.1 =
* Fix: events grid is now container-width responsive (auto-fit + minmax) instead of viewport-only.
* Cards adapt typography and image height when narrow via container queries.

= 0.1.0 =
* Initial release.
* Events grid shortcode `[meetpure_events]` with card layout.
* Single event detail shortcode `[meetpure_event]`.
* Admin settings page with API token, team ID, event count, and single event page picker.
* Automatic page title and featured image from event data.
* Speakers and agenda sections.
* 5-minute transient cache.
* Theme-inheriting CSS via custom properties.

== Upgrade Notice ==

= 0.1.4 =
Compatibility update for WordPress 6.9.

= 0.1.2 =
Fixes events grid spacing and adds `min_width` attribute. Recommended.

= 0.1.1 =
Container-width responsive grid; cards adapt to their own width.

= 0.1.0 =
Initial release.
