Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Ticket #66328 (Recovery mode does not recognize network-activated plugins) created

Дата публикации: 16-10-2026 17:36:45


WP_Recovery_Mode::is_network_plugin() is meant to make WP_Recovery_Mode::handle_error() ignore errors from network-activated plugins, but it never returns true.
It compares each entry from wp_get_active_network_plugins() against the extension slug followed by a slash:
<?php
$network_plugins = wp_get_active_network_plugins();
foreach ( $network_plugins as $plugin ) {
if ( str_starts_with( $plugin, $extension['slug'] . '/' ) ) {
return true;
}
}
wp_get_active_network_plugins() returns full paths, such as /var/www/wp-content/plugins/my-plugin/my-plugin.php, while the slug from WP_Recovery_Mode::get_extension_for_error() is relative to the plugins directory, such as my-plugin. The prefix never matches, so an error from a network-activated plugin is not rejected with invalid_source.
Single-file plugins such as hello.php could not match even with relative paths, because their slug is the file name and the check requires a trailing slash.
This has been the case since recovery mode was introduced in [44973]. The impact is limited today, because WP_Fatal_Error_Handler::handle() only calls handle_error() when ! is_multisite(), but the check is wrong wherever it is used.
Steps to reproduce
On a multisite install, network-activate a plugin in a directory, for example my-plugin/my-plugin.php.
Call ( new WP_Recovery_Mode() )->handle_error() with an error whose file is inside WP_PLUGIN_DIR . '/my-plugin/'.
Expected: a WP_Error with the code invalid_source. Actual: the error is treated as coming from a pausable plugin (for example non_protected_endpoint).
Proposed fix
Convert each path with plugin_basename() before comparing, and also match a single-file plugin by its basename:
<?php
foreach ( $network_plugins as $plugin ) {
// wp_get_active_network_plugins() returns full paths, while the slug is relative to the plugins directory.
$plugin = plugin_basename( $plugin );
if ( $plugin === $extension['slug'] || str_starts_with( $plugin, $extension['slug'] . '/' ) ) {
return true;
}
}
Found while adding test coverage for WP_Recovery_Mode in ​PR 14160, where @lancewillett suggested a multisite case confirming that handle_error() rejects an error from a network-activated plugin.


Основное содержимое страницы с новостью.

Javascript required

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Changeset [64412]: Tests: Add coverage for `WP_Recovery_Mode`. Test recovery mode ...011.6216-10-2026
2Changeset [64414]: Tests: Add coverage for paused-theme recovery helpers. Cover ...012.416-10-2026
3Reply To: WordPress.com Notifications disappeared from WP Admin Bar after recent updates0727-06-2026
4Ticket #62762 (WP_Widget_Categories::widget(): use int or bool for $cat_args values ...) closed06.9116-10-2026
5Ticket #66325 (Abilities API: Allow abilities to declare required capabilities) created06.0216-10-2026
6Changeset [64415]: Tests: Add coverage for `WP_Fatal_Error_Handler`. Cover error ...011.0616-10-2026
7Ticket #66290 (E2E: login-localize-script test fails its first attempt when ...) closed07.9716-10-2026
8Accessibility regression after update — <ul class="x-menu"> has role="navigation" causing Lighthouse list errors010.7518-09-2026
9New Wordpress Website - 500 Internal Server Error08.2220-09-2026
10Ticket #66246 (Interactivity API: Add server-side processing for the new data-wp-html ...) reopened09.5416-10-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 5.92. Источник: core.trac.wordpress.org.