Ultimate CSV Importer - Version 3.5.2

Version Description

Download this release

Release Info

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

Code changes from version 3.5.1 to 3.5.2

Readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.smackcoders.com/donate.html
4
  Tags: Advanced CSV Importer, Advanced CSV Import, csv, csv importer, csv import, csv file, csv format, admin, affiliate, amazon, author, automatic, blog, buddypress, categories, comments, content, custom post, e-commerce, free, images, import, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, users, video, woocommerce, wordpress, xml, youtube, batch, bulk, bulk edit, bulk editor, excel, spreadsheet
5
  Requires at least: 3.6.0
6
  Tested up to: 3.8.1
7
- Stable tag: 3.5.1
8
- Version: 3.5.1
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
@@ -15,7 +15,7 @@ Advanced CSV Importer plugin to import data as bulk post, page, custom post etc.
15
 
16
  == Description ==
17
 
18
- **Version 3.5.1 is now available with all reported bug fixes. Give a try today and [Leave your thoughts, comments, review and feed back here](http://wordpress.org/support/view/plugin-reviews/wp-ultimate-csv-importer?filter=5)**
19
 
20
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
21
 
@@ -280,9 +280,18 @@ Read More FAQs from below wiki links.
280
 
281
  == Changelog ==
282
 
 
 
 
 
 
 
 
 
 
283
  = 3.5.1 =
284
  * User reported issue fixes
285
- * Activation and other plugin conflict issue solved like Jetpack
286
  * Admin UI freezing issues - screen option, Help links issues fixed.
287
  * WYSIWIG editor UI issue fixed.
288
 
@@ -409,6 +418,9 @@ Read More FAQs from below wiki links.
409
 
410
  == Upgrade Notice ==
411
 
 
 
 
412
  = 3.5.1 =
413
  * Must upgrade now for 3.5 bug fixes
414
 
4
  Tags: Advanced CSV Importer, Advanced CSV Import, csv, csv importer, csv import, csv file, csv format, admin, affiliate, amazon, author, automatic, blog, buddypress, categories, comments, content, custom post, e-commerce, free, images, import, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, users, video, woocommerce, wordpress, xml, youtube, batch, bulk, bulk edit, bulk editor, excel, spreadsheet
5
  Requires at least: 3.6.0
6
  Tested up to: 3.8.1
7
+ Stable tag: 3.5.2
8
+ Version: 3.5.2
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
15
 
16
  == Description ==
17
 
18
+ **Version 3.5.2 is now available with all reported bug fixes. Give a try today and [Leave your thoughts, comments, review and feed back here](http://wordpress.org/support/view/plugin-reviews/wp-ultimate-csv-importer?filter=5)**
19
 
20
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
21
 
280
 
281
  == Changelog ==
282
 
283
+ = 3.5.2 =
284
+ * Import posts with author names as numerical apart from User ID
285
+ * Added menu_order attribute import
286
+ * Added Auto image rename option
287
+ * Option to cancel an partial import at middle
288
+ * Improved image handling even special characters in Url
289
+ * Import can handle image urls without any extensions
290
+ * User reported bugs fixed
291
+
292
  = 3.5.1 =
293
  * User reported issue fixes
294
+ * Activation and other plugin conflict issue solved like Jet pack
295
  * Admin UI freezing issues - screen option, Help links issues fixed.
296
  * WYSIWIG editor UI issue fixed.
297
 
418
 
419
  == Upgrade Notice ==
420
 
421
+ = 3.5.2 =
422
+ * Upgrade for bug free version and improved image handling
423
+
424
  = 3.5.1 =
425
  * Must upgrade now for 3.5 bug fixes
426
 
includes/WPImporter_includes_helper.php CHANGED
@@ -62,7 +62,8 @@ class WPImporter_includes_helper {
62
  'post_author' => null,
63
  'featured_image' => null,
64
  'post_parent' => 0,
65
- 'post_status' => 0
 
66
  );
67
 
68
  // @var array CSV headers
@@ -73,31 +74,31 @@ class WPImporter_includes_helper {
73
  /* getImportDataConfiguration */
74
  public function getImportDataConfiguration(){
75
  $importDataConfig = "<div class='importstatus'id='importallwithps_div'>
76
- <table><tr><td>
77
- <label>Import with post status</label><span class='mandatory'> *</span></td><td>
78
  <div style='float:left;'>
79
- <select name='importallwithps' id='importallwithps' onChange='selectpoststatus();' >
80
- <option value='0'>Status as in CSV</option>
81
- <option value='1'>Publish</option>
82
- <option value='2'>Sticky</option>
83
- <option value='4'>Private</option>
84
- <option value='3'>Protected</option>
85
- <option value='5'>Draft</option>
86
- <option value='6'>Pending</option>
87
- </select></div>
88
  <div style='float:right;'>
89
- <a href='#' class='tooltip'>
90
- <img src='".WP_CONST_ULTIMATE_CSV_IMP_DIR."images/help.png' />
91
- <span class='tooltipPostStatus'>
92
- <img class='callout' src='".WP_CONST_ULTIMATE_CSV_IMP_DIR."images/callout.gif' />
93
- Select the status for the post imported, if not defined within your csv .E.g.publish
94
- <img src='". WP_CONST_ULTIMATE_CSV_IMP_DIR."images/help.png' style='margin-top: 6px;float:right;' />
95
- </span></a> </div>
96
- </td></tr><tr><td>
97
- <div id='globalpassword_label' class='globalpassword' style='display:none;'><label>Password</label><span class='mandatory'> *</span></div></td><td>
98
- <div id='globalpassword_text' class='globalpassword' style='display:none;'><input type = 'text' id='globalpassword_txt' name='globalpassword_txt' placeholder='Password for all post'></div></td></tr></table>
99
- </div>";
100
- return $importDataConfig;
101
  }
102
 
103
  /**
@@ -146,7 +147,7 @@ class WPImporter_includes_helper {
146
  delete_option('wpcsvfreesettings');
147
  }
148
 
149
- public function output_fd_page()
150
  {
151
  if(!isset($_REQUEST['__module']))
152
  {
@@ -156,7 +157,7 @@ class WPImporter_includes_helper {
156
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'lib/skinnymvc/controller/SkinnyController.php');
157
 
158
  $c = new SkinnyControllerWPCsvFree;
159
- $c->main();
160
  }
161
 
162
  public function getSettings(){
@@ -234,8 +235,8 @@ class WPImporter_includes_helper {
234
  $this->defCols ["CF: " . $val] = $val;
235
  }
236
 
237
-
238
-
239
  }
240
 
241
  /**
@@ -255,7 +256,7 @@ class WPImporter_includes_helper {
255
  $data_rows = array();
256
  $this->delim = $delim;
257
  //print($this->delim);die;
258
- # Check whether file is present in the given file location
259
  $fileexists = file_exists($file);
260
 
261
  if ($fileexists) {
@@ -316,6 +317,28 @@ class WPImporter_includes_helper {
316
  return false;
317
  }
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
 
320
  /**
321
  * function to map the csv file and process it
@@ -329,6 +352,7 @@ class WPImporter_includes_helper {
329
  $smack_taxo = array();
330
  $custom_array = array();
331
  $seo_custom_array= array();
 
332
 
333
  $headr_count = $ret_array['h2'];
334
  for ($i = 0; $i < count($data_rows); $i++) {
@@ -358,130 +382,106 @@ class WPImporter_includes_helper {
358
  }
359
  }
360
  if(is_array( $new_post )){
361
- foreach ($new_post as $ckey => $cval) {
362
- $this->postFlag = true;
363
- $taxo = get_taxonomies();
364
- foreach ($taxo as $taxokey => $taxovalue) {
365
- if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
366
- if ($taxokey == $ckey) {
367
- $smack_taxo [$ckey] = $new_post [$ckey];
 
368
  }
369
  }
370
- }
371
 
372
- $taxo_check = 0;
373
- if (!isset($smack_taxo[$ckey])) {
374
- $smack_taxo [$ckey] = null;
375
- $taxo_check = 1;
376
- }
377
- if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey]) {
378
- if ($taxo_check == 1) {
379
- unset($smack_taxo[$ckey]);
380
- $taxo_check = 0;
381
  }
382
- if (array_key_exists($ckey, $custom_array)) {
383
- $darray [$ckey] = $new_post [$ckey];
384
- } else {
385
- if (array_key_exists($ckey, $smack_taxo)) {
386
- $data_array[$ckey] = null;
387
- } else {
388
- $data_array[$ckey] = $new_post [$ckey];
389
  }
390
- }
391
- } else {
392
- switch ($ckey) {
393
- case 'post_tag' :
394
- $tags [$ckey] = $new_post [$ckey];
395
- break;
396
- case 'post_category' :
397
- $categories [$ckey] = $new_post [$ckey];
398
- break;
399
- case 'featured_image' :
400
- /*
401
- * TODO: Cleanup required
402
- */
403
- $split_filename = explode('/', htmlentities($new_post [$ckey]));
404
- $arr_filename = count($split_filename);
405
- $plain_filename = $split_filename [$arr_filename - 1];
406
- $new_post [$ckey] = str_replace(' ', '%20', $new_post [$ckey]);
407
- $file_url = $filetype [$ckey] = $new_post [$ckey];
408
- $file_type = explode('.', $filetype [$ckey]);
409
- $count = count($file_type);
410
- $type = $file_type [$count - 1];
411
-
412
- if ($type == 'png') {
413
- $file ['post_mime_type'] = 'image/png';
414
- } else if ($type == 'jpg' || $type == 'jpeg') {
415
- $file ['post_mime_type'] = 'image/jpeg';
416
- } else if ($type == 'gif') {
417
- $file ['post_mime_type'] = 'image/gif';
418
- }
419
- $img_name = explode('/', $file_url);
420
- $imgurl_split = count($img_name);
421
- $img_name = explode('.', $img_name [$imgurl_split - 1]);
422
- if (count($img_name) > 2) {
423
- for ($r = 0; $r < (count($img_name) - 1); $r++) {
424
- if ($r == 0)
425
- $img_title = $img_name[$r];
426
- else
427
- $img_title .= '.' . $img_name[$r];
428
- }
429
- } else {
430
- $img_title = $img_name = $img_name [0];
431
- }
432
- $attachmentName = urldecode($img_title) . '.' . $type;
433
- $dir = wp_upload_dir();
434
- $get_media_settings = get_option('uploads_use_yearmonth_folders');
435
- if($get_media_settings == 1){
436
- $dirname = date('Y') . '/' . date('m');
437
- $full_path = $dir ['basedir'] . '/' . $dirname;
438
- $baseurl = $dir ['baseurl'] . '/' . $dirname;
439
- }else{
440
- $full_path = $dir ['basedir'];
441
- $baseurl = $dir ['baseurl'];
442
- }
443
- $filename = explode('/', $file_url);
444
- $file_split = count($filename);
445
- $filepath = $full_path . '/' . urldecode($plain_filename);
446
- $fileurl = $baseurl . '/' . $filename [$file_split - 1];
447
- if (is_dir($full_path)) {
448
- $smack_fileCopy = @copy($file_url, $filepath);
449
  } else {
450
- wp_mkdir_p($full_path);
451
- $smack_fileCopy = @copy($file_url, $filepath);
452
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
 
454
- if(!function_exists('wp_get_current_user')) {
455
- include(ABSPATH . "wp-includes/pluggable.php");
456
- }
457
- $img = wp_get_image_editor($filepath);
458
- if (!is_wp_error($img)) {
459
-
460
- $sizes_array = array(
461
- // #1 - resizes to 1024x768 pixel, square-cropped image
462
- array('width' => 1024, 'height' => 768, 'crop' => true),
463
- // #2 - resizes to 100px max width/height, non-cropped image
464
- array('width' => 100, 'height' => 100, 'crop' => false),
465
- // #3 - resizes to 100 pixel max height, non-cropped image
466
- array('width' => 300, 'height' => 100, 'crop' => false),
467
- // #3 - resizes to 624x468 pixel max width, non-cropped image
468
- array('width' => 624, 'height' => 468, 'crop' => false)
469
- );
470
- $resize = $img->multi_resize($sizes_array);
471
- }
472
- if ($smack_fileCopy) {
473
- $file ['guid'] = $fileurl;
474
- $file ['post_title'] = $img_title;
475
- $file ['post_content'] = '';
476
- $file ['post_status'] = 'attachment';
477
- } else {
478
- $file = false;
479
- }
480
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  }
482
  }
483
  }
484
- }
485
 
