Product Import Export for WooCommerce - Version 1.7.8

Version Description

  • Bug Fix:- Problem with activating plugin in multisite.
  • Bug Fix:- Warning when open fails.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Product Import Export for WooCommerce
Version 1.7.8
Comparing to
See all releases

Code changes from version 1.7.7 to 1.7.8

Product_Commercial_Sample_CSV.csv CHANGED
@@ -2,11 +2,11 @@ Parent SKU,SKU,Product Name,Short Description,Description,Regular Price,Sale Pri
2
  ,A11,Samsung Galaxy Ace Duos,"-5 MP Primary Camera
3
  -3.5 inch Capacitive Touchscreen
4
  -Wi-Fi Enabled
5
- ","Having a much vaunted reputation of being one of the world’s leading budget smartphone makers, the Samsung Galaxy Ace Duos S6802 does quite well to maintain Samsung’s authority in the current market. The device comes in a bar shape and has a sleek look to it. The Ace Duos S6802 is a Smart Dual Active SIM, (GSM + GSM) device with both the inserted SIM cards being active at the same time. If you are on a call on sim 1 and you get a call on sim 2, the call would be diverted to sim 1 and the display would show it as call waiting.The same will be apply for both the Sims. So that we cannot miss out any calls on sim 1 and sim 2. This Samsung phone is run on the Android v2.3 (Gingerbread) OS with a snappy processor speed of 832 MHz. To assure the smooth running of apps, the device comes with an adequate 512 MB of RAM.",29.99,11.52,0.5,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-mobile.jpg|http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-mobile-2.jpg,simple,Mobile Phone,Smart Phone,,,,,,,,,,
6
  ,A12,Formal shoe,Formal shoe leather made,"Formal shoe leather made , black color",10,8,0.5,,simple,Shoes,Foot Wears,,,,,,,,,,
7
- ,A13,LED TV,LED TV 20 inches,LED TV 20 inches by samsung,30,29,1,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-tv.jpg,simple,Tele Vision,Electronics,,,,,,,,,,
8
- ,A14,Refrigerator,Double door Refrigerator,Double door Refrigerator with auto power saving,35,32,2,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-fridge.jpg,simple,Refrigerator,Electronics,,,,,,,,,,
9
- ,A15,Washing machine,Washing machine with remote control,Washing machine with remote controle and much more options,20,18,2,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-wm.jpg,simple,washing Machine,Electronics,,,,,,,,,,
10
- ,B11,Men's Cotton T-Shirt,The images represent actual product though color of the image and product may slightly differ.,Strut on the streets in comfort adorning this slim-fit T-Shirt from the house of Tinted. This unique creation is made using rayon that will highlight your torso. Work hard and play hard as you party through the night in this utterly comfortable T-Shirt.,10,,1,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-red.png,variable,Clothing & Accessories > Men > Tops & Tees > T-Shirts,T-Shirts,,Wash dark colors seperately,2|1|0,Blue|Red,3|0|1,red,Cotton,0|1|0,Regular Fit,1|1|0
11
- B11,B11V2,,,,24,12,,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-red.png,,,,red,,,,,,,,,
12
- B11,B11V1,,,,22,11,,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-blue.png,,,,blue,,,,,,,,,
2
  ,A11,Samsung Galaxy Ace Duos,"-5 MP Primary Camera
3
  -3.5 inch Capacitive Touchscreen
4
  -Wi-Fi Enabled
5
+ ","Having a much vaunted reputation of being one of the world’s leading budget smartphone makers, the Samsung Galaxy Ace Duos S6802 does quite well to maintain Samsung’s authority in the current market. The device comes in a bar shape and has a sleek look to it. The Ace Duos S6802 is a Smart Dual Active SIM, (GSM + GSM) device with both the inserted SIM cards being active at the same time. If you are on a call on sim 1 and you get a call on sim 2, the call would be diverted to sim 1 and the display would show it as call waiting.The same will be apply for both the Sims. So that we cannot miss out any calls on sim 1 and sim 2. This Samsung phone is run on the Android v2.3 (Gingerbread) OS with a snappy processor speed of 832 MHz. To assure the smooth running of apps, the device comes with an adequate 512 MB of RAM.",29.99,11.52,0.5,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-mobile.jpg|https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-mobile-2.jpg,simple,Mobile Phone,Smart Phone,,,,,,,,,,
6
  ,A12,Formal shoe,Formal shoe leather made,"Formal shoe leather made , black color",10,8,0.5,,simple,Shoes,Foot Wears,,,,,,,,,,
