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

124 lines
3.3 KiB
PHP
Executable File

<?php
/**
* Stripe Settings - Custom Metadata table template.
*
* @since 1.9.6
*
* @var array $custom_metadata Saved Metadata.
* @var string $subsection Current subsection.
* @var string $slug Field slug.
* @var array $form_data Form data.
* @var array $fields Allowed fields.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="wpforms-panel-field-stripe-custom-metadata">
<p>
<?php esc_html_e( 'Custom Meta', 'wpforms-lite' ); ?>
<i class="fa fa-question-circle-o wpforms-help-tooltip" title="<?php esc_html_e( 'Map custom meta to form field values.', 'wpforms-lite' ); ?>"></i>
</p>
<table class="wpforms-panel-content-section-stripe-custom-metadata-table">
<thead>
<tr>
<th>
<?php esc_html_e( 'Object Type', 'wpforms-lite' ); ?>
</th>
<th>
<?php esc_html_e( 'Meta Key', 'wpforms-lite' ); ?>
</th>
<th colspan="3">
<?php esc_html_e( 'Meta Value', 'wpforms-lite' ); ?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ( $custom_metadata as $key => $value ) :
$is_hidden = ! $key ? 'hidden' : '';
$is_meta_key_valid = ! empty( $value['meta_key'] ) || empty( $value['object_type'] ) || empty( $value['meta_value'] );
$meta_key_input_class = [
'wpforms-panel-field-stripe-custom-metadata-meta-key',
$is_meta_key_valid ? '' : 'wpforms-required-field-error',
];
?>
<tr data-key="<?php echo esc_attr( $key ); ?>">
<td>
<?php
wpforms_panel_field(
'select',
$slug,
'object_type',
$form_data,
'',
[
'parent' => 'payments',
'subsection' => $subsection,
'index' => $key,
'placeholder' => esc_html__( '--- Select Object Type ---', 'wpforms-lite' ),
'options' => [
'customer' => esc_html__( 'Customer', 'wpforms-lite' ),
'payment' => esc_html__( 'Payment', 'wpforms-lite' ),
],
'input_class' => 'wpforms-panel-field-stripe-custom-metadata-object-type',
]
);
?>
</td>
<td>
<?php
wpforms_panel_field(
'text',
$slug,
'meta_key',
$form_data,
'',
[
'parent' => 'payments',
'subsection' => $subsection,
'index' => $key,
'input_class' => implode( ' ', $meta_key_input_class ),
]
);
?>
</td>
<td>
<?php
wpforms_panel_field(
'select',
$slug,
'meta_value',
$form_data,
'',
[
'parent' => 'payments',
'subsection' => $subsection,
'index' => $key,
'field_map' => $fields,
'placeholder' => esc_html__( '--- Select Meta Value ---', 'wpforms-lite' ),
'input_class' => 'wpforms-panel-field-stripe-custom-metadata-meta-value',
]
);
?>
</td>
<td class="add">
<button class="button-secondary wpforms-panel-content-section-stripe-custom-metadata-add" title="<?php esc_attr_e( 'Add Another', 'wpforms-lite' ); ?>">
<i class="fa fa-plus-circle"></i>
</button>
</td>
<td class="delete">
<button class="button-secondary wpforms-panel-content-section-stripe-custom-metadata-delete <?php echo esc_attr( $is_hidden ); ?>" title="<?php esc_attr_e( 'Remove', 'wpforms-lite' ); ?>">
<i class="fa fa-minus-circle"></i>
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>