486
  if($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter'] != 'custompost'){
487
  $data_array['post_type'] = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter'];
@@ -558,6 +558,9 @@ class WPImporter_includes_helper {
558
 
559
  if ($authorLen == $postAuthorLen) {
560
  $postauthor = $wpdb->get_results("select ID from $wpdb->users where ID = \"{$postuserid}\"");
 
 
 
561
  } else {
562
  $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
563
  }
@@ -573,7 +576,7 @@ class WPImporter_includes_helper {
573
  $data_array ['post_author'] = 1;
574
  $this->noPostAuthCount++;
575
  }
576
-
577
  // Date format post
578
  if (!isset($data_array ['post_date'])){
579
  $data_array ['post_date'] = date('Y-m-d H:i:s');
@@ -588,7 +591,7 @@ class WPImporter_includes_helper {
588
  if($data_array){
589
  if($ret_array['importallwithps'] == 3){
590
  $data_array['post_password'] = $ret_array['globalpassword_txt'];
591
-
592
  }
593
  }
594
  //print('<pre>');print_r($data_array);die;
@@ -598,13 +601,22 @@ class WPImporter_includes_helper {
598
  unset($postauthor);
599
  if ($post_id) {
600
  $uploaded_file_name=$session_arr['uploadedFile'];
601
- $real_file_name = $session_arr['uploaded_csv_name'];
602
- // $version = $session_arr['currentfileversion'];
603
  $action = $data_array['post_type'];
604
- /* $version_arr=array();
605
- $version_arr=explode("(",$uploaded_file_name);
606
- $version_arr=explode(")",$version_arr[1]);
607
- $version=$version_arr[0]; */
 
 
 
 
 
 
 
 
 
608
  $created_records[$action][] = $post_id;
609
  if($action == 'post'){
610
  $imported_as = 'Post';
@@ -626,7 +638,7 @@ class WPImporter_includes_helper {
626
  }
627
  }
628
 
629
-
630
  // Create custom taxonomy to post
631
  if (!empty ($smack_taxo)) {
632
  foreach ($smack_taxo as $taxo_key => $taxo_value) {
@@ -655,23 +667,22 @@ class WPImporter_includes_helper {
655
  }
656
  // Add featured image
657
  if (!empty ($file)) {
658
- $wp_filetype = wp_check_filetype(basename($attachmentName), null);
659
  $wp_upload_dir = wp_upload_dir();
660
  $attachment = array(
661
- 'guid' => $wp_upload_dir['url'] . '/' . basename($attachmentName),
662
- 'post_mime_type' => $wp_filetype['type'],
663
- 'post_title' => preg_replace('/\.[^.]+$/', '', basename($attachmentName)),
664
  'post_content' => '',
665
  'post_status' => 'inherit'
666
  );
667
  if($get_media_settings == 1){
668
- $generate_attachment = $dirname . '/' . $attachmentName;
669
  }else{
670
- $generate_attachment = $attachmentName;
671
  }
672
- $uploadedImage = $wp_upload_dir['path'] . '/' . $attachmentName;
673
  $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
674
- require_once(ABSPATH . 'wp-admin/includes/image.php');
675
  $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
676
  wp_update_attachment_metadata($attach_id, $attach_data);
677
  set_post_thumbnail($post_id, $attach_id);
@@ -681,25 +692,25 @@ class WPImporter_includes_helper {
681
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
682
  }
683
  }
684
- unset($data_array);
685
  }
686
-
687
- /**
688
- * Delete uploaded file after import process
689
- */
690
- function deletefileafterprocesscomplete($uploadDir) {
691
- //array_map('unlink', glob("$uploadDir/*"));
692
  $files = array_diff(scandir($uploadDir), array('.','..'));
693
  foreach ($files as $file) {
694
  (is_dir("$uploadDir/$file")) ? rmdir("$uploadDir/$file") : unlink("$uploadDir/$file");
695
  }
696
- }
697
 
698
- // Function convert string to hash_key
699
- public function convert_string2hash_key($value) {
700
- $file_name = hash_hmac('md5', "$value", 'secret');
701
- return $file_name;
702
- }
703
 
704
  // Function for common footer
705
  public function common_footer_for_other_plugin_promotions(){
@@ -720,7 +731,7 @@ class WPImporter_includes_helper {
720
  <label class="plugintags"><a href="http://www.smackcoders.com/vtiger-quickbooks-integration-module.html" target="_blank">Vtiger QuickBooks</a></label>
721
  <label class="plugintags"><a href="http://www.smackcoders.com/xero-vtiger-integration.html" target="_blank">Vtiger Xero Sync</a></label>
722
  <label class="plugintags"><a href="http://www.smackcoders.com/vtiger-crm-hrm-payroll-modules.html" target="_blank">Vtiger HR and Payroll</a></label>
723
- <label class="plugintags"><a href="http://www.smackcoders.com/hr-payroll.html" target="_blank">HR Payroll</a></label>
724
  <div style="position:relative;float:right;"><a href="http://www.smackcoders.com/"><img width=80 src="http://www.smackcoders.com/skin/frontend/default/megashop/images/logo.png" /></a></div>
725
  </div>';
726
  echo $content;
62
  'post_author' => null,
63
  'featured_image' => null,
64
  'post_parent' => 0,
65
+ 'post_status' => 0,
66
+ 'menu_order' => 0,
67
  );
68
 
69
  // @var array CSV headers
74
  /* getImportDataConfiguration */
75
  public function getImportDataConfiguration(){
76
  $importDataConfig = "<div class='importstatus'id='importallwithps_div'>
77
+ <table><tr><td>
78
+ <label>Import with post status</label><span class='mandatory'> *</span></td><td>
79
  <div style='float:left;'>
80
+ <select name='importallwithps' id='importallwithps' onChange='selectpoststatus();' >
81
+ <option value='0'>Status as in CSV</option>
82
+ <option value='1'>Publish</option>
83
+ <option value='2'>Sticky</option>
84
+ <option value='4'>Private</option>
85
+ <option value='3'>Protected</option>
86
+ <option value='5'>Draft</option>
87
+ <option value='6'>Pending</option>
88
+ </select></div>
89
  <div style='float:right;'>
90
+ <a href='#' class='tooltip'>
91
+ <img src='".WP_CONST_ULTIMATE_CSV_IMP_DIR."images/help.png' />
92
+ <span class='tooltipPostStatus'>
93
+ <img class='callout' src='".WP_CONST_ULTIMATE_CSV_IMP_DIR."images/callout.gif' />
94
+ Select the status for the post imported, if not defined within your csv .E.g.publish
95
+ <img src='". WP_CONST_ULTIMATE_CSV_IMP_DIR."images/help.png' style='margin-top: 6px;float:right;' />
96
+ </span></a> </div>
97
+ </td></tr><tr><td>
98
+ <div id='globalpassword_label' class='globalpassword' style='display:none;'><label>Password</label><span class='mandatory'> *</span></div></td><td>
99
+ <div id='globalpassword_text' class='globalpassword' style='display:none;'><input type = 'text' id='globalpassword_txt' name='globalpassword_txt' placeholder='Password for all post'></div></td></tr></table>
100
+ </div>";
101
+ return $importDataConfig;
102
  }
103
 
104
  /**
147
  delete_option('wpcsvfreesettings');
148
  }
149
 
150
+ public static function output_fd_page()
151
  {
152
  if(!isset($_REQUEST['__module']))
153
  {
157
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'lib/skinnymvc/controller/SkinnyController.php');
158
 
159
  $c = new SkinnyControllerWPCsvFree;
160
+ $c->main();
161
  }
162
 
163
  public function getSettings(){
235
  $this->defCols ["CF: " . $val] = $val;
236
  }
237
 
238
+
239
+
240
  }
241
 
242
  /**
256
  $data_rows = array();
257
  $this->delim = $delim;
258
  //print($this->delim);die;
259
+ # Check whether file is present in the given file location
260
  $fileexists = file_exists($file);
261
 
262
  if ($fileexists) {
317
  return false;
318
  }
319
 
320
+ /**
321
+ * function to fetch the featured image from remote URL
322
+ *
323
+ */
324
+ function get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value){
325
+ if($fimg_path!="" && $fimg_path){
326
+ $fimg_path = $fimg_path . "/" . $post_slug_value . "-" . $fimg_name;
327
+ }
328
+ $ch = curl_init ($f_img);
329
+ curl_setopt($ch, CURLOPT_HEADER, 0);
330
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
331
+ curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
332
+ curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
333
+ $rawdata=curl_exec($ch);
334
+ curl_close ($ch);
335
+ if(file_exists($fimg_path)){
336
+ unlink($fimg_path);
337
+ }
338
+ $fp = fopen($fimg_path,'x');
339
+ fwrite($fp, $rawdata);
340
+ fclose($fp);
341
+ }
342
 
343
  /**
344
  * function to map the csv file and process it
352
  $smack_taxo = array();
353
  $custom_array = array();
354
  $seo_custom_array= array();
355
+ $imported_feature_img = array();
356
 
357
  $headr_count = $ret_array['h2'];
358
  for ($i = 0; $i < count($data_rows); $i++) {
382
  }
383
  }
384
  if(is_array( $new_post )){
385
+ foreach ($new_post as $ckey => $cval) {
386
+ $this->postFlag = true;
387
+ $taxo = get_taxonomies();
388
+ foreach ($taxo as $taxokey => $taxovalue) {
389
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
390
+ if ($taxokey == $ckey) {
391
+ $smack_taxo [$ckey] = $new_post [$ckey];
392
+ }
393
  }
394
  }
 
395
 
396
+ $taxo_check = 0;
397
+ if (!isset($smack_taxo[$ckey])) {
398
+ $smack_taxo [$ckey] = null;
399
+ $taxo_check = 1;
 
 
 
 
 
400
  }
401
+ if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey]) {
402
+ if ($taxo_check == 1) {
403
+ unset($smack_taxo[$ckey]);
404
+ $taxo_check = 0;
 
 
 
405
  }
406
+ if (array_key_exists($ckey, $custom_array)) {
407
+ $darray [$ckey] = $new_post [$ckey];
408
+ } else {
409
+ if (array_key_exists($ckey, $smack_taxo)) {
410
+ $data_array[$ckey] = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  } else {
412
+ $data_array[$ckey] = $new_post [$ckey];
 
413
  }
414
+ }
415
+ } else {
416
+ switch ($ckey) {
417
+ case 'post_tag' :
418
+ $tags [$ckey] = $new_post [$ckey];
419
+ break;
420
+ case 'post_category' :
421
+ $categories [$ckey] = $new_post [$ckey];
422
+ break;
423
+ case 'featured_image' :
424
+ require_once(ABSPATH . "wp-includes/pluggable.php");
425
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
426
+ $dir = wp_upload_dir();
427
+ $get_media_settings = get_option('uploads_use_yearmonth_folders');
428
+ if($get_media_settings == 1){
429
+ $dirname = date('Y') . '/' . date('m');
430
+ $full_path = $dir ['basedir'] . '/' . $dirname;
431
+ $baseurl = $dir ['baseurl'] . '/' . $dirname;
432
+ }else{
433
+ $full_path = $dir ['basedir'];
434
+ $baseurl = $dir ['baseurl'];
435
+ }
436
 
437
+ $f_img = $new_post [$ckey];
438
+ $fimg_path = $full_path;
439
+
440
+ $fimg_name = @basename($f_img);
441
+ $fimg_name = preg_replace("/[^a-zA-Z0-9._\s]/", "", $fimg_name);
442
+ $fimg_name = preg_replace('/\s/', '-', $fimg_name);
443
+ $fimg_name = urlencode($fimg_name);
444
+
445
+ $parseURL = parse_url($f_img);
446
+ $path_parts = pathinfo($f_img);
447
+ if(!isset($path_parts['extension']))
448
+ $fimg_name = $fimg_name . '.jpg';
449
+
450
+ $f_img_slug = preg_replace("/[^a-zA-Z0-9._\s]/", "", $new_post['post_title']);
451
+ $f_img_slug = preg_replace('/\s/', '-', $f_img_slug);
452
+
453
+ $post_slug_value = strtolower($f_img_slug);
454
+ $this->get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value);
455
+ $filepath = $fimg_path."/" . $post_slug_value . "-" . $fimg_name;
456
+
457
+ if(@getimagesize($filepath)){
458
+ $img = wp_get_image_editor($filepath);
459
+ if (!is_wp_error($img)) {
460
+ $sizes_array = array(
461
+ // #1 - resizes to 1024x768 pixel, square-cropped image
462
+ array('width' => 1024, 'height' => 768, 'crop' => true),
463
+ // #2 - resizes to 100px max width/height, non-cropped image
464
+ array('width' => 100, 'height' => 100, 'crop' => false),
465
+ // #3 - resizes to 100 pixel max height, non-cropped image
466
+ array('width' => 300, 'height' => 100, 'crop' => false),
467
+ // #3 - resizes to 624x468 pixel max width, non-cropped image
468
+ array('width' => 624, 'height' => 468, 'crop' => false)
469
+ );
470
+ $resize = $img->multi_resize($sizes_array);
471
+ }
472
+ $file ['guid'] = $baseurl."/".$fimg_name;
473
+ $file ['post_title'] = $fimg_name;
474
+ $file ['post_content'] = '';
475
+ $file ['post_status'] = 'attachment';
476
+ }
477
+ else {
478
+ $file = false;
479
+ }
480
+ break;
481
+ }
482
  }
483
  }
484
  }
 
485
 
486
  if($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter'] != 'custompost'){
487
  $data_array['post_type'] = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter'];
558
 
559
  if ($authorLen == $postAuthorLen) {
560
  $postauthor = $wpdb->get_results("select ID from $wpdb->users where ID = \"{$postuserid}\"");
561
+ if(empty($postauthor) || !$postauthor[0]->ID) { // If user name are numeric Ex: 1300001
562
+ $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
563
+ }
564
  } else {
565
  $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
566
  }
576
  $data_array ['post_author'] = 1;
577
  $this->noPostAuthCount++;
578
  }
579
+
580
  // Date format post
581
  if (!isset($data_array ['post_date'])){
582
  $data_array ['post_date'] = date('Y-m-d H:i:s');
591
  if($data_array){
592
  if($ret_array['importallwithps'] == 3){
593
  $data_array['post_password'] = $ret_array['globalpassword_txt'];
594
+
595
  }
596
  }
597
  //print('<pre>');print_r($data_array);die;
601
  unset($postauthor);
602
  if ($post_id) {
603
  $uploaded_file_name=$session_arr['uploadedFile'];
604
+ $real_file_name = $session_arr['uploaded_csv_name'];
605
+ // $version = $session_arr['currentfileversion'];
606
  $action = $data_array['post_type'];
607
+ /* $version_arr=array();
608
+ $version_arr=explode("(",$uploaded_file_name);
609
+ $version_arr=explode(")",$version_arr[1]);
610
+ $version=$version_arr[0]; */
611
+ $get_imported_feature_image = array();
612
+ $get_imported_feature_image = get_option('IMPORTED_FEATURE_IMAGES');
613
+ if(is_array($get_imported_feature_image)){
614
+ $imported_feature_img = array_merge($get_imported_feature_image, $imported_feature_img);
615
+ }
616
+ else{
617
+ $imported_feature_img = $imported_feature_img;
618
+ }
619
+ update_option('IMPORTED_FEATURE_IMAGES', $imported_feature_img);
620
  $created_records[$action][] = $post_id;
621
  if($action == 'post'){
622
  $imported_as = 'Post';
638
  }
639
  }
640
 
641
+
642
  // Create custom taxonomy to post
643
  if (!empty ($smack_taxo)) {
644
  foreach ($smack_taxo as $taxo_key => $taxo_value) {
667
  }
668
  // Add featured image
669
  if (!empty ($file)) {
670
+ //$wp_filetype = wp_check_filetype(@basename($file ['guid']), null);
671
  $wp_upload_dir = wp_upload_dir();
672
  $attachment = array(
673
+ 'guid' => $file ['guid'],
674
+ 'post_mime_type' => 'image/jpeg',
675
+ 'post_title' => preg_replace('/\.[^.]+$/', '', @basename($file ['guid'])),
676
  'post_content' => '',
677
  'post_status' => 'inherit'
678
  );
679
  if($get_media_settings == 1){
680
+ $generate_attachment = $dirname . '/' . $post_slug_value . '-' . $fimg_name;
681
  }else{
682
+ $generate_attachment = $fimg_name;
683
  }
684
+ $uploadedImage = $wp_upload_dir['path'] . '/' . $post_slug_value . '-' . $fimg_name;
685
  $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
 
686
  $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
687
  wp_update_attachment_metadata($attach_id, $attach_data);
688
  set_post_thumbnail($post_id, $attach_id);
692
  $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS'];
693
  }
694
  }
695
+ unset($data_array);
696
  }
697
+
698
+ /**
699
+ * Delete uploaded file after import process
700
+ */
701
+ function deletefileafterprocesscomplete($uploadDir) {
702
+ //array_map('unlink', glob("$uploadDir/*"));
703
  $files = array_diff(scandir($uploadDir), array('.','..'));
704
  foreach ($files as $file) {
705
  (is_dir("$uploadDir/$file")) ? rmdir("$uploadDir/$file") : unlink("$uploadDir/$file");
706
  }
707
+ }
708
 
709
+ // Function convert string to hash_key
710
+ public function convert_string2hash_key($value) {
711
+ $file_name = hash_hmac('md5', "$value", 'secret');
712
+ return $file_name;
713
+ }
714
 
715
  // Function for common footer
716
  public function common_footer_for_other_plugin_promotions(){
731
  <label class="plugintags"><a href="http://www.smackcoders.com/vtiger-quickbooks-integration-module.html" target="_blank">Vtiger QuickBooks</a></label>
732
  <label class="plugintags"><a href="http://www.smackcoders.com/xero-vtiger-integration.html" target="_blank">Vtiger Xero Sync</a></label>
733
  <label class="plugintags"><a href="http://www.smackcoders.com/vtiger-crm-hrm-payroll-modules.html" target="_blank">Vtiger HR and Payroll</a></label>
734
+ <label class="plugintags"><a href="http://www.smackcoders.com/hr-payroll.html" target="_blank">HR Payroll</a></label>
735
  <div style="position:relative;float:right;"><a href="http://www.smackcoders.com/"><img width=80 src="http://www.smackcoders.com/skin/frontend/default/megashop/images/logo.png" /></a></div>
736
  </div>';
737
  echo $content;
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.5.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
@@ -13,12 +13,10 @@ define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-
13
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
14
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
15
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
16
- define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.5.1');
17
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
18
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path( __FILE__ ));
19
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
20
- /*define('WP_CONST_ULTIMATE_CSV_IMP_MAPPING_TEMPLATE', 'wp_ultimate_csv_importer_mappingtemplate');
21
- define('WP_CONST_ULTIMATE_CSV_IMP_SCHEDULED_IMPORT', 'wp_ultimate_csv_importer_scheduled_import');*/
22
 
23
  //require_once('config/settings.php');
24
 
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.5.2
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
13
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
14
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
15
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
16
+ define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.5.2');
17
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
18
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path( __FILE__ ));
19
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
 
 
20
 
21
  //require_once('config/settings.php');
22
 
js/ultimate-importer-pro.js CHANGED
@@ -502,11 +502,17 @@ function importRecordsbySettings(siteurl)
502
  },
503
  success:function(data) {
504
  if(parseInt(tmpCnt) < parseInt(tot_no_of_records)){
505
- currentlimit = parseInt(currentlimit)+parseInt(importlimit);
506
- document.getElementById('currentlimit').value = currentlimit;
507
- console.log('impLmt: '+importlimit+'totRecds: '+tot_no_of_records);
508
- document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
509
- setTimeout(function(){importRecordsbySettings()},0);
 
 
 
 
 
 
510
  }else{
511
  document.getElementById('ajaxloader').style.display="none";
512
  document.getElementById('startbutton').style.display="none";
@@ -522,6 +528,12 @@ function importRecordsbySettings(siteurl)
522
  });
523
  }
524
 
 
 
 
 
 
 
525
  // Enable/Disable WP-e-Commerce Custom Fields
526
  function enablewpcustomfield(val){
527
  if(val == 'wpcustomfields'){
@@ -656,3 +668,9 @@ function check_allnumeric(inputtxt)
656
  return false;
657
  }
658
  }
 
 
 
 
 
 
502
  },
503
  success:function(data) {
504
  if(parseInt(tmpCnt) < parseInt(tot_no_of_records)){
505
+ var terminate_action = document.getElementById('terminateaction').value;
506
+ if(terminate_action == 'continue'){
507
+ currentlimit = parseInt(currentlimit)+parseInt(importlimit);
508
+ document.getElementById('currentlimit').value = currentlimit;
509
+ console.log('impLmt: '+importlimit+'totRecds: '+tot_no_of_records);
510
+ document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
511
+ setTimeout(function(){importRecordsbySettings()},0);
512
+ } else {
513
+ document.getElementById('log').innerHTML += "Import process has been terminated.</br>";
514
+ return false;
515
+ }
516
  }else{
517
  document.getElementById('ajaxloader').style.display="none";
518
  document.getElementById('startbutton').style.display="none";
528
  });
529
  }
530
 
531
+ // Terminate import process
532
+ function terminateProcess(){
533
+ document.getElementById('terminateaction').value = 'terminate';
534
+ }
535
+
536
+
537
  // Enable/Disable WP-e-Commerce Custom Fields
538
  function enablewpcustomfield(val){
539
  if(val == 'wpcustomfields'){
668
  return false;
669
  }
670
  }
671
+
672
+ function gotoback() {
673
+ var currentURL = document.getElementById('current_url').value;
674
+ var set_assigned_step = currentURL.replace("uploadfile","mapping_settings");
675
+ // window.location.assign(set_assigned_step);
676
+ }
modules/comments/templates/index.php CHANGED
@@ -352,13 +352,15 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
352
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
353
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
354
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
 
355
  </li>
356
  <!-- <li>
357
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
358
  </li>-->
359
  </ul>
360
- <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
361
- <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
 
362
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
363
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
364
  <div class="clear"></div>
352
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
353
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
354
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
355
+ <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
356
  </li>
357
  <!-- <li>
358
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
359
  </li>-->
360
  </ul>
361
+ <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
362
+ <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="" onclick="terminateProcess();" />
363
+ <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();" />
364
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
365
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
366
  <div class="clear"></div>
modules/custompost/templates/index.php CHANGED
@@ -259,7 +259,10 @@ $impCE = new WPImporter_includes_helper();
259
  if ($_REQUEST['__module'] == 'page') {
260
  unset($impCE->defCols['post_category']);
261
  unset($impCE->defCols['post_tag']);
262
- }
 
 
 
