Contact Form Entries – Contact Form 7, WPforms and more - Version 1.0.3

Version Description

  • fixed Export Entries feature.
Download this release

Release Info

Developer asif876
Plugin Icon 128x128 Contact Form Entries – Contact Form 7, WPforms and more
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

contact-form-entries.php CHANGED
@@ -2,9 +2,9 @@
2
  /**
3
  * Plugin Name: Contact Form Entries
4
  * Description: Save form submissions to the database from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, <a href="https://wordpress.org/plugins/jetpack/">JetPack Contact Form</a>, <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms</a>, <a href="https://wordpress.org/plugins/formidable/">Formidable Forms</a>, <a href="http://codecanyon.net/item/quform-wordpress-form-builder/706149">Quform</a>, <a href="https://wordpress.org/plugins/cforms2/">cformsII</a>, <a href="https://wordpress.org/plugins/contact-form-plugin/">Contact Form by BestWebSoft</a>, <a href="https://wordpress.org/plugins/ultimate-form-builder-lite/">Ultimate Form Builder</a>, <a href="https://wordpress.org/plugins/caldera-forms/">Caldera Forms</a> and <a href="https://wordpress.org/plugins/wpforms-lite/">WP Forms</a>.
5
- * Version: 1.0.2
6
  * Requires at least: 3.8
7
- * Tested up to: 4.9
8
  * Author URI: https://www.crmperks.com
9
  * Plugin URI: https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/
10
  * Author: CRM Perks
@@ -15,11 +15,7 @@ if( !defined( 'ABSPATH' ) ) exit;
15
 
16
  if( !class_exists( 'vxcf_form' ) ):
17
 
18
- /**
19
- * Main class
20
- *
21
- * @since 1.0.0
22
- */
23
  class vxcf_form {
24
 
25
 
@@ -30,7 +26,7 @@ class vxcf_form {
30
  public static $type = "vxcf_form";
31
  public static $path = '';
32
 
33
- public static $version = '1.0.2';
34
  public static $upload_folder = 'crm_perks_uploads';
35
  public static $db_version='';
36
  public static $base_url='';
@@ -177,8 +173,8 @@ public function entries_shortcode($atts){
177
  }
178
  }
179
  }
180
- $fields=vxcf_form::get_form_fields($form_id);
181
- $fields['created']=array('name'=>'created','_id'=>'created', 'label'=> __('Created', 'contact-form-entries'));
182
 
183
  $col_end=count($fields);
184
  if(!empty($atts['cols'])){
@@ -319,11 +315,11 @@ if(is_array($arr) && count($arr)>0){
319
  var_dump($tags,$arr); die();
320
  }
321
 
322
- public function create_entry($lead,$form,$type){
 
323
  $entry_id='';
324
  if(is_array($lead) && count($lead)>0){
325
-
326
-
327
  $data=vxcf_form::get_data_object();
328
  $form_id=$type.'_'.$form['id'];
329
  $main=array('form_id'=>$form_id);
@@ -333,20 +329,21 @@ public function create_entry($lead,$form,$type){
333
  return;
334
  }
335
  $meta=get_option(vxcf_form::$id.'_meta',array());
336
- if(empty($meta['ip'])){
337
- $main=$this->get_lead_info($main);
338
- }
339
  //set self::$form_fields_temp
340
  vxcf_form::get_form_fields($form_id);
341
  $lead=apply_filters('vxcf_entries_plugin_before_saving_lead',$lead,$main);
342
  $vis_id=''; $entry_id=0;
 
343
  if(empty($meta['cookies'])){
344
  $vis_id=$this->vx_id();
345
  $entry_id=$data->get_vis_info_of_day($vis_id,$form_id,'1');
346
  }
347
  $main['type']='0'; $main['is_read']='0';
348
  $entry_id=$this->create_update_lead($lead,$main,$entry_id);
349
-
350
  // var_dump($detail,$lead,$entry_id); die();
351
  $forms_arr=get_option('vxcf_all_forms',array());
352
  if(!isset($forms_arr[$type]['label'])){
@@ -364,7 +361,8 @@ $forms_fields=get_option('vxcf_all_fields',array());
364
  $forms_fields[$type]['fields'][$form['id']]=self::$form_fields_temp[$form_id];
365
  update_option('vxcf_all_fields',$forms_fields,false);
366
  }
367
-
 
368
  if($this->do_actions()){
369
  do_action('vx_addons_save_entry',$entry_id,$lead,'cf',$form);
370
  }
@@ -396,7 +394,7 @@ $data->update_lead($update,$insert,$entry_id,$lead);
396
  }
397
  return $entry_id;
398
  }
399
- public function update_entry_meta($entry_id,$meta_key,$meta){
400
  if(!empty($entry_id) && !empty($meta) && is_array($meta)){
401
  $entry=vxcf_form::get_entry($entry_id);
402
  $detail=!empty($entry['meta']) ? json_decode($entry['meta'],true) : array();
@@ -408,10 +406,15 @@ if(!empty($entry_id) && !empty($meta) && is_array($meta)){
408
  $data->update_lead('','',$entry_id,array('meta'=>json_encode($detail)));
409
  }
410
  }
411
- public function get_lead_info($info){
412
  $current_user = wp_get_current_user();
413
  $info['user_id']=$current_user->ID;
414
- $info['ip']=$this->get_ip();
 
 
 
 
 
415
  $resolution="";
416
  if(isset($_POST['vx_width'])){
417
  $width=vxcf_form::post('vx_width');
@@ -419,30 +422,35 @@ $height=vxcf_form::post('vx_height');
419
  $resolution=$width." x ".$height;
420
  $info['screen']=$resolution;
421
  }
422
- $bro_info=self::browser_info();
 
423
  //get page url
424
  $page_url="//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
425
  if(isset($_REQUEST['vx_url'])){
426
  $page_url=vxcf_form::post('vx_url');
427
  }
 
 
 
428
  $page_url=substr($page_url,0,250);
429
  $info['url']=$page_url;
430
  $info['browser']=$bro_info['name'];
431
  $info['os']=$bro_info['platform'];
432
- $info['vis_id']=$this->vx_id();
 
 
 
 
433
  return $info;
434
  }
435
  public function create_entry_vf($entry_id,$entry,$form){
436
  //$track=$this->track_form_entry('vf');
437
- if( !empty($form['settings']['disable_db'])){
438
- return;
439
- }
440
- return $this->create_entry($entry,$form,'vf');
441
  }
442
  public function create_entry_wp($fields, $entry, $form_id, $form_data){
443
  $track=$this->track_form_entry('wp',$form_id);
444
- if($track === false){ return; }
445
-
446
 
447
  $upload_files=$lead=array();
448
  if(!empty($fields)){
@@ -458,9 +466,11 @@ if(in_array($v['type'],array('payment-select','payment-multiple'))){
458
  }
459
  $lead[$v['id']]=$val;
460
  } }
461
- $uploaded_files=$this->copy_files($upload_files);
462
- if(is_array($uploaded_files)){
463
- foreach($uploaded_files as $k=>$v){
 
 
464
  $lead[$k]=$v;
465
  } }
466
 
@@ -468,15 +478,13 @@ $form_arr=array('id'=>$form_data['id'],'name'=>'WP Forms','fields'=>$form_data['
468
  if(!empty($form_data['fields']['settings']['form_title'])){
469
  $form_arr['name']=$form_data['fields']['settings']['form_title'];
470
  }
471
- $this->create_entry($lead,$form_arr,'wp');
472
  }
473
  //var_dump($fields); die();
474
  }
475
  public function create_entry_wc($id,$posted){
476
  $track=$this->track_form_entry('wc','1');
477
- if($track === false){
478
- return;
479
- }
480
  $tags=vxcf_form::get_form_fields('wc_1');
481
  $order=get_post_meta($id);
482
  $_order=new WC_Order($id);
@@ -495,21 +503,19 @@ if(!empty($tags)){
495
  }
496
  //var_dump($lead,$order,$tags); die();
497
  $form_arr=array('id'=>'1','name'=>'WooCommerce','fields'=>$tags);
498
- $this->create_entry($lead,$form_arr,'wc');
499
 
500
  }
501
  public function create_entry_cf($form){
502
 
503
- $form_id=$form->id();
504
  $track=$this->track_form_entry('cf',$form_id);
505
- if($track === false){
506
- return;
 
 
 
507
  }
508
- $submission = WPCF7_Submission::get_instance();
509
-
510
- $uploaded_files_form = $submission->uploaded_files();
511
- //
512
- $uploaded_files=$this->copy_files($uploaded_files_form);
513
  $form_title=$form->title();
514
  $tags=vxcf_form::get_form_fields('cf_'.$form_id);
515
 
@@ -528,7 +534,7 @@ $val = $submission->get_posted_data($name);
528
  }
529
 
530
  $form_arr=array('id'=>$form_id,'name'=>$form_title,'fields'=>$tags);
531
- $this->create_entry($lead,$form_arr,'cf');
532
 
533
  }
534
  public function create_entry_na($data){
@@ -536,7 +542,7 @@ public function create_entry_na($data){
536
  $form_id=$data['form_id'];
537
  $track=$this->track_form_entry('na',$form_id);
538
 
539
- if($track === false && empty($data['form_id'])){
540
  return;
541
  }
542
 
@@ -553,24 +559,22 @@ if(!empty($data['fields'])){
553
  }
554
  }
555
  }
556
-
557
- $uploaded_files=$this->copy_files($upload_files);
 
558
  if(is_array($uploaded_files)){
559
  foreach($uploaded_files as $k=>$v){
560
  $lead[$k]=$v;
561
  }
562
  }
563
  $form_arr=array('id'=>$form_id,'name'=>$form_title,'fields'=>$data['data']['fields']);
564
- $this->create_entry($lead,$form_arr,'na');
565
 
566
  }
