Contact Form 7 Database Addon – CFDB7 - Version 1.2.4.5

Version Description

Download this release

Release Info

Developer arshidkv12
Plugin Icon 128x128 Contact Form 7 Database Addon – CFDB7
Version 1.2.4.5
Comparing to
See all releases

Code changes from version 1.2.4.1 to 1.2.4.5

contact-form-cfdb-7.php CHANGED
@@ -7,7 +7,7 @@ Author: Arshid
7
  Author URI: http://ciphercoin.com/
8
  Text Domain: contact-form-cfdb7
9
  Domain Path: /languages/
10
- Version: 1.2.4.1
11
  */
12
 
13
  function cfdb7_create_table(){
@@ -92,7 +92,7 @@ function cfdb7_before_send_mail( $form_tag ) {
92
 
93
  $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',
94
  '_wpcf7_is_ajax_call','cfdb7_name', '_wpcf7_container_post','_wpcf7cf_hidden_group_fields',
95
- '_wpcf7cf_hidden_groups', '_wpcf7cf_visible_groups', '_wpcf7cf_options');
96
 
97
  $data = $form->get_posted_data();
98
  $files = $form->uploaded_files();
@@ -113,8 +113,8 @@ function cfdb7_before_send_mail( $form_tag ) {
113
 
114
  if ( ! is_array($d) ){
115
 
116
- $bl = array('\"',"\'",'/','\\');
117
- $wl = array('"',''','/', '\');
118
 
119
  $tmpD = str_replace($bl, $wl, $tmpD );
120
  }
7
  Author URI: http://ciphercoin.com/
8
  Text Domain: contact-form-cfdb7
9
  Domain Path: /languages/
10
+ Version: 1.2.4.5
11
  */
12
 
13
  function cfdb7_create_table(){
92
 
93
  $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',
94
  '_wpcf7_is_ajax_call','cfdb7_name', '_wpcf7_container_post','_wpcf7cf_hidden_group_fields',
95
+ '_wpcf7cf_hidden_groups', '_wpcf7cf_visible_groups', '_wpcf7cf_options','g-recaptcha-response');
96
 
97
  $data = $form->get_posted_data();
98
  $files = $form->uploaded_files();
113
 
114
  if ( ! is_array($d) ){
115
 
116
+ $bl = array('\"',"\'",'/','\\','"',"'");
117
+ $wl = array('"',''','/', '\','"',''');
118
 
119
  $tmpD = str_replace($bl, $wl, $tmpD );
120
  }
inc/admin-form-details.php CHANGED
@@ -64,12 +64,14 @@ class CFdb7_Form_Details
64
  $key_val = str_replace('your-', '', $key);
65
  $key_val = ucfirst( $key_val );
66
  $arr_str_data = implode(', ',$data);
 
67
  echo '<p><b>'.$key_val.'</b>: '. nl2br($arr_str_data) .'</p>';
68
 
69
  }else{
70
 
71
  $key_val = str_replace('your-', '', $key);
72
  $key_val = ucfirst( $key_val );
 
73
  echo '<p><b>'.$key_val.'</b>: '.nl2br($data).'</p>';
74
  }
75
  }
64
  $key_val = str_replace('your-', '', $key);
65
  $key_val = ucfirst( $key_val );
66
  $arr_str_data = implode(', ',$data);
67
+ $arr_str_data = esc_html( $arr_str_data );
68
  echo '<p><b>'.$key_val.'</b>: '. nl2br($arr_str_data) .'</p>';
69
 
70
  }else{
71
 
72
  $key_val = str_replace('your-', '', $key);
73
  $key_val = ucfirst( $key_val );
74
+ $data = esc_html( $data );
75
  echo '<p><b>'.$key_val.'</b>: '.nl2br($data).'</p>';
76
  }
77
  }
inc/admin-mainpage.php CHANGED
@@ -111,6 +111,7 @@ class CFDB7_Main_List_Table extends WP_List_Table
111
  $this->_column_headers = array($columns, $hidden );
112
  $this->items = $data;
113
  }
 
