Develop WC

The official WooCommerce development blog

WooCommerce 2.5 Beta 1 — November 9, 2015

WooCommerce 2.5 Beta 1

WC 2.5 codename “Dashing Dolphin” has been tagged for testing. This release has seen a short development cycle of ~3 months and comprises of ~1000 commits from 21 contributors.

You can download beta 1 here.

Release Highlights

2.5 mostly contains enhancements to existing functionality, but we have added some new features which developers will appreciate such as WP CLI support!

The WooCommerce CLI (command line interface) lets you perform many actions on your store via the command line, such as creating customers and coupons. This should be useful for power users.

WooCommerce CLI in action

The post here has more details on the CLI.

The WooCommerce REST API has been further enhanced with some new endpoints:

  • /products/shipping_classes to update product shipping classes.
  • POST, PUT, and DELETE for product categories and tags.
  • Added support to filter products by tag, category, shipping class, and attribute.
  • Added tax and tax_class endpoints for setting tax rates.

The REST API documentation will be updated with this new endpoints soon.

For performance and scalability reasons we’re introducing a new session handler which uses custom tables, rather than the WordPress options table. You can read more about this feature here.

Also related to performance, we’ve improved the way in which verified reviews are stored and retrieved, and we’ve improved backend searches.

Some admin screens have been tweaked; most notably the tax settings screen which is now ajax enhanced/faster and supports search.

2015-11-04 at 14.28.png
Ajax powered with inline search

The email settings screen has also been tweaked to remove the sub-navigation links in favour of a table.

2015-11-04 at 14.29
Emails are shown in a neat table in 2.5

The checkout and order flows have also had some adjustment:

  • When only 1 gateway is enabled, the radio buttons will be hidden.
  • We now only display the coupon form on the checkout if a coupon hasn’t yet been applied.
  • We have added a handy ‘pay’ link to the order screen which you can send to customers.
  • We have added the terms and conditions checkbox to the pay page, which was previously only shown on checkout.
  • Password strength indicators are now displayed on checkout when creating an account.
  • If payment fails, admin will receive an email.
  • When a WordPress user is deleted, their orders turn into guest orders.
  • When calculating order taxes, tax settings are respected and default to the base country.
  • Order notes are added to record manual email sends to customers.

Other notable tweaks include:

  • Variations are now generated in a logical order using a new wc_array_cartesian function.
  • Variations will fade in to avoid the initial ‘flicker’ during page load.
  • Reports now show both net and gross averages.
  • The welcome screen is no more.

You can see the full changelog in the readme file.

Template changes

For frontend templates we’ve changed some files to make templating more flexible:

  • Product archive anchors are now hooked into templates rather than hard coded.
  • We’ve added template files for the customer details list in emails (emails/email-customer-details.php)
  • Revised single variation cart template. Template files now exist for variations, and the cart button will display (disabled) when no selections are made.
  • New star ratings. The old one was 5 separate buttons. This new one consolidates the 5 options into one element making it leaner visually and more intuitive. Works in IE9+ with a graceful degradation for IE8.

The following template files have been version bumped in 2.5 and may require theme updates:

  1. single-product/review.php – Added new action hooks + verified reviewer code
  2. single-product/add-to-cart/variable.php – Correctly escape variation data.
  3. order/order-details.php – woocommerce_purchase_note_order_statuses filter.
  4. order/order-details-item.php – woocommerce_purchase_note_order_statuses filter.
  5. loop/add-to-cart.php – Uses supports_ajax_add_to_cart method.
  6. global/quantity-input.php – Changed min and max attributes.
  7. content-widget-product.php – File was missing version.
  8. content-product.php – Action hooks to handle anchor output.
  9. content-product_cat.php – Action hooks to handle anchor output.
  10. checkout/payment.php – Support for new terms.php template file.
  11. checkout/form-pay.php – Support for new terms.php template file.
  12. cart/mini-cart.php – URL escaping.
  13. cart/cart-shipping.php – Extra filters and some simplification of strings.

