Flexible Shipping for WooCommerce - Version 3.3.12

Version Description

  • 2019-05-08 =
  • Fixed export/import for shipping classes with comma in name
Download this release

Release Info

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

Code changes from version 3.3.11 to 3.3.12

classes/csv/class-csv-importer.php CHANGED
@@ -174,6 +174,9 @@ 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();
@@ -276,8 +279,8 @@ class WPDesk_Flexible_Shipping_Csv_Importer {
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;
281
 
282
  } else {
283
  $imported_shipping_method['method_rules'][] = $this->new_rule( $csv_row, $import_row_count );
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
+ $csv_shipping_class = WPDesk_Flexible_Shipping_Csv_Shipping_Class::create_from_encoded_shipping_class_name( $rule_shipping_class );
178
+ $rule_shipping_class = $csv_shipping_class->get_shipping_class_name();
179
+
180
  $shipping_class_found = false;
181
  WC()->shipping()->shipping_classes = array();
182
  $wc_shipping_classes = WC()->shipping()->get_shipping_classes();
279
 
280
  $imported_shipping_method = $this->new_shipping_method( $csv_row, $shipping_methods, $import_row_count );
281
 
282
+ $current_method_title = $csv_row['Method Title'];
283
+ $method_title = $imported_shipping_method['method_title'];
284
 
285
  } else {
286
  $imported_shipping_method['method_rules'][] = $this->new_rule( $csv_row, $import_row_count );
classes/csv/class-csv-shipping-class.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Shipping class in CSV.
5
+ */
6
+ class WPDesk_Flexible_Shipping_Csv_Shipping_Class {
7
+
8
+ const ENCODED_COMMA = '&#44;';
9
+
10
+ /**
11
+ * Shipping class name.
12
+ *
13
+ * @var string
14
+ */
15
+ private $shipping_class_name;
16
+
17
+ /**
18
+ * WPDesk_Flexible_Shipping_Csv_Shipping_Class constructor.
19
+ *
20
+ * @param string $shipping_class_name Shipping class name.
21
+ */
22
+ public function __construct( $shipping_class_name ) {
23
+ $this->shipping_class_name = $shipping_class_name;
24
+ }
25
+
26
+ /**
27
+ * Create from encoded shipping class name.
28
+ *
29
+ * @param string $encoded_shipping_class_name Encoded shipping class name.
30
+ *
31
+ * @return WPDesk_Flexible_Shipping_Csv_Shipping_Class
32
+ */
33
+ public static function create_from_encoded_shipping_class_name( $encoded_shipping_class_name ) {
34
+ return new self( str_replace( self::ENCODED_COMMA, ',', $encoded_shipping_class_name ) );
35
+ }
36
+
37
+ /**
38
+ * Get shipping class name.
39
+ *
40
+ * @return string
41
+ */
42
+ public function get_shipping_class_name() {
43
+ return $this->shipping_class_name;
44
+ }
45
+
46
+ /**
47
+ * Get encoded shipping class name.
48
+ *
49
+ * @return string
50
+ */
51
+ public function get_encoded_shipping_class_name() {
52
+ return str_replace( ',', self::ENCODED_COMMA, $this->shipping_class_name );
53
+ }
54
+
55
+ }
classes/flexible-shipping-export.php CHANGED
@@ -169,11 +169,14 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_Export' ) ) {
169
  }
170
  foreach ( $wc_shipping_classes as $shipping_class ) {
171
  if ( in_array( $shipping_class->term_id, $method_shipping_class ) ) {
172
- $method_rule['shipping_class'] .= $shipping_class->name;
 
 
173
  $method_rule['shipping_class'] .= ',';
174
  }
175
  }
176
  $method_rule['shipping_class'] = trim( $method_rule['shipping_class'], ',' );
 
177
  }
178
  if ( ! isset( $method_rule['stop'] ) ) {
179
  $method_rule['stop'] = '';
169
  }
170
  foreach ( $wc_shipping_classes as $shipping_class ) {
171
  if ( in_array( $shipping_class->term_id, $method_shipping_class ) ) {
172
+ $csv_shipping_class = new WPDesk_Flexible_Shipping_Csv_Shipping_Class( $shipping_class->name );
173
+
174
+ $method_rule['shipping_class'] .= $csv_shipping_class->get_encoded_shipping_class_name();
175
  $method_rule['shipping_class'] .= ',';
176
  }
177
  }
178
  $method_rule['shipping_class'] = trim( $method_rule['shipping_class'], ',' );
179
+
180
  }
181
  if ( ! isset( $method_rule['stop'] ) ) {
182
  $method_rule['stop'] = '';
flexible-shipping.php CHANGED
@@ -3,7 +3,7 @@
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.3.11
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -43,8 +43,8 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
43
  }
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
- $plugin_version = '3.3.11';
47
- $plugin_release_timestamp = '2019-05-06 15:25';
48
 
