Posted by 9 Comments WordPress

0 Flares 0 Flares ×

One of the features in the WordPress 3.5 release towards the end of last year was the removal of ms-file.php processing for static multisite files. For new installations this is the default mode, however for existing installations it is a completely optional, and manual, process to change to the new mode.

While looking into the manual option, I'd seen a few requests from people wondering if a plugin existed, so wrote one to ease the process a little. Although not difficult, the plugin does help ease some of the more laborious steps of that process and could be useful as a starting point for upgrading a network.

Why would you want to change how uploaded files are processed?

Single site WordPress uses the uploads directory to store uploaded images. Prior to version 3.5, sub-sites in a WordPress multisite installation required a special directory called blogs.dir to store uploaded files, and accessed these images through a file handler called ms-files.php. However a web server can serve up static files such as images more efficiently by itself than by loading them through PHP. Avoiding the ms-files.php filter is therefore a good thing.

What does the plugin do?

You can use this plugin to migrate an existing multisite installation to use the uploads directory instead of blogs.dir. It works by setting the ms_files_rewriting flag to 0 in the wp_sitemeta table, resets the upload paths for each sub-site, and finally copies all files from blogs.dir/[id]/files/ to uploads/sites/[id]/ (where [id] is the site identifier). It can also optionally update links in posts and pages to use the new URL path, however links in widget settings and theme & plugin options will not be changed.

For more details about the fun you can have changing an existing installation manually, take a look at Mika Epstein's post on dumping the ms-files filter.

0 Flares Twitter 0 Facebook 0 LinkedIn 0 Google+ 0 0 Flares ×

Tagged with: