Ultimate CSV Importer - Version 5.0.3

Version Description

Download this release

Release Info

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

Code changes from version 5.0.2 to 5.0.3

Readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.me/smackcoders
4
  Tags: csv importer, import csv, import woocommerce, import marketpress, import seo by yoast, import all in one seo, scheduled import, import remote file, export woocommerce, import types fields, import acf fields, import inline images
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 5.0.2
8
- Version: 5.0.2
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
@@ -106,6 +106,11 @@ This will solve your issue or get support from hosting if you didn’t have suff
106
  For more FAQ, you can refer [here](https://goo.gl/eH7BHT).
107
 
108
  == Changelog ==
 
 
 
 
 
109
  = 5.0.2 =
110
  * Added: Compatibility from PHP 5.3.
111
  = 5.0.1 =
@@ -399,6 +404,8 @@ For more FAQ, you can refer [here](https://goo.gl/eH7BHT).
399
  * Initial release version. Tested and found works well without any issues.
400
 
401
  == Upgrade Notice ==
 
 
402
  = 5.0.2 =
403
  * Upgrade now to get the fix for PHP 5.3 compatibility.
404
  = 5.0.1 =
4
  Tags: csv importer, import csv, import woocommerce, import marketpress, import seo by yoast, import all in one seo, scheduled import, import remote file, export woocommerce, import types fields, import acf fields, import inline images
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 5.0.3
8
+ Version: 5.0.3
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
106
  For more FAQ, you can refer [here](https://goo.gl/eH7BHT).
107
 
108
  == Changelog ==
109
+ = 5.0.3 =
110
+ * Added: Support for traditional Chinese characters.
111
+ * Fixed: Author/Editor menu visibility issue
112
+ * Fixed: [Assigning categories to post issue](https://wordpress.org/support/topic/ultimate-csv-importer-v5-adds-all-posts-to-uncategorized/)
113
+ * Fixed: [Import with Chinese character](https://wordpress.org/support/topic/unable-to-import-posts-with-chinese-characters/)
114
  = 5.0.2 =
115
  * Added: Compatibility from PHP 5.3.
116
  = 5.0.1 =
404
  * Initial release version. Tested and found works well without any issues.
405
 
406
  == Upgrade Notice ==
407
+ = 5.0.3 =
408
+ * Upgrade now for Chinese character support and a fix for category import.
409
  = 5.0.2 =
410
  * Upgrade now to get the fix for PHP 5.3 compatibility.
411
  = 5.0.1 =
admin/class-uci-admin.php CHANGED
@@ -48,12 +48,12 @@ class SmackUCIAdmin extends SmackUCIHelper {
48
 
49
  public static function show_admin_menus() {
50
  $is_author_can_import = get_option('sm_uci_pro_settings', null);
51
- $is_author_can_import = isset($is_author_can_import['enable_plugin_access_for_author'])?$is_author_can_import['enable_plugin_access_for_author']:'';
52
- if ( apply_filters( 'sm_uci_enable_setup_wizard', true ) && is_user_logged_in() && current_user_can( 'administrator' ) || current_user_can( 'author') || current_user_can('editor') ) {
53
  add_action( 'admin_menu', array( __CLASS__, 'admin_menus' ) );
54
  }
55
- if ( is_user_logged_in() && ( current_user_can( 'author') || current_user_can('editor') ) && $is_author_can_import == 'enable' ) {
56
- add_action( 'admin_menu', array( __CLASS__, 'admin_menus' ) );
57
  }
58
  }
59
 
@@ -62,13 +62,24 @@ class SmackUCIAdmin extends SmackUCIHelper {
62
  */
63
  public static function admin_menus() {
64
  global $submenu;
65
- add_menu_page(SM_UCI_SETTINGS, SM_UCI_NAME, 'manage_sm_uci_pro', SM_UCI_SLUG, array(__CLASS__, 'sm_uci_screens'),plugins_url("assets/images/faviconWT16.png",dirname(__FILE__)));
66
- add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Dashboard', 'manage_sm_uci_pro', 'sm-uci-dashboard', array(__CLASS__, 'sm_uci_screens'));
67
- add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Import / Update', 'manage_sm_uci_pro', 'sm-uci-import', array(__CLASS__, 'sm_uci_screens'));
68
- add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Managers', 'manage_sm_uci_pro', 'sm-uci-managers', array(__CLASS__, 'sm_uci_screens'));
69
- add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Export', 'manage_sm_uci_pro', 'sm-uci-export', array(__CLASS__, 'sm_uci_screens'));
70
  add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Settings', 'manage_sm_uci_settings', 'sm-uci-settings', array(__CLASS__, 'sm_uci_screens'));
71
- add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Support', 'manage_sm_uci_pro', 'sm-uci-support', array(__CLASS__, 'sm_uci_screens'));
 
 
 
 
 
 
 
 
 
 
 
72
  unset($submenu[SM_UCI_SLUG][0]);
73
  }
74
 
48
 
49
  public static function show_admin_menus() {
50
  $is_author_can_import = get_option('sm_uci_pro_settings', null);
51
+ $is_author_can_import = isset($is_author_can_import['author_editor_access']) ? $is_author_can_import['author_editor_access'] : '';
52
+ if ( apply_filters( 'sm_uci_enable_setup_wizard', true ) && is_user_logged_in() && current_user_can( 'administrator' ) ) {
53
  add_action( 'admin_menu', array( __CLASS__, 'admin_menus' ) );
54
  }
55
+ if ( is_user_logged_in() && ( current_user_can( 'author') || current_user_can('editor') ) && $is_author_can_import == 'on' ) {
56
+ add_action( 'admin_menu', array( __CLASS__, 'admin_menus_for_other_roles' ) );
57
  }
58
  }
59
 
62
  */
63
  public static function admin_menus() {
64
  global $submenu;
65
+ add_menu_page(SM_UCI_SETTINGS, SM_UCI_NAME, 'manage_options', SM_UCI_SLUG, array(__CLASS__, 'sm_uci_screens'),plugins_url("assets/images/faviconWT16.png",dirname(__FILE__)));
66
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Dashboard', 'manage_options', 'sm-uci-dashboard', array(__CLASS__, 'sm_uci_screens'));
67
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Import / Update', 'manage_options', 'sm-uci-import', array(__CLASS__, 'sm_uci_screens'));
68
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Managers', 'manage_options', 'sm-uci-managers', array(__CLASS__, 'sm_uci_screens'));
69
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Export', 'manage_options', 'sm-uci-export', array(__CLASS__, 'sm_uci_screens'));
70
  add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Settings', 'manage_sm_uci_settings', 'sm-uci-settings', array(__CLASS__, 'sm_uci_screens'));
71
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Support', 'manage_options', 'sm-uci-support', array(__CLASS__, 'sm_uci_screens'));
72
+ unset($submenu[SM_UCI_SLUG][0]);
73
+ }
74
+
75
+ public static function admin_menus_for_other_roles() {
76
+ global $submenu;
77
+ add_menu_page(SM_UCI_SETTINGS, SM_UCI_NAME, '2', SM_UCI_SLUG, array(__CLASS__, 'sm_uci_screens'),plugins_url("assets/images/faviconWT16.png",dirname(__FILE__)));
78
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Dashboard', '2', 'sm-uci-dashboard', array(__CLASS__, 'sm_uci_screens'));
79
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Import / Update', '2', 'sm-uci-import', array(__CLASS__, 'sm_uci_screens'));
80
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Managers', '2', 'sm-uci-managers', array(__CLASS__, 'sm_uci_screens'));
81
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Export', '2', 'sm-uci-export', array(__CLASS__, 'sm_uci_screens'));
82
+ add_submenu_page(SM_UCI_SLUG, SM_UCI_NAME, 'Support', '2', 'sm-uci-support', array(__CLASS__, 'sm_uci_screens'));
83
  unset($submenu[SM_UCI_SLUG][0]);
84
  }
85
 
admin/views/form-settings-view.php CHANGED
@@ -101,18 +101,20 @@ if(!empty($woocomattr)){
101
  $data['wooon_status'] = '';
102
  $data['woooff_status'] = 'checked';
103
  }
104
-
105
- }if(!empty($author_editor_access)){
106
  if($author_editor_access == 'on'){
107
  $data['access_on'] = 'enablesetting';
108
  $data['access_off'] = 'disablesetting';
109
  $data['accesson_status'] = 'checked';
110
  $data['accessoff_status'] = '';
 
111
  }else{
112
  $data['access_off'] = 'enablesetting';
113
  $data['access_on'] = 'disablesetting';
114
  $data['accesson_status'] = '';
115
  $data['accessoff_status'] = 'checked';
 
116
  }
117
  }
118
  //database optimization
@@ -285,8 +287,16 @@ if(isset($ucioptimize['delete_all_trackback_comments'])) {
285
  <p><?php echo esc_html_e('This enables authors/editors to import.','wp-ultimate-csv-importer'); ?></p>
286
  </td>
287
  <td id='divtd'>
288
- <label id="allowimport" class="<?php echo $data['access_on']; ?>" ><input type='radio' name='author_editor_access' id="enableimport" class="importauthor noicheck" value='on' <?php echo $data['accesson_status']; ?> style="display:none" onclick="saveoptions(this.id, this.name);" /><?php echo esc_html_e('Enable','wp-ultimate-csv-importer'); ?></label>
289
- <label id="notallowimport" class="<?php echo $data['access_off']; ?>" > <input type='radio' name='author_editor_access' id="disableimport" class="importauthor noicheck" value='off' <?php echo $data['accessoff_status']; ?> style="display:none" onclick="saveoptions(this.id, this.name);" ><?php echo esc_html_e('Disable','wp-ultimate-csv-importer'); ?></label>
 
 
 
 
 
 
 
 
290
  </td>
291
  </tr>
292
  </table>
101
  $data['wooon_status'] = '';
102
  $data['woooff_status'] = 'checked';
103
  }
104
+ }
105
+ if(!empty($author_editor_access)){
106
  if($author_editor_access == 'on'){
107
  $data['access_on'] = 'enablesetting';
108
  $data['access_off'] = 'disablesetting';
109
  $data['accesson_status'] = 'checked';
110
  $data['accessoff_status'] = '';
111
+ $author_editor_access = "checked='checked'";
112
  }else{
113
  $data['access_off'] = 'enablesetting';
114
  $data['access_on'] = 'disablesetting';
115
  $data['accesson_status'] = '';
116
  $data['accessoff_status'] = 'checked';
117
+ $author_editor_access = "";
118
  }
119
  }
120
  //database optimization
287
  <p><?php echo esc_html_e('This enables authors/editors to import.','wp-ultimate-csv-importer'); ?></p>
288
  </td>
289
  <td id='divtd'>
290
+ <div class="col-xs-12 col-sm-4 col-md-8 mb15">
291
+ <div class="mt20">
292
+ <!-- Scheduled log button -->
293
+
294
+ <input id="author_editor_access" type='checkbox' class="tgl tgl-skewed noicheck" name='author_editor_access' <?php echo $author_editor_access; ?> style="display:none" onclick="saveoptions(this.id, this.name);" />
295
+ <label data-tg-off="NO" data-tg-on="YES" for="author_editor_access" id="enableimport" class="tgl-btn" style="font-size: 16px;" >
296
+ </label>
297
+ <!-- Scheduled log btn End -->
298
+ </div>
299
+ </div>
300
  </td>
301
  </tr>
302
  </table>
admin/views/form-support-view.php CHANGED
@@ -35,15 +35,15 @@
35
  * "Copyright Smackcoders. 2016. All rights reserved".
36
  ********************************************************************************/
37
  if ( ! defined( 'ABSPATH' ) )
38
- exit; // Exit if accessed directly
39
  ?>
40
 
41
  <div class="list-inline pull-right mb10 wp_ultimate_csv_importer_pro">
42
- <div class="col-md-6 mt10"><a href="https://goo.gl/jdPMW8" target="_blank">Documentation</a></div>
43
- <div class="col-md-6 mt10"><a href="https://goo.gl/fKvDxH" target="_blank">Sample CSV</a></div>
44
- </div>
45
  <div class="wp_ultimate_csv_importer_pro panel col-md-12" style="font-size:14px; height: 650px;width:99%;">
46
- <div class="col-md-10" style="text-align:center;width:99%;font-size:15px;margin-top:20px;">If you love WP Ultimate CSV Importer show us you care with a 5-star review on <a style="font-size:15px;" target="_blank" href ="https://wordpress.org/support/plugin/wp-ultimate-csv-importer/reviews/?rate=5#new-post">wordpress.org!</a></div>
47
  <div class="col-md-12">
48
  <div class="col-md-6 col-sm-6 mt40 mb40" style="">
49
  <fieldset class="scheduler-border"> <legend class="scheduler-border" style="margin-top:15px;">Enquiry form</legend>
@@ -63,9 +63,9 @@ if ( ! defined( 'ABSPATH' ) )
63
  <label for="comment">Message</label>
64
  <textarea class="form-control" style="height:200px;" rows="5" name="message" id="message"></textarea>
65
  </div>
66
- <div id="loading" style="opacity:0.7;background-color: #fff;z-index: 99;text-align: center;">
67
- <img class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10" id="loading-image" src="<?php echo plugins_url().'/'.SM_UCI_SLUG ;?>/assets/images/loading.gif" width="24" height="24" alt="Loading" style="display:none;margin-left:300px;" />
68
- </div>
69
 
70
  <div class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10">
71
  <input name="" id="send" class="smack-btn smack-btn-primary btn-radius" value="Send" onclick="send_support_email();" type="button" style="margin-top:5px;">
@@ -77,19 +77,23 @@ if ( ! defined( 'ABSPATH' ) )
77
  <fieldset class="scheduler-border"> <legend class="scheduler-border" style="margin-top:20px;">News Letter Subscription</legend>
78
  <div class="form-group">
79
  <label>Email</label>
80
- <input name="subscribe_email" id="subscribe_email" class="form-control" value="" type="text">
81
- </div>
82
- <div id="loading" style="opacity:0.7;background-color: #fff;z-index: 99;text-align: center;">
83
- <img class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10" id="loading-img-subs" src="<?php echo plugins_url().'/'.SM_UCI_SLUG ;?>/assets/images/loading.gif" width="24" height="24" alt="Loading" style="display:none;margin-left:300px;" />
84
- </div>
85
  <div class="col-md-12">
86
- <div class="col-md-offset-9 col-sm-offset-7 col-xs-offset-2 mb10">
87
- <input name="" id="" class="smack-btn smack-btn-primary btn-radius" value="Subscribe" onclick="send_subscribe_email();" type="button">
88
- </div>
89
  </div>
90
  </fieldset>
91
  </div>
 
 
 
 
 
92
  </div>
93
  </div>
94
-
95
-
35
  * "Copyright Smackcoders. 2016. All rights reserved".
36
  ********************************************************************************/
37
  if ( ! defined( 'ABSPATH' ) )
38
+ exit; // Exit if accessed directly
39
  ?>
40
 
41
  <div class="list-inline pull-right mb10 wp_ultimate_csv_importer_pro">
42
+ <div class="col-md-6 mt10"><a href="https://goo.gl/jdPMW8" target="_blank">Documentation</a></div>
43
+ <div class="col-md-6 mt10"><a href="https://goo.gl/fKvDxH" target="_blank">Sample CSV</a></div>
44
+ </div>
45
  <div class="wp_ultimate_csv_importer_pro panel col-md-12" style="font-size:14px; height: 650px;width:99%;">
46
+ <div class="col-md-10" style="text-align:center;width:99%;font-size:15px;margin-top:20px;">If you love WP Ultimate CSV Importer show us your care with a 5-star review on <a style="font-size:15px;" target="_blank" href ="https://wordpress.org/support/plugin/wp-ultimate-csv-importer/reviews/?rate=5#new-post">wordpress.org!</a></div>
47
  <div class="col-md-12">
48
  <div class="col-md-6 col-sm-6 mt40 mb40" style="">
49
  <fieldset class="scheduler-border"> <legend class="scheduler-border" style="margin-top:15px;">Enquiry form</legend>
63
  <label for="comment">Message</label>
64
  <textarea class="form-control" style="height:200px;" rows="5" name="message" id="message"></textarea>
65
  </div>
66
+ <div id="loading" style="opacity:0.7;background-color: #fff;z-index: 99;text-align: center;">
67
+ <img class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10" id="loading-image" src="<?php echo plugins_url().'/'.SM_UCI_SLUG ;?>/assets/images/loading.gif" width="24" height="24" alt="Loading" style="display: none;margin-left: 110px;position: absolute;margin-top: 14px;" />
68
+ </div>
69
 
70
  <div class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10">
71
  <input name="" id="send" class="smack-btn smack-btn-primary btn-radius" value="Send" onclick="send_support_email();" type="button" style="margin-top:5px;">
77
  <fieldset class="scheduler-border"> <legend class="scheduler-border" style="margin-top:20px;">News Letter Subscription</legend>
78
  <div class="form-group">
79
  <label>Email</label>
80
+ <input name="subscribe_email" id="subscribe_email" class="form-control" value="" type="text">
81
+ </div>
82
+ <div id="loading" style="opacity:0.7;background-color: #fff;z-index: 99;text-align: center;">
83
+ <img class="col-md-offset-10 col-sm-offset-9 col-xs-offset-4 mb10" id="loading-img-subs" src="<?php echo plugins_url().'/'.SM_UCI_SLUG ;?>/assets/images/loading.gif" width="24" height="24" alt="Loading" style="display: none;margin-left: 65px;position: absolute;margin-top: 9px;" />
84
+ </div>
85
  <div class="col-md-12">
86
+ <div class="col-md-offset-9 col-sm-offset-7 col-xs-offset-2 mb10">
87
+ <input name="" id="" class="smack-btn smack-btn-primary btn-radius" value="Subscribe" onclick="send_subscribe_email();" type="button">
88
+ </div>
89
  </div>
90
  </fieldset>
91
  </div>
92
+ <div style="font-size:15px;" class="col-md-6 col-sm-6 mt40 mb40">
93
+ <div><b>Note</b></div>
94
+ <div class="mt20"><i class="icon-news-paper" style="color:#178D7C;"></i>&nbsp; Subscribe to Smackcoders Mailing list (a few messages a year)</div>
95
+ <div class="mt20"><i class="icon-mail" style="color:#178D7C;"></i>&nbsp;Please draft a mail to support@smackcoders.com. If you doesn't get any acknowledgement within an hour!</div>
96
+ </div>
97
  </div>
98
  </div>
99
+ </div>
 
assets/js/ultimate-importer.js CHANGED
@@ -1865,9 +1865,17 @@ jQuery(function () {
1865
  function send_support_email() {
1866
  document.getElementById('loading-image').style.display = "block";
1867
  var email = document.getElementById('email').value;
 
 
 
 
1868
  var query = document.getElementById('query').value;
1869
  var message = document.getElementById('message').value;
1870
- jQuery.ajax({
 
 
 
 
1871
  url: ajaxurl,
1872
  type: 'post',
1873
  data: {
@@ -1877,8 +1885,12 @@ function send_support_email() {
1877
  'message': message
1878
  },
1879
  success: function (response) {
1880
- document.getElementById('loading-image').style.display = "none";
1881
- swal('Success!', 'Thanks for submitting the query.', 'success')
 
 
 
 
1882
  }
1883
  });
1884
 
@@ -1887,6 +1899,10 @@ function send_support_email() {
1887
  function send_subscribe_email() {
1888
  document.getElementById('loading-img-subs').style.display = "block";
1889
  var email = document.getElementById('subscribe_email').value;
 
 
 
 
1890
  jQuery.ajax({
1891
  url: ajaxurl,
1892
  type: 'post',
@@ -1896,7 +1912,11 @@ function send_subscribe_email() {
1896
  },
1897
  success: function (response) {
1898
  document.getElementById('loading-img-subs').style.display = "none";
1899
- swal('Success!', 'Thanks for submitting.', 'success')
 
 
 
 
1900
  }
1901
  });
1902
  }
1865
  function send_support_email() {
1866
  document.getElementById('loading-image').style.display = "block";
1867
  var email = document.getElementById('email').value;
1868
+ if(email == '') {
1869
+ swal('Warning!', 'Please Enter your email' , 'warning')
1870
+ document.getElementById('loading-image').style.display = "none";
1871
+ return false; }
1872
  var query = document.getElementById('query').value;
1873
  var message = document.getElementById('message').value;
1874
+ if(message == '') {
1875
+ swal('Warning!', 'Please Enter your query', 'warning')
1876
+ document.getElementById('loading-image').style.display = "none";
1877
+ return false; }
1878
+ jQuery.ajax({
1879
  url: ajaxurl,
1880
  type: 'post',
1881
  data: {
1885
  'message': message
1886
  },
1887
  success: function (response) {
1888
+ document.getElementById('loading-image').style.display = "none";
1889
+ if(response == "Please draft a mail to support@smackcoders.com. If you doesn't get any acknowledgement within an hour!") {
1890
+ swal('Warning!', response, 'warning')
1891
+ } else {
1892
+ swal('Success!', 'Thanks for submitting the query.', 'success')
1893
+ }
1894
  }
1895
  });
1896
 
1899
  function send_subscribe_email() {
1900
  document.getElementById('loading-img-subs').style.display = "block";
1901
  var email = document.getElementById('subscribe_email').value;
1902
+ if(email == '') {
1903
+ swal('Warning!', 'Please Enter your email', 'warning')
1904
+ document.getElementById('loading-img-subs').style.display = "none";
1905
+ return false; }
1906
  jQuery.ajax({
1907
  url: ajaxurl,
1908
  type: 'post',
1912
  },
1913
  success: function (response) {
1914
  document.getElementById('loading-img-subs').style.display = "none";
1915
+ if(response == "Please draft a mail to support@smackcoders.com. If you doesn't get any acknowledgement within an hour!") {
1916
+ swal('Warning!', response, 'warning')
1917
+ } else {
1918
+ swal('Success!', 'Thanks for Subscribing.', 'success')
1919
+ }
1920
  }
1921
  });
1922
  }
includes/class-uci-admin-ajax.php CHANGED
@@ -797,35 +797,49 @@ class SmackUCIAdminAjax {
797
  }
798
 
799
  public static function sendmail(){
800
- if($_POST){
801
- $email = $_POST['email'];
802
- $query = $_POST['query'];
803
- $message = $_POST['message'];
804
- $url = get_option('siteurl');
805
- $sitename = get_option('blogname');
806
- $headers = "From: ".$sitename ."<$email>";
807
- $to = 'support@smackcoders.com';
808
- $subject = $query;
809
- $message = " Site URL: " .$url. "\n Message: ".$message;
810
- //send email
811
- mail($to, $subject, $message , $headers); //This method sends the mail.
812
- }
813
- }
814
-
815
- public static function send_subscribe_email(){
816
- if($_POST){
817
- $email = $_POST['subscribe_email'];
818
- $message = 'Hi Team: I want to subscribe to your newsletter.';
819
- $url = get_option('siteurl');
820
- $sitename = get_option('blogname');
821
- $headers = "From: ".$sitename ."<$email>";
822
- $to = 'support@smackcoders.com';
823
- $subject = 'Newsletter Subscription';
824
- $message = " Site URL: " .$url. "\n Message: ".$message;
825
- //send email
826
- mail($to, $subject, $message, $headers); //This method sends the mail.
827
- }
828
- }
829
-
830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  }
797
  }
798
 
799
  public static function sendmail(){
800
+ if($_POST){
801
+ $email = $_POST['email'];
802
+ $url = get_option('siteurl');
803
+ $site_name = get_option('blogname');
804
+ $headers = "From: " . $site_name . "<$email>" . "\r\n";
805
+ $headers.= 'MIME-Version: 1.0' . "\r\n";
806
+ $headers.= "Content-type: text/html; charset=iso-8859-1 \r\n";
807
+ $to = 'support@smackcoders.com';
808
+ $subject = $_POST['query'];
809
+ $message = "Site URL: " . $url . "\r\n";
810
+ $message .= "Plugin Name: " . SM_UCI_SETTINGS . "\r\n";
811
+ $message .= "Message: " . $_POST['message'] . "\r\n";
812
+ //send email
813
+ if(wp_mail($to, $subject, $message, $headers)) {
814
+ echo 'Mail Sent!';
815
+ } else {
816
+ echo "Please draft a mail to support@smackcoders.com. If you doesn't get any acknowledgement within an hour!";
817
+ } //This method sends the mail.
818
+ die;
819
+ }
820
+ }
 
 
 
 
 
 
 
 
 
821
 
822
+ public static function send_subscribe_email(){
823
+ if($_POST){
824
+ $email = $_POST['subscribe_email'];
825
+ $url = get_option('siteurl');
826
+ $site_name = get_option('blogname');
827
+ $headers = "From: " . $site_name . "<$email>" . "\r\n";
828
+ $headers.= 'MIME-Version: 1.0' . "\r\n";
829
+ $headers.= "Content-type: text/html; charset=iso-8859-1 \r\n";
830
+ $to = 'support@smackcoders.com';
831
+ $subject = 'Newsletter Subscription';
832
+ $message = "Site URL: " . $url . "\r\n";
833
+ $message .= "Plugin Name: " . SM_UCI_SETTINGS . "\r\n";
834
+ $message .= "Message: Hi Team, I want to subscribe to your newsletter." . "\r\n";
835
+ //send email
836
+ if(wp_mail($to, $subject, $message, $headers)) {
837
+ echo 'Mail Sent!';
838
+ } else {
839
+ echo "Please draft a mail to support@smackcoders.com. If you doesn't get any acknowledgement within an hour!";
840
+ } //This method sends the mail.
841
+ die;
842
+ }
843
+ }
844
+
845
  }
includes/class-uci-aioseo-data-import.php CHANGED
@@ -44,7 +44,7 @@ class SmackUCIAIOSEODataImport {
44
  global $uci_admin;
45
  $aioseodata = $uci_admin->getRowMapping();
46
  $data_array = $aioseodata['AIOSEO'];
47
- if( !empty($uci_admin->getRowMapping())) {
48
  if(in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', $uci_admin->get_active_plugins())) {
49
  $this->importDataForAIOSEOFields( $data_array, $uci_admin->getImportAs(), $uci_admin->getLastImportId());
50
  }
44
  global $uci_admin;
45
  $aioseodata = $uci_admin->getRowMapping();
46
  $data_array = $aioseodata['AIOSEO'];
47
+ if( !empty($aioseodata)) {
48
  if(in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', $uci_admin->get_active_plugins())) {
49
  $this->importDataForAIOSEOFields( $data_array, $uci_admin->getImportAs(), $uci_admin->getLastImportId());
50
  }
includes/class-uci-helper.php CHANGED
@@ -146,7 +146,10 @@ class SmackUCIHelper {
146
  }
147
 
148
  public function getActivePlugins() {
149
- return $this->event_information['active_plugins'];
 
 
 
150
  }
151
 
152
  public function getLastImportId() {
@@ -1996,9 +1999,8 @@ class SmackUCIHelper {
1996
  if (!empty($post_format)) {
1997
  wp_set_object_terms($retID, $post_format, 'post_format');
1998
  }
1999
- $media_handle = array();
2000
- $shortcodes = '';
2001
- $media_handle = isset($duplicateHandling['media_handling']) ? $duplicateHandling['media_handling'] : '';
2002
 
2003
  #TODO: Need to import the media for scheduler
2004
  /* Set Featured Image */
@@ -2217,6 +2219,19 @@ class SmackUCIHelper {
2217
  // Create / Assign categories to the post types
2218
  if(isset($categories[$termKey]) && $categories[$termKey] != '')
2219
  $this->assignTermsAndTaxonomies($categories, $category_name, $pID);
 
 
 
 
 
 
 
 
 
 
 
 
 
2220
  break;
2221
  case 'post_tag' :
2222
  $tags [$termKey] = $data_array [$termKey];
@@ -2952,26 +2967,25 @@ class SmackUCIHelper {
2952
  return $allData;
2953
  }
2954
 
2955
- public function convert_local_image_src($dom_document,$post_id,$media_handle) {
2956
- ob_get_clean();
2957
- $doc = new DOMDocument();
2958
- @$doc->loadHTML($dom_document);
2959
- $xpath = new DOMXPath($doc);
2960
- $images = $xpath->evaluate("//img");
2961
- $update_content = array();
2962
- foreach ($images as $image) {
2963
- $src = utf8_decode($image->getAttribute('src'));
2964
- $src = htmlentities($src, ENT_QUOTES | ENT_IGNORE, "UTF-8");
2965
- $src = str_replace('&rdquo;','',$src);
2966
- $src = str_replace('&ldquo;','',$src);
2967
- $attachid = $this->set_featureimage($src,$post_id,$media_handle);
2968
- $new_src_url = wp_get_attachment_url($attachid);
2969
- $image->setAttribute( 'src' , $new_src_url);
2970
- }
2971
- $post_content = $doc->saveHTML();
2972
- $update_content['ID'] = $post_id;
2973
- $update_content['post_content'] = $post_content;
2974
- wp_update_post($update_content);
2975
  }
2976
 
2977
  /**
@@ -3110,11 +3124,12 @@ class SmackUCIHelper {
3110
  curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
3111
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
3112
  $rawdata = curl_exec($ch);
3113
- if(strpos($rawdata, 'Not Found') != 0) {
 
3114
  $rawdata = false;
3115
  }
3116
  if ($rawdata == false) {
3117
- return false;
3118
  } else {
3119
  if (file_exists($uploaddir_path)) {
3120
  unlink($uploaddir_path);
146
  }
147
 
148
  public function getActivePlugins() {
149
+ if(!empty($this->event_information['active_plugins']))
150
+ return $this->event_information['active_plugins'];
151
+ else
152
+ return get_option('active_plugins');
153
  }
154
 
155
  public function getLastImportId() {
1999
  if (!empty($post_format)) {
2000
  wp_set_object_terms($retID, $post_format, 'post_format');
2001
  }
2002
+ $shortcodes = array();
2003
+ $media_handle = isset($duplicateHandling['media_handling']) ? $duplicateHandling['media_handling'] : array();
 
2004
 
2005
  #TODO: Need to import the media for scheduler
2006
  /* Set Featured Image */
2219
  // Create / Assign categories to the post types
2220
  if(isset($categories[$termKey]) && $categories[$termKey] != '')
2221
  $this->assignTermsAndTaxonomies($categories, $category_name, $pID);
2222
+ //Get Default Category id
2223
+ $default_category_id = get_option('default_category');
2224
+ //Get Default Category Name
2225
+ $default_category_details = get_term_by('id', $default_category_id , 'category');
2226
+ //Remove Default Category
2227
+ $categories = wp_get_object_terms($pID, 'category');
2228
+ if (count($categories) > 1) {
2229
+ foreach ($categories as $key => $category) {
2230
+ if ($category->name == $default_category_details->name ) {
2231
+ wp_remove_object_terms($pID, $default_category_details->name , 'category');
2232
+ }
2233
+ }
2234
+ }
2235
  break;
2236
  case 'post_tag' :
2237
  $tags [$termKey] = $data_array [$termKey];
2967
  return $allData;
2968
  }
2969
 
2970
+ public function convert_local_image_src($content, $post_id, $media_handle) {
2971
+ if(trim($content) != '') {
2972
+ $doc = new DOMDocument();
2973
+ @$doc->loadHTML( mb_convert_encoding( $content, 'HTML-ENTITIES', 'UTF-8' ) );
2974
+
2975
+ $searchNode = $doc->getElementsByTagName( "img" );
2976
+ if ( ! empty( $searchNode ) ) {
2977
+ foreach ( $searchNode as $searchNode ) {
2978
+ $orig_img_src = $searchNode->getAttribute( 'src' );
2979
+ $attachid = $this->set_featureimage( $orig_img_src, $post_id, $media_handle );
2980
+ $new_img_src = wp_get_attachment_url( $attachid );
2981
+ $searchNode->setAttribute( 'src', $new_img_src );
2982
+ }
2983
+ $post_content = $doc->saveHTML();
2984
+ $update_content['ID'] = $post_id;
2985
+ $update_content['post_content'] = $post_content;
2986
+ wp_update_post( $update_content );
2987
+ }
2988
+ }
 
2989
  }
2990
 
2991
  /**
3124
  curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
3125
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
3126
  $rawdata = curl_exec($ch);
3127
+ $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
3128
+ if ( $http_code != 200 && strpos( $rawdata, 'Not Found' ) != 0 ) {
3129
  $rawdata = false;
3130
  }
3131
  if ($rawdata == false) {
3132
+ return null;
3133
  } else {
3134
  if (file_exists($uploaddir_path)) {
3135
  unlink($uploaddir_path);
index.php CHANGED
@@ -2,7 +2,7 @@
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: Seamlessly create posts, custom posts, pages, media, SEO and more from your CSV data with ease.
5
- * Version: 5.0.2
6
  * Author: smackcoders
7
  * Text Domain: wp-ultimate-csv-importer
8
  * Domain Path: /languages
@@ -57,7 +57,7 @@ if ( ! class_exists( 'SM_WPUltimateCSVImporter' ) ) :
57
  */
58
  class SM_WPUltimateCSVImporter {
59
 
60
- public $version = '5.0.2';
61
 
62
  /**
63
  * The single instance of the class.
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: Seamlessly create posts, custom posts, pages, media, SEO and more from your CSV data with ease.
5
+ * Version: 5.0.3
6
  * Author: smackcoders
7
  * Text Domain: wp-ultimate-csv-importer
8
  * Domain Path: /languages
57
  */
58
  class SM_WPUltimateCSVImporter {
59
 
60
+ public $version = '5.0.3';
61
 
62
  /**
63
  * The single instance of the class.