diff --git a/includes/Services/PluginInstaller.php b/includes/Services/PluginInstaller.php index 76adeda..679d331 100644 --- a/includes/Services/PluginInstaller.php +++ b/includes/Services/PluginInstaller.php @@ -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; @@ -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 ) ) {