Plugin Directory

Changeset 3194673


Ignore:
Timestamp:
11/22/2024 05:43:18 AM (17 months ago)
Author:
zohocrm
Message:

Php latest version compatibility checking

Location:
zoho-crm-forms/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • zoho-crm-forms/trunk/Readme.txt

    r3194617 r3194673  
    77Author: Zoho CRM
    88Tested up to: 6.7
    9 Stable tag: 1.8.0.2
     9Stable tag: 1.8.0.3
    1010License: GPLv2 or later
    11 Version: 1.8.0.2
     11Version: 1.8.0.3
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1313
     
    3113111.8.0.2
    312312Php latest version compatibility checking
     3131.8.0.3
     314Php latest version compatibility checking
    313315
    314316== Upgrade notice ==
  • zoho-crm-forms/trunk/includes/crmcontactform7.php

    r3193765 r3194673  
    55require_once('crmcontactformgenerator.php');
    66add_action('wpcf7_before_send_mail', 'zcfcontact_forms_submitdata');
    7 
    87function zcfreplace_key_function($all_fields, $key1, $key2) {
     8    if (!is_array($all_fields) || !array_key_exists($key1, $all_fields)) {
     9        return $all_fields;
     10    }
    911    $keys = array_keys($all_fields);
    10     $index = array_search($key1, $keys);
     12    $values = array_values($all_fields);
     13    $index = array_search($key1, $keys, true);
    1114    if ($index !== false) {
    1215        $keys[$index] = $key2;
    13         $all_fields = array_combine($keys, $all_fields);
    14     }
    15     return $all_fields;
     16    }
     17    return array_combine($keys, $values);
    1618}
    1719
     
    5759        }
    5860
    59         $mapped_array = $check_map_exist['fields'];
     61        $mapped_array = isset($check_map_exist['fields']) && is_array($check_map_exist['fields']) ? $check_map_exist['fields'] : [];
    6062        $mapped_array_key_labels = array_keys($mapped_array);
    6163        $get_json_array = $wpdb->get_results($wpdb->prepare("select ID,post_content from $wpdb->posts where ID=%d", $post_id));
  • zoho-crm-forms/trunk/includes/crmcontactformfieldsmapping.php

    r3178280 r3194673  
    213213            if (preg_match('/^thirdpartyfield/', $data_key)) {
    214214                $thirdparty_key = ltrim($data_key, 'thirdpartyfield_');
    215                 $thirdparty_labels[$thirdparty_key] = $data_val; // Make thirdparty label array
     215                $thirdparty_labels[$thirdparty_key] = $data_val;
    216216            }
    217217
     
    219219                $crm_field_key = ltrim($data_key, 'crm_fields_');
    220220                if ($data_val != '--None--') {
    221                     $crm_labels[$crm_field_key] = $data_val; // Make crm labels array -take only mapped values
    222                 }
    223             }
    224         }
    225         $get_keys_crm_labels = array_keys($crm_labels); // get keys from crm labels- to prepare mapped thirdparty labels
    226 
     221                    $crm_labels[$crm_field_key] = $data_val;
     222                }
     223            }
     224        }
     225        $get_keys_crm_labels = is_array($crm_labels) ? array_keys($crm_labels) : [];
    227226        foreach ($thirdparty_labels as $tp_key => $tp_val) {
    228227            foreach ($get_keys_crm_labels as $index_val) {
    229                 if ($tp_key == $index_val) {//check crm key index with thirdparty label  array
    230                     $thirdparty_mapped_labels[$tp_key] = $tp_val;  // prepare mapped values for thirdparty label array
    231                 }
    232             }
    233         }
    234         $mapped_array = array_combine($thirdparty_mapped_labels, $crm_labels); // Combine final mapped array(thirdparty, crm fields)
     228                if ($tp_key == $index_val) {
     229                    $thirdparty_mapped_labels[$tp_key] = $tp_val; 
     230                }
     231            }
     232        }
     233        if (is_array($thirdparty_mapped_labels) && is_array($crm_labels) && count($thirdparty_mapped_labels) === count($crm_labels)){
     234            $mapped_array = array_combine($thirdparty_mapped_labels, $crm_labels);
     235        }else{
     236            $mapped_array = [];
     237        }
    235238        $final_mapped_array = array();
    236239        $final_mapped_array['form_title'] = $form_title;
  • zoho-crm-forms/trunk/includes/crmcontactformgenerator.php

    r3194617 r3194673  
    6666
    6767$FormSettings = $newform->zcfFormPropSettings($attr['name']);
    68 $FormSettingsArray = is_array($FormSettings)
    69     ? $FormSettings
    70     : json_decode(json_encode($FormSettings), true);
     68$FormSettingsArray = is_array($FormSettings)? $FormSettings: json_decode(json_encode($FormSettings), true);
    7169$FormSettingsArray = $FormSettingsArray ?? [];
    7270
  • zoho-crm-forms/trunk/index.php

    r3194617 r3194673  
    44 * Plugin Name: Zoho CRM Lead Magnet
    55 * Description: Websites are one of the most important sources of leads for your business. That means your CRM system should be well integrated with your website to contextually capture each and every visitor to turn them into a lead.Introducing the Zoho CRM Lead Capture plugin for Wordpress. This lets you create webforms, embed them in your website, and automatically capture leads directly into your CRM with zero attenuation.Not only is the integration easy to set-up but it's also easy on your wallet.
    6  * Version: 1.8.0.2
     6 * Version: 1.8.0.3
    77 * ***************************************************************************************** */
    88if (!defined('ABSPATH'))
    99    exit;
    1010
    11         define( 'ZCF_VERSION', '1.8.0.2' );
     11        define( 'ZCF_VERSION', '1.8.0.3' );
    1212        define( 'ZCF_LBPLUGINFILE', __FILE__ );
    1313        define( 'ZCF_LBPLUGIN_URL', untrailingslashit( plugins_url( '', ZCF_LBPLUGINFILE ) ) );
Note: See TracChangeset for help on using the changeset viewer.