S2 Members Not Demoting Users
A couple of the websites I have developed over the years use S2Members plugin with WordPress to manager the users who pay a fee for premium membership content. S2Members takes the standard users and applies custom capabilities to them. Purchasing premium memberships (Level 1 – Level 5) lets users gain access to content that is not available to standard users.
On June 30th v140630 was released and there was an undocumented bug that caused users not to be demoted at the proper times. Normally if you have a one month membership that was purchased on July 19th at 4:08 pm CST, that user’s membership capability would be raised to Level 1 and then on August 19th, at 4:08 pm CST that user would drop down to Subscriber. This is standard free user level that WordPress assigns users.
When multiple sites that I have developed updated to v140630, this behavior stopped working. It appeared to one owner that users were not being demoted at all and to another that it was happing later than normal. It turns out that the the owner that said they were not being demoted at all just didn’t wait long enough. Users were being demoted but exactly 86400 seconds later than expected.
86400 seconds (one day) is the default grace period that S2Members has built in. Most site owners will give customers an additional 24 hours of access; just to help avoid any negativity that may result from a customer losing access sooner than they might expect. On all of the sites that I have developed, they have a one day membership and giving them a one day grace period would basically cut their revenue in half.
I am not sure why but when updating to v140630 reset this from 0 seconds to 86400 seconds. Simply switching it back to the 0 seconds that was there prior to the update corrects this issue.