Write the settings row through a helper that can create it update_option() declines to write a value equal to the one get_option() would return, and register_setting() is passed a default, which installs a default_option filter answering with the shipped defaults for a row that does not exist. So on an admin request -- the path every real update takes, because activation hooks do not fire on an update -- a migration whose result happens to equal the defaults writes nothing at all, while the legacy rows it read are deleted anyway. Latent here rather than live, and I checked before changing anything: get() merges over the defaults in every one of these plugins, so a missing row and a defaults row read identically and nothing is lost today. It stops being latent the moment one of them gains a setting whose absence means something other than its default, and then the failure is silent, browser-only, and the legacy rows are already gone. This is the shape that cost wp-print and wp-pluginsused a release blocker each earlier today, so §7.6.1 exists and names wp-print as the reference. Eight plugins can reach it; two already had the helper. This is the rest. Ordinary setters -- update(), save() -- are untouched. There the behaviour is correct and expected, and only an upgrade path that then deletes the rows it read carries the risk. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1KNA2t61SoWKZamqPF5sx
Recent Commits to wp-pluginsused:master (2)
-
Write the settings row through a helper that can create it
-
Say Plugins Used Settings, and take WP- out of the page title
Say Plugins Used Settings, and take WP- out of the page title The heading and the page title are two different rules, and this plugin was on the wrong side of both. STANDARDS §4.1 says the sidebar carries the plugin name with its WP- prefix, because that is the string a site owner matches against the list of everything they installed, and that the page title and the <h1> never do, because by then they know where they are. Task #17 adds that a settings screen's heading ends in the word "Settings". The <h1> read "Plugins Used", which is a fair description of the screen and is not what the other fourteen settings screens do. The page title passed to add_options_page() read "WP-PluginsUsed" -- the browser tab, and what a screen reader announces on arrival, which is exactly the place §4.1 calls the prefix noise. Only three plugins still had it there. §4.1 had been demonstrating the opposite of the first rule, because two of its six worked examples were settings screens written before #17 existed, and "Plugins Used" was one of them. The standard is corrected in the same pass; an example is a rule, and it is the part people copy. The Settings entry in the sidebar is untouched and still reads WP-PluginsUsed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1KNA2t61SoWKZamqPF5sx