Changeset 2865082
- Timestamp:
- 02/14/2023 12:30:45 PM (3 years ago)
- Location:
- lead-generated
- Files:
-
- 31 added
- 1 deleted
- 21 edited
-
tags/1.25 (added)
-
tags/1.25/admin (added)
-
tags/1.25/admin/class-wsl-admin.php (added)
-
tags/1.25/admin/editor-panel.php (added)
-
tags/1.25/admin/partials (added)
-
tags/1.25/admin/partials/send_to_company_field.php (added)
-
tags/1.25/helpers.php (added)
-
tags/1.25/includes (added)
-
tags/1.25/includes/assets (added)
-
tags/1.25/includes/assets/custom.js (added)
-
tags/1.25/includes/class-lgcrm-ug-gutenberg-form-api.php (added)
-
tags/1.25/includes/class-wsl-api.php (added)
-
tags/1.25/includes/class-wsl-beaver-api.php (added)
-
tags/1.25/includes/class-wsl-caldera-api.php (added)
-
tags/1.25/includes/class-wsl-cf7-api.php (added)
-
tags/1.25/includes/class-wsl-divi-api.php (added)
-
tags/1.25/includes/class-wsl-elementor-api.php (added)
-
tags/1.25/includes/class-wsl-formidable-api.php (added)
-
tags/1.25/includes/class-wsl-gravity-api.php (added)
-
tags/1.25/includes/class-wsl-ninja-api.php (added)
-
tags/1.25/includes/class-wsl-smartforms-api.php (added)
-
tags/1.25/includes/class-wsl-thriveform-api.php (added)
-
tags/1.25/includes/class-wsl-typeform-api.php (added)
-
tags/1.25/includes/class-wsl-wpbrizy-api.php (added)
-
tags/1.25/includes/class-wsl-wpf-api.php (added)
-
tags/1.25/includes/class-wsl-wpff-api.php (added)
-
tags/1.25/includes/helpers.php (added)
-
tags/1.25/includes/wsl-base.php (added)
-
tags/1.25/lead-generated.php (added)
-
tags/1.25/readme.txt (added)
-
trunk/admin/class-wsl-admin.php (modified) (8 diffs)
-
trunk/admin/editor-panel.php (modified) (2 diffs)
-
trunk/includes/class-lgcrm-ug-gutenberg-form-api.php (added)
-
trunk/includes/class-wsl-api.php (modified) (3 diffs)
-
trunk/includes/class-wsl-beaver-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-caldera-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-cf7-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-divi-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-elementor-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-formidable-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-gravity-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-ninja-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-smartforms-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-thriveform-api.php (modified) (8 diffs)
-
trunk/includes/class-wsl-typeform-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-ug-gutenberg-form-api.php (deleted)
-
trunk/includes/class-wsl-wpbrizy-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-wpf-api.php (modified) (4 diffs)
-
trunk/includes/class-wsl-wpff-api.php (modified) (4 diffs)
-
trunk/includes/helpers.php (modified) (7 diffs)
-
trunk/includes/wsl-base.php (modified) (1 diff)
-
trunk/lead-generated.php (modified) (16 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lead-generated/trunk/admin/class-wsl-admin.php
r2293509 r2865082 33 33 <?php 34 34 // This prints out all hidden setting fields 35 settings_fields( ' wsl_options_group' );35 settings_fields( 'lgcrm_options_group' ); 36 36 do_settings_sections( 'wsl-setting-admin' ); 37 37 submit_button(); … … 45 45 { 46 46 register_setting( 47 ' wsl_options_group', // Option group47 'lgcrm_options_group', // Option group 48 48 $this->option_name, // Option name 49 49 array( $this, 'sanitize' ) // Sanitize … … 51 51 52 52 add_settings_section( 53 ' wsl_section', // ID53 'lgcrm_section', // ID 54 54 '', // Title 55 55 array( $this, 'print_section_info' ), // Callback … … 62 62 array( $this, 'api_key_callback' ), // Callback 63 63 'wsl-setting-admin', // Page 64 ' wsl_section' // Section64 'lgcrm_section' // Section 65 65 ); 66 66 … … 70 70 array( $this, 'sent_to_crm_callback' ), // Callback 71 71 'wsl-setting-admin', // Page 72 ' wsl_section' // Section72 'lgcrm_section' // Section 73 73 ); 74 74 … … 78 78 array( $this, 'sent_to_company_callback' ), // Callback 79 79 'wsl-setting-admin', // Page 80 ' wsl_section' // Section80 'lgcrm_section' // Section 81 81 ); 82 82 } … … 112 112 public function sent_to_crm_callback(){ 113 113 echo '<label>'; 114 echo '<input '. checked( wsl_get_setting('send_to_crm'), 1, false).' type="checkbox" id="send_to_crm" name="wsl_settings[send_to_crm]" class="regular-text" value="1" />';114 echo '<input '. checked(lgcrm_get_setting('send_to_crm'), 1, false).' type="checkbox" id="send_to_crm" name="wsl_settings[send_to_crm]" class="regular-text" value="1" />'; 115 115 echo 'Enable sending to CRM'; 116 116 echo '</label>'; … … 121 121 $api_obj = new Wsl_Api(); 122 122 $company = $api_obj->get_companies(); 123 $meta = wsl_get_settings();124 include_once WSL_ADMIN_DIR.'/partials/send_to_company_field.php';123 $meta = lgcrm_get_settings(); 124 include_once LGCRM_ADMIN_DIR.'/partials/send_to_company_field.php'; 125 125 } 126 126 -
lead-generated/trunk/admin/editor-panel.php
r2126032 r2865082 1 1 <?php 2 2 3 $meta = wsl_get_cf7_post_settings($post->id);3 $meta = lgcrm_get_cf7_post_settings($post->id); 4 4 $api_obj = new Wsl_Api(); 5 5 $companies = $api_obj->get_companies(); … … 30 30 </th> 31 31 <td> 32 <?php include_once WSL_ADMIN_DIR.'/partials/send_to_company_field.php'; ?>32 <?php include_once LGCRM_ADMIN_DIR.'/partials/send_to_company_field.php'; ?> 33 33 </td> 34 34 </tr> -
lead-generated/trunk/includes/class-wsl-api.php
r2600478 r2865082 22 22 return $this->api_key; 23 23 }else{ 24 $settings = wsl_get_settings();24 $settings = lgcrm_get_settings(); 25 25 if(isset($settings['api_key']) && $settings['api_key'] != ''){ 26 26 return $settings['api_key']; … … 44 44 // print_r($response); 45 45 // echo '</pre>';die(); 46 // wsl_update_setting('send_to_company',$data->source_id);47 //$prev_setting = wsl_get_settings();46 //lgcrm_update_setting('send_to_company',$data->source_id); 47 //$prev_setting = lgcrm_get_settings(); 48 48 // echo $prev_setting['send_to_company']; 49 49 if($response->type == 'duplicate' && $response->site_data->site_url){ … … 60 60 update_option('wsl_settings', $settings); 61 61 }elseif($response->type == 'success'){ 62 wsl_update_setting("send_to_company",$response->data->id);62 lgcrm_update_setting("send_to_company",$response->data->id); 63 63 } 64 64 return $response; -
lead-generated/trunk/includes/class-wsl-beaver-api.php
r2770022 r2865082 1 1 <?php 2 2 3 class Wsl_Beaver_Api extends Wsl_Base{3 class Wsl_Beaver_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 138 138 'remote_ip' => $_SERVER['REMOTE_ADDR'], 139 139 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 140 'plugin_name' => "beaver", 140 141 ); 141 142 } … … 232 233 public function process_result($result){ 233 234 $data = $result; 234 $send_to_company = wsl_get_setting('send_to_company');235 $send_to_company = lgcrm_get_setting('send_to_company'); 235 236 if($send_to_company && $send_to_company != 0){ 236 237 //All good 237 238 }else{ 238 239 if(isset($data->source_id)){ 239 wsl_update_setting('send_to_company',$data->source_id);240 lgcrm_update_setting('send_to_company',$data->source_id); 240 241 } 241 242 } -
lead-generated/trunk/includes/class-wsl-caldera-api.php
r2429077 r2865082 1 1 <?php 2 2 3 class Wsl_CalderaForms_Api extends Wsl_Base{3 class Wsl_CalderaForms_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 146 146 'remote_ip' => $_SERVER['REMOTE_ADDR'], 147 147 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 148 'plugin_name' => "caldera", 148 149 ); 149 150 } … … 240 241 public function process_result($result){ 241 242 $data = $result; 242 $send_to_company = wsl_get_setting('send_to_company');243 $send_to_company = lgcrm_get_setting('send_to_company'); 243 244 if($send_to_company && $send_to_company != 0){ 244 245 //All good 245 246 }else{ 246 247 if(isset($data->source_id)){ 247 wsl_update_setting('send_to_company',$data->source_id);248 lgcrm_update_setting('send_to_company',$data->source_id); 248 249 } 249 250 } -
lead-generated/trunk/includes/class-wsl-cf7-api.php
r2328159 r2865082 1 1 <?php 2 2 3 class Wsl_Cf7_Api extends Wsl_Base{3 class Wsl_Cf7_Api extends Lg_Crm{ 4 4 5 5 … … 97 97 public function get_source_data(){ 98 98 99 $company_id = wsl_get_cf7_post_setting('send_to_company', $this->cf7->id());99 $company_id = lgcrm_get_cf7_post_setting('send_to_company', $this->cf7->id()); 100 100 if(!$company_id){ 101 $company_id = wsl_get_setting('send_to_company');101 $company_id = lgcrm_get_setting('send_to_company'); 102 102 } 103 103 return array( … … 132 132 'remote_ip' => $this->submission->get_meta( 'remote_ip' ), 133 133 'wp_user_id' => $this->submission->get_meta( 'current_user_id' ), 134 'user_agent' => $this->submission->get_meta('user_agent') 134 'user_agent' => $this->submission->get_meta('user_agent'), 135 'plugin_name' => "contact_f7", 135 136 ); 136 137 } … … 294 295 public function process_result($result){ 295 296 $data = $result; 296 $send_to_company = wsl_get_setting('send_to_company');297 $send_to_company = lgcrm_get_setting('send_to_company'); 297 298 if($send_to_company && $send_to_company != 0){ 298 299 //All good 299 300 }else{ 300 301 if(isset($data->source_id)){ 301 wsl_update_setting('send_to_company',$data->source_id);302 lgcrm_update_setting('send_to_company',$data->source_id); 302 303 } 303 304 } -
lead-generated/trunk/includes/class-wsl-divi-api.php
r2415131 r2865082 1 1 <?php 2 2 3 class Wsl_Divi_Api extends Wsl_Base{3 class Wsl_Divi_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 113 113 114 114 public function get_source_data(){ 115 $company_id = wsl_get_setting('send_to_company');115 $company_id = lgcrm_get_setting('send_to_company'); 116 116 return array( 117 117 'id' => $company_id, … … 161 161 'post_url' => home_url( $wp->request ), 162 162 'remote_ip' => $_SERVER['REMOTE_ADDR'], 163 'plugin_name' => "divi", 163 164 ); 164 165 } … … 254 255 public function process_result($result){ 255 256 $data = $result; 256 $send_to_company = wsl_get_setting('send_to_company');257 $send_to_company = lgcrm_get_setting('send_to_company'); 257 258 if($send_to_company && $send_to_company != 0){ 258 259 //All good 259 260 }else{ 260 261 if(isset($data->source_id)){ 261 wsl_update_setting('send_to_company',$data->source_id);262 lgcrm_update_setting('send_to_company',$data->source_id); 262 263 } 263 264 } -
lead-generated/trunk/includes/class-wsl-elementor-api.php
r2299017 r2865082 1 1 <?php 2 2 3 class Wsl_Elementor_Api extends Wsl_Base{3 class Wsl_Elementor_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 119 119 120 120 public function get_source_data(){ 121 $company_id = wsl_get_setting('send_to_company');121 $company_id = lgcrm_get_setting('send_to_company'); 122 122 return array( 123 123 'id' => $company_id, … … 141 141 //'unit_tag' => $this->submission->get_meta( 'unit_tag' ), 142 142 'remote_ip' => $_SERVER['REMOTE_ADDR'], 143 'plugin_name' => "elementor", 143 144 //'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 144 145 //'user_agent' => $this->submission->get_meta('user_agent') … … 238 239 public function process_result($result){ 239 240 $data = $result; 240 $send_to_company = wsl_get_setting('send_to_company');241 $send_to_company = lgcrm_get_setting('send_to_company'); 241 242 if($send_to_company && $send_to_company != 0){ 242 243 //All good 243 244 }else{ 244 245 if(isset($data->source_id)){ 245 wsl_update_setting('send_to_company',$data->source_id);246 lgcrm_update_setting('send_to_company',$data->source_id); 246 247 } 247 248 } -
lead-generated/trunk/includes/class-wsl-formidable-api.php
r2463360 r2865082 1 1 <?php 2 2 3 class Wsl_formidable_Api extends Wsl_Base{3 class Wsl_formidable_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 166 166 'remote_ip' => $_SERVER['REMOTE_ADDR'], 167 167 'wp_user_id' => '', 168 'plugin_name' => "formaidable", 168 169 ); 169 170 } … … 260 261 public function process_result($result){ 261 262 $data = $result; 262 $send_to_company = wsl_get_setting('send_to_company');263 $send_to_company = lgcrm_get_setting('send_to_company'); 263 264 if($send_to_company && $send_to_company != 0){ 264 265 //All good 265 266 }else{ 266 267 if(isset($data->source_id)){ 267 wsl_update_setting('send_to_company',$data->source_id);268 lgcrm_update_setting('send_to_company',$data->source_id); 268 269 } 269 270 } -
lead-generated/trunk/includes/class-wsl-gravity-api.php
r2776454 r2865082 1 1 <?php 2 2 3 class Wsl_Gravity_Api extends Wsl_Base{3 class Wsl_Gravity_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 134 134 135 135 136 $company_id = wsl_get_setting('send_to_company');136 $company_id = lgcrm_get_setting('send_to_company'); 137 137 return array( 138 138 'id' => $company_id, … … 156 156 //'unit_tag' => $this->submission->get_meta( 'unit_tag' ), 157 157 'remote_ip' => $_SERVER['REMOTE_ADDR'], 158 'plugin_name' => "gravity", 158 159 //'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 159 160 //'user_agent' => $this->submission->get_meta('user_agent') … … 238 239 public function process_result($result){ 239 240 $data = $result; 240 $send_to_company = wsl_get_setting('send_to_company');241 $send_to_company = lgcrm_get_setting('send_to_company'); 241 242 if($send_to_company && $send_to_company != 0){ 242 243 //All good 243 244 }else{ 244 245 if(isset($data->source_id)){ 245 wsl_update_setting('send_to_company',$data->source_id);246 lgcrm_update_setting('send_to_company',$data->source_id); 246 247 } 247 248 } -
lead-generated/trunk/includes/class-wsl-ninja-api.php
r2299017 r2865082 1 1 <?php 2 2 3 class Wsl_Ninja_Api extends Wsl_Base{3 class Wsl_Ninja_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 104 104 105 105 106 $company_id = wsl_get_setting('send_to_company');106 $company_id = lgcrm_get_setting('send_to_company'); 107 107 return array( 108 108 'id' => $company_id, … … 127 127 'remote_ip' => $_SERVER['REMOTE_ADDR'], 128 128 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 129 'plugin_name' => "ninja", 129 130 //'user_agent' => $this->submission->get_meta('user_agent') 130 131 ); … … 225 226 public function process_result($result){ 226 227 $data = $result; 227 $send_to_company = wsl_get_setting('send_to_company');228 $send_to_company = lgcrm_get_setting('send_to_company'); 228 229 if($send_to_company && $send_to_company != 0){ 229 230 //All good 230 231 }else{ 231 232 if(isset($data->source_id)){ 232 wsl_update_setting('send_to_company',$data->source_id);233 lgcrm_update_setting('send_to_company',$data->source_id); 233 234 } 234 235 } -
lead-generated/trunk/includes/class-wsl-smartforms-api.php
r2422103 r2865082 1 1 <?php 2 2 3 class Wsl_SmartForms_Api extends Wsl_Base{3 class Wsl_SmartForms_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 234 234 'remote_ip' => $_SERVER['REMOTE_ADDR'], 235 235 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 236 'plugin_name' => "smartforms", 236 237 ); 237 238 } … … 328 329 public function process_result($result){ 329 330 $data = $result; 330 $send_to_company = wsl_get_setting('send_to_company');331 $send_to_company = lgcrm_get_setting('send_to_company'); 331 332 if($send_to_company && $send_to_company != 0){ 332 333 //All good 333 334 }else{ 334 335 if(isset($data->source_id)){ 335 wsl_update_setting('send_to_company',$data->source_id);336 lgcrm_update_setting('send_to_company',$data->source_id); 336 337 } 337 338 } -
lead-generated/trunk/includes/class-wsl-thriveform-api.php
r2440393 r2865082 1 1 <?php 2 2 3 class Wsl_thriveform_Api extends Wsl_Base{3 class Wsl_thriveform_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 112 112 $fields = array(); 113 113 $count = 0; 114 $label = unserialize( base64_decode( $submission["tve_labels"] ) );115 114 $form_settings = array(); 116 115 $fields_for_sub = array(); … … 124 123 125 124 $fields_for_sub[] = array( 126 "name" => strtolower($ label[$key]),125 "name" => strtolower($key), 127 126 "value" => $value, 128 127 "id" => $count++, 129 128 "type" => $key, 130 "label" => $ label[$key]129 "label" => $key 131 130 ); 132 131 } … … 149 148 'remote_ip' => $_SERVER['REMOTE_ADDR'], 150 149 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 150 'plugin_name' => "thriveform", 151 151 ); 152 152 } … … 243 243 public function process_result($result){ 244 244 $data = $result; 245 $send_to_company = wsl_get_setting('send_to_company');245 $send_to_company = lgcrm_get_setting('send_to_company'); 246 246 if($send_to_company && $send_to_company != 0){ 247 247 //All good 248 248 }else{ 249 249 if(isset($data->source_id)){ 250 wsl_update_setting('send_to_company',$data->source_id);250 lgcrm_update_setting('send_to_company',$data->source_id); 251 251 } 252 252 } … … 259 259 $fields = array(); 260 260 $count = 0; 261 $label = unserialize( base64_decode( $fields_data["tve_labels"] ));262 261 263 262 foreach($fields_data as $key=>$value){ … … 269 268 270 269 $fields[] = array( 271 "name" => strtolower($ label[$key]),270 "name" => strtolower($key), 272 271 "value" => $value, 273 272 "id" => $count++, 274 273 "type" => $key, 275 "label" => $ label[$key]274 "label" => $key 276 275 ); 277 276 } -
lead-generated/trunk/includes/class-wsl-typeform-api.php
r2770022 r2865082 1 1 <?php 2 2 3 class Wsl_Typeform_Api extends Wsl_Base{3 class Wsl_Typeform_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 144 144 'remote_ip' => $_SERVER['REMOTE_ADDR'], 145 145 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 146 'plugin_name' => "typeform", 146 147 ); 147 148 } … … 238 239 public function process_result($result){ 239 240 $data = $result; 240 $send_to_company = wsl_get_setting('send_to_company');241 $send_to_company = lgcrm_get_setting('send_to_company'); 241 242 if($send_to_company && $send_to_company != 0){ 242 243 //All good 243 244 }else{ 244 245 if(isset($data->source_id)){ 245 wsl_update_setting('send_to_company',$data->source_id);246 lgcrm_update_setting('send_to_company',$data->source_id); 246 247 } 247 248 } -
lead-generated/trunk/includes/class-wsl-wpbrizy-api.php
r2422103 r2865082 1 1 <?php 2 2 3 class Wsl_Brizy_Api extends Wsl_Base{3 class Wsl_Brizy_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 165 165 'remote_ip' => $_SERVER['REMOTE_ADDR'], 166 166 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 167 'plugin_name' => "brizy", 167 168 ); 168 169 } … … 259 260 public function process_result($result){ 260 261 $data = $result; 261 $send_to_company = wsl_get_setting('send_to_company');262 $send_to_company = lgcrm_get_setting('send_to_company'); 262 263 if($send_to_company && $send_to_company != 0){ 263 264 //All good 264 265 }else{ 265 266 if(isset($data->source_id)){ 266 wsl_update_setting('send_to_company',$data->source_id);267 lgcrm_update_setting('send_to_company',$data->source_id); 267 268 } 268 269 } -
lead-generated/trunk/includes/class-wsl-wpf-api.php
r2760339 r2865082 1 1 <?php 2 2 3 class Wsl_Wpf_Api extends Wsl_Base{3 class Wsl_Wpf_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 104 104 105 105 106 $company_id = wsl_get_setting('send_to_company');106 $company_id = lgcrm_get_setting('send_to_company'); 107 107 return array( 108 108 'id' => $company_id, … … 127 127 'remote_ip' => $_SERVER['REMOTE_ADDR'], 128 128 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 129 'plugin_name' => "wp_forms", 129 130 //'user_agent' => $this->submission->get_meta('user_agent') 130 131 ); … … 225 226 public function process_result($result){ 226 227 $data = $result; 227 $send_to_company = wsl_get_setting('send_to_company');228 $send_to_company = lgcrm_get_setting('send_to_company'); 228 229 if($send_to_company && $send_to_company != 0){ 229 230 //All good 230 231 }else{ 231 232 if(isset($data->source_id)){ 232 wsl_update_setting('send_to_company',$data->source_id);233 lgcrm_update_setting('send_to_company',$data->source_id); 233 234 } 234 235 } -
lead-generated/trunk/includes/class-wsl-wpff-api.php
r2770022 r2865082 1 1 <?php 2 2 3 class Wsl_Wpff_Api extends Wsl_Base{3 class Wsl_Wpff_Api extends Lg_Crm{ 4 4 5 5 public $cf7; … … 100 100 101 101 public function get_source_data(){ 102 $company_id = wsl_get_setting('send_to_company');102 $company_id = lgcrm_get_setting('send_to_company'); 103 103 return array( 104 104 'id' => $company_id, … … 150 150 'remote_ip' => $_SERVER['REMOTE_ADDR'], 151 151 'wp_user_id' => $this->submission['settings']['notifications'][1]['sender_address'], 152 'plugin_name' => "fluent_forms", 152 153 ); 153 154 } … … 244 245 public function process_result($result){ 245 246 $data = $result; 246 $send_to_company = wsl_get_setting('send_to_company');247 $send_to_company = lgcrm_get_setting('send_to_company'); 247 248 if($send_to_company && $send_to_company != 0){ 248 249 //All good 249 250 }else{ 250 251 if(isset($data->source_id)){ 251 wsl_update_setting('send_to_company',$data->source_id);252 lgcrm_update_setting('send_to_company',$data->source_id); 252 253 } 253 254 } -
lead-generated/trunk/includes/helpers.php
r2600478 r2865082 1 1 <?php 2 function is_send_to_crm(){3 return wsl_get_setting('send_to_crm');2 function lgcrm_is_send_to_crm(){ 3 return lgcrm_get_setting('send_to_crm'); 4 4 } 5 5 6 function wsl_get_default_cf7_post_settings(){7 $wsl_settings = wsl_get_settings();6 function lgcrm_get_default_cf7_post_settings(){ 7 $wsl_settings = lgcrm_get_settings(); 8 8 if(is_array($wsl_settings)){ 9 9 return $wsl_settings; … … 16 16 } 17 17 18 function wsl_get_cf7_post_settings($post_id){18 function lgcrm_get_cf7_post_settings($post_id){ 19 19 $meta = get_post_meta($post_id,'_wsl_settings',TRUE); 20 20 //var_dump($meta); 21 21 if(!is_array($meta)){ 22 return wsl_get_default_cf7_post_settings();22 return lgcrm_get_default_cf7_post_settings(); 23 23 } 24 return array_merge( wsl_get_default_cf7_post_settings(),$meta);24 return array_merge(lgcrm_get_default_cf7_post_settings(),$meta); 25 25 } 26 26 27 function wsl_get_cf7_post_setting($name,$post_id){28 $meta = wsl_get_cf7_post_settings($post_id);27 function lgcrm_get_cf7_post_setting($name,$post_id){ 28 $meta = lgcrm_get_cf7_post_settings($post_id); 29 29 if(isset($meta[$name])){ 30 30 return $meta[$name]; … … 34 34 } 35 35 36 function wsl_get_default_settings(){36 function lgcrm_get_default_settings(){ 37 37 $default = array( 38 38 'api_key' => '', … … 43 43 } 44 44 45 function wsl_get_settings(){46 $settings = get_option('wsl_settings', wsl_get_default_settings());45 function lgcrm_get_settings(){ 46 $settings = get_option('wsl_settings',lgcrm_get_default_settings()); 47 47 return $settings; 48 48 } 49 49 50 function wsl_update_setting($name,$value){51 $settings = get_option('wsl_settings', wsl_get_default_settings());50 function lgcrm_update_setting($name,$value){ 51 $settings = get_option('wsl_settings',lgcrm_get_default_settings()); 52 52 $settings[$name] = $value; 53 53 update_option('wsl_settings', $settings); 54 54 } 55 55 56 function wsl_get_setting($name){57 $settings = get_option('wsl_settings', wsl_get_default_settings());56 function lgcrm_get_setting($name){ 57 $settings = get_option('wsl_settings',lgcrm_get_default_settings()); 58 58 return isset($settings[$name])?$settings[$name] : false; 59 59 } 60 60 61 function wsl_check_default_company_exists($companies){61 function lgcrm_check_default_company_exists($companies){ 62 62 $company_websites = array_column(array_map('get_object_vars', $companies), 'website','id'); 63 63 $id = array_search(site_url(), $company_websites); … … 69 69 } 70 70 71 function typeform_script() {71 function lgcrm_typeform_script() { 72 72 wp_register_script( "my_custom_script", plugin_dir_url( __FILE__ ).'assets/custom.js', array('jquery'), NULL, TRUE ); 73 73 wp_localize_script( 'my_custom_script', 'localize', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); … … 76 76 wp_enqueue_script( 'my_custom_script' ); 77 77 } 78 add_action( 'wp_enqueue_scripts', ' typeform_script' );78 add_action( 'wp_enqueue_scripts', 'lgcrm_typeform_script' ); 79 79 80 function typeform_api($response_id){80 function lgcrm_typeform_api($response_id){ 81 81 82 $get_settings = wsl_get_settings();82 $get_settings = lgcrm_get_settings(); 83 83 $token = $get_settings["typeform_api_key"]; 84 84 … … 100 100 } 101 101 102 function lgcrm_sanitize_data($data){ 103 if(is_array($data)){ 104 foreach($data as $key=>$rec){ 105 if(!is_array($rec)){ 106 $data[$key] = sanitize_text_field($rec); 107 }else{ 108 $data[$key] = $rec; 109 } 110 } 111 return $data; 112 }else{ 113 return sanitize_text_field($data); 114 } 115 116 117 } 118 -
lead-generated/trunk/includes/wsl-base.php
r2328157 r2865082 1 1 <?php 2 2 3 class Wsl_Base{3 class Lg_Crm{ 4 4 5 5 public $api_url = 'https://app.leadgenerated.com/public/api/lead/create'; -
lead-generated/trunk/lead-generated.php
r2776454 r2865082 5 5 * Plugin URI: https://www.leadgenerated.com/ 6 6 * Description: Save the leads to Lead Generated system generated by various form plugins. We currently support CF7, Ninja Forms, WP Forms, Gravity Forms and Elementor Builder. 7 * Version: 1.2 37 * Version: 1.25 8 8 * Author: Lead Generated 9 9 * Author URI: https://profiles.wordpress.org/leadgenerated/ … … 27 27 */ 28 28 29 define( ' WSL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );30 define( ' WSL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );31 define( ' WSL_INCLUDES_DIR', plugin_dir_path( __FILE__ ).'/includes' );32 define( ' WSL_ADMIN_DIR', plugin_dir_path( __FILE__ ).'/admin' );33 34 require_once WSL_INCLUDES_DIR . '/helpers.php';35 require_once WSL_INCLUDES_DIR . '/wsl-base.php';36 require_once WSL_INCLUDES_DIR . '/class-wsl-api.php';37 require_once WSL_INCLUDES_DIR . '/class-wsl-cf7-api.php';38 require_once WSL_INCLUDES_DIR . '/class-wsl-wpf-api.php';39 require_once WSL_INCLUDES_DIR . '/class-wsl-ninja-api.php';40 require_once WSL_INCLUDES_DIR . '/class-wsl-gravity-api.php';41 require_once WSL_INCLUDES_DIR . '/class-wsl-elementor-api.php';42 require_once WSL_INCLUDES_DIR . '/class-wsl-divi-api.php';43 require_once WSL_INCLUDES_DIR . '/class-wsl-wpff-api.php';44 require_once WSL_INCLUDES_DIR . '/class-wsl-typeform-api.php';45 require_once WSL_INCLUDES_DIR . '/class-wsl-beaver-api.php';46 require_once WSL_INCLUDES_DIR . '/class-wsl-wpbrizy-api.php';47 require_once WSL_INCLUDES_DIR . '/class-wsl-smartforms-api.php';48 require_once WSL_INCLUDES_DIR . '/class-wsl-caldera-api.php';49 require_once WSL_INCLUDES_DIR . '/class-wsl-thriveform-api.php';50 require_once WSL_INCLUDES_DIR . '/class-wsl-formidable-api.php';51 require_once WSL_INCLUDES_DIR . '/class-wsl-ug-gutenberg-form-api.php';29 define( 'LGCRM_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 30 define( 'LGCRM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 31 define( 'LGCRM_INCLUDES_DIR', plugin_dir_path( __FILE__ ).'/includes' ); 32 define( 'LGCRM_ADMIN_DIR', plugin_dir_path( __FILE__ ).'/admin' ); 33 34 require_once LGCRM_INCLUDES_DIR . '/helpers.php'; 35 require_once LGCRM_INCLUDES_DIR . '/wsl-base.php'; 36 require_once LGCRM_INCLUDES_DIR . '/class-wsl-api.php'; 37 require_once LGCRM_INCLUDES_DIR . '/class-wsl-cf7-api.php'; 38 require_once LGCRM_INCLUDES_DIR . '/class-wsl-wpf-api.php'; 39 require_once LGCRM_INCLUDES_DIR . '/class-wsl-ninja-api.php'; 40 require_once LGCRM_INCLUDES_DIR . '/class-wsl-gravity-api.php'; 41 require_once LGCRM_INCLUDES_DIR . '/class-wsl-elementor-api.php'; 42 require_once LGCRM_INCLUDES_DIR . '/class-wsl-divi-api.php'; 43 require_once LGCRM_INCLUDES_DIR . '/class-wsl-wpff-api.php'; 44 require_once LGCRM_INCLUDES_DIR . '/class-wsl-typeform-api.php'; 45 require_once LGCRM_INCLUDES_DIR . '/class-wsl-beaver-api.php'; 46 require_once LGCRM_INCLUDES_DIR . '/class-wsl-wpbrizy-api.php'; 47 require_once LGCRM_INCLUDES_DIR . '/class-wsl-smartforms-api.php'; 48 require_once LGCRM_INCLUDES_DIR . '/class-wsl-caldera-api.php'; 49 require_once LGCRM_INCLUDES_DIR . '/class-wsl-thriveform-api.php'; 50 require_once LGCRM_INCLUDES_DIR . '/class-wsl-formidable-api.php'; 51 require_once LGCRM_INCLUDES_DIR . '/class-lgcrm-ug-gutenberg-form-api.php'; 52 52 53 53 if(is_admin()){ 54 require_once WSL_ADMIN_DIR . '/class-wsl-admin.php';54 require_once LGCRM_ADMIN_DIR . '/class-wsl-admin.php'; 55 55 $admin_obj = new Wsl_Admin(); 56 56 } … … 58 58 59 59 // define the wpcf7_submit callback 60 function wsl_wpcf7_submit( $instance, $result ) {61 if(! is_send_to_crm()){60 function lgcrm_wpcf7_submit( $instance, $result ) { 61 if(!lgcrm_is_send_to_crm()){ 62 62 return false; 63 63 } … … 68 68 $submission = WPCF7_Submission::get_instance(); 69 69 70 $send_to_crm = wsl_get_cf7_post_setting('send_to_crm',$instance->id());70 $send_to_crm = lgcrm_get_cf7_post_setting('send_to_crm',$instance->id()); 71 71 if($send_to_crm != 1){ 72 72 return false; … … 79 79 } 80 80 //Contact Form 7 submit hook 81 add_action( 'wpcf7_submit', ' wsl_wpcf7_submit', 10, 2 );81 add_action( 'wpcf7_submit', 'lgcrm_wpcf7_submit', 10, 2 ); 82 82 83 83 // add the action 84 84 //add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' ); 85 85 86 add_filter( 'wpcf7_editor_panels', ' wsl_add_panel' );87 88 function wsl_add_panel($panels){86 add_filter( 'wpcf7_editor_panels', 'lgcrm_add_panel' ); 87 88 function lgcrm_add_panel($panels){ 89 89 $panels['leads-panel'] = array( 90 90 'title' => 'Lead Settings', 91 'callback' => ' wsl_leads_panel_callback'91 'callback' => 'lgcrm_leads_panel_callback' 92 92 ); 93 93 return $panels; 94 94 } 95 95 96 function wsl_leads_panel_callback($post){97 include_once WSL_PLUGIN_DIR.'/admin/editor-panel.php';98 } 99 100 add_action( 'wpcf7_after_save', ' cf7_success_page_save_contact_form' );101 102 function cf7_success_page_save_contact_form( $contact_form ) {96 function lgcrm_leads_panel_callback($post){ 97 include_once LGCRM_PLUGIN_DIR.'/admin/editor-panel.php'; 98 } 99 100 add_action( 'wpcf7_after_save', 'lgcrm_success_page_save_contact_form' ); 101 102 function lgcrm_success_page_save_contact_form( $contact_form ) { 103 103 $contact_form_id = $contact_form->id(); 104 104 … … 117 117 } 118 118 119 function wsl_ninja_forms_after_submission( $form_data ){120 if(! is_send_to_crm()){119 function lgcrm_ninja_forms_after_submission( $form_data ){ 120 if(!lgcrm_is_send_to_crm()){ 121 121 return false; 122 122 } … … 125 125 $laravel_api->call(); 126 126 } 127 add_action( 'ninja_forms_after_submission', ' wsl_ninja_forms_after_submission' );128 129 function wsl_wpf_process_entry_save( $fields, $entry, $form_id, $form_data ) {130 if(! is_send_to_crm()){127 add_action( 'ninja_forms_after_submission', 'lgcrm_ninja_forms_after_submission' ); 128 129 function lgcrm_wpf_process_entry_save( $fields, $entry, $form_id, $form_data ) { 130 if(!lgcrm_is_send_to_crm()){ 131 131 return false; 132 132 } … … 136 136 $laravel_api->call(); 137 137 } 138 add_filter( 'wpforms_process_entry_save', ' wsl_wpf_process_entry_save', 10, 4 );139 140 function wsl_gravityform_submission( $entry, $form) { //Gravity forms141 if(! is_send_to_crm()){138 add_filter( 'wpforms_process_entry_save', 'lgcrm_wpf_process_entry_save', 10, 4 ); 139 140 function lgcrm_gravityform_submission( $entry, $form) { //Gravity forms 141 if(!lgcrm_is_send_to_crm()){ 142 142 return false; 143 143 } … … 148 148 149 149 } 150 add_action( 'gform_after_submission', ' wsl_gravityform_submission', 10, 2 ); //Gravity forms151 152 add_action( 'elementor_pro/forms/new_record', ' wsl_elementor_pro', 10, 2);153 154 function wsl_elementor_pro($record, $handler ){155 if(! is_send_to_crm()){150 add_action( 'gform_after_submission', 'lgcrm_gravityform_submission', 10, 2 ); //Gravity forms 151 152 add_action( 'elementor_pro/forms/new_record', 'lgcrm_elementor_pro', 10, 2); 153 154 function lgcrm_elementor_pro($record, $handler ){ 155 if(!lgcrm_is_send_to_crm()){ 156 156 return false; 157 157 } … … 164 164 } 165 165 166 add_action( 'et_pb_contact_form_submit', ' wsl_divi' );167 168 function wsl_divi(){169 if(! is_send_to_crm()){166 add_action( 'et_pb_contact_form_submit', 'lgcrm_divi' ); 167 168 function lgcrm_divi(){ 169 if(!lgcrm_is_send_to_crm()){ 170 170 return false; 171 171 } 172 172 reset($_POST); 173 $key = key($_POST); 173 $form_data = lgcrm_sanitize_data($_POST); 174 $key = key($form_data); 174 175 $counter = substr($key, -1); 175 $laravel_api = new Wsl_Divi_Api($ _POST["et_pb_contact_email_fields_".$counter]);176 $laravel_api->set_submission_instance($ _POST["et_pb_contact_email_fields_".$counter]);177 $laravel_api->call(); 178 } 179 180 add_action('fluentform_submission_inserted', ' wsl_fluentforms', 20, 3);181 182 function wsl_fluentforms($entryId, $formData, $form)176 $laravel_api = new Wsl_Divi_Api($form_data["et_pb_contact_email_fields_".$counter]); 177 $laravel_api->set_submission_instance($form_data["et_pb_contact_email_fields_".$counter]); 178 $laravel_api->call(); 179 } 180 181 add_action('fluentform_submission_inserted', 'lgcrm_fluentforms', 20, 3); 182 183 function lgcrm_fluentforms($entryId, $formData, $form) 183 184 { 184 if(! is_send_to_crm()){185 if(!lgcrm_is_send_to_crm()){ 185 186 return false; 186 187 } … … 190 191 } 191 192 192 add_action("wp_ajax_nopriv_wsl_typeform", " wsl_typeform");193 add_action("wp_ajax_wsl_typeform", " wsl_typeform");194 195 function wsl_typeform() {196 if(! is_send_to_crm()){197 return false; 198 } 199 $fields = typeform_api($_POST['response_id']);193 add_action("wp_ajax_nopriv_wsl_typeform", "lgcrm_typeform"); 194 add_action("wp_ajax_wsl_typeform", "lgcrm_typeform"); 195 196 function lgcrm_typeform() { 197 if(!lgcrm_is_send_to_crm()){ 198 return false; 199 } 200 $fields = lgcrm_sanitize_data(lgcrm_typeform_api($_POST['response_id'])); 200 201 201 202 $laravel_api = new Wsl_Typeform_Api($fields); … … 204 205 } 205 206 206 add_action( 'wp_ajax_fl_builder_email', 'wsl_beaver' ); 207 add_action("wp_ajax_nopriv_fl_builder_email", "wsl_beaver"); 208 209 function wsl_beaver(){ 210 if(!is_send_to_crm()){ 211 return false; 212 } 213 $laravel_api = new Wsl_Beaver_Api($_POST); 214 $laravel_api->set_submission_instance($_POST); 215 $laravel_api->call(); 216 } 217 218 add_action('wp_ajax_brizy_submit_form', 'wsl_brizy'); 219 add_action("wp_ajax_nopriv_brizy_submit_form", "wsl_brizy"); 220 221 function wsl_brizy(){ 222 if(!is_send_to_crm()){ 223 return false; 224 } 225 $fields_data = $_POST["data"]; 207 add_action( 'wp_ajax_fl_builder_email', 'lgcrm_beaver' ); 208 add_action("wp_ajax_nopriv_fl_builder_email", "lgcrm_beaver"); 209 210 function lgcrm_beaver(){ 211 if(!lgcrm_is_send_to_crm()){ 212 return false; 213 } 214 $form_data = lgcrm_sanitize_data($_POST); 215 $laravel_api = new Wsl_Beaver_Api($form_data); 216 $laravel_api->set_submission_instance($form_data); 217 $laravel_api->call(); 218 } 219 220 add_action('wp_ajax_brizy_submit_form', 'lgcrm_brizy'); 221 add_action("wp_ajax_nopriv_brizy_submit_form", "lgcrm_brizy"); 222 223 function lgcrm_brizy(){ 224 if(!lgcrm_is_send_to_crm()){ 225 return false; 226 } 227 $form = lgcrm_sanitize_data($_POST); 228 $fields_data = $form["data"]; 226 229 227 230 $laravel_api = new Wsl_Brizy_Api($fields_data); … … 230 233 } 231 234 232 add_action( 'wp_ajax_rednao_smart_forms_save_form_values',' wsl_smart_forms');233 add_action( 'wp_ajax_nopriv_rednao_smart_forms_save_form_values',' wsl_smart_forms');234 235 function wsl_smart_forms($data){236 if(! is_send_to_crm()){237 return false; 238 } 239 $fields_data = $_POST;235 add_action( 'wp_ajax_rednao_smart_forms_save_form_values','lgcrm_smart_forms'); 236 add_action( 'wp_ajax_nopriv_rednao_smart_forms_save_form_values','lgcrm_smart_forms'); 237 238 function lgcrm_smart_forms($data){ 239 if(!lgcrm_is_send_to_crm()){ 240 return false; 241 } 242 $fields_data = lgcrm_sanitize_data($_POST); 240 243 241 244 $laravel_api = new Wsl_SmartForms_Api($fields_data); … … 244 247 } 245 248 246 add_action('caldera_forms_submit_complete', ' wsl_caldera_forms', 50, 3);247 248 function wsl_caldera_forms($form, $referrer, $process_id)249 add_action('caldera_forms_submit_complete', 'lgcrm_caldera_forms', 50, 3); 250 251 function lgcrm_caldera_forms($form, $referrer, $process_id) 249 252 { 250 if(! is_send_to_crm()){253 if(!lgcrm_is_send_to_crm()){ 251 254 return false; 252 255 } 253 256 $fields_data = $form["fields"]; 254 $formData = $_REQUEST;257 $formData = lgcrm_sanitize_data($_REQUEST); 255 258 256 259 $laravel_api = new Wsl_CalderaForms_Api($fields_data, $formData); … … 259 262 } 260 263 261 add_action( 'wp_ajax_tve_api_form_submit', ' wsl_thrive_form' );262 add_action( 'wp_ajax_nopriv_tve_api_form_submit', ' wsl_thrive_form' );263 264 function wsl_thrive_form(){265 if(! is_send_to_crm()){264 add_action( 'wp_ajax_tve_api_form_submit', 'lgcrm_thrive_form' ); 265 add_action( 'wp_ajax_nopriv_tve_api_form_submit', 'lgcrm_thrive_form' ); 266 267 function lgcrm_thrive_form(){ 268 if(!lgcrm_is_send_to_crm()){ 266 269 return false; 267 270 } … … 273 276 } 274 277 275 add_action('frm_after_create_entry', ' wsl_fomidable', 30, 2);276 277 function wsl_fomidable($entry_id, $form_id){278 add_action('frm_after_create_entry', 'lgcrm_fomidable', 30, 2); 279 280 function lgcrm_fomidable($entry_id, $form_id){ 278 281 $laravel_api = new Wsl_formidable_Api($entry_id, $form_id); 279 282 $laravel_api->set_submission_instance($entry_id, $form_id); 280 283 $laravel_api->call(); 281 284 } 285 286 add_action( 'wp_ajax_uagb_process_forms', 'lgcrm_gutenberg_forms' ); 287 add_action( 'wp_ajax_nopriv_uagb_process_forms', 'lgcrm_gutenberg_forms' ); 288 289 function lgcrm_gutenberg_forms(){ 290 if(!lgcrm_is_send_to_crm()){ 291 return false; 292 } 293 $fields_data = lgcrm_sanitize_data($_POST); 294 295 $laravel_api = new Lgcrm_Gutenberg_Api($fields_data); 296 $laravel_api->set_submission_instance($fields_data); 297 $laravel_api->call(); 298 } -
lead-generated/trunk/readme.txt
r2776454 r2865082 3 3 Tags: cf7, contact-form, leads, crm, management 4 4 Requires at least: 5.0 5 Tested up to: 6. 0.16 Stable tag: 1.2 35 Tested up to: 6.1.1 6 Stable tag: 1.25 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later … … 105 105 = 1.23 = 106 106 * Fixed gravity form field name mapping in case of label missing 107 108 = 1.25 = 109 * Removed vulnerability in the plugin 110 * Sanitized and verfied the data 111 * Fixed Thrive Forms integration security issues
Note: See TracChangeset
for help on using the changeset viewer.