Ultimate CSV Importer - Version 3.6.75

Version Description

Download this release

Release Info

Developer smackcoders
Plugin Icon 128x128 Ultimate CSV Importer
Version 3.6.75
Comparing to
See all releases

Code changes from version 3.6.6 to 3.6.75

Readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === WP Ultimate CSV Importer Plugin ===
2
  Contributors: smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
- Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, buddypress, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, eshop, woocommerce, wordpress, xml, youtube, export
5
- Requires at least: 3.8
6
- Tested up to: 4.0
7
- Stable tag: 3.6.6
8
- Version: 3.6.6
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
@@ -15,7 +15,9 @@ Advanced CSV Importer plugin to import/export posts, pages, eshop products, cust
15
 
16
  == Description ==
17
 
18
- ** Now version 3.6.6 with added improvements and fixes to 3.6.5 with much advanced media handling of in line images in any posts features. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
 
 
19
 
20
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
21
 
@@ -24,6 +26,8 @@ WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer
24
  <p>https://www.youtube.com/watch?v=Guv5zR7fgW0&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
25
 
26
  = Highlights =
 
 
27
  * Import external/internal images in line to any posts
28
  * Upload images related to each csv
29
  * Auto delimiter
@@ -37,12 +41,12 @@ WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer
37
  * Scheduled Publishing
38
  * Duplicate Title and content handling
39
  * Multi Lingual import (CSV format must be UTF-8 without BOM)
40
- * Mutisite and Buddypress also supported now
41
  * Compatible to wordpress themes
42
  * Better alternative for xml
43
  * Post Format option added
44
  * Page template attribute feature
45
- * EShop Proucts import (included from V3.6.3)
46
  = Power Import Features to Control your csv import =
47
  * Post title, content and even excerpt
48
  * Text, WYSIWYG/HTML, in line CSS in post content
@@ -176,6 +180,35 @@ This will solve your issue or get support from hosting if you dint have sufficie
176
 
177
  == Changelog ==
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  = 3.6.6 =
180
  * Dashboard chart issue fixed for multi site.
181
  * UI improvements along with easy usability.
@@ -366,6 +399,24 @@ This will solve your issue or get support from hosting if you dint have sufficie
366
 
367
  == Upgrade Notice ==
368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  = 3.6.6 =
370
  * Upgrade now for improved experience.
371
 
1
  === WP Ultimate CSV Importer Plugin ===
2
  Contributors: smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
+ Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, eshop, woocommerce, wordpress, xml, youtube, export
5
+ Requires at least: 3.9
6
+ Tested up to: 4.1
7
+ Stable tag: 3.6.75
8
+ Version: 3.6.75
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
15
 
16
  == Description ==
17
 
18
+ Wordpress Ultimate CSV Importer Pro V4.0 Beta is available as live demo for users to test drive all new features, improvements and changes from http://demo.smackcoders.com/csv4beta. Users can get product manual and sample csv files etc., from - https://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-pro-v4-0-beta-demo-is-available.html
19
+
20
+ ** Now stable version 3.6.75 available to download with hot security fix. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
21
 
22
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
23
 
26
  <p>https://www.youtube.com/watch?v=Guv5zR7fgW0&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
27
 
28
  = Highlights =
29
+ * New Terminate & Continue feature is added.
30
+ * Complete export feature with improved filters
31
  * Import external/internal images in line to any posts
32
  * Upload images related to each csv
33
  * Auto delimiter
41
  * Scheduled Publishing
42
  * Duplicate Title and content handling
43
  * Multi Lingual import (CSV format must be UTF-8 without BOM)
44
+ * Mutisite also supported now
45
  * Compatible to wordpress themes
46
  * Better alternative for xml
47
  * Post Format option added
48
  * Page template attribute feature
49
+ * EShop Products import (included from V3.6.3)
50
  = Power Import Features to Control your csv import =
51
  * Post title, content and even excerpt
52
  * Text, WYSIWYG/HTML, in line CSS in post content
180
 
181
  == Changelog ==
182
 
183
+ = 3.6.75 =
184
+ * Added: Terminate & Continue option in import section.
185
+ * Improved: Log section. Issue fixed in Web View & Admin View.
186
+ * Fixed: Secrity fix for export module.
187
+
188
+ = 3.6.74 =
189
+ * Added: Secrity fix.
190
+
191
+ = 3.6.73 =
192
+ * Added: WordPress 4.0 compatibility checked.
193
+ * Added: https format support for all wp instances.
194
+ * Added: Warning to guide user to create uploads directory with writeable permissions.
195
+ * Fixed: Image handling issues in featured image.
196
+ * Fixed: Multisite compatible issue.
197
+ * Removed: Post Content field mandatory option.
198
+ * Removed: All console warnings.
199
+ * Improved: Details added in security and performance tab under settings module.
200
+
201
+ = 3.6.72 =
202
+ * Added: Debug mode enable/disable options.
203
+ * Modified: Menu order changes.
204
+
205
+ = 3.6.71 =
206
+ * Minor bug fixed
207
+
208
+ = 3.6.7 =
209
+ * Added: Export features for all missing modules.
210
+ * Fixed: All console warnings and reported logs.
211
+
212
  = 3.6.6 =
213
  * Dashboard chart issue fixed for multi site.
214
  * UI improvements along with easy usability.
399
 
400
  == Upgrade Notice ==
401
 
402
+ = 3.6.75 =
403
+ * Upgrade now for improved experience.
404
+
405
+ = 3.6.74 =
406
+ * Upgrade now for secrity fix.
407
+
408
+ = 3.6.73 =
409
+ * Upgrade now for WordPress 4.0 compatibility and minor bug fixes.
410
+
411
+ = 3.6.72 =
412
+ * Upgrade to enable/disable debug mode in settings.
413
+
414
+ = 3.6.71 =
415
+ * Upgrade now for complete export features as in Pro with bug fix.
416
+
417
+ = 3.6.7 =
418
+ * Upgrade now for complete export features as in Pro.
419
+
420
  = 3.6.6 =
421
  * Upgrade now for improved experience.
422
 
css/main.css CHANGED
@@ -415,7 +415,7 @@ border: 2px solid red;
415
  border-radius:4px;
416
  -moz-border-radius: 4px;
417
  -webkit-border-radius: 4px;
418
- top:190px;
419
  position:relative;
420
  }
421
 
415
  border-radius:4px;
416
  -moz-border-radius: 4px;
417
  -webkit-border-radius: 4px;
418
+ /* top:190px; */
419
  position:relative;
420
  }
421
 
css/style.css CHANGED
@@ -251,6 +251,10 @@ position: absolute;
251
  padding: 15px 0;
252
  }
253
 
 
 
 
 
254
  #boxmethod1, #boxmethod2, #boxmethod3, #boxmethod4 {
255
  padding: 10px;
256
  }
@@ -433,11 +437,11 @@ padding-bottom: 10px;
433
  margin-top: -33px;
434
  margin-right: 8px;
435
  }
436
- #wpusercheck,#allowimport,#schedulecheck,#dropon,#catenable,#postlabel,
437
  #pagelabel,#userlabel,#commentslabel,#custaxlabel,#cplabel,#catlabel,#custrevlabel {
438
  border-radius:5px 0 0 5px;
439
  }
440
- #wpuseruncheck,#donallowimport,#scheduleuncheck,#dropoff,#catdisable,#nopostlabel,
441
  #nopagelabel,#nouserlabel,#nocommentslabel,#nocustaxlabel,#nocplabel,#nocatlabel,#nocustrevlabel {
442
  border-radius:0 5px 5px 0;
443
  }
@@ -648,4 +652,6 @@ margin-top: 10px;
648
  height:315px !important;
649
  }
650
  /*End off summary*/
651
-
 
 
251
  padding: 15px 0;
252
  }
253
 
254
+ .method1 img, .method2 img, .method3 img, .method4 img, #showmappingtemplate img, .databaseoptimization img {
255
+ margin-top:-25px;
256
+ }
257
+
258
  #boxmethod1, #boxmethod2, #boxmethod3, #boxmethod4 {
259
  padding: 10px;
260
  }
437
  margin-top: -33px;
438
  margin-right: 8px;
439
  }
440
+ #wpusercheck,#allowimport,#schedulecheck,#dropon,#catenable,#postlabel,#debugmode_enable,
441
  #pagelabel,#userlabel,#commentslabel,#custaxlabel,#cplabel,#catlabel,#custrevlabel {
442
  border-radius:5px 0 0 5px;
443
  }
444
+ #wpuseruncheck,#donallowimport,#scheduleuncheck,#dropoff,#catdisable,#nopostlabel, #debugmode_disable,
445
  #nopagelabel,#nouserlabel,#nocommentslabel,#nocustaxlabel,#nocplabel,#nocatlabel,#nocustrevlabel {
446
  border-radius:0 5px 5px 0;
447
  }
652
  height:315px !important;
653
  }
654
  /*End off summary*/
655
+ #noPlugin {
656
+ margin: 5% 12%;
657
+ }
images/pro_icon.gif ADDED
Binary file
includes/WPImporter_includes_helper.php CHANGED
@@ -818,7 +818,7 @@ class WPImporter_includes_helper {
818
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
819
  }
820
  }
821
- $this->detailedLog[$currentLimit]['verify_here'] = "<b>Verify Here -</b> <a href='" . get_permalink( $post_id ) . "' title='" . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $data_array['post_title'] ) ) . "' rel='permalink'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "'>" . __( 'Admin View' ) . "</a>";
822
 
823
  unset($data_array);
824
  }
@@ -857,6 +857,8 @@ class WPImporter_includes_helper {
857
  $wpdb->query($sql4);
858
  }
859
  }
 
 
860
  }
861
 
862
  //Drop Database While Deactivate plugin
@@ -868,7 +870,7 @@ class WPImporter_includes_helper {
868
  $sql2 = "DROP TABLE smackcsv_line_log;";
869
  $wpdb->query($sql2);
870
 
871
-
872
  }
873
  public function addPieChartEntry($imported_as, $count) {
874
  //add total counts
@@ -932,6 +934,11 @@ class WPImporter_includes_helper {
932
  return $file_name;
933
  }
934
 
 
 
 
 
 
935
  // Function for common footer
936
  public function common_footer_for_other_plugin_promotions(){
937
  $content = '<div class="accordion-inner">
@@ -1044,13 +1051,13 @@ class WPImporter_includes_helper {
1044
  </div>
1045
  <div style = "opacity: 0.3;background-color: ghostwhite;">
1046
  <div id="boxmethod2" class="method2">
1047
- <label><span class="radio-icon"><input type="radio" name="importmethod" id="dwnldftpfile" /></span> <span class="header-text" id="importopt">' . __('From FTP') . '</span> </label> <br>
1048
  </div>
1049
  <div id="boxmethod3" class="method3">
1050
- <label> <span class="radio-icon"><input type="radio" name="importmethod" id="dwnldextrfile" /></span> <span class="header-text" id="importopt">' . __('From URL') . '</span></label> <br>
1051
  </div>
1052
  <div id="boxmethod4" class="method4">
1053
- <label><span class="radio-icon"><input type="radio" name="importmethod" id="useuploadedfile" /></span> <span class="header-text" id="importopt">' . __('From Already Uploaded') . '</span></label> <br>
1054
  </div>
1055
  </div>
1056
 
@@ -1095,5 +1102,771 @@ class CallWPImporterObj extends WPImporter_includes_helper
1095
  }
1096
  }
1097
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1098
 
1099
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
819
  }
820
  }
821
+ $this->detailedLog[$currentLimit]['verify_here'] = "<b>Verify Here -</b> <a href='" . get_permalink( $post_id ) . "' title='" . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $data_array['post_title'] ) ) . "' rel='permalink' target='_blank'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "' target='_blank'>" . __( 'Admin View' ) . "</a>";
822
 
823
  unset($data_array);
824
  }
857
  $wpdb->query($sql4);
858
  }
859
  }
860
+ $saveSettings = array('savesettings' => 'Save', 'post' => 'post', 'page' => 'page', 'custompost' => 'custompost', 'drop_table' => 'off', 'debug_mode' => 'disable_debug', 'export_delimiter' => ';',);
861
+ update_option('wpcsvfreesettings', $saveSettings);
862
  }
863
 
864
  //Drop Database While Deactivate plugin
870
  $sql2 = "DROP TABLE smackcsv_line_log;";
871
  $wpdb->query($sql2);
872
 
873
+ update_option('wpcsvfreesettings','');
874
  }
875
  public function addPieChartEntry($imported_as, $count) {
876
  //add total counts
934
  return $file_name;
935
  }
936
 
937
+ // Function to show common notice for PRO Feature
938
+ public function common_notice_for_pro_feature() {
939
+ return "<p align='center'> <label style='color:red;'> This feature is only available in Pro! </label> <a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank'>Go Pro Now</a> </p>";
940
+ }
941
+
942
  // Function for common footer
943
  public function common_footer_for_other_plugin_promotions(){
944
  $content = '<div class="accordion-inner">
1051
  </div>
1052
  <div style = "opacity: 0.3;background-color: ghostwhite;">
1053
  <div id="boxmethod2" class="method2">
1054
+ <label><span class="radio-icon"><input type="radio" name="importmethod" id="dwnldftpfile" /></span> <span class="header-text" id="importopt">' . __('From FTP') . '</span> </label> <img src="' . WP_CONTENT_URL . '/plugins/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/images/pro_icon.gif" title="PRO Feature" /> <br>
1055
  </div>
1056
  <div id="boxmethod3" class="method3">
1057
+ <label> <span class="radio-icon"><input type="radio" name="importmethod" id="dwnldextrfile" /></span> <span class="header-text" id="importopt">' . __('From URL') . '</span></label> <img src="' . WP_CONTENT_URL . '/plugins/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/images/pro_icon.gif" title="PRO Feature" /> <br>
1058
  </div>
1059
  <div id="boxmethod4" class="method4">
1060
+ <label><span class="radio-icon"><input type="radio" name="importmethod" id="useuploadedfile" /></span> <span class="header-text" id="importopt">' . __('From Already Uploaded') . '</span></label> <img src="' . WP_CONTENT_URL . '/plugins/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/images/pro_icon.gif" title="PRO Feature" /> <br>
1061
  </div>
1062
  </div>
1063
 
1102
  }
1103
  }
1104
 