263
  ?>
264
  <tr><td class="left_align"> <b>CSV HEADER</b> </td><td> <b>WP FIELDS</b> </td><td> <b>SAMPLE VALUE</b> </td><td></td></tr>
265
  <?php
@@ -421,13 +424,15 @@ $impCE = new WPImporter_includes_helper();
421
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
422
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
423
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
 
424
  </li>
425
  <!--<li>
426
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
427
  </li>-->
428
  </ul>
429
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
430
- <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
 
431
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
432
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
433
  <div class="clear"></div>
259
  if ($_REQUEST['__module'] == 'page') {
260
  unset($impCE->defCols['post_category']);
261
  unset($impCE->defCols['post_tag']);
262
+ }
263
+ if ($_REQUEST['__module'] != 'page') {
264
+ unset($impCE->defCols['menu_order']);
265
+ }
266
  ?>
267
  <tr><td class="left_align"> <b>CSV HEADER</b> </td><td> <b>WP FIELDS</b> </td><td> <b>SAMPLE VALUE</b> </td><td></td></tr>
268
  <?php
424
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
425
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
426
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
427
+ <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
428
  </li>
429
  <!--<li>
430
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
431
  </li>-->
432
  </ul>
433
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
434
+ <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="" onclick="terminateProcess();" />
435
+ <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();" />
436
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
437
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
438
  <div class="clear"></div>