7
+ ,A13,LED TV,LED TV 20 inches,LED TV 20 inches by samsung,30,29,1,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-tv.jpg,simple,Tele Vision,Electronics,,,,,,,,,,
8
+ ,A14,Refrigerator,Double door Refrigerator,Double door Refrigerator with auto power saving,35,32,2,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-fridge.jpg,simple,Refrigerator,Electronics,,,,,,,,,,
9
+ ,A15,Washing machine,Washing machine with remote control,Washing machine with remote controle and much more options,20,18,2,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-wm.jpg,simple,washing Machine,Electronics,,,,,,,,,,
10
+ ,B11,Men's Cotton T-Shirt,The images represent actual product though color of the image and product may slightly differ.,Strut on the streets in comfort adorning this slim-fit T-Shirt from the house of Tinted. This unique creation is made using rayon that will highlight your torso. Work hard and play hard as you party through the night in this utterly comfortable T-Shirt.,10,,1,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-red.png,variable,Clothing & Accessories > Men > Tops & Tees > T-Shirts,T-Shirts,,Wash dark colors seperately,2|1|0,Blue|Red,3|0|1,red,Cotton,0|1|0,Regular Fit,1|1|0
11
+ B11,B11V2,,,,24,12,,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-red.png,,,,red,,,,,,,,,
12
+ B11,B11V1,,,,22,11,,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-blue.png,,,,blue,,,,,,,,,
Product_WooCommerce_Sample_CSV.csv CHANGED
@@ -2,11 +2,11 @@ parent_sku,sku,post_title,post_excerpt,post_content,regular_price,sale_price,wei
2
  ,A11,Samsung Galaxy Ace Duos,"-5 MP Primary Camera
3
  -3.5 inch Capacitive Touchscreen
4
  -Wi-Fi Enabled
5
- ","Having a much vaunted reputation of being one of the world’s leading budget smartphone makers, the Samsung Galaxy Ace Duos S6802 does quite well to maintain Samsung’s authority in the current market. The device comes in a bar shape and has a sleek look to it. The Ace Duos S6802 is a Smart Dual Active SIM, (GSM + GSM) device with both the inserted SIM cards being active at the same time. If you are on a call on sim 1 and you get a call on sim 2, the call would be diverted to sim 1 and the display would show it as call waiting.The same will be apply for both the Sims. So that we cannot miss out any calls on sim 1 and sim 2. This Samsung phone is run on the Android v2.3 (Gingerbread) OS with a snappy processor speed of 832 MHz. To assure the smooth running of apps, the device comes with an adequate 512 MB of RAM.",29.99,11.52,0.5,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-mobile.jpg|http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-mobile-2.jpg,simple,Mobile Phone,Smart Phone,,,,,,,,,,
6
  ,A12,Formal shoe,Formal shoe leather made,"Formal shoe leather made , black color",10,8,0.5,,simple,Shoes,Foot Wears,,,,,,,,,,
7
- ,A13,LED TV,LED TV 20 inches,LED TV 20 inches by samsung,30,29,1,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-tv.jpg,simple,Tele Vision,Electronics,,,,,,,,,,
8
- ,A14,Refrigerator,Double door Refrigerator,Double door Refrigerator with auto power saving,35,32,2,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-fridge.jpg,simple,Refrigerator,Electronics,,,,,,,,,,
9
- ,A15,Washing machine,Washing machine with remote control,Washing machine with remote controle and much more options,20,18,2,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-model-wm.jpg,simple,washing Machine,Electronics,,,,,,,,,,
10
- ,B11,Men's Cotton T-Shirt,The images represent actual product though color of the image and product may slightly differ.,Strut on the streets in comfort adorning this slim-fit T-Shirt from the house of Tinted. This unique creation is made using rayon that will highlight your torso. Work hard and play hard as you party through the night in this utterly comfortable T-Shirt.,10,,1,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-red.png,variable,Clothing & Accessories > Men > Tops & Tees > T-Shirts,T-Shirts,,Wash dark colors seperately,2|1|0,Blue|Red,3|0|1,red,Cotton,0|1|0,Regular Fit,1|1|0
11
- B11,B11V2,,,,24,12,,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-red.png,,,,red,,,,,,,,,
12
- B11,B11V1,,,,22,11,,http://productimportexport.webtoffee.com/public_html/wp-includes/images/products/hikeforce-men-t-shirt-blue.png,,,,blue,,,,,,,,,
2
  ,A11,Samsung Galaxy Ace Duos,"-5 MP Primary Camera
3
  -3.5 inch Capacitive Touchscreen
4
  -Wi-Fi Enabled
5
+ ","Having a much vaunted reputation of being one of the world’s leading budget smartphone makers, the Samsung Galaxy Ace Duos S6802 does quite well to maintain Samsung’s authority in the current market. The device comes in a bar shape and has a sleek look to it. The Ace Duos S6802 is a Smart Dual Active SIM, (GSM + GSM) device with both the inserted SIM cards being active at the same time. If you are on a call on sim 1 and you get a call on sim 2, the call would be diverted to sim 1 and the display would show it as call waiting.The same will be apply for both the Sims. So that we cannot miss out any calls on sim 1 and sim 2. This Samsung phone is run on the Android v2.3 (Gingerbread) OS with a snappy processor speed of 832 MHz. To assure the smooth running of apps, the device comes with an adequate 512 MB of RAM.",29.99,11.52,0.5,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-mobile.jpg|https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-mobile-2.jpg,simple,Mobile Phone,Smart Phone,,,,,,,,,,
6
  ,A12,Formal shoe,Formal shoe leather made,"Formal shoe leather made , black color",10,8,0.5,,simple,Shoes,Foot Wears,,,,,,,,,,
