Make WordPress Core


Ignore:
Timestamp:
02/20/2024 07:25:38 AM (16 months ago)
Author:
costdev
Message:

Plugin Dependencies: Remove auto-deactivation and bootstrapping logic.

Automatic deactivation of dependents with unmet dependencies requires a write operation to the database. This was performed during Core's bootstrap, which risked the database and cache becoming out-of-sync on sites with heavy traffic.

No longer loading plugins that have unmet requirements has not had a final approach decided core-wide, and is still in discussion in #60491 to be handled in a future release.

The plugin_data option, used to persistently store plugin data for detecting unmet dependencies during Core's bootstrap, is no longer needed.

Follow-up to [57545], [57592], [57606], [57617].

Props dd32, azaozz, swissspidy, desrosj, afragen, pbiron, zunaid321, costdev.
Fixes #60457. See #60491, #60510, #60518.

File:
1 edited

Legend:

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

    r57545 r57658  
    155155        // Force refresh of plugin update information.
    156156        wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
    157 
    158         $all_plugin_data = get_option( 'plugin_data', array() );
    159         $plugin_file     = $this->new_plugin_data['file'];
    160         unset( $this->new_plugin_data['file'] );
    161         $all_plugin_data[ $plugin_file ] = $this->new_plugin_data;
    162         update_option( 'plugin_data', $all_plugin_data );
    163157
    164158        if ( $parsed_args['overwrite_package'] ) {
     
    489483                $info = get_plugin_data( $file, false, false );
    490484                if ( ! empty( $info['Name'] ) ) {
    491                     $basename = basename( $file );
    492                     $dirname  = basename( dirname( $file ) );
    493 
    494                     if ( '.' === $dirname ) {
    495                         $plugin_file = $basename;
    496                     } else {
    497                         $plugin_file = "$dirname/$basename";
    498                     }
    499                     $this->new_plugin_data         = ( $info );
    500                     $this->new_plugin_data['file'] = $plugin_file;
     485                    $this->new_plugin_data = $info;
    501486                    break;
    502487                }
Note: See TracChangeset for help on using the changeset viewer.