{"id":19031128,"date":"2026-09-28T10:55:14","date_gmt":"2026-09-28T10:55:14","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/multisite-make-uninstall-preference-network-wide\/"},"modified":"2026-09-28T10:55:14","modified_gmt":"2026-09-28T10:55:14","slug":"multisite-make-uninstall-preference-network-wide","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/multisite-make-uninstall-preference-network-wide\/","title":{"rendered":"Multisite: Make uninstall preference network-wide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for this great easy to use plugin.<br \/>The following is a performance\/architecture suggestion for multisite installations, not a security issue. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I noticed that <code>uninstall.php<\/code> uses <code>get_sites()<\/code> with <code>number =&gt; 0<\/code> and then calls <code>switch_to_blog()<\/code> for every site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On very large multisite networks (e.g. tens of thousands of subsites), this could make the uninstall process unnecessarily expensive. In particular, when the setting is <strong>\u201cKeep data\u201d<\/strong>, the code still iterates through all sites even though <code>aicft_uninstall_site()<\/code> immediately returns.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I would suggest making the uninstall preference <strong>network-wide on multisite<\/strong>, available <strong>only to the Super Admin<\/strong> and not to administrators of individual subsites, and storing it via <code>get_site_option()<\/code> \/ <code>update_site_option()<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With this approach:<\/p>\n\n\n\n<ul>\n<li><strong>Keep data<\/strong> \u2192 the uninstall process can return immediately without iterating through the subsites.<\/li>\n\n\n\n<li><strong>Remove data<\/strong> \u2192 the plugin processes the sites and removes its data. <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This would avoid unnecessary processing on large multisite networks while also making the uninstall preference consistent at network level. <br \/><br \/>Thanks!<br \/>Lena <\/p>\n","protected":false},"template":"","class_list":["post-19031128","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19031128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19031128\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19031128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}