Resolving conflict with migration branch

This commit is contained in:
Julia Amosova 2019-11-28 16:46:35 +00:00
commit 6fb8f23ec6
46 changed files with 1258 additions and 491 deletions

View File

@ -13,7 +13,7 @@ There are many ways to contribute to the project!
If you wish to contribute code, please read the information in the sections below. Then [fork](https://help.github.com/articles/fork-a-repo/) WooCommerce, commit your changes, and [submit a pull request](https://help.github.com/articles/using-pull-requests/) 🎉 If you wish to contribute code, please read the information in the sections below. Then [fork](https://help.github.com/articles/fork-a-repo/) WooCommerce, commit your changes, and [submit a pull request](https://help.github.com/articles/using-pull-requests/) 🎉
We use the `help wanted` label to mark issues that are suitable for new contributors. You can find all the issues with this label [here](https://github.com/woocommerce/woocommerce/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). We use the `good first issue` label to mark issues that are suitable for new contributors. You can find all the issues with this label [here](https://github.com/woocommerce/woocommerce/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
WooCommerce is licensed under the GPLv3+, and all contributions to the project will be released under the same license. You maintain copyright over any contribution you make, and by submitting a pull request, you are agreeing to release that contribution under the GPLv3+ license. WooCommerce is licensed under the GPLv3+, and all contributions to the project will be released under the same license. You maintain copyright over any contribution you make, and by submitting a pull request, you are agreeing to release that contribution under the GPLv3+ license.

View File

@ -5,6 +5,8 @@ dist: xenial
services: services:
- xvfb - xvfb
- mysql - mysql
- docker
- docker-compose
sudo: false sudo: false
@ -32,14 +34,10 @@ matrix:
- name: "Coding standard check" - name: "Coding standard check"
php: 7.2 php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1 env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
- name: "e2e tests" - name: "E2E tests"
php: 7.2 env: RUN_E2E=1
env: WP_VERSION=latest WP_MULTISITE=0 RUN_E2E=1 script:
addons: - docker-compose up -d
chrome: beta
apt:
packages:
- nginx
- name: "Unit tests code coverage" - name: "Unit tests code coverage"
php: 7.3 php: 7.3
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1 env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1

View File

@ -1,5 +1,225 @@
== Changelog == == Changelog ==
= 3.8.0 - 2019-11-05 =
* Enhancement - Show error message in "My Account - view order" if order does not exist. #24435
* Enhancement - Add support to allow connect and install for in-app purchase flow. #24451
* Enhancement - Declared support to Unicode CLDR. #24564
* Enhancement - Declared support for PHP 7.4 in CI by removing PHP 7.4 from list of allowed failures. #24668
* Enhancement - Update the recommended PHP version to 7.0 and the recommended WP version to 5.0. #24730
* Enhancement - Change On Boarding Wizard to opt out of usage tracking by default. #24680
* Enhancement - Add `Available on backorder` message for products available on backorder. #24559
* Tweak - Hide Vietnam's state field. #24158
* Tweak - Better wording when no downloads are available on My Account > Downloads. #24172
* Tweak - Only consider orders created via checkout to hold stock. #24159
* Tweak - Stop to load order data twice in "View order" screen on "My Account" page. #24437
* Tweak - Prevent PHP warnings in tracker if order doesn't have a created date yet. #24441
* Tweak - Use `wc_get_checkout_url()` to get checkout URL. #24544
* Tweak - Maintain value of select fields in credit card form. #24720
* Tweak - Prevent filter per category while exporting product variations. #24517
* Tweak - Better wording for subtotal of items in cart and review order. #24440
* Tweak - Prevent new lines in product quantity in checkout details. #24311
* Tweak - Add a tooltip in the "Coupon expity date" field. #24749
* Tweak - CSS styling changes for WP 5.3. #24832
* Template - Moved HTML for displaying product price filter widget to a new template `product price filter widget`. #23384
* Accessibility - Make $subtext color darker. #24739
* Dev - Consistent register/login submit button css class names. Preserve old class names as well for backwards compatibility. #23701
* Dev - Added woocommerce_disable_password_change_notification filter, set to false by default. #24154
* Dev - Add filter `woocommerce_cart_item_removed_message` and `woocommerce_cart_product_cannot_be_purchased_message` to filter notice content when an item is removed from cart, or when a product cannot be purchased. #24176
* Dev - Prevent fatal error if trying to run `wc_load_cart()` before `before_woocommerce_init`. #24198
* Dev - Add woocommerce_get_zone_criteria filter hook to add custom criteria for matching zone ID. #24199
* Dev - Fire actions `woocommerce_before_delete_product_variation`, `woocommerce_delete_product_variation` and `woocommerce_trash_product_variation` appropriately when deleting or trashing product variations. #24239
* Dev - In filter `woocommerce_update_product_stock_query` use `$new_stock` instead of `$stock_quantity`. #24229
* Dev - Introduced woocommerce_prevent_adjust_line_item_product_stock filter. #24279
* Dev - Introduced `woocommerce_logout_default_redirect_url` filter to allow custom default URL. #24282
* Dev - Added woocommerce_sort_fees_callback filter. #24280
* Dev - Remove deprecated i18n/states directory. #24364
* Dev - Add filter `woocommerce_shipping_show_shipping_calculator` for showing shipping calculator. #24375
* Dev - Corrected UG states location. #24388
* Dev - Remove deprecations notices with PHP 7.4 by changing parameter order for `implode`. #24396
* Dev - Add ``$this` param to email filter for additional_content added in 3.7. #24399
* Dev - Add `woocommerce_product_import_process_item_data` filter to allow modifying a row before importing. #24412
* Dev - Fixed warnings when error_get_last() returns null. #24442
* Dev - Use brackets instead of braces to avoid deprecation notice in PHP 7.4. #24460
* Dev - Implement Puppeteer's architecture for running E2E tests locally. #24479
* Dev - Remove call to get_magic_quotes_runtime() as it is deprecated as of PHP 7.4. #24485
* Dev - Return value of `$mailer->send()` in `wc_mail` function. #24505
* Dev - Remove Selenium e2e tests & add Puppeteer new product e2e test. #24513
* Dev - Add a filter `woocommerce_ajax_add_order_item_validation` to allow validations in `add_order_item` function. #24518
* Dev - Use `wc_get_cart_url` instead of `wc_get_page_permalink( 'cart' )` because former has a filter `woocommerce_get_cart_url` to allow customization. #24530
* Dev - New `woocommerce_product_after_tabs` action hook added. #24694
* Dev - Enable append hashes on custom events (like ajax requests) #24665
* Dev - Introduced `woocommerce_order_get_formatted_billing_address` and `woocommerce_order_get_formatted_shipping_address` filters. #24677
* Dev - WC_Abstract_Order::recalculate_coupons() is public now. #24740
* Dev - Added 'applied_coupon' trigger to checkout.js. #24406
* Dev - Introduced woocommerce_output_cart_shortcode_content filter. #24738
* Dev - Add WPML compatibility to the geolocation URL. #24722
* Dev - Validate server requirements in WCCCOM Site Installer endpoints. #24690
* Dev - Introduced woocommerce_payment_token_class filter. #24542
* Dev - Add support for post type count to system status report. #24536
* Dev - Check for max discount to be -ve to prevent overwriting refunded fee amount. #24341
* Dev: Add filter woocommerce_european_union_countries to the method WC_Countries::get_european_union_countries(). #24741
* Dev - Allow WC_Product_Query sort products by include order. #24294
* Dev - Removed duplicated include of WC_Admin_Importers. #24751
* Dev - Refactor minimum requirement notice to use constant for easier changes in the future. #24830
* Fix - Clean products transients when term is removed. #23991
* Fix - Only add the image node to structured data if product has image. #24191
* Fix - Product attribute terms endpoint in legacy REST API v3 by converting `attribute_id` to int. #24203
* Fix - Prevent duplicate processing/stock reduction when IPN or PDT notifications are enabled by checking if order is not already in `processing` or `completed` status. #24249
* Fix - Position of ID section in mobile rows actions when displaying the list of products in the admin. #24277
* Fix - Endpoints URLs to follow slashes preferences from WordPress permalinks. #24283
* Fix - Ensure that postcode validation doesn't return any whitespace on beginning and end of a postcode. #24284
* Fix - Shipping classes sort under products alphabetically. #24291
* Fix - Shipping rates layout in admin settings. #24327
* Fix - Retain the focus on the select box when product variation is changed. #24339
* Fix - Prevent PHP notice in WC_Order_Item_Data_Store::get_order_item_type() when there is no entry in the database for the order item ID passed. #24353
* Fix - Add translation in class-wc-shipping.php for matching zone message. #24366
* Fix - Previewing email template. #24380
* Fix - Check if order exist before generate hash for downloads. #24384
* Fix - Ensure WC_Product_Data_Store_CPT::is_existing_sku() return boolean. #24385
* Fix - `function_exists` check for wc_hex_is_light(). #24391
* Fix - Removed Emoji from default additional email content due problem on some database that doesn't allow Emojis. #24450
* Fix - Fixed escaping on an attribute in `class-wc-admin-menus.php`. #24466
* Fix - Add translation for image alt attribute text in multiple places. #24467, #24468, #24469
* Fix - Uneven padding in the input field with class "location-input" in on boarding wizard. #24476
* Fix - Duplicate id in pages settings. #24478
* Fix - Use `esc_attr_e` instead of `esc_html_e` for escaping an attribute in multiple places. #24481, #24520, #24521, #24522, #24523, #24524
* Fix - Use `esc_attr__` instead of `esc_html__` in escaping attributes string. #24525, #24529
* Fix - Typo fix in payment captured error message. #24501
* Fix - Documentation URL in failed order email content. #24535
* Fix - "Add to cart" links in feed. #24545
* Fix - Escaping in Storefront banner. #24546
* Fix - Use `wp_kses_post` to allow certain html tags in extensions page. #24589
* Fix - Escape `$prefix` in item download links. #24601
* Fix - Use `esc_attr` instead of `esc_html` in multiple places for proper escaping. #24613, #24614
* Fix - Use `esc_html` instead of `esc_attr` in multiple places for proper escaping. #24616
* Fix - Use `esc_html_e` instead of `_e` in multiple places for proper escaping. #24615, #24618, #24630
* Fix - Use `esc_html__` instead of `esc_html` for proper escaping and some typo fixes. #24639
* Fix - Add no-store and remove max-age header (no longer needed). #24652
* Fix - Use correct meta value for `downloadable` column in product lookup table regenerate function. #24681
* Fix - Admin sub-menus becoming unaligned when scrolling down in the orders page when there are no orders. #24688
* Fix - OWB country and sell in person alignment. #24700
* Fix - Domain replacement script now replaces both double and single quoted `woo-gutenberg-products-block` with `woocommerce` in both PHP and JavaScript files. #24696
* Fix - Convert `current_user_id` to string in some places to prevent unnecessary session database updates. #24016
* Fix - Fixed description of failed order emails. #24737
* Fix - Fixed Photoswipe styles. #24296
* Fix - Also consider refunded item when updating order and adjusting stocks. #24745
* Fix - Handle 0 attribute value for variations correctly. #24750
* Fix - Fixed spaces in form fields of External Products. #24295
* Fix - Removed links to downloadable products from refund emails. #24952
* Localization - Add Zambia's Provinces to the list of states. #24307
* Localization - Adaptation of the order of last name and first name and addresses in Japan. #24336
* Localization - Fixed Namibian dollar symbol. #24438
* Localization - Change localization tag `action-scheduler` to `woocommerce`. #24474
* Localization - Fixed missing US Minor Outlying Islands states. #24826
* Security - Add an exit after the redirect when checking author archive capabilities for customers.
* Security - Ensure 404 pages with single product urls cannot be exploited using Open Redirect.
= 3.7.1 - 2019-10-09
* Security - Add an exit after the redirect when checking author archive capabilities for customers.
* Security - Ensure 404 pages with single product urls cannot be exploited using Open Redirect.
= 3.7.0 - 2019-08-12 =
* Enhancement - Added table ENGINE to system status report for debugging purposes. #23101
* Enhancement - Format empty cart message as information notice. #23152
* Enhancement - Add taxonomy-specific classes to active filters widget. #23122
* Enhancement - Allow emails `Thanks` wording to be modified via the email settings. #22927
* Enhancement - Move tax classes from WordPress Options to a new `wc_tax_rate_classes` table. #23093
* Enhancement - Make WooCommerce shop roles translatable. #23150
* Enhancement - Prevent the Cart, Checkout and My Account pages from being set to the same pages. #23479
* Enhancement - New coupon code generate button on the coupon page. #24069
* Enhancement - Add `tag_operator` paramater to the `[products]` shortcode for use with the `tag` paramater ie. `[products tag='tag1,tag2' tag_operator='AND']`. #24111
* Tweak - When cleaning up variations due to product type change, force delete them instead of trashing. #23478
* Tweak - Change wording on the link to change the address so reflect if an address is already present or not. #23532
* Tweak - If variations are missing prices, show a notice in the product data panel. #23133
* Tweak - Use `determine_locale()` to properly load custom translation files. #23785
* Tweak - OBW: Switch shipping labels and shipping zones placement. #23781
* Tweak - Show the quantity refunded on customer facing order screens. #23038
* Tweak - CSV product import now allows true/false values for the published field, as well as the original 0 (private), -1 (draft), 1 (publish) values. #23207
* Tweak - Update product attribute sorting tooltip to clarify usage. #23222
* Tweak - Store tax rate percentage in the tax line items on orders. #23268
* Tweak - Remove the left and right margin from the logo in emails. #23360
* Tweak - Use the high res version of the WP spinner in the coupon Block UI. #23364
* Tweak - Improve user registration validation messages. #23468
* Tweak - Auto generate a new username when a username is blacklisted by WordPress. #23672
* Tweak - Guest cart sessions now gets deleted when a user logs in, preventing duplicate cart sessions. #23687
* Tweak - Include the store's base postcode and city when calculating order taxes. #23695
* Tweak - Update the generate username setting description label to reflect how the username is actually generated. #23911
* Tweak - OBW: Adjust plugin highlight container sizes to avoid overlap. #23997
* Tweak - Round tax amounts late when the round at subtotal level setting is enabled to reduce rounding errors. #24024
* Tweak - OBW: Now includes WooCommerce Admin as a recommended plugin. #24058
* Template - Review and update all template files escaping. #23460
* Template - Remove mention of shipping section from the checkout/form-login.php template as shipping is not always a requirement for an order. #23941
* Template - Add new filter `woocommerce_before_thankyou` to the checkout/thankyou.php template. #23538
* Template - Add new `woocommerce_widget_shopping_cart_total` hook to replace hardcoded subtotal in cart/mini-cart.php template. #24145
* Template - Add new `woocommerce_widget_shopping_cart_after_buttons` hook in cart/mini-cart.php template. #24145
* Template - Add new `woocommerce_before_cart_collaterals` hook in cart/cart.php template. #24145
* Template - Correct the plural forms usage in loop/result-count.php template. #24005
* Dev - Introduce new PHP 5.6 minimum requirement. #23924
* Dev - Introduce new WordPress 4.9 minimum requirement. #24156
* Dev - Move the settings save functionality from the `settings_page_init` function to the `wp_loaded` action so it is not saved after the settings page renders. #23091
* Dev - Add quantity input action hooks `woocommerce_before_add_to_cart_quantity` and `woocommerce_after_add_to_cart_quantity`. #23166
* Dev - Add `$this` parameter to email class filters. #23250
* Dev - Add new `WC_Abstract_Order::get_coupons()` method for returning all coupon line item objects on an order. #23663
* Dev - Added new action `woocommerce_product_read` to `WC_Product_Data_Store_CPT::read()`. #23181
* Dev - Add new filter `woocommerce_admin_order_buyer_name` to the `WC_Admin_List_Table_Orders::render_order_number_column()` method to change the buyer name in orders list screen. #23741
* Dev - Add new actions to `WC_Helper` class for when WooCommerce.com Product Subscription statuses change `woocommerce_helper_subscription_activate_success`, `woocommerce_helper_subscription_activate_error`, `woocommerce_helper_subscription_deactivate_success`, and `woocommerce_helper_subscription_deactivate_error`. #23041
* Dev - Extend usage and event tracking (if opted in) to system status, admin order and admin coupon pages. #23190 #23189 #23883
* Dev - Add `woocommerce_after_X_object_save` actions, and passed objects to `woocommerce_new_x` and `woocommerce_update_x` actions. #23338
* Dev - Update customer order and lifetime spend totals in `wc_update_new_customer_past_orders()` to trigger `customer.updated` webhooks for paid orders. #23402
* Dev - Preserve the State field's custom css classes when selecting an option from the Country dropdown. #23433
* Dev - Add new `woocommerce_product_related_posts_shuffle` filter in `wc_get_related_products()` to enable/disable related product shuffling, defaults to true. #23562
* Dev - Deprecate the `WC_Abstract_Order::get_used_coupons()` method and replace it with a new method `WC_Abstract_Order::get_coupon_codes()`. #23689
* Dev - Add new `woocommerce_prices_include_tax` filter in the `wc_prices_include_tax()` function. #23697
* Dev - Add new `woocommerce_admin_after_product_gallery_item` filter in the `WC_Meta_Box_Product_Images::output()` method for adding additional markup after product gallery items. #23743
* Dev - Remove unused images `assets/images/klarna-white.png` and `assets/images/square-white.png`. #23748
* Dev - Move Free Shipping method JavaScript code from outputting on all shipping setting pages to just the Free Shipping page using the `admin_footer` hook. #23776
* Dev - Prevent PHP fatal error while throwing exceptions in `woocommerce_rest_insert_{post_type}_object` hooks. #23793
* Dev - Add new `woocommerce_enforce_password_strength_meter_on_checkout` filter in the `WC_Frontend_Scripts::get_script_data()` method to allow enforcing the password strength meter on checkout. #23811
* Dev - Add new `woocommerce_search_products_post_statuses` filter in the `WC_Product_Data_Store_CPT::search_products()` method for controlling what post statuses to include in product searches. #23838
* Dev - Allow filtering `woocommerce_order_formatted_shipping_address` even when no shipping address is defined. #23859
* Dev - Change the query in the `WC_Product_Data_Store::find_matching_product_variation()` method to always respect the ordering of variations. #23881
* Dev - Move all feature plugin features out from the WooCommerce codebase and utilize composer and an autoloader for including it in WooCommerce core, affects WC REST API and WC Blocks. #23957
* Dev - Allow displaying multiple error messages through the registration validation. #23968
* Dev - Add new `woocommerce_cart_item_removed_notice_type`, `woocommerce_cart_updated_notice_type` and `woocommerce_add_to_cart_notice_type` filters for changing the default notice types for cart notices. #24021
* Dev - Add namespaced support for Jetpack 7.5 tracking library. #24140
* Dev - Add support for an improved WooCommerce.com Marketplace browse and purchase experience (in progress). #24075 #24123
* Dev - Added `$order` and `$product` as parameters to the `woocommerce_ajax_order_item` filter in `WC_Ajax::add_order_item()`. #24108
* Dev - Add new `woocommerce_product_import_image_separator` filter in `WC_Product_CSV_Importer::parse_images_field()` for adjusting the product images seperator. #24120
* Dev - Add new `woocommerce_widget_shopping_cart_subtotal()` template function that hooks into the `woocommerce_widget_shopping_cart_total` action to output the mini cart subtotal. #24145
* Dev - Deprecate the `woocommerce_before_cart_item_quantity_zero` action from `WC_Cart::restore_cart_item()` in favor of existing `woocommerce_cart_item_removed` action. #23112
* Dev - Deprecate WC_Tax::maybe_remove_tax_class_rates which hooked into the WP Options update hook for taxes in favor of new function WC_Tax::delete_tax_class_by which works on the new tax classes table. #24213
* Fix - Use version_compare for determining the maximum WooCommerce database version number. #23092
* Fix - Missing space and closing `<strong>` tag in WooCommerce.com disconnect message. #24073
* Fix - CSV Importer - Skip rows during update if a SKU column exists, but the value is empty. #23262
* Fix - Allow matching `Any` attributes when calling `WC_Product_Data_Store::find_matching_product_variation()`. #23067
* Fix - Switch coupon amount validation based on decimal seperator setting. #23137
* Fix - Show the correct results for shortcodes on static homepages when sorting. #23159
* Fix - Queue AJAX add to cart events to avoid overwriting session data. #23293
* Fix - Wrong subtotals when changing tax classes via the `woocommerce_product_get_tax_class` filter. #23344
* Fix - Fatal error on plain text order emails where products were deleted. #23754
* Fix - Do not pass the `no_shipping` argument to PayPal when the order contains shippable items. #23773
* Fix - Product review form does respects the `require_name_email` WordPress core option. #23786
* Fix - Do not cache expired sessions, negative expiry causes errors in some caching modules. #23863
* Fix - WC_Log_Handler_DB logs now uses the same timestamp format as text logs, Y-m-d H:i:s. #23863
* Fix - Display line breaks for customer notes in emails, and order details. #23969
* Fix - Correct plural forms usage in `WC_Admin_Report` class. #24020
* Fix - System status database info section throwing a PHP notice on some DB environments. #24023
* Fix - On the system status database info section display a message informing users that WooCommerce was unable to get database information instead of an error, when a database sharding plugin is active. #24034
* Fix - Usage and event tracking (if opted in) was not working correctly in the OBW. #24056
* Fix - Fatal error on downloads report when some download files were missing. #24118
* Fix - Prevents the taxes columns from being removed when the order is no longer editable in admin. #23884
* Performance - Improve the speed of the admin dashboard by only updating transients once per class. #23011
* Performance - Reduce number of queries needed to populate variations data by priming post caches. #23272
* Performance - Persistant cart improvements, only update the persistent cart if the cart items actually change. #23112
* Performance - Exclude `action_log` comment types from `wp_count_comments`. #24071
* Localization - Added validation for Italian postcodes. #23269
* Localization - Remove unused tax locale defaults since we now promote auto tax services instead. #23431
* Localization - Define correct address format for Uganda. #23178
* Localization - Hide the postcode and update the state label to "Province" for Mozambique. #23764
* Localization - OBW: Make postal code optional based on locale data. #23915
* Localization - Add new currency for São Tomé, Príncipe dobra and Mauritanian ouguiya. #23950
* Localization - Change Canada poscode label to `Postal code`. #23740
= 3.6.5 - 2019-07-02 = = 3.6.5 - 2019-07-02 =
* Security - Introduce file type check for tax rate importer. * Security - Introduce file type check for tax rate importer.
* Security - Added nonce check to CSV importer actions. * Security - Added nonce check to CSV importer actions.

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM wordpress:latest
COPY . /var/www/html/wp-content/plugins/woocommerce

View File

@ -4184,6 +4184,10 @@ img.help_tip {
padding: 2px; padding: 2px;
display: none; display: none;
@media (max-width: 768px) {
display: block;
}
li { li {
float: right; float: right;
margin: 0 0 0 2px; margin: 0 0 0 2px;

View File

@ -360,9 +360,12 @@ jQuery( function( $ ) {
// Always update the fragments // Always update the fragments
if ( data && data.fragments ) { if ( data && data.fragments ) {
$.each( data.fragments, function ( key, value ) { $.each( data.fragments, function ( key, value ) {
$( key ).replaceWith( value ); if ( ! wc_checkout_form.fragments || wc_checkout_form.fragments[ key ] !== value ) {
$( key ).replaceWith( value );
}
$( key ).unblock(); $( key ).unblock();
} ); } );
wc_checkout_form.fragments = data.fragments;
} }
// Recheck the terms and conditions box, if needed // Recheck the terms and conditions box, if needed

View File

@ -10,12 +10,12 @@
"automattic/jetpack-autoloader": "^1.2.0", "automattic/jetpack-autoloader": "^1.2.0",
"php": ">=5.6|>=7.0", "php": ">=5.6|>=7.0",
"composer/installers": "1.7.0", "composer/installers": "1.7.0",
"woocommerce/woocommerce-blocks": "2.4.3", "woocommerce/woocommerce-blocks": "2.4.5",
"woocommerce/woocommerce-rest-api": "1.0.3" "woocommerce/woocommerce-rest-api": "1.0.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "7.5.16", "phpunit/phpunit": "7.5.17",
"woocommerce/woocommerce-sniffs": "0.0.8" "woocommerce/woocommerce-sniffs": "0.0.9"
}, },
"config": { "config": {
"platform": { "platform": {

88
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c955d86ce8d65e6fb1e0e97282642d7b", "content-hash": "a5cb448a1d94f10a40207b6f0dfa1c50",
"packages": [ "packages": [
{ {
"name": "automattic/jetpack-autoloader", "name": "automattic/jetpack-autoloader",
@ -166,16 +166,16 @@
}, },
{ {
"name": "woocommerce/woocommerce-blocks", "name": "woocommerce/woocommerce-blocks",
"version": "v2.4.3", "version": "v2.4.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git", "url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "9a4b30a18f055ed83d819959cbc1386111f401a5" "reference": "130bc40824f844c0870c94c0ad0aa7a6abb74f6f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/9a4b30a18f055ed83d819959cbc1386111f401a5", "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/130bc40824f844c0870c94c0ad0aa7a6abb74f6f",
"reference": "9a4b30a18f055ed83d819959cbc1386111f401a5", "reference": "130bc40824f844c0870c94c0ad0aa7a6abb74f6f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -209,7 +209,7 @@
"gutenberg", "gutenberg",
"woocommerce" "woocommerce"
], ],
"time": "2019-10-14T13:20:09+00:00" "time": "2019-11-02T13:48:18+00:00"
}, },
{ {
"name": "woocommerce/woocommerce-rest-api", "name": "woocommerce/woocommerce-rest-api",
@ -527,16 +527,16 @@
}, },
{ {
"name": "phpcompatibility/php-compatibility", "name": "phpcompatibility/php-compatibility",
"version": "9.3.1", "version": "9.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196" "reference": "1f37659196e4f3113ea506a7efba201c52303bf1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9999344e47e7af6b00e1a898eacc4e4368fb7196", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1",
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196", "reference": "1f37659196e4f3113ea506a7efba201c52303bf1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -581,20 +581,20 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2019-09-05T18:36:49+00:00" "time": "2019-11-15T04:12:02+00:00"
}, },
{ {
"name": "phpcompatibility/phpcompatibility-paragonie", "name": "phpcompatibility/phpcompatibility-paragonie",
"version": "1.1.0", "version": "1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
"reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936" "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c",
"reference": "b1bb79a7cab1fb856b56f1b5cf110b6e52d8e936", "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -633,7 +633,7 @@
"polyfill", "polyfill",
"standards" "standards"
], ],
"time": "2019-08-28T15:58:19+00:00" "time": "2019-11-04T15:17:54+00:00"
}, },
{ {
"name": "phpcompatibility/phpcompatibility-wp", "name": "phpcompatibility/phpcompatibility-wp",
@ -837,22 +837,22 @@
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
"version": "1.8.1", "version": "1.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0" "sebastian/recursion-context": "^1.0|^2.0|^3.0"
}, },
@ -896,7 +896,7 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2019-06-13T12:50:23+00:00" "time": "2019-10-03T11:07:50+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@ -1152,16 +1152,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "7.5.16", "version": "7.5.17",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a",
"reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1232,7 +1232,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-09-14T09:08:39+00:00" "time": "2019-10-28T10:37:36+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -1802,16 +1802,16 @@
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "3.5.0", "version": "3.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "0afebf16a2e7f1e434920fa976253576151effe9" "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/0afebf16a2e7f1e434920fa976253576151effe9", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7",
"reference": "0afebf16a2e7f1e434920fa976253576151effe9", "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1849,7 +1849,7 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2019-09-26T23:12:26+00:00" "time": "2019-10-28T04:36:32+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@ -2001,23 +2001,23 @@
}, },
{ {
"name": "woocommerce/woocommerce-sniffs", "name": "woocommerce/woocommerce-sniffs",
"version": "0.0.8", "version": "0.0.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/woocommerce/woocommerce-sniffs.git", "url": "https://github.com/woocommerce/woocommerce-sniffs.git",
"reference": "ccdae93ba678d59cd9741bec077d0c63c0a82958" "reference": "7677a84e9a355fe1e088f704090be891e7a6d427"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/ccdae93ba678d59cd9741bec077d0c63c0a82958", "url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/7677a84e9a355fe1e088f704090be891e7a6d427",
"reference": "ccdae93ba678d59cd9741bec077d0c63c0a82958", "reference": "7677a84e9a355fe1e088f704090be891e7a6d427",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"dealerdirect/phpcodesniffer-composer-installer": "0.5.0", "dealerdirect/phpcodesniffer-composer-installer": "0.5.0",
"php": ">=7.0", "php": ">=7.0",
"phpcompatibility/phpcompatibility-wp": "2.1.0", "phpcompatibility/phpcompatibility-wp": "2.1.0",
"wp-coding-standards/wpcs": "2.1.1" "wp-coding-standards/wpcs": "2.2.0"
}, },
"type": "phpcodesniffer-standard", "type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -2037,20 +2037,20 @@
"woocommerce", "woocommerce",
"wordpress" "wordpress"
], ],
"time": "2019-10-16T18:25:21+00:00" "time": "2019-11-11T15:48:34+00:00"
}, },
{ {
"name": "wp-coding-standards/wpcs", "name": "wp-coding-standards/wpcs",
"version": "2.1.1", "version": "2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
"reference": "bd9c33152115e6741e3510ff7189605b35167908" "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908", "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f90e8692ce97b693633db7ab20bfa78d930f536a",
"reference": "bd9c33152115e6741e3510ff7189605b35167908", "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2073,7 +2073,7 @@
"authors": [ "authors": [
{ {
"name": "Contributors", "name": "Contributors",
"homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
} }
], ],
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
@ -2082,7 +2082,7 @@
"standards", "standards",
"wordpress" "wordpress"
], ],
"time": "2019-05-21T02:50:00+00:00" "time": "2019-11-11T12:34:03+00:00"
} }
], ],
"aliases": [], "aliases": [],

53
docker-compose.yaml Normal file
View File

@ -0,0 +1,53 @@
version: '3.7'
services:
db:
image: mariadb:10.4
restart: on-failure
environment:
MYSQL_DATABASE: testdb
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- db:/var/lib/mysql
wordpress-woocomerce-dev:
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
ports:
- 8084:80
restart: on-failure
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: testdb
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_TABLE_PREFIX: "wp_"
WORDPRESS_DEBUG: 1
volumes:
- wordpress:/var/www/html
wordpress-cli:
depends_on:
- db
- wordpress-woocomerce-dev
image: wordpress:cli
restart: on-failure
user: xfs
command: >
/bin/sh -c '
wp core install --url=http://localhost:8084 --title="WooCommerce Core E2E Test Suite" --admin_user=admin --admin_password=password --admin_email=admin@woocommercecoree2etestsuite.com --path=/var/www/html --skip-email;
wp plugin activate woocommerce;
wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html;
'
volumes:
- wordpress:/var/www/html
volumes:
db:
wordpress:

View File

@ -599,7 +599,7 @@ class WC_Admin_Setup_Wizard {
</article> </article>
<footer> <footer>
<div class="inner"> <div class="inner">
<button class="button button-primary button-large" id="wc_tracker_submit" aria-label="<?php esc_attr_e( 'Continue', 'woocommerce' ); ?>"><?php esc_html_e( 'Continue', 'woocommerce' ); ?></a> <button class="button button-primary button-large" id="wc_tracker_submit" aria-label="<?php esc_attr_e( 'Continue', 'woocommerce' ); ?>"><?php esc_html_e( 'Continue', 'woocommerce' ); ?></button>
</div> </div>
</footer> </footer>
</section> </section>

View File

@ -1592,7 +1592,7 @@ class WC_Helper {
/** /**
* Flush subscriptions cache. * Flush subscriptions cache.
*/ */
private static function _flush_subscriptions_cache() { public static function _flush_subscriptions_cache() {
delete_transient( '_woocommerce_helper_subscriptions' ); delete_transient( '_woocommerce_helper_subscriptions' );
} }

View File

@ -18,6 +18,7 @@ if ( ! $tab_exists ) {
} }
?> ?>
<div class="wrap woocommerce"> <div class="wrap woocommerce">
<?php do_action( 'woocommerce_before_settings_' . $current_tab ); ?>
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data"> <form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper"> <nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php <?php
@ -46,4 +47,5 @@ if ( ! $tab_exists ) {
<?php wp_nonce_field( 'woocommerce-settings' ); ?> <?php wp_nonce_field( 'woocommerce-settings' ); ?>
</p> </p>
</form> </form>
<?php do_action( 'woocommerce_after_settings_' . $current_tab ); ?>
</div> </div>

View File

@ -637,7 +637,7 @@ class WC_Cart extends WC_Legacy_Cart {
*/ */
public function empty_cart( $clear_persistent_cart = true ) { public function empty_cart( $clear_persistent_cart = true ) {
do_action( 'woocommerce_before_cart_emptied' ); do_action( 'woocommerce_before_cart_emptied', $clear_persistent_cart );
$this->cart_contents = array(); $this->cart_contents = array();
$this->removed_cart_contents = array(); $this->removed_cart_contents = array();
@ -653,7 +653,7 @@ class WC_Cart extends WC_Legacy_Cart {
$this->fees_api->remove_all_fees(); $this->fees_api->remove_all_fees();
do_action( 'woocommerce_cart_emptied' ); do_action( 'woocommerce_cart_emptied', $clear_persistent_cart );
} }
/** /**

View File

@ -366,6 +366,17 @@ class WC_Countries {
return apply_filters( 'woocommerce_european_union_countries', $countries, $type ); return apply_filters( 'woocommerce_european_union_countries', $countries, $type );
} }
/**
* Gets an array of Non-EU countries that use VAT as the Local name for their taxes based on this list - https://en.wikipedia.org/wiki/Value-added_tax#Non-European_Union_countries
*
* @return string[]
*/
public function countries_using_vat() {
$countries = array( 'AL', 'AR', 'AZ', 'BS', 'BH', 'BY', 'BB', 'BO', 'EG', 'ET', 'CL', 'CO', 'EC', 'SV', 'FJ', 'GM', 'GH', 'GT', 'IN', 'IR', 'IL', 'KZ', 'MU', 'MK', 'MX', 'MD', 'MN', 'ME', 'NA', 'NP', 'NG', 'PS', 'PY', 'RU', 'RW', 'KN', 'SA', 'RS', 'ZA', 'KR', 'LK', 'TH', 'TR', 'UA', 'UY', 'UZ', 'VE', 'VN', 'AE' );
return apply_filters( 'woocommerce_countries_using_vat', $countries );
}
/** /**
* Gets the correct string for shipping - either 'to the' or 'to'. * Gets the correct string for shipping - either 'to the' or 'to'.
* *
@ -400,7 +411,7 @@ class WC_Countries {
* @return string * @return string
*/ */
public function tax_or_vat() { public function tax_or_vat() {
$return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ) ), true ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' ); $return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ), $this->countries_using_vat() ), true ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' );
return apply_filters( 'woocommerce_countries_tax_or_vat', $return ); return apply_filters( 'woocommerce_countries_tax_or_vat', $return );
} }
@ -411,7 +422,7 @@ class WC_Countries {
* @return string * @return string
*/ */
public function inc_tax_or_vat() { public function inc_tax_or_vat() {
$return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ) ), true ) ? __( '(incl. VAT)', 'woocommerce' ) : __( '(incl. tax)', 'woocommerce' ); $return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ), $this->countries_using_vat() ), true ) ? __( '(incl. VAT)', 'woocommerce' ) : __( '(incl. tax)', 'woocommerce' );
return apply_filters( 'woocommerce_countries_inc_tax_or_vat', $return ); return apply_filters( 'woocommerce_countries_inc_tax_or_vat', $return );
} }
@ -422,7 +433,7 @@ class WC_Countries {
* @return string * @return string
*/ */
public function ex_tax_or_vat() { public function ex_tax_or_vat() {
$return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ) ), true ) ? __( '(ex. VAT)', 'woocommerce' ) : __( '(ex. tax)', 'woocommerce' ); $return = in_array( $this->get_base_country(), array_merge( $this->get_european_union_countries( 'eu_vat' ), array( 'NO' ), $this->countries_using_vat() ), true ) ? __( '(ex. VAT)', 'woocommerce' ) : __( '(ex. tax)', 'woocommerce' );
return apply_filters( 'woocommerce_countries_ex_tax_or_vat', $return ); return apply_filters( 'woocommerce_countries_ex_tax_or_vat', $return );
} }

View File

@ -428,7 +428,7 @@ class WC_Emails {
* @param string $email Email address. * @param string $email Email address.
*/ */
public function order_downloads( $order, $sent_to_admin = false, $plain_text = false, $email = '' ) { public function order_downloads( $order, $sent_to_admin = false, $plain_text = false, $email = '' ) {
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted() && ! $sent_to_admin; $show_downloads = $order->has_downloadable_item() && $order->is_download_permitted() && ! $sent_to_admin && ! is_a( $email, 'WC_Email_Customer_Refunded_Order' );
if ( ! $show_downloads ) { if ( ! $show_downloads ) {
return; return;

View File

@ -247,7 +247,7 @@ class WC_Frontend_Scripts {
), ),
'wc-country-select' => array( 'wc-country-select' => array(
'src' => self::get_asset_url( 'assets/js/frontend/country-select' . $suffix . '.js' ), 'src' => self::get_asset_url( 'assets/js/frontend/country-select' . $suffix . '.js' ),
'deps' => array( 'jquery', 'selectWoo' ), 'deps' => array( 'jquery' ),
'version' => WC_VERSION, 'version' => WC_VERSION,
), ),
'wc-credit-card-form' => array( 'wc-credit-card-form' => array(

View File

@ -366,15 +366,18 @@ class WC_Order extends WC_Abstract_Order {
/* translators: 1: old order status 2: new order status */ /* translators: 1: old order status 2: new order status */
$transition_note = sprintf( __( 'Order status changed from %1$s to %2$s.', 'woocommerce' ), wc_get_order_status_name( $status_transition['from'] ), wc_get_order_status_name( $status_transition['to'] ) ); $transition_note = sprintf( __( 'Order status changed from %1$s to %2$s.', 'woocommerce' ), wc_get_order_status_name( $status_transition['from'] ), wc_get_order_status_name( $status_transition['to'] ) );
// Note the transition occurred.
$this->add_status_transition_note( $transition_note, $status_transition );
do_action( 'woocommerce_order_status_' . $status_transition['from'] . '_to_' . $status_transition['to'], $this->get_id(), $this ); do_action( 'woocommerce_order_status_' . $status_transition['from'] . '_to_' . $status_transition['to'], $this->get_id(), $this );
do_action( 'woocommerce_order_status_changed', $this->get_id(), $status_transition['from'], $status_transition['to'], $this ); do_action( 'woocommerce_order_status_changed', $this->get_id(), $status_transition['from'], $status_transition['to'], $this );
} else { } else {
/* translators: %s: new order status */ /* translators: %s: new order status */
$transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $status_transition['to'] ) ); $transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $status_transition['to'] ) );
}
// Note the transition occurred. // Note the transition occurred.
$this->add_order_note( trim( $status_transition['note'] . ' ' . $transition_note ), 0, $status_transition['manual'] ); $this->add_status_transition_note( $transition_note, $status_transition );
}
} catch ( Exception $e ) { } catch ( Exception $e ) {
$logger = wc_get_logger(); $logger = wc_get_logger();
$logger->error( $logger->error(
@ -883,10 +886,11 @@ class WC_Order extends WC_Abstract_Order {
* Filter orders formatterd billing address. * Filter orders formatterd billing address.
* *
* @since 3.8.0 * @since 3.8.0
* @param string $address Formatted billing address string. * @param string $address Formatted billing address string.
* @param array $raw_address Raw billing address. * @param array $raw_address Raw billing address.
* @param WC_Order $order Order data. @since 3.9.0
*/ */
return apply_filters( 'woocommerce_order_get_formatted_billing_address', $address ? $address : $empty_content, $raw_address ); return apply_filters( 'woocommerce_order_get_formatted_billing_address', $address ? $address : $empty_content, $raw_address, $this );
} }
/** /**
@ -908,10 +912,11 @@ class WC_Order extends WC_Abstract_Order {
* Filter orders formatterd shipping address. * Filter orders formatterd shipping address.
* *
* @since 3.8.0 * @since 3.8.0
* @param string $address Formatted shipping address string. * @param string $address Formatted billing address string.
* @param array $raw_address Raw shipping address. * @param array $raw_address Raw billing address.
* @param WC_Order $order Order data. @since 3.9.0
*/ */
return apply_filters( 'woocommerce_order_get_formatted_shipping_address', $address ? $address : $empty_content, $raw_address ); return apply_filters( 'woocommerce_order_get_formatted_shipping_address', $address ? $address : $empty_content, $raw_address, $this );
} }
/** /**
@ -1705,6 +1710,19 @@ class WC_Order extends WC_Abstract_Order {
return $comment_id; return $comment_id;
} }
/**
* Add an order note for status transition
*
* @since 3.9.0
* @uses WC_Order::add_order_note()
* @param string $note Note to be added giving status transition from and to details.
* @param bool $transition Details of the status transition.
* @return int Comment ID.
*/
private function add_status_transition_note( $note, $transition ) {
return $this->add_order_note( trim( $transition['note'] . ' ' . $note ), 0, $transition['manual'] );
}
/** /**
* List order notes (public) for the customer. * List order notes (public) for the customer.
* *

View File

@ -8,9 +8,7 @@
* @version 3.1.0 * @version 3.1.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { defined( 'ABSPATH' ) || exit;
exit;
}
/** /**
* Include dependencies. * Include dependencies.

View File

@ -72,6 +72,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
add_action( 'woocommerce_order_status_processing', array( $this, 'capture_payment' ) ); add_action( 'woocommerce_order_status_processing', array( $this, 'capture_payment' ) );
add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) ); add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) );
add_filter( 'woocommerce_thankyou_order_received_text', array( $this, 'order_received_text' ), 10, 2 );
if ( ! $this->is_valid_for_use() ) { if ( ! $this->is_valid_for_use() ) {
$this->enabled = 'no'; $this->enabled = 'no';
@ -380,17 +381,17 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$this->log( 'Refund Result: ' . wc_print_r( $result, true ) ); $this->log( 'Refund Result: ' . wc_print_r( $result, true ) );
switch ( strtolower( $result->ACK ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar switch ( strtolower( $result->ACK ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
case 'success': case 'success':
case 'successwithwarning': case 'successwithwarning':
$order->add_order_note( $order->add_order_note(
/* translators: 1: Refund amount, 2: Refund ID */ /* translators: 1: Refund amount, 2: Refund ID */
sprintf( __( 'Refunded %1$s - Refund ID: %2$s', 'woocommerce' ), $result->GROSSREFUNDAMT, $result->REFUNDTRANSACTIONID ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar sprintf( __( 'Refunded %1$s - Refund ID: %2$s', 'woocommerce' ), $result->GROSSREFUNDAMT, $result->REFUNDTRANSACTIONID ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
); );
return true; return true;
} }
return isset( $result->L_LONGMESSAGE0 ) ? new WP_Error( 'error', $result->L_LONGMESSAGE0 ) : false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar return isset( $result->L_LONGMESSAGE0 ) ? new WP_Error( 'error', $result->L_LONGMESSAGE0 ) : false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
} }
/** /**
@ -414,7 +415,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$this->log( 'Capture Result: ' . wc_print_r( $result, true ) ); $this->log( 'Capture Result: ' . wc_print_r( $result, true ) );
// phpcs:disable WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
if ( ! empty( $result->PAYMENTSTATUS ) ) { if ( ! empty( $result->PAYMENTSTATUS ) ) {
switch ( $result->PAYMENTSTATUS ) { switch ( $result->PAYMENTSTATUS ) {
case 'Completed': case 'Completed':
@ -450,4 +451,20 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
wp_enqueue_script( 'woocommerce_paypal_admin', WC()->plugin_url() . '/includes/gateways/paypal/assets/js/paypal-admin' . $suffix . '.js', array(), WC_VERSION, true ); wp_enqueue_script( 'woocommerce_paypal_admin', WC()->plugin_url() . '/includes/gateways/paypal/assets/js/paypal-admin' . $suffix . '.js', array(), WC_VERSION, true );
} }
/**
* Custom PayPal order received text.
*
* @since 3.9.0
* @param string $text Default text.
* @param WC_Order $order Order data.
* @return string
*/
public function order_received_text( $text, $order ) {
if ( $this->id === $order->get_payment_method() ) {
return esc_html__( 'Thank you for your payment. Your transaction has been completed, and a receipt for your purchase has been emailed to you. Log into your PayPal account to view transaction details.', 'woocommerce' );
}
return $text;
}
} }

View File

@ -420,7 +420,7 @@ abstract class WP_Background_Process extends WP_Async_Request {
// Adds every 5 minutes to the existing schedules. // Adds every 5 minutes to the existing schedules.
$schedules[ $this->identifier . '_cron_interval' ] = array( $schedules[ $this->identifier . '_cron_interval' ] = array(
'interval' => MINUTE_IN_SECONDS * $interval, 'interval' => MINUTE_IN_SECONDS * $interval,
'display' => sprintf( __( 'Every %d Minutes' ), $interval ), 'display' => sprintf( __( 'Every %d minutes', 'woocommerce' ), $interval ),
); );
return $schedules; return $schedules;

View File

@ -43,6 +43,11 @@ class WC_Tracks_Client {
* @return void * @return void
*/ */
public static function maybe_set_identity_cookie() { public static function maybe_set_identity_cookie() {
// Do not set on AJAX requests.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
}
// Bail if cookie already set. // Bail if cookie already set.
if ( isset( $_COOKIE['tk_ai'] ) ) { if ( isset( $_COOKIE['tk_ai'] ) ) {
return; return;

View File

@ -27,9 +27,9 @@ class WC_Orders_Tracking {
* Send a Tracks event when the Orders page is viewed. * Send a Tracks event when the Orders page is viewed.
*/ */
public function track_orders_view() { public function track_orders_view() {
if ( isset( $_GET['post_type'] ) && 'shop_order' === wp_unslash( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized if ( isset( $_GET['post_type'] ) && 'shop_order' === wp_unslash( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification, WordPress.Security.ValidatedSanitizedInput // phpcs:disable WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput
$properties = array( $properties = array(
'status' => isset( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : 'all', 'status' => isset( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : 'all',
); );
@ -77,8 +77,8 @@ class WC_Orders_Tracking {
} }
$order = wc_get_order( $id ); $order = wc_get_order( $id );
$date_created = $order->get_date_created()->date( 'Y-m-d H:i:s' ); $date_created = $order->get_date_created() ? $order->get_date_created()->date( 'Y-m-d H:i:s' ) : '';
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification // phpcs:disable WordPress.Security.NonceVerification
$new_date = sprintf( $new_date = sprintf(
'%s %2d:%2d:%2d', '%s %2d:%2d:%2d',
isset( $_POST['order_date'] ) ? wc_clean( wp_unslash( $_POST['order_date'] ) ) : '', isset( $_POST['order_date'] ) ? wc_clean( wp_unslash( $_POST['order_date'] ) ) : '',
@ -104,7 +104,7 @@ class WC_Orders_Tracking {
* @param int $order_id Order ID. * @param int $order_id Order ID.
*/ */
public function track_order_action( $order_id ) { public function track_order_action( $order_id ) {
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification // phpcs:disable WordPress.Security.NonceVerification
if ( ! empty( $_POST['wc_order_action'] ) ) { if ( ! empty( $_POST['wc_order_action'] ) ) {
$order = wc_get_order( $order_id ); $order = wc_get_order( $order_id );
$action = wc_clean( wp_unslash( $_POST['wc_order_action'] ) ); $action = wc_clean( wp_unslash( $_POST['wc_order_action'] ) );
@ -123,7 +123,7 @@ class WC_Orders_Tracking {
* Track "add order" button on the Edit Order screen. * Track "add order" button on the Edit Order screen.
*/ */
public function track_add_order_from_edit() { public function track_add_order_from_edit() {
// phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized // phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
if ( isset( $_GET['post_type'] ) && 'shop_order' === wp_unslash( $_GET['post_type'] ) ) { if ( isset( $_GET['post_type'] ) && 'shop_order' === wp_unslash( $_GET['post_type'] ) ) {
$referer = wp_get_referer(); $referer = wp_get_referer();

View File

@ -151,6 +151,8 @@ function wc_get_account_menu_item_classes( $endpoint ) {
$current = true; // Dashboard is not an endpoint, so needs a custom check. $current = true; // Dashboard is not an endpoint, so needs a custom check.
} elseif ( 'orders' === $endpoint && isset( $wp->query_vars['view-order'] ) ) { } elseif ( 'orders' === $endpoint && isset( $wp->query_vars['view-order'] ) ) {
$current = true; // When looking at individual order, highlight Orders list item (to signify where in the menu the user currently is). $current = true; // When looking at individual order, highlight Orders list item (to signify where in the menu the user currently is).
} elseif ( 'payment-methods' === $endpoint && isset( $wp->query_vars['add-payment-method'] ) ) {
$current = true;
} }
if ( $current ) { if ( $current ) {

View File

@ -1140,7 +1140,7 @@ function wc_get_customer_default_location() {
$allowed_country_codes = WC()->countries->get_allowed_countries(); $allowed_country_codes = WC()->countries->get_allowed_countries();
if ( ! empty( $location['country'] ) && ! array_key_exists( $location['country'], $allowed_country_codes ) ) { if ( ! empty( $location['country'] ) && ! array_key_exists( $location['country'], $allowed_country_codes ) ) {
$location['country'] = current( $allowed_country_codes ); $location['country'] = current( array_keys( $allowed_country_codes ) );
$location['state'] = ''; $location['state'] = '';
} }

View File

@ -1948,6 +1948,7 @@ if ( ! function_exists( 'woocommerce_upsell_display' ) ) {
array( array(
'posts_per_page' => $limit, 'posts_per_page' => $limit,
'orderby' => $orderby, 'orderby' => $orderby,
'order' => $order,
'columns' => $columns, 'columns' => $columns,
) )
); );
@ -1955,6 +1956,7 @@ if ( ! function_exists( 'woocommerce_upsell_display' ) ) {
wc_set_loop_prop( 'columns', apply_filters( 'woocommerce_upsells_columns', isset( $args['columns'] ) ? $args['columns'] : $columns ) ); wc_set_loop_prop( 'columns', apply_filters( 'woocommerce_upsells_columns', isset( $args['columns'] ) ? $args['columns'] : $columns ) );
$orderby = apply_filters( 'woocommerce_upsells_orderby', isset( $args['orderby'] ) ? $args['orderby'] : $orderby ); $orderby = apply_filters( 'woocommerce_upsells_orderby', isset( $args['orderby'] ) ? $args['orderby'] : $orderby );
$order = apply_filters( 'woocommerce_upsells_order', isset( $args['order'] ) ? $args['order'] : $order );
$limit = apply_filters( 'woocommerce_upsells_total', isset( $args['posts_per_page'] ) ? $args['posts_per_page'] : $limit ); $limit = apply_filters( 'woocommerce_upsells_total', isset( $args['posts_per_page'] ) ? $args['posts_per_page'] : $limit );
// Get visible upsells then sort them at random, then limit result set. // Get visible upsells then sort them at random, then limit result set.

View File

@ -123,6 +123,10 @@ class WC_WCCOM_Site_Installer {
'products' => $products, 'products' => $products,
); );
// Clear the cache of customer's subscription before asking for them.
// Thus, they will be re-fetched from WooCommerce.com after a purchase.
WC_Helper::_flush_subscriptions_cache();
WC()->queue()->cancel_all( 'woocommerce_wccom_install_products', $args ); WC()->queue()->cancel_all( 'woocommerce_wccom_install_products', $args );
WC()->queue()->add( 'woocommerce_wccom_install_products', $args ); WC()->queue()->add( 'woocommerce_wccom_install_products', $args );
@ -257,7 +261,7 @@ class WC_WCCOM_Site_Installer {
* *
* @since 3.7.0 * @since 3.7.0
* @param int $product_id Product ID. * @param int $product_id Product ID.
* @return bool|\WP_Error * @return array|\WP_Error
*/ */
private static function get_product_info( $product_id ) { private static function get_product_info( $product_id ) {
$product_info = array( $product_info = array(

713
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,17 +25,16 @@
"@babel/preset-env": "^7.5.5", "@babel/preset-env": "^7.5.5",
"@babel/register": "^7.5.5", "@babel/register": "^7.5.5",
"@wordpress/e2e-test-utils": "^2.2.0", "@wordpress/e2e-test-utils": "^2.2.0",
"autoprefixer": "9.6.5", "autoprefixer": "9.7.2",
"babel-eslint": "10.0.3", "babel-eslint": "10.0.3",
"chai": "4.2.0", "chai": "4.2.0",
"chai-as-promised": "7.1.1", "chai-as-promised": "7.1.1",
"commander": "^3.0.0", "commander": "^3.0.0",
"config": "3.2.3",
"cross-env": "6.0.3",
"eslint": "6.5.1",
"eslint-config-wpcalypso": "4.0.1",
"eslint-plugin-jest": "22.13.6", "eslint-plugin-jest": "22.13.6",
"eslint-plugin-wpcalypso": "4.1.0", "config": "3.2.4",
"cross-env": "6.0.3",
"eslint": "6.7.0",
"eslint-config-wpcalypso": "5.0.0",
"github-contributors-list": "https://github.com/woocommerce/github-contributors-list/tarball/master", "github-contributors-list": "https://github.com/woocommerce/github-contributors-list/tarball/master",
"grunt": "1.0.4", "grunt": "1.0.4",
"grunt-checktextdomain": "1.0.1", "grunt-checktextdomain": "1.0.1",
@ -52,18 +51,18 @@
"grunt-rtlcss": "2.0.1", "grunt-rtlcss": "2.0.1",
"grunt-sass": "3.1.0", "grunt-sass": "3.1.0",
"grunt-shell": "3.0.1", "grunt-shell": "3.0.1",
"grunt-stylelint": "0.11.1", "grunt-stylelint": "0.12.0",
"grunt-wp-i18n": "1.0.3", "grunt-wp-i18n": "1.0.3",
"husky": "3.0.9", "husky": "3.1.0",
"istanbul": "1.0.0-alpha.2", "istanbul": "1.0.0-alpha.2",
"jest": "24.8.0", "jest": "24.8.0",
"jest-puppeteer": "4.3.0", "jest-puppeteer": "4.3.0",
"lint-staged": "9.4.2", "lint-staged": "9.4.3",
"mocha": "6.2.2", "mocha": "6.2.2",
"node-sass": "4.12.0", "node-sass": "4.13.0",
"prettier": "github:automattic/calypso-prettier#c56b4251", "prettier": "github:automattic/calypso-prettier#c56b4251",
"puppeteer": "2.0.0", "puppeteer": "2.0.0",
"stylelint": "11.1.1", "stylelint": "12.0.0",
"stylelint-config-wordpress": "15.0.0" "stylelint-config-wordpress": "15.0.0"
}, },
"engines": { "engines": {

View File

@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloada
Requires at least: 4.9 Requires at least: 4.9
Tested up to: 5.2 Tested up to: 5.2
Requires PHP: 5.6 Requires PHP: 5.6
Stable tag: 3.7.0 Stable tag: 3.8.0
License: GPLv3 License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -179,120 +179,7 @@ INTERESTED IN DEVELOPMENT?
== Changelog == == Changelog ==
= 3.8.0 - 2019-01-10 = = 3.9.0 - 2020-01-xx =
* Enhancement - Show error message in "My Account - view order" if order does not exist. #24435
* Enhancement - Add support to allow connect and install for in-app purchase flow. #24451
* Enhancement - Declared support to Unicode CLDR. #24564
* Enhancement - Declared support for PHP 7.4 in CI by removing PHP 7.4 from list of allowed failures. #24668
* Enhancement - Update the recommended PHP version to 7.0 and the recommended WP version to 5.0. #24730
* Enhancement - Change On Boarding Wizard to opt out of usage tracking by default. #24680
* Enhancement - Add `Available on backorder` message for products available on backorder. #24559
* Tweak - Hide Vietnam's state field. #24158
* Tweak - Better wording when no downloads are available on My Account > Downloads. #24172
* Tweak - Only consider orders created via checkout to hold stock. #24159
* Tweak - Stop to load order data twice in "View order" screen on "My Account" page. #24437
* Tweak - Prevent PHP warnings in tracker if order doesn't have a created date yet. #24441
* Tweak - Use `wc_get_checkout_url()` to get checkout URL. #24544
* Tweak - Maintain value of select fields in credit card form. #24720
* Tweak - Prevent filter per category while exporting product variations. #24517
* Tweak - Better wording for subtotal of items in cart and review order. #24440
* Tweak - Prevent new lines in product quantity in checkout details. #24311
* Tweak - Add a tooltip in the "Coupon expity date" field. #24749
* Tweak - CSS styling changes for WP 5.3. #24832
* Template - Moved HTML for displaying product price filter widget to a new template `product price filter widget`. #23384
* Accessibility - Make $subtext color darker. #24739
* Dev - Consistent register/login submit button css class names. Preserve old class names as well for backwards compatibility. #23701
* Dev - Added woocommerce_disable_password_change_notification filter, set to false by default. #24154
* Dev - Add filter `woocommerce_cart_item_removed_message` and `woocommerce_cart_product_cannot_be_purchased_message` to filter notice content when an item is removed from cart, or when a product cannot be purchased. #24176
* Dev - Prevent fatal error if trying to run `wc_load_cart()` before `before_woocommerce_init`. #24198
* Dev - Add woocommerce_get_zone_criteria filter hook to add custom criteria for matching zone ID. #24199
* Dev - Fire actions `woocommerce_before_delete_product_variation`, `woocommerce_delete_product_variation` and `woocommerce_trash_product_variation` appropriately when deleting or trashing product variations. #24239
* Dev - In filter `woocommerce_update_product_stock_query` use `$new_stock` instead of `$stock_quantity`. #24229
* Dev - Introduced woocommerce_prevent_adjust_line_item_product_stock filter. #24279
* Dev - Introduced `woocommerce_logout_default_redirect_url` filter to allow custom default URL. #24282
* Dev - Added woocommerce_sort_fees_callback filter. #24280
* Dev - Remove deprecated i18n/states directory. #24364
* Dev - Add filter `woocommerce_shipping_show_shipping_calculator` for showing shipping calculator. #24375
* Dev - Corrected UG states location. #24388
* Dev - Remove deprecations notices with PHP 7.4 by changing parameter order for `implode`. #24396
* Dev - Add ``$this` param to email filter for additional_content added in 3.7. #24399
* Dev - Add `woocommerce_product_import_process_item_data` filter to allow modifying a row before importing. #24412
* Dev - Fixed warnings when error_get_last() returns null. #24442
* Dev - Use brackets instead of braces to avoid deprecation notice in PHP 7.4. #24460
* Dev - Implement Puppeteer's architecture for running E2E tests locally. #24479
* Dev - Remove call to get_magic_quotes_runtime() as it is deprecated as of PHP 7.4. #24485
* Dev - Return value of `$mailer->send()` in `wc_mail` function. #24505
* Dev - Remove Selenium e2e tests & add Puppeteer new product e2e test. #24513
* Dev - Add a filter `woocommerce_ajax_add_order_item_validation` to allow validations in `add_order_item` function. #24518
* Dev - Use `wc_get_cart_url` instead of `wc_get_page_permalink( 'cart' )` because former has a filter `woocommerce_get_cart_url` to allow customization. #24530
* Dev - New `woocommerce_product_after_tabs` action hook added. #24694
* Dev - Enable append hashes on custom events (like ajax requests) #24665
* Dev - Introduced `woocommerce_order_get_formatted_billing_address` and `woocommerce_order_get_formatted_shipping_address` filters. #24677
* Dev - WC_Abstract_Order::recalculate_coupons() is public now. #24740
* Dev - Added 'applied_coupon' trigger to checkout.js. #24406
* Dev - Introduced woocommerce_output_cart_shortcode_content filter. #24738
* Dev - Add WPML compatibility to the geolocation URL. #24722
* Dev - Validate server requirements in WCCCOM Site Installer endpoints. #24690
* Dev - Introduced woocommerce_payment_token_class filter. #24542
* Dev - Add support for post type count to system status report. #24536
* Dev - Check for max discount to be -ve to prevent overwriting refunded fee amount. #24341
* Dev: Add filter woocommerce_european_union_countries to the method WC_Countries::get_european_union_countries(). #24741
* Dev - Allow WC_Product_Query sort products by include order. #24294
* Dev - Removed duplicated include of WC_Admin_Importers. #24751
* Dev - Refactor minimum requirement notice to use constant for easier changes in the future. #24830
* Fix - Clean products transients when term is removed. #23991
* Fix - Only add the image node to structured data if product has image. #24191
* Fix - Product attribute terms endpoint in legacy REST API v3 by converting `attribute_id` to int. #24203
* Fix - Prevent duplicate processing/stock reduction when IPN or PDT notifications are enabled by checking if order is not already in `processing` or `completed` status. #24249
* Fix - Position of ID section in mobile rows actions when displaying the list of products in the admin. #24277
* Fix - Endpoints URLs to follow slashes preferences from WordPress permalinks. #24283
* Fix - Ensure that postcode validation doesn't return any whitespace on beginning and end of a postcode. #24284
* Fix - Shipping classes sort under products alphabetically. #24291
* Fix - Shipping rates layout in admin settings. #24327
* Fix - Retain the focus on the select box when product variation is changed. #24339
* Fix - Prevent PHP notice in WC_Order_Item_Data_Store::get_order_item_type() when there is no entry in the database for the order item ID passed. #24353
* Fix - Add translation in class-wc-shipping.php for matching zone message. #24366
* Fix - Previewing email template. #24380
* Fix - Check if order exist before generate hash for downloads. #24384
* Fix - Ensure WC_Product_Data_Store_CPT::is_existing_sku() return boolean. #24385
* Fix - `function_exists` check for wc_hex_is_light(). #24391
* Fix - Removed Emoji from default additional email content due problem on some database that doesn't allow Emojis. #24450
* Fix - Fixed escaping on an attribute in `class-wc-admin-menus.php`. #24466
* Fix - Add translation for image alt attribute text in multiple places. #24467, #24468, #24469
* Fix - Uneven padding in the input field with class "location-input" in on boarding wizard. #24476
* Fix - Duplicate id in pages settings. #24478
* Fix - Use `esc_attr_e` instead of `esc_html_e` for escaping an attribute in multiple places. #24481, #24520, #24521, #24522, #24523, #24524
* Fix - Use `esc_attr__` instead of `esc_html__` in escaping attributes string. #24525, #24529
* Fix - Typo fix in payment captured error message. #24501
* Fix - Remove broken download link for downloadable product in refund emails. #24526
* Fix - Documentation URL in failed order email content. #24535
* Fix - "Add to cart" links in feed. #24545
* Fix - Escaping in Storefront banner. #24546
* Fix - Use `wp_kses_post` to allow certain html tags in extensions page. #24589
* Fix - Escape `$prefix` in item download links. #24601
* Fix - Use `esc_attr` instead of `esc_html` in multiple places for proper escaping. #24613, #24614
* Fix - Use `esc_html` instead of `esc_attr` in multiple places for proper escaping. #24616
* Fix - Use `esc_html_e` instead of `_e` in multiple places for proper escaping. #24615, #24618, #24630
* Fix - Use `esc_html__` instead of `esc_html` for proper escaping and some typo fixes. #24639
* Fix - Add no-store and remove max-age header (no longer needed). #24652
* Fix - Use correct meta value for `downloadable` column in product lookup table regenerate function. #24681
* Fix - Admin sub-menus becoming unaligned when scrolling down in the orders page when there are no orders. #24688
* Fix - OWB country and sell in person alignment. #24700
* Fix - Add selectWoo as dependency of country-select. #24347
* Fix - Domain replacement script now replaces both double and single quoted `woo-gutenberg-products-block` with `woocommerce` in both PHP and JavaScript files. #24696
* Fix - Convert `current_user_id` to string in some places to prevent unnecessary session database updates. #24016
* Fix - Fixed description of failed order emails. #24737
* Fix - Fixed Photoswipe styles. #24296
* Fix - Also consider refunded item when updating order and adjusting stocks. #24745
* Fix - Handle 0 attribute value for variations correctly. #24750
* Fix - Fixed spaces in form fields of External Products. #24295
* Localization - Add Zambia's Provinces to the list of states. #24307
* Localization - Adaptation of the order of last name and first name and addresses in Japan. #24336
* Localization - Fixed Namibian dollar symbol. #24438
* Localization - Change localization tag `action-scheduler` to `woocommerce`. #24474
* Localization - Fixed missing US Minor Outlying Islands states. #24826
* Security - Add an exit after the redirect when checking author archive capabilities for customers.
* Security - Ensure 404 pages with single product urls cannot be exploited using Open Redirect.
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt). [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt).

View File

@ -1,11 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ ${RUN_E2E} == 1 ]]; then if [[ ${RUN_E2E} == 1 ]]; then
npm install
WP_SITE_URL="http://localhost:8080" npm run test:e2e
# Set base url to that of e2e test suite.
export BASE_URL="$WP_SITE_URL"
# Run the tests
npm test
fi fi

