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

1 line
4.7 KiB
JavaScript
Executable File

var WPForms=window.WPForms||{};WPForms.Admin=WPForms.Admin||{},WPForms.Admin.Builder=WPForms.Admin.Builder||{},WPForms.Admin.Builder.Settings=WPForms.Admin.Builder.Settings||((e,s,n)=>{let a={},i={};var r={init(){n(r.ready)},ready(){r.setup(),r.initTags(),r.events()},setup(){a={$builder:n("#wpforms-builder"),$panel:n("#wpforms-panel-settings"),$selectTags:n("#wpforms-panel-field-settings-form_tags")},r.allowEditDisabledEntriesOption()},events(){a.$panel.on("keydown","#wpforms-panel-field-settings-form_tags-wrap input",r.addCustomTagInput).on("removeItem","#wpforms-panel-field-settings-form_tags-wrap select",r.editTagsRemoveItem).on("change","#wpforms-panel-field-settings-antispam_v3",r.enableAntispamV3).on("change","#wpforms-panel-field-settings-disable_entries",r.disableEntries).on("change","#wpforms-panel-field-settings-store_spam_entries",r.storeSpamEntries),a.$selectTags.on("change",r.changeTags),n(e).on("connectionsDataLoaded",r.allowEditDisabledEntriesOption)},enableAntispamV3(){n("#wpforms-panel-field-settings-antispam").prop("checked",!1).closest(".wpforms-panel-field").toggleClass("wpforms-hidden")},disableEntries(){var e=n(this),t=e.prop("checked"),s=n("#wpforms-panel-field-settings-store_spam_entries").prop("checked");r.toggleFilteringMessages(!t&&s),n("#wpforms-panel-field-settings-store_spam_entries-wrap").toggleClass("wpforms-hidden",e.prop("checked")),e.prop("checked")&&((t=r.getEntryRequirement()).required?(n.confirm({title:wpforms_builder.entry_storage_required,content:r.getDisabledEntryMessage(t),icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}),e.prop("checked",!1)):n.alert({title:wpforms_builder.heads_up,content:wpforms_builder.disable_entries,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}))},storeSpamEntries(){r.toggleFilteringMessages(n(this).prop("checked"))},toggleFilteringMessages(e){n("#wpforms-panel-field-anti_spam-filtering_store_spam").is(":checked")&&(n("#wpforms-panel-field-anti_spam-country_filter-message-wrap").toggleClass("wpforms-hidden",e),n("#wpforms-panel-field-anti_spam-keyword_filter-message-wrap").toggleClass("wpforms-hidden",e))},initTags(e=null){var t;(e=e?.length?e:a.$selectTags).length&&"function"==typeof s.Choices&&(i.tagsChoicesObj=new Choices(e[0],wpforms_builder_settings.choicesjs_config),t=i.tagsChoicesObj.getValue(!0),i.tagsChoicesObj.clearStore().setChoices(wpforms_builder_settings.all_tags_choices,"value","label",!0).setChoiceByValue(t),e.data("choicesjs",i.tagsChoicesObj),r.initTagsHiddenInput())},initTagsHiddenInput(){a.$selectTagsHiddenInput=n('<input type="hidden" name="settings[form_tags_json]">'),a.$selectTags.closest(".wpforms-panel-field").append(a.$selectTagsHiddenInput),r.changeTags(null)},addCustomTagInput(e){var t,s;["Enter",","].indexOf(e.key)<0||(e.preventDefault(),e.stopPropagation(),i.tagsChoicesObj&&0!==e.target.value.length&&(t=_.escape(e.target.value).trim(),s=_.map(i.tagsChoicesObj.getValue(),"label").map(function(e){return e.toLowerCase().trim()}),""===t||0<=s.indexOf(t.toLowerCase())?i.tagsChoicesObj.clearInput():(r.addCustomTagInputCreate(t),r.changeTags(e))))},editTagsRemoveItem(t){var e,s,a;0<=_.map(wpforms_builder_settings.all_tags_choices,"value").indexOf(t.detail.value)||(s=(e=n(t.target).data("choicesjs")).getValue(!0),a=_.filter(e._currentState.choices,function(e){return e.value!==t.detail.value}),e.clearStore().setChoices(a,"value","label",!0).setChoiceByValue(s))},addCustomTagInputCreate(e){var t=_.find(wpforms_builder_settings.all_tags_choices,{label:e});t&&t.value?i.tagsChoicesObj.setChoiceByValue(t.value):i.tagsChoicesObj.setChoices([{value:e,label:e,selected:!0}],"value","label",!1),i.tagsChoicesObj.clearInput()},changeTags(e){var t=i.tagsChoicesObj.getValue(),s=[];for(let e=0;e<t.length;e++)s.push({value:t[e].value,label:t[e].label});a.$selectTagsHiddenInput.val(JSON.stringify(s))},getDisabledEntryMessage(e){var e=e?.dependencies||{};return Object.keys(e).length?(e=Object.values(e).map(({text:e,href:t},s,a)=>{t=`<a href="${t}" target="_blank">${e}</a>`;return s===a.length-1&&1<a.length?"and "+t:s<a.length-2?t+",":t}).join(" "),wpforms_builder.payments_on_entries_off.replace("{integration}",e)):wpforms_builder.payments_on_entries_off},allowEditDisabledEntriesOption(){var e=n("#wpforms-panel-field-settings-disable_entries-wrap > span");e.hasClass("wpforms-toggle-control-disabled")&&!r.getEntryRequirement()?.loadingStack?.size&&e.removeClass("wpforms-toggle-control-disabled")},getEntryRequirement(){return wp.hooks.applyFilters("wpforms.Builder.entryRequirement",{required:!1,dependencies:{},loadingStack:new Set})}};return r})(document,window,jQuery),WPForms.Admin.Builder.Settings.init();