1105
+ class WPImpCSVParserLib {
1106
+
1107
+ /*
1108
+
1109
+ Class: parseCSV v0.4.3 beta
1110
+ http://code.google.com/p/parsecsv-for-php/
1111
+
1112
+
1113
+ Fully conforms to the specifications lined out on wikipedia:
1114
+ - http://en.wikipedia.org/wiki/Comma-separated_values
1115
+
1116
+ Based on the concept of Ming Hong Ng's CsvFileParser class:
1117
+ - http://minghong.blogspot.com/2006/07/csv-parser-for-php.html
1118
+
1119
+
1120
+
1121
+ Copyright (c) 2007 Jim Myhrberg (jim@zydev.info).
1122
+
1123
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1124
+ of this software and associated documentation files (the "Software"), to deal
1125
+ in the Software without restriction, including without limitation the rights
1126
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1127
+ copies of the Software, and to permit persons to whom the Software is
1128
+ furnished to do so, subject to the following conditions:
1129
+
1130
+ The above copyright notice and this permission notice shall be included in
1131
+ all copies or substantial portions of the Software.
1132
+
1133
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1134
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1135
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1136
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1137
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1138
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1139
+ THE SOFTWARE.
1140
+
1141
+
1142
+
1143
+ Code Examples
1144
+ ----------------
1145
+ # general usage
1146
+ $csv = new parseCSV('data.csv');
1147
+ print_r($csv->data);
1148
+ ----------------
1149
+ # tab delimited, and encoding conversion
1150
+ $csv = new parseCSV();
1151
+ $csv->encoding('UTF-16', 'UTF-8');
1152
+ $csv->delimiter = "\t";
1153
+ $csv->parse('data.tsv');
1154
+ print_r($csv->data);
1155
+ ----------------
1156
+ # auto-detect delimiter character
1157
+ $csv = new parseCSV();
1158
+ $csv->auto('data.csv');
1159
+ print_r($csv->data);
1160
+ ----------------
1161
+ # modify data in a csv file
1162
+ $csv = new parseCSV();
1163
+ $csv->sort_by = 'id';
1164
+ $csv->parse('data.csv');
1165
+ # "4" is the value of the "id" column of the CSV row
1166
+ $csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => 'john@doe.com');
1167
+ $csv->save();
1168
+ ----------------
1169
+ # add row/entry to end of CSV file
1170
+ # - only recommended when you know the extact sctructure of the file
1171
+ $csv = new parseCSV();
1172
+ $csv->save('data.csv', array(array('1986', 'Home', 'Nowhere', '')), true);
1173
+ ----------------
1174
+ # convert 2D array to csv data and send headers
1175
+ # to browser to treat output as a file and download it
1176
+ $csv = new parseCSV();
1177
+ $csv->output (true, 'movies.csv', $array);
1178
+ ----------------
1179
+
1180
+
1181
+ */
1182
 
1183
 
1184
+ /**
1185
+ * Configuration
1186
+ * - set these options with $object->var_name = 'value';
1187
+ */
1188
+
1189
+ # use first line/entry as field names
1190
+ var $heading = true;
1191
+
1192
+ # override field names
1193
+ var $fields = array();
1194
+
1195
+ # sort entries by this field
1196
+ var $sort_by = null;
1197
+ var $sort_reverse = false;
1198
+
1199
+ # sort behavior passed to ksort/krsort functions
1200
+ # regular = SORT_REGULAR
1201
+ # numeric = SORT_NUMERIC
1202
+ # string = SORT_STRING
1203
+ var $sort_type = null;
1204
+
1205
+ # delimiter (comma) and enclosure (double quote)
1206
+ var $delimiter = ',';
1207
+ var $enclosure = '"';
1208
+
1209
+ # basic SQL-like conditions for row matching
1210
+ var $conditions = null;
1211
+
1212
+ # number of rows to ignore from beginning of data
1213
+ var $offset = null;
1214
+
1215
+ # limits the number of returned rows to specified amount
1216
+ var $limit = null;
1217
+
1218
+ # number of rows to analyze when attempting to auto-detect delimiter
1219
+ var $auto_depth = 15;
1220
+
1221
+ # characters to ignore when attempting to auto-detect delimiter
1222
+ var $auto_non_chars = "a-zA-Z0-9\n\r";
1223
+
1224
+ # preferred delimiter characters, only used when all filtering method
1225
+ # returns multiple possible delimiters (happens very rarely)
1226
+ var $auto_preferred = ",;\t.:|";
1227
+
1228
+ # character encoding options
1229
+ var $convert_encoding = false;
1230
+ var $input_encoding = 'ISO-8859-1';
1231
+ var $output_encoding = 'ISO-8859-1';
1232
+
1233
+ # used by unparse(), save(), and output() functions
1234
+ var $linefeed = "\r\n";
1235
+
1236
+ # only used by output() function
1237
+ var $output_delimiter = ',';
1238
+ var $output_filename = 'data.csv';
1239
+
1240
+ # keep raw file data in memory after successful parsing (useful for debugging)
1241
+ var $keep_file_data = false;
1242
+
1243
+ /**
1244
+ * Internal variables
1245
+ */
1246
+
1247
+ # current file
1248
+ var $file;
1249
+
1250
+ # loaded file contents
1251
+ var $file_data;
1252
+
1253
+ # error while parsing input data
1254
+ # 0 = No errors found. Everything should be fine :)
1255
+ # 1 = Hopefully correctable syntax error was found.
1256
+ # 2 = Enclosure character (double quote by default)
1257
+ # was found in non-enclosed field. This means
1258
+ # the file is either corrupt, or does not
1259
+ # standard CSV formatting. Please validate
1260
+ # the parsed data yourself.
1261
+ var $error = 0;
1262
+
1263
+ # detailed error info
1264
+ var $error_info = array();
1265
+
1266
+ # array of field values in data parsed
1267
+ var $titles = array();
1268
+
1269
+ # two dimentional array of CSV data
1270
+ var $data = array();
1271
+
1272
+
1273
+ /**
1274
+ * Constructor
1275
+ * @param input CSV file or string
1276
+ * @return nothing
1277
+ */
1278
+ function parseCSV ($input = null, $offset = null, $limit = null, $conditions = null) {
1279
+ if ( $offset !== null ) $this->offset = $offset;
1280
+ if ( $limit !== null ) $this->limit = $limit;
1281
+ if ( count($conditions) > 0 ) $this->conditions = $conditions;
1282
+ if ( !empty($input) ) $this->parse($input);
1283
+ }
1284
+
1285
+
1286
+ // ==============================================
1287
+ // ----- [ Main Functions ] ---------------------
1288
+ // ==============================================
1289
+
1290
+ /**
1291
+ * Parse CSV file or string
1292
+ * @param input CSV file or string
1293
+ * @return nothing
1294
+ */
1295
+ function parse ($input = null, $offset = null, $limit = null, $conditions = null) {
1296
+ if ( $input === null ) $input = $this->file;
1297
+ if ( !empty($input) ) {
1298
+ if ( $offset !== null ) $this->offset = $offset;
1299
+ if ( $limit !== null ) $this->limit = $limit;
1300
+ if ( count($conditions) > 0 ) $this->conditions = $conditions;
1301
+ if ( is_readable($input) ) {
1302
+ $this->data = $this->parse_file($input);
1303
+ } else {
1304
+ $this->file_data = &$input;
1305
+ $this->data = $this->parse_string();
1306
+ }
1307
+ if ( $this->data === false ) return false;
1308
+ }
1309
+ return true;
1310
+ }
1311
+
1312
+ /**
1313
+ * Save changes, or new file and/or data
1314
+ * @param file file to save to
1315
+ * @param data 2D array with data
1316
+ * @param append append current data to end of target CSV if exists
1317
+ * @param fields field names
1318
+ * @return true or false
1319
+ */
1320
+ function save ($file = null, $data = array(), $append = false, $fields = array()) {
1321
+ if ( empty($file) ) $file = &$this->file;
1322
+ $mode = ( $append ) ? 'at' : 'wt' ;
1323
+ $is_php = ( preg_match('/\.php$/i', $file) ) ? true : false ;
1324
+ return $this->_wfile($file, $this->unparse($data, $fields, $append, $is_php), $mode);
1325
+ }
1326
+
1327
+ /**
1328
+ * Generate CSV based string for output
1329
+ * @param filename if specified, headers and data will be output directly to browser as a downloable file
1330
+ * @param data 2D array with data
1331
+ * @param fields field names
1332
+ * @param delimiter delimiter used to separate data
1333
+ * @return CSV data using delimiter of choice, or default
1334
+ */
1335
+ function output ($filename = null, $data = array(), $fields = array(), $delimiter = null) {
1336
+ if ( empty($filename) ) $filename = $this->output_filename;
1337
+ if ( $delimiter === null ) $delimiter = $this->output_delimiter;
1338
+ $data = $this->unparse($data, $fields, null, null, $delimiter);
1339
+ if ( $filename !== null ) {
1340
+ header('Content-type: application/csv');
1341
+ header('Content-Disposition: attachment; filename="'.$filename.'"');
1342
+ echo $data;
1343
+ }
1344
+ return $data;
1345
+ }
1346
+
1347
+ /**
1348
+ * Convert character encoding
1349
+ * @param input input character encoding, uses default if left blank
1350
+ * @param output output character encoding, uses default if left blank
1351
+ * @return nothing
1352
+ */
1353
+ function encoding ($input = null, $output = null) {
1354
+ $this->convert_encoding = true;
1355
+ if ( $input !== null ) $this->input_encoding = $input;
1356
+ if ( $output !== null ) $this->output_encoding = $output;
1357
+ }
1358
+
1359
+ /**
1360
+ * Auto-Detect Delimiter: Find delimiter by analyzing a specific number of
1361
+ * rows to determine most probable delimiter character
1362
+ * @param file local CSV file
1363
+ * @param parse true/false parse file directly
1364
+ * @param search_depth number of rows to analyze
1365
+ * @param preferred preferred delimiter characters
1366
+ * @param enclosure enclosure character, default is double quote (").
1367
+ * @return delimiter character
1368
+ */
1369
+ function auto ($file = null, $parse = true, $search_depth = null, $preferred = null, $enclosure = null) {
1370
+
1371
+ if ( $file === null ) $file = $this->file;
1372
+ if ( empty($search_depth) ) $search_depth = $this->auto_depth;
1373
+ if ( $enclosure === null ) $enclosure = $this->enclosure;
1374
+
1375
+ if ( $preferred === null ) $preferred = $this->auto_preferred;
1376
+
1377
+ if ( empty($this->file_data) ) {
1378
+ if ( $this->_check_data($file) ) {
1379
+ $data = &$this->file_data;
1380
+ } else return false;
1381
+ } else {
1382
+ $data = &$this->file_data;
1383
+ }
1384
+
1385
+ $chars = array();
1386
+ $strlen = strlen($data);
1387
+ $enclosed = false;
1388
+ $n = 1;
1389
+ $to_end = true;
1390
+
1391
+ // walk specific depth finding posssible delimiter characters
1392
+ for ( $i=0; $i < $strlen; $i++ ) {
1393
+ $ch = $data{$i};
1394
+ $nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
1395
+ $pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
1396
+
1397
+ // open and closing quotes
1398
+ if ( $ch == $enclosure ) {
1399
+ if ( !$enclosed || $nch != $enclosure ) {
1400
+ $enclosed = ( $enclosed ) ? false : true ;
1401
+ } elseif ( $enclosed ) {
1402
+ $i++;
1403
+ }
1404
+
1405
+ // end of row
1406
+ } elseif ( ($ch == "\n" && $pch != "\r" || $ch == "\r") && !$enclosed ) {
1407
+ if ( $n >= $search_depth ) {
1408
+ $strlen = 0;
1409
+ $to_end = false;
1410
+ } else {
1411
+ $n++;
1412
+ }
1413
+
1414
+ // count character
1415
+ } elseif (!$enclosed) {
1416
+ if ( !preg_match('/['.preg_quote($this->auto_non_chars, '/').']/i', $ch) ) {
1417
+ if ( !isset($chars[$ch][$n]) ) {
1418
+ $chars[$ch][$n] = 1;
1419
+ } else {
1420
+ $chars[$ch][$n]++;
1421
+ }
1422
+ }
1423
+ }
1424
+ }
1425
+
1426
+ // filtering
1427
+ $depth = ( $to_end ) ? $n-1 : $n ;
1428
+ $filtered = array();
1429
+ foreach( $chars as $char => $value ) {
1430
+ if ( $match = $this->_check_count($char, $value, $depth, $preferred) ) {
1431
+ $filtered[$match] = $char;
1432
+ }
1433
+ }
1434
+
1435
+ // capture most probable delimiter
1436
+ ksort($filtered);
1437
+ $this->delimiter = reset($filtered);
1438
+
1439
+ // parse data
1440
+ if ( $parse ) $this->data = $this->parse_string();
1441
+
1442
+ return $this->delimiter;
1443
+
1444
+ }
1445
+
1446
+
1447
+ // ==============================================
1448
+ // ----- [ Core Functions ] ---------------------
1449
+ // ==============================================
1450
+
1451
+ /**
1452
+ * Read file to string and call parse_string()
1453
+ * @param file local CSV file
1454
+ * @return 2D array with CSV data, or false on failure
1455
+ */
1456
+ function parse_file ($file = null) {
1457
+ if ( $file === null ) $file = $this->file;
1458
+ if ( empty($this->file_data) ) $this->load_data($file);
1459
+ return ( !empty($this->file_data) ) ? $this->parse_string() : false ;
1460
+ }
1461
+
1462
+ /**
1463
+ * Parse CSV strings to arrays
1464
+ * @param data CSV string
1465
+ * @return 2D array with CSV data, or false on failure
1466
+ */
1467
+ function parse_string ($data = null) {
1468
+ if ( empty($data) ) {
1469
+ if ( $this->_check_data() ) {
1470
+ $data = &$this->file_data;
1471
+ } else return false;
1472
+ }
1473
+
1474
+ $white_spaces = str_replace($this->delimiter, '', " \t\x0B\0");
1475
+
1476
+ $rows = array();
1477
+ $row = array();
1478
+ $row_count = 0;
1479
+ $current = '';
1480
+ $head = ( !empty($this->fields) ) ? $this->fields : array() ;
1481
+ $col = 0;
1482
+ $enclosed = false;
1483
+ $was_enclosed = false;
1484
+ $strlen = strlen($data);
1485
+
1486
+ // walk through each character
1487
+ for ( $i=0; $i < $strlen; $i++ ) {
1488
+ $ch = $data{$i};
1489
+ $nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
1490
+ $pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
1491
+
1492
+ // open/close quotes, and inline quotes
1493
+ if ( $ch == $this->enclosure ) {
1494
+ if ( !$enclosed ) {
1495
+ if ( ltrim($current, $white_spaces) == '' ) {
1496
+ $enclosed = true;
1497
+ $was_enclosed = true;
1498
+ } else {
1499
+ $this->error = 2;
1500
+ $error_row = count($rows) + 1;
1501
+ $error_col = $col + 1;
1502
+ if ( !isset($this->error_info[$error_row.'-'.$error_col]) ) {
1503
+ $this->error_info[$error_row.'-'.$error_col] = array(
1504
+ 'type' => 2,
1505
+ 'info' => 'Syntax error found on row '.$error_row.'. Non-enclosed fields can not contain double-quotes.',
1506
+ 'row' => $error_row,
1507
+ 'field' => $error_col,
1508
+ 'field_name' => (!empty($head[$col])) ? $head[$col] : null,
1509
+ );
1510
+ }
1511
+ $current .= $ch;
1512
+ }
1513
+ } elseif ($nch == $this->enclosure) {
1514
+ $current .= $ch;
1515
+ $i++;
1516
+ } elseif ( $nch != $this->delimiter && $nch != "\r" && $nch != "\n" ) {
1517
+ for ( $x=($i+1); isset($data{$x}) && ltrim($data{$x}, $white_spaces) == ''; $x++ ) {}
1518
+ if ( $data{$x} == $this->delimiter ) {
1519
+ $enclosed = false;
1520
+ $i = $x;
1521
+ } else {
1522
+ if ( $this->error < 1 ) {
1523
+ $this->error = 1;
1524
+ }
1525
+ $error_row = count($rows) + 1;
1526
+ $error_col = $col + 1;
1527
+ if ( !isset($this->error_info[$error_row.'-'.$error_col]) ) {
1528
+ $this->error_info[$error_row.'-'.$error_col] = array(
1529
+ 'type' => 1,
1530
+ 'info' =>
1531
+ 'Syntax error found on row '.(count($rows) + 1).'. '.
1532
+ 'A single double-quote was found within an enclosed string. '.
1533
+ 'Enclosed double-quotes must be escaped with a second double-quote.',
1534
+ 'row' => count($rows) + 1,
1535
+ 'field' => $col + 1,
1536
+ 'field_name' => (!empty($head[$col])) ? $head[$col] : null,
1537
+ );
1538
+ }
1539
+ $current .= $ch;
1540
+ $enclosed = false;
1541
+ }
1542
+ } else {
1543
+ $enclosed = false;
1544
+ }
1545
+
1546
+ // end of field/row
1547
+ } elseif ( ($ch == $this->delimiter || $ch == "\n" || $ch == "\r") && !$enclosed ) {
1548
+ $key = ( !empty($head[$col]) ) ? $head[$col] : $col ;
1549
+ $row[$key] = ( $was_enclosed ) ? $current : trim($current) ;
1550
+ $current = '';
1551
+ $was_enclosed = false;
1552
+ $col++;
1553
+
1554
+ // end of row
1555
+ if ( $ch == "\n" || $ch == "\r" ) {
1556
+ if ( $this->_validate_offset($row_count) && $this->_validate_row_conditions($row, $this->conditions) ) {
1557
+ if ( $this->heading && empty($head) ) {
1558
+ $head = $row;
1559
+ } elseif ( empty($this->fields) || (!empty($this->fields) && (($this->heading && $row_count > 0) || !$this->heading)) ) {
1560
+ if ( !empty($this->sort_by) && !empty($row[$this->sort_by]) ) {
1561
+ if ( isset($rows[$row[$this->sort_by]]) ) {
1562
+ $rows[$row[$this->sort_by].'_0'] = &$rows[$row[$this->sort_by]];
1563
+ unset($rows[$row[$this->sort_by]]);
1564
+ for ( $sn=1; isset($rows[$row[$this->sort_by].'_'.$sn]); $sn++ ) {}
1565
+ $rows[$row[$this->sort_by].'_'.$sn] = $row;
1566
+ } else $rows[$row[$this->sort_by]] = $row;
1567
+ } else $rows[] = $row;
1568
+ }
1569
+ }
1570
+ $row = array();
1571
+ $col = 0;
1572
+ $row_count++;
1573
+ if ( $this->sort_by === null && $this->limit !== null && count($rows) == $this->limit ) {
1574
+ $i = $strlen;
1575
+ }
1576
+ if ( $ch == "\r" && $nch == "\n" ) $i++;
1577
+ }
1578
+
1579
+ // append character to current field
1580
+ } else {
1581
+ $current .= $ch;
1582
+ }
1583
+ }
1584
+ $this->titles = $head;
1585
+ if ( !empty($this->sort_by) ) {
1586
+ $sort_type = SORT_REGULAR;
1587
+ if ( $this->sort_type == 'numeric' ) {
1588
+ $sort_type = SORT_NUMERIC;
1589
+ } elseif ( $this->sort_type == 'string' ) {
1590
+ $sort_type = SORT_STRING;
1591
+ }
1592
+ ( $this->sort_reverse ) ? krsort($rows, $sort_type) : ksort($rows, $sort_type) ;
1593
+ if ( $this->offset !== null || $this->limit !== null ) {
1594
+ $rows = array_slice($rows, ($this->offset === null ? 0 : $this->offset) , $this->limit, true);
1595
+ }
1596
+ }
1597
+ if ( !$this->keep_file_data ) {
1598
+ $this->file_data = null;
1599
+ }
1600
+ return $rows;
1601
+ }
1602
+
1603
+ /**
1604
+ * Create CSV data from array
1605
+ * @param data 2D array with data
1606
+ * @param fields field names
1607
+ * @param append if true, field names will not be output
1608
+ * @param is_php if a php die() call should be put on the first
1609
+ * line of the file, this is later ignored when read.
1610
+ * @param delimiter field delimiter to use
1611
+ * @return CSV data (text string)
1612
+ */
1613
+ function unparse ( $data = array(), $fields = array(), $append = false , $is_php = false, $delimiter = null) {
1614
+ if ( !is_array($data) || empty($data) ) $data = &$this->data;
1615
+ if ( !is_array($fields) || empty($fields) ) $fields = &$this->titles;
1616
+ if ( $delimiter === null ) $delimiter = $this->delimiter;
1617
+
1618
+ $string = ( $is_php ) ? "<?php header('Status: 403'); die(' '); ?>".$this->linefeed : '' ;
1619
+ $entry = array();
1620
+
1621
+ // create heading
1622
+ if ( $this->heading && !$append && !empty($fields) ) {
1623
+ foreach( $fields as $key => $value ) {
1624
+ $entry[] = $this->_enclose_value($value);
1625
+ }
1626
+ $string .= implode($delimiter, $entry).$this->linefeed;
1627
+ $entry = array();
1628
+ }
1629
+
1630
+ // create data
1631
+ foreach( $data as $key => $row ) {
1632
+ foreach( $row as $field => $value ) {
1633
+ $entry[] = $this->_enclose_value($value);
1634
+ }
1635
+ $string .= implode($delimiter, $entry).$this->linefeed;
1636
+ $entry = array();
1637
+ }
1638
+
1639
+ return $string;
1640
+ }
1641
+
1642
+ /**
1643
+ * Load local file or string
1644
+ * @param input local CSV file
1645
+ * @return true or false
1646
+ */
1647
+ function load_data ($input = null) {
1648
+ $data = null;
1649
+ $file = null;
1650
+ if ( $input === null ) {
1651
+ $file = $this->file;
1652
+ } elseif ( file_exists($input) ) {
1653
+ $file = $input;
1654
+ } else {
1655
+ $data = $input;
1656
+ }
1657
+ if ( !empty($data) || $data = $this->_rfile($file) ) {
1658
+ if ( $this->file != $file ) $this->file = $file;
1659
+ if ( preg_match('/\.php$/i', $file) && preg_match('/<\?.*?\?>(.*)/ims', $data, $strip) ) {
1660
+ $data = ltrim($strip[1]);
1661
+ }
1662
+ if ( $this->convert_encoding ) $data = iconv($this->input_encoding, $this->output_encoding, $data);
1663
+ if ( substr($data, -1) != "\n" ) $data .= "\n";
1664
+ $this->file_data = &$data;
1665
+ return true;
1666
+ }
1667
+ return false;
1668
+ }
1669
+
1670
+
1671
+ // ==============================================
1672
+ // ----- [ Internal Functions ] -----------------
1673
+ // ==============================================
1674
+
1675
+ /**
1676
+ * Validate a row against specified conditions
1677
+ * @param row array with values from a row
1678
+ * @param conditions specified conditions that the row must match
1679
+ * @return true of false
1680
+ */
1681
+ function _validate_row_conditions ($row = array(), $conditions = null) {
1682
+ if ( !empty($row) ) {
1683
+ if ( !empty($conditions) ) {
1684
+ $conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
1685
+ $or = '';
1686
+ foreach( $conditions as $key => $value ) {
1687
+ if ( strpos($value, ' AND ') !== false ) {
1688
+ $value = explode(' AND ', $value);
1689
+ $and = '';
1690
+ foreach( $value as $k => $v ) {
1691
+ $and .= $this->_validate_row_condition($row, $v);
1692
+ }
1693
+ $or .= (strpos($and, '0') !== false) ? '0' : '1' ;
1694
+ } else {
1695
+ $or .= $this->_validate_row_condition($row, $value);
1696
+ }
1697
+ }
1698
+ return (strpos($or, '1') !== false) ? true : false ;
1699
+ }
1700
+ return true;
1701
+ }
1702
+ return false;
1703
+ }
1704
+
1705
+ /**
1706
+ * Validate a row against a single condition
1707
+ * @param row array with values from a row
1708
+ * @param condition specified condition that the row must match
1709
+ * @return true of false
1710
+ */
1711
+ function _validate_row_condition ($row, $condition) {
1712
+ $operators = array(
1713
+ '=', 'equals', 'is',
1714
+ '!=', 'is not',
1715
+ '<', 'is less than',
1716
+ '>', 'is greater than',
1717
+ '<=', 'is less than or equals',
1718
+ '>=', 'is greater than or equals',
1719
+ 'contains',
1720
+ 'does not contain',
1721
+ );
1722
+ $operators_regex = array();
1723
+ foreach( $operators as $value ) {
1724
+ $operators_regex[] = preg_quote($value, '/');
1725
+ }
1726
+ $operators_regex = implode('|', $operators_regex);
1727
+ if ( preg_match('/^(.+) ('.$operators_regex.') (.+)$/i', trim($condition), $capture) ) {
1728
+ $field = $capture[1];
1729
+ $op = $capture[2];
1730
+ $value = $capture[3];
1731
+ if ( preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/i', $value, $capture) ) {
1732
+ if ( $capture[1] == $capture[3] ) {
1733
+ $value = $capture[2];
1734
+ $value = str_replace("\\n", "\n", $value);
1735
+ $value = str_replace("\\r", "\r", $value);
1736
+ $value = str_replace("\\t", "\t", $value);
1737
+ $value = stripslashes($value);
1738
+ }
1739
+ }
1740
+ if ( array_key_exists($field, $row) ) {
1741
+ if ( ($op == '=' || $op == 'equals' || $op == 'is') && $row[$field] == $value ) {
1742
+ return '1';
1743
+ } elseif ( ($op == '!=' || $op == 'is not') && $row[$field] != $value ) {
1744
+ return '1';
1745
+ } elseif ( ($op == '<' || $op == 'is less than' ) && $row[$field] < $value ) {
1746
+ return '1';
1747
+ } elseif ( ($op == '>' || $op == 'is greater than') && $row[$field] > $value ) {
1748
+ return '1';
1749
+ } elseif ( ($op == '<=' || $op == 'is less than or equals' ) && $row[$field] <= $value ) {
1750
+ return '1';
1751
+ } elseif ( ($op == '>=' || $op == 'is greater than or equals') && $row[$field] >= $value ) {
1752
+ return '1';
1753
+ } elseif ( $op == 'contains' && preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
1754
+ return '1';
1755
+ } elseif ( $op == 'does not contain' && !preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
1756
+ return '1';
1757
+ } else {
1758
+ return '0';
1759
+ }
1760
+ }
1761
+ }
1762
+ return '1';
1763
+ }
1764
+
1765
+ /**
1766
+ * Validates if the row is within the offset or not if sorting is disabled
1767
+ * @param current_row the current row number being processed
1768
+ * @return true of false
1769
+ */
1770
+ function _validate_offset ($current_row) {
1771
+ if ( $this->sort_by === null && $this->offset !== null && $current_row < $this->offset ) return false;
1772
+ return true;
1773
+ }
1774
+
1775
+ /**
1776
+ * Enclose values if needed
1777
+ * - only used by unparse()
1778
+ * @param value string to process
1779
+ * @return Processed value
1780
+ */
1781
+ function _enclose_value ($value = null) {
1782
+ if ( $value !== null && $value != '' ) {
1783
+ $delimiter = preg_quote($this->delimiter, '/');
1784
+ $enclosure = preg_quote($this->enclosure, '/');
1785
+ if ( preg_match("/".$delimiter."|".$enclosure."|\n|\r/i", $value) || ($value{0} == ' ' || substr($value, -1) == ' ') ) {
1786
+ $value = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $value);
1787
+ $value = $this->enclosure.$value.$this->enclosure;
1788
+ }
1789
+ }
1790
+ return $value;
1791
+ }
1792
+
1793
+ /**
1794
+ * Check file data
1795
+ * @param file local filename
1796
+ * @return true or false
1797
+ */
1798
+ function _check_data ($file = null) {
1799
+ if ( empty($this->file_data) ) {
1800
+ if ( $file === null ) $file = $this->file;
1801
+ return $this->load_data($file);
1802
+ }
1803
+ return true;
1804
+ }
1805
+
1806
+
1807
+ /**
1808
+ * Check if passed info might be delimiter
1809
+ * - only used by find_delimiter()
1810
+ * @return special string used for delimiter selection, or false
1811
+ */
1812
+ function _check_count ($char, $array, $depth, $preferred) {
1813
+ if ( $depth == count($array) ) {
1814
+ $first = null;
1815
+ $equal = null;
1816
+ $almost = false;
1817
+ foreach( $array as $key => $value ) {
1818
+ if ( $first == null ) {
1819
+ $first = $value;
1820
+ } elseif ( $value == $first && $equal !== false) {
1821
+ $equal = true;
1822
+ } elseif ( $value == $first+1 && $equal !== false ) {
1823
+ $equal = true;
1824
+ $almost = true;
1825
+ } else {
1826
+ $equal = false;
1827
+ }
1828
+ }
1829
+ if ( $equal ) {
1830
+ $match = ( $almost ) ? 2 : 1 ;
1831
+ $pref = strpos($preferred, $char);
1832
+ $pref = ( $pref !== false ) ? str_pad($pref, 3, '0', STR_PAD_LEFT) : '999' ;
1833
+ return $pref.$match.'.'.(99999 - str_pad($first, 5, '0', STR_PAD_LEFT));
1834
+ } else return false;
1835
+ }
1836
+ }
1837
+
1838
+ /**
1839
+ * Read local file
1840
+ * @param file local filename
1841
+ * @return Data from file, or false on failure
1842
+ */
1843
+ function _rfile ($file = null) {
1844
+ if ( is_readable($file) ) {
1845
+ if ( !($fh = fopen($file, 'r')) ) return false;
1846
+ $data = fread($fh, filesize($file));
1847
+ fclose($fh);
1848
+ return $data;
1849
+ }
1850
+ return false;
1851
+ }
1852
+
1853
+ /**
1854
+ * Write to local file
1855
+ * @param file local filename
1856
+ * @param string data to write to file
1857
+ * @param mode fopen() mode
1858
+ * @param lock flock() mode
1859
+ * @return true or false
1860
+ */
1861
+ function _wfile ($file, $string = '', $mode = 'wb', $lock = 2) {
1862
+ if ( $fp = fopen($file, $mode) ) {
1863
+ flock($fp, $lock);
1864
+ $re = fwrite($fp, $string);
1865
+ $re2 = fclose($fp);
1866
+ if ( $re != false && $re2 != false ) return true;
1867
+ }
1868
+ return false;
1869
+ }
1870
+
1871
+ }
1872
+
index.php CHANGED
@@ -2,7 +2,7 @@
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
- * Version: 3.6.6
6
  * Author: smackcoders.com