7
+ ,A13,LED TV,LED TV 20 inches,LED TV 20 inches by samsung,30,29,1,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-tv.jpg,simple,Tele Vision,Electronics,,,,,,,,,,
8
+ ,A14,Refrigerator,Double door Refrigerator,Double door Refrigerator with auto power saving,35,32,2,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-fridge.jpg,simple,Refrigerator,Electronics,,,,,,,,,,
9
+ ,A15,Washing machine,Washing machine with remote control,Washing machine with remote controle and much more options,20,18,2,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-model-wm.jpg,simple,washing Machine,Electronics,,,,,,,,,,
10
+ ,B11,Men's Cotton T-Shirt,The images represent actual product though color of the image and product may slightly differ.,Strut on the streets in comfort adorning this slim-fit T-Shirt from the house of Tinted. This unique creation is made using rayon that will highlight your torso. Work hard and play hard as you party through the night in this utterly comfortable T-Shirt.,10,,1,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-red.png,variable,Clothing & Accessories > Men > Tops & Tees > T-Shirts,T-Shirts,,Wash dark colors seperately,2|1|0,Blue|Red,3|0|1,red,Cotton,0|1|0,Regular Fit,1|1|0
11
+ B11,B11V2,,,,24,12,,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-red.png,,,,red,,,,,,,,,
12
+ B11,B11V1,,,,22,11,,https://media.wtdev.xyz/wp-content/uploads/2020/04/wt-men-t-shirt-blue.png,,,,blue,,,,,,,,,
includes/class-wf-prodimpexpcsv-ajax-handler.php CHANGED
File without changes
includes/importer/class-wf-prodimpexpcsv-product-import.php CHANGED
@@ -541,11 +541,10 @@ class WF_ProdImpExpCsv_Product_Import extends WP_Importer {
541
  $enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
542
  if ( $enc ) setlocale( LC_ALL, 'en_US.' . $enc );
543
  @ini_set( 'auto_detect_line_endings', true );
544
-
545
  // Get headers
546
  if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
547
 
548
- $row = $raw_headers = array();
549
  $csv_delimiter = $this->delimiter;
550
  $header = fgetcsv( $handle, 0, $csv_delimiter );
551
 
541
  $enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
542
  if ( $enc ) setlocale( LC_ALL, 'en_US.' . $enc );
543
  @ini_set( 'auto_detect_line_endings', true );
544
+ $row = $raw_headers = array();
545
  // Get headers
546
  if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
547
 
 
548
  $csv_delimiter = $this->delimiter;
549
  $header = fgetcsv( $handle, 0, $csv_delimiter );
550
 
product-import-export-for-woo.php CHANGED
@@ -5,273 +5,259 @@
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
- Version: 1.7.7
9
  WC tested up to: 4.0.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
13
  */
14
 
15
- if (!defined('ABSPATH') || !is_admin()) {
16
- return;
17
  }
18
 
19
 
20
- if (!defined('WF_PIPE_CURRENT_VERSION')) {
21
- define("WF_PIPE_CURRENT_VERSION", "1.7.7");
22
  }
23
- if (!defined('WF_PROD_IMP_EXP_ID')) {
24
- define("WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp");
25
  }
26
- if (!defined('WF_WOOCOMMERCE_CSV_IM_EX')) {
27
- define("WF_WOOCOMMERCE_CSV_IM_EX", "wf_woocommerce_csv_im_ex");
28
  }
29
  /**
30
  * Check if WooCommerce is active
31
  */
32
- if ( ! in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { // deactive if woocommerce in not active
33
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
34
- deactivate_plugins( plugin_basename(__FILE__) );
35
  }
36
- //if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
37
-
38
- if (!class_exists('WF_Product_Import_Export_CSV')) :
39
-
40
- /**
41
- * Main CSV Import class
42
- */
43
- class WF_Product_Import_Export_CSV {
44
-
45
- /**
46
- * Constructor
47
- */
48
- public function __construct() {
49
- if (!defined('WF_ProdImpExpCsv_FILE')) {
50
- define('WF_ProdImpExpCsv_FILE', __FILE__);
51
- }
52
-
53
- if (!defined('WF_ProdImpExpCsv_BASE')) {
54
- define('WF_ProdImpExpCsv_BASE', plugin_dir_path(__FILE__));
55
- }
56
-
57
- add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
58
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
59
- add_action('init', array($this, 'load_plugin_textdomain'));
60
- add_action('init', array($this, 'catch_export_request'), 20);
61
- add_action('admin_init', array($this, 'register_importers'));
62
-
63
- add_filter('admin_footer_text', array($this, 'WT_admin_footer_text'), 100);
64
- add_action('wp_ajax_pipe_wt_review_plugin', array($this, "review_plugin"));
65
-
66
-
67
- // if (!get_option('webtoffee_storefrog_admin_notices_dismissed')) {
68
- // add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
69
- // add_action('wp_ajax_webtoffee_storefrog_notice_dismiss', array($this, 'webtoffee_storefrog_notice_dismiss'));
70
- // }
71
-
72
- include_once( 'includes/class-wf-prodimpexpcsv-system-status-tools.php' );
73
- include_once( 'includes/class-wf-prodimpexpcsv-admin-screen.php' );
74
- include_once( 'includes/importer/class-wf-prodimpexpcsv-importer.php' );
75
-
76
- if (defined('DOING_AJAX')) {
77
- include_once( 'includes/class-wf-prodimpexpcsv-ajax-handler.php' );
78
- }
79
-
80
- // uninstall feedback catch
81
- include_once 'includes/class-wf-prodimpexp-plugin-uninstall-feedback.php';
82
- }
83
-
84
- public function wf_plugin_action_links($links) {
85
- $plugin_links = array(
86
- '<a href="' . admin_url('admin.php?page=wf_woocommerce_csv_im_ex&tab=export') . '">' . __('Import Export', 'product-import-export-for-woo') . '</a>',
87
- '<a target="_blank" href="https://www.webtoffee.com/product/product-import-export-woocommerce/" style="color:#3db634;"> ' . __('Premium Upgrade', 'product-import-export-for-woo') . '</a>',
88
- '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/">' . __('Support', 'product-import-export-for-woo') . '</a>',
89
- '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews/">' . __('Review', 'product-import-export-for-woo') . '</a>',
90
- );
91
- if (array_key_exists('deactivate', $links)) {
92
- $links['deactivate'] = str_replace('<a', '<a class="pipe-deactivate-link"', $links['deactivate']);
93
- }
94
- return array_merge($plugin_links, $links);
95
- }
96
-
97
- /**
98
- * Add screen ID
99
- */
100
- public function woocommerce_screen_ids($ids) {
101
- $ids[] = 'admin'; // For import screen
102
- return $ids;
103
- }
104
-
105
- /**
106
- * Handle localization
107
- */
108
- public function load_plugin_textdomain() {
109
- load_plugin_textdomain('product-import-export-for-woo', false, dirname(plugin_basename(__FILE__)) . '/lang/');
110
- }
111
-
112
- /**
113
- * Catches an export request and exports the data. This class is only loaded in admin.
114
- */
115
- public function catch_export_request() {
116
-
117
- if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'wf_woocommerce_csv_im_ex') {
118
- switch ($_GET['action']) {
119
- case "export" :
120
- $user_ok = self::hf_user_permission();
121
- if ($user_ok) {
122
- include_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );
123
- WF_ProdImpExpCsv_Exporter::do_export('product');
124
- } else {
125
- wp_redirect(wp_login_url());
126
- }
127
- break;
128
- }
129
- }
130
- }
131
-
132
- /**
133
- * Register importers for use
134
- */
135
- public function register_importers() {
136
- register_importer('xa_woocommerce_csv', 'WebToffee WooCommerce Product Import (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'product-import-export-for-woo'), 'WF_ProdImpExpCsv_Importer::product_importer');
137
- }
138
-
139
- public static function hf_user_permission() {
140
- // Check if user has rights to export
141
- $current_user = wp_get_current_user();
142
- $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);
143
- $current_user->roles = array_unique($current_user->roles);
144
- $user_ok = false;
145
- $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
146
- if ($current_user instanceof WP_User) {
147
- $can_users = array_intersect($wf_roles, $current_user->roles);
148
- if (!empty($can_users) || is_super_admin($current_user->ID)) {
149
- $user_ok = true;
150
- }
151
- }
152
- return $user_ok;
153
- }
154
-
155
- function webtoffee_storefrog_admin_notices() {
156
- if (apply_filters('webtoffee_storefrog_suppress_admin_notices', false) || !self::hf_user_permission()) {
157
- return;
158
- }
159
- $screen = get_current_screen();
160
- $allowed_screen_ids = array('product_page_wf_woocommerce_csv_im_ex');
161
-
162
- if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
163
-
164
- $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'product-import-export-for-woo');
165
- $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'product-import-export-for-woo');
166
-
167
- $content = '<style>.webtoffee-storefrog-nav-tab.updated {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>';
168
- $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_ProdImpExpCsv_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.</span></button></div></div>';
169
- echo $content;
170
-
171
-
172
- wc_enqueue_js("
 
 
 
 
 
 
 
 
 
 
 
173
  jQuery( '#webtoffee-storefrog-notice-dismiss' ).click( function() {
174
 
175
- jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'webtoffee_storefrog_notice_dismiss' } );
176
  jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
177
  });
