Ultimate CSV Importer - Version 3.8.1

Version Description

Download this release

Release Info

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

Code changes from version 3.8 to 3.8.1

Files changed (60) hide show
  1. Readme.txt +19 -13
  2. config/settings.php +2 -0
  3. images/csv_importer_dashboard_v3.5.png +0 -0
  4. includes/Importer.php +3 -0
  5. includes/WPImporter_includes_helper.php +5 -0
  6. index.php +37 -2
  7. js/ultimate-importer-free.js +24 -6
  8. lib/jquery-plugins/UploadHandler.php +6 -4
  9. lib/jquery-plugins/index.php +0 -0
  10. lib/jquery-plugins/uploader.php +2 -1
  11. modules/categories/actions/actions.php +3 -1
  12. modules/categories/templates/index.php +2 -1
  13. modules/comments/actions/actions.php +5 -5
  14. modules/comments/templates/index.php +81 -47
  15. modules/custompost/actions/actions.php +2 -1
  16. modules/custompost/templates/index.php +85 -46
  17. modules/customtaxonomy/actions/actions.php +3 -1
  18. modules/customtaxonomy/templates/index.php +2 -0
  19. modules/dashboard/actions/actions.php +2 -0
  20. modules/dashboard/actions/chartone.php +2 -1
  21. modules/dashboard/actions/getInlineGraphValues.php +2 -3
  22. modules/dashboard/actions/managefiles.php +2 -1
  23. modules/dashboard/templates/index.php +11 -11
  24. modules/default/templates/index.php +1 -1
  25. modules/eshop/actions/actions.php +3 -0
  26. modules/eshop/templates/index.php +84 -45
  27. modules/export/actions/actions.php +20 -19
  28. modules/export/templates/export.php +79 -26
  29. modules/export/templates/export_old.php +0 -1400
  30. modules/export/templates/index.php +8 -4
  31. modules/filemanager/actions/actions.php +2 -0
  32. modules/filemanager/templates/index.php +2 -0
  33. modules/mappingtemplate/actions/actions.php +2 -0
  34. modules/mappingtemplate/templates/index.php +2 -0
  35. modules/old_export/actions/actions.php +0 -1428
  36. modules/old_export/templates/export.php +0 -663
  37. modules/old_export/templates/index.php +0 -225
  38. modules/page/actions/actions.php +2 -0
  39. modules/page/templates/index.php +85 -46
  40. modules/post/actions/actions.php +2 -0
  41. modules/post/templates/index.php +82 -41
  42. modules/schedulemapping/actions/actions.php +2 -0
  43. modules/schedulemapping/templates/index.php +2 -0
  44. modules/settings/actions/actions.php +7 -5
  45. modules/settings/templates/index.php +31 -16
  46. modules/support/actions/actions.php +2 -1
  47. modules/support/templates/index.php +3 -2
  48. modules/users/actions/actions.php +2 -0
  49. modules/users/templates/index.php +82 -48
  50. modules/woocommerce/actions/actions.php +3 -1
  51. modules/woocommerce/templates/index.php +2 -1
  52. modules/wpcommerce/actions/actions.php +3 -1
  53. modules/wpcommerce/templates/index.php +2 -1
  54. plugins/class.inlineimages.php +11 -2
  55. templates/import.php +10 -0
  56. templates/menu.php +3 -0
  57. templates/readfile.php +3 -2
  58. templates/savetemplate.php +0 -55
  59. templates/versioncheck.php +2 -0
  60. upgrade/migrationfreev3.6.php +4 -0
Readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
  Tags: wp all import, 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: 4.1
6
- Tested up to: 4.2.2
7
- Stable tag: 3.8
8
- Version: 3.8
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
@@ -53,17 +53,10 @@ It is more easy to import csv database maintained in Excel xls or spread sheets
53
  Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best WordPress themes available online. Now manage multi site & buddy press, Amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
54
 
55
  = Helpful Links =
