Flexible Shipping for WooCommerce - Version 2.0.1

Version Description

  • 2018-03-01 =
  • Fixed problems with deactivation plugin on multisite
  • Fixed WP Desk Tracker warning after enabling the plugin
Download this release

Release Info

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

Code changes from version 2.0 to 2.0.1

classes/tracker.php CHANGED
@@ -169,6 +169,9 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_Tracker' ) ) {
169
  return $links;
170
  }
171
  $options = get_option('wpdesk_helper_options', array() );
 
 
 
172
  if ( empty( $options['wpdesk_tracker_agree'] ) ) {
173
  $options['wpdesk_tracker_agree'] = '0';
174
  }
@@ -186,6 +189,9 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_Tracker' ) ) {
186
 
187
 
188
  public function activated_plugin( $plugin, $network_wide ) {
 
 
 
189
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
190
  return;
191
  }
169
  return $links;
170
  }
171
  $options = get_option('wpdesk_helper_options', array() );
172
+ if ( !is_array( $options ) ) {
173
+ $options = array();
174
+ }
175
  if ( empty( $options['wpdesk_tracker_agree'] ) ) {
176
  $options['wpdesk_tracker_agree'] = '0';
177
  }
189
 
190
 
191
  public function activated_plugin( $plugin, $network_wide ) {
192
+ if ( $network_wide ) {
193
+ return;
194
+ }
195
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
196
  return;
197
  }
flexible-shipping.php CHANGED
@@ -3,15 +3,15 @@
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: 2.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
10
  Domain Path: /languages/
11
  Requires at least: 4.5
12
- Tested up to: 4.9.2
13
  WC requires at least: 2.6.14
14
- WC tested up to: 3.3
15
 
16
  Copyright 2017 WP Desk Ltd.
17
 
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: 2.0.1
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
10
  Domain Path: /languages/
11
  Requires at least: 4.5
12
+ Tested up to: 4.9.4
13
  WC requires at least: 2.6.14
14
+ WC tested up to: 3.3.3
15
 
16
  Copyright 2017 WP Desk Ltd.
17
 
inc/wpdesk-tracker/class-wpdesk-tracker.php CHANGED
@@ -3,7 +3,7 @@
3
  * WP Desk Tracker
4
  *
5
  * @class WPDESK_Tracker
6
- * @version 1.3.1
7
  * @package WPDESK/Helper
8
  * @category Class
9
  * @author WP Desk
@@ -32,7 +32,7 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
32
  * @var string
33
  */
34
  private static $api_url = 'https://data.wpdesk.org/?track=1';
35
- //private static $api_url = 'http://woo271.grola.pl/?track=1';
36
 
37
  /**
38
  * Hook into cron event.
@@ -62,6 +62,10 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
62
 
63
  add_filter( 'wpdesk_tracker_data', array( __CLASS__, 'wpdesk_tracker_message_version' ) );
64
 
 
 
 
 
65
  global $pagenow;
66
  if ( 'plugins.php' === $pagenow ) {
67
  add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) );
@@ -69,6 +73,35 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
69
 
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  public static function init_schedule() {
73
  $options = get_option( 'wpdesk_helper_options' );
74
  if ( !is_array( $options ) ) {
@@ -92,7 +125,7 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
92
  }
93
 
94
  public static function admin_footer() {
95
- if ( wpdesk_tracker_enabled() && !apply_filters( 'wpdesk_tracker_do_not_ask', false ) ) {
96
  $plugins = array(
97
  'wpdesk-helper/wpdesk-helper.php' => 'wpdesk-helper/wpdesk-helper.php'
98
  );
@@ -459,7 +492,8 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
459
  if ( !empty( $_REQUEST['additional_info'] ) ) {
460
  $params['additional_info'] = $_REQUEST['additional_info'];
461
  }
462
- $response = wp_remote_post( self::$api_url, array(
 
463
  'method' => 'POST',
464
  'timeout' => 5,
465
  'redirection' => 5,
@@ -537,7 +571,10 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
537
  else {
538
  $params = array( 'click_action' => 'no' );
539
  if ( self::$dismiss_coupon ) {
540
- $params = array( 'click_action' => 'no_coupon' );
 
 
 
541
  }
542
  $params['url'] = home_url();
543
  }
@@ -547,7 +584,7 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
547
  $params['localhost'] = 'yes';
548
  }
549
 
550
- $response = wp_remote_post( self::$api_url, array(
551
  'method' => 'POST',
552
  'timeout' => 5,
553
  'redirection' => 5,
@@ -558,6 +595,7 @@ if ( !class_exists( 'WPDesk_Tracker' ) ) {
558
  'cookies' => array(),
559
  )
560
  );
 
561
  }
562
 
563
  /**
3
  * WP Desk Tracker
4
  *
5
  * @class WPDESK_Tracker
6
+ * @version 1.3.2
7
  * @package WPDESK/Helper
8
  * @category Class
9
  * @author WP Desk
32
  * @var string
33
  */
34
  private static $api_url = 'https://data.wpdesk.org/?track=1';
35
+ private static $test_api_url = 'https://testdata.wpdesk.org/?track=1';
36
 
