Administration: Remove unreachable "All selected plugins are up to date." notice in plugins.php - #12859
Conversation
…te." notice. The `elseif ( 'update-selected' === $action )` branch in the Plugins screen notice chain can never execute. `$action` is assigned once and the earlier `update-selected` switch case renders the bulk-update iframe and always ends in `exit`, so `$action` can never still be `'update-selected'` when the notice chain runs (PHPStan reports the comparison as always false). The branch was reachable when introduced in [11542]: the handler filtered the selection to out-of-date plugins and fell through via `break` when all were current, showing the message. The iframe rewrite in [11232] removed that path and made the case exit unconditionally, but left the notice behind. It has been dead code ever since; the iframe update screen already reports the up-to-date outcome. See https://core.trac.wordpress.org/ticket/65812
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: https://core.trac.wordpress.org/ticket/65812
Summary
Removes an unreachable admin-notice branch on the Plugins screen (
wp-admin/plugins.php). Theelseif ( 'update-selected' === $action )branch that prints "All selected plugins are up to date." can never execute.Why it is unreachable
$actionis assigned once, fromWP_Plugins_List_Table::current_action(), and is never reassigned.$action === 'update-selected', the earlierswitch ( $action )enterscase 'update-selected':, which renders the bulk-update iframe and ends in an unconditionalexit;.$action === 'update-selected', so theelseifis always false. PHPStan reports the comparison as "will always evaluate to false."The string
"All selected plugins are up to date."exists nowhere else inwp-admin, and the iframe update screen (update.php?action=update-selected) already reports the up-to-date outcome.History
The branch was reachable when introduced in [11542] (2010): the handler filtered the selection to out-of-date plugins and
breaked (notexit) when all were current, falling through to the notice. The iframe rewrite in [11232] removed that filtering and thebreak, leaving the notice behind. It has been dead code ever since.Testing
php -lpasses; no functional change (removed code was never reached).