=== AI Real Estate by Smashre ===
Contributors: smashre
Tags: real estate, property listings, ai chatbot, lead capture, property viewing
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 0.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI property assistant for agencies: answers from your own listings, takes enquiries and viewing requests, syncs with Smashre AI.

== Description ==

AI Real Estate by Smashre is the WordPress part of the Smashre AI real estate service. It needs a Smashre AI account with the AI Real Estate product. Without an account the plugin installs, but the chat widget stays hidden.

= What it does =

* **AI chat widget** on your site. Visitors ask in plain language ("3-bed house for sale in Lahore under 3 crore") and get answers based on your listings.
* **Listing cards that cannot be invented.** The AI only names listings; every card's title, price, photo and link is read from your WordPress site at that moment. Unpublished, password-protected or excluded listings are never shown.
* **Contact an agent** and **Request a viewing** forms inside the chat. Viewing requests are clearly marked as requests until your team confirms them.
* **Automatic listing sync**: changes are sent about a minute after you save a listing, and a full check runs daily. Listings you unpublish or delete are removed from Smashre AI.
* **Field mapping** for any listing post type: map price, rent period, currency, sale/rent, status, type, bedrooms, bathrooms, area, unit, address, city, area/neighbourhood, amenities, furnished, coordinates and photo gallery to custom fields or taxonomies. A preview shows exactly what will be shared.
* **Presets** for the Houzez and RealHomes themes fill in the usual field names. They have not been tested against those themes yet, so check the preview.
* **Consent first**: nothing a visitor types is sent until they tick the notice; enquiries store the exact consent text they agreed to.
* **One-click connection** to your Smashre AI account. No API keys to copy.

= What it does not do =

* It does not take payments, reservations or offers, prepare contracts, or handle closing or key handover.
* It does not import listings from property portals or MLS feeds.
* It never changes or deletes your WordPress listings.

== External services ==

This plugin connects to **Smashre AI** (https://smashre.com), operated by Smashre AI. Nothing is sent until an administrator connects the site.

What is sent, and when:

* **Connecting the site** (when an administrator presses "Connect to Smashre AI"): the site address and name, the WordPress, PHP and plugin versions, and the site language. The administrator signs in on smashre.com to approve the site.
* **Status checks** (twice a day while connected): the site token and site address, to read the subscription status.
* **Chat** (when a visitor has ticked the chat notice and sends a message): the message, a random chat session ID, the page address and the site language.
* **Enquiries and viewing requests** (when a visitor has ticked the contact notice and submits the form): the details entered (name, email, phone, message, budget, preferred area, preferred date and time), the property, the page address and the consent text.
* **Listing sync** (after an administrator ticks the authorization box): published listings of the chosen post type — title, link, description, the mapped facts, image addresses and dates.

Visitor IP addresses are not sent. They are used on your site only, in hashed form, to limit message rates.

* Terms of service: https://smashre.com/terms
* Privacy policy: https://smashre.com/privacy

== Installation ==

1. In WordPress, go to Plugins → Add New → Upload Plugin, choose `ai-real-estate-by-smashre.zip` and activate it.
2. Go to Settings → AI Real Estate and press **Connect to Smashre AI**. Sign in to your Smashre AI account (or create one), choose your organization and approve the site.
3. On the **Listings** tab, choose the post type that holds your properties and map the fields (or apply a theme preset). Check the preview.
4. Tick the authorization box to confirm you may market these listings, and save. The first sync starts automatically; the **Sync** tab shows progress.
5. On the **Chat widget** tab, switch on the widget.

Sync uses WP-Cron, which runs when the site has visitors. On low-traffic sites, set up a real cron job for `wp-cron.php`.

== Frequently Asked Questions ==

= Do I need a Smashre AI account? =

Yes. The plugin connects your site to the Smashre AI service, which runs the AI assistant and stores enquiries. Plans and prices are on https://smashre.com.

= Can the assistant show a price that is not on my site? =

Listing cards cannot: they are rebuilt from your WordPress data for every answer. The written reply comes from the AI service, which is instructed to use only your synced listings.

= What happens if I disconnect or uninstall? =

Disconnecting stops the widget and sync and tells Smashre AI. Uninstalling always removes the site token. Settings are kept unless you tick "Delete this plugin's settings" on the Privacy tab. Your listings are never changed.

= Can I keep a listing out of the assistant? =

Yes. Tick "Do not share this listing with the AI assistant" on the listing's edit screen.

= Is my theme supported? =

Any theme or plugin that stores listings as a custom post type with custom fields or taxonomies can be mapped. Houzez and RealHomes presets are provided but are untested.

== Screenshots ==

1. Chat answer with listing cards built from the site's own data.
2. Viewing request form.
3. Connection status in the settings.
4. Field-mapping preview.
5. Sync status and log.

== Changelog ==

= 0.2.2 =
* Fixed: settings upgrade ran before `init`, which made WordPress 6.7+ report translations loaded too early. (The 0.2.1 package was built before this fix.)

= 0.2.1 =
* Readme: shorter summary (WordPress Plugin Check). Removed an empty placeholder file.

= 0.2.0 =
* New: connect to a Smashre AI account with one click (authorization code with PKCE); a manual token remains available under Advanced.
* New: automatic listing sync (incremental and daily full), with retry, sync log and status.
* New: mapping for 18 listing facts to custom fields or taxonomies; untested Houzez and RealHomes presets; mapping preview.
* New: "Contact an agent" and "Request a viewing" forms with consent records.
* New: listing cards in chat, built from WordPress data only.
* New: per-listing "do not share" option.
* New: subscription status from Smashre AI; widget and sync pause when the plan does not include them.
* Changed: branding is now Smashre AI; default service address https://smashre.com/api/real-estate.
* Changed: uninstall keeps settings unless you opt in; the token is always removed.
* Fixed: button text contrast with some themes.

= 0.1.0 =
* First skeleton: settings, site token, chat widget, signed listing feed, generic custom-post-type adapter.

== Upgrade Notice ==

= 0.2.2 =
Fixes an early-translation notice after upgrading from 0.2.0.

= 0.2.1 =
No functional changes from 0.2.0.

= 0.2.0 =
Adds one-click connection and automatic listing sync. After updating, open Settings → AI Real Estate, connect the site and tick the listing authorization box: sync stays off until you do.
