Version Description
- Fixed save file related issue.
- Compatible with latest version wordpress 5.7.2
Download this release
Release Info
Developer | vsourz1td |
Plugin | Advanced Contact form 7 DB |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- README.txt +5 -2
- admin/class-advanced-cf7-db-admin.php +9 -3
- admin/class/PHPExcel/Shared/OLE.php +1 -1
- advanced-cf7-db.php +2 -2
- includes/class-advanced-cf7-db.php +1 -1
- includes/vsz-cf7-db-function.php +19 -8
README.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: vsourz1td
|
3 |
Tags: contact form 7 db, advanced cf7 db, contact form 7 database, contact form db, contact form 7, save form data, save contact form, save cf7, database, cf7db, save-contact-form, Save-Forms-Data, import-cf7, export-contact-data, view-cf7-entry
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.8.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -191,6 +191,9 @@ return $contact_form_ids;
|
|
191 |
|
192 |
|
193 |
== Changelog ==
|
|
|
|
|
|
|
194 |
|
195 |
= 1.8.1 =
|
196 |
* Minor bug fixes
|
2 |
Contributors: vsourz1td
|
3 |
Tags: contact form 7 db, advanced cf7 db, contact form 7 database, contact form db, contact form 7, save form data, save contact form, save cf7, database, cf7db, save-contact-form, Save-Forms-Data, import-cf7, export-contact-data, view-cf7-entry
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 5.7.2
|
6 |
+
Stable tag: 1.8.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
191 |
|
192 |
|
193 |
== Changelog ==
|
194 |
+
= 1.8.2 =
|
195 |
+
* Fixed save file related issue.
|
196 |
+
* Compatible with latest version wordpress 5.7.2
|
197 |
|
198 |
= 1.8.1 =
|
199 |
* Minor bug fixes
|
admin/class-advanced-cf7-db-admin.php
CHANGED
@@ -1268,6 +1268,7 @@ function vsz_cf7_export_to_excel($fid, $ids_export){
|
|
1268 |
//create excel class object
|
1269 |
$xls = new PHPExcel();
|
1270 |
|
|
|
1271 |
//First we will set header in excel file
|
1272 |
$col = 0;
|
1273 |
$row = 1;
|
@@ -1278,6 +1279,7 @@ function vsz_cf7_export_to_excel($fid, $ids_export){
|
|
1278 |
$col++;
|
1279 |
}
|
1280 |
|
|
|
1281 |
$row = 2;
|
1282 |
foreach ($data_sorted as $k => $v){
|
1283 |
//Define column index here
|
@@ -1286,11 +1288,15 @@ function vsz_cf7_export_to_excel($fid, $ids_export){
|
|
1286 |
//Get column order wise value here
|
1287 |
foreach ($fields as $k2 => $v2){
|
1288 |
$colVal = (isset($v[$k2]) ? html_entity_decode($v[$k2]) : '');
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
$col++;
|
|
|
1293 |
}
|
|
|
|
|
|
|
1294 |
//Consider new row for each entry here
|
1295 |
$row++;
|
1296 |
}
|
1268 |
//create excel class object
|
1269 |
$xls = new PHPExcel();
|
1270 |
|
1271 |
+
|
1272 |
//First we will set header in excel file
|
1273 |
$col = 0;
|
1274 |
$row = 1;
|
1279 |
$col++;
|
1280 |
}
|
1281 |
|
1282 |
+
|
1283 |
$row = 2;
|
1284 |
foreach ($data_sorted as $k => $v){
|
1285 |
//Define column index here
|
1288 |
//Get column order wise value here
|
1289 |
foreach ($fields as $k2 => $v2){
|
1290 |
$colVal = (isset($v[$k2]) ? html_entity_decode($v[$k2]) : '');
|
1291 |
+
$cell = $xls->getCellNo($row, $col);
|
1292 |
+
$xls->setActiveSheetIndex(0)->setCellValue($cell,$colVal);
|
1293 |
+
//$xls->getActiveSheet()->setCellValueByColumnAndRow($col, $row, $colVal);
|
1294 |
$col++;
|
1295 |
+
|
1296 |
}
|
1297 |
+
/* echo '<pre>';
|
1298 |
+
var_dump($data_sorted);
|
1299 |
+
exit; */
|
1300 |
//Consider new row for each entry here
|
1301 |
$row++;
|
1302 |
}
|
admin/class/PHPExcel/Shared/OLE.php
CHANGED
@@ -287,7 +287,7 @@ class PHPExcel_Shared_OLE
|
|
287 |
$pps = new PHPExcel_Shared_OLE_PPS_File($name);
|
288 |
break;
|
289 |
default:
|
290 |
-
|
291 |
}
|
292 |
fseek($fh, 1, SEEK_CUR);
|
293 |
$pps->Type = $type;
|
287 |
$pps = new PHPExcel_Shared_OLE_PPS_File($name);
|
288 |
break;
|
289 |
default:
|
290 |
+
break;
|
291 |
}
|
292 |
fseek($fh, 1, SEEK_CUR);
|
293 |
$pps->Type = $type;
|
advanced-cf7-db.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* Plugin Name: Advanced CF7 DB
|
10 |
* Plugin URI: https://wordpress.org/plugins/advanced-cf7-db/
|
11 |
* Description: Save all contact form 7 submitted data to the database, View, Export, ordering, Change field labels, Import data using CSV very easily.
|
12 |
-
* Version: 1.8.
|
13 |
* Author: Vsourz Digital
|
14 |
* Author URI: https://www.vsourz.com
|
15 |
* License: GPL-2.0+
|
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
23 |
die;
|
24 |
}
|
25 |
global $vsz_cf7db_current_version;
|
26 |
-
$vsz_cf7db_current_version = '
|
27 |
/**
|
28 |
* Defining all the table names and setting their prefix here
|
29 |
*/
|
9 |
* Plugin Name: Advanced CF7 DB
|
10 |
* Plugin URI: https://wordpress.org/plugins/advanced-cf7-db/
|
11 |
* Description: Save all contact form 7 submitted data to the database, View, Export, ordering, Change field labels, Import data using CSV very easily.
|
12 |
+
* Version: 1.8.2
|
13 |
* Author: Vsourz Digital
|
14 |
* Author URI: https://www.vsourz.com
|
15 |
* License: GPL-2.0+
|
23 |
die;
|
24 |
}
|
25 |
global $vsz_cf7db_current_version;
|
26 |
+
$vsz_cf7db_current_version = '1.8.2';
|
27 |
/**
|
28 |
* Defining all the table names and setting their prefix here
|
29 |
*/
|
includes/class-advanced-cf7-db.php
CHANGED
@@ -69,7 +69,7 @@ class Advanced_Cf7_Db {
|
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'advanced-cf7-db';
|
72 |
-
$this->version = '1.
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'advanced-cf7-db';
|
72 |
+
$this->version = '1.8.2';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
includes/vsz-cf7-db-function.php
CHANGED
@@ -56,6 +56,7 @@ function vsz_cf7_before_send_email($contact_form){
|
|
56 |
//Get not inserted fields value list
|
57 |
$cf7d_no_save_fields = vsz_cf7_no_save_fields();
|
58 |
foreach ($contact_form->posted_data as $k => $v) {
|
|
|
59 |
//Check not inserted fields name in array or not
|
60 |
if(in_array($k, $cf7d_no_save_fields)) {
|
61 |
continue;
|
@@ -120,6 +121,7 @@ if (!function_exists('vsz_cf7_modify_form_before_insert_in_cf7_vdata_entry')) {
|
|
120 |
function vsz_cf7_modify_form_before_insert_in_cf7_vdata_entry($cf7){
|
121 |
//if it has at lest 1 file uploaded
|
122 |
if (count($cf7->uploaded_files) > 0) {
|
|
|
123 |
//Get upload dir URL
|
124 |
$upload_dir = wp_upload_dir();
|
125 |
//Create custom upload folder
|
@@ -128,17 +130,26 @@ if (!function_exists('vsz_cf7_modify_form_before_insert_in_cf7_vdata_entry')) {
|
|
128 |
wp_mkdir_p($dir_upload);
|
129 |
//Get all uploaded files information
|
130 |
foreach ($cf7->uploaded_files as $k => $v) {
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
$file_name = wp_unique_filename($dir_upload, $file_name);
|
135 |
-
|
136 |
$dst_file = $dir_upload . '/' . $file_name;
|
137 |
-
|
138 |
-
if (@copy($
|
139 |
//Setup customize file information in array
|
140 |
-
|
141 |
-
|
|
|
142 |
}//Close foreach
|
143 |
}//Close if
|
144 |
return $cf7;
|
56 |
//Get not inserted fields value list
|
57 |
$cf7d_no_save_fields = vsz_cf7_no_save_fields();
|
58 |
foreach ($contact_form->posted_data as $k => $v) {
|
59 |
+
|
60 |
//Check not inserted fields name in array or not
|
61 |
if(in_array($k, $cf7d_no_save_fields)) {
|
62 |
continue;
|
121 |
function vsz_cf7_modify_form_before_insert_in_cf7_vdata_entry($cf7){
|
122 |
//if it has at lest 1 file uploaded
|
123 |
if (count($cf7->uploaded_files) > 0) {
|
124 |
+
|
125 |
//Get upload dir URL
|
126 |
$upload_dir = wp_upload_dir();
|
127 |
//Create custom upload folder
|
130 |
wp_mkdir_p($dir_upload);
|
131 |
//Get all uploaded files information
|
132 |
foreach ($cf7->uploaded_files as $k => $v) {
|
133 |
+
|
134 |
+
|
135 |
+
//to check if CF7 version due to changes $cf7->uploaded_files return value
|
136 |
+
if(defined('WPCF7_VERSION') && WPCF7_VERSION > '5.3.2'){
|
137 |
+
$val=$v[0];
|
138 |
+
}else{
|
139 |
+
$val=$v;
|
140 |
+
}
|
141 |
+
//Get file name
|
142 |
+
$file_name = basename($val);
|
143 |
+
//Create unique file name
|
144 |
$file_name = wp_unique_filename($dir_upload, $file_name);
|
145 |
+
//Setup filoe path
|
146 |
$dst_file = $dir_upload . '/' . $file_name;
|
147 |
+
//Copy file information in destination variable
|
148 |
+
if (@copy($val, $dst_file)){
|
149 |
//Setup customize file information in array
|
150 |
+
$cf7->posted_data[$k] = $upload_dir['baseurl'] . '/' . $cf7d_upload_folder . '/' . $file_name;
|
151 |
+
}
|
152 |
+
|
153 |
}//Close foreach
|
154 |
}//Close if
|
155 |
return $cf7;
|