Version 2.7 beta 1 now available

Easy Digital Downloads version 2.7 is getting close to being ready. Today we’re happy to announce the first beta version of the release.

There are numerous significant improvements in 2.7 and we would like to encourage all theme and plugin developers, as well as store owners, to test the beta version as soon as possible so that we can ensure the final release goes smoothly.

To ensure that the update to version 2.7 goes smoothly, we need as many people as possible to help test the beta. This release includes more than 550 commits, so there is a ton to test. Every bug that we catch between now and the final release is one less problem for live sites.

Testing the beta

To ensure that the update to version 2.7 goes smoothly, we need as many people as possible to help test the beta. Every bug that we catch between now and the final release is one less problem for live sites.

Please do not test this beta on a live site. We highly recommend using a staging site. You can find our guide to set up a local testing environment here.

The latest version of the beta may be downloaded from GitHub.

Important changes

Cart API

We’ve introduced a new API for the cart which handles all the cart actions and functions.  It has been designed to be significantly more efficient than our previous implementation of the cart.

The EDD_Cart API provides a centralized way to manipulate the cart; prior to 2.7, all interactions with the cart occurred via edd_cart_ functions. We have always provided many ways for extensions to filter cart data, though each call to an edd_cart_ function resulted in those filters being run repeatedly. The EDD_Cart API has been built to minimize those calls, ensuring that filters only need to be run once. This led to significant improvement to the page load time for the checkout from 2.6865 seconds to 0.8456 seconds.

Significantly faster reporting and querying

In 2.7 we have completely rewritten the way reports are queried.  Previously, we were creating a lot of unnecessary objects resulting in extremely high memory usage and slow load time.  This release introduces queries made directly to the database hence requiring very little processing of data.

On our own site, running a report from Jan 1 2012 to Jan 1 2017 took over three minutes previously, now the entire report and page loads in 1-2 seconds with a fraction of the database queries and memory usage.

Introduction of edd_get_payment()

A new function has been introduced to act as a wrapper method for retrieving an instance of an EDD_Payment object in lieu of creating an instance by accessing the class directly.

The edd_get_payment() function works with the object cache to improve performance of retrieving payments.  The new function accepts the same parameters as the constructor of EDD_Payment but also returns false if a payment was not found (i.e. incorrect payment ID was specified).

Redesigned View Order Details Page

The View Order Details page that can be accessed from Downloads → Payment History has received a major overhaul to simplify changing the customer on a payment and allowing individual item price manipulation.

The redesigned screen allows alteration of the item price, tax, and quantities (if enabled).  It has been redesigned to allow alteration of the data in a more structured way.

We have made UX improvements for the way a customer on a payment record is changed.  We’ve added a link “Assign to another customer” which displays a dropdown of customers the payment can switched over to or the user can choose “New Customer” where they would enter the name and email address of the customer.

CSV Earnings Report

EDD 2.7 introduces a new CSV Earnings Report which replaces our old Sales and Earnings PDF Report. The new report details sales and refunds, as well as revoked, abandoned, failed, and cancelled payments over a period of time.

Discounts API

Another new API we are introducing in 2.7 is the EDD_Discount API.  It has been designed to simplify handling discount codes and follows the same model to that of EDD_Payment making altering a discount simple too. Previously, all discount interaction was handled through the edd_discount_ functions, resulting in the creation of a new object each time a function was called.  Now, a single instance of EDD_Discount holds everything about that discount code making discounts more efficient in general.

Variable Pricing for Bundles

Variable pricing for bundles works the same way that it does for regular downloads. Previously, variable pricing was not an option for bundles. This new feature in 2.7 also allows for download variants to be tied to bundle variants.

With the configuration above, we have a download named Download Bundle which consists of three variable prices: Regular, Plus, and Business. We have three separate downloads: Download [D1], Download [D2] and Download [D3].  Bundle variation pricing allows Download [D1] to only be accessible to customers who purchase the Plus variant of the bundle.

If a customer purchased the Business variant of the bundle, viewing the order details on Purchase History would look like this:

