=== Inspectius RE – Real Estate Analysis ===
Contributors: xertify
Tags: real estate, property valuation, lead generation, immobilien, contact form
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 2.9.3
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed the Inspectius RE AI-powered real estate analysis into your WordPress site via shortcode or Gutenberg block — no backend required.

== Description ==

Inspectius RE embeds a complete AI-powered real estate analysis directly into your WordPress website. Using the shortcode `[inspectius_analyse]` or the native Gutenberg block, visitors can have properties digitally analysed — without a backend stack and without complex integration. The analysis runs via the central Inspectius API and delivers a modern, data-driven property valuation right on your website.

**Highlights:**

* AI-powered real estate analysis
* Embed via shortcode `[inspectius_analyse]`
* Native Gutenberg editor support
* Direct connection to the Inspectius API
* No backend stack required
* Quick integration into broker, real estate, and partner websites

Ideal for: estate agents, property portals, project developers, partner networks, and PropTech platforms.

**Full feature list:**

* 8-step valuation funnel as a centred modal (property type → address → year built → floor area → condition → features → photo → AI analysis)
* Real-time land value from official sources (BORIS, ALKIS)
* 3D building visualisation based on public LoD2 data
* Lead form step: name, e-mail, phone — stored in the WordPress database
* E-mail notification on every new lead (configurable recipient address)
* Admin dashboard: lead overview, KPI tiles, CSV export
* Broker branding: own logo and agency name shown inside the dialog
* Exit intent: automatically opens the wizard when a visitor is about to leave the page (max. 2× per session)
* Hero shortcode `[inspectius_hero]` for prominent CTA sections
* Scripts and styles are only loaded on pages that contain a shortcode or block

**Requirements:**

This plugin requires an active connection to the Inspectius API (see "External Services" below).

== External Services ==

This plugin communicates with the external service **Inspectius RE API** (default endpoint: `https://inspectius-re.de`).

**What data is transmitted?**

* Property address (entered by the visitor)
* Property type, year built, floor area, condition, features
* Optional: photo of the property (Base64-encoded)
* Coordinates (latitude/longitude, derived from the entered address)

**When is the connection made?**

Only when a visitor actively starts the valuation wizard and enters data. No data is sent on a plain page load.

**External service links:**

* Service: https://inspectius-re.de
* Terms of Service: https://inspectius-re.de/rechtliches/agb.html
* Privacy Policy: https://inspectius-re.de/rechtliches/datenschutz.html

The API endpoint is configurable in the plugin settings (Settings → Inspectius RE).

== Installation ==

1. Install the ZIP via WP Admin under Plugins → Add New Plugin → Upload Plugin.
2. Activate the plugin.
3. Go to **Settings → Inspectius RE**, enter the API base URL, and test the connection with "Test Connection".
4. Optionally set a broker logo, agency name, and lead notification e-mail address.
5. Insert the shortcode `[inspectius_analyse]` or `[inspectius_hero]` on any page.

== Frequently Asked Questions ==

= Do I need an API key? =

No API key is required inside the plugin itself. Access is configured via the API base URL in the plugin settings. An active Inspectius licence on the API server is required.

= Does the plugin work without the Inspectius API? =

No. The valuation wizard needs the API for land values, building data, and the AI analysis. Without an API connection the wizard displays an error message.

= Is visitor data stored? =

Only when a visitor enters contact details in the lead form step and clicks "Next". The data is stored in the WordPress database (`wp_inspectius_leads`) and is visible in the admin dashboard.

= Is the plugin GDPR-compliant? =

The plugin itself does not send any data without an explicit visitor action. It is the responsibility of the WordPress site operator to update their own privacy policy to cover the use of the Inspectius API. Guidance is available at https://inspectius-re.de/rechtliches/datenschutz.html.

= Can I point the plugin to my own server? =

Yes. The API base URL can be set freely in the plugin settings (e.g. a self-hosted Inspectius VPS).

= On which pages are scripts loaded? =

Only on pages that contain the shortcode `[inspectius_analyse]`, `[inspectius_hero]`, or the Gutenberg block. All other pages are not affected.

