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/tests/phpunit/tests/admin/plugin-dependencies/getDependencyFilepath.php

    r57545 r57658  
    1717 */
    1818class Tests_Admin_WPPluginDependencies_GetDependencyFilepath extends WP_PluginDependencies_UnitTestCase {
     19
     20    /**
     21     * Tests that false is returned if Plugin Dependencies has not been initialized.
     22     *
     23     * @ticket 60457
     24     */
     25    public function test_should_return_false_before_initialization() {
     26        // Ensure Plugin Dependencies has not been initialized.
     27        $this->assertFalse(
     28            $this->get_property_value( 'initialized' ),
     29            'Plugin Dependencies has been initialized.'
     30        );
     31
     32        $this->assertSame(
     33            self::$static_properties['dependency_slugs'],
     34            $this->get_property_value( 'dependency_slugs' ),
     35            '"dependency_slugs" was not set to its default value.'
     36        );
     37
     38        $this->assertFalse(
     39            self::$instance->get_dependency_filepath( 'dependency' ),
     40            'false was not returned before initialization.'
     41        );
     42    }
    1943
    2044    /**
Note: See TracChangeset for help on using the changeset viewer.