Resolving conflict with master branch

This commit is contained in:
Julia Amosova 2019-11-23 18:03:04 +00:00
commit d2fa44518a
28 changed files with 1625 additions and 419 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/) 🎉
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.

View File

@ -1,5 +1,225 @@
== 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 =
* Security - Introduce file type check for tax rate importer.
* Security - Added nonce check to CSV importer actions.

View File

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

View File

@ -360,9 +360,12 @@ jQuery( function( $ ) {
// Always update the fragments
if ( data && data.fragments ) {
$.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();
} );
wc_checkout_form.fragments = data.fragments;
}
// Recheck the terms and conditions box, if needed

View File

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

View File

@ -599,7 +599,7 @@ class WC_Admin_Setup_Wizard {
</article>
<footer>
<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>
</footer>
</section>

View File

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

View File

@ -18,6 +18,7 @@ if ( ! $tab_exists ) {
}
?>
<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">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
@ -46,4 +47,5 @@ if ( ! $tab_exists ) {
<?php wp_nonce_field( 'woocommerce-settings' ); ?>
</p>
</form>
<?php do_action( 'woocommerce_after_settings_' . $current_tab ); ?>
</div>

View File

@ -637,7 +637,7 @@ class WC_Cart extends WC_Legacy_Cart {
*/
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->removed_cart_contents = array();
@ -653,7 +653,7 @@ class WC_Cart extends WC_Legacy_Cart {
$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 );
}
/**
* 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'.
*
@ -400,7 +411,7 @@ class WC_Countries {
* @return string
*/
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 );
}
@ -411,7 +422,7 @@ class WC_Countries {
* @return string
*/
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 );
}
@ -422,7 +433,7 @@ class WC_Countries {
* @return string
*/
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 );
}

View File

@ -428,7 +428,7 @@ class WC_Emails {
* @param string $email Email address.
*/
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 ) {
return;

View File

@ -247,7 +247,7 @@ class WC_Frontend_Scripts {
),
'wc-country-select' => array(
'src' => self::get_asset_url( 'assets/js/frontend/country-select' . $suffix . '.js' ),
'deps' => array( 'jquery', 'selectWoo' ),
'deps' => array( 'jquery' ),
'version' => WC_VERSION,
),
'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 */
$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_changed', $this->get_id(), $status_transition['from'], $status_transition['to'], $this );
} else {
/* translators: %s: new order status */
$transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $status_transition['to'] ) );
}
// Note the transition occurred.
$this->add_order_note( trim( $status_transition['note'] . ' ' . $transition_note ), 0, $status_transition['manual'] );
// Note the transition occurred.
$this->add_status_transition_note( $transition_note, $status_transition );
}
} catch ( Exception $e ) {
$logger = wc_get_logger();
$logger->error(
@ -883,10 +886,11 @@ class WC_Order extends WC_Abstract_Order {
* Filter orders formatterd billing address.
*
* @since 3.8.0
* @param string $address Formatted billing address string.
* @param array $raw_address Raw billing address.
* @param string $address Formatted billing address string.
* @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.
*
* @since 3.8.0
* @param string $address Formatted shipping address string.
* @param array $raw_address Raw shipping address.
* @param string $address Formatted billing address string.
* @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;
}
/**
* 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.
*

View File

@ -8,9 +8,7 @@
* @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
/**
* 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_order_status_processing', 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() ) {
$this->enabled = 'no';
@ -380,17 +381,17 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$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 'successwithwarning':
$order->add_order_note(
/* 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 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 ) );
// phpcs:disable WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
if ( ! empty( $result->PAYMENTSTATUS ) ) {
switch ( $result->PAYMENTSTATUS ) {
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 );
}
/**
* 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.
$schedules[ $this->identifier . '_cron_interval' ] = array(
'interval' => MINUTE_IN_SECONDS * $interval,
'display' => sprintf( __( 'Every %d Minutes' ), $interval ),
'display' => sprintf( __( 'Every %d minutes', 'woocommerce' ), $interval ),
);
return $schedules;

View File

@ -43,6 +43,11 @@ class WC_Tracks_Client {
* @return void
*/
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.
if ( isset( $_COOKIE['tk_ai'] ) ) {
return;

View File

@ -27,9 +27,9 @@ class WC_Orders_Tracking {
* Send a Tracks event when the Orders page is viewed.
*/
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(
'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 );
$date_created = $order->get_date_created()->date( 'Y-m-d H:i:s' );
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
$date_created = $order->get_date_created() ? $order->get_date_created()->date( 'Y-m-d H:i:s' ) : '';
// phpcs:disable WordPress.Security.NonceVerification
$new_date = sprintf(
'%s %2d:%2d:%2d',
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.
*/
public function track_order_action( $order_id ) {
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
// phpcs:disable WordPress.Security.NonceVerification
if ( ! empty( $_POST['wc_order_action'] ) ) {
$order = wc_get_order( $order_id );
$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.
*/
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'] ) ) {
$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.
} 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).
} elseif ( 'payment-methods' === $endpoint && isset( $wp->query_vars['add-payment-method'] ) ) {
$current = true;
}
if ( $current ) {

View File

@ -1140,7 +1140,7 @@ function wc_get_customer_default_location() {
$allowed_country_codes = WC()->countries->get_allowed_countries();
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'] = '';
}

View File

@ -1948,6 +1948,7 @@ if ( ! function_exists( 'woocommerce_upsell_display' ) ) {
array(
'posts_per_page' => $limit,
'orderby' => $orderby,
'order' => $order,
'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 ) );
$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 );
// 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,
);
// 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()->add( 'woocommerce_wccom_install_products', $args );
@ -257,7 +261,7 @@ class WC_WCCOM_Site_Installer {
*
* @since 3.7.0
* @param int $product_id Product ID.
* @return bool|\WP_Error
* @return array|\WP_Error
*/
private static function get_product_info( $product_id ) {
$product_info = array(

1448
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/register": "^7.5.5",
"@wordpress/e2e-test-utils": "^2.2.0",
"autoprefixer": "9.6.5",
"autoprefixer": "9.7.2",
"babel-eslint": "10.0.3",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"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-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",
"grunt": "1.0.4",
"grunt-checktextdomain": "1.0.1",
@ -52,18 +51,18 @@
"grunt-rtlcss": "2.0.1",
"grunt-sass": "3.1.0",
"grunt-shell": "3.0.1",
"grunt-stylelint": "0.11.1",
"grunt-stylelint": "0.12.0",
"grunt-wp-i18n": "1.0.3",
"husky": "3.0.9",
"husky": "3.1.0",
"istanbul": "1.0.0-alpha.2",
"jest": "24.8.0",
"jest-puppeteer": "4.3.0",
"lint-staged": "9.4.2",
"lint-staged": "9.4.3",
"mocha": "6.2.2",
"node-sass": "4.12.0",
"node-sass": "4.13.0",
"prettier": "github:automattic/calypso-prettier#c56b4251",
"puppeteer": "2.0.0",
"stylelint": "11.1.1",
"stylelint": "12.0.0",
"stylelint-config-wordpress": "15.0.0"
},
"engines": {

View File

@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloada
Requires at least: 4.9
Tested up to: 5.2
Requires PHP: 5.6
Stable tag: 3.7.0
Stable tag: 3.8.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -179,120 +179,7 @@ INTERESTED IN DEVELOPMENT?
== Changelog ==
= 3.8.0 - 2019-01-10 =
* 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.
= 3.9.0 - 2020-01-xx =
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt).

View File

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

View File

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