Repository navigation
Plugin Updater: Avoid false positive on native auto_update_plugins option - #1510
Open
KhushalSainS wants to merge 1 commit into
Open
KhushalSainS wants to merge 1 commit into
KhushalSainS wants to merge 1 commit into
Conversation
The updater routines check used an unanchored auto_update_plugin pattern, which also matched the core auto_update_plugins site option. Add a trailing word boundary so the auto_update_plugin filter is still detected without flagging the native option. Add a regression test for read-only option access.
KhushalSainS
requested review from
davidperezgar,
ernilambar and
frantorres
as code owners
October 20, 2026 13:28
Contributor
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @sensahin. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #1506.
Updates
Plugin_Updater_Check::look_for_updater_routines()so theauto_update_pluginpattern no longer matches the nativeauto_update_pluginssite option.Why?
The check used the unanchored regex
#auto_update_plugin#, which matches the plural core option name as a substring. A read-onlyget_site_option( 'auto_update_plugins', array() )therefore producedupdate_modification_detected, even though it does not alter update routines or implement a custom updater.WordPress core itself reads and writes this option in
wp_ajax_toggle_auto_updates()and other admin screens, gated by theupdate_pluginscapability.How?
Adds a trailing word boundary:
This continues to match the singular
auto_update_pluginfilter while excluding the plural option.Adds a PHPUnit fixture and regression test for read-only option access. The existing
test-plugin-updater-routines-errorsfixture continues to assert thatadd_filter( 'auto_update_plugin', ... )is still flagged.Testing Instructions
composer install && npm cinpm run wp-env:start:testsnpm run test-php(full suite).test-plugin-updater-routines-native-optionfixture returnsSuccess: Checks complete. No errors found.test-plugin-updater-routines-errorsfixture still returnsupdate_modification_detectedwithDetected: auto_update_plugin.AI Usage Disclosure
AI tools were used to investigate the check, identify the regex boundary issue, and draft the regression test.
All changes were reviewed and tested .