View File

@ -1,3 +0,0 @@
{
"url": "BASE_URL"
}

View File

@ -1,3 +1,13 @@
{ {
"url": "https://example.com/" "url": "http://localhost:8084/",
"users": {
"admin": {
"username": "admin",
"password": "password"
},
"customer": {
"username": "customer",
"password": "password"
}
}
} }

View File

@ -10,4 +10,3 @@ class CustomSequencer extends Sequencer {
} }
module.exports = CustomSequencer; module.exports = CustomSequencer;

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,197 @@
/**
* @format
*/
/**
* Internal dependencies
*/
import { StoreOwnerFlow } from '../../utils/flows';
import {
permalinkSettingsPageSaveChanges,
setCheckbox,
settingsPageSaveChanges,
verifyCheckboxIsSet,
verifyCheckboxIsUnset, verifyValueOfInputField
} from "../../utils";
describe( 'Store owner can login and make sure WooCommerce is activated', () => {
it( 'Can login', async () => {
await StoreOwnerFlow.login();
} );
it( 'Can make sure WooCommerce is activated. If not, activate it', async () => {
const slug = 'woocommerce';
await StoreOwnerFlow.openPlugins();
const disableLink = await page.$( `tr[data-slug="${ slug }"] .deactivate a` );
if ( disableLink ) {
return;
}
await page.click( `tr[data-slug="${ slug }"] .activate a` );
await page.waitForSelector( `tr[data-slug="${ slug }"] .deactivate a` );
});
} );
describe( 'Store owner can go through store Setup Wizard', () => {
it( 'Can start Setup Wizard', async () => {
await StoreOwnerFlow.runSetupWizard();
} );
it( 'Can fill out Store setup details', async () => {
// Fill out store address details
await expect( page ).toSelect( 'select[name="store_country"]', 'United States (US)' );
await expect( page ).toFill( '#store_address', 'addr 1' );
await expect( page ).toFill( '#store_address_2', 'addr 2' );
await expect( page ).toFill( '#store_city', 'San Francisco' );
await expect( page ).toSelect( 'select[name="store_state"]', 'California' );
await expect( page ).toFill( '#store_postcode', '94107' );
// Select currency and type of products to sell details
await expect( page ).toSelect( 'select[name="currency_code"]', '\n' +
'\t\t\t\t\t\tUnited States (US) dollar ($ USD)\t\t\t\t\t' );
await expect( page ).toSelect( 'select[name="product_type"]', 'I plan to sell both physical and digital products' );
// Verify that checkbox next to "I will also be selling products or services in person." is not selected
await verifyCheckboxIsUnset( '#woocommerce_sell_in_person' );
// Click on "Let's go!" button to move to the next step
await page.$eval( 'button[name=save_step]', elem => elem.click() );
// Wait for usage tracking pop-up window to appear
await page.waitForSelector( '#wc-backbone-modal-dialog' );
await expect( page ).toMatchElement( '.wc-backbone-modal-header', { text: 'Help improve WooCommerce with usage tracking' } );
await page.waitForSelector('#wc_tracker_checkbox_dialog');
// Verify that checkbox next to "Enable usage tracking and help improve WooCommerce" is not selected
await verifyCheckboxIsUnset('#wc_tracker_checkbox_dialog');
await Promise.all([
// Click on "Continue" button to move to the next step
page.$eval( '#wc_tracker_submit', elem => elem.click() ),
// Wait for the Payment section to load
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
]);
} );
it( 'Can fill out Payment details', async () => {
// Turn off Stripe account toggle
await page.click( '.wc-wizard-service-toggle' );
// Click on "Continue" button to move to the next step
await page.click( 'button[name=save_step]', { text: 'Continue' } );
} );
it( 'Can fill out Shipping details', async () => {
// Turn off WooCommerce Shipping option
await page.$eval( '#wc_recommended_woocommerce_services', elem => elem.click() );
await page.waitForSelector( 'select[name="shipping_zones[domestic][method]"]' );
await page.waitForSelector( 'select[name="shipping_zones[intl][method]"]' );
// Select Free Shipping method for domestic shipping zone
await page.evaluate( () => {
document.querySelector( 'select[name="shipping_zones[domestic][method]"] > option:nth-child(2)' ).selected = true;
let element = document.querySelector( 'select[name="shipping_zones[domestic][method]"]' );
let event = new Event( 'change', { bubbles: true } );
event.simulated=true;
element.dispatchEvent( event );
} );
// Select Free Shipping method for the rest of the world shipping zone
await page.evaluate( () => {
document.querySelector( 'select[name="shipping_zones[intl][method]"] > option:nth-child(2)' ).selected = true;
let element = document.querySelector( 'select[name="shipping_zones[intl][method]"]' );
let event = new Event( 'change', { bubbles: true } );
event.simulated=true;
element.dispatchEvent( event );
});
// Select product weight and product dimensions options
await expect( page ).toSelect( 'select[name="weight_unit"]', 'Pounds' );
await expect( page ).toSelect( 'select[name="dimension_unit"]', 'Inches' );
// Click on "Continue" button to move to the next step
await page.click( 'button[name=save_step]', { text: 'Continue' } );
} );
it( 'Can fill out Recommended details', async () => {
// Turn off Storefront Theme option
await page.$eval( '#wc_recommended_storefront_theme', elem => elem.click() );
// Turn off Automated Taxes option
await page.$eval( '#wc_recommended_automated_taxes', elem => elem.click() );
// Turn off WooCommerce Admin option
await page.$eval( '#wc_recommended_wc_admin', elem => elem.click() );
// Turn off Mailchimp option
await page.$eval( '#wc_recommended_mailchimp', elem => elem.click() );
// Turn off Facebook option
await page.$eval( '#wc_recommended_facebook', elem => elem.click() );
// Click on "Continue" button to move to the next step
await page.click( 'button[name=save_step]', { text: 'Continue' } );
} );
it( 'Can skip Activate Jetpack section', async () => {
// Click on "Skip this step" in order to skip Jetpack installation
await page.click( '.wc-setup-footer-links' );
} );
it( 'Can finish Setup Wizard - Ready! section', async () => {
// Visit Dashboard
await StoreOwnerFlow.openDashboard();
} );
} );
describe( 'Store owner can finish initial store setup', () => {
it('Can enable tax rates and calculations', async () => {
// Go to general settings page
await StoreOwnerFlow.openSettings( 'general' );
// Make sure the general tab is active
await expect( page ).toMatchElement( 'a.nav-tab-active', { text: 'General' } );
// Enable tax rates and calculations
await setCheckbox( '#woocommerce_calc_taxes' );
await settingsPageSaveChanges();
// Verify that settings have been saved
await Promise.all( [
expect( page ).toMatchElement( '#message', { text: 'Your settings have been saved.' } ),
verifyCheckboxIsSet( '#woocommerce_calc_taxes' ),
] );
});
it('Can configure permalink settings', async () => {
// Go to Permalink Settings page
await StoreOwnerFlow.openPermalinkSettings();
// Select "Post name" option in common settings section
await page.click( 'input[value="/%postname%/"]', { text: ' Post name' } );
// Select "Custom base" in product permalinks section
await page.click( '#woocommerce_custom_selection' );
// Fill custom base slug to use
await expect( page ).toFill( '#woocommerce_permalink_structure', '/product/' );
await permalinkSettingsPageSaveChanges();
// Verify that settings have been saved
await Promise.all( [
expect( page ).toMatchElement( '#setting-error-settings_updated', { text: 'Permalink structure updated.' } ),
verifyValueOfInputField( '#permalink_structure', '/%postname%/' ),
verifyValueOfInputField( '#woocommerce_permalink_structure', '/product/' ),
] );
});
} );