modules/page/templates/index.php CHANGED
@@ -398,12 +398,14 @@ $impCE = new WPImporter_includes_helper();
398
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
399
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
400
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
 
401
  </li>
402
  <!--<li>
403
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
404
  </li>-->
405
  </ul>
406
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
 
407
  <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
408
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
409
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
398
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
399
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
400
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
401
+ <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
402
  </li>
403
  <!--<li>
404
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
405
  </li>-->
406
  </ul>
407
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
408
+ <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="" onclick="terminateProcess();" />
409
  <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
410
  <!-- <input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
411
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
modules/post/templates/index.php CHANGED
@@ -193,6 +193,7 @@ $impCE = new WPImporter_includes_helper();
193
  if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
194
  $uploaded_csv_name = $_POST['upload_csv_realname'];
195
  }
 
196
  $getrecords = $impCE->csv_file_data($filename,$delimeter);
197
  $getcustomposts=get_post_types();
198
  foreach($getcustomposts as $keys => $value)
@@ -238,6 +239,9 @@ $impCE = new WPImporter_includes_helper();
238
  unset($impCE->defCols['post_category']);
239
  unset($impCE->defCols['post_tag']);
240
  }
 
 
 
241
  ?>
242
  <tr><td class="left_align"> <b>CSV HEADER</b> </td><td> <b>WP FIELDS</b> </td><td> <b>SAMPLE VALUE</b> </td><td></td></tr>
