=== Easy Event CAD ===
Contributors: easyeventcad
Tags: event planning, party rental, tent, floor plan, event layout
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Put your Easy Event CAD event planner on your WordPress site with a shortcode or block, so customers can lay out their event.

== Description ==

Easy Event CAD lets party and tent rental companies' customers lay out
their event to scale: tents, tables, chairs, dance floors and more, with a
pull sheet and a quote request at the end. This plugin puts your company's
planner on your WordPress site.

The plugin is a thin wrapper. It contains no planning logic of its own: it
outputs the same embed snippet you could copy by hand from your Easy Event
CAD account (Settings, then Embed & branding), using the company code and
display settings you save here. The planner itself is served by Easy Event
CAD, so it stays up to date without plugin updates.

A launcher card (a button or image that opens the planner full screen) is
the default and fits anywhere, even a sidebar. Inline mode puts the planner
straight into a page. You can also show up to two saved example layouts so
visitors see a real starting plan before they click in.

Using the shortcode or block also avoids a common problem: some hosting
security filters (for example ModSecurity) refuse to save or show a page
that contains a pasted script tag. With the plugin, the page only stores
`[easyeventcad]`.

= Features =

* Settings page to store your company code, default mode (Launcher, Inline,
  or Popup), default height, launcher card copy/image, and up to two seeded
  plan previews.
* A real, executing **live preview** on the Settings page — see your actual
  current configuration render before you use it anywhere.
* `[easyeventcad]` shortcode, with optional per-placement overrides:
  `[easyeventcad mode="launcher" launcher_heading="Design Your Tent"]`.
* "Easy Event CAD Planner" block for the block editor (Gutenberg), with the
  same settings available in the block sidebar.
