Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ function get_dropins() {
* Includes Multisite drop-ins only when is_multisite()
*
* @since 3.0.0
* @since 7.2.0 Added the `secrets.php` drop-in.
*
* @return array[] {
* Key is file name. The value is an array of data about the drop-in.
Expand All @@ -507,6 +508,7 @@ function _get_dropins() {
'object-cache.php' => array( __( 'External object cache.' ), true ), // Auto on load.
'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // Auto on error.
'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // Auto on error.
'secrets.php' => array( __( 'Custom Secrets API backend.' ), true ), // Auto on load.
);

if ( is_multisite() ) {
Expand Down
20 changes: 20 additions & 0 deletions tests/phpunit/tests/admin/includesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,26 @@ public function test_get_dropins_not_empty() {
$this->_restore_drop_ins();
}

/**
* @ticket 66380
*
* @covers ::get_dropins
*/
public function test_get_dropins_includes_secrets_dropin() {
$this->_back_up_drop_ins();

$p1 = $this->_create_plugin( "<?php\n//Test", 'secrets.php', WP_CONTENT_DIR );

$dropins = get_dropins();

unlink( $p1[1] );

$this->assertSame( array( 'secrets.php' ), array_keys( $dropins ) );

// Clean up.
$this->_restore_drop_ins();
}

/**
* @covers ::is_network_only_plugin
*/
Expand Down
Loading