== Screenshots ==

1. Valuation wizard – property type selection
2. Address input with autocomplete
3. Analysis result with land value and 3D building model
4. Lead form step with broker branding
5. Admin dashboard: lead overview with CSV export
6. Settings page: API URL, logo, lead e-mail

== Changelog ==

= 2.9.0 =
* UX: Preview-Phase komplett neu geordnet: Lageplan/3D oben, dann 3 grosse Haupt-Kacheln (Grundstücksfläche, Bodenrichtwert, Bodenwert), dann Sachwertverfahren-Tabelle, dann Wertindikation ±15%, PV-Potenzialanalyse-Teaser, und vollstaendige Lieferliste (10 Punkte) mit 99-€-CTA
* Feature: Haupt-Kacheln fuer amtliche Kennwerte (gross, mit Amtliche-Quelle-Badge)
* Feature: PV-Potenzialanalyse-Teaser (live via PvgisDienst wenn Koordinaten vorhanden)
* Feature: CTA-Checklist mit vollstaendiger 99-€-Lieferliste statt Phone-Mockup
* CSS: Neue Klassen .haupt-kacheln, .pv-teaser, .moat-block--checklist


= 2.8.0 =
* UX: Schritt-Name im Fortschrittsbalken sichtbar (z. B. "SCHRITT 3 VON 8 · ADRESSE")
* UX: Fortschrittsbalken-Höhe von 3 px auf 8 px erhöht; CSS-Transition greift jetzt korrekt
* UX: Auswahlkarten größer (min-height 112 px Desktop), Schrift 14 px; `.active`-Highlight fix
* UX: Auto-Advance bei Baujahr- und Flächen-Schritt hinzugefügt (war fehlend)
* UX: Adress-Input Desktop: Label steht jetzt korrekt über dem Eingabefeld
* UX: Preis-Range in Preview-Phase in Markenfarbe statt Grau

= 2.7.1 =
* Fix: Lead-API received empty address/type strings (state.draft.* reference corrected)
* Fix: Address lat/lon now invalidated when user edits the address text after resolution
* Fix: Photo loading spinner shown during FileReader validation ("validating" state)
* Fix: Preview photo upload shows error message for invalid file type or size
* Fix: Duplicate @media(max-width:700px) block in re-dialog.css merged

= 2.7.0 =
* Plugin Check compliance: all EscapeOutput, date/gmdate, unslash, and phpcs issues resolved
* Removed load_plugin_textdomain (auto-loaded since WP 4.6)
* Block editor script now explicitly sets in_footer = false
* readme.txt translated to English; Tested up to updated to 7.1

= 2.6.0 =
* All 3D/map libraries (Three.js, Leaflet, OrbitControls, Lod2Viewer, PvgisDienst) bundled locally — no external script downloads

= 2.5.0 =
* Deactivation hook: cleans up transients
* Uninstall hook: removes database table and plugin options on uninstall
* Spam protection: honeypot + IP rate-limiting (5 leads/IP/hour) on the REST endpoint
* Text domain loaded correctly

= 2.4.1 =
* GPL-2.0-or-later licence applied, LICENSE file added
* Updates now managed via wordpress.org (custom update checker removed)
* readme.txt updated to WP.org standard

= 2.4.0 =
* Fix: all Geo API calls (LoD2, orthophoto, streets, vegetation, DGM1) now use the configured API base URL — 3D model works on any domain

= 2.0.0 =
* Compact centred modal instead of fullscreen
* Broker settings: logo, agency name, lead e-mail
* Lead database (wp_inspectius_leads) + REST endpoint
* Lead form step in the wizard after the preview
* E-mail notification on new lead
* Admin page: leads & analysis with KPI tiles + CSV export
* Exit intent with annoyance guard (max. 2× per session)
* Shortcode [inspectius_hero] for hero sections
* WP media picker for broker logo

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.7.0 =
Plugin Check compliance update. Update recommended before submitting to wordpress.org.

= 2.4.0 =
Fixes missing 3D models on non-Inspectius domains. Strongly recommended.
