Skip to content

Commit

Permalink
Reorder check
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Oct 22, 2024
1 parent 0e7e57b commit 6de9917
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/Services/PluginInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ public static function install_premium_plugin( $plugin, $provider, $activate ) {
return $license_response;
}

// Check if the download URL is present in the license response
if ( empty( $license_response['downloadUrl'] ) ) {
return new \WP_Error( 'nfd_installer_error', __( 'Download URL is missing for premium plugin: ', 'wp-module-installer' ) . $plugin );
}

// Get the plugin basename from the license response
$plugin_basename = ! empty( $license_response['basename'] ) ? $license_response['basename'] : false;

Expand Down Expand Up @@ -220,6 +215,11 @@ public static function install_premium_plugin( $plugin, $provider, $activate ) {
);
}

// Check if the download URL is present in the license response
if ( empty( $license_response['downloadUrl'] ) ) {
return new \WP_Error( 'nfd_installer_error', __( 'Download URL is missing for premium plugin: ', 'wp-module-installer' ) . $plugin );
}

// Plugin is not installed, proceed with installation
$install_status = self::install_from_zip( $license_response['downloadUrl'], $activate );
if ( is_wp_error( $install_status ) ) {
Expand Down

0 comments on commit 6de9917

Please sign in to comment.