Flexible Shipping for WooCommerce - Version 3.6.0

Version Description

  • 2019-07-24 =
  • Added filter flexible_shipping_csv_delimiter to CSV delimiter
  • Fixed support for , in exported csv file
  • Fixed import speed for more complex shipment methods
Download this release

Release Info

Developer jablonowski
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 3.6.0
Comparing to
See all releases

Code changes from version 3.5.1 to 3.6.0

classes/table-rate/csv/{class-csv-importer.php → class-wpdesk-flexible-shipping-csv-importer.php} RENAMED
@@ -1,10 +1,17 @@
1
  <?php
 
 
 
 
 
2
 
3
  /**
4
  * Import shipping methods and rules from CSV.
5
  */
6
  class WPDesk_Flexible_Shipping_Csv_Importer {
7
 
 
 
8
  /**
9
  * Flexible Shipping shipping method.
10
  *
@@ -12,13 +19,44 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
12
  */
13
  private $flexible_shipping_method;
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * WPDesk_Flexible_Shipping_Csv_Importer constructor.
17
  *
18
  * @param WPDesk_Flexible_Shipping $flexible_shipping_method Flexible shipping method.
19
  */
20
  public function __construct( $flexible_shipping_method ) {
21
- $this->flexible_shipping_method = $flexible_shipping_method;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
  /**
@@ -29,9 +67,11 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
29
  * @return array
30
  */
31
  private function load_csv_from_file( $tmp_name ) {
32
- return array_map( function ( $v ) {
33
- return str_getcsv( $v, ';' );
34
- }, file( $tmp_name ) );
 
 
35
  }
36
 
37
  /**
@@ -39,12 +79,14 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
39
  *
40
  * @param array $row Row.
41
  * @param array $columns Columns.
 
42
  * @return array
43
  */
44
  private function add_columns_to_row( array $row, array $columns ) {
45
  foreach ( $columns as $col_key => $col ) {
46
  $row[ $col ] = $row[ $col_key ];
47
  }
 
48
  return $row;
49
  }
50
 
@@ -66,6 +108,7 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
66
  }
67
  $first = false;
68
  }
 
69
  return $csv_array;
70
  }
71
 
@@ -83,7 +126,12 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
83
  private function new_shipping_method( array $csv_row, array $shipping_methods, $import_row_count ) {
84
  $new_shipping_method = array( 'method_enabled' => 'no' );
85
  if ( ! isset( $csv_row['Method Title'] ) || '' === trim( $csv_row['Method Title'] ) ) {
86
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( __( 'Sorry, there has been an error. The CSV is invalid or incorrect file type.', 'flexible-shipping' ) );
 
 
 
 
 
87
  }
88
  $method_title = $csv_row['Method Title'];
89
  $count = 0;
@@ -91,7 +139,10 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
91
  if ( 0 === $count ) {
92
  $method_title = $csv_row['Method Title'] . ' (' . __( 'import', 'flexible-shipping' ) . ')';
93
  } else {
94
- $method_title = $csv_row['Method Title'] . ' (' . __( 'import', 'flexible-shipping' ) . ' ' . $count . ')';
 
 
 
95
  }
96
  $count ++;
97
  }
@@ -99,18 +150,37 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
99
  $new_shipping_method['id_for_shipping'] = $this->flexible_shipping_method->id . '_' . $this->flexible_shipping_method->instance_id . '_' . $new_shipping_method['id'];
100
  $new_shipping_method['method_title'] = $method_title;
101
  $new_shipping_method['method_description'] = $csv_row['Method Description'];
102
- if ( '' !== trim( $csv_row['Free Shipping'] ) && ! is_numeric( str_replace( ',', '.', $csv_row['Free Shipping'] ) ) ) {
103
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
104
- // Translators: free shipping value and row number.
105
- __( 'Free Shipping value %1$s is not valid number. Row number %2$d.', 'flexible-shipping' ), $csv_row['Free Shipping'], $import_row_count
106
- ) );
 
 
 
 
 
 
 
 
107
  }
108
- $new_shipping_method[ WPDesk_Flexible_Shipping::FIELD_METHOD_FREE_SHIPPING ] = str_replace( ',', '.', $csv_row['Free Shipping'] );
109
- if ( trim( $csv_row['Maximum Cost'] ) !== '' && ! is_numeric( str_replace( ',', '.', $csv_row['Maximum Cost'] ) ) ) {
110
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
111
- // Translators: maximum cost value and row number.
112
- __( 'Maximum Cost value %1$s is not valid number. Row number %2$d.', 'flexible-shipping' ), $csv_row['Maximum Cost'], $import_row_count
113
- ) );
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
  $new_shipping_method['method_max_cost'] = str_replace( ',', '.', $csv_row['Maximum Cost'] );
116
  $new_shipping_method['method_calculation_method'] = $csv_row['Calculation Method'];
@@ -119,10 +189,12 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
119
  array( 'sum', 'lowest', 'highest' ),
120
  true
121
  ) ) {
122
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
123
- // Translators: row number.
124
- __( 'Invalid value for Calculation Method in row number %d.', 'flexible-shipping' ), $import_row_count
125
- ) );
 
 
126
  }
127
  $new_shipping_method['method_visibility'] = $csv_row['Visibility'];
128
  if ( 'yes' !== $new_shipping_method['method_visibility'] ) {
@@ -149,17 +221,62 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
149
  */
150
  private function get_numeric_value_from_row( array $csv_row, $column, $import_row_count ) {
151
  if ( '' !== trim( $csv_row[ $column ] ) && ! is_numeric( str_replace( ',', '.', $csv_row[ $column ] ) ) ) {
152
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
153
- // Translators: column name, value and row number.
154
- __( '%1$s value %2$s is not valid number. Row number %3$d.', 'flexible-shipping' ),
155
- $column,
156
- $csv_row['Min'],
157
- $import_row_count
158
- ) );
 
 
159
  }
 
