diff --git a/.codeclimate.yml b/.codeclimate.yml index dcf25bd147f..7395ee88e39 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -18,7 +18,6 @@ ratings: - "includes/*" exclude_paths: - "tests/" -- "apigen/" - "sample-data/" - "i18n/" - "includes/api/legacy/" diff --git a/.gitattributes b/.gitattributes index d728da00bed..1b5a2bb019a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,4 @@ /.* export-ignore -apigen* export-ignore CODE_OF_CONDUCT.md export-ignore CHANGELOG.txt export-ignore composer.* export-ignore diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0435d0f3331..c194fb6beb0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ ### Changes proposed in this Pull Request: - + Closes # . @@ -24,10 +24,10 @@ Closes # . * [ ] Have you added an explanation of what your changes do and why you'd like us to include them? * [ ] Have you written new tests for your changes, as applicable? -* [ ] Have you successfully ran tests with your changes locally? +* [ ] Have you successfully run tests with your changes locally? ### Changelog entry -> Enter a short summary of all changes on this Pull Request. This will appear in the changelog if accepted. +> Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted. diff --git a/.gitignore b/.gitignore index 6d673efc6ba..4af7307f91e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,9 +24,6 @@ none # Windows junk Thumbs.db -# ApiGen -/wc-apidocs/ - # Behat/CLI Tests tests/cli/installer tests/cli/composer.phar diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 988a1febcbe..0fd5723b7c4 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -23,7 +23,6 @@ checks: verify_property_names: false filter: excluded_paths: - - apigen/ - sample-data/ - i18n/ - includes/api/legacy/ diff --git a/.travis.yml b/.travis.yml index ebc211463d9..e5b5913d052 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: php - -addons: - chrome: stable - apt: - packages: - - nginx +dist: trusty sudo: false +cache: + directories: + - vendor + - $HOME/.composer/cache + # Test main supported versions of PHP against latest WP. php: - 5.6 @@ -19,32 +19,34 @@ php: env: - WP_VERSION=latest WP_MULTISITE=0 -# Additional tests against stable PHP (min recommended version is 5.6) and past supported versions of WP +# Additional tests against stable PHP (min version is 5.6) # and code coverage report. matrix: fast_finish: true include: - - php: 5.3 - dist: precise - - php: 5.2 - dist: precise - name: "Coding standard check" php: 7.2 env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1 - name: "e2e tests" php: 7.2 env: WP_VERSION=latest WP_MULTISITE=0 RUN_E2E=1 + addons: + chrome: stable + apt: + packages: + - nginx - name: "Unit tests code coverage" - php: 7.1 + php: 7.3 env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1 - name: "WooCommerce unit tests using WordPress nightly" php: 7.3 env: WP_VERSION=nightly WP_MULTISITE=0 allow_failures: - - php: 7.1 + - php: 7.3 env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1 before_script: + - export PATH="$HOME/.composer/vendor/bin:$PATH" - | # Remove Xdebug for a huge performance increase: if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then @@ -52,9 +54,12 @@ before_script: else echo "xdebug.ini does not exist" fi - - export PATH="$HOME/.config/composer/vendor/bin:$PATH" - - bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION - - bash tests/bin/travis.sh before + - | + # Install WP Test suite, install PHPUnit globally: + if [[ ! -z "$WP_VERSION" ]]; then + bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION + composer global require "phpunit/phpunit=4.8.*|6.5.*" + fi script: - bash tests/bin/phpunit.sh diff --git a/.wordpress-org/banner-1544x500.png b/.wordpress-org/banner-1544x500.png index d515d551fcc..42c75cecd43 100644 Binary files a/.wordpress-org/banner-1544x500.png and b/.wordpress-org/banner-1544x500.png differ diff --git a/.wordpress-org/banner-772x250.png b/.wordpress-org/banner-772x250.png index aa1f423b1bd..e4187e3a9d6 100644 Binary files a/.wordpress-org/banner-772x250.png and b/.wordpress-org/banner-772x250.png differ diff --git a/.wordpress-org/icon-128x128.png b/.wordpress-org/icon-128x128.png index 60918af4695..08df15c0748 100644 Binary files a/.wordpress-org/icon-128x128.png and b/.wordpress-org/icon-128x128.png differ diff --git a/.wordpress-org/icon-256x256.png b/.wordpress-org/icon-256x256.png index 2390aa84fff..a2508f0b84c 100644 Binary files a/.wordpress-org/icon-256x256.png and b/.wordpress-org/icon-256x256.png differ diff --git a/.wordpress-org/screenshot-1.jpg b/.wordpress-org/screenshot-1.jpg new file mode 100644 index 00000000000..d5383232d5b Binary files /dev/null and b/.wordpress-org/screenshot-1.jpg differ diff --git a/.wordpress-org/screenshot-1.png b/.wordpress-org/screenshot-1.png deleted file mode 100644 index 25dd507e20d..00000000000 Binary files a/.wordpress-org/screenshot-1.png and /dev/null differ diff --git a/.wordpress-org/screenshot-2.jpg b/.wordpress-org/screenshot-2.jpg new file mode 100644 index 00000000000..0fef945a86e Binary files /dev/null and b/.wordpress-org/screenshot-2.jpg differ diff --git a/.wordpress-org/screenshot-2.png b/.wordpress-org/screenshot-2.png deleted file mode 100644 index 995273936b3..00000000000 Binary files a/.wordpress-org/screenshot-2.png and /dev/null differ diff --git a/.wordpress-org/screenshot-3.jpg b/.wordpress-org/screenshot-3.jpg new file mode 100644 index 00000000000..2468c849b03 Binary files /dev/null and b/.wordpress-org/screenshot-3.jpg differ diff --git a/.wordpress-org/screenshot-3.png b/.wordpress-org/screenshot-3.png deleted file mode 100644 index 84c39b4c4e3..00000000000 Binary files a/.wordpress-org/screenshot-3.png and /dev/null differ diff --git a/.wordpress-org/screenshot-4.jpg b/.wordpress-org/screenshot-4.jpg new file mode 100644 index 00000000000..a671aef0770 Binary files /dev/null and b/.wordpress-org/screenshot-4.jpg differ diff --git a/.wordpress-org/screenshot-4.png b/.wordpress-org/screenshot-4.png deleted file mode 100644 index 9865f3351bb..00000000000 Binary files a/.wordpress-org/screenshot-4.png and /dev/null differ diff --git a/.wordpress-org/screenshot-5.jpg b/.wordpress-org/screenshot-5.jpg new file mode 100644 index 00000000000..c3049936a43 Binary files /dev/null and b/.wordpress-org/screenshot-5.jpg differ diff --git a/.wordpress-org/screenshot-5.png b/.wordpress-org/screenshot-5.png deleted file mode 100644 index ed40c7f4743..00000000000 Binary files a/.wordpress-org/screenshot-5.png and /dev/null differ diff --git a/.wordpress-org/screenshot-6.jpg b/.wordpress-org/screenshot-6.jpg new file mode 100644 index 00000000000..8d00d366518 Binary files /dev/null and b/.wordpress-org/screenshot-6.jpg differ diff --git a/.wordpress-org/screenshot-6.png b/.wordpress-org/screenshot-6.png deleted file mode 100644 index ba6dea591e0..00000000000 Binary files a/.wordpress-org/screenshot-6.png and /dev/null differ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ed88d86a65b..f664926f991 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,307 @@ == Changelog == += 3.6.4 - 2019-05-27 = +* Enhancement - Add notice to install WooCommerce Admin. #23659 +* Fix - Tracks: Add check for OBW is-opting-in. #23772 +* Fix - Use HTTP protocol for schema.org's availability. #23774 +* Fix - Coupon usage limit checks based on email never ran when orders are created via wp-admin. #23775 +* Fix - Duplicate out of stock notices when navigating from cart to checkout and back to cart. #23791 +* Fix - Remove sensitive information from refund reason when manually refunding an order, and move it to an order note. #23739 +* Tweak - Tracks: set cookie on admin_init instead of wp_loaded. #23787 +* Dev - Fixed number of arguments for all occurrences of the woocommerce_valid_order_statuses_for_cancel filter. #23704 +* Dev - REST API - Stop order creation if invalid data is sent. #23325 +* Dev - Introduce new wc_load_cart function for dynamically loading and initializing the cart. #23794 + += 3.6.3 - 2019-05-16 = +* Fix - State not required for Serbia. #23430 +* Fix - # symbol in product category name broke product export. #23454 +* Fix - XML export caused fatal errors due to Action Scheduler adding invalid characters. #23456 +* Fix - Invalid password messages when password contains backslashes. #23499 +* Fix - Dismiss button in WC admin notices "legacy_shipping" and "no_shipping_methods" were not clickable. #23517 +* Fix - WC $wpdb->tables not defined early enough. #23529 +* Fix - Tracks JS not printed on last page of OBW. #23519 +* Fix - Error in the logic used to build fields for external products when the query string contained full-stops, pluses or spaces in the values of the parameters. #23535 +* Fix - UI page width issue on OBW. #23526 +* Fix - Customer address not auto populated on checkout after registering and filling in address prior. #23528 +* Fix - Available WooCommerce extension updates not showing in System Status report. #23601 +* Fix - wc_change_get_terms_defaults throwing undefined index notices. #23611 +* Fix - System Status report alway showing checkmark next to Connected to WooCommerce.com. #23617 +* Fix - State field never populated when loading customer address on order via wp-admin. #23615 +* Fix - Order sorting not working in wp-admin when Yoast SEO active. #23590 +* Fix - Attribute ordering not working in product edit screen. #23625 +* Fix - Tracks reporting incorrect order totals due to refunds being excluded in calculation. #23671 +* Fix - Reload state options when creating a new order in WP-Admin and changing country. #23602 +* Fix - New webhooks not showing in the webhook admin list page when you have object caching enabled. #23713 +* Fix - Missing coupon expiry dates, restore coupons expiry_date backward compatibility. #23714 +* Fix - Bulk stock update could result in all products set to out of stock, change ensures consistency between db and Product instance in memory. #23534 +* Fix - Dashboard stats widget including unpublished products in out of stock and low in stock counts. #23734 +* Fix - PayPal payment not captured when you transition an order from a custom order status to completed or processing. #23634 +* Tweak - Confirm before saving empty list of countries to sell to in settings. #23597 +* Tweak - Change default WC API version used when creating webhooks to the latest WC API version. #23515 +* Tweak - Report a bug button now points to the new issue template in GitHub. #23580 +* Tweak - Do not display taxes in totals columns when taxes not enabled. #23579 +* Tweak - WC WP-CLI upgrade routine mimics wp-admin upgrade when no updates found by setting DB version to current version. #23666 +* Tweak - Template caching now cache based on WC_VERSION to avoid issues with symlinked plugin folders. #23546 +* Tweak - OBW payment gateway selection defaults. #23690 +* Localization - Add Serbia locale defaults. #23428 +* Localization - Add address format for Serbia. #23429 + += 3.6.2 - 2019-04-24 = +* Fix - Fix CSS classname conflict with themes due to missing product object global. #23377 +* Fix - Fix security check on email template preview page. #23356 +* Fix - Prevent `wc_ascii_uasort_comparison` throwing notices in some server configs. #23363 +* Fix - `is_request_to_rest_api` should check for wc endpoints only. #23372 +* Fix - Fixed use of get_term_meta in REST API endpoints. #23457 +* Fix - Fixed missing closing tag for log-in link for reviews. #23445 +* Fix - Fixed average_rating in the db upgrade routine for lookup table. #23465 +* Fix - More useful update notices if cron is disabled. #23383 +* Fix - Prevent term ordering queries inserted by wc_terms_clauses from conflicting with custom where clauses. #23449 +* Fix - When product lookup table is generating for the first time, avoid wrong stock statuses being set for variable products. #23455 +* Fix - Ensure webhooks respect registered order args. #23444 +* Fix - REST API - Return custom attribute with defined name instead of lowercase name. #23482 +* Fix - Fix 3.6 conflict with Woo Blocks plugin 1.4. #23399 +* Fix - Allow default sorting of WC taxonomies to be overwritten by get_terms orderby. #23477 +* Fix - Improve wc_rating_count lookup table generation with large numbers of posts. #23486 +* Fix - Avoid recurring event for suggestions updates. #23484 +* Fix - Revert selectWoo escaping change and instead escape user names. Avoids issues displaying slash characters. #23334 +* Fix - If an empty array is passed to the v3 API for images, images should be unset. #23339 +* Fix - Fix attribute renaming when dealing with unicode characters. #23132 +* Fix - Preserve full-stops in external product URLs. #23196 +* Fix - Add check for VAT exemption inside `display_prices_including_tax`. #23201 +* Fix - Avoid post update in `wc_update_product_stock` to prevent product titles being updated. #23249 +* Fix - Updated Back to Items link when editing attribute terms. #23238 +* Fix - Network orders widget not showing orders when installed as a network plugin. #23270 +* Fix - Correctly map attributes in CSV when the number is not at the end of the cell. #23251 +* Fix - Fixed highlighting of Orders list item in My Account when looking at individual order. #23236 +* Fix - Applies `wp_strip_all_tags` to the line item name when building PayPal request URL. #23297 +* Fix - Non int value handling in `wc_let_to_num`. #23329 +* Fix - Style span.description elements after select2 boxes. #23252 +* Fix - Switch to subquery for sale products to prevent large query errors on some hosting environments. #23266 +* Fix - Add offerCount to variable product structured data. #23349 +* Fix - Cart widget - Allow title to be removed. #23370 +* Fix - Prevent order data being escaped incorrectly on save when using quotes. #23380 +* Fix - Prevent plugins causing notices by calling get_catalog_ordering_args incorrectly. #23451 +* Fix - Product list view shipping class filter display correct products. #23446 +* Fix - Twenty Seventeen On Sale badge hidden behind product image. #23450 +* Fix - Correct postcode validation on my-account page. #23483 +* Fix - Fixed compatibility with the Jetpack Beta Tester plugin when loading the Tracks client library. #23397 +* Fix - Updated anchor for "How to create a child theme" with the correct target address in the Codex. #23469 +* Tweak - Update action scheduler to version 2.2.5. #23489 +* Tweak - Removed 2 old admin notices for featured moved in past versions. #23263 +* Localization - Make the state/county field optional at checkout for Greece. #23365 + += 3.6.1 - 2019-04-18 = +* Fix - Remove calls to 'header_register_callback' to prevent conflicts with some hosting providers and PHP versions. + += 3.6.0 - 2019-04-17 = +* Enhancement - Merged WooCommerce Gutenberg Products Block feature plugin. Adds blocks for the new editor, including + hand picked products, featured products, products by category/attribute, sale products, new products, top rated + products, and best selling products. #22954 +* Enhancement - Only include order erasure bulk action if erasure is enabled in settings. #22354 +* Enhancement - Customer notes containing URLs now automatically converts to clickable links. #21927 +* Enhancement - Add increase and decrease stock options to bulk edit form. #22475 +* Enhancement - Allow states in zones to be searched by country name. #22339 +* Enhancement - Added registration success notices to account pages. #22650 +* Enhancement - Store notice is visible again if the notice text is changed. #22645 +* Enhancement - Add aria-label attribute to shop orderby selector to improve accessibility. #22683 +* Enhancement - When adding, editing, and deleting items manually from orders, the corresponding product stock will be + updated to reflect the event and an order note will log the event. #22329 +* Enhancement - Added suggestions for official extensions to Products, Edit Product and Orders screens. +* Enhancement - Store attribute values as post_excerpt for variations to support easier searching for variations. #22083 +* Enhancement - Improved username generation and introduced wc_create_new_customer_username function. #23145 +* Enhancement - Allow opting out of Marketplace Suggestions 23218 +* Tweak - Generalize shipping estimate text on cart page. #22467 +* Tweak - Include auto draft orders in order list filters. #22380 +* Tweak - Only include the network orders widget on the main site dashboard. #22318 +* Tweak - Only show available shipping continents when selecting shipping zone region. #22131 +* Tweak - Use Shortcode block on default WooCommerce pages. #21817 +* Tweak - Show full category hierarchy in product URLs when term IDs are not sequential. #22526 +* Tweak - Make sure account and checkout endpoints only work under account and checkout pages. #22631 +* Tweak - Show loading graphic when order form is submitted. #22664 +* Tweak - Add alt text to gallery images #22863 +* Tweak - Improved `display_name` generation during checkout. #22786 +* Tweak - Send correct calling code and phone number to PayPal standard when using non-US addresses. #22693 +* Tweak - Added tooltip to refund-amount input box and made it readonly when taxes are enabled. #22820 +* Tweak - Remove admin alert for the WooCommerce Gutenberg Products Block feature plugin. #22982 +* Tweak - Setup Wizard: support keyboard navigation to toggle on/off features. #22936 +* Tweak - Set reply-to address for all emails. #22979 +* Tweak - Setup wizard redirection improvements. #22977 +* Tweak - Simplify display of discount amounts within orders. #22949 +* Tewak - Remove Marketplace Suggestions from product listing page. #23211 +* Template - Moved the order of rememberme checkboxes for accessibility so they tab in order. #21454 +* Template - New structure for attributes template, including new `woocommerce_display_product_attributes` filter. #22480 +* Template - Admin cancelled order email reworded. #22971 +* Dev - Update action scheduler to version 2.2.2. #23162 +* Dev - Update action scheduler to version 2.2.1. #23016 +* Dev - Use ActionScheduler for database updates. Improved update notice. #22904 +* Dev - Introduce `woocommerce_reviews_title` filter. #22216 +* Dev - Added `woocommerce_cheque_process_payment_order_status` filter allowing plugins to change the order status to the Cheque gateway. #21402 +* Dev - Add the current coupon object to the `woocommerce_get_shop_coupon_data` filter. #21442 +* Dev - New filter `woocommerce_gallery_image_html_attachment_image_params` for manipulating gallery images. #22005 +* Dev - New filter `woocommerce_widget_get_current_page_url` for manipulating links in widgets. #21537 +* Dev - Move wc_get_template filter to allow plugins to register locations for template files that do not exist in WooCommerce core. #21764 +* Dev - Add support for custom classes on global/quantity-input.php. #21553 +* Dev - Pass product object to `woocommerce_add_to_cart_redirect` filter where appropriate. #22123 +* Dev - Add support for forgetting the cart contents and user session when switching between accounts using the User Switching plugin. #21991 +* Dev - Added a consistent form class to the Track Order Form. #21991 +* Dev - Add $orderby and $order params to filter `woocommerce_get_catalog_ordering_args`. #22257 +* Dev - Add new pre query filter to WC_Product_Data_Store_CPT::search_products(). #22165 +* Dev - Added additional parameters to the `woocommerce_variation_option_name` filter. #21153 +* Dev - Added new filter `woocommerce_get_min_max_price_meta_query`. #22255 +* Dev - Added a filter to WC_REST_CRUD_Controller::get_collection_params method to allow developers to change params in + the same way as WP_Rest_Posts_controller::get_collection_params. #21562 +* Dev - Add $zone param to woocommerce_shipping_zone_before_methods_table and woocommerce_shipping_zone_after_methods_table actions. #21961 +* Dev - Added `woocommerce_geolocation_ajax_get_location_hash` filter. #22350 +* Dev - Added `woocommerce_variation_prices_array` filter. #21003 +* Dev - Added `wc_emptied_cart` javascript event when cart is emptied. #22469 +* Dev - Switched `woocommerce_ordered_again` hook to ref_array. #22425 +* Dev - `woocommerce_checkout_before_order_review_heading` action added in checkout form template. #22481 +* Dev - Added `woocommerce_variation_header` hook in variations list. #21341 +* Dev - Add a filter, woocommerce_current_user_can_edit_customer_meta_fields, to bypass manage_woocommerce when editing customer meta fields. #22277 +* Dev - Adds filter on the return value of function 'get_item_tax_rates'. This gives developers the possibility to + prevent the mandatory caching of tax rates. #22488 +* Dev - Add filters for mail callback in WC_Email::send method. #22394 +* Dev - Add an instance method to WC_Admin_Taxonomies. #21884 +* Dev - Added `woocommerce_order_is_pending_statuses` filter and `wc_get_is_pending_statuses` function. #22409 +* Dev - Filter save_payment_method_checkbox to allow "Save to account" checkbox to be removed from the checkout form. #21859 +* Dev - Added triggers to the gallery script to allow 3rd parties to run scripts before and after initialization. #22501 +* Dev - Added `woocommerce_add_to_cart_qty_html` filter. #21069 +* Dev - Prevent extract from polluting hook arguments in wc_get_template(). #21722 +* Dev - Add `woocommerce_pre_remove_cart_item_from_session` hook to allow removal of cart items when the cart is loaded from the session. #22290 +* Dev - Add `$attribute` to `woocommerce_product_option_terms` filter. #21648 +* Dev - Added error handling and timeout to cart fragment ajax call. #21043 +* Dev - Remove unused legacy 'woocommerce_lock_down_admin' option and use filter only instead. #17796 +* Dev - Allow custom settings sections in the Shipping tab. #21719 +* Dev - Update Emogrifier library to 2.1. #22342 +* Dev - Moved core state codes to a single file. #22339 +* Dev - Adds filter for product categories displayed by `product_categories` shortcode. #22571 +* Dev - Moves cart hash calculation to WC_Cart class. #21050 +* Dev - Removed deprecated Simplify gateway. #22410 +* Dev - Added `woocommerce_paypal_force_one_line_item` filter to control how items are sent to PayPal. #22653 +* Dev - Added `woocommerce_update_product_stock_query` to filter the direct sql query to update product stock. #22672 +* Dev - Added `woocommerce_product_loop_title_classes` filter to modify product title loop classes. #22717 +* Dev - Delay `woocommerce_loaded` hook until all plugins are loaded. #22536 +* Dev - Added `woocommerce_product_price_class` filter to modify product price classes. #22748 +* Dev - `woocommerce_product_stock_status_options` filter added for stock status options. #22834 +* Dev - `woocommerce_before_cart_emptied` action before cart is emptied. #22846 +* Dev - Added filters for shipping options - `woocommerce_shipping_ID_option` and `woocommerce_shipping_ID_instance_option`. #22771 +* Dev - Refactor comment/rating update functions. #22909 +* Dev - Introduced wc_sanitize_phone_number() function. #22962 +* Dev - Added `woocommerce_get_product_subcategories_cache_key` filter to allow the cache to be renamed if for instance + the site runs in multiple languages and needs a unique cache per language. #22915 +* Dev - Inactive, MU, Dropin plugins and WooCommerce.com account connection status added to System Status Report. #22887 +* Dev - Make error handling consistent in payment processing for pay page and checkout. #22916 +* Dev - Improved usage and event tracking (if opted in). #22955 +* Dev - Pass class context to woocommerce_email_styles filter. #23027 +* Fix - Use correct address for taxes when applying/removing coupons. #22802 +* Fix - Hide ratings on the shop page when reviews are disabled. #22476 +* Fix - Fix W3C validation of single product page quantity input. #22333 +* Fix - Give product variations a unique guid after creation. #22324 +* Fix - Deduct correct refunded amounts in calculated net daily sales export CSV. #22518 +* Fix - Country sorting for stores which use a language that uses a lot of accented characters, e.g. Spanish. #22417 +* Fix - Customer VAT exempt status now carries through to order when placed via checkout. #22458 +* Fix - Handle full refunds for taxes by code report. #21843 +* Fix - Option "Used for variations" should show only for variable products when saving attributes. #22524 +* Fix - Allow pa_ in product attribute slugs. #22112 +* Fix - Fix customer creation dates in API. #22269 +* Fix - Get widget instance setting defaults so it shows in customiser before save. #22345 +* Fix - PR state codes. #22339 +* Fix - Allow selecting states from the Country / State drop-down for your store address when you have the option + enabled to sell to specific countries. #22339 +* Fix - Restrict the price filter widget to filtering the main product query. #22621 +* Fix - Default placeholder image resizing. #22443 +* Fix - HTML tags should be stripped from description in Structured Data of Product. #22596 +* Fix - For logged in customers, pull default address fields from customer object, not session object, to avoid incorrect mixes of data. #22392 +* Fix - Misc tax rounding improvements. #22420 +* Fix - Respect shop page subcategories setting when `page/N/` is added to the URL. #22589 +* Fix - Check for decoded taxonomy name when unsetting product terms. #22740 +* Fix - If date paid is not set but payment complete status has passed, set it. #22735 +* Fix - Prevent webhooks for drafts, and correct create vs updated for manual orders. #22731 +* Fix - Ignore invalid default customer locations. #22357 +* Fix - The state select field was missing a placeholder. #22357 +* Fix - Fix state field rendering when customer address is not in a valid selling country. #22357 +* Fix - Correctly handle negative fees when using the REST API. #22782 +* Fix - Make sure local_pickup taxes do not hang around when local_pickup is not available for the selected location during checkout. #22826 +* Fix - Remove Plugin and Theme background installer hooks, cannot run as there are no events scheduled for it. #22799 +* Fix - Trigger zoom if moving cursor over image quickly in product gallery. #22784 +* Fix - PayPal: Add meta data, before changing order status. #22892 +* Fix - Make price filter widget tax aware when you have excl prices entered but show prices incl of tax. #22540 +* Fix - Loop attribute panels to disable options rather than look at values to prevent notices. #22891 +* Fix - When deleting zone methods, also remove setting options. #22867 +* Fix - Correctly show state fields after posting the edit address form. #22948 +* Fix - Validate coupon usage limit for manual orders correctly before order is saved. #22980 +* Fix - Make coupon code sanitization match post_title sanitization. #22945 +* Fix - Ensure WC_Helper sees plugin activation events via CLI. #22972 +* Fix - Setup wizard redirection improvements. #22977 +* Fix - Correctly show stock status for products when manually creating an order in the admin. #22997 +* Fix - After logging in update customer session ID. #23001 +* Fix - Narrow viewport css in setup wizard. #23033 +* Fix - Allow entering of date only ( no time ) when placing a singular product on sale. #22973 +* Fix - Download link URL in helper. #23146 +* Fix - Completed email wording update. #23128 +* Fix - REST API: Allow filtering by future status #23138 +* Fix - Update refund reason to make it clear process is manual. #23149 +* Fix - Hide stock status for variations when the parent is managing stock. #23069 +* Fix - Force variation product type in WC_Ajax::add_variation. #23131 +* Fix - WooCommerce writes current_theme_supports_woocommerce option on every regular page view. #23035 +* Fix - Update the rating request text in the footer to be friendlier for screen reader users. #23039 +* Fix - Null check variable before accessing its properties on checkout page. #23047 +* Fix - Recognize all input fields with ID for checkout fields. #23050 +* Fix - Avoid regenerating thumbnails on every page load. #21800 +* Fix - Changed 'private' methods on WC_Breadcrumb class to 'protected'. #23057 +* Fix - Jumping to top of page when dismissing store notice. #23066 +* Fix - Backwards compatibility issues with wc_get_template #23197 +* Fix - Remove date restriction of Facebook Plugin feature in OBW #23210 +* Fix - Updates to usage tracking logic #23231 +* Fix - Add get_post_status helper method and ensure prefix gets added for most statuses #23203 +* Fix - Add link to suggstions management #23229 +* Fix - Make usage tracking opt-out text more clear #23216 +* Fix - CSS Issues with suggestions display #23241 +* Fix - Product search may fail to return valid results when using the 'include' flag to search within a limited set. +* Fix - Change aria-labelledby to aria-label on quantity input. #23186 +* Performance - Product meta data lookup table used for sorting and slow queries. #22718 +* Performance - Prime caches when reading variations. #22587 +* Performance - Only include REST API classes and objects during `rest_api_init` hook. #22615 +* Performance - Improved how versioned transients are set/cleanup to avoid cron. #22511 +* Performance - Optimized product CSS class functions to avoid multiple product reads and duplication. #22610 +* Performance - Improved caching of template loader, product types, and layered nav widget. #22612 +* Performance - Remove external lookup of IP addresses on localhost. #22608 +* Performance - Improved speed of the `find_matching_product_variation` variation lookup function. #22423 +* Performance - Prevent frontend code from being loaded during REST API. #21090 +* Performance - Load only active webhooks on pages and allow limits to be set by developers. #22760 +* Performance - Index on downloadable_product_permissions to improve speed when fetching downloads for customers. #22906 +* Performance - Improved term ordering queries, making the sorting apply by default via the DB query rather than sorting + all terms with PHP. Removed legacy term meta table usage. #22570 +* Performance - Use day, not time, in status widget for caching. #22950 +* Performance - Improve slow term ordering by using queries instead of php. #22570 +* Performance - Removes legacy woocomerce_termmeta table and swap out all calls to legacy term meta functions to the new WP ones. #22570 +* Performance - Apply term sorting using get_terms_defaults hook instead of custom parameters. #22570 +* Performance - Use pre_get_terms hook to detect menu_order sorting param and apply to the term query. Meta sorting is now possible through WP. #22570 +* Performance - Use terms_clauses hook to support numeric name sorting and to improve the menu order sorting so it works if meta is missing. #22570 +* Performance - Added caching to System Status Report. #22887 +* Performance - Delete empty meta on update in data-stores. #22773 +* Performance - Image regeneration edge cases. #22818 +* Performance - Don’t query for an order count unnecessarily. #22984 +* Performance - Add caching to attribute functions. #22938 +* Performance - Add ability to run product lookup table updates via WP CLI. #23031 +* Localization - Modify administrative regions of Greece to default to their english ISO 3166-2 names, instead of using the native GR names. #21945 +* Localization - Added US Minor Outlying Islands as states to avoid confusion with US. #22468 +* Localization - Dutch postcode validation. #22316 +* Localization - Made municipality address field optional for Latvia. #22487 +* Localization - Added new Venezuelan currency Bs S. #22435 +* Localization - Added Danish locale. #22495 +* Localization - Update Peruvian currency. #22602 +* Localization - Update CA address format. #22692 +* Localization - Updated JP field order. #22774 + += 3.5.8 - 2019-04-16 = +* Security - Added escaping for states on the user profile screen. +* Security - Added escaping for PhotoSwipe captions. +* Security - Added escaping for SelectWoo selected options. + += 3.5.7 - 2019-03-19 = +* Security - Improved the way in which state fields are regenerated by JavaScript to ensure values are properly escaped. + = 3.5.6 - 2019-03-07 = * Fix - Removes invalid product structured data from archives, and include more data on single product pages. #22925 Product structured data should only be generated for visible data, and not on archives when there are single @@ -3246,7 +3548,7 @@ * Feature - Allow setting the product post type slug to a static (non-translatable) text, mainly to be used for translating and WPML setups. * Feature - Added lost password shortcode / email notification (thanks Max Rice). * Feature - Simplified permalink/base settings now found in Settings > Permalinks. -* Feature - Support more permalink structures (from https://codex.wordpress.org/Using_Permalinks) +* Feature - Support more permalink structures (from https://wordpress.org/support/article/using-permalinks/) * Feature - Added option to resend order emails, checkboxes select which one. * Feature - New layered nav current filters widget. This lists active filters from all layered nav for de-selection. * Feature - Added the option to sell products individually (only allow 1 in the cart). diff --git a/Gruntfile.js b/Gruntfile.js index 4406894ed30..4634f1106ea 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -88,6 +88,8 @@ module.exports = function( grunt ) { '<%= dirs.js %>/photoswipe/photoswipe.min.js': ['<%= dirs.js %>/photoswipe/photoswipe.js'], '<%= dirs.js %>/photoswipe/photoswipe-ui-default.min.js': ['<%= dirs.js %>/photoswipe/photoswipe-ui-default.js'], '<%= dirs.js %>/round/round.min.js': ['<%= dirs.js %>/round/round.js'], + '<%= dirs.js %>/selectWoo/selectWoo.full.min.js': ['<%= dirs.js %>/selectWoo/selectWoo.full.js'], + '<%= dirs.js %>/selectWoo/selectWoo.min.js': ['<%= dirs.js %>/selectWoo/selectWoo.js'], '<%= dirs.js %>/stupidtable/stupidtable.min.js': ['<%= dirs.js %>/stupidtable/stupidtable.js'], '<%= dirs.js %>/zeroclipboard/jquery.zeroclipboard.min.js': ['<%= dirs.js %>/zeroclipboard/jquery.zeroclipboard.js'] } @@ -195,7 +197,6 @@ module.exports = function( grunt ) { options: { potFilename: 'woocommerce.pot', exclude: [ - 'apigen/.*', 'vendor/.*', 'tests/.*', 'tmp/.*' @@ -228,7 +229,6 @@ module.exports = function( grunt ) { files: { src: [ '**/*.php', // Include all files - '!apigen/**', // Exclude apigen/ '!includes/libraries/**', // Exclude libraries/ '!node_modules/**', // Exclude node_modules/ '!tests/**', // Exclude tests/ @@ -245,13 +245,6 @@ module.exports = function( grunt ) { stdout: true, stderr: true }, - apidocs: { - command: [ - 'vendor/bin/apigen generate -q', - 'cd apigen', - 'php hook-docs.php' - ].join( '&&' ) - }, e2e_test: { command: 'npm run --silent test:single tests/e2e-tests/' + grunt.option( 'file' ) }, @@ -293,9 +286,6 @@ module.exports = function( grunt ) { // Clean the directory. clean: { - apidocs: { - src: [ 'wc-apidocs' ] - }, blocks: { src: [ '<%= dirs.js %>/blocks', @@ -313,7 +303,6 @@ module.exports = function( grunt ) { dist: { src: [ '**/*.php', // Include all php files. - '!apigen/**', '!includes/api/legacy/**', '!includes/libraries/**', '!node_modules/**', @@ -383,6 +372,7 @@ module.exports = function( grunt ) { ) // Replace class & constant prefixes. .replace( /WGPB_/g, 'WC_' ) + .replace( /FP_VERSION/g, 'WGPB_VERSION' ) // Replace file imports .replace( /-wgpb-/g, '-wc-' ) } @@ -436,11 +426,6 @@ module.exports = function( grunt ) { 'copy' ]); - grunt.registerTask( 'docs', [ - 'clean:apidocs', - 'shell:apidocs' - ]); - grunt.registerTask( 'contributors', [ 'prompt:contributors', 'shell:contributors' diff --git a/apigen.neon b/apigen.neon deleted file mode 100644 index 33cbe52eb1c..00000000000 --- a/apigen.neon +++ /dev/null @@ -1,20 +0,0 @@ -destination: wc-apidocs -templateConfig: apigen/theme-woocommerce/config.neon -extensions: [php] -source: - - woocommerce.php - - includes -exclude: - - includes/libraries/ - - includes/api/legacy/ -charset: [UTF-8] -main: WC -title: WooCommerce Code Reference -baseUrl: https://docs.woocommerce.com/wc-apidocs/ -templateTheme: default -php: false -sourceCode: true -tree: true -deprecated: true -todo: true -download: false diff --git a/apigen/hook-docs.php b/apigen/hook-docs.php deleted file mode 100644 index 74087e50198..00000000000 --- a/apigen/hook-docs.php +++ /dev/null @@ -1,226 +0,0 @@ -' . $hook . ''; - } - - public static function process_hooks() { - self::$files_to_scan = array(); - - self::$files_to_scan['Template Files'] = self::get_files( '*.php', GLOB_MARK, '../templates/' ); - self::$files_to_scan['Template Functions'] = array( '../includes/wc-template-functions.php', '../includes/wc-template-hooks.php' ); - self::$files_to_scan['Shortcodes'] = self::get_files( '*.php', GLOB_MARK, '../includes/shortcodes/' ); - self::$files_to_scan['Widgets'] = self::get_files( '*.php', GLOB_MARK, '../includes/widgets/' ); - self::$files_to_scan['Data Stores'] = self::get_files( '*.php', GLOB_MARK, '../includes/data-stores' ); - self::$files_to_scan['Core Classes'] = array_merge( - self::get_files( '*.php', GLOB_MARK, '../includes/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/abstracts/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/customizer/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/emails/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/export/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/gateways/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/import/' ), - self::get_files( '*.php', GLOB_MARK, '../includes/shipping/' ) - ); - - self::$files_to_scan = array_filter( self::$files_to_scan ); - - $scanned = array(); - - ob_start(); - - $index = array(); - - foreach ( self::$files_to_scan as $heading => $files ) { - $index[] = '' . $heading . ''; - } - - echo '
'; - echo '

