Manual property enhancements: MLS status sync, agent clone, description formatting

- Manual properties linked to MLS now inherit status (Active/Pending/Closed) and
  days_on_market from the MLS listing dynamically
- Properties not in MLS default to Closed status
- Clone feature now auto-populates listing agent by matching MLS ID to Agent CPT
- Description formatter detects embedded headers (unpunctuated text after sentences)
  and splits them into separate paragraphs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-01-23 21:28:44 +00:00
parent c2d5b2248d
commit 57b752f54e
60 changed files with 5323 additions and 189 deletions
@@ -0,0 +1,129 @@
# Database Content Update: SEO - Albert Lea Landing Page
**Date:** 2026-01-05
**Author:** Claude (automated)
**Summary:** Configure Albert Lea page as SEO landing page with city template
## Overview
This update configures the existing Albert Lea page (ID 15) as an SEO-optimized city landing page that displays MLS listings for Albert Lea.
## Changes Made
### 1. Update Albert Lea Page Slug
Change the URL from `/albert-lea/` to `/albert-lea-homes/` for better SEO targeting.
```sql
UPDATE wp_posts
SET post_name = 'albert-lea-homes'
WHERE ID = 15;
```
**WP-CLI Alternative:**
```bash
wp post update 15 --post_name=albert-lea-homes --allow-root
```
### 2. Set Page Template
Assign the City Landing Page template to the Albert Lea page.
```sql
-- First check if template meta exists
SELECT * FROM wp_postmeta WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- If exists, update:
UPDATE wp_postmeta
SET meta_value = 'page-city-landing.php'
WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- If not exists, insert:
INSERT INTO wp_postmeta (post_id, meta_key, meta_value)
VALUES (15, '_wp_page_template', 'page-city-landing.php');
```
**WP-CLI Alternative:**
```bash
wp post meta update 15 _wp_page_template page-city-landing.php --allow-root
```
### 3. Add Yoast SEO Meta
Add optimized meta title and description for the page.
```sql
INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES
(15, '_yoast_wpseo_title', 'Albert Lea Homes for Sale | HomeProz Real Estate'),
(15, '_yoast_wpseo_metadesc', 'Find homes for sale in Albert Lea, MN. Browse current listings, view property details, and connect with local real estate experts at HomeProz.');
```
**WP-CLI Alternative:**
```bash
wp post meta add 15 _yoast_wpseo_title "Albert Lea Homes for Sale | HomeProz Real Estate" --allow-root
wp post meta add 15 _yoast_wpseo_metadesc "Find homes for sale in Albert Lea, MN. Browse current listings, view property details, and connect with local real estate experts at HomeProz." --allow-root
```
### 4. Flush Rewrite Rules
Required after changing page slugs to update permalinks.
```bash
wp rewrite flush --allow-root
```
## Dependencies
- Theme files must be deployed first:
- `wp-content/themes/homeproz/page-city-landing.php`
- `wp-content/themes/homeproz/page-city-landing.scss`
- `wp-content/themes/homeproz/inc/yoast-seo.php`
- `wp-content/themes/homeproz/inc/acf-fields.php` (updated)
- `wp-content/themes/homeproz/functions.php` (updated)
- `wp-content/themes/homeproz/dist/` (rebuilt assets)
## Verification
After applying changes, verify:
1. **Page loads correctly:**
```
https://[domain]/albert-lea-homes/
```
2. **Template is active:**
```bash
wp post meta get 15 _wp_page_template --allow-root
# Should output: page-city-landing.php
```
3. **Yoast meta is set:**
```bash
wp post meta get 15 _yoast_wpseo_title --allow-root
wp post meta get 15 _yoast_wpseo_metadesc --allow-root
```
4. **MLS sitemap accessible:**
```
https://[domain]/mls-listings-sitemap.xml
```
## Rollback
To revert these changes:
```sql
-- Restore original slug
UPDATE wp_posts SET post_name = 'albert-lea' WHERE ID = 15;
-- Remove template assignment
DELETE FROM wp_postmeta WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- Remove Yoast meta
DELETE FROM wp_postmeta WHERE post_id = 15 AND meta_key IN ('_yoast_wpseo_title', '_yoast_wpseo_metadesc');
```
Then flush rewrite rules:
```bash
wp rewrite flush --allow-root
```
@@ -0,0 +1,56 @@
# Agent Testimonials Feature
**Date**: 2026-01-06
**Type**: ACF Field Addition
## Summary
Added a new "Testimonials" tab to the Agent Details ACF field group, allowing agents to display client testimonials on their profile pages.
## Changes Made
### ACF Field Group: Agent Details (group_agent_details)
Added new tab and repeater field:
**New Tab**: Testimonials (field_agent_tab_testimonials)
- Position: After Social Media tab, before Settings tab
**New Repeater Field**: agent_testimonials (field_agent_testimonials)
- Type: Repeater
- Layout: Block
- Max rows: 20
**Sub-fields**:
1. `quote` (field_testimonial_quote) - Textarea, required
- The testimonial text from the client
2. `client_name` (field_testimonial_client_name) - Text, required
- Client's name (e.g., "John D." or "John Doe")
3. `context` (field_testimonial_context) - Text, optional
- Context like "Albert Lea Buyer" or "First-time Homeowner"
## Template Changes
Updated `single-agent.php` to display testimonials section between biography and gallery.
## Styling
Added testimonials styles to `template-parts/agent/single-agent.scss`:
- Two-column grid on desktop, single column on mobile
- Card styling with accent border-left
- Quote icon with italicized text
- Attribution with client name and optional context
## How to Add Testimonials
1. Go to Agents in WordPress admin
2. Edit an agent
3. Click the "Testimonials" tab
4. Click "Add Testimonial"
5. Enter the quote text, client name, and optionally a context
6. Save the agent
## Dependencies
- Requires ACF Pro (repeater field)
- Theme must be built after deployment (`npm run build`)
@@ -0,0 +1,81 @@
# Favicon Management Feature
**Date**: 2026-01-06
**Type**: ACF Field Addition + Theme Feature
## Summary
Added favicon management through Theme Options. Site administrators can upload a source image that gets automatically converted to all required favicon sizes using ImageMagick.
## ACF Field Group Changes
### Theme Options (group_theme_options)
Added new "Branding" tab (before Advanced tab):
**New Tab**: Branding (field_theme_tab_branding)
**New Fields**:
1. `theme_favicon_source` (field_theme_favicon_source) - Image field
- Return format: ID
- Mime types: png, webp
- Minimum dimensions: 256x256 pixels
- Instructions: Upload square image at least 512x512
2. `theme_favicon_status` (field_theme_favicon_status) - Message field
- Shows instructions about saving to generate favicons
## Generated Files
When a favicon source is uploaded and saved, the following files are generated in `/wp-content/uploads/favicon/`:
| File | Size | Purpose |
|------|------|---------|
| favicon.ico | 16x16, 32x32, 48x48 | Legacy browsers |
| favicon-16x16.png | 16x16 | Standard favicon |
| favicon-32x32.png | 32x32 | Standard favicon |
| favicon-48x48.png | 48x48 | Standard favicon |
| apple-touch-icon.png | 180x180 | iOS home screen |
| android-chrome-192x192.png | 192x192 | Android/Chrome |
| android-chrome-512x512.png | 512x512 | Android/Chrome splash |
| mstile-150x150.png | 150x150 | Windows tiles |
| site.webmanifest | - | PWA manifest |
| browserconfig.xml | - | Windows tile config |
## Theme Files Added/Modified
### New File: `inc/favicon.php`
- ACF save hook for favicon processing
- ImageMagick conversion functions
- Web manifest generation
- HTML head output with cache busting
- Disables WordPress Site Icon (Customizer)
### Modified: `functions.php`
- Added `require_once` for `inc/favicon.php`
### Modified: `inc/acf-fields.php`
- Added Branding tab with favicon fields
## Server Requirements
- **ImageMagick**: Must be installed with `convert` command available
- Admin notice displays if ImageMagick is not found
## How to Use
1. Go to Theme Options in WordPress admin
2. Click the "Branding" tab
3. Upload a square PNG or WebP image (minimum 256x256, recommended 512x512)
4. Save the Theme Options
5. Favicons are automatically generated and output in the HTML head
## Cache Busting
Favicon URLs include a version query parameter based on file modification time to ensure browsers load updated favicons when changed.
## Dependencies
- ACF Pro
- ImageMagick on server
- Theme must include favicon.php
@@ -0,0 +1,39 @@
# MLS Grid SSL Verification Skip
**Date**: 2026-01-06
**Type**: Server Configuration (wp-config.php)
Note: This is not a database change, but a server-level configuration change. Documented here for production sync purposes.
## Issue
MLS Grid's media CDN (`media.mlsgrid.com`) has an expired SSL certificate, causing all image fetches to fail with SSL handshake errors. This resulted in 404 errors for property images on the site.
## Solution
Enable the `MLS_SKIP_SSL_VERIFY` option that was added in commit `0fd8b71`.
## Change Required
Add to `wp-config.php` (after MLS Grid API settings):
```php
// Skip SSL verification for MLS Grid media (their cert is expired)
define( 'MLS_SKIP_SSL_VERIFY', true );
```
## Security Note
This disables SSL certificate verification only for MLS Grid media downloads. This is acceptable because:
1. The data being fetched is public property images (not sensitive)
2. The alternative is completely broken image functionality
3. This should be reverted once MLS Grid renews their certificate
## Verification
After applying, test an image URL:
```bash
curl -I "https://[site]/mls-image/[listing_key]/1/thumb/?sig=[signature]"
```
Should return `HTTP 200` with `content-type: image/webp`.