Plugin Directory

Changeset 3397112


Ignore:
Timestamp:
11/17/2025 10:52:43 AM (4 months ago)
Author:
samsonovteamwork
Message:

Ver 1.0.1

Location:
form-attribution-tracking/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • form-attribution-tracking/trunk/attribution-tracking.php

    r3397097 r3397112  
    44 * Plugin URI: https://wordpress.org/plugin/form-referral-source
    55 * Description: Automatically adds permanent hidden referral source fields to forms from Formidable and Fluent Forms
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: Ryan Howard
    88 * Author URI: https://www.ryanhoward.dev
     
    2323
    2424// Define plugin constants
    25 define('ATTRIBUTION_TRACKING_VERSION', '1.0.0');
     25define('ATTRIBUTION_TRACKING_VERSION', '1.0.1');
    2626define('ATTRIBUTION_TRACKING_PLUGIN_FILE', __FILE__);
    2727define('ATTRIBUTION_TRACKING_PLUGIN_DIR', plugin_dir_path(__FILE__));
  • form-attribution-tracking/trunk/readme.md

    r3397093 r3397112  
    66Tested up to: 6.8
    77Requires PHP: 8.0
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    205205## Changelog
    206206
     207### 1.0.1
     208- Fixed a fatal error occurring on Fluent Forms submissions when fallback attribution data was processed as a string instead of an array.
     209- Improved validation and safety checks for referral source population.
     210- Enhanced compatibility with Fluent Forms to prevent incorrect data handling.
     211
     212
    207213### 1.0.0
    208214- Initial release
  • form-attribution-tracking/trunk/src/Integrations/FluentFormsIntegration.php

    r3397093 r3397112  
    9191    {
    9292        $field_name = $this->getReferralSourceFieldName();
    93        
     93
    9494        // Only populate if field is empty (JavaScript failed)
    9595        if (!isset($data[$field_name]) || empty($data[$field_name])) {
    9696            $referral_source = $this->getReferralSourceFromRequest();
    9797            if ($referral_source) {
    98                 $insertData['response'][$field_name] = $referral_source;
     98                $rawResponse = $insertData['response'] ?? '';
     99
     100                if (is_string($rawResponse) && $rawResponse !== '') {
     101                    $response = json_decode($rawResponse, true);
     102                    if (json_last_error() !== JSON_ERROR_NONE || !is_array($response)) {
     103                        $response = [];
     104                    }
     105                } elseif (is_array($rawResponse)) {
     106                    $response = $rawResponse;
     107                } else {
     108                    $response = [];
     109                }
     110                $response[$field_name] = $referral_source;
     111
     112                $insertData['response'] = wp_json_encode($response);
    99113                $this->log('Fallback referral source populated', [
    100114                    'form_id' => $form->id,
Note: See TracChangeset for help on using the changeset viewer.