7
  * Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
8
  * Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
@@ -44,14 +44,38 @@
44
  * "Copyright Smackcoders. 2014. All rights reserved".
45
  ********************************************************************************/
46
 
47
- ini_set('display_errors', 'Off');
48
- ob_start();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html');
51
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
52
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
53
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
54
- define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.6.6');
55
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
56
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
57
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
@@ -60,6 +84,7 @@ if (!class_exists('SkinnyControllerWPCsvFree')) {
60
  require_once('lib/skinnymvc/controller/SkinnyController.php');
61
  }
62
 
 
63
  require_once('plugins/class.inlineimages.php');
64
  require_once('includes/WPImporter_includes_helper.php');
65
 
@@ -68,26 +93,31 @@ register_activation_hook(__FILE__, array('WPImporter_includes_helper', 'activate
68
  register_deactivation_hook(__FILE__, array('WPImporter_includes_helper', 'deactivate'));
69
 
70
  function action_csv_imp_admin_menu() {
71
- if(!function_exists('wp_get_current_user')) {
72
  include(ABSPATH . "wp-includes/pluggable.php");
73
  }
74
- if(is_multisite()) {
75
- if ( current_user_can( 'administrator' ) ) {
76
- add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
77
- }
78
-
79
- }
80
- else {
81
- if ( current_user_can( 'author' ) ) {
82
- $HelperObj = new WPImporter_includes_helper();
83
- $settings = $HelperObj->getSettings();
84
- if(isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') {
85
- add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, '2', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
 
 
 
 
 
 
 
 
86
  }
87
- } else if ( current_user_can( 'administrator' ) ) {
88
- add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
89
  }
90
- }
91
  }
92
  add_action("admin_menu" , "action_csv_imp_admin_menu");
93
 
@@ -124,6 +154,20 @@ function action_csv_imp_admin_init() {
124
  }
125
 
126
  add_action('admin_init', 'action_csv_imp_admin_init');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  function firstchart() {
128
  require_once("modules/dashboard/actions/chartone.php");
129
  die();
@@ -183,7 +227,7 @@ function linetwoStats() {
183
 
184
  function wpcsvimporter_add_dashboard_widgets() {
185
 
186
- wp_enqueue_script('dashpiechart', plugins_url('js/dashchart.js', __FILE__));
187
  wp_enqueue_script('high_chart', plugins_url('js/highcharts.js', __FILE__));
188
  wp_enqueue_script('export_module', plugins_url('js/exporting.js', __FILE__));
189
  wp_enqueue_script('pie_chart', plugins_url('js/highcharts-3d.js', __FILE__));
@@ -193,24 +237,12 @@ function wpcsvimporter_add_dashboard_widgets() {
193
 
194
  add_action('wp_dashboard_setup', 'wpcsvimporter_add_dashboard_widgets');
195
 
196
-
 
 
197
  function importByRequest() {
198
  require_once("templates/import.php");
199
  die;
200
  }
201
-
202
  add_action('wp_ajax_importByRequest', 'importByRequest');
203
 
204
- add_action('init', 'myStartSession', 1);
205
- add_action('wp_logout', 'myEndSession');
206
- add_action('wp_login', 'myEndSession');
207
-
208
- function myStartSession() {
209
- if (!session_id()) {
210
- session_start();
211
- }
212
- }
213
-
214
- function myEndSession() {
215
- session_destroy();
216
- }
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
+ * Version: 3.6.75
6
  * Author: smackcoders.com
7
  * Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
8
  * Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
44
  * "Copyright Smackcoders. 2014. All rights reserved".
45
  ********************************************************************************/
46
 
47
+ $get_debug_mode = get_option('wpcsvfreesettings');
48
+ if(isset($get_debug_mode['debug_mode']) && $get_debug_mode['debug_mode'] != 'enable_debug') {
49
+ error_reporting(0);
50
+ ini_set('display_errors', 'Off');
51
+ }
52
+
53
+ @ob_start();
54
+ add_action('init', 'myStartSession', 1);
55
+ add_action('wp_logout', 'myEndSession');
56
+ add_action('wp_login', 'myEndSession');
57
+ /**
58
+ * To Start Session
59
+ */
60
+ function myStartSession() {
61
+ if (!session_id()) {
62
+ session_start();
63
+ }
64
+ }
65
+ /**
66
+ * To Destroy session
67
+ */
68
+ function myEndSession() {
69
+ session_destroy();
70
+ }
71
+ if ( empty( $GLOBALS['wp_rewrite'] ) )
72
+ $GLOBALS['wp_rewrite'] = new WP_Rewrite();
73
 
74
  define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html');
75
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
76
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
77
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
78
+ define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.6.75');
79
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
80
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
81
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
84
  require_once('lib/skinnymvc/controller/SkinnyController.php');
85
  }
86
 
87
+
88
  require_once('plugins/class.inlineimages.php');
89
  require_once('includes/WPImporter_includes_helper.php');
90
 
93
  register_deactivation_hook(__FILE__, array('WPImporter_includes_helper', 'deactivate'));
94
 
95
  function action_csv_imp_admin_menu() {
96
+ if(!function_exists('wp_get_current_user')) {
97
  include(ABSPATH . "wp-includes/pluggable.php");
98
  }
99
+ if(is_multisite()) {
100
+ if ( current_user_can( 'administrator' ) ) {
101
+ add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
102
+ } else if ( current_user_can( 'author' ) || current_user_can( 'editor' ) ) {
103
+ $HelperObj = new WPImporter_includes_helper();
104
+ $settings = $HelperObj->getSettings();
105
+ if(isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') {
106
+ add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, '2', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
107
+ }
108
+ }
109
+ }
110
+ else {
111
+ if ( current_user_can( 'author' ) || current_user_can( 'editor' ) ) {
112
+ $HelperObj = new WPImporter_includes_helper();
113
+ $settings = $HelperObj->getSettings();
114
+ if(isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') {
115
+ add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, '2', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
116
+ }
117
+ } else if ( current_user_can( 'administrator' ) ) {
118
+ add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
119
  }
 
 
120
  }
 
121
  }
122
  add_action("admin_menu" , "action_csv_imp_admin_menu");
123
 
154
  }
155
 
156
  add_action('admin_init', 'action_csv_imp_admin_init');
157
+
158
+ // Move Pages above Media
159
+ function smackcsvfree_change_menu_order( $menu_order ) {
160
+ return array(
161
+ 'index.php',
162
+ 'edit.php',
163
+ 'edit.php?post_type=page',
164
+ 'upload.php',
165
+ 'wp-ultimate-csv-importer/index.php',
166
+ );
167
+ }
168
+ add_filter( 'custom_menu_order', '__return_true' );
169
+ add_filter( 'menu_order', 'smackcsvfree_change_menu_order' );
170
+
171
  function firstchart() {
172
  require_once("modules/dashboard/actions/chartone.php");
173
  die();
227
 
228
  function wpcsvimporter_add_dashboard_widgets() {
229
 
230
+ wp_enqueue_script('dashpiechart', plugins_url('js/dashchart-widget.js', __FILE__));
231
  wp_enqueue_script('high_chart', plugins_url('js/highcharts.js', __FILE__));
232
  wp_enqueue_script('export_module', plugins_url('js/exporting.js', __FILE__));
233
  wp_enqueue_script('pie_chart', plugins_url('js/highcharts-3d.js', __FILE__));
237
 
238
  add_action('wp_dashboard_setup', 'wpcsvimporter_add_dashboard_widgets');
239
 
240
+ /**
241
+ * To Process the Import
242
+ */
243
  function importByRequest() {
244
  require_once("templates/import.php");
245
  die;
246
  }
 
247
  add_action('wp_ajax_importByRequest', 'importByRequest');
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/dashchart-widget.js ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready(function() {
2
+ pieStats();
3
+ lineStats();
4
+ });
5
+ function pieStats()
6
+ {
7
+ jQuery.ajax({
8
+ type: 'POST',
9
+ url: ajaxurl,
10
+ data: {
11
+ 'action' : 'firstchart',
12
+ 'postdata' : 'firstchartdata',
13
+ },
14
+ dataType: 'json',
15
+ cache: false,
16
+ success: function(data) {
17
+ var browser = JSON.parse(data);
18
+ if (browser['label'] == 'No Imports Yet') {
19
+ document.getElementById('pieStats').innerHTML = "<h2 style='color: red;text-align: center;padding-top: 100px;' >No Imports Yet</h2>";
20
+ return false;
21
+ }
22
+
23
+ jQuery('#pieStats').highcharts({
24
+ chart: {
25
+ type: 'pie',
26
+ options3d: {
27
+ enabled: true,
28
+ alpha: 45,
29
+ beta: 0
30
+ }
31
+ },
32
+ title: {
33
+ text: ''
34
+ },
35
+ tooltip: {
36
+ pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
37
+ },
38
+ plotOptions: {
39
+ pie: {
40
+ allowPointSelect: true,
41
+ cursor: 'pointer',
42
+ depth: 35,
43
+ dataLabels: {
44
+ enabled: true,
45
+ format: '{point.name}'
46
+ }
47
+ }
48
+ },
49
+ series: [{
50
+ type: 'pie',
51
+ name: 'overall statistics',
52
+ // data: JSON.parse(data),
53
+ data: browser
54
+ }]
55
+ });
56
+ }
57
+ });
58
+ }
59
+ function lineStats()
60
+ {
61
+ jQuery.ajax({
62
+ type: 'POST',
63
+ url: ajaxurl,
64
+ data: {
65
+ 'action' : 'secondchart',
66
+ 'postdata' : 'secondchartdata',
67
+ },
68
+ dataType: 'json',
69
+ cache: false,
70
+ success: function(data) {
71
+ var val = JSON.parse(data);
72
+ var line = [val[0],val[1],val[2],val[3],val[4],val[5]];
73
+ jQuery('#lineStats').highcharts({
74
+ title: {
75
+ text: '',
76
+ x: -5 //center
77
+ },
78
+ subtitle: {
79
+ text: '',
80
+ x: -5
81
+ },
82
+ xAxis: {
83
+ categories:val.cat
84
+ },
85
+ yAxis: {
86
+ title: {
87
+ text: 'Import (Nos)'
88
+ },
89
+ plotLines: [{
90
+ value: 0,
91
+ width: 1,
92
+ color: '#808080'
93
+ }]
94
+ },
95
+ tooltip: {
96
+ valueSuffix: ' Nos'
97
+ },
98
+ legend: {
99
+ layout: 'vertical',
100
+ align: 'right',
101
+ verticalAlign: 'middle',
102
+ borderWidth: 0
103
+ },
104
+ series:line });
105
+ }
106
+ });
107
+ }
108
+
109
+
js/dashchart.js CHANGED
@@ -1,6 +1,9 @@
1
  jQuery( document ).ready(function() {
2
- pieStats();
3
- lineStats();
 
 
 
4
  });
5
  function pieStats()
6
  {
@@ -14,12 +17,12 @@ jQuery.ajax({
14
  dataType: 'json',
15
  cache: false,
16
  success: function(data) {
17
-
18
  var browser = JSON.parse(data);
19
  if (browser['label'] == 'No Imports Yet') {
20
  document.getElementById('pieStats').innerHTML = "<h2 style='color: red;text-align: center;padding-top: 100px;' >No Imports Yet</h2>";
21
  return false;
22
  }
 
23
  jQuery('#pieStats').highcharts({
24
  chart: {
25
  type: 'pie',
1
  jQuery( document ).ready(function() {
2
+ var get_module = document.getElementById('checkmodule').value;
3
+ if(get_module == 'dashboard') {
4
+ pieStats();
5
+ lineStats();
6
+ }
7
  });
8
  function pieStats()
9
  {
17
  dataType: 'json',
18
  cache: false,
19
  success: function(data) {
 
20
  var browser = JSON.parse(data);
21
  if (browser['label'] == 'No Imports Yet') {
22
  document.getElementById('pieStats').innerHTML = "<h2 style='color: red;text-align: center;padding-top: 100px;' >No Imports Yet</h2>";
23
  return false;
24
  }
25
+
26
  jQuery('#pieStats').highcharts({
27
  chart: {
28
  type: 'pie',
js/ultimate-importer-free.js CHANGED
@@ -7,8 +7,8 @@ jQuery( document ).ready(function() {
7
  document.getElementById('log').innerHTML = '<p style="margin:15px;color:red;">NO LOGS YET NOW.</p>';
8
  }
9
 
10
- pieStats();
11
- lineStats();
12
 
13
 
14
  }
@@ -374,26 +374,26 @@ function import_csv()
374
  if (array[j] == 'post_title') {
375
  val1 = 'On';
376
  }
377
- if (array[j] == 'post_content') {
378
  val2 = 'On';
379
- }
380
  if (post_status_msg == 'Off') {
381
  if (array[j] == 'post_status')
382
  post_status_msg = 'On';
383
  }
384
  }
385
- if (importer != 'custompost' && val1 == 'On' && val2 == 'On' && post_status_msg == 'On') {
386
  return true;
387
  }
388
- else if (importer == 'custompost' && val1 == 'On' && val2 == 'On' && post_status_msg == 'On' && post_type=='On') {
389
  return true;
390
  }
391
  else {
392
  error_msg = '';
393
  if (val1 == 'Off')
394
- error_msg += " post_title,";
395
- if (val2 == 'Off')
396
- error_msg += " post_content,";
397
  if(importer == 'custompost') {
398
  if (SelectedIndex == 'select')
399
  error_msg += " post_type,";
@@ -566,13 +566,13 @@ function importRecordsbySettings(siteurl)
566
  return false;
567
  }
568
  if(get_log == '<p style="margin:15px;color:red;">NO LOGS YET NOW.</p>'){
569
- document.getElementById('log').innerHTML = '<p style="margin:15px;color:red;">Your Import Is In Progress...</p>';
570
  document.getElementById('startbutton').disabled = true;
571
  }
572
  document.getElementById('ajaxloader').style.display="";
573
  var tempCount = parseInt(tmpCnt);
574
  var totalCount = parseInt(tot_no_of_records);
575
- if(tempCount>totalCount){
576
  document.getElementById('ajaxloader').style.display="none";
577
  document.getElementById('startbutton').style.display="none";
578
  document.getElementById('importagain').style.display="";
@@ -605,7 +605,11 @@ function importRecordsbySettings(siteurl)
605
  document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
606
  setTimeout(function(){importRecordsbySettings()},0);
607
  } else {
608
- document.getElementById('log').innerHTML += "Import process has been terminated.</br>";
 
 
 
 
609
  return false;
610
  }
611
  }else{
@@ -628,6 +632,34 @@ function terminateProcess(){
628
  document.getElementById('terminateaction').value = 'terminate';
629
  }
630
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
 
632
  // Enable/Disable WP-e-Commerce Custom Fields
633
  function enablewpcustomfield(val){
@@ -923,7 +955,7 @@ function selectModules(id) {
923
  }
924
  }
925
 
926
- function addwpexportfilter(id) {
927
  if(document.getElementById(id).checked == true) {
928
  if(id == 'getdataforspecificperiod') {
929
  document.getElementById('specificperiodexport').style.display = '';
@@ -968,9 +1000,9 @@ function showsettingsoption(id) {
968
  for(i=1;i<=9;i++) {
969
  if(parseInt(id) == parseInt(i)) {
970
  if(parseInt(i) == 8) {
971
- document.getElementById('sidebar').style.height = '1139px';
972
- document.getElementById('contentbar').style.height = '1139px';
973
- document.getElementById('settingsholder').style.height = '1140px';
974
  } else if(parseInt(i) == 9) {
975
  document.getElementById('sidebar').style.height = '665px';
976
  document.getElementById('contentbar').style.height = '665px';
@@ -991,6 +1023,10 @@ function showsettingsoption(id) {
991
  document.getElementById('sidebar').style.height = '965px';
992
  document.getElementById('contentbar').style.height = '965px';
993
  document.getElementById('settingsholder').style.height = '966px';
 
 
 
 
994
  } else {
995
  document.getElementById('sidebar').style.height = 'auto';
996
  document.getElementById('contentbar').style.height = 'auto';
@@ -1015,7 +1051,7 @@ function showsettingsoption(id) {
1015
 
1016
  //seo setting enable and disable
1017
  function seosetting(id) {
1018
- if(id == 'none') {
1019
  jQuery('#seosetting1').removeClass("disablesetting");
1020
  jQuery('#seosetting1').addClass("enablesetting");
1021
  document.getElementById("seosetting1text").innerHTML="Enabled";
@@ -1408,6 +1444,21 @@ function dropsetting(id) {
1408
  }
1409
  }
1410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1411
  //Ecommerce setting
1412
  function ecommercesetting(id) {
1413
  if(id == 'nonerecommerce') {
7
  document.getElementById('log').innerHTML = '<p style="margin:15px;color:red;">NO LOGS YET NOW.</p>';
8
  }
9
 
10
+ //pieStats();
11
+ //lineStats();
12
 
13
 
14
  }
374
  if (array[j] == 'post_title') {
375
  val1 = 'On';
376
  }
377
+ /* if (array[j] == 'post_content') {
378
  val2 = 'On';
379
+ } */
380
  if (post_status_msg == 'Off') {
381
  if (array[j] == 'post_status')
382
  post_status_msg = 'On';
383
  }
384
  }
385
+ if (importer != 'custompost' && val1 == 'On' && post_status_msg == 'On') {
386
  return true;
387
  }
388
+ else if (importer == 'custompost' && val1 == 'On' && post_status_msg == 'On' && post_type=='On') {
389
  return true;
390
  }
391
  else {
392
  error_msg = '';
393
  if (val1 == 'Off')
394
+ error_msg += " post_title";
395
+ /* if (val2 == 'Off')
396
+ error_msg += " post_content,"; */
397
  if(importer == 'custompost') {
398
  if (SelectedIndex == 'select')
399
  error_msg += " post_type,";
566
  return false;
567
  }
568
  if(get_log == '<p style="margin:15px;color:red;">NO LOGS YET NOW.</p>'){
569
+ document.getElementById('log').innerHTML = '<p style="margin-left:10px;color:red;">Your Import Is In Progress...</p>';
570
  document.getElementById('startbutton').disabled = true;
571
  }
572
  document.getElementById('ajaxloader').style.display="";
573
  var tempCount = parseInt(tmpCnt);
574
  var totalCount = parseInt(tot_no_of_records);
575
+ if(tempCount >= totalCount){
576
  document.getElementById('ajaxloader').style.display="none";
577
  document.getElementById('startbutton').style.display="none";
578
  document.getElementById('importagain').style.display="";
605
  document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
606
  setTimeout(function(){importRecordsbySettings()},0);
607
  } else {
608
+ document.getElementById('log').innerHTML += "<p style='margin-left:10px;color:red;'>Import process has been terminated.</p>";
609
+ document.getElementById('ajaxloader').style.display="none";
610
+ document.getElementById('startbutton').style.display = "none";
611
+ document.getElementById('terminatenow').style.display = "none";
612
+ document.getElementById('continuebutton').style.display = "";
613
  return false;
614
  }
615
  }else{
632
  document.getElementById('terminateaction').value = 'terminate';
633
  }
634
 
635
+ function continueprocess() {
636
+ var tot_no_of_records = document.getElementById('checktotal').value;
637
+ var tmpCnt = document.getElementById('tmpcount').value;
638
+ var currentlimit = document.getElementById('currentlimit').value;
639
+ var importlimit = document.getElementById('importlimit').value;
640
+ // var get_requested_count = importlimit;
641
+ var tot_no_of_records = document.getElementById('checktotal').value;
642
+
643
+ if (parseInt(tmpCnt) > parseInt(tot_no_of_records)) {
644
+ document.getElementById('terminatenow').style.display = "none";
645
+ } else {
646
+ document.getElementById('terminatenow').style.display = "";
647
+ }
648
+ document.getElementById('log').innerHTML += "<div style='margin-left:10px;color:green;'> Import process has been continued.</div></br>";
649
+ document.getElementById('ajaxloader').style.display = "";
650
+ document.getElementById('startbutton').style.display = "";
651
+ document.getElementById('continuebutton').style.display = "none";
652
+ //document.getElementById('dwnld_log_link').style.display = "none";
653
+ document.getElementById('terminateaction').value = 'continue';
654
+ // document.getElementById('currentlimit').value = currentlimit;
655
+ //currentlimit = parseInt(currentlimit)+parseInt(importlimit);
656
+ // console.log('impLmt: '+importlimit+'totRecds: '+tot_no_of_records);
657
+ // document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
658
+
659
+ setTimeout(function () {
660
+ importRecordsbySettings()
661
+ }, 0);
662
+ }
663
 
664
  // Enable/Disable WP-e-Commerce Custom Fields
665
  function enablewpcustomfield(val){
955
  }
956
  }
957
 
958
+ function addexportfilter(id) {
959
  if(document.getElementById(id).checked == true) {
960
  if(id == 'getdataforspecificperiod') {
961
  document.getElementById('specificperiodexport').style.display = '';
1000
  for(i=1;i<=9;i++) {
1001
  if(parseInt(id) == parseInt(i)) {
1002
  if(parseInt(i) == 8) {
1003
+ document.getElementById('sidebar').style.height = '1189px';
1004
+ document.getElementById('contentbar').style.height = '1189px';
1005
+ document.getElementById('settingsholder').style.height = '1190px';
1006
  } else if(parseInt(i) == 9) {
1007
  document.getElementById('sidebar').style.height = '665px';
1008
  document.getElementById('contentbar').style.height = '665px';
1023
  document.getElementById('sidebar').style.height = '965px';
1024
  document.getElementById('contentbar').style.height = '965px';
1025
  document.getElementById('settingsholder').style.height = '966px';
1026
+ } else if(parseInt(i) == 6) {
1027
+ document.getElementById('sidebar').style.height = '565px';
1028
+ document.getElementById('contentbar').style.height = '565px';
1029
+ document.getElementById('settingsholder').style.height = '566px';
1030
  } else {
1031
  document.getElementById('sidebar').style.height = 'auto';
1032
  document.getElementById('contentbar').style.height = 'auto';
1051
 
1052
  //seo setting enable and disable
1053
  function seosetting(id) {
1054
+ if(id == 'nonerseooption') {
1055
  jQuery('#seosetting1').removeClass("disablesetting");
1056
  jQuery('#seosetting1').addClass("enablesetting");
1057
  document.getElementById("seosetting1text").innerHTML="Enabled";
1444
  }
1445
  }
1446
 
1447
+ // Enable / Disable the debug mode
1448
+ function debugmode_check (id) {
1449
+ if(id == 'enabled') {
1450
+ jQuery('#debugmode_enable').removeClass("disablesetting");
1451
+ jQuery('#debugmode_enable').addClass("enablesetting");
1452
+ jQuery('#debugmode_disable').removeClass("enablesetting");
1453
+ jQuery('#debugmode_disable').addClass("disablesetting");
1454
+ } else {
1455
+ jQuery('#debugmode_disable').removeClass("disablesetting");
1456
+ jQuery('#debugmode_disable').addClass("enablesetting");
1457
+ jQuery('#debugmode_enable').removeClass("enablesetting");
1458
+ jQuery('#debugmode_enable').addClass("disablesetting");
1459
+ }
1460
+ }
1461
+
1462
  //Ecommerce setting
1463
  function ecommercesetting(id) {
1464
  if(id == 'nonerecommerce') {
modules/comments/templates/index.php CHANGED
@@ -44,8 +44,14 @@
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
48
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
49
  <?php } else { ?>
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
@@ -75,6 +81,7 @@
75
  <select disabled>
76
  <option value ='select template' /> select template </option>
77
  </select>
 
78
  </div>
79
 
80
  </div>
@@ -416,6 +423,7 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
416
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
417
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
418
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
 
419
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
420
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
421
  <div class="clear"></div>
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
+ <?php if(is_dir($impCE->getUploadDirectory('default'))){
48
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
49
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
50
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
51
+ }
52
+ } else { ?>
53
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
54
+ <?php }?>
55
  <?php } else { ?>
56
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
57
  <?php } ?>
81
  <select disabled>
82
  <option value ='select template' /> select template </option>
83
  </select>
84
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
85
  </div>
86
 
87
  </div>
423
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
424
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
425
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
426
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
427
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
428
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
429
  <div class="clear"></div>
modules/custompost/templates/index.php CHANGED
@@ -44,8 +44,14 @@ $impCE = new WPImporter_includes_helper();
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
48
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
49
  <?php } else { ?>
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
@@ -72,6 +78,7 @@ $impCE = new WPImporter_includes_helper();
72
  <select disabled>
73
  <option value ='select template' > select template </option>
74
  </select>
 
75
  </div>
76
 
77
  </div>
@@ -547,6 +554,7 @@ $impCE = new WPImporter_includes_helper();
547
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
548
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
549
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
 
550
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
551
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
552
  <div class="clear"></div>
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
+ <?php if(is_dir($impCE->getUploadDirectory('default'))){
48
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
49
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
50
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
51
+ }
52
+ } else { ?>
53
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
54
+ <?php }?>
55
  <?php } else { ?>
56
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
57
  <?php } ?>
78
  <select disabled>
79
  <option value ='select template' > select template </option>
80
  </select>
81
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
82
  </div>
83
 
84
  </div>
554
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
555
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
556
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
557
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
558
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
559
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
560
  <div class="clear"></div>
modules/dashboard/templates/index.php CHANGED
@@ -79,8 +79,8 @@ if(isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'filenotfound'){
79
  <?php if(isset($_REQUEST['errormsg'])){
80
  ?>
81
  <script type="text/javascript">
82
- showMapMessages('error' , "<?php echo $_REQUEST['errormsg']; ?>")
83
  </script>
84
- <?
85
  }
86
  ?>
79
  <?php if(isset($_REQUEST['errormsg'])){
80
  ?>
81
  <script type="text/javascript">
82
+ showMapMessages('error' , "<?php echo $_REQUEST['errormsg']; ?>");
83
  </script>
84
+ <?php
85
  }
86
  ?>
modules/eshop/actions/actions.php CHANGED
@@ -707,7 +707,7 @@ class EshopActions extends SkinnyActions {
707
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
708
  }
709
  }
710
- $this->detailedLog[$currentLimit]['verify_here'] = "<b>Verify Here -</b> <a href='" . get_permalink( $post_id ) . "' title='" . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $data_array['post_title'] ) ) . "' rel='permalink'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "'>" . __( 'Admin View' ) . "</a>";
711
 
712
  unset($data_array);
713
  }
707
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
708
  }
709
  }
710
+ $this->detailedLog[$currentLimit]['verify_here'] = "<b>Verify Here -</b> <a href='" . get_permalink( $post_id ) . "' title='" . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $data_array['post_title'] ) ) . "' rel='permalink' target='_blank'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "' target='_blank'>" . __( 'Admin View' ) . "</a>";
711
 
712
  unset($data_array);
713
  }
modules/eshop/templates/index.php CHANGED
@@ -46,17 +46,23 @@ $eshopObj->isplugin();
46
  <td>
47
  <h3>CSV Import Options</h3>
48
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
49
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
50
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
51
  <?php } else { ?>
52
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
53
  <?php } ?>
54
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
 
 
 
55
  <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile' enctype="multipart/form-data">
56
  <div class="importfile" align='center'>
57
- <div align=center>
58
- <div id="noPlugin" class="warnings" style="display:none"></div>
59
- </div>
60
  <?php
61
  if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] == 'not_avail') {
62
  ?>
@@ -109,6 +115,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
109
  <select disabled/>
110
  <option value ='select template' > select template </option>
111
  </select>
 
112
  </div>
113
  <!-- code ends here -->
114
  </div>
@@ -532,6 +539,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
532
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings('<?php echo site_url(); ?>');" >
533
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
534
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
 
535
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
536
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
537
 
46
  <td>
47
  <h3>CSV Import Options</h3>
48
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
49
+ <?php if(is_dir($impCE->getUploadDirectory('default'))){
50
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
51
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
52
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
53
+ }
54
+ } else { ?>
55
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
56
+ <?php }?>
57
  <?php } else { ?>
58
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
59
  <?php } ?>
60
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
61
+ <div align=center>
62
+ <div id="noPlugin" class="warnings" style="display:none"></div>
63
+ </div>
64
  <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile' enctype="multipart/form-data">
65
  <div class="importfile" align='center'>
 
 
 
66
  <?php
67
  if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] == 'not_avail') {
68
  ?>
115
  <select disabled/>
116
  <option value ='select template' > select template </option>
117
  </select>
118
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
119
  </div>
120
  <!-- code ends here -->
121
  </div>
539
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings('<?php echo site_url(); ?>');" >
540
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
541
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
542
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
543
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
544
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
545
 
modules/export/actions/actions.php CHANGED
@@ -27,6 +27,9 @@ class ExportActions extends SkinnyActions {
27
  $helper->generateanddownloadcsv($type, $filename);
28
  }
29
  }
 
 
 
30
  return $data;
31
  }
32
 
27
  $helper->generateanddownloadcsv($type, $filename);
28
  }
29
  }
30
+ $nonce = '';
31
+ $nonce = wp_create_nonce('my-nonce');
32
+ $data['wp_nonce'] = $nonce;
33
  return $data;
34
  }
35
 
modules/export/templates/export.php CHANGED
@@ -6,8 +6,20 @@
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
 
 
 
 
9
  require_once('../../../../../../wp-load.php');
10
- require_once('../../../includes/Importer.php');
 
 
 
 
 
 
 
 
 
11
 
12
  $ExportObj = new WPCSVProExportData();
13
  #print('<pre>'); print_r($_POST); //die;
@@ -43,7 +55,7 @@ class WPCSVProExportData {
43
  $this->WPImpExportUsers($request);
44
  }
45
  else {
46
- $this->WPImpFreeExportData($request);#die;
47
  }
48
  }
49
 
@@ -54,6 +66,10 @@ class WPCSVProExportData {
54
  global $wpdb;
55
  $post_type = $exporttype;
56
  $unwantedHeader = array('_eshop_product', '_wp_attached_file', '_wp_page_template', '_wp_attachment_metadata', '_encloseme');
 
 
 
 
57
  if($exporttype == 'eshop')
58
  $post_type = 'post';
59
  if($exporttype == 'custompost') {
@@ -70,10 +86,29 @@ class WPCSVProExportData {
70
  $Header[] = $rhq1_headkey;
71
  }
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
74
  $Header[] = $aioseoval;
75
  $unwantedHeader[] = $aioseokey;
76
  }
 
 
 
 
77
  foreach ($result_header_query2 as $rhq2_headkey) {
78
  if (!in_array($rhq2_headkey->meta_key, $Header)) {
79
  if(!in_array($rhq2_headkey->meta_key, $unwantedHeader)) {
@@ -83,23 +118,60 @@ class WPCSVProExportData {
83
  }
84
 
85
  #print('<pre>'); print_r($Header); die;
86
- if($exporttype == 'eshop') {
87
- foreach($this->EshopHeaders() as $eshop_hkey => $eshop_hval) {
88
- if(in_array($eshop_hval, $Header))
89
- $ProHeader[] = $eshop_hkey;
90
- else
91
- $ProHeader[] = $eshop_hkey;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
-
94
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
95
  $ProHeader[] = $aioseoval;
96
  }
 
 
 
 
 
97
  return $ProHeader;
98
  }
99
- if(!in_array('', $Header) && !in_array('', $Header)){
100
- $Header[] = 'post_tag';
101
- $Header[] = 'post_category';
102
- }
103
  return $Header;
104
  }
105
 
@@ -110,6 +182,10 @@ class WPCSVProExportData {
110
  global $wpdb;
111
  $post_type = $exporttype;
112
  $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID";
 
 
 
 
113
  if($post_type == 'eshop')
114
  $post_type = 'post';
115
  if($post_type == 'custompost')
@@ -140,7 +216,17 @@ class WPCSVProExportData {
140
  }
141
  if($exporttype == 'eshop')
142
  $get_post_ids .= " and pm.meta_key = 'sku'";
 
 
 
 
 
 
143
 
 
 
 
 
144
  if(isset($request['getdatabyspecificauthors'])) {
145
  if(isset($request['postauthor']) && $request['postauthor'] != 0) {
146
  $get_post_ids .= " and p.post_author = {$request['postauthor']}";
@@ -216,6 +302,46 @@ class WPCSVProExportData {
216
  return $result;
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  /**
220
  *
221
  */
@@ -232,27 +358,122 @@ class WPCSVProExportData {
232
  return $aioseofields;
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  /**
236
  *
237
  */
238
  public function getAllTerms($postID, $type) {
239
- // Tags & Categories
240
- $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
241
- $postTags = $postCategory = '';
242
- foreach ($get_tags as $tags) {
243
- $postTags .= $tags . ',';
244
- }
245
- $postTags = substr($postTags, 0, -1);
246
- $TermsData['post_tag'] = $postTags;
247
- $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
248
- foreach ($get_categotries as $category) {
249
- $postCategory .= $category . '|';
250
- }
251
- $postCategory = substr($postCategory, 0, -1);
252
- $TermsData['post_category'] = $postCategory;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  return $TermsData;
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  /**
257
  *
258
  */
@@ -265,7 +486,7 @@ class WPCSVProExportData {
265
  * @param $request
266
  * @return array
267
  */
268
- public function WPImpFreeExportData($request) {
269
  #print('<pre>'); print_r($this->getACFvalues()); die;
270
  global $wpdb;
271
  $export_delimiter = ',';
@@ -289,7 +510,7 @@ class WPCSVProExportData {
289
  $result = $this->get_all_record_ids($exporttype, $request);
290
  #print('<pre>'); print_r($Header); print_r($result); print('</pre>'); die;
291
  $fieldsCount = count($result);
292
- if ($result) {
293
  foreach ($result as $postID) {
294
  $pId = $pId . ',' . $postID;
295
  $PostData[$postID] = $this->getPostDatas($postID);
@@ -339,8 +560,295 @@ class WPCSVProExportData {
339
  }
340
  }
341
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  // Eshop product meta datas starts here
343
- if ($postmeta->meta_key == 'featured') {
344
  $isFeatured = strtolower($postmeta->meta_value);
345
  $PostMetaData[$postmeta->post_id]['featured_product'] = $isFeatured;
346
  }
@@ -412,6 +920,22 @@ class WPCSVProExportData {
412
  }
413
  # print('PostMetaData: '); print('<pre>'); print_r($Header); print_r($PostMetaData); #die;
414
  $TermsData[$postID] = $this->getAllTerms($postID,$exporttype);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  }
416
 
417
  #$ExportData = array();
@@ -434,6 +958,57 @@ class WPCSVProExportData {
434
  }
435
  #print('<pre>'); print_r($Header); die;
436
  #print('<pre>'); print_r($ExportData); die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  if($exporttype == 'eshop') {
438
  foreach($Header as $hkey) {
439
  foreach($ExportData as $edkey => $edval) {
@@ -456,6 +1031,16 @@ class WPCSVProExportData {
456
  $CSVContent[$ED_key][$aioseoval] = $ED_val[$aioseokey];
457
  #unset($CSVContent[$ED_key][$header_key]);
458
  }
 
 
 
 
 
 
 
 
 
 
459
  } else if (array_key_exists($header_key, $ED_val)) {
460
  $CSVContent[$ED_key][$header_key] = $ED_val[$header_key];
461
  } else {
@@ -466,8 +1051,256 @@ class WPCSVProExportData {
466
  }
467
  #print(count($CSVContent[22]));print('<br>' . count($Header));
468
  #print('<pre>'); print_r($CSVContent) ;print('</pre>'); die;
469
- $csv = new ImporterLib();
470
- $csv->wmyuyn_3 ($csv_file_name, $CSVContent, $Header, $export_delimiter);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  }
472
 
473
  /**
@@ -501,8 +1334,8 @@ class WPCSVProExportData {
501
  $i++;
502
  }
503
  #print('<pre>'); print_r($header); print_r($singleCommentContent);die;
504
- $csv = new ImporterLib();
505
- $csv->wmyuyn_3 ($csv_file_name, $ExportData, $Header, $export_delimiter);
506
  }
507
 
508
  /**
@@ -556,7 +1389,7 @@ class WPCSVProExportData {
556
 
557
  $result = $wpdb->get_col($get_user_ids);
558
  $fieldsCount = count($result);
559
- if ($result) {
560
  foreach ($result as $userID) {
561
  $uId = $uId . ',' . $userID;
562
  $query1 = "SELECT *FROM $wpdb->users where ID in ($userID);";
@@ -656,8 +1489,7 @@ class WPCSVProExportData {
656
  }
657
  }
658
  }
659
-
660
- $csv = new ImporterLib();
661
- $csv->wmyuyn_3 ($csv_file_name, $CSVContent, $UserHeader, $export_delimiter);
662
  }
663
  }
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
 
9
+ if(!isset($_SERVER['HTTP_REFERER'])) {
10
+ die('Your requested url were wrong! Please contact your admin.');
11
+ }
12
  require_once('../../../../../../wp-load.php');
13
+
14
+ $nonce = $_POST['nonce'];
15
+ //echo '<pre>'; print_r($sitedomain); echo '</pre>';
16
+ if ( ! wp_verify_nonce( $nonce, 'my-nonce' ) ) {
17
+ // This nonce is not valid.
18
+ die( 'Security check: Your requested URL is wrong! Please, Contact your administrator.' );
19
+ } else {
20
+ // The nonce was valid.
21
+ // Do stuff here.
22
+ }
23
 
24
  $ExportObj = new WPCSVProExportData();
25
  #print('<pre>'); print_r($_POST); //die;
55
  $this->WPImpExportUsers($request);
56
  }
57
  else {
58
+ $this->WPImpPROExportData($request);#die;
59
  }
60
  }
61
 
66
  global $wpdb;
67
  $post_type = $exporttype;
68
  $unwantedHeader = array('_eshop_product', '_wp_attached_file', '_wp_page_template', '_wp_attachment_metadata', '_encloseme');
69
+ if($exporttype == 'woocommerce' || $exporttype == 'marketpress')
70
+ $post_type = 'product';
71
+ if($exporttype == 'wpcommerce')
72
+ $post_type = 'wpsc-product';
73
  if($exporttype == 'eshop')
74
  $post_type = 'post';
75
  if($exporttype == 'custompost') {
86
  $Header[] = $rhq1_headkey;
87
  }
88
  }
89
+ foreach($this->getACFvalues() as $acfKey => $acfVal) {
90
+ $unwantedHeader[] = '_' . $acfKey;
91
+ }
92
+ foreach($this->getACFvalues() as $acfKey => $acfVal) {
93
+ if(!in_array($acfKey, $unwantedHeader)) {
94
+ $Header[] = $acfKey;
95
+ $unwantedHeader[] = $acfKey;
96
+ }
97
+ }
98
+ foreach($this->getTypesFields() as $typeKey => $typeVal) {
99
+ if(!in_array($typeKey, $unwantedHeader)) {
100
+ $Header[] = $typeVal;
101
+ $unwantedHeader[] = $typeKey;
102
+ }
103
+ }
104
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
105
  $Header[] = $aioseoval;
106
  $unwantedHeader[] = $aioseokey;
107
  }
108
+ foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
109
+ $Header[] = $yoastseoval;
110
+ $unwantedHeader[] = $yoastseokey;
111
+ }
112
  foreach ($result_header_query2 as $rhq2_headkey) {
113
  if (!in_array($rhq2_headkey->meta_key, $Header)) {
114
  if(!in_array($rhq2_headkey->meta_key, $unwantedHeader)) {
118
  }
119
 
120
  #print('<pre>'); print_r($Header); die;
121
+ if($exporttype == 'woocommerce' || $exporttype == 'marketpress' || $exporttype == 'wpcommerce' || $exporttype == 'eshop') {
122
+ if($exporttype == 'woocommerce') {
123
+ foreach($this->WoocommerceMetaHeaders() as $woo_hkey => $woo_hval) {
124
+ if(in_array($woo_hval, $Header))
125
+ $ProHeader[] = $woo_hkey;
126
+ else
127
+ $ProHeader[] = $woo_hkey;
128
+ }
129
+ }
130
+ else if($exporttype == 'marketpress') {
131
+ foreach($this->MarketPressHeaders() as $mp_hkey => $mp_hval) {
132
+ if(in_array($mp_hval, $Header))
133
+ $ProHeader[] = $mp_hkey;
134
+ else
135
+ $ProHeader[] = $mp_hkey;
136
+ }
137
+ }
138
+ else if($exporttype == 'wpcommerce') {
139
+ foreach($this->WpeCommerceHeaders() as $wpcom_hkey => $wpcom_hval) {
140
+ if(in_array($wpcom_hval, $Header))
141
+ $ProHeader[] = $wpcom_hkey;
142
+ else
143
+ $ProHeader[] = $wpcom_hkey;
144
+ }
145
+ }
146
+ else if($exporttype == 'eshop') {
147
+ foreach($this->EshopHeaders() as $eshop_hkey => $eshop_hval) {
148
+ if(in_array($eshop_hval, $Header))
149
+ $ProHeader[] = $eshop_hkey;
150
+ else
151
+ $ProHeader[] = $eshop_hkey;
152
+ }
153
+ }
154
+ foreach($this->getACFvalues() as $acfKey => $acfVal) {
155
+ if(!in_array($acfKey, $unwantedHeader)) {
156
+ $ProHeader[] = $acfKey;
157
+ }
158
+ }
159
+ foreach($this->getTypesFields() as $typeKey => $typeVal) {
160
+ if(!in_array($typeKey, $unwantedHeader)) {
161
+ $ProHeader[] = $typeVal;
162
+ }
163
  }
 
164
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
165
  $ProHeader[] = $aioseoval;
166
  }
167
+ foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
168
+ $ProHeader[] = $yoastseoval;
169
+ }
170
+ #print('<pre>'); print_r($ProHeader); die;
171
+ $ProHeader[] = 'featured_image';
172
  return $ProHeader;
173
  }
174
+ $Header[] = 'featured_image';
 
 
 
175
  return $Header;
176
  }
177
 
182
  global $wpdb;
183
  $post_type = $exporttype;
184
  $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID";
185
+ if($post_type == 'woocommerce' || $post_type == 'marketpress')
186
+ $post_type = 'product';
187
+ if($post_type == 'wpcommerce')
188
+ $post_type = 'wpsc-product';
189
  if($post_type == 'eshop')
190
  $post_type = 'post';
191
  if($post_type == 'custompost')
216
  }
217
  if($exporttype == 'eshop')
218
  $get_post_ids .= " and pm.meta_key = 'sku'";
219
+ if($post_type == 'woocommerce')
220
+ $get_post_ids .= " and pm.meta_key = '_sku'";
221
+ if($post_type == 'marketpress')
222
+ $get_post_ids .= " and pm.meta_key = 'mp_sku'";
223
+ if($post_type == 'wpcommerce')
224
+ $get_post_ids .= " and pm.meta_key = '_wpsc_sku'";
225
 
226
+ /* if($exporttype == 'woocommerce') {
227
+ $post_type = 'product';
228
+ $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID where post_type = '$post_type' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_sku'";
229
+ } */
230
  if(isset($request['getdatabyspecificauthors'])) {
231
  if(isset($request['postauthor']) && $request['postauthor'] != 0) {
232
  $get_post_ids .= " and p.post_author = {$request['postauthor']}";
302
  return $result;
303
  }
304
 
305
+ /**
306
+ *
307
+ */
308
+ public function getTypesFields() {
309
+ $wptypesfields = get_option('wpcf-fields');
310
+ #print('<pre>'); print_r($wptypesfields);
311
+ foreach($wptypesfields as $typeFkey){
312
+ $typesfields[$typeFkey['meta_key']] = $typeFkey['name'];
313
+ }
314
+ #print_r($typesfields);
315
+ return $typesfields;
316
+ }
317
+
318
+ /**
319
+ *
320
+ */
321
+ public function getACFvalues($getspecificfieldtype = null) {
322
+ global $wpdb;
323
+ // Code for ACF fields
324
+ $get_acf_fields = $wpdb->get_col ( "SELECT meta_value FROM $wpdb->postmeta
325
+ GROUP BY meta_key
326
+ HAVING meta_key LIKE 'field_%'
327
+ ORDER BY meta_key" );
328
+
329
+ foreach ( $get_acf_fields as $acf_value ){
330
+ $get_acf_field = unserialize($acf_value);
331
+ $acf_fields[$get_acf_field['name']] = "CF: ".$get_acf_field['name'];
332
+ $acf_fields_slug[$get_acf_field['name']] = "_".$get_acf_field['name'];
333
+
334
+ if($get_acf_field['type'] == 'checkbox'){
335
+ $checkbox_option_fields[] = $get_acf_field['name'];
336
+ }
337
+ } // Code ends here
338
+ if($getspecificfieldtype == 'checkbox')
339
+ return $checkbox_option_fields;
340
+ else
341
+ return $acf_fields;
342
+ }
343
+
344
+
345
  /**
346
  *
347
  */
358
  return $aioseofields;
359
  }
360
 
361
+ /**
362
+ *
363
+ */
364
+ public function getYoastSEOfields () {
365
+ $yoastseofields = array('_yoast_wpseo_focuskw' => 'focus_keyword',
366
+ '_yoast_wpseo_title' => 'title',
367
+ '_yoast_wpseo_metadesc' => 'meta_desc',
368
+ '_yoast_wpseo_meta-robots-noindex' => 'meta-robots-noindex',
369
+ '_yoast_wpseo_meta-robots-nofollow' => 'meta-robots-nofollow',
370
+ '_yoast_wpseo_meta-robots-adv' => 'meta-robots-adv',
371
+ '_yoast_wpseo_sitemap-include' => 'sitemap-include',
372
+ '_yoast_wpseo_sitemap-prio' => 'sitemap-prio',
373
+ '_yoast_wpseo_canonical' => 'canonical',
374
+ '_yoast_wpseo_redirect' => 'redirect',
375
+ '_yoast_wpseo_opengraph-description' => 'opengraph-description',
376
+ '_yoast_wpseo_google-plus-description' => 'google-plus-description',
377
+ );
378
+ return $yoastseofields;
379
+ }
380
+
381
  /**
382
  *
383
  */
384
  public function getAllTerms($postID, $type) {
385
+ // Tags & Categories
386
+ if($type == 'woocommerce' || $type == 'marketpress') {
387
+ $exporttype = 'product';
388
+ $postTags = $postCategory = '';
389
+ $taxonomies = get_object_taxonomies($exporttype);
390
+ $get_tags = get_the_terms( $postID, 'product_tag' );
391
+ if($get_tags){
392
+ foreach($get_tags as $tags){
393
+ $postTags .= $tags->name.',';
394
+ }
395
+ }
396
+ $postTags = substr($postTags,0,-1);
397
+ $TermsData['product_tag'] = $postTags;
398
+ foreach ($taxonomies as $taxonomy) {
399
+ if($taxonomy == 'product_cat' || $taxonomy == 'product_category'){
400
+ $get_categotries =wp_get_post_terms( $postID, $taxonomy );
401
+ if($get_categotries){
402
+ foreach($get_categotries as $category){
403
+ $postCategory .= $category->name.'|';
404
+ }
405
+ }
406
+ $postCategory = substr($postCategory, 0 , -1);
407
+ $TermsData['product_category'] = $postCategory;
408
+ }
409
+ }
410
+ } else if($type == 'wpcommerce') {
411
+ $exporttype = 'wpsc-product';
412
+ $postTags = $postCategory = '';
413
+ $taxonomies = get_object_taxonomies($exporttype);
414
+ $get_tags = get_the_terms( $postID, 'product_tag' );
415
+ if($get_tags){
416
+ foreach($get_tags as $tags){
417
+ $postTags .= $tags->name.',';
418
+ }
419
+ }
420
+ $postTags = substr($postTags,0,-1);
421
+ $TermsData['product_tag'] = $postTags;
422
+ foreach ($taxonomies as $taxonomy) {
423
+ if($taxonomy == 'wpsc_product_category'){
424
+ $get_categotries =wp_get_post_terms( $postID, $taxonomy );
425
+ if($get_categotries){
426
+ foreach($get_categotries as $category){
427
+ $postCategory .= $category->name.'|';
428
+ }
429
+ }
430
+ $postCategory = substr($postCategory, 0 , -1);
431
+ $TermsData['product_category'] = $postCategory;
432
+ }
433
+ }
434
+ } else {
435
+ $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
436
+ $postTags = $postCategory = '';
437
+ foreach ($get_tags as $tags) {
438
+ $postTags .= $tags . ',';
439
+ }
440
+ $postTags = substr($postTags, 0, -1);
441
+ $TermsData['post_tag'] = $postTags;
442
+ $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
443
+ foreach ($get_categotries as $category) {
444
+ $postCategory .= $category . '|';
445
+ }
446
+ $postCategory = substr($postCategory, 0, -1);
447
+ $TermsData['post_category'] = $postCategory;
448
+ }
449
+ #print('<pre>'); print_r($TermsData); die;
450
  return $TermsData;
451
  }
452
 
453
+ /**
454
+ *
455
+ */
456
+ public function MarketPressHeaders() {
457
+ $marketpressHeaders = array('product_title' => 'post_title', 'product_content' => 'post_content', 'product_excerpt' => 'post_excerpt', 'product_publish_date' => 'post_date', 'product_slug' => 'post_name', 'product_status' => 'post_status', 'product_parent' => 'post_parent', 'comment_status' => 'open', 'ping_status' => 'open', 'variation' => 'mp_var_name', 'SKU' => 'mp_sku', 'regular_price' => 'mp_price', 'is_sale' => 'mp_is_sale', 'sale_price' => 'mp_sale_price', 'track_inventory' => 'mp_track_inventory', 'inventory' => 'mp_inventory', 'track_limit' => 'mp_track_limit', 'limit_per_order' => 'mp_limit', 'product_link' => 'mp_product_link', 'is_special_tax' => 'mp_is_special_tax', 'special_tax' => 'mp_special_tax', 'sales_count' => 'mp_sales_count', 'extra_shipping_cost' => 'mp_shipping', 'file_url' => 'mp_file', 'product_category' => 'post_category', 'product_tag' => 'post_tag', 'featured_image' => 'featured_image',);
458
+ return $marketpressHeaders;
459
+ }
460
+
461
+ /**
462
+ *
463
+ */
464
+ public function WpeCommerceHeaders() {
465
+ $wpecommerceHeaders = array('post_date' => 'post_date', 'post_content' => 'post_content', 'post_title' => 'post_title', 'post_excerpt' => 'post_excerpt', 'post_name' => 'post_name', 'stock' => '_wpsc_stock', 'price' => '_wpsc_price', 'sale_price' => '_wpsc_special_price', 'SKU' => '_wpsc_sku', 'product_tags' => 'product_tag', 'product_category' => null, 'featured_image' => 'featured_image', 'custom_meta' => null, 'wpsc_is_donation' => '_wpsc_is_donation', 'notify_when_none_left' => 'notify_when_none_left', 'unpublish_when_none_left' => 'unpublish_when_none_left', 'taxable_amount' => 'wpec_taxes_taxable_amount', 'is_taxable' => 'wpec_taxes_taxable', 'external_link' => 'external_link', 'external_link_text' => 'external_link_text', 'external_link_target' => 'external_link_target', 'no_shipping' => 'no_shipping', 'weight' => 'weight', 'weight_unit' => 'weight_unit', 'height' => 'height', 'height_unit' => 'height_unit', 'width' => 'width', 'width_unit' => 'width_unit', 'length' => 'length', 'length_unit' => 'length_unit', 'dimension_unit' => null, 'shipping' => 'shipping', 'merchant_notes' => 'merchant_notes', 'enable_comments' => 'enable_comments', 'quantity_limited' => 'quantity_limited', 'special' => 'special', 'display_weight_as' => 'display_weight_as', 'state' => 'state', 'quantity' => 'quantity', 'table_price' => 'table_price', 'google_prohibited' => 'google_prohibited',);
466
+ return $wpecommerceHeaders;
467
+ }
468
+
469
+ /**
470
+ *
471
+ */
472
+ public function WoocommerceMetaHeaders() {
473
+ $woocomHeaders = array('product_publish_date' => 'post_date', 'product_content' => 'post_content', 'product_name' => 'post_title', 'product_short_description' => 'post_excerpt', 'product_slug' => 'post_name', 'post_parent' => 0, 'product_category' => 'post_category', 'product_tag' => 'post_tag', 'post_type' => null, 'product_type' => '_product_type', 'product_shipping_class' => '_product_shipping_class', 'product_status' => 'post_status', 'visibility' => '_visibility', 'tax_status' => '_tax_status', 'product_attribute_name' => '_product_attribute_name', 'product_attribute_value' => '_product_attribute_value', 'product_attribute_visible' => '_product_attribute_visible', 'product_attribute_variation' => '_product_attribute_variation', 'featured_image' => null, 'product_attribute_taxonomy' => '_product_attribute_taxonomy', 'tax_class' => '_tax_class', 'file_paths' => '_file_paths', 'comment_count' => null, 'menu_order' => 0, 'comment_status'=> null, 'edit_last' => null, 'edit_lock' => null, 'thumbnail_id' => null, 'visibility' => '_visibility', 'stock_status' => '_stock_status', 'stock_qty' => '_stock', 'total_sales' => null, 'downloadable' => 'downloadable', 'downloadable_files' => '_downloadable_files', 'virtual' => '_virtual', 'regular_price' => '_regular_price', 'sale_price' => '_sale_price', 'purchase_note' => null, 'featured_product' => '_featured', 'weight' => null, 'length' => null, 'width' => null, 'height' => null, 'sku' => '_sku', 'upsell_ids' => '_upsell_ids', 'crosssell_ids' => '_crosssell_ids', 'sale_price_dates_from' => '_sale_price_dates_from', 'sale_price_dates_to' => '_sale_price_dates_to', 'price' => null,'sold_individually' => '_price', 'manage_stock' => '_manage_stock', 'backorders' => '_backorders', 'product_image_gallery' => '__product_image_gallery', 'product_url' => '_product_url', 'button_text' => '_button_text', 'downloadable_files' => null, 'download_limit' => '_download_limit', 'download_expiry' => '_download_expiry', 'download_type'=> null, 'min_variation_price' => null, 'max_variation_price'=> null, 'min_price_variation_id' => null, 'max_price_variation_id' => null, 'min_variation_regular_price' => null, 'max_variation_regular_price' => null, 'min_regular_price_variation_id' => null, 'max_regular_price_variation_id' => null, 'min_variation_sale_price' => null, 'max_variation_sale_price' => null, 'min_sale_price_variation_id' => null, 'max_sale_price_variation_id' => null, 'default_attributes' => null,);
474
+ return $woocomHeaders;
475
+ }
476
+
477
  /**
478
  *
479
  */
486
  * @param $request
487
  * @return array
488
  */
489
+ public function WPImpPROExportData($request) {
490
  #print('<pre>'); print_r($this->getACFvalues()); die;
491
  global $wpdb;
492
  $export_delimiter = ',';
510
  $result = $this->get_all_record_ids($exporttype, $request);
511
  #print('<pre>'); print_r($Header); print_r($result); print('</pre>'); die;
512
  $fieldsCount = count($result);
513
+ if(isset($result)) {
514
  foreach ($result as $postID) {
515
  $pId = $pId . ',' . $postID;
516
  $PostData[$postID] = $this->getPostDatas($postID);
560
  }
561
  }
562
  } else {
563
+ // ACF checkbox fields
564
+ $acfserialized = 0;
565
+ if(array_key_exists($postmeta->meta_key, $this->getACFvalues())) {
566
+ foreach($possible_values as $posval){
567
+ if(strpos($postmeta->meta_value,$posval)){
568
+ $acfserialized = 1;
569
+ } else {
570
+ $acfserialized = 0;
571
+ }
572
+ }
573
+ if($acfserialized == 0) {
574
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
575
+ } else {
576
+ $acf_checkboxes = $this->getACFvalues('checkbox');
577
+ if(in_array($postmeta->meta_key, $acf_checkboxes)) {
578
+ $get_all_values = unserialize($postmeta->meta_value);
579
+ foreach($get_all_values as $optKey => $optVal) {
580
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $optVal . ',';
581
+ }
582
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
583
+ }
584
+ }
585
+ }
586
+ // ACF checkbox fields ends here
587
+ // WooCommerce product meta datas
588
+ else if ($postmeta->meta_key == '_product_attributes') {
589
+ #print_r($postmeta->meta_value); #die;
590
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
591
+ $product_attribute_name = $product_attribute_value = $product_attribute_visible = $product_attribute_variation = '';
592
+ $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = '';
593
+ $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = '';
594
+ $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = '';
595
+ $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = '';
596
+ $eshop_products_unser1 = unserialize($postmeta->meta_value);
597
+ $check_attr_count1 = count($eshop_products_unser1);
598
+ if($check_attr_count1 == 1){
599
+ $eshop_products_unser2 = unserialize($eshop_products_unser1);
600
+ $check_attr_count2 = count($eshop_products_unser2);
601
+ }
602
+ if($check_attr_count1 < $check_attr_count2){
603
+ $unserialized_attributes = $eshop_products_unser2;
604
+ }else{
605
+ $unserialized_attributes = $eshop_products_unser1;
606
+ }
607
+
608
+ foreach ($unserialized_attributes as $key) {
609
+ foreach($key as $attr_header => $attr_value){
610
+ if($attr_header == 'name')
611
+ $product_attribute_name .= $attr_value.'|';
612
+ if($attr_header == 'value')
613
+ $product_attribute_value .= $attr_value.'|';
614
+ if($attr_header == 'is_visible')
615
+ $product_attribute_visible .= $attr_value.'|';
616
+ if($attr_header == 'is_variation'){
617
+ if(isset($attr_value))
618
+ $product_attribute_variation .= $attr_value.'|';
619
+ }
620
+ }
621
+ }
622
+ $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = substr($product_attribute_name, 0, -1);
623
+ $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = substr($product_attribute_value, 0, -1);
624
+ $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = substr($product_attribute_visible, 0, -1);
625
+ $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = substr($product_attribute_variation, 0, -1);
626
+ #print('<pre>'); print_r($PostMetaData); die;
627
+ }
628
+ else if ($postmeta->meta_key == '_upsell_ids') {
629
+ $upsellids = array();
630
+ $crosssellids = array();
631
+ #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); #print_r($PostMetaData); print('</pre>'); #die;
632
+ if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
633
+ $upsellids = unserialize($postmeta->meta_value);
634
+ if(is_array($upsellids)){
635
+ foreach($upsellids as $upsellID){
636
+ $upsell_ids .= $upsellID.',';
637
+ }
638
+ $PostMetaData[$postmeta->post_id]['_upsell_ids'] = substr($upsell_ids, 0, -1);
639
+ }else{
640
+ $PostMetaData[$postmeta->post_id]['_upsell_ids'] = '';
641
+ }
642
+ #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); print_r($PostMetaData);
643
+ }
644
+ }
645
+ #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); print_r($PostMetaData); print('</pre>'); #die;
646
+ else if ($postmeta->meta_key == '_crosssell_ids') {
647
+ if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
648
+ $crosssellids = unserialize($postmeta->meta_value);
649
+ if(is_array($crosssellids)){
650
+ foreach($crosssellids as $crosssellID){
651
+ $crosssell_ids .= $crosssellID.',';
652
+ }
653
+ $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = substr($crosssell_ids, 0, -1);
654
+ }else{
655
+ $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = '';
656
+ }
657
+ }
658
+ }
659
+ else if ($postmeta->meta_key == '_downloadable_files') {
660
+ if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
661
+ $downloadable_files = unserialize($postmeta->meta_value);
662
+ if(is_array($downloadable_files)){
663
+ foreach($downloadable_files as $dkey => $dval){
664
+ $downloadable_key = $dkey;
665
+ foreach($dval as $down_key => $down_val) {
666
+ $downloadable_value .= $down_val . ',';
667
+ }
668
+ }
669
+ $downloadable_all .= $downloadable_key . ',' . $downloadable_value;
670
+ $PostMetaData[$postmeta->post_id]['_downloadable_files'] = substr($downloadable_all ,0, -1);
671
+ }else{
672
+ $PostMetaData[$postmeta->post_id]['_downloadable_files'] = '';
673
+ }
674
+ }
675
+ }
676
+ else if ($postmeta->meta_key == '_thumbnail_id') {
677
+ $attachment_file = '';
678
+ $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
679
+ $attachment = $wpdb->get_results($get_attachement);
680
+ $attachment_file = $attachment[0]->guid;
681
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
682
+ $postmeta->meta_key = 'featured_image';
683
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
684
+ }
685
+ else if ($postmeta->meta_key == '_visibility') {
686
+ if($postmeta->meta_value == 'visible')
687
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
688
+ if($postmeta->meta_value == 'catalog')
689
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
690
+ if($postmeta->meta_value == 'search')
691
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
692
+ if($postmeta->meta_value == 'hidden')
693
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 4;
694
+ }
695
+ else if ($postmeta->meta_key == '_stock_status') {
696
+ /*if($postmeta->meta_value == 'instock')
697
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
698
+ if($postmeta->meta_value == 'outofstock')
699
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;*/
700
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
701
+ }
702
+ else if ($postmeta->meta_key == '_tax_status') {
703
+ if($postmeta->meta_value == 'taxable')
704
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
705
+ if($postmeta->meta_value == 'shipping')
706
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
707
+ if($postmeta->meta_value == 'none')
708
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
709
+ }
710
+ else if ($postmeta->meta_key == '_tax_class') {
711
+ if($postmeta->meta_value == '')
712
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
713
+ if($postmeta->meta_value == 'reduced-rate')
714
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
715
+ if($postmeta->meta_value == 'zero-rate')
716
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
717
+ }
718
+ else if ($postmeta->meta_key == '_backorders') {
719
+ if($postmeta->meta_value == 'no')
720
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
721
+ if($postmeta->meta_value == 'notify')
722
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
723
+ if($postmeta->meta_value == 'yes')
724
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
725
+ }
726
+ else if ($postmeta->meta_key == '_featured') {
727
+ if($postmeta->meta_value == 'no')
728
+ $PostMetaData[$postmeta->post_id]['featured_product'] = 1;
729
+ if($postmeta->meta_value == 'yes')
730
+ $PostMetaData[$postmeta->post_id]['featured_product'] = 2;
731
+ if($postmeta->meta_value == 'zero-rate')
732
+ $PostMetaData[$postmeta->post_id]['featured_product'] = 3;
733
+ }
734
+ else if ($postmeta->meta_key == '_product_type') {
735
+ if($postmeta->meta_value == 'simple')
736
+ $PostMetaData[$postmeta->post_id]['product_type'] = 1;
737
+ if($postmeta->meta_value == 'grouped')
738
+ $PostMetaData[$postmeta->post_id]['product_type'] = 2;
739
+ if($postmeta->meta_value == 'variable')
740
+ $PostMetaData[$postmeta->post_id]['product_type'] = 4;
741
+ }
742
+ /* else if($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
743
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
744
+ } */
745
+ #$eshop_products = $postmeta->meta_value;
746
+ else if ($postmeta->meta_key == 'products') {
747
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
748
+ $eshop_products = unserialize($eshop_products);
749
+ foreach ($eshop_products as $key) {
750
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
751
+ }
752
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
753
+ } // WooCommerce product meta datas end here
754
+ // MarketPress product meta datas starts here
755
+ else if ($postmeta->meta_key == 'mp_var_name') {
756
+ $mp_variations = null;
757
+ $all_variations = unserialize($postmeta->meta_value);
758
+ foreach($all_variations as $variation_name) {
759
+ $mp_variations .= $variation_name . ',';
760
+ }
761
+ $mp_variations = substr($mp_variations, 0, -1);
762
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_variations;
763
+ }
764
+ else if ($postmeta->meta_key == 'mp_sale_price') {
765
+ $mp_sale_prices = null;
766
+ $all_sale_prices = unserialize($postmeta->meta_value);
767
+ foreach($all_sale_prices as $mp_sale_price_value) {
768
+ $mp_sale_prices .= $mp_sale_price_value . ',';
769
+ }
770
+ $mp_sale_prices = substr($mp_sale_prices, 0, -1);
771
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_sale_prices;
772
+ }
773
+ else if ($postmeta->meta_key == 'mp_price') {
774
+ $mp_prod_prices = null;
775
+ $all_mp_prod_prices = unserialize($postmeta->meta_value);
776
+ foreach($all_mp_prod_prices as $mp_prod_price_value) {
777
+ $mp_prod_prices .= $mp_prod_price_value . ',';
778
+ }
779
+ $mp_prod_prices = substr($mp_prod_prices, 0, -1);
780
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_prod_prices;
781
+ }
782
+ else if ($postmeta->meta_key == 'mp_sku') {
783
+ $mp_sku = null;
784
+ $all_mp_prod_sku = unserialize($postmeta->meta_value);
785
+ foreach($all_mp_prod_sku as $mp_prod_sku) {
786
+ $mp_sku .= $mp_prod_sku. ',';
787
+ }
788
+ $mp_sku = substr($mp_sku, 0, -1);
789
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_sku;
790
+ }
791
+ else if ($postmeta->meta_key == 'mp_shipping') {
792
+ $mp_prod_shipping_value = unserialize($postmeta->meta_value);
793
+ $mp_shipping_value = $mp_prod_shipping_value['extra_cost'];
794
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_shipping_value;
795
+ }
796
+ else if ($postmeta->meta_key == 'mp_inventory') {
797
+ $mp_inventory_value = null;
798
+ $mp_prod_inventory_values = unserialize($postmeta->meta_value);
799
+ foreach($mp_prod_inventory_values as $inventory_values) {
800
+ $mp_inventory_value .= $inventory_values. ',';
801
+ }
802
+ $mp_inventory_value = substr($mp_inventory_value, 0, -1);
803
+ $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_inventory_value;
804
+ } // MarketPress product meta datas ends here
805
+ // WP e-Commerce product meta datas starts here
806
+ else if ($postmeta->meta_key == '_wpsc_product_metadata') {
807
+ $wpecomm_product_metadata = unserialize($postmeta->meta_value);
808
+ #print('<pre>'); print_r($wpecomm_product_metadata); die;
809
+ foreach($wpecomm_product_metadata as $prod_md_key => $prod_md_val) {
810
+ if($prod_md_key == 'dimensions') { #die('summa');
811
+ foreach($prod_md_val as $prod_dimen_key => $prod_dimen_val) {
812
+ $PostMetaData[$postmeta->post_id][$prod_dimen_key] = $prod_dimen_val;
813
+ }
814
+ }
815
+ else if($prod_md_key == 'shipping') {
816
+ $shipping = null;
817
+ foreach($prod_md_val as $prod_ship_key => $prod_ship_val) {
818
+ $shipping .= $prod_ship_val . ',';
819
+ }
820
+ $shipping = substr($shipping, 0, -1);
821
+ $PostMetaData[$postmeta->post_id][$prod_md_key] = $shipping;
822
+ }
823
+ else if($prod_md_key == 'table_rate_price') {
824
+ foreach($prod_md_val as $table_rate_key => $table_rate_val) {
825
+ if($table_rate_key == 'quantity') {
826
+ $trq_val = null;
827
+ foreach($table_rate_val as $trq) {
828
+ $trq_val .= $trq . '|';
829
+ }
830
+ $trq_val = substr($trq_val, 0, -1);
831
+ $PostMetaData[$postmeta->post_id][$table_rate_key] = $trq_val;
832
+ } else if($table_rate_key == 'table_price') {
833
+ $tbl_price_amt = null;
834
+ foreach($table_rate_val as $tbl_price) {
835
+ $tbl_price_amt .= $tbl_price . '|';
836
+ }
837
+ $tbl_price_amt = substr($tbl_price_amt, 0, -1);
838
+ $PostMetaData[$postmeta->post_id][$table_rate_key] = $tbl_price_amt;
839
+ } else {
840
+ $PostMetaData[$postmeta->post_id][$table_rate_key] = $table_rate_val;
841
+ }
842
+ }
843
+ }
844
+ else {
845
+ $PostMetaData[$postmeta->post_id][$prod_md_key] = $prod_md_val;
846
+ }
847
+ }
848
+ }
849
+ // Wp e-Commerce product meta datas ends here
850
  // Eshop product meta datas starts here
851
+ else if ($postmeta->meta_key == 'featured') {
852
  $isFeatured = strtolower($postmeta->meta_value);
853
  $PostMetaData[$postmeta->post_id]['featured_product'] = $isFeatured;
854
  }
920
  }
921
  # print('PostMetaData: '); print('<pre>'); print_r($Header); print_r($PostMetaData); #die;
922
  $TermsData[$postID] = $this->getAllTerms($postID,$exporttype);
923
+ /*
924
+ // Tags & Categories
925
+ $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
926
+ $postTags = $postCategory = '';
927
+ foreach ($get_tags as $tags) {
928
+ $postTags .= $tags . ',';
929
+ }
930
+ $postTags = substr($postTags, 0, -1);
931
+ $TermsData[$postID]['post_tag'] = $postTags;
932
+ $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
933
+ foreach ($get_categotries as $category) {
934
+ $postCategory .= $category . '|';
935
+ }
936
+ $postCategory = substr($postCategory, 0, -1);
937
+ $TermsData[$postID]['post_category'] = $postCategory;
938
+ */
939
  }
940
 
941
  #$ExportData = array();
958
  }
959
  #print('<pre>'); print_r($Header); die;
960
  #print('<pre>'); print_r($ExportData); die;
961
+ if($exporttype == 'woocommerce') {
962
+ foreach($Header as $hkey) {
963
+ foreach($ExportData as $edkey => $edval) {
964
+ /*if(array_key_exists($hkey, $this->getACFvalues())) {
965
+ $ExportData[$edkey][$hkey] = $edval[$hkey];
966
+ unset($ExportData[$edkey]['_'.$hkey]);
967
+ }
968
+ else if(in_array($hkey, $this->getAIOSEOfields())) {
969
+ foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
970
+ $ExportData[$edkey][$aioseoval] = $edval[$aioseokey];
971
+ unset($ExportData[$edkey][$hkey]);
972
+ }
973
+ }
974
+ else if(array_key_exists('_'.$hkey, $edval)) {
975
+ $ExportData[$edkey][$hkey] = $edval['_'.$hkey];
976
+ unset($ExportData[$edkey]['_'.$hkey]);
977
+ } */
978
+ foreach($this->WoocommerceMetaHeaders() as $woohkey => $woohval) {
979
+ if(array_key_exists($woohval, $ExportData[$edkey])) {
980
+ $ExportData[$edkey][$woohkey] = $edval[$woohval];
981
+ unset($ExportData[$edkey][$woohval]);
982
+ }
983
+ }
984
+ }
985
+ }
986
+ }
987
+ # MarketPressHeaders
988
+ if($exporttype == 'marketpress') {
989
+ foreach($Header as $hkey) {
990
+ foreach($ExportData as $edkey => $edval) {
991
+ foreach($this->MarketPressHeaders() as $mphkey => $mphval) {
992
+ if(array_key_exists($mphval, $ExportData[$edkey])) {
993
+ $ExportData[$edkey][$mphkey] = $edval[$mphval];
994
+ // unset($ExportData[$edkey][$mphval]);
995
+ }
996
+ }
997
+ }
998
+ }
999
+ }
1000
+ if($exporttype == 'wpcommerce') {
1001
+ foreach($Header as $hkey) {
1002
+ foreach($ExportData as $edkey => $edval) {
1003
+ foreach($this->WpeCommerceHeaders() as $wpcomhkey => $wpcomhval) {
1004
+ if(array_key_exists($wpcomhval, $ExportData[$edkey])) {
1005
+ $ExportData[$edkey][$wpcomhkey] = $edval[$wpcomhval];
1006
+ // unset($ExportData[$edkey][$wpcomhval]);
1007
+ }
1008
+ }
1009
+ }
1010
+ }
1011
+ }
1012
  if($exporttype == 'eshop') {
1013
  foreach($Header as $hkey) {
1014
  foreach($ExportData as $edkey => $edval) {
1031
  $CSVContent[$ED_key][$aioseoval] = $ED_val[$aioseokey];
1032
  #unset($CSVContent[$ED_key][$header_key]);
1033
  }
1034
+ } else if (in_array($header_key, $this->getYoastSEOfields())) {
1035
+ foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
1036
+ $CSVContent[$ED_key][$yoastseoval] = $ED_val[$yoastseokey];
1037
+ #unset($CSVContent[$ED_key][$header_key]);
1038
+ }
1039
+ } else if (in_array($header_key, $this->getTypesFields())) {
1040
+ foreach($this->getTypesFields() as $typesFkey => $typesFval) {
1041
+ $CSVContent[$ED_key][$typesFval] = $ED_val[$typesFkey];
1042
+ #unset($CSVContent[$ED_key][$header_key]);
1043
+ }
1044
  } else if (array_key_exists($header_key, $ED_val)) {
1045
  $CSVContent[$ED_key][$header_key] = $ED_val[$header_key];
1046
  } else {
1051
  }
1052
  #print(count($CSVContent[22]));print('<br>' . count($Header));
1053
  #print('<pre>'); print_r($CSVContent) ;print('</pre>'); die;
1054
+ $csv = new WPImpCSVParserLib();
1055
+ $csv->output ($csv_file_name, $CSVContent, $Header, $export_delimiter);
1056
+ }
1057
+
1058
+ /**
1059
+ *
1060
+ */
1061
+ public function WPImpExportCategories($request) {
1062
+ global $wpdb;
1063
+ $export_delimiter = ',';
1064
+ $exporttype = $request['export'];
1065
+ $wpcsvsettings=get_option('wpcsvprosettings');
1066
+ if(isset($wpcsvsettings['export_delimiter'])){
1067
+ $export_delimiter = $wpcsvsettings['export_delimiter'];
1068
+ }
1069
+ if($_POST['export_filename'])
1070
+ $csv_file_name =$_POST['export_filename'].'.csv';
1071
+ else
1072
+ $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1073
+
1074
+ $Header[] = 'name';
1075
+ $Header[] = 'slug';
1076
+ $Header[] = 'description';
1077
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1078
+ $Header[] = 'wpseo_title';
1079
+ $Header[] = 'wpseo_desc';
1080
+ $Header[] = 'wpseo_canonical';
1081
+ $Header[] = 'wpseo_noindex';
1082
+ $Header[] = 'wpseo_sitemap_include';
1083
+ }
1084
+ $get_all_categories = get_categories('hide_empty=0');
1085
+ $fieldsCount = count($get_all_categories);
1086
+ $seo_yoast_taxonomies = get_option('wpseo_taxonomy_meta');
1087
+ foreach($seo_yoast_taxonomies as $seo_yoast=>$seo){
1088
+ $val_seo_yoast = $seo;
1089
+ }
1090
+ foreach( $get_all_categories as $cateKey => $cateValue ) {
1091
+ $categID = $cateValue->term_id;
1092
+ $categName = $cateValue->cat_name;
1093
+ $categSlug = $cateValue->slug;
1094
+ $categDesc = $cateValue->category_description;
1095
+ $categParent = $cateValue->parent;
1096
+ if($categParent == 0) {
1097
+ $TERM_DATA[$categID]['name'] = $categName;
1098
+ } else {
1099
+ $categParentName = get_cat_name( $categParent );
1100
+ $TERM_DATA[$categID]['name'] = $categParentName . '|' . $categName;
1101
+ }
1102
+ $TERM_DATA[$categID]['slug'] = $categSlug;
1103
+ $TERM_DATA[$categID]['description'] = $categDesc;
1104
+ }
1105
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1106
+ foreach($seo_yoast_taxonomies['category'] as $taxoKey => $taxoValue){
1107
+ $taxoID = $taxoKey;
1108
+ $taxo_wpseo_title = $taxoValue['wpseo_title'];
1109
+ $taxo_wpseo_desc = $taxoValue['wpseo_desc'];
1110
+ $taxo_wpseo_canonical = $taxoValue['wpseo_canonical'];
1111
+ $taxo_wpseo_noindex = $taxoValue['wpseo_noindex'];
1112
+ $taxo_wpseo_sitemap_include = $taxoValue['wpseo_sitemap_include'];
1113
+ $TERM_DATA[$taxoID]['wpseo_title'] = $taxo_wpseo_title;
1114
+ $TERM_DATA[$taxoID]['wpseo_desc'] = $taxo_wpseo_desc;
1115
+ $TERM_DATA[$taxoID]['wpseo_canonical'] = $taxo_wpseo_canonical;
1116
+ $TERM_DATA[$taxoID]['wpseo_noindex'] = $taxo_wpseo_noindex;
1117
+ $TERM_DATA[$taxoID]['wpseo_sitemap_include'] = $taxo_wpseo_sitemap_include;
1118
+ }
1119
+ }
1120
+ $csv = new WPImpCSVParserLib();
1121
+ $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1122
+ }
1123
+
1124
+ /**
1125
+ *
1126
+ */
1127
+ public function WPImpExportTags($request) {
1128
+ global $wpdb;
1129
+ $export_delimiter = ',';
1130
+ $exporttype = $request['export'];
1131
+ $wpcsvsettings=get_option('wpcsvprosettings');
1132
+ if(isset($wpcsvsettings['export_delimiter'])){
1133
+ $export_delimiter = $wpcsvsettings['export_delimiter'];
1134
+ }
1135
+ if($_POST['export_filename'])
1136
+ $csv_file_name =$_POST['export_filename'].'.csv';
1137
+ else
1138
+ $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1139
+
1140
+ $Header[] = 'name';
1141
+ $Header[] = 'slug';
1142
+ $Header[] = 'description';
1143
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1144
+ $Header[] = 'wpseo_title';
1145
+ $Header[] = 'wpseo_desc';
1146
+ $Header[] = 'wpseo_canonical';
1147
+ $Header[] = 'wpseo_noindex';
1148
+ $Header[] = 'wpseo_sitemap_include';
1149
+ }
1150
+ $seo_yoast_taxonomies = get_option('wpseo_taxonomy_meta');
1151
+ foreach($seo_yoast_taxonomies['post_tag'] as $seo_yoast=>$seo){
1152
+ $val_seo_yoast = $seo;
1153
+ }
1154
+
1155
+ $get_all_tags = get_tags('hide_empty=0');
1156
+ $fieldsCount = count($get_all_tags);
1157
+ foreach( $get_all_tags as $tagKey => $tagValue ) {
1158
+ $tagID = $tagValue->term_id;
1159
+ $tagName = $tagValue->name;
1160
+ $tagSlug = $tagValue->slug;
1161
+ $tagDesc = $tagValue->description;
1162
+ $TERM_DATA[$tagID]['name'] = $tagName;
1163
+ $TERM_DATA[$tagID]['slug'] = $tagSlug;
1164
+ $TERM_DATA[$tagID]['description'] = $tagDesc;
1165
+ }
1166
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1167
+ foreach($seo_yoast_taxonomies['post_tag'] as $taxoKey => $taxoValue){
1168
+ $tagID = $taxoKey;
1169
+ $taxo_wpseo_title = $taxoValue['wpseo_title'];
1170
+ $taxo_wpseo_desc = $taxoValue['wpseo_desc'];
1171
+ $taxo_wpseo_canonical = $taxoValue['wpseo_canonical'];
1172
+ $taxo_wpseo_noindex = $taxoValue['wpseo_noindex'];
1173
+ $taxo_wpseo_sitemap_include = $taxoValue['wpseo_sitemap_include'];
1174
+ $TERM_DATA[$tagID]['wpseo_title'] = $taxo_wpseo_title;
1175
+ $TERM_DATA[$tagID]['wpseo_desc'] = $taxo_wpseo_desc;
1176
+ $TERM_DATA[$tagID]['wpseo_canonical'] = $taxo_wpseo_canonical;
1177
+ $TERM_DATA[$tagID]['wpseo_noindex'] = $taxo_wpseo_noindex;
1178
+ $TERM_DATA[$tagID]['wpseo_sitemap_include'] = $taxo_wpseo_sitemap_include;
1179
+ }
1180
+ }
1181
+ $csv = new WPImpCSVParserLib();
1182
+ $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1183
+ }
1184
+
1185
+ /**
1186
+ *
1187
+ */
1188
+ public function WPImpExportTaxonomies($request) {
1189
+ global $wpdb;
1190
+ $export_delimiter = ',';
1191
+ $exporttype = $request['export'];
1192
+ $wpcsvsettings=get_option('wpcsvprosettings');
1193
+ if(isset($wpcsvsettings['export_delimiter'])){
1194
+ $export_delimiter = $wpcsvsettings['export_delimiter'];
1195
+ }
1196
+ if($_POST['export_filename'])
1197
+ $csv_file_name =$_POST['export_filename'].'.csv';
1198
+ else
1199
+ $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1200
+
1201
+ $taxonomy_name = $_POST['export_taxo_type'];
1202
+ $taxonomies = get_terms( $taxonomy_name, 'orderby=count&hide_empty=0' );
1203
+ $Header[] = 'name';
1204
+ $Header[] = 'slug';
1205
+ $Header[] = 'description';
1206
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1207
+ $Header[] = 'wpseo_title';
1208
+ $Header[] = 'wpseo_desc';
1209
+ $Header[] = 'wpseo_canonical';
1210
+ $Header[] = 'wpseo_noindex';
1211
+ $Header[] = 'wpseo_sitemap_include';
1212
+ }
1213
+ $fieldsCount = count($taxonomies);
1214
+ $seo_yoast_taxonomies = get_option('wpseo_taxonomy_meta');
1215
+ foreach($seo_yoast_taxonomies as $seo_yoast=>$seo){
1216
+ $val_seo_yoast = $seo;
1217
+ }
1218
+ foreach( $taxonomies as $taxoKey => $taxoValue ) {
1219
+ $taxoID = $taxoValue->term_id;
1220
+ $taxoName = $taxoValue->name;
1221
+ $taxoSlug = $taxoValue->slug;
1222
+ $taxoDesc = $taxoValue->description;
1223
+ $taxoParent = $taxoValue->parent;
1224
+ if($taxoParent == 0) {
1225
+ $TERM_DATA[$taxoID]['name'] = $taxoName;
1226
+ } else {
1227
+ $taxoParentName = get_term( $taxoParent, $taxonomy_name );
1228
+ $TERM_DATA[$taxoID]['name'] = $taxoParentName->name . '|' . $taxoName;
1229
+ }
1230
+ $TERM_DATA[$taxoID]['slug'] = $taxoSlug;
1231
+ $TERM_DATA[$taxoID]['description'] = $taxoDesc;
1232
+ }
1233
+ if($wpcsvsettings['rseooption'] == 'yoastseo'){
1234
+ foreach($seo_yoast_taxonomies[$taxonomy_name] as $taxoKey => $taxoValue){
1235
+ $taxoID = $taxoKey;
1236
+ $taxo_wpseo_title = $taxoValue['wpseo_title'];
1237
+ $taxo_wpseo_desc = $taxoValue['wpseo_desc'];
1238
+ $taxo_wpseo_canonical = $taxoValue['wpseo_canonical'];
1239
+ $taxo_wpseo_noindex = $taxoValue['wpseo_noindex'];
1240
+ $taxo_wpseo_sitemap_include = $taxoValue['wpseo_sitemap_include'];
1241
+ $TERM_DATA[$taxoID]['wpseo_title'] = $taxo_wpseo_title;
1242
+ $TERM_DATA[$taxoID]['wpseo_desc'] = $taxo_wpseo_desc;
1243
+ $TERM_DATA[$taxoID]['wpseo_canonical'] = $taxo_wpseo_canonical;
1244
+ $TERM_DATA[$taxoID]['wpseo_noindex'] = $taxo_wpseo_noindex;
1245
+ $TERM_DATA[$taxoID]['wpseo_sitemap_include'] = $taxo_wpseo_sitemap_include;
1246
+ }
1247
+ }
1248
+ $csv = new WPImpCSVParserLib();
1249
+ $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1250
+ }
1251
+
1252
+ /**
1253
+ *
1254
+ */
1255
+ public function WPImpExportCustomerReviews($request) {
1256
+ global $wpdb;
1257
+ $export_delimiter = ',';
1258
+ $exporttype = $request['export'];
1259
+ $wpcsvsettings=get_option('wpcsvprosettings');
1260
+ if(isset($wpcsvsettings['export_delimiter'])){
1261
+ $export_delimiter = $wpcsvsettings['export_delimiter'];
1262
+ }
1263
+ if($_POST['export_filename'])
1264
+ $csv_file_name =$_POST['export_filename'].'.csv';
1265
+ else
1266
+ $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1267
+
1268
+ $header_query1 = "SELECT * FROM wp_wpcreviews";
1269
+ $header_query2 = "SELECT id FROM wp_wpcreviews";
1270
+
1271
+ $result_header_query1 = $wpdb->get_results($header_query1);
1272
+ foreach($result_header_query1 as $rhq1_key){
1273
+ foreach($rhq1_key as $rhq1_headkey => $rhq1_headval){
1274
+ if(!in_array($rhq1_headkey,$Header))
1275
+ $Header[] = $rhq1_headkey;
1276
+ }
1277
+ }
1278
+
1279
+ $result = $wpdb->get_results($header_query1);
1280
+ $result1 = $wpdb->get_results($header_query2);
1281
+
1282
+ $fieldsCount = count($result);
1283
+ if (isset($result)) {
1284
+ $i =0;
1285
+ foreach ($result as $postID) {
1286
+ foreach ($postID as $Key => $Val){
1287
+ $postData[$i][$Key] = $Val;
1288
+ }
1289
+ $i++;
1290
+ }
1291
+ $ExportData = $postData;
1292
+ $j=0;
1293
+ foreach($Header as $key)
1294
+ {
1295
+ $key=$j;
1296
+ $header[] = $key;
1297
+ $j++;
1298
+ }
1299
+ $csv = new WPImpCSVParserLib();
1300
+
1301
+ $csv->output ($csv_file_name, $ExportData, $Header, $export_delimiter);
1302
+
1303
+ }
1304
  }
1305
 
1306
  /**
1334
  $i++;
1335
  }
1336
  #print('<pre>'); print_r($header); print_r($singleCommentContent);die;
1337
+ $csv = new WPImpCSVParserLib();
1338
+ $csv->output ($csv_file_name, $ExportData, $Header, $export_delimiter);
1339
  }
1340
 
1341
  /**
1389
 
1390
  $result = $wpdb->get_col($get_user_ids);
1391
  $fieldsCount = count($result);
1392
+ if (isset($result)) {
1393
  foreach ($result as $userID) {
1394
  $uId = $uId . ',' . $userID;
1395
  $query1 = "SELECT *FROM $wpdb->users where ID in ($userID);";
1489
  }
1490
  }
1491
  }
1492
+ $csv = new WPImpCSVParserLib();
1493
+ $csv->output ($csv_file_name, $CSVContent, $UserHeader, $export_delimiter);
 
1494
  }
1495
  }
modules/export/templates/index.php CHANGED
@@ -6,34 +6,42 @@
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
  ?>
 
 
 
 
 
9
  <div class="accordion" id="accordion2" style = 'width:98%;'>
10
  <div class="accordion-group">
 
11
  <div id="collapseTwo" class="accordion-body in collapse">
12
- <div class="accordion-inner">
13
- <div class="title">
 
 
14
  <span class="settings-icon"> <img src="<?php echo WP_CONTENT_URL;?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/export.png" width="24" height="24" /> </span>
15
- <label><h3>Export Data With Advanced Filters</h3></label>
 
16
  </div>
17
-
18
- <div style="margin-top:20px;">
19
- <div style="display:none;" id="ShowMsg"><p class="alert alert-warning" id="warning-msg"></p></div>
20
  <form class="form-horizontal" method="post" name="exportmodule" action="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>modules/export/templates/export.php" onsubmit="return export_module();">
21
  <!-- <form class="form-horizontal" method="post" name="exportmodule" action="" onsubmit="return export_module();"> -->
22
  <div class="table-responsive">
23
  <table style='width:100%;' class='table exportmodule'>
24
- <th colspan='2'><label class='h-exportmodule'><h3 id="innertitle"> To export data based on the filters</h3> </label></th>
25
  <tr>
26
- <td><label><input type='checkbox' name='getdataforspecificperiod' id='getdataforspecificperiod' value='getdataforspecificperiod' onclick='addwpexportfilter(this.id);' /><span id="align"> Export data for the specific period</span></label>
27
  <div id='specificperiodexport' style='padding:10px;display:none;'>
28
  <label id='periodstartfrom'><b> Start From </b></label>
29
  <input type='text' class='form-control' name='postdatefrom' style='cursor:default;width:25%;' readonly id='postdatefrom' value='' />
30
  <label id='periodendto'><b> End To </b></label>
31
  <input type='text' class='form-control' name='postdateto' style='cursor:default;width:25%;' readonly id='postdateto' value='' />
 
32
  </div>
33
  </td>
34
  </tr>
35
  <tr>
36
- <td><label><input type='checkbox' name='getdatawithspecificstatus' id='getdatawithspecificstatus' value='getdatawithspecificstatus' onclick='addwpexportfilter(this.id);' /> <span id="align">Export data with the specific status</span></label>
37
  <div id='specificstatusexport' style='padding:10px;display:none;'>
38
  <label id='status'><b> Status </b></label>
39
  <select name='postwithstatus' id='postwithstatus'>
@@ -49,7 +57,7 @@
49
  </td>
50
  </tr>
51
  <tr>
52
- <td><label><input type='checkbox' name='getdatabyspecificauthors' id='getdatabyspecificauthors' value='getdatabyspecificauthors' onclick='addwpexportfilter(this.id);' /><span id="align"> Export data by specific authors</span></label>
53
  <div id='specificauthorexport' style='padding:10px;display:none;'>
54
  <label id='authors'><b> Authors </b></label>
55
  <?php $blogusers = get_users( 'blog_id=1&orderby=nicename' ); ?>
@@ -76,19 +84,19 @@
76
  </div>
77
  <div class="table-responsive" id="exporttable">
78
  <table class='table exportmodule'>
79
- <th colspan='2'><label class='h-exportmodule'><h3 id="innertitle"> Select your module to export the data</h3> </label></th>
80
  <tr>
81
- <td class='exportdatatype'><label> <input type="radio" name="export" value="post" id="post"><span id="align"> Post</span> </label></td>
82
- <td class='exportdatatype'><label> <input type="radio" name="export" value="eshop" id="eshop"><span id="align"> Eshop</span> </label></td>
83
  </tr>
84
  <tr>
85
- <td class='exportdatatype'><label> <input type="radio" name="export" value="page" id="page"><span id="align"> Page</span> </label></td>
86
- <td class='exportdatatype'><label> <input type="radio" name="export" value="wpcommerce" id="wpcommerce" onclick="export_check(this.value);"><span id="align"> Wp-Commerce</span> <span class="mandatory">*</span></label></td>
87
  </tr>
88
  <tr>
89
  <td class='exportdatatype'>
90
- <label> <input type="radio" name="export" value="custompost" id="custompost" ><span id="align"> Custom Post</span> </label>
91
- <select name="export_post_type" style="margin-left:10px">
92
  <option>--Select--</option>
93
  <?php
94
  foreach (get_post_types() as $key => $value) {
@@ -101,20 +109,20 @@
101
  ?>
102
  </select>
103
  </td>
104
- <td class='exportdatatype'><label> <input type="radio" name="export" value="woocommerce" id="woocommerce" onclick="export_check(this.value);"><span id="align"> Woo-Commerce</span> <span class="mandatory">*</span></label></td>
105
  </tr>
106
  <tr>
107
- <td class='exportdatatype'><label> <input type="radio" name="export" value="category" id="category" onclick="export_check(this.value);"><span id="align"> Category</span><span class="mandatory">*</span></label></td>
108
- <td class='exportdatatype'><label> <input type="radio" name="export" value="marketpress" id="marketpress" onclick="export_check(this.value);"><span id="align"> Marketpress</span> <span class="mandatory">*</span></label></td>
109
  </tr>
110
  <tr>
111
- <td class='exportdatatype'><label> <input type="radio" name="export" value="tags" id="tags" onclick="export_check(this.value);"><span id="align"> Tags</span> <span class="mandatory">*</span></label></td>
112
- <td class='exportdatatype'><label> <input type="radio" name="export" value="customerreviews" id="customerreviews" onclick="export_check(this.value);"><span id="align"> Customer Reviews</span><span class="mandatory">*</span></label></td>
113
  </tr>
114
  <tr>
115
  <td class='exportdatatype'>
116
- <label> <input type="radio" name="export" value="customtaxonomy" id="customtaxonomy" onclick="export_check(this.value);"><span id="align"> Custom Taxonomy</span> <span class="mandatory">*</span></label>
117
- <select name="export_taxo_type" style="margin-left:10px;">
118
  <option>--Select--</option>
119
  <?php
120
  foreach (get_taxonomies() as $key => $value) {
@@ -126,10 +134,10 @@
126
  }
127
  ?>
128
  </select></td>
129
- <td class='exportdatatype'><label> <input type="radio" name="export" value="comments" id="comments"><span id="align"> Comments</span> </label></td>
130
  </tr>
131
  <tr>
132
- <td class='exportdatatype'><label> <input type="radio" name="export" value="users" id="users"><span id="align"> Users</span> </label></td>
133
  <td class='exportdatatype'></td>
134
  </tr>
135
  </table>
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
  ?>
9
+ <?php
10
+ $siteurl = get_option('siteurl');
11
+ $noncedata = $skinnyData['wp_nonce'];
12
+ ?>
13
+
14
  <div class="accordion" id="accordion2" style = 'width:98%;'>
15
  <div class="accordion-group">
16
+
17
  <div id="collapseTwo" class="accordion-body in collapse">
18
+ <span style="margin: 4% 0px 4% 22%; color: red; font-weight: bold;" name="warning" id="warning" ><p><marquee onmouseover="this.stop();" onmouseout="this.start();"><span>Check your system configuration before proceeding the export. It may help to prevent from facing server configuration issues</span><span style='position:relative;left:4px;'><a href='<?php echo $siteurl?>/wp-admin/admin.php?page=wp-ultimate-csv-importer/index.php&__module=settings'>Click here</a> to refer your server configuration.</span></marquee></p></span>
19
+
20
+ <div class="accordion-inner">
21
+ <div>
22
  <span class="settings-icon"> <img src="<?php echo WP_CONTENT_URL;?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/export.png" width="24" height="24" /> </span>
23
+
24
+ <label> <h3 id="exporttitle">Export Data With Advanced Filters</h3></label>
25
  </div>
26
+ <div style="margin-left:20px;">
 
 
27
  <form class="form-horizontal" method="post" name="exportmodule" action="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>modules/export/templates/export.php" onsubmit="return export_module();">
28
  <!-- <form class="form-horizontal" method="post" name="exportmodule" action="" onsubmit="return export_module();"> -->
29
  <div class="table-responsive">
30
  <table style='width:100%;' class='table exportmodule'>
31
+ <th colspan='2'><label class='h-exportmodule'><h3 id="innertitle"> To export data based on the filters</h3></label></th>
32
  <tr>
33
+ <td><label><input type='checkbox' name='getdataforspecificperiod' id='getdataforspecificperiod' value='getdataforspecificperiod' onclick='addexportfilter(this.id);' /><span id="align"> Export data for the specific period</span></label>
34
  <div id='specificperiodexport' style='padding:10px;display:none;'>
35
  <label id='periodstartfrom'><b> Start From </b></label>
36
  <input type='text' class='form-control' name='postdatefrom' style='cursor:default;width:25%;' readonly id='postdatefrom' value='' />
37
  <label id='periodendto'><b> End To </b></label>
38
  <input type='text' class='form-control' name='postdateto' style='cursor:default;width:25%;' readonly id='postdateto' value='' />
39
+ <input type='hidden' name='nonce' id='nonce' value='<?php if(isset($noncedata)) { echo $noncedata; }?>'>
40
  </div>
41
  </td>
42
  </tr>
43
  <tr>
44
+ <td><label><input type='checkbox' name='getdatawithspecificstatus' id='getdatawithspecificstatus' value='getdatawithspecificstatus' onclick='addexportfilter(this.id);' /><span id="align"> Export data with the specific status</span></label>
45
  <div id='specificstatusexport' style='padding:10px;display:none;'>
46
  <label id='status'><b> Status </b></label>
47
  <select name='postwithstatus' id='postwithstatus'>
57
  </td>
58
  </tr>
59
  <tr>
60
+ <td><label><input type='checkbox' name='getdatabyspecificauthors' id='getdatabyspecificauthors' value='getdatabyspecificauthors' onclick='addexportfilter(this.id);' /><span id="align"> Export data by specific authors</span></label>
61
  <div id='specificauthorexport' style='padding:10px;display:none;'>
62
  <label id='authors'><b> Authors </b></label>
63
  <?php $blogusers = get_users( 'blog_id=1&orderby=nicename' ); ?>
84
  </div>
85
  <div class="table-responsive" id="exporttable">
86
  <table class='table exportmodule'>
87
+ <th colspan='2'><label class='h-exportmodule'><h3 id="innertitle">Select your module to export the data </h3></label></th>
88
  <tr>
89
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="post"><span id="align"> Post</span> </label></td>
90
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="eshop"><span id="align"> Eshop</span> </label></td>
91
  </tr>
92
  <tr>
93
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="page"><span id="align"> Page</span> </label></td>
94
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="wpcommerce"><span id="align"> Wp-Commerce</span></label></td>
95
  </tr>
96
  <tr>
97
  <td class='exportdatatype'>
98
+ <label> <input type="radio" name="export" value="custompost"><span id="align"> Custom Post</span></label>
99
+ <select name="export_post_type" style="margin-left:10px">
100
  <option>--Select--</option>
101
  <?php
102
  foreach (get_post_types() as $key => $value) {
109
  ?>
110
  </select>
111
  </td>
112
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="woocommerce"><span id="align"> Woo-Commerce</span></label></td>
113
  </tr>
114
  <tr>
115
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="category"><span id="align"> Category</span></label></td>
116
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="marketpress"><span id="align"> Marketpress</span></label></td>
117
  </tr>
118
  <tr>
119
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="tags"><span id="align"> Tags </label></span></td>
120
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="customerreviews"><span id="align"> Customer Reviews</span></label></td>
121
  </tr>
122
  <tr>
123
  <td class='exportdatatype'>
124
+ <label> <input type="radio" name="export" value="customtaxonomy"><span id="align"> Custom Taxonomy</span></label>
125
+ <select name="export_taxo_type" style="margin-left:10px;">
126
  <option>--Select--</option>
127
  <?php
128
  foreach (get_taxonomies() as $key => $value) {
134
  }
135
  ?>
136
  </select></td>
137
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="comments"><span id="align"> Comments</span></label></td>
138
  </tr>
139
  <tr>
140
+ <td class='exportdatatype'><label> <input type="radio" name="export" value="users"><span id="align"> Users</span></label></td>
141
  <td class='exportdatatype'></td>
142
  </tr>
143
  </table>
modules/filemanager/actions/actions.php CHANGED
@@ -50,7 +50,9 @@ class FilemanagerActions extends SkinnyActions {
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
 
 
53
  return $data;
54
  }
55
 
56
- }
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
53
+ $helperObj = new WPImporter_includes_helper();
54
+ $data['common_notice'] = $helperObj->common_notice_for_pro_feature();
55
  return $data;
56
  }
57
 
58
+ }
modules/filemanager/templates/index.php CHANGED
@@ -34,6 +34,6 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
- ?><div align='center' style='width:100%;'><img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/Filemanager.png' width=100%>
38
- </div>
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ ?>
38
+ <div align='center' style='width:100%;'><?php echo $skinnyData['common_notice']; ?><img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/Filemanager.png' width=100%></div>
39
 
modules/mappingtemplate/actions/actions.php CHANGED
@@ -50,7 +50,9 @@ class MappingtemplateActions extends SkinnyActions {
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
 
 
53
  return $data;
54
  }
55
 
56
- }
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
53
+ $helperObj = new WPImporter_includes_helper();
54
+ $data['common_notice'] = $helperObj->common_notice_for_pro_feature();
55
  return $data;
56
  }
57
 
58
+ }
modules/mappingtemplate/templates/index.php CHANGED
@@ -35,4 +35,4 @@
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
  ?>
38
- <div align='center' style='width:100%;'> <img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/templates.png' style='width:90%;'></div>
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
  ?>
38
+ <div align='center' style='width:100%;'> <?php echo $skinnyData['common_notice']; ?> <img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/templates.png' style='width:90%;'></div>
modules/page/templates/index.php CHANGED
@@ -44,8 +44,14 @@ $impCE = new WPImporter_includes_helper();
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
48
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
49
  <?php } else { ?>
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
@@ -72,6 +78,7 @@ $impCE = new WPImporter_includes_helper();
72
  <select disabled>
73
  <option value ='select template' /> select template </option>
74
  </select>
 
75
  </div>
76
  </div>
77
  <div style="float:right;">
@@ -484,6 +491,7 @@ $impCE = new WPImporter_includes_helper();
484
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
485
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
486
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();">
 
487
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
488
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
489
  <div class="clear"></div>
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
+ <?php if(is_dir($impCE->getUploadDirectory('default'))){
48
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
49
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
50
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
51
+ }
52
+ } else { ?>
53
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
54
+ <?php }?>
55
  <?php } else { ?>
56
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
57
  <?php } ?>
78
  <select disabled>
79
  <option value ='select template' /> select template </option>
80
  </select>
81
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
82
  </div>
83
  </div>
84
  <div style="float:right;">
491
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
492
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
493
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();">
494
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
495
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
496
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
497
  <div class="clear"></div>
modules/post/templates/index.php CHANGED
@@ -44,8 +44,14 @@ $impCE = new WPImporter_includes_helper();
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
48
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
49
  <?php } else { ?>
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
@@ -71,8 +77,9 @@ $impCE = new WPImporter_includes_helper();
71
  <tr>
72
  <div id='showmappingtemplate' style='float:left;padding-left:10px;'>
73
  <select disabled/>
74
- <option value ='select template' > select template </option>
75
  </select>
 
76
  </div>
77
  <!-- code ends here -->
78
  </div>
@@ -494,6 +501,7 @@ $impCE = new WPImporter_includes_helper();
494
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings('<?php echo site_url(); ?>');" >
495
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
496
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
 
497
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
498
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
499
 
44
  <td>
45
  <h3>CSV Import Options</h3>
46
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
47
+ <?php if(is_dir($impCE->getUploadDirectory('default'))) {
48
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
49
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
50
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
51
+ }
52
+ } else { ?>
53
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
54
+ <?php }?>
55
  <?php } else { ?>
56
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
57
  <?php } ?>
77
  <tr>
78
  <div id='showmappingtemplate' style='float:left;padding-left:10px;'>
79
  <select disabled/>
80
+ <option value ='select template' > select template </option>
81
  </select>
82
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
83
  </div>
84
  <!-- code ends here -->
85
  </div>
501
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings('<?php echo site_url(); ?>');" >
502
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
503
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none" onclick="import_again();" />
504
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
505
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
506
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
507
 
modules/schedulemapping/actions/actions.php CHANGED
@@ -50,7 +50,9 @@ class SchedulemappingActions extends SkinnyActions {
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
 
 
53
  return $data;
54
  }
55
 
56
- }
50
  {
51
  // return an array of name value pairs to send data to the template
52
  $data = array();
53
+ $helperObj = new WPImporter_includes_helper();
54
+ $data['common_notice'] = $helperObj->common_notice_for_pro_feature();
55
  return $data;
56
  }
57
 
58
+ }
modules/schedulemapping/templates/index.php CHANGED
@@ -36,5 +36,4 @@
36
  ********************************************************************************/
37
  ?>
38
 
39
- <div align='center' style='width:100%;'><img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/schedule.png' width=100%>
40
- </div>
36
  ********************************************************************************/
37
  ?>
38
 
39
+ <div align='center' style='width:100%;'><?php echo $skinnyData['common_notice']; ?><img src='<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR ?>images/schedule.png' width=100%></div>
 
modules/settings/actions/actions.php CHANGED
@@ -57,7 +57,7 @@ class SettingsActions extends SkinnyActions
57
  update_option('wpcsvfreesettings',$_POST);
58
  $data['savesettings'] = 'done';
59
  }
60
- $setingsArr = array('post', 'page', 'custompost', 'comments', 'categories', 'customtaxonomy', 'users', 'eshop', 'wpcommerce', 'woocommerce', 'custompostuitype', 'cctm', 'acf', 'aioseo', 'yoastseo', 'enable', 'disable', 'nonerseooption', 'nonercustompost', 'nonerecommerce', 'recommerce','enable_plugin_access_for_author');
61
  foreach($setingsArr as $option)
62
  $data[$option] = "";
63
 
@@ -66,7 +66,6 @@ class SettingsActions extends SkinnyActions
66
  foreach($settings as $settings_key)
67
  $data[$settings_key] = 'checked';
68
 
69
-
70
  //Settings action
71
  //SEO option
72
  $tableseo = get_option('wpcsvfreesettings');
@@ -228,9 +227,19 @@ class SettingsActions extends SkinnyActions
228
  $data['customerreviews'] = 'disablesetting';
229
  }
230
 
231
-
232
-
233
-
 
 
 
 
 
 
 
 
 
 
234
 
235
  //Custom Fields
236
  #$wpmemberoption = $tableseo['rwpmembers'];
57
  update_option('wpcsvfreesettings',$_POST);
58
  $data['savesettings'] = 'done';
59
  }
60
+ $setingsArr = array('post', 'page', 'custompost', 'comments', 'categories', 'customtaxonomy', 'users', 'eshop', 'wpcommerce', 'woocommerce', 'custompostuitype', 'cctm', 'acf', 'aioseo', 'yoastseo', 'enable', 'disable', 'nonerseooption', 'nonercustompost', 'nonerecommerce', 'recommerce','enable_plugin_access_for_author', 'send_log_email', 'enable_debug', 'disable_debug', 'debug_mode');
61
  foreach($setingsArr as $option)
62
  $data[$option] = "";
63
 
66
  foreach($settings as $settings_key)
67
  $data[$settings_key] = 'checked';
68
 
 
69
  //Settings action
70
  //SEO option
71
  $tableseo = get_option('wpcsvfreesettings');
227
  $data['customerreviews'] = 'disablesetting';
228
  }
229
 
230
+ // Debug mode enable / disable
231
+ if(isset($tableseo['debug_mode'])) {
232
+ $debug_mode = $tableseo['debug_mode'];
233
+ } else {
234
+ $debug_mode = '';
235
+ }
236
+ if($debug_mode == 'enable_debug') {
237
+ $data['debugmode_enable'] = 'checked enablesetting';
238
+ $data['debugmode_disable'] = 'disablesetting';
239
+ } else if($debug_mode == 'disable_debug') {
240
+ $data['debugmode_enable'] = 'disablesetting';
241
+ $data['debugmode_disable'] = 'checked enablesetting';
242
+ }
243
 
244
  //Custom Fields
245
  #$wpmemberoption = $tableseo['rwpmembers'];
modules/settings/templates/index.php CHANGED
@@ -35,7 +35,7 @@
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
  ?>
38
-
39
  <div id="ShowMsg" style="display:none;"><p id="warning-msg" class="alert alert-warning"><?php echo $skinnyData['plugStatus'];?></p></div>
40
  <?php if(isset($skinnyData['savesettings']) && $skinnyData['savesettings'] == 'done'){ ?>
41
  <div id="deletesuccess"><p class="alert alert-success">Settings Saved</p></div>
@@ -348,12 +348,12 @@ global $wpdb; ?>
348
  <tr><td>
349
  <h3 id="innertitle">None</h3>
350
  <label>SEO Meta import is disabled.</label> </td><td>
351
- <label id="seosetting1" class="<?php echo $skinnyData['nonerseooption'];?>" ><input type = 'radio' name ='rseooption' id='nonerseooption' value='nonerseooption' <?php echo $skinnyData['nonerseooption']; ?> class='ecommerce' onclick="check_if_avail(this.id);" style="display:none"><span id="seosetting1text"> <?php echo $skinnyData['none_status']; ?> </span> </label>
352
  </td></tr>
353
  <tr><td>
354
  <h3 id="innertitle">All-in-one SEO </h3>
355
  <label>Enable All-in-one SEO import.</label> </td><td>
356
- <label id="seosetting2" class="<?php echo $skinnyData['aioseo']; ?>" ><input type ='radio' name = 'rseooption' id='aioseo' value='aioseo' <?php echo $skinnyData['aioseo']; ?> style="display:none"><span id="seosetting2text"> <?php echo $skinnyData['aioseo_status']; ?> </span></label>
357
  <div id="pluginavail" class="<?php echo $skinnyData['aioseotd'] ?>"> </div>
358
  </td></tr>
359
  <tr><td>
@@ -390,6 +390,12 @@ global $wpdb; ?>
390
  </select>
391
  </label>
392
  </td></tr>
 
 
 
 
 
 
393
  <tr class="databorder"><td>
394
  <h3 id="innertitle">Scheduled log mails</h3>
395
  <label>Enable to get scheduled log mails.</label> </td><td>
@@ -417,7 +423,7 @@ global $wpdb; ?>
417
  <!--div-7-->
418
  <div id="section7" class="databaseoptimization" style="display:none;">
419
  <div class="title">
420
- <h3>Database Optimization </h3>
421
  <span style="float:right;margin-right:168px;margin-top:-35px;">
422
  <a id="checkOpt" onclick="check_if_avail(this.id);" href="#"> Check All </a>
423
  </span>
@@ -476,8 +482,8 @@ global $wpdb; ?>
476
  <div id="data" class="databorder security-perfoemance" >
477
  <table class="securityfeatures">
478
  <tr><td>
479
- <h3 id="innertitle">Allow authors to import</h3>
480
- <label><div>This enables authors to import.</div>
481
  <div>It does not support users.</div></label></td><td>
482
 
483
  <!--<label><input type='checkbox' name='enable_plugin_access_for_author' value='enable_plugin_access_for_author' <?php echo $skinnyData['enable_plugin_access_for_author']; ?> /> Allow authors to import </label>-->
@@ -498,20 +504,22 @@ global $wpdb; ?>
498
  </th><th class='min-requirement-values'>
499
  <label>Minimum Requirements</label>
500
  </th></tr>
501
- <tr><td>post_max_size </td><td class='ini-configured-values'><?php echo ini_get('post_max_size') ?></td><td class='min-requirement-values'></td></tr>
502
- <tr><td>auto_append_file</td><td class='ini-configured-values'><?php echo ini_get('auto_append_file') ?></td><td class='min-requirement-values'></td></tr>
503
- <tr><td>auto_prepend_file </td><td class='ini-configured-values'><?php echo ini_get('auto_prepend_file') ?></td><td class='min-requirement-values'></td></tr>
504
- <tr><td>upload_max_filesize </td><td class='ini-configured-values'><?php echo ini_get('upload_max_filesize') ?></td><td class='min-requirement-values'></td></tr>
505
- <tr><td>file_uploads </td><td class='ini-configured-values'><?php echo ini_get('file_uploads') ?></td><td class='min-requirement-values'></td></tr>
506
- <tr><td>allow_url_fopen </td><td class='ini-configured-values'><?php echo ini_get('allow_url_fopen') ?></td><td class='min-requirement-values'></td></tr>
507
- <tr><td>max_execution_time </td><td class='ini-configured-values'><?php echo ini_get('max_execution_time') ?></td><td class='min-requirement-values'></td></tr>
508
- <tr><td>max_input_time </td><td class='ini-configured-values'><?php echo ini_get('max_input_time') ?></td><td class='min-requirement-values'></td></tr>
509
- <tr><td>max_input_vars </td><td class='ini-configured-values'><?php echo ini_get('max_input_vars') ?></td><td class='min-requirement-values'></td></tr>
510
- <tr><td>memory_limit </td><td class='ini-configured-values'><?php echo ini_get('memory_limit') ?></td><td class='min-requirement-values'></td></tr>
511
  </table>
512
  <h3 id="innertitle" colspan="2" >Required Loaders and Extentions:</h3>
513
  <table class="table table-striped">
514
- <?php $loaders_extensions = get_loaded_extensions();?>
 
 
515
  <tr><td>IonCube Loader </td><td><?php if(in_array('ionCube Loader', $loaders_extensions)) {
516
  echo '<label style="color:green;">Yes</label>';
517
  } else {
@@ -527,6 +535,25 @@ global $wpdb; ?>
527
  } else {
528
  echo '<label style="color:red;">No</label>';
529
  } ?></td><td></td></tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  </table>
531
  <h3 id="innertitle" colspan="2" >Debug Information:</h3>
532
  <table class="table table-striped">
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
  ?>
38
+ <div style ='text-align:center;margin:0;color:red;font-size:smaller;'> Your Required Settings Configuration Please Select Security and Performance tab </div></br>
39
  <div id="ShowMsg" style="display:none;"><p id="warning-msg" class="alert alert-warning"><?php echo $skinnyData['plugStatus'];?></p></div>
40
  <?php if(isset($skinnyData['savesettings']) && $skinnyData['savesettings'] == 'done'){ ?>
41
  <div id="deletesuccess"><p class="alert alert-success">Settings Saved</p></div>
348
  <tr><td>
349
  <h3 id="innertitle">None</h3>
350
  <label>SEO Meta import is disabled.</label> </td><td>
351
+ <label id="seosetting1" class="<?php echo $skinnyData['nonerseooption'];?>" ><input type = 'radio' name ='rseooption' id='nonerseooption' value='nonerseooption' <?php #echo $skinnyData['nonerseooption']; ?> class='ecommerce' onclick="seosetting(this.id);" style="display:none"><span id="seosetting1text"> <?php echo $skinnyData['none_status']; ?> </span> </label>
352
  </td></tr>
353
  <tr><td>
354
  <h3 id="innertitle">All-in-one SEO </h3>
355
  <label>Enable All-in-one SEO import.</label> </td><td>
356
+ <label id="seosetting2" class="<?php echo $skinnyData['aioseo']; ?>" ><input type ='radio' name = 'rseooption' id='aioseo' value='aioseo' <?php echo $skinnyData['aioseo']; ?> onclick="seosetting(this.id);" style="display:none"><span id="seosetting2text"> <?php echo $skinnyData['aioseo_status']; ?> </span></label>
357
  <div id="pluginavail" class="<?php echo $skinnyData['aioseotd'] ?>"> </div>
358
  </td></tr>
359
  <tr><td>
390
  </select>
391
  </label>
392
  </td></tr>
393
+ <tr class="databorder"><td>
394
+ <h3 id="innertitle">Debug Mode</h3>
395
+ <label>You can enable/disable the debug mode.</label> </td><td>
396
+ <label id="debugmode_enable" class="<?php echo $skinnyData['debugmode_enable']; ?>"><input type='radio' name='debug_mode' value='enable_debug' <?php echo $skinnyData['debugmode_enable']; ?> id="enabled" style="display:none" onclick="debugmode_check(this.id);" > On </label>
397
+ <label id="debugmode_disable" class="<?php echo $skinnyData['debugmode_disable']; ?>"><input type='radio' name='debug_mode' value='disable_debug' <?php echo $skinnyData['debugmode_disable']; ?> id="disabled" style="display:none" onclick="debugmode_check(this.id);" > Off </label>
398
+ </td></tr>
399
  <tr class="databorder"><td>
400
  <h3 id="innertitle">Scheduled log mails</h3>
401
  <label>Enable to get scheduled log mails.</label> </td><td>
423
  <!--div-7-->
424
  <div id="section7" class="databaseoptimization" style="display:none;">
425
  <div class="title">
426
+ <h3>Database Optimization <img src="<?php echo WP_CONTENT_URL;?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/pro_icon.gif" title='PRO Feature' /></h3>
427
  <span style="float:right;margin-right:168px;margin-top:-35px;">
428
  <a id="checkOpt" onclick="check_if_avail(this.id);" href="#"> Check All </a>
429
  </span>
482
  <div id="data" class="databorder security-perfoemance" >
483
  <table class="securityfeatures">
484
  <tr><td>
485
+ <h3 id="innertitle">Allow authors/editors to import</h3>
486
+ <label><div>It helps authors/editors can import using importer.</div>
487
  <div>It does not support users.</div></label></td><td>
488
 
489
  <!--<label><input type='checkbox' name='enable_plugin_access_for_author' value='enable_plugin_access_for_author' <?php echo $skinnyData['enable_plugin_access_for_author']; ?> /> Allow authors to import </label>-->
504
  </th><th class='min-requirement-values'>
505
  <label>Minimum Requirements</label>
506
  </th></tr>
507
+ <tr><td>post_max_size </td><td class='ini-configured-values'><?php echo ini_get('post_max_size') ?></td><td class='min-requirement-values'>10M</td></tr>
508
+ <tr><td>auto_append_file</td><td class='ini-configured-values'>-<?php echo ini_get('auto_append_file') ?></td><td class='min-requirement-values'>-</td></tr>
509
+ <tr><td>auto_prepend_file </td><td class='ini-configured-values'>-<?php echo ini_get('auto_prepend_file') ?></td><td class='min-requirement-values'>-</td></tr>
510
+ <tr><td>upload_max_filesize </td><td class='ini-configured-values'><?php echo ini_get('upload_max_filesize') ?></td><td class='min-requirement-values'>2M</td></tr>
511
+ <tr><td>file_uploads </td><td class='ini-configured-values'><?php echo ini_get('file_uploads') ?></td><td class='min-requirement-values'>1</td></tr>
512
+ <tr><td>allow_url_fopen </td><td class='ini-configured-values'><?php echo ini_get('allow_url_fopen') ?></td><td class='min-requirement-values'>1</td></tr>
513
+ <tr><td>max_execution_time </td><td class='ini-configured-values'><?php echo ini_get('max_execution_time') ?></td><td class='min-requirement-values'>3000</td></tr>
514
+ <tr><td>max_input_time </td><td class='ini-configured-values'><?php echo ini_get('max_input_time') ?></td><td class='min-requirement-values'>3000</td></tr>
515
+ <tr><td>max_input_vars </td><td class='ini-configured-values'><?php echo ini_get('max_input_vars') ?></td><td class='min-requirement-values'>3000</td></tr>
516
+ <tr><td>memory_limit </td><td class='ini-configured-values'><?php echo ini_get('memory_limit') ?></td><td class='min-requirement-values'>99M</td></tr>
517
  </table>
518
  <h3 id="innertitle" colspan="2" >Required Loaders and Extentions:</h3>
519
  <table class="table table-striped">
520
+ <?php $loaders_extensions = get_loaded_extensions();
521
+ $mod_security = apache_get_modules();
522
+ ?>
523
  <tr><td>IonCube Loader </td><td><?php if(in_array('ionCube Loader', $loaders_extensions)) {
524
  echo '<label style="color:green;">Yes</label>';
525
  } else {
535
  } else {
536
  echo '<label style="color:red;">No</label>';
537
  } ?></td><td></td></tr>
538
+ <tr><td>Mod Security </td><td><?php if(in_array('mod_security.c', $mod_security)) {
539
+ echo '<label style="color:green;">Yes</label>';
540
+ } else {
541
+ echo '<label style="color:red;">No</label>';
542
+ } ?></td><td>
543
+ <div style='float:left'>
544
+ <a href="#" class="tooltip">
545
+ <img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/help.png" style="margin-left:-74px;"/>
546
+ <span style="margin-left:20px;margin-top:-10px;width:150px;">
547
+ <img class="callout" src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/callout.gif"/>
548
+ <strong>htaccess settings:</strong>
549
+ <p>Locate the .htaccess file in Apache web root,if not create a new file named .htaccess and add the following:</p>
550
+ <b><?php echo '<IfModule mod_security.c>';?> SecFilterEngine Off SecFilterScanPOST Off <?php echo ' </IfModule>';?></b>
551
+
552
+ </span>
553
+ </a>
554
+ </div>
555
+ </td></tr>
556
+
557
  </table>
558
  <h3 id="innertitle" colspan="2" >Debug Information:</h3>
559
  <table class="table table-striped">
modules/users/actions/actions.php CHANGED
@@ -174,12 +174,14 @@ class UsersActions extends SkinnyActions {
174
  if(!empty($getUserId)){
175
  $user_id = $getUserId[0]->ID;
176
  }
177
- if($user_id){
178
  $this->dupPostCount = $this->dupPostCount+1;
179
  $this->detailedLog[$currentLimit][] = "<b>Username</b> - " . $UserLogin . " - already exists(skipped), <b>E-mail</b> - " . $UserEmail . " - found as duplicate.";
180
  }
181
  else{
182
  $user_id = wp_insert_user( $data_array );
 
 
183
  $user = new WP_User( $user_id );
184
  if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
185
  foreach ( $user->roles as $role )
174
  if(!empty($getUserId)){
175
  $user_id = $getUserId[0]->ID;
176
  }
177
+ if(is_array($getUserId) && !empty($getUserId)){
178
  $this->dupPostCount = $this->dupPostCount+1;
179
  $this->detailedLog[$currentLimit][] = "<b>Username</b> - " . $UserLogin . " - already exists(skipped), <b>E-mail</b> - " . $UserEmail . " - found as duplicate.";
180
  }
181
  else{
182
  $user_id = wp_insert_user( $data_array );
183
+ if(is_wp_error($user_id))
184
+ return false;
185
  $user = new WP_User( $user_id );
186
  if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
187
  foreach ( $user->roles as $role )
modules/users/templates/index.php CHANGED
@@ -48,8 +48,14 @@ $impCE = new WPImporter_includes_helper();
48
  <td>
49
  <h3>CSV Import Options</h3>
50
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
51
- <?php if(is_dir($impCE->getUploadDirectory('default'))){ ?>
52
- <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
 
 
 
 
 
 
53
  <?php } else { ?>
54
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
55
  <?php } ?>
@@ -76,6 +82,7 @@ $impCE = new WPImporter_includes_helper();
76
  <select disabled/>
77
  <option value ='select template' /> select template </option>
78
  </select>
 
79
  </div>
80
 
81
  </div>
@@ -413,6 +420,7 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
413
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
414
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
415
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none;" onclick="import_again();" />
 
416
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
417
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
418
  <div class="clear"></div>
48
  <td>
49
  <h3>CSV Import Options</h3>
50
  <div id='sec-one' <?php if($_REQUEST['step']!= 'uploadfile') {?> style='display:none;' <?php } ?>>
51
+ <?php if(is_dir($impCE->getUploadDirectory('default'))){
52
+ if (!is_writable($impCE->getUploadDirectory('default'))) {
53
+ if (!chmod($impCE->getUploadDirectory('default'), 0777)) { ?>
54
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' /> <?php
55
+ }
56
+ } else { ?>
57
+ <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='found' />
58
+ <?php }?>
59
  <?php } else { ?>
60
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
61
  <?php } ?>
82
  <select disabled/>
83
  <option value ='select template' /> select template </option>
84
  </select>
85
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG; ?>/images/pro_icon.gif" title="PRO Feature" />
86
  </div>
87
 
88
  </div>
420
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
421
  <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="display:none;" onclick="terminateProcess();" />
422
  <input class="btn btn-warning" type="button" value="Reload" id="importagain" style="display:none;" onclick="import_again();" />
423
+ <input id="continuebutton" class="btn btn-lg btn-success" type="button" value="Continue" style="display:none;color: #ffffff;" onclick="continueprocess();">
424
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
425
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
426
  <div class="clear"></div>
screenshot-8.png CHANGED
Binary file
templates/import.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/SkinnyBaseActions.php');
39
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php');
40
  $skinnyObj = new CallWPImporterObj();
@@ -220,7 +221,7 @@ if ($totRecords <= ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'] +
220
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId']);
221
  }
222
  if ($limit == $totRecords) {
223
- echo "<br><div style='margin-left:3px;'>Import successfully completed!.</div>";
224
  }
225
  /*if ($curr_action == 'users') {
226
  echo "<div style='margin-left:7px;'>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if(!defined('ABSPATH'))
38
+ die('Your requested url were wrong! Please contact your admin.');
39
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/SkinnyBaseActions.php');
40
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php');
41
  $skinnyObj = new CallWPImporterObj();
221
  unset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId']);
222
  }
223
  if ($limit == $totRecords) {
224
+ echo "<br><div style='margin-left:10px; color:green;'>Import successfully completed!.</div>";
225
  }
226
  /*if ($curr_action == 'users') {
227
  echo "<div style='margin-left:7px;'>";
templates/layout.php CHANGED
@@ -46,7 +46,18 @@
46
  }
47
  else if(isset($_REQUEST['__module']))
48
  {
49
- print_r($skinny_content);
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
  else
52
  {
46
  }
47
  else if(isset($_REQUEST['__module']))
48
  {
49
+ # print_r($skinny_content);
50
+ if (isset($_REQUEST['__module'])) {
51
+ if ( current_user_can( 'administrator' ) ) { //uthor' ) && current_user_can( 'editor' ) ) {
52
+ print_r($skinny_content);
53
+ } else {
54
+ if($_REQUEST['__module'] == 'users' || $_REQUEST['__module'] == 'settings') {
55
+ die('<p id="warning-msg" class="alert alert-warning" style="margin-top:50px;">You are not having the permission to access this page. Please, Contact your administrator.</p>');
56
+ } else {
57
+ print_r($skinny_content);
58
+ }
59
+ }
60
+ }
61
  }
62
  else
63
  {
templates/menu.php CHANGED
@@ -5,14 +5,17 @@
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
-
 
9
  $post = $page = $custompost = $categories = $users = $customtaxonomy = $comments = $eshop = $wpcommerce = $woocommerce = $settings = $support = $dashboard = $export = $mappingtemplate = $filemanager = $schedulemapping = $marketpress = $customerreviews = '';
10
  $impCEM = CallWPImporterObj::getInstance();
11
  $get_settings = array();
12
  $get_settings = $impCEM->getSettings();
13
  $mod = isset($_REQUEST['__module']) ? $_REQUEST['__module'] : '';
14
- foreach ($get_settings as $key) {
15
- $$key = true;
 
 
16
  }
17
  if (isset($_POST['post_csv']) && $_POST['post_csv'] == 'Import') {
18
  $dashboard = 'activate';
@@ -96,7 +99,6 @@ $menuHTML .= "</div>";
96
  $menuHTML .= "<div class='msg' id = 'showMsg' style = 'display:none;'></div>";
97
  $menuHTML .= "<input type='hidden' id='current_url' name='current_url' value='" . get_admin_url() . "admin.php?page=" . WP_CONST_ULTIMATE_CSV_IMP_SLUG . "/index.php&__module=" . $_REQUEST['__module'] . "&step=uploadfile'/>";
98
  $menuHTML .= "<input type='hidden' name='checkmodule' id='checkmodule' value='" . $_REQUEST['__module'] . "' />";
99
- $menuHTML .= "<input type='hidden' name='checkstep' id='checkstep' value='".$_REQUEST['step']."'/>";
100
 
101
  $menuHTML .= "
102
  </nav>";
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
+ if(!defined('ABSPATH'))
9
+ die('Your requested url were wrong! Please contact your admin.');
10
  $post = $page = $custompost = $categories = $users = $customtaxonomy = $comments = $eshop = $wpcommerce = $woocommerce = $settings = $support = $dashboard = $export = $mappingtemplate = $filemanager = $schedulemapping = $marketpress = $customerreviews = '';
11
  $impCEM = CallWPImporterObj::getInstance();
12
  $get_settings = array();
13
  $get_settings = $impCEM->getSettings();
14
  $mod = isset($_REQUEST['__module']) ? $_REQUEST['__module'] : '';
15
+ if( is_array($get_settings) && !empty($get_settings) ) {
16
+ foreach ($get_settings as $key) {
17
+ $$key = true;
18
+ }
19
  }
20
  if (isset($_POST['post_csv']) && $_POST['post_csv'] == 'Import') {
21
  $dashboard = 'activate';
99
  $menuHTML .= "<div class='msg' id = 'showMsg' style = 'display:none;'></div>";
100
  $menuHTML .= "<input type='hidden' id='current_url' name='current_url' value='" . get_admin_url() . "admin.php?page=" . WP_CONST_ULTIMATE_CSV_IMP_SLUG . "/index.php&__module=" . $_REQUEST['__module'] . "&step=uploadfile'/>";
101
  $menuHTML .= "<input type='hidden' name='checkmodule' id='checkmodule' value='" . $_REQUEST['__module'] . "' />";
 
102
 
103
  $menuHTML .= "
104
  </nav>";
templates/savetemplate.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /*********************************************************************************
3
- * WP Ultimate CSV Importer is a Tool for importing CSV for the Wordpress
4
- * plugin developed by Smackcoder. Copyright (C) 2014 Smackcoders.
5
- *
6
- * WP Ultimate CSV Importer is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Affero General Public License version 3
8
- * as published by the Free Software Foundation with the addition of the
9
- * following permission added to Section 15 as permitted in Section 7(a): FOR
10
- * ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY WP Ultimate
11
- * CSV Importer, WP Ultimate CSV Importer DISCLAIMS THE WARRANTY OF NON
12
- * INFRINGEMENT OF THIRD PARTY RIGHTS.
13
- *
14
- * WP Ultimate CSV Importer is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
17
- * License for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public License
20
- * along with this program; if not, see http://www.gnu.org/licenses or write
21
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
- * Boston, MA 02110-1301 USA.
23
- *
24
- * You can contact Smackcoders at email address info@smackcoders.com.
25
- *
26
- * The interactive user interfaces in original and modified versions
27
- * of this program must display Appropriate Legal Notices, as required under
28
- * Section 5 of the GNU Affero General Public License version 3.
29
- *
30
- * In accordance with Section 7(b) of the GNU Affero General Public License
31
- * version 3, these Appropriate Legal Notices must retain the display of the
32
- * WP Ultimate CSV Importer copyright notice. If the display of the logo is
33
- * not reasonably feasible for technical reasons, the Appropriate Legal
34
- * Notices must display the words
35
- * "Copyright Smackcoders. 2014. All rights reserved".
36
- ********************************************************************************/
37
-
38
- require_once('../config/settings.php');
39
- require_once('../lib/skinnymvc/controller/SkinnyController.php');
40
- require_once('../../../../wp-load.php');
41
- if($_REQUEST['stepstatus']){
42
- foreach($_REQUEST as $reqKey => $reqVal){
43
- if($reqKey == 'h2'){
44
- $getArr = explode(',',$reqVal);
45
- foreach($getArr as $v){
46
- $mapArr[] = $v;
47
- }
48
- $_SESSION['SMACK_IMP_OPTIONS']['mapArr'] = $mapArr;
49
- }elseif($reqKey != 'h2'){
50
- $_SESSION['SMACK_IMP_OPTIONS'][$reqKey] = $reqVal;
51
- }
52
- }
53
- print_r(json_encode($_REQUEST));
54
- }
55
- die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/versioncheck.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  global $wpdb;
39
  $all_arr = array();
40
  $all_arr = $_REQUEST['postdata'];
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if(!defined('ABSPATH'))
38
+ die('Your requested url were wrong! Please contact your admin.');
39
  global $wpdb;
40
  $all_arr = array();
41
  $all_arr = $_REQUEST['postdata'];