Skip to content

Commit

Permalink
Checks to prevent re-queuing plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed Feb 22, 2023
1 parent 0002a1f commit 525914a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/RestApi/PluginsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@ public function set_site_features( \WP_REST_Request $request ) {

foreach ( $plugins as $plugin => $decision ) {
if ( $decision ) {
// If the Plugin exists and is activated
if ( PluginInstaller::exists( $plugin, $decision ) )
continue;

// If the Plugin is already in queue
$position_in_queue = PluginInstallTaskManager::status( $plugin );
if ( false !== $position_in_queue )
continue;

PluginInstallTaskManager::add_to_queue(
new PluginInstallTask(
$plugin,
Expand Down

0 comments on commit 525914a

Please sign in to comment.