Action and Filter Hook Reference

'; - echo '
-

This is simply a list of action and filter hooks found within WooCommerce files. View the source to see supported params and usage.

-

' . implode( ', ', $index ) . '

-
'; - - foreach ( self::$files_to_scan as $heading => $files ) { - self::$custom_hooks_found = array(); - - foreach ( $files as $f ) { - self::$current_file = basename( $f ); - $tokens = token_get_all( file_get_contents( $f ) ); - $token_type = false; - $current_class = ''; - $current_function = ''; - - if ( in_array( self::$current_file, $scanned ) ) { - continue; - } - - $scanned[] = self::$current_file; - - foreach ( $tokens as $index => $token ) { - if ( is_array( $token ) ) { - $trimmed_token_1 = trim( $token[1] ); - if ( T_CLASS == $token[0] ) { - $token_type = 'class'; - } elseif ( T_FUNCTION == $token[0] ) { - $token_type = 'function'; - } elseif ( 'do_action' === $token[1] ) { - $token_type = 'action'; - } elseif ( 'apply_filters' === $token[1] ) { - $token_type = 'filter'; - } elseif ( $token_type && ! empty( $trimmed_token_1 ) ) { - switch ( $token_type ) { - case 'class' : - $current_class = $token[1]; - break; - case 'function' : - $current_function = $token[1]; - break; - case 'filter' : - case 'action' : - $hook = trim( $token[1], "'" ); - $hook = str_replace( '_FUNCTION_', strtoupper( $current_function ), $hook ); - $hook = str_replace( '_CLASS_', strtoupper( $current_class ), $hook ); - $hook = str_replace( '$this', strtoupper( $current_class ), $hook ); - $hook = str_replace( array( '.', '{', '}', '"', "'", ' ', ')', '(' ), '', $hook ); - $loop = 0; - - // Keep adding to hook until we find a comma or colon - while ( 1 ) { - $loop ++; - $prev_hook = is_string( $tokens[ $index + $loop - 1 ] ) ? $tokens[ $index + $loop - 1 ] : $tokens[ $index + $loop - 1 ][1]; - $next_hook = is_string( $tokens[ $index + $loop ] ) ? $tokens[ $index + $loop ] : $tokens[ $index + $loop ][1]; - - if ( in_array( $next_hook, array( '.', '{', '}', '"', "'", ' ', ')', '(' ) ) ) { - continue; - } - - if ( in_array( $next_hook, array( ',', ';' ) ) ) { - break; - } - - $hook_first = substr( $next_hook, 0, 1 ); - $hook_last = substr( $next_hook, -1, 1 ); - - if ( '{' === $hook_first || '}' === $hook_last || '$' === $hook_first || ')' === $hook_last || '>' === substr( $prev_hook, -1, 1 ) ) { - $next_hook = strtoupper( $next_hook ); - } - - $next_hook = str_replace( array( '.', '{', '}', '"', "'", ' ', ')', '(' ), '', $next_hook ); - - $hook .= $next_hook; - } - - if ( isset( self::$custom_hooks_found[ $hook ] ) ) { - self::$custom_hooks_found[ $hook ]['file'][] = self::$current_file; - } else { - self::$custom_hooks_found[ $hook ] = array( - 'line' => $token[2], - 'class' => $current_class, - 'function' => $current_function, - 'file' => array( self::$current_file ), - 'type' => $token_type, - ); - } - break; - } - $token_type = false; - } - } - } - } - - foreach ( self::$custom_hooks_found as $hook => $details ) { - if ( ! strstr( $hook, 'woocommerce' ) && ! strstr( $hook, 'product' ) && ! strstr( $hook, 'wc_' ) ) { - //unset( self::$custom_hooks_found[ $hook ] ); - } - } - - ksort( self::$custom_hooks_found ); - - if ( ! empty( self::$custom_hooks_found ) ) { - echo '

' . $heading . '

'; - - echo ''; - - foreach ( self::$custom_hooks_found as $hook => $details ) { - echo ' - - - - ' . "\n"; - } - - echo '
HookTypeFile(s)
' . self::get_hook_link( $hook, $details ) . '' . $details['type'] . '' . implode( ', ', array_unique( $details['file'] ) ) . '
'; - } - } - - echo '