On a WordPress Multisite, tries to avoid using switch_to_blog()
and restore_current_blog()
when possible.
- Short-circuit the
get_blogs_of_user()
function. We don't have to check if a site is own by the user, we want all sites. - Extend
WP_MS_Sites_List_Table
and use bespokeSuper_Admin_Performance_Boost::get_admin_url()
andSuper_Admin_Performance_Boost::get_home_url()
funtions. - Extend
WP_MS_Users_List_Table
- For the Super Admin, hide their sites in the
Sites
column. - For rest of the users, use bespoke
Super_Admin_Performance_Boost::get_home_url()
funtions.
- For the Super Admin, hide their sites in the
I wish I did't have to write this and the Super Admin All Sites Menu plugin, but it feels like WordPress Multisite is not ready for the Super Admin role.
I have a multisite with 100+ sites, and the following issues are a pain:
- The My Sites menu doesn't work for more than 23 sites, hence my Super Admin All Sites Menu plugin.
switch_to_blog()
is used on every site for each page load, only to get the blog details, which is a waste of resources.- There's no point in listing all sites in the
Sites
column for the Super Admin, they own them all.
You know the drill.
Super Admin Performance Boost is copyright 2023+ Per Soderlind
Super Admin Performance Boost is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
Super Admin Performance Boost is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/.