567
  }
568
  public function create_entry_qu($form){
569
  $form_id=$form->getId();
570
  $track=$this->track_form_entry('qu',$form_id);
571
- if($track === false){
572
- return;
573
- }
574
  if(empty($form)){
575
  return;
576
  }
@@ -603,15 +607,17 @@ if($track === false){
603
  }
604
  }
605
  }
606
- $uploaded_files=$this->copy_files($upload_files);
607
- if(is_array($uploaded_files)){
608
- foreach($uploaded_files as $k=>$v){
 
 
609
  $lead[$k]=$v;
610
  }
611
  }
612
  if(count($lead)>0){
613
  $form_arr=array('id'=>$form_id,'name'=>$form->getName(),'fields'=>$fields);
614
- $this->create_entry($lead,$form_arr,'qu');
615
  }
616
  }
617
 
@@ -620,9 +626,7 @@ $this->create_entry($lead,$form_arr,'qu');
620
  public function create_entry_ca($form){
621
  $form_id=$form['ID'];
622
  $track=$this->track_form_entry('ca',$form_id);
623
- if($track === false){
624
- return;
625
- }
626
  global $processed_data;
627
 
628
  if(empty($form)){
@@ -655,24 +659,24 @@ if($track === false){
655
  $lead[$id]=$val;
656
  }
657
  }
658
- $uploaded_files=$this->copy_files($upload_files);
659
- if(is_array($uploaded_files)){
660
- foreach($uploaded_files as $k=>$v){
 
 
661
  $lead[$k]=$v;
662
  }
663
  }
664
  if(count($lead)>0){
665
  $form_arr=array('id'=>$form_id,'name'=>$form['name'],'fields'=>$fields);
666
- $this->create_entry($lead,$form_arr,'ca');
667
  }
668
  }
669
 
670
  }
671
  public function create_entry_be(){
672
  $track=$this->track_form_entry('be','1');
673
- if($track === false){
674
- return;
675
- }
676
  global $cntctfrm_path_of_uploaded_file;
677
  $fields=vxcf_form::get_form_fields('be_');
678
  $lead=array();
@@ -681,7 +685,10 @@ if($track === false){
681
  if(isset($_POST['cntctfrm_contact_'.$k])){
682
  $lead[$k]=vxcf_form::post('cntctfrm_contact_'.$k);
683
  }else if($field['type'] == 'file' && !empty($cntctfrm_path_of_uploaded_file)){
684
- $files=$this->copy_files(array($k=>$cntctfrm_path_of_uploaded_file) );
 
 
 
685
  if(isset($files[$k])){
686
  $lead[$k]=$files[$k];
687
  }
@@ -691,7 +698,7 @@ if($track === false){
691
  }
692
  if(count($lead)>0){
693
  $form_arr=array('id'=>'','name'=>'BestSoft Contact Form','fields'=>$fields);
694
- $this->create_entry($lead,$form_arr,'be');
695
  }
696
  }
697
  public function create_entry_ul($to_email){
@@ -721,9 +728,6 @@ public function create_entry_ul($to_email){
721
  return;
722
  }
723
  $track=$this->track_form_entry('ul',$entry['form_id']);
724
- if($track === false){
725
- return;
726
- }
727
 
728
 
729
  $form_id=$entry['form_id'];
@@ -736,7 +740,7 @@ if($track === false){
736
  if(isset($fields[$k])){
737
  $lead[$k]=$v;
738
  }else{
739
- echo $k.'<hr>';
740
  }
741
 
742
  }
@@ -747,7 +751,7 @@ if($track === false){
747
  if(count($lead)>0){
748
  $form= UFBL_Model::get_form_detail($form_id);
749
  $form_arr=array('id'=>$form_id,'name'=>$form['form_title'],'fields'=>$fields);
750
- $this->create_entry($lead,$form_arr,'ul');
751
  }
752
 
753
 
@@ -832,9 +836,7 @@ $this->create_entry($lead,$form_arr,'c2');
832
  public function create_entry_jp($post_i, $all_values, $extra_values){
833
  $post_id=get_the_ID();
834
  $track=$this->track_form_entry('jp',$post_id);
835
- if($track === false){
836
- return;
837
- }
838
 
839
  $title=get_the_title();
840
  $fields=vxcf_form::get_form_fields('jp_'.$post_id);
@@ -856,7 +858,7 @@ $title=get_the_title();
856
  }
857
  if(count($lead)>0){
858
  $form_arr=array('id'=>$post_id,'name'=>$title,'fields'=>$fields);
859
- $this->create_entry($lead,$form_arr,'jp');
860
  }
861
  }
862
 
@@ -937,9 +939,7 @@ $this->create_entry($lead,$form_arr,'c2');
937
  }
938
  public function create_entry_fd($entry_id,$form_id){
939
  $track=$this->track_form_entry('fd',$form_id);
940
- if($track === false){
941
- return;
942
- }
943
  $fields=vxcf_form::get_form_fields('fd_'.$form_id);
944
  global $wpdb;
945
  $table=$wpdb->prefix.'frm_item_metas';
@@ -970,11 +970,11 @@ if(is_array($fields)){
970
  }
971
  }
972
  //
973
-
974
- $uploaded_files=$this->copy_files($uploaded_files_form);
975
-
976
- if(is_array($uploaded_files)){
977
- foreach($uploaded_files as $k=>$v){
978
  $lead[$k]=$v;
979
  }
980
  }
@@ -984,12 +984,11 @@ $table=$wpdb->prefix.'frm_forms';
984
  $sql=$wpdb->prepare("Select name from $table where id=%d",$form_id);
985
  $form_name=$wpdb->get_var($sql);
986
  $form_arr=array('id'=>$form_id,'name'=>$form_name,'fields'=>$fields);
987
- $this->create_entry($lead,$form_arr,'fd');
988
 
989
  }
990
  public function create_entry_gf($entry,$form){
991
  $track=$this->track_form_entry('gf',$form['id']);
992
- if($track === false){ return; }
993
 
994
  $fields=vxcf_form::get_form_fields('gf_'.$form['id']);
995
  $uploaded_files_form =$lead=array();
@@ -1028,16 +1027,17 @@ if(is_array($file_arr)){
1028
  }
1029
 
1030
 
1031
-
1032
- $uploaded_files=$this->copy_files($uploaded_files_form);
1033
- if(is_array($uploaded_files)){
1034
- foreach($uploaded_files as $k=>$v){
 
1035
  $lead[$k]=$v;
1036
  }
1037
  }
1038
 
1039
  $form_arr=array('id'=>$form['id'],'name'=>$form['title'],'fields'=>$form['fields']);
1040
- $this->create_entry($lead,$form_arr,'gf');
1041
  // var_dump($lead); die();
1042
  }
1043
  public function create_entry_fscf($data){
@@ -1186,10 +1186,10 @@ $options=FSCF_Util::get_form_options($form_id, true);
1186
  }
1187
  return $fields_arr;
1188
  }