160
  return str_replace( ',', '.', $csv_row[ $column ] );
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  /**
164
  * Maybe populate and create shipping classes.
165
  *
@@ -174,31 +291,17 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
174
  $rule['shipping_class'] = array();
175
  foreach ( $rule_shipping_classes as $rule_shipping_class ) {
176
  if ( ! in_array( $rule_shipping_class, array( 'all', 'any', 'none' ), true ) ) {
177
- $shipping_class_found = false;
178
- WC()->shipping()->shipping_classes = array();
179
- $wc_shipping_classes = WC()->shipping()->get_shipping_classes();
180
- foreach ( $wc_shipping_classes as $shipping_class ) {
181
- if ( $shipping_class->name === $rule_shipping_class ) {
182
- $rule['shipping_class'][] = $shipping_class->term_id;
183
- $shipping_class_found = true;
184
- }
185
- }
186
- if ( ! $shipping_class_found ) {
187
- $term_id = wp_insert_term( $rule_shipping_class, 'product_shipping_class', array( 'description' => $rule_shipping_class ) );
188
- if ( is_wp_error( $term_id ) ) {
189
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
190
- // Translators: rule shipping class and wp_error message.
191
- __( 'Error while creating shipping class: %1$s, %2$s', 'flexible-shipping' ), $rule_shipping_class, $term_id->get_error_message()
192
- ) );
193
- } else {
194
- $rule['shipping_class'][] = $term_id['term_id'];
195
- }
196
  }
 
197
  } else {
198
  $rule['shipping_class'][] = $rule_shipping_class;
199
  }
200
  }
201
  }
 
202
  return $rule;
203
  }
204
 
@@ -219,10 +322,12 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
219
  array( 'none', 'value', 'weight', 'item', 'cart_line_item' ),
220
  true
221
  ) ) {
222
- throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception( sprintf(
223
- // Translators: row number.
224
- __( 'Invalid value for Based On in row number %d.', 'flexible-shipping' ), $import_row_count
225
- ) );
 
 
226
  }
227
 
228
  $rule['min'] = $this->get_numeric_value_from_row( $csv_row, 'Min', $import_row_count );
@@ -247,6 +352,7 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
247
  } else {
248
  $rule['cancel'] = 0;
249
  }
 
250
  return $rule;
251
  }
252
 
@@ -255,6 +361,7 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
255
  *
256
  * @param string $tmp_name Tmp file name.
257
  * @param array $shipping_methods Shipping methods.
 
258
  * @return array
259
  * @throws WPDesk_Flexible_Shipping_Csv_Importer_Exception Exception.
260
  */
@@ -274,7 +381,10 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
274
  if ( ! isset( $csv_row['Method Title'] ) || $current_method_title !== $csv_row['Method Title'] || ! isset( $csv_row['Based on'] ) || '' === $csv_row['Based on'] ) {
275
  $new_method = true;
276
 
277
- $imported_shipping_method = $this->new_shipping_method( $csv_row, $shipping_methods, $import_row_count );
 
 
 
278
 
279
  $current_method_title = $imported_shipping_method['method_title'];
280
  $method_title = $current_method_title;
@@ -286,10 +396,13 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
286
  if ( ! $first ) {
287
  $shipping_methods[ $imported_shipping_method['id'] ] = $imported_shipping_method;
288
  if ( $new_method ) {
289
- WC_Admin_Settings::add_message( sprintf(
290
- // Translators: imported method title and method title.
291
- __( 'Shipping method %1$s imported as %2$s.', 'flexible-shipping' ), $current_method_title, $method_title
292
- ) );
 
 
 
293
  }
294
  }
295
  $first = false;
1
  <?php
2
+ /**
3
+ * CSV importer
4
+ *
5
+ * @package \WPDesk_Flexible_Shipping
6
+ */
7
 
8
  /**
9
  * Import shipping methods and rules from CSV.
10
  */
11
  class WPDesk_Flexible_Shipping_Csv_Importer {
12
 
13
+ const CSV_DELIMITER = ';';
14
+
15
  /**
16
  * Flexible Shipping shipping method.
17
  *
19
  */
20
  private $flexible_shipping_method;
21
 
22
+ /**
23
+ * Hashmap for shipping classes with name->term_id data.
24
+ *
25
+ * @var \stdClass[]
26
+ */
27
+ private $wc_shipping_classes_hashmap;
28
+
29
+ /**
30
+ * Delimiter used in CSV file.
31
+ *
32
+ * @return string
33
+ */
34
+ public static function get_csv_delimiter() {
35
+ return apply_filters( 'flexible_shipping_csv_delimiter', self::CSV_DELIMITER );
36
+ }
37
+
38
  /**
39
  * WPDesk_Flexible_Shipping_Csv_Importer constructor.
40
  *
41
  * @param WPDesk_Flexible_Shipping $flexible_shipping_method Flexible shipping method.
42
  */
43
  public function __construct( $flexible_shipping_method ) {
44
+ $this->flexible_shipping_method = $flexible_shipping_method;
45
+ $this->wc_shipping_classes_hashmap = $this->prepare_shipping_class_hashmap();
46
+ }
47
+
48
+ /**
49
+ * Prepares hashmap for fast checking the term_id of given shipment class.
50
+ *
51
+ * @return array
52
+ */
53
+ private function prepare_shipping_class_hashmap() {
54
+ $cache = [];
55
+ foreach ( WC()->shipping()->get_shipping_classes() as $class ) {
56
+ $cache[ html_entity_decode( $class->name ) ] = (int) $class->term_id;
57
+ }
58
+
59
+ return $cache;
60
  }
61
 
62
  /**
67
  * @return array
68
  */
69
  private function load_csv_from_file( $tmp_name ) {
70
+ return array_map(
71
+ function ( $v ) {
72
+ return str_getcsv( $v, self::get_csv_delimiter() );
73
+ }, file( $tmp_name )
74
+ );
75
  }
76
 
77
  /**
79
  *
80
  * @param array $row Row.
81
  * @param array $columns Columns.
82
+ *
83
  * @return array
84
  */
85
  private function add_columns_to_row( array $row, array $columns ) {
86
  foreach ( $columns as $col_key => $col ) {
87
  $row[ $col ] = $row[ $col_key ];
88
  }
89
+
90
  return $row;
91
  }
92
 
108
  }
109
  $first = false;
110
  }
111
+
112
  return $csv_array;
113
  }
114
 
126
  private function new_shipping_method( array $csv_row, array $shipping_methods, $import_row_count ) {
127
  $new_shipping_method = array( 'method_enabled' => 'no' );
128
  if ( ! isset( $csv_row['Method Title'] ) || '' === trim( $csv_row['Method Title'] ) ) {
129
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
130
+ __(
131
+ 'Sorry, there has been an error. The CSV is invalid or incorrect file type.',
132
+ 'flexible-shipping'
133
+ )
134
+ );
135
  }
