Skip to content

Commit

Permalink
Use highest available license key in auto updater if no key is set
Browse files Browse the repository at this point in the history
  • Loading branch information
robincornett committed Nov 10, 2021
1 parent e384678 commit dc4b337
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion includes/class-edd-license-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,20 @@ public function auto_updater() {
return;
}

$license = $this->license;
// Fall back to the highest license key if one is not saved for this extension.
if ( empty( $license ) ) {
$pass_manager = new \EDD\Admin\Pass_Manager();
$highest_key = $pass_manager->highest_license_key;
if ( $highest_key ) {
$license = $highest_key;
}
}
$betas = edd_get_option( 'enabled_betas', array() );

$args = array(
'version' => $this->version,
'license' => $this->license,
'license' => $license,
'author' => $this->author,
'beta' => function_exists( 'edd_extension_has_beta_support' ) && edd_extension_has_beta_support( $this->item_shortname ),
);
Expand Down

0 comments on commit dc4b337

Please sign in to comment.