178
- ");
179
- }
180
- }
181
-
182
- public function webtoffee_storefrog_notice_dismiss() {
183
-
184
- if (!self::hf_user_permission()) {
185
- wp_die(-1);
186
- }
187
- update_option('webtoffee_storefrog_admin_notices_dismissed', 1);
188
- wp_die();
189
- }
190
-
191
- public function WT_admin_footer_text($footer_text) {
192
- if (!self::hf_user_permission()) {
193
- return $footer_text;
194
- }
195
- $screen = get_current_screen();
196
- $allowed_screen_ids = array('product_page_wf_woocommerce_csv_im_ex');
197
- if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'xa_woocommerce_csv')) {
198
- if (!get_option('pipe_wt_plugin_reviewed')) {
199
- $footer_text = sprintf(
200
- __('If you like the plugin please leave us a %1$s review.', 'product-import-export-for-woo'), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__('Thanks :)', 'product-import-export-for-woo') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
201
- );
202
- wc_enqueue_js(
203
- "jQuery( 'a.wt-review-link' ).click( function() {
204
  jQuery.post( '" . WC()->ajax_url() . "', { action: 'pipe_wt_review_plugin' } );
205
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
206
  });"
207
- );
208
- } else {
209
- $footer_text = __('Thank you for your review.', 'product-import-export-for-woo');
210
- }
211
- }
212
-
213
- return '<i>'.$footer_text.'</i>';
214
- }
215
-
216
-
217
- public function review_plugin(){
218
- if (!self::hf_user_permission()) {
219
- wp_die(-1);
220
- }
221
- update_option('pipe_wt_plugin_reviewed', 1);
222
- wp_die();
223
- }
224
-
225
- }
226
-
227
- endif;
228
-
229
- new WF_Product_Import_Export_CSV();
230
- //}
231
-
232
-
233
-
234
- // Welcome screen tutorial video --> Move this function to inside the class
235
- add_action('admin_init', 'impexp_welcome');
236
-
237
- register_activation_hook(__FILE__, 'hf_welcome_screen_activate_basic');
238
-
239
- function hf_welcome_screen_activate_basic() {
240
- if(!class_exists( 'WooCommerce' )){
241
- deactivate_plugins(basename(__FILE__));
242
- wp_die(__("WooCommerce is not installed/actived. it is required for this plugin to work properly. Please activate WooCommerce.", 'product-import-export-for-woo'), "", array('back_link' => 1));
243
- }
244
- if (is_plugin_active('product-csv-import-export-for-woocommerce/product-csv-import-export.php')) {
245
- deactivate_plugins(basename(__FILE__));
246
- wp_die(__("Is everything fine? You already have the Premium version installed in your website. For any issues, kindly raise a ticket via <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>", 'product-import-export-for-woo'), "", array('back_link' => 1));
247
- }
248
- update_option('xa_pipe_plugin_installed_date', date('Y-m-d H:i:s'));
249
- set_transient('_welcome_screen_activation_redirect', true, 30);
250
- }
251
-
252
- if (!function_exists('impexp_welcome')) {
253
-
254
- function impexp_welcome() {
255
- if (!get_transient('_welcome_screen_activation_redirect')) {
256
- return;
257
- }
258
- delete_transient('_welcome_screen_activation_redirect');
259
- wp_safe_redirect(add_query_arg(array('page' => 'wf_woocommerce_csv_im_ex'), admin_url('admin.php')));
260
- }
261
-
262
- }
263
-
264
- /*
265
- * Displays update information for a plugin.
266
- */
267
- function wt_product_import_export_for_woo_update_message( $data, $response )
268
- {
269
- if(isset( $data['upgrade_notice']))
270
- {
271
- printf(
272
- '<div class="update-message wt-update-message">%s</div>',
273
- $data['upgrade_notice']
274
- );
275
- }
276
- }
277
- add_action( 'in_plugin_update_message-product-import-export-for-woo/product-import-export-for-woo.php', 'wt_product_import_export_for_woo_update_message', 10, 2 );
5
  Description: Import and Export Products From and To your WooCommerce Store.
