Plugin Directory

Changeset 3460077


Ignore:
Timestamp:
02/12/2026 03:14:37 PM (4 weeks ago)
Author:
basecloud
Message:

Update to version 3.0.3 from GitHub

Location:
basecloud-utm-tracker
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • basecloud-utm-tracker/tags/3.0.3/CHANGELOG.md

    r3460030 r3460077  
    11# Changelog
     2
     3## 3.0.3 - 2026-02-12
     4
     5**🎯 Merge Tag Intelligence Update**
     6
     7### Improved
     8
     9• **Smart Field Matching** - Enhanced merge tag parser with intelligent field detection:
     10  - Normalizes field labels by removing special characters (handles "Name & Surname", "E-Mail", etc.)
     11  - Added common field aliases (phone = telephone/mobile/contact number)
     12  - Better partial matching for complex field names
     13  - Prevents literal merge tags appearing in webhook data
     14• **Field Aliases** - Automatic mapping for common variations:
     15  - Phone: telephone, mobile, cell, contact number
     16  - Name: first name, full name, your name
     17  - Surname: last name, family name
     18  - Email: e-mail, email address
     19  - Message: comments, enquiry, inquiry, details
     20  - Plus more for company, address, city, country, date, time
     21• **Empty Field Handling** - Unmatched merge tags now replaced with empty string instead of showing literal {FieldName}
     22• **Special Character Support** - Properly handles ampersands, hyphens, and other special characters in field labels
     23
     24### Technical Details
     25
     26• Modified `parse_merge_tag()` function with 3-tier matching system:
     27  1. Exact normalized match (most accurate)
     28  2. Partial match within field label (flexible)
     29  3. Alias-based matching (common variations)
     30• Removes punctuation for comparison while preserving original labels
     31• Prevents webhook display_data from showing malformed merge tags
     32
     33---
    234
    335## 3.0.2 - 2026-02-12
  • basecloud-utm-tracker/tags/3.0.3/basecloud-utm-tracker.php

    r3460030 r3460077  
    44 * Plugin URI:        https://www.basecloudglobal.com/plugins/utm-tracker
    55 * Description:       The "Big 4" Form Automator. Advanced UTM tracking with automated injection for Gravity Forms, Elementor, WPForms, and Contact Form 7.
    6  * Version:           3.0.2
     6 * Version:           3.0.3
    77 * Author:            BaseCloud Team
    88 * Author URI:        https://www.basecloudglobal.com/
     
    303303            foreach ($matches as $match) {
    304304                $search_label = strtolower(trim($match[1]));
     305                $field_found = false;
    305306               
    306307                // Check for exact entry properties first
     
    340341                }
    341342               
    342                 // Search for field by label (case-insensitive, partial match)
     343                // Common field aliases for better matching
     344                $aliases = [
     345                    'phone' => ['phone', 'telephone', 'mobile', 'cell', 'contact number', 'contact', 'phone number'],
     346                    'name' => ['name', 'first name', 'full name', 'your name'],
     347                    'surname' => ['surname', 'last name', 'family name'],
     348                    'email' => ['email', 'e-mail', 'email address'],
     349                    'message' => ['message', 'comments', 'comment', 'enquiry', 'inquiry', 'details'],
     350                    'company' => ['company', 'business', 'organization', 'organisation'],
     351                    'address' => ['address', 'street', 'location'],
     352                    'city' => ['city', 'town'],
     353                    'country' => ['country', 'nation'],
     354                    'date' => ['date', 'booking date', 'appointment date'],
     355                    'time' => ['time', 'appointment time', 'booking time']
     356                ];
     357               
     358                // Search for field by label with improved matching
    343359                foreach ($form['fields'] as $field) {
    344360                    $field_label = strtolower($field->label);
     361                    // Normalize: remove special chars for comparison
     362                    $normalized_field = preg_replace('/[^a-z0-9\s]/', '', $field_label);
     363                    $normalized_search = preg_replace('/[^a-z0-9\s]/', '', $search_label);
    345364                   
    346                     // Check for exact or partial match
    347                     if ($field_label === $search_label ||
    348                         strpos($field_label, $search_label) !== false ||
    349                         strpos($search_label, $field_label) !== false) {
     365                    // 1. Exact match (normalized)
     366                    if ($normalized_field === $normalized_search) {
    350367                        $field_value = rgar($entry, $field->id);
    351368                        $value = str_replace($match[0], $field_value ?? '', $value);
     369                        $field_found = true;
    352370                        break;
    353371                    }
     372                   
     373                    // 2. Check if search term is in field label
     374                    if (strpos($normalized_field, $normalized_search) !== false) {
     375                        $field_value = rgar($entry, $field->id);
     376                        $value = str_replace($match[0], $field_value ?? '', $value);
     377                        $field_found = true;
     378                        break;
     379                    }
     380                   
     381                    // 3. Check aliases
     382                    foreach ($aliases as $alias_group) {
     383                        if (in_array($normalized_search, $alias_group)) {
     384                            foreach ($alias_group as $alias) {
     385                                if (strpos($normalized_field, $alias) !== false) {
     386                                    $field_value = rgar($entry, $field->id);
     387                                    $value = str_replace($match[0], $field_value ?? '', $value);
     388                                    $field_found = true;
     389                                    break 3;
     390                                }
     391                            }
     392                        }
     393                    }
     394                }
     395               
     396                // If field not found, replace with empty string to avoid showing {FieldName}
     397                if (!$field_found) {
     398                    $value = str_replace($match[0], '', $value);
    354399                }
    355400            }
     
    13021347                            <h1>UTM Tracker</h1>
    13031348                        </div>
    1304                         <span class="bc-version">v3.0.2</span>
     1349                        <span class="bc-version">v3.0.3</span>
    13051350                    </div>
    13061351
  • basecloud-utm-tracker/tags/3.0.3/readme.txt

    r3460030 r3460077  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 3.0.2
     6Stable tag: 3.0.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    198198
    199199== Changelog ==
     200
     201= 3.0.3 =
     202* 🎯 **Smart Field Matching** - Enhanced merge tag parser with intelligent field detection and normalization
     203* **Field Aliases** - Automatic mapping for common field variations (phone = telephone/mobile/contact number)
     204* **Special Character Support** - Properly handles ampersands, hyphens in field labels like "Name & Surname"
     205* **Better Empty Handling** - Unmatched merge tags replaced with empty string instead of showing literal {FieldName}
     206* **3-Tier Matching** - Exact match → Partial match → Alias-based matching for maximum compatibility
     207* FIXED: Merge tags like {Phone} now properly match fields named "Contact Number", "Telephone", "Mobile"
     208* FIXED: Complex field labels with special characters (& - .) now match simple merge tags
    200209
    201210= 3.0.2 =
  • basecloud-utm-tracker/trunk/CHANGELOG.md

    r3460030 r3460077  
    11# Changelog
     2
     3## 3.0.3 - 2026-02-12
     4
     5**🎯 Merge Tag Intelligence Update**
     6
     7### Improved
     8
     9• **Smart Field Matching** - Enhanced merge tag parser with intelligent field detection:
     10  - Normalizes field labels by removing special characters (handles "Name & Surname", "E-Mail", etc.)
     11  - Added common field aliases (phone = telephone/mobile/contact number)
     12  - Better partial matching for complex field names
     13  - Prevents literal merge tags appearing in webhook data
     14• **Field Aliases** - Automatic mapping for common variations:
     15  - Phone: telephone, mobile, cell, contact number
     16  - Name: first name, full name, your name
     17  - Surname: last name, family name
     18  - Email: e-mail, email address
     19  - Message: comments, enquiry, inquiry, details
     20  - Plus more for company, address, city, country, date, time
     21• **Empty Field Handling** - Unmatched merge tags now replaced with empty string instead of showing literal {FieldName}
     22• **Special Character Support** - Properly handles ampersands, hyphens, and other special characters in field labels
     23
     24### Technical Details
     25
     26• Modified `parse_merge_tag()` function with 3-tier matching system:
     27  1. Exact normalized match (most accurate)
     28  2. Partial match within field label (flexible)
     29  3. Alias-based matching (common variations)
     30• Removes punctuation for comparison while preserving original labels
     31• Prevents webhook display_data from showing malformed merge tags
     32
     33---
    234
    335## 3.0.2 - 2026-02-12
  • basecloud-utm-tracker/trunk/basecloud-utm-tracker.php

    r3460030 r3460077  
    44 * Plugin URI:        https://www.basecloudglobal.com/plugins/utm-tracker
    55 * Description:       The "Big 4" Form Automator. Advanced UTM tracking with automated injection for Gravity Forms, Elementor, WPForms, and Contact Form 7.
    6  * Version:           3.0.2
     6 * Version:           3.0.3
    77 * Author:            BaseCloud Team
    88 * Author URI:        https://www.basecloudglobal.com/
     
    303303            foreach ($matches as $match) {
    304304                $search_label = strtolower(trim($match[1]));
     305                $field_found = false;
    305306               
    306307                // Check for exact entry properties first
     
    340341                }
    341342               
    342                 // Search for field by label (case-insensitive, partial match)
     343                // Common field aliases for better matching
     344                $aliases = [
     345                    'phone' => ['phone', 'telephone', 'mobile', 'cell', 'contact number', 'contact', 'phone number'],
     346                    'name' => ['name', 'first name', 'full name', 'your name'],
     347                    'surname' => ['surname', 'last name', 'family name'],
     348                    'email' => ['email', 'e-mail', 'email address'],
     349                    'message' => ['message', 'comments', 'comment', 'enquiry', 'inquiry', 'details'],
     350                    'company' => ['company', 'business', 'organization', 'organisation'],
     351                    'address' => ['address', 'street', 'location'],
     352                    'city' => ['city', 'town'],
     353                    'country' => ['country', 'nation'],
     354                    'date' => ['date', 'booking date', 'appointment date'],
     355                    'time' => ['time', 'appointment time', 'booking time']
     356                ];
     357               
     358                // Search for field by label with improved matching
    343359                foreach ($form['fields'] as $field) {
    344360                    $field_label = strtolower($field->label);
     361                    // Normalize: remove special chars for comparison
     362                    $normalized_field = preg_replace('/[^a-z0-9\s]/', '', $field_label);
     363                    $normalized_search = preg_replace('/[^a-z0-9\s]/', '', $search_label);
    345364                   
    346                     // Check for exact or partial match
    347                     if ($field_label === $search_label ||
    348                         strpos($field_label, $search_label) !== false ||
    349                         strpos($search_label, $field_label) !== false) {
     365                    // 1. Exact match (normalized)
     366                    if ($normalized_field === $normalized_search) {
    350367                        $field_value = rgar($entry, $field->id);
    351368                        $value = str_replace($match[0], $field_value ?? '', $value);
     369                        $field_found = true;
    352370                        break;
    353371                    }
     372                   
     373                    // 2. Check if search term is in field label
     374                    if (strpos($normalized_field, $normalized_search) !== false) {
     375                        $field_value = rgar($entry, $field->id);
     376                        $value = str_replace($match[0], $field_value ?? '', $value);
     377                        $field_found = true;
     378                        break;
     379                    }
     380                   
     381                    // 3. Check aliases
     382                    foreach ($aliases as $alias_group) {
     383                        if (in_array($normalized_search, $alias_group)) {
     384                            foreach ($alias_group as $alias) {
     385                                if (strpos($normalized_field, $alias) !== false) {
     386                                    $field_value = rgar($entry, $field->id);
     387                                    $value = str_replace($match[0], $field_value ?? '', $value);
     388                                    $field_found = true;
     389                                    break 3;
     390                                }
     391                            }
     392                        }
     393                    }
     394                }
     395               
     396                // If field not found, replace with empty string to avoid showing {FieldName}
     397                if (!$field_found) {
     398                    $value = str_replace($match[0], '', $value);
    354399                }
    355400            }
     
    13021347                            <h1>UTM Tracker</h1>
    13031348                        </div>
    1304                         <span class="bc-version">v3.0.2</span>
     1349                        <span class="bc-version">v3.0.3</span>
    13051350                    </div>
    13061351
  • basecloud-utm-tracker/trunk/readme.txt

    r3460030 r3460077  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 3.0.2
     6Stable tag: 3.0.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    198198
    199199== Changelog ==
     200
     201= 3.0.3 =
     202* 🎯 **Smart Field Matching** - Enhanced merge tag parser with intelligent field detection and normalization
     203* **Field Aliases** - Automatic mapping for common field variations (phone = telephone/mobile/contact number)
     204* **Special Character Support** - Properly handles ampersands, hyphens in field labels like "Name & Surname"
     205* **Better Empty Handling** - Unmatched merge tags replaced with empty string instead of showing literal {FieldName}
     206* **3-Tier Matching** - Exact match → Partial match → Alias-based matching for maximum compatibility
     207* FIXED: Merge tags like {Phone} now properly match fields named "Contact Number", "Telephone", "Mobile"
     208* FIXED: Complex field labels with special characters (& - .) now match simple merge tags
    200209
    201210= 3.0.2 =
Note: See TracChangeset for help on using the changeset viewer.