=== Integrate Palace Properties ===
Contributors: safdar
Tags: palace, property, real-estate, mri-palace, rental
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 2.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Synchronize property listings from MRI Palace to your WordPress website with beautiful templates, AJAX filtering, and full property management.

== Description ==

Integrate Palace Properties connects your WordPress site to [MRI Palace](https://www.palace.co.nz/) property management software. Properties are automatically synced via a secure cloud-hosted backend, keeping your listings always up to date.

**Key Features:**

* **Automatic Sync** — Properties sync hourly with smart delta detection (only changed properties are updated)
* **6 Beautiful Templates** — Palace Property (default), Classic, Modern, Minimal, Grid Gallery, and Developer
* **AJAX Filtering** — Real-time search, filter by price/bedrooms/bathrooms/region/type/status, sortable
* **Full Property Data** — All Palace API fields: address, rent, features, agent info, custom fields, and more
* **Taxonomy Support** — Property Type, Status, Region, and Management Type taxonomies
* **Display Configuration** — Control exactly which property details appear on your website
* **Theme Override** — Templates can be overridden in your theme's `palace-properties/` directory
* **Schema.org** — Structured data (RealEstateListing) for better SEO
* **Gallery with Lightbox** — Automatic image sync from Palace with keyboard/touch lightbox
* **Responsive** — Fully responsive at all breakpoints
* **Accessible** — Proper ARIA labels, keyboard navigation, screen reader support

**How It Works:**

1. Configure your Palace API credentials in the plugin settings
2. The cloud backend fetches properties from Palace API and sends them to your site via webhook
3. Properties appear as a custom post type with full filtering and beautiful templates

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/integrate-palace-properties/` or install through the WordPress dashboard.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Navigate to **WP Palace Properties → Settings** and enter your Palace API credentials.
4. Enter your subscription key (or leave blank for a free plan with 10 properties).
5. Click **Save Changes**. Properties will begin syncing automatically.

== Frequently Asked Questions ==

= How often do properties sync? =

Properties sync hourly. You can also trigger a manual sync from the Dashboard page.

= Can I control which properties appear? =

Yes. Use the Display Configuration settings to choose which statuses (Active/Inactive) to sync, and which property details to show on the frontend.

= Can I customize the templates? =

Yes. Create a `palace-properties/` directory in your theme and add `single.php` or `archive.php` to override the plugin templates. The Developer template is specifically designed for full CSS customization.

= Does it work with block themes? =

Yes. The plugin works with both classic and block themes (like Twenty Twenty-Five).

== Screenshots ==

1. Dashboard with sync status and property statistics
2. Property archive page with search filters
3. Single property page with gallery and details
4. Template selector with 6 options
5. Display configuration settings

== Changelog ==

= 2.1.0 =
* Gallery sync progress tracking — see which properties are syncing, queued, or failed
* Resync Galleries button — force re-download all property images
* Process Now button — manually trigger gallery syncs without waiting for WP-Cron
* API rate limiting — throttled image downloads to prevent Palace API timeouts
* Fixed critical bug: gallery retry hook name mismatch causing syncs to silently fail
* Fixed gallery image deletion bug where orphan cleanup removed valid images
* Fixed featured_image() helper returning wrong format for templates
* Fixed wp-color-picker dependency error on WordPress 6.9+
* Improved error visibility — failed syncs show actual error messages in dashboard
* Removed unauthenticated AJAX endpoints for better security
* Cleaned up zombie cron events from deleted properties
* Proper uninstall cleanup for all sync metadata and transients
* Dashboard performance improvements — removed heavy cron cleanup from page load

= 2.0.0 =
* Complete rewrite with 6 template system
* AJAX filtering, sorting, and search
* Delta sync — only changed properties are updated
* Full Palace API v2 detailed endpoint support
* Custom taxonomies (Type, Status, Region, Management)
* Display configuration — control what shows on frontend
* Property Helper class for centralized data access
* Schema.org structured data
* Vanilla JS lightbox gallery (no Swiper dependency)
* HMAC webhook authentication
* Idempotent sync with change code tracking
* Admin dashboard with sync status and stats
* WP plugin repo compliance

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.1.0 =
Gallery sync reliability improvements, progress tracking dashboard, and critical bug fixes. Recommended update for all users.

= 2.0.0 =
Major upgrade with new templates, AJAX filtering, delta sync, and full Palace API support. All existing data is preserved with backward-compatible meta keys.
