=== MotionHub.Studio ===
Contributors: eduardozonta
Tags: booking, appointments, scheduling, fitness, classes
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.24
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to MotionHub.Studio: manage your studio from your dashboard and add booking, calendar and packages with blocks or shortcodes.

== Description ==

MotionHub.Studio is the official WordPress companion for the **MotionHub.Studio** platform, a hosted studio-management service for dance and fitness studios. Connect your studio from your WordPress dashboard, jump to your studio admin with one click, and drop your booking and class components onto any page with a block or a native WordPress shortcode.

**Manage your studio**

* An Overview page in your dashboard with one-click links into your full studio admin — schedule, customers, packages, settings and more. The admin opens securely on the MotionHub.Studio site in a new tab (it is never embedded in wp-admin).
* One-click setup wizard to create or connect your studio.

**Add components to your pages — blocks or shortcodes**

Every component works two ways: as a **block** in the **MotionHub.Studio** block category (drag it in, pick options in the sidebar), or as a native **shortcode** you can paste anywhere. See the full list under **Shortcodes** below.

* **Calendar** — your class schedule, with view, filters and card options.
* **Booking form** — inline or as a button + modal.
* **Packages** — grid or list, grouping, and field toggles.
* **Classes**, **Categories**, **Instructors**, **Events**.
* **Customer account** — sign in and self-service.

A MotionHub.Studio account is required for this plugin to work. See **External services** below.

== Shortcodes ==

Every component is available as a native WordPress shortcode — paste it into any post, page or widget. The studio connection is detected automatically, so there are no IDs or keys to enter. Each shortcode also has a matching block in the **MotionHub.Studio** block category, where you can pick categories, classes and instructors by name and set every option from the sidebar.

* `[motionhub_calendar]` — your class schedule. Common options: `view` (day, week, month), `card_size`, `show_instructor`, `show_availability`, `min_height`. Optional filters: `category`, `service`, `employee`.
  Example: `[motionhub_calendar view="week" card_size="compact"]`
* `[motionhub_appointmentform]` — a booking form, inline or as a button + modal. Options: `display_mode` (inline, modal), `button_label`, `brand_color`, `services`, `min_height`.
  Example: `[motionhub_appointmentform display_mode="modal" button_label="Book a class"]`
* `[motionhub_packages]` — your packages and memberships. Options: `layout` (grid, list), `columns`, `show_price`, `show_duration`, `group_by`, `heading`, `min_height`.
  Example: `[motionhub_packages layout="grid" columns="3"]`
* `[motionhub_classes]` — your classes. Options: `layout` (card, circle), `show_image`, `show_category`, `show_price`, `services`, `min_height`.
  Example: `[motionhub_classes layout="card"]`
* `[motionhub_categories]` — your class categories. Options: `layout` (card, circle), `show_count`, `categories`, `min_height`.
  Example: `[motionhub_categories show_count="1"]`
* `[motionhub_instructors]` — your instructors. Options: `show_photo`, `show_role`, `show_instagram`, `instructors`, `min_height`.
  Example: `[motionhub_instructors show_role="1"]`
* `[motionhub_events]` — your events with ticketing. Options: `min_height`.
  Example: `[motionhub_events]`
* `[motionhub_account]` — a customer sign-in and self-service area. Options: `min_height`.
  Example: `[motionhub_account]`

== External services ==

This plugin relies on the **MotionHub.Studio** platform (a third-party hosted service). The plugin will not function without it.

* **Service:** MotionHub.Studio — a hosted platform for managing dance & fitness studios.
* **Endpoint:** `https://app.motionhub.studio`
* **Studio admin:** your full studio admin lives on `https://app.motionhub.studio`. From the plugin's Overview page you open it with one click — the plugin exchanges your connection key for a short-lived token and opens the admin in a new browser tab on the MotionHub.Studio site. The admin screens are not embedded in your WordPress dashboard.
* **Page components:** the booking/calendar/packages blocks and shortcodes load the platform's component script `https://app.motionhub.studio/js/embed.js`, which renders the component using your studio slug and a publishable embed key.
* **Data sent:** your connection key and the signed-in user's email (to authenticate), plus the parameters of the component being shown (e.g. which class, category or service). No customer payment details pass through your WordPress site.
* **Terms of Service:** https://motionhub.studio/terms
* **Privacy Policy:** https://motionhub.studio/privacy

== Installation ==

