Title: Multisite support
Last modified: August 21, 2016

---

# Multisite support

 *  [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [13 years ago](https://wordpress.org/support/topic/multisite-support-42/)
 * Hi,
 * Thanks for the great plugin! I needed this with multisite support, so I took 
   a crack at it. It was pretty much a find & replace job with the _options related
   functions, and I provided a network admin page hook.
 * It worked for me on both multisite and standard site after my changes. Here is
   a basic patch: [http://jdx.co/files/upload-scanner-multisite.patch](http://jdx.co/files/upload-scanner-multisite.patch)
 * There may be more to it than what I’ve done, I was following a fairly basic tutorial.
   Let me know what you think.
 * Thanks again!
 * [http://wordpress.org/plugins/upload-scanner/](http://wordpress.org/plugins/upload-scanner/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031457)
 * Hey,
 * Really appreciate the input. Great patch, too. I made two tiny additions to the
   upgrade routine and the readme file and have the results on the git mirror:
 * [https://github.com/kurtpayne/wordpress-upload-scanner-plugin](https://github.com/kurtpayne/wordpress-upload-scanner-plugin)
 * Can you give this a whirl on your site and make sure it works as you expect?
 * Thank you!
 *  Thread Starter [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031486)
 * Sure, I can test it. It might take me a few days, but I’ll let you know what 
   I find out.
 *  Thread Starter [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031524)
 * Just tested the github copy and it lost my settings on upgrade. I could be wrong,
   but I don’t think you need to delete the old options for multisite on upgrade.
   As I understand the X_site_option() functions, they fallback to the x_option()
   functions if !is_multisite(). Check out line 913 here: [http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/option.php#L885](http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/option.php#L885)
 * Maybe I’m assuming too much, but I think you are safe to just always use the 
   x_site_option() functions because they are “multisite smart”.
 * Thoughts?
 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031528)
 * Hey,
 * You’re absolutely right. I was trying to get the upgrade routine to work here:
 * [https://github.com/kurtpayne/wordpress-upload-scanner-plugin/blob/master/upload-scanner/class-upload-scanner-plugin.php#L119-L143](https://github.com/kurtpayne/wordpress-upload-scanner-plugin/blob/master/upload-scanner/class-upload-scanner-plugin.php#L119-L143)
 * This way, users upgrading from 1.2 or lower, would have their single site “options”
   migrated to multisite “site_options” automatically. Looks like I didn’t quite
   get it right.
 * Does this make sense?
 *  Thread Starter [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031529)
 * I get what you were going for, but don’t have enough multisite experience yet
   to know if it’s necessary.
 * To accomplish that I think you’d need to store the existing options in a variable,
   then delete the old options before updating the new ones.
 * Example for single option:
    ` $var1 = get_option('upload-scanner_use_clamav',
   false);
 * if (is_multisite()){
    delete_option('upload-scanner_use_clamav'); }
 * update_site_option('upload-scanner_use_clamav', $var1);
 * That should avoid losing any data.
 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031538)
 * Does the new upgrade routine work for you?
 *  [nopivnick](https://wordpress.org/support/users/nopivnick/)
 * (@nopivnick)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031571)
 * I’ve been running Upload Scanner v1.2 on a Multisite Network instance for a few
   months now.
 * I’d be happy to install v1.3 on my instance if you’d like some help testing but
   it would probably be best if you tell me exactly what to look for.
 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031572)
 * Hi nopivnick,
 * If you can test 1.3, that’d be great. Just upload it and make sure it doesn’t
   lose your settings. Then make sure that the settings are global (network-wide,
   not per site). That’s it.
 *  [nopivnick](https://wordpress.org/support/users/nopivnick/)
 * (@nopivnick)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031578)
 * fyi, I don’t have an FTP server running on my box which means I can’t run any
   so-called “automatic updates” via web browser.
 * my update process from Upload Scanner v1.2 → v1.3 would be as follows:
    1. network deactivate v1.2 of upload-scanner
    2. delete the plugin directory in /wp-content/plugins from the command line
    3. unzip the GitHub files
    4. restart php5-fpm
    5. network activate v1.3 of upload-scanner
 * then I’d look for retained settings and test that the plugin was scanning uploads
   on child sites, not just the main (aka parent, default) site.
 * does that satisfy your testing parameters or should I wait until I’ve finished
   configuring Automatic Updates via SSH to test the upgrade to version 1.3?
 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031580)
 * That should work.
 * You could also unzip in place. This plugin’s activate routine doesn’t do anything
   except check for prerequisites. The upgrade check on hit to admin_init.
 *  [nopivnick](https://wordpress.org/support/users/nopivnick/)
 * (@nopivnick)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031583)
 * okay.
 * 1.) I can confirm that post-update v1.2 → v1.3 RC all my settings under
 * **Network Admin » Settings » Upload Scanner**
 * were retained with one minor catch: plugin log content no longer appears in
 * **Network Admin » Settings » View Log button » Upload Scan Log pane**
 * 2.) I can also confirm that my Upload Scanner settings continue to apply to child
   sites that existed prior to the update, as well as new child sites created after
   the update.
 * hope that helps.
 *  Plugin Author [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * (@kurtpayne)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031584)
 * Hi nopivnick,
 * Can you confirm your log path is correct, it exists, and the file is readable
   by your php user?

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Multisite support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/upload-scanner_a79991.svg)
 * [Upload Scanner](https://wordpress.org/plugins/upload-scanner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/upload-scanner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/upload-scanner/)
 * [Active Topics](https://wordpress.org/support/plugin/upload-scanner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/upload-scanner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/upload-scanner/reviews/)

 * 12 replies
 * 3 participants
 * Last reply from: [Kurt Payne](https://wordpress.org/support/users/kurtpayne/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/multisite-support-42/#post-4031584)
 * Status: not a support question