=== RehAnalytics — By Rehani ===
Contributors: khuzaplugins
Tags: real estate, valuation, analytics, houzez, property
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show a RehAnalytics valuation widget on single property listing pages. Compares the asking price to an ML estimate (Under / Fair / Over).

== Description ==

**See how a listing's asking price compares to the market.**

Khuza RehAnalytics adds a compact valuation widget to single property listing pages on your WordPress site. It compares the asking price to a machine-learning price estimate and shows a simple Under / Fair / Over gauge, so buyers can judge value at a glance.

Connect your site once from Settings → Khuza RehAnalytics, then the widget appears automatically on supported single listing pages.

= Why site owners install it =

* **Build buyer trust** — an independent price signal next to each listing.
* **Keeps buyers on your page** — the estimate loads inline, no redirect.
* **Get Mortgage handoff** — when the Khuza Get Mortgage plugin is active, its button appears inside the widget.
* **Free to install** — no setup cost.
* **Works with your theme** — drops into standard property listing layouts.

= How it works =

1. Install the plugin and connect your site to your Khuza account.
2. On a single property listing page, the plugin reads the listing details (price, location, beds, baths, size, type).
3. It requests an ML estimate from Rehani Soko and renders the Under / Fair / Over gauge.
4. A link to the full valuation report opens on Rehani Soko.

= Coverage =

* Single property listing pages only (not grid cards).
* Kenya and Tanzania listings (v1).
* Tested with Houzez; designed for WP Residence, Estatik, and Real Homes.

**Requirements:**

* A Rehani Soko / Khuza account (register at rehanisoko.com)
* A real estate theme with single property listing pages
* WordPress 6.0 or higher

== External Services ==

This plugin relies on third-party services operated by Rehani Soko.

= Rehani Soko API =

* Service: https://render-prod.rehanisoko-internal.com/api/v1
* Used for: connecting your WordPress site, fetching widget configuration, and requesting the ML price estimate for a listing.
* Data sent: your site URL, connection token/API key, plugin version, and listing metadata (title, price, currency, location, beds, baths, size, property type, page URL).
* When: on plugin connect/disconnect, config refresh, and when the widget loads on a single listing page.
* Terms of service: https://www.rehanisoko.com/terms-of-service
* Privacy policy: https://www.rehanisoko.com/privacy-policy

= Rehani Soko website =

* Service: https://www.rehanisoko.com
* Used for: opening the full valuation report in the buyer's browser.
* Data sent: the listing ID from the API call above.
* When: when a visitor clicks "Full valuation report".
* Terms of service: https://www.rehanisoko.com/terms-of-service
* Privacy policy: https://www.rehanisoko.com/privacy-policy

== Installation ==

1. Upload the plugin through Plugins > Add New > Upload, or install from the directory.
2. Activate it.
3. Go to **Settings > Khuza RehAnalytics** and paste your connection token from your Khuza dashboard.
4. Save. The widget appears on supported single listing pages.

To get a token: log in at platform.rehanisoko.com → Dashboard → Plugins → WordPress → Khuza RehAnalytics → Generate Connection Token.

== Frequently Asked Questions ==

= Does it cost anything to install? =

No. Installation and setup are free.

= Do I need a Rehani Soko account? =

Yes. Sign up at rehanisoko.com and generate a connection token from the Khuza dashboard.

= Where does the widget appear? =

On single property listing pages in supported countries. It does not appear on grid/archive cards or generic WordPress Pages.

= Which markets does it support? =

Kenya and Tanzania in v1. The widget only renders for listings in supported countries.

= Which themes does it work with? =

Tested with Houzez. Designed for WP Residence, Estatik, and Real Homes. Contact support if your listing layout needs a custom hook.

= Does this plugin store buyer data? =

No. WordPress only stores your site connection credentials. Listing metadata is sent to Rehani Soko to compute the estimate; the full report is served on Rehani Soko.

= How accurate is the estimate? =

It is a machine-learning estimate based on comparable sales. When there are too few nearby comparables, the widget shows "No reliable estimate yet" instead of a number.

== Screenshots ==

1. The RehAnalytics widget on a single property listing (Under / Fair / Over gauge).
2. The "No reliable estimate yet" state when comparables are sparse.
3. The plugin settings and connect screen.
4. Widget appearance (accent color) settings.

== Changelog ==

= 1.1.8 =
* Renamed the plugin to "RehAnalytics — By Rehani" and added the Rehani icon

= 1.1.7 =
* Removed the "Powered by" credit from the public widget (Guideline 10 — no attribution on user-facing UI)

= 1.1.6 =
* Documented external services in readme for WordPress.org compliance
* Removed the non-functional valuation request form pending backend support
* Removed debug logging and unused widget assets
* Localized admin connect/disconnect UI strings
* Uninstall now also clears the affiliate attribution option

= 1.1.1 =
* Align connect instructions with Khuza dashboard WordPress tab

= 1.1.0 =
* Sidebar RehAnalytics widget on single listing pages (Kenya/Tanzania)
* ML estimate card with Under/Fair/Over gauge and Get Mortgage handoff

= 1.0.0 =
* Initial release: connect, admin settings, property extraction with neighborhood

== Upgrade Notice ==

= 1.1.7 =
Removes the "Powered by" credit from the public widget to comply with WordPress.org Guideline 10.

= 1.1.6 =
Compliance and cleanup release for WordPress.org review: external services documented, non-functional form removed, admin strings localized.
