=== UnitMap – Interactive Site Plan & Unit Availability ===
Contributors: davidcorney4
Tags: interactive-floor-plan, unit-availability, site-plan, real-estate, floor-plan
Requires at least: 6.4
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Interactive site and floor plans for property projects. Visitors click a unit for status, price, and specs, then enquire.

== Description ==

UnitMap turns a site plan or floor plan into a clickable unit map on WordPress.

It is built for property developers, project marketers, and the WordPress agencies who build their sites. Visitors click a unit to see whether it is available, reserved, or sold, along with price and specs, then send an enquiry from the map. Your team draws the units once in wp-admin. After that, status and pricing can stay up to date without a developer — and in Pro, sales can update a Google Sheet and the map follows.

= Draw the plan, then embed it =

Upload a PNG, JPG, or WebP plan image from the WordPress Media Library. Click to draw each unit on the plan, then fill in:

* Unit code (the unique key used for sync)
* Label
* Status: available, reserved, or sold
* Price (currency is configurable: $, €, £, or ₪)
* Area (sqft or m²)
* Rooms and floor
* Optional notes

Status colors are configurable (defaults: available green, reserved amber, sold red). Embed the map with a shortcode or the Gutenberg block. The overlay uses percentage coordinates, so unit shapes stay aligned on desktop and mobile.

= What visitors see =

* A responsive, clickable plan
* Hover tooltip with unit details
* A keyboard- and touch-accessible modal with full specs
* An enquiry form (name, email, phone, message) tied to that unit

Each enquiry is saved as a lead in wp-admin and emailed to the site admin or a per-plan recipient.

= Built to stay light, and to work in RTL =

UnitMap uses vanilla JavaScript and CSS — no React build step, no heavy front-end stack. Layout uses CSS logical properties, so the admin editor and the front-end map work in right-to-left languages. v1.0 ships English and Hebrew (he_IL) translations and a .pot file. Arabic and other RTL sites get a correct RTL layout; further translations can be added from the .pot file.

= Free vs Pro vs Agency =

**Free** (wordpress.org, GPLv2+)

* 1 plan, 1 level (no floor or building switcher), up to 10 units
* Plan images: PNG, JPG, or WebP (no SVG upload in v1.0)
* Visual polygon editor in wp-admin
* Front-end map, tooltips, unit modal, and enquiry form
* Leads stored in wp-admin, with email notification
* Shortcode and Gutenberg block
* English and Hebrew translations, with native RTL layout
* Configurable currency and area units

**Pro — $99/year, 1 site**

Everything in Free, plus:

* Unlimited plans and unlimited units
* In-map multi-floor / building switcher (each level has its own image and units; visitors switch levels without a page reload)
* Live Google Sheet CSV URL sync — paste a published spreadsheet CSV URL; no Google OAuth or API keys. Cached (default 15 minutes), refreshed on a schedule, with a Sync Now button and last-sync status
* Manual CSV import and export (UTF-8 with BOM). Import updates status, price, area, rooms, floor, and notes by unit code, and leaves polygon shapes untouched
* Front-end filter bar: status, price min/max, rooms, and floor. Non-matching units dim and cannot be clicked. Shows a live matching count
* Lead export to UTF-8 BOM CSV, filterable by plan and date

**Agency — $199/year, 10 sites**

Everything in Pro, licensed for up to 10 sites.

== Installation ==

1. In wp-admin, go to Plugins → Add New, search for “UnitMap”, and click Install Now. Or upload the plugin zip under Plugins → Add New → Upload Plugin.
2. Activate UnitMap.
3. Open UnitMap in the admin menu and create a plan. Upload a PNG, JPG, or WebP plan image, draw each unit, and fill in its details.
4. Embed the map on any page or post with the shortcode or the Gutenberg block (see below).

= Shortcode and block =

Shortcode (replace `123` with your plan’s ID):

`[unitmap_map id="123"]`

Gutenberg: insert the UnitMap block (`unitmap/map`) and set the same plan ID.

The shortcode also works in Elementor and other page builders that support WordPress shortcodes.

== Frequently Asked Questions ==

= Does it work with Gutenberg, Elementor, and other page builders? =

Yes. There is a native Gutenberg block (`unitmap/map`). In Elementor, Bricks, Oxygen, and other builders, add a shortcode or HTML widget and paste `[unitmap_map id="123"]`. There is no separate Elementor widget in v1.0.

= How does Google Sheet sync work? Do I need API keys? =

Google Sheet sync is a Pro feature. You publish the sheet as a CSV (or use a Google Sheet export CSV URL) and paste that HTTPS URL in the plan settings. UnitMap fetches the file — no Google account connection, no OAuth, and no API keys. Rows are matched to units by unit code. The sheet is cached (default 15 minutes), refreshed on a schedule, and you can click Sync Now at any time. Manual CSV import and export are also included in Pro.

= Is Hebrew or Arabic supported? =

The admin editor and the front-end map are RTL-native, so Hebrew and Arabic sites lay out correctly. v1.0 ships English and Hebrew (he_IL) translations and a .pot file. An Arabic translation is not bundled in v1.0; you can add one from the .pot file.

= What image formats can I upload? =

PNG, JPG, and WebP, through the WordPress Media Library. SVG plan uploads are not supported in v1.0. Unit outlines are drawn as a vector overlay on top of the raster image, so the click areas stay sharp when the map scales.

= How do Pro and Agency licenses work? =

The plugin on wordpress.org is the Free version, licensed GPLv2 or later. Pro ($99/year, 1 site) and Agency ($199/year, 10 sites) are licensed upgrades via Freemius. Upgrade links appear on UnitMap’s own admin screens. After purchase, the Pro features above are unlocked on the licensed site(s).

= Does the map work on phones? =

Yes. The map is responsive, unit shapes use percentage coordinates so they stay aligned on small screens, and the unit modal is keyboard- and touch-accessible.

= What is included in the Free version? =

One plan, one level, and up to 10 units, plus the editor, front-end map, enquiry form, leads, shortcode, Gutenberg block, and English/Hebrew translations. Multi-floor switching, Google Sheet sync, CSV import/export, the front-end filter bar, unlimited plans or units, and lead CSV export are Pro.

= Can sales change prices without logging into WordPress? =

In Pro, yes — update the published Google Sheet (or import a CSV). The map updates on the next sync. In Free, unit details are edited in wp-admin.

== Screenshots ==

1. An interactive site plan. Hover a unit to see its status and price.
2. Click a unit for specs and send an enquiry without leaving the map.
3. Draw unit outlines on your plan image in wp-admin. No code required.
4. Pro: switch buildings and floors inside the map, with no page reload.
5. Pro: filter units by status, price, rooms, and floor. Non-matches dim out.
6. Pro: sales updates a published Google Sheet; the map syncs on a schedule, with no API keys.
7. The same map in a right-to-left Hebrew layout.

== Changelog ==

= 1.0.0 =
* Initial release.
* Interactive site and floor plans with a visual polygon editor (PNG, JPG, or WebP).
* Unit status (available, reserved, sold), price, area, rooms, floor, and notes.
* Front-end map with hover tooltip, unit modal, and enquiry form.
* Leads stored in wp-admin, with email notification.
* Shortcode `[unitmap_map]` and Gutenberg block `unitmap/map`.
* English and Hebrew (he_IL) translations, plus native RTL layout.
* Pro: unlimited plans and units, multi-floor / building switcher, live Google Sheet CSV URL sync, manual CSV import/export, front-end filter bar, and lead CSV export.

== Upgrade Notice ==

= 1.0.0 =
Initial release of UnitMap.