114
  /**
115
  * Override the parent columns method. Defines the columns to use in your listing table
116
  *
111
  $this->_column_headers = array($columns, $hidden );
112
  $this->items = $data;
113
  }
114
+
115
  /**
116
  * Override the parent columns method. Defines the columns to use in your listing table
117
  *
inc/admin-subpage.php CHANGED
@@ -56,6 +56,7 @@ if( ! class_exists( 'WP_List_Table' ) ) {
56
  class CFDB7_List_Table extends WP_List_Table
57
  {
58
  private $form_post_id;
 
59
 
60
  public function __construct() {
61
 
@@ -125,13 +126,14 @@ class CFDB7_List_Table extends WP_List_Table
125
  $cfdb = apply_filters( 'cfdb7_database', $wpdb );
126
  $table_name = $cfdb->prefix.'db7_forms';
127
 
128
- $results = $cfdb->get_results( "SELECT * FROM $table_name WHERE form_post_id = $form_post_id LIMIT 1", OBJECT );
 
129
 
130
- $first_row = isset($results[0]) ? unserialize( $results[0]->form_value ): 0 ;
131
- $columns = array();
132
 
133
  if( !empty($first_row) ){
134
- $columns['form_id'] = $results[0]->form_id;
135
  $columns['cb'] = '<input type="checkbox" />';
136
  foreach ($first_row as $key => $value) {
137
 
@@ -139,6 +141,8 @@ class CFDB7_List_Table extends WP_List_Table
139
 
140
  $key_val = str_replace( array('your-', 'cfdb7_file'), '', $key);
141
  $columns[$key] = ucfirst( $key_val );
 
 
142
 
143
  if ( sizeof($columns) > 4) break;
144
  }
@@ -238,6 +242,11 @@ class CFDB7_List_Table extends WP_List_Table
238
  $fid = $result->form_post_id;
239
  $form_values['form_id'] = $result->form_id;
240
 
 
 
 
 
 
241
  foreach ($form_value as $k => $value) {
242
 
243
  $ktmp = $k;
@@ -247,14 +256,15 @@ class CFDB7_List_Table extends WP_List_Table
247
  if ( $can_foreach ) {
248
 
249
  foreach ($value as $k_val => $val):
250
-
251
  $form_values[$ktmp] = ( strlen($val) > 150 ) ? substr($val, 0, 150).'...': $val;
252
  $form_values[$ktmp] = sprintf($link, $fid, $result->form_id, $form_values[$ktmp]);
253
 
254
  endforeach;
255
  }else{
256
- $form_values[$ktmp] = ( strlen($value) > 150 ) ? substr($value, 0, 150).'...': $value;
257
- $form_values[$ktmp] = sprintf($link, $fid, $result->form_id, $form_values[$ktmp]);
 
258
  }
259
 
260
  }
56
  class CFDB7_List_Table extends WP_List_Table
57
  {
58
  private $form_post_id;
59
+ private $column_titles;
60
 
61
  public function __construct() {
62
 
126
  $cfdb = apply_filters( 'cfdb7_database', $wpdb );
127
  $table_name = $cfdb->prefix.'db7_forms';
128
 
129
+ $results = $cfdb->get_results( "SELECT * FROM $table_name
130
+ WHERE form_post_id = $form_post_id ORDER BY form_id DESC LIMIT 1", OBJECT );
131
 
132
+ $first_row = isset($results[0]) ? unserialize( $results[0]->form_value ): 0 ;
133
+ $columns = array();
134
 
135
  if( !empty($first_row) ){
136
+ //$columns['form_id'] = $results[0]->form_id;
137
  $columns['cb'] = '<input type="checkbox" />';
138
  foreach ($first_row as $key => $value) {
139
 
141
 
142
  $key_val = str_replace( array('your-', 'cfdb7_file'), '', $key);
143
  $columns[$key] = ucfirst( $key_val );
144
+
145
+ $this->column_titles[] = $key_val;
146
 
147
  if ( sizeof($columns) > 4) break;
148
  }
242
  $fid = $result->form_post_id;
243
  $form_values['form_id'] = $result->form_id;
244
 
245
+ foreach ( $this->column_titles as $col_title) {
246
+ $form_value[ $col_title ] = isset( $form_value[ $col_title ] ) ?
247
+ $form_value[ $col_title ] : '';
248
+ }
249
+
250
  foreach ($form_value as $k => $value) {
251
 
252
  $ktmp = $k;
256
  if ( $can_foreach ) {
257
 
258
  foreach ($value as $k_val => $val):
259
+ $val = esc_html( $val );
260
  $form_values[$ktmp] = ( strlen($val) > 150 ) ? substr($val, 0, 150).'...': $val;
261
  $form_values[$ktmp] = sprintf($link, $fid, $result->form_id, $form_values[$ktmp]);
262
 
263
  endforeach;
264
  }else{
265
+ $value = esc_html( $value );
266
+ $form_values[$ktmp] = ( strlen($value) > 150 ) ? substr($value, 0, 150).'...': $value;
267
+ $form_values[$ktmp] = sprintf($link, $fid, $result->form_id, $form_values[$ktmp]);
268
  }
269
 
270
  }
inc/export-csv.php CHANGED
@@ -55,7 +55,8 @@ class Expoert_CSV{
55
  foreach ( $array['form_id'] as $line => $form_id ) {
56
  $line_values = array();
57
  foreach($array_keys as $array_key ) {
58
- $line_values[ $array_key ] = $array[ $array_key ][ $line ];
 
59
  }
60
  fputcsv($df, $line_values);
61
  }
@@ -81,7 +82,12 @@ class Expoert_CSV{
81
  }
82
  $fid = (int)$_REQUEST['fid'];
83
  $results = $cfdb->get_results("SELECT form_id, form_value, form_date FROM $table_name
84
- WHERE form_post_id = '$fid' ",OBJECT);
 
 
 
 
 
85
 
86
  $data = array();
87
  $i = 0;
@@ -95,7 +101,7 @@ class Expoert_CSV{
95
  $cfdb7_dir_url = $upload_dir['baseurl'].'/cfdb7_uploads';
96
 
97
  foreach ($resultTmp as $key => $value):
98
-
99
  if (strpos($key, 'cfdb7_file') !== false ){
100
  $data[$key][$i] = $cfdb7_dir_url.'/'.$value;
101
  continue;
55
  foreach ( $array['form_id'] as $line => $form_id ) {
56
  $line_values = array();
57
  foreach($array_keys as $array_key ) {
58
+ $val = isset( $array[ $array_key ][ $line ] ) ? $array[ $array_key ][ $line ] : '';
59
+ $line_values[ $array_key ] = $val;
60
  }
61
  fputcsv($df, $line_values);
62
  }
82
  }
83
  $fid = (int)$_REQUEST['fid'];
84
  $results = $cfdb->get_results("SELECT form_id, form_value, form_date FROM $table_name
85
+ WHERE form_post_id = '$fid' ORDER BY form_id DESC ",OBJECT);
86
+ $heading_row = $cfdb->get_results("SELECT form_id, form_value, form_date FROM $table_name
87
+ WHERE form_post_id = '$fid' ORDER BY form_id DESC LIMIT 1",OBJECT);
88
+ $heading_row = reset( $heading_row );
89
+ $heading_row = unserialize( $heading_row->form_value );
90
+ $heading_key = array_keys( $heading_row );
91
 
92
  $data = array();
93
  $i = 0;
101
  $cfdb7_dir_url = $upload_dir['baseurl'].'/cfdb7_uploads';
102
 
103
  foreach ($resultTmp as $key => $value):
104
+ if ( ! in_array( $key, $heading_key ) ) continue;
105
  if (strpos($key, 'cfdb7_file') !== false ){
106
  $data[$key][$i] = $cfdb7_dir_url.'/'.$value;
107
  continue;
readme.txt CHANGED
@@ -2,12 +2,14 @@
2
  Contributors: arshidkv12
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=H5F3Z6S3MNTXA&lc=IN&item_name=wp%2dlogin%2dlimit&amount=5%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
4
  Tags: cf7, contact form 7, contact form 7 db, contact form db, contact form seven, contact form storage, export contact form, save contact form, wpcf7
5
- Requires at least: 3.5
6
- Tested up to: 5
7
- Stable tag: 1.2.4.1
8
- License: GPLv2
 
 
9
 
10
- Save and manage Contact Form 7 messages. Never lose important data. It is lightweight contact form 7 db plugin
11
 
12
 
13
  == Description ==
@@ -64,3 +66,7 @@ Fixed csv export issue
64
 
65
  == 1.2.4 ==
66
  Fixed admin notification bug
 
 
 
 
2
  Contributors: arshidkv12
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=H5F3Z6S3MNTXA&lc=IN&item_name=wp%2dlogin%2dlimit&amount=5%2e00&currency_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
4
  Tags: cf7, contact form 7, contact form 7 db, contact form db, contact form seven, contact form storage, export contact form, save contact form, wpcf7
5
+ Requires at least: 4.8
6
+ Tested up to: 5.0
7
+ Stable tag: 1.2.4.5
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+ Requires PHP: 5.3
11
 
12
+ Save and manage Contact Form 7 messages. Never lose important data. It is lightweight contact form 7 database plugin.
13
 
14
 
15
  == Description ==
66
 
67
  == 1.2.4 ==
68
  Fixed admin notification bug
69
+
70
+ == 1.2.4.3 ==
71
+ Responsive issue fixed
72
+