Changeset 3479987
- Timestamp:
- 03/11/2026 11:06:38 AM (3 weeks ago)
- Location:
- firstpromoter
- Files:
-
- 27 added
- 6 edited
-
tags/0.3.5 (added)
-
tags/0.3.5/assets (added)
-
tags/0.3.5/assets/css (added)
-
tags/0.3.5/assets/css/admin.css (added)
-
tags/0.3.5/assets/css/index.php (added)
-
tags/0.3.5/assets/index.php (added)
-
tags/0.3.5/assets/js (added)
-
tags/0.3.5/assets/js/admin.js (added)
-
tags/0.3.5/assets/js/custom-forms.js (added)
-
tags/0.3.5/assets/js/index.php (added)
-
tags/0.3.5/firstpromoter.php (added)
-
tags/0.3.5/includes (added)
-
tags/0.3.5/includes/class-fp-helpers.php (added)
-
tags/0.3.5/includes/class-fp-settings-page.php (added)
-
tags/0.3.5/includes/index.php (added)
-
tags/0.3.5/index.php (added)
-
tags/0.3.5/integrations (added)
-
tags/0.3.5/integrations/class-fp-integration-base.php (added)
-
tags/0.3.5/integrations/class-fp-integration-contactform7.php (added)
-
tags/0.3.5/integrations/class-fp-integration-customforms.php (added)
-
tags/0.3.5/integrations/class-fp-integration-memberpress.php (added)
-
tags/0.3.5/integrations/class-fp-integration-optimizepress.php (added)
-
tags/0.3.5/integrations/class-fp-integration-payment-links.php (added)
-
tags/0.3.5/integrations/class-fp-integration-urlcapture.php (added)
-
tags/0.3.5/integrations/class-fp-integration-woocommerce.php (added)
-
tags/0.3.5/integrations/index.php (added)
-
tags/0.3.5/readme.txt (added)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/assets/js/custom-forms.js (modified) (1 diff)
-
trunk/firstpromoter.php (modified) (2 diffs)
-
trunk/includes/class-fp-settings-page.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firstpromoter/trunk/assets/css/admin.css
r3458122 r3479987 642 642 } 643 643 644 .fp-custom-form-fields .fp- input.regular-text{644 .fp-custom-form-fields .fp-field-label { 645 645 flex: 1; 646 display: flex; 647 flex-direction: column; 648 gap: 4px; 649 } 650 651 .fp-custom-form-fields .fp-field-label span { 652 font-size: 12px; 653 font-weight: 600; 654 color: #374151; 655 } 656 657 .fp-custom-form-fields .fp-field-label .fp-input.regular-text { 658 width: 100%; 646 659 margin-bottom: 0; 647 660 } -
firstpromoter/trunk/assets/js/admin.js
r3458122 r3479987 105 105 } 106 106 107 // Validate cross domain - cannot include the primary domain 108 var $crossDomain = $form.find('#firstpromoter_cross_domain'); 109 if ($crossDomain.length) { 110 var homeDomain = (window.fpAdminData && window.fpAdminData.homeDomain) ? window.fpAdminData.homeDomain : ''; 111 if (homeDomain) { 112 var domains = $crossDomain.val().split(','); 113 for (var i = 0; i < domains.length; i++) { 114 var d = domains[i].trim().toLowerCase().replace(/^www\./, ''); 115 if (d === homeDomain) { 116 hasErrors = true; 117 $crossDomain.addClass('error'); 118 self.showMessage('Your primary domain (' + homeDomain + ') cannot be added as a cross domain.', 'error'); 119 break; 120 } 121 } 122 } 123 } 124 107 125 if (hasErrors) { 108 126 e.preventDefault(); -
firstpromoter/trunk/assets/js/custom-forms.js
r3458124 r3479987 3 3 var forms = cfg.forms || []; 4 4 var debounceTimer = null; 5 if (forms.length === 0) {6 console.warn("No forms configured");7 }8 5 9 6 function attachFormTracking() { -
firstpromoter/trunk/firstpromoter.php
r3471405 r3479987 3 3 Plugin Name: FirstPromoter 4 4 Description: FirstPromoter tracking scripts with WooCommerce, OptimizePress, Contact Form 7 & MemberPress 5 Version: 0.3. 45 Version: 0.3.5 6 6 Author: FirstPromoter 7 7 Author URI: https://firstpromoter.com … … 20 20 21 21 // Define plugin constants 22 define('FIRSTPROMOTER_VERSION', '0.3. 4');22 define('FIRSTPROMOTER_VERSION', '0.3.5'); 23 23 define('FIRSTPROMOTER_PLUGIN_PATH', plugin_dir_path(__FILE__)); 24 24 define('FIRSTPROMOTER_PLUGIN_URL', plugin_dir_url(__FILE__)); -
firstpromoter/trunk/includes/class-fp-settings-page.php
r3471405 r3479987 169 169 true 170 170 ); 171 172 $home_host = (string) parse_url(home_url(), PHP_URL_HOST); 173 wp_localize_script('first-promoter-admin', 'fpAdminData', array( 174 'homeDomain' => preg_replace('/^www\./i', '', strtolower($home_host)), 175 )); 171 176 } 172 177 … … 358 363 <div class="fp-custom-form-row"<?php if ($idx > 0 && !$has_multiple) echo ' style="display:none"'; ?>> 359 364 <div class="fp-custom-form-fields"> 360 <input type="text" 361 name="firstpromoter_integration_settings[custom_forms][<?php echo (int) $idx; ?>][email_selector]" 362 value="<?php echo esc_attr(isset($form_row['email_selector']) ? $form_row['email_selector'] : ''); ?>" 363 placeholder="Email input selector, e.g. #signup-email" 364 class="fp-input regular-text"> 365 <input type="text" 366 name="firstpromoter_integration_settings[custom_forms][<?php echo (int) $idx; ?>][submit_selector]" 367 value="<?php echo esc_attr(isset($form_row['submit_selector']) ? $form_row['submit_selector'] : ''); ?>" 368 placeholder="Submit selector, e.g. #signup-btn or form.my-form" 369 class="fp-input regular-text"> 365 <label class="fp-field-label"> 366 <span>Email Input</span> 367 <input type="text" 368 name="firstpromoter_integration_settings[custom_forms][<?php echo (int) $idx; ?>][email_selector]" 369 value="<?php echo esc_attr(isset($form_row['email_selector']) ? $form_row['email_selector'] : ''); ?>" 370 placeholder="e.g. #signup-email" 371 class="fp-input regular-text"> 372 </label> 373 <label class="fp-field-label"> 374 <span>Submit Button</span> 375 <input type="text" 376 name="firstpromoter_integration_settings[custom_forms][<?php echo (int) $idx; ?>][submit_selector]" 377 value="<?php echo esc_attr(isset($form_row['submit_selector']) ? $form_row['submit_selector'] : ''); ?>" 378 placeholder="e.g. #signup-btn or form.my-form" 379 class="fp-input regular-text"> 380 </label> 370 381 </div> 371 382 <button type="button" class="fp-remove-form-row" title="Remove row"<?php if (!$has_multiple) echo ' style="display:none"'; ?>>×</button> … … 529 540 $sanitized['api_key'] = sanitize_text_field(isset($input['api_key']) ? $input['api_key'] : ''); 530 541 531 // Sanitize cross domain 532 $sanitized['cross_domain'] = sanitize_text_field(isset($input['cross_domain']) ? $input['cross_domain'] : ''); 542 // Sanitize cross domain - prevent adding the primary domain 543 $cross_domain_raw = sanitize_text_field(isset($input['cross_domain']) ? $input['cross_domain'] : ''); 544 $home_host = (string) parse_url(home_url(), PHP_URL_HOST); 545 $home_domain = preg_replace('/^www\./i', '', strtolower($home_host)); 546 $filtered = array(); 547 $had_primary = false; 548 foreach (explode(',', $cross_domain_raw) as $d) { 549 $d = trim($d); 550 if ($d === '') { 551 continue; 552 } 553 if (preg_replace('/^www\./i', '', strtolower($d)) === $home_domain) { 554 $had_primary = true; 555 } else { 556 $filtered[] = $d; 557 } 558 } 559 if ($had_primary) { 560 add_settings_error( 561 'firstpromoter_base_settings', 562 'cross_domain_primary', 563 'Your primary domain (' . esc_html($home_domain) . ') cannot be added as a cross domain and has been removed.', 564 'error' 565 ); 566 } 567 $sanitized['cross_domain'] = implode(',', $filtered); 533 568 534 569 // Sanitize checkbox -
firstpromoter/trunk/readme.txt
r3471405 r3479987 196 196 197 197 == Changelog == 198 199 = 0.3.5 = 200 * Improved: Custom Form Tracking admin UI now shows labels ("Email Input" / "Submit Button") on selector fields for clarity 201 * Fixed: Removed spurious console.warn when no custom forms are configured (script is never loaded in that case anyway) 198 202 199 203 = 0.3.4 = … … 265 269 == Upgrade Notice == 266 270 271 = 0.3.5 = 272 Minor admin UI and JS cleanup in Custom Form Tracking. No behaviour changes. 273 267 274 = 0.3.4 = 268 275 New: Payment Links integration — automatically append your FirstPromoter tracking ID to Stripe payment links or any custom payment URL on your pages.
Note: See TracChangeset
for help on using the changeset viewer.