6
  Author: WebToffee
7
  Author URI: https://www.webtoffee.com/product/product-import-export-woocommerce/
8
+ Version: 1.7.8
9
  WC tested up to: 4.0.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Text Domain: product-import-export-for-woo
13
  */
14
 
15
+ if ( !defined( 'ABSPATH' ) || !is_admin() ) {
16
+ return;
17
  }
18
 
19
 
20
+ if ( !defined( 'WF_PIPE_CURRENT_VERSION' ) ) {
21
+ define( "WF_PIPE_CURRENT_VERSION", "1.7.8" );
22
  }
23
+ if ( !defined( 'WF_PROD_IMP_EXP_ID' ) ) {
24
+ define( "WF_PROD_IMP_EXP_ID", "wf_prod_imp_exp" );
25
  }
26
+ if ( !defined( 'WF_WOOCOMMERCE_CSV_IM_EX' ) ) {
27
+ define( "WF_WOOCOMMERCE_CSV_IM_EX", "wf_woocommerce_csv_im_ex" );
28
  }
29
  /**
30
  * Check if WooCommerce is active
31
  */
32
+ if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) && !array_key_exists( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_site_option( 'active_sitewide_plugins', array() ) ) ) ) { // deactive if woocommerce in not active
33
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
34
+ deactivate_plugins( plugin_basename( __FILE__ ) );
35
  }
