Disabling Multi-site Sharing?

This topic is: resolved

Tagged: 

Viewing 15 posts - 1 through 15 (of 17 total)
Author Posts
April 30, 2013 at 11:36 am #3040
OM4
Post count: 13

Hi,

We are using MasterPress on a WordPress Multisite installation, and currently there are the following settings that for post types, taxonomies, field sets and fields:

AVAILABILITY – control the visibility of this Post Type within WordPress
MULTI-SITE – specify the sites in the multisite network that this Post Type is available in
– All Sites
– Include only in specific Sites
– Exclude from specific Sites

Is it possible to disable the Multi-site sharing feature completely? Basically, we don’t want our clients to be able to see a list of other sites that are part of the Multisite network.

Or alternatively, is it possible to somehow only have that section display for Multisite Super Admins?

For example, if you added a hook/filter to the code, we could disable this feature programatically.

Thanks.

James

April 30, 2013 at 11:40 am #3041
traversal
Post count: 207

Hey James,

That’s a very good point, and I never thought about that possibility. I’ll work on adding a hook first at the very least so you can hide it, and will also add support to disable that in the user interface at some stage.

I’ll let you know when something is in place.

Trav

April 30, 2013 at 11:43 am #3042
OM4
Post count: 13

Thanks for the quick reply Trav!

A simple filter would do the trick.

Then in the various spots in your code, you could just do something like:

if ( apply_filters('mp_multisite_sharing_enabled', true) ) { ... }

So it would default to enabled, but other plugins or code could disable it by overriding that filter.

James

April 30, 2013 at 11:50 am #3043
traversal
Post count: 207

Yeah, filters are great in the sense that they can be tailored to really specific cases, and those cases can be evaluated at runtime too, based on the current user, site, etc.

I’ll let you know when something is in place.

April 30, 2013 at 1:36 pm #3045
OM4
Post count: 13

Thanks.

If you need any help testing or implementing it, please let me know. Happy to help.

James

May 3, 2013 at 2:36 pm #3051
OM4
Post count: 13

Hi Trav,

I have now realised that in Multisite, MasterPress creates a global table and stores the post types, fields, etc in the global table.

Do you have any documentation that explains how the plugin is supposed to work with WordPress Multisite?

In our case, we don’t want any sharing between multisite blogs/sites. Each individual site/blog should have its own unique CPT, field definitions etc.

Thanks.

James

May 3, 2013 at 3:08 pm #3052
traversal
Post count: 207

Hey James,

Yeah, when I first sat down to think about adding the filter, it dawned on me that it might take a bit longer to support what you guys are after. You’re right – the way it’s currently setup is to share the masterplan across all sites in the network.

This worked for my use-case as I was building it, but you’ve made me realise that MasterPress needs a mode where each site is completely independent, so that you could use it in a network for multiple clients.

I still don’t think that will be too difficult though, as in theory the filter can also switch which set of database tables to use.

I also realised today as I sat down to work on it, that WordPress no longer uses “blogs.dir” folders in multisite, so I need to work to support the new “uploads/sites/SITE_ID” structure of that too.

Thanks for clarifying.

Trav

May 3, 2013 at 3:16 pm #3053
OM4
Post count: 13

Yeah, I suspect both multisite methods may be required. Shared multisite, and individual multisite.

I’m just guessing here, but I think that separate (not shared) multisite functionality would probably be more popular, because more and more devs/freelancers are starting to use multisite to create client sites.

For multisite, perhaps if the plugin is network activated, then use the shared feature. But if the plugin is individually activated on an individual site/blog, then the plugin shouldn’t use multisite sharing?

Or alternatively, you could add a network admin settings screen that lets the user choose whether to use shared multi-site or individual multi-site methods. Although this may be complicated if people change the setting after the initial setup.

Re the uploads, you’re right. New multisite installs set up in 3.6 don’t use ms-files.php rewriting by default.
However older multisite installs upgraded to 3.6 do continue to use the ms-files.php (blogs.dir) method.

So your plugin might have to support both.

See http://core.trac.wordpress.org/ticket/19235 for details.

Happy for you to run any ideas by me. We’ve been using Multisite for 5+ years. My skype name is james_a_collins.

James

May 3, 2013 at 3:29 pm #3054
traversal
Post count: 207

Yeah, I think you’re right – more people would actually use multisite to manage completely separate sites. I had thought about ways to maybe use different defaults for Network activation versus individual site activation, but my gut says that might be confusing, as it doesn’t necessarily seem to follow that network activation would share the setup by default.

I think what I may do is to require a “define” in wp-config to activate the current “shared” setup, but by default have it operate the way you guys want it. It feels more like a config item, so would probably be better than a filter.

Thanks for the link to the ms-files discussion, that’ll help!

I’ll add you on Skype too, in case I run into a wall and need to talk it over. 🙂

Thanks

May 10, 2013 at 10:04 am #3058
traversal
Post count: 207

Hey James.

I’m not far off releasing the next beta which will change the behaviour of multisite to allow completely walled-off sites that don’t share the Masterplan.

The hold-up has been more around supporting the non ms-files directories for uploaded content, which is semi-related, and I’ve also been working to make sure that custom upload directories can also be supported.

I’m also working to make the next point release change the default location for storing MasterPress files. Currently they’re stored in wp-content/mp, but I’m realising it’ll just be better if they get stored in wp-content/uploads/mp going forward. I’ll write up a more detailed blog post to outline this in detail when the next beta is up.

Cheers

Trav

May 10, 2013 at 10:39 am #3059
OM4
Post count: 13

Hi Trav, thanks for the update.

I realise that these changes are pretty major, so I don’t have a problem with you taking your time to implement and test them.

James

May 30, 2013 at 9:51 am #3138
traversal
Post count: 207

Hey James,

Just letting you know that the latest beta (1.0.1.b3) now changes things up to support the isolation of multisite sites by default, as we had discussed.

There are also some changes to the default location for the “mp” content folder, where MasterPress stores its content.

For more info, check out this support topic:
https://www.masterpressplugin.com/support/topic/masterpress-1-0-1-important-changes

and these posts:
https://www.masterpressplugin.com/2013/05/multisite-sharing-in-101
https://www.masterpressplugin.com/2013/05/content-in-101

and this documentation page:
https://www.masterpressplugin.com/docs/getting-started/multisite-support-in-masterpress

Let me know how you go, and thanks for waiting on this.

May 30, 2013 at 10:22 am #3139
OM4
Post count: 13

Fantastic, thanks Trav.

I’ll let you know if I notice any issues with beta 3.

James

June 17, 2013 at 3:44 pm #3223
OM4
Post count: 13

Hi Trav,

Just a quick note to say that we’ve now got MasterPress (v1.0.0b4) set up on a few of our WordPRess multisite installations.

One install is using the shared functionality (by adding the MASTERPRESS_MULTISITE_SHARING constant). The other setups are using the default isolated method.

So far so good, but I’ll let you know if we notice any issues.

Thanks so much for your hard work.

James

June 17, 2013 at 3:45 pm #3224
traversal
Post count: 207

Great, thanks James. Glad it’s working okay!

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.

Latest From the Blog

MasterPress 1.3.1 is now available

MasterPress 1.3.1 is a compatibility release for PHP 8 and WordPress 5.7. It still remains backwards compatible with older PHP versions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM