Integrate MLS listings with property map and add smart sync

Property Map:
- Replace ACF-based property display with MLS database queries
- Use real lat/lng coordinates from MLS (100% coverage)
- Create property-card-mls.php template for MLS property cards
- Update AJAX handler to filter MLS properties

MLS Plugin Enhancements:
- Add 'wp mls run' smart sync command (auto-detects full/incremental/resume)
- Add database index migrations for lat/lng and composite search indexes
- Add comprehensive README.md documentation

Documentation:
- Update site README.md with sysadmin quick reference
- Add FEATURES_PENDING_12_15.md tracking client feature requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hanson.xyz Dev
2025-12-15 22:32:41 -06:00
parent b9cddd2f64
commit fc018ca604
13 changed files with 2346 additions and 308 deletions
@@ -43,6 +43,29 @@ Navigate to **Settings > MLS Settings** to configure:
### Via WP-CLI
#### Smart Sync (Recommended)
The `wp mls run` command is the recommended way to sync. It automatically handles all scenarios:
```bash
wp mls run # Smart sync with progress
wp mls run --quiet # Status messages only
wp mls run --verbose # Full API details
wp mls run --silent # For cron (no output)
```
**What it does automatically:**
- If a sync is already running: aborts (prevents duplicates)
- If a previous sync failed/interrupted: resumes it
- If no data exists: runs full sync
- Otherwise: runs incremental sync
Failed syncs are automatically resumed on the next run - no manual intervention needed.
#### Manual Sync Commands
For more control, use the individual sync commands:
```bash
# Test connection first
wp mls test connection
@@ -54,9 +77,6 @@ wp mls sync full
# Run incremental updates
wp mls sync incremental
# Download pending media
wp mls sync media
# Use --verbose for detailed output
wp mls sync full --verbose
wp mls sync incremental --verbose
@@ -80,17 +100,25 @@ Use `--verbose` for detailed timestamped output showing API requests and individ
Add to your system crontab (`crontab -e`) for scheduled sync:
```bash
# Incremental sync every hour (recommended for production)
# Smart sync every 15 minutes (recommended)
# Automatically handles: initial sync, incremental updates, and error recovery
*/15 * * * * cd /var/www/html && wp mls run --silent --allow-root >> /var/log/mls-sync.log 2>&1
```
That's it! The `wp mls run` command handles everything automatically:
- First run: performs full initial sync
- Subsequent runs: performs incremental sync
- After failures: resumes from where it left off
- Concurrent runs: safely aborts if another sync is running
**For more control**, use the individual commands:
```bash
# Incremental sync every hour
0 * * * * cd /var/www/html && wp mls sync incremental --allow-root >> /var/log/mls-sync.log 2>&1
# Or every 30 minutes for more frequent updates
*/30 * * * * cd /var/www/html && wp mls sync incremental --allow-root >> /var/log/mls-sync.log 2>&1
# Full sync weekly (Sunday at 3am) to catch any missed records
# Full sync weekly (Sunday at 3am) to rebuild from scratch
0 3 * * 0 cd /var/www/html && wp mls sync full --allow-root >> /var/log/mls-sync.log 2>&1
# Download any pending media every 15 minutes
*/15 * * * * cd /var/www/html && wp mls sync media --limit=50 --allow-root >> /var/log/mls-sync.log 2>&1
```
**Important Notes:**
@@ -98,6 +126,7 @@ Add to your system crontab (`crontab -e`) for scheduled sync:
- Redirect output to a log file for debugging
- MLS Grid requires refresh at least every 12 hours per IDX rules
- The plugin handles rate limits automatically (waits if approaching limits)
- Media images are fetched on-demand when properties are viewed (no separate cron needed)
### Via WP-Cron (Alternative)