56
-
57
  [Read More Here>>](http://www.wpultimatecsvimporter.com?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
58
-
59
-
60
  [Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
61
-
62
-
63
- Get Started [Sample CSV Files](https://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
64
-
65
-
66
- Documentation and Tutorial for [CSV Importer ](http://www.wpultimatecsvimporter.com/documentation?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
67
 
68
 
69
  = Video Walkthrough =
@@ -130,7 +123,7 @@ Your WordPress theme should support featured image. If not, please add the follo
130
  * Dashboard, CSV Manager and Custom Mapping Templates
131
  * DB Optimizer, System status etc.
132
 
133
- Compare Free Vs Pro [Features](https://www.wpultimatecsvimporter.com/wp-ultimate-csv-importer-plugin?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
134
  Learn More from [User Manual](https://www.wpultimatecsvimporter.com/documentation?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
135
 
136
 
@@ -210,6 +203,16 @@ This will solve your issue or get support from hosting if you dint have sufficie
210
 
211
  == Changelog ==
212
 
 
 
 
 
 
 
 
 
 
 
213
  = 3.8 =
214
  * Multilanguage support (fr_FR,es_ES,nl_NL)
215
  * Inline image handling shortcode with image attributes
@@ -468,6 +471,9 @@ This will solve your issue or get support from hosting if you dint have sufficie
468
 
469
  == Upgrade Notice ==
470
 
 
 
 
471
  = 3.8 =
472
  * Upgrade now for Multi language support and bug fixes
473
 
3
  Donate link: http://www.smackcoders.com/donate.html
4
  Tags: wp all import, 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: 4.1
6
+ Tested up to: 4.2.4
7
+ Stable tag: 3.8.1
8
+ Version: 3.8.1
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
53
  Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best WordPress themes available online. Now manage multi site & buddy press, Amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
54
 
55
  = Helpful Links =
 
56
  [Read More Here>>](http://www.wpultimatecsvimporter.com?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
 
 
57
  [Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
58
+ Get Started [Sample CSV Files] (https://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
59
+ Documentation and Tutorial for [CSV Importer ] (http://www.wpultimatecsvimporter.com/documentation?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
 
 
 
 
60
 
61
 
62
  = Video Walkthrough =
123
  * Dashboard, CSV Manager and Custom Mapping Templates
124
  * DB Optimizer, System status etc.
125
 
126
+ Compare Free Vs Pro[Features](https://www.wpultimatecsvimporter.com/wp-ultimate-csv-importer-plugin?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
127
  Learn More from [User Manual](https://www.wpultimatecsvimporter.com/documentation?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)>>
128
 
129
 
203
 
204
  == Changelog ==
205
 
206
+
207
+ = 3.8.1 =
208
+ * Added : WordPress 4.2.3 and 4.2.4 compatibility checked.
209
+ * Fixed : Fixed all warning issues.
210
+ * Fixed : XSS vulnerability
211
+ * Fixed : Removed the ../../../../../../wp-load.php and used the wordpress ajax call.
212
+ * Fixed : Removed the wp-content that are directly used in some files.
213
+ * Added : Checked the ABSPATH in each file.
214
+ * Added : Comments are exported by specific date and author option.
215
+
216
  = 3.8 =
217
  * Multilanguage support (fr_FR,es_ES,nl_NL)
218
  * Inline image handling shortcode with image attributes
471
 
472
  == Upgrade Notice ==
473
 
474
+ = 3.8.1 =
475
+ * Must to upgrade security and bug fixes.
476
+
477
  = 3.8 =
478
  * Upgrade now for Multi language support and bug fixes
479
 
config/settings.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  global $wpdb;
39
  DEFINE('WP_DBNAME_CSVIMPORTER', $wpdb->dbname);
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  global $wpdb;
41
  DEFINE('WP_DBNAME_CSVIMPORTER', $wpdb->dbname);
images/csv_importer_dashboard_v3.5.png DELETED
Binary file
includes/Importer.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  class ImporterLib {
3
  var $rzfejj_23 = true;
4
  var $lfxszn_24 = array();
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit; // Exit if accessed directly
4
+
5
  class ImporterLib {
6
  var $rzfejj_23 = true;
7
  var $lfxszn_24 = array();
includes/WPImporter_includes_helper.php CHANGED
@@ -34,6 +34,9 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
 
37
  class WPImporter_includes_helper {
38
 
39
  public function __construct()
@@ -511,8 +514,10 @@ class WPImporter_includes_helper {
511
  $f_img_slug = strtolower(str_replace('','-',$f_img_slug));
512
 
513
  $post_slug_value = strtolower($f_img_slug);
 
514
  $fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
515
  $fimg_name = $fimg_name.'.'.$path_parts['extension'];
 
516
  $this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
517
  $filepath = $fimg_path ."/" . $fimg_name;
518
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
+
40
  class WPImporter_includes_helper {
41
 
42
  public function __construct()
514
  $f_img_slug = strtolower(str_replace('','-',$f_img_slug));
515
 
516
  $post_slug_value = strtolower($f_img_slug);
517
+ if(array_key_exists('extension',$path_parts)){
518
  $fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
519
  $fimg_name = $fimg_name.'.'.$path_parts['extension'];
520
+ }
521
  $this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
522
  $filepath = $fimg_path ."/" . $fimg_name;
523
 
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.8
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
@@ -43,6 +43,8 @@
43
  * Notices must display the words
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') {
@@ -75,7 +77,7 @@ define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-
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.8');
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);
@@ -132,6 +134,18 @@ add_action("admin_menu" , "action_csv_imp_admin_menu");
132
 
133
  function action_csv_imp_admin_init() {
134
  if (isset($_REQUEST['page']) && ($_REQUEST['page'] == 'wp-ultimate-csv-importer/index.php' || $_REQUEST['page'] == 'page')) {
 
 
 
 
 
 
 
 
 
 
 
 
135
  wp_enqueue_script('jquery-ui-datepicker');
136
  wp_enqueue_style('jquery-style', plugins_url('css/jquery-ui.css', __FILE__));
137
  wp_register_script('ultimate-importer-js', plugins_url('js/ultimate-importer-free.js', __FILE__));
@@ -184,6 +198,18 @@ function firstchart() {
184
 
185
  add_action('wp_ajax_firstchart', 'firstchart');
186
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  function secondchart() {
188
  require_once("modules/dashboard/actions/chartone.php");
189
  die();
@@ -266,4 +292,13 @@ die();
266
  }
267
  add_action('wp_ajax_trans_alert_str' , 'trans_alert_str');
268
 
 
 
 
 
 
 
 
 
 
269
 
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.8.1
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
43
  * Notices must display the words
44
  * "Copyright Smackcoders. 2014. All rights reserved".
45
  ********************************************************************************/
46
+ if ( ! defined( 'ABSPATH' ) )
47
+ exit; // Exit if accessed directly
48
 
49
  $get_debug_mode = get_option('wpcsvfreesettings');
50
  if(isset($get_debug_mode['debug_mode']) && $get_debug_mode['debug_mode'] != 'enable_debug') {
77
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
78
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
79
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
80
+ define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.8.1');
81
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
82
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
83
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
134
 
135
  function action_csv_imp_admin_init() {
136
  if (isset($_REQUEST['page']) && ($_REQUEST['page'] == 'wp-ultimate-csv-importer/index.php' || $_REQUEST['page'] == 'page')) {
137
+
138
+ // Code for use the global wordpress functons in javascript
139
+
140
+ /* wp_register_script('ultimate-importer-free', plugins_url('js/ultimate-importer-free.js', __FILE__));
141
+ wp_enqueue_script('ultimate-importer-free',plugins_url('js/ultimate-importer-free.js', __FILE__),array('ultimate-importer-free'));
142
+ $pa = array(
143
+ 'plugin_url' => plugins_url(),
144
+ 'ajax_url' => admin_url( 'admin-ajax.php'),
145
+ 'abspath' => ABSPATH,
146
+ );
147
+ wp_localize_script( 'ultimate-importer-free', 'csvimporterfree', $pa);*/
148
+
149
  wp_enqueue_script('jquery-ui-datepicker');
150
  wp_enqueue_style('jquery-style', plugins_url('css/jquery-ui.css', __FILE__));
151
  wp_register_script('ultimate-importer-js', plugins_url('js/ultimate-importer-free.js', __FILE__));
198
 
199
  add_action('wp_ajax_firstchart', 'firstchart');
200
 
201
+ function shownextrecords() {
202
+ require_once("templates/readfile.php");
203
+ die();
204
+ }
205
+ add_action('wp_ajax_shownextrecords','shownextrecords');
206
+
207
+ function uploadfilehandle() {
208
+ require_once("lib/jquery-plugins/uploader.php");
209
+ die();
210
+ }
211
+ add_action('wp_ajax_uploadfilehandle','uploadfilehandle');
212
+
213
  function secondchart() {
214
  require_once("modules/dashboard/actions/chartone.php");
215
  die();
292
  }
293
  add_action('wp_ajax_trans_alert_str' , 'trans_alert_str');
294
 
295
+ /**
296
+ *
297
+ */
298
+ function export_submit(){
299
+ require_once("modules/export/templates/export.php");
300
+ die;
301
+ }
302
+ add_action('wp_ajax_export_file','export_submit');
303
+
304
 
js/ultimate-importer-free.js CHANGED
@@ -42,13 +42,22 @@ jQuery( document ).ready(function() {
42
  }
43
  if(uploadedFile != '' && select_delim != '') {
44
  var tmpLoc = jQuery('#tmpLoc').val();
45
- var doaction = 'record_no=1&file_name=' + uploadedFile + '&selected_delimeter=' + select_delim + '&checkmodule=' + checkmodule+'&temloc=' + tmpLoc+'&dir_path=' + dir_path + '&wpnonce=' + noncekey;
46
  if(tmpLoc != '' && tmpLoc != null) {
47
  jQuery.ajax({
48
- url: tmpLoc + 'templates/readfile.php',
49
  type: 'post',
50
- data: doaction,
51
  dataType: 'json',
 
 
 
 
 
 
 
 
 
 
52
  success: function (response) {
53
  if (response != null) {
54
  var totalLength = response.length;
@@ -60,6 +69,7 @@ jQuery( document ).ready(function() {
60
  }
61
  }
62
  });
 
63
  function goto_mapping(id){
64
  if(id == 'importfile'){
65
  var currentURL = document.URL;
@@ -107,12 +117,20 @@ function gotoelement(id) {
107
  return false;
108
  }
109
  }
110
- var doaction = 'record_no=' + gotoElement + '&file_name=' + uploadedFile + '&delim='+ delim + '&checkmodule=' + checkmodule+ '&dir_path=' + dir_path + '&wpnonce=' + noncekey;
111
  var tmpLoc = document.getElementById('tmpLoc').value;
112
  jQuery.ajax({
113
- url: tmpLoc + 'templates/readfile.php',
114
  type: 'post',
115
- data: doaction,
 
 
 
 
 
 
 
 
116
  dataType: 'json',
117
  success: function (response) {
118
  var totalLength = response.length;
42
  }
43
  if(uploadedFile != '' && select_delim != '') {
44
  var tmpLoc = jQuery('#tmpLoc').val();
45
+ // var doaction = 'record_no=1&file_name=' + uploadedFile + '&selected_delimeter=' + select_delim + '&checkmodule=' + checkmodule+'&temloc=' + tmpLoc+'&dir_path=' + dir_path + '&wpnonce=' + noncekey;
46
  if(tmpLoc != '' && tmpLoc != null) {
47
  jQuery.ajax({
48
+ url: ajaxurl,
49
  type: 'post',
 
50
  dataType: 'json',
51
+ data: {
52
+ 'record_no' : '1',
53
+ 'file_name' : uploadedFile,
54
+ 'selected_delimeter' : select_delim,
55
+ 'checkmodule' : checkmodule,
56
+ 'temloc' : tmpLoc,
57
+ 'dir_path' : dir_path,
58
+ 'wpnonce' : noncekey,
59
+ 'action' : 'shownextrecords',
60
+ },
61
  success: function (response) {
62
  if (response != null) {
63
  var totalLength = response.length;
69
  }
70
  }
71
  });
72
+
73
  function goto_mapping(id){
74
  if(id == 'importfile'){
75
  var currentURL = document.URL;
117
  return false;
118
  }
119
  }
120
+ // var doaction = 'record_no=' + gotoElement + '&file_name=' + uploadedFile + '&delim='+ delim + '&checkmodule=' + checkmodule+ '&dir_path=' + dir_path + '&wpnonce=' + noncekey;
121
  var tmpLoc = document.getElementById('tmpLoc').value;
122
  jQuery.ajax({
123
+ url: ajaxurl,
124
  type: 'post',
125
+ data: {
126
+ 'record_no' : gotoElement,
127
+ 'file_name' : uploadedFile,
128
+ 'delim' : delim,
129
+ 'checkmodule' : checkmodule,
130
+ 'dir_path' : dir_path,
131
+ 'wpnonce' : noncekey,
132
+ 'action' : 'shownextrecords',
133
+ },
134
  dataType: 'json',
135
  success: function (response) {
136
  var totalLength = response.length;
lib/jquery-plugins/UploadHandler.php CHANGED
@@ -9,8 +9,9 @@
9
  * Licensed under the MIT license:
10
  * http://www.opensource.org/licenses/MIT
11
  */
12
- $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
13
- require_once($parse_uri[0]."wp-load.php");
 
14
  $impCheckobj = CallWPImporterObj::checkSecurity();
15
  if($impCheckobj != 'true')
16
  die($impCheckobj);
@@ -1081,7 +1082,7 @@ class UploadHandler
1081
  protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
1082
  $index = null, $content_range = null)
1083
  {
1084
- $post_url = admin_url() . 'admin.php?page=' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/index.php&__module=' . $_POST['current_module'] . '&step=uploadfile';
1085
  $impCheckobj = CallWPImporterObj::checkSecurity();
1086
  if($impCheckobj != 'true')
1087
  die($impCheckobj);
@@ -1405,7 +1406,7 @@ class UploadHandler
1405
  );
1406
  }
1407
  # code added by goku to get the uploaded filename
1408
- $files[0]->uploadedname = $upload['name'][0];
1409
  return $this->generate_response(
1410
  array($this->options['param_name'] => $files),
1411
  $print_response
@@ -1438,3 +1439,4 @@ class UploadHandler
1438
  }
1439
 
1440
  }
 
9
  * Licensed under the MIT license:
10
  * http://www.opensource.org/licenses/MIT
11
  */
12
+ if ( ! defined( 'ABSPATH' ) )
13
+ exit; // Exit if accessed directly
14
+
15
  $impCheckobj = CallWPImporterObj::checkSecurity();
16
  if($impCheckobj != 'true')
17
  die($impCheckobj);
1082
  protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
1083
  $index = null, $content_range = null)
1084
  {
1085
+ $post_url = admin_url() . 'admin.php?page=' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/index.php&__module=' . $_POST['curr_action']. '&step=uploadfile';
1086
  $impCheckobj = CallWPImporterObj::checkSecurity();
1087
  if($impCheckobj != 'true')
1088
  die($impCheckobj);
1406
  );
1407
  }
1408
  # code added by goku to get the uploaded filename
1409
+ $files[0]->uploadedname = $upload['name'];
1410
  return $this->generate_response(
1411
  array($this->options['param_name'] => $files),
1412
  $print_response
1439
  }
1440
 
1441
  }
1442
+
lib/jquery-plugins/index.php DELETED
File without changes
lib/jquery-plugins/uploader.php CHANGED
@@ -9,7 +9,8 @@
9
  * Licensed under the MIT license:
10
  * http://www.opensource.org/licenses/MIT
11
  */
12
-
 
13
  error_reporting(E_ALL | E_STRICT);
14
  require('UploadHandler.php');
15
  $current_user = wp_get_current_user();
9
  * Licensed under the MIT license:
10
  * http://www.opensource.org/licenses/MIT
11
  */
12
+ if ( ! defined( 'ABSPATH' ) )
13
+ exit; // Exit if accessed directly
14
  error_reporting(E_ALL | E_STRICT);
15
  require('UploadHandler.php');
16
  $current_user = wp_get_current_user();
modules/categories/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class CategoriesActions extends SkinnyActions {
39
 
@@ -53,4 +55,4 @@ class CategoriesActions extends SkinnyActions {
53
  return $data;
54
  }
55
 
56
- }
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class CategoriesActions extends SkinnyActions {
41
 
55
  return $data;
56
  }
57
 
58
+ }
modules/categories/templates/index.php CHANGED
@@ -34,5 +34,6 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.')."</p></div>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.')."</p></div>";
modules/comments/actions/actions.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  class CommentsActions extends SkinnyActions
39
  {
40
  public function __construct()
@@ -319,20 +320,19 @@ class CommentsActions extends SkinnyActions
319
  if($post_exists)
320
  {
321
  $commentid=wp_insert_comment($dat_array);
322
-
323
  if($commentid) {
324
  $this->insPostCount+=1;
325
- $this->detailedLog[$currentLimit][] = "Comment added to <b>Post_ID</b> - " . $dat_array ['comment_post_ID'] . ", <b>Author</b> - " . $dat_array['comment_author'] . ", <b>Author Email</b> - " . $dat_array['comment_author_email'] . ", <b>Author URL</b> - " . $dat_array['comment_author_url'] . ", <b>Date</b> - " . $dat_array['comment_date'] . ", <b>Verify Here</b> - <a href='" . get_permalink( $post_id ) . "' rel='permalink'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "'>" . __( 'Admin View' ) . "</a>";
326
  }
327
  else {
328
  $this->dupPostCount+=1;
329
- $this->detailedLog[$currentLimit][] = "<b>Comment - </b>skipped, <b>Post_ID</b> - " . $dat_array ['comment_post_ID']. " not available";
330
  }
331
  }
332
  else
333
  {
334
  $this->dupPostCount+=1;
335
- $this->detailedLog[$currentLimit][] = "<b>Comment - </b>skipped, <b>Post_ID</b> - " . $dat_array ['comment_post_ID']. " not available";
336
  }
337
  return $commentid;
338
  }//add comments ends
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  class CommentsActions extends SkinnyActions
40
  {
41
  public function __construct()
320
  if($post_exists)
321
  {
322
  $commentid=wp_insert_comment($dat_array);
 
323
  if($commentid) {
324
  $this->insPostCount+=1;
325
+ $this->detailedLog[][] = "Comment added to <b>Post_ID</b> - " . $dat_array ['comment_post_ID'] . ", <b>Author</b> - " . $dat_array['comment_author'] . ", <b>Author Email</b> - " . $dat_array['comment_author_email'] . ", <b>Author URL</b> - " . $dat_array['comment_author_url'] . ", <b>Date</b> - " . $dat_array['comment_date'] . ", <b>Verify Here</b> - <a href='" . get_permalink( $post_id ) . "' rel='permalink'>" . __( 'Web View' ) . "</a> | <a href='" . get_edit_post_link( $post_id, true ) . "' title='" . esc_attr( __( 'Edit this item' ) ) . "'>" . __( 'Admin View' ) . "</a>";
326
  }
327
  else {
328
  $this->dupPostCount+=1;
329
+ $this->detailedLog[][] = "<b>Comment - </b>skipped, <b>Post_ID</b> - " . $dat_array ['comment_post_ID']. " not available";
330
  }
331
  }
332
  else
333
  {
334
  $this->dupPostCount+=1;
335
+ $this->detailedLog[][] = "<b>Comment - </b>skipped, <b>Post_ID</b> - " . $dat_array ['comment_post_ID']. " not available";
336
  }
337
  return $commentid;
338
  }//add comments ends
modules/comments/templates/index.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
  $impCE = new WPImporter_includes_helper();
38
  $nonce_Key = $impCE->create_nonce_key();
39
  ?>
@@ -113,51 +115,83 @@ jQuery('#warning').css('font-weight','bold');
113
  jQuery('#progress .progress-bar').css('visibility','hidden');
114
  }
115
  else{
116
- jQuery(function () {
117
- 'use strict';
118
- var uploadPath = document.getElementById('uploaddir').value;
119
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
120
- jQuery('#fileupload').fileupload({
121
- url: url,
122
- dataType: 'json',
123
- done: function (e, data) {
124
- jQuery.each(data.result.files, function (index, file) {
125
- document.getElementById('uploadFileName').value=file.name;
126
- var filewithmodule = file.uploadedname.split(".csv");
127
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
128
- document.getElementById('upload_csv_realname').value = file.uploadedname;
129
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
130
- var get_version2 = get_version1[1].split(".csv");
131
- var get_version3 = get_version2[0].split("-");
132
- document.getElementById('current_file_version').value = get_version3[1];
133
- jQuery('#uploadedfilename').val(file.uploadedname);
134
- jQuery( "#filenamedisplay" ).empty(); //alert(file.size);
135
- if(file.size>1024 && file.size<(1024*1024))
136
- {
137
- var fileSize =(file.size/1024).toFixed(2)+' kb';
138
- }
139
- else if(file.size>(1024*1024))
140
- {
141
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
142
- }
143
- else
144
- {
145
- var fileSize= (file.size)+' byte';
146
- }
147
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
148
- jQuery('#importfile').attr('disabled', false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
- });
151
- },
152
- progressall: function (e, data) {
153
- var progress = parseInt(data.loaded / data.total * 100, 10);
154
- jQuery('#progress .progress-bar').css(
155
- 'width',
156
- progress + '%'
157
- );
158
- }
159
- }).prop('disabled', !jQuery.support.fileInput)
160
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
161
  });
162
  }
163
  </script>
@@ -304,11 +338,11 @@ $allcustomposts.=$value.',';
304
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;" value="<?php echo $value ?>"/>
305
  <span style="display: none;" id="customspan<?php echo $count ?>">
306
  <a href="#" class="tooltip">
307
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
308
  <span class="tooltipFour">
309
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
310
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
311
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
312
  </span>
313
  </a>
314
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $impCE = new WPImporter_includes_helper();
40
  $nonce_Key = $impCE->create_nonce_key();
41
  ?>
115
  jQuery('#progress .progress-bar').css('visibility','hidden');
116
  }
117
  else{
118
+ jQuery(function () {
119
+ 'use strict';
120
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
121
+ var filesdata;
122
+ var uploadPath = document.getElementById('uploaddir').value;
123
+ function prepareUpload(event){
124
+ filesdata = event.target.files;
125
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
126
+ var frmdata = new FormData();
127
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
128
+ frmdata.append('files', uploadfile_data);
129
+ frmdata.append('action','uploadfilehandle');
130
+ frmdata.append('curr_action', curraction);
131
+ frmdata.append('uploadPath', uploadPath);
132
+ jQuery.ajax({
133
+ url : ajaxurl,
134
+ type : 'post',
135
+ data : frmdata,
136
+ cache: false,
137
+ contentType : false,
138
+ processData: false,
139
+ success : function(data) {
140
+ var fileobj =JSON.parse(data);
141
+ jQuery.each(fileobj,function(objkey,objval){
142
+ jQuery.each(objval,function(o_key,file){
143
+ document.getElementById('uploadFileName').value=file.name;
144
+ var filewithmodule = file.uploadedname.split(".");
145
+ var check_file = filewithmodule[filewithmodule.length - 1];
146
+ if(check_file != "csv" && check_file != "txt") {
147
+ alert('Un Supported File Format');
148
+ return false;
149
+ }
150
+ if(check_file == "csv"){
151
+ var filenamecsv = file.uploadedname.split(".csv");
152
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
153
+ }
154
+ if(check_file == "txt"){
155
+ var filenametxt = file.uploadedname.split(".txt");
156
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
157
+ }
158
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
159
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
160
+ var get_version2 = get_version1[1].split(".csv");
161
+ var get_version3 = get_version2[0].split("-");
162
+ document.getElementById('current_file_version').value = get_version3[1];
163
+ jQuery('#uploadedfilename').val(file.uploadedname);
164
+ jQuery( "#filenamedisplay" ).empty();
165
+ if(file.size>1024 && file.size<(1024*1024))
166
+ {
167
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
168
+ }
169
+ else if(file.size>(1024*1024))
170
+ {
171
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
172
+ }
173
+ else
174
+ {
175
+ var fileSize= (file.size)+' byte';
176
+ }
177
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
178
+ jQuery('#importfile').attr('disabled', false);
179
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
180
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
181
+ });
182
+ });
183
 
184
+ }
185
+ });
186
+ }
187
+ jQuery('#fileupload').on('change', prepareUpload);
188
+ jQuery('#fileupload').fileupload({
189
+ url : url,
190
+ progressall: function (e, data) {
191
+ var progress = parseInt(data.loaded / data.total * 100, 10);
192
+ jQuery('#progress .progress-bar').css('width', progress + '%' );
193
+ }
194
+ });
195
  });
196
  }
197
  </script>
338
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;" value="<?php echo $value ?>"/>
339
  <span style="display: none;" id="customspan<?php echo $count ?>">
340
  <a href="#" class="tooltip">
341
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
342
  <span class="tooltipFour">
343
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
344
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
345
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
346
  </span>
347
  </a>
348
  </span>
modules/custompost/actions/actions.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  class CustompostActions extends SkinnyActions {
39
 
40
  public function __construct()
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  class CustompostActions extends SkinnyActions {
40
 
41
  public function __construct()
modules/custompost/templates/index.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  $impCE = new WPImporter_includes_helper();
39
  $nonce_Key = $impCE->create_nonce_key();
40
  ?>
@@ -111,47 +112,85 @@ $nonce_Key = $impCE->create_nonce_key();
111
  jQuery('#progress .progress-bar').css('visibility','hidden');
112
  }
113
  else{
114
- jQuery(function () {
115
- 'use strict';
116
- var uploadPath = document.getElementById('uploaddir').value;
117
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
118
- jQuery('#fileupload').fileupload({
119
- url: url,
120
- dataType: 'json',
121
- done: function (e, data) {
122
- jQuery.each(data.result.files, function (index, file) {
123
- document.getElementById('uploadFileName').value=file.name;
124
- var filewithmodule = file.uploadedname.split(".csv");
125
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
126
- document.getElementById('upload_csv_realname').value = file.uploadedname;
127
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
128
- var get_version2 = get_version1[1].split(".csv");
129
- var get_version3 = get_version2[0].split("-");
130
- document.getElementById('current_file_version').value = get_version3[1];
131
- jQuery('#uploadedfilename').val(file.uploadedname);
132
- jQuery( "#filenamedisplay").empty();
133
- if(file.size>1024 && file.size<(1024*1024))
134
- {
135
- var fileSize =(file.size/1024).toFixed(2)+' kb';
136
- }
137
- else if(file.size>(1024*1024))
138
- {
139
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
140
- }
141
- else
142
- {
143
- var fileSize= (file.size)+' byte';
144
- }
145
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
146
- jQuery('#importfile').attr('disabled', false);
147
- });
148
- },progressall: function (e, data) {
149
- var progress = parseInt(data.loaded / data.total * 100, 10);
150
- jQuery('#progress .progress-bar').css('width', progress + '%' );
151
- }
152
- }).prop('disabled', !jQuery.support.fileInput)
153
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
154
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  }
156
  </script>
157
  <input type = 'hidden' name = 'importid' id = 'importid' >
@@ -193,7 +232,7 @@ $nonce_Key = $impCE->create_nonce_key();
193
  $basename_zipfile = $get_basename_zipfile[0];
194
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
195
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
196
- if(class_exists(ZipArchive)){
197
  $zip = new ZipArchive;
198
  if(!empty($uploaded_compressedFile)){
199
  if ($zip->open($uploaded_compressedFile) === TRUE) {
@@ -434,11 +473,11 @@ $nonce_Key = $impCE->create_nonce_key();
434
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="<?php echo __('Replace the default value',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
435
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
436
  <a href="#" class="tooltip">
437
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
438
  <span class="tooltipPostStatus">
439
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
440
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
441
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
442
  </span>
443
  </a>
444
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $impCE = new WPImporter_includes_helper();
40
  $nonce_Key = $impCE->create_nonce_key();
41
  ?>
112
  jQuery('#progress .progress-bar').css('visibility','hidden');
113
  }
114
  else{
115
+ jQuery(function () {
116
+ 'use strict';
117
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
118
+ var filesdata;
119
+ var uploadPath = document.getElementById('uploaddir').value;
120
+ function prepareUpload(event){
121
+ filesdata = event.target.files;
122
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
123
+ var frmdata = new FormData();
124
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
125
+ frmdata.append('files', uploadfile_data);
126
+ frmdata.append('action','uploadfilehandle');
127
+ frmdata.append('curr_action', curraction);
128
+ frmdata.append('uploadPath', uploadPath);
129
+ jQuery.ajax({
130
+ url : ajaxurl,
131
+ type : 'post',
132
+ data : frmdata,
133
+ cache: false,
134
+ contentType : false,
135
+ processData: false,
136
+ success : function(data) {
137
+ var fileobj =JSON.parse(data);
138
+ jQuery.each(fileobj,function(objkey,objval){
139
+ jQuery.each(objval,function(o_key,file){
140
+ document.getElementById('uploadFileName').value=file.name;
141
+ var filewithmodule = file.uploadedname.split(".");
142
+ var check_file = filewithmodule[filewithmodule.length - 1];
143
+ if(check_file != "csv" && check_file != "txt") {
144
+ alert('Un Supported File Format');
145
+ return false;
146
+ }
147
+ if(check_file == "csv"){
148
+ var filenamecsv = file.uploadedname.split(".csv");
149
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
150
+ }
151
+ if(check_file == "txt"){
152
+ var filenametxt = file.uploadedname.split(".txt");
153
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
154
+ }
155
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
156
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
157
+ var get_version2 = get_version1[1].split(".csv");
158
+ var get_version3 = get_version2[0].split("-");
159
+ document.getElementById('current_file_version').value = get_version3[1];
160
+ jQuery('#uploadedfilename').val(file.uploadedname);
161
+ jQuery( "#filenamedisplay" ).empty();
162
+ if(file.size>1024 && file.size<(1024*1024))
163
+ {
164
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
165
+ }
166
+ else if(file.size>(1024*1024))
167
+ {
168
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
169
+ }
170
+ else
171
+ {
172
+ var fileSize= (file.size)+' byte';
173
+ }
174
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
175
+ jQuery('#importfile').attr('disabled', false);
176
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
177
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
178
+ });
179
+ });
180
+
181
+ }
182
+ });
183
+ }
184
+ jQuery('#fileupload').on('change', prepareUpload);
185
+ jQuery('#fileupload').fileupload({
186
+ url : url,
187
+ progressall: function (e, data) {
188
+ var progress = parseInt(data.loaded / data.total * 100, 10);
189
+ jQuery('#progress .progress-bar').css('width', progress + '%' );
190
+ }
191
+ });
192
+ });
193
+
194
  }
195
  </script>
196
  <input type = 'hidden' name = 'importid' id = 'importid' >
232
  $basename_zipfile = $get_basename_zipfile[0];
233
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
234
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
235
+ if(class_exists('ZipArchive')){
236
  $zip = new ZipArchive;
237
  if(!empty($uploaded_compressedFile)){
238
  if ($zip->open($uploaded_compressedFile) === TRUE) {
473
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="<?php echo __('Replace the default value',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
474
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
475
  <a href="#" class="tooltip">
476
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
477
  <span class="tooltipPostStatus">
478
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
479
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
480
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
481
  </span>
482
  </a>
483
  </span>
modules/customtaxonomy/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class CustomtaxonomyActions extends SkinnyActions {
39
 
@@ -53,4 +55,4 @@ class CustomtaxonomyActions extends SkinnyActions {
53
  return $data;
54
  }
55
 
56
- }
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class CustomtaxonomyActions extends SkinnyActions {
41
 
55
  return $data;
56
  }
57
 
58
+ }
modules/customtaxonomy/templates/index.php CHANGED
@@ -34,5 +34,7 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
modules/dashboard/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class DashboardActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class DashboardActions extends SkinnyActions {
41
 
modules/dashboard/actions/chartone.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
  if($_REQUEST['postdata']=='firstchartdata')
40
  {
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  global $wpdb;
40
  if($_REQUEST['postdata']=='firstchartdata')
41
  {
modules/dashboard/actions/getInlineGraphValues.php CHANGED
@@ -34,8 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
38
- require_once('../../../../../../wp-load.php');
39
 
40
  ?>
41
  <script src= "<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/js/jquery.js" type="text/javascript"></script>
@@ -45,7 +45,6 @@ require_once('../../../../../../wp-load.php');
45
  var inserted = skipped = updated = [];
46
  </script>
47
  <?php
48
- //require_once('/var/www/newwordpress/wp/wp-load.php');
49
  global $wpdb;
50
  $getDetails = $wpdb->get_results("select * from smackcsv_status_log where sdm_id =".$_REQUEST['sdmid']);
51
  foreach($getDetails as $getDetail){
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  ?>
41
  <script src= "<?php echo WP_CONTENT_URL; ?>/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/js/jquery.js" type="text/javascript"></script>
45
  var inserted = skipped = updated = [];
46
  </script>
47
  <?php
 
48
  global $wpdb;
49
  $getDetails = $wpdb->get_results("select * from smackcsv_status_log where sdm_id =".$_REQUEST['sdmid']);
50
  foreach($getDetails as $getDetail){
modules/dashboard/actions/managefiles.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  $pluginURL = plugins_url();
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');
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $pluginURL = plugins_url();
40
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/SkinnyBaseActions.php');
41
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php');
modules/dashboard/templates/index.php CHANGED
@@ -34,19 +34,20 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  global $wpdb;
39
  $impCE = new WPImporter_includes_helper();
40
 
41
  $dashObj = new DashboardActions();
42
  $ret_arr=array();
43
- if(isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'filenotfound'){
44
  ?>
45
- <script>
46
  showMapMessages('error',translateAlertString('The files does not exist'));
47
- </script>
48
  <?php
49
- } ?>
50
  <div class="box-one">
51
  <div class="top-right-box">
52
  <h3><span style="margin: -5px 5px 5px 5px;"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR;?>images/chart_bar.png" /></span><?php echo __('Importers Activity',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
@@ -75,12 +76,11 @@ if(isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'filenotfound'){
75
  </div>
76
  </div>
77
  </div>-->
78
-
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
  ?>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  global $wpdb;
40
  $impCE = new WPImporter_includes_helper();
41
 
42
  $dashObj = new DashboardActions();
43
  $ret_arr=array();
44
+ #if(isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'filenotfound'){
45
  ?>
46
+ <!--<script>
47
  showMapMessages('error',translateAlertString('The files does not exist'));
48
+ </script>-->
49
  <?php
50
+ #} ?>
51
  <div class="box-one">
52
  <div class="top-right-box">
53
  <h3><span style="margin: -5px 5px 5px 5px;"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR;?>images/chart_bar.png" /></span><?php echo __('Importers Activity',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
76
  </div>
77
  </div>
78
  </div>-->
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/default/templates/index.php CHANGED
@@ -1 +1 @@
1
- <h1>:)</h1>
1
+ <h1>:)</h1>
modules/eshop/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class EshopActions extends SkinnyActions {
39
 
@@ -427,6 +429,7 @@ class EshopActions extends SkinnyActions {
427
  $post_slug_value = strtolower($f_img_slug);
428
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
429
  $impCE = new WPImporter_includes_helper();
 
430
  $fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
431
  $fimg_name = $fimg_name.'.'.$path_parts['extension'];
432
  $impCE->get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value,$currentLimit,$this);
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class EshopActions extends SkinnyActions {
41
 
429
  $post_slug_value = strtolower($f_img_slug);
430
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
431
  $impCE = new WPImporter_includes_helper();
432
+ $path_parts['extension'] = isset($path_parts['extension']) ? $path_parts['extension'] : '';
433
  $fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
434
  $fimg_name = $fimg_name.'.'.$path_parts['extension'];
435
  $impCE->get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value,$currentLimit,$this);
modules/eshop/templates/index.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
38
  $impCE = new WPImporter_includes_helper();
39
  $nonce_Key = $impCE->create_nonce_key();
@@ -150,47 +152,84 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
150
  jQuery('#progress .progress-bar').css('visibility','hidden');
151
  }
152
  else{
153
- jQuery(function () {
154
- 'use strict';
155
- var uploadPath = document.getElementById('uploaddir').value;
156
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
157
- jQuery('#fileupload').fileupload({
158
- url: url,
159
- dataType: 'json',
160
- done: function (e, data) {
161
- jQuery.each(data.result.files, function (index, file) {
162
- document.getElementById('uploadFileName').value=file.name;
163
- var filewithmodule = file.uploadedname.split(".csv");
164
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
165
- document.getElementById('upload_csv_realname').value = file.uploadedname;
166
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
167
- var get_version2 = get_version1[1].split(".csv");
168
- var get_version3 = get_version2[0].split("-");
169
- document.getElementById('current_file_version').value = get_version3[1];
170
- jQuery('#uploadedfilename').val(file.uploadedname);
171
- jQuery( "#filenamedisplay" ).empty();
172
- if(file.size>1024 && file.size<(1024*1024))
173
- {
174
- var fileSize =(file.size/1024).toFixed(2)+' kb';
175
- }
176
- else if(file.size>(1024*1024))
177
- {
178
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
179
- }
180
- else
181
- {
182
- var fileSize= (file.size)+' byte';
183
- }
184
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
185
- jQuery('#importfile').attr('disabled', false);
186
- });
187
- },progressall: function (e, data) {
188
- var progress = parseInt(data.loaded / data.total * 100, 10);
189
- jQuery('#progress .progress-bar').css('width', progress + '%' );
190
- }
191
- }).prop('disabled', !jQuery.support.fileInput)
192
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
193
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  }
195
  </script>
196
  <input type = 'hidden' name = 'importid' id = 'importid' >
@@ -233,7 +272,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
233
  $basename_zipfile = $get_basename_zipfile[0];
234
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
235
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
236
- if(class_exists(ZipArchive)){
237
  $zip = new ZipArchive;
238
  if(!empty($uploaded_compressedFile)){
239
  if ($zip->open($uploaded_compressedFile) === TRUE) {
@@ -417,11 +456,11 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
417
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
418
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
419
  <a href="#" class="tooltip">
420
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
421
  <span class="tooltipPostStatus">
422
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
423
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
424
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
425
  </span>
426
  </a>
427
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
40
  $impCE = new WPImporter_includes_helper();
41
  $nonce_Key = $impCE->create_nonce_key();
152
  jQuery('#progress .progress-bar').css('visibility','hidden');
153
  }
154
  else{
155
+ jQuery(function () {
156
+ 'use strict';
157
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
158
+ var filesdata;
159
+ var uploadPath = document.getElementById('uploaddir').value;
160
+ function prepareUpload(event){
161
+ filesdata = event.target.files;
162
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
163
+ var frmdata = new FormData();
164
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
165
+ frmdata.append('files', uploadfile_data);
166
+ frmdata.append('action','uploadfilehandle');
167
+ frmdata.append('curr_action', curraction);
168
+ frmdata.append('uploadPath', uploadPath);
169
+ jQuery.ajax({
170
+ url : ajaxurl,
171
+ type : 'post',
172
+ data : frmdata,
173
+ cache: false,
174
+ contentType : false,
175
+ processData: false,
176
+ success : function(data) {
177
+ var fileobj =JSON.parse(data);
178
+ jQuery.each(fileobj,function(objkey,objval){
179
+ jQuery.each(objval,function(o_key,file){
180
+ document.getElementById('uploadFileName').value=file.name;
181
+ var filewithmodule = file.uploadedname.split(".");
182
+ var check_file = filewithmodule[filewithmodule.length - 1];
183
+ if(check_file != "csv" && check_file != "txt") {
184
+ alert('Un Supported File Format');
185
+ return false;
186
+ }
187
+ if(check_file == "csv"){
188
+ var filenamecsv = file.uploadedname.split(".csv");
189
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
190
+ }
191
+ if(check_file == "txt"){
192
+ var filenametxt = file.uploadedname.split(".txt");
193
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
194
+ }
195
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
196
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
197
+ var get_version2 = get_version1[1].split(".csv");
198
+ var get_version3 = get_version2[0].split("-");
199
+ document.getElementById('current_file_version').value = get_version3[1];
200
+ jQuery('#uploadedfilename').val(file.uploadedname);
201
+ jQuery( "#filenamedisplay" ).empty();
202
+ if(file.size>1024 && file.size<(1024*1024))
203
+ {
204
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
205
+ }
206
+ else if(file.size>(1024*1024))
207
+ {
208
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
209
+ }
210
+ else
211
+ {
212
+ var fileSize= (file.size)+' byte';
213
+ }
214
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
215
+ jQuery('#importfile').attr('disabled', false);
216
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
217
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
218
+ });
219
+ });
220
+
221
+ }
222
+ });
223
+ }
224
+ jQuery('#fileupload').on('change', prepareUpload);
225
+ jQuery('#fileupload').fileupload({
226
+ url : url,
227
+ progressall: function (e, data) {
228
+ var progress = parseInt(data.loaded / data.total * 100, 10);
229
+ jQuery('#progress .progress-bar').css('width', progress + '%' );
230
+ }
231
+ });
232
+ });
233
  }
234
  </script>
235
  <input type = 'hidden' name = 'importid' id = 'importid' >
272
  $basename_zipfile = $get_basename_zipfile[0];
273
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
274
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
275
+ if(class_exists('ZipArchive')){
276
  $zip = new ZipArchive;
277
  if(!empty($uploaded_compressedFile)){
278
  if ($zip->open($uploaded_compressedFile) === TRUE) {
456
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
457
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
458
  <a href="#" class="tooltip">
459
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
460
  <span class="tooltipPostStatus">
461
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
462
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
463
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
464
  </span>
465
  </a>
466
  </span>
modules/export/actions/actions.php CHANGED
@@ -5,7 +5,8 @@
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
-
 
9
  class ExportActions extends SkinnyActions {
10
  public function __construct() {
11
 
@@ -396,8 +397,8 @@ class ExportActions extends SkinnyActions {
396
  }
397
  } elseif ($exporttype == 'eshop') {
398
  $exporttype = 'post';
399
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
400
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
401
  $result_header_query1 = $wpdb->get_results($header_query1);
402
  $result_header_query2 = $wpdb->get_results($header_query2);
403
  foreach ($result_header_query1 as $rhq1_key) {
@@ -422,14 +423,14 @@ class ExportActions extends SkinnyActions {
422
  $Header[] = 'featured_image';
423
  $Header[] = 'post_tag';
424
  $Header[] = 'post_category';
425
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = 'sku'";
426
 
427
  $result = $wpdb->get_col($get_post_ids);
428
  $fieldsCount = count($result);
429
  if ($result) {
430
  foreach ($result as $postID) {
431
  $pId = $pId . ',' . $postID;
432
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
433
  $result_query1 = $wpdb->get_results($query1);
434
  if (!empty($result_query1)) {
435
  foreach ($result_query1 as $posts) {
@@ -455,7 +456,7 @@ class ExportActions extends SkinnyActions {
455
  }
456
  }
457
  }
458
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
459
  $result_query2 = $wpdb->get_results($query2);
460
  if (!empty($result_query2)) {
461
  foreach ($result_query2 as $postmeta) {
@@ -478,7 +479,7 @@ class ExportActions extends SkinnyActions {
478
  if ($postmeta->meta_key == '_thumbnail_id') {
479
  $attachment_file = '';
480
  #TODO: $attachment_file not used in this function / overwritten immediately
481
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
482
  $attachment = $wpdb->get_results($get_attachement);
483
  $attachment_file = $attachment[0]->guid;
484
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
@@ -624,8 +625,8 @@ class ExportActions extends SkinnyActions {
624
  }
625
  } elseif ($exporttype == 'wpcommerce') {
626
  $exporttype = 'wpsc-product';
627
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
628
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
629
  $result_header_query1 = $wpdb->get_results($header_query1);
630
  $result_header_query2 = $wpdb->get_results($header_query2);
631
  foreach ($result_header_query1 as $rhq1_key) {
@@ -673,13 +674,13 @@ class ExportActions extends SkinnyActions {
673
  $Header[] = 'table_price';
674
  $Header[] = 'google_prohibited';
675
 
676
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_wpsc_sku'";
677
  $result = $wpdb->get_col($get_post_ids);
678
  $fieldsCount = count($result);
679
  if ($result) {
680
  foreach ($result as $postID) {
681
  $pId = $pId . ',' . $postID;
682
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
683
  $result_query1 = $wpdb->get_results($query1);
684
  if (!empty($result_query1)) {
685
  foreach ($result_query1 as $posts) {
@@ -705,7 +706,7 @@ class ExportActions extends SkinnyActions {
705
  }
706
  }
707
  }
708
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
709
  $result_query2 = $wpdb->get_results($query2);
710
  if (!empty($result_query2)) {
711
  foreach ($result_query2 as $postmeta) {
@@ -723,7 +724,7 @@ class ExportActions extends SkinnyActions {
723
  }
724
  if ($postmeta->meta_key == '_thumbnail_id') {
725
  $attachment_file = '';
726
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
727
  $attachment = $wpdb->get_results($get_attachement);
728
  $attachment_file = $attachment[0]->guid;
729
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
@@ -926,8 +927,8 @@ class ExportActions extends SkinnyActions {
926
  }
927
  } elseif ($exporttype == 'woocommerce') {
928
  $exporttype = 'product';
929
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
930
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
931
  $result_header_query1 = $wpdb->get_results($header_query1);
932
  $result_header_query2 = $wpdb->get_results($header_query2);
933
  foreach ($result_header_query1 as $rhq1_key) {
@@ -952,14 +953,14 @@ class ExportActions extends SkinnyActions {
952
  $Header[] = '_product_attribute_visible';
953
  $Header[] = '_product_attribute_variation';
954
 
955
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_sku'";
956
 
957
  $result = $wpdb->get_col($get_post_ids);
958
  $fieldsCount = count($result);
959
  if ($result) {
960
  foreach ($result as $postID) {
961
  $pId = $pId . ',' . $postID;
962
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
963
  $result_query1 = $wpdb->get_results($query1);
964
  if (!empty($result_query1)) {
965
  foreach ($result_query1 as $posts) {
@@ -994,7 +995,7 @@ class ExportActions extends SkinnyActions {
994
  }
995
  }
996
  }
997
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
998
  $result_query2 = $wpdb->get_results($query2);
999
  if (!empty($result_query2)) {
1000
  foreach ($result_query2 as $postmeta) {
@@ -1077,7 +1078,7 @@ class ExportActions extends SkinnyActions {
1077
  }
1078
  if ($postmeta->meta_key == '_thumbnail_id') {
1079
  $attachment_file = '';
1080
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
1081
  $attachment = $wpdb->get_results($get_attachement);
1082
  $attachment_file = $attachment[0]->guid;
1083
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
+ if ( ! defined( 'ABSPATH' ) )
9
+ exit; // Exit if accessed directly
10
  class ExportActions extends SkinnyActions {
11
  public function __construct() {
12
 
397
  }
398
  } elseif ($exporttype == 'eshop') {
399
  $exporttype = 'post';
400
+ $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$exporttype'";
401
+ $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
402
  $result_header_query1 = $wpdb->get_results($header_query1);
403
  $result_header_query2 = $wpdb->get_results($header_query2);
404
  foreach ($result_header_query1 as $rhq1_key) {
423
  $Header[] = 'featured_image';
424
  $Header[] = 'post_tag';
425
  $Header[] = 'post_category';
426
+ $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = 'sku'";
427
 
428
  $result = $wpdb->get_col($get_post_ids);
429
  $fieldsCount = count($result);
430
  if ($result) {
431
  foreach ($result as $postID) {
432
  $pId = $pId . ',' . $postID;
433
+ $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
434
  $result_query1 = $wpdb->get_results($query1);
435
  if (!empty($result_query1)) {
436
  foreach ($result_query1 as $posts) {
456
  }
457
  }
458
  }
459
+ $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
460
  $result_query2 = $wpdb->get_results($query2);
461
  if (!empty($result_query2)) {
462
  foreach ($result_query2 as $postmeta) {
479
  if ($postmeta->meta_key == '_thumbnail_id') {
480
  $attachment_file = '';
481
  #TODO: $attachment_file not used in this function / overwritten immediately
482
+ $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
483
  $attachment = $wpdb->get_results($get_attachement);
484
  $attachment_file = $attachment[0]->guid;
485
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
625
  }
626
  } elseif ($exporttype == 'wpcommerce') {
627
  $exporttype = 'wpsc-product';
628
+ $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$exporttype'";
629
+ $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
630
  $result_header_query1 = $wpdb->get_results($header_query1);
631
  $result_header_query2 = $wpdb->get_results($header_query2);
632
  foreach ($result_header_query1 as $rhq1_key) {
674
  $Header[] = 'table_price';
675
  $Header[] = 'google_prohibited';
676
 
677
+ $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_wpsc_sku'";
678
  $result = $wpdb->get_col($get_post_ids);
679
  $fieldsCount = count($result);
680
  if ($result) {
681
  foreach ($result as $postID) {
682
  $pId = $pId . ',' . $postID;
683
+ $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
684
  $result_query1 = $wpdb->get_results($query1);
685
  if (!empty($result_query1)) {
686
  foreach ($result_query1 as $posts) {
706
  }
707
  }
708
  }
709
+ $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
710
  $result_query2 = $wpdb->get_results($query2);
711
  if (!empty($result_query2)) {
712
  foreach ($result_query2 as $postmeta) {
724
  }
725
  if ($postmeta->meta_key == '_thumbnail_id') {
726
  $attachment_file = '';
727
+ $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
728
  $attachment = $wpdb->get_results($get_attachement);
729
  $attachment_file = $attachment[0]->guid;
730
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
927
  }
928
  } elseif ($exporttype == 'woocommerce') {
929
  $exporttype = 'product';
930
+ $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$exporttype'";
931
+ $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
932
  $result_header_query1 = $wpdb->get_results($header_query1);
933
  $result_header_query2 = $wpdb->get_results($header_query2);
934
  foreach ($result_header_query1 as $rhq1_key) {
953
  $Header[] = '_product_attribute_visible';
954
  $Header[] = '_product_attribute_variation';
955
 
956
+ $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_sku'";
957
 
958
  $result = $wpdb->get_col($get_post_ids);
959
  $fieldsCount = count($result);
960
  if ($result) {
961
  foreach ($result as $postID) {
962
  $pId = $pId . ',' . $postID;
963
+ $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
964
  $result_query1 = $wpdb->get_results($query1);
965
  if (!empty($result_query1)) {
966
  foreach ($result_query1 as $posts) {
995
  }
996
  }
997
  }
998
+ $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
999
  $result_query2 = $wpdb->get_results($query2);
1000
  if (!empty($result_query2)) {
1001
  foreach ($result_query2 as $postmeta) {
1078
  }
1079
  if ($postmeta->meta_key == '_thumbnail_id') {
1080
  $attachment_file = '';
1081
+ $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
1082
  $attachment = $wpdb->get_results($get_attachement);
1083
  $attachment_file = $attachment[0]->guid;
1084
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
modules/export/templates/export.php CHANGED
@@ -5,24 +5,21 @@
5
  * Proprietary and confidential
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
  $nonce = $_POST['nonce'];
14
- //echo '<pre>'; print_r($sitedomain); echo '</pre>';
15
  if ( ! wp_verify_nonce( $nonce, 'my-nonce' ) ) {
16
  // This nonce is not valid.
17
  die( 'Security check: Your requested URL is wrong! Please, Contact your administrator.' );
18
- } else {
19
  // The nonce was valid.
20
  // Do stuff here.
21
- }
22
-
23
  $ExportObj = new WPCSVProExportData();
24
- #print('<pre>'); print_r($_POST); //die;
25
  $ExportObj->executeIndex($_POST);
 
26
  class WPCSVProExportData {
27
  public function __construct() {
28
 
@@ -63,6 +60,7 @@ class WPCSVProExportData {
63
  */
64
  public function generateCSVHeaders($exporttype){
65
  global $wpdb;
 
66
  $post_type = $exporttype;
67
  $unwantedHeader = array('_eshop_product', '_wp_attached_file', '_wp_page_template', '_wp_attachment_metadata', '_encloseme');
68
  if($exporttype == 'woocommerce' || $exporttype == 'marketpress')
@@ -231,7 +229,6 @@ class WPCSVProExportData {
231
  $get_post_ids .= " and p.post_author = {$request['postauthor']}";
232
  }
233
  }
234
- #print_r($get_post_ids); die;
235
  $result = $wpdb->get_col($get_post_ids);
236
  if(isset($request['getdatawithspecificstatus'])) {
237
  if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Sticky') {
@@ -306,9 +303,12 @@ class WPCSVProExportData {
306
  */
307
  public function getTypesFields() {
308
  $wptypesfields = get_option('wpcf-fields');
 
309
  #print('<pre>'); print_r($wptypesfields);
310
- foreach($wptypesfields as $typeFkey){
311
- $typesfields[$typeFkey['meta_key']] = $typeFkey['name'];
 
 
312
  }
313
  #print_r($typesfields);
314
  return $typesfields;
@@ -319,6 +319,7 @@ class WPCSVProExportData {
319
  */
320
  public function getACFvalues($getspecificfieldtype = null) {
321
  global $wpdb;
 
322
  // Code for ACF fields
323
  $get_acf_fields = $wpdb->get_col ( "SELECT meta_value FROM $wpdb->postmeta
324
  GROUP BY meta_key
@@ -326,7 +327,7 @@ class WPCSVProExportData {
326
  ORDER BY meta_key" );
327
 
328
  foreach ( $get_acf_fields as $acf_value ){
329
- $get_acf_field = unserialize($acf_value);
330
  $acf_fields[$get_acf_field['name']] = "CF: ".$get_acf_field['name'];
331
  $acf_fields_slug[$get_acf_field['name']] = "_".$get_acf_field['name'];
332
 
@@ -498,7 +499,7 @@ class WPCSVProExportData {
498
  $export_delimiter = $_POST['postwithdelimiter'];
499
  }elseif(isset($_POST['getdatawithdelimiter']) && !empty($_POST['others_delimiter'])){
500
 
501
- $export_delimiter = $_POST['others_delimiter'];
502
  }else{
503
 
504
  $export_delimiter = ',';
@@ -521,14 +522,16 @@ class WPCSVProExportData {
521
  }
522
  $Header = $this->generateCSVHeaders($exporttype);
523
  $result = $this->get_all_record_ids($exporttype, $request);
 
524
  #print('<pre>'); print_r($Header); print_r($result); print('</pre>'); die;
525
  $fieldsCount = count($result);
526
  if(isset($result)) {
527
  foreach ($result as $postID) {
528
- $pId = $pId . ',' . $postID;
529
  $PostData[$postID] = $this->getPostDatas($postID);
530
  #print('<pre>'); print_r($PostData); #die;
531
  $result_query2 = $this->getPostMetaDatas($postID);
 
532
  #print('<pre>'); print_r($result_query2); print('</pre>'); #die;
533
 
534
  $possible_values = array('s:', 'a:', ':{');
@@ -609,7 +612,7 @@ class WPCSVProExportData {
609
  $eshop_products_unser1 = unserialize($postmeta->meta_value);
610
  $check_attr_count1 = count($eshop_products_unser1);
611
  if($check_attr_count1 == 1){
612
- $eshop_products_unser2 = unserialize($eshop_products_unser1);
613
  $check_attr_count2 = count($eshop_products_unser2);
614
  }
615
  if($check_attr_count1 < $check_attr_count2){
@@ -640,6 +643,7 @@ class WPCSVProExportData {
640
  }
641
  else if ($postmeta->meta_key == '_upsell_ids') {
642
  $upsellids = array();
 
643
  $crosssellids = array();
644
  #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); #print_r($PostMetaData); print('</pre>'); #die;
645
  if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
@@ -758,11 +762,13 @@ class WPCSVProExportData {
758
  #$eshop_products = $postmeta->meta_value;
759
  else if ($postmeta->meta_key == 'products') {
760
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
 
761
  $eshop_products = unserialize($eshop_products);
762
  foreach ($eshop_products as $key) {
763
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
764
  }
765
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
 
766
  } // WooCommerce product meta datas end here
767
  // MarketPress product meta datas starts here
768
  else if ($postmeta->meta_key == 'mp_var_name') {
@@ -809,9 +815,11 @@ class WPCSVProExportData {
809
  else if ($postmeta->meta_key == 'mp_inventory') {
810
  $mp_inventory_value = null;
811
  $mp_prod_inventory_values = unserialize($postmeta->meta_value);
 
812
  foreach($mp_prod_inventory_values as $inventory_values) {
813
  $mp_inventory_value .= $inventory_values. ',';
814
  }
 
815
  $mp_inventory_value = substr($mp_inventory_value, 0, -1);
816
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_inventory_value;
817
  } // MarketPress product meta datas ends here
@@ -917,7 +925,7 @@ class WPCSVProExportData {
917
  $postmeta->meta_key = 'featured_image';
918
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
919
  }
920
- else if(is_array($checkbox_option_fields) && in_array($postmeta->meta_key,$checkbox_option_fields)){
921
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
922
  $eshop_products = unserialize($eshop_products); //print_r($eshop_products);
923
  foreach ($eshop_products as $key) {
@@ -951,7 +959,7 @@ class WPCSVProExportData {
951
  */
952
  }
953
 
954
- #$ExportData = array();
955
  // Merge all arrays
956
  #echo '<pre>'; print_r($TermsData); die;
957
  // echo '<pre>'; print_r($PostData); die('sds');
@@ -1036,22 +1044,31 @@ class WPCSVProExportData {
1036
  }
1037
  #print('<pre>'); print_r($Header); print('</pre>'); #die;
1038
  # print('<pre>'); print_r($ExportData); die;
 
1039
  foreach ($Header as $header_key) {
1040
  if (is_array($ExportData)) {
1041
  foreach ($ExportData as $ED_key => $ED_val) {
1042
  if (in_array($header_key, $this->getAIOSEOfields())) { #die($header_key);
1043
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
 
1044
  $CSVContent[$ED_key][$aioseoval] = $ED_val[$aioseokey];
 
 
1045
  #unset($CSVContent[$ED_key][$header_key]);
1046
  }
1047
  } else if (in_array($header_key, $this->getYoastSEOfields())) {
1048
  foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
 
1049
  $CSVContent[$ED_key][$yoastseoval] = $ED_val[$yoastseokey];
 
1050
  #unset($CSVContent[$ED_key][$header_key]);
1051
  }
1052
  } else if (in_array($header_key, $this->getTypesFields())) {
1053
  foreach($this->getTypesFields() as $typesFkey => $typesFval) {
 
1054
  $CSVContent[$ED_key][$typesFval] = $ED_val[$typesFkey];
 
 
1055
  #unset($CSVContent[$ED_key][$header_key]);
1056
  }
1057
  } else if (array_key_exists($header_key, $ED_val)) {
@@ -1074,6 +1091,7 @@ class WPCSVProExportData {
1074
  public function WPImpExportCategories($request) {
1075
  global $wpdb;
1076
  $exporttype = $request['export'];
 
1077
  if(isset($_POST['getdatawithdelimiter']) && isset($_POST['postwithdelimiter']) && $_POST['postwithdelimiter'] != 'Select'){
1078
  if($_POST['postwithdelimiter'] == "{Space}")
1079
  $export_delimiter = " ";
@@ -1101,7 +1119,7 @@ class WPCSVProExportData {
1101
  $Header[] = 'name';
1102
  $Header[] = 'slug';
1103
  $Header[] = 'description';
1104
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1105
  $Header[] = 'wpseo_title';
1106
  $Header[] = 'wpseo_desc';
1107
  $Header[] = 'wpseo_canonical';
@@ -1129,7 +1147,7 @@ class WPCSVProExportData {
1129
  $TERM_DATA[$categID]['slug'] = $categSlug;
1130
  $TERM_DATA[$categID]['description'] = $categDesc;
1131
  }
1132
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1133
  foreach($seo_yoast_taxonomies['category'] as $taxoKey => $taxoValue){
1134
  $taxoID = $taxoKey;
1135
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
@@ -1153,7 +1171,9 @@ class WPCSVProExportData {
1153
  */
1154
  public function WPImpExportTags($request) {
1155
  global $wpdb;
 
1156
  $exporttype = $request['export'];
 
1157
  /*if(isset($_POST['getdatawithdelimeter']) && isset($_POST['delimeterstatus'])){
1158
  $export_delimiter = $_POST['delimeterstatus'];
1159
  }else{
@@ -1181,7 +1201,7 @@ class WPCSVProExportData {
1181
  $Header[] = 'name';
1182
  $Header[] = 'slug';
1183
  $Header[] = 'description';
1184
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1185
  $Header[] = 'wpseo_title';
1186
  $Header[] = 'wpseo_desc';
1187
  $Header[] = 'wpseo_canonical';
@@ -1189,9 +1209,11 @@ class WPCSVProExportData {
1189
  $Header[] = 'wpseo_sitemap_include';
1190
  }
1191
  $seo_yoast_taxonomies = get_option('wpseo_taxonomy_meta');
 
1192
  foreach($seo_yoast_taxonomies['post_tag'] as $seo_yoast=>$seo){
1193
  $val_seo_yoast = $seo;
1194
  }
 
1195
 
1196
  $get_all_tags = get_tags('hide_empty=0');
1197
  $fieldsCount = count($get_all_tags);
@@ -1204,7 +1226,7 @@ class WPCSVProExportData {
1204
  $TERM_DATA[$tagID]['slug'] = $tagSlug;
1205
  $TERM_DATA[$tagID]['description'] = $tagDesc;
1206
  }
1207
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1208
  foreach($seo_yoast_taxonomies['post_tag'] as $taxoKey => $taxoValue){
1209
  $tagID = $taxoKey;
1210
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
@@ -1229,6 +1251,7 @@ class WPCSVProExportData {
1229
  public function WPImpExportTaxonomies($request) {
1230
  global $wpdb;
1231
  $exporttype = $request['export'];
 
1232
  /* if(isset($_POST['getdatawithdelimeter']) && isset($_POST['delimeterstatus'])){
1233
  $export_delimiter = $_POST['delimeterstatus'];
1234
  }else{
@@ -1258,7 +1281,7 @@ class WPCSVProExportData {
1258
  $Header[] = 'name';
1259
  $Header[] = 'slug';
1260
  $Header[] = 'description';
1261
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1262
  $Header[] = 'wpseo_title';
1263
  $Header[] = 'wpseo_desc';
1264
  $Header[] = 'wpseo_canonical';
@@ -1285,7 +1308,7 @@ class WPCSVProExportData {
1285
  $TERM_DATA[$taxoID]['slug'] = $taxoSlug;
1286
  $TERM_DATA[$taxoID]['description'] = $taxoDesc;
1287
  }
1288
- if($wpcsvsettings['rseooption'] == 'yoastseo'){
1289
  foreach($seo_yoast_taxonomies[$taxonomy_name] as $taxoKey => $taxoValue){
1290
  $taxoID = $taxoKey;
1291
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
@@ -1401,9 +1424,38 @@ class WPCSVProExportData {
1401
  $csv_file_name =$_POST['export_filename'].'.csv';
1402
  else
1403
  $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1404
-
1405
- $commentQuery = "SELECT * FROM $wpdb->comments " . $orderBy;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1406
  $comments = $wpdb->get_results( $commentQuery);
 
1407
  $mappedHeader = false;
1408
  $i = 0;
1409
  foreach($comments as $comment){
@@ -1452,6 +1504,7 @@ class WPCSVProExportData {
1452
  $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1453
 
1454
  $uId = '';
 
1455
  $header_query1 = "SELECT *FROM $wpdb->users";
1456
  $header_query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
1457
  $result_header_query1 = $wpdb->get_results($header_query1);
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
+ /*if(!isset($_SERVER['HTTP_REFERER'])) {
 
9
  die('Your requested url were wrong! Please contact your admin.');
10
+ }*/
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit; // Exit if accessed directly
13
  $nonce = $_POST['nonce'];
 
14
  if ( ! wp_verify_nonce( $nonce, 'my-nonce' ) ) {
15
  // This nonce is not valid.
16
  die( 'Security check: Your requested URL is wrong! Please, Contact your administrator.' );
17
+ }
18
  // The nonce was valid.
19
  // Do stuff here.
 
 
20
  $ExportObj = new WPCSVProExportData();
 
21
  $ExportObj->executeIndex($_POST);
22
+
23
  class WPCSVProExportData {
24
  public function __construct() {
25
 
60
  */
61
  public function generateCSVHeaders($exporttype){
62
  global $wpdb;
63
+ $Header = array();
64
  $post_type = $exporttype;
65
  $unwantedHeader = array('_eshop_product', '_wp_attached_file', '_wp_page_template', '_wp_attachment_metadata', '_encloseme');
66
  if($exporttype == 'woocommerce' || $exporttype == 'marketpress')
229
  $get_post_ids .= " and p.post_author = {$request['postauthor']}";
230
  }
231
  }
 
232
  $result = $wpdb->get_col($get_post_ids);
233
  if(isset($request['getdatawithspecificstatus'])) {
234
  if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Sticky') {
303
  */
304
  public function getTypesFields() {
305
  $wptypesfields = get_option('wpcf-fields');
306
+ $typesfields = array();
307
  #print('<pre>'); print_r($wptypesfields);
308
+ if(!empty($wptypesfields) && is_array($wptypesfields)) {
309
+ foreach($wptypesfields as $typeFkey){
310
+ $typesfields[$typeFkey['meta_key']] = $typeFkey['name'];
311
+ }
312
  }
313
  #print_r($typesfields);
314
  return $typesfields;
319
  */
320
  public function getACFvalues($getspecificfieldtype = null) {
321
  global $wpdb;
322
+ $checkbox_option_fields = $acf_fields = array();
323
  // Code for ACF fields
324
  $get_acf_fields = $wpdb->get_col ( "SELECT meta_value FROM $wpdb->postmeta
325
  GROUP BY meta_key
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
 
499
  $export_delimiter = $_POST['postwithdelimiter'];
500
  }elseif(isset($_POST['getdatawithdelimiter']) && !empty($_POST['others_delimiter'])){
501
 
502
+ $export_delimiter = $_POST['others_delimiter'];
503
  }else{
504
 
505
  $export_delimiter = ',';
522
  }
523
  $Header = $this->generateCSVHeaders($exporttype);
524
  $result = $this->get_all_record_ids($exporttype, $request);
525
+ $PostData = array();
526
  #print('<pre>'); print_r($Header); print_r($result); print('</pre>'); die;
527
  $fieldsCount = count($result);
528
  if(isset($result)) {
529
  foreach ($result as $postID) {
530
+ #$pId = $pId . ',' . $postID;
531
  $PostData[$postID] = $this->getPostDatas($postID);
532
  #print('<pre>'); print_r($PostData); #die;
533
  $result_query2 = $this->getPostMetaDatas($postID);
534
+ $PostMetaData = array();
535
  #print('<pre>'); print_r($result_query2); print('</pre>'); #die;
536
 
537
  $possible_values = array('s:', 'a:', ':{');
612
  $eshop_products_unser1 = unserialize($postmeta->meta_value);
613
  $check_attr_count1 = count($eshop_products_unser1);
614
  if($check_attr_count1 == 1){
615
+ $eshop_products_unser2 = @unserialize($eshop_products_unser1);
616
  $check_attr_count2 = count($eshop_products_unser2);
617
  }
618
  if($check_attr_count1 < $check_attr_count2){
643
  }
644
  else if ($postmeta->meta_key == '_upsell_ids') {
645
  $upsellids = array();
646
+ $upsell_ids = '';
647
  $crosssellids = array();
648
  #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); #print_r($PostMetaData); print('</pre>'); #die;
649
  if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
762
  #$eshop_products = $postmeta->meta_value;
763
  else if ($postmeta->meta_key == 'products') {
764
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
765
+ if(isset($eshop_products)) {
766
  $eshop_products = unserialize($eshop_products);
767
  foreach ($eshop_products as $key) {
768
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
769
  }
770
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
771
+ }
772
  } // WooCommerce product meta datas end here
773
  // MarketPress product meta datas starts here
774
  else if ($postmeta->meta_key == 'mp_var_name') {
815
  else if ($postmeta->meta_key == 'mp_inventory') {
816
  $mp_inventory_value = null;
817
  $mp_prod_inventory_values = unserialize($postmeta->meta_value);
818
+ if(is_array($mp_prod_inventory_values) && !empty($mp_prod_inventory_values)){
819
  foreach($mp_prod_inventory_values as $inventory_values) {
820
  $mp_inventory_value .= $inventory_values. ',';
821
  }
822
+ }
823
  $mp_inventory_value = substr($mp_inventory_value, 0, -1);
824
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_inventory_value;
825
  } // MarketPress product meta datas ends here
925
  $postmeta->meta_key = 'featured_image';
926
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
927
  }
928
+ else if(is_array($this->getACFvalues()) && in_array($postmeta->meta_key, $this->getACFvalues())){
929
  $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
930
  $eshop_products = unserialize($eshop_products); //print_r($eshop_products);
931
  foreach ($eshop_products as $key) {
959
  */
960
  }
961
 
962
+ $ExportData = array();
963
  // Merge all arrays
964
  #echo '<pre>'; print_r($TermsData); die;
965
  // echo '<pre>'; print_r($PostData); die('sds');
1044
  }
1045
  #print('<pre>'); print_r($Header); print('</pre>'); #die;
1046
  # print('<pre>'); print_r($ExportData); die;
1047
+ $CSVContent = array();
1048
  foreach ($Header as $header_key) {
1049
  if (is_array($ExportData)) {
1050
  foreach ($ExportData as $ED_key => $ED_val) {
1051
  if (in_array($header_key, $this->getAIOSEOfields())) { #die($header_key);
1052
  foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
1053
+ if(array_key_exists($aioseokey,$ED_val)){
1054
  $CSVContent[$ED_key][$aioseoval] = $ED_val[$aioseokey];
1055
+ }
1056
+
1057
  #unset($CSVContent[$ED_key][$header_key]);
1058
  }
1059
  } else if (in_array($header_key, $this->getYoastSEOfields())) {
1060
  foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
1061
+ if(array_key_exists($yoastseokey,$ED_val)){
1062
  $CSVContent[$ED_key][$yoastseoval] = $ED_val[$yoastseokey];
1063
+ }
1064
  #unset($CSVContent[$ED_key][$header_key]);
1065
  }
1066
  } else if (in_array($header_key, $this->getTypesFields())) {
1067
  foreach($this->getTypesFields() as $typesFkey => $typesFval) {
1068
+ if(array_key_exists($typesFkey,$ED_val))
1069
  $CSVContent[$ED_key][$typesFval] = $ED_val[$typesFkey];
1070
+ else
1071
+ $CSVContent[$ED_key][$typesFval] = '';
1072
  #unset($CSVContent[$ED_key][$header_key]);
1073
  }
1074
  } else if (array_key_exists($header_key, $ED_val)) {
1091
  public function WPImpExportCategories($request) {
1092
  global $wpdb;
1093
  $exporttype = $request['export'];
1094
+ $wpcsvsettings=get_option('wpcsvfreesettings');
1095
  if(isset($_POST['getdatawithdelimiter']) && isset($_POST['postwithdelimiter']) && $_POST['postwithdelimiter'] != 'Select'){
1096
  if($_POST['postwithdelimiter'] == "{Space}")
1097
  $export_delimiter = " ";
1119
  $Header[] = 'name';
1120
  $Header[] = 'slug';
1121
  $Header[] = 'description';
1122
+ if(is_array($wpcsvsettings) && array_key_exists('rseooption', $wpcsvsettings) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1123
  $Header[] = 'wpseo_title';
1124
  $Header[] = 'wpseo_desc';
1125
  $Header[] = 'wpseo_canonical';
1147
  $TERM_DATA[$categID]['slug'] = $categSlug;
1148
  $TERM_DATA[$categID]['description'] = $categDesc;
1149
  }
1150
+ if(is_array($wpcsvsettings) && array_key_exists('rseooption', $wpcsvsettings) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1151
  foreach($seo_yoast_taxonomies['category'] as $taxoKey => $taxoValue){
1152
  $taxoID = $taxoKey;
1153
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
1171
  */
1172
  public function WPImpExportTags($request) {
1173
  global $wpdb;
1174
+ $wpcsvsettings=get_option('wpcsvfreesettings');
1175
  $exporttype = $request['export'];
1176
+
1177
  /*if(isset($_POST['getdatawithdelimeter']) && isset($_POST['delimeterstatus'])){
1178
  $export_delimiter = $_POST['delimeterstatus'];
1179
  }else{
1201
  $Header[] = 'name';
1202
  $Header[] = 'slug';
1203
  $Header[] = 'description';
1204
+ if(isset($wpcsvsettings['rseooption']) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1205
  $Header[] = 'wpseo_title';
1206
  $Header[] = 'wpseo_desc';
1207
  $Header[] = 'wpseo_canonical';
1209
  $Header[] = 'wpseo_sitemap_include';
1210
  }
1211
  $seo_yoast_taxonomies = get_option('wpseo_taxonomy_meta');
1212
+ if(!empty($seo_yoast_taxonomies) && isset($seo_yoast_taxonomies['post_tag'])){
1213
  foreach($seo_yoast_taxonomies['post_tag'] as $seo_yoast=>$seo){
1214
  $val_seo_yoast = $seo;
1215
  }
1216
+ }
1217
 
1218
  $get_all_tags = get_tags('hide_empty=0');
1219
  $fieldsCount = count($get_all_tags);
1226
  $TERM_DATA[$tagID]['slug'] = $tagSlug;
1227
  $TERM_DATA[$tagID]['description'] = $tagDesc;
1228
  }
1229
+ if(isset($wpcsvsettings['rseooption']) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1230
  foreach($seo_yoast_taxonomies['post_tag'] as $taxoKey => $taxoValue){
1231
  $tagID = $taxoKey;
1232
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
1251
  public function WPImpExportTaxonomies($request) {
1252
  global $wpdb;
1253
  $exporttype = $request['export'];
1254
+ $wpcsvsettings=get_option('wpcsvfreesettings');
1255
  /* if(isset($_POST['getdatawithdelimeter']) && isset($_POST['delimeterstatus'])){
1256
  $export_delimiter = $_POST['delimeterstatus'];
1257
  }else{
1281
  $Header[] = 'name';
1282
  $Header[] = 'slug';
1283
  $Header[] = 'description';
1284
+ if(isset ($wpcsvsettings['rseooption']) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1285
  $Header[] = 'wpseo_title';
1286
  $Header[] = 'wpseo_desc';
1287
  $Header[] = 'wpseo_canonical';
1308
  $TERM_DATA[$taxoID]['slug'] = $taxoSlug;
1309
  $TERM_DATA[$taxoID]['description'] = $taxoDesc;
1310
  }
1311
+ if(isset($wpcsvsettings['rseooption']) && $wpcsvsettings['rseooption'] == 'yoastseo'){
1312
  foreach($seo_yoast_taxonomies[$taxonomy_name] as $taxoKey => $taxoValue){
1313
  $taxoID = $taxoKey;
1314
  $taxo_wpseo_title = $taxoValue['wpseo_title'];
1424
  $csv_file_name =$_POST['export_filename'].'.csv';
1425
  else
1426
  $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1427
+ $commentQuery = "SELECT * FROM $wpdb->comments orderBy";
1428
+ if(isset($request['getdatabyspecificauthors'])) {
1429
+ if(isset($request['postauthor'])){ //&& $request['postauthor'] != 0){
1430
+ $comment_author = $request['postauthor'];
1431
+ $getauthorquery = "select user_login from $wpdb->users where id = $comment_author";
1432
+ $getauthor = $wpdb->get_results( $getauthorquery);
1433
+ if(!empty($getauthor))
1434
+ $comment_author = $getauthor[0]->user_login;
1435
+ else
1436
+ $comment_author = '';
1437
+ }
1438
+ }
1439
+ if(isset($request['getdataforspecificperiod'])) {
1440
+ $commentQuery = "SELECT * FROM $wpdb->comments where comment_date >= '".$request['postdatefrom']."' and comment_date <= '". $request['postdateto']."'";
1441
+ }
1442
+ if(isset($request['getdatabyspecificauthors'])) {
1443
+ if(isset($request['postauthor']) && $request['postauthor'] != 0) {
1444
+ $commentQuery = "SELECT * FROM $wpdb->comments where comment_author = '".$comment_author."'";
1445
+ }
1446
+ }
1447
+ if(isset($request['getdataforspecificperiod']) && isset($request['getdatabyspecificauthors'])){
1448
+ if($commentQuery != null && $commentQuery != '' ){
1449
+ $commentQuery = "SELECT * FROM $wpdb->comments where comment_date >= '".$request['postdatefrom']."' and comment_date <= '". $request['postdateto']."' and comment_author = '".$comment_author."'";
1450
+ }
1451
+ else {
1452
+ $commentQuery = "SELECT * FROM $wpdb->comments where comment_date >= '".$request['postdatefrom']."' and comment_date <= '". $request['postdateto']."'";
1453
+ }
1454
+ }
1455
+
1456
+
1457
  $comments = $wpdb->get_results( $commentQuery);
1458
+ //echo '<pre>';print_r($comments);echo '</pre>';die;
1459
  $mappedHeader = false;
1460
  $i = 0;
1461
  foreach($comments as $comment){
1504
  $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1505
 
1506
  $uId = '';
1507
+ $Header = array();
1508
  $header_query1 = "SELECT *FROM $wpdb->users";
1509
  $header_query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
1510
  $result_header_query1 = $wpdb->get_results($header_query1);
modules/export/templates/export_old.php DELETED
@@ -1,1400 +0,0 @@
1
- <?php
2
- /******************************************************************************************
3
- * Copyright (C) Smackcoders 2014 - All Rights Reserved
4
- * Unauthorized copying of this file, via any medium is strictly prohibited
5
- * Proprietary and confidential
6
- * You can contact Smackcoders at email address info@smackcoders.com.
7
- *******************************************************************************************/
8
-
9
- require_once('../../../../../../wp-load.php');
10
- $ExportObj = new WPCSVProExportData();
11
- #print('<pre>'); print_r($_POST); //die;
12
- $ExportObj->executeIndex($_POST);
13
- class WPCSVProExportData {
14
- public function __construct() {
15
-
16
- }
17
-
18
- /**
19
- * The actions index method
20
- * @param array $request
21
- * @return array
22
- */
23
- public function executeIndex($request) {
24
- #print('<pre>'); print_r($request); print('</pre>'); die;
25
- if($request['export'] == 'category') {
26
- $this->WPImpExportCategories($request);
27
- }
28
- else if($request['export'] == 'tags') {
29
- $this->WPImpExportTags($request);
30
- }
31
- else if($request['export'] == 'customtaxonomy') {
32
- $this->WPImpExportTaxonomies($request);
33
- }
34
- else if($request['export'] == 'customerreviews') {
35
- $this->WPImpExportCustomerReviews($request);
36
- }
37
- else if($request['export'] == 'comments') {
38
- $this->WPImpExportComments($request);
39
- }
40
- else if($request['export'] == 'users') {
41
- $this->WPImpExportUsers($request);
42
- }
43
- else {
44
- $this->WPImpPROExportData($request);#die;
45
- }
46
- }
47
-
48
- /**
49
- *
50
- */
51
- public function generateCSVHeaders($exporttype){
52
- global $wpdb;
53
- $post_type = $exporttype;
54
- $unwantedHeader = array('_eshop_product', '_wp_attached_file', '_wp_page_template', '_wp_attachment_metadata', '_encloseme');
55
- if($exporttype == 'woocommerce' || $exporttype == 'marketpress')
56
- $post_type = 'product';
57
- if($exporttype == 'wpcommerce')
58
- $post_type = 'wpsc-product';
59
- if($exporttype == 'eshop')
60
- $post_type = 'post';
61
- if($exporttype == 'custompost') {
62
- $post_type = $_POST['export_post_type'];
63
- }
64
- $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$post_type'";
65
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') and meta_key NOT LIKE 'field_%' and meta_key NOT LIKE '_wp_types%'";
66
- $result_header_query1 = $wpdb->get_results($header_query1);
67
- $result_header_query2 = $wpdb->get_results($header_query2);
68
-
69
- foreach ($result_header_query1 as $rhq1_key) {
70
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
71
- if (!in_array($rhq1_headkey, $Header))
72
- $Header[] = $rhq1_headkey;
73
- }
74
- }
75
- foreach($this->getACFvalues() as $acfKey => $acfVal) {
76
- $unwantedHeader[] = '_' . $acfKey;
77
- }
78
- foreach($this->getACFvalues() as $acfKey => $acfVal) {
79
- if(!in_array($acfKey, $unwantedHeader)) {
80
- $Header[] = $acfKey;
81
- $unwantedHeader[] = $acfKey;
82
- }
83
- }
84
- foreach($this->getTypesFields() as $typeKey => $typeVal) {
85
- if(!in_array($typeKey, $unwantedHeader)) {
86
- $Header[] = $typeVal;
87
- $unwantedHeader[] = $typeKey;
88
- }
89
- }
90
- foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
91
- $Header[] = $aioseoval;
92
- $unwantedHeader[] = $aioseokey;
93
- }
94
- foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
95
- $Header[] = $yoastseoval;
96
- $unwantedHeader[] = $yoastseokey;
97
- }
98
- foreach ($result_header_query2 as $rhq2_headkey) {
99
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
100
- if(!in_array($rhq2_headkey->meta_key, $unwantedHeader)) {
101
- $Header[] = $rhq2_headkey->meta_key;
102
- }
103
- }
104
- }
105
-
106
- #print('<pre>'); print_r($Header); die;
107
- if($exporttype == 'woocommerce' || $exporttype == 'marketpress' || $exporttype == 'wpcommerce' || $exporttype == 'eshop') {
108
- if($exporttype == 'woocommerce') {
109
- foreach($this->WoocommerceMetaHeaders() as $woo_hkey => $woo_hval) {
110
- if(in_array($woo_hval, $Header))
111
- $ProHeader[] = $woo_hkey;
112
- else
113
- $ProHeader[] = $woo_hkey;
114
- }
115
- }
116
- else if($exporttype == 'marketpress') {
117
- foreach($this->MarketPressHeaders() as $mp_hkey => $mp_hval) {
118
- if(in_array($mp_hval, $Header))
119
- $ProHeader[] = $mp_hkey;
120
- else
121
- $ProHeader[] = $mp_hkey;
122
- }
123
- }
124
- else if($exporttype == 'wpcommerce') {
125
- foreach($this->WpeCommerceHeaders() as $wpcom_hkey => $wpcom_hval) {
126
- if(in_array($wpcom_hval, $Header))
127
- $ProHeader[] = $wpcom_hkey;
128
- else
129
- $ProHeader[] = $wpcom_hkey;
130
- }
131
- }
132
- else if($exporttype == 'eshop') {
133
- foreach($this->EshopHeaders() as $eshop_hkey => $eshop_hval) {
134
- if(in_array($eshop_hval, $Header))
135
- $ProHeader[] = $eshop_hkey;
136
- else
137
- $ProHeader[] = $eshop_hkey;
138
- }
139
- }
140
- foreach($this->getACFvalues() as $acfKey => $acfVal) {
141
- if(!in_array($acfKey, $unwantedHeader)) {
142
- $ProHeader[] = $acfKey;
143
- }
144
- }
145
- foreach($this->getTypesFields() as $typeKey => $typeVal) {
146
- if(!in_array($typeKey, $unwantedHeader)) {
147
- $ProHeader[] = $typeVal;
148
- }
149
- }
150
- foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
151
- $ProHeader[] = $aioseoval;
152
- }
153
- foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
154
- $ProHeader[] = $yoastseoval;
155
- }
156
- $ProHeader[] = 'featured_image';
157
- return $ProHeader;
158
- }
159
- $Header[] = 'featured_image';
160
- return $Header;
161
- }
162
-
163
- /**
164
- *
165
- */
166
- public function get_all_record_ids($exporttype, $request) {
167
- global $wpdb;
168
- $post_type = $exporttype;
169
- $get_post_ids = "select DISTINCT ID from $wpdb->posts p join $wpdb->postmeta pm on pm.post_id = p.ID";
170
- if($post_type == 'woocommerce' || $post_type == 'marketpress')
171
- $post_type = 'product';
172
- if($post_type == 'wpcommerce')
173
- $post_type = 'wpsc-product';
174
- if($post_type == 'eshop')
175
- $post_type = 'post';
176
- if($post_type == 'custompost')
177
- $post_type = $_POST['export_post_type'];
178
-
179
- $get_post_ids .= " where p.post_type = '$post_type'";
180
- if(isset($request['getdatawithspecificstatus'])) {
181
- if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'All') {
182
- $get_post_ids .= " and p.post_status in ('publish','draft','future','private','pending')";
183
- } else if(isset($request['postwithstatus']) && ($request['postwithstatus'] == 'Publish' || $request['postwithstatus'] == 'Sticky')) {
184
- $get_post_ids .= " and p.post_status in ('publish')";
185
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Draft') {
186
- $get_post_ids .= " and p.post_status in ('draft')";
187
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Scheduled') {
188
- $get_post_ids .= " and p.post_status in ('future')";
189
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Private') {
190
- $get_post_ids .= " and p.post_status in ('private')";
191
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Pending') {
192
- $get_post_ids .= " and p.post_status in ('pending')";
193
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Protected') {
194
- $get_post_ids .= " and p.post_status in ('publish') and post_password != ''";
195
- }
196
- } else {
197
- $get_post_ids .= " and p.post_status in ('publish','draft','future','private','pending')";
198
- }
199
- if(isset($request['getdataforspecificperiod'])) {
200
- $get_post_ids .= " and p.post_date >= '" . $request['postdatefrom'] . "' and p.post_date <= '" . $request['postdateto'] . "'";
201
- }
202
- if($exporttype == 'eshop')
203
- $get_post_ids .= " and pm.meta_key = 'sku'";
204
- if($post_type == 'woocommerce')
205
- $get_post_ids .= " and pm.meta_key = '_sku'";
206
- if($post_type == 'marketpress')
207
- $get_post_ids .= " and pm.meta_key = 'mp_sku'";
208
- if($post_type == 'wpcommerce')
209
- $get_post_ids .= " and pm.meta_key = '_wpsc_sku'";
210
-
211
- /* if($exporttype == 'woocommerce') {
212
- $post_type = 'product';
213
- $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'";
214
- } */
215
- if(isset($request['getdatabyspecificauthors'])) {
216
- if(isset($request['postauthor']) && $request['postauthor'] != 0) {
217
- $get_post_ids .= " and p.post_author = {$request['postauthor']}";
218
- }
219
- }
220
- #print_r($get_post_ids); die;
221
- $result = $wpdb->get_col($get_post_ids);
222
- if(isset($request['getdatawithspecificstatus'])) {
223
- if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Sticky') {
224
- $get_sticky_posts = get_option('sticky_posts');
225
- foreach($get_sticky_posts as $sticky_post_id) {
226
- if(in_array($sticky_post_id, $result))
227
- $sticky_posts[] = $sticky_post_id;
228
- }
229
- return $sticky_posts;
230
- }
231
- }
232
- #print_r($get_sticky_posts);
233
- #print_r($result);die;
234
- return $result;
235
- }
236
-
237
- /**
238
- *
239
- */
240
- public function getPostDatas($postID) {
241
- global $wpdb;
242
- $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
243
- $result_query1 = $wpdb->get_results($query1);
244
- if (!empty($result_query1)) {
245
- foreach ($result_query1 as $posts) {
246
- foreach ($posts as $post_key => $post_value) {
247
- if ($post_key == 'post_status') {
248
- if (is_sticky($postID)) {
249
- $PostData[$post_key] = 'Sticky';
250
- $post_status = 'Sticky';
251
- } else {
252
- $PostData[$post_key] = $post_value;
253
- $post_status = $post_value;
254
- }
255
- } else {
256
- $PostData[$post_key] = $post_value;
257
- }
258
- if ($post_key == 'post_password') {
259
- if ($post_value) {
260
- $PostData['post_status'] = "{" . $post_value . "}";
261
- } else {
262
- $PostData['post_status'] = $post_status;
263
- }
264
- }
265
- if ($post_key == 'comment_status') {
266
- if ($post_value == 'closed') {
267
- $PostData['comment_status'] = 0;
268
- }
269
- if ($post_value == 'open') {
270
- $PostData['comment_status'] = 1;
271
- }
272
- }
273
- }
274
- }
275
- }
276
- return $PostData;
277
- }
278
-
279
- /**
280
- *
281
- */
282
- public function getPostMetaDatas($postID) {
283
- global $wpdb;
284
- $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
285
- #print($query2); print('<br>');
286
- $result = $wpdb->get_results($query2);
287
- return $result;
288
- }
289
-
290
- /**
291
- *
292
- */
293
- public function getTypesFields() {
294
- $wptypesfields = get_option('wpcf-fields');
295
- #print('<pre>'); print_r($wptypesfields);
296
- foreach($wptypesfields as $typeFkey){
297
- $typesfields[$typeFkey['meta_key']] = $typeFkey['name'];
298
- }
299
- #print_r($typesfields);
300
- return $typesfields;
301
- }
302
-
303
- /**
304
- *
305
- */
306
- public function getACFvalues($getspecificfieldtype = null) {
307
- global $wpdb;
308
- // Code for ACF fields
309
- $get_acf_fields = $wpdb->get_col ( "SELECT meta_value FROM $wpdb->postmeta
310
- GROUP BY meta_key
311
- HAVING meta_key LIKE 'field_%'
312
- ORDER BY meta_key" );
313
-
314
- foreach ( $get_acf_fields as $acf_value ){
315
- $get_acf_field = unserialize($acf_value);
316
- $acf_fields[$get_acf_field['name']] = "CF: ".$get_acf_field['name'];
317
- $acf_fields_slug[$get_acf_field['name']] = "_".$get_acf_field['name'];
318
-
319
- if($get_acf_field['type'] == 'checkbox'){
320
- $checkbox_option_fields[] = $get_acf_field['name'];
321
- }
322
- } // Code ends here
323
- if($getspecificfieldtype == 'checkbox')
324
- return $checkbox_option_fields;
325
- else
326
- return $acf_fields;
327
- }
328
-
329
-
330
- /**
331
- *
332
- */
333
- public function getAIOSEOfields() {
334
- $aioseofields = array('_aioseop_keywords' => 'seo_keywords',
335
- '_aioseop_description' => 'seo_description',
336
- '_aioseop_title' => 'seo_title',
337
- '_aioseop_noindex' => 'seo_noindex',
338
- '_aioseop_nofollow' => 'seo_nofollow',
339
- '_aioseop_disable' => 'seo_disable',
340
- '_aioseop_disable_analytics' => 'seo_disable_analytics',
341
- '_aioseop_noodp' => 'seo_noodp',
342
- '_aioseop_noydir' => 'seo_noydir',);
343
- return $aioseofields;
344
- }
345
-
346
- /**
347
- *
348
- */
349
- public function getYoastSEOfields () {
350
- $yoastseofields = array('_yoast_wpseo_focuskw' => 'focus_keyword',
351
- '_yoast_wpseo_title' => 'title',
352
- '_yoast_wpseo_metadesc' => 'meta_desc',
353
- '_yoast_wpseo_meta-robots-noindex' => 'meta-robots-noindex',
354
- '_yoast_wpseo_meta-robots-nofollow' => 'meta-robots-nofollow',
355
- '_yoast_wpseo_meta-robots-adv' => 'meta-robots-adv',
356
- '_yoast_wpseo_sitemap-include' => 'sitemap-include',
357
- '_yoast_wpseo_sitemap-prio' => 'sitemap-prio',
358
- '_yoast_wpseo_canonical' => 'canonical',
359
- '_yoast_wpseo_redirect' => 'redirect',
360
- '_yoast_wpseo_opengraph-description' => 'opengraph-description',
361
- '_yoast_wpseo_google-plus-description' => 'google-plus-description',
362
- );
363
- return $yoastseofields;
364
- }
365
-
366
- /**
367
- *
368
- */
369
- public function getAllTerms($postID, $type) {
370
- // Tags & Categories
371
- if($type == 'woocommerce' || $type == 'marketpress') {
372
- $exporttype = 'product';
373
- $postTags = $postCategory = '';
374
- $taxonomies = get_object_taxonomies($exporttype);
375
- $get_tags = get_the_terms( $postID, 'product_tag' );
376
- if($get_tags){
377
- foreach($get_tags as $tags){
378
- $postTags .= $tags->name.',';
379
- }
380
- }
381
- $postTags = substr($postTags,0,-1);
382
- $TermsData['product_tag'] = $postTags;
383
- foreach ($taxonomies as $taxonomy) {
384
- if($taxonomy == 'product_cat' || $taxonomy == 'product_category'){
385
- $get_categotries =wp_get_post_terms( $postID, $taxonomy );
386
- if($get_categotries){
387
- foreach($get_categotries as $category){
388
- $postCategory .= $category->name.'|';
389
- }
390
- }
391
- $postCategory = substr($postCategory, 0 , -1);
392
- $TermsData['product_category'] = $postCategory;
393
- }
394
- }
395
- } else if($type == 'wpcommerce') {
396
- $exporttype = 'wpsc-product';
397
- $postTags = $postCategory = '';
398
- $taxonomies = get_object_taxonomies($exporttype);
399
- $get_tags = get_the_terms( $postID, 'product_tag' );
400
- if($get_tags){
401
- foreach($get_tags as $tags){
402
- $postTags .= $tags->name.',';
403
- }
404
- }
405
- $postTags = substr($postTags,0,-1);
406
- $TermsData['product_tag'] = $postTags;
407
- foreach ($taxonomies as $taxonomy) {
408
- if($taxonomy == 'wpsc_product_category'){
409
- $get_categotries =wp_get_post_terms( $postID, $taxonomy );
410
- if($get_categotries){
411
- foreach($get_categotries as $category){
412
- $postCategory .= $category->name.'|';
413
- }
414
- }
415
- $postCategory = substr($postCategory, 0 , -1);
416
- $TermsData['product_category'] = $postCategory;
417
- }
418
- }
419
- } else {
420
- $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
421
- $postTags = $postCategory = '';
422
- foreach ($get_tags as $tags) {
423
- $postTags .= $tags . ',';
424
- }
425
- $postTags = substr($postTags, 0, -1);
426
- $TermsData['post_tag'] = $postTags;
427
- $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
428
- foreach ($get_categotries as $category) {
429
- $postCategory .= $category . '|';
430
- }
431
- $postCategory = substr($postCategory, 0, -1);
432
- $TermsData['post_category'] = $postCategory;
433
- }
434
- #print('<pre>'); print_r($TermsData); die;
435
- return $TermsData;
436
- }
437
-
438
- /**
439
- *
440
- */
441
- public function MarketPressHeaders() {
442
- $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',);
443
- return $marketpressHeaders;
444
- }
445
-
446
- /**
447
- *
448
- */
449
- public function WpeCommerceHeaders() {
450
- $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',);
451
- return $wpecommerceHeaders;
452
- }
453
-
454
- /**
455
- *
456
- */
457
- public function WoocommerceMetaHeaders() {
458
- $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,);
459
- return $woocomHeaders;
460
- }
461
-
462
- /**
463
- *
464
- */
465
- public function EshopHeaders() {
466
- $eshopHeaders = array('post_title' => 'post_title', 'post_content' => 'post_content', 'post_excerpt' => 'post_excerpt', 'post_date' => 'post_date', 'post_name' => 'post_name', 'post_status' => 'post_status', 'post_author' => 'post_author', 'post_parent' => 0, 'comment_status' => 'open', 'ping_status' => 'open', 'SKU' => 'sku', 'products_option' => 'products_option', 'sale_price' => 'sale_price', 'regular_price' => 'regular_price', 'description' => 'description', 'shiprate' => 'shiprate', 'optset' => null, 'featured_product' => 'featured', 'product_in_sale' => '_eshop_sale', 'stock_available' => '_eshop_stock', 'cart_option' => 'cart_radio', 'category' => 'post_category', 'tags' => 'post_tag', 'featured_image' => null,);
467
- return $eshopHeaders;
468
- }
469
-
470
- /**
471
- * @param $request
472
- * @return array
473
- */
474
- public function WPImpPROExportData($request) {
475
- #print('<pre>'); print_r($this->getACFvalues()); die;
476
- global $wpdb;
477
- $export_delimiter = ',';
478
- $exporttype = $_POST['export'];
479
- $wpcsvsettings=get_option('wpcsvprosettings');
480
- if(isset($wpcsvsettings['export_delimiter'])){
481
- $export_delimiter = $wpcsvsettings['export_delimiter'];
482
- }
483
- if($_POST['export_filename'])
484
- $csv_file_name =$_POST['export_filename'].'.csv';
485
- else
486
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
487
- $wptypesfields = get_option('wpcf-fields');
488
- #print('<pre>'); print_r($wptypesfields); die;
489
- #print('<pre>'); print_r($_POST); print('</pre>');
490
- //if($exporttype=='post' || $exporttype=='page' || $exporttype=='custompost') {
491
- if($exporttype == 'custompost') {
492
- $exporttype = $_POST['export_post_type'];
493
- }
494
- $Header = $this->generateCSVHeaders($exporttype);
495
- $result = $this->get_all_record_ids($exporttype, $request);
496
- #print('<pre>'); print_r($Header); print_r($result); print('</pre>'); die;
497
- $fieldsCount = count($result);
498
- if ($result) {
499
- foreach ($result as $postID) {
500
- $pId = $pId . ',' . $postID;
501
- $PostData[$postID] = $this->getPostDatas($postID);
502
- #print('<pre>'); print_r($PostData); #die;
503
- $result_query2 = $this->getPostMetaDatas($postID);
504
- #print('<pre>'); print_r($result_query2); print('</pre>'); #die;
505
-
506
- $possible_values = array('s:', 'a:', ':{');
507
- if (!empty($result_query2)) {
508
- foreach ($result_query2 as $postmeta) {
509
- $typesFserialized = 0;
510
- $isFound = explode('wpcf-',$postmeta->meta_key);
511
- if(count($isFound) == 2){
512
- foreach($wptypesfields as $typesKey => $typesVal){
513
- if($postmeta->meta_key == 'wpcf-'.$typesKey){
514
- foreach($possible_values as $posval){
515
- if(strpos($postmeta->meta_value,$posval)){
516
- $typesFserialized = 1;
517
- } else {
518
- $typesFserialized = 0;
519
- }
520
- }
521
- if($typesFserialized == 1){
522
- $getMetaData = get_post_meta($postID, $postmeta->meta_key);
523
- if(!is_array($getMetaData[0])){
524
- $get_all_values = unserialize($getMetaData[0]);
525
- $get_values = $get_all_values[0];
526
- } else {
527
- $get_values = $getMetaData[0];
528
- }
529
- $typesFVal = null;
530
- if($typesVal['type'] == 'checkboxes'){
531
- foreach($get_values as $authorKey => $authorVal) {
532
- foreach($typesVal['data']['options'] as $doKey => $doVal){
533
- if($doKey == $authorKey)
534
- $typesFVal .= $doVal['title'].',';
535
- }
536
- }
537
- $typesFVal = substr($typesFVal, 0, -1);
538
- } elseif($typesVal['type'] == 'skype') {
539
- $typesFVal = $get_values['skypename'];
540
- }
541
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $typesFVal;
542
- } else {
543
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
544
- }
545
- }
546
- }
547
- } else {
548
- // ACF checkbox fields
549
- $acfserialized = 0;
550
- if(array_key_exists($postmeta->meta_key, $this->getACFvalues())) {
551
- foreach($possible_values as $posval){
552
- if(strpos($postmeta->meta_value,$posval)){
553
- $acfserialized = 1;
554
- } else {
555
- $acfserialized = 0;
556
- }
557
- }
558
- if($acfserialized == 0) {
559
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
560
- } else {
561
- $acf_checkboxes = $this->getACFvalues('checkbox');
562
- if(in_array($postmeta->meta_key, $acf_checkboxes)) {
563
- $get_all_values = unserialize($postmeta->meta_value);
564
- foreach($get_all_values as $optKey => $optVal) {
565
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $optVal . ',';
566
- }
567
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
568
- }
569
- }
570
- }
571
- // ACF checkbox fields ends here
572
- // WooCommerce product meta datas
573
- else if ($postmeta->meta_key == '_product_attributes') {
574
- #print_r($postmeta->meta_value); #die;
575
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
576
- $product_attribute_name = $product_attribute_value = $product_attribute_visible = $product_attribute_variation = '';
577
- $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = '';
578
- $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = '';
579
- $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = '';
580
- $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = '';
581
- $eshop_products_unser1 = unserialize($postmeta->meta_value);
582
- $check_attr_count1 = count($eshop_products_unser1);
583
- if($check_attr_count1 == 1){
584
- $eshop_products_unser2 = unserialize($eshop_products_unser1);
585
- $check_attr_count2 = count($eshop_products_unser2);
586
- }
587
- if($check_attr_count1 < $check_attr_count2){
588
- $unserialized_attributes = $eshop_products_unser2;
589
- }else{
590
- $unserialized_attributes = $eshop_products_unser1;
591
- }
592
-
593
- foreach ($unserialized_attributes as $key) {
594
- foreach($key as $attr_header => $attr_value){
595
- if($attr_header == 'name')
596
- $product_attribute_name .= $attr_value.'|';
597
- if($attr_header == 'value')
598
- $product_attribute_value .= $attr_value.'|';
599
- if($attr_header == 'is_visible')
600
- $product_attribute_visible .= $attr_value.'|';
601
- if($attr_header == 'is_variation'){
602
- if(isset($attr_value))
603
- $product_attribute_variation .= $attr_value.'|';
604
- }
605
- }
606
- }
607
- $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = substr($product_attribute_name, 0, -1);
608
- $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = substr($product_attribute_value, 0, -1);
609
- $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = substr($product_attribute_visible, 0, -1);
610
- $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = substr($product_attribute_variation, 0, -1);
611
- #print('<pre>'); print_r($PostMetaData); die;
612
- }
613
- else if ($postmeta->meta_key == '_upsell_ids') {
614
- $upsellids = array();
615
- $crosssellids = array();
616
- #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); #print_r($PostMetaData); print('</pre>'); #die;
617
- if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
618
- $upsellids = unserialize($postmeta->meta_value);
619
- if(is_array($upsellids)){
620
- foreach($upsellids as $upsellID){
621
- $upsell_ids .= $upsellID.',';
622
- }
623
- $PostMetaData[$postmeta->post_id]['_upsell_ids'] = substr($upsell_ids, 0, -1);
624
- }else{
625
- $PostMetaData[$postmeta->post_id]['_upsell_ids'] = '';
626
- }
627
- #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); print_r($PostMetaData);
628
- }
629
- }
630
- #print('<pre>'); print('VALUE for _upsell_ids: '); print_r($postmeta->meta_value); print_r($PostMetaData); print('</pre>'); #die;
631
- else if ($postmeta->meta_key == '_crosssell_ids') {
632
- if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
633
- $crosssellids = unserialize($postmeta->meta_value);
634
- if(is_array($crosssellids)){
635
- foreach($crosssellids as $crosssellID){
636
- $crosssell_ids .= $crosssellID.',';
637
- }
638
- $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = substr($crosssell_ids, 0, -1);
639
- }else{
640
- $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = '';
641
- }
642
- }
643
- }
644
- else if ($postmeta->meta_key == '_downloadable_files') {
645
- if($postmeta->meta_value != '' && $postmeta->meta_value != null) {
646
- $downloadable_files = unserialize($postmeta->meta_value);
647
- if(is_array($downloadable_files)){
648
- foreach($downloadable_files as $dkey => $dval){
649
- $downloadable_key = $dkey;
650
- foreach($dval as $down_key => $down_val) {
651
- $downloadable_value .= $down_val . ',';
652
- }
653
- }
654
- $downloadable_all .= $downloadable_key . ',' . $downloadable_value;
655
- $PostMetaData[$postmeta->post_id]['_downloadable_files'] = substr($downloadable_all ,0, -1);
656
- }else{
657
- $PostMetaData[$postmeta->post_id]['_downloadable_files'] = '';
658
- }
659
- }
660
- }
661
- else if ($postmeta->meta_key == '_thumbnail_id') {
662
- $attachment_file = '';
663
- $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
664
- $attachment = $wpdb->get_results($get_attachement);
665
- $attachment_file = $attachment[0]->guid;
666
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
667
- $postmeta->meta_key = 'featured_image';
668
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
669
- }
670
- else if ($postmeta->meta_key == '_visibility') {
671
- if($postmeta->meta_value == 'visible')
672
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
673
- if($postmeta->meta_value == 'catalog')
674
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
675
- if($postmeta->meta_value == 'search')
676
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
677
- if($postmeta->meta_value == 'hidden')
678
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 4;
679
- }
680
- else if ($postmeta->meta_key == '_stock_status') {
681
- /*if($postmeta->meta_value == 'instock')
682
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
683
- if($postmeta->meta_value == 'outofstock')
684
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;*/
685
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
686
- }
687
- else if ($postmeta->meta_key == '_tax_status') {
688
- if($postmeta->meta_value == 'taxable')
689
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
690
- if($postmeta->meta_value == 'shipping')
691
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
692
- if($postmeta->meta_value == 'none')
693
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
694
- }
695
- else if ($postmeta->meta_key == '_tax_class') {
696
- if($postmeta->meta_value == '')
697
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
698
- if($postmeta->meta_value == 'reduced-rate')
699
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
700
- if($postmeta->meta_value == 'zero-rate')
701
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
702
- }
703
- else if ($postmeta->meta_key == '_backorders') {
704
- if($postmeta->meta_value == 'no')
705
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
706
- if($postmeta->meta_value == 'notify')
707
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
708
- if($postmeta->meta_value == 'yes')
709
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
710
- }
711
- else if ($postmeta->meta_key == '_featured') {
712
- if($postmeta->meta_value == 'no')
713
- $PostMetaData[$postmeta->post_id]['featured_product'] = 1;
714
- if($postmeta->meta_value == 'yes')
715
- $PostMetaData[$postmeta->post_id]['featured_product'] = 2;
716
- if($postmeta->meta_value == 'zero-rate')
717
- $PostMetaData[$postmeta->post_id]['featured_product'] = 3;
718
- }
719
- else if ($postmeta->meta_key == '_product_type') {
720
- if($postmeta->meta_value == 'simple')
721
- $PostMetaData[$postmeta->post_id]['product_type'] = 1;
722
- if($postmeta->meta_value == 'grouped')
723
- $PostMetaData[$postmeta->post_id]['product_type'] = 2;
724
- if($postmeta->meta_value == 'variable')
725
- $PostMetaData[$postmeta->post_id]['product_type'] = 4;
726
- }
727
- /* else if($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
728
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
729
- } */
730
- #$eshop_products = $postmeta->meta_value;
731
- else if ($postmeta->meta_key == 'products') {
732
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
733
- $eshop_products = unserialize($eshop_products);
734
- foreach ($eshop_products as $key) {
735
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
736
- }
737
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
738
- } // WooCommerce product meta datas end here
739
- // MarketPress product meta datas starts here
740
- else if ($postmeta->meta_key == 'mp_var_name') {
741
- $mp_variations = null;
742
- $all_variations = unserialize($postmeta->meta_value);
743
- foreach($all_variations as $variation_name) {
744
- $mp_variations .= $variation_name . ',';
745
- }
746
- $mp_variations = substr($mp_variations, 0, -1);
747
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_variations;
748
- }
749
- else if ($postmeta->meta_key == 'mp_sale_price') {
750
- $mp_sale_prices = null;
751
- $all_sale_prices = unserialize($postmeta->meta_value);
752
- foreach($all_sale_prices as $mp_sale_price_value) {
753
- $mp_sale_prices .= $mp_sale_price_value . ',';
754
- }
755
- $mp_sale_prices = substr($mp_sale_prices, 0, -1);
756
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_sale_prices;
757
- }
758
- else if ($postmeta->meta_key == 'mp_price') {
759
- $mp_prod_prices = null;
760
- $all_mp_prod_prices = unserialize($postmeta->meta_value);
761
- foreach($all_mp_prod_prices as $mp_prod_price_value) {
762
- $mp_prod_prices .= $mp_prod_price_value . ',';
763
- }
764
- $mp_prod_prices = substr($mp_prod_prices, 0, -1);
765
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_prod_prices;
766
- }
767
- else if ($postmeta->meta_key == 'mp_sku') {
768
- $mp_sku = null;
769
- $all_mp_prod_sku = unserialize($postmeta->meta_value);
770
- foreach($all_mp_prod_sku as $mp_prod_sku) {
771
- $mp_sku .= $mp_prod_sku. ',';
772
- }
773
- $mp_sku = substr($mp_sku, 0, -1);
774
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_sku;
775
- }
776
- else if ($postmeta->meta_key == 'mp_shipping') {
777
- $mp_prod_shipping_value = unserialize($postmeta->meta_value);
778
- $mp_shipping_value = $mp_prod_shipping_value['extra_cost'];
779
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_shipping_value;
780
- }
781
- else if ($postmeta->meta_key == 'mp_inventory') {
782
- $mp_inventory_value = null;
783
- $mp_prod_inventory_values = unserialize($postmeta->meta_value);
784
- foreach($mp_prod_inventory_values as $inventory_values) {
785
- $mp_inventory_value .= $inventory_values. ',';
786
- }
787
- $mp_inventory_value = substr($mp_inventory_value, 0, -1);
788
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $mp_inventory_value;
789
- } // MarketPress product meta datas ends here
790
- // WP e-Commerce product meta datas starts here
791
- else if ($postmeta->meta_key == '_wpsc_product_metadata') {
792
- $wpecomm_product_metadata = unserialize($postmeta->meta_value);
793
- #print('<pre>'); print_r($wpecomm_product_metadata); die;
794
- foreach($wpecomm_product_metadata as $prod_md_key => $prod_md_val) {
795
- if($prod_md_key == 'dimensions') { #die('summa');
796
- foreach($prod_md_val as $prod_dimen_key => $prod_dimen_val) {
797
- $PostMetaData[$postmeta->post_id][$prod_dimen_key] = $prod_dimen_val;
798
- }
799
- }
800
- else if($prod_md_key == 'shipping') {
801
- $shipping = null;
802
- foreach($prod_md_val as $prod_ship_key => $prod_ship_val) {
803
- $shipping .= $prod_ship_val . ',';
804
- }
805
- $shipping = substr($shipping, 0, -1);
806
- $PostMetaData[$postmeta->post_id][$prod_md_key] = $shipping;
807
- }
808
- else if($prod_md_key == 'table_rate_price') {
809
- foreach($prod_md_val as $table_rate_key => $table_rate_val) {
810
- if($table_rate_key == 'quantity') {
811
- $trq_val = null;
812
- foreach($table_rate_val as $trq) {
813
- $trq_val .= $trq . '|';
814
- }
815
- $trq_val = substr($trq_val, 0, -1);
816
- $PostMetaData[$postmeta->post_id][$table_rate_key] = $trq_val;
817
- } else if($table_rate_key == 'table_price') {
818
- $tbl_price_amt = null;
819
- foreach($table_rate_val as $tbl_price) {
820
- $tbl_price_amt .= $tbl_price . '|';
821
- }
822
- $tbl_price_amt = substr($tbl_price_amt, 0, -1);
823
- $PostMetaData[$postmeta->post_id][$table_rate_key] = $tbl_price_amt;
824
- } else {
825
- $PostMetaData[$postmeta->post_id][$table_rate_key] = $table_rate_val;
826
- }
827
- }
828
- }
829
- else {
830
- $PostMetaData[$postmeta->post_id][$prod_md_key] = $prod_md_val;
831
- }
832
- }
833
- }
834
- // Wp e-Commerce product meta datas ends here
835
- // Eshop product meta datas starts here
836
- else if ($postmeta->meta_key == 'featured') {
837
- $isFeatured = strtolower($postmeta->meta_value);
838
- $PostMetaData[$postmeta->post_id]['featured_product'] = $isFeatured;
839
- }
840
- else if ($postmeta->meta_key == 'sale') {
841
- $is_prod_sale = strtolower($postmeta->meta_value);
842
- $PostMetaData[$postmeta->post_id]['product_in_sale'] = $is_prod_sale;
843
- }
844
- else if ($postmeta->meta_key == '_eshop_stock') {
845
- if($postmeta->meta_value == 1) {
846
- $stock_available = 'yes';
847
- } else {
848
- $stock_available = 'no';
849
- }
850
- $PostMetaData[$postmeta->post_id]['stock_available'] = $stock_available;
851
- }
852
- else if ($postmeta->meta_key == 'cart_radio') {
853
- $PostMetaData[$postmeta->post_id]['cart_option'] = $postmeta->meta_value;
854
- }
855
- else if ($postmeta->meta_key == 'shiprate') {
856
- $PostMetaData[$postmeta->post_id]['shiprate'] = $postmeta->meta_value;
857
- }
858
- else if ($postmeta->meta_key == '_eshop_product') {
859
- $product_attr_details = unserialize($postmeta->meta_value);
860
- $prod_option = $sale_price = $reg_price = null;
861
- #print('<pre>');print_r($product_attr_details); #die;
862
- foreach($product_attr_details as $prod_att_det_Key => $prod_att_det_Val) {
863
- if($prod_att_det_Key == 'sku') {
864
- $PostMetaData[$postmeta->post_id]['sku'] = $prod_att_det_Val;
865
- }
866
- else if($prod_att_det_Key == 'products') {
867
- foreach($prod_att_det_Val as $all_prod_options) {
868
- $prod_option .= $all_prod_options['option'] . ',';
869
- $sale_price .= $all_prod_options['saleprice'] . ',';
870
- $reg_price .= $all_prod_options['price'] . ',';
871
- }
872
- $prod_option = substr($prod_option, 0, -1);
873
- $sale_price = substr($sale_price, 0, -1);
874
- $reg_price = substr($reg_price, 0, -1);
875
- $PostMetaData[$postmeta->post_id]['products_option'] = $prod_option;
876
- $PostMetaData[$postmeta->post_id]['sale_price'] = $sale_price;
877
- $PostMetaData[$postmeta->post_id]['regular_price'] = $reg_price;
878
- }
879
- }
880
- #$PostMetaData[$postmeta->post_id]['cart_option'] = $postmeta->meta_value;
881
- }
882
- // Eshop product meta datas ends here
883
- else if ($postmeta->meta_key == '_thumbnail_id') {
884
- $attachment_file = '';
885
- $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
886
- $attachment = $wpdb->get_results($get_attachement);
887
- $attachment_file = $attachment[0]->guid;
888
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
889
- $postmeta->meta_key = 'featured_image';
890
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
891
- }
892
- else if(is_array($checkbox_option_fields) && in_array($postmeta->meta_key,$checkbox_option_fields)){
893
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
894
- $eshop_products = unserialize($eshop_products); //print_r($eshop_products);
895
- foreach ($eshop_products as $key) {
896
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
897
- }
898
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
899
- }
900
- else {
901
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
902
- }
903
- }
904
- }
905
- }
906
- # print('PostMetaData: '); print('<pre>'); print_r($Header); print_r($PostMetaData); #die;
907
- $TermsData[$postID] = $this->getAllTerms($postID,$exporttype);
908
- /*
909
- // Tags & Categories
910
- $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
911
- $postTags = $postCategory = '';
912
- foreach ($get_tags as $tags) {
913
- $postTags .= $tags . ',';
914
- }
915
- $postTags = substr($postTags, 0, -1);
916
- $TermsData[$postID]['post_tag'] = $postTags;
917
- $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
918
- foreach ($get_categotries as $category) {
919
- $postCategory .= $category . '|';
920
- }
921
- $postCategory = substr($postCategory, 0, -1);
922
- $TermsData[$postID]['post_category'] = $postCategory;
923
- */
924
- }
925
-
926
- #$ExportData = array();
927
- // Merge all arrays
928
- #echo '<pre>'; print_r($TermsData); die;
929
- // echo '<pre>'; print_r($PostData); die('sds');
930
- foreach ($PostData as $pd_key => $pd_val) {
931
- if (array_key_exists($pd_key, $PostMetaData)) {
932
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
933
- // echo '<pre>'; print_r($ExportData); die('exist');
934
- } else {
935
- $ExportData[$pd_key] = $PostData[$pd_key];
936
- }
937
- if (array_key_exists($pd_key, $TermsData)) {
938
- if (empty($ExportData[$pd_key]))
939
- $ExportData[$pd_key] = array();
940
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
941
- }
942
- }
943
- }
944
- #print('<pre>'); print_r($Header); die;
945
- #print('<pre>'); print_r($ExportData); die;
946
- if($exporttype == 'woocommerce') {
947
- foreach($Header as $hkey) {
948
- foreach($ExportData as $edkey => $edval) {
949
- /*if(array_key_exists($hkey, $this->getACFvalues())) {
950
- $ExportData[$edkey][$hkey] = $edval[$hkey];
951
- unset($ExportData[$edkey]['_'.$hkey]);
952
- }
953
- else if(in_array($hkey, $this->getAIOSEOfields())) {
954
- foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
955
- $ExportData[$edkey][$aioseoval] = $edval[$aioseokey];
956
- unset($ExportData[$edkey][$hkey]);
957
- }
958
- }
959
- else if(array_key_exists('_'.$hkey, $edval)) {
960
- $ExportData[$edkey][$hkey] = $edval['_'.$hkey];
961
- unset($ExportData[$edkey]['_'.$hkey]);
962
- } */
963
- foreach($this->WoocommerceMetaHeaders() as $woohkey => $woohval) {
964
- if(array_key_exists($woohval, $ExportData[$edkey])) {
965
- $ExportData[$edkey][$woohkey] = $edval[$woohval];
966
- unset($ExportData[$edkey][$woohval]);
967
- }
968
- }
969
- }
970
- }
971
- }
972
- # MarketPressHeaders
973
- if($exporttype == 'marketpress') {
974
- foreach($Header as $hkey) {
975
- foreach($ExportData as $edkey => $edval) {
976
- foreach($this->MarketPressHeaders() as $mphkey => $mphval) {
977
- if(array_key_exists($mphval, $ExportData[$edkey])) {
978
- $ExportData[$edkey][$mphkey] = $edval[$mphval];
979
- // unset($ExportData[$edkey][$mphval]);
980
- }
981
- }
982
- }
983
- }
984
- }
985
- if($exporttype == 'wpcommerce') {
986
- foreach($Header as $hkey) {
987
- foreach($ExportData as $edkey => $edval) {
988
- foreach($this->WpeCommerceHeaders() as $wpcomhkey => $wpcomhval) {
989
- if(array_key_exists($wpcomhval, $ExportData[$edkey])) {
990
- $ExportData[$edkey][$wpcomhkey] = $edval[$wpcomhval];
991
- // unset($ExportData[$edkey][$wpcomhval]);
992
- }
993
- }
994
- }
995
- }
996
- }
997
- if($exporttype == 'eshop') {
998
- foreach($Header as $hkey) {
999
- foreach($ExportData as $edkey => $edval) {
1000
- foreach($this->EshopHeaders() as $eshophkey => $eshophval) {
1001
- if(array_key_exists($eshophval, $ExportData[$edkey])) {
1002
- $ExportData[$edkey][$eshophkey] = $edval[$eshophval];
1003
- // unset($ExportData[$edkey][$wpcomhval]);
1004
- }
1005
- }
1006
- }
1007
- }
1008
- }
1009
- #print('<pre>'); print_r($Header); print('</pre>'); #die;
1010
- # print('<pre>'); print_r($ExportData); die;
1011
- foreach ($Header as $header_key) {
1012
- if (is_array($ExportData)) {
1013
- foreach ($ExportData as $ED_key => $ED_val) {
1014
- if (in_array($header_key, $this->getAIOSEOfields())) { #die($header_key);
1015
- foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
1016
- $CSVContent[$ED_key][$aioseoval] = $ED_val[$aioseokey];
1017
- #unset($CSVContent[$ED_key][$header_key]);
1018
- }
1019
- } else if (in_array($header_key, $this->getYoastSEOfields())) {
1020
- foreach($this->getYoastSEOfields() as $yoastseokey => $yoastseoval) {
1021
- $CSVContent[$ED_key][$yoastseoval] = $ED_val[$yoastseokey];
1022
- #unset($CSVContent[$ED_key][$header_key]);
1023
- }
1024
- } else if (in_array($header_key, $this->getTypesFields())) {
1025
- foreach($this->getTypesFields() as $typesFkey => $typesFval) {
1026
- $CSVContent[$ED_key][$typesFval] = $ED_val[$typesFkey];
1027
- #unset($CSVContent[$ED_key][$header_key]);
1028
- }
1029
- } else if (array_key_exists($header_key, $ED_val)) {
1030
- $CSVContent[$ED_key][$header_key] = $ED_val[$header_key];
1031
- } else {
1032
- $CSVContent[$ED_key][$header_key] = null;
1033
- }
1034
- }
1035
- }
1036
- }
1037
- #print(count($CSVContent[22]));print('<br>' . count($Header));
1038
- #print('<pre>'); print_r($CSVContent) ;print('</pre>'); die;
1039
- $csv = new WPImpCSVParserLib();
1040
- $csv->output ($csv_file_name, $CSVContent, $Header, $export_delimiter);
1041
- }
1042
-
1043
- /**
1044
- *
1045
- */
1046
- public function WPImpExportCategories($request) {
1047
- global $wpdb;
1048
- $export_delimiter = ',';
1049
- $exporttype = $request['export'];
1050
- $wpcsvsettings=get_option('wpcsvprosettings');
1051
- if(isset($wpcsvsettings['export_delimiter'])){
1052
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1053
- }
1054
- if($_POST['export_filename'])
1055
- $csv_file_name =$_POST['export_filename'].'.csv';
1056
- else
1057
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1058
-
1059
- $Header[] = 'name';
1060
- $Header[] = 'slug';
1061
- $Header[] = 'description';
1062
- $get_all_categories = get_categories('hide_empty=0');
1063
- $fieldsCount = count($get_all_categories);
1064
- foreach( $get_all_categories as $cateKey => $cateValue ) {
1065
- $categID = $cateValue->term_id;
1066
- $categName = $cateValue->cat_name;
1067
- $categSlug = $cateValue->slug;
1068
- $categDesc = $cateValue->category_description;
1069
- $categParent = $cateValue->parent;
1070
- if($categParent == 0) {
1071
- $TERM_DATA[$categID]['name'] = $categName;
1072
- } else {
1073
- $categParentName = get_cat_name( $categParent );
1074
- $TERM_DATA[$categID]['name'] = $categParentName . '|' . $categName;
1075
- }
1076
- $TERM_DATA[$categID]['slug'] = $categSlug;
1077
- $TERM_DATA[$categID]['description'] = $categDesc;
1078
- }
1079
- $csv = new WPImpCSVParserLib();
1080
- $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1081
- }
1082
-
1083
- /**
1084
- *
1085
- */
1086
- public function WPImpExportTags($request) {
1087
- global $wpdb;
1088
- $export_delimiter = ',';
1089
- $exporttype = $request['export'];
1090
- $wpcsvsettings=get_option('wpcsvprosettings');
1091
- if(isset($wpcsvsettings['export_delimiter'])){
1092
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1093
- }
1094
- if($_POST['export_filename'])
1095
- $csv_file_name =$_POST['export_filename'].'.csv';
1096
- else
1097
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1098
-
1099
- $Header[] = 'name';
1100
- $Header[] = 'slug';
1101
- $Header[] = 'description';
1102
- $get_all_tags = get_tags('hide_empty=0');
1103
- $fieldsCount = count($get_all_tags);
1104
- foreach( $get_all_tags as $tagKey => $tagValue ) {
1105
- $tagID = $tagValue->term_id;
1106
- $tagName = $tagValue->name;
1107
- $tagSlug = $tagValue->slug;
1108
- $tagDesc = $tagValue->description;
1109
- $TERM_DATA[$tagID]['name'] = $tagName;
1110
- $TERM_DATA[$tagID]['slug'] = $tagSlug;
1111
- $TERM_DATA[$tagID]['description'] = $tagDesc;
1112
- }
1113
- $csv = new WPImpCSVParserLib();
1114
- $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1115
- }
1116
-
1117
- /**
1118
- *
1119
- */
1120
- public function WPImpExportTaxonomies($request) {
1121
- global $wpdb;
1122
- $export_delimiter = ',';
1123
- $exporttype = $request['export'];
1124
- $wpcsvsettings=get_option('wpcsvprosettings');
1125
- if(isset($wpcsvsettings['export_delimiter'])){
1126
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1127
- }
1128
- if($_POST['export_filename'])
1129
- $csv_file_name =$_POST['export_filename'].'.csv';
1130
- else
1131
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1132
-
1133
- $taxonomy_name = $_POST['export_taxo_type'];
1134
- $taxonomies = get_terms( $taxonomy_name, 'orderby=count&hide_empty=0' );
1135
- $Header[] = 'name';
1136
- $Header[] = 'slug';
1137
- $Header[] = 'description';
1138
- $fieldsCount = count($taxonomies);
1139
- foreach( $taxonomies as $taxoKey => $taxoValue ) {
1140
- $taxoID = $taxoValue->term_id;
1141
- $taxoName = $taxoValue->name;
1142
- $taxoSlug = $taxoValue->slug;
1143
- $taxoDesc = $taxoValue->description;
1144
- $taxoParent = $taxoValue->parent;
1145
- if($taxoParent == 0) {
1146
- $TERM_DATA[$taxoID]['name'] = $taxoName;
1147
- } else {
1148
- $taxoParentName = get_term( $taxoParent, $taxonomy_name );
1149
- $TERM_DATA[$taxoID]['name'] = $taxoParentName->name . '|' . $taxoName;
1150
- }
1151
- $TERM_DATA[$taxoID]['slug'] = $taxoSlug;
1152
- $TERM_DATA[$taxoID]['description'] = $taxoDesc;
1153
- }
1154
- $csv = new WPImpCSVParserLib();
1155
- $csv->output ($csv_file_name, $TERM_DATA, $Header, $export_delimiter);
1156
- }
1157
-
1158
- /**
1159
- *
1160
- */
1161
- public function WPImpExportCustomerReviews($request) {
1162
- global $wpdb;
1163
- $export_delimiter = ',';
1164
- $exporttype = $request['export'];
1165
- $wpcsvsettings=get_option('wpcsvprosettings');
1166
- if(isset($wpcsvsettings['export_delimiter'])){
1167
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1168
- }
1169
- if($_POST['export_filename'])
1170
- $csv_file_name =$_POST['export_filename'].'.csv';
1171
- else
1172
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1173
-
1174
- $header_query1 = "SELECT * FROM wp_wpcreviews";
1175
- $header_query2 = "SELECT id FROM wp_wpcreviews";
1176
-
1177
- $result_header_query1 = $wpdb->get_results($header_query1);
1178
- foreach($result_header_query1 as $rhq1_key){
1179
- foreach($rhq1_key as $rhq1_headkey => $rhq1_headval){
1180
- if(!in_array($rhq1_headkey,$Header))
1181
- $Header[] = $rhq1_headkey;
1182
- }
1183
- }
1184
-
1185
- $result = $wpdb->get_results($header_query1);
1186
- $result1 = $wpdb->get_results($header_query2);
1187
- $fieldsCount = count($result);
1188
- if ($result) {
1189
- $i =0;
1190
- foreach ($result as $postID) {
1191
- foreach ($postID as $Key => $Val){
1192
- $postData[$i][$Key] = $Val;
1193
- }
1194
- $i++;
1195
- }
1196
- $ExportData = $postData;
1197
- $j=0;
1198
- foreach($Header as $key)
1199
- {
1200
- $key=$j;
1201
- $header[] = $key;
1202
- $j++;
1203
- }
1204
-
1205
- $csv = new WPImpCSVParserLib();
1206
- $csv->output ($csv_file_name, $ExportData, $Header, $export_delimiter);
1207
- }
1208
- }
1209
-
1210
- /**
1211
- *
1212
- */
1213
- public function WPImpExportComments($request) {
1214
- global $wpdb;
1215
- $export_delimiter = ',';
1216
- $exporttype = $request['export'];
1217
- $wpcsvsettings=get_option('wpcsvprosettings');
1218
- if(isset($wpcsvsettings['export_delimiter'])){
1219
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1220
- }
1221
- if($_POST['export_filename'])
1222
- $csv_file_name =$_POST['export_filename'].'.csv';
1223
- else
1224
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1225
-
1226
- $commentQuery = "SELECT * FROM $wpdb->comments " . $orderBy;
1227
- $comments = $wpdb->get_results( $commentQuery);
1228
- $mappedHeader = false;
1229
- $i = 0;
1230
- foreach($comments as $comment){
1231
- foreach($comment as $key => $value){
1232
- if(!$mappedHeader){
1233
- $Header[] = $key; // ."$export_delimiter";
1234
- }
1235
- $ExportData[$i][$key] = $value; //'"'.$value.'"'."$export_delimiter";
1236
- }
1237
- $mappedHeader = true;
1238
- $i++;
1239
- }
1240
- #print('<pre>'); print_r($header); print_r($singleCommentContent);die;
1241
- $csv = new WPImpCSVParserLib();
1242
- $csv->output ($csv_file_name, $ExportData, $Header, $export_delimiter);
1243
- }
1244
-
1245
- /**
1246
- *
1247
- */
1248
- public function WPImpExportUsers($request) {
1249
- global $wpdb;
1250
- $export_delimiter = ',';
1251
- $exporttype = $request['export'];
1252
- $wpcsvsettings=get_option('wpcsvprosettings');
1253
- if(isset($wpcsvsettings['export_delimiter'])){
1254
- $export_delimiter = $wpcsvsettings['export_delimiter'];
1255
- }
1256
- if($_POST['export_filename'])
1257
- $csv_file_name =$_POST['export_filename'].'.csv';
1258
- else
1259
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
1260
-
1261
- $uId = '';
1262
- $header_query1 = "SELECT *FROM $wpdb->users";
1263
- $header_query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
1264
- $result_header_query1 = $wpdb->get_results($header_query1);
1265
- $result_header_query2 = $wpdb->get_results($header_query2);
1266
- /* print('<pre>'); print_r($result_header_query1);
1267
- print_r($result_header_query2);die; */
1268
- foreach ($result_header_query1 as $rhq1_key) {
1269
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
1270
- if (!in_array($rhq1_headkey, $Header))
1271
- $Header[] = $rhq1_headkey;
1272
- }
1273
- }
1274
- foreach ($result_header_query2 as $rhq2_headkey) {
1275
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
1276
- if($rhq2_headkey->meta_key == 'mp_shipping_info' )
1277
- {
1278
- $mp_ship_header= unserialize($rhq2_headkey->meta_value);
1279
- foreach($mp_ship_header as $mp_ship_key => $mp_value) { $Header[] = "msi: ".$mp_ship_key; }
1280
- }
1281
- if($rhq2_headkey->meta_key == 'mp_billing_info' )
1282
- {
1283
- $mp_ship_header= unserialize($rhq2_headkey->meta_value);
1284
- foreach($mp_ship_header as $mp_ship_key => $mp_value) { $Header[] = "mbi: ".$mp_ship_key; }
1285
- }
1286
-
1287
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file' && $rhq2_headkey->meta_key != 'mp_shipping_info' && $rhq2_headkey->meta_key != 'mp_billing_info' )
1288
- $Header[] = $rhq2_headkey->meta_key;
1289
- }
1290
- }
1291
- #echo '<pre>'; print_r($Header); die('dsd');
1292
- $get_user_ids = "select DISTINCT ID from $wpdb->users u join $wpdb->usermeta um on um.user_id = u.ID";
1293
-
1294
- $result = $wpdb->get_col($get_user_ids);
1295
- $fieldsCount = count($result);
1296
- if ($result) {
1297
- foreach ($result as $userID) {
1298
- $uId = $uId . ',' . $userID;
1299
- $query1 = "SELECT *FROM $wpdb->users where ID in ($userID);";
1300
- $result_query1 = $wpdb->get_results($query1);
1301
- if (!empty($result_query1)) {
1302
- foreach ($result_query1 as $users) {
1303
- foreach ($users as $user_key => $user_value) {
1304
- $UserData[$userID][$user_key] = $user_value;
1305
- }
1306
- }
1307
- }
1308
- // echo '<pre>'; print_r($UserData); die ('dfdf');
1309
- $query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where ID=$userID";
1310
- $possible_values = array('s:', 'a:', ':{');
1311
- $result_query2 = $wpdb->get_results($query2);
1312
- if (!empty($result_query2)) {
1313
- foreach ($result_query2 as $usermeta) {
1314
- // echo '<pre>'; print_r($usermeta);
1315
-
1316
- foreach($possible_values as $posval){
1317
- if(strpos($usermeta->meta_value,$posval)){
1318
- if($usermeta->meta_key == 'mp_shipping_info' || $usermeta->meta_key == 'mp_billing_info')
1319
- $typesFserialized = 1;
1320
- } else {
1321
- $typesFserialized = 0;
1322
- }
1323
- }
1324
- if($typesFserialized == 1)
1325
- {
1326
- if($usermeta->meta_key == 'mp_shipping_info')
1327
- {
1328
- $UserID = $usermeta->user_id;
1329
- $mp_ship_data = unserialize($usermeta->meta_value);
1330
- foreach($mp_ship_data as $mp_ship_key => $mp_ship_value)
1331
- {
1332
- $mp_ship_tempkey = "msi: ".$mp_ship_key;
1333
- $UserData[$UserID][$mp_ship_tempkey]= $mp_ship_value;
1334
- }
1335
- }
1336
-
1337
- if($usermeta->meta_key == 'mp_billing_info')
1338
- {
1339
- $UserID = $usermeta->user_id;
1340
- $mp_ship_data = unserialize($usermeta->meta_value);
1341
- foreach($mp_ship_data as $mp_ship_key => $mp_ship_value)
1342
- {
1343
- $mp_ship_tempkey = "mbi: ".$mp_ship_key;
1344
- $UserData[$UserID][$mp_ship_tempkey]= $mp_ship_value;
1345
- }
1346
- }
1347
-
1348
- if($usermeta->meta_key != 'wp_capabilities' && $usermeta->meta_key !='mp_shipping_info' && $usermeta->meta_key != 'mp_billing_info') {
1349
- $UserData[$userID][$usermeta->meta_key] = $usermeta->meta_value;
1350
- } else {
1351
- if($usermeta->meta_key == 'wp_capabilities') {
1352
- $getUserRole = unserialize($usermeta->meta_value);
1353
- // echo '<pre>'; print_r($getUserRole); die('ddf');
1354
- foreach($getUserRole as $urKey => $urVal) {
1355
- $getUserRole = get_role($urKey);
1356
- }
1357
- $rolelevel = 0;
1358
- $isfound = array();
1359
- foreach($getUserRole->capabilities as $roleKey => $roleVal){
1360
- $isfound = explode('level_', $roleKey);
1361
- if(is_array($isfound) && count($isfound) == 2){
1362
- $rolelevel = $rolelevel + 1;
1363
- }
1364
- } $rolelevel = $rolelevel - 1;
1365
- #$UserData[$userID][$usermeta->meta_key] = $rolelevel;
1366
- }
1367
- }
1368
- } else {
1369
- foreach($possible_values as $posval){
1370
- if(strpos($usermeta->meta_value,$posval)){
1371
- $UserData[$userID][$usermeta->meta_key] = null;
1372
- } else {
1373
- $ifSerialized = 0;
1374
- $UserData[$userID][$usermeta->meta_key] = $usermeta->meta_value;
1375
- }
1376
- }
1377
-
1378
- }
1379
- } #echo '<pre>'; print_r($UserData); die('dd');
1380
- }
1381
- }
1382
- }
1383
- $UserHeader = array();
1384
- foreach ($Header as $header_key) {
1385
- foreach ($UserData as $UD_key => $UD_val) {
1386
- if(array_key_exists($header_key, $UD_val)) {
1387
- $CSVContent[$UD_key][$header_key] = $UD_val[$header_key];
1388
- if(!in_array($header_key, $UserHeader))
1389
- $UserHeader[] = $header_key;
1390
- }
1391
- else {
1392
- $CSVContent[$UD_key][$header_key] = null;
1393
- }
1394
- }
1395
- }
1396
-
1397
- $csv = new WPImpCSVParserLib();
1398
- $csv->output ($csv_file_name, $CSVContent, $UserHeader, $export_delimiter);
1399
- }
1400
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/export/templates/index.php CHANGED
@@ -5,6 +5,8 @@
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
 
 
8
  ?>
9
  <?php
10
  $siteurl = get_option('siteurl');
@@ -24,8 +26,10 @@ $noncedata = $skinnyData['wp_nonce'];
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>
@@ -113,7 +117,7 @@ $noncedata = $skinnyData['wp_nonce'];
113
  <tr>
114
  <td class='exportdatatype'>
115
  <label> <input type="radio" name="export" value="custompost"><span id="align"> Custom Post</span></label>
116
- <select name="export_post_type" style="margin-left:10px">
117
  <option>--Select--</option>
118
  <?php
119
  foreach (get_post_types() as $key => $value) {
@@ -139,7 +143,7 @@ $noncedata = $skinnyData['wp_nonce'];
139
  <tr>
140
  <td class='exportdatatype'>
141
  <label> <input type="radio" name="export" value="customtaxonomy"><span id="align"> Custom Taxonomy</span></label>
142
- <select name="export_taxo_type" style="margin-left:10px;">
143
  <option>--Select--</option>
144
  <?php
145
  foreach (get_taxonomies() as $key => $value) {
@@ -240,7 +244,7 @@ $noncedata = $skinnyData['wp_nonce'];
240
  <input class='form-control' type='text' name='export_filename' id='export_filename' value=''
241
  placeholder="export_as_<?php echo(date("Y-m-d")); ?>" size="18">
242
  </div>
243
- <div class='col-sm-3'><input type="submit" name="exportbutton" value="Export" class='btn btn-primary'></div>
244
 
245
  </form>
246
  </div>
5
  * Proprietary and confidential
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
+ if ( ! defined( 'ABSPATH' ) )
9
+ exit; // Exit if accessed directly
10
  ?>
11
  <?php
12
  $siteurl = get_option('siteurl');
26
  <label> <h3 id="exporttitle">Export Data With Advanced Filters</h3></label>
27
  </div>
28
  <div style="margin-left:20px;">
29
+ <form id = "exportmoduleform" class="form-horizontal" method="post" name="exportmodule" action = "<?php echo admin_url('admin-ajax.php'); ?>" onsubmit = "return export_module();">
30
  <!-- <form class="form-horizontal" method="post" name="exportmodule" action="" onsubmit="return export_module();"> -->
31
+ <?php wp_nonce_field('export_file','my-nonce'); ?>
32
+ <input name="action" value="export_file" type="hidden">
33
  <div class="table-responsive">
34
  <table style='width:100%;' class='table exportmodule'>
35
  <th colspan='2'><label class='h-exportmodule'><h3 id="innertitle"> To export data based on the filters</h3></label></th>
117
  <tr>
118
  <td class='exportdatatype'>
119
  <label> <input type="radio" name="export" value="custompost"><span id="align"> Custom Post</span></label>
120
+ <select name="export_post_type" style="margin-left:10px" id = "export_post_type">
121
  <option>--Select--</option>
122
  <?php
123
  foreach (get_post_types() as $key => $value) {
143
  <tr>
144
  <td class='exportdatatype'>
145
  <label> <input type="radio" name="export" value="customtaxonomy"><span id="align"> Custom Taxonomy</span></label>
146
+ <select name="export_taxo_type" style="margin-left:10px;" id = "export_taxo_type">
147
  <option>--Select--</option>
148
  <?php
149
  foreach (get_taxonomies() as $key => $value) {
244
  <input class='form-control' type='text' name='export_filename' id='export_filename' value=''
245
  placeholder="export_as_<?php echo(date("Y-m-d")); ?>" size="18">
246
  </div>
247
+ <div class='col-sm-3'><input type="submit" id = "exportbutton" name="exportbutton" value="Export" class='btn btn-primary' onclick = "exportsubmit();"></div>
248
 
249
  </form>
250
  </div>
modules/filemanager/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class FilemanagerActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class FilemanagerActions extends SkinnyActions {
41
 
modules/filemanager/templates/index.php CHANGED
@@ -34,6 +34,8 @@
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
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  ?>
40
  <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>
41
 
modules/mappingtemplate/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class MappingtemplateActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class MappingtemplateActions extends SkinnyActions {
41
 
modules/mappingtemplate/templates/index.php CHANGED
@@ -34,5 +34,7 @@
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/templates.png' style='width:90%;'></div>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  ?>
40
  <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/old_export/actions/actions.php DELETED
@@ -1,1428 +0,0 @@
1
- <?php
2
- /******************************************************************************************
3
- * Copyright (C) Smackcoders 2014 - All Rights Reserved
4
- * Unauthorized copying of this file, via any medium is strictly prohibited
5
- * Proprietary and confidential
6
- * You can contact Smackcoders at email address info@smackcoders.com.
7
- *******************************************************************************************/
8
-
9
- class ExportActions extends SkinnyActions {
10
- public function __construct() {
11
-
12
- }
13
-
14
- /**
15
- * The actions index method
16
- * @param array $request
17
- * @return array
18
- */
19
- public function executeIndex($request) {
20
- // return an array of name value pairs to send data to the template
21
- $data = array();
22
- if (!empty($request['POST'])) {
23
- $type = $request['POST']['export'];
24
- $filename = $request['POST']['export_filename'];
25
- if (!empty($type) && !empty($filename)) {
26
- $helper = new ultimatecsv_include_helper();
27
- $helper->generateanddownloadcsv($type, $filename);
28
- }
29
- }
30
- return $data;
31
- }
32
-
33
- /**
34
- * @param $request
35
- * @return array
36
- */
37
- public function executeExport($request) {
38
- #TODO: Update phpdoc
39
- $data = array();
40
- #TODO: $data = array() not used in this function / overwritten immediately
41
- ob_start();
42
- global $wpdb;
43
- $Header = $PostData = $PostMetaData = $TermsData = $ExportData = array();
44
- $exporttype = $request['POST']['export'];
45
- $export_filename = $request['POST']['export_filename'];
46
- if ($export_filename) {
47
- $csv_file_name = $export_filename . '.csv';
48
- } else {
49
- $csv_file_name = 'exportas_' . $exporttype . '_' . date("Y-m-d") . '.csv';
50
- }
51
- #TODO: $csv_file_name not used in this function / overwritten immediately
52
-
53
- if ($exporttype == 'post' || $exporttype == 'page') {
54
- $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$exporttype'";
55
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') and meta_key NOT LIKE 'field_%'";
56
- $result_header_query1 = $wpdb->get_results($header_query1);
57
- $result_header_query2 = $wpdb->get_results($header_query2);
58
-
59
- foreach ($result_header_query1 as $rhq1_key) {
60
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
61
- if (!in_array($rhq1_headkey, $Header)) {
62
- $Header[] = $rhq1_headkey;
63
- }
64
- }
65
- }
66
-
67
- foreach ($result_header_query2 as $rhq2_headkey) {
68
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
69
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file') {
70
- $Header[] = $rhq2_headkey->meta_key;
71
- }
72
- }
73
- }
74
-
75
- $Header[] = 'post_tag';
76
- $Header[] = 'featured_image';
77
- $Header[] = 'post_category';
78
- // Code for ACF fields
79
- $limit = ( int )apply_filters('postmeta_form_limit', 30);
80
- $get_acf_fields = $wpdb->get_col("SELECT meta_value FROM $wpdb->postmeta
81
- GROUP BY meta_key
82
- HAVING meta_key LIKE 'field_%'
83
- ORDER BY meta_key
84
- LIMIT $limit");
85
-
86
- foreach ($get_acf_fields as $acf_value) {
87
- $get_acf_field = unserialize($acf_value);
88
- $acf_fields[$get_acf_field['name']] = "CF: " . $get_acf_field['name'];
89
- $acf_fields_slug[$get_acf_field['name']] = "_" . $get_acf_field['name'];
90
- if (in_array("_" . $get_acf_field['name'], $Header)) {
91
- $Header = array_diff($Header, $acf_fields_slug);
92
- }
93
- if ($get_acf_field['type'] == 'checkbox') {
94
- $checkbox_option_fields[] = $get_acf_field['name'];
95
- }
96
- } // Code ends here
97
- $get_post_ids = "select DISTINCT ID from $wpdb->posts where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending')";
98
-
99
- $result = $wpdb->get_col($get_post_ids);
100
- $fieldsCount = count($result);
101
- if ($result) {
102
- foreach ($result as $postID) {
103
- $pId = $pId . ',' . $postID;
104
- $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
105
- $result_query1 = $wpdb->get_results($query1);
106
- if (!empty($result_query1)) {
107
- foreach ($result_query1 as $posts) {
108
- foreach ($posts as $post_key => $post_value) {
109
- if ($post_key == 'post_status') {
110
- if (is_sticky($postID)) {
111
- $PostData[$postID][$post_key] = 'Sticky';
112
- $post_status = 'Sticky';
113
- } else {
114
- $PostData[$postID][$post_key] = $post_value;
115
- $post_status = $post_value;
116
- }
117
- } else {
118
- $PostData[$postID][$post_key] = $post_value;
119
- }
120
- if ($post_key == 'post_password') {
121
- if ($post_value) {
122
- $PostData[$postID]['post_status'] = "{" . $post_value . "}";
123
- } else {
124
- $PostData[$postID]['post_status'] = $post_status;
125
- }
126
- }
127
- }
128
- }
129
- }
130
- $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
131
- $result_query2 = $wpdb->get_results($query2);
132
- if (!empty($result_query2)) {
133
- foreach ($result_query2 as $postmeta) {
134
- if ($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
135
- if (is_array($acf_fields_slug) && !in_array($postmeta->meta_key, $acf_fields_slug)) {
136
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
137
- }
138
- }
139
- $eshop_products = $postmeta->meta_value;
140
- if ($postmeta->meta_key == 'products') {
141
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
142
- $eshop_products = unserialize($eshop_products);
143
- foreach ($eshop_products as $key) {
144
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
145
- }
146
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
147
- }
148
- if ($postmeta->meta_key == '_thumbnail_id') {
149
- $attachment_file = '';
150
- $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
151
- $attachment = $wpdb->get_results($get_attachement);
152
- $attachment_file = $attachment[0]->guid;
153
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
154
- $postmeta->meta_key = 'featured_image';
155
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
156
- }
157
- if (is_array($checkbox_option_fields) && in_array($postmeta->meta_key, $checkbox_option_fields)) {
158
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
159
- $eshop_products = unserialize($eshop_products); //print_r($eshop_products);
160
- foreach ($eshop_products as $key) {
161
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
162
- }
163
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
164
- }
165
- }
166
-
167
- }
168
- // Tags & Categories
169
- $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
170
- $postTags = $postCategory = '';
171
- foreach ($get_tags as $tags) {
172
- $postTags .= $tags . ',';
173
- }
174
- $postTags = substr($postTags, 0, -1);
175
- $TermsData[$postID]['post_tag'] = $postTags;
176
- $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
177
- foreach ($get_categotries as $category) {
178
- $postCategory .= $category . '|';
179
- }
180
- $postCategory = substr($postCategory, 0, -1);
181
- $TermsData[$postID]['post_category'] = $postCategory;
182
- }
183
- $ExportData = array();
184
- // Merge all arrays
185
- foreach ($PostData as $pd_key => $pd_val) {
186
- if (array_key_exists($pd_key, $PostMetaData)) {
187
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
188
- } else {
189
- $ExportData[$pd_key] = $PostData[$pd_key];
190
- }
191
- if (array_key_exists($pd_key, $TermsData)) {
192
- if (empty($ExportData[$pd_key])) {
193
- $ExportData[$pd_key] = array();
194
- }
195
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
196
- }
197
- }
198
-
199
- foreach ($Header as $header_key) {
200
- foreach ($ExportData as $ED_key) {
201
- if (array_key_exists($header_key, $ED_key)) {
202
- $CSVContent[$header_key][] = $ED_key[$header_key];
203
- } else {
204
- $CSVContent[$header_key][] = '';
205
- }
206
- }
207
- }
208
- }
209
-
210
- # GENERATE AS CSV
211
- $CSVDATA = array();
212
- for ($j = 0; $j < $fieldsCount; $j++) {
213
- foreach ($Header as $value) {
214
- $CSVDATA[$j] .= '"' . $CSVContent[$value][$j] . '",';
215
- }
216
- }
217
- $CSV_FILE_CONTENT = array();
218
- foreach ($Header as $csv_header) {
219
- if ($csv_header == '_eshop_stock') {
220
- $csv_header = 'stock_available';
221
- }
222
- if ($csv_header == 'cart_radio') {
223
- $csv_header = 'cart_option';
224
- }
225
- if ($csv_header == 'sale') {
226
- $csv_header = 'product_in_sale';
227
- }
228
- if ($csv_header == 'featured') {
229
- $csv_header = 'featured_product';
230
- }
231
- if ($csv_header == 'sku' || $csv_header == '_wpsc_sku') {
232
- $csv_header = 'SKU';
233
- }
234
- if ($csv_header == '_aioseop_keywords') {
235
- $csv_header = 'seo_keywords';
236
- }
237
- if ($csv_header == '_aioseop_description') {
238
- $csv_header = 'seo_description';
239
- }
240
- if ($csv_header == '_aioseop_title') {
241
- $csv_header = 'seo_title';
242
- }
243
- if ($csv_header == '_aioseop_noindex') {
244
- $csv_header = 'seo_noindex';
245
- }
246
- if ($csv_header == '_aioseop_nofollow') {
247
- $csv_header = 'seo_nofollow';
248
- }
249
- if ($csv_header == '_aioseop_disable') {
250
- $csv_header = 'seo_disable';
251
- }
252
- if ($csv_header == '_aioseop_disable_analytics') {
253
- $csv_header = 'seo_disable_analytics';
254
- }
255
- if ($csv_header == '_yoast_wpseo_focuskw') {
256
- $csv_header = 'focus_keyword';
257
- }
258
- if ($csv_header == '_yoast_wpseo_title') {
259
- $csv_header = 'title';
260
- }
261
- if ($csv_header == '_yoast_wpseo_metadesc') {
262
- $csv_header = 'meta_desc';
263
- }
264
- if ($csv_header == '_yoast_wpseo_meta-robots-noindex') {
265
- $csv_header = 'meta-robots-noindex';
266
- }
267
- if ($csv_header == '_yoast_wpseo_meta-robots-nofollow') {
268
- $csv_header = 'meta-robots-nofollow';
269
- }
270
- if ($csv_header == '_yoast_wpseo_meta-robots-adv') {
271
- $csv_header = 'meta-robots-adv';
272
- }
273
- if ($csv_header == '_yoast_wpseo_sitemap-include') {
274
- $csv_header = 'sitemap-include';
275
- }
276
- if ($csv_header == '_yoast_wpseo_sitemap-prio') {
277
- $csv_header = 'sitemap-prio';
278
- }
279
- if ($csv_header == '_yoast_wpseo_canonical') {
280
- $csv_header = 'canonical';
281
- }
282
- if ($csv_header == '_yoast_wpseo_redirect') {
283
- $csv_header = 'redirect';
284
- }
285
- if ($csv_header == '_yoast_wpseo_opengraph-description') {
286
- $csv_header = 'opengraph-description';
287
- }
288
- if ($csv_header == '_yoast_wpseo_google-plus-description') {
289
- $csv_header = 'google-plus-description';
290
- }
291
- if (array_key_exists($csv_header, $acf_fields)) {
292
- $csv_header = $acf_fields[$csv_header];
293
- }
294
-
295
- $CSV_FILE_CONTENT .= $csv_header . ",";
296
- }
297
-
298
- $CSV_FILE_CONTENT = substr($CSV_FILE_CONTENT, 0, -1);
299
- $CSV_FILE_CONTENT .= "\n";
300
- if ($CSVDATA) {
301
- foreach ($CSVDATA as $csv_content) {
302
- $csv_content = substr($csv_content, 0, -1);
303
- $CSV_FILE_CONTENT .= $csv_content . "\n";
304
- }
305
- }
306
- } elseif ($exporttype == 'customerreviews') {
307
- $header_query1 = "SELECT * FROM wp_wpcreviews";
308
- #TODO: Remove * from the SQL
309
-
310
- $result_header_query1 = $wpdb->get_results($header_query1);
311
- foreach ($result_header_query1 as $rhq1_key) {
312
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
313
- if (!in_array($rhq1_headkey, $Header)) {
314
- $Header[] = $rhq1_headkey;
315
- }
316
- }
317
- }
318
-
319
- $Header[] = 'date_time';
320
- $Header[] = 'reviewer_name';
321
- $Header[] = 'reviewer_email';
322
- $Header[] = 'reviewer_ip';
323
- $Header[] = 'review_title';
324
- $Header[] = 'review_text';
325
- $Header[] = 'review_response';
326
- $Header[] = 'status';
327
- $Header[] = 'review_rating';
328
- $Header[] = 'reviewer_url';
329
- $Header[] = 'page_id';
330
- $Header[] = 'custom_fields';
331
-
332
- # GENERATE AS CSV
333
- $CSVDATA = array();
334
- for ($j = 0; $j < 11; $j++) {
335
- foreach ($Header as $value) {
336
- $CSVDATA[$j] .= '"' . $value[$j] . '",';
337
- }
338
- }
339
- $CSV_FILE_CONTENT = array();
340
- foreach ($Header as $csv_header) {
341
- if ($csv_header == 'date_time') {
342
- $csv_header = 'date_time';
343
- }
344
- if ($csv_header == 'reviewer_name') {
345
- $csv_header = 'reviewer_name';
346
- }
347
- if ($csv_header == 'reviewer_email') {
348
- $csv_header = 'reviewer_email';
349
- }
350
- if ($csv_header == 'reviewer_ip') {
351
- $csv_header = 'reviewer_ip';
352
- }
353
- if ($csv_header == 'review_title') {
354
- $csv_header = 'review_title';
355
- }
356
- if ($csv_header == 'review_text') {
357
- $csv_header = 'review_text';
358
- }
359
- if ($csv_header == 'review_response') {
360
- $csv_header = 'review_response';
361
- }
362
- if ($csv_header == 'status') {
363
- $csv_header = 'status';
364
- }
365
- if ($csv_header == 'review_rating') {
366
- $csv_header = 'review_rating';
367
- }
368
- if ($csv_header == 'reviewer_url') {
369
- $csv_header = 'reviewer_url';
370
- }
371
- if ($csv_header == 'page_id') {
372
- $csv_header = 'page_id';
373
- }
374
- if ($csv_header == 'custom_fields') {
375
- $csv_header = 'custom_fields';
376
- }
377
-
378
- $isActive = false;
379
- $active_plugins = get_option('active_plugins');
380
- if (in_array('wp-customer-reviews/wp-customer-reviews.php', $active_plugins)) {
381
- $isActive = true;
382
- }
383
- #TODO: $isActive not used in this function / overwritten immediately
384
- $CSV_FILE_CONTENT .= $csv_header . ",";
385
- }
386
- $CSV_FILE_CONTENT = substr($CSV_FILE_CONTENT, 0, -1);
387
- $CSV_FILE_CONTENT .= "\n";
388
- if ($CSVDATA) {
389
- foreach ($CSVDATA as $csv_content) {
390
- $csv_content = substr($csv_content, 0, -1);
391
- $CSV_FILE_CONTENT .= $csv_content . "\n";
392
- }
393
- }
394
- } elseif ($exporttype == 'eshop') {
395
- $exporttype = 'post';
396
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
397
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
398
- $result_header_query1 = $wpdb->get_results($header_query1);
399
- $result_header_query2 = $wpdb->get_results($header_query2);
400
- foreach ($result_header_query1 as $rhq1_key) {
401
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
402
- if (!in_array($rhq1_headkey, $Header)) {
403
- if ($rhq1_headkey != 'to_ping' && $rhq1_headkey != 'pinged' && $rhq1_headkey != 'post_mime_type') {
404
- $Header[] = $rhq1_headkey;
405
- }
406
- }
407
- }
408
- }
409
- foreach ($result_header_query2 as $rhq2_headkey) {
410
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
411
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file' && $rhq2_headkey->meta_key != 'products' && $rhq2_headkey->meta_key != '_eshop_sale' && $rhq2_headkey->meta_key != 'post_mime_type' && $rhq2_headkey->meta_key != '_thumbnail_id' && $rhq2_headkey->meta_key != '_wp_attachment_metadata' && $rhq2_headkey->meta_key != '_eshop_featured') {
412
- $Header[] = $rhq2_headkey->meta_key;
413
- }
414
- }
415
- }
416
- $Header[] = 'products_option';
417
- $Header[] = 'regular_price';
418
- $Header[] = 'sale_price';
419
- $Header[] = 'featured_image';
420
- $Header[] = 'post_tag';
421
- $Header[] = 'post_category';
422
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = 'sku'";
423
-
424
- $result = $wpdb->get_col($get_post_ids);
425
- $fieldsCount = count($result);
426
- if ($result) {
427
- foreach ($result as $postID) {
428
- $pId = $pId . ',' . $postID;
429
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
430
- $result_query1 = $wpdb->get_results($query1);
431
- if (!empty($result_query1)) {
432
- foreach ($result_query1 as $posts) {
433
- foreach ($posts as $post_key => $post_value) {
434
- if ($post_key == 'post_status') {
435
- if (is_sticky($postID)) {
436
- $PostData[$postID][$post_key] = 'Sticky';
437
- $post_status = 'Sticky';
438
- } else {
439
- $PostData[$postID][$post_key] = $post_value;
440
- $post_status = $post_value;
441
- }
442
- } else {
443
- $PostData[$postID][$post_key] = $post_value;
444
- }
445
- if ($post_key == 'post_password') {
446
- if ($post_value) {
447
- $PostData[$postID]['post_status'] = "{" . $post_value . "}";
448
- } else {
449
- $PostData[$postID]['post_status'] = $post_status;
450
- }
451
- }
452
- }
453
- }
454
- }
455
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
456
- $result_query2 = $wpdb->get_results($query2);
457
- if (!empty($result_query2)) {
458
- foreach ($result_query2 as $postmeta) {
459
- if ($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
460
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
461
- }
462
- $eshop_products = $postmeta->meta_value;
463
- if ($postmeta->meta_key == 'products') {
464
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
465
- $eshop_products = unserialize($eshop_products);
466
- foreach ($eshop_products as $key) {
467
- $PostMetaData[$postmeta->post_id]['products_option'] .= $key['option'] . ',';
468
- $PostMetaData[$postmeta->post_id]['sale_price'] .= $key['saleprice'] . ',';
469
- $PostMetaData[$postmeta->post_id]['regular_price'] .= $key['price'] . ',';
470
- }
471
- $PostMetaData[$postmeta->post_id]['products_option'] = substr($PostMetaData[$postmeta->post_id]['products_option'], 0, -1);
472
- $PostMetaData[$postmeta->post_id]['sale_price'] = substr($PostMetaData[$postmeta->post_id]['sale_price'], 0, -1);
473
- $PostMetaData[$postmeta->post_id]['regular_price'] = substr($PostMetaData[$postmeta->post_id]['regular_price'], 0, -1);
474
- }
475
- if ($postmeta->meta_key == '_thumbnail_id') {
476
- $attachment_file = '';
477
- #TODO: $attachment_file not used in this function / overwritten immediately
478
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
479
- $attachment = $wpdb->get_results($get_attachement);
480
- $attachment_file = $attachment[0]->guid;
481
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
482
- $postmeta->meta_key = 'featured_image';
483
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
484
- }
485
- }
486
-
487
- }
488
- // Tags & Categories
489
- $get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
490
- $postTags = $postCategory = '';
491
- foreach ($get_tags as $tags) {
492
- $postTags .= $tags . ',';
493
- }
494
- $postTags = substr($postTags, 0, -1);
495
- $TermsData[$postID]['post_tag'] = $postTags;
496
- $get_categotries = wp_get_post_categories($postID, array('fields' => 'names'));
497
- foreach ($get_categotries as $category) {
498
- $postCategory .= $category . '|';
499
- }
500
- $postCategory = substr($postCategory, 0, -1);
501
- $TermsData[$postID]['post_category'] = $postCategory;
502
- }
503
-
504
- $ExportData = array();
505
- // Merge all arrays
506
- foreach ($PostData as $pd_key => $pd_val) {
507
- if (array_key_exists($pd_key, $PostMetaData)) {
508
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
509
- }
510
- if (array_key_exists($pd_key, $TermsData)) {
511
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
512
- }
513
- }
514
- foreach ($Header as $header_key) {
515
- foreach ($ExportData as $ED_key) {
516
- if (array_key_exists($header_key, $ED_key)) {
517
- $CSVContent[$header_key][] = $ED_key[$header_key];
518
- } else {
519
- $CSVContent[$header_key][] = '';
520
- }
521
- }
522
- }
523
- }
524
- # GENERATE AS CSV
525
- $CSVDATA = array();
526
- for ($j = 0; $j < $fieldsCount; $j++) {
527
- foreach ($Header as $value) {
528
- $CSVDATA[$j] .= '"' . $CSVContent[$value][$j] . '",';
529
- }
530
- }
531
- $CSV_FILE_CONTENT = array();
532
- foreach ($Header as $csv_header) {
533
- if ($csv_header == '_eshop_stock') {
534
- $csv_header = 'stock_available';
535
- }
536
- if ($csv_header == 'cart_radio') {
537
- $csv_header = 'cart_option';
538
- }
539
- if ($csv_header == 'sale') {
540
- $csv_header = 'product_in_sale';
541
- }
542
- if ($csv_header == 'featured') {
543
- $csv_header = 'featured_product';
544
- }
545
- if ($csv_header == 'sku') {
546
- $csv_header = 'SKU';
547
- }
548
- if ($csv_header == '_aioseop_keywords') {
549
- $csv_header = 'seo_keywords';
550
- }
551
- if ($csv_header == '_aioseop_description') {
552
- $csv_header = 'seo_description';
553
- }
554
- if ($csv_header == '_aioseop_title') {
555
- $csv_header = 'seo_title';
556
- }
557
- if ($csv_header == '_aioseop_noindex') {
558
- $csv_header = 'seo_noindex';
559
- }
560
- if ($csv_header == '_aioseop_nofollow') {
561
- $csv_header = 'seo_nofollow';
562
- }
563
- if ($csv_header == '_aioseop_disable') {
564
- $csv_header = 'seo_disable';
565
- }
566
- if ($csv_header == '_aioseop_disable_analytics') {
567
- $csv_header = 'seo_disable_analytics';
568
- }
569
- if ($csv_header == '_yoast_wpseo_focuskw') {
570
- $csv_header = 'focus_keyword';
571
- }
572
- if ($csv_header == '_yoast_wpseo_title') {
573
- $csv_header = 'title';
574
- }
575
- if ($csv_header == '_yoast_wpseo_metadesc') {
576
- $csv_header = 'meta_desc';
577
- }
578
- if ($csv_header == '_yoast_wpseo_meta-robots-noindex') {
579
- $csv_header = 'meta-robots-noindex';
580
- }
581
- if ($csv_header == '_yoast_wpseo_meta-robots-nofollow') {
582
- $csv_header = 'meta-robots-nofollow';
583
- }
584
- if ($csv_header == '_yoast_wpseo_meta-robots-adv') {
585
- $csv_header = 'meta-robots-adv';
586
- }
587
- if ($csv_header == '_yoast_wpseo_sitemap-include') {
588
- $csv_header = 'sitemap-include';
589
- }
590
- if ($csv_header == '_yoast_wpseo_sitemap-prio') {
591
- $csv_header = 'sitemap-prio';
592
- }
593
- if ($csv_header == '_yoast_wpseo_canonical') {
594
- $csv_header = 'canonical';
595
- }
596
- if ($csv_header == '_yoast_wpseo_redirect') {
597
- $csv_header = 'redirect';
598
- }
599
- if ($csv_header == '_yoast_wpseo_opengraph-description') {
600
- $csv_header = 'opengraph-description';
601
- }
602
- if ($csv_header == '_yoast_wpseo_google-plus-description') {
603
- $csv_header = 'google-plus-description';
604
- }
605
-
606
- if ($csv_header == 'post_tag') {
607
- $csv_header = 'tags';
608
- }
609
- if ($csv_header == 'post_category') {
610
- $csv_header = 'category';
611
- }
612
- $CSV_FILE_CONTENT .= $csv_header . ",";
613
- }
614
- $CSV_FILE_CONTENT = substr($CSV_FILE_CONTENT, 0, -1);
615
- $CSV_FILE_CONTENT .= "\n";
616
- if ($CSVDATA) {
617
- foreach ($CSVDATA as $csv_content) {
618
- $csv_content = substr($csv_content, 0, -1);
619
- $CSV_FILE_CONTENT .= $csv_content . "\n";
620
- }
621
- }
622
- } elseif ($exporttype == 'wpcommerce') {
623
- $exporttype = 'wpsc-product';
624
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
625
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
626
- $result_header_query1 = $wpdb->get_results($header_query1);
627
- $result_header_query2 = $wpdb->get_results($header_query2);
628
- foreach ($result_header_query1 as $rhq1_key) {
629
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
630
- if (!in_array($rhq1_headkey, $Header)) {
631
- $Header[] = $rhq1_headkey;
632
- }
633
- }
634
- }
635
- foreach ($result_header_query2 as $rhq2_headkey) {
636
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
637
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file' && $rhq2_headkey->meta_key != '_wpsc_product_metadata') {
638
- $Header[] = $rhq2_headkey->meta_key;
639
- }
640
- }
641
- }
642
- $Header[] = 'featured_image';
643
- $Header[] = 'product_tag';
644
- $Header[] = 'wpsc_product_category';
645
- $Header[] = 'notify_when_none_left';
646
- $Header[] = 'unpublish_when_none_left';
647
- $Header[] = 'wpec_taxes_taxable_amount';
648
- $Header[] = 'wpec_taxes_taxable';
649
- $Header[] = 'external_link';
650
- $Header[] = 'external_link_text';
651
- $Header[] = 'external_link_target';
652
- $Header[] = 'no_shipping';
653
- $Header[] = 'weight';
654
- $Header[] = 'weight_unit';
655
- $Header[] = 'height';
656
- $Header[] = 'height_unit';
657
- $Header[] = 'width';
658
- $Header[] = 'width_unit';
659
- $Header[] = 'length';
660
- $Header[] = 'length_unit';
661
- $Header[] = 'merchant_notes';
662
- $Header[] = 'enable_comments';
663
- $Header[] = 'quantity_limited';
664
- $Header[] = 'special';
665
- $Header[] = 'display_weight_as';
666
- $Header[] = 'table_rate_price';
667
- $Header[] = 'state';
668
- $Header[] = 'quantity';
669
- $Header[] = 'shipping';
670
- $Header[] = 'table_price';
671
- $Header[] = 'google_prohibited';
672
-
673
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_wpsc_sku'";
674
- $result = $wpdb->get_col($get_post_ids);
675
- $fieldsCount = count($result);
676
- if ($result) {
677
- foreach ($result as $postID) {
678
- $pId = $pId . ',' . $postID;
679
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
680
- $result_query1 = $wpdb->get_results($query1);
681
- if (!empty($result_query1)) {
682
- foreach ($result_query1 as $posts) {
683
- foreach ($posts as $post_key => $post_value) {
684
- if ($post_key == 'post_status') {
685
- if (is_sticky($postID)) {
686
- $PostData[$postID][$post_key] = 'Sticky';
687
- $post_status = 'Sticky';
688
- } else {
689
- $PostData[$postID][$post_key] = $post_value;
690
- $post_status = $post_value;
691
- }
692
- } else {
693
- $PostData[$postID][$post_key] = $post_value;
694
- }
695
- if ($post_key == 'post_password') {
696
- if ($post_value) {
697
- $PostData[$postID]['post_status'] = "{" . $post_value . "}";
698
- } else {
699
- $PostData[$postID]['post_status'] = $post_status;
700
- }
701
- }
702
- }
703
- }
704
- }
705
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
706
- $result_query2 = $wpdb->get_results($query2);
707
- if (!empty($result_query2)) {
708
- foreach ($result_query2 as $postmeta) {
709
- if ($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
710
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
711
- }
712
- $eshop_products = $postmeta->meta_value;
713
- if ($postmeta->meta_key == 'products') {
714
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
715
- $eshop_products = unserialize($eshop_products);
716
- foreach ($eshop_products as $key) {
717
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key['option'] . '|' . $key['price'] . '|' . $key['saleprice'] . ',';
718
- }
719
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
720
- }
721
- if ($postmeta->meta_key == '_thumbnail_id') {
722
- $attachment_file = '';
723
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
724
- $attachment = $wpdb->get_results($get_attachement);
725
- $attachment_file = $attachment[0]->guid;
726
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
727
- $postmeta->meta_key = 'featured_image';
728
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
729
- }
730
- if ($postmeta->meta_key == '_wpsc_product_metadata') {
731
- $productMeta = unserialize($postmeta->meta_value);
732
- foreach ($productMeta as $metaKey => $metaValue) {
733
- if ($metaKey == 'notify_when_none_left' || $metaKey == 'unpublish_when_none_left' || $metaKey == 'external_link' || $metaKey == 'external_link_text' || $metaKey == 'external_link_target' || $metaKey == 'no_shipping' || $metaKey == 'weight' || $metaKey == 'weight_unit' || $metaKey == 'merchant_notes' || $metaKey == 'enable_comments' || $metaKey == 'quantity_limited' || $metaKey == 'special' || $metaKey == 'display_weight_as' || $metaKey == 'google_prohibited') {
734
- $PostMetaData[$postmeta->post_id][$metaKey] = $metaValue;
735
- }
736
- if ($metaKey == 'wpec_taxes_taxable_amount') {
737
- $PostMetaData[$postmeta->post_id]['taxable_amount'] = $metaValue;
738
- }
739
- if ($metaKey == 'wpec_taxes_taxable') {
740
- $PostMetaData[$postmeta->post_id]['is_taxable'] = $metaValue;
741
- }
742
- if ($metaKey == 'dimensions') {
743
- foreach ($metaValue as $mk => $mv) {
744
- $PostMetaData[$postmeta->post_id][$mk] = $mv;
745
- }
746
- }
747
- if ($metaKey == 'shipping') {
748
- $PostMetaData[$postmeta->post_id]['shipping'] = $metaKey['local'] . '|' . $metaKey['international'];
749
- }
750
- if ($metaKey == 'table_rate_price') {
751
- $PostMetaData[$postmeta->post_id]['state'] = $metaKey['table_rate_price']['state'];
752
- $PostMetaData[$postmeta->post_id]['quantity'] = $metaKey['table_rate_price']['quantity'][0];
753
- $PostMetaData[$postmeta->post_id]['table_price'] = $metaKey['table_rate_price']['table_price'][0];
754
- }
755
- }
756
- }
757
- }
758
-
759
- }
760
- // Tags & Categories
761
- $postTags = $postCategory = '';
762
- $taxonomies = get_object_taxonomies($exporttype);
763
- foreach ($taxonomies as $taxonomy) {
764
- if ($taxonomy == 'product_tag') {
765
- $get_tags = get_the_terms($postID, $taxonomy);
766
- if ($get_tags) {
767
- foreach ($get_tags as $tags) {
768
- $postTags .= $tags->name . ',';
769
- }
770
- }
771
- $postTags = substr($postTags, 0, -1);
772
- $TermsData[$postID]['product_tag'] = $postTags;
773
- }
774
- if ($taxonomy == 'wpsc_product_category') {
775
- $get_categotries = wp_get_post_terms($postID, $taxonomy);
776
- if ($get_categotries) {
777
- foreach ($get_categotries as $category) {
778
- $postCategory .= $category->name . '|';
779
- }
780
- }
781
- $postCategory = substr($postCategory, 0, -1);
782
- $TermsData[$postID][$taxonomy] = $postCategory;
783
- }
784
- }
785
- }
786
-
787
- $ExportData = array();
788
- // Merge all arrays
789
- foreach ($PostData as $pd_key => $pd_val) {
790
- if (array_key_exists($pd_key, $PostMetaData)) {
791
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
792
- }
793
- if (array_key_exists($pd_key, $TermsData)) {
794
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
795
- }
796
- }
797
- foreach ($Header as $header_key) {
798
- foreach ($ExportData as $ED_key) {
799
- if (array_key_exists($header_key, $ED_key)) {
800
- $CSVContent[$header_key][] = $ED_key[$header_key];
801
- } else {
802
- $CSVContent[$header_key][] = '';
803
- }
804
- }
805
- }
806
- }
807
- # GENERATE AS CSV
808
- $CSVDATA = array();
809
- for ($j = 0; $j < $fieldsCount; $j++) {
810
- foreach ($Header as $value) {
811
- $CSVDATA[$j] .= '"' . $CSVContent[$value][$j] . '",';
812
- }
813
- }
814
-
815
- $CSV_FILE_CONTENT = array();
816
- foreach ($Header as $csv_header) {
817
- if ($csv_header == '_wpsc_stock') {
818
- $csv_header = 'stock';
819
- }
820
- if ($csv_header == '_wpsc_price') {
821
- $csv_header = 'price';
822
- }
823
- if ($csv_header == '_wpsc_special_price') {
824
- $csv_header = 'sale_price';
825
- }
826
- if ($csv_header == '_wpsc_sku') {
827
- $csv_header = 'SKU';
828
- }
829
- if ($csv_header == 'wpec_taxes_taxable_amount') {
830
- $csv_header = 'taxable_amount';
831
- }
832
- if ($csv_header == 'wpec_taxes_taxable') {
833
- $csv_header = 'is_taxable';
834
- }
835
- if ($csv_header == '_aioseop_keywords') {
836
- $csv_header = 'seo_keywords';
837
- }
838
- if ($csv_header == '_aioseop_description') {
839
- $csv_header = 'seo_description';
840
- }
841
- if ($csv_header == '_aioseop_title') {
842
- $csv_header = 'seo_title';
843
- }
844
- if ($csv_header == '_aioseop_noindex') {
845
- $csv_header = 'seo_noindex';
846
- }
847
- if ($csv_header == '_aioseop_nofollow') {
848
- $csv_header = 'seo_nofollow';
849
- }
850
- if ($csv_header == '_aioseop_disable') {
851
- $csv_header = 'seo_disable';
852
- }
853
- if ($csv_header == '_yoast_wpseo_focuskw') {
854
- $csv_header = 'focus_keyword';
855
- }
856
- if ($csv_header == '_yoast_wpseo_title') {
857
- $csv_header = 'title';
858
- }
859
- if ($csv_header == '_yoast_wpseo_metadesc') {
860
- $csv_header = 'meta_desc';
861
- }
862
- if ($csv_header == '_yoast_wpseo_meta-robots-noindex') {
863
- $csv_header = 'meta-robots-noindex';
864
- }
865
- if ($csv_header == '_yoast_wpseo_meta-robots-nofollow') {
866
- $csv_header = 'meta-robots-nofollow';
867
- }
868
- if ($csv_header == '_yoast_wpseo_meta-robots-adv') {
869
- $csv_header = 'meta-robots-adv';
870
- }
871
- if ($csv_header == '_yoast_wpseo_sitemap-include') {
872
- $csv_header = 'sitemap-include';
873
- }
874
- if ($csv_header == '_yoast_wpseo_sitemap-prio') {
875
- $csv_header = 'sitemap-prio';
876
- }
877
- if ($csv_header == '_yoast_wpseo_canonical') {
878
- $csv_header = 'canonical';
879
- }
880
- if ($csv_header == '_yoast_wpseo_redirect') {
881
- $csv_header = 'redirect';
882
- }
883
- if ($csv_header == '_yoast_wpseo_opengraph-description') {
884
- $csv_header = 'opengraph-description';
885
- }
886
- if ($csv_header == '_yoast_wpseo_google-plus-description') {
887
- $csv_header = 'google-plus-description';
888
- }
889
- if ($csv_header == '_aioseop_disable_analytics') {
890
- $csv_header = 'seo_disable_analytics';
891
- }
892
- if ($csv_header == 'product_tag') {
893
- $csv_header = 'product_tags';
894
- }
895
- if ($csv_header == 'wpsc_product_category') {
896
- $csv_header = 'product_category';
897
- }
898
- // Code for wp-ecommerce-custom-fields support
899
- $isActive = false;
900
- $active_plugins = get_option('active_plugins');
901
- if (in_array('wp-e-commerce-custom-fields/custom-fields.php', $active_plugins)) {
902
- $isActive = true;
903
- }
904
- if ($isActive) {
905
- $get_wpcf = unserialize(get_option('wpsc_cf_data'));
906
- foreach ($get_wpcf as $wpcf_key => $wpcf_val) {
907
- $key = '_wpsc_' . $wpcf_val['slug'];
908
- if ($csv_header == $key) {
909
- $csv_header = $wpcf_val['name'];
910
- }
911
- }
912
- } // Code ends here
913
-
914
- $CSV_FILE_CONTENT .= $csv_header . ",";
915
- }
916
- $CSV_FILE_CONTENT = substr($CSV_FILE_CONTENT, 0, -1);
917
- $CSV_FILE_CONTENT .= "\n";
918
- if ($CSVDATA) {
919
- foreach ($CSVDATA as $csv_content) {
920
- $csv_content = substr($csv_content, 0, -1);
921
- $CSV_FILE_CONTENT .= $csv_content . "\n";
922
- }
923
- }
924
- } elseif ($exporttype == 'woocommerce') {
925
- $exporttype = 'product';
926
- $header_query1 = "SELECT wp.* FROM wp_posts wp where post_type = '$exporttype'";
927
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
928
- $result_header_query1 = $wpdb->get_results($header_query1);
929
- $result_header_query2 = $wpdb->get_results($header_query2);
930
- foreach ($result_header_query1 as $rhq1_key) {
931
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
932
- if (!in_array($rhq1_headkey, $Header)) {
933
- $Header[] = $rhq1_headkey;
934
- }
935
- }
936
- }
937
- foreach ($result_header_query2 as $rhq2_headkey) {
938
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
939
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file') {
940
- $Header[] = $rhq2_headkey->meta_key;
941
- }
942
- }
943
- }
944
- $Header[] = 'featured_image';
945
- $Header[] = 'product_tag';
946
- $Header[] = 'product_category';
947
- $Header[] = '_product_attribute_name';
948
- $Header[] = '_product_attribute_value';
949
- $Header[] = '_product_attribute_visible';
950
- $Header[] = '_product_attribute_variation';
951
-
952
- $get_post_ids = "select DISTINCT ID from wp_posts p join wp_postmeta pm on pm.post_id = p.ID where post_type = '$exporttype' and post_status in ('publish','draft','future','private','pending') and pm.meta_key = '_sku'";
953
-
954
- $result = $wpdb->get_col($get_post_ids);
955
- $fieldsCount = count($result);
956
- if ($result) {
957
- foreach ($result as $postID) {
958
- $pId = $pId . ',' . $postID;
959
- $query1 = "SELECT wp.* FROM wp_posts wp where ID=$postID";
960
- $result_query1 = $wpdb->get_results($query1);
961
- if (!empty($result_query1)) {
962
- foreach ($result_query1 as $posts) {
963
- foreach ($posts as $post_key => $post_value) {
964
- if ($post_key == 'post_status') {
965
- if (is_sticky($postID)) {
966
- $PostData[$postID][$post_key] = 'Sticky';
967
- $post_status = 'Sticky';
968
- } else {
969
- $PostData[$postID][$post_key] = $post_value;
970
- $post_status = $post_value;
971
- }
972
- } else {
973
- $PostData[$postID][$post_key] = $post_value;
974
- }
975
- if ($post_key == 'post_password') {
976
- if ($post_value) {
977
- $PostData[$postID]['post_status'] = "{" . $post_value . "}";
978
- } else {
979
- $PostData[$postID]['post_status'] = $post_status;
980
- }
981
- }
982
- if ($post_key == 'comment_status') {
983
- if ($post_value == 'closed') {
984
- $PostData[$postID]['comment_status'] = 0;
985
- }
986
- if ($post_value == 'open') {
987
- $PostData[$postID]['comment_status'] = 1;
988
- }
989
- }
990
-
991
- }
992
- }
993
- }
994
- $query2 = "SELECT post_id, meta_key, meta_value FROM wp_posts wp JOIN wp_postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
995
- $result_query2 = $wpdb->get_results($query2);
996
- if (!empty($result_query2)) {
997
- foreach ($result_query2 as $postmeta) {
998
- if ($postmeta->meta_key != '_eshop_product' && $postmeta->meta_key != '_thumbnail_id') {
999
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
1000
- }
1001
- $eshop_products = $postmeta->meta_value;
1002
- if ($postmeta->meta_key == '_product_attributes') {
1003
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
1004
- $product_attribute_name = $product_attribute_value = $product_attribute_visible = $product_attribute_variation = '';
1005
- $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = '';
1006
- $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = '';
1007
- $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = '';
1008
- $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = '';
1009
- $eshop_products_unser1 = unserialize($eshop_products);
1010
- $check_attr_count1 = count($eshop_products_unser1);
1011
- if ($check_attr_count1 == 1) {
1012
- $eshop_products_unser2 = unserialize($eshop_products_unser1);
1013
- $check_attr_count2 = count($eshop_products_unser2);
1014
- }
1015
- if ($check_attr_count1 < $check_attr_count2) {
1016
- $unserialized_attributes = $eshop_products_unser2;
1017
- } else {
1018
- $unserialized_attributes = $eshop_products_unser1;
1019
- }
1020
-
1021
- foreach ($unserialized_attributes as $key) {
1022
- foreach ($key as $attr_header => $attr_value) {
1023
- if ($attr_header == 'name') {
1024
- $product_attribute_name .= $attr_value . '|';
1025
- }
1026
- if ($attr_header == 'value') {
1027
- $product_attribute_value .= $attr_value . '|';
1028
- }
1029
- if ($attr_header == 'is_visible') {
1030
- $product_attribute_visible .= $attr_value . '|';
1031
- }
1032
- if ($attr_header == 'is_variation') {
1033
- if (isset($attr_value)) {
1034
- $product_attribute_variation .= $attr_value . '|';
1035
- }
1036
- }
1037
- }
1038
- }
1039
- $PostMetaData[$postmeta->post_id]['_product_attribute_name'] = substr($product_attribute_name, 0, -1);
1040
- $PostMetaData[$postmeta->post_id]['_product_attribute_value'] = substr($product_attribute_value, 0, -1);
1041
- $PostMetaData[$postmeta->post_id]['_product_attribute_visible'] = substr($product_attribute_visible, 0, -1);
1042
- $PostMetaData[$postmeta->post_id]['_product_attribute_variation'] = substr($product_attribute_variation, 0, -1);
1043
- }
1044
- $upsellids = array();
1045
- $crosssellids = array();
1046
- #TODO: $upsellids, $crosssellids not used in this function / overwritten immediately
1047
- if ($postmeta->meta_key == '_upsell_ids') {
1048
- if ($postmeta->meta_value != '' && $postmeta->meta_value != null) {
1049
- $upsellids = unserialize($postmeta->meta_value);
1050
- if (is_array($upsellids)) {
1051
- $upsell_ids = null;
1052
- foreach ($upsellids as $upsellID) {
1053
- $upsell_ids .= $upsellID . ',';
1054
- }
1055
- $PostMetaData[$postmeta->post_id]['_upsell_ids'] = substr($upsell_ids, 0, -1);
1056
- } else {
1057
- $PostMetaData[$postmeta->post_id]['_upsell_ids'] = '';
1058
- }
1059
- }
1060
- }
1061
- if ($postmeta->meta_key == '_crosssell_ids') {
1062
- if ($postmeta->meta_value != '' && $postmeta->meta_value != null) {
1063
- $crosssellids = unserialize($postmeta->meta_value);
1064
- if (is_array($crosssellids)) {
1065
- $crosssell_ids = null;
1066
- foreach ($crosssellids as $crosssellID) {
1067
- $crosssell_ids .= $crosssellID . ',';
1068
- }
1069
- $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = substr($crosssell_ids, 0, -1);
1070
- } else {
1071
- $PostMetaData[$postmeta->post_id]['_crosssell_ids'] = '';
1072
- }
1073
- }
1074
- }
1075
- if ($postmeta->meta_key == '_thumbnail_id') {
1076
- $attachment_file = '';
1077
- $get_attachement = "select guid from wp_posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
1078
- $attachment = $wpdb->get_results($get_attachement);
1079
- $attachment_file = $attachment[0]->guid;
1080
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
1081
- $postmeta->meta_key = 'featured_image';
1082
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
1083
- }
1084
- if ($postmeta->meta_key == '_visibility') {
1085
- if ($postmeta->meta_value == 'visible') {
1086
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
1087
- }
1088
- if ($postmeta->meta_value == 'catalog') {
1089
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
1090
- }
1091
- if ($postmeta->meta_value == 'search') {
1092
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
1093
- }
1094
- if ($postmeta->meta_value == 'hidden') {
1095
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 4;
1096
- }
1097
- }
1098
- if ($postmeta->meta_key == '_stock_status') {
1099
- if ($postmeta->meta_value == 'instock') {
1100
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
1101
- }
1102
- if ($postmeta->meta_value == 'outofstock') {
1103
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
1104
- }
1105
- }
1106
- if ($postmeta->meta_key == '_tax_status') {
1107
- if ($postmeta->meta_value == 'taxable') {
1108
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
1109
- }
1110
- if ($postmeta->meta_value == 'shipping') {
1111
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
1112
- }
1113
- if ($postmeta->meta_value == 'none') {
1114
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
1115
- }
1116
- }
1117
- if ($postmeta->meta_key == '_tax_class') {
1118
- if ($postmeta->meta_value == '') {
1119
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
1120
- }
1121
- if ($postmeta->meta_value == 'reduced-rate') {
1122
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
1123
- }
1124
- if ($postmeta->meta_value == 'zero-rate') {
1125
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
1126
- }
1127
- }
1128
- if ($postmeta->meta_key == '_backorders') {
1129
- if ($postmeta->meta_value == 'no') {
1130
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 1;
1131
- }
1132
- if ($postmeta->meta_value == 'notify') {
1133
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 2;
1134
- }
1135
- if ($postmeta->meta_value == 'yes') {
1136
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = 3;
1137
- }
1138
- }
1139
- if ($postmeta->meta_key == '_featured') {
1140
- if ($postmeta->meta_value == 'no') {
1141
- $PostMetaData[$postmeta->post_id]['featured_product'] = 1;
1142
- }
1143
- if ($postmeta->meta_value == 'yes') {
1144
- $PostMetaData[$postmeta->post_id]['featured_product'] = 2;
1145
- }
1146
- if ($postmeta->meta_value == 'zero-rate') {
1147
- $PostMetaData[$postmeta->post_id]['featured_product'] = 3;
1148
- }
1149
- }
1150
- if ($postmeta->meta_key == '_product_type') {
1151
- if ($postmeta->meta_value == 'simple') {
1152
- $PostMetaData[$postmeta->post_id]['featured_product'] = 1;
1153
- }
1154
- if ($postmeta->meta_value == 'grouped') {
1155
- $PostMetaData[$postmeta->post_id]['featured_product'] = 2;
1156
- }
1157
- if ($postmeta->meta_value == 'variable') {
1158
- $PostMetaData[$postmeta->post_id]['featured_product'] = 4;
1159
- }
1160
- }
1161
- }
1162
-
1163
- }
1164
- // Tags & Categories
1165
- $postTags = $postCategory = '';
1166
- $taxonomies = get_object_taxonomies($exporttype);
1167
- $get_tags = get_the_terms($postID, 'product_tag');
1168
- if ($get_tags) {
1169
- foreach ($get_tags as $tags) {
1170
- $postTags .= $tags->name . ',';
1171
- }
1172
- }
1173
- $postTags = substr($postTags, 0, -1);
1174
- $TermsData[$postID]['product_tag'] = $postTags;
1175
- foreach ($taxonomies as $taxonomy) {
1176
- if ($taxonomy == 'product_cat') {
1177
- $get_categotries = wp_get_post_terms($postID, $taxonomy);
1178
- if ($get_categotries) {
1179
- foreach ($get_categotries as $category) {
1180
- $postCategory .= $category->name . '|';
1181
- }
1182
- }
1183
- $postCategory = substr($postCategory, 0, -1);
1184
- $TermsData[$postID]['product_category'] = $postCategory;
1185
- }
1186
- }
1187
- }
1188
-
1189
- $ExportData = array();
1190
- // Merge all arrays
1191
- foreach ($PostData as $pd_key => $pd_val) {
1192
- if (array_key_exists($pd_key, $PostMetaData)) {
1193
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
1194
- }
1195
- if (array_key_exists($pd_key, $TermsData)) {
1196
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
1197
- }
1198
- }
1199
- foreach ($Header as $header_key) {
1200
- foreach ($ExportData as $ED_key) {
1201
- if (array_key_exists($header_key, $ED_key)) {
1202
- $CSVContent[$header_key][] = $ED_key[$header_key];
1203
- } else {
1204
- $CSVContent[$header_key][] = '';
1205
- }
1206
- }
1207
- }
1208
- }
1209
- # GENERATE AS CSV
1210
- $CSVDATA = array();
1211
- for ($j = 0; $j < $fieldsCount; $j++) {
1212
- foreach ($Header as $value) {
1213
- $CSVDATA[$j] .= '"' . $CSVContent[$value][$j] . '",';
1214
- }
1215
- }
1216
- $CSV_FILE_CONTENT = array();
1217
- foreach ($Header as $csv_header) {
1218
- if ($csv_header == 'post_title') {
1219
- $csv_header = 'product_name';
1220
- }
1221
- if ($csv_header == 'post_content') {
1222
- $csv_header = 'product_content';
1223
- }
1224
- if ($csv_header == 'post_name') {
1225
- $csv_header = 'product_slug';
1226
- }
1227
- if ($csv_header == 'post_excerpt') {
1228
- $csv_header = 'product_short_description';
1229
- }
1230
- if ($csv_header == 'post_status') {
1231
- $csv_header = 'product_status';
1232
- }
1233
- if ($csv_header == 'post_date') {
1234
- $csv_header = 'product_publish_date';
1235
- }
1236
- if ($csv_header == '_product_type') {
1237
- $csv_header = 'product_type';
1238
- }
1239
- if ($csv_header == '_product_shipping_class') {
1240
- $csv_header = 'product_shipping_class';
1241
- }
1242
- if ($csv_header == '_visibility') {
1243
- $csv_header = 'visibility';
1244
- }
1245
- if ($csv_header == '_stock_status') {
1246
- $csv_header = 'stock_status';
1247
- }
1248
- if ($csv_header == '_manage_stock') {
1249
- $csv_header = 'manage_stock';
1250
- }
1251
- if ($csv_header == '_total_sales') {
1252
- $csv_header = 'total_sales';
1253
- }
1254
- if ($csv_header == '_downloadable') {
1255
- $csv_header = 'downloadable';
1256
- }
1257
- if ($csv_header == '_virtual') {
1258
- $csv_header = 'virtual';
1259
- }
1260
- if ($csv_header == '_product_image_gallery') {
1261
- $csv_header = 'product_image_gallery';
1262
- }
1263
- if ($csv_header == '_regular_price') {
1264
- $csv_header = 'regular_price';
1265
- }
1266
- if ($csv_header == '_sale_price') {
1267
- $csv_header = 'sale_price';
1268
- }
1269
- if ($csv_header == '_tax_status') {
1270
- $csv_header = 'tax_status';
1271
- }
1272
- if ($csv_header == '_tax_class') {
1273
- $csv_header = 'tax_class';
1274
- }
1275
- if ($csv_header == '_purchase_note') {
1276
- $csv_header = 'purchase_note';
1277
- }
1278
- if ($csv_header == '_featured') {
1279
- $csv_header = 'featured_product';
1280
- }
1281
- if ($csv_header == '_weight') {
1282
- $csv_header = 'weight';
1283
- }
1284
- if ($csv_header == '_length') {
1285
- $csv_header = 'length';
1286
- }
1287
- if ($csv_header == '_width') {
1288
- $csv_header = 'width';
1289
- }
1290
- if ($csv_header == '_height') {
1291
- $csv_header = 'height';
1292
- }
1293
- if ($csv_header == '_sku') {
1294
- $csv_header = 'sku';
1295
- }
1296
- if ($csv_header == '_upsell_ids') {
1297
- $csv_header = 'upsell_ids';
1298
- }
1299
- if ($csv_header == '_crosssell_ids') {
1300
- $csv_header = 'crosssell_ids';
1301
- }
1302
- if ($csv_header == '_product_attribute_name') {
1303
- $csv_header = 'product_attribute_name';
1304
- }
1305
- if ($csv_header == '_product_attribute_value') {
1306
- $csv_header = 'product_attribute_value';
1307
- }
1308
- if ($csv_header == '_product_attribute_visible') {
1309
- $csv_header = 'product_attribute_visible';
1310
- }
1311
- if ($csv_header == '_product_attribute_variation') {
1312
- $csv_header = 'product_attribute_variation';
1313
- }
1314
- if ($csv_header == '_sale_price_dates_from') {
1315
- $csv_header = 'sale_price_dates_from';
1316
- }
1317
- if ($csv_header == '_sale_price_dates_to') {
1318
- $csv_header = 'sale_price_dates_to';
1319
- }
1320
- if ($csv_header == '_price') {
1321
- $csv_header = 'price';
1322
- }
1323
- if ($csv_header == '_stock') {
1324
- $csv_header = 'stock';
1325
- }
1326
- if ($csv_header == '_backorders') {
1327
- $csv_header = 'backorders';
1328
- }
1329
- if ($csv_header == '_file_paths') {
1330
- $csv_header = 'file_paths';
1331
- }
1332
- if ($csv_header == '_download_limit') {
1333
- $csv_header = 'download_limit';
1334
- }
1335
- if ($csv_header == '_download_expiry') {
1336
- $csv_header = 'download_expiry';
1337
- }
1338
- if ($csv_header == '_product_url') {
1339
- $csv_header = 'product_url';
1340
- }
1341
- if ($csv_header == '_button_text') {
1342
- $csv_header = 'button_text';
1343
- }
1344
- if ($csv_header == '_sold_individually') {
1345
- $csv_header = 'sold_individually';
1346
- }
1347
- if ($csv_header == '_aioseop_keywords') {
1348
- $csv_header = 'seo_keywords';
1349
- }
1350
- if ($csv_header == '_aioseop_description') {
1351
- $csv_header = 'seo_description';
1352
- }
1353
- if ($csv_header == '_aioseop_title') {
1354
- $csv_header = 'seo_title';
1355
- }
1356
- if ($csv_header == '_aioseop_noindex') {
1357
- $csv_header = 'seo_noindex';
1358
- }
1359
- if ($csv_header == '_aioseop_nofollow') {
1360
- $csv_header = 'seo_nofollow';
1361
- }
1362
- if ($csv_header == '_aioseop_disable') {
1363
- $csv_header = 'seo_disable';
1364
- }
1365
- if ($csv_header == '_aioseop_disable_analytics') {
1366
- $csv_header = 'seo_disable_analytics';
1367
- }
1368
- if ($csv_header == '_yoast_wpseo_focuskw') {
1369
- $csv_header = 'focus_keyword';
1370
- }
1371
- if ($csv_header == '_yoast_wpseo_title') {
1372
- $csv_header = 'title';
1373
- }
1374
- if ($csv_header == '_yoast_wpseo_metadesc') {
1375
- $csv_header = 'meta_desc';
1376
- }
1377
- if ($csv_header == '_yoast_wpseo_meta-robots-noindex') {
1378
- $csv_header = 'meta-robots-noindex';
1379
- }
1380
- if ($csv_header == '_yoast_wpseo_meta-robots-nofollow') {
1381
- $csv_header = 'meta-robots-nofollow';
1382
- }
1383
- if ($csv_header == '_yoast_wpseo_meta-robots-adv') {
1384
- $csv_header = 'meta-robots-adv';
1385
- }
1386
- if ($csv_header == '_yoast_wpseo_sitemap-include') {
1387
- $csv_header = 'sitemap-include';
1388
- }
1389
- if ($csv_header == '_yoast_wpseo_sitemap-prio') {
1390
- $csv_header = 'sitemap-prio';
1391
- }
1392
- if ($csv_header == '_yoast_wpseo_canonical') {
1393
- $csv_header = 'canonical';
1394
- }
1395
- if ($csv_header == '_yoast_wpseo_redirect') {
1396
- $csv_header = 'redirect';
1397
- }
1398
- if ($csv_header == '_yoast_wpseo_opengraph-description') {
1399
- $csv_header = 'opengraph-description';
1400
- }
1401
- if ($csv_header == '_yoast_wpseo_google-plus-description') {
1402
- $csv_header = 'google-plus-description';
1403
- }
1404
- $CSV_FILE_CONTENT .= $csv_header . ",";
1405
- }
1406
- $CSV_FILE_CONTENT = substr($CSV_FILE_CONTENT, 0, -1);
1407
- $CSV_FILE_CONTENT .= "\n";
1408
- if ($CSVDATA) {
1409
- foreach ($CSVDATA as $csv_content) {
1410
- $csv_content = substr($csv_content, 0, -1);
1411
- $CSV_FILE_CONTENT .= $csv_content . "\n";
1412
- }
1413
- }
1414
- }
1415
- #TODO: What is this?
1416
- echo '<pre>';
1417
- print_r($CSV_FILE_CONTENT);
1418
- die('it exiusrs');
1419
- header("Content-type: text/x-csv"); # DECLARING FILE TYPE
1420
- header("Content-Transfer-Encoding: binary");
1421
- header("Content-Disposition: attachment; filename=" . $csv_file_name); # EXPORT GENERATED CSV FILE
1422
- header("Pragma: no-cache");
1423
- header("Expires: 0");
1424
- print($CSV_FILE_CONTENT);
1425
- die;
1426
- return $data;
1427
- }
1428
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/old_export/templates/export.php DELETED
@@ -1,663 +0,0 @@
1
- <?php
2
- /******************************************************************************************
3
- * Copyright (C) Smackcoders 2014 - All Rights Reserved
4
- * Unauthorized copying of this file, via any medium is strictly prohibited
5
- * Proprietary and confidential
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;
14
- $ExportObj->executeIndex($_POST);
15
- class WPCSVProExportData {
16
- public function __construct() {
17
-
18
- }
19
-
20
- /**
21
- * The actions index method
22
- * @param array $request
23
- * @return array
24
- */
25
- public function executeIndex($request) {
26
- #print('<pre>'); print_r($request); print('</pre>'); die;
27
- if($request['export'] == 'category') {
28
- $this->WPImpExportCategories($request);
29
- }
30
- else if($request['export'] == 'tags') {
31
- $this->WPImpExportTags($request);
32
- }
33
- else if($request['export'] == 'customtaxonomy') {
34
- $this->WPImpExportTaxonomies($request);
35
- }
36
- else if($request['export'] == 'customerreviews') {
37
- $this->WPImpExportCustomerReviews($request);
38
- }
39
- else if($request['export'] == 'comments') {
40
- $this->WPImpExportComments($request);
41
- }
42
- else if($request['export'] == 'users') {
43
- $this->WPImpExportUsers($request);
44
- }
45
- else {
46
- $this->WPImpFreeExportData($request);#die;
47
- }
48
- }
49
-
50
- /**
51
- *
52
- */
53
- public function generateCSVHeaders($exporttype){
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') {
60
- $post_type = $_POST['export_post_type'];
61
- }
62
- $header_query1 = "SELECT wp.* FROM $wpdb->posts wp where post_type = '$post_type'";
63
- $header_query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') and meta_key NOT LIKE 'field_%' and meta_key NOT LIKE '_wp_types%'";
64
- $result_header_query1 = $wpdb->get_results($header_query1);
65
- $result_header_query2 = $wpdb->get_results($header_query2);
66
-
67
- foreach ($result_header_query1 as $rhq1_key) {
68
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
69
- if (!in_array($rhq1_headkey, $Header))
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)) {
80
- $Header[] = $rhq2_headkey->meta_key;
81
- }
82
- }
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
-
106
- /**
107
- *
108
- */
109
- public function get_all_record_ids($exporttype, $request) {
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')
116
- $post_type = $_POST['export_post_type'];
117
-
118
- $get_post_ids .= " where p.post_type = '$post_type'";
119
- if(isset($request['getdatawithspecificstatus'])) {
120
- if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'All') {
121
- $get_post_ids .= " and p.post_status in ('publish','draft','future','private','pending')";
122
- } else if(isset($request['postwithstatus']) && ($request['postwithstatus'] == 'Publish' || $request['postwithstatus'] == 'Sticky')) {
123
- $get_post_ids .= " and p.post_status in ('publish')";
124
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Draft') {
125
- $get_post_ids .= " and p.post_status in ('draft')";
126
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Scheduled') {
127
- $get_post_ids .= " and p.post_status in ('future')";
128
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Private') {
129
- $get_post_ids .= " and p.post_status in ('private')";
130
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Pending') {
131
- $get_post_ids .= " and p.post_status in ('pending')";
132
- } else if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Protected') {
133
- $get_post_ids .= " and p.post_status in ('publish') and post_password != ''";
134
- }
135
- } else {
136
- $get_post_ids .= " and p.post_status in ('publish','draft','future','private','pending')";
137
- }
138
- if(isset($request['getdataforspecificperiod'])) {
139
- $get_post_ids .= " and p.post_date >= '" . $request['postdatefrom'] . "' and p.post_date <= '" . $request['postdateto'] . "'";
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']}";
147
- }
148
- }
149
- #print_r($get_post_ids); die;
150
- $result = $wpdb->get_col($get_post_ids);
151
- if(isset($request['getdatawithspecificstatus'])) {
152
- if(isset($request['postwithstatus']) && $request['postwithstatus'] == 'Sticky') {
153
- $get_sticky_posts = get_option('sticky_posts');
154
- foreach($get_sticky_posts as $sticky_post_id) {
155
- if(in_array($sticky_post_id, $result))
156
- $sticky_posts[] = $sticky_post_id;
157
- }
158
- return $sticky_posts;
159
- }
160
- }
161
- #print_r($get_sticky_posts);
162
- #print_r($result);die;
163
- return $result;
164
- }
165
-
166
- /**
167
- *
168
- */
169
- public function getPostDatas($postID) {
170
- global $wpdb;
171
- $query1 = "SELECT wp.* FROM $wpdb->posts wp where ID=$postID";
172
- $result_query1 = $wpdb->get_results($query1);
173
- if (!empty($result_query1)) {
174
- foreach ($result_query1 as $posts) {
175
- foreach ($posts as $post_key => $post_value) {
176
- if ($post_key == 'post_status') {
177
- if (is_sticky($postID)) {
178
- $PostData[$post_key] = 'Sticky';
179
- $post_status = 'Sticky';
180
- } else {
181
- $PostData[$post_key] = $post_value;
182
- $post_status = $post_value;
183
- }
184
- } else {
185
- $PostData[$post_key] = $post_value;
186
- }
187
- if ($post_key == 'post_password') {
188
- if ($post_value) {
189
- $PostData['post_status'] = "{" . $post_value . "}";
190
- } else {
191
- $PostData['post_status'] = $post_status;
192
- }
193
- }
194
- if ($post_key == 'comment_status') {
195
- if ($post_value == 'closed') {
196
- $PostData['comment_status'] = 0;
197
- }
198
- if ($post_value == 'open') {
199
- $PostData['comment_status'] = 1;
200
- }
201
- }
202
- }
203
- }
204
- }
205
- return $PostData;
206
- }
207
-
208
- /**
209
- *
210
- */
211
- public function getPostMetaDatas($postID) {
212
- global $wpdb;
213
- $query2 = "SELECT post_id, meta_key, meta_value FROM $wpdb->posts wp JOIN $wpdb->postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last') AND ID=$postID";
214
- #print($query2); print('<br>');
215
- $result = $wpdb->get_results($query2);
216
- return $result;
217
- }
218
-
219
- /**
220
- *
221
- */
222
- public function getAIOSEOfields() {
223
- $aioseofields = array('_aioseop_keywords' => 'seo_keywords',
224
- '_aioseop_description' => 'seo_description',
225
- '_aioseop_title' => 'seo_title',
226
- '_aioseop_noindex' => 'seo_noindex',
227
- '_aioseop_nofollow' => 'seo_nofollow',
228
- '_aioseop_disable' => 'seo_disable',
229
- '_aioseop_disable_analytics' => 'seo_disable_analytics',
230
- '_aioseop_noodp' => 'seo_noodp',
231
- '_aioseop_noydir' => 'seo_noydir',);
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
- */
259
- public function EshopHeaders() {
260
- $eshopHeaders = array('post_title' => 'post_title', 'post_content' => 'post_content', 'post_excerpt' => 'post_excerpt', 'post_date' => 'post_date', 'post_name' => 'post_name', 'post_status' => 'post_status', 'post_author' => 'post_author', 'post_parent' => 0, 'comment_status' => 'open', 'ping_status' => 'open', 'SKU' => 'sku', 'products_option' => 'products_option', 'sale_price' => 'sale_price', 'regular_price' => 'regular_price', 'description' => 'description', 'shiprate' => 'shiprate', 'optset' => null, 'featured_product' => 'featured', 'product_in_sale' => '_eshop_sale', 'stock_available' => '_eshop_stock', 'cart_option' => 'cart_radio', 'category' => 'post_category', 'tags' => 'post_tag', 'featured_image' => null,);
261
- return $eshopHeaders;
262
- }
263
-
264
- /**
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 = ',';
272
- $exporttype = $_POST['export'];
273
- $wpcsvsettings=get_option('wpcsvprosettings');
274
- if(isset($wpcsvsettings['export_delimiter'])){
275
- $export_delimiter = $wpcsvsettings['export_delimiter'];
276
- }
277
- if($_POST['export_filename'])
278
- $csv_file_name =$_POST['export_filename'].'.csv';
279
- else
280
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
281
- $wptypesfields = get_option('wpcf-fields');
282
- #print('<pre>'); print_r($wptypesfields); die;
283
- #print('<pre>'); print_r($_POST); print('</pre>');
284
- //if($exporttype=='post' || $exporttype=='page' || $exporttype=='custompost') {
285
- if($exporttype == 'custompost') {
286
- $exporttype = $_POST['export_post_type'];
287
- }
288
- $Header = $this->generateCSVHeaders($exporttype);
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);
296
- #print('<pre>'); print_r($PostData); #die;
297
- $result_query2 = $this->getPostMetaDatas($postID);
298
- #print('<pre>'); print_r($result_query2); print('</pre>'); #die;
299
-
300
- $possible_values = array('s:', 'a:', ':{');
301
- if (!empty($result_query2)) {
302
- foreach ($result_query2 as $postmeta) {
303
- $typesFserialized = 0;
304
- $isFound = explode('wpcf-',$postmeta->meta_key);
305
- if(count($isFound) == 2){
306
- foreach($wptypesfields as $typesKey => $typesVal){
307
- if($postmeta->meta_key == 'wpcf-'.$typesKey){
308
- foreach($possible_values as $posval){
309
- if(strpos($postmeta->meta_value,$posval)){
310
- $typesFserialized = 1;
311
- } else {
312
- $typesFserialized = 0;
313
- }
314
- }
315
- if($typesFserialized == 1){
316
- $getMetaData = get_post_meta($postID, $postmeta->meta_key);
317
- if(!is_array($getMetaData[0])){
318
- $get_all_values = unserialize($getMetaData[0]);
319
- $get_values = $get_all_values[0];
320
- } else {
321
- $get_values = $getMetaData[0];
322
- }
323
- $typesFVal = null;
324
- if($typesVal['type'] == 'checkboxes'){
325
- foreach($get_values as $authorKey => $authorVal) {
326
- foreach($typesVal['data']['options'] as $doKey => $doVal){
327
- if($doKey == $authorKey)
328
- $typesFVal .= $doVal['title'].',';
329
- }
330
- }
331
- $typesFVal = substr($typesFVal, 0, -1);
332
- } elseif($typesVal['type'] == 'skype') {
333
- $typesFVal = $get_values['skypename'];
334
- }
335
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $typesFVal;
336
- } else {
337
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
338
- }
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
- }
347
- else if ($postmeta->meta_key == 'sale') {
348
- $is_prod_sale = strtolower($postmeta->meta_value);
349
- $PostMetaData[$postmeta->post_id]['product_in_sale'] = $is_prod_sale;
350
- }
351
- else if ($postmeta->meta_key == '_eshop_stock') {
352
- if($postmeta->meta_value == 1) {
353
- $stock_available = 'yes';
354
- } else {
355
- $stock_available = 'no';
356
- }
357
- $PostMetaData[$postmeta->post_id]['stock_available'] = $stock_available;
358
- }
359
- else if ($postmeta->meta_key == 'cart_radio') {
360
- $PostMetaData[$postmeta->post_id]['cart_option'] = $postmeta->meta_value;
361
- }
362
- else if ($postmeta->meta_key == 'shiprate') {
363
- $PostMetaData[$postmeta->post_id]['shiprate'] = $postmeta->meta_value;
364
- }
365
- else if ($postmeta->meta_key == '_eshop_product') {
366
- $product_attr_details = unserialize($postmeta->meta_value);
367
- $prod_option = $sale_price = $reg_price = null;
368
- #print('<pre>');print_r($product_attr_details); #die;
369
- foreach($product_attr_details as $prod_att_det_Key => $prod_att_det_Val) {
370
- if($prod_att_det_Key == 'sku') {
371
- $PostMetaData[$postmeta->post_id]['sku'] = $prod_att_det_Val;
372
- }
373
- else if($prod_att_det_Key == 'products') {
374
- foreach($prod_att_det_Val as $all_prod_options) {
375
- $prod_option .= $all_prod_options['option'] . ',';
376
- $sale_price .= $all_prod_options['saleprice'] . ',';
377
- $reg_price .= $all_prod_options['price'] . ',';
378
- }
379
- $prod_option = substr($prod_option, 0, -1);
380
- $sale_price = substr($sale_price, 0, -1);
381
- $reg_price = substr($reg_price, 0, -1);
382
- $PostMetaData[$postmeta->post_id]['products_option'] = $prod_option;
383
- $PostMetaData[$postmeta->post_id]['sale_price'] = $sale_price;
384
- $PostMetaData[$postmeta->post_id]['regular_price'] = $reg_price;
385
- }
386
- }
387
- #$PostMetaData[$postmeta->post_id]['cart_option'] = $postmeta->meta_value;
388
- }
389
- // Eshop product meta datas ends here
390
- else if ($postmeta->meta_key == '_thumbnail_id') {
391
- $attachment_file = '';
392
- $get_attachement = "select guid from $wpdb->posts where ID = $postmeta->meta_value AND post_type = 'attachment'";
393
- $attachment = $wpdb->get_results($get_attachement);
394
- $attachment_file = $attachment[0]->guid;
395
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
396
- $postmeta->meta_key = 'featured_image';
397
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $attachment_file;
398
- }
399
- else if(is_array($checkbox_option_fields) && in_array($postmeta->meta_key,$checkbox_option_fields)){
400
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
401
- $eshop_products = unserialize($eshop_products); //print_r($eshop_products);
402
- foreach ($eshop_products as $key) {
403
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
404
- }
405
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = substr($PostMetaData[$postmeta->post_id][$postmeta->meta_key], 0, -1);
406
- }
407
- else {
408
- $PostMetaData[$postmeta->post_id][$postmeta->meta_key] = $postmeta->meta_value;
409
- }
410
- }
411
- }
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();
418
- // Merge all arrays
419
- #echo '<pre>'; print_r($TermsData); die;
420
- // echo '<pre>'; print_r($PostData); die('sds');
421
- foreach ($PostData as $pd_key => $pd_val) {
422
- if (array_key_exists($pd_key, $PostMetaData)) {
423
- $ExportData[$pd_key] = array_merge($PostData[$pd_key], $PostMetaData[$pd_key]);
424
- // echo '<pre>'; print_r($ExportData); die('exist');
425
- } else {
426
- $ExportData[$pd_key] = $PostData[$pd_key];
427
- }
428
- if (array_key_exists($pd_key, $TermsData)) {
429
- if (empty($ExportData[$pd_key]))
430
- $ExportData[$pd_key] = array();
431
- $ExportData[$pd_key] = array_merge($ExportData[$pd_key], $TermsData[$pd_key]);
432
- }
433
- }
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) {
440
- foreach($this->EshopHeaders() as $eshophkey => $eshophval) {
441
- if(array_key_exists($eshophval, $ExportData[$edkey])) {
442
- $ExportData[$edkey][$eshophkey] = $edval[$eshophval];
443
- // unset($ExportData[$edkey][$wpcomhval]);
444
- }
445
- }
446
- }
447
- }
448
- }
449
- #print('<pre>'); print_r($Header); print('</pre>'); #die;
450
- # print('<pre>'); print_r($ExportData); die;
451
- foreach ($Header as $header_key) {
452
- if (is_array($ExportData)) {
453
- foreach ($ExportData as $ED_key => $ED_val) {
454
- if (in_array($header_key, $this->getAIOSEOfields())) { #die($header_key);
455
- foreach($this->getAIOSEOfields() as $aioseokey => $aioseoval) {
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 {
462
- $CSVContent[$ED_key][$header_key] = null;
463
- }
464
- }
465
- }
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
- /**
474
- *
475
- */
476
- public function WPImpExportComments($request) {
477
- global $wpdb;
478
- $export_delimiter = ',';
479
- $exporttype = $request['export'];
480
- $wpcsvsettings=get_option('wpcsvprosettings');
481
- if(isset($wpcsvsettings['export_delimiter'])){
482
- $export_delimiter = $wpcsvsettings['export_delimiter'];
483
- }
484
- if($_POST['export_filename'])
485
- $csv_file_name =$_POST['export_filename'].'.csv';
486
- else
487
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
488
-
489
- $commentQuery = "SELECT * FROM $wpdb->comments " . $orderBy;
490
- $comments = $wpdb->get_results( $commentQuery);
491
- $mappedHeader = false;
492
- $i = 0;
493
- foreach($comments as $comment){
494
- foreach($comment as $key => $value){
495
- if(!$mappedHeader){
496
- $Header[] = $key; // ."$export_delimiter";
497
- }
498
- $ExportData[$i][$key] = $value; //'"'.$value.'"'."$export_delimiter";
499
- }
500
- $mappedHeader = true;
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
- /**
509
- *
510
- */
511
- public function WPImpExportUsers($request) {
512
- global $wpdb;
513
- $export_delimiter = ',';
514
- $exporttype = $request['export'];
515
- $wpcsvsettings=get_option('wpcsvprosettings');
516
- if(isset($wpcsvsettings['export_delimiter'])){
517
- $export_delimiter = $wpcsvsettings['export_delimiter'];
518
- }
519
- if($_POST['export_filename'])
520
- $csv_file_name =$_POST['export_filename'].'.csv';
521
- else
522
- $csv_file_name='exportas_'.date("Y").'-'.date("m").'-'.date("d").'.csv';
523
-
524
- $uId = '';
525
- $header_query1 = "SELECT *FROM $wpdb->users";
526
- $header_query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where meta_key NOT IN ('_edit_lock','_edit_last')";
527
- $result_header_query1 = $wpdb->get_results($header_query1);
528
- $result_header_query2 = $wpdb->get_results($header_query2);
529
- /* print('<pre>'); print_r($result_header_query1);
530
- print_r($result_header_query2);die; */
531
- foreach ($result_header_query1 as $rhq1_key) {
532
- foreach ($rhq1_key as $rhq1_headkey => $rhq1_headval) {
533
- if (!in_array($rhq1_headkey, $Header))
534
- $Header[] = $rhq1_headkey;
535
- }
536
- }
537
- foreach ($result_header_query2 as $rhq2_headkey) {
538
- if (!in_array($rhq2_headkey->meta_key, $Header)) {
539
- if($rhq2_headkey->meta_key == 'mp_shipping_info' )
540
- {
541
- $mp_ship_header= unserialize($rhq2_headkey->meta_value);
542
- foreach($mp_ship_header as $mp_ship_key => $mp_value) { $Header[] = "msi: ".$mp_ship_key; }
543
- }
544
- if($rhq2_headkey->meta_key == 'mp_billing_info' )
545
- {
546
- $mp_ship_header= unserialize($rhq2_headkey->meta_value);
547
- foreach($mp_ship_header as $mp_ship_key => $mp_value) { $Header[] = "mbi: ".$mp_ship_key; }
548
- }
549
-
550
- if ($rhq2_headkey->meta_key != '_eshop_product' && $rhq2_headkey->meta_key != '_wp_attached_file' && $rhq2_headkey->meta_key != 'mp_shipping_info' && $rhq2_headkey->meta_key != 'mp_billing_info' )
551
- $Header[] = $rhq2_headkey->meta_key;
552
- }
553
- }
554
- #echo '<pre>'; print_r($Header); die('dsd');
555
- $get_user_ids = "select DISTINCT ID from $wpdb->users u join $wpdb->usermeta um on um.user_id = u.ID";
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);";
563
- $result_query1 = $wpdb->get_results($query1);
564
- if (!empty($result_query1)) {
565
- foreach ($result_query1 as $users) {
566
- foreach ($users as $user_key => $user_value) {
567
- $UserData[$userID][$user_key] = $user_value;
568
- }
569
- }
570
- }
571
- // echo '<pre>'; print_r($UserData); die ('dfdf');
572
- $query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where ID=$userID";
573
- $possible_values = array('s:', 'a:', ':{');
574
- $result_query2 = $wpdb->get_results($query2);
575
- if (!empty($result_query2)) {
576
- foreach ($result_query2 as $usermeta) {
577
- // echo '<pre>'; print_r($usermeta);
578
-
579
- foreach($possible_values as $posval){
580
- if(strpos($usermeta->meta_value,$posval)){
581
- if($usermeta->meta_key == 'mp_shipping_info' || $usermeta->meta_key == 'mp_billing_info')
582
- $typesFserialized = 1;
583
- } else {
584
- $typesFserialized = 0;
585
- }
586
- }
587
- if($typesFserialized == 1)
588
- {
589
- if($usermeta->meta_key == 'mp_shipping_info')
590
- {
591
- $UserID = $usermeta->user_id;
592
- $mp_ship_data = unserialize($usermeta->meta_value);
593
- foreach($mp_ship_data as $mp_ship_key => $mp_ship_value)
594
- {
595
- $mp_ship_tempkey = "msi: ".$mp_ship_key;
596
- $UserData[$UserID][$mp_ship_tempkey]= $mp_ship_value;
597
- }
598
- }
599
-
600
- if($usermeta->meta_key == 'mp_billing_info')
601
- {
602
- $UserID = $usermeta->user_id;
603
- $mp_ship_data = unserialize($usermeta->meta_value);
604
- foreach($mp_ship_data as $mp_ship_key => $mp_ship_value)
605
- {
606
- $mp_ship_tempkey = "mbi: ".$mp_ship_key;
607
- $UserData[$UserID][$mp_ship_tempkey]= $mp_ship_value;
608
- }
609
- }
610
-
611
- if($usermeta->meta_key != 'wp_capabilities' && $usermeta->meta_key !='mp_shipping_info' && $usermeta->meta_key != 'mp_billing_info') {
612
- $UserData[$userID][$usermeta->meta_key] = $usermeta->meta_value;
613
- } else {
614
- if($usermeta->meta_key == 'wp_capabilities') {
615
- $getUserRole = unserialize($usermeta->meta_value);
616
- // echo '<pre>'; print_r($getUserRole); die('ddf');
617
- foreach($getUserRole as $urKey => $urVal) {
618
- $getUserRole = get_role($urKey);
619
- }
620
- $rolelevel = 0;
621
- $isfound = array();
622
- foreach($getUserRole->capabilities as $roleKey => $roleVal){
623
- $isfound = explode('level_', $roleKey);
624
- if(is_array($isfound) && count($isfound) == 2){
625
- $rolelevel = $rolelevel + 1;
626
- }
627
- } $rolelevel = $rolelevel - 1;
628
- #$UserData[$userID][$usermeta->meta_key] = $rolelevel;
629
- }
630
- }
631
- } else {
632
- foreach($possible_values as $posval){
633
- if(strpos($usermeta->meta_value,$posval)){
634
- $UserData[$userID][$usermeta->meta_key] = null;
635
- } else {
636
- $ifSerialized = 0;
637
- $UserData[$userID][$usermeta->meta_key] = $usermeta->meta_value;
638
- }
639
- }
640
-
641
- }
642
- } #echo '<pre>'; print_r($UserData); die('dd');
643
- }
644
- }
645
- }
646
- $UserHeader = array();
647
- foreach ($Header as $header_key) {
648
- foreach ($UserData as $UD_key => $UD_val) {
649
- if(array_key_exists($header_key, $UD_val)) {
650
- $CSVContent[$UD_key][$header_key] = $UD_val[$header_key];
651
- if(!in_array($header_key, $UserHeader))
652
- $UserHeader[] = $header_key;
653
- }
654
- else {
655
- $CSVContent[$UD_key][$header_key] = null;
656
- }
657
- }
658
- }
659
-
660
- $csv = new ImporterLib();
661
- $csv->wmyuyn_3 ($csv_file_name, $CSVContent, $UserHeader, $export_delimiter);
662
- }
663
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/old_export/templates/index.php DELETED
@@ -1,225 +0,0 @@
1
- <?php
2
- /******************************************************************************************
3
- * Copyright (C) Smackcoders 2014 - All Rights Reserved
4
- * Unauthorized copying of this file, via any medium is strictly prohibited
5
- * Proprietary and confidential
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'>
40
- <option>All</option>
41
- <option>Publish</option>
42
- <option>Sticky</option>
43
- <option>Private</option>
44
- <option>Protected</option>
45
- <option>Draft</option>
46
- <option>Pending</option>
47
- </select>
48
- </div>
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' ); ?>
56
- <select name='postauthor' id='postauthor' >
57
- <option value='0'>All</option>
58
- <?php foreach( $blogusers as $user ) { ?>
59
- <option value='<?php echo esc_html( $user->ID ); ?>'> <?php echo esc_html( $user->display_name ); ?> </option>
60
- <?php } ?>
61
- </select>
62
- </div>
63
- </td>
64
- </tr>
65
- </table>
66
- <script type = 'text/javascript'>
67
- jQuery(document).ready(function() {
68
- jQuery('#postdatefrom').datepicker({
69
- dateFormat : 'yy-mm-dd'
70
- });
71
- jQuery('#postdateto').datepicker({
72
- dateFormat : 'yy-mm-dd'
73
- });
74
- });
75
- </script>
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) {
95
- if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item') && ($value != 'post') && ($value != 'page') && ($value != 'wp-types-group') && ($value != 'wp-types-user-group') && ($value != 'product') && ($value != 'product_variation') && ($value != 'shop_order') && ($value != 'shop_coupon') && ($value != 'acf')) {
96
- ?>
97
- <option id="<?php echo($value); ?>"> <?php echo($value); ?> </option>
98
- <?php
99
- }
100
- }
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) {
121
- if (($value != 'category') && ($value != 'post_tag') && ($value != 'nav_menu') && ($value != 'link_category') && ($value != 'post_format') && ($value != 'product_tag') && ($value != 'wpsc_product_category') && ($value != 'wpsc-variation')) {
122
- ?>
123
- <option id="<?php echo($value); ?>"> <?php echo($value); ?> </option>
124
- <?php
125
- }
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>
136
- </div>
137
- <?php /*
138
- <div class='form-group exportedas'>
139
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="post"> Post </label>
140
- </div>
141
- </div>
142
- <div class='form-group exportedas'>
143
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="page"> Page </label>
144
- </div>
145
- </div>
146
- <div class='form-group exportedas'>
147
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="custompost"> Custom Post </label>
148
- <select name="export_post_type">
149
- <option>--Select--</option>
150
- <?php
151
- foreach (get_post_types() as $key => $value) {
152
- if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item') && ($value != 'post') && ($value != 'page') && ($value != 'wp-types-group') && ($value != 'wp-types-user-group') && ($value != 'product') && ($value != 'product_variation') && ($value != 'shop_order') && ($value != 'shop_coupon') && ($value != 'acf')) {
153
- ?>
154
- <option id="<?php echo($value); ?>"> <?php echo($value); ?> </option>
155
- <?php
156
- }
157
- }
158
- ?>
159
- </select></div>
160
- </div>
161
- <div class='form-group exportedas'>
162
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="users"> Users </label>
163
- </div>
164
- </div>
165
- <div class='form-group exportedas'><div class='col-sm-3 export_action'><label><input type='radio' name='export' value='comments' id='comments' onclick="export_check(this.value)">Comments </label> </div> </div>
166
- <div class='form-group exportedas'>
167
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="category"> Category
168
- </label></div>
169
- </div>
170
- <div class='form-group exportedas'>
171
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="tags"> Tags </label>
172
- </div>
173
- </div>
174
- <div class='form-group exportedas'>
175
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="customtaxonomy"> Custom
176
- Taxonomy </label>
177
- <select name="export_taxo_type">
178
- <option>--Select--</option>
179
- <?php
180
- foreach (get_taxonomies() as $key => $value) {
181
- if (($value != 'category') && ($value != 'post_tag') && ($value != 'nav_menu') && ($value != 'link_category') && ($value != 'post_format') && ($value != 'product_tag') && ($value != 'wpsc_product_category') && ($value != 'wpsc-variation')) {
182
- ?>
183
- <option id="<?php echo($value); ?>"> <?php echo($value); ?> </option>
184
- <?php
185
- }
186
- }
187
- ?>
188
- </select></div>
189
- </div>
190
- <div class='form-group exportedas'>
191
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="eshop"> Eshop </label>
192
- </div>
193
- </div>
194
- <div class='form-group exportedas'>
195
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="wpcommerce">
196
- Wp-Commerce </label></div>
197
- </div>
198
- <div class='form-group exportedas'>
199
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="woocommerce">
200
- Woo-Commerce </label></div>
201
- </div>
202
- <div class='form-group exportedas'>
203
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="marketpress">
204
- Marketpress </label></div>
205
- </div>
206
- <div class='form-group exportedas'>
207
- <div class='col-sm-3 export_action'><label> <input type="radio" name="export" value="customerreviews">
208
- Customer Reviews </label></div>
209
- </div>
210
- */ ?>
211
- <div class='form-group exportedas'>
212
- <label class='col-sm-2 control-label'><b> File Name: </b></label>
213
-
214
- <div class='col-sm-6'>
215
- <input class='form-control' type='text' name='export_filename' id='export_filename' value=''
216
- placeholder="export_as_<?php echo(date("Y-m-d")); ?>" size="18">
217
- </div>
218
- <div class='col-sm-3'><input type="submit" name="exportbutton" value="Export" class='btn btn-primary'></div>
219
-
220
- </form>
221
- </div>
222
- </div>
223
- </div>
224
- </div>
225
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/page/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class PageActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class PageActions extends SkinnyActions {
41
 
modules/page/templates/index.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  $impCE = new WPImporter_includes_helper();
39
  $nonce_Key = $impCE->create_nonce_key();
@@ -111,48 +113,85 @@ $nonce_Key = $impCE->create_nonce_key();
111
  jQuery('#progress .progress-bar').css('visibility','hidden');
112
  }
113
  else{
114
- jQuery(function () {
115
- 'use strict';
116
- var uploadPath = document.getElementById('uploaddir').value;
117
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
118
- jQuery('#fileupload').fileupload({
119
- url: url,
120
- dataType: 'json',
121
- done: function (e, data) {
122
- jQuery.each(data.result.files, function (index, file) {
123
- document.getElementById('uploadFileName').value=file.name;
124
- var filewithmodule = file.uploadedname.split(".csv");
125
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
126
- document.getElementById('upload_csv_realname').value = file.uploadedname;
127
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
128
- var get_version2 = get_version1[1].split(".csv");
129
- var get_version3 = get_version2[0].split("-");
130
- document.getElementById('current_file_version').value = get_version3[1];
131
- jQuery('#uploadedfilename').val(file.uploadedname);
132
- jQuery( "#filenamedisplay" ).empty();
133
- if(file.size>1024 && file.size<(1024*1024))
134
- {
135
- var fileSize =(file.size/1024).toFixed(2)+' kb';
136
- }
137
- else if(file.size>(1024*1024))
138
- {
139
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
140
- }
141
- else
142
- {
143
- var fileSize= (file.size)+' byte';
144
- }
145
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
146
- jQuery('#importfile').attr('disabled', false);
147
- });
148
- },progressall: function (e, data) {
149
- var progress = parseInt(data.loaded / data.total * 100, 10);
150
- jQuery('#progress .progress-bar').css('width', progress + '%' );
151
- }
152
- }).prop('disabled', !jQuery.support.fileInput)
153
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
154
- });
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  </script>
157
  <input type = 'hidden' name = 'importid' id = 'importid' >
158
 
@@ -194,7 +233,7 @@ $nonce_Key = $impCE->create_nonce_key();
194
  $basename_zipfile = $get_basename_zipfile[0];
195
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
196
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
197
- if(class_exists(ZipArchive)){
198
  $zip = new ZipArchive;
199
  if(!empty($uploaded_compressedFile)){
200
  if ($zip->open($uploaded_compressedFile) === TRUE) {
@@ -372,11 +411,11 @@ $nonce_Key = $impCE->create_nonce_key();
372
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
373
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
374
  <a href="#" class="tooltip">
375
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
376
  <span class="tooltipPostStatus">
377
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
378
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
379
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
380
  </span>
381
  </a>
382
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  $impCE = new WPImporter_includes_helper();
41
  $nonce_Key = $impCE->create_nonce_key();
113
  jQuery('#progress .progress-bar').css('visibility','hidden');
114
  }
115
  else{
116
+ jQuery(function () {
117
+ 'use strict';
118
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
119
+ var filesdata;
120
+ var uploadPath = document.getElementById('uploaddir').value;
121
+ function prepareUpload(event){
122
+ filesdata = event.target.files;
123
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
124
+ var frmdata = new FormData();
125
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
126
+ frmdata.append('files', uploadfile_data);
127
+ frmdata.append('action','uploadfilehandle');
128
+ frmdata.append('curr_action', curraction);
129
+ frmdata.append('uploadPath', uploadPath);
130
+ jQuery.ajax({
131
+ url : ajaxurl,
132
+ type : 'post',
133
+ data : frmdata,
134
+ cache: false,
135
+ contentType : false,
136
+ processData: false,
137
+ success : function(data) {
138
+ var fileobj =JSON.parse(data);
139
+ jQuery.each(fileobj,function(objkey,objval){
140
+ jQuery.each(objval,function(o_key,file){
141
+ document.getElementById('uploadFileName').value=file.name;
142
+ var filewithmodule = file.uploadedname.split(".");
143
+ var check_file = filewithmodule[filewithmodule.length - 1];
144
+ if(check_file != "csv" && check_file != "txt") {
145
+ alert('Un Supported File Format');
146
+ return false;
147
+ }
148
+ if(check_file == "csv"){
149
+ var filenamecsv = file.uploadedname.split(".csv");
150
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
151
+ }
152
+ if(check_file == "txt"){
153
+ var filenametxt = file.uploadedname.split(".txt");
154
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
155
+ }
156
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
157
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
158
+ var get_version2 = get_version1[1].split(".csv");
159
+ var get_version3 = get_version2[0].split("-");
160
+ document.getElementById('current_file_version').value = get_version3[1];
161
+ jQuery('#uploadedfilename').val(file.uploadedname);
162
+ jQuery( "#filenamedisplay" ).empty();
163
+ if(file.size>1024 && file.size<(1024*1024))
164
+ {
165
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
166
+ }
167
+ else if(file.size>(1024*1024))
168
+ {
169
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
170
+ }
171
+ else
172
+ {
173
+ var fileSize= (file.size)+' byte';
174
+ }
175
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
176
+ jQuery('#importfile').attr('disabled', false);
177
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
178
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
179
+ });
180
+ });
181
+
182
+ }
183
+ });
184
+ }
185
+ jQuery('#fileupload').on('change', prepareUpload);
186
+ jQuery('#fileupload').fileupload({
187
+ url : url,
188
+ progressall: function (e, data) {
189
+ var progress = parseInt(data.loaded / data.total * 100, 10);
190
+ jQuery('#progress .progress-bar').css('width', progress + '%' );
191
+ }
192
+ });
193
+ });
194
+ }
195
  </script>
196
  <input type = 'hidden' name = 'importid' id = 'importid' >
197
 
233
  $basename_zipfile = $get_basename_zipfile[0];
234
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
235
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
236
+ if(class_exists('ZipArchive')){
237
  $zip = new ZipArchive;
238
  if(!empty($uploaded_compressedFile)){
239
  if ($zip->open($uploaded_compressedFile) === TRUE) {
411
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
412
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
413
  <a href="#" class="tooltip">
414
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
415
  <span class="tooltipPostStatus">
416
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
417
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
418
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
419
  </span>
420
  </a>
421
  </span>
modules/post/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class PostActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class PostActions extends SkinnyActions {
41
 
modules/post/templates/index.php CHANGED
@@ -34,6 +34,9 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
 
37
  $impCE = new WPImporter_includes_helper();
38
  $nonce_Key = $impCE->create_nonce_key();
39
  ?>
@@ -113,48 +116,85 @@ $nonce_Key = $impCE->create_nonce_key();
113
  jQuery('#progress .progress-bar').css('visibility','hidden');
114
  }
115
  else{
116
- jQuery(function () {
117
  'use strict';
 
 
118
  var uploadPath = document.getElementById('uploaddir').value;
119
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
120
- jQuery('#fileupload').fileupload({
121
- url: url,
122
- dataType: 'json',
123
- done: function (e, data) {
124
- jQuery.each(data.result.files, function (index, file) {
125
- document.getElementById('uploadFileName').value=file.name;
126
- var filewithmodule = file.uploadedname.split(".csv");
127
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
128
- document.getElementById('upload_csv_realname').value = file.uploadedname;
129
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
130
- var get_version2 = get_version1[1].split(".csv");
131
- var get_version3 = get_version2[0].split("-");
132
- document.getElementById('current_file_version').value = get_version3[1];
133
- jQuery('#uploadedfilename').val(file.uploadedname);
134
- jQuery( "#filenamedisplay" ).empty();
135
- if(file.size>1024 && file.size<(1024*1024))
136
- {
137
- var fileSize =(file.size/1024).toFixed(2)+' kb';
138
- }
139
- else if(file.size>(1024*1024))
140
- {
141
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
142
- }
143
- else
144
- {
145
- var fileSize= (file.size)+' byte';
146
- }
147
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
148
- jQuery('#importfile').attr('disabled', false);
149
- });
150
- },progressall: function (e, data) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  var progress = parseInt(data.loaded / data.total * 100, 10);
152
  jQuery('#progress .progress-bar').css('width', progress + '%' );
153
  }
154
- }).prop('disabled', !jQuery.support.fileInput)
155
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
156
- });
157
- }
158
  </script>
159
  <input type = 'hidden' name = 'importid' id = 'importid' >
160
  <!-- <div class='section-one' align='center'>
@@ -195,7 +235,7 @@ $nonce_Key = $impCE->create_nonce_key();
195
  $basename_zipfile = $get_basename_zipfile[0];
196
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
197
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
198
- if(class_exists(ZipArchive)){
199
  $zip = new ZipArchive;
200
  if(!empty($uploaded_compressedFile)){
201
  if ($zip->open($uploaded_compressedFile) === TRUE) {
@@ -250,6 +290,7 @@ $nonce_Key = $impCE->create_nonce_key();
250
  if(isset($_POST['uploadfilename']) && $_POST['uploadfilename'] != ''){
251
  $file_name = $_POST['uploadfilename'];
252
  $filename = $impCE->convert_string2hash_key($file_name);
 
253
  }
254
  if (isset($_POST['mydelimeter'])) {
255
  $delimeter= $_POST['mydelimeter'];
@@ -378,11 +419,11 @@ $nonce_Key = $impCE->create_nonce_key();
378
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
379
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
380
  <a href="#" class="tooltip">
381
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
382
  <span class="tooltipPostStatus">
383
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
384
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
385
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
386
  </span>
387
  </a>
388
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
+
40
  $impCE = new WPImporter_includes_helper();
41
  $nonce_Key = $impCE->create_nonce_key();
42
  ?>
116
  jQuery('#progress .progress-bar').css('visibility','hidden');
117
  }
118
  else{
119
+ jQuery(function () {
120
  'use strict';
121
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
122
+ var filesdata;
123
  var uploadPath = document.getElementById('uploaddir').value;
124
+ function prepareUpload(event){
125
+ filesdata = event.target.files;
126
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
127
+ var frmdata = new FormData();
128
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
129
+ frmdata.append('files', uploadfile_data);
130
+ frmdata.append('action','uploadfilehandle');
131
+ frmdata.append('curr_action', curraction);
132
+ frmdata.append('uploadPath', uploadPath);
133
+ jQuery.ajax({
134
+ url : ajaxurl,
135
+ type : 'post',
136
+ data : frmdata,
137
+ cache: false,
138
+ contentType : false,
139
+ processData: false,
140
+ success : function(data) {
141
+ var fileobj =JSON.parse(data);
142
+ jQuery.each(fileobj,function(objkey,objval){
143
+ jQuery.each(objval,function(o_key,file){
144
+ document.getElementById('uploadFileName').value=file.name;
145
+ var filewithmodule = file.uploadedname.split(".");
146
+ var check_file = filewithmodule[filewithmodule.length - 1];
147
+ if(check_file != "csv" && check_file != "txt") {
148
+ alert('Un Supported File Format');
149
+ return false;
150
+ }
151
+ if(check_file == "csv"){
152
+ var filenamecsv = file.uploadedname.split(".csv");
153
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
154
+ }
155
+ if(check_file == "txt"){
156
+ var filenametxt = file.uploadedname.split(".txt");
157
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
158
+ }
159
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
160
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
161
+ var get_version2 = get_version1[1].split(".csv");
162
+ var get_version3 = get_version2[0].split("-");
163
+ document.getElementById('current_file_version').value = get_version3[1];
164
+ jQuery('#uploadedfilename').val(file.uploadedname);
165
+ jQuery( "#filenamedisplay" ).empty();
166
+ if(file.size>1024 && file.size<(1024*1024))
167
+ {
168
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
169
+ }
170
+ else if(file.size>(1024*1024))
171
+ {
172
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
173
+ }
174
+ else
175
+ {
176
+ var fileSize= (file.size)+' byte';
177
+ }
178
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
179
+ jQuery('#importfile').attr('disabled', false);
180
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
181
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
182
+ });
183
+ });
184
+
185
+ }
186
+ });
187
+ }
188
+ jQuery('#fileupload').on('change', prepareUpload);
189
+ jQuery('#fileupload').fileupload({
190
+ url : url,
191
+ progressall: function (e, data) {
192
  var progress = parseInt(data.loaded / data.total * 100, 10);
193
  jQuery('#progress .progress-bar').css('width', progress + '%' );
194
  }
195
+ });
196
+ });
197
+ }
 
198
  </script>
199
  <input type = 'hidden' name = 'importid' id = 'importid' >
200
  <!-- <div class='section-one' align='center'>
235
  $basename_zipfile = $get_basename_zipfile[0];
236
  $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $filehashkey;
237
  $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $filehashkey;
238
+ if(class_exists('ZipArchive')){
239
  $zip = new ZipArchive;
240
  if(!empty($uploaded_compressedFile)){
241
  if ($zip->open($uploaded_compressedFile) === TRUE) {
290
  if(isset($_POST['uploadfilename']) && $_POST['uploadfilename'] != ''){
291
  $file_name = $_POST['uploadfilename'];
292
  $filename = $impCE->convert_string2hash_key($file_name);
293
+
294
  }
295
  if (isset($_POST['mydelimeter'])) {
296
  $delimeter= $_POST['mydelimeter'];
419
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;float:left;width:160px;" value="<?php echo $value ?>"/>
420
  <span style="display: none;float:left" id="customspan<?php echo $count ?>">
421
  <a href="#" class="tooltip">
422
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
423
  <span class="tooltipPostStatus">
424
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
425
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
426
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
427
  </span>
428
  </a>
429
  </span>
modules/schedulemapping/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class SchedulemappingActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class SchedulemappingActions extends SkinnyActions {
41
 
modules/schedulemapping/templates/index.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
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>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  ?>
40
 
41
  <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
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class SettingsActions extends SkinnyActions
39
  {
@@ -70,7 +72,7 @@ class SettingsActions extends SkinnyActions
70
  //Settings action
71
  //SEO option
72
  $tableseo = get_option('wpcsvfreesettings');
73
- $seooption = $tableseo['rseooption'];
74
  if ( $seooption == 'aioseo' ) {
75
  $data['aioseo'] = 'checked enablesetting';
76
  $data['yoastseo'] = 'disablesetting';
@@ -306,7 +308,7 @@ class SettingsActions extends SkinnyActions
306
 
307
  //Custom post
308
  $tablecustompost = get_option('wpcsvfreesettings');
309
- $customoption = $tablecustompost['rcustompost'];
310
  if ( $customoption == 'custompostuitype' ) {
311
  $data['custompostuitype'] = 'checked enablesetting';
312
  $data['wptypes'] = 'disablesetting';
@@ -368,7 +370,7 @@ class SettingsActions extends SkinnyActions
368
  $data['podspost_status'] = 'Disabled';
369
  }
370
  //Additional Settings
371
- $scheduleoption = $tableseo['send_log_email'];
372
  if ( $scheduleoption == 'send_log_email' ) {
373
  $data['schedulelog'] = 'checked enablesetting';
374
  $data['schedulenolog'] = 'disablesetting';
@@ -378,7 +380,7 @@ class SettingsActions extends SkinnyActions
378
  $data['schedulelog'] = 'disablesetting';
379
  }
380
 
381
- $categoryoption = $tableseo['rcateicons'];
382
  if ( $categoryoption == 'enable' ) {
383
  $data['catyenable'] = 'checked enablesetting';
384
  $data['catydisable'] = 'disablesetting';
@@ -406,7 +408,7 @@ class SettingsActions extends SkinnyActions
406
  $data['dropoff_status'] = 'checked';
407
  }
408
  //Eccommerce option
409
- $ecommerceoption = $tableseo['recommerce'];
410
  if ( $ecommerceoption == 'eshop' ) {
411
  $data['eshop'] = 'checked enablesetting';
412
  $data['marketpress'] = 'disablesetting';
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class SettingsActions extends SkinnyActions
41
  {
72
  //Settings action
73
  //SEO option
74
  $tableseo = get_option('wpcsvfreesettings');
75
+ $seooption = isset($tableseo['rseooption']) ? $tableseo['rseooption'] : '';
76
  if ( $seooption == 'aioseo' ) {
77
  $data['aioseo'] = 'checked enablesetting';
78
  $data['yoastseo'] = 'disablesetting';
308
 
309
  //Custom post
310
  $tablecustompost = get_option('wpcsvfreesettings');
311
+ $customoption = isset($tablecustompost['rcustompost']) ? $tablecustompost['rcustompost'] : '';
312
  if ( $customoption == 'custompostuitype' ) {
313
  $data['custompostuitype'] = 'checked enablesetting';
314
  $data['wptypes'] = 'disablesetting';
370
  $data['podspost_status'] = 'Disabled';
371
  }
372
  //Additional Settings
373
+ $scheduleoption = isset($tableseo['send_log_email']) ? $tableseo['send_log_email'] : '';
374
  if ( $scheduleoption == 'send_log_email' ) {
375
  $data['schedulelog'] = 'checked enablesetting';
376
  $data['schedulenolog'] = 'disablesetting';
380
  $data['schedulelog'] = 'disablesetting';
381
  }
382
 
383
+ $categoryoption = isset($tableseo['rcateicons']) ? $tableseo['rcateicons'] : '';
384
  if ( $categoryoption == 'enable' ) {
385
  $data['catyenable'] = 'checked enablesetting';
386
  $data['catydisable'] = 'disablesetting';
408
  $data['dropoff_status'] = 'checked';
409
  }
410
  //Eccommerce option
411
+ $ecommerceoption = isset($tableseo['recommerce']) ? $tableseo['recommerce'] : '';
412
  if ( $ecommerceoption == 'eshop' ) {
413
  $data['eshop'] = 'checked enablesetting';
414
  $data['marketpress'] = 'disablesetting';
modules/settings/templates/index.php CHANGED
@@ -34,6 +34,9 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
 
37
  $impCE = new WPImporter_includes_helper();
38
  $nonce_Key = $impCE->create_nonce_key();
39
  if(! wp_verify_nonce($nonce_Key, 'smack_nonce'))
@@ -200,7 +203,7 @@ global $wpdb; ?>
200
  </td><td style="width:112px">
201
  <label id="custrevlabel" title = "<?php echo __('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['customerreviews'].' '.$skinnyData['acf'];?>" ><input type ='checkbox' name = 'rcustomfield' id='Customerreviews' style="display:none" value='Customerreviews' <?php echo $skinnyData['acf']; ?> onclick="check_if_avail(this.id);" ><?php echo $impCE->reduceStringLength(__('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Enable'); ?></label>
202
  <label id="nocustrevlabel" title = "<?php echo __('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['nocustomerreviews'];?>" ><input type ='checkbox' name = 'rcustomfield' style="display:none" onclick="check_if_avail(this.name);" ><?php echo $impCE->reduceStringLength(__('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Disable'); ?></label>
203
- <span id="pluginavail" class="moduleavail <?php echo $skinnyData['customerreviewstd'] ?>"> </span>
204
  </td></tr>
205
  </tbody></table><br />
206
  <label style='color:red;'><?php echo __("Note: Supports WordPress Custom Post by default. For Custom Post Type UI plugin, please enable it under Custom Posts & Taxonomy",WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label>
@@ -231,7 +234,7 @@ global $wpdb; ?>
231
  <label><?php echo __('Import support for Types Custom Post Type and taxonomies data.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
232
  <label id="custompostsetting3" class="<?php echo $skinnyData['cctm'];?>" >
233
  <input type ='radio' name = 'rcustompost' id='types' style="display:none" value='types' <?php echo $skinnyData['cctm']; ?> onclick="check_if_avail(this.id);" ><span id="custompost3text"> <?php echo $skinnyData['wptypes_status']; ?> </span></label>
234
- <div id="pluginavail" class="<?php echo $skinnyData['wptypestd'] ?>"> </div>
235
  </td></tr>
236
  <tr><td>
237
  <h3 id="innertitle"><?php echo __('CCTM Custom Posts',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
@@ -243,7 +246,7 @@ global $wpdb; ?>
243
  <h3 id="innertitle"><?php echo __('PODS Custom Posts & Taxonomy',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
244
  <label><?php echo __('Import support for PODS Custom Posts.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
245
  <label id="custompostsetting5" class="<?php echo $skinnyData['podspost']; ?>"><input type='radio' name='rcustompost' id='podspost' value='podspost' <?php echo $skinnyData['podspost']; ?> style="display:none" onclick="check_if_avail(this.id);"><span id="custompost5text"> <?php echo $skinnyData['podspost_status']; ?></span></label>
246
- <div id="pluginavail" class="<?php echo $skinnyData['podstd'] ?>"> </div>
247
  </td></tr>
248
  </tbody>
249
  </table>
@@ -286,13 +289,13 @@ global $wpdb; ?>
286
  <h3 id="innertitle"><?php echo __('Types Custom Fields',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
287
  <label><?php echo __('Enable to add import support for Types custom fields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
288
  <label id="customfieldsetting3" class="<?php echo $skinnyData['wptypescustfields']; ?>"><input type='radio' name='rcustomfield' id='typescustomfield' value='wptypescustfields' <?php echo $skinnyData['wptypes']; ?> style="display:none" onclick="check_if_avail(this.id);" /><span id="customfield3text" > <?php echo $skinnyData['typesfield_status']; ?> </span></label>
289
- <div id="pluginavail" class="<?php echo $skinnyData['wptypestd'] ?>"> </div>
290
  </td></tr>
291
  <tr><td>
292
  <h3 id="innertitle"><?php echo __('PODS Custom Fields',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h3>
293
  <label><?php echo __('Enable to add import support for PODS custom fields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
294
  <label id="customfieldsetting4" class="<?php echo $skinnyData['podscustomfields']; ?>"><input type='radio' name='rcustomfield' id='podscustomfield' value='podscustomfields' <?php echo $skinnyData['podscustomfields']; ?> style="display:none" onclick="check_if_avail(this.id);" /><span id="customfield4text" > <?php echo $skinnyData['podsfield_status']; ?> </span></label>
295
- <div id="pluginavail" class="<?php echo $skinnyData['podstd'] ?>"> </div>
296
  </td></tr>
297
  </tbody>
298
  </table>
@@ -322,7 +325,7 @@ global $wpdb; ?>
322
  <h3 id="innertitle"><?php echo __('Marketpress Lite',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
323
  <label><?php echo __('Enable ecommerce import for marketpress Lite.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
324
  <label id="ecommercesetting3" class="<?php echo $skinnyData['woocommerce']; ?>"><input type='radio' name='recommerce' id='marketpress' value='marketpress' <?php echo $skinnyData['marketpress']; ?> class = 'woocommerce' onclick='check_if_avail(this.id);' style="display:none"><span id="ecommerce3text"><?php echo $skinnyData['marketpress_status']; ?></span></label>
325
- <div id="pluginavail" class="<?php echo $skinnyData['marketpresslitetd'] ?>"> </div>
326
  </td></tr>
327
  <tr><td>
328
  <h3 id="innertitle"><?php echo __('Woocommerce',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h3>
@@ -439,29 +442,41 @@ global $wpdb; ?>
439
  <table class="databaseoptimization">
440
  <tbody>
441
  <tr><td>
442
- <label><input type='checkbox' name='delete_all_orphaned_post_page_meta' id='delete_all_orphaned_post_page_meta' value='delete_all_orphaned_post_page_meta' <?php echo $skinnyData['delete_all_orphaned_post_page_meta']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all orphaned Post/Page Meta',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
 
 
 
 
 
 
 
 
 
 
 
 
443
  </td><td>
444
- <label><input type='checkbox' name='delete_all_unassigned_tags' id='delete_all_unassigned_tags' value='delete_all_unassigned_tags' <?php echo $skinnyData['delete_all_unassigned_tags']; ?> disabled/></label><td><span id="align"> <?php echo __('Delete all unassigned tags',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
445
  </td></tr>
446
  <tr><td>
447
- <label><input type='checkbox' name='delete_all_post_page_revisions' id='delete_all_post_page_revisions' value='delete_all_post_page_revisions' <?php echo $skinnyData['delete_all_post_page_revisions']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Post/Page revisions',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
448
  </td><td>
449
- <label><input type='checkbox' name='delete_all_auto_draft_post_page' id='delete_all_auto_draft_post_page' value='delete_all_auto_draft_post_page' <?php echo $skinnyData['delete_all_auto_draft_post_page']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all auto drafted Post/Page',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
450
  </td></tr>
451
  <tr><td>
452
- <label><input type='checkbox' name='delete_all_post_page_in_trash' id='delete_all_post_page_in_trash' value='delete_all_post_page_in_trash' <?php echo $skinnyData['delete_all_spam_comments']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Post/Page in trash',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
453
  </td><td>
454
- <label><input type='checkbox' name='delete_all_spam_comments' id='delete_all_spam_comments' value='delete_all_spam_comments' <?php echo $skinnyData['delete_all_comments_in_trash']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Spam Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
455
  </td></tr>
456
  <tr><td>
457
- <label><input type='checkbox' name='delete_all_comments_in_trash' id='delete_all_comments_in_trash' value='delete_all_comments_in_trash' <?php echo $skinnyData['delete_all_comments_in_trash']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Comments in trash',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
458
  </td><td>
459
- <label><input type='checkbox' name='delete_all_unapproved_comments' id='delete_all_unapproved_comments' value='delete_all_unapproved_comments' <?php echo $skinnyData['delete_all_unapproved_comments']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Unapproved Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
460
  </td></tr>
461
  <tr><td>
462
- <label><input type='checkbox' name='delete_all_pingback_commments' id='delete_all_pingback_commments' value='delete_all_pingback_commments' <?php echo $skinnyData['delete_all_pingback_commments']; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Pingback Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
463
  </td><td>
464
- <label><input type='checkbox' name='delete_all_trackback_comments' id='delete_all_trackback_comments' value='delete_all_trackback_comments' <?php echo $skinnyData['delete_all_trackback_comments']; ?> disabled /> </label><td><span id="align"> <?php echo __('Delete all Trackback Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
465
  </td></tr>
466
  </tbody>
467
  </table>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
+ global $wp_version, $wpdb;
40
  $impCE = new WPImporter_includes_helper();
41
  $nonce_Key = $impCE->create_nonce_key();
42
  if(! wp_verify_nonce($nonce_Key, 'smack_nonce'))
203
  </td><td style="width:112px">
204
  <label id="custrevlabel" title = "<?php echo __('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['customerreviews'].' '.$skinnyData['acf'];?>" ><input type ='checkbox' name = 'rcustomfield' id='Customerreviews' style="display:none" value='Customerreviews' <?php echo $skinnyData['acf']; ?> onclick="check_if_avail(this.id);" ><?php echo $impCE->reduceStringLength(__('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Enable'); ?></label>
205
  <label id="nocustrevlabel" title = "<?php echo __('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['nocustomerreviews'];?>" ><input type ='checkbox' name = 'rcustomfield' style="display:none" onclick="check_if_avail(this.name);" ><?php echo $impCE->reduceStringLength(__('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Disable'); ?></label>
206
+ <span id="pluginavail" class="moduleavail <?php if(isset($skinnyData['customerreviewstd'])) echo $skinnyData['customerreviewstd']; ?>"> </span>
207
  </td></tr>
208
  </tbody></table><br />
209
  <label style='color:red;'><?php echo __("Note: Supports WordPress Custom Post by default. For Custom Post Type UI plugin, please enable it under Custom Posts & Taxonomy",WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label>
234
  <label><?php echo __('Import support for Types Custom Post Type and taxonomies data.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
235
  <label id="custompostsetting3" class="<?php echo $skinnyData['cctm'];?>" >
236
  <input type ='radio' name = 'rcustompost' id='types' style="display:none" value='types' <?php echo $skinnyData['cctm']; ?> onclick="check_if_avail(this.id);" ><span id="custompost3text"> <?php echo $skinnyData['wptypes_status']; ?> </span></label>
237
+ <div id="pluginavail" class="<?php if(isset($skinnyData['wptypestd'])) echo $skinnyData['wptypestd']; ?>"> </div>
238
  </td></tr>
239
  <tr><td>
240
  <h3 id="innertitle"><?php echo __('CCTM Custom Posts',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
246
  <h3 id="innertitle"><?php echo __('PODS Custom Posts & Taxonomy',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
247
  <label><?php echo __('Import support for PODS Custom Posts.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
248
  <label id="custompostsetting5" class="<?php echo $skinnyData['podspost']; ?>"><input type='radio' name='rcustompost' id='podspost' value='podspost' <?php echo $skinnyData['podspost']; ?> style="display:none" onclick="check_if_avail(this.id);"><span id="custompost5text"> <?php echo $skinnyData['podspost_status']; ?></span></label>
249
+ <div id="pluginavail" class="<?php if(isset($skinnyData['podstd'])) echo $skinnyData['podstd']; ?>"> </div>
250
  </td></tr>
251
  </tbody>
252
  </table>
289
  <h3 id="innertitle"><?php echo __('Types Custom Fields',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
290
  <label><?php echo __('Enable to add import support for Types custom fields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
291
  <label id="customfieldsetting3" class="<?php echo $skinnyData['wptypescustfields']; ?>"><input type='radio' name='rcustomfield' id='typescustomfield' value='wptypescustfields' <?php echo $skinnyData['wptypes']; ?> style="display:none" onclick="check_if_avail(this.id);" /><span id="customfield3text" > <?php echo $skinnyData['typesfield_status']; ?> </span></label>
292
+ <div id="pluginavail" class="<?php if(isset($skinnyData['wptypestd'])) echo $skinnyData['wptypestd']; ?>"> </div>
293
  </td></tr>
294
  <tr><td>
295
  <h3 id="innertitle"><?php echo __('PODS Custom Fields',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h3>
296
  <label><?php echo __('Enable to add import support for PODS custom fields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
297
  <label id="customfieldsetting4" class="<?php echo $skinnyData['podscustomfields']; ?>"><input type='radio' name='rcustomfield' id='podscustomfield' value='podscustomfields' <?php echo $skinnyData['podscustomfields']; ?> style="display:none" onclick="check_if_avail(this.id);" /><span id="customfield4text" > <?php echo $skinnyData['podsfield_status']; ?> </span></label>
298
+ <div id="pluginavail" class="<?php if(isset($skinnyData['podstd'])) echo $skinnyData['podstd']; ?>"> </div>
299
  </td></tr>
300
  </tbody>
301
  </table>
325
  <h3 id="innertitle"><?php echo __('Marketpress Lite',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
326
  <label><?php echo __('Enable ecommerce import for marketpress Lite.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> </td><td>
327
  <label id="ecommercesetting3" class="<?php echo $skinnyData['woocommerce']; ?>"><input type='radio' name='recommerce' id='marketpress' value='marketpress' <?php echo $skinnyData['marketpress']; ?> class = 'woocommerce' onclick='check_if_avail(this.id);' style="display:none"><span id="ecommerce3text"><?php echo $skinnyData['marketpress_status']; ?></span></label>
328
+ <div id="pluginavail" class="<?php if(isset($skinnyData['marketpresslitetd'])) echo $skinnyData['marketpresslitetd']; ?>"> </div>
329
  </td></tr>
330
  <tr><td>
331
  <h3 id="innertitle"><?php echo __('Woocommerce',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h3>
442
  <table class="databaseoptimization">
443
  <tbody>
444
  <tr><td>
445
+ <?php
446
+ $skinny_delete_all_post_page = isset($skinnyData['delete_all_orphaned_post_page_meta']) ? $skinnyData['delete_all_orphaned_post_page_meta'] : '';
447
+ $skinny_delete_all_unassigned_tag = isset($skinnyData['delete_all_unassigned_tags']) ? $skinnyData['delete_all_unassigned_tags'] : '';
448
+ $skinny_delete_all_page_revisions = isset($skinnyData['delete_all_post_page_revisions']) ? $skinnyData['delete_all_post_page_revisions'] : '';
449
+ $skinny_delete_all_auto_draft_page = isset($skinnyData['delete_all_auto_draft_post_page']) ? $skinnyData['delete_all_auto_draft_post_page'] : '';
450
+ $skinny_delete_all_post_page_trash = isset($skinnyData['delete_all_post_page_in_trash']) ? $skinnyData['delete_all_post_page_in_trash'] : '';
451
+ $skinny_delete_all_comments_trash = isset($skinnyData['delete_all_comments_in_trash']) ? $skinnyData['delete_all_comments_in_trash'] : '';
452
+ $skinny_delete_all_spam_comments = isset($skinnyData['delete_all_spam_comments']) ? $skinnyData['delete_all_spam_comments'] : '';
453
+ $skinny_delete_all_unapproved_comments = isset($skinnyData['delete_all_unapproved_comments']) ? $skinnyData['delete_all_unapproved_comments'] : '';
454
+ $skinny_delete_all_pingback_comments = isset($skinnyData['delete_all_pingback_commments']) ? $skinnyData['delete_all_pingback_commments'] : '';
455
+ $skinny_delete_all_trackback_comments = isset($skinnyData['delete_all_trackback_comments']) ? $skinnyData['delete_all_trackback_comments'] : '';
456
+ ?>
457
+ <label><input type='checkbox' name='delete_all_orphaned_post_page_meta' id='delete_all_orphaned_post_page_meta' value='delete_all_orphaned_post_page_meta' <?php echo $skinny_delete_all_post_page; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all orphaned Post/Page Meta',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
458
  </td><td>
459
+ <label><input type='checkbox' name='delete_all_unassigned_tags' id='delete_all_unassigned_tags' value='delete_all_unassigned_tags' <?php echo $skinny_delete_all_unassigned_tag; ?> disabled/></label><td><span id="align"> <?php echo __('Delete all unassigned tags',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
460
  </td></tr>
461
  <tr><td>
462
+ <label><input type='checkbox' name='delete_all_post_page_revisions' id='delete_all_post_page_revisions' value='delete_all_post_page_revisions' <?php echo $skinny_delete_all_page_revisions; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Post/Page revisions',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
463
  </td><td>
464
+ <label><input type='checkbox' name='delete_all_auto_draft_post_page' id='delete_all_auto_draft_post_page' value='delete_all_auto_draft_post_page' <?php echo $skinny_delete_all_auto_draft_page; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all auto drafted Post/Page',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
465
  </td></tr>
466
  <tr><td>
467
+ <label><input type='checkbox' name='delete_all_post_page_in_trash' id='delete_all_post_page_in_trash' value='delete_all_post_page_in_trash' <?php echo $skinny_delete_all_post_page_trash; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Post/Page in trash',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
468
  </td><td>
469
+ <label><input type='checkbox' name='delete_all_spam_comments' id='delete_all_spam_comments' value='delete_all_spam_comments' <?php echo $skinny_delete_all_spam_comments; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Spam Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
470
  </td></tr>
471
  <tr><td>
472
+ <label><input type='checkbox' name='delete_all_comments_in_trash' id='delete_all_comments_in_trash' value='delete_all_comments_in_trash' <?php echo $skinny_delete_all_comments_trash; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Comments in trash',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
473
  </td><td>
474
+ <label><input type='checkbox' name='delete_all_unapproved_comments' id='delete_all_unapproved_comments' value='delete_all_unapproved_comments' <?php echo $skinny_delete_all_unapproved_comments; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Unapproved Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
475
  </td></tr>
476
  <tr><td>
477
+ <label><input type='checkbox' name='delete_all_pingback_commments' id='delete_all_pingback_commments' value='delete_all_pingback_commments' <?php echo $skinny_delete_all_pingback_comments; ?> disabled /></label><td><span id="align"> <?php echo __('Delete all Pingback Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
478
  </td><td>
479
+ <label><input type='checkbox' name='delete_all_trackback_comments' id='delete_all_trackback_comments' value='delete_all_trackback_comments' <?php echo $skinny_delete_all_trackback_comments; ?> disabled /> </label><td><span id="align"> <?php echo __('Delete all Trackback Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span></td>
480
  </td></tr>
481
  </tbody>
482
  </table>
modules/support/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class SupportActions extends SkinnyActions {
39
 
@@ -49,7 +51,6 @@ class SupportActions extends SkinnyActions {
49
  public function executeIndex($request)
50
  {
51
  // return an array of name value pairs to send data to the template
52
- require_once (ABSPATH . 'wp-load.php');
53
  $data = array();
54
  $headers = array();
55
  if(isset($_POST['send_mail'])){
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class SupportActions extends SkinnyActions {
41
 
51
  public function executeIndex($request)
52
  {
53
  // return an array of name value pairs to send data to the template
 
54
  $data = array();
55
  $headers = array();
56
  if(isset($_POST['send_mail'])){
modules/support/templates/index.php CHANGED
@@ -34,7 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  $impCE = new WPImporter_includes_helper();
39
  ?>
40
 
@@ -52,7 +53,7 @@ $impCE = new WPImporter_includes_helper();
52
 
53
  <div id="relatedpages" style='position:relative;left:630px;bottom:345px;'>
54
  <h2 id="doctitle"><?php echo __('Smackcoders Support',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h2 >
55
- <p style="line-height:20px;padding-top:20px"><?php echo __('Click',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="https://www.smackcoders.com/blog/category/web-development-news/?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"> <?php __('here',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></a> <?php echo __('for Development News',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </p>
56
  <p style="line-height:20px"><?php echo __('View',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="http://www.wpultimatecsvimporter.com/?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"><?php echo __('Recent News',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></a> </p>
57
  <p style="line-height:20px"><?php echo __('Refer',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="http://www.wpultimatecsvimporter.com/documentation?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"><?php echo __('Detailed Document',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></a> </p>
58
  <p style="line-height:20px"><?php echo __('For',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?><a href="https://www.smackcoders.com/blog/csv-importer-a-simple-and-easy-csv-importer-tutorial.html?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"> <?php echo __('Tutorials',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </a> </p>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $impCE = new WPImporter_includes_helper();
40
  ?>
41
 
53
 
54
  <div id="relatedpages" style='position:relative;left:630px;bottom:345px;'>
55
  <h2 id="doctitle"><?php echo __('Smackcoders Support',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </h2 >
56
+ <p style="line-height:20px;padding-top:20px"><?php echo __('Click',WP_CONST_ULTIMATE_CSV_IMP_SLUG);echo ' '; echo __('here',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="https://www.smackcoders.com/blog/category/web-development-news/?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"> <?php echo __('for Development News',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </a></p>
57
  <p style="line-height:20px"><?php echo __('View',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="http://www.wpultimatecsvimporter.com/?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"><?php echo __('Recent News',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></a> </p>
58
  <p style="line-height:20px"><?php echo __('Refer',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <a href="http://www.wpultimatecsvimporter.com/documentation?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"><?php echo __('Detailed Document',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></a> </p>
59
  <p style="line-height:20px"><?php echo __('For',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?><a href="https://www.smackcoders.com/blog/csv-importer-a-simple-and-easy-csv-importer-tutorial.html?utm_source=WpPlugin&utm_medium=Free&utm_campaign=SupportTraffic" target="_blank"> <?php echo __('Tutorials',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> </a> </p>
modules/users/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class UsersActions extends SkinnyActions {
39
 
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class UsersActions extends SkinnyActions {
41
 
modules/users/templates/index.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.'/includes/WPImporter_includes_helper.php');
39
  ?>
40
 
@@ -115,50 +116,83 @@ jQuery('#warning').css('font-weight','bold');
115
  jQuery('#progress .progress-bar').css('visibility','hidden');
116
  }
117
  else{
118
- jQuery(function () {
119
- 'use strict';
120
- var uploadPath = document.getElementById('uploaddir').value;
121
- var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/lib/jquery-plugins/uploader.php')+'?uploadPath='+uploadPath+'&curr_action=<?php echo $_REQUEST['__module']; ?>';
122
- jQuery('#fileupload').fileupload({
123
- url: url,
124
- dataType: 'json',
125
- done: function (e, data) {
126
- jQuery.each(data.result.files, function (index, file) {
127
- document.getElementById('uploadFileName').value=file.name;
128
- var filewithmodule = file.uploadedname.split(".csv");
129
- file.uploadedname = filewithmodule[0]+"-<?php echo $_REQUEST['__module']; ?>"+".csv";
130
- document.getElementById('upload_csv_realname').value = file.uploadedname;
131
- var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
132
- var get_version2 = get_version1[1].split(".csv");
133
- var get_version3 = get_version2[0].split("-");
134
- document.getElementById('current_file_version').value = get_version3[1];
135
- jQuery('#uploadedfilename').val(file.uploadedname);
136
- jQuery( "#filenamedisplay" ).empty(); //alert(file.size);
137
- if(file.size>1024 && file.size<(1024*1024))
138
- {
139
- var fileSize =(file.size/1024).toFixed(2)+' kb';
140
- }
141
- else if(file.size>(1024*1024))
142
- {
143
- var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
144
- }
145
- else
146
- {
147
- var fileSize= (file.size)+' byte';
148
- }
149
- jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
150
- jQuery('#importfile').attr('disabled', false);
151
- });
152
- },
153
- progressall: function (e, data) {
154
- var progress = parseInt(data.loaded / data.total * 100, 10);
155
- jQuery('#progress .progress-bar').css(
156
- 'width',
157
- progress + '%'
158
- );
159
- }
160
- }).prop('disabled', !jQuery.support.fileInput)
161
- .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  });
163
  }
164
  </script>
@@ -303,11 +337,11 @@ $usersObj = new UsersActions();
303
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="<?php echo __('Replace the default value',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" style="display: none;" value="<?php echo $value ?>"/>
304
  <span style="display: none;" id="customspan<?php echo $count ?>">
305
  <a href="#" class="tooltip">
306
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" />
307
  <span class="tooltipFour">
308
- <img class="callout" src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/callout.gif" />
309
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
310
- <img src="../wp-content/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/images/help.png" style="margin-top: 6px;float:right;" />
311
  </span>
312
  </a>
313
  </span>
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
40
  ?>
41
 
116
  jQuery('#progress .progress-bar').css('visibility','hidden');
117
  }
118
  else{
119
+ jQuery(function () {
120
+ 'use strict';
121
+ var url = (document.getElementById('pluginurl').value+'/plugins/<?php echo WP_CONST_ULTIMATE_CSV_IMP_SLUG;?>/modules/default/templates/index.php');
122
+ var filesdata;
123
+ var uploadPath = document.getElementById('uploaddir').value;
124
+ function prepareUpload(event){
125
+ filesdata = event.target.files;
126
+ var curraction = '<?php echo $_REQUEST['__module']; ?>';
127
+ var frmdata = new FormData();
128
+ var uploadfile_data = jQuery('#fileupload').prop('files')[0];
129
+ frmdata.append('files', uploadfile_data);
130
+ frmdata.append('action','uploadfilehandle');
131
+ frmdata.append('curr_action', curraction);
132
+ frmdata.append('uploadPath', uploadPath);
133
+ jQuery.ajax({
134
+ url : ajaxurl,
135
+ type : 'post',
136
+ data : frmdata,
137
+ cache: false,
138
+ contentType : false,
139
+ processData: false,
140
+ success : function(data) {
141
+ var fileobj =JSON.parse(data);
142
+ jQuery.each(fileobj,function(objkey,objval){
143
+ jQuery.each(objval,function(o_key,file){
144
+ document.getElementById('uploadFileName').value=file.name;
145
+ var filewithmodule = file.uploadedname.split(".");
146
+ var check_file = filewithmodule[filewithmodule.length - 1];
147
+ if(check_file != "csv" && check_file != "txt") {
148
+ alert('Un Supported File Format');
149
+ return false;
150
+ }
151
+ if(check_file == "csv"){
152
+ var filenamecsv = file.uploadedname.split(".csv");
153
+ file.uploadedname = filenamecsv[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".csv";
154
+ }
155
+ if(check_file == "txt"){
156
+ var filenametxt = file.uploadedname.split(".txt");
157
+ file.uploadedname = filenametxt[0] + "-<?php echo $_REQUEST['__module']; ?>" + ".txt";
158
+ }
159
+ document.getElementById('upload_csv_realname').value = file.uploadedname;
160
+ var get_version1 = file.name.split("-<?php echo $_REQUEST['__module']; ?>");
161
+ var get_version2 = get_version1[1].split(".csv");
162
+ var get_version3 = get_version2[0].split("-");
163
+ document.getElementById('current_file_version').value = get_version3[1];
164
+ jQuery('#uploadedfilename').val(file.uploadedname);
165
+ jQuery( "#filenamedisplay" ).empty();
166
+ if(file.size>1024 && file.size<(1024*1024))
167
+ {
168
+ var fileSize =(file.size/1024).toFixed(2)+' kb';
169
+ }
170
+ else if(file.size>(1024*1024))
171
+ {
172
+ var fileSize =(file.size/(1024*1024)).toFixed(2)+' mb';
173
+ }
174
+ else
175
+ {
176
+ var fileSize= (file.size)+' byte';
177
+ }
178
+ jQuery('<p/>').text((file.name)+' - '+fileSize).appendTo('#filenamedisplay');
179
+ jQuery('#importfile').attr('disabled', false);
180
+ jQuery('#fileupload').prop('disabled', !jQuery.support.fileInput)
181
+ .parent().addClass(jQuery.support.fileInput ? undefined : 'disabled');
182
+ });
183
+ });
184
+
185
+ }
186
+ });
187
+ }
188
+ jQuery('#fileupload').on('change', prepareUpload);
189
+ jQuery('#fileupload').fileupload({
190
+ url : url,
191
+ progressall: function (e, data) {
192
+ var progress = parseInt(data.loaded / data.total * 100, 10);
193
+ jQuery('#progress .progress-bar').css('width', progress + '%' );
194
+ }
195
+ });
196
  });
197
  }
198
  </script>
337
  <input class="customfieldtext" type="text" id="textbox<?php print($count); ?>" name="textbox<?php print($count); ?>" TITLE="<?php echo __('Replace the default value',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" style="display: none;" value="<?php echo $value ?>"/>
338
  <span style="display: none;" id="customspan<?php echo $count ?>">
339
  <a href="#" class="tooltip">
340
+ <img src="<?php echo WP_PLUGIN_URL . '/' .WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png'; ?>" />
341
  <span class="tooltipFour">
342
+ <img class="callout" src="<?php echo WP_PLUGIN_URL . '/'. WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/callout.gif'; ?>" />
343
  <strong><?php echo __('Give a name for your new custom field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></strong>
344
+ <img src="<?php echo WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/images/help.png' ; ?>" style="margin-top: 6px;float:right;" />
345
  </span>
346
  </a>
347
  </span>
modules/woocommerce/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class WoocommerceActions extends SkinnyActions {
39
 
@@ -53,4 +55,4 @@ class WoocommerceActions extends SkinnyActions {
53
  return $data;
54
  }
55
 
56
- }
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class WoocommerceActions extends SkinnyActions {
41
 
55
  return $data;
56
  }
57
 
58
+ }
modules/woocommerce/templates/index.php CHANGED
@@ -34,5 +34,6 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>".__('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>".__('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
modules/wpcommerce/actions/actions.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
 
38
  class WpcommerceActions extends SkinnyActions {
39
 
@@ -53,4 +55,4 @@ class WpcommerceActions extends SkinnyActions {
53
  return $data;
54
  }
55
 
56
- }
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
 
40
  class WpcommerceActions extends SkinnyActions {
41
 
55
  return $data;
56
  }
57
 
58
+ }
modules/wpcommerce/templates/index.php CHANGED
@@ -34,5 +34,6 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
-
 
38
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  echo "<div align='center' style='width:100%;'> <p class='warnings' style='width:50%;text-align:center;color:red;'>". __('This feature is only available in PRO!.',WP_CONST_ULTIMATE_CSV_IMP_SLUG)."</p></div>";
plugins/class.inlineimages.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  class WPImporter_inlineImages {
3
 
4
  /**
@@ -12,10 +14,11 @@ class WPImporter_inlineImages {
12
  # print_r($res_array); die('am from importwithInlineImages function');
13
  $updatearray = array();
14
  $res_array = $this->capture_all_shortcodes($data_array['post_content'],$postID);
15
- $updatearray['post_content'] = $res_array['post_content'];
16
  $updatearray['ID'] = $postID;
17
  $post_id = wp_update_post($updatearray);
18
  $impObj->insPostCount++;
 
19
  $impObj->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success , <b>Inline_images_shortcodes - </b>".$res_array['inlineimage_shortcode']."";
20
  return $post_id;
21
  }
@@ -208,6 +211,7 @@ public function capture_all_shortcodes( $post_content,$postID){
208
  $eventKey = $_POST['postdata']['uploadedFile'];
209
  $inlineimageDirpath = $inlineimageDir . '/' . $eventKey;
210
  $imagelist = scanDirectories($inlineimageDirpath);
 
211
  if(!$imagelist) {
212
  //echo 'Images not available!'; die;
213
  $noimage = WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/noimage.png";
@@ -224,8 +228,10 @@ public function capture_all_shortcodes( $post_content,$postID){
224
  }
225
 
226
  $exploded_currentLoc = explode("$eventKey", $currentLoc);
227
- if(!empty($exploded_currentLoc))
228
  $inlimg_curr_loc = $exploded_currentLoc[1];
 
 
229
 
230
  $inlineimageURL = $inlineimageURL . '/' . $eventKey . $inlimg_curr_loc;
231
 
@@ -284,6 +290,9 @@ public function capture_all_shortcodes( $post_content,$postID){
284
  }*/
285
  // if($shortcode_mode == 'Inline') {
286
  $oldWord = $shortcode;
 
 
 
287
  $newWord = '<img src="' . $inline_file['guid'] . '" '.$image_attribute[1].' '.$image_attribute[2].' '.$image_attribute[3].' />';
288
  $post_content = str_replace($oldWord , $newWord , $post_content);
289
  $result['post_content'] = $post_content;
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit; // Exit if accessed directly
4
  class WPImporter_inlineImages {
5
 
6
  /**
14
  # print_r($res_array); die('am from importwithInlineImages function');
15
  $updatearray = array();
16
  $res_array = $this->capture_all_shortcodes($data_array['post_content'],$postID);
17
+ $updatearray['post_content'] = isset($res_array['post_content']) ? $res_array['post_content'] : '';
18
  $updatearray['ID'] = $postID;
19
  $post_id = wp_update_post($updatearray);
20
  $impObj->insPostCount++;
21
+ $res_array['inlineimage_shortcode'] = isset($res_array['inlineimage_shortcode']) ? $res_array['inlineimage_shortcode'] : '';
22
  $impObj->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success , <b>Inline_images_shortcodes - </b>".$res_array['inlineimage_shortcode']."";
23
  return $post_id;
24
  }
211
  $eventKey = $_POST['postdata']['uploadedFile'];
212
  $inlineimageDirpath = $inlineimageDir . '/' . $eventKey;
213
  $imagelist = scanDirectories($inlineimageDirpath);
214
+ $currentLoc = '';
215
  if(!$imagelist) {
216
  //echo 'Images not available!'; die;
217
  $noimage = WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/noimage.png";
228
  }
229
 
230
  $exploded_currentLoc = explode("$eventKey", $currentLoc);
231
+ if(!empty($exploded_currentLoc) && isset($exploded_currentLoc[1]))
232
  $inlimg_curr_loc = $exploded_currentLoc[1];
233
+ else
234
+ $inlimg_curr_loc = '';
235
 
236
  $inlineimageURL = $inlineimageURL . '/' . $eventKey . $inlimg_curr_loc;
237
 
290
  }*/
291
  // if($shortcode_mode == 'Inline') {
292
  $oldWord = $shortcode;
293
+ $image_attribute[1] = isset($image_attribute[1])?$image_attribute[1] : '';
294
+ $image_attribute[2] = isset($image_attribute[2])?$image_attribute[2] : '';
295
+ $image_attribute[3] = isset($image_attribute[3])?$image_attribute[3] : '';
296
  $newWord = '<img src="' . $inline_file['guid'] . '" '.$image_attribute[1].' '.$image_attribute[2].' '.$image_attribute[3].' />';
297
  $post_content = str_replace($oldWord , $newWord , $post_content);
298
  $result['post_content'] = $post_content;
templates/import.php CHANGED
@@ -34,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
  $noncevar = isset($_POST['postdata']['wpnonce']) ? $_POST['postdata']['wpnonce'] : '';
38
  if(!wp_verify_nonce($noncevar, 'smack_nonce'))
39
  die('You are not allowed to do this operation.Please contact your admin.');
@@ -105,6 +107,7 @@ if ($count < $totRecords) {
105
  $resultArr = array();
106
  $res2 = array();
107
  $res1 = array();
 
108
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
109
  $delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
110
  $resultArr = $skinnyObj->csv_file_data($filename);
@@ -118,6 +121,7 @@ $csv_rec_count = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['h2'];
118
 
119
  //mapped and unmapped count
120
  for($i=0;$i<$csv_rec_count;$i++) {
 
121
  $mapping_value = $_SESSION[$_POST['postdata']['uploadedFile']]['SMACK_MAPPING_SETTINGS_VALUES']['mapping'.$i];
122
  if($mapping_value == '-- Select --' ) {
123
  $res1[] = $mapping_value;
@@ -154,8 +158,14 @@ for ($i = $limit; $i < $count; $i++) {
154
  $sample_inlineimage_url = $_POST['postdata']['inlineimagehandling'];
155
  }
156
  $importObj->processDataInWP($to_be_import_rec,$_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $i, $extracted_image_location, $importinlineimageoption, $sample_inlineimage_url);
 
157
  if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'custompost' || $curr_action == 'eshop') {
158
  foreach($importObj->detailedLog as $logKey => $logVal) {
 
 
 
 
 
159
  echo "<p style='margin-left:10px;'> " . $logVal['post_id'] . " , " . $logVal['assigned_author'] . " , " . $logVal['category'] . " , " . $logVal['tags'] . " , " . $logVal['postdate'] . " , " . $logVal['image'] . " , " . $logVal['poststatus'];
160
  if($curr_action == 'eshop') {
161
  echo " , " . $logVal['SKU'] . ", " . $logVal['verify_here'] . "</p>";
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $noncevar = isset($_POST['postdata']['wpnonce']) ? $_POST['postdata']['wpnonce'] : '';
40
  if(!wp_verify_nonce($noncevar, 'smack_nonce'))
41
  die('You are not allowed to do this operation.Please contact your admin.');
107
  $resultArr = array();
108
  $res2 = array();
109
  $res1 = array();
110
+ $mapping_value = '';
111
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
112
  $delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
113
  $resultArr = $skinnyObj->csv_file_data($filename);
121
 
122
  //mapped and unmapped count
123
  for($i=0;$i<$csv_rec_count;$i++) {
124
+ if(array_key_exists($_POST['postdata']['uploadedFile'],$_SESSION))
125
  $mapping_value = $_SESSION[$_POST['postdata']['uploadedFile']]['SMACK_MAPPING_SETTINGS_VALUES']['mapping'.$i];
126
  if($mapping_value == '-- Select --' ) {
127
  $res1[] = $mapping_value;
158
  $sample_inlineimage_url = $_POST['postdata']['inlineimagehandling'];
159
  }
160
  $importObj->processDataInWP($to_be_import_rec,$_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $i, $extracted_image_location, $importinlineimageoption, $sample_inlineimage_url);
161
+ $logarr = array('post_id','assigned_author','category','tags','postdate','image','poststatus');
162
  if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'custompost' || $curr_action == 'eshop') {
163
  foreach($importObj->detailedLog as $logKey => $logVal) {
164
+ foreach($logarr as $logarrkey){
165
+ if(!array_key_exists($logarrkey,$logVal)){
166
+ $logVal[$logarrkey] = '';
167
+ }
168
+ }
169
  echo "<p style='margin-left:10px;'> " . $logVal['post_id'] . " , " . $logVal['assigned_author'] . " , " . $logVal['category'] . " , " . $logVal['tags'] . " , " . $logVal['postdate'] . " , " . $logVal['image'] . " , " . $logVal['poststatus'];
170
  if($curr_action == 'eshop') {
171
  echo " , " . $logVal['SKU'] . ", " . $logVal['verify_here'] . "</p>";
templates/menu.php CHANGED
@@ -6,6 +6,8 @@
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
  //require_once(WP_CONST_ULTIMATE_CSV_IMP_DIR.'includes/WPImporter_includes_helper.php');
 
 
9
  $impObj = new WPImporter_includes_helper();
10
  $nonceKey = $impObj->create_nonce_key();
11
  if(! wp_verify_nonce($nonceKey, 'smack_nonce'))
@@ -19,6 +21,7 @@ $impCEM = CallWPImporterObj::getInstance();
19
  $get_settings = array();
20
  $get_settings = $impCEM->getSettings();
21
  $mod = isset($_REQUEST['__module']) ? $_REQUEST['__module'] : '';
 
22
  if( is_array($get_settings) && !empty($get_settings) ) {
23
  foreach ($get_settings as $key) {
24
  $$key = true;
6
  * You can contact Smackcoders at email address info@smackcoders.com.
7
  *******************************************************************************************/
8
  //require_once(WP_CONST_ULTIMATE_CSV_IMP_DIR.'includes/WPImporter_includes_helper.php');
9
+ if ( ! defined( 'ABSPATH' ) )
10
+ exit; // Exit if accessed directly
11
  $impObj = new WPImporter_includes_helper();
12
  $nonceKey = $impObj->create_nonce_key();
13
  if(! wp_verify_nonce($nonceKey, 'smack_nonce'))
21
  $get_settings = array();
22
  $get_settings = $impCEM->getSettings();
23
  $mod = isset($_REQUEST['__module']) ? $_REQUEST['__module'] : '';
24
+ $module = $manager = '';
25
  if( is_array($get_settings) && !empty($get_settings) ) {
26
  foreach ($get_settings as $key) {
27
  $$key = true;
templates/readfile.php CHANGED
@@ -34,8 +34,9 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
- $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
38
- require_once($parse_uri[0]."wp-load.php");
 
39
  $impCheckobj = CallWPImporterObj::checkSecurity();
40
  if($impCheckobj != 'true')
41
  die($impCheckobj);
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if(!defined('ABSPATH')) {
38
+ exit;
39
+ }
40
  $impCheckobj = CallWPImporterObj::checkSecurity();
41
  if($impCheckobj != 'true')
42
  die($impCheckobj);
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,6 +34,8 @@
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
 
 
37
  $impObj = new WPImporter_includes_helper();
38
  $nonceKey = $impObj->create_nonce_key();
39
  if(! wp_verify_nonce($nonceKey, 'smack_nonce'))
34
  * Notices must display the words
35
  * "Copyright Smackcoders. 2014. All rights reserved".
36
  ********************************************************************************/
37
+ if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  $impObj = new WPImporter_includes_helper();
40
  $nonceKey = $impObj->create_nonce_key();
41
  if(! wp_verify_nonce($nonceKey, 'smack_nonce'))
upgrade/migrationfreev3.6.php CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  <div align=center style="padding-top:220px;">
2
  <form name="upgrade_to_latest" method="post">
3
  <label style="font-size:2em;" id="step1"><?php echo __('Upgrade to Latest Version 3.6',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit; // Exit if accessed directly
4
+ ?>
5
  <div align=center style="padding-top:220px;">
6
  <form name="upgrade_to_latest" method="post">
7
  <label style="font-size:2em;" id="step1"><?php echo __('Upgrade to Latest Version 3.6',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label>