136
  $method_title = $csv_row['Method Title'];
137
  $count = 0;
139
  if ( 0 === $count ) {
140
  $method_title = $csv_row['Method Title'] . ' (' . __( 'import', 'flexible-shipping' ) . ')';
141
  } else {
142
+ $method_title = $csv_row['Method Title'] . ' (' . __(
143
+ 'import',
144
+ 'flexible-shipping'
145
+ ) . ' ' . $count . ')';
146
  }
147
  $count ++;
148
  }
150
  $new_shipping_method['id_for_shipping'] = $this->flexible_shipping_method->id . '_' . $this->flexible_shipping_method->instance_id . '_' . $new_shipping_method['id'];
151
  $new_shipping_method['method_title'] = $method_title;
152
  $new_shipping_method['method_description'] = $csv_row['Method Description'];
153
+ if ( '' !== trim( $csv_row['Free Shipping'] ) && ! is_numeric(
154
+ str_replace(
155
+ ',', '.',
156
+ $csv_row['Free Shipping']
157
+ )
158
+ ) ) {
159
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
160
+ sprintf(
161
+ // Translators: free shipping value and row number.
162
+ __( 'Free Shipping value %1$s is not valid number. Row number %2$d.', 'flexible-shipping' ),
163
+ $csv_row['Free Shipping'], $import_row_count
164
+ )
165
+ );
166
  }
167
+ $new_shipping_method[ WPDesk_Flexible_Shipping::FIELD_METHOD_FREE_SHIPPING ] = str_replace(
168
+ ',', '.',
169
+ $csv_row['Free Shipping']
170
+ );
171
+ if ( trim( $csv_row['Maximum Cost'] ) !== '' && ! is_numeric(
172
+ str_replace(
173
+ ',', '.',
174
+ $csv_row['Maximum Cost']
175
+ )
176
+ ) ) {
177
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
178
+ sprintf(
179
+ // Translators: maximum cost value and row number.
180
+ __( 'Maximum Cost value %1$s is not valid number. Row number %2$d.', 'flexible-shipping' ),
181
+ $csv_row['Maximum Cost'], $import_row_count
182
+ )
183
+ );
184
  }
185
  $new_shipping_method['method_max_cost'] = str_replace( ',', '.', $csv_row['Maximum Cost'] );
186
  $new_shipping_method['method_calculation_method'] = $csv_row['Calculation Method'];
189
  array( 'sum', 'lowest', 'highest' ),
190
  true
191
  ) ) {
192
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
193
+ sprintf(
194
+ // Translators: row number.
195
+ __( 'Invalid value for Calculation Method in row number %d.', 'flexible-shipping' ), $import_row_count
196
+ )
197
+ );
198
  }
199
  $new_shipping_method['method_visibility'] = $csv_row['Visibility'];
200
  if ( 'yes' !== $new_shipping_method['method_visibility'] ) {
221
  */
222
  private function get_numeric_value_from_row( array $csv_row, $column, $import_row_count ) {
223
  if ( '' !== trim( $csv_row[ $column ] ) && ! is_numeric( str_replace( ',', '.', $csv_row[ $column ] ) ) ) {
224
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
225
+ sprintf(
226
+ // Translators: column name, value and row number.
227
+ __( '%1$s value %2$s is not valid number. Row number %3$d.', 'flexible-shipping' ),
228
+ $column,
229
+ $csv_row['Min'],
230
+ $import_row_count
231
+ )
232
+ );
233
  }
234
+
235
  return str_replace( ',', '.', $csv_row[ $column ] );
236
  }
237
 
238
+ /**
239
+ * Find and returns shipping class term id
240
+ *
241
+ * @param string $name Shipping class name to search.
242
+ *
243
+ * @return int|null Term id
244
+ */
245
+ private function find_shipping_class_by_name( $name ) {
246
+ $name = html_entity_decode( $name );
247
+ if ( isset( $this->wc_shipping_classes_hashmap[ $name ] ) ) {
248
+ return $this->wc_shipping_classes_hashmap[ $name ];
249
+ }
250
+
251
+ return null;
252
+ }
253
+
254
+ /**
255
+ * Creates a shipping class
256
+ *
257
+ * @param string $name Shipping class name.
258
+ * @param string $description Shipping class description.
259
+ *
260
+ * @return int Term id
261
+ * @throws WPDesk_Flexible_Shipping_Csv_Importer_Exception When can't create the class.
262
+ */
263
+ private function create_shipping_class( $name, $description ) {
264
+ $term_id = wp_insert_term( $name, 'product_shipping_class', array( 'description' => $description ) );
265
+ if ( is_wp_error( $term_id ) ) {
266
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
267
+ sprintf(
268
+ // Translators: rule shipping class and wp_error message.
269
+ __( 'Error while creating shipping class: %1$s, %2$s', 'flexible-shipping' ), $name,
270
+ $term_id->get_error_message()
271
+ )
272
+ );
273
+ }
274
+ $term_id = (int) $term_id['term_id'];
275
+ $this->wc_shipping_classes_hashmap[ html_entity_decode( $name ) ] = $term_id;
276
+
277
+ return $term_id;
278
+ }
279
+
280
  /**
281
  * Maybe populate and create shipping classes.
282
  *
291
  $rule['shipping_class'] = array();
292
  foreach ( $rule_shipping_classes as $rule_shipping_class ) {
293
  if ( ! in_array( $rule_shipping_class, array( 'all', 'any', 'none' ), true ) ) {
294
+ $term_id = $this->find_shipping_class_by_name( $rule_shipping_class );
295
+ if ( null === $term_id ) {
296
+ $term_id = $this->create_shipping_class( $rule_shipping_class, $rule_shipping_class );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  }
298
+ $rule['shipping_class'][] = $term_id;
299
  } else {
300
  $rule['shipping_class'][] = $rule_shipping_class;
301
  }
302
  }
303
  }
304
+
305
  return $rule;
306
  }
307
 
322
  array( 'none', 'value', 'weight', 'item', 'cart_line_item' ),
323
  true
324
  ) ) {
325
+ throw new WPDesk_Flexible_Shipping_Csv_Importer_Exception(
326
+ sprintf(
327
+ // Translators: row number.
328
+ __( 'Invalid value for Based On in row number %d.', 'flexible-shipping' ), $import_row_count
329
+ )
330
+ );
331
  }
332
 
333
  $rule['min'] = $this->get_numeric_value_from_row( $csv_row, 'Min', $import_row_count );
352
  } else {
353
  $rule['cancel'] = 0;
354
  }
355
+
356
  return $rule;
357
  }
358
 
361
  *
362
  * @param string $tmp_name Tmp file name.
363
  * @param array $shipping_methods Shipping methods.
364
+ *
365
  * @return array
366
  * @throws WPDesk_Flexible_Shipping_Csv_Importer_Exception Exception.
367
  */
