Version Description
- implement hashed/plaintext password processing during import.
- Bug fix: User role import.
Download this release
Release Info
Developer | webtoffee |
Plugin | Import Export WordPress Users and WooCommerce Customers |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 1.1.4
- Sample_Users.csv +2 -2
- customer-import-export.php +196 -196
- images/calendar.png +0 -0
- images/documentation.png +0 -0
- images/storefrog.png +0 -0
- images/support.png +0 -0
- images/video.png +0 -0
- images/wf-ajax-loader.gif +0 -0
- images/wf-failed.png +0 -0
- images/wf-import.png +0 -0
- images/wf-notice.png +0 -0
- images/wf-success.png +0 -0
- includes/class-wf-customerimpexpcsv-admin-screen.php +85 -85
- includes/class-wf-customerimpexpcsv-ajax-handler.php +24 -24
- includes/exporter/class-wf-customerimpexpcsv-exporter.php +134 -133
- includes/exporter/data/data-wf-post-columns.php +22 -22
- includes/importer/class-wf-csv-parser.php +233 -233
- includes/importer/class-wf-customerimpexpcsv-customer-import.php +846 -833
- includes/importer/class-wf-customerimpexpcsv-importer.php +40 -40
- includes/importer/data/data-wf-reserved-fields-pair.php +20 -20
- includes/importer/views/html-wf-import-greeting.php +43 -43
- includes/importer/views/html-wf-import-options.php +14 -14
- includes/importer/views/market.php +0 -0
- includes/settings/class-wf-customerimpexpcsv-settings.php +17 -17
- includes/views/export/html-wf-export-customers.php +93 -93
- includes/views/export/market.php +0 -0
- includes/views/html-wf-admin-screen.php +23 -23
- includes/views/html-wf-help-guide.php +0 -0
- includes/views/import/html-wf-import-customers.php +7 -7
- lang/wf_customer_import_export-fr_FR.po +0 -0
- license.txt +707 -707
- readme.txt +8 -4
- styles/select2.css +0 -0
- styles/select2.js +0 -0
- styles/wf-style.css +144 -144
- temp-import.csv +0 -0
Sample_Users.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,display_name,first_name,last_name,user_status,roles
|
2 |
-
9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,mark,mark@xadapter.com,http://www.xadapter.com,2016-10-20 11:52:04,Mark,Mark,Wough,,"subscriber, customer"
|
1 |
+
ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,display_name,first_name,last_name,user_status,roles
|
2 |
+
9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,mark,mark@xadapter.com,http://www.xadapter.com,2016-10-20 11:52:04,Mark,Mark,Wough,,"subscriber, customer"
|
customer-import-export.php
CHANGED
@@ -1,197 +1,197 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
Plugin Name: WordPress Users & WooCommerce Customers Import Export(BASIC)
|
5 |
-
Plugin URI: https://wordpress.org/plugins/users-customers-import-export-for-wp-woocommerce/
|
6 |
-
Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
|
7 |
-
Author: WebToffee
|
8 |
-
Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
|
9 |
-
Version: 1.1.
|
10 |
-
WC tested up to: 3.4.4
|
11 |
-
Text Domain: wf_customer_import_export
|
12 |
-
License: GPLv3
|
13 |
-
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
-
*/
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
if (!defined('ABSPATH') || !is_admin()) {
|
19 |
-
return;
|
20 |
-
}
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Function to check whether Premium version of User Import Export plugin is installed or not
|
24 |
-
*/
|
25 |
-
function wf_wordpress_user_import_export_premium_check(){
|
26 |
-
if ( is_plugin_active('customer-import-export-for-woocommerce/customer-import-export.php') ){
|
27 |
-
deactivate_plugins( basename( __FILE__ ) );
|
28 |
-
wp_die(__("You already have the Premium version installed. For any issues, kindly contact our <a target='_blank' href='https://www.xadapter.com/online-support/'>support</a>.", "wf_customer_import_export"), "", array('back_link' => 1 ));
|
29 |
-
}
|
30 |
-
}
|
31 |
-
register_activation_hook( __FILE__, 'wf_wordpress_user_import_export_premium_check' );
|
32 |
-
|
33 |
-
|
34 |
-
if( !defined('WF_CUSTOMER_IMP_EXP_ID') )
|
35 |
-
{
|
36 |
-
define("WF_CUSTOMER_IMP_EXP_ID", "wf_customer_imp_exp");
|
37 |
-
}
|
38 |
-
|
39 |
-
if( !defined('HF_WORDPRESS_CUSTOMER_IM_EX') )
|
40 |
-
{
|
41 |
-
define("HF_WORDPRESS_CUSTOMER_IM_EX", "hf_wordpress_customer_im_ex");
|
42 |
-
}
|
43 |
-
|
44 |
-
if (!class_exists('WF_Customer_Import_Export_CSV')) :
|
45 |
-
|
46 |
-
/*
|
47 |
-
* Main CSV Import class
|
48 |
-
*/
|
49 |
-
|
50 |
-
class WF_Customer_Import_Export_CSV {
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Constructor
|
54 |
-
*/
|
55 |
-
public function __construct() {
|
56 |
-
if( !defined('WF_CustomerImpExpCsv_FILE') )
|
57 |
-
{
|
58 |
-
define('WF_CustomerImpExpCsv_FILE', __FILE__);
|
59 |
-
}
|
60 |
-
|
61 |
-
add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
|
62 |
-
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
|
63 |
-
add_action('init', array($this, 'load_plugin_textdomain'));
|
64 |
-
add_action('init', array($this, 'catch_export_request'), 20);
|
65 |
-
add_action('init', array($this, 'catch_save_settings'), 20);
|
66 |
-
add_action('admin_init', array($this, 'register_importers'));
|
67 |
-
|
68 |
-
if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
|
69 |
-
add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
|
70 |
-
add_action('wp_ajax_UEIPF_webtoffee_storefrog_notice_dismiss', array($this, 'webtoffee_storefrog_notice_dismiss'));
|
71 |
-
}
|
72 |
-
|
73 |
-
include_once( 'includes/class-wf-customerimpexpcsv-admin-screen.php' );
|
74 |
-
include_once( 'includes/importer/class-wf-customerimpexpcsv-importer.php' );
|
75 |
-
|
76 |
-
if (defined('DOING_AJAX')) {
|
77 |
-
include_once( 'includes/class-wf-customerimpexpcsv-ajax-handler.php' );
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
public function wf_plugin_action_links($links) {
|
82 |
-
$plugin_links = array(
|
83 |
-
'<a href="' . admin_url('admin.php?page=hf_wordpress_customer_im_ex') . '">' . __('Import Export Users', 'wf_customer_import_export') . '</a>',
|
84 |
-
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support', 'wf_customer_import_export') . '</a>',
|
85 |
-
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
|
86 |
-
);
|
87 |
-
return array_merge($plugin_links, $links);
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Add screen ID
|
92 |
-
*/
|
93 |
-
public function woocommerce_screen_ids($ids) {
|
94 |
-
$ids[] = 'admin'; // For import screen
|
95 |
-
return $ids;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Handle localisation
|
100 |
-
*/
|
101 |
-
public function load_plugin_textdomain() {
|
102 |
-
load_plugin_textdomain('wf_customer_import_export', false, dirname(plugin_basename(__FILE__)) . '/lang/');
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Catches an export request and exports the data. This class is only loaded in admin.
|
107 |
-
*/
|
108 |
-
public function catch_export_request() {
|
109 |
-
if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
|
110 |
-
switch ($_GET['action']) {
|
111 |
-
case "export" :
|
112 |
-
$user_ok = $this->hf_user_permission();
|
113 |
-
if ($user_ok) {
|
114 |
-
include_once( 'includes/exporter/class-wf-customerimpexpcsv-exporter.php' );
|
115 |
-
WF_CustomerImpExpCsv_Exporter::do_export();
|
116 |
-
} else {
|
117 |
-
wp_redirect(wp_login_url());
|
118 |
-
}
|
119 |
-
break;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
public function catch_save_settings() {
|
125 |
-
if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
|
126 |
-
switch ($_GET['action']) {
|
127 |
-
case "settings" :
|
128 |
-
include_once( 'includes/settings/class-wf-customerimpexpcsv-settings.php' );
|
129 |
-
WF_CustomerImpExpCsv_Settings::save_settings();
|
130 |
-
break;
|
131 |
-
}
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Register importers for use
|
137 |
-
*/
|
138 |
-
public function register_importers() {
|
139 |
-
register_importer('wordpress_hf_user_csv', 'WordPress User/Customers (CSV)', __('Import <strong>users/customers</strong> to your site via a csv file.', 'wf_customer_import_export'), 'WF_CustomerImpExpCsv_Importer::customer_importer');
|
140 |
-
}
|
141 |
-
|
142 |
-
private function hf_user_permission() {
|
143 |
-
// Check if user has rights to export
|
144 |
-
$current_user = wp_get_current_user();
|
145 |
-
$user_ok = false;
|
146 |
-
$wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
|
147 |
-
if ($current_user instanceof WP_User) {
|
148 |
-
$can_users = array_intersect($wf_roles, $current_user->roles);
|
149 |
-
if (!empty($can_users)) {
|
150 |
-
$user_ok = true;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
return $user_ok;
|
154 |
-
}
|
155 |
-
|
156 |
-
function webtoffee_storefrog_admin_notices() {
|
157 |
-
|
158 |
-
if (apply_filters('webtoffee_storefrog_suppress_admin_notices', false)) {
|
159 |
-
return;
|
160 |
-
}
|
161 |
-
$screen = get_current_screen();
|
162 |
-
|
163 |
-
$allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex', 'admin');
|
164 |
-
if (in_array($screen->id, $allowed_screen_ids)) {
|
165 |
-
|
166 |
-
$notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_customer_import_export');
|
167 |
-
$notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_customer_import_export');
|
168 |
-
|
169 |
-
$content = '<style>.webtoffee-storefrog-nav-tab.updated {z-index:2; display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
|
170 |
-
$content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'wf_order_import_export') . '</span></button></div></div>';
|
171 |
-
echo $content;
|
172 |
-
|
173 |
-
|
174 |
-
$user_js = "jQuery( '#webtoffee-storefrog-notice-dismiss' ).click( function() {
|
175 |
-
jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'UEIPF_webtoffee_storefrog_notice_dismiss' } );
|
176 |
-
jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
|
177 |
-
});
|
178 |
-
";
|
179 |
-
$js = "<!-- User Import JavaScript -->\n<script type=\"text/javascript\">\njQuery(function($) { $user_js });\n</script>\n";
|
180 |
-
echo $js;
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
function webtoffee_storefrog_notice_dismiss() {
|
185 |
-
|
186 |
-
if (current_user_can('editor') || current_user_can('administrator')) {
|
187 |
-
update_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed', 1);
|
188 |
-
wp_die();
|
189 |
-
}
|
190 |
-
wp_die(-1);
|
191 |
-
}
|
192 |
-
|
193 |
-
}
|
194 |
-
|
195 |
-
endif;
|
196 |
-
|
197 |
new WF_Customer_Import_Export_CSV();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: WordPress Users & WooCommerce Customers Import Export(BASIC)
|
5 |
+
Plugin URI: https://wordpress.org/plugins/users-customers-import-export-for-wp-woocommerce/
|
6 |
+
Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
|
7 |
+
Author: WebToffee
|
8 |
+
Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
|
9 |
+
Version: 1.1.4
|
10 |
+
WC tested up to: 3.4.4
|
11 |
+
Text Domain: wf_customer_import_export
|
12 |
+
License: GPLv3
|
13 |
+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
+
*/
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
if (!defined('ABSPATH') || !is_admin()) {
|
19 |
+
return;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Function to check whether Premium version of User Import Export plugin is installed or not
|
24 |
+
*/
|
25 |
+
function wf_wordpress_user_import_export_premium_check(){
|
26 |
+
if ( is_plugin_active('customer-import-export-for-woocommerce/customer-import-export.php') ){
|
27 |
+
deactivate_plugins( basename( __FILE__ ) );
|
28 |
+
wp_die(__("You already have the Premium version installed. For any issues, kindly contact our <a target='_blank' href='https://www.xadapter.com/online-support/'>support</a>.", "wf_customer_import_export"), "", array('back_link' => 1 ));
|
29 |
+
}
|
30 |
+
}
|
31 |
+
register_activation_hook( __FILE__, 'wf_wordpress_user_import_export_premium_check' );
|
32 |
+
|
33 |
+
|
34 |
+
if( !defined('WF_CUSTOMER_IMP_EXP_ID') )
|
35 |
+
{
|
36 |
+
define("WF_CUSTOMER_IMP_EXP_ID", "wf_customer_imp_exp");
|
37 |
+
}
|
38 |
+
|
39 |
+
if( !defined('HF_WORDPRESS_CUSTOMER_IM_EX') )
|
40 |
+
{
|
41 |
+
define("HF_WORDPRESS_CUSTOMER_IM_EX", "hf_wordpress_customer_im_ex");
|
42 |
+
}
|
43 |
+
|
44 |
+
if (!class_exists('WF_Customer_Import_Export_CSV')) :
|
45 |
+
|
46 |
+
/*
|
47 |
+
* Main CSV Import class
|
48 |
+
*/
|
49 |
+
|
50 |
+
class WF_Customer_Import_Export_CSV {
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Constructor
|
54 |
+
*/
|
55 |
+
public function __construct() {
|
56 |
+
if( !defined('WF_CustomerImpExpCsv_FILE') )
|
57 |
+
{
|
58 |
+
define('WF_CustomerImpExpCsv_FILE', __FILE__);
|
59 |
+
}
|
60 |
+
|
61 |
+
add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
|
62 |
+
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
|
63 |
+
add_action('init', array($this, 'load_plugin_textdomain'));
|
64 |
+
add_action('init', array($this, 'catch_export_request'), 20);
|
65 |
+
add_action('init', array($this, 'catch_save_settings'), 20);
|
66 |
+
add_action('admin_init', array($this, 'register_importers'));
|
67 |
+
|
68 |
+
if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
|
69 |
+
add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
|
70 |
+
add_action('wp_ajax_UEIPF_webtoffee_storefrog_notice_dismiss', array($this, 'webtoffee_storefrog_notice_dismiss'));
|
71 |
+
}
|
72 |
+
|
73 |
+
include_once( 'includes/class-wf-customerimpexpcsv-admin-screen.php' );
|
74 |
+
include_once( 'includes/importer/class-wf-customerimpexpcsv-importer.php' );
|
75 |
+
|
76 |
+
if (defined('DOING_AJAX')) {
|
77 |
+
include_once( 'includes/class-wf-customerimpexpcsv-ajax-handler.php' );
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
public function wf_plugin_action_links($links) {
|
82 |
+
$plugin_links = array(
|
83 |
+
'<a href="' . admin_url('admin.php?page=hf_wordpress_customer_im_ex') . '">' . __('Import Export Users', 'wf_customer_import_export') . '</a>',
|
84 |
+
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support', 'wf_customer_import_export') . '</a>',
|
85 |
+
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
|
86 |
+
);
|
87 |
+
return array_merge($plugin_links, $links);
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Add screen ID
|
92 |
+
*/
|
93 |
+
public function woocommerce_screen_ids($ids) {
|
94 |
+
$ids[] = 'admin'; // For import screen
|
95 |
+
return $ids;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Handle localisation
|
100 |
+
*/
|
101 |
+
public function load_plugin_textdomain() {
|
102 |
+
load_plugin_textdomain('wf_customer_import_export', false, dirname(plugin_basename(__FILE__)) . '/lang/');
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Catches an export request and exports the data. This class is only loaded in admin.
|
107 |
+
*/
|
108 |
+
public function catch_export_request() {
|
109 |
+
if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
|
110 |
+
switch ($_GET['action']) {
|
111 |
+
case "export" :
|
112 |
+
$user_ok = $this->hf_user_permission();
|
113 |
+
if ($user_ok) {
|
114 |
+
include_once( 'includes/exporter/class-wf-customerimpexpcsv-exporter.php' );
|
115 |
+
WF_CustomerImpExpCsv_Exporter::do_export();
|
116 |
+
} else {
|
117 |
+
wp_redirect(wp_login_url());
|
118 |
+
}
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
public function catch_save_settings() {
|
125 |
+
if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
|
126 |
+
switch ($_GET['action']) {
|
127 |
+
case "settings" :
|
128 |
+
include_once( 'includes/settings/class-wf-customerimpexpcsv-settings.php' );
|
129 |
+
WF_CustomerImpExpCsv_Settings::save_settings();
|
130 |
+
break;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Register importers for use
|
137 |
+
*/
|
138 |
+
public function register_importers() {
|
139 |
+
register_importer('wordpress_hf_user_csv', 'WordPress User/Customers (CSV)', __('Import <strong>users/customers</strong> to your site via a csv file.', 'wf_customer_import_export'), 'WF_CustomerImpExpCsv_Importer::customer_importer');
|
140 |
+
}
|
141 |
+
|
142 |
+
private function hf_user_permission() {
|
143 |
+
// Check if user has rights to export
|
144 |
+
$current_user = wp_get_current_user();
|
145 |
+
$user_ok = false;
|
146 |
+
$wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
|
147 |
+
if ($current_user instanceof WP_User) {
|
148 |
+
$can_users = array_intersect($wf_roles, $current_user->roles);
|
149 |
+
if (!empty($can_users)) {
|
150 |
+
$user_ok = true;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
return $user_ok;
|
154 |
+
}
|
155 |
+
|
156 |
+
function webtoffee_storefrog_admin_notices() {
|
157 |
+
|
158 |
+
if (apply_filters('webtoffee_storefrog_suppress_admin_notices', false)) {
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
$screen = get_current_screen();
|
162 |
+
|
163 |
+
$allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex', 'admin');
|
164 |
+
if (in_array($screen->id, $allowed_screen_ids)) {
|
165 |
+
|
166 |
+
$notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_customer_import_export');
|
167 |
+
$notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_customer_import_export');
|
168 |
+
|
169 |
+
$content = '<style>.webtoffee-storefrog-nav-tab.updated {z-index:2; display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
|
170 |
+
$content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'wf_order_import_export') . '</span></button></div></div>';
|
171 |
+
echo $content;
|
172 |
+
|
173 |
+
|
174 |
+
$user_js = "jQuery( '#webtoffee-storefrog-notice-dismiss' ).click( function() {
|
175 |
+
jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'UEIPF_webtoffee_storefrog_notice_dismiss' } );
|
176 |
+
jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
|
177 |
+
});
|
178 |
+
";
|
179 |
+
$js = "<!-- User Import JavaScript -->\n<script type=\"text/javascript\">\njQuery(function($) { $user_js });\n</script>\n";
|
180 |
+
echo $js;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
function webtoffee_storefrog_notice_dismiss() {
|
185 |
+
|
186 |
+
if (current_user_can('editor') || current_user_can('administrator')) {
|
187 |
+
update_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed', 1);
|
188 |
+
wp_die();
|
189 |
+
}
|
190 |
+
wp_die(-1);
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
endif;
|
196 |
+
|
197 |
new WF_Customer_Import_Export_CSV();
|
images/calendar.png
CHANGED
File without changes
|
images/documentation.png
CHANGED
File without changes
|
images/storefrog.png
CHANGED
File without changes
|
images/support.png
CHANGED
File without changes
|
images/video.png
CHANGED
File without changes
|
images/wf-ajax-loader.gif
CHANGED
File without changes
|
images/wf-failed.png
CHANGED
File without changes
|
images/wf-import.png
CHANGED
File without changes
|
images/wf-notice.png
CHANGED
File without changes
|
images/wf-success.png
CHANGED
File without changes
|
includes/class-wf-customerimpexpcsv-admin-screen.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_Admin_Screen {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Constructor
|
10 |
-
*/
|
11 |
-
public function __construct() {
|
12 |
-
add_action('admin_menu', array($this, 'admin_menu'));
|
13 |
-
add_action('admin_print_styles', array($this, 'admin_scripts'));
|
14 |
-
add_action('admin_notices', array($this, 'admin_notices'));
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Notices in admin
|
19 |
-
*/
|
20 |
-
public function admin_notices() {
|
21 |
-
if (!function_exists('mb_detect_encoding')) {
|
22 |
-
echo '<div class="error"><p>' . __('User/Customer CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'wf_customer_import_export') . '</p></div>';
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Admin Menu
|
28 |
-
*/
|
29 |
-
public function admin_menu() {
|
30 |
-
$page = add_users_page( __( 'User Import Export', 'wf_customer_import_export' ), __( 'User Import Export', 'wf_customer_import_export' ), 'list_users', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
31 |
-
$page1 = add_submenu_page( 'woocommerce', __( 'Customer Import Export', 'wf_customer_import_export' ), __( 'Customer Import Export', 'wf_customer_import_export' ), 'manage_woocommerce', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Admin Scripts
|
36 |
-
*/
|
37 |
-
public function admin_scripts() {
|
38 |
-
global $wp_scripts;
|
39 |
-
if(function_exists('WC')){
|
40 |
-
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
|
41 |
-
}
|
42 |
-
wp_enqueue_style('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
|
43 |
-
wp_enqueue_style('woocommerce-user-csv-importer1', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.css', basename(__FILE__)), '', '4.0.6', '');
|
44 |
-
wp_enqueue_script('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.js', basename(__FILE__)), array(), '4.0.6', true);
|
45 |
-
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Admin Screen output
|
51 |
-
*/
|
52 |
-
public function output() {
|
53 |
-
$tab = 'export';
|
54 |
-
|
55 |
-
if (!empty($_GET['tab'])) {
|
56 |
-
if ($_GET['tab'] == 'import') {
|
57 |
-
$tab = 'import';
|
58 |
-
} else if ($_GET['tab'] == 'settings') {
|
59 |
-
$tab = 'settings';
|
60 |
-
} else if ($_GET['tab'] == 'help') {
|
61 |
-
$tab = 'help';
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
include( 'views/html-wf-admin-screen.php' );
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Admin page for help
|
70 |
-
*/
|
71 |
-
public function admin_help_page() {
|
72 |
-
include('views/html-wf-help-guide.php');
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Admin Page for exporting
|
77 |
-
*/
|
78 |
-
public function admin_export_page() {
|
79 |
-
$post_columns = include( 'exporter/data/data-wf-post-columns.php' );
|
80 |
-
include( 'views/export/html-wf-export-customers.php' );
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
}
|
85 |
-
|
86 |
new WF_CustomerImpExpCsv_Admin_Screen();
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
class WF_CustomerImpExpCsv_Admin_Screen {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Constructor
|
10 |
+
*/
|
11 |
+
public function __construct() {
|
12 |
+
add_action('admin_menu', array($this, 'admin_menu'));
|
13 |
+
add_action('admin_print_styles', array($this, 'admin_scripts'));
|
14 |
+
add_action('admin_notices', array($this, 'admin_notices'));
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Notices in admin
|
19 |
+
*/
|
20 |
+
public function admin_notices() {
|
21 |
+
if (!function_exists('mb_detect_encoding')) {
|
22 |
+
echo '<div class="error"><p>' . __('User/Customer CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'wf_customer_import_export') . '</p></div>';
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Admin Menu
|
28 |
+
*/
|
29 |
+
public function admin_menu() {
|
30 |
+
$page = add_users_page( __( 'User Import Export', 'wf_customer_import_export' ), __( 'User Import Export', 'wf_customer_import_export' ), 'list_users', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
31 |
+
$page1 = add_submenu_page( 'woocommerce', __( 'Customer Import Export', 'wf_customer_import_export' ), __( 'Customer Import Export', 'wf_customer_import_export' ), 'manage_woocommerce', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Admin Scripts
|
36 |
+
*/
|
37 |
+
public function admin_scripts() {
|
38 |
+
global $wp_scripts;
|
39 |
+
if(function_exists('WC')){
|
40 |
+
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
|
41 |
+
}
|
42 |
+
wp_enqueue_style('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
|
43 |
+
wp_enqueue_style('woocommerce-user-csv-importer1', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.css', basename(__FILE__)), '', '4.0.6', '');
|
44 |
+
wp_enqueue_script('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.js', basename(__FILE__)), array(), '4.0.6', true);
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Admin Screen output
|
51 |
+
*/
|
52 |
+
public function output() {
|
53 |
+
$tab = 'export';
|
54 |
+
|
55 |
+
if (!empty($_GET['tab'])) {
|
56 |
+
if ($_GET['tab'] == 'import') {
|
57 |
+
$tab = 'import';
|
58 |
+
} else if ($_GET['tab'] == 'settings') {
|
59 |
+
$tab = 'settings';
|
60 |
+
} else if ($_GET['tab'] == 'help') {
|
61 |
+
$tab = 'help';
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
include( 'views/html-wf-admin-screen.php' );
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Admin page for help
|
70 |
+
*/
|
71 |
+
public function admin_help_page() {
|
72 |
+
include('views/html-wf-help-guide.php');
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Admin Page for exporting
|
77 |
+
*/
|
78 |
+
public function admin_export_page() {
|
79 |
+
$post_columns = include( 'exporter/data/data-wf-post-columns.php' );
|
80 |
+
include( 'views/export/html-wf-export-customers.php' );
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
new WF_CustomerImpExpCsv_Admin_Screen();
|
includes/class-wf-customerimpexpcsv-ajax-handler.php
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_AJAX_Handler {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Constructor
|
10 |
-
*/
|
11 |
-
public function __construct() {
|
12 |
-
add_action( 'wp_ajax_user_csv_import_request', array( $this, 'csv_customer_import_request' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Ajax event for importing a CSV
|
17 |
-
*/
|
18 |
-
public function csv_customer_import_request() {
|
19 |
-
define( 'WP_LOAD_IMPORTERS', true );
|
20 |
-
WF_CustomerImpExpCsv_Importer::customer_importer();
|
21 |
-
}
|
22 |
-
|
23 |
-
}
|
24 |
-
|
25 |
new WF_CustomerImpExpCsv_AJAX_Handler();
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
class WF_CustomerImpExpCsv_AJAX_Handler {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Constructor
|
10 |
+
*/
|
11 |
+
public function __construct() {
|
12 |
+
add_action( 'wp_ajax_user_csv_import_request', array( $this, 'csv_customer_import_request' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Ajax event for importing a CSV
|
17 |
+
*/
|
18 |
+
public function csv_customer_import_request() {
|
19 |
+
define( 'WP_LOAD_IMPORTERS', true );
|
20 |
+
WF_CustomerImpExpCsv_Importer::customer_importer();
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
24 |
+
|
25 |
new WF_CustomerImpExpCsv_AJAX_Handler();
|
includes/exporter/class-wf-customerimpexpcsv-exporter.php
CHANGED
@@ -1,133 +1,134 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
class WF_CustomerImpExpCsv_Exporter {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Customer Exporter Tool
|
11 |
-
*/
|
12 |
-
public static function do_export() {
|
13 |
-
global $wpdb;
|
14 |
-
|
15 |
-
$export_limit = !empty($_POST['limit']) ? intval($_POST['limit']) : 999999999;
|
16 |
-
$export_offset = !empty($_POST['offset']) ? intval($_POST['offset']) : 0;
|
17 |
-
$csv_columns = include( 'data/data-wf-post-columns.php' );
|
18 |
-
|
19 |
-
$user_columns_name = !empty($_POST['columns_name']) ? $_POST['columns_name'] : $csv_columns;
|
20 |
-
$export_columns = !empty($_POST['columns']) ? $_POST['columns'] : array();
|
21 |
-
|
22 |
-
$export_user_roles = !empty($_POST['user_roles']) ? $_POST['user_roles'] : array();
|
23 |
-
$delimiter = !empty($_POST['delimiter']) ? $_POST['delimiter'] : ',';
|
24 |
-
|
25 |
-
|
26 |
-
$wpdb->hide_errors();
|
27 |
-
@set_time_limit(0);
|
28 |
-
if (function_exists('apache_setenv'))
|
29 |
-
@apache_setenv('no-gzip', 1);
|
30 |
-
@ini_set('zlib.output_compression', 0);
|
31 |
-
@ob_clean();
|
32 |
-
|
33 |
-
header('Content-Type: text/csv; charset=UTF-8');
|
34 |
-
header('Content-Disposition: attachment; filename=Customer-Export-' . date('Y_m_d_H_i_s', current_time('timestamp')) . ".csv");
|
35 |
-
header('Pragma: no-cache');
|
36 |
-
header('Expires: 0');
|
37 |
-
|
38 |
-
$fp = fopen('php://output', 'w');
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
$args = array(
|
43 |
-
'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
|
44 |
-
'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
|
45 |
-
'number' => $export_limit, // number of users to retrieve
|
46 |
-
'offset' => $export_offset // offset to skip from list
|
47 |
-
);
|
48 |
-
|
49 |
-
$users = get_users($args);
|
50 |
-
|
51 |
-
// Variable to hold the CSV data we're exporting
|
52 |
-
$row = array();
|
53 |
-
|
54 |
-
// Export header rows
|
55 |
-
foreach ($csv_columns as $column => $value) {
|
56 |
-
$temp_head = esc_attr($user_columns_name[$column]);
|
57 |
-
if (!$export_columns || in_array($column, $export_columns))
|
58 |
-
$row[] = $temp_head;
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $row);
|
65 |
-
fwrite($fp, implode($delimiter, $row) . "\n");
|
66 |
-
unset($row);
|
67 |
-
|
68 |
-
// Loop users
|
69 |
-
foreach ($users as $user) {
|
70 |
-
//$row = array();
|
71 |
-
$data = WF_CustomerImpExpCsv_Exporter::get_customers_csv_row($user, $export_columns, $csv_columns);
|
72 |
-
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $data);
|
73 |
-
fwrite($fp, implode($delimiter, $row) . "\n");
|
74 |
-
unset($row);
|
75 |
-
unset($data);
|
76 |
-
}
|
77 |
-
|
78 |
-
fclose($fp);
|
79 |
-
exit;
|
80 |
-
}
|
81 |
-
|
82 |
-
public static function format_data($data) {
|
83 |
-
//if (!is_array($data));
|
84 |
-
//$data = (string) urldecode($data);
|
85 |
-
$enc = mb_detect_encoding($data, 'UTF-8, ISO-8859-1', true);
|
86 |
-
$data = ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
87 |
-
return $data;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Wrap a column in quotes for the CSV
|
92 |
-
* @param string data to wrap
|
93 |
-
* @return string wrapped data
|
94 |
-
*/
|
95 |
-
public static function wrap_column($data) {
|
96 |
-
return '"' . str_replace('"', '""', $data) . '"';
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Get the customer data for a single CSV row
|
101 |
-
* @since 3.0
|
102 |
-
* @param int $customer_id
|
103 |
-
* @param array $export_columns - user selected columns / all
|
104 |
-
* @return array $meta_keys customer/user meta data
|
105 |
-
*/
|
106 |
-
public static function get_customers_csv_row($id, $export_columns, $csv_columns) {
|
107 |
-
|
108 |
-
$user = get_user_by('ID', $id);
|
109 |
-
|
110 |
-
$customer_data = array();
|
111 |
-
foreach ($csv_columns as $key) {
|
112 |
-
|
113 |
-
$customer_data[$key] = !empty($user->{$key}) ? maybe_serialize($user->{$key}) : '';
|
114 |
-
}
|
115 |
-
$
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
*
|
127 |
-
*
|
128 |
-
* @
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
class WF_CustomerImpExpCsv_Exporter {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Customer Exporter Tool
|
11 |
+
*/
|
12 |
+
public static function do_export() {
|
13 |
+
global $wpdb;
|
14 |
+
|
15 |
+
$export_limit = !empty($_POST['limit']) ? intval($_POST['limit']) : 999999999;
|
16 |
+
$export_offset = !empty($_POST['offset']) ? intval($_POST['offset']) : 0;
|
17 |
+
$csv_columns = include( 'data/data-wf-post-columns.php' );
|
18 |
+
|
19 |
+
$user_columns_name = !empty($_POST['columns_name']) ? $_POST['columns_name'] : $csv_columns;
|
20 |
+
$export_columns = !empty($_POST['columns']) ? $_POST['columns'] : array();
|
21 |
+
|
22 |
+
$export_user_roles = !empty($_POST['user_roles']) ? $_POST['user_roles'] : array();
|
23 |
+
$delimiter = !empty($_POST['delimiter']) ? $_POST['delimiter'] : ',';
|
24 |
+
|
25 |
+
|
26 |
+
$wpdb->hide_errors();
|
27 |
+
@set_time_limit(0);
|
28 |
+
if (function_exists('apache_setenv'))
|
29 |
+
@apache_setenv('no-gzip', 1);
|
30 |
+
@ini_set('zlib.output_compression', 0);
|
31 |
+
@ob_clean();
|
32 |
+
|
33 |
+
header('Content-Type: text/csv; charset=UTF-8');
|
34 |
+
header('Content-Disposition: attachment; filename=Customer-Export-' . date('Y_m_d_H_i_s', current_time('timestamp')) . ".csv");
|
35 |
+
header('Pragma: no-cache');
|
36 |
+
header('Expires: 0');
|
37 |
+
|
38 |
+
$fp = fopen('php://output', 'w');
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
$args = array(
|
43 |
+
'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
|
44 |
+
'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
|
45 |
+
'number' => $export_limit, // number of users to retrieve
|
46 |
+
'offset' => $export_offset // offset to skip from list
|
47 |
+
);
|
48 |
+
|
49 |
+
$users = get_users($args);
|
50 |
+
|
51 |
+
// Variable to hold the CSV data we're exporting
|
52 |
+
$row = array();
|
53 |
+
|
54 |
+
// Export header rows
|
55 |
+
foreach ($csv_columns as $column => $value) {
|
56 |
+
$temp_head = esc_attr($user_columns_name[$column]);
|
57 |
+
if (!$export_columns || in_array($column, $export_columns))
|
58 |
+
$row[] = $temp_head;
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $row);
|
65 |
+
fwrite($fp, implode($delimiter, $row) . "\n");
|
66 |
+
unset($row);
|
67 |
+
|
68 |
+
// Loop users
|
69 |
+
foreach ($users as $user) {
|
70 |
+
//$row = array();
|
71 |
+
$data = WF_CustomerImpExpCsv_Exporter::get_customers_csv_row($user, $export_columns, $csv_columns);
|
72 |
+
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $data);
|
73 |
+
fwrite($fp, implode($delimiter, $row) . "\n");
|
74 |
+
unset($row);
|
75 |
+
unset($data);
|
76 |
+
}
|
77 |
+
|
78 |
+
fclose($fp);
|
79 |
+
exit;
|
80 |
+
}
|
81 |
+
|
82 |
+
public static function format_data($data) {
|
83 |
+
//if (!is_array($data));
|
84 |
+
//$data = (string) urldecode($data);
|
85 |
+
$enc = mb_detect_encoding($data, 'UTF-8, ISO-8859-1', true);
|
86 |
+
$data = ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
87 |
+
return $data;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Wrap a column in quotes for the CSV
|
92 |
+
* @param string data to wrap
|
93 |
+
* @return string wrapped data
|
94 |
+
*/
|
95 |
+
public static function wrap_column($data) {
|
96 |
+
return '"' . str_replace('"', '""', $data) . '"';
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Get the customer data for a single CSV row
|
101 |
+
* @since 3.0
|
102 |
+
* @param int $customer_id
|
103 |
+
* @param array $export_columns - user selected columns / all
|
104 |
+
* @return array $meta_keys customer/user meta data
|
105 |
+
*/
|
106 |
+
public static function get_customers_csv_row($id, $export_columns, $csv_columns) {
|
107 |
+
|
108 |
+
$user = get_user_by('ID', $id);
|
109 |
+
|
110 |
+
$customer_data = array();
|
111 |
+
foreach ($csv_columns as $key) {
|
112 |
+
|
113 |
+
$customer_data[$key] = !empty($user->{$key}) ? maybe_serialize($user->{$key}) : '';
|
114 |
+
}
|
115 |
+
$user_roles = (!empty($user->roles)) ? $user->roles : array();
|
116 |
+
$customer_data['roles'] = implode(',', $user_roles);
|
117 |
+
|
118 |
+
foreach ($customer_data as $key => $value) {
|
119 |
+
if (!$export_columns || in_array($key, $export_columns)) {
|
120 |
+
// need to modify code
|
121 |
+
} else {
|
122 |
+
unset($customer_data[$key]);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
/*
|
126 |
+
* CSV Customer Export Row.
|
127 |
+
* Filter the individual row data for the customer export
|
128 |
+
* @since 3.0
|
129 |
+
* @param array $customer_data
|
130 |
+
*/
|
131 |
+
return apply_filters('hf_customer_csv_export_data', $customer_data);
|
132 |
+
}
|
133 |
+
|
134 |
+
}
|
includes/exporter/data/data-wf-post-columns.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
$columns = array(
|
8 |
-
'ID' => 'ID',
|
9 |
-
'user_login' => 'user_login',
|
10 |
-
'user_pass' => 'user_pass',
|
11 |
-
'user_nicename' => 'user_nicename',
|
12 |
-
'user_email' => 'user_email',
|
13 |
-
'user_url' => 'user_url',
|
14 |
-
'user_registered' => 'user_registered',
|
15 |
-
'display_name' => 'display_name',
|
16 |
-
'first_name' => 'first_name',
|
17 |
-
'last_name' => 'last_name',
|
18 |
-
'user_status' => 'user_status',
|
19 |
-
'roles' => 'roles'
|
20 |
-
);
|
21 |
-
|
22 |
-
return apply_filters('hf_csv_customer_post_columns', $columns);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
$columns = array(
|
8 |
+
'ID' => 'ID',
|
9 |
+
'user_login' => 'user_login',
|
10 |
+
'user_pass' => 'user_pass',
|
11 |
+
'user_nicename' => 'user_nicename',
|
12 |
+
'user_email' => 'user_email',
|
13 |
+
'user_url' => 'user_url',
|
14 |
+
'user_registered' => 'user_registered',
|
15 |
+
'display_name' => 'display_name',
|
16 |
+
'first_name' => 'first_name',
|
17 |
+
'last_name' => 'last_name',
|
18 |
+
'user_status' => 'user_status',
|
19 |
+
'roles' => 'roles'
|
20 |
+
);
|
21 |
+
|
22 |
+
return apply_filters('hf_csv_customer_post_columns', $columns);
|
includes/importer/class-wf-csv-parser.php
CHANGED
@@ -1,234 +1,234 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce CSV Importer class for managing parsing of CSV files.
|
4 |
-
*/
|
5 |
-
class WF_CSV_Parser {
|
6 |
-
|
7 |
-
var $row;
|
8 |
-
var $post_type;
|
9 |
-
var $posts = array();
|
10 |
-
var $processed_posts = array();
|
11 |
-
var $file_url_import_enabled = true;
|
12 |
-
var $log;
|
13 |
-
var $merged = 0;
|
14 |
-
var $skipped = 0;
|
15 |
-
var $imported = 0;
|
16 |
-
var $errored = 0;
|
17 |
-
var $id;
|
18 |
-
var $file_url;
|
19 |
-
var $delimiter;
|
20 |
-
var $send_mail;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Constructor
|
24 |
-
*/
|
25 |
-
public function __construct( $post_type = 'user' ) {
|
26 |
-
$this->post_type = $post_type;
|
27 |
-
$this->user_base_fields = array(
|
28 |
-
'ID' => 'ID',
|
29 |
-
'user_login' => 'user_login',
|
30 |
-
'user_pass' => 'user_pass',
|
31 |
-
'user_nicename' => 'user_nicename',
|
32 |
-
'user_email' => 'user_email',
|
33 |
-
'user_url' => 'user_url',
|
34 |
-
'user_registered' => 'user_registered',
|
35 |
-
'display_name' => 'display_name',
|
36 |
-
'first_name' => 'first_name',
|
37 |
-
'last_name' => 'last_name',
|
38 |
-
'user_status' => 'user_status',
|
39 |
-
'roles' => 'roles'
|
40 |
-
);
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Format data from the csv file
|
47 |
-
* @param string $data
|
48 |
-
* @param string $enc
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public function format_data_from_csv( $data, $enc ) {
|
52 |
-
return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Parse the data
|
57 |
-
* @param string $file [description]
|
58 |
-
* @param string $delimiter [description]
|
59 |
-
* @param array $mapping [description]
|
60 |
-
* @param integer $start_pos [description]
|
61 |
-
* @param integer $end_pos [description]
|
62 |
-
* @return array
|
63 |
-
*/
|
64 |
-
public function parse_data( $file, $delimiter, $mapping, $start_pos = 0, $end_pos = null, $eval_field ) {
|
65 |
-
// Set locale
|
66 |
-
$enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
|
67 |
-
if ( $enc )
|
68 |
-
setlocale( LC_ALL, 'en_US.' . $enc );
|
69 |
-
@ini_set( 'auto_detect_line_endings', true );
|
70 |
-
|
71 |
-
$parsed_data = array();
|
72 |
-
$raw_headers = array();
|
73 |
-
|
74 |
-
// Put all CSV data into an associative array
|
75 |
-
if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
|
76 |
-
|
77 |
-
$header = fgetcsv( $handle, 0, $delimiter );
|
78 |
-
if ( $start_pos != 0 )
|
79 |
-
fseek( $handle, $start_pos );
|
80 |
-
|
81 |
-
while ( ( $postmeta = fgetcsv( $handle, 0, $delimiter ) ) !== FALSE ) {
|
82 |
-
$row = array();
|
83 |
-
|
84 |
-
foreach ( $header as $key => $heading ) {
|
85 |
-
$s_heading = $heading;
|
86 |
-
|
87 |
-
// Check if this heading is being mapped to a different field
|
88 |
-
if ( isset( $mapping[$s_heading] ) ) {
|
89 |
-
if ( $mapping[$s_heading] == 'import_as_meta' ) {
|
90 |
-
|
91 |
-
$s_heading = 'meta:' . $s_heading;
|
92 |
-
|
93 |
-
}else {
|
94 |
-
$s_heading = esc_attr( $mapping[$s_heading] );
|
95 |
-
}
|
96 |
-
}
|
97 |
-
if( !empty($mapping) ){
|
98 |
-
foreach ($mapping as $mkey => $mvalue) {
|
99 |
-
if(trim($mvalue) === trim($heading)){
|
100 |
-
$s_heading = $mkey;
|
101 |
-
}
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
if ( $s_heading == '' )
|
106 |
-
continue;
|
107 |
-
|
108 |
-
// Add the heading to the parsed data
|
109 |
-
$row[$s_heading] = ( isset( $postmeta[$key] ) ) ? $this->format_data_from_csv( $postmeta[$key], $enc ) : '';
|
110 |
-
|
111 |
-
if(!empty($eval_field[ $heading ]))
|
112 |
-
$row[$s_heading] = $this->evaluate_field($row[$s_heading], $eval_field[$s_heading]);
|
113 |
-
|
114 |
-
// Raw Headers stores the actual column name in the CSV
|
115 |
-
$raw_headers[ $s_heading ] = $heading;
|
116 |
-
}
|
117 |
-
$parsed_data[] = $row;
|
118 |
-
|
119 |
-
unset( $postmeta, $row );
|
120 |
-
|
121 |
-
$position = ftell( $handle );
|
122 |
-
|
123 |
-
if ( $end_pos && $position >= $end_pos )
|
124 |
-
break;
|
125 |
-
}
|
126 |
-
fclose( $handle );
|
127 |
-
}
|
128 |
-
return array( $parsed_data, $raw_headers, $position );
|
129 |
-
}
|
130 |
-
|
131 |
-
private function evaluate_field($value, $evaluation_field){
|
132 |
-
$processed_value = $value;
|
133 |
-
if(!empty($evaluation_field)){
|
134 |
-
$operator = substr($evaluation_field, 0, 1);
|
135 |
-
if(in_array($operator, array('=', '+', '-', '*', '/', '&' , '@'))){
|
136 |
-
$eval_val = substr($evaluation_field, 1);
|
137 |
-
switch($operator){
|
138 |
-
case '=':
|
139 |
-
$processed_value = trim($eval_val);
|
140 |
-
break;
|
141 |
-
case '+':
|
142 |
-
$processed_value = $this->hf_currency_formatter($value) + $eval_val;
|
143 |
-
break;
|
144 |
-
case '-':
|
145 |
-
$processed_value = $value - $eval_val;
|
146 |
-
break;
|
147 |
-
case '*':
|
148 |
-
$processed_value = $value * $eval_val;
|
149 |
-
break;
|
150 |
-
case '/':
|
151 |
-
$processed_value = $value / $eval_val;
|
152 |
-
break;
|
153 |
-
case '@':
|
154 |
-
$date = DateTime::createFromFormat($eval_val, $value);
|
155 |
-
$processed_value = $date->format('Y-m-d H:i:s');
|
156 |
-
break;
|
157 |
-
case '&':
|
158 |
-
if (strpos($eval_val, '[VAL]') !== false) {
|
159 |
-
$processed_value = str_replace('[VAL]',$value,$eval_val);
|
160 |
-
}
|
161 |
-
else{
|
162 |
-
$processed_value = $value . $eval_val;
|
163 |
-
}
|
164 |
-
break;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
return $processed_value;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Parse users
|
173 |
-
* @param array $item
|
174 |
-
* @param integer $merge_empty_cells
|
175 |
-
* @return array
|
176 |
-
*/
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
public function parse_users( $item, $raw_headers, $merging, $record_offset ) {
|
182 |
-
|
183 |
-
|
184 |
-
global $WF_CSV_User_Import, $wpdb;
|
185 |
-
|
186 |
-
$results = array();
|
187 |
-
$row = 0;
|
188 |
-
$skipped = 0;
|
189 |
-
|
190 |
-
$row++;
|
191 |
-
if ( $row <= $record_offset ) {
|
192 |
-
if($WF_CSV_User_Import->log)
|
193 |
-
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'wf_customer_import_export' ), $row ) );
|
194 |
-
unset($item);
|
195 |
-
return;
|
196 |
-
}
|
197 |
-
if ( empty($item['user_email']) ) {
|
198 |
-
if($WF_CSV_User_Import->log)
|
199 |
-
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: cannot insert user without email.', 'wf_customer_import_export' ), $row ) );
|
200 |
-
unset($item);
|
201 |
-
return;
|
202 |
-
}elseif(!is_email($item['user_email'])){
|
203 |
-
if($WF_CSV_User_Import->log)
|
204 |
-
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: Email is not valid.', 'wf_customer_import_export' ), $row ) );
|
205 |
-
unset($item);
|
206 |
-
return;
|
207 |
-
}
|
208 |
-
|
209 |
-
$user_details = array();
|
210 |
-
foreach ($this->user_base_fields as $key => $value) {
|
211 |
-
$user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
|
212 |
-
}
|
213 |
-
|
214 |
-
|
215 |
-
$parsed_details = array();
|
216 |
-
|
217 |
-
$parsed_details['user_details'] = $user_details;
|
218 |
-
|
219 |
-
|
220 |
-
// the $user_details array will now contain the necessary name-value pairs for the wp_users table
|
221 |
-
$results[] = $parsed_details;
|
222 |
-
|
223 |
-
// Result
|
224 |
-
return array(
|
225 |
-
$this->post_type => $results,
|
226 |
-
'skipped' => $skipped,
|
227 |
-
);
|
228 |
-
}
|
229 |
-
|
230 |
-
function hf_currency_formatter($price){
|
231 |
-
$decimal_seperator = wc_get_price_decimal_separator();
|
232 |
-
return preg_replace("[^0-9\\'.$decimal_seperator.']", "", $price);
|
233 |
-
}
|
234 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce CSV Importer class for managing parsing of CSV files.
|
4 |
+
*/
|
5 |
+
class WF_CSV_Parser {
|
6 |
+
|
7 |
+
var $row;
|
8 |
+
var $post_type;
|
9 |
+
var $posts = array();
|
10 |
+
var $processed_posts = array();
|
11 |
+
var $file_url_import_enabled = true;
|
12 |
+
var $log;
|
13 |
+
var $merged = 0;
|
14 |
+
var $skipped = 0;
|
15 |
+
var $imported = 0;
|
16 |
+
var $errored = 0;
|
17 |
+
var $id;
|
18 |
+
var $file_url;
|
19 |
+
var $delimiter;
|
20 |
+
var $send_mail;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor
|
24 |
+
*/
|
25 |
+
public function __construct( $post_type = 'user' ) {
|
26 |
+
$this->post_type = $post_type;
|
27 |
+
$this->user_base_fields = array(
|
28 |
+
'ID' => 'ID',
|
29 |
+
'user_login' => 'user_login',
|
30 |
+
'user_pass' => 'user_pass',
|
31 |
+
'user_nicename' => 'user_nicename',
|
32 |
+
'user_email' => 'user_email',
|
33 |
+
'user_url' => 'user_url',
|
34 |
+
'user_registered' => 'user_registered',
|
35 |
+
'display_name' => 'display_name',
|
36 |
+
'first_name' => 'first_name',
|
37 |
+
'last_name' => 'last_name',
|
38 |
+
'user_status' => 'user_status',
|
39 |
+
'roles' => 'roles'
|
40 |
+
);
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Format data from the csv file
|
47 |
+
* @param string $data
|
48 |
+
* @param string $enc
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function format_data_from_csv( $data, $enc ) {
|
52 |
+
return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Parse the data
|
57 |
+
* @param string $file [description]
|
58 |
+
* @param string $delimiter [description]
|
59 |
+
* @param array $mapping [description]
|
60 |
+
* @param integer $start_pos [description]
|
61 |
+
* @param integer $end_pos [description]
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public function parse_data( $file, $delimiter, $mapping, $start_pos = 0, $end_pos = null, $eval_field ) {
|
65 |
+
// Set locale
|
66 |
+
$enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
|
67 |
+
if ( $enc )
|
68 |
+
setlocale( LC_ALL, 'en_US.' . $enc );
|
69 |
+
@ini_set( 'auto_detect_line_endings', true );
|
70 |
+
|
71 |
+
$parsed_data = array();
|
72 |
+
$raw_headers = array();
|
73 |
+
|
74 |
+
// Put all CSV data into an associative array
|
75 |
+
if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
|
76 |
+
|
77 |
+
$header = fgetcsv( $handle, 0, $delimiter );
|
78 |
+
if ( $start_pos != 0 )
|
79 |
+
fseek( $handle, $start_pos );
|
80 |
+
|
81 |
+
while ( ( $postmeta = fgetcsv( $handle, 0, $delimiter ) ) !== FALSE ) {
|
82 |
+
$row = array();
|
83 |
+
|
84 |
+
foreach ( $header as $key => $heading ) {
|
85 |
+
$s_heading = $heading;
|
86 |
+
|
87 |
+
// Check if this heading is being mapped to a different field
|
88 |
+
if ( isset( $mapping[$s_heading] ) ) {
|
89 |
+
if ( $mapping[$s_heading] == 'import_as_meta' ) {
|
90 |
+
|
91 |
+
$s_heading = 'meta:' . $s_heading;
|
92 |
+
|
93 |
+
}else {
|
94 |
+
$s_heading = esc_attr( $mapping[$s_heading] );
|
95 |
+
}
|
96 |
+
}
|
97 |
+
if( !empty($mapping) ){
|
98 |
+
foreach ($mapping as $mkey => $mvalue) {
|
99 |
+
if(trim($mvalue) === trim($heading)){
|
100 |
+
$s_heading = $mkey;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( $s_heading == '' )
|
106 |
+
continue;
|
107 |
+
|
108 |
+
// Add the heading to the parsed data
|
109 |
+
$row[$s_heading] = ( isset( $postmeta[$key] ) ) ? $this->format_data_from_csv( $postmeta[$key], $enc ) : '';
|
110 |
+
|
111 |
+
if(!empty($eval_field[ $heading ]))
|
112 |
+
$row[$s_heading] = $this->evaluate_field($row[$s_heading], $eval_field[$s_heading]);
|
113 |
+
|
114 |
+
// Raw Headers stores the actual column name in the CSV
|
115 |
+
$raw_headers[ $s_heading ] = $heading;
|
116 |
+
}
|
117 |
+
$parsed_data[] = $row;
|
118 |
+
|
119 |
+
unset( $postmeta, $row );
|
120 |
+
|
121 |
+
$position = ftell( $handle );
|
122 |
+
|
123 |
+
if ( $end_pos && $position >= $end_pos )
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
fclose( $handle );
|
127 |
+
}
|
128 |
+
return array( $parsed_data, $raw_headers, $position );
|
129 |
+
}
|
130 |
+
|
131 |
+
private function evaluate_field($value, $evaluation_field){
|
132 |
+
$processed_value = $value;
|
133 |
+
if(!empty($evaluation_field)){
|
134 |
+
$operator = substr($evaluation_field, 0, 1);
|
135 |
+
if(in_array($operator, array('=', '+', '-', '*', '/', '&' , '@'))){
|
136 |
+
$eval_val = substr($evaluation_field, 1);
|
137 |
+
switch($operator){
|
138 |
+
case '=':
|
139 |
+
$processed_value = trim($eval_val);
|
140 |
+
break;
|
141 |
+
case '+':
|
142 |
+
$processed_value = $this->hf_currency_formatter($value) + $eval_val;
|
143 |
+
break;
|
144 |
+
case '-':
|
145 |
+
$processed_value = $value - $eval_val;
|
146 |
+
break;
|
147 |
+
case '*':
|
148 |
+
$processed_value = $value * $eval_val;
|
149 |
+
break;
|
150 |
+
case '/':
|
151 |
+
$processed_value = $value / $eval_val;
|
152 |
+
break;
|
153 |
+
case '@':
|
154 |
+
$date = DateTime::createFromFormat($eval_val, $value);
|
155 |
+
$processed_value = $date->format('Y-m-d H:i:s');
|
156 |
+
break;
|
157 |
+
case '&':
|
158 |
+
if (strpos($eval_val, '[VAL]') !== false) {
|
159 |
+
$processed_value = str_replace('[VAL]',$value,$eval_val);
|
160 |
+
}
|
161 |
+
else{
|
162 |
+
$processed_value = $value . $eval_val;
|
163 |
+
}
|
164 |
+
break;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
return $processed_value;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Parse users
|
173 |
+
* @param array $item
|
174 |
+
* @param integer $merge_empty_cells
|
175 |
+
* @return array
|
176 |
+
*/
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
public function parse_users( $item, $raw_headers, $merging, $record_offset ) {
|
182 |
+
|
183 |
+
|
184 |
+
global $WF_CSV_User_Import, $wpdb;
|
185 |
+
|
186 |
+
$results = array();
|
187 |
+
$row = 0;
|
188 |
+
$skipped = 0;
|
189 |
+
|
190 |
+
$row++;
|
191 |
+
if ( $row <= $record_offset ) {
|
192 |
+
if($WF_CSV_User_Import->log)
|
193 |
+
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'wf_customer_import_export' ), $row ) );
|
194 |
+
unset($item);
|
195 |
+
return;
|
196 |
+
}
|
197 |
+
if ( empty($item['user_email']) ) {
|
198 |
+
if($WF_CSV_User_Import->log)
|
199 |
+
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: cannot insert user without email.', 'wf_customer_import_export' ), $row ) );
|
200 |
+
unset($item);
|
201 |
+
return;
|
202 |
+
}elseif(!is_email($item['user_email'])){
|
203 |
+
if($WF_CSV_User_Import->log)
|
204 |
+
$WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: Email is not valid.', 'wf_customer_import_export' ), $row ) );
|
205 |
+
unset($item);
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
|
209 |
+
$user_details = array();
|
210 |
+
foreach ($this->user_base_fields as $key => $value) {
|
211 |
+
$user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
$parsed_details = array();
|
216 |
+
|
217 |
+
$parsed_details['user_details'] = $user_details;
|
218 |
+
|
219 |
+
|
220 |
+
// the $user_details array will now contain the necessary name-value pairs for the wp_users table
|
221 |
+
$results[] = $parsed_details;
|
222 |
+
|
223 |
+
// Result
|
224 |
+
return array(
|
225 |
+
$this->post_type => $results,
|
226 |
+
'skipped' => $skipped,
|
227 |
+
);
|
228 |
+
}
|
229 |
+
|
230 |
+
function hf_currency_formatter($price){
|
231 |
+
$decimal_seperator = wc_get_price_decimal_separator();
|
232 |
+
return preg_replace("[^0-9\\'.$decimal_seperator.']", "", $price);
|
233 |
+
}
|
234 |
}
|
includes/importer/class-wf-customerimpexpcsv-customer-import.php
CHANGED
@@ -1,833 +1,846 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WordPress Importer class for managing the import process of a CSV file
|
4 |
-
*
|
5 |
-
* @package WordPress
|
6 |
-
* @subpackage Importer
|
7 |
-
*/
|
8 |
-
if (!class_exists('WP_Importer'))
|
9 |
-
return;
|
10 |
-
|
11 |
-
class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
|
12 |
-
|
13 |
-
var $id;
|
14 |
-
var $file_url;
|
15 |
-
var $delimiter;
|
16 |
-
var $send_mail;
|
17 |
-
var $profile;
|
18 |
-
var $merge_empty_cells;
|
19 |
-
var $processed_terms = array();
|
20 |
-
var $processed_posts = array();
|
21 |
-
var $merged = 0;
|
22 |
-
var $skipped = 0;
|
23 |
-
var $imported = 0;
|
24 |
-
var $errored = 0;
|
25 |
-
// Results
|
26 |
-
var $import_results = array();
|
27 |
-
var $log = false;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Constructor
|
31 |
-
*/
|
32 |
-
public function __construct() {
|
33 |
-
|
34 |
-
// Check that the class exists before trying to use it
|
35 |
-
if (function_exists('WC')) {
|
36 |
-
if(WC()->version < '3.0')
|
37 |
-
{
|
38 |
-
$this->log = new WC_Logger();
|
39 |
-
}
|
40 |
-
else
|
41 |
-
{
|
42 |
-
$this->log = wc_get_logger();
|
43 |
-
}
|
44 |
-
}
|
45 |
-
$this->import_page = 'wordpress_hf_user_csv';
|
46 |
-
$this->file_url_import_enabled = apply_filters('woocommerce_csv_product_file_url_import_enabled', true);
|
47 |
-
}
|
48 |
-
|
49 |
-
public function hf_log_data_change ($content = 'user-csv-import',$data='')
|
50 |
-
{
|
51 |
-
if (WC()->version < '2.7.0')
|
52 |
-
{
|
53 |
-
$this->log->add($content,$data);
|
54 |
-
}else
|
55 |
-
{
|
56 |
-
$context = array( 'source' => $content );
|
57 |
-
$this->log->log("debug", $data ,$context);
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Registered callback function for the WordPress Importer
|
63 |
-
*
|
64 |
-
* Manages the three separate stages of the CSV import process
|
65 |
-
*/
|
66 |
-
public function dispatch() {
|
67 |
-
|
68 |
-
global $woocommerce, $wpdb;
|
69 |
-
|
70 |
-
if (!empty($_POST['delimiter'])) {
|
71 |
-
$this->delimiter = stripslashes(trim($_POST['delimiter']));
|
72 |
-
} else if (!empty($_GET['delimiter'])) {
|
73 |
-
$this->delimiter = stripslashes(trim($_GET['delimiter']));
|
74 |
-
}
|
75 |
-
|
76 |
-
if (!$this->delimiter)
|
77 |
-
$this->delimiter = ',';
|
78 |
-
|
79 |
-
|
80 |
-
$this->send_mail = !empty($_POST['send_mail']) ? 1 : 0;
|
81 |
-
|
82 |
-
|
83 |
-
if (!empty($_POST['profile'])) {
|
84 |
-
$this->profile = stripslashes(trim($_POST['profile']));
|
85 |
-
} else if (!empty($_GET['profile'])) {
|
86 |
-
$this->profile = stripslashes(trim($_GET['profile']));
|
87 |
-
}
|
88 |
-
if (!$this->profile)
|
89 |
-
$this->profile = '';
|
90 |
-
|
91 |
-
if (!empty($_POST['merge_empty_cells']) || !empty($_GET['merge_empty_cells'])) {
|
92 |
-
$this->merge_empty_cells = 1;
|
93 |
-
} else {
|
94 |
-
$this->merge_empty_cells = 0;
|
95 |
-
}
|
96 |
-
|
97 |
-
$step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
|
98 |
-
|
99 |
-
switch ($step) {
|
100 |
-
case 0 :
|
101 |
-
$this->header();
|
102 |
-
$this->greet();
|
103 |
-
break;
|
104 |
-
case 1 :
|
105 |
-
$this->header();
|
106 |
-
|
107 |
-
check_admin_referer('import-upload');
|
108 |
-
|
109 |
-
if (!empty($_GET['file_url']))
|
110 |
-
$this->file_url = esc_attr($_GET['file_url']);
|
111 |
-
if (!empty($_GET['file_id']))
|
112 |
-
$this->id = $_GET['file_id'];
|
113 |
-
|
114 |
-
if (!empty($_GET['clearmapping']) || $this->handle_upload())
|
115 |
-
$this->import_options();
|
116 |
-
else
|
117 |
-
_e('Error with handle_upload!', 'wf_customer_import_export');
|
118 |
-
break;
|
119 |
-
case 2 :
|
120 |
-
$this->header();
|
121 |
-
|
122 |
-
check_admin_referer('import-woocommerce');
|
123 |
-
|
124 |
-
$this->id = (int) $_POST['import_id'];
|
125 |
-
|
126 |
-
if ($this->file_url_import_enabled)
|
127 |
-
$this->file_url = esc_attr($_POST['import_url']);
|
128 |
-
|
129 |
-
if ($this->id)
|
130 |
-
$file = get_attached_file($this->id);
|
131 |
-
else if ($this->file_url_import_enabled)
|
132 |
-
$file = ABSPATH . $this->file_url;
|
133 |
-
|
134 |
-
$file = str_replace("\\", "/", $file);
|
135 |
-
|
136 |
-
if ($file) {
|
137 |
-
?>
|
138 |
-
<table id="import-progress" class="widefat_importer widefat">
|
139 |
-
<thead>
|
140 |
-
<tr>
|
141 |
-
<th class="status"> </th>
|
142 |
-
<th class="row"><?php _e('Row', 'wf_customer_import_export'); ?></th>
|
143 |
-
<th><?php _e('User ID', 'wf_customer_import_export'); ?></th>
|
144 |
-
<th><?php _e('User Status', 'wf_customer_import_export'); ?></th>
|
145 |
-
<th class="reason"><?php _e('Status Msg', 'wf_customer_import_export'); ?></th>
|
146 |
-
</tr>
|
147 |
-
</thead>
|
148 |
-
<tfoot>
|
149 |
-
<tr class="importer-loading">
|
150 |
-
<td colspan="5"></td> </tr>
|
151 |
-
</tfoot>
|
152 |
-
<tbody></tbody>
|
153 |
-
</table>
|
154 |
-
<script type="text/javascript">
|
155 |
-
jQuery(document).ready(function($) {
|
156 |
-
|
157 |
-
if (! window.console) { window.console = function(){}; }
|
158 |
-
|
159 |
-
var processed_terms = [];
|
160 |
-
var processed_posts = [];
|
161 |
-
var i = 1;
|
162 |
-
var done_count = 0;
|
163 |
-
function import_rows(start_pos, end_pos) {
|
164 |
-
|
165 |
-
var data = {
|
166 |
-
action: 'user_csv_import_request',
|
167 |
-
file: '<?php echo addslashes($file); ?>',
|
168 |
-
mapping: '<?php echo @json_encode($_POST['map_from']); ?>',
|
169 |
-
profile: '<?php echo $this->profile; ?>',
|
170 |
-
eval_field: '<?php echo @stripslashes(json_encode(($_POST['eval_field']), JSON_HEX_APOS)) ?>',
|
171 |
-
start_pos: start_pos,
|
172 |
-
end_pos: end_pos,
|
173 |
-
};
|
174 |
-
data.eval_field = $.parseJSON(data.eval_field);
|
175 |
-
return $.ajax({
|
176 |
-
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '3', 'merge' => !empty($_GET['merge']) ? '1' : '0'), admin_url('admin-ajax.php')); ?>',
|
177 |
-
data: data,
|
178 |
-
type: 'POST',
|
179 |
-
success: function(response) {
|
180 |
-
if (response) {
|
181 |
-
|
182 |
-
try {
|
183 |
-
// Get the valid JSON only from the returned string
|
184 |
-
if (response.indexOf("<!--WC_START-->") >= 0)
|
185 |
-
response = response.split("<!--WC_START-->")[1]; // Strip off before after WC_START
|
186 |
-
|
187 |
-
if (response.indexOf("<!--WC_END-->") >= 0)
|
188 |
-
response = response.split("<!--WC_END-->")[0]; // Strip off anything after WC_END
|
189 |
-
|
190 |
-
// Parse
|
191 |
-
|
192 |
-
var results = $.parseJSON(response);
|
193 |
-
if (results.error) {
|
194 |
-
|
195 |
-
$('#import-progress tbody').append('<tr id="row-' + i + '" class="error"><td class="status" colspan="5">' + results.error + '</td></tr>');
|
196 |
-
i++;
|
197 |
-
} else if (results.import_results && $(results.import_results).size() > 0) {
|
198 |
-
|
199 |
-
$.each(results.processed_terms, function(index, value) {
|
200 |
-
processed_terms.push(value);
|
201 |
-
});
|
202 |
-
$.each(results.processed_posts, function(index, value) {
|
203 |
-
processed_posts.push(value);
|
204 |
-
});
|
205 |
-
$(results.import_results).each(function(index, row) {
|
206 |
-
$('#import-progress tbody').append('<tr id="row-' + i + '" class="' + row['status'] + '"><td><mark class="result" title="' + row['status'] + '">' + row['status'] + '</mark></td><td class="row">' + i + '</td><td>' + row['user_id'] + '</td><td>' + row['post_id'] + ' - ' + row['post_title'] + '</td><td class="reason">' + row['reason'] + '</td></tr>');
|
207 |
-
i++;
|
208 |
-
});
|
209 |
-
}
|
210 |
-
|
211 |
-
} catch (err) {}
|
212 |
-
|
213 |
-
} else {
|
214 |
-
$('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'wf_customer_import_export'); ?>' + '</td></tr>');
|
215 |
-
}
|
216 |
-
|
217 |
-
var w = $(window);
|
218 |
-
var row = $("#row-" + (i - 1));
|
219 |
-
if (row.length) {
|
220 |
-
w.scrollTop(row.offset().top - (w.height() / 2));
|
221 |
-
}
|
222 |
-
|
223 |
-
done_count++;
|
224 |
-
$('body').trigger('user_csv_import_request_complete');
|
225 |
-
}
|
226 |
-
});
|
227 |
-
}
|
228 |
-
|
229 |
-
var rows = [];
|
230 |
-
<?php
|
231 |
-
$limit = apply_filters('woocommerce_csv_import_limit_per_request', 10);
|
232 |
-
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
233 |
-
if ($enc)
|
234 |
-
setlocale(LC_ALL, 'en_US.' . $enc);
|
235 |
-
@ini_set('auto_detect_line_endings', true);
|
236 |
-
|
237 |
-
$count = 0;
|
238 |
-
$previous_position = 0;
|
239 |
-
$position = 0;
|
240 |
-
$import_count = 0;
|
241 |
-
|
242 |
-
// Get CSV positions
|
243 |
-
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
244 |
-
|
245 |
-
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
|
246 |
-
$count++;
|
247 |
-
|
248 |
-
if ($count >= $limit) {
|
249 |
-
$previous_position = $position;
|
250 |
-
$position = ftell($handle);
|
251 |
-
$count = 0;
|
252 |
-
$import_count ++;
|
253 |
-
|
254 |
-
// Import rows between $previous_position $position
|
255 |
-
?>rows.push([ <?php echo $previous_position; ?>, <?php echo $position; ?> ]); <?php
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
// Remainder
|
260 |
-
if ($count > 0) {
|
261 |
-
?>rows.push([ <?php echo $position; ?>, '' ]); <?php
|
262 |
-
$import_count ++;
|
263 |
-
}
|
264 |
-
|
265 |
-
fclose($handle);
|
266 |
-
}
|
267 |
-
?>
|
268 |
-
|
269 |
-
var data = rows.shift();
|
270 |
-
var regen_count = 0;
|
271 |
-
import_rows( data[0], data[1] );
|
272 |
-
|
273 |
-
$('body').on( 'user_csv_import_request_complete', function() {
|
274 |
-
if ( done_count == <?php echo $import_count; ?> ) {
|
275 |
-
|
276 |
-
import_done();
|
277 |
-
} else {
|
278 |
-
// Call next request
|
279 |
-
data = rows.shift();
|
280 |
-
import_rows( data[0], data[1] );
|
281 |
-
}
|
282 |
-
} );
|
283 |
-
|
284 |
-
function import_done() {
|
285 |
-
var data = {
|
286 |
-
action: 'user_csv_import_request',
|
287 |
-
file: '<?php echo $file; ?>',
|
288 |
-
processed_terms: processed_terms,
|
289 |
-
processed_posts: processed_posts,
|
290 |
-
};
|
291 |
-
|
292 |
-
$.ajax({
|
293 |
-
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '4', 'merge' => !empty($_GET['merge']) ? 1 : 0), admin_url('admin-ajax.php')); ?>',
|
294 |
-
data: data,
|
295 |
-
type: 'POST',
|
296 |
-
success: function( response ) {
|
297 |
-
console.log( response );
|
298 |
-
$('#import-progress tbody').append( '<tr class="complete"><td colspan="5">' + response + '</td></tr>' );
|
299 |
-
$('.importer-loading').hide();
|
300 |
-
}
|
301 |
-
});
|
302 |
-
}
|
303 |
-
});
|
304 |
-
</script>
|
305 |
-
<?php
|
306 |
-
} else {
|
307 |
-
echo '<p class="error">' . __('Error finding uploaded file!', 'wf_customer_import_export') . '</p>';
|
308 |
-
}
|
309 |
-
break;
|
310 |
-
case 3 :
|
311 |
-
|
312 |
-
// Check access - cannot use nonce here as it will expire after multiple requests
|
313 |
-
if (function_exists('WC')) {
|
314 |
-
if (!current_user_can('manage_woocommerce'))
|
315 |
-
die();
|
316 |
-
}
|
317 |
-
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
318 |
-
|
319 |
-
if (function_exists('gc_enable'))
|
320 |
-
gc_enable();
|
321 |
-
|
322 |
-
@set_time_limit(0);
|
323 |
-
@ob_flush();
|
324 |
-
@flush();
|
325 |
-
$wpdb->hide_errors();
|
326 |
-
|
327 |
-
$file = stripslashes($_POST['file']);
|
328 |
-
$mapping = json_decode(stripslashes($_POST['mapping']), true);
|
329 |
-
$profile = isset($_POST['profile']) ? $_POST['profile'] : '';
|
330 |
-
$eval_field = $_POST['eval_field'];
|
331 |
-
$start_pos = isset($_POST['start_pos']) ? absint($_POST['start_pos']) : 0;
|
332 |
-
$end_pos = isset($_POST['end_pos']) ? absint($_POST['end_pos']) : '';
|
333 |
-
|
334 |
-
if ($profile !== '') {
|
335 |
-
$profile_array = get_option('wf_user_csv_imp_exp_mapping');
|
336 |
-
$profile_array[$profile] = array($mapping, $eval_field);
|
337 |
-
update_option('wf_user_csv_imp_exp_mapping', $profile_array);
|
338 |
-
}
|
339 |
-
|
340 |
-
$position = $this->import_start($file, $mapping, $start_pos, $end_pos, $eval_field);
|
341 |
-
$this->import();
|
342 |
-
$this->import_end();
|
343 |
-
|
344 |
-
$results = array();
|
345 |
-
$results['import_results'] = $this->import_results;
|
346 |
-
$results['processed_terms'] = $this->processed_terms;
|
347 |
-
$results['processed_posts'] = $this->processed_posts;
|
348 |
-
|
349 |
-
echo "<!--WC_START-->";
|
350 |
-
echo json_encode($results);
|
351 |
-
echo "<!--WC_END-->";
|
352 |
-
exit;
|
353 |
-
break;
|
354 |
-
case 4 :
|
355 |
-
// Check access - cannot use nonce here as it will expire after multiple requests
|
356 |
-
if (function_exists('WC')) {
|
357 |
-
if (!current_user_can('manage_woocommerce'))
|
358 |
-
die();
|
359 |
-
}
|
360 |
-
|
361 |
-
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
362 |
-
|
363 |
-
if (function_exists('gc_enable'))
|
364 |
-
gc_enable();
|
365 |
-
|
366 |
-
@set_time_limit(0);
|
367 |
-
@ob_flush();
|
368 |
-
@flush();
|
369 |
-
$wpdb->hide_errors();
|
370 |
-
|
371 |
-
$this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
|
372 |
-
$this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
|
373 |
-
|
374 |
-
_e('Step 1...', 'wf_customer_import_export') . ' ';
|
375 |
-
|
376 |
-
wp_defer_term_counting(true);
|
377 |
-
wp_defer_comment_counting(true);
|
378 |
-
|
379 |
-
_e('Step 2...', 'wf_customer_import_export') . ' ';
|
380 |
-
|
381 |
-
echo 'Step 3...' . ' '; // Easter egg
|
382 |
-
|
383 |
-
_e('Finalizing...', 'wf_customer_import_export') . ' ';
|
384 |
-
|
385 |
-
// SUCCESS
|
386 |
-
_e('Finished. Import complete.', 'wf_customer_import_export');
|
387 |
-
|
388 |
-
$this->import_end();
|
389 |
-
exit;
|
390 |
-
break;
|
391 |
-
}
|
392 |
-
|
393 |
-
$this->footer();
|
394 |
-
}
|
395 |
-
|
396 |
-
/**
|
397 |
-
* format_data_from_csv
|
398 |
-
*/
|
399 |
-
public function format_data_from_csv($data, $enc) {
|
400 |
-
return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
401 |
-
}
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Display pre-import options
|
405 |
-
*/
|
406 |
-
public function import_options() {
|
407 |
-
$j = 0;
|
408 |
-
|
409 |
-
if ($this->id)
|
410 |
-
$file = get_attached_file($this->id);
|
411 |
-
else if ($this->file_url_import_enabled)
|
412 |
-
$file = ABSPATH . $this->file_url;
|
413 |
-
else
|
414 |
-
return;
|
415 |
-
|
416 |
-
// Set locale
|
417 |
-
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
418 |
-
if ($enc)
|
419 |
-
setlocale(LC_ALL, 'en_US.' . $enc);
|
420 |
-
@ini_set('auto_detect_line_endings', true);
|
421 |
-
|
422 |
-
// Get headers
|
423 |
-
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
424 |
-
|
425 |
-
$row = $raw_headers = array();
|
426 |
-
$header = fgetcsv($handle, 0, $this->delimiter);
|
427 |
-
|
428 |
-
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
|
429 |
-
foreach ($header as $key => $heading) {
|
430 |
-
if (!$heading)
|
431 |
-
continue;
|
432 |
-
$s_heading = $heading;
|
433 |
-
$row[$s_heading] = ( isset($postmeta[$key]) ) ? $this->format_data_from_csv($postmeta[$key], $enc) : '';
|
434 |
-
$raw_headers[$s_heading] = $heading;
|
435 |
-
}
|
436 |
-
break;
|
437 |
-
}
|
438 |
-
fclose($handle);
|
439 |
-
}
|
440 |
-
|
441 |
-
$mapping_from_db = get_option('wf_user_csv_imp_exp_mapping');
|
442 |
-
|
443 |
-
if ($this->profile !== '' && !empty($_GET['clearmapping'])) {
|
444 |
-
unset($mapping_from_db[$this->profile]);
|
445 |
-
update_option('wf_user_csv_imp_exp_mapping', $mapping_from_db);
|
446 |
-
$this->profile = '';
|
447 |
-
}
|
448 |
-
if ($this->profile !== '')
|
449 |
-
$mapping_from_db = $mapping_from_db[$this->profile];
|
450 |
-
|
451 |
-
$saved_mapping = null;
|
452 |
-
$saved_evaluation = null;
|
453 |
-
if ($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])) {
|
454 |
-
$reset_action = 'admin.php?clearmapping=1&profile=' . $this->profile . '&import=' . $this->import_page . '&step=1&merge=' . (!empty($_GET['merge']) ? 1 : 0 ) . '&file_url=' . $this->file_url . '&delimiter=' . $this->delimiter . '&merge_empty_cells=' . $this->merge_empty_cells. '&send_mail=' . $this->send_mail . '&file_id=' . $this->id . '';
|
455 |
-
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
|
456 |
-
echo '<h3>' . __('Columns are pre-selected using the Mapping file: "<b style="color:gray">' . $this->profile . '</b>". <a href="' . $reset_action . '"> Delete</a> this mapping file.', 'wf_customer_import_export') . '</h3>';
|
457 |
-
$saved_mapping = $mapping_from_db[0];
|
458 |
-
$saved_evaluation = $mapping_from_db[1];
|
459 |
-
}
|
460 |
-
|
461 |
-
$merge = (!empty($_GET['merge']) && $_GET['merge']) ? 1 : 0;
|
462 |
-
|
463 |
-
include( 'views/html-wf-import-options.php' );
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* The main controller for the actual import stage.
|
468 |
-
*/
|
469 |
-
public function import() {
|
470 |
-
global $woocommerce, $wpdb;
|
471 |
-
|
472 |
-
wp_suspend_cache_invalidation(true);
|
473 |
-
if ($this->log) {
|
474 |
-
$this->hf_log_data_change('user-csv-import', '---');
|
475 |
-
$this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
|
476 |
-
}
|
477 |
-
$merging = 1;
|
478 |
-
$record_offset = 0;
|
479 |
-
|
480 |
-
$i = 0;
|
481 |
-
|
482 |
-
foreach ($this->parsed_data as $key => &$item) {
|
483 |
-
$user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
|
484 |
-
if (!is_wp_error($user))
|
485 |
-
$this->process_users($user['user'][0]);
|
486 |
-
else
|
487 |
-
$this->add_import_result('failed', $user->get_error_message(), 'Not parsed', json_encode($item), '-');
|
488 |
-
|
489 |
-
unset($item, $user);
|
490 |
-
$i++;
|
491 |
-
}
|
492 |
-
if ($this->log)
|
493 |
-
$this->hf_log_data_change('user-csv-import', __('Finished processing Users.', 'wf_customer_import_export'));
|
494 |
-
wp_suspend_cache_invalidation(false);
|
495 |
-
}
|
496 |
-
|
497 |
-
/**
|
498 |
-
* Parses the CSV file and prepares us for the task of processing parsed data
|
499 |
-
*
|
500 |
-
* @param string $file Path to the CSV file for importing
|
501 |
-
*/
|
502 |
-
public function import_start($file, $mapping, $start_pos, $end_pos, $eval_field) {
|
503 |
-
|
504 |
-
|
505 |
-
if (function_exists('WC')) {
|
506 |
-
if (WC()->version < '2.7.0') {
|
507 |
-
$memory = size_format(woocommerce_let_to_num(ini_get('memory_limit')));
|
508 |
-
$wp_memory = size_format(woocommerce_let_to_num(WP_MEMORY_LIMIT));
|
509 |
-
} else {
|
510 |
-
$memory = size_format(wc_let_to_num(ini_get('memory_limit')));
|
511 |
-
$wp_memory = size_format(wc_let_to_num(WP_MEMORY_LIMIT));
|
512 |
-
}
|
513 |
-
}
|
514 |
-
if ($this->log) {
|
515 |
-
$this->hf_log_data_change('user-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
516 |
-
$this->hf_log_data_change('user-csv-import', __('Parsing products CSV.', 'wf_customer_import_export'));
|
517 |
-
}
|
518 |
-
$this->parser = new WF_CSV_Parser('user');
|
519 |
-
|
520 |
-
|
521 |
-
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field);
|
522 |
-
if ($this->log)
|
523 |
-
$this->hf_log_data_change('user-csv-import', __('Finished parsing products CSV.', 'wf_customer_import_export'));
|
524 |
-
|
525 |
-
unset($import_data);
|
526 |
-
|
527 |
-
wp_defer_term_counting(true);
|
528 |
-
wp_defer_comment_counting(true);
|
529 |
-
|
530 |
-
return $position;
|
531 |
-
}
|
532 |
-
|
533 |
-
/**
|
534 |
-
* Performs post-import cleanup of files and the cache
|
535 |
-
*/
|
536 |
-
public function import_end() {
|
537 |
-
|
538 |
-
//wp_cache_flush(); Stops output in some hosting environments
|
539 |
-
foreach (get_taxonomies() as $tax) {
|
540 |
-
delete_option("{$tax}_children");
|
541 |
-
_get_term_hierarchy($tax);
|
542 |
-
}
|
543 |
-
|
544 |
-
wp_defer_term_counting(false);
|
545 |
-
wp_defer_comment_counting(false);
|
546 |
-
|
547 |
-
do_action('import_end');
|
548 |
-
}
|
549 |
-
|
550 |
-
/**
|
551 |
-
* Handles the CSV upload and initial parsing of the file to prepare for
|
552 |
-
* displaying author import options
|
553 |
-
*
|
554 |
-
* @return bool False if error uploading or invalid file, true otherwise
|
555 |
-
*/
|
556 |
-
public function handle_upload() {
|
557 |
-
|
558 |
-
if (empty($_POST['file_url'])) {
|
559 |
-
|
560 |
-
$file = wp_import_handle_upload();
|
561 |
-
|
562 |
-
if (isset($file['error'])) {
|
563 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong><br />';
|
564 |
-
echo esc_html($file['error']) . '</p>';
|
565 |
-
return false;
|
566 |
-
}
|
567 |
-
|
568 |
-
$this->id = (int) $file['id'];
|
569 |
-
return true;
|
570 |
-
} else {
|
571 |
-
|
572 |
-
if (file_exists(ABSPATH . $_POST['file_url'])) {
|
573 |
-
|
574 |
-
$this->file_url = esc_attr($_POST['file_url']);
|
575 |
-
return true;
|
576 |
-
} else {
|
577 |
-
|
578 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong></p>';
|
579 |
-
return false;
|
580 |
-
}
|
581 |
-
}
|
582 |
-
|
583 |
-
return false;
|
584 |
-
}
|
585 |
-
|
586 |
-
/**
|
587 |
-
* Create new posts based on import information
|
588 |
-
*/
|
589 |
-
private function process_users($post) {
|
590 |
-
|
591 |
-
|
592 |
-
global $wpdb;
|
593 |
-
$this->imported = $this->merged = 0;
|
594 |
-
|
595 |
-
// plan a dry run
|
596 |
-
//$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
|
597 |
-
$dry_run = 0; //mockup import and check weather the users can be imported without fail
|
598 |
-
if ($this->log) {
|
599 |
-
$this->hf_log_data_change('user-csv-import', '---');
|
600 |
-
$this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
|
601 |
-
}
|
602 |
-
|
603 |
-
if (empty($post['user_details']['user_email'])) {
|
604 |
-
$this->add_import_result('skipped', __('Cannot insert user without email', 'wf_customer_import_export'), 1, 1, 1);
|
605 |
-
unset($post);
|
606 |
-
return;
|
607 |
-
} elseif (!is_email($post['user_details']['user_email'])) {
|
608 |
-
$this->add_import_result('skipped', __('skipped: Email is not valid.', 'wf_customer_import_export'), 1, $post['user_details']['user_email'], 1);
|
609 |
-
unset($post);
|
610 |
-
return;
|
611 |
-
}
|
612 |
-
|
613 |
-
$user_id = $this->hf_check_customer($post);
|
614 |
-
|
615 |
-
$new_added = false;
|
616 |
-
|
617 |
-
|
618 |
-
if ($user_id) {
|
619 |
-
$usr_msg = 'User already exists.';
|
620 |
-
$user_info = get_userdata($user_id);
|
621 |
-
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
622 |
-
$this->add_import_result('skipped', __($usr_msg, 'wf_customer_import_export'),$user_id , $user_string, $user_id);
|
623 |
-
if ($this->log)
|
624 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $usr_msg, 'wf_customer_import_export'), $user_id), true);
|
625 |
-
unset($post);
|
626 |
-
return;
|
627 |
-
} else{
|
628 |
-
$user_id = $this->hf_create_customer($post);
|
629 |
-
$new_added = true;
|
630 |
-
if (is_wp_error($user_id)) {
|
631 |
-
$this->errored++;
|
632 |
-
$this->add_import_result('failed', __($user_id->get_error_message(), 'wf_customer_import_export'), 0, 'failed', 1);
|
633 |
-
if ($this->log)
|
634 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s', 'wf_customer_import_export'), 1, $user_id->get_error_message()), true);
|
635 |
-
$skipped++;
|
636 |
-
unset($post);
|
637 |
-
return;
|
638 |
-
} elseif (empty($user_id)) {
|
639 |
-
$this->errored++;
|
640 |
-
if ($this->log)
|
641 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('An error occurred with the customer information provided.', 'wf_customer_import_export')));
|
642 |
-
$this->add_import_result('skipped', __('An error occurred with the customer information provided.', 'wf_customer_import_export'), 0, 'failed', 1);
|
643 |
-
$skipped++;
|
644 |
-
unset($post);
|
645 |
-
return;
|
646 |
-
}
|
647 |
-
}
|
648 |
-
|
649 |
-
$out_msg = 'User Imported Successfully.';
|
650 |
-
|
651 |
-
$user_info = get_userdata($user_id);
|
652 |
-
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
653 |
-
|
654 |
-
|
655 |
-
$this->add_import_result('imported', __($out_msg, 'wf_customer_import_export'), $user_id , $user_string, $user_id);
|
656 |
-
if ($this->log)
|
657 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $out_msg, 'wf_customer_import_export'), $user_id), true);
|
658 |
-
$this->imported++;
|
659 |
-
if ($this->log) {
|
660 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> Finished importing user %s', 'wf_customer_import_export'), $dry_run ? "" : $user_id ));
|
661 |
-
$this->hf_log_data_change('user-csv-import', __('Finished processing users.', 'wf_customer_import_export'));
|
662 |
-
}
|
663 |
-
|
664 |
-
unset($post);
|
665 |
-
}
|
666 |
-
|
667 |
-
public function hf_check_customer($data) {
|
668 |
-
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
669 |
-
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
670 |
-
$customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
671 |
-
|
672 |
-
$found_customer = false;
|
673 |
-
|
674 |
-
if (!empty($customer_email)) {
|
675 |
-
|
676 |
-
if (is_email($customer_email) && false !== email_exists($customer_email)) {
|
677 |
-
$found_customer = email_exists($customer_email);
|
678 |
-
} elseif (!empty($username) && false !== username_exists($username)) {
|
679 |
-
$found_customer = username_exists($username);
|
680 |
-
}
|
681 |
-
}
|
682 |
-
return $found_customer;
|
683 |
-
}
|
684 |
-
|
685 |
-
public function hf_create_customer($data) {
|
686 |
-
|
687 |
-
$
|
688 |
-
$
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
$
|
693 |
-
|
694 |
-
|
695 |
-
$
|
696 |
-
|
697 |
-
|
698 |
-
$
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
$maybe_username =
|
707 |
-
$
|
708 |
-
$
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
$
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
if (!is_wp_error($found_customer)) {
|
720 |
-
|
721 |
-
|
722 |
-
$
|
723 |
-
|
724 |
-
$
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
$
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
'
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
'
|
746 |
-
'
|
747 |
-
|
748 |
-
)
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
'
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
/**
|
775 |
-
*
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
public function
|
799 |
-
|
800 |
-
$
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
*
|
810 |
-
*/
|
811 |
-
public function
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WordPress Importer class for managing the import process of a CSV file
|
4 |
+
*
|
5 |
+
* @package WordPress
|
6 |
+
* @subpackage Importer
|
7 |
+
*/
|
8 |
+
if (!class_exists('WP_Importer'))
|
9 |
+
return;
|
10 |
+
|
11 |
+
class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
|
12 |
+
|
13 |
+
var $id;
|
14 |
+
var $file_url;
|
15 |
+
var $delimiter;
|
16 |
+
var $send_mail;
|
17 |
+
var $profile;
|
18 |
+
var $merge_empty_cells;
|
19 |
+
var $processed_terms = array();
|
20 |
+
var $processed_posts = array();
|
21 |
+
var $merged = 0;
|
22 |
+
var $skipped = 0;
|
23 |
+
var $imported = 0;
|
24 |
+
var $errored = 0;
|
25 |
+
// Results
|
26 |
+
var $import_results = array();
|
27 |
+
var $log = false;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Constructor
|
31 |
+
*/
|
32 |
+
public function __construct() {
|
33 |
+
|
34 |
+
// Check that the class exists before trying to use it
|
35 |
+
if (function_exists('WC')) {
|
36 |
+
if(WC()->version < '3.0')
|
37 |
+
{
|
38 |
+
$this->log = new WC_Logger();
|
39 |
+
}
|
40 |
+
else
|
41 |
+
{
|
42 |
+
$this->log = wc_get_logger();
|
43 |
+
}
|
44 |
+
}
|
45 |
+
$this->import_page = 'wordpress_hf_user_csv';
|
46 |
+
$this->file_url_import_enabled = apply_filters('woocommerce_csv_product_file_url_import_enabled', true);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function hf_log_data_change ($content = 'user-csv-import',$data='')
|
50 |
+
{
|
51 |
+
if (WC()->version < '2.7.0')
|
52 |
+
{
|
53 |
+
$this->log->add($content,$data);
|
54 |
+
}else
|
55 |
+
{
|
56 |
+
$context = array( 'source' => $content );
|
57 |
+
$this->log->log("debug", $data ,$context);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Registered callback function for the WordPress Importer
|
63 |
+
*
|
64 |
+
* Manages the three separate stages of the CSV import process
|
65 |
+
*/
|
66 |
+
public function dispatch() {
|
67 |
+
|
68 |
+
global $woocommerce, $wpdb;
|
69 |
+
|
70 |
+
if (!empty($_POST['delimiter'])) {
|
71 |
+
$this->delimiter = stripslashes(trim($_POST['delimiter']));
|
72 |
+
} else if (!empty($_GET['delimiter'])) {
|
73 |
+
$this->delimiter = stripslashes(trim($_GET['delimiter']));
|
74 |
+
}
|
75 |
+
|
76 |
+
if (!$this->delimiter)
|
77 |
+
$this->delimiter = ',';
|
78 |
+
|
79 |
+
|
80 |
+
$this->send_mail = !empty($_POST['send_mail']) ? 1 : 0;
|
81 |
+
|
82 |
+
|
83 |
+
if (!empty($_POST['profile'])) {
|
84 |
+
$this->profile = stripslashes(trim($_POST['profile']));
|
85 |
+
} else if (!empty($_GET['profile'])) {
|
86 |
+
$this->profile = stripslashes(trim($_GET['profile']));
|
87 |
+
}
|
88 |
+
if (!$this->profile)
|
89 |
+
$this->profile = '';
|
90 |
+
|
91 |
+
if (!empty($_POST['merge_empty_cells']) || !empty($_GET['merge_empty_cells'])) {
|
92 |
+
$this->merge_empty_cells = 1;
|
93 |
+
} else {
|
94 |
+
$this->merge_empty_cells = 0;
|
95 |
+
}
|
96 |
+
|
97 |
+
$step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
|
98 |
+
|
99 |
+
switch ($step) {
|
100 |
+
case 0 :
|
101 |
+
$this->header();
|
102 |
+
$this->greet();
|
103 |
+
break;
|
104 |
+
case 1 :
|
105 |
+
$this->header();
|
106 |
+
|
107 |
+
check_admin_referer('import-upload');
|
108 |
+
|
109 |
+
if (!empty($_GET['file_url']))
|
110 |
+
$this->file_url = esc_attr($_GET['file_url']);
|
111 |
+
if (!empty($_GET['file_id']))
|
112 |
+
$this->id = $_GET['file_id'];
|
113 |
+
|
114 |
+
if (!empty($_GET['clearmapping']) || $this->handle_upload())
|
115 |
+
$this->import_options();
|
116 |
+
else
|
117 |
+
_e('Error with handle_upload!', 'wf_customer_import_export');
|
118 |
+
break;
|
119 |
+
case 2 :
|
120 |
+
$this->header();
|
121 |
+
|
122 |
+
check_admin_referer('import-woocommerce');
|
123 |
+
|
124 |
+
$this->id = (int) $_POST['import_id'];
|
125 |
+
|
126 |
+
if ($this->file_url_import_enabled)
|
127 |
+
$this->file_url = esc_attr($_POST['import_url']);
|
128 |
+
|
129 |
+
if ($this->id)
|
130 |
+
$file = get_attached_file($this->id);
|
131 |
+
else if ($this->file_url_import_enabled)
|
132 |
+
$file = ABSPATH . $this->file_url;
|
133 |
+
|
134 |
+
$file = str_replace("\\", "/", $file);
|
135 |
+
|
136 |
+
if ($file) {
|
137 |
+
?>
|
138 |
+
<table id="import-progress" class="widefat_importer widefat">
|
139 |
+
<thead>
|
140 |
+
<tr>
|
141 |
+
<th class="status"> </th>
|
142 |
+
<th class="row"><?php _e('Row', 'wf_customer_import_export'); ?></th>
|
143 |
+
<th><?php _e('User ID', 'wf_customer_import_export'); ?></th>
|
144 |
+
<th><?php _e('User Status', 'wf_customer_import_export'); ?></th>
|
145 |
+
<th class="reason"><?php _e('Status Msg', 'wf_customer_import_export'); ?></th>
|
146 |
+
</tr>
|
147 |
+
</thead>
|
148 |
+
<tfoot>
|
149 |
+
<tr class="importer-loading">
|
150 |
+
<td colspan="5"></td> </tr>
|
151 |
+
</tfoot>
|
152 |
+
<tbody></tbody>
|
153 |
+
</table>
|
154 |
+
<script type="text/javascript">
|
155 |
+
jQuery(document).ready(function($) {
|
156 |
+
|
157 |
+
if (! window.console) { window.console = function(){}; }
|
158 |
+
|
159 |
+
var processed_terms = [];
|
160 |
+
var processed_posts = [];
|
161 |
+
var i = 1;
|
162 |
+
var done_count = 0;
|
163 |
+
function import_rows(start_pos, end_pos) {
|
164 |
+
|
165 |
+
var data = {
|
166 |
+
action: 'user_csv_import_request',
|
167 |
+
file: '<?php echo addslashes($file); ?>',
|
168 |
+
mapping: '<?php echo @json_encode($_POST['map_from']); ?>',
|
169 |
+
profile: '<?php echo $this->profile; ?>',
|
170 |
+
eval_field: '<?php echo @stripslashes(json_encode(($_POST['eval_field']), JSON_HEX_APOS)) ?>',
|
171 |
+
start_pos: start_pos,
|
172 |
+
end_pos: end_pos,
|
173 |
+
};
|
174 |
+
data.eval_field = $.parseJSON(data.eval_field);
|
175 |
+
return $.ajax({
|
176 |
+
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '3', 'merge' => !empty($_GET['merge']) ? '1' : '0'), admin_url('admin-ajax.php')); ?>',
|
177 |
+
data: data,
|
178 |
+
type: 'POST',
|
179 |
+
success: function(response) {
|
180 |
+
if (response) {
|
181 |
+
|
182 |
+
try {
|
183 |
+
// Get the valid JSON only from the returned string
|
184 |
+
if (response.indexOf("<!--WC_START-->") >= 0)
|
185 |
+
response = response.split("<!--WC_START-->")[1]; // Strip off before after WC_START
|
186 |
+
|
187 |
+
if (response.indexOf("<!--WC_END-->") >= 0)
|
188 |
+
response = response.split("<!--WC_END-->")[0]; // Strip off anything after WC_END
|
189 |
+
|
190 |
+
// Parse
|
191 |
+
|
192 |
+
var results = $.parseJSON(response);
|
193 |
+
if (results.error) {
|
194 |
+
|
195 |
+
$('#import-progress tbody').append('<tr id="row-' + i + '" class="error"><td class="status" colspan="5">' + results.error + '</td></tr>');
|
196 |
+
i++;
|
197 |
+
} else if (results.import_results && $(results.import_results).size() > 0) {
|
198 |
+
|
199 |
+
$.each(results.processed_terms, function(index, value) {
|
200 |
+
processed_terms.push(value);
|
201 |
+
});
|
202 |
+
$.each(results.processed_posts, function(index, value) {
|
203 |
+
processed_posts.push(value);
|
204 |
+
});
|
205 |
+
$(results.import_results).each(function(index, row) {
|
206 |
+
$('#import-progress tbody').append('<tr id="row-' + i + '" class="' + row['status'] + '"><td><mark class="result" title="' + row['status'] + '">' + row['status'] + '</mark></td><td class="row">' + i + '</td><td>' + row['user_id'] + '</td><td>' + row['post_id'] + ' - ' + row['post_title'] + '</td><td class="reason">' + row['reason'] + '</td></tr>');
|
207 |
+
i++;
|
208 |
+
});
|
209 |
+
}
|
210 |
+
|
211 |
+
} catch (err) {}
|
212 |
+
|
213 |
+
} else {
|
214 |
+
$('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'wf_customer_import_export'); ?>' + '</td></tr>');
|
215 |
+
}
|
216 |
+
|
217 |
+
var w = $(window);
|
218 |
+
var row = $("#row-" + (i - 1));
|
219 |
+
if (row.length) {
|
220 |
+
w.scrollTop(row.offset().top - (w.height() / 2));
|
221 |
+
}
|
222 |
+
|
223 |
+
done_count++;
|
224 |
+
$('body').trigger('user_csv_import_request_complete');
|
225 |
+
}
|
226 |
+
});
|
227 |
+
}
|
228 |
+
|
229 |
+
var rows = [];
|
230 |
+
<?php
|
231 |
+
$limit = apply_filters('woocommerce_csv_import_limit_per_request', 10);
|
232 |
+
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
233 |
+
if ($enc)
|
234 |
+
setlocale(LC_ALL, 'en_US.' . $enc);
|
235 |
+
@ini_set('auto_detect_line_endings', true);
|
236 |
+
|
237 |
+
$count = 0;
|
238 |
+
$previous_position = 0;
|
239 |
+
$position = 0;
|
240 |
+
$import_count = 0;
|
241 |
+
|
242 |
+
// Get CSV positions
|
243 |
+
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
244 |
+
|
245 |
+
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
|
246 |
+
$count++;
|
247 |
+
|
248 |
+
if ($count >= $limit) {
|
249 |
+
$previous_position = $position;
|
250 |
+
$position = ftell($handle);
|
251 |
+
$count = 0;
|
252 |
+
$import_count ++;
|
253 |
+
|
254 |
+
// Import rows between $previous_position $position
|
255 |
+
?>rows.push([ <?php echo $previous_position; ?>, <?php echo $position; ?> ]); <?php
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
// Remainder
|
260 |
+
if ($count > 0) {
|
261 |
+
?>rows.push([ <?php echo $position; ?>, '' ]); <?php
|
262 |
+
$import_count ++;
|
263 |
+
}
|
264 |
+
|
265 |
+
fclose($handle);
|
266 |
+
}
|
267 |
+
?>
|
268 |
+
|
269 |
+
var data = rows.shift();
|
270 |
+
var regen_count = 0;
|
271 |
+
import_rows( data[0], data[1] );
|
272 |
+
|
273 |
+
$('body').on( 'user_csv_import_request_complete', function() {
|
274 |
+
if ( done_count == <?php echo $import_count; ?> ) {
|
275 |
+
|
276 |
+
import_done();
|
277 |
+
} else {
|
278 |
+
// Call next request
|
279 |
+
data = rows.shift();
|
280 |
+
import_rows( data[0], data[1] );
|
281 |
+
}
|
282 |
+
} );
|
283 |
+
|
284 |
+
function import_done() {
|
285 |
+
var data = {
|
286 |
+
action: 'user_csv_import_request',
|
287 |
+
file: '<?php echo $file; ?>',
|
288 |
+
processed_terms: processed_terms,
|
289 |
+
processed_posts: processed_posts,
|
290 |
+
};
|
291 |
+
|
292 |
+
$.ajax({
|
293 |
+
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '4', 'merge' => !empty($_GET['merge']) ? 1 : 0), admin_url('admin-ajax.php')); ?>',
|
294 |
+
data: data,
|
295 |
+
type: 'POST',
|
296 |
+
success: function( response ) {
|
297 |
+
console.log( response );
|
298 |
+
$('#import-progress tbody').append( '<tr class="complete"><td colspan="5">' + response + '</td></tr>' );
|
299 |
+
$('.importer-loading').hide();
|
300 |
+
}
|
301 |
+
});
|
302 |
+
}
|
303 |
+
});
|
304 |
+
</script>
|
305 |
+
<?php
|
306 |
+
} else {
|
307 |
+
echo '<p class="error">' . __('Error finding uploaded file!', 'wf_customer_import_export') . '</p>';
|
308 |
+
}
|
309 |
+
break;
|
310 |
+
case 3 :
|
311 |
+
|
312 |
+
// Check access - cannot use nonce here as it will expire after multiple requests
|
313 |
+
if (function_exists('WC')) {
|
314 |
+
if (!current_user_can('manage_woocommerce'))
|
315 |
+
die();
|
316 |
+
}
|
317 |
+
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
318 |
+
|
319 |
+
if (function_exists('gc_enable'))
|
320 |
+
gc_enable();
|
321 |
+
|
322 |
+
@set_time_limit(0);
|
323 |
+
@ob_flush();
|
324 |
+
@flush();
|
325 |
+
$wpdb->hide_errors();
|
326 |
+
|
327 |
+
$file = stripslashes($_POST['file']);
|
328 |
+
$mapping = json_decode(stripslashes($_POST['mapping']), true);
|
329 |
+
$profile = isset($_POST['profile']) ? $_POST['profile'] : '';
|
330 |
+
$eval_field = $_POST['eval_field'];
|
331 |
+
$start_pos = isset($_POST['start_pos']) ? absint($_POST['start_pos']) : 0;
|
332 |
+
$end_pos = isset($_POST['end_pos']) ? absint($_POST['end_pos']) : '';
|
333 |
+
|
334 |
+
if ($profile !== '') {
|
335 |
+
$profile_array = get_option('wf_user_csv_imp_exp_mapping');
|
336 |
+
$profile_array[$profile] = array($mapping, $eval_field);
|
337 |
+
update_option('wf_user_csv_imp_exp_mapping', $profile_array);
|
338 |
+
}
|
339 |
+
|
340 |
+
$position = $this->import_start($file, $mapping, $start_pos, $end_pos, $eval_field);
|
341 |
+
$this->import();
|
342 |
+
$this->import_end();
|
343 |
+
|
344 |
+
$results = array();
|
345 |
+
$results['import_results'] = $this->import_results;
|
346 |
+
$results['processed_terms'] = $this->processed_terms;
|
347 |
+
$results['processed_posts'] = $this->processed_posts;
|
348 |
+
|
349 |
+
echo "<!--WC_START-->";
|
350 |
+
echo json_encode($results);
|
351 |
+
echo "<!--WC_END-->";
|
352 |
+
exit;
|
353 |
+
break;
|
354 |
+
case 4 :
|
355 |
+
// Check access - cannot use nonce here as it will expire after multiple requests
|
356 |
+
if (function_exists('WC')) {
|
357 |
+
if (!current_user_can('manage_woocommerce'))
|
358 |
+
die();
|
359 |
+
}
|
360 |
+
|
361 |
+
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
362 |
+
|
363 |
+
if (function_exists('gc_enable'))
|
364 |
+
gc_enable();
|
365 |
+
|
366 |
+
@set_time_limit(0);
|
367 |
+
@ob_flush();
|
368 |
+
@flush();
|
369 |
+
$wpdb->hide_errors();
|
370 |
+
|
371 |
+
$this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
|
372 |
+
$this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
|
373 |
+
|
374 |
+
_e('Step 1...', 'wf_customer_import_export') . ' ';
|
375 |
+
|
376 |
+
wp_defer_term_counting(true);
|
377 |
+
wp_defer_comment_counting(true);
|
378 |
+
|
379 |
+
_e('Step 2...', 'wf_customer_import_export') . ' ';
|
380 |
+
|
381 |
+
echo 'Step 3...' . ' '; // Easter egg
|
382 |
+
|
383 |
+
_e('Finalizing...', 'wf_customer_import_export') . ' ';
|
384 |
+
|
385 |
+
// SUCCESS
|
386 |
+
_e('Finished. Import complete.', 'wf_customer_import_export');
|
387 |
+
|
388 |
+
$this->import_end();
|
389 |
+
exit;
|
390 |
+
break;
|
391 |
+
}
|
392 |
+
|
393 |
+
$this->footer();
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* format_data_from_csv
|
398 |
+
*/
|
399 |
+
public function format_data_from_csv($data, $enc) {
|
400 |
+
return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Display pre-import options
|
405 |
+
*/
|
406 |
+
public function import_options() {
|
407 |
+
$j = 0;
|
408 |
+
|
409 |
+
if ($this->id)
|
410 |
+
$file = get_attached_file($this->id);
|
411 |
+
else if ($this->file_url_import_enabled)
|
412 |
+
$file = ABSPATH . $this->file_url;
|
413 |
+
else
|
414 |
+
return;
|
415 |
+
|
416 |
+
// Set locale
|
417 |
+
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
418 |
+
if ($enc)
|
419 |
+
setlocale(LC_ALL, 'en_US.' . $enc);
|
420 |
+
@ini_set('auto_detect_line_endings', true);
|
421 |
+
|
422 |
+
// Get headers
|
423 |
+
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
424 |
+
|
425 |
+
$row = $raw_headers = array();
|
426 |
+
$header = fgetcsv($handle, 0, $this->delimiter);
|
427 |
+
|
428 |
+
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
|
429 |
+
foreach ($header as $key => $heading) {
|
430 |
+
if (!$heading)
|
431 |
+
continue;
|
432 |
+
$s_heading = $heading;
|
433 |
+
$row[$s_heading] = ( isset($postmeta[$key]) ) ? $this->format_data_from_csv($postmeta[$key], $enc) : '';
|
434 |
+
$raw_headers[$s_heading] = $heading;
|
435 |
+
}
|
436 |
+
break;
|
437 |
+
}
|
438 |
+
fclose($handle);
|
439 |
+
}
|
440 |
+
|
441 |
+
$mapping_from_db = get_option('wf_user_csv_imp_exp_mapping');
|
442 |
+
|
443 |
+
if ($this->profile !== '' && !empty($_GET['clearmapping'])) {
|
444 |
+
unset($mapping_from_db[$this->profile]);
|
445 |
+
update_option('wf_user_csv_imp_exp_mapping', $mapping_from_db);
|
446 |
+
$this->profile = '';
|
447 |
+
}
|
448 |
+
if ($this->profile !== '')
|
449 |
+
$mapping_from_db = $mapping_from_db[$this->profile];
|
450 |
+
|
451 |
+
$saved_mapping = null;
|
452 |
+
$saved_evaluation = null;
|
453 |
+
if ($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])) {
|
454 |
+
$reset_action = 'admin.php?clearmapping=1&profile=' . $this->profile . '&import=' . $this->import_page . '&step=1&merge=' . (!empty($_GET['merge']) ? 1 : 0 ) . '&file_url=' . $this->file_url . '&delimiter=' . $this->delimiter . '&merge_empty_cells=' . $this->merge_empty_cells. '&send_mail=' . $this->send_mail . '&file_id=' . $this->id . '';
|
455 |
+
$reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
|
456 |
+
echo '<h3>' . __('Columns are pre-selected using the Mapping file: "<b style="color:gray">' . $this->profile . '</b>". <a href="' . $reset_action . '"> Delete</a> this mapping file.', 'wf_customer_import_export') . '</h3>';
|
457 |
+
$saved_mapping = $mapping_from_db[0];
|
458 |
+
$saved_evaluation = $mapping_from_db[1];
|
459 |
+
}
|
460 |
+
|
461 |
+
$merge = (!empty($_GET['merge']) && $_GET['merge']) ? 1 : 0;
|
462 |
+
|
463 |
+
include( 'views/html-wf-import-options.php' );
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* The main controller for the actual import stage.
|
468 |
+
*/
|
469 |
+
public function import() {
|
470 |
+
global $woocommerce, $wpdb;
|
471 |
+
|
472 |
+
wp_suspend_cache_invalidation(true);
|
473 |
+
if ($this->log) {
|
474 |
+
$this->hf_log_data_change('user-csv-import', '---');
|
475 |
+
$this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
|
476 |
+
}
|
477 |
+
$merging = 1;
|
478 |
+
$record_offset = 0;
|
479 |
+
|
480 |
+
$i = 0;
|
481 |
+
|
482 |
+
foreach ($this->parsed_data as $key => &$item) {
|
483 |
+
$user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
|
484 |
+
if (!is_wp_error($user))
|
485 |
+
$this->process_users($user['user'][0]);
|
486 |
+
else
|
487 |
+
$this->add_import_result('failed', $user->get_error_message(), 'Not parsed', json_encode($item), '-');
|
488 |
+
|
489 |
+
unset($item, $user);
|
490 |
+
$i++;
|
491 |
+
}
|
492 |
+
if ($this->log)
|
493 |
+
$this->hf_log_data_change('user-csv-import', __('Finished processing Users.', 'wf_customer_import_export'));
|
494 |
+
wp_suspend_cache_invalidation(false);
|
495 |
+
}
|
496 |
+
|
497 |
+
/**
|
498 |
+
* Parses the CSV file and prepares us for the task of processing parsed data
|
499 |
+
*
|
500 |
+
* @param string $file Path to the CSV file for importing
|
501 |
+
*/
|
502 |
+
public function import_start($file, $mapping, $start_pos, $end_pos, $eval_field) {
|
503 |
+
|
504 |
+
|
505 |
+
if (function_exists('WC')) {
|
506 |
+
if (WC()->version < '2.7.0') {
|
507 |
+
$memory = size_format(woocommerce_let_to_num(ini_get('memory_limit')));
|
508 |
+
$wp_memory = size_format(woocommerce_let_to_num(WP_MEMORY_LIMIT));
|
509 |
+
} else {
|
510 |
+
$memory = size_format(wc_let_to_num(ini_get('memory_limit')));
|
511 |
+
$wp_memory = size_format(wc_let_to_num(WP_MEMORY_LIMIT));
|
512 |
+
}
|
513 |
+
}
|
514 |
+
if ($this->log) {
|
515 |
+
$this->hf_log_data_change('user-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
516 |
+
$this->hf_log_data_change('user-csv-import', __('Parsing products CSV.', 'wf_customer_import_export'));
|
517 |
+
}
|
518 |
+
$this->parser = new WF_CSV_Parser('user');
|
519 |
+
|
520 |
+
|
521 |
+
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field);
|
522 |
+
if ($this->log)
|
523 |
+
$this->hf_log_data_change('user-csv-import', __('Finished parsing products CSV.', 'wf_customer_import_export'));
|
524 |
+
|
525 |
+
unset($import_data);
|
526 |
+
|
527 |
+
wp_defer_term_counting(true);
|
528 |
+
wp_defer_comment_counting(true);
|
529 |
+
|
530 |
+
return $position;
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Performs post-import cleanup of files and the cache
|
535 |
+
*/
|
536 |
+
public function import_end() {
|
537 |
+
|
538 |
+
//wp_cache_flush(); Stops output in some hosting environments
|
539 |
+
foreach (get_taxonomies() as $tax) {
|
540 |
+
delete_option("{$tax}_children");
|
541 |
+
_get_term_hierarchy($tax);
|
542 |
+
}
|
543 |
+
|
544 |
+
wp_defer_term_counting(false);
|
545 |
+
wp_defer_comment_counting(false);
|
546 |
+
|
547 |
+
do_action('import_end');
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Handles the CSV upload and initial parsing of the file to prepare for
|
552 |
+
* displaying author import options
|
553 |
+
*
|
554 |
+
* @return bool False if error uploading or invalid file, true otherwise
|
555 |
+
*/
|
556 |
+
public function handle_upload() {
|
557 |
+
|
558 |
+
if (empty($_POST['file_url'])) {
|
559 |
+
|
560 |
+
$file = wp_import_handle_upload();
|
561 |
+
|
562 |
+
if (isset($file['error'])) {
|
563 |
+
echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong><br />';
|
564 |
+
echo esc_html($file['error']) . '</p>';
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
|
568 |
+
$this->id = (int) $file['id'];
|
569 |
+
return true;
|
570 |
+
} else {
|
571 |
+
|
572 |
+
if (file_exists(ABSPATH . $_POST['file_url'])) {
|
573 |
+
|
574 |
+
$this->file_url = esc_attr($_POST['file_url']);
|
575 |
+
return true;
|
576 |
+
} else {
|
577 |
+
|
578 |
+
echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong></p>';
|
579 |
+
return false;
|
580 |
+
}
|
581 |
+
}
|
582 |
+
|
583 |
+
return false;
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Create new posts based on import information
|
588 |
+
*/
|
589 |
+
private function process_users($post) {
|
590 |
+
|
591 |
+
|
592 |
+
global $wpdb;
|
593 |
+
$this->imported = $this->merged = 0;
|
594 |
+
|
595 |
+
// plan a dry run
|
596 |
+
//$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
|
597 |
+
$dry_run = 0; //mockup import and check weather the users can be imported without fail
|
598 |
+
if ($this->log) {
|
599 |
+
$this->hf_log_data_change('user-csv-import', '---');
|
600 |
+
$this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
|
601 |
+
}
|
602 |
+
|
603 |
+
if (empty($post['user_details']['user_email'])) {
|
604 |
+
$this->add_import_result('skipped', __('Cannot insert user without email', 'wf_customer_import_export'), 1, 1, 1);
|
605 |
+
unset($post);
|
606 |
+
return;
|
607 |
+
} elseif (!is_email($post['user_details']['user_email'])) {
|
608 |
+
$this->add_import_result('skipped', __('skipped: Email is not valid.', 'wf_customer_import_export'), 1, $post['user_details']['user_email'], 1);
|
609 |
+
unset($post);
|
610 |
+
return;
|
611 |
+
}
|
612 |
+
|
613 |
+
$user_id = $this->hf_check_customer($post);
|
614 |
+
|
615 |
+
$new_added = false;
|
616 |
+
|
617 |
+
|
618 |
+
if ($user_id) {
|
619 |
+
$usr_msg = 'User already exists.';
|
620 |
+
$user_info = get_userdata($user_id);
|
621 |
+
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
622 |
+
$this->add_import_result('skipped', __($usr_msg, 'wf_customer_import_export'),$user_id , $user_string, $user_id);
|
623 |
+
if ($this->log)
|
624 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $usr_msg, 'wf_customer_import_export'), $user_id), true);
|
625 |
+
unset($post);
|
626 |
+
return;
|
627 |
+
} else{
|
628 |
+
$user_id = $this->hf_create_customer($post);
|
629 |
+
$new_added = true;
|
630 |
+
if (is_wp_error($user_id)) {
|
631 |
+
$this->errored++;
|
632 |
+
$this->add_import_result('failed', __($user_id->get_error_message(), 'wf_customer_import_export'), 0, 'failed', 1);
|
633 |
+
if ($this->log)
|
634 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s', 'wf_customer_import_export'), 1, $user_id->get_error_message()), true);
|
635 |
+
$skipped++;
|
636 |
+
unset($post);
|
637 |
+
return;
|
638 |
+
} elseif (empty($user_id)) {
|
639 |
+
$this->errored++;
|
640 |
+
if ($this->log)
|
641 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('An error occurred with the customer information provided.', 'wf_customer_import_export')));
|
642 |
+
$this->add_import_result('skipped', __('An error occurred with the customer information provided.', 'wf_customer_import_export'), 0, 'failed', 1);
|
643 |
+
$skipped++;
|
644 |
+
unset($post);
|
645 |
+
return;
|
646 |
+
}
|
647 |
+
}
|
648 |
+
|
649 |
+
$out_msg = 'User Imported Successfully.';
|
650 |
+
|
651 |
+
$user_info = get_userdata($user_id);
|
652 |
+
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
653 |
+
|
654 |
+
|
655 |
+
$this->add_import_result('imported', __($out_msg, 'wf_customer_import_export'), $user_id , $user_string, $user_id);
|
656 |
+
if ($this->log)
|
657 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $out_msg, 'wf_customer_import_export'), $user_id), true);
|
658 |
+
$this->imported++;
|
659 |
+
if ($this->log) {
|
660 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> Finished importing user %s', 'wf_customer_import_export'), $dry_run ? "" : $user_id ));
|
661 |
+
$this->hf_log_data_change('user-csv-import', __('Finished processing users.', 'wf_customer_import_export'));
|
662 |
+
}
|
663 |
+
|
664 |
+
unset($post);
|
665 |
+
}
|
666 |
+
|
667 |
+
public function hf_check_customer($data) {
|
668 |
+
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
669 |
+
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
670 |
+
$customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
671 |
+
|
672 |
+
$found_customer = false;
|
673 |
+
|
674 |
+
if (!empty($customer_email)) {
|
675 |
+
|
676 |
+
if (is_email($customer_email) && false !== email_exists($customer_email)) {
|
677 |
+
$found_customer = email_exists($customer_email);
|
678 |
+
} elseif (!empty($username) && false !== username_exists($username)) {
|
679 |
+
$found_customer = username_exists($username);
|
680 |
+
}
|
681 |
+
}
|
682 |
+
return $found_customer;
|
683 |
+
}
|
684 |
+
|
685 |
+
public function hf_create_customer($data) {
|
686 |
+
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
687 |
+
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
688 |
+
$customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
689 |
+
|
690 |
+
if (!empty($data['user_details']['user_pass'])) {
|
691 |
+
$password = (strlen( $data['user_details']['user_pass'])==34 ) ? $data['user_details']['user_pass'] : wp_hash_password($data['user_details']['user_pass']);
|
692 |
+
$password_generated = false;
|
693 |
+
} else {
|
694 |
+
$password = wp_generate_password(12, true);
|
695 |
+
$password_generated = true;
|
696 |
+
}
|
697 |
+
$found_customer = false;
|
698 |
+
if (is_email($customer_email)) {
|
699 |
+
|
700 |
+
|
701 |
+
|
702 |
+
// Not in test mode, create a user account for this email
|
703 |
+
if (empty($username)) {
|
704 |
+
|
705 |
+
$maybe_username = explode('@', $customer_email);
|
706 |
+
$maybe_username = sanitize_user($maybe_username[0]);
|
707 |
+
$counter = 1;
|
708 |
+
$username = $maybe_username;
|
709 |
+
|
710 |
+
while (username_exists($username)) {
|
711 |
+
$username = $maybe_username . $counter;
|
712 |
+
$counter++;
|
713 |
+
}
|
714 |
+
}
|
715 |
+
|
716 |
+
$found_customer = wp_create_user($username, $password, $customer_email);
|
717 |
+
wp_insert_user(array('ID' => $found_customer,'user_login'=>$username,'user_email'=>$customer_email, 'user_pass' => $password));
|
718 |
+
|
719 |
+
if (!is_wp_error($found_customer)) {
|
720 |
+
$wp_user_object = new WP_User($found_customer);
|
721 |
+
$roles = get_editable_roles();
|
722 |
+
$new_roles_str = str_replace(' ','',$data['user_details']['roles']);
|
723 |
+
$new_roles = explode(',', $new_roles_str);
|
724 |
+
$new_roles = array_intersect( $new_roles, array_keys( $roles ) );
|
725 |
+
error_log(print_r($new_roles,true));
|
726 |
+
$roles_to_remove = array();
|
727 |
+
$user_roles = array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ); //subscriber
|
728 |
+
|
729 |
+
if ( ! $new_roles ) {
|
730 |
+
// If there are no roles, delete all of the user's roles
|
731 |
+
$roles_to_remove = $user_roles;
|
732 |
+
} else {
|
733 |
+
$roles_to_remove = array_diff( $user_roles, $new_roles );
|
734 |
+
}
|
735 |
+
foreach ( $roles_to_remove as $_role ) {
|
736 |
+
$wp_user_object->remove_role( $_role );
|
737 |
+
}
|
738 |
+
if(!empty($new_roles)){
|
739 |
+
// Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
|
740 |
+
$_new_roles = array_diff( $new_roles, array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ) );
|
741 |
+
foreach ( $_new_roles as $_role1 ) {
|
742 |
+
$wp_user_object->add_role( $_role1 );
|
743 |
+
}
|
744 |
+
}
|
745 |
+
$user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
|
746 |
+
$website = (!empty($data['user_details']['user_url'])) ? $data['user_details']['user_url'] : '';
|
747 |
+
$user_registered = (!empty($data['user_details']['user_registered'])) ? $data['user_details']['user_registered'] : '';
|
748 |
+
$display_name = (!empty($data['user_details']['display_name'])) ? $data['user_details']['display_name'] : '';
|
749 |
+
$first_name = (!empty($data['user_details']['first_name'])) ? $data['user_details']['first_name'] : '';
|
750 |
+
$last_name = (!empty($data['user_details']['last_name'])) ? $data['user_details']['last_name'] : '';
|
751 |
+
$user_status = (!empty($data['user_details']['user_status'])) ? $data['user_details']['user_status'] : '';
|
752 |
+
wp_update_user( array(
|
753 |
+
'ID' => $found_customer,
|
754 |
+
'user_nicename' => $user_nicename,
|
755 |
+
'user_url' => $website,
|
756 |
+
'user_registered' => $user_registered,
|
757 |
+
'display_name' => $display_name,
|
758 |
+
'first_name' => $first_name,
|
759 |
+
'last_name' => $last_name,
|
760 |
+
'user_status' => $user_status,
|
761 |
+
)
|
762 |
+
);
|
763 |
+
|
764 |
+
}
|
765 |
+
} else {
|
766 |
+
|
767 |
+
$found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be created without Email.', 'wf_customer_import_export'), $customer_id));
|
768 |
+
}
|
769 |
+
|
770 |
+
return $found_customer;
|
771 |
+
}
|
772 |
+
|
773 |
+
|
774 |
+
/**
|
775 |
+
* Log a row's import status
|
776 |
+
*/
|
777 |
+
protected function add_import_result($status, $reason, $post_id = '', $post_title = '', $user_id = '') {
|
778 |
+
$this->import_results[] = array(
|
779 |
+
'post_title' => $post_title,
|
780 |
+
'post_id' => $post_id,
|
781 |
+
'user_id' => $user_id,
|
782 |
+
'status' => $status,
|
783 |
+
'reason' => $reason
|
784 |
+
);
|
785 |
+
}
|
786 |
+
|
787 |
+
/**
|
788 |
+
* Decide what the maximum file size for downloaded attachments is.
|
789 |
+
* Default is 0 (unlimited), can be filtered via import_attachment_size_limit
|
790 |
+
*
|
791 |
+
* @return int Maximum attachment file size to import
|
792 |
+
*/
|
793 |
+
public function max_attachment_size() {
|
794 |
+
return apply_filters('import_attachment_size_limit', 0);
|
795 |
+
}
|
796 |
+
|
797 |
+
// Display import page title
|
798 |
+
public function header() {
|
799 |
+
echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
800 |
+
echo '<h2>' . ( empty($_GET['merge']) ? __('Import', 'wf_customer_import_export') : __('Merge Users', 'wf_customer_import_export') ) . '</h2>';
|
801 |
+
}
|
802 |
+
|
803 |
+
// Close div.wrap
|
804 |
+
public function footer() {
|
805 |
+
echo '</div>';
|
806 |
+
}
|
807 |
+
|
808 |
+
/**
|
809 |
+
* Display introductory text and file upload form
|
810 |
+
*/
|
811 |
+
public function greet() {
|
812 |
+
$action = 'admin.php?import=wordpress_hf_user_csv&step=1';
|
813 |
+
$bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
|
814 |
+
$size = size_format($bytes);
|
815 |
+
$upload_dir = wp_upload_dir();
|
816 |
+
|
817 |
+
include( 'views/html-wf-import-greeting.php' );
|
818 |
+
}
|
819 |
+
|
820 |
+
/**
|
821 |
+
* Added to http_request_timeout filter to force timeout at 60 seconds during import
|
822 |
+
* @return int 60
|
823 |
+
*/
|
824 |
+
public function bump_request_timeout($val) {
|
825 |
+
return 60;
|
826 |
+
}
|
827 |
+
|
828 |
+
public function wf_let_to_num($size) {
|
829 |
+
$l = substr($size, -1);
|
830 |
+
$ret = substr($size, 0, -1);
|
831 |
+
switch (strtoupper($l)) {
|
832 |
+
case 'P':
|
833 |
+
$ret *= 1024;
|
834 |
+
case 'T':
|
835 |
+
$ret *= 1024;
|
836 |
+
case 'G':
|
837 |
+
$ret *= 1024;
|
838 |
+
case 'M':
|
839 |
+
$ret *= 1024;
|
840 |
+
case 'K':
|
841 |
+
$ret *= 1024;
|
842 |
+
}
|
843 |
+
return $ret;
|
844 |
+
}
|
845 |
+
|
846 |
+
}
|
includes/importer/class-wf-customerimpexpcsv-importer.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_Importer {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* User Exporter Tool
|
10 |
-
*/
|
11 |
-
public static function load_wp_importer() {
|
12 |
-
// Load Importer API
|
13 |
-
require_once ABSPATH . 'wp-admin/includes/import.php';
|
14 |
-
|
15 |
-
if ( ! class_exists( 'WP_Importer' ) ) {
|
16 |
-
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
17 |
-
if ( file_exists( $class_wp_importer ) ) {
|
18 |
-
require $class_wp_importer;
|
19 |
-
}
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* User Importer Tool
|
25 |
-
*/
|
26 |
-
public static function customer_importer() {
|
27 |
-
if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
|
28 |
-
return;
|
29 |
-
}
|
30 |
-
|
31 |
-
self::load_wp_importer();
|
32 |
-
|
33 |
-
// includes
|
34 |
-
require_once 'class-wf-customerimpexpcsv-customer-import.php';
|
35 |
-
require_once 'class-wf-csv-parser.php';
|
36 |
-
|
37 |
-
// Dispatch
|
38 |
-
$GLOBALS['WF_CSV_Customer_Import'] = new WF_CustomerImpExpCsv_Customer_Import();
|
39 |
-
$GLOBALS['WF_CSV_Customer_Import'] ->dispatch();
|
40 |
-
}
|
41 |
}
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
class WF_CustomerImpExpCsv_Importer {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* User Exporter Tool
|
10 |
+
*/
|
11 |
+
public static function load_wp_importer() {
|
12 |
+
// Load Importer API
|
13 |
+
require_once ABSPATH . 'wp-admin/includes/import.php';
|
14 |
+
|
15 |
+
if ( ! class_exists( 'WP_Importer' ) ) {
|
16 |
+
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
17 |
+
if ( file_exists( $class_wp_importer ) ) {
|
18 |
+
require $class_wp_importer;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* User Importer Tool
|
25 |
+
*/
|
26 |
+
public static function customer_importer() {
|
27 |
+
if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
self::load_wp_importer();
|
32 |
+
|
33 |
+
// includes
|
34 |
+
require_once 'class-wf-customerimpexpcsv-customer-import.php';
|
35 |
+
require_once 'class-wf-csv-parser.php';
|
36 |
+
|
37 |
+
// Dispatch
|
38 |
+
$GLOBALS['WF_CSV_Customer_Import'] = new WF_CustomerImpExpCsv_Customer_Import();
|
39 |
+
$GLOBALS['WF_CSV_Customer_Import'] ->dispatch();
|
40 |
+
}
|
41 |
}
|
includes/importer/data/data-wf-reserved-fields-pair.php
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
$columns = array(
|
7 |
-
'ID' => 'ID | Customer/User ID ',
|
8 |
-
'user_login' => 'User Login | User Login',
|
9 |
-
'user_pass' => 'user_pass | user_pass',
|
10 |
-
'user_nicename' => 'user_nicename | user_nicename',
|
11 |
-
'user_email' => 'user_email | user_email',
|
12 |
-
'user_url' => 'user_url | user_url',
|
13 |
-
'user_registered' => 'user_registered | user_registered',
|
14 |
-
'display_name' => 'display_name | display_name',
|
15 |
-
'first_name' => 'first_name | first_name',
|
16 |
-
'last_name' => 'last_name | last_name',
|
17 |
-
'user_status' => 'user_status | user_status',
|
18 |
-
'roles' => 'roles | roles'
|
19 |
-
);
|
20 |
-
|
21 |
return apply_filters('hf_csv_customer_import_columns', $columns);
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
$columns = array(
|
7 |
+
'ID' => 'ID | Customer/User ID ',
|
8 |
+
'user_login' => 'User Login | User Login',
|
9 |
+
'user_pass' => 'user_pass | user_pass',
|
10 |
+
'user_nicename' => 'user_nicename | user_nicename',
|
11 |
+
'user_email' => 'user_email | user_email',
|
12 |
+
'user_url' => 'user_url | user_url',
|
13 |
+
'user_registered' => 'user_registered | user_registered',
|
14 |
+
'display_name' => 'display_name | display_name',
|
15 |
+
'first_name' => 'first_name | first_name',
|
16 |
+
'last_name' => 'last_name | last_name',
|
17 |
+
'user_status' => 'user_status | user_status',
|
18 |
+
'roles' => 'roles | roles'
|
19 |
+
);
|
20 |
+
|
21 |
return apply_filters('hf_csv_customer_import_columns', $columns);
|
includes/importer/views/html-wf-import-greeting.php
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
|
2 |
-
<div class=" woocommerce">
|
3 |
-
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
4 |
-
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
5 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab "><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
|
6 |
-
<a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab nav-tab-active"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
|
7 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'wf_csv_import_export'); ?></a>
|
8 |
-
<a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
|
9 |
-
</h2>
|
10 |
-
<?php
|
11 |
-
include_once("market.php");
|
12 |
-
?>
|
13 |
-
|
14 |
-
</div>
|
15 |
-
<div class="tool-box bg-white p-20p pipe-view">
|
16 |
-
<h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
17 |
-
<p><?php _e('Import Users in CSV format from your computer.You can import users/customers (in CSV format) in to the shop.', 'wf_customer_import_export'); ?></p>
|
18 |
-
<?php if (!empty($upload_dir['error'])) : ?>
|
19 |
-
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'wf_customer_import_export'); ?></p>
|
20 |
-
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
|
21 |
-
|
22 |
-
<?php else : ?>
|
23 |
-
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
|
24 |
-
<table class="form-table">
|
25 |
-
<tbody>
|
26 |
-
<tr>
|
27 |
-
<th>
|
28 |
-
<label for="upload"><?php _e('Select a file from your computer', 'wf_customer_import_export'); ?></label>
|
29 |
-
</th>
|
30 |
-
<td>
|
31 |
-
<input type="file" id="upload" name="import" size="25" />
|
32 |
-
<input type="hidden" name="action" value="save" />
|
33 |
-
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
|
34 |
-
<small><?php printf(__('Maximum size: %s'), $size); ?></small>
|
35 |
-
</td>
|
36 |
-
</tr>
|
37 |
-
</tbody>
|
38 |
-
</table>
|
39 |
-
<p class="submit">
|
40 |
-
<input type="submit" class="button button-primary" value="<?php esc_attr_e('Upload file and import'); ?>" />
|
41 |
-
</p>
|
42 |
-
</form>
|
43 |
-
<?php endif; ?>
|
44 |
</div>
|
1 |
+
|
2 |
+
<div class=" woocommerce">
|
3 |
+
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
4 |
+
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
5 |
+
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab "><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab nav-tab-active"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
|
7 |
+
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'wf_csv_import_export'); ?></a>
|
8 |
+
<a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
|
9 |
+
</h2>
|
10 |
+
<?php
|
11 |
+
include_once("market.php");
|
12 |
+
?>
|
13 |
+
|
14 |
+
</div>
|
15 |
+
<div class="tool-box bg-white p-20p pipe-view">
|
16 |
+
<h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
17 |
+
<p><?php _e('Import Users in CSV format from your computer.You can import users/customers (in CSV format) in to the shop.', 'wf_customer_import_export'); ?></p>
|
18 |
+
<?php if (!empty($upload_dir['error'])) : ?>
|
19 |
+
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'wf_customer_import_export'); ?></p>
|
20 |
+
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
|
21 |
+
|
22 |
+
<?php else : ?>
|
23 |
+
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
|
24 |
+
<table class="form-table">
|
25 |
+
<tbody>
|
26 |
+
<tr>
|
27 |
+
<th>
|
28 |
+
<label for="upload"><?php _e('Select a file from your computer', 'wf_customer_import_export'); ?></label>
|
29 |
+
</th>
|
30 |
+
<td>
|
31 |
+
<input type="file" id="upload" name="import" size="25" />
|
32 |
+
<input type="hidden" name="action" value="save" />
|
33 |
+
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
|
34 |
+
<small><?php printf(__('Maximum size: %s'), $size); ?></small>
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
</tbody>
|
38 |
+
</table>
|
39 |
+
<p class="submit">
|
40 |
+
<input type="submit" class="button button-primary" value="<?php esc_attr_e('Upload file and import'); ?>" />
|
41 |
+
</p>
|
42 |
+
</form>
|
43 |
+
<?php endif; ?>
|
44 |
</div>
|
includes/importer/views/html-wf-import-options.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2'); ?>" method="post" id="nomap">
|
2 |
-
<?php wp_nonce_field('import-woocommerce'); ?>
|
3 |
-
<input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
|
4 |
-
<?php if ($this->file_url_import_enabled) : ?>
|
5 |
-
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
|
6 |
-
<?php endif; ?>
|
7 |
-
<p class="submit">
|
8 |
-
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'wf_customer_import_export'); ?>" />
|
9 |
-
</p>
|
10 |
-
</form>
|
11 |
-
<script type="text/javascript">
|
12 |
-
jQuery(document).ready(function(){
|
13 |
-
jQuery("form#nomap").submit();
|
14 |
-
});
|
15 |
</script>
|
1 |
+
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2'); ?>" method="post" id="nomap">
|
2 |
+
<?php wp_nonce_field('import-woocommerce'); ?>
|
3 |
+
<input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
|
4 |
+
<?php if ($this->file_url_import_enabled) : ?>
|
5 |
+
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
|
6 |
+
<?php endif; ?>
|
7 |
+
<p class="submit">
|
8 |
+
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'wf_customer_import_export'); ?>" />
|
9 |
+
</p>
|
10 |
+
</form>
|
11 |
+
<script type="text/javascript">
|
12 |
+
jQuery(document).ready(function(){
|
13 |
+
jQuery("form#nomap").submit();
|
14 |
+
});
|
15 |
</script>
|
includes/importer/views/market.php
CHANGED
File without changes
|
includes/settings/class-wf-customerimpexpcsv-settings.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
class WF_CustomerImpExpCsv_Settings {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* User Exporter Tool
|
11 |
-
*/
|
12 |
-
public static function save_settings() {
|
13 |
-
wp_redirect(admin_url('/admin.php?page=' . HF_WORDPRESS_CUSTOMER_IM_EX . '&tab=settings'));
|
14 |
-
exit;
|
15 |
-
}
|
16 |
-
|
17 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
class WF_CustomerImpExpCsv_Settings {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* User Exporter Tool
|
11 |
+
*/
|
12 |
+
public static function save_settings() {
|
13 |
+
wp_redirect(admin_url('/admin.php?page=' . HF_WORDPRESS_CUSTOMER_IM_EX . '&tab=settings'));
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
includes/views/export/html-wf-export-customers.php
CHANGED
@@ -1,94 +1,94 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
<div class="tool-box bg-white p-20p pipe-view">
|
4 |
-
<h3 class="title"><?php _e('Export Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
5 |
-
<p><?php _e('Export and download your Users in CSV format. This file can be used to import users back into your Website.', 'wf_customer_import_export'); ?></p>
|
6 |
-
<form action="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&action=export'); ?>" method="post">
|
7 |
-
|
8 |
-
<table class="form-table">
|
9 |
-
<tr>
|
10 |
-
<th>
|
11 |
-
<label for="v_user_roles"><?php _e('User Roles', 'wf_customer_import_export'); ?></label>
|
12 |
-
</th>
|
13 |
-
<td>
|
14 |
-
<select id="v_user_roles" name="user_roles[]" data-placeholder="<?php _e('All Roles', 'wf_customer_import_export'); ?>" class="wc-enhanced-select" multiple="multiple">
|
15 |
-
|
16 |
-
<?php
|
17 |
-
global $wp_roles;
|
18 |
-
|
19 |
-
foreach ( $wp_roles->role_names as $role => $name ) {
|
20 |
-
echo '<option value="' . esc_attr( $role ) . '">' . $name . '</option>';
|
21 |
-
}
|
22 |
-
?>
|
23 |
-
</select>
|
24 |
-
|
25 |
-
<p style="font-size: 12px"><?php _e('Users with these roles will be exported.', 'wf_customer_import_export'); ?></p>
|
26 |
-
</td>
|
27 |
-
</tr>
|
28 |
-
<tr>
|
29 |
-
<th>
|
30 |
-
<label for="v_offset"><?php _e('Offset', 'wf_customer_import_export'); ?></label>
|
31 |
-
</th>
|
32 |
-
<td>
|
33 |
-
<input type="text" name="offset" id="v_offset" placeholder="<?php _e('0', 'wf_customer_import_export'); ?>" class="input-text" />
|
34 |
-
<p style="font-size: 12px"><?php _e('The number of users to skip before returning.', 'wf_customer_import_export'); ?></p>
|
35 |
-
</td>
|
36 |
-
</tr>
|
37 |
-
<tr>
|
38 |
-
<th>
|
39 |
-
<label for="v_limit"><?php _e('Limit', 'wf_customer_import_export'); ?></label>
|
40 |
-
</th>
|
41 |
-
<td>
|
42 |
-
<input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'wf_customer_import_export'); ?>" class="input-text" />
|
43 |
-
<p style="font-size: 12px"><?php _e('The number of users to return.', 'wf_customer_import_export'); ?></p>
|
44 |
-
</td>
|
45 |
-
</tr>
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
<tr>
|
52 |
-
<th>
|
53 |
-
<label for="v_columns"><?php _e('Columns', 'wf_customer_import_export'); ?></label>
|
54 |
-
</th>
|
55 |
-
<table id="datagrid">
|
56 |
-
<th style="text-align: left;">
|
57 |
-
<label for="v_columns"><?php _e('Column', 'wf_customer_import_export'); ?></label>
|
58 |
-
</th>
|
59 |
-
<th style="text-align: left;">
|
60 |
-
<label for="v_columns_name"><?php _e('Column Name', 'wf_customer_import_export'); ?></label>
|
61 |
-
</th>
|
62 |
-
<?php
|
63 |
-
?>
|
64 |
-
<?php foreach ($post_columns as $pkey => $pcolumn) {
|
65 |
-
|
66 |
-
?>
|
67 |
-
<tr>
|
68 |
-
<td>
|
69 |
-
<input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
|
70 |
-
<label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'wf_customer_import_export'); ?></label>
|
71 |
-
</td>
|
72 |
-
<td>
|
73 |
-
<input type="text" name="columns_name[<?php echo $pkey; ?>]" value="<?php echo $pkey; ?>" class="input-text" />
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
<?php } ?>
|
77 |
-
|
78 |
-
</table><br/>
|
79 |
-
</tr>
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
</table>
|
87 |
-
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
|
88 |
-
</form>
|
89 |
-
</div>
|
90 |
-
<script>
|
91 |
-
jQuery(document).ready(function() {
|
92 |
-
jQuery('.wc-enhanced-select').select2();
|
93 |
-
});
|
94 |
</script>
|
1 |
+
|
2 |
+
|
3 |
+
<div class="tool-box bg-white p-20p pipe-view">
|
4 |
+
<h3 class="title"><?php _e('Export Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
5 |
+
<p><?php _e('Export and download your Users in CSV format. This file can be used to import users back into your Website.', 'wf_customer_import_export'); ?></p>
|
6 |
+
<form action="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&action=export'); ?>" method="post">
|
7 |
+
|
8 |
+
<table class="form-table">
|
9 |
+
<tr>
|
10 |
+
<th>
|
11 |
+
<label for="v_user_roles"><?php _e('User Roles', 'wf_customer_import_export'); ?></label>
|
12 |
+
</th>
|
13 |
+
<td>
|
14 |
+
<select id="v_user_roles" name="user_roles[]" data-placeholder="<?php _e('All Roles', 'wf_customer_import_export'); ?>" class="wc-enhanced-select" multiple="multiple">
|
15 |
+
|
16 |
+
<?php
|
17 |
+
global $wp_roles;
|
18 |
+
|
19 |
+
foreach ( $wp_roles->role_names as $role => $name ) {
|
20 |
+
echo '<option value="' . esc_attr( $role ) . '">' . $name . '</option>';
|
21 |
+
}
|
22 |
+
?>
|
23 |
+
</select>
|
24 |
+
|
25 |
+
<p style="font-size: 12px"><?php _e('Users with these roles will be exported.', 'wf_customer_import_export'); ?></p>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<th>
|
30 |
+
<label for="v_offset"><?php _e('Offset', 'wf_customer_import_export'); ?></label>
|
31 |
+
</th>
|
32 |
+
<td>
|
33 |
+
<input type="text" name="offset" id="v_offset" placeholder="<?php _e('0', 'wf_customer_import_export'); ?>" class="input-text" />
|
34 |
+
<p style="font-size: 12px"><?php _e('The number of users to skip before returning.', 'wf_customer_import_export'); ?></p>
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
<tr>
|
38 |
+
<th>
|
39 |
+
<label for="v_limit"><?php _e('Limit', 'wf_customer_import_export'); ?></label>
|
40 |
+
</th>
|
41 |
+
<td>
|
42 |
+
<input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'wf_customer_import_export'); ?>" class="input-text" />
|
43 |
+
<p style="font-size: 12px"><?php _e('The number of users to return.', 'wf_customer_import_export'); ?></p>
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
<tr>
|
52 |
+
<th>
|
53 |
+
<label for="v_columns"><?php _e('Columns', 'wf_customer_import_export'); ?></label>
|
54 |
+
</th>
|
55 |
+
<table id="datagrid">
|
56 |
+
<th style="text-align: left;">
|
57 |
+
<label for="v_columns"><?php _e('Column', 'wf_customer_import_export'); ?></label>
|
58 |
+
</th>
|
59 |
+
<th style="text-align: left;">
|
60 |
+
<label for="v_columns_name"><?php _e('Column Name', 'wf_customer_import_export'); ?></label>
|
61 |
+
</th>
|
62 |
+
<?php
|
63 |
+
?>
|
64 |
+
<?php foreach ($post_columns as $pkey => $pcolumn) {
|
65 |
+
|
66 |
+
?>
|
67 |
+
<tr>
|
68 |
+
<td>
|
69 |
+
<input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
|
70 |
+
<label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'wf_customer_import_export'); ?></label>
|
71 |
+
</td>
|
72 |
+
<td>
|
73 |
+
<input type="text" name="columns_name[<?php echo $pkey; ?>]" value="<?php echo $pkey; ?>" class="input-text" />
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
<?php } ?>
|
77 |
+
|
78 |
+
</table><br/>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
</table>
|
87 |
+
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
|
88 |
+
</form>
|
89 |
+
</div>
|
90 |
+
<script>
|
91 |
+
jQuery(document).ready(function() {
|
92 |
+
jQuery('.wc-enhanced-select').select2();
|
93 |
+
});
|
94 |
</script>
|
includes/views/export/market.php
CHANGED
File without changes
|
includes/views/html-wf-admin-screen.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<div class="wrap woocommerce">
|
2 |
-
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
-
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab <?php echo ($tab == 'export') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
|
5 |
-
<a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
|
6 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'wf_csv_import_export'); ?></a>
|
7 |
-
<a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
|
8 |
-
</h2>
|
9 |
-
<?php
|
10 |
-
switch ($tab) {
|
11 |
-
case "export" :
|
12 |
-
$this->admin_export_page();
|
13 |
-
include_once("export/market.php");
|
14 |
-
break;
|
15 |
-
case "help" :
|
16 |
-
$this->admin_help_page();
|
17 |
-
break;
|
18 |
-
default :
|
19 |
-
$this->admin_export_page();
|
20 |
-
break;
|
21 |
-
}
|
22 |
-
?>
|
23 |
-
|
24 |
</div>
|
1 |
+
<div class="wrap woocommerce">
|
2 |
+
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
+
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
4 |
+
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab <?php echo ($tab == 'export') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
|
5 |
+
<a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
|
6 |
+
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'wf_csv_import_export'); ?></a>
|
7 |
+
<a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
|
8 |
+
</h2>
|
9 |
+
<?php
|
10 |
+
switch ($tab) {
|
11 |
+
case "export" :
|
12 |
+
$this->admin_export_page();
|
13 |
+
include_once("export/market.php");
|
14 |
+
break;
|
15 |
+
case "help" :
|
16 |
+
$this->admin_help_page();
|
17 |
+
break;
|
18 |
+
default :
|
19 |
+
$this->admin_export_page();
|
20 |
+
break;
|
21 |
+
}
|
22 |
+
?>
|
23 |
+
|
24 |
</div>
|
includes/views/html-wf-help-guide.php
CHANGED
File without changes
|
includes/views/import/html-wf-import-customers.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<div class="tool-box">
|
2 |
-
<h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
3 |
-
<p><?php _e('Import Users in CSV format from your computer', 'wf_customer_import_export'); ?></p>
|
4 |
-
<p class="submit">
|
5 |
-
<?php $import_url = admin_url('admin.php?import=wordpress_hf_user_csv'); ?>
|
6 |
-
<a class="button button-primary" id="mylink" href="<?php echo $import_url; ?>"><?php _e('Import Users', 'wf_customer_import_export'); ?></a>
|
7 |
-
</p>
|
8 |
</div>
|
1 |
+
<div class="tool-box">
|
2 |
+
<h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
|
3 |
+
<p><?php _e('Import Users in CSV format from your computer', 'wf_customer_import_export'); ?></p>
|
4 |
+
<p class="submit">
|
5 |
+
<?php $import_url = admin_url('admin.php?import=wordpress_hf_user_csv'); ?>
|
6 |
+
<a class="button button-primary" id="mylink" href="<?php echo $import_url; ?>"><?php _e('Import Users', 'wf_customer_import_export'); ?></a>
|
7 |
+
</p>
|
8 |
</div>
|
lang/wf_customer_import_export-fr_FR.po
CHANGED
File without changes
|
license.txt
CHANGED
@@ -1,708 +1,708 @@
|
|
1 |
-
WordPress Users & WooCommerce Customers Import Export
|
2 |
-
|
3 |
-
Copyright 2018 by the contributors
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License as published by
|
7 |
-
the Free Software Foundation; either version 3 of the License, or
|
8 |
-
(at your option) any later version.
|
9 |
-
|
10 |
-
This program is distributed in the hope that it will be useful,
|
11 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
-
GNU General Public License for more details.
|
14 |
-
|
15 |
-
You should have received a copy of the GNU General Public License
|
16 |
-
along with this program; if not, write to the Free Software
|
17 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
18 |
-
|
19 |
-
This program incorporates work covered by the following copyright and
|
20 |
-
permission notices:
|
21 |
-
|
22 |
-
WordPress Users & WooCommerce Customers Import Export
|
23 |
-
Copyright: 2015-2018 Hikeforce.
|
24 |
-
License: GNU General Public License v3.0
|
25 |
-
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
26 |
-
|
27 |
-
and
|
28 |
-
|
29 |
-
HikeForce
|
30 |
-
|
31 |
-
WordPress Users & WooCommerce Customers Import Export is released under the GPL
|
32 |
-
|
33 |
-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
34 |
-
|
35 |
-
GNU GENERAL PUBLIC LICENSE
|
36 |
-
Version 3, 29 June 2007
|
37 |
-
|
38 |
-
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
39 |
-
Everyone is permitted to copy and distribute verbatim copies
|
40 |
-
of this license document, but changing it is not allowed.
|
41 |
-
|
42 |
-
Preamble
|
43 |
-
|
44 |
-
The GNU General Public License is a free, copyleft license for
|
45 |
-
software and other kinds of works.
|
46 |
-
|
47 |
-
The licenses for most software and other practical works are designed
|
48 |
-
to take away your freedom to share and change the works. By contrast,
|
49 |
-
the GNU General Public License is intended to guarantee your freedom to
|
50 |
-
share and change all versions of a program--to make sure it remains free
|
51 |
-
software for all its users. We, the Free Software Foundation, use the
|
52 |
-
GNU General Public License for most of our software; it applies also to
|
53 |
-
any other work released this way by its authors. You can apply it to
|
54 |
-
your programs, too.
|
55 |
-
|
56 |
-
When we speak of free software, we are referring to freedom, not
|
57 |
-
price. Our General Public Licenses are designed to make sure that you
|
58 |
-
have the freedom to distribute copies of free software (and charge for
|
59 |
-
them if you wish), that you receive source code or can get it if you
|
60 |
-
want it, that you can change the software or use pieces of it in new
|
61 |
-
free programs, and that you know you can do these things.
|
62 |
-
|
63 |
-
To protect your rights, we need to prevent others from denying you
|
64 |
-
these rights or asking you to surrender the rights. Therefore, you have
|
65 |
-
certain responsibilities if you distribute copies of the software, or if
|
66 |
-
you modify it: responsibilities to respect the freedom of others.
|
67 |
-
|
68 |
-
For example, if you distribute copies of such a program, whether
|
69 |
-
gratis or for a fee, you must pass on to the recipients the same
|
70 |
-
freedoms that you received. You must make sure that they, too, receive
|
71 |
-
or can get the source code. And you must show them these terms so they
|
72 |
-
know their rights.
|
73 |
-
|
74 |
-
Developers that use the GNU GPL protect your rights with two steps:
|
75 |
-
(1) assert copyright on the software, and (2) offer you this License
|
76 |
-
giving you legal permission to copy, distribute and/or modify it.
|
77 |
-
|
78 |
-
For the developers' and authors' protection, the GPL clearly explains
|
79 |
-
that there is no warranty for this free software. For both users' and
|
80 |
-
authors' sake, the GPL requires that modified versions be marked as
|
81 |
-
changed, so that their problems will not be attributed erroneously to
|
82 |
-
authors of previous versions.
|
83 |
-
|
84 |
-
Some devices are designed to deny users access to install or run
|
85 |
-
modified versions of the software inside them, although the manufacturer
|
86 |
-
can do so. This is fundamentally incompatible with the aim of
|
87 |
-
protecting users' freedom to change the software. The systematic
|
88 |
-
pattern of such abuse occurs in the area of products for individuals to
|
89 |
-
use, which is precisely where it is most unacceptable. Therefore, we
|
90 |
-
have designed this version of the GPL to prohibit the practice for those
|
91 |
-
products. If such problems arise substantially in other domains, we
|
92 |
-
stand ready to extend this provision to those domains in future versions
|
93 |
-
of the GPL, as needed to protect the freedom of users.
|
94 |
-
|
95 |
-
Finally, every program is threatened constantly by software patents.
|
96 |
-
States should not allow patents to restrict development and use of
|
97 |
-
software on general-purpose computers, but in those that do, we wish to
|
98 |
-
avoid the special danger that patents applied to a free program could
|
99 |
-
make it effectively proprietary. To prevent this, the GPL assures that
|
100 |
-
patents cannot be used to render the program non-free.
|
101 |
-
|
102 |
-
The precise terms and conditions for copying, distribution and
|
103 |
-
modification follow.
|
104 |
-
|
105 |
-
TERMS AND CONDITIONS
|
106 |
-
|
107 |
-
0. Definitions.
|
108 |
-
|
109 |
-
"This License" refers to version 3 of the GNU General Public License.
|
110 |
-
|
111 |
-
"Copyright" also means copyright-like laws that apply to other kinds of
|
112 |
-
works, such as semiconductor masks.
|
113 |
-
|
114 |
-
"The Program" refers to any copyrightable work licensed under this
|
115 |
-
License. Each licensee is addressed as "you". "Licensees" and
|
116 |
-
"recipients" may be individuals or organizations.
|
117 |
-
|
118 |
-
To "modify" a work means to copy from or adapt all or part of the work
|
119 |
-
in a fashion requiring copyright permission, other than the making of an
|
120 |
-
exact copy. The resulting work is called a "modified version" of the
|
121 |
-
earlier work or a work "based on" the earlier work.
|
122 |
-
|
123 |
-
A "covered work" means either the unmodified Program or a work based
|
124 |
-
on the Program.
|
125 |
-
|
126 |
-
To "propagate" a work means to do anything with it that, without
|
127 |
-
permission, would make you directly or secondarily liable for
|
128 |
-
infringement under applicable copyright law, except executing it on a
|
129 |
-
computer or modifying a private copy. Propagation includes copying,
|
130 |
-
distribution (with or without modification), making available to the
|
131 |
-
public, and in some countries other activities as well.
|
132 |
-
|
133 |
-
To "convey" a work means any kind of propagation that enables other
|
134 |
-
parties to make or receive copies. Mere interaction with a user through
|
135 |
-
a computer network, with no transfer of a copy, is not conveying.
|
136 |
-
|
137 |
-
An interactive user interface displays "Appropriate Legal Notices"
|
138 |
-
to the extent that it includes a convenient and prominently visible
|
139 |
-
feature that (1) displays an appropriate copyright notice, and (2)
|
140 |
-
tells the user that there is no warranty for the work (except to the
|
141 |
-
extent that warranties are provided), that licensees may convey the
|
142 |
-
work under this License, and how to view a copy of this License. If
|
143 |
-
the interface presents a list of user commands or options, such as a
|
144 |
-
menu, a prominent item in the list meets this criterion.
|
145 |
-
|
146 |
-
1. Source Code.
|
147 |
-
|
148 |
-
The "source code" for a work means the preferred form of the work
|
149 |
-
for making modifications to it. "Object code" means any non-source
|
150 |
-
form of a work.
|
151 |
-
|
152 |
-
A "Standard Interface" means an interface that either is an official
|
153 |
-
standard defined by a recognized standards body, or, in the case of
|
154 |
-
interfaces specified for a particular programming language, one that
|
155 |
-
is widely used among developers working in that language.
|
156 |
-
|
157 |
-
The "System Libraries" of an executable work include anything, other
|
158 |
-
than the work as a whole, that (a) is included in the normal form of
|
159 |
-
packaging a Major Component, but which is not part of that Major
|
160 |
-
Component, and (b) serves only to enable use of the work with that
|
161 |
-
Major Component, or to implement a Standard Interface for which an
|
162 |
-
implementation is available to the public in source code form. A
|
163 |
-
"Major Component", in this context, means a major essential component
|
164 |
-
(kernel, window system, and so on) of the specific operating system
|
165 |
-
(if any) on which the executable work runs, or a compiler used to
|
166 |
-
produce the work, or an object code interpreter used to run it.
|
167 |
-
|
168 |
-
The "Corresponding Source" for a work in object code form means all
|
169 |
-
the source code needed to generate, install, and (for an executable
|
170 |
-
work) run the object code and to modify the work, including scripts to
|
171 |
-
control those activities. However, it does not include the work's
|
172 |
-
System Libraries, or general-purpose tools or generally available free
|
173 |
-
programs which are used unmodified in performing those activities but
|
174 |
-
which are not part of the work. For example, Corresponding Source
|
175 |
-
includes interface definition files associated with source files for
|
176 |
-
the work, and the source code for shared libraries and dynamically
|
177 |
-
linked subprograms that the work is specifically designed to require,
|
178 |
-
such as by intimate data communication or control flow between those
|
179 |
-
subprograms and other parts of the work.
|
180 |
-
|
181 |
-
The Corresponding Source need not include anything that users
|
182 |
-
can regenerate automatically from other parts of the Corresponding
|
183 |
-
Source.
|
184 |
-
|
185 |
-
The Corresponding Source for a work in source code form is that
|
186 |
-
same work.
|
187 |
-
|
188 |
-
2. Basic Permissions.
|
189 |
-
|
190 |
-
All rights granted under this License are granted for the term of
|
191 |
-
copyright on the Program, and are irrevocable provided the stated
|
192 |
-
conditions are met. This License explicitly affirms your unlimited
|
193 |
-
permission to run the unmodified Program. The output from running a
|
194 |
-
covered work is covered by this License only if the output, given its
|
195 |
-
content, constitutes a covered work. This License acknowledges your
|
196 |
-
rights of fair use or other equivalent, as provided by copyright law.
|
197 |
-
|
198 |
-
You may make, run and propagate covered works that you do not
|
199 |
-
convey, without conditions so long as your license otherwise remains
|
200 |
-
in force. You may convey covered works to others for the sole purpose
|
201 |
-
of having them make modifications exclusively for you, or provide you
|
202 |
-
with facilities for running those works, provided that you comply with
|
203 |
-
the terms of this License in conveying all material for which you do
|
204 |
-
not control copyright. Those thus making or running the covered works
|
205 |
-
for you must do so exclusively on your behalf, under your direction
|
206 |
-
and control, on terms that prohibit them from making any copies of
|
207 |
-
your copyrighted material outside their relationship with you.
|
208 |
-
|
209 |
-
Conveying under any other circumstances is permitted solely under
|
210 |
-
the conditions stated below. Sublicensing is not allowed; section 10
|
211 |
-
makes it unnecessary.
|
212 |
-
|
213 |
-
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
214 |
-
|
215 |
-
No covered work shall be deemed part of an effective technological
|
216 |
-
measure under any applicable law fulfilling obligations under article
|
217 |
-
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
218 |
-
similar laws prohibiting or restricting circumvention of such
|
219 |
-
measures.
|
220 |
-
|
221 |
-
When you convey a covered work, you waive any legal power to forbid
|
222 |
-
circumvention of technological measures to the extent such circumvention
|
223 |
-
is effected by exercising rights under this License with respect to
|
224 |
-
the covered work, and you disclaim any intention to limit operation or
|
225 |
-
modification of the work as a means of enforcing, against the work's
|
226 |
-
users, your or third parties' legal rights to forbid circumvention of
|
227 |
-
technological measures.
|
228 |
-
|
229 |
-
4. Conveying Verbatim Copies.
|
230 |
-
|
231 |
-
You may convey verbatim copies of the Program's source code as you
|
232 |
-
receive it, in any medium, provided that you conspicuously and
|
233 |
-
appropriately publish on each copy an appropriate copyright notice;
|
234 |
-
keep intact all notices stating that this License and any
|
235 |
-
non-permissive terms added in accord with section 7 apply to the code;
|
236 |
-
keep intact all notices of the absence of any warranty; and give all
|
237 |
-
recipients a copy of this License along with the Program.
|
238 |
-
|
239 |
-
You may charge any price or no price for each copy that you convey,
|
240 |
-
and you may offer support or warranty protection for a fee.
|
241 |
-
|
242 |
-
5. Conveying Modified Source Versions.
|
243 |
-
|
244 |
-
You may convey a work based on the Program, or the modifications to
|
245 |
-
produce it from the Program, in the form of source code under the
|
246 |
-
terms of section 4, provided that you also meet all of these conditions:
|
247 |
-
|
248 |
-
a) The work must carry prominent notices stating that you modified
|
249 |
-
it, and giving a relevant date.
|
250 |
-
|
251 |
-
b) The work must carry prominent notices stating that it is
|
252 |
-
released under this License and any conditions added under section
|
253 |
-
7. This requirement modifies the requirement in section 4 to
|
254 |
-
"keep intact all notices".
|
255 |
-
|
256 |
-
c) You must license the entire work, as a whole, under this
|
257 |
-
License to anyone who comes into possession of a copy. This
|
258 |
-
License will therefore apply, along with any applicable section 7
|
259 |
-
additional terms, to the whole of the work, and all its parts,
|
260 |
-
regardless of how they are packaged. This License gives no
|
261 |
-
permission to license the work in any other way, but it does not
|
262 |
-
invalidate such permission if you have separately received it.
|
263 |
-
|
264 |
-
d) If the work has interactive user interfaces, each must display
|
265 |
-
Appropriate Legal Notices; however, if the Program has interactive
|
266 |
-
interfaces that do not display Appropriate Legal Notices, your
|
267 |
-
work need not make them do so.
|
268 |
-
|
269 |
-
A compilation of a covered work with other separate and independent
|
270 |
-
works, which are not by their nature extensions of the covered work,
|
271 |
-
and which are not combined with it such as to form a larger program,
|
272 |
-
in or on a volume of a storage or distribution medium, is called an
|
273 |
-
"aggregate" if the compilation and its resulting copyright are not
|
274 |
-
used to limit the access or legal rights of the compilation's users
|
275 |
-
beyond what the individual works permit. Inclusion of a covered work
|
276 |
-
in an aggregate does not cause this License to apply to the other
|
277 |
-
parts of the aggregate.
|
278 |
-
|
279 |
-
6. Conveying Non-Source Forms.
|
280 |
-
|
281 |
-
You may convey a covered work in object code form under the terms
|
282 |
-
of sections 4 and 5, provided that you also convey the
|
283 |
-
machine-readable Corresponding Source under the terms of this License,
|
284 |
-
in one of these ways:
|
285 |
-
|
286 |
-
a) Convey the object code in, or embodied in, a physical product
|
287 |
-
(including a physical distribution medium), accompanied by the
|
288 |
-
Corresponding Source fixed on a durable physical medium
|
289 |
-
customarily used for software interchange.
|
290 |
-
|
291 |
-
b) Convey the object code in, or embodied in, a physical product
|
292 |
-
(including a physical distribution medium), accompanied by a
|
293 |
-
written offer, valid for at least three years and valid for as
|
294 |
-
long as you offer spare parts or customer support for that product
|
295 |
-
model, to give anyone who possesses the object code either (1) a
|
296 |
-
copy of the Corresponding Source for all the software in the
|
297 |
-
product that is covered by this License, on a durable physical
|
298 |
-
medium customarily used for software interchange, for a price no
|
299 |
-
more than your reasonable cost of physically performing this
|
300 |
-
conveying of source, or (2) access to copy the
|
301 |
-
Corresponding Source from a network server at no charge.
|
302 |
-
|
303 |
-
c) Convey individual copies of the object code with a copy of the
|
304 |
-
written offer to provide the Corresponding Source. This
|
305 |
-
alternative is allowed only occasionally and noncommercially, and
|
306 |
-
only if you received the object code with such an offer, in accord
|
307 |
-
with subsection 6b.
|
308 |
-
|
309 |
-
d) Convey the object code by offering access from a designated
|
310 |
-
place (gratis or for a charge), and offer equivalent access to the
|
311 |
-
Corresponding Source in the same way through the same place at no
|
312 |
-
further charge. You need not require recipients to copy the
|
313 |
-
Corresponding Source along with the object code. If the place to
|
314 |
-
copy the object code is a network server, the Corresponding Source
|
315 |
-
may be on a different server (operated by you or a third party)
|
316 |
-
that supports equivalent copying facilities, provided you maintain
|
317 |
-
clear directions next to the object code saying where to find the
|
318 |
-
Corresponding Source. Regardless of what server hosts the
|
319 |
-
Corresponding Source, you remain obligated to ensure that it is
|
320 |
-
available for as long as needed to satisfy these requirements.
|
321 |
-
|
322 |
-
e) Convey the object code using peer-to-peer transmission, provided
|
323 |
-
you inform other peers where the object code and Corresponding
|
324 |
-
Source of the work are being offered to the general public at no
|
325 |
-
charge under subsection 6d.
|
326 |
-
|
327 |
-
A separable portion of the object code, whose source code is excluded
|
328 |
-
from the Corresponding Source as a System Library, need not be
|
329 |
-
included in conveying the object code work.
|
330 |
-
|
331 |
-
A "User Product" is either (1) a "consumer product", which means any
|
332 |
-
tangible personal property which is normally used for personal, family,
|
333 |
-
or household purposes, or (2) anything designed or sold for incorporation
|
334 |
-
into a dwelling. In determining whether a product is a consumer product,
|
335 |
-
doubtful cases shall be resolved in favor of coverage. For a particular
|
336 |
-
product received by a particular user, "normally used" refers to a
|
337 |
-
typical or common use of that class of product, regardless of the status
|
338 |
-
of the particular user or of the way in which the particular user
|
339 |
-
actually uses, or expects or is expected to use, the product. A product
|
340 |
-
is a consumer product regardless of whether the product has substantial
|
341 |
-
commercial, industrial or non-consumer uses, unless such uses represent
|
342 |
-
the only significant mode of use of the product.
|
343 |
-
|
344 |
-
"Installation Information" for a User Product means any methods,
|
345 |
-
procedures, authorization keys, or other information required to install
|
346 |
-
and execute modified versions of a covered work in that User Product from
|
347 |
-
a modified version of its Corresponding Source. The information must
|
348 |
-
suffice to ensure that the continued functioning of the modified object
|
349 |
-
code is in no case prevented or interfered with solely because
|
350 |
-
modification has been made.
|
351 |
-
|
352 |
-
If you convey an object code work under this section in, or with, or
|
353 |
-
specifically for use in, a User Product, and the conveying occurs as
|
354 |
-
part of a transaction in which the right of possession and use of the
|
355 |
-
User Product is transferred to the recipient in perpetuity or for a
|
356 |
-
fixed term (regardless of how the transaction is characterized), the
|
357 |
-
Corresponding Source conveyed under this section must be accompanied
|
358 |
-
by the Installation Information. But this requirement does not apply
|
359 |
-
if neither you nor any third party retains the ability to install
|
360 |
-
modified object code on the User Product (for example, the work has
|
361 |
-
been installed in ROM).
|
362 |
-
|
363 |
-
The requirement to provide Installation Information does not include a
|
364 |
-
requirement to continue to provide support service, warranty, or updates
|
365 |
-
for a work that has been modified or installed by the recipient, or for
|
366 |
-
the User Product in which it has been modified or installed. Access to a
|
367 |
-
network may be denied when the modification itself materially and
|
368 |
-
adversely affects the operation of the network or violates the rules and
|
369 |
-
protocols for communication across the network.
|
370 |
-
|
371 |
-
Corresponding Source conveyed, and Installation Information provided,
|
372 |
-
in accord with this section must be in a format that is publicly
|
373 |
-
documented (and with an implementation available to the public in
|
374 |
-
source code form), and must require no special password or key for
|
375 |
-
unpacking, reading or copying.
|
376 |
-
|
377 |
-
7. Additional Terms.
|
378 |
-
|
379 |
-
"Additional permissions" are terms that supplement the terms of this
|
380 |
-
License by making exceptions from one or more of its conditions.
|
381 |
-
Additional permissions that are applicable to the entire Program shall
|
382 |
-
be treated as though they were included in this License, to the extent
|
383 |
-
that they are valid under applicable law. If additional permissions
|
384 |
-
apply only to part of the Program, that part may be used separately
|
385 |
-
under those permissions, but the entire Program remains governed by
|
386 |
-
this License without regard to the additional permissions.
|
387 |
-
|
388 |
-
When you convey a copy of a covered work, you may at your option
|
389 |
-
remove any additional permissions from that copy, or from any part of
|
390 |
-
it. (Additional permissions may be written to require their own
|
391 |
-
removal in certain cases when you modify the work.) You may place
|
392 |
-
additional permissions on material, added by you to a covered work,
|
393 |
-
for which you have or can give appropriate copyright permission.
|
394 |
-
|
395 |
-
Notwithstanding any other provision of this License, for material you
|
396 |
-
add to a covered work, you may (if authorized by the copyright holders of
|
397 |
-
that material) supplement the terms of this License with terms:
|
398 |
-
|
399 |
-
a) Disclaiming warranty or limiting liability differently from the
|
400 |
-
terms of sections 15 and 16 of this License; or
|
401 |
-
|
402 |
-
b) Requiring preservation of specified reasonable legal notices or
|
403 |
-
author attributions in that material or in the Appropriate Legal
|
404 |
-
Notices displayed by works containing it; or
|
405 |
-
|
406 |
-
c) Prohibiting misrepresentation of the origin of that material, or
|
407 |
-
requiring that modified versions of such material be marked in
|
408 |
-
reasonable ways as different from the original version; or
|
409 |
-
|
410 |
-
d) Limiting the use for publicity purposes of names of licensors or
|
411 |
-
authors of the material; or
|
412 |
-
|
413 |
-
e) Declining to grant rights under trademark law for use of some
|
414 |
-
trade names, trademarks, or service marks; or
|
415 |
-
|
416 |
-
f) Requiring indemnification of licensors and authors of that
|
417 |
-
material by anyone who conveys the material (or modified versions of
|
418 |
-
it) with contractual assumptions of liability to the recipient, for
|
419 |
-
any liability that these contractual assumptions directly impose on
|
420 |
-
those licensors and authors.
|
421 |
-
|
422 |
-
All other non-permissive additional terms are considered "further
|
423 |
-
restrictions" within the meaning of section 10. If the Program as you
|
424 |
-
received it, or any part of it, contains a notice stating that it is
|
425 |
-
governed by this License along with a term that is a further
|
426 |
-
restriction, you may remove that term. If a license document contains
|
427 |
-
a further restriction but permits relicensing or conveying under this
|
428 |
-
License, you may add to a covered work material governed by the terms
|
429 |
-
of that license document, provided that the further restriction does
|
430 |
-
not survive such relicensing or conveying.
|
431 |
-
|
432 |
-
If you add terms to a covered work in accord with this section, you
|
433 |
-
must place, in the relevant source files, a statement of the
|
434 |
-
additional terms that apply to those files, or a notice indicating
|
435 |
-
where to find the applicable terms.
|
436 |
-
|
437 |
-
Additional terms, permissive or non-permissive, may be stated in the
|
438 |
-
form of a separately written license, or stated as exceptions;
|
439 |
-
the above requirements apply either way.
|
440 |
-
|
441 |
-
8. Termination.
|
442 |
-
|
443 |
-
You may not propagate or modify a covered work except as expressly
|
444 |
-
provided under this License. Any attempt otherwise to propagate or
|
445 |
-
modify it is void, and will automatically terminate your rights under
|
446 |
-
this License (including any patent licenses granted under the third
|
447 |
-
paragraph of section 11).
|
448 |
-
|
449 |
-
However, if you cease all violation of this License, then your
|
450 |
-
license from a particular copyright holder is reinstated (a)
|
451 |
-
provisionally, unless and until the copyright holder explicitly and
|
452 |
-
finally terminates your license, and (b) permanently, if the copyright
|
453 |
-
holder fails to notify you of the violation by some reasonable means
|
454 |
-
prior to 60 days after the cessation.
|
455 |
-
|
456 |
-
Moreover, your license from a particular copyright holder is
|
457 |
-
reinstated permanently if the copyright holder notifies you of the
|
458 |
-
violation by some reasonable means, this is the first time you have
|
459 |
-
received notice of violation of this License (for any work) from that
|
460 |
-
copyright holder, and you cure the violation prior to 30 days after
|
461 |
-
your receipt of the notice.
|
462 |
-
|
463 |
-
Termination of your rights under this section does not terminate the
|
464 |
-
licenses of parties who have received copies or rights from you under
|
465 |
-
this License. If your rights have been terminated and not permanently
|
466 |
-
reinstated, you do not qualify to receive new licenses for the same
|
467 |
-
material under section 10.
|
468 |
-
|
469 |
-
9. Acceptance Not Required for Having Copies.
|
470 |
-
|
471 |
-
You are not required to accept this License in order to receive or
|
472 |
-
run a copy of the Program. Ancillary propagation of a covered work
|
473 |
-
occurring solely as a consequence of using peer-to-peer transmission
|
474 |
-
to receive a copy likewise does not require acceptance. However,
|
475 |
-
nothing other than this License grants you permission to propagate or
|
476 |
-
modify any covered work. These actions infringe copyright if you do
|
477 |
-
not accept this License. Therefore, by modifying or propagating a
|
478 |
-
covered work, you indicate your acceptance of this License to do so.
|
479 |
-
|
480 |
-
10. Automatic Licensing of Downstream Recipients.
|
481 |
-
|
482 |
-
Each time you convey a covered work, the recipient automatically
|
483 |
-
receives a license from the original licensors, to run, modify and
|
484 |
-
propagate that work, subject to this License. You are not responsible
|
485 |
-
for enforcing compliance by third parties with this License.
|
486 |
-
|
487 |
-
An "entity transaction" is a transaction transferring control of an
|
488 |
-
organization, or substantially all assets of one, or subdividing an
|
489 |
-
organization, or merging organizations. If propagation of a covered
|
490 |
-
work results from an entity transaction, each party to that
|
491 |
-
transaction who receives a copy of the work also receives whatever
|
492 |
-
licenses to the work the party's predecessor in interest had or could
|
493 |
-
give under the previous paragraph, plus a right to possession of the
|
494 |
-
Corresponding Source of the work from the predecessor in interest, if
|
495 |
-
the predecessor has it or can get it with reasonable efforts.
|
496 |
-
|
497 |
-
You may not impose any further restrictions on the exercise of the
|
498 |
-
rights granted or affirmed under this License. For example, you may
|
499 |
-
not impose a license fee, royalty, or other charge for exercise of
|
500 |
-
rights granted under this License, and you may not initiate litigation
|
501 |
-
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
502 |
-
any patent claim is infringed by making, using, selling, offering for
|
503 |
-
sale, or importing the Program or any portion of it.
|
504 |
-
|
505 |
-
11. Patents.
|
506 |
-
|
507 |
-
A "contributor" is a copyright holder who authorizes use under this
|
508 |
-
License of the Program or a work on which the Program is based. The
|
509 |
-
work thus licensed is called the contributor's "contributor version".
|
510 |
-
|
511 |
-
A contributor's "essential patent claims" are all patent claims
|
512 |
-
owned or controlled by the contributor, whether already acquired or
|
513 |
-
hereafter acquired, that would be infringed by some manner, permitted
|
514 |
-
by this License, of making, using, or selling its contributor version,
|
515 |
-
but do not include claims that would be infringed only as a
|
516 |
-
consequence of further modification of the contributor version. For
|
517 |
-
purposes of this definition, "control" includes the right to grant
|
518 |
-
patent sublicenses in a manner consistent with the requirements of
|
519 |
-
this License.
|
520 |
-
|
521 |
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
522 |
-
patent license under the contributor's essential patent claims, to
|
523 |
-
make, use, sell, offer for sale, import and otherwise run, modify and
|
524 |
-
propagate the contents of its contributor version.
|
525 |
-
|
526 |
-
In the following three paragraphs, a "patent license" is any express
|
527 |
-
agreement or commitment, however denominated, not to enforce a patent
|
528 |
-
(such as an express permission to practice a patent or covenant not to
|
529 |
-
sue for patent infringement). To "grant" such a patent license to a
|
530 |
-
party means to make such an agreement or commitment not to enforce a
|
531 |
-
patent against the party.
|
532 |
-
|
533 |
-
If you convey a covered work, knowingly relying on a patent license,
|
534 |
-
and the Corresponding Source of the work is not available for anyone
|
535 |
-
to copy, free of charge and under the terms of this License, through a
|
536 |
-
publicly available network server or other readily accessible means,
|
537 |
-
then you must either (1) cause the Corresponding Source to be so
|
538 |
-
available, or (2) arrange to deprive yourself of the benefit of the
|
539 |
-
patent license for this particular work, or (3) arrange, in a manner
|
540 |
-
consistent with the requirements of this License, to extend the patent
|
541 |
-
license to downstream recipients. "Knowingly relying" means you have
|
542 |
-
actual knowledge that, but for the patent license, your conveying the
|
543 |
-
covered work in a country, or your recipient's use of the covered work
|
544 |
-
in a country, would infringe one or more identifiable patents in that
|
545 |
-
country that you have reason to believe are valid.
|
546 |
-
|
547 |
-
If, pursuant to or in connection with a single transaction or
|
548 |
-
arrangement, you convey, or propagate by procuring conveyance of, a
|
549 |
-
covered work, and grant a patent license to some of the parties
|
550 |
-
receiving the covered work authorizing them to use, propagate, modify
|
551 |
-
or convey a specific copy of the covered work, then the patent license
|
552 |
-
you grant is automatically extended to all recipients of the covered
|
553 |
-
work and works based on it.
|
554 |
-
|
555 |
-
A patent license is "discriminatory" if it does not include within
|
556 |
-
the scope of its coverage, prohibits the exercise of, or is
|
557 |
-
conditioned on the non-exercise of one or more of the rights that are
|
558 |
-
specifically granted under this License. You may not convey a covered
|
559 |
-
work if you are a party to an arrangement with a third party that is
|
560 |
-
in the business of distributing software, under which you make payment
|
561 |
-
to the third party based on the extent of your activity of conveying
|
562 |
-
the work, and under which the third party grants, to any of the
|
563 |
-
parties who would receive the covered work from you, a discriminatory
|
564 |
-
patent license (a) in connection with copies of the covered work
|
565 |
-
conveyed by you (or copies made from those copies), or (b) primarily
|
566 |
-
for and in connection with specific products or compilations that
|
567 |
-
contain the covered work, unless you entered into that arrangement,
|
568 |
-
or that patent license was granted, prior to 28 March 2007.
|
569 |
-
|
570 |
-
Nothing in this License shall be construed as excluding or limiting
|
571 |
-
any implied license or other defenses to infringement that may
|
572 |
-
otherwise be available to you under applicable patent law.
|
573 |
-
|
574 |
-
12. No Surrender of Others' Freedom.
|
575 |
-
|
576 |
-
If conditions are imposed on you (whether by court order, agreement or
|
577 |
-
otherwise) that contradict the conditions of this License, they do not
|
578 |
-
excuse you from the conditions of this License. If you cannot convey a
|
579 |
-
covered work so as to satisfy simultaneously your obligations under this
|
580 |
-
License and any other pertinent obligations, then as a consequence you may
|
581 |
-
not convey it at all. For example, if you agree to terms that obligate you
|
582 |
-
to collect a royalty for further conveying from those to whom you convey
|
583 |
-
the Program, the only way you could satisfy both those terms and this
|
584 |
-
License would be to refrain entirely from conveying the Program.
|
585 |
-
|
586 |
-
13. Use with the GNU Affero General Public License.
|
587 |
-
|
588 |
-
Notwithstanding any other provision of this License, you have
|
589 |
-
permission to link or combine any covered work with a work licensed
|
590 |
-
under version 3 of the GNU Affero General Public License into a single
|
591 |
-
combined work, and to convey the resulting work. The terms of this
|
592 |
-
License will continue to apply to the part which is the covered work,
|
593 |
-
but the special requirements of the GNU Affero General Public License,
|
594 |
-
section 13, concerning interaction through a network will apply to the
|
595 |
-
combination as such.
|
596 |
-
|
597 |
-
14. Revised Versions of this License.
|
598 |
-
|
599 |
-
The Free Software Foundation may publish revised and/or new versions of
|
600 |
-
the GNU General Public License from time to time. Such new versions will
|
601 |
-
be similar in spirit to the present version, but may differ in detail to
|
602 |
-
address new problems or concerns.
|
603 |
-
|
604 |
-
Each version is given a distinguishing version number. If the
|
605 |
-
Program specifies that a certain numbered version of the GNU General
|
606 |
-
Public License "or any later version" applies to it, you have the
|
607 |
-
option of following the terms and conditions either of that numbered
|
608 |
-
version or of any later version published by the Free Software
|
609 |
-
Foundation. If the Program does not specify a version number of the
|
610 |
-
GNU General Public License, you may choose any version ever published
|
611 |
-
by the Free Software Foundation.
|
612 |
-
|
613 |
-
If the Program specifies that a proxy can decide which future
|
614 |
-
versions of the GNU General Public License can be used, that proxy's
|
615 |
-
public statement of acceptance of a version permanently authorizes you
|
616 |
-
to choose that version for the Program.
|
617 |
-
|
618 |
-
Later license versions may give you additional or different
|
619 |
-
permissions. However, no additional obligations are imposed on any
|
620 |
-
author or copyright holder as a result of your choosing to follow a
|
621 |
-
later version.
|
622 |
-
|
623 |
-
15. Disclaimer of Warranty.
|
624 |
-
|
625 |
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
626 |
-
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
627 |
-
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
628 |
-
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
629 |
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
630 |
-
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
631 |
-
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
632 |
-
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
633 |
-
|
634 |
-
16. Limitation of Liability.
|
635 |
-
|
636 |
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
637 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
638 |
-
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
639 |
-
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
640 |
-
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
641 |
-
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
642 |
-
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
643 |
-
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
644 |
-
SUCH DAMAGES.
|
645 |
-
|
646 |
-
17. Interpretation of Sections 15 and 16.
|
647 |
-
|
648 |
-
If the disclaimer of warranty and limitation of liability provided
|
649 |
-
above cannot be given local legal effect according to their terms,
|
650 |
-
reviewing courts shall apply local law that most closely approximates
|
651 |
-
an absolute waiver of all civil liability in connection with the
|
652 |
-
Program, unless a warranty or assumption of liability accompanies a
|
653 |
-
copy of the Program in return for a fee.
|
654 |
-
|
655 |
-
END OF TERMS AND CONDITIONS
|
656 |
-
|
657 |
-
How to Apply These Terms to Your New Programs
|
658 |
-
|
659 |
-
If you develop a new program, and you want it to be of the greatest
|
660 |
-
possible use to the public, the best way to achieve this is to make it
|
661 |
-
free software which everyone can redistribute and change under these terms.
|
662 |
-
|
663 |
-
To do so, attach the following notices to the program. It is safest
|
664 |
-
to attach them to the start of each source file to most effectively
|
665 |
-
state the exclusion of warranty; and each file should have at least
|
666 |
-
the "copyright" line and a pointer to where the full notice is found.
|
667 |
-
|
668 |
-
<one line to give the program's name and a brief idea of what it does.>
|
669 |
-
Copyright © <year> <name of author>
|
670 |
-
|
671 |
-
This program is free software: you can redistribute it and/or modify
|
672 |
-
it under the terms of the GNU General Public License as published by
|
673 |
-
the Free Software Foundation, either version 3 of the License, or
|
674 |
-
(at your option) any later version.
|
675 |
-
|
676 |
-
This program is distributed in the hope that it will be useful,
|
677 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
678 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
679 |
-
GNU General Public License for more details.
|
680 |
-
|
681 |
-
You should have received a copy of the GNU General Public License
|
682 |
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
683 |
-
|
684 |
-
Also add information on how to contact you by electronic and paper mail.
|
685 |
-
|
686 |
-
If the program does terminal interaction, make it output a short
|
687 |
-
notice like this when it starts in an interactive mode:
|
688 |
-
|
689 |
-
<program> Copyright © <year> <name of author>
|
690 |
-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
691 |
-
This is free software, and you are welcome to redistribute it
|
692 |
-
under certain conditions; type `show c' for details.
|
693 |
-
|
694 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
695 |
-
parts of the General Public License. Of course, your program's commands
|
696 |
-
might be different; for a GUI interface, you would use an "about box".
|
697 |
-
|
698 |
-
You should also get your employer (if you work as a programmer) or school,
|
699 |
-
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
700 |
-
For more information on this, and how to apply and follow the GNU GPL, see
|
701 |
-
<http://www.gnu.org/licenses/>.
|
702 |
-
|
703 |
-
The GNU General Public License does not permit incorporating your program
|
704 |
-
into proprietary programs. If your program is a subroutine library, you
|
705 |
-
may consider it more useful to permit linking proprietary applications with
|
706 |
-
the library. If this is what you want to do, use the GNU Lesser General
|
707 |
-
Public License instead of this License. But first, please read
|
708 |
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
1 |
+
WordPress Users & WooCommerce Customers Import Export
|
2 |
+
|
3 |
+
Copyright 2018 by the contributors
|
4 |
+
|
5 |
+
This program is free software; you can redistribute it and/or modify
|
6 |
+
it under the terms of the GNU General Public License as published by
|
7 |
+
the Free Software Foundation; either version 3 of the License, or
|
8 |
+
(at your option) any later version.
|
9 |
+
|
10 |
+
This program is distributed in the hope that it will be useful,
|
11 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
GNU General Public License for more details.
|
14 |
+
|
15 |
+
You should have received a copy of the GNU General Public License
|
16 |
+
along with this program; if not, write to the Free Software
|
17 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
18 |
+
|
19 |
+
This program incorporates work covered by the following copyright and
|
20 |
+
permission notices:
|
21 |
+
|
22 |
+
WordPress Users & WooCommerce Customers Import Export
|
23 |
+
Copyright: 2015-2018 Hikeforce.
|
24 |
+
License: GNU General Public License v3.0
|
25 |
+
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
26 |
+
|
27 |
+
and
|
28 |
+
|
29 |
+
HikeForce
|
30 |
+
|
31 |
+
WordPress Users & WooCommerce Customers Import Export is released under the GPL
|
32 |
+
|
33 |
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
34 |
+
|
35 |
+
GNU GENERAL PUBLIC LICENSE
|
36 |
+
Version 3, 29 June 2007
|
37 |
+
|
38 |
+
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
39 |
+
Everyone is permitted to copy and distribute verbatim copies
|
40 |
+
of this license document, but changing it is not allowed.
|
41 |
+
|
42 |
+
Preamble
|
43 |
+
|
44 |
+
The GNU General Public License is a free, copyleft license for
|
45 |
+
software and other kinds of works.
|
46 |
+
|
47 |
+
The licenses for most software and other practical works are designed
|
48 |
+
to take away your freedom to share and change the works. By contrast,
|
49 |
+
the GNU General Public License is intended to guarantee your freedom to
|
50 |
+
share and change all versions of a program--to make sure it remains free
|
51 |
+
software for all its users. We, the Free Software Foundation, use the
|
52 |
+
GNU General Public License for most of our software; it applies also to
|
53 |
+
any other work released this way by its authors. You can apply it to
|
54 |
+
your programs, too.
|
55 |
+
|
56 |
+
When we speak of free software, we are referring to freedom, not
|
57 |
+
price. Our General Public Licenses are designed to make sure that you
|
58 |
+
have the freedom to distribute copies of free software (and charge for
|
59 |
+
them if you wish), that you receive source code or can get it if you
|
60 |
+
want it, that you can change the software or use pieces of it in new
|
61 |
+
free programs, and that you know you can do these things.
|
62 |
+
|
63 |
+
To protect your rights, we need to prevent others from denying you
|
64 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
65 |
+
certain responsibilities if you distribute copies of the software, or if
|
66 |
+
you modify it: responsibilities to respect the freedom of others.
|
67 |
+
|
68 |
+
For example, if you distribute copies of such a program, whether
|
69 |
+
gratis or for a fee, you must pass on to the recipients the same
|
70 |
+
freedoms that you received. You must make sure that they, too, receive
|
71 |
+
or can get the source code. And you must show them these terms so they
|
72 |
+
know their rights.
|
73 |
+
|
74 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
75 |
+
(1) assert copyright on the software, and (2) offer you this License
|
76 |
+
giving you legal permission to copy, distribute and/or modify it.
|
77 |
+
|
78 |
+
For the developers' and authors' protection, the GPL clearly explains
|
79 |
+
that there is no warranty for this free software. For both users' and
|
80 |
+
authors' sake, the GPL requires that modified versions be marked as
|
81 |
+
changed, so that their problems will not be attributed erroneously to
|
82 |
+
authors of previous versions.
|
83 |
+
|
84 |
+
Some devices are designed to deny users access to install or run
|
85 |
+
modified versions of the software inside them, although the manufacturer
|
86 |
+
can do so. This is fundamentally incompatible with the aim of
|
87 |
+
protecting users' freedom to change the software. The systematic
|
88 |
+
pattern of such abuse occurs in the area of products for individuals to
|
89 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
90 |
+
have designed this version of the GPL to prohibit the practice for those
|
91 |
+
products. If such problems arise substantially in other domains, we
|
92 |
+
stand ready to extend this provision to those domains in future versions
|
93 |
+
of the GPL, as needed to protect the freedom of users.
|
94 |
+
|
95 |
+
Finally, every program is threatened constantly by software patents.
|
96 |
+
States should not allow patents to restrict development and use of
|
97 |
+
software on general-purpose computers, but in those that do, we wish to
|
98 |
+
avoid the special danger that patents applied to a free program could
|
99 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
100 |
+
patents cannot be used to render the program non-free.
|
101 |
+
|
102 |
+
The precise terms and conditions for copying, distribution and
|
103 |
+
modification follow.
|
104 |
+
|
105 |
+
TERMS AND CONDITIONS
|
106 |
+
|
107 |
+
0. Definitions.
|
108 |
+
|
109 |
+
"This License" refers to version 3 of the GNU General Public License.
|
110 |
+
|
111 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
112 |
+
works, such as semiconductor masks.
|
113 |
+
|
114 |
+
"The Program" refers to any copyrightable work licensed under this
|
115 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
116 |
+
"recipients" may be individuals or organizations.
|
117 |
+
|
118 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
119 |
+
in a fashion requiring copyright permission, other than the making of an
|
120 |
+
exact copy. The resulting work is called a "modified version" of the
|
121 |
+
earlier work or a work "based on" the earlier work.
|
122 |
+
|
123 |
+
A "covered work" means either the unmodified Program or a work based
|
124 |
+
on the Program.
|
125 |
+
|
126 |
+
To "propagate" a work means to do anything with it that, without
|
127 |
+
permission, would make you directly or secondarily liable for
|
128 |
+
infringement under applicable copyright law, except executing it on a
|
129 |
+
computer or modifying a private copy. Propagation includes copying,
|
130 |
+
distribution (with or without modification), making available to the
|
131 |
+
public, and in some countries other activities as well.
|
132 |
+
|
133 |
+
To "convey" a work means any kind of propagation that enables other
|
134 |
+
parties to make or receive copies. Mere interaction with a user through
|
135 |
+
a computer network, with no transfer of a copy, is not conveying.
|
136 |
+
|
137 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
138 |
+
to the extent that it includes a convenient and prominently visible
|
139 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
140 |
+
tells the user that there is no warranty for the work (except to the
|
141 |
+
extent that warranties are provided), that licensees may convey the
|
142 |
+
work under this License, and how to view a copy of this License. If
|
143 |
+
the interface presents a list of user commands or options, such as a
|
144 |
+
menu, a prominent item in the list meets this criterion.
|
145 |
+
|
146 |
+
1. Source Code.
|
147 |
+
|
148 |
+
The "source code" for a work means the preferred form of the work
|
149 |
+
for making modifications to it. "Object code" means any non-source
|
150 |
+
form of a work.
|
151 |
+
|
152 |
+
A "Standard Interface" means an interface that either is an official
|
153 |
+
standard defined by a recognized standards body, or, in the case of
|
154 |
+
interfaces specified for a particular programming language, one that
|
155 |
+
is widely used among developers working in that language.
|
156 |
+
|
157 |
+
The "System Libraries" of an executable work include anything, other
|
158 |
+
than the work as a whole, that (a) is included in the normal form of
|
159 |
+
packaging a Major Component, but which is not part of that Major
|
160 |
+
Component, and (b) serves only to enable use of the work with that
|
161 |
+
Major Component, or to implement a Standard Interface for which an
|
162 |
+
implementation is available to the public in source code form. A
|
163 |
+
"Major Component", in this context, means a major essential component
|
164 |
+
(kernel, window system, and so on) of the specific operating system
|
165 |
+
(if any) on which the executable work runs, or a compiler used to
|
166 |
+
produce the work, or an object code interpreter used to run it.
|
167 |
+
|
168 |
+
The "Corresponding Source" for a work in object code form means all
|
169 |
+
the source code needed to generate, install, and (for an executable
|
170 |
+
work) run the object code and to modify the work, including scripts to
|
171 |
+
control those activities. However, it does not include the work's
|
172 |
+
System Libraries, or general-purpose tools or generally available free
|
173 |
+
programs which are used unmodified in performing those activities but
|
174 |
+
which are not part of the work. For example, Corresponding Source
|
175 |
+
includes interface definition files associated with source files for
|
176 |
+
the work, and the source code for shared libraries and dynamically
|
177 |
+
linked subprograms that the work is specifically designed to require,
|
178 |
+
such as by intimate data communication or control flow between those
|
179 |
+
subprograms and other parts of the work.
|
180 |
+
|
181 |
+
The Corresponding Source need not include anything that users
|
182 |
+
can regenerate automatically from other parts of the Corresponding
|
183 |
+
Source.
|
184 |
+
|
185 |
+
The Corresponding Source for a work in source code form is that
|
186 |
+
same work.
|
187 |
+
|
188 |
+
2. Basic Permissions.
|
189 |
+
|
190 |
+
All rights granted under this License are granted for the term of
|
191 |
+
copyright on the Program, and are irrevocable provided the stated
|
192 |
+
conditions are met. This License explicitly affirms your unlimited
|
193 |
+
permission to run the unmodified Program. The output from running a
|
194 |
+
covered work is covered by this License only if the output, given its
|
195 |
+
content, constitutes a covered work. This License acknowledges your
|
196 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
197 |
+
|
198 |
+
You may make, run and propagate covered works that you do not
|
199 |
+
convey, without conditions so long as your license otherwise remains
|
200 |
+
in force. You may convey covered works to others for the sole purpose
|
201 |
+
of having them make modifications exclusively for you, or provide you
|
202 |
+
with facilities for running those works, provided that you comply with
|
203 |
+
the terms of this License in conveying all material for which you do
|
204 |
+
not control copyright. Those thus making or running the covered works
|
205 |
+
for you must do so exclusively on your behalf, under your direction
|
206 |
+
and control, on terms that prohibit them from making any copies of
|
207 |
+
your copyrighted material outside their relationship with you.
|
208 |
+
|
209 |
+
Conveying under any other circumstances is permitted solely under
|
210 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
211 |
+
makes it unnecessary.
|
212 |
+
|
213 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
214 |
+
|
215 |
+
No covered work shall be deemed part of an effective technological
|
216 |
+
measure under any applicable law fulfilling obligations under article
|
217 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
218 |
+
similar laws prohibiting or restricting circumvention of such
|
219 |
+
measures.
|
220 |
+
|
221 |
+
When you convey a covered work, you waive any legal power to forbid
|
222 |
+
circumvention of technological measures to the extent such circumvention
|
223 |
+
is effected by exercising rights under this License with respect to
|
224 |
+
the covered work, and you disclaim any intention to limit operation or
|
225 |
+
modification of the work as a means of enforcing, against the work's
|
226 |
+
users, your or third parties' legal rights to forbid circumvention of
|
227 |
+
technological measures.
|
228 |
+
|
229 |
+
4. Conveying Verbatim Copies.
|
230 |
+
|
231 |
+
You may convey verbatim copies of the Program's source code as you
|
232 |
+
receive it, in any medium, provided that you conspicuously and
|
233 |
+
appropriately publish on each copy an appropriate copyright notice;
|
234 |
+
keep intact all notices stating that this License and any
|
235 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
236 |
+
keep intact all notices of the absence of any warranty; and give all
|
237 |
+
recipients a copy of this License along with the Program.
|
238 |
+
|
239 |
+
You may charge any price or no price for each copy that you convey,
|
240 |
+
and you may offer support or warranty protection for a fee.
|
241 |
+
|
242 |
+
5. Conveying Modified Source Versions.
|
243 |
+
|
244 |
+
You may convey a work based on the Program, or the modifications to
|
245 |
+
produce it from the Program, in the form of source code under the
|
246 |
+
terms of section 4, provided that you also meet all of these conditions:
|
247 |
+
|
248 |
+
a) The work must carry prominent notices stating that you modified
|
249 |
+
it, and giving a relevant date.
|
250 |
+
|
251 |
+
b) The work must carry prominent notices stating that it is
|
252 |
+
released under this License and any conditions added under section
|
253 |
+
7. This requirement modifies the requirement in section 4 to
|
254 |
+
"keep intact all notices".
|
255 |
+
|
256 |
+
c) You must license the entire work, as a whole, under this
|
257 |
+
License to anyone who comes into possession of a copy. This
|
258 |
+
License will therefore apply, along with any applicable section 7
|
259 |
+
additional terms, to the whole of the work, and all its parts,
|
260 |
+
regardless of how they are packaged. This License gives no
|
261 |
+
permission to license the work in any other way, but it does not
|
262 |
+
invalidate such permission if you have separately received it.
|
263 |
+
|
264 |
+
d) If the work has interactive user interfaces, each must display
|
265 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
266 |
+
interfaces that do not display Appropriate Legal Notices, your
|
267 |
+
work need not make them do so.
|
268 |
+
|
269 |
+
A compilation of a covered work with other separate and independent
|
270 |
+
works, which are not by their nature extensions of the covered work,
|
271 |
+
and which are not combined with it such as to form a larger program,
|
272 |
+
in or on a volume of a storage or distribution medium, is called an
|
273 |
+
"aggregate" if the compilation and its resulting copyright are not
|
274 |
+
used to limit the access or legal rights of the compilation's users
|
275 |
+
beyond what the individual works permit. Inclusion of a covered work
|
276 |
+
in an aggregate does not cause this License to apply to the other
|
277 |
+
parts of the aggregate.
|
278 |
+
|
279 |
+
6. Conveying Non-Source Forms.
|
280 |
+
|
281 |
+
You may convey a covered work in object code form under the terms
|
282 |
+
of sections 4 and 5, provided that you also convey the
|
283 |
+
machine-readable Corresponding Source under the terms of this License,
|
284 |
+
in one of these ways:
|
285 |
+
|
286 |
+
a) Convey the object code in, or embodied in, a physical product
|
287 |
+
(including a physical distribution medium), accompanied by the
|
288 |
+
Corresponding Source fixed on a durable physical medium
|
289 |
+
customarily used for software interchange.
|
290 |
+
|
291 |
+
b) Convey the object code in, or embodied in, a physical product
|
292 |
+
(including a physical distribution medium), accompanied by a
|
293 |
+
written offer, valid for at least three years and valid for as
|
294 |
+
long as you offer spare parts or customer support for that product
|
295 |
+
model, to give anyone who possesses the object code either (1) a
|
296 |
+
copy of the Corresponding Source for all the software in the
|
297 |
+
product that is covered by this License, on a durable physical
|
298 |
+
medium customarily used for software interchange, for a price no
|
299 |
+
more than your reasonable cost of physically performing this
|
300 |
+
conveying of source, or (2) access to copy the
|
301 |
+
Corresponding Source from a network server at no charge.
|
302 |
+
|
303 |
+
c) Convey individual copies of the object code with a copy of the
|
304 |
+
written offer to provide the Corresponding Source. This
|
305 |
+
alternative is allowed only occasionally and noncommercially, and
|
306 |
+
only if you received the object code with such an offer, in accord
|
307 |
+
with subsection 6b.
|
308 |
+
|
309 |
+
d) Convey the object code by offering access from a designated
|
310 |
+
place (gratis or for a charge), and offer equivalent access to the
|
311 |
+
Corresponding Source in the same way through the same place at no
|
312 |
+
further charge. You need not require recipients to copy the
|
313 |
+
Corresponding Source along with the object code. If the place to
|
314 |
+
copy the object code is a network server, the Corresponding Source
|
315 |
+
may be on a different server (operated by you or a third party)
|
316 |
+
that supports equivalent copying facilities, provided you maintain
|
317 |
+
clear directions next to the object code saying where to find the
|
318 |
+
Corresponding Source. Regardless of what server hosts the
|
319 |
+
Corresponding Source, you remain obligated to ensure that it is
|
320 |
+
available for as long as needed to satisfy these requirements.
|
321 |
+
|
322 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
323 |
+
you inform other peers where the object code and Corresponding
|
324 |
+
Source of the work are being offered to the general public at no
|
325 |
+
charge under subsection 6d.
|
326 |
+
|
327 |
+
A separable portion of the object code, whose source code is excluded
|
328 |
+
from the Corresponding Source as a System Library, need not be
|
329 |
+
included in conveying the object code work.
|
330 |
+
|
331 |
+
A "User Product" is either (1) a "consumer product", which means any
|
332 |
+
tangible personal property which is normally used for personal, family,
|
333 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
334 |
+
into a dwelling. In determining whether a product is a consumer product,
|
335 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
336 |
+
product received by a particular user, "normally used" refers to a
|
337 |
+
typical or common use of that class of product, regardless of the status
|
338 |
+
of the particular user or of the way in which the particular user
|
339 |
+
actually uses, or expects or is expected to use, the product. A product
|
340 |
+
is a consumer product regardless of whether the product has substantial
|
341 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
342 |
+
the only significant mode of use of the product.
|
343 |
+
|
344 |
+
"Installation Information" for a User Product means any methods,
|
345 |
+
procedures, authorization keys, or other information required to install
|
346 |
+
and execute modified versions of a covered work in that User Product from
|
347 |
+
a modified version of its Corresponding Source. The information must
|
348 |
+
suffice to ensure that the continued functioning of the modified object
|
349 |
+
code is in no case prevented or interfered with solely because
|
350 |
+
modification has been made.
|
351 |
+
|
352 |
+
If you convey an object code work under this section in, or with, or
|
353 |
+
specifically for use in, a User Product, and the conveying occurs as
|
354 |
+
part of a transaction in which the right of possession and use of the
|
355 |
+
User Product is transferred to the recipient in perpetuity or for a
|
356 |
+
fixed term (regardless of how the transaction is characterized), the
|
357 |
+
Corresponding Source conveyed under this section must be accompanied
|
358 |
+
by the Installation Information. But this requirement does not apply
|
359 |
+
if neither you nor any third party retains the ability to install
|
360 |
+
modified object code on the User Product (for example, the work has
|
361 |
+
been installed in ROM).
|
362 |
+
|
363 |
+
The requirement to provide Installation Information does not include a
|
364 |
+
requirement to continue to provide support service, warranty, or updates
|
365 |
+
for a work that has been modified or installed by the recipient, or for
|
366 |
+
the User Product in which it has been modified or installed. Access to a
|
367 |
+
network may be denied when the modification itself materially and
|
368 |
+
adversely affects the operation of the network or violates the rules and
|
369 |
+
protocols for communication across the network.
|
370 |
+
|
371 |
+
Corresponding Source conveyed, and Installation Information provided,
|
372 |
+
in accord with this section must be in a format that is publicly
|
373 |
+
documented (and with an implementation available to the public in
|
374 |
+
source code form), and must require no special password or key for
|
375 |
+
unpacking, reading or copying.
|
376 |
+
|
377 |
+
7. Additional Terms.
|
378 |
+
|
379 |
+
"Additional permissions" are terms that supplement the terms of this
|
380 |
+
License by making exceptions from one or more of its conditions.
|
381 |
+
Additional permissions that are applicable to the entire Program shall
|
382 |
+
be treated as though they were included in this License, to the extent
|
383 |
+
that they are valid under applicable law. If additional permissions
|
384 |
+
apply only to part of the Program, that part may be used separately
|
385 |
+
under those permissions, but the entire Program remains governed by
|
386 |
+
this License without regard to the additional permissions.
|
387 |
+
|
388 |
+
When you convey a copy of a covered work, you may at your option
|
389 |
+
remove any additional permissions from that copy, or from any part of
|
390 |
+
it. (Additional permissions may be written to require their own
|
391 |
+
removal in certain cases when you modify the work.) You may place
|
392 |
+
additional permissions on material, added by you to a covered work,
|
393 |
+
for which you have or can give appropriate copyright permission.
|
394 |
+
|
395 |
+
Notwithstanding any other provision of this License, for material you
|
396 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
397 |
+
that material) supplement the terms of this License with terms:
|
398 |
+
|
399 |
+
a) Disclaiming warranty or limiting liability differently from the
|
400 |
+
terms of sections 15 and 16 of this License; or
|
401 |
+
|
402 |
+
b) Requiring preservation of specified reasonable legal notices or
|
403 |
+
author attributions in that material or in the Appropriate Legal
|
404 |
+
Notices displayed by works containing it; or
|
405 |
+
|
406 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
407 |
+
requiring that modified versions of such material be marked in
|
408 |
+
reasonable ways as different from the original version; or
|
409 |
+
|
410 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
411 |
+
authors of the material; or
|
412 |
+
|
413 |
+
e) Declining to grant rights under trademark law for use of some
|
414 |
+
trade names, trademarks, or service marks; or
|
415 |
+
|
416 |
+
f) Requiring indemnification of licensors and authors of that
|
417 |
+
material by anyone who conveys the material (or modified versions of
|
418 |
+
it) with contractual assumptions of liability to the recipient, for
|
419 |
+
any liability that these contractual assumptions directly impose on
|
420 |
+
those licensors and authors.
|
421 |
+
|
422 |
+
All other non-permissive additional terms are considered "further
|
423 |
+
restrictions" within the meaning of section 10. If the Program as you
|
424 |
+
received it, or any part of it, contains a notice stating that it is
|
425 |
+
governed by this License along with a term that is a further
|
426 |
+
restriction, you may remove that term. If a license document contains
|
427 |
+
a further restriction but permits relicensing or conveying under this
|
428 |
+
License, you may add to a covered work material governed by the terms
|
429 |
+
of that license document, provided that the further restriction does
|
430 |
+
not survive such relicensing or conveying.
|
431 |
+
|
432 |
+
If you add terms to a covered work in accord with this section, you
|
433 |
+
must place, in the relevant source files, a statement of the
|
434 |
+
additional terms that apply to those files, or a notice indicating
|
435 |
+
where to find the applicable terms.
|
436 |
+
|
437 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
438 |
+
form of a separately written license, or stated as exceptions;
|
439 |
+
the above requirements apply either way.
|
440 |
+
|
441 |
+
8. Termination.
|
442 |
+
|
443 |
+
You may not propagate or modify a covered work except as expressly
|
444 |
+
provided under this License. Any attempt otherwise to propagate or
|
445 |
+
modify it is void, and will automatically terminate your rights under
|
446 |
+
this License (including any patent licenses granted under the third
|
447 |
+
paragraph of section 11).
|
448 |
+
|
449 |
+
However, if you cease all violation of this License, then your
|
450 |
+
license from a particular copyright holder is reinstated (a)
|
451 |
+
provisionally, unless and until the copyright holder explicitly and
|
452 |
+
finally terminates your license, and (b) permanently, if the copyright
|
453 |
+
holder fails to notify you of the violation by some reasonable means
|
454 |
+
prior to 60 days after the cessation.
|
455 |
+
|
456 |
+
Moreover, your license from a particular copyright holder is
|
457 |
+
reinstated permanently if the copyright holder notifies you of the
|
458 |
+
violation by some reasonable means, this is the first time you have
|
459 |
+
received notice of violation of this License (for any work) from that
|
460 |
+
copyright holder, and you cure the violation prior to 30 days after
|
461 |
+
your receipt of the notice.
|
462 |
+
|
463 |
+
Termination of your rights under this section does not terminate the
|
464 |
+
licenses of parties who have received copies or rights from you under
|
465 |
+
this License. If your rights have been terminated and not permanently
|
466 |
+
reinstated, you do not qualify to receive new licenses for the same
|
467 |
+
material under section 10.
|
468 |
+
|
469 |
+
9. Acceptance Not Required for Having Copies.
|
470 |
+
|
471 |
+
You are not required to accept this License in order to receive or
|
472 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
473 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
474 |
+
to receive a copy likewise does not require acceptance. However,
|
475 |
+
nothing other than this License grants you permission to propagate or
|
476 |
+
modify any covered work. These actions infringe copyright if you do
|
477 |
+
not accept this License. Therefore, by modifying or propagating a
|
478 |
+
covered work, you indicate your acceptance of this License to do so.
|
479 |
+
|
480 |
+
10. Automatic Licensing of Downstream Recipients.
|
481 |
+
|
482 |
+
Each time you convey a covered work, the recipient automatically
|
483 |
+
receives a license from the original licensors, to run, modify and
|
484 |
+
propagate that work, subject to this License. You are not responsible
|
485 |
+
for enforcing compliance by third parties with this License.
|
486 |
+
|
487 |
+
An "entity transaction" is a transaction transferring control of an
|
488 |
+
organization, or substantially all assets of one, or subdividing an
|
489 |
+
organization, or merging organizations. If propagation of a covered
|
490 |
+
work results from an entity transaction, each party to that
|
491 |
+
transaction who receives a copy of the work also receives whatever
|
492 |
+
licenses to the work the party's predecessor in interest had or could
|
493 |
+
give under the previous paragraph, plus a right to possession of the
|
494 |
+
Corresponding Source of the work from the predecessor in interest, if
|
495 |
+
the predecessor has it or can get it with reasonable efforts.
|
496 |
+
|
497 |
+
You may not impose any further restrictions on the exercise of the
|
498 |
+
rights granted or affirmed under this License. For example, you may
|
499 |
+
not impose a license fee, royalty, or other charge for exercise of
|
500 |
+
rights granted under this License, and you may not initiate litigation
|
501 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
502 |
+
any patent claim is infringed by making, using, selling, offering for
|
503 |
+
sale, or importing the Program or any portion of it.
|
504 |
+
|
505 |
+
11. Patents.
|
506 |
+
|
507 |
+
A "contributor" is a copyright holder who authorizes use under this
|
508 |
+
License of the Program or a work on which the Program is based. The
|
509 |
+
work thus licensed is called the contributor's "contributor version".
|
510 |
+
|
511 |
+
A contributor's "essential patent claims" are all patent claims
|
512 |
+
owned or controlled by the contributor, whether already acquired or
|
513 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
514 |
+
by this License, of making, using, or selling its contributor version,
|
515 |
+
but do not include claims that would be infringed only as a
|
516 |
+
consequence of further modification of the contributor version. For
|
517 |
+
purposes of this definition, "control" includes the right to grant
|
518 |
+
patent sublicenses in a manner consistent with the requirements of
|
519 |
+
this License.
|
520 |
+
|
521 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
522 |
+
patent license under the contributor's essential patent claims, to
|
523 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
524 |
+
propagate the contents of its contributor version.
|
525 |
+
|
526 |
+
In the following three paragraphs, a "patent license" is any express
|
527 |
+
agreement or commitment, however denominated, not to enforce a patent
|
528 |
+
(such as an express permission to practice a patent or covenant not to
|
529 |
+
sue for patent infringement). To "grant" such a patent license to a
|
530 |
+
party means to make such an agreement or commitment not to enforce a
|
531 |
+
patent against the party.
|
532 |
+
|
533 |
+
If you convey a covered work, knowingly relying on a patent license,
|
534 |
+
and the Corresponding Source of the work is not available for anyone
|
535 |
+
to copy, free of charge and under the terms of this License, through a
|
536 |
+
publicly available network server or other readily accessible means,
|
537 |
+
then you must either (1) cause the Corresponding Source to be so
|
538 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
539 |
+
patent license for this particular work, or (3) arrange, in a manner
|
540 |
+
consistent with the requirements of this License, to extend the patent
|
541 |
+
license to downstream recipients. "Knowingly relying" means you have
|
542 |
+
actual knowledge that, but for the patent license, your conveying the
|
543 |
+
covered work in a country, or your recipient's use of the covered work
|
544 |
+
in a country, would infringe one or more identifiable patents in that
|
545 |
+
country that you have reason to believe are valid.
|
546 |
+
|
547 |
+
If, pursuant to or in connection with a single transaction or
|
548 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
549 |
+
covered work, and grant a patent license to some of the parties
|
550 |
+
receiving the covered work authorizing them to use, propagate, modify
|
551 |
+
or convey a specific copy of the covered work, then the patent license
|
552 |
+
you grant is automatically extended to all recipients of the covered
|
553 |
+
work and works based on it.
|
554 |
+
|
555 |
+
A patent license is "discriminatory" if it does not include within
|
556 |
+
the scope of its coverage, prohibits the exercise of, or is
|
557 |
+
conditioned on the non-exercise of one or more of the rights that are
|
558 |
+
specifically granted under this License. You may not convey a covered
|
559 |
+
work if you are a party to an arrangement with a third party that is
|
560 |
+
in the business of distributing software, under which you make payment
|
561 |
+
to the third party based on the extent of your activity of conveying
|
562 |
+
the work, and under which the third party grants, to any of the
|
563 |
+
parties who would receive the covered work from you, a discriminatory
|
564 |
+
patent license (a) in connection with copies of the covered work
|
565 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
566 |
+
for and in connection with specific products or compilations that
|
567 |
+
contain the covered work, unless you entered into that arrangement,
|
568 |
+
or that patent license was granted, prior to 28 March 2007.
|
569 |
+
|
570 |
+
Nothing in this License shall be construed as excluding or limiting
|
571 |
+
any implied license or other defenses to infringement that may
|
572 |
+
otherwise be available to you under applicable patent law.
|
573 |
+
|
574 |
+
12. No Surrender of Others' Freedom.
|
575 |
+
|
576 |
+
If conditions are imposed on you (whether by court order, agreement or
|
577 |
+
otherwise) that contradict the conditions of this License, they do not
|
578 |
+
excuse you from the conditions of this License. If you cannot convey a
|
579 |
+
covered work so as to satisfy simultaneously your obligations under this
|
580 |
+
License and any other pertinent obligations, then as a consequence you may
|
581 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
582 |
+
to collect a royalty for further conveying from those to whom you convey
|
583 |
+
the Program, the only way you could satisfy both those terms and this
|
584 |
+
License would be to refrain entirely from conveying the Program.
|
585 |
+
|
586 |
+
13. Use with the GNU Affero General Public License.
|
587 |
+
|
588 |
+
Notwithstanding any other provision of this License, you have
|
589 |
+
permission to link or combine any covered work with a work licensed
|
590 |
+
under version 3 of the GNU Affero General Public License into a single
|
591 |
+
combined work, and to convey the resulting work. The terms of this
|
592 |
+
License will continue to apply to the part which is the covered work,
|
593 |
+
but the special requirements of the GNU Affero General Public License,
|
594 |
+
section 13, concerning interaction through a network will apply to the
|
595 |
+
combination as such.
|
596 |
+
|
597 |
+
14. Revised Versions of this License.
|
598 |
+
|
599 |
+
The Free Software Foundation may publish revised and/or new versions of
|
600 |
+
the GNU General Public License from time to time. Such new versions will
|
601 |
+
be similar in spirit to the present version, but may differ in detail to
|
602 |
+
address new problems or concerns.
|
603 |
+
|
604 |
+
Each version is given a distinguishing version number. If the
|
605 |
+
Program specifies that a certain numbered version of the GNU General
|
606 |
+
Public License "or any later version" applies to it, you have the
|
607 |
+
option of following the terms and conditions either of that numbered
|
608 |
+
version or of any later version published by the Free Software
|
609 |
+
Foundation. If the Program does not specify a version number of the
|
610 |
+
GNU General Public License, you may choose any version ever published
|
611 |
+
by the Free Software Foundation.
|
612 |
+
|
613 |
+
If the Program specifies that a proxy can decide which future
|
614 |
+
versions of the GNU General Public License can be used, that proxy's
|
615 |
+
public statement of acceptance of a version permanently authorizes you
|
616 |
+
to choose that version for the Program.
|
617 |
+
|
618 |
+
Later license versions may give you additional or different
|
619 |
+
permissions. However, no additional obligations are imposed on any
|
620 |
+
author or copyright holder as a result of your choosing to follow a
|
621 |
+
later version.
|
622 |
+
|
623 |
+
15. Disclaimer of Warranty.
|
624 |
+
|
625 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
626 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
627 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
628 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
629 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
630 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
631 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
632 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
633 |
+
|
634 |
+
16. Limitation of Liability.
|
635 |
+
|
636 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
637 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
638 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
639 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
640 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
641 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
642 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
643 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
644 |
+
SUCH DAMAGES.
|
645 |
+
|
646 |
+
17. Interpretation of Sections 15 and 16.
|
647 |
+
|
648 |
+
If the disclaimer of warranty and limitation of liability provided
|
649 |
+
above cannot be given local legal effect according to their terms,
|
650 |
+
reviewing courts shall apply local law that most closely approximates
|
651 |
+
an absolute waiver of all civil liability in connection with the
|
652 |
+
Program, unless a warranty or assumption of liability accompanies a
|
653 |
+
copy of the Program in return for a fee.
|
654 |
+
|
655 |
+
END OF TERMS AND CONDITIONS
|
656 |
+
|
657 |
+
How to Apply These Terms to Your New Programs
|
658 |
+
|
659 |
+
If you develop a new program, and you want it to be of the greatest
|
660 |
+
possible use to the public, the best way to achieve this is to make it
|
661 |
+
free software which everyone can redistribute and change under these terms.
|
662 |
+
|
663 |
+
To do so, attach the following notices to the program. It is safest
|
664 |
+
to attach them to the start of each source file to most effectively
|
665 |
+
state the exclusion of warranty; and each file should have at least
|
666 |
+
the "copyright" line and a pointer to where the full notice is found.
|
667 |
+
|
668 |
+
<one line to give the program's name and a brief idea of what it does.>
|
669 |
+
Copyright © <year> <name of author>
|
670 |
+
|
671 |
+
This program is free software: you can redistribute it and/or modify
|
672 |
+
it under the terms of the GNU General Public License as published by
|
673 |
+
the Free Software Foundation, either version 3 of the License, or
|
674 |
+
(at your option) any later version.
|
675 |
+
|
676 |
+
This program is distributed in the hope that it will be useful,
|
677 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
678 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
679 |
+
GNU General Public License for more details.
|
680 |
+
|
681 |
+
You should have received a copy of the GNU General Public License
|
682 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
683 |
+
|
684 |
+
Also add information on how to contact you by electronic and paper mail.
|
685 |
+
|
686 |
+
If the program does terminal interaction, make it output a short
|
687 |
+
notice like this when it starts in an interactive mode:
|
688 |
+
|
689 |
+
<program> Copyright © <year> <name of author>
|
690 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
691 |
+
This is free software, and you are welcome to redistribute it
|
692 |
+
under certain conditions; type `show c' for details.
|
693 |
+
|
694 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
695 |
+
parts of the General Public License. Of course, your program's commands
|
696 |
+
might be different; for a GUI interface, you would use an "about box".
|
697 |
+
|
698 |
+
You should also get your employer (if you work as a programmer) or school,
|
699 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
700 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
701 |
+
<http://www.gnu.org/licenses/>.
|
702 |
+
|
703 |
+
The GNU General Public License does not permit incorporating your program
|
704 |
+
into proprietary programs. If your program is a subroutine library, you
|
705 |
+
may consider it more useful to permit linking proprietary applications with
|
706 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
707 |
+
Public License instead of this License. But first, please read
|
708 |
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
|
|
4 |
Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.8
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -146,8 +146,11 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
|
|
146 |
|
147 |
3. Premium export Screen
|
148 |
|
149 |
-
== Changelog ==
|
150 |
|
|
|
|
|
|
|
151 |
= 1.1.3 =
|
152 |
* Export page blank bug fix.
|
153 |
= 1.1.2 =
|
@@ -182,5 +185,6 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
|
|
182 |
|
183 |
== Upgrade Notice ==
|
184 |
|
185 |
-
= 1.1.
|
186 |
-
*
|
|
4 |
Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.8
|
7 |
+
Stable tag: 1.1.4
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
146 |
|
147 |
3. Premium export Screen
|
148 |
|
149 |
+
== Changelog ==
|
150 |
|
151 |
+
= 1.1.4 =
|
152 |
+
* implement hashed/plaintext password processing during import.
|
153 |
+
* Bug fix: User role import.
|
154 |
= 1.1.3 =
|
155 |
* Export page blank bug fix.
|
156 |
= 1.1.2 =
|
185 |
|
186 |
== Upgrade Notice ==
|
187 |
|
188 |
+
= 1.1.4 =
|
189 |
+
* implement hashed/plaintext password processing during import.
|
190 |
+
* Bug fix: User role import.
|
styles/select2.css
CHANGED
File without changes
|
styles/select2.js
CHANGED
File without changes
|
styles/wf-style.css
CHANGED
@@ -1,145 +1,145 @@
|
|
1 |
-
#icon-woocommerce-importer {
|
2 |
-
background-image: url(../images/wf-import.png) !important;
|
3 |
-
background-position: -3px -5px;
|
4 |
-
}
|
5 |
-
.widefat_importer td {
|
6 |
-
vertical-align: middle;
|
7 |
-
padding: 5px 9px;
|
8 |
-
}
|
9 |
-
#import-progress {
|
10 |
-
width: 100%;
|
11 |
-
}
|
12 |
-
#import-progress td, #import-progress th {
|
13 |
-
padding: .5em 1em;
|
14 |
-
}
|
15 |
-
#import-progress td.status, #import-progress th.status {
|
16 |
-
width: 32px;
|
17 |
-
}
|
18 |
-
#import-progress td.row, #import-progress th.row {
|
19 |
-
width: 3em;
|
20 |
-
text-align: center;
|
21 |
-
}
|
22 |
-
#import-progress td.reason, #import-progress th.reason {
|
23 |
-
text-align: right;
|
24 |
-
}
|
25 |
-
#import-progress tr.importer-loading td {
|
26 |
-
background: url(../images/wf-ajax-loader.gif) no-repeat center center;
|
27 |
-
height: 32px;
|
28 |
-
}
|
29 |
-
#import-progress .merged td,
|
30 |
-
#import-progress .imported td {
|
31 |
-
}
|
32 |
-
#import-progress .skipped td {
|
33 |
-
border-bottom-color: #dbcb83;
|
34 |
-
background: #f2ecd2;
|
35 |
-
}
|
36 |
-
#import-progress .failed td {
|
37 |
-
border-bottom-color: #e6adaa;
|
38 |
-
background: #f2d3d2;
|
39 |
-
}
|
40 |
-
#import-progress mark.result {
|
41 |
-
height: 0;
|
42 |
-
display: block;
|
43 |
-
line-height: 16px;
|
44 |
-
overflow: hidden;
|
45 |
-
padding: 16px 0 0 0;
|
46 |
-
}
|
47 |
-
#import-progress .skipped mark.result {
|
48 |
-
background: url(../images/wf-notice.png) no-repeat center top;
|
49 |
-
}
|
50 |
-
#import-progress .merged mark.result,
|
51 |
-
#import-progress .imported mark.result {
|
52 |
-
background: url(../images/wf-success.png) no-repeat center top;
|
53 |
-
}
|
54 |
-
#import-progress .failed mark.result {
|
55 |
-
background: url(../images/wf-failed.png) no-repeat center top;
|
56 |
-
}
|
57 |
-
#import-progress .complete td {
|
58 |
-
background: #000;
|
59 |
-
border-color: #000;
|
60 |
-
border-top: 4px solid #000;
|
61 |
-
color: #fff;
|
62 |
-
font-size: 1.5em;
|
63 |
-
padding: .95em 1em 1em;
|
64 |
-
text-align: center;
|
65 |
-
}
|
66 |
-
#import-progress .regenerating td {
|
67 |
-
padding: 0;
|
68 |
-
}
|
69 |
-
#import-progress .regenerating div.progress {
|
70 |
-
background: #464646;
|
71 |
-
padding: .95em 1em 1em;
|
72 |
-
color: #fff;
|
73 |
-
overflow: hidden;
|
74 |
-
width: 0;
|
75 |
-
float: left;
|
76 |
-
text-align: left;
|
77 |
-
white-space: nowrap;
|
78 |
-
}
|
79 |
-
.update{
|
80 |
-
background: #fff;
|
81 |
-
border-left: 4px solid #fff;
|
82 |
-
padding: 1px 12px;
|
83 |
-
border-left-color: #46b450;
|
84 |
-
margin-top: 10px;
|
85 |
-
}
|
86 |
-
#datagrid { border-collapse: collapse; text-align: left; width: 80%; }
|
87 |
-
#datagrid {
|
88 |
-
background: #fff; overflow: hidden;
|
89 |
-
}
|
90 |
-
#datagrid td{ padding: 3px 10px; }
|
91 |
-
#datagrid th { padding: 8px 25px; color: #fff; background-color: #ccc; font-weight: bold;font-size: 15px; }
|
92 |
-
|
93 |
-
.woocommerce-message a.button-primary, .woocommerce-message button.button-primary{
|
94 |
-
background: #0085ba none repeat scroll 0 0 !important;
|
95 |
-
border-color: #0073aa #006799 #006799 !important;}
|
96 |
-
.woocommerce-message{border-left-color:#46b450 !important;}
|
97 |
-
.chosen-container-multi .chosen-choices li.search-field{
|
98 |
-
padding: 5px !important;
|
99 |
-
}
|
100 |
-
.chosen-container-multi .chosen-choices li.search-field input[type="text"]{
|
101 |
-
padding: 1px !important;
|
102 |
-
}
|
103 |
-
.order_actions .download_to_csv_wf {
|
104 |
-
display: block;
|
105 |
-
height: 2em !important;
|
106 |
-
padding: 0 !important;
|
107 |
-
position: relative;
|
108 |
-
text-indent: -9999px;
|
109 |
-
width: 2em;
|
110 |
-
}
|
111 |
-
.order_actions .download_to_csv_wf::after {
|
112 |
-
content: "";
|
113 |
-
font-family: "dashicons";
|
114 |
-
font-variant: normal;
|
115 |
-
font-weight: normal;
|
116 |
-
height: 100%;
|
117 |
-
left: 0;
|
118 |
-
margin: 0;
|
119 |
-
position: absolute;
|
120 |
-
text-align: center;
|
121 |
-
text-indent: 0;
|
122 |
-
text-transform: none;
|
123 |
-
top: 0;
|
124 |
-
width: 100%;
|
125 |
-
}
|
126 |
-
.pipe-view {
|
127 |
-
width: 65%;
|
128 |
-
float: left;
|
129 |
-
}
|
130 |
-
#datagrid td input {
|
131 |
-
margin-top: 4px;
|
132 |
-
box-shadow: none;
|
133 |
-
padding: 7px 10px;
|
134 |
-
}
|
135 |
-
.bg-white{
|
136 |
-
background: #fff;
|
137 |
-
}
|
138 |
-
.p-20p{
|
139 |
-
padding: 20px;
|
140 |
-
}
|
141 |
-
.nav-tab-wrapper .nav-tab-premium {
|
142 |
-
background: #5ccc96;
|
143 |
-
color: white;
|
144 |
-
border-color: #5ccc96;
|
145 |
}
|
1 |
+
#icon-woocommerce-importer {
|
2 |
+
background-image: url(../images/wf-import.png) !important;
|
3 |
+
background-position: -3px -5px;
|
4 |
+
}
|
5 |
+
.widefat_importer td {
|
6 |
+
vertical-align: middle;
|
7 |
+
padding: 5px 9px;
|
8 |
+
}
|
9 |
+
#import-progress {
|
10 |
+
width: 100%;
|
11 |
+
}
|
12 |
+
#import-progress td, #import-progress th {
|
13 |
+
padding: .5em 1em;
|
14 |
+
}
|
15 |
+
#import-progress td.status, #import-progress th.status {
|
16 |
+
width: 32px;
|
17 |
+
}
|
18 |
+
#import-progress td.row, #import-progress th.row {
|
19 |
+
width: 3em;
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
#import-progress td.reason, #import-progress th.reason {
|
23 |
+
text-align: right;
|
24 |
+
}
|
25 |
+
#import-progress tr.importer-loading td {
|
26 |
+
background: url(../images/wf-ajax-loader.gif) no-repeat center center;
|
27 |
+
height: 32px;
|
28 |
+
}
|
29 |
+
#import-progress .merged td,
|
30 |
+
#import-progress .imported td {
|
31 |
+
}
|
32 |
+
#import-progress .skipped td {
|
33 |
+
border-bottom-color: #dbcb83;
|
34 |
+
background: #f2ecd2;
|
35 |
+
}
|
36 |
+
#import-progress .failed td {
|
37 |
+
border-bottom-color: #e6adaa;
|
38 |
+
background: #f2d3d2;
|
39 |
+
}
|
40 |
+
#import-progress mark.result {
|
41 |
+
height: 0;
|
42 |
+
display: block;
|
43 |
+
line-height: 16px;
|
44 |
+
overflow: hidden;
|
45 |
+
padding: 16px 0 0 0;
|
46 |
+
}
|
47 |
+
#import-progress .skipped mark.result {
|
48 |
+
background: url(../images/wf-notice.png) no-repeat center top;
|
49 |
+
}
|
50 |
+
#import-progress .merged mark.result,
|
51 |
+
#import-progress .imported mark.result {
|
52 |
+
background: url(../images/wf-success.png) no-repeat center top;
|
53 |
+
}
|
54 |
+
#import-progress .failed mark.result {
|
55 |
+
background: url(../images/wf-failed.png) no-repeat center top;
|
56 |
+
}
|
57 |
+
#import-progress .complete td {
|
58 |
+
background: #000;
|
59 |
+
border-color: #000;
|
60 |
+
border-top: 4px solid #000;
|
61 |
+
color: #fff;
|
62 |
+
font-size: 1.5em;
|
63 |
+
padding: .95em 1em 1em;
|
64 |
+
text-align: center;
|
65 |
+
}
|
66 |
+
#import-progress .regenerating td {
|
67 |
+
padding: 0;
|
68 |
+
}
|
69 |
+
#import-progress .regenerating div.progress {
|
70 |
+
background: #464646;
|
71 |
+
padding: .95em 1em 1em;
|
72 |
+
color: #fff;
|
73 |
+
overflow: hidden;
|
74 |
+
width: 0;
|
75 |
+
float: left;
|
76 |
+
text-align: left;
|
77 |
+
white-space: nowrap;
|
78 |
+
}
|
79 |
+
.update{
|
80 |
+
background: #fff;
|
81 |
+
border-left: 4px solid #fff;
|
82 |
+
padding: 1px 12px;
|
83 |
+
border-left-color: #46b450;
|
84 |
+
margin-top: 10px;
|
85 |
+
}
|
86 |
+
#datagrid { border-collapse: collapse; text-align: left; width: 80%; }
|
87 |
+
#datagrid {
|
88 |
+
background: #fff; overflow: hidden;
|
89 |
+
}
|
90 |
+
#datagrid td{ padding: 3px 10px; }
|
91 |
+
#datagrid th { padding: 8px 25px; color: #fff; background-color: #ccc; font-weight: bold;font-size: 15px; }
|
92 |
+
|
93 |
+
.woocommerce-message a.button-primary, .woocommerce-message button.button-primary{
|
94 |
+
background: #0085ba none repeat scroll 0 0 !important;
|
95 |
+
border-color: #0073aa #006799 #006799 !important;}
|
96 |
+
.woocommerce-message{border-left-color:#46b450 !important;}
|
97 |
+
.chosen-container-multi .chosen-choices li.search-field{
|
98 |
+
padding: 5px !important;
|
99 |
+
}
|
100 |
+
.chosen-container-multi .chosen-choices li.search-field input[type="text"]{
|
101 |
+
padding: 1px !important;
|
102 |
+
}
|
103 |
+
.order_actions .download_to_csv_wf {
|
104 |
+
display: block;
|
105 |
+
height: 2em !important;
|
106 |
+
padding: 0 !important;
|
107 |
+
position: relative;
|
108 |
+
text-indent: -9999px;
|
109 |
+
width: 2em;
|
110 |
+
}
|
111 |
+
.order_actions .download_to_csv_wf::after {
|
112 |
+
content: "";
|
113 |
+
font-family: "dashicons";
|
114 |
+
font-variant: normal;
|
115 |
+
font-weight: normal;
|
116 |
+
height: 100%;
|
117 |
+
left: 0;
|
118 |
+
margin: 0;
|
119 |
+
position: absolute;
|
120 |
+
text-align: center;
|
121 |
+
text-indent: 0;
|
122 |
+
text-transform: none;
|
123 |
+
top: 0;
|
124 |
+
width: 100%;
|
125 |
+
}
|
126 |
+
.pipe-view {
|
127 |
+
width: 65%;
|
128 |
+
float: left;
|
129 |
+
}
|
130 |
+
#datagrid td input {
|
131 |
+
margin-top: 4px;
|
132 |
+
box-shadow: none;
|
133 |
+
padding: 7px 10px;
|
134 |
+
}
|
135 |
+
.bg-white{
|
136 |
+
background: #fff;
|
137 |
+
}
|
138 |
+
.p-20p{
|
139 |
+
padding: 20px;
|
140 |
+
}
|
141 |
+
.nav-tab-wrapper .nav-tab-premium {
|
142 |
+
background: #5ccc96;
|
143 |
+
color: white;
|
144 |
+
border-color: #5ccc96;
|
145 |
}
|
temp-import.csv
CHANGED
File without changes
|