The following template files are new in 2.5.0:

  1. single-product/add-to-cart/variation.php
  2. single-product/add-to-cart/variation-add-to-cart-button.php
  3. emails/email-customer-details.php
  4. emails/plain/email-customer-details.php
  5. emails/admin-failed-order.php
  6. product-searchform.php
  7. checkout/terms.php

Release Schedule

Beta 1 is out today (Nov 9th) and the beta testing period will run through to the end of the year to avoid a release during the holiday season. Subsequent betas will be released as needed.

If all goes to plan, Release Candidate 1 will be tagged sometime between Jan 4th–8th 2016, with the final release dropping a week later.

How to beta test

We posted a nice little write-up on beta testing here which should get you started. Please read that and jump right in!

WooCommerce 2.4.9 security and fix release —

WooCommerce 2.4.9 security and fix release

The WooCommerce 2.4.9 release is now available on or automatic update in your administration panel. A total of ~18 commits made it into this release fixing a few small issues, the main one being the error handling in our Geo IP library. See the changelog for the full details.

An XSS issue within the price.php template file was also fixed, however this one would require edit/admin permissions to take advantage of. The template version was bumped just in case, so if you’ve overridden this file you’ll want to update your copy. See this commit.

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.

WooCommerce 2.4.8 fix release — October 26, 2015
New session handler in 2.5 — October 7, 2015

New session handler in 2.5

Being stateless, WordPress doesn’t have an in-built way of handling session data. You can use cookies. You can implement PHP Sessions, but both have limitations and some hosts aren’t equipped to deal with them by default.

Early on we decided to adopt a solution based on whereby you have a cookie to identify each user, and have their session data stored in the WP options table. This worked well, and has served us nicely until now. There are however some drawbacks to this solution:

  • It’s hard to clear sessions since the options table contains other data
  • Scalability – Lots of sessions & transients mean slower queries on the options table
  • Performance – as above

The Github issue identifying these problems is here.

For the past few months some of the community, and Gerhard Potgieter who manages the store, have been experimenting with a custom session handler to work around these issues. At it’s core, it is pretty similar to our existing solution. However, it uses custom tables to store the data instead of the WP options table.

woocommerce-large-sessions has actually been running without issue on a few months now, so we’ve decided it is time to roll that into WooCommerce core.

A slightly modified version of the above has now been merged into 2.5 and is ready to test. If you would like to test the new session handler, just download master from Github.

Note: you may need to reactivate WooCommerce for the new table to be created.

We look forward to your feedback!

Sneak Peek: WP CLI Support in WooCommerce 2.5 — October 1, 2015

Sneak Peek: WP CLI Support in WooCommerce 2.5

WP CLI support is one of the features that’s included in WooCommerce 2.5 milestone. In case you haven’t heard WP-CLI:

WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser.

All WooCommerce related commands are grouped into wp wc command:

$ wp wc
usage: wp wc coupon 
   or: wp wc customer 
   or: wp wc order 
   or: wp wc product 
   or: wp wc report 
   or: wp wc tool 

See 'wp help wc <command>' for more information on a specific command.