381
  if ( ! isset( $csv_row['Method Title'] ) || $current_method_title !== $csv_row['Method Title'] || ! isset( $csv_row['Based on'] ) || '' === $csv_row['Based on'] ) {
382
  $new_method = true;
383
 
384
+ $imported_shipping_method = $this->new_shipping_method(
385
+ $csv_row, $shipping_methods,
386
+ $import_row_count
387
+ );
388
 
389
  $current_method_title = $imported_shipping_method['method_title'];
390
  $method_title = $current_method_title;
396
  if ( ! $first ) {
397
  $shipping_methods[ $imported_shipping_method['id'] ] = $imported_shipping_method;
398
  if ( $new_method ) {
399
+ WC_Admin_Settings::add_message(
400
+ sprintf(
401
+ // Translators: imported method title and method title.
402
+ __( 'Shipping method %1$s imported as %2$s.', 'flexible-shipping' ), $current_method_title,
403
+ $method_title
404
+ )
405
+ );
406
  }
407
  }
408
  $first = false;
classes/table-rate/csv/flexible-shipping-export.php CHANGED
@@ -216,7 +216,7 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_Export' ) ) {
216
  header( 'Content-Disposition: attachment; filename=' . $filename . '.csv' );
217
  $out = fopen( 'php://output', 'w' );
218
  foreach ( $csv_array as $fields ) {
219
- fputcsv( $out, $fields, ';' );
220
  }
221
  fclose( $out );
222
  wp_die();
216
  header( 'Content-Disposition: attachment; filename=' . $filename . '.csv' );
217
  $out = fopen( 'php://output', 'w' );
218
  foreach ( $csv_array as $fields ) {
219
+ fputcsv( $out, $fields, WPDesk_Flexible_Shipping_Csv_Importer::get_csv_delimiter() );
220
  }
221
  fclose( $out );
222
  wp_die();
composer.lock CHANGED
@@ -1,10 +1,10 @@
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "625fa4cb52c66209fad5df2a5e0345a9",
8
  "packages": [
9
  {
10
  "name": "moneyphp/money",
@@ -744,16 +744,16 @@
744
  },
745
  {
746
  "name": "wpdesk/wp-wpdesk-connect",
747
- "version": "1.1.0",
748
  "source": {
749
  "type": "git",
750
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-connect.git",
751
- "reference": "f3d64b41570fc17f71cfa234835456a0d430bc6c"
752
  },
753
  "dist": {
754
  "type": "zip",
755
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-connect/repository/archive.zip?sha=f3d64b41570fc17f71cfa234835456a0d430bc6c",
756
- "reference": "f3d64b41570fc17f71cfa234835456a0d430bc6c",
757
  "shasum": ""
758
  },
759
  "require": {
@@ -783,7 +783,7 @@
783
  "email": "krzysiek@wpdesk.pl"
784
  }
785
  ],
786
- "time": "2019-06-18T09:41:59+00:00"
787
  },
788
  {
789
  "name": "wpdesk/wp-wpdesk-fs-shipment",
@@ -826,16 +826,16 @@
826
  },
827
  {
828
  "name": "wpdesk/wp-wpdesk-tracker",
829
- "version": "1.0.3",
830
  "source": {
831
  "type": "git",
832
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-tracker.git",
833
- "reference": "04e8933a047245b37fc77991e330361613e8dd63"
834
  },
835
  "dist": {
836
  "type": "zip",
837
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-tracker/repository/archive.zip?sha=04e8933a047245b37fc77991e330361613e8dd63",
838
- "reference": "04e8933a047245b37fc77991e330361613e8dd63",
839
  "shasum": ""
840
  },
841
  "require": {
@@ -862,7 +862,7 @@
862
  "email": "krzysiek@wpdesk.pl"
863
  }
864
  ],
865
- "time": "2019-04-23T13:16:55+00:00"
866
  }
867
  ],
868
  "packages-dev": [
@@ -1158,64 +1158,6 @@
1158
  ],
1159
  "time": "2017-10-19T19:58:43+00:00"
1160
  },
1161
- {
1162
- "name": "phpcompatibility/php-compatibility",
1163
- "version": "9.2.0",
1164
- "source": {
1165
- "type": "git",
1166
- "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
1167
- "reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e"
1168
- },
1169
- "dist": {
1170
- "type": "zip",
1171
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/3db1bf1e28123fd574a4ae2e9a84072826d51b5e",
1172
- "reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e",
1173
- "shasum": ""
1174
- },
1175
- "require": {
1176
- "php": ">=5.3",
1177
- "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
1178
- },
1179
- "conflict": {
1180
- "squizlabs/php_codesniffer": "2.6.2"
1181
- },
1182
- "require-dev": {
1183
- "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
1184
- },
1185
- "suggest": {
1186
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
1187
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
1188
- },
1189
- "type": "phpcodesniffer-standard",
1190
- "notification-url": "https://packagist.org/downloads/",
1191
- "license": [
1192
- "LGPL-3.0-or-later"
1193
- ],
1194
- "authors": [
1195
- {
1196
- "name": "Contributors",
1197
- "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
1198
- },
1199
- {
1200
- "name": "Wim Godden",
1201
- "homepage": "https://github.com/wimg",
1202
- "role": "lead"
1203
- },
1204
- {
1205
- "name": "Juliette Reinders Folmer",
1206
- "homepage": "https://github.com/jrfnl",
1207
- "role": "lead"
1208
- }
1209
- ],
1210
- "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
1211
- "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
1212
- "keywords": [
1213
- "compatibility",
1214
- "phpcs",
1215
- "standards"
1216
- ],
1217
- "time": "2019-06-27T19:58:56+00:00"
1218
- },
1219
  {
1220
  "name": "phpdocumentor/reflection-common",
1221
  "version": "1.0.1",
@@ -2329,57 +2271,6 @@
2329
  "homepage": "https://github.com/sebastianbergmann/version",
2330
  "time": "2016-10-03T07:35:21+00:00"
2331
  },
