If you were not already aware, the Easy Digital Downloads team has made a commitment to improving the performance of our platform by introducing custom database tables for data we deem qualified for this treatment. I’m elated to bring you the first beta of Software Licensing 3.6, which moves license keys to their own custom tables, providing a cleaner data organization and significantly improved performance.
Custom database tables
As we’ve been doing with our other migrations, store owners will be presented with a migration utility that allows them to move the data from the old custom post types, to the new data format. Since moving licenses is a multi-phase process, we had to rebuild the migration utility to be more flexible and verbose, so store owners could get a better picture of what was happening.
Initially, store owners will be presented with an expandable admin notice informing them of this upgrade, as well as the WP-CLI command to use to complete this upgrade.
Instead of immediately starting the upgrade, as we have previously done, the user needs to click to start this process. There are a possible 3 steps that need to be completed on the initial view:
- Upgrade Licenses
- Update bundle licenses
- Update license logs
Only the relevant options will be shown:
Starting the upgrade will use our batch processing API to upgrade a limited number of licenses at a time, to help reduce any risks of causing errors due to server resources. When step 1 is completed a check is run to see if the number of legacy license keys matches the number of new license keys. If these numbers match, any remaining steps will be automatically started. If the numbers are different, however, the remaining steps will not be started automatically, allowing store owners to go see if there was a reason for this, and verify any necessary data was migrated prior to starting the remaining steps. When all steps are completed, users will be notified they can navigate away from the upgrades page to verify data. At this point their store is 100% using the new license tables. The old data still exists, until the final ‘Remove Legacy Data’ step is performed.
If you are running a large store, with more than a thousand licenses, we recommend running this migration over WP-CLI with the provided command. This will ensure the fastest and most reliable method of upgrading a large data set.
The new table schema for these tables is defined below.
wp_edd_licenses
- id
- license_key
- status
- download_id
- price_id
- payment_id
- cart_index
- date_created
- expiration
- parent
- customer_id
- user_id
wp_edd_licensemeta
- meta_id
- license_id
- meta_key
- meta_value
wp_edd_license_activations
- site_id
- site_name
- license_id
- activated
- is_local
New license capabilities
In the past, Software Licensing has always used some of the Easy Digital Downloads roles and capabilities to restrict who can view and modify licenses. In version 3.6, we’ve added 3 capabilities, which allow a granular customization as to what roles can view, edit, and delete licenses from a store. By default, the mappings for license capabilities are tied to EDD Core roles, but can be customized to your preference with a role management plugin or custom integration.
- view_licenses: Allows viewing the list table and details page of individual license keys. The capability has been added to these roles:
- Shop Manager
- Shop Worker
- Administrator
- manage_licenses: Allows modifying license data. The capability has been added to these roles:
- Shop Manager
- Shop Worker
- Administrator
- delete_licenses: Allows deleting license records. The capability has been added to these roles:
- Shop Manager
- Administrator
Download betas from the front-end
In version 3.5, we added support for adding beta versions of licensed products. If the API request for `get_version` was called with the `beta` flag, instead of delivering the latest stable version, the beta was delivered. Previously the only way to get this was via the license handler. In version 3.6, users are able to download beta versions from within their accounts, just like they do with stable versions. These beta files will appear anywhere that EDD outputs download files by default.
Swap variable price assignment
If a license is attached to a product that has variable pricing enabled, users with the ‘modify_licenses’ capability can now change the variable price assignment of a license.
Other improvements
- More information has been added to the Licenses list table.
- Item ID has been added to the API responses.
- License search has been improved to allow partial license search.
- Front-end tables have the
.edd-table
class added to allow better theme support. - Changelog output can now be filtered.
- Refunding a renewal payment rolls back the license expiration.
- Better tool-tips for license management.
- Removed
final
keyword from theEDD_SL_License
class. - License export tool now uses batch processing API to avoid timeouts.
- Upgrade and Renewal dates are now stored in License meta.
Notable bug fixes
- Improved overall performance of license count checks.
- Lifetime child license expirations are now tied to their parent licenses.
activate_license
API call logged the activation twice in the license logs.- Upgrading from lifetime to a bundle caused some issues with the expiration dates.
- Deleting a payment record now properly affects license meta for renewals and upgrades.
- Beta file URLs are no longer forced to
http
. - Sample plugin now uses
time()
instead ofcurrent_time( 'timestamp' )
. - Using the
empty_cart
function now removes any renewal session data.
Frequently Asked Questions
Why did the status counts change after the migration?
You may notice, after running the migration, that some of the status counts in the license list table have changed. This is because during the migration, some checks were run against the licenses to correct any incorrect statuses. While you may see some differences in the counts for individual statuses, the overall license count should remain the same.
Can my store still receive new payments and generate licenses while this migration is running?
Yes! While this migration is running, your store will still be able to process payments and generate new licenses, while the old data is being migrated.
Beta testing
This is a significant update for Software Licensing and so we are testing it as extensively as possible, and we’d love help! If you’d like to help us test the beta, please see this guide.
Notes:
- Access to the beta is restricted to active license holders. Don’t have one? Purchase one today.
- You will need Easy Digital Downloads 2.6.17 or later in order to use the automatic beta install option.
- Valid license holders can also download a copy of the beta version from within their account.
Please let us know what you think! If you notice any problems, you may let us know in the comments below or by submitting a support ticket.
Nice work! I was hoping for this change.
Thanks Jeremy,
We are super excited for it too. 👍
Hi EDD-Team,
Very good that you move on!
But my key issue are: I can’t install the beta in a running system – that’s too dangerous. So I’m waiting for the final stable update.
Unfortunaltely the post does not make clear, what I have to do. Just install / update it? (you mention WP-CLI for bigger stores, what is this?)
I buy the edd-plugins to get rid of techdetails concerning payment, licencing etc. as much as possible. So this topic here should be as simple as possible.
Bernhard
Hey Bernhard,
As this is our development blog it is geared towards developers building with EDD that are comfortable using beta releases and providing feedback. We recommend it run in a staging or test environment before ever hitting a live site for sure.
As the beta moves towards a stable release we will make an announcement on our main blog at easydigitaldownloads.com/blog with information geared towards users not familiar with the development side of things. That will be the post that is written as simply as possible for end users.
Thanks for detailing things so clearly in advance.