Currently, following commands are available:

  • Coupon
    $ wp wc coupon
    usage: wp wc coupon create [--<field>=<value>] [--porcelain]
       or: wp wc coupon delete <id>...
       or: wp wc coupon get [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc coupon list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc coupon types
       or: wp wc coupon update <coupon> --<field>=<value>
    See 'wp help wc coupon <command>' for more information on a specific command.
  • Customer
    $ wp wc customer
    usage: wp wc customer create [--<field>=<value>] [--porcelain]
       or: wp wc customer delete <customer>...
       or: wp wc customer downloads [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc customer get [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc customer list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc customer orders [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc customer update <customer> --<field>=<value>
    See 'wp help wc customer <command>' for more information on a specific command.
  • Order
    $ wp wc order
    usage: wp wc order create [--<field>=<value>] [--porcelain]
       or: wp wc order delete
       or: wp wc order get [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc order list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc order update <id> --<field>=<value>
    See 'wp help wc order <command>' for more information on a specific command.
  • Product
    $ wp wc product
    usage: wp wc product category 
       or: wp wc product create [--<field>=<value>] [--porcelain]
       or: wp wc product delete <id>...
       or: wp wc product get [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc product list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc product reviews [--field=<field>] [--fields=<fields>] [--format=<format>]
       or: wp wc product types
       or: wp wc product update <id> --<field>=<value>
    See 'wp help wc product <command>' for more information on a specific command.
  • Report
    $ wp wc report
    usage: wp wc report list [--format=<format>]
       or: wp wc report sales [--field=<field>] [--fields=<fields>] [--format=<format>] [--period=<period>] [--date_min] [--date_max] [--limit]
       or: wp wc report top_sellers [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--period=<period>] [--date_min] [--date_max] [--limit]
    See 'wp help wc report <command>' for more information on a specific command.
  • Tool
    $ wp wc tool
    usage: wp wc tool clear_transients
    See 'wp help wc tool <command>' for more information on a specific command.

Here’s the demo of WooCommerce CLI in action:


In case a command is not obvious to you, appending --help should give you more information about the command.

This feature is available in master branch. If you find the feature is useful in the next release, we encourage you to checkout the branch, test it, and report any issues to our GitHub’s issues tracker.

WooCommerce 2.4.7 fix release available — September 21, 2015

WooCommerce 2.4.7 fix release available

The WooCommerce 2.4.7 release is now available via or automatic update in your administration panel. A total of 164 commits made it into this release.

Here are the highlights:

  1. For geolocation with static cache support, ensure hash is appended during form submission.
  2. Remove use of ‘input’ event in checkout scripts to prevent IE11 triggering updates on placeholder change.
  3. Added missing monthly cron schedule.
  4. Only run maybe_set_cart_cookies if cart was loaded to prevent notices.
  5. Escape add to cart messages to stop translations from breaking cart events.
  6. AJAX variations not being found in some cases when product version was < 2.4, but attributes were updated after sync().
  7. To prevent discounts being applied in ‘random’ order (based on order added to cart), sort cart items based on subtotal during calculate_totals.
  8. We changed the way prices are cached for variable products.

We also made some smaller fixes and tweaks based on feedback. See the changelog for details.

Not shown above, we’re also experimenting with a method of keeping prices the same regardless of tax rate (some systems call this universal pricing). This is experimental and subject to change, but to enable this functionality you can use add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_true' ); Use at your own risk though!

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.

Moving languages packs to — September 17, 2015

Moving languages packs to

Recently an announcement was made that plugins could soon make use of Language Packs, the same way in which core and themes do. This makes it easier for users to obtain translations (they are downloaded along with the plugin), lets everyone translate in the same place ( and lets all plugins share a translation memory.

With the new language pack system, you’ll be able to update/install any translation from your WordPress dashboard within the “Updates” screen:


Up until now, WooCommerce has had its own custom language pack system implemented in 2.2, with our translations being hosted on Transifex. We’re like to move this over to .org as soon as possible.

Starting today, we’ll no longer update the languages packages within the Transifex and the 2.4.8 WooCommerce release will no longer include our custom language pack downloader.

Our new translations are located here.

If you’re like to contribute to translation going forward, or if you are maintaining a translation already, it’s important you start doing this now on WordPress will only install translations that are complete, with all strings revised.

If you are a translation reviewer today at Transifex or would like to be a reviewer, please leave a comment (see example below) with your username and which language you would like to be reviewer.

pt_BR – @claudiosanches


If you would like to learn more about how translation works in the new system with GlotPress, see this post.

Thanks to all of our contributors :)


Get every new post delivered to your Inbox.

Join 2,939 other followers