Changeset 3444289
- Timestamp:
- 01/21/2026 05:01:40 PM (4 weeks ago)
- Location:
- contact-form-7-mailchimp-extension
- Files:
-
- 9 deleted
- 4 edited
-
tags/0.9.72/assets/js/chimpmatic-lite.js (modified) (4 diffs)
-
tags/0.9.72/includes/services/class-cmatic-pro-syncer.php (modified) (3 diffs)
-
tags/0.9.72/includes/services/submission/class-cmatic-status-resolver.php (modified) (1 diff)
-
tags/0.9.72/includes/ui/class-cmatic-field-mapper.php (modified) (1 diff)
-
trunk/admin (deleted)
-
trunk/api (deleted)
-
trunk/bootstrap.php (deleted)
-
trunk/core (deleted)
-
trunk/interfaces (deleted)
-
trunk/services (deleted)
-
trunk/signals (deleted)
-
trunk/ui (deleted)
-
trunk/utils (deleted)
Legend:
- Unmodified
- Added
- Removed
-
contact-form-7-mailchimp-extension/tags/0.9.72/assets/js/chimpmatic-lite.js
r3442168 r3444289 547 547 const data = await response.json(); 548 548 if (wrapper) wrapper.classList.remove('is-saving'); 549 if (!data.success) this.checked = !enabled; 549 if (data.success) { 550 // Sync defaultChecked to prevent CF7 beforeunload warning 551 this.defaultChecked = this.checked; 552 } else { 553 this.checked = !enabled; 554 } 550 555 } catch (error) { 551 556 if (wrapper) wrapper.classList.remove('is-saving'); … … 562 567 if (selects.length === 0) return; 563 568 569 const perFormFields = ['double_optin', 'sync_tags']; 570 564 571 selects.forEach(function(select) { 565 572 select.addEventListener('change', async function() { 566 573 const field = this.dataset.field; 567 const enabled= this.value === '1';574 const value = this.value === '1'; 568 575 const wrapper = this.closest('.mcee-container'); 569 576 … … 571 578 572 579 try { 573 const response = await fetch(chimpmaticLite.restUrl + 'settings/toggle', { 580 let url, body; 581 582 if (perFormFields.includes(field)) { 583 const formId = getFormId(); 584 if (!formId) { 585 if (wrapper) wrapper.classList.remove('is-saving'); 586 this.value = value ? '0' : '1'; 587 return; 588 } 589 const rootUrl = chimpmaticLite.restUrl.replace('chimpmatic-lite/v1/', ''); 590 url = rootUrl + 'cmatic/form/setting'; 591 body = JSON.stringify({ form_id: formId, field, value }); 592 } else { 593 url = chimpmaticLite.restUrl + 'settings/toggle'; 594 body = JSON.stringify({ field, enabled: value }); 595 } 596 597 const response = await fetch(url, { 574 598 method: 'POST', 575 599 headers: { … … 577 601 'X-WP-Nonce': chimpmaticLite.restNonce 578 602 }, 579 body : JSON.stringify({ field, enabled })603 body 580 604 }); 581 605 582 606 const data = await response.json(); 583 607 if (wrapper) wrapper.classList.remove('is-saving'); 584 if (!data.success) { 585 this.value = enabled ? '0' : '1'; 608 if (data.success) { 609 // Sync defaultSelected to prevent CF7 beforeunload warning 610 Array.from(this.options).forEach(function(opt) { 611 opt.defaultSelected = opt.selected; 612 }); 613 } else { 614 this.value = value ? '0' : '1'; 586 615 } 587 616 } catch (error) { 588 617 if (wrapper) wrapper.classList.remove('is-saving'); 589 this.value = enabled? '0' : '1';618 this.value = value ? '0' : '1'; 590 619 } 591 620 }); -
contact-form-7-mailchimp-extension/tags/0.9.72/includes/services/class-cmatic-pro-syncer.php
r3442192 r3444289 107 107 } 108 108 109 $domain = str_ireplace( array( 'http://', 'https://' ), '', home_url() ); 110 $api_url = 'https://chimpmatic.com/'; 111 $product_id = ! empty( $activation['product_id'] ) ? $activation['product_id'] : 436; 112 $args = array( 109 $domain = str_ireplace( array( 'http://', 'https://' ), '', home_url() ); 110 $api_url = 'https://chimpmatic.com/'; 111 $args = array( 113 112 'wc_am_action' => 'update', 114 113 'slug' => 'chimpmatic', 115 114 'plugin_name' => self::PRO_PLUGIN_FILE, 116 115 'version' => $current_version, 117 'product_id' => $product_id,116 'product_id' => 436, 118 117 'api_key' => $api_key, 119 118 'instance' => $instance_id, … … 153 152 require_once ABSPATH . 'wp-admin/includes/file.php'; 154 153 155 // Check if Pro was active before upgrade.156 $was_active = is_plugin_active( self::PRO_PLUGIN_FILE );157 158 154 $updates = get_site_transient( 'update_plugins' ); 159 155 if ( ! is_object( $updates ) ) { … … 174 170 Cmatic_Options_Repository::set_option( 'pro_last_auto_sync', $sync_info->new_version ); 175 171 Cmatic_Options_Repository::set_option( 'pro_last_auto_sync_at', gmdate( 'Y-m-d H:i:s' ) ); 176 177 // Reactivate Pro if it was active before upgrade.178 if ( $was_active && ! is_plugin_active( self::PRO_PLUGIN_FILE ) ) {179 activate_plugin( self::PRO_PLUGIN_FILE );180 }181 182 // Clear the stale update transient to prevent "update available" banner.183 delete_site_transient( 'update_plugins' );184 wp_clean_plugins_cache();185 172 } 186 173 } -
contact-form-7-mailchimp-extension/tags/0.9.72/includes/services/submission/class-cmatic-status-resolver.php
r3442168 r3444289 15 15 public static function resolve( array $cf7_mch, array $posted_data, Cmatic_File_Logger $logger ): ?string { 16 16 // Double opt-in enabled (per-form setting). 17 if ( ! empty( $cf7_mch[' confsubs'] ) ) {17 if ( ! empty( $cf7_mch['double_optin'] ) || ! empty( $cf7_mch['confsubs'] ) ) { 18 18 return 'pending'; 19 19 } -
contact-form-7-mailchimp-extension/tags/0.9.72/includes/ui/class-cmatic-field-mapper.php
r3442168 r3444289 195 195 196 196 private static function render_double_optin( array $cf7_mch ): void { 197 $value = ! empty( $cf7_mch[' confsubs'] ) ? '1' : '0';197 $value = ! empty( $cf7_mch['double_optin'] ) || ! empty( $cf7_mch['confsubs'] ) ? '1' : '0'; 198 198 ?> 199 199 <div class="mcee-container">
Note: See TracChangeset
for help on using the changeset viewer.