* No API keys, tokens, or secrets are ever stored — your company code is
  public information (it's the same slug in your shareable planner link).

= Requirements =

* An Easy Event CAD account (https://easyeventcad.com). Your company code
  is shown in your account under Settings, Embed & branding, and is the
  last part of your hosted planner link, for example
  `app.easyeventcad.com/d/your-company`.
* If you use the Allowed websites list in your Easy Event CAD account, add
  your WordPress site's address to it, or the browser will not show the
  planner.

== External services ==

This plugin connects to Easy Event CAD (https://easyeventcad.com), a hosted
event-layout service run by Easy Event CAD LLC. It is needed to show the
planner; without it the plugin does nothing.

* What is loaded: on any page where you place the shortcode or block (and
  on the plugin's Settings page, for the live preview), the visitor's
  browser loads the planner script `embed.js` and the planner itself from
  your configured planner host (by default `https://app.easyeventcad.com`).
* What is sent: your company code and display settings, the address of the
  page the planner sits on, and the usual information any browser sends
  with a web request (such as IP address and browser type). Anything the
  visitor enters in the planner (event details, and their name, email and
  phone if they ask for a quote) is sent to Easy Event CAD and shared with
  your rental company. The planner also records anonymous usage events
  (for example, that it was opened).
* Nothing is sent from your WordPress server; the plugin stores only your
  settings, in one WordPress option.

Terms of Service: https://easyeventcad.com/legal/terms
Privacy Policy: https://easyeventcad.com/legal/privacy

== Installation ==

1. Upload the `easy-event-cad` folder to `/wp-content/plugins/`, or install
   the zip via Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Go to Settings → Easy Event CAD and enter your company code (shown in
   your Easy Event CAD account under Settings, Embed & branding).
4. Add `[easyeventcad]` to any post/page, or add the "Easy Event CAD
   Planner" block.

== Frequently Asked Questions ==

= Does this plugin store any of my customers' data? =

No. All planning happens inside the embedded `iframe`, served entirely by
Easy Event CAD. This plugin only stores your company code and display
preferences (mode, height, button label) as a single WordPress option.
Nothing about your site visitors passes through WordPress. See "External
services" above for what the planner sends to Easy Event CAD.

= Can I embed more than one planner (different modes) on the same site? =

Yes — the shortcode and block both accept per-placement `mode`, `height`,
and launcher-copy overrides, so one page can be a launcher card and another
can be forced inline, independent of your saved default.

= What is "Launcher" mode, and why is it the default? =

A launcher is a small card (a button, or your own image) that opens the
full planner in a full-screen overlay when clicked. It's the default
because it works in any placement — a sidebar, a footer widget, a narrow
column. Inline mode renders the planner directly in the page at every
placement size, phones included (since v2.1.0): the embedded planner is
the guided question flow, which is built for small screens — tablets get
full editing, phones get the interview plus a view-only plan with a quote
button. Pick Inline for a dedicated planner page, Launcher for a card
placed among other content.

= Can I show a real starting layout before a visitor clicks in? =

Yes — configure up to two "seed" plan IDs (UUIDs from your Easy Event CAD
account) in Settings, or per-placement via the shortcode/block. With one
seed configured, the launcher opens straight into that plan; with two, the
visitor sees a small picker plus a "start blank" option. A missing, revoked,
or invalid seed silently falls back to a blank planner — it never shows an
error.

= The planner doesn't load — just a blank space or a missing button. =

Two different notes cover the two ways this happens. If the planner
iframe loaded but stays blank for about 12 seconds, your WordPress domain
probably isn't on your Allowed websites list (Settings, Embed & branding
in your Easy Event CAD account; leave the list empty to allow any site, or
add your address, such as https://www.your-site.com); a note saying so
appears under the frame. If nothing appears at all — no iframe, no card — the planner
script itself never ran: a network firewall or DNS filter blocking the
planner domain, or a browser extension blocking third-party scripts.
Since v2.1.0 the placement then shows a note plus a direct link that opens
the hosted planner in a new tab. On a managed office network, ask IT to
allow the planner host you configured under Settings → Easy Event CAD
(by default app.easyeventcad.com).

== Changelog ==

= 2.2.0 =
* Changed: the planner's script tags are now built with WordPress's own
  `wp_get_script_tag()` and `wp_get_inline_script_tag()`, so they follow
  your site's script filters (for example a Content Security Policy nonce).
  The planner looks and works the same.
* Changed: readme for the WordPress.org plugin directory, including an
  "External services" section, and the plugin and author links now point
  at easyeventcad.com.

= 2.1.0 =
* Changed: Inline mode now always renders the planner inline — at every
  placement size, phones included. The app's embedded planner is the
  guided question flow (since the app-side 2026-08-24 cutover), which is
  designed for small screens: tablets get full editing, phones get the
  interview plus a view-only plan with a quote button. The v2.0.0
  "roughly 1100×700px or larger" inline guardrail protected the OLD
  drag-and-drop editor and was silently downgrading every tablet and
  phone visitor to the launcher card in front of the old editor. Launcher
  and Popup modes still render the launcher card. (The actual decision
  runs inside the hosted embed.js — this plugin's emitted snippet is
  unchanged; the note here documents the behavior change a site will see
  once the hosted app ships it.)
* Added: a no-load fallback. If the hosted planner script never runs on a
  visitor's browser — an office firewall or DNS filter blocking the
  planner domain, a browser extension blocking third-party scripts, or
  JavaScript off — the placement used to show literally nothing. It now
  shows a short note plus a direct "open the event planner" link to the
  hosted planner page (and the same link inside <noscript>). The note is
  plain page HTML with no dependency on the planner domain, revealed by a
  small inline check only when the planner iframe has not appeared within
  12 seconds, and it hides itself again if the planner turns up late.

= 2.0.0 =
* Changed: the compiled-in default planner host is now
  `https://app.easyeventcad.com` (the app's custom production domain,
  cut over from `easy-event-cad.vercel.app` in the app's own auth-domain
  cutover follow-up). This only changes the DEFAULT for a fresh install —
  the Planner host field stays admin-overridable exactly as before, so a
  site with an explicit saved host value (including the old vercel.app
  address, which keeps working) is unaffected until that field is cleared.
* Added: support for the embed.js **v2** contract (`embed.js?v=2`) —
  render guardrail + launcher/seeded-launch support. New "Launcher" mode
  (a card that opens a full-screen planner) is now the default for a
  fresh install; Inline only actually renders inline where a placement
  measures roughly 1100×700px or larger, falling back to the launcher
  card automatically everywhere smaller — a plain sidebar or footer
  widget no longer gets a cramped, half-usable inline iframe. "Popup"
  mode is kept as a distinct saved value and behaves the same as
  Launcher going forward. New settings/shortcode/block fields: launcher
  card style (button or image) + image URL, launcher heading/body/CTA
  copy, and up to two "seed" plan IDs (with labels) for showing visitors
  a real starting layout before they click in. **Sites already using this
  plugin keep their own currently-saved mode exactly as configured** —
  upgrading never silently changes an already-working placement's
  behavior beyond the guardrail itself (which only ever helps a placement
  that was too small to be usable inline anyway).
* Added: a real, executing **live preview** on the Settings page — the
  previous read-only textarea-only preview is kept (for copy-paste), but
  the actual widget script now also renders live on the settings screen
  itself, so you can see your current configuration work before using it
  anywhere. Clearly labeled as reflecting this admin screen's own content
  width, not your site's real front-end placement.
* No breaking changes to `[easyeventcad]` or the block's existing
  `mode`/`height`/`label` attributes — all new attributes are additive and
  optional.

= 1.0.2 =
* Changed: the block editor canvas now shows an honest static placeholder
  ("the live planner appears once this page is published or previewed")
  instead of a permanently blank `ServerSideRender` preview. Verified live
  that `ServerSideRender`'s block-renderer REST call succeeds and returns
  the correct markup, but the returned `<script>` tag can never execute
  when injected via React (a fundamental browser behavior, not specific to
  this plugin) — so the "live preview" was always going to be blank for a
  script-based embed. The actual published/previewed page (a real page
  load) renders the planner correctly, confirmed identical to the
  `[easyeventcad]` shortcode's output.

= 1.0.1 =
* Fixed: the block editor's live preview (`ServerSideRender`) never rendered
  anything, on a real WordPress 6.9 site with the modern iframed block
  editor canvas — the block was missing `apiVersion: 3`, which WordPress
  6.9+ requires for full iframe-editor compatibility (a block editor
  deprecation warning explicitly flagged this). Fixed by declaring
  `apiVersion: 3` on the block registration. Found via a real installation
  on a production WordPress site, not caught by local testing against
  WordPress 6.7.

= 1.0.0 =
* Initial release: settings page, shortcode, and Gutenberg block wrapping
  the Easy Event CAD embed.js v1 widget contract.