243
  <?php
@@ -400,13 +404,16 @@ $impCE = new WPImporter_includes_helper();
400
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
401
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
402
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
 
403
  </li>
404
  <!-- <li>
405
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
406
  </li>-->
407
  </ul>
 
408
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
409
- <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
 
410
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
411
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
412
  <div class="clear"></div>
193
  if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
194
  $uploaded_csv_name = $_POST['upload_csv_realname'];
195
  }
196
+
197
  $getrecords = $impCE->csv_file_data($filename,$delimeter);
198
  $getcustomposts=get_post_types();
199
  foreach($getcustomposts as $keys => $value)
239
  unset($impCE->defCols['post_category']);
240
  unset($impCE->defCols['post_tag']);
241
  }
242
+ if ($_REQUEST['__module'] != 'page') {
243
+ unset($impCE->defCols['menu_order']);
244
+ }
245
  ?>
246
  <tr><td class="left_align"> <b>CSV HEADER</b> </td><td> <b>WP FIELDS</b> </td><td> <b>SAMPLE VALUE</b> </td><td></td></tr>
247
  <?php
404
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
405
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
406
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
407
+ <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
408
  </li>
409
  <!-- <li>
410
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
411
  </li>-->
412
  </ul>
413
+ <!-- <input id="goto_back" name="goto_back" class="btn btn-warning" type="button" value="<< Back" onclick="gotoback();" /> -->
414
  <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
