Flexible Shipping for WooCommerce - Version 4.6.1

Version Description

  • 2021-06-21 =
  • Changed notice type for Left Free Shipping message
  • Fixed fatal error with CoCart plugin: added parameters types verification in Free Shipping Notice
Download this release

Release Info

Developer wpdesk
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 4.6.1
Comparing to
See all releases

Code changes from version 4.6.0 to 4.6.1

classes/class-flexible-shipping-plugin.php CHANGED
@@ -492,13 +492,11 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
492
  * @internal
493
  */
494
  public function init_free_shipping_notice() {
495
- global $wp;
496
-
497
  $cart = WC()->cart;
498
  $session = WC()->session;
499
- if ( null !== $cart && null !== $session ) {
500
  ( new FreeShippingNoticeGenerator( $cart, $session ) )->hooks();
501
- ( new FreeShippingNotice( $cart, $session, $wp ) )->hooks();
502
  }
503
  }
504
 
492
  * @internal
493
  */
494
  public function init_free_shipping_notice() {
 
 
495
  $cart = WC()->cart;
496
  $session = WC()->session;
497
+ if ( $cart instanceof WC_Cart && $session instanceof WC_Session ) {
498
  ( new FreeShippingNoticeGenerator( $cart, $session ) )->hooks();
499
+ ( new FreeShippingNotice( $cart, $session ) )->hooks();
500
  }
501
  }
502
 
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: 4.6.0
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
@@ -11,7 +11,7 @@
11
  * Requires at least: 5.2
12
  * Tested up to: 5.7
13
  * WC requires at least: 4.8
14
- * WC tested up to: 5.3
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
- $plugin_version = '4.6.0';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
@@ -50,15 +50,15 @@ $plugin_dir = dirname( __FILE__ );
50
  define( 'FLEXIBLE_SHIPPING_VERSION', $plugin_version );
51
  define( $plugin_class_name, $plugin_version );
52
 
53
- $requirements = array(
54
  'php' => '5.6',
55
  'wp' => '4.5',
56
- 'plugins' => array(
57
- array(
58
  'name' => 'woocommerce/woocommerce.php',
59
  'nice_name' => 'WooCommerce',
60
- ),
61
- ),
62
- );
63
 
64
  require __DIR__ . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/plugin-init-php52-free.php';
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: 4.6.1
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
11
  * Requires at least: 5.2
12
  * Tested up to: 5.7
13
  * WC requires at least: 4.8
14
+ * WC tested up to: 5.4
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
+ $plugin_version = '4.6.1';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
50
  define( 'FLEXIBLE_SHIPPING_VERSION', $plugin_version );
51
  define( $plugin_class_name, $plugin_version );
52
 
53
+ $requirements = [
54
  'php' => '5.6',
55
  'wp' => '4.5',
56
+ 'plugins' => [
57
+ [
58
  'name' => 'woocommerce/woocommerce.php',
59
  'nice_name' => 'WooCommerce',
60
+ ],
61
+ ],
62
+ ];
63
 
64
  require __DIR__ . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/plugin-init-php52-free.php';
lang/flexible-shipping.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Flexible Shipping 4.6.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-06-07T14:34:56+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
@@ -51,23 +51,23 @@ msgid "By using the 'Send feedback' button I hereby agree and consent to the ter
51
  msgstr ""
52
 
53
  #. Translators: link.
54
- #: classes/class-flexible-shipping-plugin.php:743
55
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
56
  msgstr ""
57
 
58
- #: classes/class-flexible-shipping-plugin.php:821
59
  msgid "Settings"
60
  msgstr ""
61
 
62
- #: classes/class-flexible-shipping-plugin.php:825
63
  msgid "Docs"
64
  msgstr ""
65
 
66
- #: classes/class-flexible-shipping-plugin.php:826
67
  msgid "Support"
68
  msgstr ""
69
 
70
- #: classes/class-flexible-shipping-plugin.php:832
71
  msgid "Upgrade"
72
  msgstr ""
73
 
@@ -1150,7 +1150,7 @@ msgid "No shipping method handled by Flexible Shipping found in the %1$s shippin
1150
  msgstr ""
