b6df4dbb92
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>
2.1 KiB
Executable File
2.1 KiB
Executable File
Remove Legacy Property Posts
Date: 2026-01-20 Type: Content Deletion Priority: Required before or after code deployment
Summary
The legacy manual property entry system has been deprecated. All properties now come exclusively from the MLS sync. This requires deleting the manually-created property posts and their associated data.
What Changed
The following legacy system components were removed from the codebase:
propertycustom post type registrationsingle-property.phptemplateproperty-card.phptemplate part- ACF "Property Details" field group
- Agent listings section from
single-agent.php
Database Changes Required on Production
1. Delete Legacy Property Posts
Run this WP-CLI command to delete the legacy property posts:
wp --allow-root post delete 24 35 60 85 125 --force
These were the legacy posts:
- ID 24: "Geneva, MN - Double Lot with Shop"
- ID 35: "115 N Newton Ave, Albert Lea, MN"
- ID 60: "411 Court St, Albert Lea, MN"
- ID 85: "1224 Saint Joseph Ave, Albert Lea, MN"
- ID 125: "15131 800th Ave, Glenville, MN"
2. Clean Up Orphaned Post Meta
After deleting the posts, clean up any orphaned meta data:
wp --allow-root db query "DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts p ON pm.post_id = p.ID WHERE p.ID IS NULL"
3. Flush Rewrite Rules
After code deployment, flush rewrite rules to remove the property slug:
wp --allow-root rewrite flush
Verification
After completing these steps, verify:
- The
/properties/archive page still works (MLS-based) - Agent profile pages no longer show a "Current Listings" section (expected - removed)
- No 404 errors from old property URLs (will naturally 404 since posts deleted)
Notes
- The
/properties/URL now exclusively serves MLS data viaarchive-property.php - Individual property URLs use the
?listing=XXXXXquery parameter for MLS listings - Agent pages no longer display properties; this was intentional as the legacy linking system is deprecated