From 10e2a2590e4dcb18b19939ad581fc76a758601f7 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Mon, 14 Oct 2024 15:05:28 +0530 Subject: [PATCH] Updates --- includes/Services/PluginInstaller.php | 4 +--- includes/WPAdmin/Listeners/InstallerListener.php | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/includes/Services/PluginInstaller.php b/includes/Services/PluginInstaller.php index 6c79715..7648a8e 100644 --- a/includes/Services/PluginInstaller.php +++ b/includes/Services/PluginInstaller.php @@ -175,9 +175,7 @@ public static function install_premium_plugin( $plugin, $activate ) { ); } - // Create an instance of PLSUtility for handling license operations $pls_utility = new PLSUtility(); - // Provision a license for the premium plugin $license_response = $pls_utility->provision_license( $plugin ); if ( is_wp_error( $license_response ) ) { @@ -205,7 +203,7 @@ public static function install_premium_plugin( $plugin, $activate ) { return new \WP_REST_Response( array( - 'message' => __( 'Successfully provisioned, installed, and activated: ', 'wp-module-installer' ) . $plugin, + 'message' => __( 'Successfully provisioned: ', 'wp-module-installer' ) . $plugin, ), 200 ); diff --git a/includes/WPAdmin/Listeners/InstallerListener.php b/includes/WPAdmin/Listeners/InstallerListener.php index 67835f9..97eca00 100644 --- a/includes/WPAdmin/Listeners/InstallerListener.php +++ b/includes/WPAdmin/Listeners/InstallerListener.php @@ -80,15 +80,11 @@ private function listen_for_premium_plugin_activation() { // Loop through each plugin in the license data and hook to its activation using basename foreach ( $license_data_store as $plugin_slug => $license_data ) { - // Ensure that the basename is present in the license data if ( isset( $license_data['basename'] ) ) { $basename = $license_data['basename']; - - // Hook into plugin activation using the basename add_action( 'activate_' . $basename, function () use ( $plugin_slug, $pls_utility ) { - // Call the activate_license function when this plugin is activated $pls_utility->activate_license( $plugin_slug ); } );