49
  $plugin_name = 'Flexible Shipping';
50
  $plugin_class_name = 'Flexible_Shipping_Plugin';
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.3.12
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
43
  }
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
+ $plugin_version = '3.3.12';
47
+ $plugin_release_timestamp = '2019-05-08 15:43';
48
 
49
  $plugin_name = 'Flexible Shipping';
50
  $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
7
- Stable tag: 3.3.11
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,9 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 3.3.11 - 2019-05-06 =
179
  * Fixed chance for exception when using woocommerce logger
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
7
+ Stable tag: 3.3.12
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.3.12 - 2019-05-08 =
179
+ * Fixed export/import for shipping classes with comma in name
180
+
181
  = 3.3.11 - 2019-05-06 =
182
  * Fixed chance for exception when using woocommerce logger
183
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit2d2efbea06f2006f9d9405b304994c66::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -362,6 +362,7 @@ return array(
362
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => $baseDir . '/classes/checkout/class-checkout-ajax-request-data.php',
363
  'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/csv/class-csv-importer.php',
364
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/csv/class-csv-importer-exception.php',
 
365
  'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/flexible-shipping-export.php',
366
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/classes/shipment/class-get-label-exception.php',
367
  'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => $baseDir . '/classes/shipment/class-label-not-available-exception.php',
362
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => $baseDir . '/classes/checkout/class-checkout-ajax-request-data.php',
363
  'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/csv/class-csv-importer.php',
364
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/csv/class-csv-importer-exception.php',
365
+ 'WPDesk_Flexible_Shipping_Csv_Shipping_Class' => $baseDir . '/classes/csv/class-csv-shipping-class.php',
366
  'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/flexible-shipping-export.php',
367
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/classes/shipment/class-get-label-exception.php',
368
  'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => $baseDir . '/classes/shipment/class-label-not-available-exception.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876', '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\ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit20ac74c6d69c9bf367e4f0ccfca51876
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire20ac74c6d69c9bf367e4f0ccfca51876($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire20ac74c6d69c9bf367e4f0ccfca51876($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 ComposerAutoloaderInit2d2efbea06f2006f9d9405b304994c66
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit2d2efbea06f2006f9d9405b304994c66', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit2d2efbea06f2006f9d9405b304994c66', '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\ComposerStaticInit2d2efbea06f2006f9d9405b304994c66::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\ComposerStaticInit2d2efbea06f2006f9d9405b304994c66::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire2d2efbea06f2006f9d9405b304994c66($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire2d2efbea06f2006f9d9405b304994c66($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 ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
@@ -448,6 +448,7 @@ class ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876
448
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => __DIR__ . '/../..' . '/classes/checkout/class-checkout-ajax-request-data.php',
449
  'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/csv/class-csv-importer.php',
450
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/csv/class-csv-importer-exception.php',
 
451
  'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/flexible-shipping-export.php',
452
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/classes/shipment/class-get-label-exception.php',
453
  'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => __DIR__ . '/../..' . '/classes/shipment/class-label-not-available-exception.php',
@@ -565,9 +566,9 @@ class ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876
565
  public static function getInitializer(ClassLoader $loader)
566
  {
567
  return \Closure::bind(function () use ($loader) {
568
- $loader->prefixLengthsPsr4 = ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876::$prefixLengthsPsr4;
569
- $loader->prefixDirsPsr4 = ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876::$prefixDirsPsr4;
570
- $loader->classMap = ComposerStaticInit20ac74c6d69c9bf367e4f0ccfca51876::$classMap;
571
 
572
  }, null, ClassLoader::class);
573
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit2d2efbea06f2006f9d9405b304994c66
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
448
  'WPDesk_Flexible_Shipping_Checkout_Ajax_Request_Data' => __DIR__ . '/../..' . '/classes/checkout/class-checkout-ajax-request-data.php',
449
  'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/csv/class-csv-importer.php',
450
  'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/csv/class-csv-importer-exception.php',
451
+ 'WPDesk_Flexible_Shipping_Csv_Shipping_Class' => __DIR__ . '/../..' . '/classes/csv/class-csv-shipping-class.php',
452
  'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/flexible-shipping-export.php',
453
  'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/classes/shipment/class-get-label-exception.php',
454
  'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => __DIR__ . '/../..' . '/classes/shipment/class-label-not-available-exception.php',
566
  public static function getInitializer(ClassLoader $loader)
567
  {
568
  return \Closure::bind(function () use ($loader) {
569
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2d2efbea06f2006f9d9405b304994c66::$prefixLengthsPsr4;
570
+ $loader->prefixDirsPsr4 = ComposerStaticInit2d2efbea06f2006f9d9405b304994c66::$prefixDirsPsr4;
571
+ $loader->classMap = ComposerStaticInit2d2efbea06f2006f9d9405b304994c66::$classMap;
572
 
573
  }, null, ClassLoader::class);
574
  }