• WooCommerce brings many improvements to the WP-CLI powered command-line interface we introduced back in WooCommerce 2.5.

    WP-CLI is a set of command-line tools for managing WordPress installations Our WC-CLI layer adds tools for managing products, coupons, payment gateways, shipping zones, and much more.

    In WooCommerce 2.5 and 2.6, the CLI was powered by it’s own separate code. This code was separate from the REST API or WC core, meaning code could end being duplicated across the code base, or it meant that certain things possible in the REST API were not possible at all with the CLI.

    2.7 introduces a new CLI powered by the REST API. We did this by forking Restful. This reduced the amount of code be need to maintain, provides a lot more power and commands, and means that the commands will always be current as we improve our REST API in the future.

    Currently, following commands are available with list, get, update, and create operations:

    wp wc customer 
    wp wc customer_download 
    wp wc order_note 
    wp wc payment_gateway 
    wp wc product 
    wp wc product_attribute 
    wp wc product_attribute_term 
    wp wc product_cat 
    wp wc product_review 
    wp wc product_shipping_class 
    wp wc product_tag 
    wp wc product_variation 
    wp wc shipping_method 
    wp wc shipping_zone 
    wp wc shipping_zone_location 
    wp wc shipping_zone_method 
    wp wc shop_coupon 
    wp wc shop_order 
    wp wc shop_order_refund 
    wp wc tax 
    wp wc tax_class 
    wp wc tool 
    wp wc webhook 
    wp wc webhook_delivery 
    

    There is a wiki page containing more information and examples. We’ll also work on generating documentation similar to our REST API documentation for each command. You can also use the —help flag to find out each commands parameters.

    Please test out the new CLI commands and provide feedback or bug reports on GitHub!


  • The WooCommerce 2.6.9 security/fix release is now available. You can download it on WordPress.org or as an automatic update in your administration panel.

    ~44 commits made it into this release fixing several minor issues and taking care of some security hardening.

    The main change was that we updated WooCommerce for compatibility with WordPress 4.7 and the new Twenty Seventeen theme!

    The full changelog for 2.6.9 is below.

    * Theme - Added support for Twenty Seventeen Theme.
    * Fix - Excluded webhook delivery logs from comments count.
    * Fix - Included password strength meter in "Lost Password" page.
    * Fix - Order fee currency in admin screen.
    * Fix - Variation selection on Firefox 40.
    * Fix - Don't prevent submission when table is not found on cart.
    * Fix - Improved layered nav counts on attribute archives.
    * Fix - Fixed pagination when removing layered nav items via widget.
    * Fix - Default BE tax rate.
    * Fix - Downloads should store variation ID rather than product if set. Also fixes link on account page.
    * Fix - Use wp_list_sort instead of _usort_terms_by_ID to be compatible with 4.7.
    * Fix - Only return empty string if empty for weight and dimension functions.
    * Security - Wrapped admin tax rate table values in _escape to thwart evil CSVs an admin user could upload. Vulnerability was discovered by Fortinet’s FortiGuard Labs.
    * Dev - API - Only update categories menu order and display if defined.
    * Dev - Fixed when should deliver wp_trash_post webhooks.

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • We’ve made a small update today (WooCommerce 2.6.8) to fix a few issues. You can download it on WordPress.org or as an automatic update in your administration panel.

    This release had ~14 commits.

    1. Fixed an issue where REQUEST_URI was missing a trailing slash during comparison in our page caching functions.
    2. Fixed an issue where empty prices were sent to PayPal.
    3. Fixed email validation on the account page.

    We also took the opportunity to update our extensions screen so it’s a bit more modern.

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • We’ve made a small update today (WooCommerce 2.6.7) to fix a few issues. You can download it on WordPress.org or as an automatic update in your administration panel.

    This release had ~11 commits.

    1. Fixed an issue where users without permissions to view reports, but could manage other parts of WooCommerce such as orders, could see the reports widget on the dashboard.
    2. Use FLOOR and CEIL to get price filter values. Fixes the issue where max price is capped at 99 in the price filter.
    3. Improved credit card fields for better mobile experience using TEL fields.
    4. Remove notices only once on cart so subsequent notices do not remove older notices.

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • We’ve made a small update and released WooCommerce 2.6.6 today to fix a potential conflict with extensions. You can download it on WordPress.org or as an automatic update in your administration panel.

    Only ~2 made it into this release to fix:

    1. A conflict with Local Pickup Plus due to 2.7.x code making it into the 2.6.x branch. This went unnoticed due to core not using the function with the error.
    2. The sort order of shipping methods was not being respected on the cart.

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • The WooCommerce 2.6.5 fix release is now available. You can download it on WordPress.org or as an automatic update in your administration panel.

    ~82 commits made it into this release fixing several minor issues. The main changes are as follows.

    1. The ship to specific countries setting actually did nothing since 2.6.0. This has now been hooked up and made functional.
    2. We fixed the webhook delivery for manual orders by fixing the way dates are handled.
    3. Fixed some oddities around variation saving and the attributes being empty on the frontend when using ‘all’ attributes.
    4. Made the processing email send when the order goes from on-hold to processing. This can sometimes happen with PayPal orders which are delayed.
    5. Improved and fixed some validation functions on the my account screen.

    The full changelog for 2.6.5 is below.

    * Fix - Shipping classes URL in admin.
    * Fix - Notice in reports when using custom date ranges.
    * Fix - When checking needs_shipping, ignore anything after : in the method ID.
    * Fix - Allow has_shipping_method to work with instances.
    * Fix - Potential notice in wc_add_to_cart_message().
    * Fix - Prevent notice in wpdb_table_fix if termmeta table is not used.
    * Fix - Payment method box fixes e.g. maintain previously selected payment method after update.
    * Fix - Prevent multiple password validation methods at once on my account page.
    * Fix - Ship to specific counties option had no effect.
    * Fix - Broken Webhook delivery due to use of post_date_gmt which does not exist for drafts.
    * Fix - Use method title in admin shipping dropdown.
    * Fix - Fixed downloadable variable product URL.
    * Fix - Handle object when generate_cart_id is used to prevent notices.
    * Fix - Set header link color in emails.
    * Fix - Rest of the world ID 0 zone handling when using CRUD classes.
    * Fix - Cast prices as decimal when querying prices in price filter widget.
    * Fix - API - Fix coupon description field.
    * Fix - API - ID needs to be capitalized to allow correct sorting.
    * Fix - API - Fixed undefined order ID.
    * Fix - API - Allow API to save refund reason.
    * Fix - API - Resolved encoding issues with attribute and variation slugs.
    * Fix - API - get_attributes should return term name, not slug.
    * Fix - API - Product "filter" and "sku" paramaters.
    * Fix - Handle info notices in cart, not just error messages.
    * Fix - Don't remove hyphens in attribute labels.
    * Fix - Start sales on variations after they are saved, if applicable.
    * Fix - Made the text showing max variations you can link match the actual filtered value.
    * Fix - Add missing tables to wpmu_drop_tables function.
    * Fix - When syncing variation stock, ensure post is a variation.
    * Fix - Resolved some sales by date sum issues.
    * Fix - Fix cart update in IE when enter key is pressed.
    * Fix - Variation is_on_backorder when parent manages stock.
    * Fix - Fix variation script malfunctioning when show_option_none arg is set to false.
    * Fix - Fire tokenisation event on load for pay page.
    * Fix - Populate attribute dropdown when empty.
    * Fix - Fix email check on my account page.
    * Fix - Send processing email on on-hold to processing transition.
    * Fix - Incompatibility with SQLite databases.
    * Fix - KGS and ISK currency symbols.
    * Tweak - Password reset now uses WP functions.
    * Tweak - Format US 9-digit postcodes.

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • The WooCommerce 2.6.4 fix/security release is now available. You can download it on WordPress.org or as an automatic update in your administration panel.

    ~20 commits made it into this release fixing several minor issues. The main changes are as follows.

    • The REST API image upload feature has been locked down to only allow images, vs all supported WordPress MIME types.

    • There was an issue in COD where shipping method titles were missing.
    • WC_ROUNDING_PRECISION constant was removed but put back for plugin compatibility reasons.

    The full changelog for 2.6.4 is below.

    * Fix - Security - Only allow image MIME type upload via REST APIs.
    * Fix - Shipping method title display in COD settings.
    * Fix - Order date input in Edge browser.
    * Fix - Ensure value is not null in variations to support empty show_option_none setting.
    * Fix - get_the_title does not need escape in grouped template file.
    * Fix - Ensure WC_ROUNDING_PRECISION is defined and use it as a low precision boundary in wc_get_rounding_precision().
    * Fix - Response body should be a string in webhook class.
    * Fix - Use h2 instead of h3 headings in profile screen.
    * Dev - API - Allow Allow meta_key/value filters for products.
    * Dev - CLI - Explode tags and category IDs to allow multiple comma separated values.
    * Dev - add $order arg to woocommerce_admin_order_item_class and woocommerce_admin_html_order_item_class filters..

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • The WooCommerce 2.6.3 fix/security release is now available. You can download it on WordPress.org or as an automatic update in your administration panel.

    ~104 commits made it into this release fixing several minor issues and a potential security issue. The main fixes/updates are as follows.

    • Securify reported an issue with the way captions were shown within PrettyPhoto. Due to double-escaping, captions could be treated as HTML allowing for XSS attacks. However, this would require the admin to upload a malicious image to exploit. The affected template files were patched and the version numbers bumped.

    • There was an issue with layered nav counts when used in conjunction with search.
    • We added transient based caching to the comment count functions to improve page loading speed in admin.

    The full changelog for 2.6.3 is below.

    * Fix - Security - Escape captions in product-thumbnail and product-image templates (template versions have been bumped).
    * Fix - Fixed how we calculate shipping tax rates when using more than one tax class.
    * Fix - When duplicating product variations, set title, name, and guid.
    * Fix - Normalized 'read more' buttons.
    * Fix - Add to cart notices for grouped products.
    * Fix - Do not sanitize passwords in the settings API.
    * Fix - Handle shipping zone location range conversion during update (dashes to ...).
    * Fix - Always remove commas while processing flat rate costs.
    * Fix - Ensures account page layout is only applied to desktop-sized displays.
    * Fix - When getting layered nav counts, take search parameters into consideration.
    * Fix - Free shipping show/hide javascript.
    * Fix - Strip hash characters when exporting reports.
    * Fix - Use permission id to revoke access to downloads to prevent removing wrong rows.
    * Fix - When duplicating product variations, set title, name, and guid.
    * Fix - Set more appropriate default rounding precision based on currency decimal places.
    * Fix - Fix message styles for empty carts.
    * Fix - Fixed the load of the WC_Email_Customer_On_Hold_Order class.
    * Fix - Don't perform cart update on search submit.
    * Dev - API - Added support for WP REST API with custom URL prefixes.
    * Dev - API - Delete variations when deleting a variable product.
    * Dev - API - Fixed how we check for product types.
    * Dev - Added woocommerce_cart_id filter.
    * Dev - Add shortcode name param to shortcode_atts function calls.
    * Dev - Post custom data when fetching a variation via ajax.
    * Dev - Include child prices in grouped_price_html filter.
    * Dev - Allow filtering of variation stock quantity.
    * Dev - Added $_product argument to 'woocommerce_restock_refunded_item' hook.
    * Dev - Added a filter hook for the wc_ajax endpoint url.
    * Tweak - Include account page link in new customer account emails.
    * Tweak - Updated all URLs from WooThemes.com to woo.com.
    * Tweak - Cache the result of WC_Comments::wp_count_comments() in a transient (improves performance).

    If you spot any further issues, please report them to us in detail on GitHub so the development team can review – comments on this post are closed.


  • The WooCommerce 2.6.2 fix release is now available. You can download it on WordPress.org or as an automatic update in your administration panel.

    ~140 commits made it into this release fixing several minor issues and making some smaller tweaks. The main fixes/updates are as follows.

    • We’ve made the password reset process redirect to the form and set a cookie containing the reset token and username to prevent password tokens being leaked via the page’s referer headers.
    • Some users didn’t like the change showing ‘in stock’ when not managing stock levels. Due to this we’ve made it so ‘in stock’ in hidden when not managing stock levels, but ‘out of stock’ is shown when that status is explicitly set.
    • We’ve improved the coupon logic so that product coupons not valid for the current cart are not applied, rather than just having no discount value.
    • We’ve made some tweaks the descriptions on the zones screen, and made it so zones can match postcodes without having a country assigned to them. Also, if no locations are set on a zone, it will now be listed as being for ‘everywhere’.
    • To allow my account page tabs to be disabled without code, you can now set the endpoint value to a blank string.

    The full changelog for 2.6.2 is below.

    * Fix - Set max index length on woocommerce_payment_tokenmeta table for utf8mb4 support.
    * Fix - is_available check for legacy shipping methods.
    * Fix - wc_add_to_cart_message() when non-array is passed.
    * Fix - Maximum coupon check should allow the 'maximum' value.
    * Fix - Product coupon logic to avoid applying non-applicable coupons.
    * Fix - Potential notices when leaving out 'default' field for shipping instances.
    * Fix - wp_cache_flush after term meta migration/update.
    * Fix - wc_add_to_cart_message() when non-array is passed.
    * Fix - woocommerce_redirect_single_search_result type check was incorrect.
    * Fix - Javascript show/hide of option in free shipping method.
    * Fix - Convert ellipsis to three periods when saving postcodes.
    * Fix - Prevent get_terms returning duplicates.
    * Fix - Removed non-existent country (Netherlands Antilles) from https://en.wikipedia.org/wiki/ISO_3166-1.
    * Fix - Grouped product range display when child is free.
    * Fix - Remove discount when checking free shipping min amount.
    * Fix - Prevent blocking the same element multiple times on cart page.
    * Fix - Don't sync ratings right after a new comment to prevent rating sync whilst rating meta does not exist yet.
    * Fix - Fix product RSS feeds when using shop base.
    * Fix - woocommerce_local_pickup_methods comparison by stripping instance IDs before the check.
    * Fix - During password resets, use cookie to store reset key and user login to avoid them being exposed in the URL/referer headers.
    * Dev - API - Fixed variable product stock at product level.
    * Dev - CLI - Introduces woocommerce_cli_get_product_variable_types filter.
    * Dev - Allow notices to be grouped on checkout after certain events.
    * Tweak - Made customer pay link display if order needs_payment() rather than checking pending status.
    * Tweak - Zones - Wording clarifications.
    * Tweak - Zones - Match zones with postcodes but no country.
    * Tweak - Zones - Match zones with no regions as 'everywhere'.
    * Tweak - Added view_admin_dashboard cap for disabling the admin access restriction in custom roles.
    * Tweak - Revised stock display based on feedback to hide 'in stock' message if stock management is off and only show available on backorder if notifying customer.
    * Tweak - Allow external product SKUs.
    * Tweak - PT (Portugal) and JP (Japan) postcode formats.
    * Tweak - Sort products from the [product_category] shortcode by menu order.
    * Tweak - Improve wc_orders_count() performance by running a query to count only posts of the given status.
    * Tweak - To allow my account page tabs to be disabled without code, you can now set the endpoint value to a blank string.

    If you spot any further issues, please report them to us in detail on Github so the development team can review – comments on this post are closed.


  • The WooCommerce 2.6.1 fix release is now available. You can download it onWordPress.org or as an automatic update in your administration panel.

    ~43 commits made it into this release fixing several minor issues and making some small tweaks to things such as the updater. The main fixes/updates are as follows.

    • Our background updater relies on a wp_remote_post to call itself and on some installs (such as those behind a security plugin or password) this may fail. As a fallback we also have a cron job, however, we’ve discovered some user’s sites do not have working cron (!) causing the updater to never run. To combat this, 2.6.1 includes a a manual ‘run updater’ link in the notice which will trigger the update.
    • Users using commas in their currency and creating orders manually in the backend were seeing totals miscalculated. This has been resolved.
    • A use case where items are free, but shipping was paid, was not supported by the PayPal Standard gateway. This has been fixed by sending shipping as a line item when this occurs.
    • We’ve fixed support for ‘skus’ on our shortcodes.
    • We’ve fixed layered nav counts when WP term splitting has not kicked in yet (causing term_ids to differ from term_taxonomy_ids).
    • Theme devs take note, we updated the content-product.php and content-product_cat.php  in 2.6 to handle the loop classes differently, but forgot to bump the template version. We’ve done that now. You may need to update your versions to match.

    The full changelog for 2.6.1 is below.

    * Fix - Added missing localized format for line taxes in orders screen to prevent total miscalculation in manual orders.
    * Fix - Improved the hour and time fields validation pattern on the orders screen.
    * Fix - PayPal does not allow free products, but paid shipping. Workaround by sending shipping as a line item if it is the only cost.
    * Fix - SKUs prop on products shortcode.
    * Fix - Layered nav counts when term_id does not match term_taxonomy_id (before splitting).
    * Fix - Fixed referer links from cart messages in WP 4.4.
    * Fix - Fix the showing/hiding of panels when terms do not exist by using wc_get_product_types() for retrieving product types.
    * Dev - content-product.php and content-product_cat.php contained the wrong version.
    * Dev - Show "matching zone" notice on the frontend when shipping debug mode is on.
    * Dev - Restored missing WC_Settings_API::init_form_fields() method to prevent potential errors in 3rd party gateways.
    * Dev - API - Fixed returned data from product images (changed title to name).
    * Dev - API - Fixed products schema for grouped_products.
    * Dev - API - Fixed products attribute options when contains ,.
    * Tweak - Hide 'payment methods' screen if no methods support it.
    * Tweak - If shipping method count changes, reset to default.
    * Tweak - Avoid normalization of zone postcodes so wildcard matching can be performed on postcodes with spaces. E.g. SP1 *
    * Tweak - Allow max_fee in addition to min_fee in flat rate costs fields.
    * Tweak - Wrap order_schema_markup() output in hidden div in case script tag is stripped.

    If you spot any further issues, please report them to us in detail on Github so the development team can review – comments on this post are closed.