2332
- {
2333
- "name": "squizlabs/php_codesniffer",
2334
- "version": "3.4.2",
2335
- "source": {
2336
- "type": "git",
2337
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
2338
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
2339
- },
2340
- "dist": {
2341
- "type": "zip",
2342
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
2343
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
2344
- "shasum": ""
2345
- },
2346
- "require": {
2347
- "ext-simplexml": "*",
2348
- "ext-tokenizer": "*",
2349
- "ext-xmlwriter": "*",
2350
- "php": ">=5.4.0"
2351
- },
2352
- "require-dev": {
2353
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
2354
- },
2355
- "bin": [
2356
- "bin/phpcs",
2357
- "bin/phpcbf"
2358
- ],
2359
- "type": "library",
2360
- "extra": {
2361
- "branch-alias": {
2362
- "dev-master": "3.x-dev"
2363
- }
2364
- },
2365
- "notification-url": "https://packagist.org/downloads/",
2366
- "license": [
2367
- "BSD-3-Clause"
2368
- ],
2369
- "authors": [
2370
- {
2371
- "name": "Greg Sherwood",
2372
- "role": "lead"
2373
- }
2374
- ],
2375
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
2376
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
2377
- "keywords": [
2378
- "phpcs",
2379
- "standards"
2380
- ],
2381
- "time": "2019-04-10T23:49:02+00:00"
2382
- },
2383
  {
2384
  "name": "symfony/polyfill-ctype",
2385
  "version": "v1.11.0",
@@ -2549,44 +2440,44 @@
2549
  "time": "2018-12-25T11:19:39+00:00"
2550
  },
2551
  {
2552
- "name": "wp-coding-standards/wpcs",
2553
- "version": "0.14.1",
2554
  "source": {
2555
  "type": "git",
2556
- "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
2557
- "reference": "cf6b310caad735816caef7573295f8a534374706"
2558
  },
2559
  "dist": {
2560
  "type": "zip",
2561
- "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/cf6b310caad735816caef7573295f8a534374706",
2562
- "reference": "cf6b310caad735816caef7573295f8a534374706",
2563
  "shasum": ""
2564
  },
2565
  "require": {
2566
- "php": ">=5.3",
2567
- "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
 
2568
  },
2569
- "suggest": {
2570
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
 
 
 
 
 
 
 
 
 
2571
  },
2572
- "type": "phpcodesniffer-standard",
2573
  "notification-url": "https://packagist.org/downloads/",
2574
- "license": [
2575
- "MIT"
2576
- ],
2577
  "authors": [
2578
  {
2579
- "name": "Contributors",
2580
- "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
2581
  }
2582
  ],
2583
- "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
2584
- "keywords": [
2585
- "phpcs",
2586
- "standards",
2587
- "wordpress"
2588
- ],
2589
- "time": "2018-02-16T01:57:48+00:00"
2590
  }
2591
  ],
2592
  "aliases": [],
@@ -2597,5 +2488,8 @@
2597
  "platform": {
2598
  "php": ">=5.6"
2599
  },
2600
- "platform-dev": []
 
 
 
2601
  }
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "c654681d0b7b6c8813c27c1c6d517a2b",
8
  "packages": [
9
  {
10
  "name": "moneyphp/money",
744
  },
745
  {
746
  "name": "wpdesk/wp-wpdesk-connect",
747
+ "version": "1.1.1",
748
  "source": {
749
  "type": "git",
750
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-connect.git",
751
+ "reference": "1a8003f4e26080551724ff6b7104651a99a7f360"
752
  },
753
  "dist": {
754
  "type": "zip",
755
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-connect/repository/archive.zip?sha=1a8003f4e26080551724ff6b7104651a99a7f360",
756
+ "reference": "1a8003f4e26080551724ff6b7104651a99a7f360",
757
  "shasum": ""
758
  },
759
  "require": {
783
  "email": "krzysiek@wpdesk.pl"
784
  }
785
  ],
786
+ "time": "2019-07-19T11:46:46+00:00"
787
  },
788
  {
789
  "name": "wpdesk/wp-wpdesk-fs-shipment",
826
  },
827
  {
828
  "name": "wpdesk/wp-wpdesk-tracker",
829
+ "version": "1.0.4",
830
  "source": {
831
  "type": "git",
832
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-tracker.git",
833
+ "reference": "172bd87885618a8f4c83a6cdb817580da7275809"
834
  },
835
  "dist": {
836
  "type": "zip",
837
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-tracker/repository/archive.zip?sha=172bd87885618a8f4c83a6cdb817580da7275809",
838
+ "reference": "172bd87885618a8f4c83a6cdb817580da7275809",
839
  "shasum": ""
840
  },
841
  "require": {
862
  "email": "krzysiek@wpdesk.pl"
863
  }
864
  ],
865
+ "time": "2019-07-17T08:59:27+00:00"
866
  }
867
  ],
868
  "packages-dev": [
1158
  ],
1159
  "time": "2017-10-19T19:58:43+00:00"
