Update check: hide or show read-only the setting on multisite sub-sites #22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: UX bug in the new update check (#19). Found by security audit run 4 (commit
77fcd83). Not a security issue.What happens
On multisite,
UpdateChecker::enabled()(src/Update/UpdateChecker.php:45-50) reads only the main site'smulti_domain_redux_update_checkoption. Plugin updates are network-wide, so that part is correct.The settings page, however, renders and saves the current blog's value.
SettingsRenderer::render()(src/Admin/SettingsRenderer.php:33) usesget_option(), and the option is registered on every site (src/Admin/SettingsPage.php:55-64). Two things follow:Suggested fix
Do one of these:
! is_multisite() || is_main_site(), and add a short note on sub-sites ("Update checks are configured on the main site").get_blog_option( get_main_site_id(), ... )) read-only on sub-sites, and skip registering the option there.Add a test that, on multisite, the sub-site settings page does not offer an editable update-check field.