Files
root b6df4dbb92 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>
2026-04-29 15:32:23 +00:00

96 lines
3.1 KiB
PHP
Executable File

<?php
/**
* The Order Summary preview for the Total payment field.
*
* @since 1.8.7
*
* @var array $items Order items.
* @var array $foot Order footer (subtotal, discount, total).
* @var string $total_width Total width.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$rows_html = '';
$total_width = $total_width ? 'width:' . $total_width . 'ch;' : '';
$fields = array_merge( (array) $items, (array) $foot );
// Display the placeholder by default.
$is_placeholder_visible = true;
// $context is set for the smart tag.
if ( isset( $context ) ) {
$is_placeholder_visible = empty( $items );
}
// Go through table items (rows).
foreach ( $fields as $field ) :
// Open a row.
$rows_html .= sprintf(
'<tr %1$s %2$s>',
wpforms_html_attributes( '', isset( $field['class'] ) ? (array) $field['class'] : [] , $field['data'] ?? [] ),
! empty( $field['is_hidden'] ) ? 'style="display:none;"' : ''
);
// Item column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-label" valign="top">%s</td>',
wp_kses_post( $field['label'] )
);
// Quantity column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-quantity" valign="top">%s</td>',
esc_html( $field['quantity'] )
);
// Price column.
$rows_html .= sprintf(
'<td class="wpforms-order-summary-item-price" valign="top" style="%1$s">%2$s</td>',
esc_attr( $total_width ),
esc_html( $field['amount'] )
);
// Close a row.
$rows_html .= '</tr>';
endforeach;
$visible_items = array_filter(
$items,
function ( $item ) {
return ! isset( $item['is_hidden'] ) || $item['is_hidden'] === false;
}
);
$is_placeholder_visible = empty( $visible_items );
$placeholder_display = $is_placeholder_visible ? 'display: table-row;' : 'display: none;';
$placeholder_classes = $is_placeholder_visible ? 'wpforms-order-summary-placeholder' : 'wpforms-order-summary-placeholder wpforms-order-summary-placeholder-hidden';
?>
<div class="wpforms-order-summary-container">
<table class="wpforms-order-summary-preview" cellpadding="0" cellspacing="0" width="100%" role="presentation">
<caption style="display: none;"><?php esc_html_e( 'Order Summary', 'wpforms-lite' ); ?></caption>
<thead>
<tr>
<th class="wpforms-order-summary-item-label" valign="top"><?php esc_html_e( 'Item', 'wpforms-lite' ); ?></th>
<th class="wpforms-order-summary-item-quantity" valign="top">
<span class="wpforms-order-summary-item-quantity-label-full"><?php esc_html_e( 'Quantity', 'wpforms-lite' ); ?></span>
<span class="wpforms-order-summary-item-quantity-label-short"><?php esc_html_e( 'Qty', 'wpforms-lite' ); ?></span>
</th>
<th class="wpforms-order-summary-item-price" valign="top" style="<?php echo esc_attr( $total_width ); ?>"><?php esc_html_e( 'Total', 'wpforms-lite' ); ?></th>
</tr>
</thead>
<tbody>
<tr class="<?php echo esc_attr( $placeholder_classes ); ?>" style="<?php echo esc_attr( $placeholder_display ); ?>">
<td colspan="3" valign="top"><?php echo esc_html__( 'There are no products selected.', 'wpforms-lite' ); ?></td>
</tr>
<?php echo $rows_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</tbody>
</table>
</div>