Plugin Directory

Changeset 2701025


Ignore:
Timestamp:
03/29/2022 07:01:41 AM (4 years ago)
Author:
codup
Message:

updated files

Location:
codup-wp-freshsales/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • codup-wp-freshsales/trunk/includes/class-codup-freshsales-cf.php

    r2556757 r2701025  
    7878         */
    7979        public function get_cf7_fields( $form ) {
    80             $fields        = [];
     80            $fields        = array();
    8181            $manager       = WPCF7_FormTagsManager::get_instance();
    8282            $tags          = $manager->scan( $form->form );
     
    8888                }
    8989
    90                 $fields[] = (object) [
     90                $fields[] = (object) array(
    9191                    'name' => $value->name,
    9292                    'type' => rtrim( $value->type, '*' ),
    93                 ];
     93                );
    9494            }
    9595            return $fields;
     
    101101         */
    102102        public function get_lead_fields() {
    103             $lead_fields = [];
     103            $lead_fields = array();
    104104            include 'freshsales-lead-fields.php';
    105105            return $lead_fields;
     
    115115        public function validate_freshsales_fields( $validator ) {
    116116            if ( wp_verify_nonce( ( filter_input( INPUT_POST, 'wpcf7-freshsales', 'enable' ) != null ) && sanitize_text_field( wp_unslash( isset( $_POST['wpcf7-freshsales']['enable'] ) ) ) == 'yes' && isset( $_POST['wpcf7-freshsales']['last_name'] ) && empty( sanitize_text_field( wp_unslash( $_POST['wpcf7-freshsales']['last_name'] ) ) ) ) ) {
    117                 $validator->add_error( 'freshsales.last_name', 100, [ 'message' => __( 'Last name is required.', 'codup-wp-freshsales' ) ] );
     117                $validator->add_error( 'freshsales.last_name', 100, array( 'message' => __( 'Last name is required.', 'codup-wp-freshsales' ) ) );
    118118            }
    119119        }
     
    143143         */
    144144        public function get_saved_setting( $args ) {
    145             return get_option( 'cwpfs_cf7_' . $args->id(), [] );
     145            return get_option( 'cwpfs_cf7_' . $args->id(), array() );
    146146        }
    147147
     
    155155
    156156            // If email is sent or failed.
    157             if ( empty( $result['status'] ) || ! in_array( $result['status'], [ 'mail_sent', 'mail_failed' ] ) ) {
     157            if ( empty( $result['status'] ) || ! in_array( $result['status'], array( 'mail_sent', 'mail_failed' ) ) ) {
    158158                return;
    159159            }
     
    179179            );
    180180
    181             $args = [];
     181            $args = array();
    182182            foreach ( $settings as $key => $value ) {
    183183                if ( is_array( $value ) ) {
     
    227227                'Content-Type'  => 'application/json',
    228228            );
    229             $lead_data     = apply_filters( 'cwpfs_create_lead_args', [ 'lead' => $args ] );
     229            $lead_data     = apply_filters( 'cwpfs_create_lead_args', array( 'lead' => $args ) );
    230230            $response      = wp_remote_post(
    231231                $url,
     
    272272         */
    273273        public function sanitize_form_settings( $settings, $form_id ) {
    274             $fields_filter_cf  = filter_input( INPUT_POST, 'wpcf7-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
    275             $company_settings  = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
    276             $custom_settings   = array_map( 'sanitize_text_field', wp_unslash( $settings['custom_field'] ) );
    277             $fields            = array_map( 'sanitize_text_field', wp_unslash( $fields_filter_cf ) );
    278             $fields['company'] = $company_settings;
     274            $fields_filter_cf       = filter_input( INPUT_POST, 'wpcf7-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
     275            $company_settings       = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
     276            $custom_settings        = array_map( 'sanitize_text_field', wp_unslash( $settings['custom_field'] ) );
     277            $fields                 = array_map( 'sanitize_text_field', wp_unslash( $fields_filter_cf ) );
     278            $fields['company']      = $company_settings;
    279279            $fields['custom_field'] = $custom_settings;
    280             $form_settings     = apply_filters( 'cwpfs_form_settings', $fields, $form_id );
     280            $form_settings          = apply_filters( 'cwpfs_form_settings', $fields, $form_id );
    281281            return $form_settings;
    282282        }
  • codup-wp-freshsales/trunk/includes/class-codup-freshsales-ff.php

    r2556757 r2701025  
    6262        public function get_my_new_settings( $values ) {
    6363            $form_id_fields = filter_input( INPUT_GET, 'id', FILTER_DEFAULT );
    64             $lead_fields   = $this->get_lead_fields();
    65             $form_fields   = $this->get_cff_fields( $values );
    66             $id            = sanitize_text_field( $form_id_fields );
    67             $currentformid = (int) $id;
     64            $lead_fields    = $this->get_lead_fields();
     65            $form_fields    = $this->get_cff_fields( $values );
     66            $id             = sanitize_text_field( $form_id_fields );
     67            $currentformid  = (int) $id;
    6868            $this->formidable_save_settings( $currentformid );
    6969            $settings = $this->get_formidableform_saved_setting( $currentformid );
     
    7878         */
    7979        public function get_formidableform_saved_setting( $form_id ) {
    80             return get_option( 'cwpfs_fform_' . $form_id, [] );
     80            return get_option( 'cwpfs_fform_' . $form_id, array() );
    8181        }
    8282
     
    8787         */
    8888        public function get_lead_fields() {
    89             $lead_fields = [];
     89            $lead_fields = array();
    9090            include 'freshsales-lead-fields.php';
    9191            return $lead_fields;
     
    120120         */
    121121        public function sanitize_form_settings( $settings, $form_id ) {
    122             $fields_filter_ff  = filter_input( INPUT_POST, 'wpff-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
    123             $company_settings  = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
    124             $custom_settings   = array_map( 'sanitize_text_field', wp_unslash( $settings['custom_field'] ) );
    125             $fields            = array_map( 'sanitize_text_field', wp_unslash( $fields_filter_ff ) );
    126             $fields['company'] = $company_settings;
     122            $fields_filter_ff       = filter_input( INPUT_POST, 'wpff-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
     123            $company_settings       = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
     124            $custom_settings        = array_map( 'sanitize_text_field', wp_unslash( $settings['custom_field'] ) );
     125            $fields                 = array_map( 'sanitize_text_field', wp_unslash( $fields_filter_ff ) );
     126            $fields['company']      = $company_settings;
    127127            $fields['custom_field'] = $custom_settings;
    128             $form_settings     = apply_filters( 'formidable_form_settings', $fields, $form_id );
     128            $form_settings          = apply_filters( 'formidable_form_settings', $fields, $form_id );
    129129            return $form_settings;
    130130        }
     
    154154            $settings = $this->get_formidableform_saved_setting( $form_id );
    155155            unset( $settings['enable'] );
    156             $lead_data = apply_filters( 'cwpfs_fform_create_lead', [ 'lead' => $settings ] );
     156            $lead_data = apply_filters( 'cwpfs_fform_create_lead', array( 'lead' => $settings ) );
    157157
    158158            if ( ! $this->lead_generation_enabled( $form_id ) ) {
  • codup-wp-freshsales/trunk/includes/class-codup-freshsales-gf.php

    r2556757 r2701025  
    2828            add_filter( 'gform_form_settings_menu', array( $this, 'freshsales_settings_menu_tab' ) );
    2929            add_action( 'gform_form_settings_page_freshsales_form_settings_page', array( $this, 'freshsales_form_settings_page' ) );
    30        
    31             add_filter( 'gform_field_value_source',  array( $this,'my_custom_population_source' ) );
    32             add_filter( 'gform_field_value_campaign',  array( $this,'my_custom_population_campaign' ) );
    33             add_filter( 'gform_field_value_medium',  array( $this,'my_custom_population_medium' ) );
    34             add_filter( 'gform_field_value_term',  array( $this,'my_custom_population_term' ) );
    35             add_filter( 'gform_field_value_content',  array( $this,'my_custom_population_content' ) );
    36             add_filter( 'gform_field_value_refurl',  array( $this,'populate_referral_refurl' ) );
    37             add_filter( 'gform_field_value_embdurl',  array( $this,'populate_referral_embdurl' ) );
    38         }
    39 
    40         function populate_referral_refurl( $value ){
     30
     31            add_filter( 'gform_field_value_source', array( $this, 'my_custom_population_source' ) );
     32            add_filter( 'gform_field_value_campaign', array( $this, 'my_custom_population_campaign' ) );
     33            add_filter( 'gform_field_value_medium', array( $this, 'my_custom_population_medium' ) );
     34            add_filter( 'gform_field_value_term', array( $this, 'my_custom_population_term' ) );
     35            add_filter( 'gform_field_value_content', array( $this, 'my_custom_population_content' ) );
     36            add_filter( 'gform_field_value_refurl', array( $this, 'populate_referral_refurl' ) );
     37            add_filter( 'gform_field_value_embdurl', array( $this, 'populate_referral_embdurl' ) );
     38        }
     39
     40        function populate_referral_refurl( $value ) {
    4141            $refurl = $_SERVER['HTTP_REFERER'];
    42             return esc_url_raw($refurl);
    43         }
    44         function populate_referral_embdurl( $value ){
    45             $embdurl = $_SERVER['REQUEST_URI'];
     42            return esc_url_raw( $refurl );
     43        }
     44        function populate_referral_embdurl( $value ) {
     45            $embdurl   = $_SERVER['REQUEST_URI'];
    4646            $http_name = $_SERVER['HTTP_HOST'];
    47             $total = $http_name . $embdurl;
    48             return esc_url_raw($embdurl);
     47            $total     = $http_name . $embdurl;
     48            return esc_url_raw( $embdurl );
    4949        }
    5050        function my_custom_population_medium( $value ) {
     
    6464            return $utm_campaign;
    6565        }
    66         public function my_custom_population_source(){
     66        public function my_custom_population_source() {
    6767            $utm_source = $_GET['utm_source'];
    6868            return $utm_source;
     
    9090            GFFormSettings::page_header();
    9191            $form_id_fieldsmap_gf = filter_input( INPUT_GET, 'id', FILTER_DEFAULT );
    92             $id            = sanitize_text_field( $form_id_fieldsmap_gf );
    93             $currentformid = (int) $id;
    94             $forminfo      = RGFormsModel::get_form( $currentformid );
     92            $id                   = sanitize_text_field( $form_id_fieldsmap_gf );
     93            $currentformid        = (int) $id;
     94            $forminfo             = RGFormsModel::get_form( $currentformid );
    9595            $this->gravityform_save_settings( $currentformid );
    9696            $form_fields = $this->get_all_form_fields( $currentformid );
     
    130130         */
    131131        public function get_lead_fields() {
    132             $lead_fields = [];
     132            $lead_fields = array();
    133133            include 'freshsales-lead-fields.php';
    134134            return $lead_fields;
     
    156156            if ( isset( $_POST['gf_save_form'] ) ) {
    157157                $form_id_save_gf = filter_input( INPUT_GET, 'id', FILTER_DEFAULT );
    158                 $id            = sanitize_text_field( $form_id_save_gf );
    159                 $currentformid = (int) $id;
    160                 $form_id       = $currentformid;
     158                $id              = sanitize_text_field( $form_id_save_gf );
     159                $currentformid   = (int) $id;
     160                $form_id         = $currentformid;
    161161                if ( ! empty( $_POST ) && isset( $_POST['wpgf-freshsales'] ) ) {
    162162                    if ( ! filter_input( INPUT_POST, 'cwpfs-form_nonce' ) != null || wp_verify_nonce( ! filter_input( INPUT_POST, ' cwpfs-form_nonce ' ), 'cwpfs-form-settings' ) ) {
     
    178178         */
    179179        public function get_gravityform_saved_setting( $form_id ) {
    180             return get_option( 'cwpfs_gform_' . $form_id, [] );
     180            return get_option( 'cwpfs_gform_' . $form_id, array() );
    181181        }
    182182
     
    190190         */
    191191        public function sanitize_gravityform_settings( $settings, $form_id ) {
    192             $fields_filter     = filter_input( INPUT_POST, 'wpgf-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
    193             $form_id_fields_gf = filter_input( INPUT_GET, 'id', FILTER_DEFAULT );
    194             $id                = sanitize_text_field( $form_id_fields_gf );
    195             $currentformid     = (int) $id;
    196             $form_id           = $currentformid;
    197             $company_settings  = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
     192            $fields_filter          = filter_input( INPUT_POST, 'wpgf-freshsales', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
     193            $form_id_fields_gf      = filter_input( INPUT_GET, 'id', FILTER_DEFAULT );
     194            $id                     = sanitize_text_field( $form_id_fields_gf );
     195            $currentformid          = (int) $id;
     196            $form_id                = $currentformid;
     197            $company_settings       = array_map( 'sanitize_text_field', wp_unslash( $settings['company'] ) );
    198198            $custom_field_settings  = array_map( 'sanitize_text_field', wp_unslash( $settings['custom_field'] ) );
    199             $fields            = array_map( 'sanitize_text_field', wp_unslash( $fields_filter ) );
    200             $fields['company'] = $company_settings;
     199            $fields                 = array_map( 'sanitize_text_field', wp_unslash( $fields_filter ) );
     200            $fields['company']      = $company_settings;
    201201            $fields['custom_field'] = $custom_field_settings;
    202             $form_settings     = apply_filters( 'gravity_form_settings', $fields, $form_id );
     202            $form_settings          = apply_filters( 'gravity_form_settings', $fields, $form_id );
    203203            return $form_settings;
    204204        }
     
    230230            $settings      = $this->get_gravityform_saved_setting( $currentformid );
    231231            unset( $settings['enable'] );
    232             $lead_data = apply_filters( 'cwpfs_gform_create_lead', [ 'lead' => $settings ] );
     232            $lead_data = apply_filters( 'cwpfs_gform_create_lead', array( 'lead' => $settings ) );
    233233
    234234            if ( ! $this->lead_generation_enabled( $currentformid ) ) {
     
    243243            $post_url   = "https://{$freshsales->domain}/api/leads";
    244244
    245 
    246245            foreach ( $lead_data['lead'] as $field_name => $field_value ) {
    247                 if(is_array( $field_value ) &&  $field_name == 'company'){
     246                if ( is_array( $field_value ) && $field_name == 'company' ) {
    248247                    foreach ( $lead_data['lead']['company'] as $field_name1 => $field_value1 ) {
    249248                        $lead_data['lead']['company'][ $field_name1 ] = rgar( $entry, $field_value1 );
    250249                    }
    251                 }
    252                 elseif(is_array( $field_value ) &&  $field_name == 'custom_field'){
     250                } elseif ( is_array( $field_value ) && $field_name == 'custom_field' ) {
    253251                    foreach ( $lead_data['lead']['custom_field'] as $field_name2 => $field_value2 ) {
    254252                        $lead_data['lead']['custom_field'][ $field_name2 ] = rgar( $entry, $field_value2 );
    255253                    }
     254                } else {
     255                    $lead_data['lead'][ $field_name ] = rgar( $entry, $field_value );
    256256                }
    257                 else {
    258                     $lead_data['lead'][ $field_name ] = rgar( $entry, $field_value );
    259                 }
    260257            }
    261258            GFCommon::log_debug( 'gform_after_submission: body => ' . print_r( $lead_data['lead'], true ) );
  • codup-wp-freshsales/trunk/includes/class-codup-wp-freshsales.php

    r2556757 r2701025  
    2525         * @var     $settings
    2626         */
    27         public $settings = [];
     27        public $settings = array();
    2828        /**
    2929         * Short description for file
     
    3131         * @var validation_notice
    3232         */
    33         public $validation_notice = [];
     33        public $validation_notice = array();
    3434        /**
    3535         * Constructor.
     
    7474         */
    7575        public function save_settings() {
    76             $domain_wp_save = filter_input( INPUT_POST, 'cwpfs_domain', FILTER_DEFAULT );
     76            $domain_wp_save  = filter_input( INPUT_POST, 'cwpfs_domain', FILTER_DEFAULT );
    7777            $api_key_wp_save = filter_input( INPUT_POST, 'cwpfs_api_key', FILTER_DEFAULT );
    78             $domain   = sanitize_text_field( $domain_wp_save );
    79             $api_key  = sanitize_text_field( $api_key_wp_save );
    80             $settings = apply_filters(
     78            $domain          = sanitize_text_field( $domain_wp_save );
     79            $api_key         = sanitize_text_field( $api_key_wp_save );
     80            $settings        = apply_filters(
    8181                'cwpfs_settings',
    82                 [
     82                array(
    8383                    'api_key' => $api_key,
    8484                    'domain'  => $domain,
    85                 ]
     85                )
    8686            );
    8787            update_option( 'cwpfs_settings', $settings );
     
    9595         */
    9696        public function cwpfs_get_old_value( $name ) {
    97             if ( ( isset( $_POST[ 'cwpfs_'.$name ] ) ) ) {
     97            if ( ( isset( $_POST[ 'cwpfs_' . $name ] ) ) ) {
    9898                return ( sanitize_text_field( wp_unslash( $_POST[ 'cwpfs_' . $name ] ) ) );
    9999            } elseif ( isset( $this->settings[ $name ] ) ) {
     
    108108         * @return boolean
    109109         */
    110         public function validate_freshsales_api_domain(){
    111             $domain_wp = filter_input( INPUT_POST, 'cwpfs_domain', FILTER_DEFAULT );
    112             $api_key_wp = filter_input( INPUT_POST, 'cwpfs_api_key', FILTER_DEFAULT );
    113             $domain        = sanitize_text_field(  $domain_wp );
     110        public function validate_freshsales_api_domain() {
     111            $domain_wp     = filter_input( INPUT_POST, 'cwpfs_domain', FILTER_DEFAULT );
     112            $api_key_wp    = filter_input( INPUT_POST, 'cwpfs_api_key', FILTER_DEFAULT );
     113            $domain        = sanitize_text_field( $domain_wp );
    114114            $api_key       = sanitize_text_field( $api_key_wp );
    115115            $url           = "https://{$domain}/api/leads/filters";
     
    118118                'Content-Type'  => 'application/json',
    119119            );
    120             $response      = wp_remote_get( $url, [ 'headers' => $headers ] );
     120            $response      = wp_remote_get( $url, array( 'headers' => $headers ) );
    121121            $response_code = wp_remote_retrieve_response_code( $response );
    122122
    123123            if ( 200 != $response_code ) {
    124124                // print_r($this->validation_notice = [
    125                 //  'message' => _e( 'Invalid Domain or Api Key.', 'codup-wp-freshsales' ),
    126                 //  'type'    => 'error',
     125                // 'message' => _e( 'Invalid Domain or Api Key.', 'codup-wp-freshsales' ),
     126                // 'type'    => 'error',
    127127                // ]);
    128                 $this->validation_notice = [
     128                $this->validation_notice = array(
    129129                    'message' => __( 'Invalid Domain or Api Key.', 'codup-wp-freshsales' ),
    130130                    'type'    => 'error',
    131                 ];
     131                );
    132132                return false;
    133133            } else {
    134                 $this->validation_notice = [
     134                $this->validation_notice = array(
    135135                    'message' => __( 'Settings saved successfully. Please go to "freshsales" tab on form add/edit page for mapping.', 'codup-wp-freshsales' ),
    136136                    'type'    => 'updated',
    137                 ];
     137                );
    138138                return true;
    139139            }
     
    146146         */
    147147        public static function get_freshsales_settings() {
    148             $saved_freshsales = get_option( 'cwpfs_settings', [] );
     148            $saved_freshsales = get_option( 'cwpfs_settings', array() );
    149149            if ( ! empty( $saved_freshsales ) ) {
    150150                return $saved_freshsales;
  • codup-wp-freshsales/trunk/includes/freshsales-lead-fields.php

    r2556757 r2701025  
    66 */
    77
    8 $lead_fields['first_name']    = (object) [
     8$lead_fields['first_name']    = (object) array(
    99    'name'      => 'first_name',
    1010    'label'     => __( 'First Name', 'codup-wp-freshsales' ),
    1111    'is_single' => true,
    12 ];
    13 $lead_fields['last_name']     = (object) [
     12);
     13$lead_fields['last_name']     = (object) array(
    1414    'name'      => 'last_name',
    1515    'label'     => __( 'Last Name *', 'codup-wp-freshsales' ),
    1616    'is_single' => true,
    17 ];
    18 $lead_fields['mobile_number'] = (object) [
     17);
     18$lead_fields['mobile_number'] = (object) array(
    1919    'name'      => 'mobile_number',
    2020    'label'     => __( 'Mobile', 'codup-wp-freshsales' ),
    2121    'is_single' => true,
    22 ];
    23 $lead_fields['work_number']   = (object) [
     22);
     23$lead_fields['work_number']   = (object) array(
    2424    'name'      => 'work_number',
    2525    'label'     => __( 'Work', 'codup-wp-freshsales' ),
    2626    'is_single' => true,
    27 ];
    28 $lead_fields['email']         = (object) [
     27);
     28$lead_fields['email']         = (object) array(
    2929    'name'      => 'email',
    3030    'label'     => __( 'Email', 'codup-wp-freshsales' ),
    3131    'is_single' => true,
    32 ];
    33 $lead_fields['job_title']     = (object) [
     32);
     33$lead_fields['job_title']     = (object) array(
    3434    'name'      => 'job_title',
    3535    'label'     => __( 'Job title', 'codup-wp-freshsales' ),
    3636    'is_single' => true,
    37 ];
    38 $lead_fields['department']    = (object) [
     37);
     38$lead_fields['department']    = (object) array(
    3939    'name'      => 'department',
    4040    'label'     => __( 'Department', 'codup-wp-freshsales' ),
    4141    'is_single' => true,
    42 ];
    43 $lead_fields['address']       = (object) [
     42);
     43$lead_fields['address']       = (object) array(
    4444    'name'      => 'address',
    4545    'label'     => __( 'Address', 'codup-wp-freshsales' ),
    4646    'is_single' => true,
    47 ];
    48 $lead_fields['city']          = (object) [
     47);
     48$lead_fields['city']          = (object) array(
    4949    'name'      => 'city',
    5050    'label'     => __( 'City', 'codup-wp-freshsales' ),
    5151    'is_single' => true,
    52 ];
    53 $lead_fields['state']         = (object) [
     52);
     53$lead_fields['state']         = (object) array(
    5454    'name'      => 'state',
    5555    'label'     => __( 'State', 'codup-wp-freshsales' ),
    5656    'is_single' => true,
    57 ];
    58 $lead_fields['zipcode']       = (object) [
     57);
     58$lead_fields['zipcode']       = (object) array(
    5959    'name'      => 'zipcode',
    6060    'label'     => __( 'Zipcode', 'codup-wp-freshsales' ),
    6161    'is_single' => true,
    62 ];
    63 $lead_fields['country']       = (object) [
     62);
     63$lead_fields['country']       = (object) array(
    6464    'name'      => 'country',
    6565    'label'     => __( 'Country', 'codup-wp-freshsales' ),
    6666    'is_single' => true,
    67 ];
     67);
    6868
    69 //from here
    70 $lead_fields['medium']    = (object) [
     69// from here
     70$lead_fields['medium'] = (object) array(
    7171    'name'      => 'medium',
    7272    'label'     => __( 'Medium', 'codup-wp-freshsales' ),
    7373    'is_single' => true,
    74 ];
     74);
    7575
    7676
    77 //custom fields
    78 $lead_fields['custom_field'] = (object) [
    79     'is_single' => false,
    80     'cf_term'      => (object) [
     77// custom fields
     78$lead_fields['custom_field'] = (object) array(
     79    'is_single'         => false,
     80    'cf_term'           => (object) array(
    8181        'name'      => '[custom_field][cf_term]',
    8282        'label'     => __( 'Term', 'codup-wp-freshsales' ),
    8383        'is_single' => false,
    84     ],
    85     'cf_content'      => (object) [
     84    ),
     85    'cf_content'        => (object) array(
    8686        'name'      => '[custom_field][cf_content]',
    8787        'label'     => __( 'Content', 'codup-wp-freshsales' ),
    8888        'is_single' => false,
    89     ],
    90     'cf_http_referral'      => (object) [
     89    ),
     90    'cf_http_referral'  => (object) array(
    9191        'name'      => '[custom_field][cf_http_referral]',
    9292        'label'     => __( 'HTTP Referral', 'codup-wp-freshsales' ),
    9393        'is_single' => false,
    94     ],
    95     'cf_embed_url'      => (object) [
     94    ),
     95    'cf_embed_url'      => (object) array(
    9696        'name'      => '[custom_field][cf_embed_url]',
    9797        'label'     => __( 'Embed URL', 'codup-wp-freshsales' ),
    9898        'is_single' => false,
    99     ],
    100     'cf_source_name'=> (object) [
     99    ),
     100    'cf_source_name'    => (object) array(
    101101        'name'      => '[custom_field][cf_source_name]',
    102102        'label'     => __( 'Source Name', 'codup-wp-freshsales' ),
    103103        'is_single' => false,
    104     ],
    105     'cf_campaign_name'=> (object) [
     104    ),
     105    'cf_campaign_name'  => (object) array(
    106106        'name'      => '[custom_field][cf_campaign_name]',
    107107        'label'     => __( 'Campaign Name', 'codup-wp-freshsales' ),
    108108        'is_single' => false,
    109     ],
    110     'cf_message'=> (object) [
     109    ),
     110    'cf_message'        => (object) array(
    111111        'name'      => '[custom_field][cf_message]',
    112112        'label'     => __( 'Message', 'codup-wp-freshsales' ),
    113113        'is_single' => false,
    114     ],
    115     'cf_project_detail'=> (object) [
     114    ),
     115    'cf_project_detail' => (object) array(
    116116        'name'      => '[custom_field][cf_project_detail]',
    117117        'label'     => __( 'Project Detail', 'codup-wp-freshsales' ),
    118118        'is_single' => false,
    119     ],
    120     'cf_start_date'=> (object) [
     119    ),
     120    'cf_start_date'     => (object) array(
    121121        'name'      => '[custom_field][cf_start_date]',
    122122        'label'     => __( 'Start Date', 'codup-wp-freshsales' ),
    123123        'is_single' => false,
    124     ],
    125     'cf_budget'=> (object) [
     124    ),
     125    'cf_budget'         => (object) array(
    126126        'name'      => '[custom_field][cf_budget]',
    127127        'label'     => __( 'Budget', 'codup-wp-freshsales' ),
    128128        'is_single' => false,
    129     ],
    130 ];
     129    ),
     130);
    131131
    132 //to here
    133 $lead_fields['company']       = (object) [
     132// to here
     133$lead_fields['company'] = (object) array(
    134134    'is_single' => false,
    135     'name'      => (object) [
     135    'name'      => (object) array(
    136136        'name'      => '[company][name]',
    137137        'label'     => __( 'Company Name', 'codup-wp-freshsales' ),
    138138        'is_single' => false,
    139     ],
    140     'address'   => (object) [
     139    ),
     140    'address'   => (object) array(
    141141        'name'      => '[company][address]',
    142142        'label'     => __( 'Company Address', 'codup-wp-freshsales' ),
    143143        'is_single' => false,
    144     ],
    145     'city'      => (object) [
     144    ),
     145    'city'      => (object) array(
    146146        'name'      => '[company][city]',
    147147        'label'     => __( 'Company City', 'codup-wp-freshsales' ),
    148148        'is_single' => false,
    149     ],
    150     'state'     => (object) [
     149    ),
     150    'state'     => (object) array(
    151151        'name'      => '[company][state]',
    152152        'label'     => __( 'Company State', 'codup-wp-freshsales' ),
    153153        'is_single' => false,
    154     ],
    155     'country'   => (object) [
     154    ),
     155    'country'   => (object) array(
    156156        'name'      => '[company][country]',
    157157        'label'     => __( 'Company Country', 'codup-wp-freshsales' ),
    158158        'is_single' => false,
    159     ],
    160     'zipcode'   => (object) [
     159    ),
     160    'zipcode'   => (object) array(
    161161        'name'      => '[company][zipcode]',
    162162        'label'     => __( 'Company Zipcode', 'codup-wp-freshsales' ),
    163163        'is_single' => false,
    164     ],
    165     'website'   => (object) [
     164    ),
     165    'website'   => (object) array(
    166166        'name'      => '[company][website]',
    167167        'label'     => __( 'Company Website', 'codup-wp-freshsales' ),
    168168        'is_single' => false,
    169     ],
    170     'phone'     => (object) [
     169    ),
     170    'phone'     => (object) array(
    171171        'name'      => '[company][phone]',
    172172        'label'     => __( 'Company Phone', 'codup-wp-freshsales' ),
    173173        'is_single' => false,
    174     ],
    175 ];
    176 $lead_fields                  = apply_filters( 'cwpfs_lead_field', $lead_fields );
     174    ),
     175);
     176$lead_fields            = apply_filters( 'cwpfs_lead_field', $lead_fields );
  • codup-wp-freshsales/trunk/readme.txt

    r2556757 r2701025  
    33Tags: contact form 7, wordpress, freshsales, Gravity Form , Formidable Form
    44Requires at least: 4.4
    5 Tested up to: 5.7.2
     5Tested up to: 5.9.2
    66License: GPLv2 or later
    77
  • codup-wp-freshsales/trunk/wp-freshsales-integration.php

    r2556757 r2701025  
    11<?php
    2 /**
    3  * MyClass Class Doc Comment
    4  *
    5  * @file
    6  * Description of what this module (or file) is doing.
    7  * @package WordPress_fresh_sales
    8  */
    9 
    102/**
    113 * Plugin Name: WordPress to Freshsales Integration
    124 * Description: Create Leads on formidable forms submission , contact form 7 submission and gravity forms submission.
    13  * Version:     1.3.2.3
     5 * Version:     1.3.2.4
    146 * Author:      codup.io
    157 * Author URI:  http://codup.io/
     
    1810 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1911 * Text Domain: codup-wp-freshsales
     12 * Tested up to: 5.9.2
    2013 */
    2114
Note: See TracChangeset for help on using the changeset viewer.