View File

@ -2,11 +2,6 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -19,7 +14,7 @@ let variablePostIdValue;
describe( 'Single Product Page', () => { describe( 'Single Product Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
simplePostIdValue = await createSimpleProduct(); simplePostIdValue = await createSimpleProduct();
await StoreOwnerFlow.logout(); await StoreOwnerFlow.logout();
} ); } );
@ -44,7 +39,7 @@ describe( 'Single Product Page', () => {
describe( 'Variable Product Page', () => { describe( 'Variable Product Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
variablePostIdValue = await createVariableProduct(); variablePostIdValue = await createVariableProduct();
await StoreOwnerFlow.logout(); await StoreOwnerFlow.logout();
} ); } );

View File

@ -2,20 +2,15 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
import { StoreOwnerFlow } from '../../utils/flows'; import { StoreOwnerFlow } from '../../utils/flows';
import { clickTab, verifyPublishAndTrash } from "../../utils"; import { clickTab, verifyPublishAndTrash } from '../../utils';
describe( 'Add New Coupon Page', () => { describe( 'Add New Coupon Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can create new coupon', async () => { it( 'can create new coupon', async () => {

View File

@ -2,20 +2,15 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
import { StoreOwnerFlow } from '../../utils/flows'; import { StoreOwnerFlow } from '../../utils/flows';
import { verifyPublishAndTrash } from "../../utils"; import { verifyPublishAndTrash } from '../../utils';
describe( 'Add New Order Page', () => { describe( 'Add New Order Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can create new order', async () => { it( 'can create new order', async () => {

View File

@ -2,11 +2,6 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -35,7 +30,7 @@ const verifyPublishAndTrash = async () => {
describe( 'Add New Simple Product Page', () => { describe( 'Add New Simple Product Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can create simple virtual product titled "Simple Product" with regular price $9.99', async () => { it( 'can create simple virtual product titled "Simple Product" with regular price $9.99', async () => {
@ -64,7 +59,7 @@ describe( 'Add New Simple Product Page', () => {
describe( 'Add New Variable Product Page', () => { describe( 'Add New Variable Product Page', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can create product with variations', async () => { it( 'can create product with variations', async () => {
// Go to "add product" page // Go to "add product" page

View File

@ -2,11 +2,6 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -15,7 +10,7 @@ import { settingsPageSaveChanges, verifyValueOfInputField } from '../../utils';
describe( 'WooCommerce General Settings', () => { describe( 'WooCommerce General Settings', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can update settings', async () => { it( 'can update settings', async () => {

View File

@ -2,20 +2,15 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
import { StoreOwnerFlow } from '../../utils/flows'; import { StoreOwnerFlow } from '../../utils/flows';
import { setCheckbox, settingsPageSaveChanges, unsetCheckbox, verifyCheckboxIsSet, verifyCheckboxIsUnset } from "../../utils"; import { setCheckbox, settingsPageSaveChanges, unsetCheckbox, verifyCheckboxIsSet, verifyCheckboxIsUnset } from '../../utils';
describe( 'WooCommerce Products > Downloadable Products Settings', () => { describe( 'WooCommerce Products > Downloadable Products Settings', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can update settings', async () => { it( 'can update settings', async () => {

View File

@ -2,11 +2,6 @@
* @format * @format
*/ */
/**
* External dependencies
*/
import { activatePlugin } from '@wordpress/e2e-test-utils';
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -18,11 +13,11 @@ import {
uiUnblocked, uiUnblocked,
verifyCheckboxIsSet, verifyCheckboxIsSet,
verifyValueOfInputField verifyValueOfInputField
} from "../../utils"; } from '../../utils';
describe( 'WooCommerce Tax Settings', () => { describe( 'WooCommerce Tax Settings', () => {
beforeAll( async () => { beforeAll( async () => {
await activatePlugin( 'woocommerce' ); await StoreOwnerFlow.login();
} ); } );
it( 'can enable tax calculation', async() => { it( 'can enable tax calculation', async() => {

View File

@ -1,21 +1,32 @@
import { clickTab } from "./index";
/** /**
* @format * @format
*/ */
const baseUrl = process.env.WP_BASE_URL; /**
* Internal dependencies
*/
import { clearAndFillInput } from './index';
const WP_ADMIN_NEW_PRODUCT = baseUrl + '/wp-admin/post-new.php?post_type=product'; const config = require( 'config' );
const WP_ADMIN_WC_SETTINGS = baseUrl + '/wp-admin/admin.php?page=wc-settings&tab='; const baseUrl = config.get( 'url' );
const WP_ADMIN_NEW_COUPON = baseUrl + '/wp-admin/post-new.php?post_type=shop_coupon';
const WP_ADMIN_NEW_ORDER = baseUrl + '/wp-admin/post-new.php?post_type=shop_order';
const SHOP_PAGE = baseUrl + '/shop/'; const SHOP_PAGE = baseUrl + '/shop/';
const SHOP_PRODUCT = baseUrl + '/?p=';
const SHOP_CART_PAGE = baseUrl + '/cart/';
const SHOP_CHECKOUT_PAGE = baseUrl + '/checkout/'; const SHOP_CHECKOUT_PAGE = baseUrl + '/checkout/';
const WP_ADMIN_LOGIN = baseUrl + 'wp-login.php';
const WP_ADMIN_DASHBOARD = baseUrl + 'wp-admin';
const WP_ADMIN_PLUGINS = baseUrl + 'wp-admin/plugins.php';
const WP_ADMIN_SETUP_WIZARD = baseUrl + 'wp-admin/admin.php?page=wc-setup';
const WP_ADMIN_NEW_COUPON = baseUrl + 'wp-admin/post-new.php?post_type=shop_coupon';
const WP_ADMIN_NEW_ORDER = baseUrl + 'wp-admin/post-new.php?post_type=shop_order';
const WP_ADMIN_NEW_PRODUCT = baseUrl + 'wp-admin/post-new.php?post_type=product';
const WP_ADMIN_WC_SETTINGS = baseUrl + 'wp-admin/admin.php?page=wc-settings&tab=';
const WP_ADMIN_PERMALINK_SETTINGS = baseUrl + 'wp-admin/options-permalink.php';
const SHOP_PRODUCT = baseUrl + '?p=';
const SHOP_CART_PAGE = baseUrl + 'cart/';
const getProductColumnExpression = ( productTitle ) => ( const getProductColumnExpression = ( productTitle ) => (
'td[@class="product-name" and ' + 'td[@class="product-name" and ' +
`a[contains(text(), "${ productTitle }")]` + `a[contains(text(), "${ productTitle }")]` +
@ -173,8 +184,26 @@ const CustomerFlow = {
}; };
const StoreOwnerFlow = { const StoreOwnerFlow = {
login: async () => {
await page.goto( WP_ADMIN_LOGIN, {
waitUntil: 'networkidle0',
} );
await expect( page.title() ).resolves.toMatch( 'Log In' );
await clearAndFillInput( '#user_login', ' ' );
await page.type( '#user_login', config.get( 'users.admin.username' ) );
await page.type( '#user_pass', config.get( 'users.admin.password' ) );
await Promise.all( [
page.click( 'input[type=submit]' ),
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
] );
},
logout: async () => { logout: async () => {
await page.goto(baseUrl + '/wp-login.php?action=logout', { await page.goto(baseUrl + 'wp-login.php?action=logout', {
waitUntil: 'networkidle0', waitUntil: 'networkidle0',
}); });
@ -186,6 +215,12 @@ const StoreOwnerFlow = {
]); ]);
}, },
openDashboard: async () => {
await page.goto( WP_ADMIN_DASHBOARD, {
waitUntil: 'networkidle0',
} );
},
openNewCoupon: async () => { openNewCoupon: async () => {
await page.goto( WP_ADMIN_NEW_COUPON, { await page.goto( WP_ADMIN_NEW_COUPON, {
waitUntil: 'networkidle0', waitUntil: 'networkidle0',
@ -204,6 +239,18 @@ const StoreOwnerFlow = {
} ); } );
}, },
openPermalinkSettings: async () => {
await page.goto( WP_ADMIN_PERMALINK_SETTINGS, {
waitUntil: 'networkidle0',
} );
},
openPlugins: async () => {
await page.goto( WP_ADMIN_PLUGINS, {
waitUntil: 'networkidle0',
} );
},
openSettings: async ( tab, section = null ) => { openSettings: async ( tab, section = null ) => {
let settingsUrl = WP_ADMIN_WC_SETTINGS + tab; let settingsUrl = WP_ADMIN_WC_SETTINGS + tab;
@ -215,6 +262,12 @@ const StoreOwnerFlow = {
waitUntil: 'networkidle0', waitUntil: 'networkidle0',
} ); } );
}, },
runSetupWizard: async () => {
await page.goto( WP_ADMIN_SETUP_WIZARD, {
waitUntil: 'networkidle0',
} );
},
}; };
export { CustomerFlow, StoreOwnerFlow }; export { CustomerFlow, StoreOwnerFlow };

View File

@ -40,6 +40,17 @@ const settingsPageSaveChanges = async () => {
] ); ] );
}; };
/**
* Save changes on Permalink settings page.
*/
const permalinkSettingsPageSaveChanges = async () => {
await page.focus( '.wp-core-ui .button-primary' );
await Promise.all( [
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
page.click( '.wp-core-ui .button-primary' ),
] );
};
/** /**
* Set checkbox. * Set checkbox.
* *
@ -153,6 +164,7 @@ module.exports = {
clearAndFillInput, clearAndFillInput,
clickTab, clickTab,
settingsPageSaveChanges, settingsPageSaveChanges,
permalinkSettingsPageSaveChanges,
setCheckbox, setCheckbox,
unsetCheckbox, unsetCheckbox,
uiUnblocked, uiUnblocked,

View File

@ -13,7 +13,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case {
public function test_create_customer() { public function test_create_customer() {
$username = 'testusername-' . time(); $username = 'testusername-' . time();
$customer = new WC_Customer(); $customer = new WC_Customer();
$customer->set_username( 'testusername-' . time() ); $customer->set_username( $username );
$customer->set_password( 'test123' ); $customer->set_password( 'test123' );
$customer->set_email( 'test@woo.local' ); $customer->set_email( 'test@woo.local' );
$customer->save(); $customer->save();

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce * Plugin Name: WooCommerce
* Plugin URI: https://woocommerce.com/ * Plugin URI: https://woocommerce.com/
* Description: An eCommerce toolkit that helps you sell anything. Beautifully. * Description: An eCommerce toolkit that helps you sell anything. Beautifully.
* Version: 3.8.0-beta.1 * Version: 3.9.0-dev
* Author: Automattic * Author: Automattic
* Author URI: https://woocommerce.com * Author URI: https://woocommerce.com
* Text Domain: woocommerce * Text Domain: woocommerce
@ -39,7 +39,7 @@ if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) {
// Include the main WooCommerce class. // Include the main WooCommerce class.
if ( ! class_exists( 'WooCommerce', false ) ) { if ( ! class_exists( 'WooCommerce', false ) ) {
include_once dirname( __FILE__ ) . '/includes/class-woocommerce.php'; include_once dirname( WC_PLUGIN_FILE ) . '/includes/class-woocommerce.php';
} }
/** /**