Skip to content

Commit

Permalink
Improves code for the upgrade tab get license info function (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmigf authored May 19, 2023
1 parent 8bb5299 commit e25ced4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions includes/class-wcpdf-settings-upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public function get_extension_license_infos() {

foreach ( $extensions as $extension ) {
$license_info[$extension] = [];
$args = [ 'edd_action' => 'check_license' ];
$request = null;
$license_key = '';

if ( $this->extension_is_enabled( $extension ) ) {
$extension_main_function = "WPO_WCPDF_".ucfirst( $extension );
Expand All @@ -146,11 +149,10 @@ public function get_extension_license_infos() {
}

if ( is_callable( [ $extension_main_function()->updater, 'get_license_key' ] ) && is_callable( [ $extension_main_function()->updater, 'remote_license_actions' ] ) ) {
if ( ! empty( $license_key = $extension_main_function()->updater->get_license_key() ) ) {
$args = array(
'edd_action' => 'check_license',
'license_key' => trim( $license_key ),
);
$license_key = $extension_main_function()->updater->get_license_key();

if ( ! empty( $license_key ) ) {
$args['license_key'] = trim( $license_key );
} else {
continue;
}
Expand Down

0 comments on commit e25ced4

Please sign in to comment.