Make WordPress Core

Changeset 57617


Ignore:
Timestamp:
02/13/2024 01:00:20 PM (9 months ago)
Author:
joemcgill
Message:

Upgrade/Install: Avoid unnecessary db operations for plugin dependencies.

The Plugin Dependencies feature saves a list of any plugins that have been disabled due to unmet dependencies to a transient in order to give user feedback in the admin about what has taken place. This ensures that the DB operations to write this transient is skipped if there are no dependent plugins to deactivate.

Props joemcgill, costdev, afragen.
Fixes #60518.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-plugin-dependencies.php

    r57545 r57617  
    687687        }
    688688
     689        // Bail early if there are no dependents to deactivate.
     690        if ( empty( $dependents_to_deactivate ) ) {
     691            return;
     692        }
     693
    689694        $dependents_to_deactivate = array_unique( $dependents_to_deactivate );
    690695
Note: See TracChangeset for help on using the changeset viewer.