WC Vendors - Version 2.0.1

Version Description

Download this release

Release Info

Developer digitalchild
Plugin Icon 128x128 WC Vendors
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  Changelog for WC Vendors
2
 
 
 
 
 
 
 
 
3
  Version 2.0.0
4
 
5
  * Added: New WC Vendors Admin menu
1
  Changelog for WC Vendors
2
 
3
+ Version 2.0.1
4
+
5
+ * Fixed: Update notice won't complete
6
+ * Fixed: Legacy settings options loading
7
+ * Fixed: Errors on activation when unsupported plugin is detected
8
+ * Fixed: Display sold_by option not working
9
+
10
  Version 2.0.0
11
 
12
  * Added: New WC Vendors Admin menu
class-wc-vendors.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Plugin Name: WC Vendors
5
  * Plugin URI: https://www.wcvendors.com
@@ -8,7 +7,7 @@
8
  * Author URI: https://www.wcvendors.com
9
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
10
  *
11
- * Version: 2.0.0
12
  * Requires at least: 4.4.0
13
  * Tested up to: 4.9.5
14
  * WC requires at least: 3.0.0
@@ -81,7 +80,7 @@ if ( wcv_is_woocommerce_activated() ) {
81
  class WC_Vendors
82
  {
83
 
84
- public $version = '2.0.0';
85
 
86
  /**
87
  * @var
@@ -103,10 +102,10 @@ if ( wcv_is_woocommerce_activated() ) {
103
  $this->define_constants();
104
 
105
  // Install & upgrade
106
- add_action( 'admin_init', array( $this, 'check_install' ) );
107
- add_action( 'init', array( $this, 'maybe_flush_permalinks' ), 99 );
108
- add_action( 'wcvendors_flush_rewrite_rules', array( $this, 'flush_rewrite_rules' ) );
109
- add_action( 'admin_init', array( $this, 'wcv_required_ignore_notices' ) );
110
 
111
  add_action( 'plugins_loaded', array( $this, 'include_gateways' ) );
112
  add_action( 'plugins_loaded', array( $this, 'include_core' ) );
@@ -118,7 +117,9 @@ if ( wcv_is_woocommerce_activated() ) {
118
  add_action( 'wp_logout', array( $this, 'destroy_session') );
119
  add_action( 'wp_login', array( $this, 'destroy_session') );
120
 
121
-
 
 
122
 
123
  // Show update notices
124
  $file = basename( __FILE__ );
@@ -201,12 +202,12 @@ if ( wcv_is_woocommerce_activated() ) {
201
  /**
202
  * Set static $pv_options to hold options class
203
  */
204
- // public function load_settings() {
205
- // if ( empty( self::$pv_options ) ) {
206
- // include_once( wcv_plugin_dir . 'classes/includes/class-sf-settings.php' );
207
- // self::$pv_options = new SF_Settings_API();
208
- // }
209
- // }
210
 
211
  public function load_il8n() {
212
  $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-vendors' );
1
  <?php
 
2
  /**
3
  * Plugin Name: WC Vendors
4
  * Plugin URI: https://www.wcvendors.com
7
  * Author URI: https://www.wcvendors.com
8
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
  *
10
+ * Version: 2.0.1
11
  * Requires at least: 4.4.0
12
  * Tested up to: 4.9.5
13
  * WC requires at least: 3.0.0
80
  class WC_Vendors
81
  {
82
 
83
+ public $version = '2.0.1';
84
 
85
  /**
86
  * @var
102
  $this->define_constants();
103
 
104
  // Install & upgrade
105
+ add_action( 'admin_init', array( $this, 'check_install' ) );
106
+ add_action( 'init', array( $this, 'maybe_flush_permalinks' ), 99 );
107
+ add_action( 'wcvendors_flush_rewrite_rules', array( $this, 'flush_rewrite_rules' ) );
108
+ add_action( 'admin_init', array( $this, 'wcv_required_ignore_notices' ) );
109
 
110
  add_action( 'plugins_loaded', array( $this, 'include_gateways' ) );
111
  add_action( 'plugins_loaded', array( $this, 'include_core' ) );
117
  add_action( 'wp_logout', array( $this, 'destroy_session') );
118
  add_action( 'wp_login', array( $this, 'destroy_session') );
119
 
120
+ // Legacy settings
121
+ add_action( 'admin_init', array( 'WCVendors_Install', 'check_pro_version' ) );
122
+ add_action( 'plugins_loaded', array( $this, 'load_legacy_settings' ) );
123
 
124
  // Show update notices
125
  $file = basename( __FILE__ );
202
  /**
203
  * Set static $pv_options to hold options class
204
  */
205
+ public function load_legacy_settings() {
206
+ if ( empty( self::$pv_options ) ) {
207
+ include_once( wcv_plugin_dir . 'classes/includes/class-sf-settings.php' );
208
+ self::$pv_options = new SF_Settings_API();
209
+ }
210
+ }
211
 
212
  public function load_il8n() {
213
  $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-vendors' );
classes/class-install.php CHANGED
@@ -44,12 +44,13 @@ class WCVendors_Install {
44
  } // init()
45
 
46
  /**
47
- * Check WC Vendors version and run the updater is required.
48
  *
49
  * This check is done on all requests and runs if the versions do not match.
50
  */
51
  public static function check_version() {
52
- if ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'wcvendors_version' ) !== WCV_VERSION ) {
 
53
  self::install();
54
  do_action( 'wcvendors_updated' );
55
  }
@@ -348,8 +349,9 @@ class WCVendors_Install {
348
  * @param string $version
349
  */
350
  public static function update_db_version( $version = null ) {
 
351
  delete_option( 'wcvendors_db_version' );
352
- add_option( 'wcvendors_db_version', is_null( $version ) ? WCV_VERSION : $version );
353
  }
354
 
355
 
@@ -357,8 +359,9 @@ class WCVendors_Install {
357
  * Update WC version to current.
358
  */
359
  private static function update_wcv_version() {
 
360
  delete_option( 'wcvendors_version' );
361
- add_option( 'wcvendors_version', WCV_VERSION );
362
  }
363
 
364
 
44
  } // init()
45
 
46
  /**
47
+ * Check WC Vendors version and run the updater if required.
48
  *
49
  * This check is done on all requests and runs if the versions do not match.
50
  */
51
  public static function check_version() {
52
+ global $wc_vendors;
53
+ if ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'wcvendors_version' ) !== $wc_vendors->version ) {
54
  self::install();
55
  do_action( 'wcvendors_updated' );
56
  }
349
  * @param string $version
350
  */
351
  public static function update_db_version( $version = null ) {
352
+ global $wc_vendors;
353
  delete_option( 'wcvendors_db_version' );
354
+ add_option( 'wcvendors_db_version', is_null( $version ) ? $wc_vendors->version : $version );
355
  }
356
 
357
 
359
  * Update WC version to current.
360
  */
361
  private static function update_wcv_version() {
362
+ global $wc_vendors;
363
  delete_option( 'wcvendors_version' );
364
+ add_option( 'wcvendors_version', $wc_vendors->version );
365
  }
366
 
367
 
classes/front/class-vendor-cart.php CHANGED
@@ -18,7 +18,7 @@ class WCV_Vendor_Cart
18
  function __construct()
19
  {
20
 
21
- if ( get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
22
  add_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
23
  add_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
24
  }
18
  function __construct()
19
  {
20
 
21
+ if ( 'yes' == get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
22
  add_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
23
  add_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
24
  }
classes/front/class-vendor-shop.php CHANGED
@@ -29,7 +29,7 @@ class WCV_Vendor_Shop
29
  add_filter( 'post_type_archive_link', array( 'WCV_Vendor_Shop', 'change_archive_link' ) );
30
 
31
  // Add sold by to product loop before add to cart
32
- if ( apply_filters( 'wcvendors_disable_sold_by_labels', get_option( 'wcvendors_display_label_sold_by_enable' ) ) ) {
33
  add_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9 );
34
  }
35
 
@@ -314,7 +314,7 @@ class WCV_Vendor_Shop
314
  */
315
  public static function add_vendor_to_order_item_meta_legacy( $item_id, $cart_item) {
316
 
317
- if ( get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
318
 
319
  $vendor_id = $cart_item[ 'data' ]->post->post_author;
320
  $sold_by_label = get_option( 'wcvendors_label_sold_by' );
@@ -333,7 +333,7 @@ class WCV_Vendor_Shop
333
  */
334
  public function add_vendor_to_order_item_meta( $item, $cart_item_key, $values ) {
335
 
336
- if ( get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
337
 
338
  $cart = WC()->cart->get_cart();
339
  $cart_item = $cart[ $cart_item_key ];
29
  add_filter( 'post_type_archive_link', array( 'WCV_Vendor_Shop', 'change_archive_link' ) );
30
 
31
  // Add sold by to product loop before add to cart
32
+ if ( apply_filters( 'wcvendors_disable_sold_by_labels', 'yes' === get_option( 'wcvendors_display_label_sold_by_enable' ) ) ) {
33
  add_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9 );
34
  }
35
 
314
  */
315
  public static function add_vendor_to_order_item_meta_legacy( $item_id, $cart_item) {
316
 
317
+ if ( 'yes' === get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
318
 
319
  $vendor_id = $cart_item[ 'data' ]->post->post_author;
320
  $sold_by_label = get_option( 'wcvendors_label_sold_by' );
333
  */
334
  public function add_vendor_to_order_item_meta( $item, $cart_item_key, $values ) {
335
 
336
+ if ( 'yes' === get_option( 'wcvendors_display_label_sold_by_enable' ) ) {
337
 
338
  $cart = WC()->cart->get_cart();
339
  $cart_item = $cart[ $cart_item_key ];
readme.txt CHANGED
@@ -5,8 +5,9 @@ Donate link: https://www.wcvendors.com/
5
  Author URI: https://www.wcvendors.com/
6
  Plugin URI: https://www.wcvendors.com/
7
  Requires at least: 4.4.0
 
8
  Tested up to: 4.9.5
9
- Stable tag: 2.0.0
10
  License: GPLv2 or later
11
 
12
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
@@ -137,15 +138,16 @@ WC Vendors does not work with multisite WordPress. There are no plans to support
137
  11. Setup Wizard complete
138
  12. Email notifications for admins, customers and vendors
139
 
140
- == Upgrade Notice ==
141
 
142
- = 2.0 =
143
 
144
- WC Vendors 2.0 is a major update. This is not compatible with ANY of our existing extensions. You should test this update on a staging server before updating. update your theme and extensions, and [review update details here](https://docs.wcvendors.com/knowledge-base/upgrading-to-wc-vendors-2-0/) before upgrading.
 
 
 
145
 
146
- == Changelog ==
147
-
148
- = Version 2.0.0 - 15th March 2018
149
 
150
  * Added: New WC Vendors Admin menu
151
  * Added: Bank details fields for vendors
@@ -192,7 +194,7 @@ Templates Updated:
192
  templates/dashboard/settings/settings.php
193
  templates/order/table-body.php
194
 
195
- =Version 1.9.14 - 18th February 2018
196
 
197
  * Added: Export commissions via CSV
198
  * Added: Commission Table Links #166
@@ -205,7 +207,7 @@ Templates Updated:
205
  * Fixed: Text domain in read me for glotpress translations
206
  * Fixed: "sold by" is showing in several areas despite deselected admin setting #386
207
 
208
- = Version 1.9.13 - 28th November 2017
209
 
210
  * Added: Notice for depreciated gateway
211
  * Added: A filter for role change: Denied Vendor #351
@@ -226,7 +228,7 @@ Templates Updated:
226
  * Fixed: Depreciated functions #368 thanks @stodorovic
227
  * Fixed: Changed how customer address is displayed based on Woo Options. Thanks @debain
228
 
229
- = Version 1.9.12 - June 26 2017
230
 
231
  * Added: For hook for vendor order content
232
  * Updated: Portuguese translations thanks Elsa
@@ -726,5 +728,6 @@ Templates Updated:
726
 
727
  == Upgrade Notice ==
728
 
729
- = 1.6.0 =
730
- Our template system has been upgraded. See (http://www.wcvendors.com/knowledgebase/v1-5-0-to-v1-6-0-upgrade-guide/) for the upgrade guide if you have used our templates to change how your site looks.
 
5
  Author URI: https://www.wcvendors.com/
6
  Plugin URI: https://www.wcvendors.com/
7
  Requires at least: 4.4.0
8
+ Requires PHP: 5.6
9
  Tested up to: 4.9.5
10
+ Stable tag: 2.0.1
11
  License: GPLv2 or later
12
 
13
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
138
  11. Setup Wizard complete
139
  12. Email notifications for admins, customers and vendors
140
 
141
+ == Changelog ==
142
 
143
+ = Version 2.0.1 - 17th May 2018 =
144
 
145
+ * Fixed: Update notice won't complete
146
+ * Fixed: Legacy settings options loading
147
+ * Fixed: Errors on activation when unsupported plugin is detected
148
+ * Fixed: Display sold_by option not working
149
 
150
+ = Version 2.0.0 - 14th May 2018 =
 
 
151
 
152
  * Added: New WC Vendors Admin menu
153
  * Added: Bank details fields for vendors
194
  templates/dashboard/settings/settings.php
195
  templates/order/table-body.php
196
 
197
+ = Version 1.9.14 - 18th February 2018 =
198
 
199
  * Added: Export commissions via CSV
200
  * Added: Commission Table Links #166
207
  * Fixed: Text domain in read me for glotpress translations
208
  * Fixed: "sold by" is showing in several areas despite deselected admin setting #386
209
 
210
+ = Version 1.9.13 - 28th November 2017 =
211
 
212
  * Added: Notice for depreciated gateway
213
  * Added: A filter for role change: Denied Vendor #351
228
  * Fixed: Depreciated functions #368 thanks @stodorovic
229
  * Fixed: Changed how customer address is displayed based on Woo Options. Thanks @debain
230
 
231
+ = Version 1.9.12 - June 26 2017 =
232
 
233
  * Added: For hook for vendor order content
234
  * Updated: Portuguese translations thanks Elsa
728
 
729
  == Upgrade Notice ==
730
 
731
+ = 2.0 =
732
+
733
+ WC Vendors 2.0 is a major update. This is not compatible with ANY of our existing extensions. You should test this update on a staging server before updating. update your theme and extensions, and [review update details here](https://docs.wcvendors.com/knowledge-base/upgrading-to-wc-vendors-2-0/) before upgrading.