37
  /**
38
  * Hook into cron event.
62
 
63
  add_filter( 'wpdesk_tracker_data', array( __CLASS__, 'wpdesk_tracker_message_version' ) );
64
 
65
+ add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 999 );
66
+ add_action( 'wp_head', array( __CLASS__, 'wp_head' ), 999 );
67
+ add_action( 'admin_head', array( __CLASS__, 'wp_head' ), 999 );
68
+
69
  global $pagenow;
70
  if ( 'plugins.php' === $pagenow ) {
71
  add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) );
73
 
74
  }
75
 
76
+ public static function get_api_url() {
77
+ $api_url = self::$api_url;
78
+ if ( apply_filters( 'wpdesk_tracker_use_testdata', false ) ) {
79
+ $api_url = self::$test_api_url;
80
+ }
81
+ return $api_url;
82
+ }
83
+
84
+ public static function wp_head() {
85
+ if ( apply_filters( 'wpdesk_tracker_use_testdata', false ) && apply_filters( 'wpdesk_tracker_show_testdata', false ) ) {
86
+ include( 'views/tracker-styles.php' );
87
+ }
88
+ }
89
+
90
+ /**
91
+ * @param WP_Admin_Bar $wp_admin_bar
92
+ */
93
+ public static function admin_bar_menu( $wp_admin_bar ) {
94
+ if ( apply_filters( 'wpdesk_tracker_use_testdata', false ) && apply_filters( 'wpdesk_tracker_show_testdata', false ) ) {
95
+ $args = array(
96
+ 'id' => 'my_page',
97
+ 'title' => 'WP Desk Test!',
98
+ 'meta' => array( 'class' => 'wpdesk-tracker-test' )
99
+ );
100
+ $wp_admin_bar->add_node( $args );
101
+ }
102
+ }
103
+
104
+
105
  public static function init_schedule() {
106
  $options = get_option( 'wpdesk_helper_options' );
107
  if ( !is_array( $options ) ) {
125
  }
126
 
127
  public static function admin_footer() {
128
+ if ( !is_network_admin() && wpdesk_tracker_enabled() && !apply_filters( 'wpdesk_tracker_do_not_ask', false ) ) {
129
  $plugins = array(
130
  'wpdesk-helper/wpdesk-helper.php' => 'wpdesk-helper/wpdesk-helper.php'
131
  );
492
  if ( !empty( $_REQUEST['additional_info'] ) ) {
493
  $params['additional_info'] = $_REQUEST['additional_info'];
494
  }
495
+
496
+ $response = wp_remote_post( self::get_api_url(), array(
497
  'method' => 'POST',
498
  'timeout' => 5,
499
  'redirection' => 5,
571
  else {
572
  $params = array( 'click_action' => 'no' );
573
  if ( self::$dismiss_coupon ) {
574
+ $params = array(
575
+ 'click_action' => 'no_coupon',
576
+ );
577
+ $params['message_version'] = self::$message_version;
578
  }
579
  $params['url'] = home_url();
580
  }
584
  $params['localhost'] = 'yes';
585
  }
586
 
587
+ $response = wp_remote_post( self::get_api_url(), array(
588
  'method' => 'POST',
589
  'timeout' => 5,
590
  'redirection' => 5,
595
  'cookies' => array(),
596
  )
597
  );
598
+
599
  }
600
 
601
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk, swoboda
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
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: 4.9.2
7
- Stable tag: 2.0
8
  Requires PHP: 5.3
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -17,7 +17,7 @@ The most flexible Table Rate Shipping WooCommerce plugin. Create virtually any s
17
 
18
  Flexible Shipping is the most advanced shipping plugin for WooCommerce stores allowing you to calculate shipping costs based on weight and/or cart total. Combine it with the PRO version and it will become the only WooCommerce Shipping plugin you'll ever need.
19
 
20
- [youtube https://www.youtube.com/watch?v=qsFvYoiNDgU]
21
 
22
  > **Upgrade to Flexible Shipping PRO**<br />
23
  > Get priority e-mail support and access all PRO features, upgrade to [Flexible Shipping PRO now &rarr;](https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/)
@@ -126,8 +126,8 @@ Key features:
126
  * item count based shipping cost,
127
  * shipping class based shipping cost,
128
  * WooCommerce shipping cost rules,
129
- * Woocommerce shipping plugin,
130
- * Woocommerce table rate shipping.
131
 
132
  Check out this WooCommerce Table Rate Shipping Plugin today!
133
 
@@ -165,6 +165,10 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
165
 
166
  == Changelog ==
167
 
 
 
 
 
168
  = 2.0 - 2018-01-24 =
169
  * Added support for WooCommerce 3.3
170
  * Fixed installing the plugin by wp-cli
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
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: 4.9.4
7
+ Stable tag: 2.0.1
8
  Requires PHP: 5.3
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
17
 
18
  Flexible Shipping is the most advanced shipping plugin for WooCommerce stores allowing you to calculate shipping costs based on weight and/or cart total. Combine it with the PRO version and it will become the only WooCommerce Shipping plugin you'll ever need.
19
 
20
+ [youtube https://www.youtube.com/watch?v=C7dQ2jQ-iVc]
21
 
22
  > **Upgrade to Flexible Shipping PRO**<br />
23
  > Get priority e-mail support and access all PRO features, upgrade to [Flexible Shipping PRO now &rarr;](https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/)
126
  * item count based shipping cost,
127
  * shipping class based shipping cost,
128
  * WooCommerce shipping cost rules,
129
+ * WooCommerce shipping plugin,
130
+ * WooCommerce table rate shipping.
131
 
132
  Check out this WooCommerce Table Rate Shipping Plugin today!
133
 
165
 
166
  == Changelog ==
167
 
168
+ = 2.0.1 - 2018-03-01 =
169
+ * Fixed problems with deactivation plugin on multisite
170
+ * Fixed WP Desk Tracker warning after enabling the plugin
171
+
172
  = 2.0 - 2018-01-24 =
173
  * Added support for WooCommerce 3.3
174
  * Fixed installing the plugin by wp-cli