1151
 
1152
  #. Translators: cart value and shop link.
1153
- #: src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php:123
1154
  msgid "You only need %1$s more to get free shipping! %2$sContinue shopping%3$s"
1155
  msgstr ""
1156
 
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Flexible Shipping 4.6.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-06-21T17:30:43+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
51
  msgstr ""
52
 
53
  #. Translators: link.
54
+ #: classes/class-flexible-shipping-plugin.php:741
55
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
56
  msgstr ""
57
 
58
+ #: classes/class-flexible-shipping-plugin.php:819
59
  msgid "Settings"
60
  msgstr ""
61
 
62
+ #: classes/class-flexible-shipping-plugin.php:823
63
  msgid "Docs"
64
  msgstr ""
65
 
66
+ #: classes/class-flexible-shipping-plugin.php:824
67
  msgid "Support"
68
  msgstr ""
69
 
70
+ #: classes/class-flexible-shipping-plugin.php:830
71
  msgid "Upgrade"
72
  msgstr ""
73
 
1150
  msgstr ""
1151
 
1152
  #. Translators: cart value and shop link.
1153
+ #: src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php:156
1154
  msgid "You only need %1$s more to get free shipping! %2$sContinue shopping%3$s"
1155
  msgstr ""
1156
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocomm
4
  Tags: table rate, table rate shipping, conditional shipping, shipping method, 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, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
  Tested up to: 5.7
7
- Stable tag: 4.6.0
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -199,6 +199,10 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
199
 
200
  == Changelog ==
201
 
 
 
 
 
202
  = 4.6.0 - 2021-06-07 =
203
  * Added NPS
204
 
4
  Tags: table rate, table rate shipping, conditional shipping, shipping method, 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, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
  Tested up to: 5.7
7
+ Stable tag: 4.6.1
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
199
 
200
  == Changelog ==
201
 
202
+ = 4.6.1 - 2021-06-21 =
203
+ * Changed notice type for Left Free Shipping message
204
+ * Fixed fatal error with CoCart plugin: added parameters types verification in Free Shipping Notice
205
+
206
  = 4.6.0 - 2021-06-07 =
207
  * Added NPS
208
 
