=== Khuza Get Mortgage ===
Contributors: khuzaplugins
Tags: mortgage, real estate, east africa, property finance, diaspora
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.25
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a "Get Mortgage" button to your property listing pages. Buyers compare mortgage offers and apply through Rehani Soko.

== Description ==

Khuza Get Mortgage adds a **Get Mortgage** button to singular property listing pages on your WordPress site. Tested with Estatik and Houzez; designed for Real Homes and similar real estate themes. When a buyer clicks the button, they open Rehani Soko's full mortgage quotes flow in a popup — compare bank offers, send an inquiry, or start an application.

**Features:**

* Auto-injects on property listing pages when connected
* Extracts listing price, location, and property type from your theme
* Opens the full Rehani mortgage quotes and application flow
* Connection managed from Settings → Khuza Mortgage
* No buyer application data stored in WordPress

**Requirements:**

* A Rehani Soko / Khuza account (register at rehanisoko.com)
* A real estate theme with property listings
* 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 button settings, and creating mortgage sessions when a visitor clicks "Get Mortgage".
* Data sent: your site URL, connection token/API key, plugin version, and listing metadata (title, price, location, beds, baths, images, page URL).
* When: on plugin connect/disconnect, config refresh, and each button click.
* 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 mortgage quotes and application flow in the buyer's browser (popup).
* Data sent: session/listing ID from the API call above; mortgage application data is entered by the buyer on Rehani Soko (not stored in WordPress).
* When: when a visitor clicks "Get Mortgage".
* Terms of service: https://www.rehanisoko.com/terms-of-service
* Privacy policy: https://www.rehanisoko.com/privacy-policy

== Installation ==

1. Upload the plugin zip via Plugins → Add New → Upload Plugin, or copy the folder to `wp-content/plugins/`.
2. Activate **Khuza Get Mortgage**.
3. Go to **Settings → Khuza Mortgage**.
4. Generate a connection token in the Khuza dashboard and paste it into the settings page.
5. Click **Connect**.
6. Open a property listing page on your site — the **Get Mortgage** button should appear.

== Frequently Asked Questions ==

= Do I need a Rehani Soko account? =

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

= Does this plugin store buyer data? =

No. Listing snapshots and applications are processed on Rehani Soko servers. WordPress only stores your site connection credentials.

= Which themes are supported? =

Tested with Estatik and Houzez. Designed for Real Homes and other themes with standard property listing pages. The button appears on singular property pages with a detectable price.

= Does it work on a regular WordPress Page? =

The button is designed for property listing pages from real estate themes, not generic Pages.

= Will a credit link appear on my site? =

No, not by default. Attribution is disabled unless you enable it in your Khuza dashboard. When enabled, a small optional "Powered by Khuza" link may appear below the button linking to rehanisoko.com.

== Screenshots ==

1. Get Mortgage button on a property listing page
2. Plugin settings page showing connection status
3. Mortgage quotes popup opened from the button

== Changelog ==

= 1.2.10 =
* Add translators comments for placeholder strings in AdminSettings
* Escape admin page header badge output in AdminPage
* Remove load_plugin_textdomain (WordPress.org loads translations automatically)
* Prefix uninstall loop variable for Plugin Check

= 1.2.9 =
* Use literal i18n strings in AdminPage for WordPress Plugin Check compliance

= 1.2.8 =
* Load text domain on init to fix WordPress 6.7+ translation notices
* Defer admin menu title translation until admin_menu (after text domain loads)

= 1.2.7 =
* WordPress.org review: unique khuzgemo_ prefixes for functions, classes, options, and transients
* Fix stats transient naming (fully prefixed khuzgemo_cfg_stats_* keys)

= 1.2.4 =
* Places the Get Mortgage button near the property price on Houzez and similar themes (instead of below the mortgage calculator)

= 1.2.3 =
* Houzez property extraction: reads country, city, and currency from taxonomies, meta fields, and map address fallbacks

= 1.2.2 =
* Documents external services for WordPress.org compliance
* Fixes privacy and terms URLs in readme
* Attribution link off by default; optional when enabled in Khuza dashboard

= 1.2.1 =
* Fixes mortgage popup blocked by browsers on partner sites
* Adds page URL support for partner listing links

= 1.2.0 =
* WP mortgage session flow: popup to full /quotes with external listing support
* Property extraction for Houzez, Real Homes, and Estatik
* Currency and embed mode support

== Upgrade Notice ==

= 1.2.10 =
Plugin Check compliance fixes for i18n, escaping, and naming.

= 1.2.9 =
Fixes WordPress.org automated Plugin Check i18n scan failures.

= 1.2.8 =
Fixes WordPress 6.7+ textdomain loading notices in debug mode.

= 1.2.7 =
Prefix and transient naming fixes for WordPress.org plugin guidelines compliance.

= 1.2.4 =
Houzez-tested release: improved location extraction and button placement near the listing price.

= 1.2.2 =
Readme and external services documentation updates for WordPress.org review.

= 1.2.1 =
Fixes mortgage popup blocked by browsers on partner sites.

= 1.2.0 =
External WordPress listing mortgage flow via wp-mortgage sessions.
