Membership and Category protection not working

I have a wp multisite (3.03) and buddypress (1.2.6) site with Membership (1.04) installed and enabled. I have also tried this on a non-buddypress site (wp multisite 3.03 and membership 1.04)... same result.

The Membership plugin has been installed as per instructions and Categories and shortcodes have been set-up:

Categories: Guest, Member
shortcodes: guest_sc, member_sc
membership levels (both levels active):
- Guest (certain pages allowed, and Guest Category allowed, after more tag content disallowed)
- Member (additional pages allowed, and Member Category allowed, after more tag content allowed)

Stranger Settings set to 'Guest' membership level and User Subscription set to 'None'.

I have been trying to get Category protection to work. And it doesn't work, on my site. Accessing site as a guest (i.e. not logged in in any way) and the blog lists ALL posts regardless of category protection. More tag protection works as does shortcode protection within the post.

But, Category protection, can't seem to get that to work at all. My expectation is that any Post with a Category of "Member" should NOT be shown to a guest website visitor (first of is this expectation correct?)

Some help please on where to go with this....

  • Mason
    • DEV MAN’s Sidekick

    Hiya Chris,

    That's no fun. Are all other components working correctly?

    We have recently updated to version 1.0.5 so you may want to check that out, but I haven't heard of anyone experiencing this particular error. We'll take a look and see if we can recreate the issue. Category protection should work the way your expecting,


  • Chris
    • Flash Drive

    Given the trouble people seem to be reporting on membership 1.05 (on thread I thought I'd stick with 1.04 as that is meant to work.

    Actually, come to think of it I did have 1.05 and then backed it out to 1.04 because of the "issues" with 1.05 that were being reported and because when I unzip 1.05 the membership.php file is zero bytes (is this right??). Have repeatedly downloaded and unzipped but still zero bytes. I assumed there was something iffy with 1.05 and backed it out...

    I now have membership plugin reporting 1.04 enabled, but have "Invite codes" option showing in Membership Options.. (a 1.05 feature)... which suggests something.

    Instructions to upgrade where to overwrite. I have membership as a mu-plugin.

    On standard site (non-buddypress) removed Membership plugin, reinstalled 1.04 as plugin (not mu-plugin), network activated (settings remained), no "Invite codes" showing on Membership Options, BUT.... still not protecting categories quite right. Blog shows all blog entries including the ones that should be protected, but sidebar widget showing categories only shows the non protected category (i.e. sidebar right, blog wrong)....

    It also allows the click through of the "protected" blog entry and shows the blog entry with correct "more tag" protection, but shows a comments entry box (even though comments are protected), and on the blog page it shows "comments closed"....


  • Barry
    • DEV MAN’s Mascot

    Actually, come to think of it I did have 1.05 and then backed it out to 1.04 because of the "issues" with 1.05 that were being reported and because when I unzip 1.05 the membership.php file is zero bytes (is this right??)

    Yes, you want to activate the membershippremium.php file - the membership.php is to overwrite any existing old versions of that file.

    Actually, come to think of it I did have 1.05 and then backed it out to 1.04 because of the "issues"

    What issues are stopping you from moving?

  • Barry
    • DEV MAN’s Mascot

    reinstalled 1.04 as plugin ... no "Invite codes" showing on Membership Options

    That'll be because they where added in 1.0.5 and aren't in 1.0.4

    Any chance of a url and we can take a look? Or some screenshots / screencast as it would help enormously if i could see the issue. Also, what theme are you using and what have you got set up as rules in your levels - can you post screenshots of those and your options page?

  • Chris
    • Flash Drive


    So the zero byte membeship.php is deliberate ?
    1.04 v 1.05 seems to make no difference to the issues I'm experiencing.

    On non buddypress site
    Theme: Atahualpa 3.5.3
    Menus correctly protected, all blog posts shown on blog page (incorrectly), more tag protection correct, can access protected blogs and have option to post comments (incorrect), sidebar widget shows correct categories according to protection level
    (see similar behaviour on TwentyTen: all blogs shown including protected ones, can access protected blog post, but comment option disabled (as expected), category widget in right hand sidebar shows correct categories)

    Disabled all plugins on standard site, only Membership enabled... problem still manifests (can leave comment on Atahualpa but not on Twentyten).

    Deleted membership plugin (ftp'ed to make sure deleted from plugins directory), went into phpadmin and dropped all "membership" tables (all wp_m tables).

    Uploaded membership 1.05 and network activated. Membership showing as "enabled" and still retains settings under Membership Options (where did it get those from?), no membership levels showing. Added one, won't save. In PHPAdmin there are no wp_m* tables.

    How do I re-install membership cleanly?

    Created entirely new blog via fantasico, standalone, 3.03 (not mu) installed only membership 1.05, imported my posts with their categories. Enabled membership, set a guest level, set up in -ve More Tag disallowed, Comments disallowed, set up in +ve, allowed only one category. Set stranger setting to use Guest, no subscriptions set up. Used Twentyten theme.
    And result; same as before blog shows all posts....

    So on a vanilla install, with only membership 1.05 plugin installed - it doesn't protect categories... so it seems.... the only thing that's carried over are 4 blog postings with their categories.

  • Chris
    • Flash Drive

    ok tried again:

    a) vanilla wp install 3.01 via fantasico
    b) create one additional posting "secret post" with category "secret", publish
    c) ftp membership 1.05 into plugins directory, change membership-config.php to have same id as my install "admin", save and upload
    d) activate membership via plugins
    e) Enable membership via Membership, shows 1.05 "Enabled"
    f) create new level "guest", drag Categories to +ve rule, click on "uncategorized", update
    g) make level active
    h) Edit membership options and make stranger settings use "guest" level created in f), save settings

    logout of wp admin, go to site, and both posts are shown (standard "hello world" and "secret post")

    so what have i missed?

  • Marcus
    • Site Builder, Child of Zeus

    getting to grips with this too, but looks to me that you're not using the rules correctly. you probably want to move the category clause into the -ve rule and select the categories you don't want shown.

    I just posted here about another issue that might help if the above doesn't:

  • Chris
    • Flash Drive

    netweblogib: thanks for taking an interest and posting...

    Tried making the rule on the "negative" side.

    It doesn't change anything. I expect only one post to be shown. The sidebar widget is affected by the rule, but not the home page list of blogs.

    Tried blocking all categories. Sidebar widget says "no categories", home page still shows both and allows viewing of both.

    So what I am I missing?

  • Chris
    • Flash Drive

    Switching the theme makes no difference. Is there a specific WPMU Dev theme that this plugin will work with... if so which one? I did try it with the default buddypress theme on the other install and it had the same (incorrect behaviour).

    So i think if i understand the thread you've directed me towards correctly, the plugin doesn't work as intended i.e. protect categories, unless the theme specifically calls the right code?

    Can you clarify please.....

  • Marcus
    • Site Builder, Child of Zeus

    I think I ended up creating a duplicate topic post in the end.... i thought it was the theme that wasn't working but it turns out I got a false positive as I protected the specific post in the level rules and left it like that while testing the other theme. Maybe a mod should close my other post and point it here?

    So, in the end I think I'm on the same boat as Chris. I try to protect a category, but the only thing that's really protected is the category page itself, not the posts, which is not really that useful. Additionally, if you give it an additional unprotected category as well, it will show up on the unprotected category list.

    I guess the question is whether this is intended or not? If so, is there a way of protecting posts in a grouped up fashion like tagging or categories?

    FYI, like Chris,other protections seem to work fine. In fact, the post that should be protected by category still protects some text via shortcode if viewing as a visitor.


  • Chris
    • Flash Drive

    I'd like to hear from Aaron, Barry or James on this...

    Is the membership plugin working as intended or is it not?

    My expectation is that category protection means that posts are not shown on the main blog page if protected nor can they be viewable.

  • Mason
    • DEV MAN’s Sidekick

    Hiya guys,

    Apologies for the delayed response here. Aaron's been away on vacation and I believe Barry is having some difficulties due to the onslaught of snow over in Europe.

    We are definitely going to have a look at this though and getcha some answers. Many thanks for your patience as we dig into this.

  • 2urn
    • WPMU DEV Initiate

    After my own issues, I went with S2 Member Pro. Much easier to configure and the developer offers paid installation, customization, and support. He was very helpful when I contacted him--but I ended up not even needing to pay for any extra help. Works like a charm.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.