Snapshot: MLS sync fixes, image refresh, plugin/theme updates
MLS plugin fixes from this session: - Fix silent insert failures: location column NOT NULL was rejecting wpdb->insert calls, causing ~18k new properties since Dec 2025 to be lost. Inserts now build raw SQL with ST_PointFromText so the spatial column is populated atomically. - Auto-refresh expired media URLs in MLS_Media_Handler::fetch_and_cache(), guarded by a property-level GET_LOCK so concurrent fetches share one API refresh. - Normalize WP_Error to null in mls_get_property_image() so callers can rely on the documented string|null contract. - Support comma-separated property_type filters in MLS_Query and MLS_Cluster so the homepage "View All Commercial" link (?property_type=Commercial+Sale,Land,Farm) actually filters correctly. - Incremental sync now looks back 10 minutes past the latest modification timestamp as a safety margin against missed records. - Smart sync exits silently (info-level, not warning) when a full sync is in progress. Operational: - New cron: weekly full sync Sundays at 3 AM (/usr/local/bin/mls-full-sync). - New cron: hourly 2GB cap on mls-thumbnails/ and cache/transformed-images/ (/usr/local/bin/mls-image-cache-cap). - Logrotate config for wp-content/debug.log (2-day retention, daily rotation, delaycompress). Repo policy: - CLAUDE.md updated with explicit "commit everything except build artifacts" policy. - .gitignore: untrack runtime image caches and debug.log rotations. Other modifications in this snapshot are pre-existing in-flight theme/plugin/db_content_updates work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,18 @@ Custom WordPress theme for HomeProz Real Estate (Albert Lea, MN). Dark/rust bran
|
||||
7. **No custom animations** - keep it static and fast
|
||||
8. **ASK before architectural decisions**
|
||||
9. **No git commits unless asked** - commits are for checkpoints before major work or major milestones, not for small single-file changes
|
||||
10. **Sync to staging** - after modifying theme or plugin files, sync them to `/var/www/vhosts/homeprozrealestate.com/staging/` using rsync
|
||||
|
||||
## Version Control Policy
|
||||
|
||||
Git is a snapshot tool and the historical record of what changed on the site. **If it's not in git, it may as well not exist.**
|
||||
|
||||
When asked to commit, commit **everything except build artifacts** — do not pick a "scope" or hand-select files. The point is the snapshot.
|
||||
|
||||
- **Commit:** all source (PHP, SCSS, JS), configs, `package.json`/`package-lock.json`, `db_content_updates/`, `node_modules/`, `dist/`, DB snapshots (`*.sql.gz`), plugins, themes, `CLAUDE.md`. `node_modules/` and `dist/` are tracked intentionally — see comments in `.gitignore`.
|
||||
- **Do not commit:** runtime caches (`wp-content/cache/transformed-images/`), log files (`wp-content/debug.log*`), and other transient/regenerable runtime output. These belong in `.gitignore`.
|
||||
|
||||
If you find untracked files in scope of a commit, include them. If something looks ambiguous, default to committing it — under-tracking loses history; over-tracking is reversible.
|
||||
|
||||
## Build
|
||||
|
||||
@@ -73,3 +85,23 @@ $url = add_query_arg('property', urlencode($title), home_url('/contact/'));
|
||||
## Page Classes
|
||||
|
||||
`Home_Page`, `Properties_Archive`, `Single_Property`, `About_Page`, `Contact_Page`, `Blog_Archive`, `Single_Post`, `Agents_Archive`, `Single_Agent`, `Search_Page`, `Error_404`
|
||||
|
||||
## MLS Property Overrides
|
||||
|
||||
### Force a non-HomeProz listing to appear as HomeProz
|
||||
|
||||
Some properties (e.g., LandProz listings) may need to appear on the HomeProz site. The `is_homeproz` flag overrides the office name check.
|
||||
|
||||
1. Find the property's `listing_key`:
|
||||
```bash
|
||||
wp --allow-root db query "SELECT listing_key, listing_id, street_name, city, list_office_name, is_homeproz FROM wp_mls_properties WHERE listing_id LIKE '%<MLS_ID>%'"
|
||||
```
|
||||
|
||||
2. Set the override flag:
|
||||
```bash
|
||||
wp --allow-root db query "UPDATE wp_mls_properties SET is_homeproz = 1 WHERE listing_key = '<LISTING_KEY>'"
|
||||
```
|
||||
|
||||
3. Document the change in `db_content_updates/` per the Database Content Changes policy.
|
||||
|
||||
**Example**: 121 Main St, Glenville (NST7785198) is listed under "LandProz Real Estate, LLC" but appears on HomeProz via `is_homeproz = 1`.
|
||||
|
||||
Reference in New Issue
Block a user