415
+ <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="" onclick="terminateProcess();" />
416
+ <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();" />
417
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
418
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
419
  <div class="clear"></div>
modules/users/templates/index.php CHANGED
@@ -351,13 +351,15 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
351
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
352
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
353
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
 
354
  </li>
355
  <!-- <li>
356
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
357
  </li>-->
358
  </ul>
359
- <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" >
360
- <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();">
 
361
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
362
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
363
  <div class="clear"></div>
351
  <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
352
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
353
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
354
+ <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
355
  </li>
356
  <!-- <li>
357
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
358
  </li>-->
359
  </ul>
360
+ <input id="startbutton" class="btn btn-primary" type="button" value="Import Now" style="color: #ffffff;background:#2E9AFE;" onclick="importRecordsbySettings();" />
361
+ <input id="terminatenow" class="btn btn-danger btn-sm" type="button" value="Terminate Now" style="" onclick="terminateProcess();" />
362
+ <input class="btn btn-warning" type="button" value="Import Again" id="importagain" style="display:none" onclick="import_again();" />
363
  <!--<input id="continuebutton" class="button" type="button" value="Continue old search" style="color: #ffffff;background:#2E9AFE;">-->
364
  <div id="ajaxloader" style="display:none"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>images/ajax-loader.gif"> Processing...</div>
365
  <div class="clear"></div>