You could just add a check for is_admin() and current_user_can("update_plugins") to make sure you’re running only for admin users that are currently in wp-admin. Any user browsing the front end won’t notice anything, logged in or not.
You will probably also want to make sure that this runs only once to avoid race conditions that would produce database errors e.g. running the same ALTER TABLE add ... twice.
Related Posts:
- How to do I get a list of active plugins on my wordpress blog programmatically?
- How to add field for new site-wide option on Network Settings screen?
- Can I upgrade a plugin to a specific version?
- How to tell if a plugin is multisite compatible?
- Plugin upgrading: Widget settings
- WordPress sharding: which multi-DB plugin to use?
- How to get the main blog’s id and db prefix from a mu plugin?
- How to run Two WordPress blogs with different themes and with single database and same content
- Prevent multisite sites from using a plugin
- Is it possible to run plugin code when a multisite blog is deleted?
- Multi domain, multi sites with different themes and content
- Getting Custom Post Type content from main-site of a Multisite
- How do I add a widget programmatically to a newly created site (WPMU) within a plugin?
- Duplicate settings of master blog to slave blogs in WP multi-site installation
- How can I list only sites that use a particular theme or plugin?
- Missing argument 2 for wpdb::prepare() Issue
- Posts wont expire
- WordPress network: set themes and plugins for new blog
- What is the function to get plugin base url in multisite?
- Unique post-id for WordPress Multisite Network
- How can I get a list of plugins and which blogs are using them?
- Multiple Domains with Single WordPress Install
- Duplicate a Multi-Site Subdomain
- How to get last_updated and newest_blogs in WP 3.0
- Display All Non-Used Plugins
- Multisite mu-plugins site-specific directory
- Multisite Backup Plugin [closed]
- Having separate plugins and themes folder for multi-site setup
- Creating Custom Roles for use on a WordPress Multi-site Instance?
- Remove filter from WordPress Plugin
- Upgrade Private Plugin without Deleting
- Multisite Widget/Content
- Exclude plugins on Main site on Multisite installation?
- WordPress 5 upgrade: until when is it safe to keep project running in 4.x?
- Reset WordPress website
- Network: retrieve a list of latest posts
- Multisite installation but do plugins always have to be multisite compatible?
- How to make an interface similar to multi-site for switching between multiple (single) sites for administrators?
- Portfolio + Blog: multisite or plugin?
- WordPress Multisite user activation hook from email
- WordPress on AWS with ELB
- WordPress independent plugin upgrade notification system [duplicate]
- Media is not attached after import
- There is any way to remove post-format filter? [closed]
- How to find wordpress db schema changes when upgrading from 4.9 to 5.2
- Setup page on first login on multisite
- Users are being redirected to main site when trying to register on subsite of my Multisite network
- “Master” WordPress Multisite – Database Sync
- User Signup in Multisite – Need Plugin or Advice
- Certain functions are undefined when called form mu-plugins
- Multisite for Multisite?
- WordPress crashes with “The service is unavailable.” after trying to upgrade plugins
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- Why shortcode always displayed after footer not in body
- Maintaining plugin addons while upgrading
- How to display terms and conditions in post area?
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- Managing wordpress Themes & plugins for multisite
- wordpress upgrade from 4.2.1 to 4.7.3 500 error
- Plugin upgrade failing during unzip
- WordPress’s is_plugin_active_for_network function not working for multisites
- Each User has a Personal Blog
- Storing Form data in a different database
- Completely remove ability to create users?
- looking for a multi-user hello-world plugin
- My plugin does not install correctly if a previous version is still installed
- How to get values from network settings panel?
- After enable multisite enviroment in wordpress site creation wizard not working
- Bulk User Deletion
- Best method of implementing compartmentalized custom post types on a multi-site network
- In a WPMU that uses several different domains, how to enable users to register subdomains of any domain from the main site?
- In Multisite Setups, how to update mass sections of sub-sites
- WordPress Multisite Profile Picture Sync Error with Nextend Social Login Plugin
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- WP Forms not displaying,becomming an fatal error
- disable plugin activation on no multisite
- How to Fix WordPress multisite woocommerce 403 file error
- How to capture hidden values with Gravity Forms
- How to use get_blogs_of_user?
- Install/Enable/Activate plugin on multisite without access to master site
- Renamed plugin folder and when I changed back nothing was activated
- How To Add Code To WP Without Plugin or Functions
- How to Call Function From Separate WordPress Install on Same Server?
- Specific plugin script not working on subdomain
- Coming soon pages with rest of site in maintenance mode
- Query Shortcode from a multisite to appear on a different site?
- Multiple Accounts on 1 email – Multisite
- Show image or notification on specific blog in multisite
- Force Network Activated Plugin to Run After Site Level Plugins
- installed WordPress but can’t upgrade or add plugins due to webdav https?
- How to set the default options on an existing plugin in a WP MU new user install
- Custom plugin breaks css.php on Multisite
- WPMU site in subdirectory: When I clone a site with NS Cloner Pro plugin, how do I remove the subdirectory from the URL?
- WordPress multisite haml templates
- Trying to output a “Most visited blogs” list in wordpress multisite
- Managing database tables in WordPress multisite
- Add custom fields in the new and edit the site forms without touching the WP core
- why i cannot see some plugins while they are enabled on network admin page?
- WordPress Multisite Plugin Activation Issue
- How to configure redis object cache for multiple sites in the same server without errors