From e83934edff6ce5fcc2910ce3797e1d75508db01e Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Fri, 31 Jan 2020 17:53:02 +0100 Subject: [PATCH 1/3] Bumped versions for the upcoming release. --- includes/class-woocommerce.php | 2 +- readme.txt | 87 +--------------------------------- woocommerce.php | 2 +- 3 files changed, 3 insertions(+), 88 deletions(-) diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index ffda8fe009c..720d45b1f8c 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -20,7 +20,7 @@ final class WooCommerce { * * @var string */ - public $version = '3.9.0'; + public $version = '4.0.0-dev'; /** * The single instance of the class. diff --git a/readme.txt b/readme.txt index 73051b48c86..90ee3fa59a1 100644 --- a/readme.txt +++ b/readme.txt @@ -179,92 +179,7 @@ INTERESTED IN DEVELOPMENT? == Changelog == -= 3.9.0 - 2020-01-21 = - -* Enhancement - Added a "Show" button next to the password field on the login fields. #24915 -* Enhancement - New WooCommerce Onboarding experience (shows to only 10% of new users). #24991 -* Enhancement - Introduced Payment Gateway API to support "pay button". #25000 -* Enhancement - Includes WooCommerce Blocks 2.5.3, introducing an "All Products" block, a new block listing products using client side rendering (requires WordPress 5.3), and more. #25181 -* Tweak - Updated PayPal standard "Thank you" page message to comply with PayPal Guidelines. #24756 -* Tweak - Account for non-EU countries that collect VAT and rename tax to VAT on the frontend. #24999 -* Tweak - Cache checkout fragments and update DOM on change only. #24227 -* Tweak - Eliminate extra update order AJAX request on checkout page load. #24271 -* Tweak - Prevent billing address from being updated on shipping update. #24374 -* Tweak - Added a tooltip in the "Coupon expity date" field. #24749 -* Tweak - Make phone numbers clickable in emails. #24786 -* Tweak - Prevent PHP warnings in tracker if order doesn't have a created date yet. #24846 -* Tweak - Capitalize "T" in "Move to Trash" phrase on order page in wp-admin to be consistent with product and coupon pages. #24867 -* Tweak - Changed `wp_cache` invalidation from using increment to using microtime. #24961 -* Tweak - Made the usage tracking link on the setup wizard more transparent. #25026 -* Tweak - Fixed menu highlight of My Account page when browsing "Add payment method" page. #25041 -* Tweak - Prevent creating products before registering related post types and taxonomies. #25049 -* Tweak - Include processing orders in tracker data when opted in. #25071 -* Tweak - Centralize check for default themes to fix Storefront appearance in the Setup Wizard. #25216 -* Tweak - Adds a WordPress version check before recommending the WooCommerce Admin plugin during setup. #25260 -* Fix - Added license key support recent changes from MaxMind GeoLite2. #25378 -* Fix - Honor tax rounding preference in edit item and refund flows. #24208 -* Fix - Prevent incorrect number of decimal points in prices. #24281 -* Fix - Fixed initial support for Gutenberg's Experimental Legacy Widget block. #24292 -* Fix - Fix overriding of query when using orderby on archives with a static homepage. #24683 -* Fix - Use of `wp_unslash()` function when escaping admin settings values. #24793 -* Fix - Do not set the tracking cookie when doing ajax requests. #24798 -* Fix - Display button to delete images from product galleries in the admin when using a mobile device. #24840 -* Fix - Fixed order note's date format. #24843 -* Fix - Refactored `WC_Order_Factory::get_order()` to remove function deprecated in PHP 7.0. #24852 -* Fix - Fixed product stock status changes on Bulk Edit save when "Enable stock management" is disabled. #24876 -* Fix - Fixed default country code fallback in wc_get_customer_default_location(). #24884 -* Fix - Fixed misleading message for Shipping options in cart. #24914 -* Fix - Customizer not loading when viewing from WordPress.com. #24935 -* Fix - Prevent notice when a variable product has no images. #24986 -* Fix - Adjusted the slug generation for duplicated variable products to prevent performance degradation when using templates. #25064 -* Fix - Added appropriate minification to photoswipe.css. #25074 -* Fix - Corrected the sorting behavior for the "products" shortcode when manually sorting products. #25084 -* Fix - Fixed invalid backlinks for in-app purchases. #25098 -* Fix - Corrected the media element player initialization for product variation descriptions. #25103 -* Fix - Enable WooCommerce.com Site API on installations not using permalink. #25131 -* Fix - WooCommerce.com Site API now returns success if the plugin was previously installed. #25140 -* Fix - WooCommerce.com Site API checks to `move_product` case to make sure result array contains `folder_exists` item and doesn't return a warning. #25160 -* Fix - Ensure that categories containing only private products are selectable in the product exporter. #25132 -* Fix - Prevent variable product parents from being added to orders. #25162 -* Fix - Use sorting settings as a default to product shortcodes. #25180 -* Fix - Applied setup wizard CSS fixes to the respective WP versions. #25197 -* Fix - Fixed "account erasure request" URL in WordPress 5.3. #25208 -* Fix - Ensure all cache get removed on webhook deletion. #25164 -* Fix - Adjusted the checkout email validation regex to be more accurate. #25251 -* Template - Introduced `woocommerce_product_related_products_heading` filter. #25059 -* Template - Introduced `woocommerce_before_lost_password_confirmation_message` and `woocommerce_after_lost_password_confirmation_message` hooks. #25096 -* REST API - Fixed `date_created` and `date_created_gmt` for customers v2. #25181 -* REST API - Fixed Restored "Total post count" section on System Status endpoint v2 and v3. #25181 -* REST API - Filter empty objects from results before loop. #25181 -* Dev - Introduce new PHP 7.0 minimum requirement. -* Dev - Introduce new WordPress 5.0 minimum requirement. -* Dev - Check for max discount to be "-ve" to prevent overwriting refunded fee amount. #24341 -* Dev - Add unload event to the checkout page to prevent reloading during checkout after placing an order. #24609 -* Dev - Only toggle form field description if element exists. #24752 -* Dev - Introduced `woocommerce_{$export_type}_export_delimiter` filter to change separator string while exporting CSV files. #24759 -* Dev - Introduced `woocommerce_after_order_refund_item_name` hook. #24760 -* Dev - Introduced `woocommerce_kses_notice_allowed_tags` filter. #24849 -* Dev - Introduced `woocommerce_shipping_not_enabled_on_cart_html` filter. #24914 -* Dev - Introduced `woocommerce_show_invalid_variations_notice` filter. #24934 -* Dev - Introduced `woocommerce_upsells_order` filter. #25017 -* Dev - Introduced `woocommerce_before_settings_{current_tab}` and `woocommerce_after_settings_{current_tab}` hooks. #25028 -* Dev - Included third parameter `$order` to `woocommerce_order_get_formatted_billing_address` and `woocommerce_order_get_formatted_shipping_address` filters. #24870 -* Dev - Pass the `$clear_persistent_cart` variable to the `woocommerce_before_cart_emptied` and `woocommerce_cart_emptied actions`. #24930 -* Dev - Made variables in `assets/css/_variables.scss` default. #24822 -* Dev - Refactor to use the same rounding logic in orders and cart. #24828 -* Dev - Add order note immediately after status change before the `woocommerce_order_status_changed action. #24879 -* Dev - Added support for custom attributes in `wc_placeholder_img()`. #24937 -* Dev - Added initial support for inline notices on checkout. #25001 -* Dev - Introduced wc_get_product_object() helper. #25031 -* Dev - Pass the correct `$this->updated_props` variable to the `woocommerce_coupon_object_updated_props` action's second paramater. #25077 -* Dev - Remove a few calls to `func_get_args()` and `call_user_func_array()` with the spread operator for better code legibility and performance gains. #25101 -- Dev - New `woocommerce_valid_order_statuses_for_payment` hook that triggers when an order is paid. Use this new hook instead of `woocommerce_order_status_changed` or *woocommerce_order_status_{old_status}}_to_{new_status}` to trigger code for payment completion. #25158 -* Dev - Ability to exclude certain product types from product search calls. #25162 -* Dev - Raise exception when `WC_Product_Variation` is instantiated with an ID that belongs to an object that is not a variation. #25178 -* Localization - Add subdivisions of Laos. #24765 -* Localization - Fixed translatable string in WooCommerce's libraries. #24892 #24894 -* Localization - Fixed translatable string comments for translators. #24928 -* Localization - Add postcode validation for Slovenia. #25174 += 4.0.0 - 2020-03-03 = [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt). diff --git a/woocommerce.php b/woocommerce.php index c6c9676aaa1..883c70a8f0c 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce * Plugin URI: https://woocommerce.com/ * Description: An eCommerce toolkit that helps you sell anything. Beautifully. - * Version: 3.9.0 + * Version: 4.0.0-dev * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woocommerce From 132ced6039920b9ca0f8a68fea594122cbf80598 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Fri, 31 Jan 2020 21:05:50 +0100 Subject: [PATCH 2/3] Fixed test for 4.0. --- .../plugin-updates/class-wc-plugin-updates.php | 4 ++++ tests/unit-tests/util/plugin-updates.php | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/includes/admin/plugin-updates/class-wc-plugin-updates.php b/includes/admin/plugin-updates/class-wc-plugin-updates.php index fc0d70f78a1..4e3952c08bf 100644 --- a/includes/admin/plugin-updates/class-wc-plugin-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugin-updates.php @@ -173,6 +173,10 @@ class WC_Plugin_Updates { /** * Get active plugins that have a tested version lower than the input version. * + * In case of testing major version compatibility and if current WC version is >= major version part + * of the $new_version, no plugins are returned, even if they don't explicitly declare compatibility + * with the $new_version. + * * @param string $new_version WooCommerce version to test against. * @param string $release 'major' or 'minor'. * @return array of plugin info arrays diff --git a/tests/unit-tests/util/plugin-updates.php b/tests/unit-tests/util/plugin-updates.php index 26e1c4209a4..8532eac98b6 100644 --- a/tests/unit-tests/util/plugin-updates.php +++ b/tests/unit-tests/util/plugin-updates.php @@ -1,4 +1,9 @@ plugins ); - $new_version = '4.0.0'; + // current: X.Y.Z, new: (X+1).0. + // as current < new, all plugins are untested. + $current_version_parts = explode( '.', WC_VERSION ); + $new_version = ( $current_version_parts[0] + 1 ) . '.0.0'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); - $new_version = '4.3.0'; + // current: X.Y.Z, new: (X+1).3.0. + // as current < new, all plugins are untested. + $new_version = ( $current_version_parts[0] + 1 ) . '.3.0'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); - $new_version = '4.0.2'; + // current: X.Y.Z, new: (X+1).0.2. + // as current < new, all plugins are untested. + $new_version = ( $current_version_parts[0] + 1 ) . '.0.2'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); } From e61305663451dee2511946a2c015f7817a635c3e Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Sat, 1 Feb 2020 14:19:22 +0100 Subject: [PATCH 3/3] This perhaps better represents the spirit of the test. --- tests/unit-tests/util/plugin-updates.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/unit-tests/util/plugin-updates.php b/tests/unit-tests/util/plugin-updates.php index 8532eac98b6..9d5b12604b5 100644 --- a/tests/unit-tests/util/plugin-updates.php +++ b/tests/unit-tests/util/plugin-updates.php @@ -115,39 +115,40 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { */ public function test_get_untested_plugins_major_bad() { $release = 'major'; + $current_version_parts = explode( '.', WC_VERSION ); + $current_major_version = $current_version_parts[0]; $this->plugins = array( 'test/test.php' => array( 'Name' => 'Test plugin', - WC_Plugin_Updates::VERSION_TESTED_HEADER => '3.0.0', + WC_Plugin_Updates::VERSION_TESTED_HEADER => $current_major_version . '.0.0', ), 'test2/test2.php' => array( 'Name' => 'Test plugin 2', - WC_Plugin_Updates::VERSION_TESTED_HEADER => '3.9.9', + WC_Plugin_Updates::VERSION_TESTED_HEADER => $current_major_version . '.9.9', ), 'test3/test3.php' => array( 'Name' => 'Test plugin 3', - WC_Plugin_Updates::VERSION_TESTED_HEADER => '3.0', + WC_Plugin_Updates::VERSION_TESTED_HEADER => $current_major_version . '.0', ), ); $plugin_keys = array_keys( $this->plugins ); // current: X.Y.Z, new: (X+1).0. // as current < new, all plugins are untested. - $current_version_parts = explode( '.', WC_VERSION ); - $new_version = ( $current_version_parts[0] + 1 ) . '.0.0'; + $new_version = ( $current_major_version + 1 ) . '.0.0'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); // current: X.Y.Z, new: (X+1).3.0. // as current < new, all plugins are untested. - $new_version = ( $current_version_parts[0] + 1 ) . '.3.0'; + $new_version = ( $current_major_version + 1 ) . '.3.0'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); // current: X.Y.Z, new: (X+1).0.2. // as current < new, all plugins are untested. - $new_version = ( $current_version_parts[0] + 1 ) . '.0.2'; + $new_version = ( $current_major_version + 1 ) . '.0.2'; $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); }