Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Oct 14, 2024
1 parent cffa06c commit 10e2a25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions includes/Services/PluginInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 0 additions & 4 deletions includes/WPAdmin/Listeners/InstallerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
);
Expand Down

0 comments on commit 10e2a25

Please sign in to comment.