Notice that Download [D3] – Business is also displayed and the business variant of Download [D3] has the price assignment set to All meaning that download will be available regardless of the variant chosen.

It should be noted that to allow for this to work, template changes have been made to shortcode-receipt.php to display bundle variations and the download files correctly.  As bundles work differently than regular downloads, this template change was necessary.

The lines altered in the template file are here.

Complete Abandoned/Pending Purchases

EDD 2.7 allows users to resume incomplete purchases on subsequent visits. This includes both completing abandoned purchases and resubmitting purchases which may not have completed successfully when initially submitted.

An example scenario is as follows:

  • Customer adds items to their cart
  • Customer goes through the checkout with PayPal, but does not complete it on the PayPal end (and does not click ‘Cancel and Return to Site’)
  • Customer visits their ‘Purchase History’ page and finds the newly added pending payment
  • A ‘Complete Purchase’ button will appear allowing the customer to checkout with PayPal and complete the transaction.

Exporting Logs

EDD makes heavy usage of logs when specific actions are triggered.  EDD 2.7 allows you to export sales, downloads and API request logs across a period of time.

The logs can be exported from the Downloads → Report → Export page

An example of a log showing API requests

Other notable improvements

The changes above are the primary features we’d like to highlight, but there are other important improvements as well.

  • The applied tax rate is now saved in the payment meta and displayed on the View Order Details screen
  • Selected image size is now inserted into File URL field in Download Files box
  • Messages registered with edd_set_error are now output via a hook
  • Improved WP-CLI payment creation to support a date range
  • Quantity fields can now be disabled on individual download products
  • EDD_Payment and edd_get_payment now accept a payment transaction ID
  • Introduced a more EDD-specific downloads shortcode [[edd_downloads]]
  • Moved edd-ajax.min script to footer to allow async loading of jQuery
  • Added a ‘Refresh Reports’ button to the graph view
  • Switched to using new IPN endpoints for PayPal Standard
  • Zip / postal code now included in tax calculation function
  • Improved the fault tolerance and error handling of creating discount codes
  • The HTML markup of the profile editor has been updated to match other forms in EDD

Notable bugs fixed

  • EDD_License did not properly support item_id
  • Earnings by Category estimates were not correct
  • Stopped redirect to PayPal on Buy Now buttons if PayPal gateway is disabled
  • Amazon Gateway settings are now checked before loading the scripts for Amazon Payments
  • The edd_download_redirect_to_checkout filter wasn’t respecting the desired outcome in some configurations
  • The payment notes were included in normal comment count
  • Disabling API request logging was not working
  • The history-downloads.php template was not properly showing variable price names
  • When adding fee to cart, we now preserve the decimal precision
  • Recounting store stats now resets the report transients
  • Multi-option purchase mode and variable prices work better with buy now buttons

As with any release, there are always bugs to fix. In 2.7 beta 1 we have fixed 26 bugs.

At this time, we hope to release version 2.7 on or near 13th February 2017.

Translators note: 2.7 has been pushed to trunk on WordPress.org and is now available for translation updates via translate.wordress.org.

Have a question or comment? Think you found a bug? Let us know by leaving a comment below!

7 responses... add one

Hi;

Thanks for the in-depth write up of the changes! I’ve taken a quick look at the beta release, specifically to look at some integrations I have with cart, and discount functions. As far as I can see the existing functions have been preserved, and updated to be wrappers around the EDD_Cart / EDD_Discount classes. However, it doesn’t look like the existing functions have been deprecated (e.g. edd_store_discount() / edd_get_cart_details() ). Are they expected to be maintained fully supported in 2.7, deprecated in a future release and finally removed in a further future release?

Wow, really impressive performance improvements, well done !!

And thanks for all the other improvements as well !

Congrats to the whole team!

I was just noticing the other day how the checkout page on my site seemed to be a bit sluggish compared to everything else, excited to see the improvements!

Leave a Reply

Your email address will not be published. Required fields are marked *