36
+ register_activation_hook( __FILE__, 'hf_welcome_screen_activate_basic' );
37
+
38
+ function hf_welcome_screen_activate_basic() {
39
+ if ( !class_exists( 'WooCommerce' ) ) {
40
+ deactivate_plugins( basename( __FILE__ ) );
41
+ wp_die( __( "WooCommerce is required for this plugin to work properly. Please activate WooCommerce.", 'product-import-export-for-woo' ), "", array( 'back_link' => 1 ) );
42
+ }
43
+ if ( is_plugin_active( 'product-csv-import-export-for-woocommerce/product-csv-import-export.php' ) ) {
44
+ deactivate_plugins( basename( __FILE__ ) );
45
+ wp_die( __( "Is everything fine? You already have the Premium version installed in your website. For any issues, kindly raise a ticket via <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>", 'product-import-export-for-woo' ), "", array( 'back_link' => 1 ) );
46
+ }
47
+ update_option( 'xa_pipe_plugin_installed_date', date( 'Y-m-d H:i:s' ) );
48
+ set_transient( '_welcome_screen_activation_redirect', true, 30 );
49
+ }
50
+
51
+ if ( !class_exists( 'WF_Product_Import_Export_CSV' ) ) :
52
+
53
+ /**
54
+ * Main CSV Import class
55
+ */
56
+ class WF_Product_Import_Export_CSV {
57
+
58
+ /**
59
+ * Constructor
60
+ */
61
+ public function __construct() {
62
+ if ( !defined( 'WF_ProdImpExpCsv_FILE' ) ) {
63
+ define( 'WF_ProdImpExpCsv_FILE', __FILE__ );
64
+ }
65
+
66
+ if ( !defined( 'WF_ProdImpExpCsv_BASE' ) ) {
67
+ define( 'WF_ProdImpExpCsv_BASE', plugin_dir_path( __FILE__ ) );
68
+ }
69
+
70
+ add_filter( 'woocommerce_screen_ids', array( $this, 'woocommerce_screen_ids' ) );
71
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'wf_plugin_action_links' ) );
72
+ add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
73
+ add_action( 'init', array( $this, 'catch_export_request' ), 20 );
74
+ add_action( 'admin_init', array( $this, 'register_importers' ) );
75
+
76
+ add_filter( 'admin_footer_text', array( $this, 'WT_admin_footer_text' ), 100 );
77
+ add_action( 'wp_ajax_pipe_wt_review_plugin', array( $this, "review_plugin" ) );
78
+
79
+
80
+ include_once( 'includes/class-wf-prodimpexpcsv-system-status-tools.php' );
81
+ include_once( 'includes/class-wf-prodimpexpcsv-admin-screen.php' );
82
+ include_once( 'includes/importer/class-wf-prodimpexpcsv-importer.php' );
83
+
84
+ if ( defined( 'DOING_AJAX' ) ) {
85
+ include_once( 'includes/class-wf-prodimpexpcsv-ajax-handler.php' );
86
+ }
87
+
88
+ // uninstall feedback catch
89
+ include_once 'includes/class-wf-prodimpexp-plugin-uninstall-feedback.php';
90
+ // Welcome screen tutorial video --> Move this function to inside the class
91
+ add_action( 'admin_init', array( $this, 'impexp_welcome' ) );
92
+ add_action( 'in_plugin_update_message-product-import-export-for-woo/product-import-export-for-woo.php', array( $this, 'wt_product_import_export_for_woo_update_message' ), 10, 2 );
93
+ }
94
+
95
+ public function wf_plugin_action_links( $links ) {
96
+ $plugin_links = array(
97
+ '<a href="' . admin_url( 'admin.php?page=wf_woocommerce_csv_im_ex&tab=export' ) . '">' . __( 'Import Export', 'product-import-export-for-woo' ) . '</a>',
98
+ '<a target="_blank" href="https://www.webtoffee.com/product/product-import-export-woocommerce/" style="color:#3db634;"> ' . __( 'Premium Upgrade', 'product-import-export-for-woo' ) . '</a>',
99
+ '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/">' . __( 'Support', 'product-import-export-for-woo' ) . '</a>',
100
+ '<a target="_blank" href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews/">' . __( 'Review', 'product-import-export-for-woo' ) . '</a>',
101
+ );
102
+ if ( array_key_exists( 'deactivate', $links ) ) {
103
+ $links[ 'deactivate' ] = str_replace( '<a', '<a class="pipe-deactivate-link"', $links[ 'deactivate' ] );
104
+ }
105
+ return array_merge( $plugin_links, $links );
106
+ }
107
+
108
+ /**
109
+ * Add screen ID
110
+ */
111
+ public function woocommerce_screen_ids( $ids ) {
112
+ $ids[] = 'admin'; // For import screen
113
+ return $ids;
114
+ }
115
+
116
+ /**
117
+ * Handle localization
118
+ */
119
+ public function load_plugin_textdomain() {
120
+ load_plugin_textdomain( 'product-import-export-for-woo', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
121
+ }
122
+
123
+ /**
124
+ * Catches an export request and exports the data. This class is only loaded in admin.
125
+ */
126
+ public function catch_export_request() {
127
+
128
+ if ( !empty( $_GET[ 'action' ] ) && !empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'wf_woocommerce_csv_im_ex' ) {
129
+ switch ( $_GET[ 'action' ] ) {
130
+ case "export" :
131
+ $user_ok = self::hf_user_permission();
132
+ if ( $user_ok ) {
133
+ include_once( 'includes/exporter/class-wf-prodimpexpcsv-exporter.php' );
134
+ WF_ProdImpExpCsv_Exporter::do_export( 'product' );
135
+ } else {
136
+ wp_redirect( wp_login_url() );
137
+ }
138
+ break;
139
+ }
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Register importers for use
145
+ */
146
+ public function register_importers() {
147
+ register_importer( 'xa_woocommerce_csv', 'WebToffee WooCommerce Product Import (CSV)', __( 'Import <strong>products</strong> to your store via a csv file.', 'product-import-export-for-woo' ), 'WF_ProdImpExpCsv_Importer::product_importer' );
148
+ }
149
+
150
+ public static function hf_user_permission() {
151
+ // Check if user has rights to export
152
+ $current_user = wp_get_current_user();
153
+ $current_user->roles = apply_filters( 'hf_add_user_roles', $current_user->roles );
154
+ $current_user->roles = array_unique( $current_user->roles );
155
+ $user_ok = false;
156
+ $wf_roles = apply_filters( 'hf_user_permission_roles', array( 'administrator', 'shop_manager' ) );
157
+ if ( $current_user instanceof WP_User ) {
158
+ $can_users = array_intersect( $wf_roles, $current_user->roles );
159
+ if ( !empty( $can_users ) || is_super_admin( $current_user->ID ) ) {
160
+ $user_ok = true;
161
+ }
162
+ }
163
+ return $user_ok;
164
+ }
165
+
166
+ function webtoffee_storefrog_admin_notices() {
167
+ if ( apply_filters( 'webtoffee_storefrog_suppress_admin_notices', false ) || !self::hf_user_permission() ) {
168
+ return;
169
+ }
170
+ $screen = get_current_screen();
171
+ $allowed_screen_ids = array( 'product_page_wf_woocommerce_csv_im_ex' );
172
+
173
+ if ( in_array( $screen->id, $allowed_screen_ids ) || (isset( $_GET[ 'import' ] ) && $_GET[ 'import' ] == 'xa_woocommerce_csv') ) {
174
+
175
+ $notice = __( '<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'product-import-export-for-woo' );
176
+ $notice .= __( '<h3>Use StoreFrog Migration Services.</h3>', 'product-import-export-for-woo' );
177
+
178
+ $content = '<style>.webtoffee-storefrog-nav-tab.updated {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>';
179
+ $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_ProdImpExpCsv_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.</span></button></div></div>';
180
+ echo $content;
181
+
182
+
183
+ wc_enqueue_js( "
184
  jQuery( '#webtoffee-storefrog-notice-dismiss' ).click( function() {
185
 
186
+ jQuery.post( '" . admin_url( "admin-ajax.php" ) . "', { action: 'webtoffee_storefrog_notice_dismiss' } );
187
  jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
188
  });
189
+ " );
190
+ }
191
+ }
192
+
193
+ public function webtoffee_storefrog_notice_dismiss() {
194
+
195
+ if ( !self::hf_user_permission() ) {
196
+ wp_die( -1 );
197
+ }
198
+ update_option( 'webtoffee_storefrog_admin_notices_dismissed', 1 );
199
+ wp_die();
200
+ }
201
+
202
+ public function WT_admin_footer_text( $footer_text ) {
203
+ if ( !self::hf_user_permission() ) {
204
+ return $footer_text;
205
+ }
206
+ $screen = get_current_screen();
207
+ $allowed_screen_ids = array( 'product_page_wf_woocommerce_csv_im_ex' );
208
+ if ( in_array( $screen->id, $allowed_screen_ids ) || (isset( $_GET[ 'import' ] ) && $_GET[ 'import' ] == 'xa_woocommerce_csv') ) {
209
+ if ( !get_option( 'pipe_wt_plugin_reviewed' ) ) {
210
+ $footer_text = sprintf(
211
+ __( 'If you like the plugin please leave us a %1$s review.', 'product-import-export-for-woo' ), '<a href="https://wordpress.org/support/plugin/product-import-export-for-woo/reviews?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__( 'Thanks :)', 'product-import-export-for-woo' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
212
+ );
213
+ wc_enqueue_js(
214
+ "jQuery( 'a.wt-review-link' ).click( function() {
215
  jQuery.post( '" . WC()->ajax_url() . "', { action: 'pipe_wt_review_plugin' } );
216
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
217
  });"
218
+ );
219
+ } else {
220
+ $footer_text = __( 'Thank you for your review.', 'product-import-export-for-woo' );
221
+ }
222
+ }
223
+
224
+ return '<i>' . $footer_text . '</i>';
225
+ }
226
+
227
+ public function review_plugin() {
228
+ if ( !self::hf_user_permission() ) {
229
+ wp_die( -1 );
230
+ }
231
+ update_option( 'pipe_wt_plugin_reviewed', 1 );
232
+ wp_die();
233
+ }
234
+
235
+ /*
236
+ * Redirect to import export page after the plugin activation.
237
+ */
238
+
239
+ public function impexp_welcome() {
240
+ if ( !get_transient( '_welcome_screen_activation_redirect' ) ) {
241
+ return;
242
+ }
243
+ delete_transient( '_welcome_screen_activation_redirect' );
244
+ wp_safe_redirect( add_query_arg( array( 'page' => 'wf_woocommerce_csv_im_ex' ), admin_url( 'admin.php' ) ) );
245
+ }
246
+
247
+ /*
248
+ * Displays update information for the plugin.
249
+ */
250
+
251
+ public function wt_product_import_export_for_woo_update_message( $data, $response ) {
252
+ if ( isset( $data[ 'upgrade_notice' ] ) ) {
253
+ printf(
254
+ '<div class="update-message wt-update-message">%s</div>', $data[ 'upgrade_notice' ]
255
+ );
256
+ }
257
+ }
258
+
259
+ }
260
+
261
+ endif;
262
+
263
+ new WF_Product_Import_Export_CSV();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
4
  Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce ,product, export, import, woocommerce ,csv
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
- Stable tag: 1.7.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -31,9 +31,6 @@ The WooCommerce Product Import Export Plugin takes CSV (Comma-Separated Values)
31
 
32
  You can create the CSV from scratch or you can export the product to get the format of CSV. You can use a spreadsheet program, such as LibreOffice , Microsoft Excel, OpenOffice or Google Spreadsheets for creating and modifying the CSV file. Save this file with extension .CSV. After entering all details about products in spreadsheet, you can import product to your online store. With this plugin, you can also export and download product details as a CSV file.
33
 
34
- = Premium version video demo =
35
- [youtube http://www.youtube.com/watch?v=fBuf54rUakY&rel=0&showinfo=0]
36
-
37
  <blockquote>
38
 
39
  = Premium version Features =
@@ -69,6 +66,8 @@ WooCommerce import products & WooCommerce export products functionalities made e
69
  = WooCommerce export products =
70
  There are multiple cases where one need to export WooCommerce products. It could be either for sending the details to someone else or integrating with a third-party system. For example, you can export woocommerce products as csv file in to an ftp folder on a regular basis using the cron job. This can be read by any third-party application to update its data.
71
 
 
 
72
  Export WooCommerce Products: Export and download product data in CSV file format. Plugins supports,
73
 
74
  WooCommerce Simple Products
@@ -86,6 +85,8 @@ It is as simple as clicking a button. But if you need to customize your export w
86
  = WooCommerce Import Products =
87
  WooCommerce bulk product upload is one of the main use case where WooCommerce product import functionality is used. 'How to import products into woocommerce' is one of the common question people ask. Our WooCommerce product csv import suite is the perfect answer for this. With is plugin you can import products from any xml or csv to WooCommerce. This saves lot of time and minimises errors.
88
 
 
 
89
  WooCommerce product import: You can use the import functionality to:
90
 
91
  Import by selecting file from your computer
@@ -153,6 +154,10 @@ By default, admin and store manager are given access to export orders from your
153
 
154
  == Changelog ==
155
 
 
 
 
 
156
  = 1.7.7 =
157
  * Tested OK with WP 5.4
158
 
4
  Tags: woocommerce product import, woocommerce import products, woocommerce export products, export woocommerce products, import products into woocommerce ,product, export, import, woocommerce ,csv
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
+ Stable tag: 1.7.8
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
31
 
32
  You can create the CSV from scratch or you can export the product to get the format of CSV. You can use a spreadsheet program, such as LibreOffice , Microsoft Excel, OpenOffice or Google Spreadsheets for creating and modifying the CSV file. Save this file with extension .CSV. After entering all details about products in spreadsheet, you can import product to your online store. With this plugin, you can also export and download product details as a CSV file.
33
 
 
 
 
34
  <blockquote>
35
 
36
  = Premium version Features =
66
  = WooCommerce export products =
67
  There are multiple cases where one need to export WooCommerce products. It could be either for sending the details to someone else or integrating with a third-party system. For example, you can export woocommerce products as csv file in to an ftp folder on a regular basis using the cron job. This can be read by any third-party application to update its data.
68
 
69
+ [youtube https://www.youtube.com/watch?v=Fn1IKbjqabM]
70
+
71
  Export WooCommerce Products: Export and download product data in CSV file format. Plugins supports,
72
 
73
  WooCommerce Simple Products
85
  = WooCommerce Import Products =
86
  WooCommerce bulk product upload is one of the main use case where WooCommerce product import functionality is used. 'How to import products into woocommerce' is one of the common question people ask. Our WooCommerce product csv import suite is the perfect answer for this. With is plugin you can import products from any xml or csv to WooCommerce. This saves lot of time and minimises errors.
87
 
88
+ [youtube https://www.youtube.com/watch?v=i2GULQm5ftQ]
89
+
90
  WooCommerce product import: You can use the import functionality to:
91
 
92
  Import by selecting file from your computer
154
 
155
  == Changelog ==
156
 
157
+ = 1.7.8 =
158
+ * Bug Fix:- Problem with activating plugin in multisite.
159
+ * Bug Fix:- Warning when open fails.
160
+
161
  = 1.7.7 =
162
  * Tested OK with WP 5.4
163