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>
34 lines
1.4 KiB
PHP
Executable File
34 lines
1.4 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Helpers functions for builder.
|
|
*
|
|
* @since 1.9.6.1
|
|
*/
|
|
|
|
/**
|
|
* Outputs a button element to display the connection status for a given connection.
|
|
*
|
|
* @since 1.9.6.1
|
|
*
|
|
* @param string $connection_id The unique identifier for the connection.
|
|
* @param string $name The name attribute value to be used for the status input field.
|
|
* @param bool $is_active Connection status, where true represents active and false represents inactive.
|
|
*/
|
|
function wpforms_connection_status_button( string $connection_id, string $name, bool $is_active ) {
|
|
|
|
$label = $is_active ? __( 'Active', 'wpforms-lite' ) : __( 'Inactive', 'wpforms-lite' );
|
|
$title = $is_active ? __( 'Deactivate', 'wpforms-lite' ) : __( 'Activate', 'wpforms-lite' );
|
|
|
|
printf(
|
|
'<span class="wpforms-builder-settings-block-status wpforms-badge wpforms-badge-sm wpforms-badge-%1$s wpforms-status-button" title="%5$s" data-active="%2$s" data-connection-id="%6$s">%3$s<i class="wpforms-status-label">%4$s</i></span>',
|
|
sanitize_html_class( $is_active ? 'green' : 'silver' ),
|
|
esc_attr( $is_active ),
|
|
$is_active ? '<i class="fa fa-check"></i>' : '<i class="fa fa-times"></i>',
|
|
esc_html( $label ),
|
|
esc_attr( $title ),
|
|
esc_attr( $connection_id )
|
|
);
|
|
|
|
printf( '<input type="hidden" name="%1$s" id="wpforms-connection-status-%2$s" value="%3$d">', esc_attr( $name ), esc_attr( $connection_id ), absint( $is_active ) );
|
|
}
|