src/WPDesk/FS/Nps/NpsDisplayDecision.php CHANGED
@@ -34,7 +34,16 @@ class NpsDisplayDecision implements DisplayNpsDecision {
34
  * @inheritDoc
35
  */
36
  public function should_display_nps() {
37
- return $this->is_new_installation() && $this->are_shipping_method_settings_saved() && $this->user_display_decision->should_display_nps();
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  /**
34
  * @inheritDoc
35
  */
36
  public function should_display_nps() {
37
+ $should_display_nps = $this->is_new_installation() && $this->are_shipping_method_settings_saved() && $this->user_display_decision->should_display_nps();
38
+ $should_display_nps =
39
+ /**
40
+ * Should display NPS?
41
+ *
42
+ * @param bool $should_display_nps
43
+ */
44
+ apply_filters( 'flexible-shipping/nps/should-display-nps', $should_display_nps );
45
+
46
+ return $should_display_nps;
47
  }
48
 
49
  /**
src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php CHANGED
@@ -18,7 +18,8 @@ use WP;
18
  class FreeShippingNotice implements Hookable {
19
 
20
  const FLEXIBLE_SHIPPING_FREE_SHIPPING_NOTICE = 'flexible_shipping_free_shipping_notice';
21
- const NOTICE_TYPE_SUCCESS = 'success';
 
22
 
23
  /**
24
  * @var WC_Cart
@@ -30,20 +31,13 @@ class FreeShippingNotice implements Hookable {
30
  */
31
  private $session;
32
 
33
- /**
34
- * @var WP
35
- */
36
- private $wp;
37
-
38
  /**
39
  * FreeShippingNotice constructor.
40
  *
41
  * @param WC_Cart $cart .
42
  * @param WC_Session $session .
43
- * @param WP $wp .
44
  */
45
- public function __construct( WC_Cart $cart, WC_Session $session, WP $wp ) {
46
- $this->wp = $wp;
47
  $this->cart = $cart;
48
  $this->session = $session;
49
  }
@@ -52,64 +46,103 @@ class FreeShippingNotice implements Hookable {
52
  * Hooks.
53
  */
54
  public function hooks() {
55
- add_action( 'woocommerce_after_calculate_totals', array( $this, 'add_notice_on_cart_and_checkout' ) );
56
- add_filter( 'woocommerce_package_rates', array( $this, 'add_notice_on_checkout_ajax' ), FreeShippingNoticeGenerator::PRIORITY + 1, 2 );
 
 
 
 
57
  }
58
 
59
  /**
60
- * Add notice to free shipping left.
 
 
 
 
 
 
 
 
 
61
  */
62
- public function add_notice_on_cart_and_checkout() {
63
  if ( ! $this->cart->needs_shipping() ) {
64
- return;
65
  }
66
 
67
- if ( $this->should_add_to_cart() || $this->should_add_to_checkout() ) {
68
- $this->add_notice();
69
 
70
- remove_action( 'woocommerce_after_calculate_totals', array( $this, 'add_notice_free_shipping' ) );
 
 
 
 
71
  }
 
 
 
 
 
 
 
 
72
  }
73
 
74
  /**
75
- * @param array $package_rates .
76
- * @param array $package .
77
  *
78
- * @return array
79
  */
80
- public function add_notice_on_checkout_ajax( $package_rates, $package ) {
81
- if ( is_checkout() && wp_doing_ajax() ) {
82
- $this->add_notice();
83
- }
84
-
85
- return $package_rates;
86
  }
87
 
88
  /**
89
- * Add notice.
90
  */
91
- private function add_notice() {
92
- $amount = (float) $this->session->get( FreeShippingNoticeGenerator::SESSION_VARIABLE, 0.0 );
93
- if ( $amount > 0.0 ) {
94
- $message_text = $this->prepare_notice_text( $amount );
95
- if ( ! wc_has_notice( $message_text, self::NOTICE_TYPE_SUCCESS ) ) {
96
- wc_add_notice( $message_text, self::NOTICE_TYPE_SUCCESS, array( self::FLEXIBLE_SHIPPING_FREE_SHIPPING_NOTICE => 'yes' ) );
97
- }
 
 
 
 
 
 
98
  }
 
 
 
 
 
 
 
 
99
  }
100
 
101
  /**
102
- * @return bool
103
  */
104
- private function should_add_to_cart() {
105
- return is_cart();
 
 
 
 
 
 
106
  }
107
 
108
  /**
109
- * @return bool
110
  */
111
- private function should_add_to_checkout() {
112
- return is_checkout() && ! wp_doing_ajax();
113
  }
114
 
115
  /**
18
  class FreeShippingNotice implements Hookable {
19
 
20
  const FLEXIBLE_SHIPPING_FREE_SHIPPING_NOTICE = 'flexible_shipping_free_shipping_notice';
21
+ const NOTICE_TYPE = 'notice';
22
+ const NOTICE_CONTAINER_CLASS = 'flexible-shipping-notice-container';
23
 
24
  /**
25
  * @var WC_Cart
31
  */
32
  private $session;
33
 
 
 
 
 
 
34
  /**
35
  * FreeShippingNotice constructor.
36
  *
37
  * @param WC_Cart $cart .
38
  * @param WC_Session $session .
 
39
  */
40
+ public function __construct( WC_Cart $cart, WC_Session $session ) {
 
41
  $this->cart = $cart;
42
  $this->session = $session;
43
  }
46
  * Hooks.
47
  */
48
  public function hooks() {
49
+ // Checkout.
50
+ add_action( 'woocommerce_before_checkout_form', [ $this, 'add_checkout_notice_container' ] );
51
+ add_filter( 'woocommerce_update_order_review_fragments', [ $this, 'add_checkout_notice_to_fragments' ] );
52
+
53
+ // Cart.
54
+ add_action( 'woocommerce_after_calculate_totals', [ $this, 'add_notice_on_cart' ] );
55
  }
56
 
57
  /**
58
+ * @return void
59
+ */
60
+ public function add_checkout_notice_container() {
61
+ echo wp_kses_post( $this->get_left_free_shipping_notice_container() );
62
+ }
63
+
64
+ /**
65
+ * @param array $fragments .
66
+ *
67
+ * @return array
68
  */
69
+ public function add_checkout_notice_to_fragments( $fragments ) {
70
  if ( ! $this->cart->needs_shipping() ) {
71
+ return $fragments;
72
  }
73
 
74
+ $notice = '';
 
75
 
76
+ $notice_message = $this->get_notice_message();
77
+ if ( $notice_message ) {
78
+ ob_start();
79
+ wc_print_notice( $notice_message, self::NOTICE_TYPE, [ self::FLEXIBLE_SHIPPING_FREE_SHIPPING_NOTICE => 'yes' ] );
80
+ $notice = ob_get_clean();
81
  }
82
+
83
+ if ( ! is_string( $notice ) ) {
84
+ $notice = '';
85
+ }
86
+
87
+ $fragments[ '.' . self::NOTICE_CONTAINER_CLASS ] = $this->get_left_free_shipping_notice_container( $notice );
88
+
89
+ return $fragments;
90
  }
91
 
92
  /**
93
+ * @param string $content .
 
94
  *
95
+ * @return string
96
  */
97
+ private function get_left_free_shipping_notice_container( $content = '' ) {
98
+ return sprintf( '<div class="%s">%s</div>', self::NOTICE_CONTAINER_CLASS, $content );
 
 
 
 
99
  }
100
 
101
  /**
102
+ * Add notice to free shipping left.
103
  */
104
+ public function add_notice_on_cart() {
105
+ if ( ! $this->cart->needs_shipping() ) {
106
+ return;
107
+ }
108
+
109
+ if ( ! is_cart() ) {
110
+ return;
111
+ }
112
+
113
+ $notice_message = $this->get_notice_message();
114
+
115
+ if ( ! $notice_message ) {
116
+ return;
117
  }
118
+
119
+ if ( wc_has_notice( $notice_message, self::NOTICE_TYPE ) ) {
120
+ return;
121
+ }
122
+
123
+ wc_add_notice( $notice_message, self::NOTICE_TYPE, [ self::FLEXIBLE_SHIPPING_FREE_SHIPPING_NOTICE => 'yes' ] );
124
+
125
+ remove_action( 'woocommerce_after_calculate_totals', [ $this, 'add_notice_on_cart' ] );
126
  }
127
 
128
  /**
129
+ * @return string
130
  */
131
+ private function get_notice_message() {
132
+ $amount = $this->get_notice_amount();
133
+
134
+ if ( $amount === 0.0 ) {
135
+ return '';
136
+ }
137
+
138
+ return $this->prepare_notice_text( $amount );
139
  }
140
 
141
  /**
142
+ * @return float
143
  */
144
+ private function get_notice_amount() {
145
+ return (float) $this->session->get( FreeShippingNoticeGenerator::SESSION_VARIABLE, 0.0 );
146
  }
147
 
148
  /**
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit834b7b1145cb7d6c1d87f67601586ee1
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire834b7b1145cb7d6c1d87f67601586ee1($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire834b7b1145cb7d6c1d87f67601586ee1($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire5e2bb2f7f43fe6060cc64f56ec4704ce($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire5e2bb2f7f43fe6060cc64f56ec4704ce($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
@@ -670,10 +670,10 @@ class ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1
670
  public static function getInitializer(ClassLoader $loader)
671
  {
672
  return \Closure::bind(function () use ($loader) {
673
- $loader->prefixLengthsPsr4 = ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::$prefixLengthsPsr4;
674
- $loader->prefixDirsPsr4 = ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::$prefixDirsPsr4;
675
- $loader->fallbackDirsPsr4 = ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::$fallbackDirsPsr4;
676
- $loader->classMap = ComposerStaticInit834b7b1145cb7d6c1d87f67601586ee1::$classMap;
677
 
678
  }, null, ClassLoader::class);
679
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
670
  public static function getInitializer(ClassLoader $loader)
671
  {
672
  return \Closure::bind(function () use ($loader) {
673
+ $loader->prefixLengthsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$prefixLengthsPsr4;
674
+ $loader->prefixDirsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$prefixDirsPsr4;
675
+ $loader->fallbackDirsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$fallbackDirsPsr4;
676
+ $loader->classMap = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$classMap;
677
 
678
  }, null, ClassLoader::class);
679
  }
vendor_prefixed/wpdesk/wp-code-sniffer/composer.json CHANGED
@@ -1,15 +1,17 @@
1
  {
2
  "name": "wpdesk\/wp-code-sniffer",
3
- "description": "Library for WP Desk Coding standards in plugins.",
4
  "license": "MIT",
5
  "keywords": [
6
  "wordpress",
7
  "code sniffer",
8
- "admin"
 
9
  ],
10
  "homepage": "https:\/\/gitlab.com\/wpdesk\/wp-code-sniffer",
11
  "type": "phpcodesniffer-standard",
12
  "prefer-stable": true,
 
13
  "authors": [
14
  {
15
  "name": "grola",
@@ -17,22 +19,24 @@
17
  }
18
  ],
19
  "require": {
 
20
  "dealerdirect\/phpcodesniffer-composer-installer": "0.6|^0.7",
21
- "phpcompatibility\/php-compatibility": "^9.3",
22
- "squizlabs\/php_codesniffer": "^3.5",
23
- "wp-coding-standards\/wpcs": "^2.2"
24
  },
25
  "require-dev": {
26
- "phpunit\/phpunit": "<7",
27
- "mockery\/mockery": "*",
28
- "10up\/wp_mock": "*"
29
  },
30
- "autoload": {},
31
- "autoload-dev": {},
32
  "scripts": {
33
- "phpcs": "phpcs"
34
- },
35
- "extra": {
36
- "class": "WPDesk\\Composer\\Codeception\\Plugin"
 
 
 
 
 
37
  }
38
  }
1
  {
2
  "name": "wpdesk\/wp-code-sniffer",
3
+ "description": "Library for WP Desk Coding Standards in plugins.",
4
  "license": "MIT",
5
  "keywords": [
6
  "wordpress",
7
  "code sniffer",
8
+ "admin",
9
+ "phpcs"
10
  ],
11
  "homepage": "https:\/\/gitlab.com\/wpdesk\/wp-code-sniffer",
12
  "type": "phpcodesniffer-standard",
13
  "prefer-stable": true,
14
+ "version": "1.2.1",
15
  "authors": [
16
  {
17
  "name": "grola",
19
  }
20
  ],
21
  "require": {
22
+ "php": ">=7.0",
23
  "dealerdirect\/phpcodesniffer-composer-installer": "0.6|^0.7",
24
+ "squizlabs\/php_codesniffer": "^3.6",
25
+ "wp-coding-standards\/wpcs": "^2.3",
26
+ "phpcompatibility\/phpcompatibility-wp": "^2.1.1"
27
  },
28
  "require-dev": {
29
+ "roave\/security-advisories": "dev-latest"
 
 
30
  },
 
 
31
  "scripts": {
32
+ "install-codestandards": [
33
+ "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
34
+ ],
35
+ "pre-package-install": [
36
+ "@install-codestandards"
37
+ ],
38
+ "post-package-update": [
39
+ "@install-codestandards"
40
+ ]
41
  }
42
  }
vendor_prefixed/wpdesk/wp-wpdesk-helper/src/UpgradeSoonNotice.php CHANGED
@@ -19,6 +19,10 @@ class UpgradeSoonNotice
19
  */
20
  private function is_old_wc()
21
  {
 
 
 
 
22
  return !\FSVendor\WPDesk_Basic_Requirement_Checker::is_wc_at_least(self::SUPPORTED_WC);
23
  }
24
  /**
19
  */
20
  private function is_old_wc()
21
  {
22
+ if (!\defined('WC_VERSION')) {
23
+ // when there is no WC, assume it is not old.
24
+ return \false;
25
+ }
26
  return !\FSVendor\WPDesk_Basic_Requirement_Checker::is_wc_at_least(self::SUPPORTED_WC);
27
  }
28
  /**