1. Install the plugin through the WordPress Plugins screen, or upload it to `/wp-content/plugins/`.
2. Activate it. The setup wizard opens automatically.
3. **Create or connect your studio** in the wizard.
4. Edit any page and add a **MotionHub.Studio** block, or paste a shortcode such as `[motionhub_calendar]`, where you want a component to appear. The connection is detected automatically — there is nothing else to configure.

== Frequently Asked Questions ==

= Do I need a MotionHub.Studio account? =

Yes. The plugin is the WordPress front end for the MotionHub.Studio hosted platform; you connect it to your studio account.

= Does customer card data pass through my WordPress site? =

No. Payments are processed by the studio's configured payment gateway; card details go directly from the customer's browser to that gateway and never touch your WordPress server.

= How do I add a component to a page? =

Two ways, whichever you prefer: insert a block from the **MotionHub.Studio** category (for example "MotionHub: Calendar") and set its options in the sidebar, or paste the matching shortcode such as `[motionhub_calendar]`. Both render the same component. See **Shortcodes** for the full list.

== Changelog ==

= 1.24 =
* New "For You" suggestions component (`[motionhub_suggestions]` shortcode and "MotionHub: For You (Suggestions)" block): show each signed-in customer a personalized set of classes, packages and promotions picked for them by the platform. Ideal for a member home or account page.

= 1.23 =
* Studio signup: the plan picker in the setup wizard now shows the plans your platform marked available in WordPress. A plan can be offered here without appearing on the public pricing page (and vice-versa) — set this per plan under Plan Tiers on the platform admin.

= 1.22 =
* New Programs component (`[motionhub_programs]` shortcode and "MotionHub: Programs" block): list your open enrollment programs — each term or course with its dates, schedule and tuition — for visitors to browse and click through to enroll. Ideal for a Programs or Enroll page.

= 1.21 =
* Events component: new "Show spots left" toggle (block sidebar and `show_spots` shortcode attribute). Turn it off to hide the "X of Y spots left" capacity line on event cards. The "Sold out" badge still shows when an event is full.

= 1.20 =
* Fix: reconnecting your studio (or connecting a new one) now refreshes the embedded widgets automatically. Previously, after a reconnect the calendar, packages and other embeds could keep using an old connection and show "Invalid API key" until the cache cleared on its own.

= 1.19 =
* New `[motionhub_staff_appointments]` shortcode: a private appointments view for your team. Staff sign in to WordPress with the email registered under Employees and see the studio's appointments right on your site; everyone else sees a sign-in prompt instead.
* New `[motionhub_staff_dashboard]` shortcode: the full studio workspace for your team on your own site — staff get the pages their role allows (appointments, customers, schedule and more), with the same sign-in protection.
* Customer Account block/shortcode: new toggles to show or hide each card on the My Account page (Next Appointments, Profile, Packages, Subscriptions, Payment Methods, Gift Cards, Connect Mobile App) — set them in the block sidebar when editing the page.

= 1.18 =
* Maintenance: renamed all internal functions, classes, constants and option keys to a unique "motionhub" prefix, following the WordPress.org guidelines so the plugin can't clash with other plugins or themes. Your studio connection is preserved automatically.

= 1.17 =
* WordPress companion rebuilt as a lean connector: an Overview page that links out to your full studio admin (opened securely in a new tab, never embedded), a one-click studio setup wizard, and block + shortcode components (calendar, booking form, packages, classes, categories, instructors, events, account) backed by the MotionHub.Studio platform.

== Upgrade Notice ==

= 1.24 =
Adds a personalized "For You" suggestions component to show each signed-in customer classes, packages and promotions picked for them, via a block or the `[motionhub_suggestions]` shortcode.

= 1.23 =
The studio signup wizard now shows WordPress-available plans, so you can offer pricing here that isn't on your public site.

= 1.22 =
Adds a Programs component to list your enrollment terms and courses with a block or the `[motionhub_programs]` shortcode.

= 1.21 =
Adds a "Show spots left" toggle to the Events component so you can hide the remaining-capacity line.

= 1.20 =
Reconnecting your studio now refreshes embedded widgets automatically, fixing "Invalid API key" errors after a reconnect.

= 1.19 =
Adds the staff-only appointments shortcode for showing the studio schedule to your team on your own site.

= 1.18 =
Internal naming cleanup for WordPress.org compliance. Your studio connection is preserved — no action needed.

= 1.17 =
Adds an Overview page that links to your studio admin, plus the page-component blocks and shortcodes.
