Skip to content

Commit

Permalink
Merge pull request #183 from newfold-labs/fix/improve-plugin-status-d…
Browse files Browse the repository at this point in the history
…etection

Improve plugin status detection
  • Loading branch information
arunshenoy99 authored Feb 24, 2023
2 parents 5ea1631 + e3ac28a commit 5d2f5c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions includes/RestApi/PluginsController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace NewfoldLabs\WP\Module\Onboarding\RestApi;

use NewfoldLabs\WP\Module\Onboarding\Data\Options;
use NewfoldLabs\WP\Module\Onboarding\Permissions;
use NewfoldLabs\WP\Module\Onboarding\Data\Plugins;
use NewfoldLabs\WP\Module\Onboarding\Data\SiteFeatures;
Expand Down Expand Up @@ -282,6 +283,17 @@ public function get_status( \WP_REST_Request $request ) {
);
}

$in_progress_plugin = \get_option( Options::get_option_name( 'plugins_init_status' ), '' );
if ( $in_progress_plugin === $plugin ) {
return new \WP_REST_Response(
array(
'status' => 'installing',
'estimate' => 30,
),
200
);
}

return new \WP_REST_Response(
array(
'status' => 'inactive',
Expand Down

0 comments on commit 5d2f5c0

Please sign in to comment.