Page 2 of 2

Re: This Is Weird!!

PostPosted: November 8th, 2011, 2:45 pm
by Eduan
What version of WordPress and s2Member are you using peterhuk?

Re: This Is Weird!!

PostPosted: November 8th, 2011, 6:27 pm
by Jason Caldwell
Thanks for the heads up on this thread.
~ Investigating now.

Re: This Is Weird!!

PostPosted: November 8th, 2011, 6:51 pm
by Jason Caldwell
Interesting. Well, I'm so sorry. I've been unable to reproduce this so far. I've tested against WordPress v3.2.1 and WordPress v3.3-beta2 running s2Member Pro v111105.

Here are some things that we can look at perhaps.

1. Are you running any caching plugins that attempt to perform object caching?
If you're running W3 Total Cache, try testing without this enabled, or with object caching disabled.

2. Are you running any custom code of your own? An s2member s2-hacks.php file? Anything that updates details about a User either before or after checkout/modification?

It sounds like there is either stale information being saved somewhere, or that stale information is sitting in an object cache and is not being updated properly. Short of that, I'm at a loss. If problems persist, please submit a Dashboard login and any access details that I need to reproduce this on your installation. Please use this private contact form for that: http://www.s2member.com/contact/

Re: This Is Weird!!

PostPosted: November 8th, 2011, 6:59 pm
by peterhuk
Hi Eduan , Jason.

Eduan I am running WordPress 3.2.1 and at present
S2 Member Version 111029 + s2Member Pro v111029


Jason,

I think I have found the problem. Why it has only took till now to show up I dont
know but the bug I found was in:

/wp-content/plugins/s2member/includes/classes/paypal-notify-in-subscr-or-wa-w-level.inc.php


On Line 120 I found:

Code: Select all
if ($paypal["ccaps"] && preg_match ("/^-all/", str_replace ("+", "", $paypal["ccaps"])))
foreach ($user->allcaps as $cap => $cap_enabled)
  if (preg_match ("/^access_s2member_ccap_/", $cap))
    $user->remove_cap ($ccap = $cap);


I could not understand the preg_match command:
preg_match ("/^-all/"


I search the net hi and low for a precedence for its use and found none. This command
(what ever it was suppose to do) was stopping the deletion of the ccaps. Which meant that
members wishing to down grade would pay less for the capabilities that had previously.

I removed the entire match:
&& preg_match ("/^-all/", str_replace ("+", "", $paypal["ccaps"]))


from the if staement and test completed Successfully!!.

Please verify and update all simular files with this bug.

Many thanks

PeterHuk

Re: This Is Weird!!

PostPosted: November 8th, 2011, 7:04 pm
by Eduan
Glad you could identify the problem. :)

Re: This Is Weird!!

PostPosted: November 8th, 2011, 7:12 pm
by Jason Caldwell
Hi Peter. Thanks for the follow-up.

OK. So I've misunderstood the issue you reported. The issue was with existing Custom Capabilities not being removed, and reset to ONLY the new ones that you listed in the modification form.

This is to be expected in the latest releases of s2Member.
Please check this section of your Dashboard. The call to preg_replace() with the -all specification is not a bug, that's the intended behavior in the latest releases of s2Member.

s2Member -> PayPal Pro Forms ( click image to enlarge )
This is from the [?] icon next to the Custom Capabilities field.
SNAG-0117.png

So you'd want this in your s2Member Pro Form Shortcode:
Code: Select all
ccaps="-all,cmem,csfb,spof,tsas,mmed"

100% Resolved

Re: This Is Weird!!

PostPosted: November 8th, 2011, 7:24 pm
by peterhuk
Many thanks Jason,

This is a nice feature but a potentially dangerous one for S2Member web owners
who probably didn’t realise its ramifications.

For new features like this is there anyway to highlight there use or make them
more obvious. As there must be many S2Member web owner using existing
templates who will be unaware of the impact of this new feature.

Many thanks

PeterHuk

Re: This Is Weird!!

PostPosted: November 8th, 2011, 7:31 pm
by Jason Caldwell
Thanks for the follow-up.

Yes, I'm sorry. We normally make every effort to provide backward compatibility when/if something like this changes. However, this particular case was an exception. We'll make an effort to spotlight things like this in future releases, should something cease to be supported.

This was changed in the release of s2Member v110815.

Changelog excerpt:
http://www.primothemes.com/readme/3679/
(s2Member/s2Member Pro) Capability Additions (Changed). In previous versions of s2Member, when generating a Payment Button/Form, it was possible to precede your list of Custom Capabilities with a + sign, indicating that you wish to (Add) new Custom Capabilities instead of (Resetting) a User's Capbilities to the ones you list. Starting with this release, (Add) is now the default behavior. In other words, the + sign is no longer required, because s2Member will automatically (Add) Capabilities to any that already exist for a particular User/Member, even without the + sign (no longer required). In addition, there is now a new directive available: -all. You may now precede your list of Custom Capabilities with -all, but only if you wish to (Remove/Reset) all Custom Capabilities, and then (Add) new ones. For example: -all,music,videos, would remove any existing Custom Capabilities that may or may not already exist for a particular User/Member, and then add: music,videos. There are additional examples provided by the Payment Button/Form Generators that come with s2Member. Please check your Dashboard if you'd like to learn more.

Re: This Is Weird!!

PostPosted: November 8th, 2011, 7:50 pm
by peterhuk
Many thank Jason,

I randomly selected version 110815 thinking that would be far back enought to
test for this issue (but it was not far back enought LOL).

After any update I normally run a series of tests on my test site to
look for potential problems. This has highlighted a major flaw in
my testing procedures :oops: .

Will have to implement more robust testing.

Many thanks for your assistance.

PeterHuk

Re: This Is Weird!!

PostPosted: November 11th, 2011, 12:46 am
by Cristián Lávaque
Got it. Thanks for reporting this, guys. I hope Jason gets to this soon. :)

Re: This Is Weird!!

PostPosted: November 15th, 2011, 4:11 pm
by Jason Caldwell
Cristián Lávaque wrote:Got it. Thanks for reporting this, guys. I hope Jason gets to this soon. :)
This was related to a misunderstanding about the functionality in the latest releases. Or, more accurately, the inability for s2Member to maintain backward compatibility for the behavior that existed in previous releases, in this regard. Please see this post for a resolution:
viewtopic.php?f=4&t=15812&p=52590#p52590

Re: This Is Weird!!

PostPosted: November 28th, 2011, 6:09 pm
by beyonddesign
I am having the exact same problem and I wish someone would help out as I did pay for a developer license. Like the user above, when and existing member tries to update their custom capabilities, s2member won't update them. They ARE being passed to Paypal correctly as my IPN logs indicate. They just aren't being updated on the WordPress side. This is really killing me as I have to try to hunt down every purchase every day to manually update their accounts! Would someone please be willing to reach out and help with my specific site? I know I've already paid for the developer version, but I would love to pay more for someone to check out my site instead of guessing what it might be on the forums here!