[Plugin: WP Read-Only] Works great in WPMU (with some tweaking)
-
I’ve been looking for a good solution to start migrating all of our static media content into Amazon S3, and this looks like a pretty way to go, with a bit of customization. I went a bit fast and dirty, but ended up changing the following four elements:
– I installed the .php file into the wp-content/mu-plugins/ folder instead of the normal plugins folder.
– In the admin_init function, I needed to set values for all blogs so that I didn’t have to go through them one-by-one. So, where all nine settings are registered there, I just dropped nine update_option lines with my key, secret, bucket, etc. This gives all WPMU sites the same default settings.
– In the upload_dir function I need to insert a blog_id subfolder to the baseurl, so that blogs keep their media separated into dirs by blog_id. So I call “global $current_blog” at the top, and then in the two $data[‘baseurl’] lines simply inserted $current_blog->blog_id and slashes appropriately.
– Finally, since config settings were taken care of, I commented out the heart of the admin_menu function, i.e. the add_options_page call.I have this on a test WP network and it’s really working perfectly. I have some more testing to do, specifically what happens if I add this to a network with over 200 sites already existing — my hope is that this will reroute ALL media uploads into S3, but not interfere with existing media until I can upload them into S3 and update all the links. What do you think?
I also wonder if there are media types that won’t work with this plugin? Any limitations there, as to filetype?
Am I missing anything here?
- The topic ‘[Plugin: WP Read-Only] Works great in WPMU (with some tweaking)’ is closed to new replies.