1160
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1161
  {
1162
  "name": "phpdocumentor/reflection-common",
1163
  "version": "1.0.1",
2271
  "homepage": "https://github.com/sebastianbergmann/version",
2272
  "time": "2016-10-03T07:35:21+00:00"
2273
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2274
  {
2275
  "name": "symfony/polyfill-ctype",
2276
  "version": "v1.11.0",
2440
  "time": "2018-12-25T11:19:39+00:00"
2441
  },
2442
  {
2443
+ "name": "wpdesk/wp-wpdesk-composer",
2444
+ "version": "1.2.0",
2445
  "source": {
2446
  "type": "git",
2447
+ "url": "https://gitlab.com/wpdesk/wp-wpdesk-composer.git",
2448
+ "reference": "52f5977e2809ed676c68120356f364d53bfd7482"
2449
  },
2450
  "dist": {
2451
  "type": "zip",
2452
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-composer/repository/archive.zip?sha=52f5977e2809ed676c68120356f364d53bfd7482",
2453
+ "reference": "52f5977e2809ed676c68120356f364d53bfd7482",
2454
  "shasum": ""
2455
  },
2456
  "require": {
2457
+ "composer-plugin-api": "^1.1",
2458
+ "ext-json": "*",
2459
+ "php": ">=5.5"
2460
  },
2461
+ "require-dev": {
2462
+ "composer/composer": "^1.8"
2463
+ },
2464
+ "type": "composer-plugin",
2465
+ "extra": {
2466
+ "class": "WPDesk\\Composer\\GitPlugin\\Plugin"
2467
+ },
2468
+ "autoload": {
2469
+ "psr-4": {
2470
+ "WPDesk\\Composer\\GitPlugin\\": "src/"
2471
+ }
2472
  },
 
2473
  "notification-url": "https://packagist.org/downloads/",
 
 
 
2474
  "authors": [
2475
  {
2476
+ "name": "Krzysiek",
2477
+ "email": "krzysiek@wpdesk.pl"
2478
  }
2479
  ],
2480
+ "time": "2019-07-19T12:22:56+00:00"
 
 
 
 
 
 
2481
  }
2482
  ],
2483
  "aliases": [],
2488
  "platform": {
2489
  "php": ">=5.6"
2490
  },
2491
+ "platform-dev": [],
2492
+ "platform-overrides": {
2493
+ "php": "5.6"
2494
+ }
2495
  }
flexible-shipping.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
- /*
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
- Version: 3.5.1
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -30,21 +30,20 @@
30
  along with this program; if not, write to the Free Software
31
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
 
33
- */
34
-
35
 
36
  if ( ! defined( 'ABSPATH' ) ) {
37
  exit;
38
  } // Exit if accessed directly
39
 
40
- // Only PHP 5.2 compatible code
41
  if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
42
  require_once dirname( __FILE__ ) . '/vendor/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker.php';
43
  }
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
- $plugin_version = '3.5.1';
47
- $plugin_release_timestamp = '2019-07-11 13:37';
48
 
49
  $plugin_name = 'Flexible Shipping';
50
  $plugin_class_name = 'Flexible_Shipping_Plugin';
1
  <?php
2
+ /**
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
+ Version: 3.6.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
30
  along with this program; if not, write to the Free Software
31
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
 
33
+ */
 
34
 
35
  if ( ! defined( 'ABSPATH' ) ) {
36
  exit;
37
  } // Exit if accessed directly
38
 
39
+ // Only PHP 5.2 compatible code.
40
  if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
41
  require_once dirname( __FILE__ ) . '/vendor/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker.php';
42
  }
43
 
44
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
45
+ $plugin_version = '3.6.0';
46
+ $plugin_release_timestamp = '2019-07-24 09:59';
47
 
48
  $plugin_name = 'Flexible Shipping';
49
  $plugin_class_name = 'Flexible_Shipping_Plugin';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flexibleshipping.com/table-rate/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
  Tested up to: 5.2.2
7
- Stable tag: 3.5.1
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -175,6 +175,11 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
178
  = 3.5.1 - 2019-07-11 =
179
  * Fixed rare change for fatal error when activating plugin
180
 
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
  Tested up to: 5.2.2
7
+ Stable tag: 3.6.0
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
175
 
176
  == Changelog ==
177
 
178
+ = 3.6.0 - 2019-07-24 =
179
+ * Added filter flexible_shipping_csv_delimiter to CSV delimiter
180
+ * Fixed support for &#44; in exported csv file
181
+ * Fixed import speed for more complex shipment methods
182
+
183
  = 3.5.1 - 2019-07-11 =
184
  * Fixed rare change for fatal error when activating plugin
185
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit79f121afd1e5a0c792baf72fc27f4e1b::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -370,7 +370,7 @@ return array(
370
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
371
  'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $vendorDir . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-cancel-shipment-exception.php',
372
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => $vendorDir . '/wpdesk/wp-wpdesk-connect/src/saas/checkout/class-checkout-ajax-request-data.php',
373
- 'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/table-rate/csv/class-csv-importer.php',
374
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/table-rate/csv/class-csv-importer-exception.php',
375
  'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/table-rate/csv/flexible-shipping-export.php',
376
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => $vendorDir . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-get-label-exception.php',
370
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
371
  'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $vendorDir . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-cancel-shipment-exception.php',
372
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => $vendorDir . '/wpdesk/wp-wpdesk-connect/src/saas/checkout/class-checkout-ajax-request-data.php',
373
+ 'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
374
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/table-rate/csv/class-csv-importer-exception.php',
375
  'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/table-rate/csv/flexible-shipping-export.php',
376
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => $vendorDir . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-get-label-exception.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd8e986b7164e77c279b97917439ef20c::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInitd8e986b7164e77c279b97917439ef20c
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitd8e986b7164e77c279b97917439ef20c::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequired8e986b7164e77c279b97917439ef20c($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequired8e986b7164e77c279b97917439ef20c($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit79f121afd1e5a0c792baf72fc27f4e1b
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit79f121afd1e5a0c792baf72fc27f4e1b', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit79f121afd1e5a0c792baf72fc27f4e1b', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire79f121afd1e5a0c792baf72fc27f4e1b($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire79f121afd1e5a0c792baf72fc27f4e1b($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd8e986b7164e77c279b97917439ef20c
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
@@ -456,7 +456,7 @@ class ComposerStaticInitd8e986b7164e77c279b97917439ef20c
456
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
457
  'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-cancel-shipment-exception.php',
458
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-connect/src/saas/checkout/class-checkout-ajax-request-data.php',
459
- 'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-csv-importer.php',
460
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-csv-importer-exception.php',
461
  'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/table-rate/csv/flexible-shipping-export.php',
462
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-get-label-exception.php',
@@ -575,9 +575,9 @@ class ComposerStaticInitd8e986b7164e77c279b97917439ef20c
575
  public static function getInitializer(ClassLoader $loader)
576
  {
577
  return \Closure::bind(function () use ($loader) {
578
- $loader->prefixLengthsPsr4 = ComposerStaticInitd8e986b7164e77c279b97917439ef20c::$prefixLengthsPsr4;
579
- $loader->prefixDirsPsr4 = ComposerStaticInitd8e986b7164e77c279b97917439ef20c::$prefixDirsPsr4;
580
- $loader->classMap = ComposerStaticInitd8e986b7164e77c279b97917439ef20c::$classMap;
581
 
582
  }, null, ClassLoader::class);
583
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
456
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
457
  'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-cancel-shipment-exception.php',
458
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-connect/src/saas/checkout/class-checkout-ajax-request-data.php',
459
+ 'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
460
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-csv-importer-exception.php',
461
  'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/table-rate/csv/flexible-shipping-export.php',
462
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-fs-shipment/src/exception/class-get-label-exception.php',
575
  public static function getInitializer(ClassLoader $loader)
576
  {
577
  return \Closure::bind(function () use ($loader) {
578
+ $loader->prefixLengthsPsr4 = ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b::$prefixLengthsPsr4;
579
+ $loader->prefixDirsPsr4 = ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b::$prefixDirsPsr4;
580
+ $loader->classMap = ComposerStaticInit79f121afd1e5a0c792baf72fc27f4e1b::$classMap;
581
 
582
  }, null, ClassLoader::class);
583
  }
vendor/composer/installed.json CHANGED
@@ -767,17 +767,17 @@
767
  },
768
  {
769
  "name": "wpdesk/wp-wpdesk-connect",
770
- "version": "1.1.0",
771
- "version_normalized": "1.1.0.0",
772
  "source": {
773
  "type": "git",
774
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-connect.git",
775
- "reference": "f3d64b41570fc17f71cfa234835456a0d430bc6c"
776
  },
777
  "dist": {
778
  "type": "zip",
779
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-connect/repository/archive.zip?sha=f3d64b41570fc17f71cfa234835456a0d430bc6c",
780
- "reference": "f3d64b41570fc17f71cfa234835456a0d430bc6c",
781
  "shasum": ""
782
  },
783
  "require": {
@@ -794,7 +794,7 @@
794
  "squizlabs/php_codesniffer": "^3.4.2",
795
  "wp-coding-standards/wpcs": "^0.14.1"
796
  },
797
- "time": "2019-06-18T09:41:59+00:00",
798
  "type": "library",
799
  "installation-source": "dist",
800
  "autoload": {
@@ -853,17 +853,17 @@
853
  },
854
  {
855
  "name": "wpdesk/wp-wpdesk-tracker",
856
- "version": "1.0.3",
857
- "version_normalized": "1.0.3.0",
858
  "source": {
859
  "type": "git",
860
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-tracker.git",
861
- "reference": "04e8933a047245b37fc77991e330361613e8dd63"
862
  },
863
  "dist": {
864
  "type": "zip",
865
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-tracker/repository/archive.zip?sha=04e8933a047245b37fc77991e330361613e8dd63",
866
- "reference": "04e8933a047245b37fc77991e330361613e8dd63",
867
  "shasum": ""
868
  },
869
  "require": {
@@ -877,7 +877,7 @@
877
  "wimg/php-compatibility": "^8",
878
  "wp-coding-standards/wpcs": "^0.14.1"
879
  },
880
- "time": "2019-04-23T13:16:55+00:00",
881
  "type": "library",
882
  "installation-source": "dist",
883
  "autoload": {
767
  },
768
  {
769
  "name": "wpdesk/wp-wpdesk-connect",
770
+ "version": "1.1.1",
771
+ "version_normalized": "1.1.1.0",
772
  "source": {
773
  "type": "git",
774
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-connect.git",
775
+ "reference": "1a8003f4e26080551724ff6b7104651a99a7f360"
776
  },
777
  "dist": {
778
  "type": "zip",
779
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-connect/repository/archive.zip?sha=1a8003f4e26080551724ff6b7104651a99a7f360",
780
+ "reference": "1a8003f4e26080551724ff6b7104651a99a7f360",
781
  "shasum": ""
782
  },
783
  "require": {
794
  "squizlabs/php_codesniffer": "^3.4.2",
795
  "wp-coding-standards/wpcs": "^0.14.1"
796
  },
797
+ "time": "2019-07-19T11:46:46+00:00",
798
  "type": "library",
799
  "installation-source": "dist",
800
  "autoload": {
853
  },
854
  {
855
  "name": "wpdesk/wp-wpdesk-tracker",
856
+ "version": "1.0.4",
857
+ "version_normalized": "1.0.4.0",
858
  "source": {
859
  "type": "git",
860
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-tracker.git",
861
+ "reference": "172bd87885618a8f4c83a6cdb817580da7275809"
862
  },
863
  "dist": {
864
  "type": "zip",
865
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-tracker/repository/archive.zip?sha=172bd87885618a8f4c83a6cdb817580da7275809",
866
+ "reference": "172bd87885618a8f4c83a6cdb817580da7275809",
867
  "shasum": ""
868
  },
869
  "require": {
877
  "wimg/php-compatibility": "^8",
878
  "wp-coding-standards/wpcs": "^0.14.1"
879
  },
880
+ "time": "2019-07-17T08:59:27+00:00",
881
  "type": "library",
882
  "installation-source": "dist",
883
  "autoload": {
vendor/wpdesk/wp-wpdesk-connect/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ## [1.1.0] - 2019-06-17
2
  ### Added
3
  - Refactor so the platform factory can be injected
1
+ ## [1.1.1] - 2019-07-19
2
+ ### Added
3
+ - Remove from Flexible Shipping when not connected to platform
4
+
5
  ## [1.1.0] - 2019-06-17
6
  ### Added
7
  - Refactor so the platform factory can be injected
vendor/wpdesk/wp-wpdesk-connect/src/saas/class-saas-settings.php CHANGED
@@ -338,6 +338,8 @@ class WPDesk_Flexible_Shipping_SaaS_Settings extends WC_Shipping_Method implemen
338
  public function generate_flexible_shipping_html( $key, $data ) {
339
  $html_class_is_dismissible = 'is-dismissible';
340
  $integration_checkbox = $this->integration_checkbox->is_visible();
 
 
341
  ob_start();
342
  include 'views/html-shipping-method-info-description.php';
343
  $notice_content = ob_get_contents();
338
  public function generate_flexible_shipping_html( $key, $data ) {
339
  $html_class_is_dismissible = 'is-dismissible';
340
  $integration_checkbox = $this->integration_checkbox->is_visible();
341
+ $show_fs_connect = $this->saas_connection->is_connected();
342
+
343
  ob_start();
344
  include 'views/html-shipping-method-info-description.php';
345
  $notice_content = ob_get_contents();
vendor/wpdesk/wp-wpdesk-connect/src/saas/class-sass-settings-integration-checkbox.php CHANGED
@@ -42,10 +42,7 @@ class WPDesk_Flexible_Shipping_SaaS_Settings_Integration_Checkbox
42
  * @return bool
43
  */
44
  public function is_visible() {
45
- if( $this->connection->is_connected() ) {
46
- return true;
47
- }
48
- return get_option( self::OPTION_NAME, '0' ) === '1';
49
  }
50
 
51
  }
42
  * @return bool
43
  */
44
  public function is_visible() {
45
+ return $this->connection->is_connected();
 
 
 
46
  }
47
 
48
  }
vendor/wpdesk/wp-wpdesk-connect/src/saas/views/html-shipping-method-info-description.php CHANGED
@@ -1,5 +1,9 @@
1
  <?php
2
- /** @var $integration_checkbox bool */
 
 
 
 
3
 
4
  $pl = get_locale() === 'pl_PL';
5
  $youtube_url = 'https://www.youtube.com/embed/qsFvYoiNDgU';
@@ -46,24 +50,26 @@ $conditional_cash_on_delivery_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-s
46
  <li><a href="<?php echo $conditional_cash_on_delivery_url; ?>"><?php _e( 'Conditional Cash on Delivery', 'flexible-shipping' ); ?></a></li>
47
  </ul>
48
 
49
- <h3 class="wc-settings-sub-title fs-connect-box-header"><?php _e( 'Integrations', 'flexible-shipping' ); ?></h3>
50
- <table class="form-table">
51
- <tbody>
52
- <tr valign="top">
53
- <th scope="row" class="titledesc">
54
- <label for="enable-fs-connect-box"><?php _e( 'FS Connect', 'flexible-shipping' ); ?></label>
55
- </th>
56
- <td class="forminp">
57
- <fieldset>
58
- <legend class="screen-reader-text"><span><?php _e( 'FS Connect', 'flexible-shipping' ); ?></span></legend>
59
- <label for="enable-fs-connect-box">
60
- <input class="enable-fs-connect-box" <?php checked( $integration_checkbox, 1 ); ?> type="checkbox" name="fsconnect_box" id="enable-fs-connect-box" style="" value="1"> <?php _e( 'Enable integration with Flexible Shipping Connect', 'flexible-shipping' ); ?>
61
- </label>
62
- </fieldset>
63
- </td>
64
- </tr>
65
- </tbody>
66
- </table>
 
 
67
 
68
  </div>
69
  </div>
1
  <?php
2
+ /**
3
+ * @var $integration_checkbox bool
4
+ * @var $show_fs_connect bool
5
+ */
6
+
7
 
8
  $pl = get_locale() === 'pl_PL';
9
  $youtube_url = 'https://www.youtube.com/embed/qsFvYoiNDgU';
50
  <li><a href="<?php echo $conditional_cash_on_delivery_url; ?>"><?php _e( 'Conditional Cash on Delivery', 'flexible-shipping' ); ?></a></li>
51
  </ul>
52
 
53
+ <?php if ( $show_fs_connect ) : ?>
54
+ <h3 class="wc-settings-sub-title fs-connect-box-header"><?php _e( 'Integrations', 'flexible-shipping' ); ?></h3>
55
+ <table class="form-table">
56
+ <tbody>
57
+ <tr valign="top">
58
+ <th scope="row" class="titledesc">
59
+ <label for="enable-fs-connect-box"><?php _e( 'FS Connect', 'flexible-shipping' ); ?></label>
60
+ </th>
61
+ <td class="forminp">
62
+ <fieldset>
63
+ <legend class="screen-reader-text"><span><?php _e( 'FS Connect', 'flexible-shipping' ); ?></span></legend>
64
+ <label for="enable-fs-connect-box">
65
+ <input class="enable-fs-connect-box" <?php checked( $integration_checkbox, 1 ); ?> type="checkbox" name="fsconnect_box" id="enable-fs-connect-box" style="" value="1"> <?php _e( 'Enable integration with Flexible Shipping Connect', 'flexible-shipping' ); ?>
66
+ </label>
67
+ </fieldset>
68
+ </td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ <?php endif; ?>
73
 
74
  </div>
75
  </div>
vendor/wpdesk/wp-wpdesk-tracker/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ## [1.0.2] - 2019-04-23
2
  ### Fixed
3
  - Should enable tracker function
1
+ ## [1.0.4] - 2019-07-16
2
+ ### Fixed
3
+ - Removed console.log
4
+
5
  ## [1.0.2] - 2019-04-23
6
  ### Fixed
7
  - Should enable tracker function
vendor/wpdesk/wp-wpdesk-tracker/src/views/tracker-plugins-footer.php CHANGED
@@ -1,18 +1,12 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <script type="text/javascript">
3
  var wpdesk_track_deactivation_plugins = <?php echo json_encode( $plugins ); ?>;
4
- console.log(wpdesk_track_deactivation_plugins);
5
  jQuery("span.deactivate a").click(function(e){
6
  var is_tracked = false;
7
- console.log(jQuery(this).closest('tr'));
8
  var data_plugin = jQuery(this).closest('tr').attr('data-plugin');
9
- console.log(data_plugin);
10
  var href = jQuery(this).attr('href');
11
- console.log(href);
12
  jQuery.each( wpdesk_track_deactivation_plugins, function( key, value ) {
13
- console.log( key + ": " + value );
14
  if ( value == data_plugin ) {
15
- console.log('match');
16
  is_tracked = true;
17
  }
18
  });
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <script type="text/javascript">
3
  var wpdesk_track_deactivation_plugins = <?php echo json_encode( $plugins ); ?>;
 
4
  jQuery("span.deactivate a").click(function(e){
5
  var is_tracked = false;
 
6
  var data_plugin = jQuery(this).closest('tr').attr('data-plugin');
 
7
  var href = jQuery(this).attr('href');
 
8
  jQuery.each( wpdesk_track_deactivation_plugins, function( key, value ) {
 
9
  if ( value == data_plugin ) {
 
10
  is_tracked = true;
11
  }
12
  });