1189
- public function validate_crmperks_field($err_msg,$field_val,$field,$form_id){
1190
- if(empty($err_msg) && !empty($field_val) && !empty($field['dup_check']) && !empty($form_id)){
1191
  $data=self::get_data_object();
1192
- $row=$data->search_lead_detail($field_val,'vf_'.$form_id);
1193
  //varify no duplicate fields
1194
  if(!empty($row)){
1195
  if($field['valid_err_msg']!=""){
@@ -1497,7 +1497,8 @@ public static function get_forms(){
1497
  }
1498
  }
1499
  //
1500
- $forms_arr=isset($all_forms['cf']['forms']) && is_array($all_forms['cf']['forms']) ? $all_forms['cf']['forms'] : array();
 
1501
  if(is_array($cf_forms) && count($cf_forms)>0){
1502
  foreach($cf_forms as $form){
1503
  if(!empty($form->post_title)){
@@ -2295,21 +2296,21 @@ $fields_arr['vxcreated']=array('_id'=>self::$form_id.'-vxvx-vxcreated','name'=>'
2295
  public function footer_js(){
2296
  ?>
2297
  <script type="text/javascript">
2298
- jQuery(document).ready(function($){
2299
- $(".cfx_form_main,.wpcf7-form,.wpforms-form,.gform_wrapper form").each(function(){
2300
- var form=$(this);
2301
  var screen_width=""; var screen_height="";
2302
  if(screen_width == ""){
2303
  if(screen){
2304
  screen_width=screen.width;
2305
  }else{
2306
- screen_width=$(window).width();
2307
  } }
2308
  if(screen_height == ""){
2309
  if(screen){
2310
  screen_height=screen.height;
2311
  }else{
2312
- screen_height=$(window).height();
2313
  } }
2314
  form.append('<input type="hidden" name="vx_width" value="'+screen_width+'">');
2315
  form.append('<input type="hidden" name="vx_height" value="'+screen_height+'">');
2
  /**
3
  * Plugin Name: Contact Form Entries
4
  * Description: Save form submissions to the database from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, <a href="https://wordpress.org/plugins/jetpack/">JetPack Contact Form</a>, <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms</a>, <a href="https://wordpress.org/plugins/formidable/">Formidable Forms</a>, <a href="http://codecanyon.net/item/quform-wordpress-form-builder/706149">Quform</a>, <a href="https://wordpress.org/plugins/cforms2/">cformsII</a>, <a href="https://wordpress.org/plugins/contact-form-plugin/">Contact Form by BestWebSoft</a>, <a href="https://wordpress.org/plugins/ultimate-form-builder-lite/">Ultimate Form Builder</a>, <a href="https://wordpress.org/plugins/caldera-forms/">Caldera Forms</a> and <a href="https://wordpress.org/plugins/wpforms-lite/">WP Forms</a>.
5
+ * Version: 1.0.3
6
  * Requires at least: 3.8
7
+ * Tested up to: 5.1
8
  * Author URI: https://www.crmperks.com
9
  * Plugin URI: https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/
10
  * Author: CRM Perks
15
 
16
  if( !class_exists( 'vxcf_form' ) ):
17
 
18
+
 
 
 
 
19
  class vxcf_form {
20
 
21
 
26
  public static $type = "vxcf_form";
27
  public static $path = '';
28
 
29
+ public static $version = '1.0.3';
30
  public static $upload_folder = 'crm_perks_uploads';
31
  public static $db_version='';
32
  public static $base_url='';
173
  }
174
  }
175
  }
176
+ $fields=vxcf_form::get_form_fields($form_id);
177
+ $fields['created']=array('name'=>'created','_id'=>'created', 'label'=> __('Created', 'contact-form-entries'));
178
 
179
  $col_end=count($fields);
180
  if(!empty($atts['cols'])){
315
  var_dump($tags,$arr); die();
316
  }
317
 
318
+ public function create_entry($lead,$form,$type,$info='',$save=true){
319
+ if(!is_array($info)){ $info=array(); }
320
  $entry_id='';
321
  if(is_array($lead) && count($lead)>0){
322
+
 
323
  $data=vxcf_form::get_data_object();
324
  $form_id=$type.'_'.$form['id'];
325
  $main=array('form_id'=>$form_id);
329
  return;
330
  }
331
  $meta=get_option(vxcf_form::$id.'_meta',array());
332
+
333
+ $main=$this->get_lead_info($main,$info);
334
+ //var_dump($lead); die();
335
  //set self::$form_fields_temp
336
  vxcf_form::get_form_fields($form_id);
337
  $lead=apply_filters('vxcf_entries_plugin_before_saving_lead',$lead,$main);
338
  $vis_id=''; $entry_id=0;
339
+ if($save){
340
  if(empty($meta['cookies'])){
341
  $vis_id=$this->vx_id();
342
  $entry_id=$data->get_vis_info_of_day($vis_id,$form_id,'1');
343
  }
344
  $main['type']='0'; $main['is_read']='0';
345
  $entry_id=$this->create_update_lead($lead,$main,$entry_id);
346
+ }
347
  // var_dump($detail,$lead,$entry_id); die();
348
  $forms_arr=get_option('vxcf_all_forms',array());
349
  if(!isset($forms_arr[$type]['label'])){
361
  $forms_fields[$type]['fields'][$form['id']]=self::$form_fields_temp[$form_id];
362
  update_option('vxcf_all_fields',$forms_fields,false);
363
  }
364
+ $main['id']=$entry_id;
365
+ $lead['__vx_entry']=$main;
366
  if($this->do_actions()){
367
  do_action('vx_addons_save_entry',$entry_id,$lead,'cf',$form);
368
  }
394
  }
395
  return $entry_id;
396
  }
397
+ public static function update_entry_meta($entry_id,$meta_key,$meta){
398
  if(!empty($entry_id) && !empty($meta) && is_array($meta)){
399
  $entry=vxcf_form::get_entry($entry_id);
400
  $detail=!empty($entry['meta']) ? json_decode($entry['meta'],true) : array();
406
  $data->update_lead('','',$entry_id,array('meta'=>json_encode($detail)));
407
  }
408
  }
409
+ public function get_lead_info($info,$meta_info=array()){
410
  $current_user = wp_get_current_user();
411
  $info['user_id']=$current_user->ID;
412
+ if(!empty($meta_info['ip'])){
413
+ $ip=$meta_info['ip'];
414
+ }else{
415
+ $ip=$this->get_ip();
416
+ }
417
+ $info['ip']=$ip;
418
  $resolution="";
419
  if(isset($_POST['vx_width'])){
420
  $width=vxcf_form::post('vx_width');
422
  $resolution=$width." x ".$height;
423
  $info['screen']=$resolution;
424
  }
425
+ $user_agent=!empty($meta_info['user_agent']) ? $meta_info['user_agent'] : '';
426
+ $bro_info=self::browser_info($user_agent);
427
  //get page url
428
  $page_url="//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
429
  if(isset($_REQUEST['vx_url'])){
430
  $page_url=vxcf_form::post('vx_url');
431
  }
432
+ if(!empty($meta_info['url'])){
433
+ $page_url=$meta_info['url'];
434
+ }
435
  $page_url=substr($page_url,0,250);
436
  $info['url']=$page_url;
437
  $info['browser']=$bro_info['name'];
438
  $info['os']=$bro_info['platform'];
439
+ if(!empty($meta_info['vis_id'])){
440
+ $info['vis_id']=$meta_info['vis_id'];
441
+ }else{
442
+ $info['vis_id']=$this->vx_id();
443
+ }
444
  return $info;
445
  }
446
  public function create_entry_vf($entry_id,$entry,$form){
447
  //$track=$this->track_form_entry('vf');
448
+ $track= empty($form['settings']['disable_db']);
449
+
450
+ return $this->create_entry($entry,$form,'vf','',$track);
 
451
  }
452
  public function create_entry_wp($fields, $entry, $form_id, $form_data){
453
  $track=$this->track_form_entry('wp',$form_id);
 
 
454
 
455
  $upload_files=$lead=array();
456
  if(!empty($fields)){
466
  }
467
  $lead[$v['id']]=$val;
468
  } }
469
+ if($track){
470
+ $upload_files=$this->copy_files($upload_files);
471
+ }
472
+ if(is_array($upload_files)){
473
+ foreach($upload_files as $k=>$v){
474
  $lead[$k]=$v;
475
  } }
476
 
478
  if(!empty($form_data['fields']['settings']['form_title'])){
479
  $form_arr['name']=$form_data['fields']['settings']['form_title'];
480
  }
481
+ $this->create_entry($lead,$form_arr,'wp','',$track);
482
  }
483
  //var_dump($fields); die();
484
  }
485
  public function create_entry_wc($id,$posted){
486
  $track=$this->track_form_entry('wc','1');
487
+
 
 
488
  $tags=vxcf_form::get_form_fields('wc_1');
489
  $order=get_post_meta($id);
490
  $_order=new WC_Order($id);
503
  }
504
  //var_dump($lead,$order,$tags); die();
505
  $form_arr=array('id'=>'1','name'=>'WooCommerce','fields'=>$tags);
506
+ $this->create_entry($lead,$form_arr,'wc','',$track);
507
 
508
  }
509
  public function create_entry_cf($form){
510
 
511
+ $form_id=$form->id();
512
  $track=$this->track_form_entry('cf',$form_id);
513
+
514
+ $submission = WPCF7_Submission::get_instance();
515
+ $uploaded_files = $submission->uploaded_files();
516
+ if($track){
517
+ $uploaded_files=$this->copy_files($uploaded_files);
518
  }
 
 
 
 
 
519
  $form_title=$form->title();
520
  $tags=vxcf_form::get_form_fields('cf_'.$form_id);
521
 
534
  }
535
 
536
  $form_arr=array('id'=>$form_id,'name'=>$form_title,'fields'=>$tags);
537
+ $this->create_entry($lead,$form_arr,'cf','',$track);
538
 
539
  }
540
  public function create_entry_na($data){
542
  $form_id=$data['form_id'];
543
  $track=$this->track_form_entry('na',$form_id);
544
 
545
+ if(empty($data['form_id'])){
546
  return;
547
  }
548
 
559
  }
560
  }
561
  }
562
+ if($track){
563
+ $uploaded_files=$this->copy_files($uploaded_files);
564
+ }
565
  if(is_array($uploaded_files)){
566
  foreach($uploaded_files as $k=>$v){
567
  $lead[$k]=$v;
568
  }
569
  }
570
  $form_arr=array('id'=>$form_id,'name'=>$form_title,'fields'=>$data['data']['fields']);
571
+ $this->create_entry($lead,$form_arr,'na','',$track);
572
 
573
  }
574
  }
575
  public function create_entry_qu($form){
576
  $form_id=$form->getId();
577
  $track=$this->track_form_entry('qu',$form_id);
 
 
 
578
  if(empty($form)){
579
  return;
580
  }
607
  }
608
  }
609
  }
610
+ if($track){
611
+ $upload_files=$this->copy_files($upload_files);
612
+ }
613
+ if(is_array($upload_files)){
614
+ foreach($upload_files as $k=>$v){
615
  $lead[$k]=$v;
616
  }
617
  }
618
  if(count($lead)>0){
619
  $form_arr=array('id'=>$form_id,'name'=>$form->getName(),'fields'=>$fields);
620
+ $this->create_entry($lead,$form_arr,'qu','',$track);
621
  }
622
  }
623
 
626
  public function create_entry_ca($form){
627
  $form_id=$form['ID'];
628
  $track=$this->track_form_entry('ca',$form_id);
629
+
 
 
630
  global $processed_data;
631
 
632
  if(empty($form)){
659
  $lead[$id]=$val;
660
  }
661
  }
662
+ if($track){
663
+ $upload_files=$this->copy_files($upload_files);
664
+ }
665
+ if(is_array($upload_files)){
666
+ foreach($upload_files as $k=>$v){
667
  $lead[$k]=$v;
668
  }
669
  }
670
  if(count($lead)>0){
671
  $form_arr=array('id'=>$form_id,'name'=>$form['name'],'fields'=>$fields);
672
+ $this->create_entry($lead,$form_arr,'ca','',$track);
673
  }
674
  }
675
 
676
  }
677
  public function create_entry_be(){
678
  $track=$this->track_form_entry('be','1');
679
+
 
 
680
  global $cntctfrm_path_of_uploaded_file;
681
  $fields=vxcf_form::get_form_fields('be_');
682
  $lead=array();
685
  if(isset($_POST['cntctfrm_contact_'.$k])){
686
  $lead[$k]=vxcf_form::post('cntctfrm_contact_'.$k);
687
  }else if($field['type'] == 'file' && !empty($cntctfrm_path_of_uploaded_file)){
688
+ $files=array($k=>$cntctfrm_path_of_uploaded_file);
689
+ if($track){
690
+ $files=$this->copy_files($files );
691
+ }
692
  if(isset($files[$k])){
693
  $lead[$k]=$files[$k];
694
  }
698
  }
699
  if(count($lead)>0){
700
  $form_arr=array('id'=>'','name'=>'BestSoft Contact Form','fields'=>$fields);
701
+ $this->create_entry($lead,$form_arr,'be','',$track);
702
  }
703
  }
704
  public function create_entry_ul($to_email){
728
  return;
729
  }
730
  $track=$this->track_form_entry('ul',$entry['form_id']);
 
 
 
731
 
732
 
733
  $form_id=$entry['form_id'];
740
  if(isset($fields[$k])){
741
  $lead[$k]=$v;
742
  }else{
743
+ // echo $k.'<hr>';
744
  }
745
 
746
  }
751
  if(count($lead)>0){
752
  $form= UFBL_Model::get_form_detail($form_id);
753
  $form_arr=array('id'=>$form_id,'name'=>$form['form_title'],'fields'=>$fields);
754
+ $this->create_entry($lead,$form_arr,'ul','',$track);
755
  }
756
 
757
 
836
  public function create_entry_jp($post_i, $all_values, $extra_values){
837
  $post_id=get_the_ID();
838
  $track=$this->track_form_entry('jp',$post_id);
839
+
 
 
840
 
841
  $title=get_the_title();
842
  $fields=vxcf_form::get_form_fields('jp_'.$post_id);
858
  }
859
  if(count($lead)>0){
860
  $form_arr=array('id'=>$post_id,'name'=>$title,'fields'=>$fields);
861
+ $this->create_entry($lead,$form_arr,'jp','',$track);
862
  }
863
  }
864
 
939
  }
940
  public function create_entry_fd($entry_id,$form_id){
941
  $track=$this->track_form_entry('fd',$form_id);
942
+
 
 
943
  $fields=vxcf_form::get_form_fields('fd_'.$form_id);
944
  global $wpdb;
945
  $table=$wpdb->prefix.'frm_item_metas';
970
  }
971
  }
972
  //
973
+ if($track){
974
+ $uploaded_files_form=$this->copy_files($uploaded_files_form);
975
+ }
976
+ if(is_array($uploaded_files_form)){
977
+ foreach($uploaded_files_form as $k=>$v){
978
  $lead[$k]=$v;
979
  }
980
  }
984
  $sql=$wpdb->prepare("Select name from $table where id=%d",$form_id);
985
  $form_name=$wpdb->get_var($sql);
986
  $form_arr=array('id'=>$form_id,'name'=>$form_name,'fields'=>$fields);
987
+ $this->create_entry($lead,$form_arr,'fd','',$track);
988
 
989
  }
990
  public function create_entry_gf($entry,$form){
991
  $track=$this->track_form_entry('gf',$form['id']);
 
992
 
993
  $fields=vxcf_form::get_form_fields('gf_'.$form['id']);
994
  $uploaded_files_form =$lead=array();
1027
  }
1028
 
1029
 
1030
+ if($track){
1031
+ $uploaded_files_form=$this->copy_files($uploaded_files_form);
1032
+ }
1033
+ if(is_array($uploaded_files_form)){
1034
+ foreach($uploaded_files_form as $k=>$v){
1035
  $lead[$k]=$v;
1036
  }
1037
  }
1038
 
1039
  $form_arr=array('id'=>$form['id'],'name'=>$form['title'],'fields'=>$form['fields']);
1040
+ $this->create_entry($lead,$form_arr,'gf','',$track);
1041
  // var_dump($lead); die();
1042
  }
1043
  public function create_entry_fscf($data){
1186
  }
1187
  return $fields_arr;
1188
  }
1189
+ public function validate_crmperks_field($err_msg,$field_val,$field,$form){
1190
+ if(empty($err_msg) && !empty($field_val) && !empty($field['dup_check']) && !empty($form['id'])){
1191
  $data=self::get_data_object();
1192
+ $row=$data->search_lead_detail($field_val,'vf_'.$form['id']);
1193
  //varify no duplicate fields
1194
  if(!empty($row)){
1195
  if($field['valid_err_msg']!=""){
1497
  }
1498
  }
1499
  //
1500
+ $forms_arr=isset($all_forms['cf']['forms']) && is_array($all_forms['cf']['forms']) ? $all_forms['cf']['forms'] : array(); //do not show deleted forms
1501
+
1502
  if(is_array($cf_forms) && count($cf_forms)>0){
1503
  foreach($cf_forms as $form){
1504
  if(!empty($form->post_title)){
2296
  public function footer_js(){
2297
  ?>
2298
  <script type="text/javascript">
2299
+ window.addEventListener("load", function(event) {
2300
+ jQuery(".cfx_form_main,.wpcf7-form,.wpforms-form,.gform_wrapper form").each(function(){
2301
+ var form=jQuery(this);
2302
  var screen_width=""; var screen_height="";
2303
  if(screen_width == ""){
2304
  if(screen){
2305
  screen_width=screen.width;
2306
  }else{
2307
+ screen_width=jQuery(window).width();
2308
  } }
2309
  if(screen_height == ""){
2310
  if(screen){
2311
  screen_height=screen.height;
2312
  }else{
2313
+ screen_height=jQuery(window).height();
2314
  } }
2315
  form.append('<input type="hidden" name="vx_width" value="'+screen_width+'">');
2316
  form.append('<input type="hidden" name="vx_height" value="'+screen_height+'">');
includes/data.php CHANGED
@@ -246,15 +246,17 @@ if($status == 'unread'){
246
  if($status == 'stared'){
247
  $search.=' and l.is_star =1';
248
  }
249
- if(isset($_GET['type'])){ $search.=' and l.type ='.(int)vxcf_form::post('type'); }
 
 
250
  $time_key=vxcf_form::post('time',$req);
251
  // handle search
252
  $search=$this->add_time_sql($search,$time_key);
253
 
254
  if(vxcf_form::post('search',$req)!=""){
255
  $search_s=esc_sql(vxcf_form::post('search',$req));
256
- if(!empty($_GET['field']) && in_array($_GET['field'],$main_fields)){
257
- $main_field=trim($_GET['field'],'vx');
258
  $search.=' and l.'.$main_field.' like "%'.$search_s.'%"';
259
  }else{
260
  $search_d='select distinct l.id from '.$leads_table.' l inner join '.$detail.' d on (l.id=d.lead_id) where '.$form_id_q;
246
  if($status == 'stared'){
247
  $search.=' and l.is_star =1';
248
  }
249
+
250
+ if(isset($req['type'])){ $search.=' and l.type ='.(int)vxcf_form::post('type',$req); }
251
+ if(isset($req['user_id'])){ $search.=' and l.user_id ='.(int)vxcf_form::post('user_id',$req); }
252
  $time_key=vxcf_form::post('time',$req);
253
  // handle search
254
  $search=$this->add_time_sql($search,$time_key);
255
 
256
  if(vxcf_form::post('search',$req)!=""){
257
  $search_s=esc_sql(vxcf_form::post('search',$req));
258
+ if(!empty($req['field']) && in_array($req['field'],$main_fields)){
259
+ $main_field=trim($req['field'],'vx');
260
  $search.=' and l.'.$main_field.' like "%'.$search_s.'%"';
261
  }else{
262
  $search_d='select distinct l.id from '.$leads_table.' l inner join '.$detail.' d on (l.id=d.lead_id) where '.$form_id_q;
includes/install.php CHANGED
@@ -49,6 +49,8 @@ public function remove_data(){
49
  delete_option(vxcf_form::$type."_version");
50
  delete_option(vxcf_form::$type."_updates");
51
  delete_option(vxcf_form::$type."_install_data");
 
 
52
 
53
  delete_option(vxcf_form::$id."_meta");
54
  $data=vxcf_form::get_data_object();
49
  delete_option(vxcf_form::$type."_version");
50
  delete_option(vxcf_form::$type."_updates");
51
  delete_option(vxcf_form::$type."_install_data");
52
+ delete_option('vxcf_all_forms');
53
+ delete_option('vxcf_all_fields');
54
 
55
  delete_option(vxcf_form::$id."_meta");
56
  $data=vxcf_form::get_data_object();
includes/plugin-pages.php CHANGED
@@ -89,6 +89,7 @@ if(!empty($lead['vis_id'])){
89
  $res=$this->data->get_related_leads($lead['vis_id'],$lead['id']);
90
  $entries=array();
91
  $entries=apply_filters('crmperks_related_leads',$entries,$lead);
 
92
  $link=vxcf_form::link_to_settings('entries');
93
  if(!empty($res)){
94
  foreach($res as $v){
@@ -142,6 +143,7 @@ public function ajax_actions(){
142
  echo $data->lead_actions(array('is_star'=>$status),array($id));
143
  }
144
  if($action == 'add_note'){
 
145
  $id=(int)vxcf_form::post('entry_id');
146
  $note=sanitize_textarea_field(wp_unslash($_POST['note']));
147
  $color=(int)vxcf_form::post('note_color');
@@ -161,7 +163,10 @@ if($note_id){
161
  $this->note_template($note_arr);
162
  if(!empty($_REQUEST['note_email'])){
163
  $subject=vxcf_form::post('note_subject');
164
- $headers = array('Content-Type: text/plain; charset=UTF-8');
 
 
 
165
  wp_mail(trim($_REQUEST['note_email']),$subject, $note,$headers);
166
  }
167
  }
@@ -673,7 +678,7 @@ die();
673
  if(current_user_can(vxcf_form::$id."_edit_settings")){
674
 
675
  header('Content-disposition: attachment; filename='.date("Y-m-d",current_time('timestamp')).'.csv');
676
- header('Content-Type: application/excel');
677
  $this->data=vxcf_form::get_data_object();
678
  vxcf_form::set_form_fields();
679
  $form_id=vxcf_form::$form_id;
@@ -698,9 +703,9 @@ vxcf_form::set_form_fields();
698
  $sno++;
699
  $_row=array($sno);
700
  foreach($fields as $field){
701
- $val='';
702
- if(!empty($field['name']) && isset($row[$field['name']])){
703
- $val=maybe_unserialize($row[$field['name']]);
704
  if(is_array($val)){
705
  $val=implode(' - ',$val);
706
  }
89
  $res=$this->data->get_related_leads($lead['vis_id'],$lead['id']);
90
  $entries=array();
91
  $entries=apply_filters('crmperks_related_leads',$entries,$lead);
92
+
93
  $link=vxcf_form::link_to_settings('entries');
94
  if(!empty($res)){
95
  foreach($res as $v){
143
  echo $data->lead_actions(array('is_star'=>$status),array($id));
144
  }
145
  if($action == 'add_note'){
146
+
147
  $id=(int)vxcf_form::post('entry_id');
148
  $note=sanitize_textarea_field(wp_unslash($_POST['note']));
149
  $color=(int)vxcf_form::post('note_color');
163
  $this->note_template($note_arr);
164
  if(!empty($_REQUEST['note_email'])){
165
  $subject=vxcf_form::post('note_subject');
166
+ $email_from=$user->user_email;
167
+ $from_name=$user->display_name;
168
+ //$headers = array('Content-Type: text/plain; charset=UTF-8');
169
+ $headers = "From: \"$from_name\" <$email_from> \r\n";
170
  wp_mail(trim($_REQUEST['note_email']),$subject, $note,$headers);
171
  }
172
  }
678
  if(current_user_can(vxcf_form::$id."_edit_settings")){
679
 
680
  header('Content-disposition: attachment; filename='.date("Y-m-d",current_time('timestamp')).'.csv');
681
+ header('Content-Type: application/excel');
682
  $this->data=vxcf_form::get_data_object();
683
  vxcf_form::set_form_fields();
684
  $form_id=vxcf_form::$form_id;
703
  $sno++;
704
  $_row=array($sno);
705
  foreach($fields as $field){
706
+ $val='';
707
+ if(!empty($field['name']) && isset($row[$field['name'].'_field'])){
708
+ $val=maybe_unserialize($row[$field['name'].'_field']);
709
  if(is_array($val)){
710
  $val=implode(' - ',$val);
711
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Contact Form Entries ===
2
  Contributors: crmperks, sbazzi
3
- Tags: contact form 7, contact form 7 database, contact form db, save contact form, contact form
4
  Requires at least: 3.8
5
- Tested up to: 4.9
6
- Stable tag: 1.0.2
7
- Version: 1.0.2
8
  Requires PHP: 5.3
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -13,27 +13,22 @@ Saves Contact Form 7, CRM Perks Forms and many other contact form submissions to
13
 
14
  == Description ==
15
 
16
- Contact Forms Entries Plugin automatically saves form submissions from Contact Form 7, CRM Perks Forms and many other popular contact form plugins to wordpress database. Learn more at [crmperks.com](https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
17
 
18
  == Supported Contact Forms ==
19
 
20
  * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
21
  * [CRM Perks Forms](https://wordpress.org/plugins/crm-perks-forms/)
22
- * [Gravity Forms](https://gravityforms.com)
23
  * [WP Forms](https://wordpress.org/plugins/wpforms-lite/)
24
- * [JetPack Contact Form](https://wordpress.org/plugins/jetpack/)
25
- * [Ninja Forms](https://wordpress.org/plugins/ninja-forms/)
26
- * [Caldera Forms](https://wordpress.org/plugins/caldera-forms/)
27
- * [Formidable Forms](https://wordpress.org/plugins/formidable/)
28
 
29
- == Contact form entries features ==
30
 
31
- * You can view all contact form entries in default wp table form.
32
  * Search contact form entries by all or specific field.
33
  * Filter contact form entries by Date.
34
  * You can mark contact form entries as read or un-read.
35
  * You can star or un-star contact form entries.
36
- * Pint all or selected contact form entries. You can also print notes related to each contact form entry.
37
  * Select entries table columns from "Screen Options".
38
  * File field of an entry supports multiple files.
39
  * Add, edit notes to any contact form entry.
@@ -43,15 +38,15 @@ Contact Forms Entries Plugin automatically saves form submissions from Contact F
43
 
44
  == Why we built this plugin ==
45
 
46
- Contact Form 7 and some other popular contact forms are good but do not have entries management feature. This free plugin adds entries management and all premium features to free wordpress contact forms including contact form 7. You can send entries data to your CRM or mailing lists.
47
 
48
- == Contact Form Entries Stats ==
49
 
50
- This plugin displays contact form submissions summary by contact form on dashboard. You can see all read/un-read entries of all contact forms at one place.
51
 
52
  == Contact Form Entry Notes ==
53
 
54
- You can add notes to any contact form entry and you can edit old notes. You can select note color to mark it as important or normal.
55
 
56
 
57
  [youtube https://www.youtube.com/watch?v=Qo1crsTYpsg]
@@ -69,46 +64,21 @@ You can add notes to any contact form entry and you can edit old notes. You can
69
 
70
  <blockquote>
71
  <p><strong>Premium Version Features.</strong></p>
72
- <p>This plugin has a Premium version which is included with <a href="https://www.crmperks.com/plugins/contact-form-plugins/crm-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme">CRM Perks Forms</a>.</p>
73
  <ul>
74
  <li>Compare daily entries, visitors and partial entries in graphical forms.</li>
75
  <li>Google Analytics Parameters and Geolocation of a visitor who submitted the form.</li>
76
- <li>Lead Scoring.</li>
77
- <li>Lookup lead's email using email lookup apis.We support all good email lookup apis like Fullcontact , Towerdata , Clearbit and pipl.com API.</li>
78
- <li>Verify lead's phone number and get detailed information about phone number using phone lookup apis, We support many good phone lookup apis like everyoneapi , whitepages api , twilio api and numverify api.</li>
79
- <li>Send entries to Zapier or any web hook.</li>
80
- <li>Create a entry from posted data by other systems.</li>
81
- <li>20+ premium addons</li>
82
  </ul>
83
- <p><a href="https://www.crmperks.com/plugins/contact-form-plugins/crm-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme">Upgrade to Pro version</a></p>
84
  </blockquote>
85
 
86
 
87
  == Want to send data to crm ==
88
  We have Premium Extensions for 20+ CRMs.[View All CRM Extensions](https://www.crmperks.com/plugin-category/contact-form-plugins/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
89
 
90
- * [Contact Form Dynamics Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-dynamics-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
91
- * [Contact Form Netsuite Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-netsuite-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
92
- * [Contact Form HubSpot Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-hubspot-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
93
- * [Contact Form InfusionSoft Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-infusionsoft-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
94
- * [Contact Form Highrise Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-highrise-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
95
- * [Contact Form Capsule Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-capsule-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
96
  * [Contact Form Streak Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-streak-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
97
- * [Contact Form Sugar Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-sugar-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
98
- * [Contact Form Zoho Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-zoho-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
99
- * [Contact Form Insightly Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-insightly-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
100
- * [Contact Form Nutshell Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-nutshell-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
101
-
102
-
103
- == Our Free Plugins ==
104
-
105
- * [CRM Perks Forms](https://wordpress.org/plugins/crm-perks-forms/).
106
-
107
- * [Support X - Wordpress Helpdesk](https://wordpress.org/plugins/support-x/).
108
-
109
- * [WooCommerce Salesforce Plugin](https://wordpress.org/plugins/woo-salesforce-plugin-crm-perks/).
110
-
111
- * [Gravity Forms FreshDesk Plugin](https://wordpress.org/plugins/gf-freshdesk/).
112
 
113
 
114
 
@@ -131,7 +101,7 @@ Our team provides free support at <a href="https://www.crmperks.com/contact-us/"
131
 
132
  = How i can make contact form 7 GDPR compliant =
133
 
134
- Simply add a "GDPR Agreement" checkbox in contact form 7 and make it a required field OR stop tracking a contact form in "settings" tab. Disable tracking cookies and user details.
135
 
136
  = Can i install this plugin without contact form 7 =
137
 
@@ -139,31 +109,31 @@ Yes, You can install it without Contact Form 7 because this plugin supports many
139
 
140
  = Which version of contact form 7 is supported by this plugin =
141
 
142
- This plugin supports all versions of Contact Form 7
143
 
144
- = How can i disable storing contact form 7 submissions to database =
145
 
146
  It is simple, See "Track Forms" option in "settings" tab
147
 
148
- = Can i export contact form 7 submissions to CSV =
149
 
150
- Yes, you can export entries of any contact form to CSV file.
151
 
152
  = Where this plugin saves contact form submissions =
153
 
154
- This plugin saves submissions from contact form 7 and other forms plugins to local wordpress database. This plugin does NOT save contact form entries to a third party or external server.
155
 
156
- = Can i reply to a contact from wordpress =
157
 
158
- Yes, you can reply to any contact form submission from wordpress. Your reply will be saved as entry notes.
159
 
160
  = Can i send contact form submissions to my CRM =
161
 
162
- Yes, you can send to any CRM with our premium extensions.
163
 
164
- = Can i search contact form submissions =
165
 
166
- Yes, You can search contact form submissions by a specific field or all fields.
167
 
168
  = How can i restrict plugin storing IP address and User Agent =
169
 
@@ -173,12 +143,24 @@ You can select this in plugin settings.
173
 
174
  You can display entries on front end with a simple shotcode available in settings.
175
 
176
- = How can i view all contact form entries =
 
 
 
 
 
 
 
 
 
 
177
 
178
- from main wordpress menu select "CRM Entries"
179
 
180
  == Changelog ==
181
 
 
 
 
182
  = 1.0.2 =
183
  * Added GDPR features.
184
  * Fixed "Undefined" function in "Stats" tab.
1
  === Contact Form Entries ===
2
  Contributors: crmperks, sbazzi
3
+ Tags: contact form 7, contact form 7 database, contact form db, save contact form, contact form 7 entries
4
  Requires at least: 3.8
5
+ Tested up to: 5.1
6
+ Stable tag: 1.0.3
7
+ Version: 1.0.3
8
  Requires PHP: 5.3
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
 
14
  == Description ==
15
 
16
+ Contact Form 7 Entries Plugin automatically saves form submissions from Contact Form 7, CRM Perks Forms and many other popular contact form plugins to wordpress database when anyone submits a form. Learn more at [crmperks.com](https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
17
 
18
  == Supported Contact Forms ==
19
 
20
  * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
21
  * [CRM Perks Forms](https://wordpress.org/plugins/crm-perks-forms/)
 
22
  * [WP Forms](https://wordpress.org/plugins/wpforms-lite/)
 
 
 
 
23
 
24
+ == Contact form 7 entries features ==
25
 
26
+ * You can view all contact form entries in default wordpress table form.
27
  * Search contact form entries by all or specific field.
28
  * Filter contact form entries by Date.
29
  * You can mark contact form entries as read or un-read.
30
  * You can star or un-star contact form entries.
31
+ * Print all or selected contact form entries. You can also print notes related to each contact form entry.
32
  * Select entries table columns from "Screen Options".
33
  * File field of an entry supports multiple files.
34
  * Add, edit notes to any contact form entry.
38
 
39
  == Why we built this plugin ==
40
 
41
+ Contact Form 7 is free contact form builder. This free Contact Form 7 Entries plugin adds entries management and all premium features to free wordpress contact forms including contact form 7. You can send entries data to your CRM or mailing lists.
42
 
43
+ == Contact Form 7 Entries Stats ==
44
 
45
+ This plugin displays contact form 7 submissions summary by contact form on dashboard. You can see all read/un-read entries of all contact forms at one place.
46
 
47
  == Contact Form Entry Notes ==
48
 
49
+ You can add notes to any contact form entry and you can edit old notes. Also you can select note color to mark it as important or normal.
50
 
51
 
52
  [youtube https://www.youtube.com/watch?v=Qo1crsTYpsg]
64
 
65
  <blockquote>
66
  <p><strong>Premium Version Features.</strong></p>
67
+ <p>Following features are available in premium add-ons <a href="https://www.crmperks.com/plugins/contact-form-plugins/crm-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme">Get all add-ons and forms</a>.</p>
68
  <ul>
69
  <li>Compare daily entries, visitors and partial entries in graphical forms.</li>
70
  <li>Google Analytics Parameters and Geolocation of a visitor who submitted the form.</li>
71
+ <li>Lookup lead's email and phone using email and phone lookup apis.</li>
72
+ <li>20+ premium add-ons</li>
 
 
 
 
73
  </ul>
74
+ <p><a href="https://www.crmperks.com/plugins/contact-form-plugins/crm-forms/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme">Get access to all addons and forms</a></p>
75
  </blockquote>
76
 
77
 
78
  == Want to send data to crm ==
79
  We have Premium Extensions for 20+ CRMs.[View All CRM Extensions](https://www.crmperks.com/plugin-category/contact-form-plugins/?utm_source=wordpress&utm_medium=directory&utm_campaign=readme)
80
 
 
 
 
 
 
 
81
  * [Contact Form Streak Plugin](https://www.crmperks.com/plugins/contact-form-plugins/contact-form-streak-plugin/?utm_medium=referral&utm_source=wordpress&utm_campaign=Entries+Readme&utm_content=WP)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
 
84
 
101
 
102
  = How i can make contact form 7 GDPR compliant =
103
 
104
+ Simply add a "GDPR Agreement" checkbox in contact form 7 and make it a required field OR stop tracking a contact form in "settings" tab. Additionally you can disable tracking cookies and user details.
105
 
106
  = Can i install this plugin without contact form 7 =
107
 
109
 
110
  = Which version of contact form 7 is supported by this plugin =
111
 
112
+ This plugin supports all versions of Contact Form 7.
113
 
114
+ = How can i disable storing contact form 7 entries to database =
115
 
116
  It is simple, See "Track Forms" option in "settings" tab
117
 
118
+ = Can i export contact form 7 entries to CSV =
119
 
120
+ Yes, you can export entries of any contact form to CSV file by clicking "Export Entries" button.
121
 
122
  = Where this plugin saves contact form submissions =
123
 
124
+ This plugin saves submissions from contact form 7 and other forms plugins to local wordpress database. This plugin does NOT save contact form 7 entries to a third party or external server.
125
 
126
+ = Can i reply to a lead from wordpress =
127
 
128
+ Yes, you can reply to any contact form 7 submission from wordpress. Your reply will be saved as entry notes.
129
 
130
  = Can i send contact form submissions to my CRM =
131
 
132
+ Yes, you can send to any CRM through our premium extensions for all popular crms.
133
 
134
+ = Can i search contact form 7 submissions =
135
 
136
+ Yes, You can search contact form 7 submissions by a specific field or all fields.
137
 
138
  = How can i restrict plugin storing IP address and User Agent =
139
 
143
 
144
  You can display entries on front end with a simple shotcode available in settings.
145
 
146
+ = How can i view all contact form 7 entries =
147
+
148
+ from main wordpress menu select "CRM Entries" then you can view any entry.
149
+
150
+ = Save contact form 7 submissions =
151
+
152
+ You can easily save contact form 7 entries to your local database with this contact form 7 entries plugin.
153
+
154
+ = Contact form 7 to database extension wp =
155
+
156
+ Contact form 7 entries plugin allows you to save contact form 7 entries to local database, later you can see all entries wordpress admin.
157
 
 
158
 
159
  == Changelog ==
160
 
161
+ = 1.0.3 =
162
+ * fixed Export Entries feature.
163
+
164
  = 1.0.2 =
165
  * Added GDPR features.
166
  * Fixed "Undefined" function in "Stats" tab.
templates/crm-entry-box.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
- } ?>
5
  <style type="text/css">
6
  .vx_msg_div a{
7
  color: #fff;
@@ -23,7 +23,7 @@
23
  </div>
24
 
25
  <div class="vx_group" style="padding: 2px 12px; border-bottom-width: 0px;">
26
- <p> <label><input type="checkbox" id="vx_include_notes" <?php if(!empty(get_option('print_note_'.vxcf_form::$id))){ echo 'checked="checked"'; } ?>> <?php _e('Include Notes','contact-form-entries') ?></label></p>
27
 
28
  </div>
29
  <div class="vx_head" style="font-weight: normal; padding: 10px;">
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
+ } $print=get_option('print_note_'.vxcf_form::$id); ?>
5
  <style type="text/css">
6
  .vx_msg_div a{
7
  color: #fff;
23
  </div>
24
 
25
  <div class="vx_group" style="padding: 2px 12px; border-bottom-width: 0px;">
26
+ <p> <label><input type="checkbox" id="vx_include_notes" <?php if(!empty($print)){ echo 'checked="checked"'; } ?>> <?php _e('Include Notes','contact-form-entries') ?></label></p>
27
 
28
  </div>
29
  <div class="vx_head" style="font-weight: normal; padding: 10px;">
templates/leads.php CHANGED
@@ -214,6 +214,11 @@ margin-left: 8px;
214
  .wrap .striped tr.vx_lead_1{
215
  background-color: #fff8e4;
216
  }
 
 
 
 
 
217
  </style>
218
  <div class="vx_wrap">
219
  <h2 class="vx_img_head"><?php echo $this->entry_title;
214
  .wrap .striped tr.vx_lead_1{
215
  background-color: #fff8e4;
216
  }
217
+ .tablenav .tablenav-pages a:focus,.tablenav .tablenav-pages a:hover{border-color:#5b9dd9;color:#fff;background:#00a0d2;box-shadow:none;outline:0}
218
+
219
+ .tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;padding:3px 6px}
220
+
221
+ .tablenav .tablenav-pages a,.tablenav-pages-navspan{display:inline-block;min-width:17px;border:1px solid #ccc;padding:3px 5px 7px;background:#e5e5e5;font-size:16px;line-height:1;font-weight:400;text-align:center}
222
  </style>
223
  <div class="vx_wrap">
224
  <h2 class="vx_img_head"><?php echo $this->entry_title;
templates/view.php CHANGED
@@ -423,8 +423,8 @@ color: #666;
423
  </div>
424
  <div class="vx_group">
425
  <div class="vx_entry_table">
426
- <?php
427
- $emails=array(); $date_field='';
428
  if(is_array($detail) && is_array($fields)){
429
  foreach($fields as $field){ //var_dump($field['basetype']);
430
 
@@ -433,9 +433,9 @@ color: #666;
433
  $date_class='';
434
  $lead_field=isset($detail[$field_id]) ? $detail[$field_id] : '';
435
  $value='';
436
- if(!empty($lead_field['value'])){
437
  $value=maybe_unserialize($lead_field['value']);
438
- }
439
 
440
  if (!filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
441
  $emails[]=$value;
@@ -446,7 +446,6 @@ $date_class='';
446
  $f_name=$field['name'];
447
  $type=$field['type'];
448
  $req=isset($field['req']) && $field['req'] == 'true' ? 'required="required"' : '';
449
-
450
  ?>
451
  <div class="entry_row">
452
  <div class="entry_col1">
@@ -454,7 +453,7 @@ $date_class='';
454
  </div>
455
  <div class="entry_col2">
456
  <div class="vx_edit">
457
- <?php
458
  if( in_array($type,array('textarea','chat','comma') )){
459
  if(is_array($value)){
460
  $value=implode(',',$value);
@@ -468,7 +467,6 @@ else if(in_array($type,array('checkbox','radio'))){
468
  $is_key=true;
469
 
470
  if(!empty($field['values']) && is_array($field['values'])){
471
-
472
  foreach($field['values'] as $v){
473
  $val=$text=$v;
474
  if(is_array($v)){
@@ -482,8 +480,8 @@ else if(in_array($type,array('checkbox','radio'))){
482
  }
483
  }
484
  $n=$type == 'checkbox' ? "lead[{$f_name}][]" : "lead[$f_name]";
485
- $check='';
486
- if(!empty($value)){
487
  if((is_array($value)&& in_array($val,$value)) || (!is_array($value) && $val == $value)){
488
  $check='checked="checked"';
489
  if(empty($text)){
@@ -491,7 +489,7 @@ else if(in_array($type,array('checkbox','radio'))){
491
  }
492
  $key_val[]=$text;
493
  }
494
- }
495
  ?>
496
  <div class="vx_check">
497
  <input type="<?php echo $type ?>" class="vx_input vx_check_100" name="<?php echo $n ?>" <?php echo $check ?> value="<?php echo $val ?>">
@@ -576,6 +574,7 @@ $settings = array("textarea_name"=>'lead['.$field['name'].']',"tinymce"=>array('
576
  wp_editor($value,$editor_id,$settings);
577
  }
578
  else{
 
579
  if($type == 'date'){$date_field=$date_class=' vx_date_field '; }
580
  $type=!in_array($type,array('email','url','tel')) ? 'text' : $type;
581
  ?>
@@ -759,7 +758,9 @@ do_action('vx_cf_add_meta_box',$lead,$detail);
759
  <div class="vx_col4"><?php echo $url ?></div>
760
  <div class="clear"></div>
761
  </div>
762
- <?php } ?>
 
 
763
  <div class="vx_row">
764
  <div class="vx_col3">
765
  <label class="left_header"><?php _e("IP", 'contact-form-entries'); ?></label>
@@ -771,6 +772,7 @@ do_action('vx_cf_add_meta_box',$lead,$detail);
771
  <div class="clear"></div>
772
  </div>
773
  <?php
 
774
  //var_dump($lead);
775
  if(!empty($lead['user_id'])){
776
  $userdata = get_userdata( $lead['user_id'] );
423
  </div>
424
  <div class="vx_group">
425
  <div class="vx_entry_table">
426
+ <?php
427
+ $emails=array(); $date_field='';
428
  if(is_array($detail) && is_array($fields)){
429
  foreach($fields as $field){ //var_dump($field['basetype']);
430
 
433
  $date_class='';
434
  $lead_field=isset($detail[$field_id]) ? $detail[$field_id] : '';
435
  $value='';
436
+ if(isset($lead_field['value'])){
437
  $value=maybe_unserialize($lead_field['value']);
438
+ }
439
 
440
  if (!filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
441
  $emails[]=$value;
446
  $f_name=$field['name'];
447
  $type=$field['type'];
448
  $req=isset($field['req']) && $field['req'] == 'true' ? 'required="required"' : '';
 
449
  ?>
450
  <div class="entry_row">
451
  <div class="entry_col1">
453
  </div>
454
  <div class="entry_col2">
455
  <div class="vx_edit">
456
+ <?php
457
  if( in_array($type,array('textarea','chat','comma') )){
458
  if(is_array($value)){
459
  $value=implode(',',$value);
467
  $is_key=true;
468
 
469
  if(!empty($field['values']) && is_array($field['values'])){
 
470
  foreach($field['values'] as $v){
471
  $val=$text=$v;
472
  if(is_array($v)){
480
  }
481
  }
482
  $n=$type == 'checkbox' ? "lead[{$f_name}][]" : "lead[$f_name]";
483
+ $check='';
484
+ // if(!empty($value)){
485
  if((is_array($value)&& in_array($val,$value)) || (!is_array($value) && $val == $value)){
486
  $check='checked="checked"';
487
  if(empty($text)){
489
  }
490
  $key_val[]=$text;
491
  }
492
+ // }
493
  ?>
494
  <div class="vx_check">
495
  <input type="<?php echo $type ?>" class="vx_input vx_check_100" name="<?php echo $n ?>" <?php echo $check ?> value="<?php echo $val ?>">
574
  wp_editor($value,$editor_id,$settings);
575
  }
576
  else{
577
+
578
  if($type == 'date'){$date_field=$date_class=' vx_date_field '; }
579
  $type=!in_array($type,array('email','url','tel')) ? 'text' : $type;
580
  ?>
758
  <div class="vx_col4"><?php echo $url ?></div>
759
  <div class="clear"></div>
760
  </div>
761
+ <?php }
762
+ if(!empty($lead['ip'])){
763
+ ?>
764
  <div class="vx_row">
765
  <div class="vx_col3">
766
  <label class="left_header"><?php _e("IP", 'contact-form-entries'); ?></label>
772
  <div class="clear"></div>
773
  </div>
774
  <?php
775
+ }
776
  //var_dump($lead);
777
  if(!empty($lead['user_id'])){
778
  $userdata = get_userdata( $lead['user_id'] );
uninstall.php CHANGED
@@ -9,7 +9,7 @@ $path=plugin_dir_path(__FILE__);
9
  include_once($path . "contact-form-entries.php");
10
  include_once($path . "includes/install.php");
11
  $install=new vxcf_form_install();
12
- $settings=get_option($install->id.'_meta',array());
13
  if(!empty($settings['plugin_data'])){
14
  $install->remove_data();
15
  }
9
  include_once($path . "contact-form-entries.php");
10
  include_once($path . "includes/install.php");
11
  $install=new vxcf_form_install();
12
+ $settings=get_option(vxcf_form::$id.'_meta',array());
13
  if(!empty($settings['plugin_data'])){
14
  $install->remove_data();
15
  }
wp/crmperks-notices.php CHANGED
@@ -105,7 +105,7 @@ public function review_notice() {
105
  update_option($this->option."_install_data",$install_time,false);
106
  }
107
 
108
- $time=current_time( 'timestamp' , 1 )-(DAY_IN_SECONDS*3);
109
  if(!empty($install_time) && is_array($install_time) && !empty($install_time['time']) && empty($install_time['review_closed'])){
110
  $time_i=(int)$install_time['time'];
111
  if($time > $time_i){
105
  update_option($this->option."_install_data",$install_time,false);
106
  }
107
 
108
+ $time=current_time( 'timestamp' , 1 )-(3600);
109
  if(!empty($install_time) && is_array($install_time) && !empty($install_time['time']) && empty($install_time['review_closed'])){
110
  $time_i=(int)$install_time['time'];
111
  if($time > $time_i){