having trouble getting membership 2 pro set up properly on multisite

i believe i've set up everything as spelled out in the documentation but maybe i've missed something because protected content does not seem to be showing for users in proper access levels.

  • Michael Bissett

    Hey @Ryan Sharrer, hope you're doing well today! :slight_smile:

    First off, I noticed that the site mentioned in the thread here isn't running the latest version of Membership 2 Pro, could you update that first, and seeing if that helps?

    Also, could you elaborate on what users should be seeing here, as in what content they should be able to access with the level you're testing with? And could you enable Support Access please, and mention which site on the network you're working with here?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Thanks! :slight_smile:

    Kind Regards,
    Michael

  • Ryan Sharrer

    When trying to upgrade the plugin from the wpmudev website, I get "You do not have sufficient permissions to access this page." even though I am logged in as a super admin.

    How do I give you support access to the network?

    We added "define('MS_PROTECT_NETWORK', true);" in wp-config.
    We also have a plugin called Ceramic Arts Daily WP Plugin which contains
    "add_filter('ms_frontend_handle_registration', '__return_false');"
    and a simple function hooked to ms_init that globally exposes the api.
    The api itself was a pleasure to use. It may be that we need some help in configuring the plugin for the multisite network.

    I am placing users into memberships like this:

    $curr_member = $membership2_api->get_member($curr_user_id);
    $membership_id = ceramic_arts_get_membership_id ($current_subscription);
    $curr_member->add_membership($membership_id);
    $curr_user_membership_ids = $curr_member->get_membership_ids();
    if (in_array($membership_id, $curr_user_membership_ids))
    echo '
    user '.$curr_user_id.' added to membership '.$current_subscription;

    Everything seems fine from the admin area but when testing I'm seeing that restricted content (custom post types) is then only visible when logged in as admin.

  • Ryan Sharrer

    So an example of what seems to be not working...

    Pottery Making Illustrated has custom post type Article restricted to memberships PO-E and PO-W.

    One of these posts is
    http://test-ceramicartsdaily.com/pottery-making-illustrated/article/an-introduction-to-color/
    and the archive page is
    http://test-ceramicartsdaily.com/pottery-making-illustrated/article

    If I log out, the article is protected. If I log in as a user, such as (details removed by moderator), who is in membership PO-E, the article is still protected. I can see the full article if I log into my super admin account.

  • Michael Bissett

    Hey @Ryan Sharrer, thanks for the additional information! :slight_smile:

    In this case, could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress network admin access details (login address, username & password)
    - Include WordPress test user details (I removed the ones in the thread here, as these are public forums)
    - Include FTP log-in details (hostname, username & password)
    - Please mention where I can find the 2nd code snippet, the one that adds users; knowing how it gets executed would be helpful too. :slight_smile:
    - Include any relevant URLs for your site

    On the contact form (linked to below), please select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks! :slight_smile:

    Kind Regards,
    Michael

    P.S. (since I saw an addition to your thread after posting this response before) I'd like to know what this external payment system is, could you elaborate on that please?

  • Michael Bissett

    Hey @Ryan Sharrer,

    After looking at this further, I'm seeing that you've got the Leaky Paywall plugin active on your network, that's what's generating that "You must upgrade your account to read the rest of this content." message on the page you mentioned.

    I'm not seeing that it's configured presently (with the exception of the Stripe gateway being chosen, though no API details have been entered), did you decide to stop using that particular plugin? Disabling it should get things working properly with Membership 2 Pro. :slight_smile:

    Please advise,
    Michael

  • Ryan Sharrer

    Oh ok great. I'll try that. I'm not sure what they are planning to do w/ the Leaky Paywall plugin. I didn't realize it was affecting Membership 2 Pro. Much of this was already set in motion when I jumped into the project. I'm assuming you got my message to the contact form w/ all the credentials, etc. for the site.

    One other thing we are trying to do if you could please point me in the right direction... is there a way w/ Membership 2 Pro to have memberships expire at a certain time?

    Carmen

  • Michael Bissett

    Hey @Ryan Sharrer,

    Yep, I did get your credentials for the site here. :slight_smile:

    In regards to this:

    One other thing we are trying to do if you could please point me in the right direction... is there a way w/ Membership 2 Pro to have memberships expire at a certain time?

    I see that you're using free memberships on your site presently, could you elaborate as to what you're planning, in regards to having memberships expire?

    Please advise,
    Michael

  • Michael Bissett

    Hey @Ryan Sharrer, thanks for clarifying that! :slight_smile:

    Hmm... with that external payment provider (ESP) taking the payments, I would think that you'd be wanting to get the date from their API first, in order to tie it in with Membership 2 Pro.

    Now, on Membership 2 Pro's end, there is the drop_membership() function, which we could use to remove a user's membership. There would be the concern of tying the expiration date from ESP to the member's user ID inside of WordPress, and then checking that user ID with Membership 2 Pro, to see that it has the membership in question.

    That's what's coming to my mind presently when I envision the means of going about all this. :slight_smile:

    For what it's worth, I hope this helps!

    Kind Regards,
    Michael

  • Ryan Sharrer

    I disabled the Leaky Paywall plugin and still could not get things working w/ Membership 2. In fact, it seems now that posts selected to be protected aren't being protected at all now when not logged in. I'm using Google Chrome and I deleted browser cookies when logging out and everything. I then deactivated all plugins on the site except for Membership 2 and WPMU DEV Dashboard.

    I thought maybe it was just custom post types that weren't getting protected, as the cpt in ? is being created by a specific plugin. I deactivated that plugin, and tried protecting regular posts too. Nothing seems to be working now.

    I am leaning toward coming up w/ a custom solution at this point. Maybe creating custom capabilities to replace what would have been memberships. Our client is not very happy at all that I've spent all this time integrating the Membership 2 plugin into their system and I'm unable to get it to do even the most basic thing. If you could check it out please and let me know if you can see anything, we'd really appreciate it.

    Thanks,
    Carmen

  • Michael Bissett

    Hey @Ryan Sharrer,

    In regards to Membership Pro suddenly showing up on your site, it looks like you tried doing an update of Membership 2 Pro while our WPMU DEV Dashboard plugin was disabled, which resulting in the plugin being "updated" to the WordPress.org version of the plugin (the free version, which among other things, doesn't include network protection).

    I've got the premium version back up and running for you, so we can touch on this now:

    I thought maybe it was just custom post types that weren't getting protected, as the cpt in ? is being created by a specific plugin. I deactivated that plugin, and tried protecting regular posts too. Nothing seems to be working now.

    After digging into this further, I know what's going on here. :slight_smile:

    In looking at the settings for IssueM, inside of:

    Articles -> Settings

    I'm seeing that you've checked the box for "Use Default WordPress Category and Tag Taxonomies".

    Here's the thing: Category Protection is overriding the Custom Post Type protection, due to the default WordPress categories being used by IssueM, so if a post isn't in a specific WordPress category, it won't be protected.

    You'll want to disable that option I mentioned, and make sure that your articles aren't using any WordPress categories.

    As for your posts, once again, the Category protection overrides the single post protection, so for your "Hello World" post on the Ceramic Monthly site, you'd need to restrict the "Uncategorized" category to a membership in order for it to be protected.

    I'd advise disabling the "Individual Posts" add-on, as it's not going to be in effect while you have the Category Protection add-on enabled (plus, from your email, you indicated that you wanted to protect categories, rather than individual posts).

    Hope this helps! :slight_smile:

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.