{"id":528,"date":"2018-01-22T18:09:25","date_gmt":"2018-01-23T00:09:25","guid":{"rendered":"https:\/\/easydigitaldownloads.com\/development\/?p=528"},"modified":"2021-12-15T15:30:56","modified_gmt":"2021-12-15T21:30:56","slug":"software-licensing-3-6-beta-1-released-with-migration-to-custom-tables","status":"publish","type":"post","link":"https:\/\/easydigitaldownloads.com\/development\/2018\/01\/22\/software-licensing-3-6-beta-1-released-with-migration-to-custom-tables\/","title":{"rendered":"Software Licensing 3.6 Beta 1 released with migration to custom tables"},"content":{"rendered":"<p>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&#8217;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.<\/p>\n<h3>Custom database tables<\/h3>\n<p>As we&#8217;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.<\/p>\n<p>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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-529 alignnone\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-notice-1024x242.png\" alt=\"\" width=\"722\" height=\"171\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-notice-1024x242.png 1024w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-notice-300x71.png 300w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-notice-768x182.png 768w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-notice.png 1267w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/p>\n<p>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:<\/p>\n<ul>\n<li>Upgrade Licenses<\/li>\n<li>Update bundle licenses<\/li>\n<li>Update license logs<\/li>\n<\/ul>\n<p>Only the relevant options will be shown:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-531 alignnone\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-step1-1024x469.png\" alt=\"\" width=\"722\" height=\"331\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-step1-1024x469.png 1024w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-step1-300x137.png 300w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-step1-768x352.png 768w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-migration-step1.png 1268w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/p>\n<p>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 <strong><em>still exists<\/em><\/strong>, until the final &#8216;Remove Legacy Data&#8217; step is performed.<\/p>\n<p class=\"edd-alert edd-alert-info\">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.<\/p>\n<p>The new table schema for these tables is defined below.<\/p>\n<p>wp_edd_licenses<\/p>\n<ul>\n<li>id<\/li>\n<li>license_key<\/li>\n<li>status<\/li>\n<li>download_id<\/li>\n<li>price_id<\/li>\n<li>payment_id<\/li>\n<li>cart_index<\/li>\n<li>date_created<\/li>\n<li>expiration<\/li>\n<li>parent<\/li>\n<li>customer_id<\/li>\n<li>user_id<\/li>\n<\/ul>\n<p>wp_edd_licensemeta<\/p>\n<ul>\n<li>meta_id<\/li>\n<li>license_id<\/li>\n<li>meta_key<\/li>\n<li>meta_value<\/li>\n<\/ul>\n<p>wp_edd_license_activations<\/p>\n<ul>\n<li>site_id<\/li>\n<li>site_name<\/li>\n<li>license_id<\/li>\n<li>activated<\/li>\n<li>is_local<\/li>\n<\/ul>\n<h3>New license capabilities<\/h3>\n<p>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&#8217;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.<\/p>\n<ul>\n<li>view_licenses: Allows viewing the list table and details page of individual license keys. The capability has been added to these roles:\n<ul>\n<li>Shop Manager<\/li>\n<li>Shop Worker<\/li>\n<li>Administrator<\/li>\n<\/ul>\n<\/li>\n<li>manage_licenses: Allows modifying license data.\u00a0The capability has been added to these roles:\n<ul>\n<li>Shop Manager<\/li>\n<li>Shop Worker<\/li>\n<li>Administrator<\/li>\n<\/ul>\n<\/li>\n<li>delete_licenses: Allows deleting license records.\u00a0The capability has been added to these roles:\n<ul>\n<li>Shop Manager<\/li>\n<li>Administrator<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Download betas from the front-end<\/h3>\n<p>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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-536 size-full alignnone\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-frontend-beta-download-e1516663492563.png\" alt=\"\" width=\"735\" height=\"135\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-frontend-beta-download-e1516663492563.png 735w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-frontend-beta-download-e1516663492563-300x55.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<h3>Swap variable price assignment<\/h3>\n<p>If a license is attached to a product that has variable pricing enabled, users with the &#8216;modify_licenses&#8217; capability can now change the variable price assignment of a license.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-538 alignnone\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-swap-variable-price.png\" alt=\"\" width=\"656\" height=\"422\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-swap-variable-price.png 656w, https:\/\/easydigitaldownloads.com\/development\/files\/2018\/01\/edd-sl-swap-variable-price-300x193.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/p>\n<h3>Other improvements<\/h3>\n<ul>\n<li>More information has been added to the Licenses list table.<\/li>\n<li>Item ID has been added to the API responses.<\/li>\n<li>License search has been improved to allow partial license search.<\/li>\n<li>Front-end tables have the <code>.edd-table<\/code>\u00a0class added to allow better theme support.<\/li>\n<li>Changelog output can now be filtered.<\/li>\n<li>Refunding a renewal payment rolls back the license expiration.<\/li>\n<li>Better tool-tips for license management.<\/li>\n<li>Removed <code>final<\/code>\u00a0keyword from the <code>EDD_SL_License<\/code> class.<\/li>\n<li>License export tool now uses batch processing API to avoid timeouts.<\/li>\n<li>Upgrade and Renewal dates are now stored in License meta.<\/li>\n<\/ul>\n<h3>Notable bug fixes<\/h3>\n<ul>\n<li>Improved overall performance of license count checks.<\/li>\n<li>Lifetime child license expirations are now tied to their parent licenses.<\/li>\n<li><code>activate_license<\/code>\u00a0API call logged the activation twice in the license logs.<\/li>\n<li>Upgrading from lifetime to a bundle caused some issues with the expiration dates.<\/li>\n<li>Deleting a payment record now properly affects license meta for renewals and upgrades.<\/li>\n<li>Beta file URLs are no longer forced to <code>http<\/code>.<\/li>\n<li>Sample plugin now uses <code>time()<\/code>\u00a0instead of <code>current_time( 'timestamp' )<\/code>.<\/li>\n<li>Using the <code>empty_cart<\/code>\u00a0function now removes any renewal session data.<\/li>\n<\/ul>\n<h3>Frequently Asked Questions<\/h3>\n<p><strong>Why did the status counts change after the migration?<\/strong><\/p>\n<p>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.<\/p>\n<p><strong>Can my store still receive new payments and generate licenses while this migration is running?<\/strong><\/p>\n<p>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.<\/p>\n<h3>Beta testing<\/h3>\n<p>This is a significant update for Software Licensing and so we are testing it as extensively as possible, and we&#8217;d love help! If you&#8217;d like to help us test the beta, please see this <a href=\"https:\/\/docs.easydigitaldownloads.com\/article\/1807-how-do-i-get-beta-versions-of-extensions\">guide<\/a>.<\/p>\n<p>Notes:<\/p>\n<ul>\n<li>Access to the beta is restricted to active license holders. Don\u2019t have one?\u00a0<a href=\"https:\/\/easydigitaldownloads.com\/downloads\/software-licensing\/\">Purchase one today<\/a>.<\/li>\n<li>You will need Easy Digital Downloads 2.6.17 or later in order to use the automatic beta install option.<\/li>\n<li>Valid license holders can also download a copy of the beta version from <a href=\"https:\/\/easydigitaldownloads.com\/your-account\/#tab-downloads\" rel=\"noopener\" target=\"_blank\">within their account<\/a>.<\/li>\n<\/ul>\n<p>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\u00a0<a href=\"https:\/\/easydigitaldownloads.com\/support\">support ticket<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Software Licensing version 3.6 beta now available. This update migrates all license data to dedicated database tables for improved performance and reliability.<\/p>\n","protected":false},"author":650,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[8],"class_list":["post-528","post","type-post","status-publish","format-standard","hentry","category-extensions","tag-software-licensing"],"_links":{"self":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/users\/650"}],"replies":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/comments?post=528"}],"version-history":[{"count":10,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/528\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/528\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/media?parent=528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/categories?post=528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/tags?post=528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}