Grace time not performing required function

Great to hear you are onboard Cristian. I hope you can help with a problem I have been having for some time. I originally posted this problem back in September at Best way to use EOT grace time but got no response. My client has a dysfunctional membership plugin at the moment because grace time is not doing what it really should be doing. They are actually quite stressed and putting a lot of pressure on me. Are you able to advise about how we can get s2Member to delay the demotion to Free Subscriber by the length of the grace time? Or perhaps you know of someone who could help me code this? I would be willing to pay for this assistance. But I am getting quite desperate and beginning to regret my recent move to s2Member due to a lack of support. I really hope your presence makes a difference.

1 Like

Hi Don! Thanks :slight_smile:

I’m sorry your client is giving you a hard time, I know how it can be. I’ll do what I can to help you achieve what you need.

I’ll answer your original question there.

I left you a reply there. :slight_smile:

I could write this customization for you. See my reply in the other thread, and if you feel you’d need help, let me know.

I sent this response by email on the 29th. Just checking that you received it?

Cristian I do not write PHP and given your expertise I would love you to assist me in solving this problem.
Do you have any sense, given your understanding of the issue, what the cost might add up to? I have a budget for this project and it is already stretched by trying to solve this through other developers who don’t understand s2Member like you do. But I will pay whatever you say is fair and I will be very appreciative of your help. Don’t think I am expecting any discounts. A fair pay for your time.

Can I suggest that I write up a brief for what I think the end result needs to look like and we can go from there?

I had not received the email. I’m glad you posted a reply here, I was wondering if still wanted help.

I don’t feel well about charging you in this case. It doesn’t seem too complicated, and you posted your original question months ago, even if I wasn’t around back then. I really want you to be enjoying s2Member, and I’d be glad to assist you with this. You can paypal me a donation if you feel like it afterwards, it’s up to you.

You already described the problem in the other thread. It’s still the same, or is it different now? Please describe in detail what you need, so I get it as close as I can. You can send me a private message with WP admin login and FTP credentials, so I can look into this. :slight_smile:

So this is the intention my client has. She has two kinds of renewing memberships - one annual and one triennial, but both membership levels grant the same kind of access. There is no difference between the two levels apart from their duration. Using the EOT reminder emails we would be notifying members at varying intervals before, at the time of, and after the EOT that renewal was due soon, now or was overdue respectively. If the member does not renew by the time their EOT rolls around the client does not want that member to lose access to the member benefits. She believes that some people just forget and she wants to give all members every encouragement to renew their membership. She wants these members to continue to have access to the member benefits for a period of three months. If during that three month extension the member renews their membership then they would commence a new membership cycle of one or three years from the day of renewal. If three months elapsed and there had been no renewal then the membership would permanently lapse and that ex-member would have to sign up again for a brand new membership. I would write the EOT reminders that helped the member understand their position at all times.

Can you explain to me how you think you would set this up? I think you suggested creating a new 3 month(?) member level which would be a kind of ‘pending membership’ which members would automatically be demoted to once they reached their EOT. Then if during that 3 month period they wished to renew they would only be presented with the one year or three year options. Does that sound like what you are suggesting might work?

I will definitely make a good donation if you can fix this for me.

1 Like

Where can I send admin and ftp access details to? I don’t see a private option within the forum.

Click on my name, and in the pop-up you’ll see a message button. :wink:

Yes, something like that. Only you don’t need two levels for the different payment intervals. The level is important for the access, not for the payment frequency. You can sell the exact same level with 20 different kinds of intervals, and the level would be the same. His subscription would be different, and that’s managed by the payment gateway on a user basis, and their EOTs set individually.

What I suggest is having three levels:

  • One for premium access for the paying user (sold for 1 or 3 years).
  • One to demote that user to once his paid time ends, but still with premium access for up to 3 months.
  • One for no premium access, for those that didn’t renew after 3 months.

Does that make sense? :slight_smile:

1 Like

I see you have more levels there, though… Would you like to explain the others?

A 0.1 level would make sense -
So instead of demoting to level 0 - demote to level 0.1 - and set a new EOT for level 0.1 - you could then decide to still grant access or not - and offer a different price tier to level 0.1.

It would like for 2 weeks after your have not paid - you can still renew for cheaper - and some content is still available.
(I would like to also have an option to block comments for level 0 members - but not level 0.1 members - or it would be even better to somehow highlight comments of level 0 members in the wordpress comments section - that is because members pay for support - and easily seeing this is level 0 member would make sense. I do not want to delete them completely - as users who sign up again, cause less work. So they should even if they take a break for a year or two - sign up again for cheaper price if logged in).

Also all members who have an active subscription which could not be billed - but is in retry period at paypal/stripe could be degraded to level 0.1

Then a last nice thing would be to have the demotion date as column in wordpress users list - that way I could say after 4-5 years delete all those users - not likely they ever come back.
(much more important to me is that s2member works reliably however - and a much better pro form checkout - but I guess above model would be easy to implement).

1 Like

The other levels are only for permanent lifetime members. These members exchange services for their membership so don’t need to pay for ongoing renewal, or they are exempt because perhaps they are medical specialists, or they are lifetime members after a lifetime of service to the cause. So these can be considered ‘set and forget’ levels. Same access as they other levels, just no renewal ever required.
But if these levels can be condensed in any way such as how you are imagining the other levels working then I am happy with that. I want the client to be able to isolate each membership type easily to view and I thought the only way to do this would be to set them as different levels.
By the way I did not configure s2Member myself. I engaged an Upwork developer to configure it but I was never confident that he was as experienced as he claimed he was. He didn’t seem to be able to think outside the box so if you see better ways to configure the membership system I am very open to this.

1 Like

Okay, I worked on your test site today.

I didn’t change every level, although they’re all basically the same, only thing that changes is length of time. I did need to free up level 1 for the intermediate demotion, so I moved the level 1 users to level 2.

Using the s2Member user import/export tool, I put all the “current” customers (levels 1 and 2) together in a single role (s2member Level 2), and gave them the custom capabilities “annual” and “triennial” as a label to tell them apart (I could have done the same for “contra”, “life” and “exempt” but didn’t bother, feel free to if you want.) WP Admin > s2Member Pro > Import/Export

I hope that makes sense and I didn’t confuse you.

I renamed Level 1 from “Current Annual” to “Overdue”, and renamed Level 2 from “Current Triennial” to “Current”. WP Admin > s2Member > General > Membership Levels/Labels

I changed the Grace Time in the EOT setting, to just 1 day. WP Admin > s2Member > PayPal Options > Auto EOT Behavior

I added the file s2-hacks.php to your /wp-content/must-use/ plugins folder with this code:

<?php

add_action('ws_plugin__s2member_during_auto_eot_system_during_demote', 's2_custom_eot_demotion_role');
add_action('ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote', 's2_custom_eot_demotion_role');

function s2_custom_eot_demotion_role(array $vars) {
	$user                 = $vars['user']; // WP_User object instance.
	$role_before_demotion = $vars['existing_role']; // Role ID before demotion by s2Member.

	if ($role_before_demotion === 's2member_level2') {
		// If he was at level 2, demote to 1 and give him 3 months to pay.
		$user->set_role('s2member_level1');
		update_user_option($user->ID, 's2member_auto_eot_time', strtotime('+3 months'));
	} else if ($role_before_demotion === 's2member_level1') {
		// If he didn't pay after 3 months, demote to 0.
		$user->set_role('subscriber'); 
	}
}

I created a test user and gave him the role Current (level 2) and an EOT time in the past, and after a while, wp-cron kicked in and demoted him to Overdue (level 1) with an EOT 3 months ahead. Then I changed his EOT time to the past again, and after a while he got demoted to Subscriber (level 0). So it seems to be behaving as desired.

Please run your own tests, check what I did, and ask me anything you want.

I hope that helps! :slight_smile:

Wow, this looks great, Cristian. Let me have a good look through it overnight and get back to you.

1 Like

So when a new subscriber signs up and they choose either annual or triennial membership, s2Member will assign the correct EOT even though they are signing up to the same level of membership. The custom capabilities will look after that and will identify them in the database with these labels? I performed an export and can see this new field ‘custom capability’. I had no idea that you could use this to differentiate memberships of different lengths.

Also I need to be able to send appropriate reminders to the different members at different times. For example I would want to send a reminder to level 2 members a month before their subscription is due to expire. But with level 1 I would want to send a reminder as soon as it starts, then a month later, then another month later, then just before final demotion. Each of these reminders will contain different content. I haven’t seen where I can send different EOT reminder emails based on the membership level. What do you advise?

I’m just running the same demotion tests that you ran now.

A question that is not directly related to this particular issue.
When one exports the full database from s2Member it comes with a huge amount of information about each user. I am trying to organise for my client to be able to export a list of the database themselves but not to have to wade through all the extra information that is exported. My initial thought was to see if I could get someone to write an Excel macro that would remove extraneous columns and rows and which would convert the UNIX timestamp format of the EOT to something meaningful for the client. Am I on the right track do you think by trying to get a macro written, or do you have any other thoughts?

So when a new subscriber signs up and they choose either annual or triennial membership, s2Member will assign the correct EOT even though they are signing up to the same level of membership.

Correct. The payment details are set by the pro-form shortcode and managed by the payment gateway. The level only manages access to content.

The custom capabilities will look after that and will identify them in the database with these labels? I performed an export and can see this new field ‘custom capability’. I had no idea that you could use this to differentiate memberships of different lengths.

No. Custom capabilities are also to manage access, not payment times. I only gave them those capabiities to use them as labels, so it’d be obvious in the users list the two different groups. Since your client was used to seeing them as separate levels, I thought he might miss that, so I added the custom capabilities. Not required for access in this case, but may make it possible to do fancier things with access if you can tell them apart.

Also I need to be able to send appropriate reminders to the different members at different times. For example I would want to send a reminder to level 2 members a month before their subscription is due to expire. But with level 1 I would want to send a reminder as soon as it starts, then a month later, then another month later, then just before final demotion. Each of these reminders will contain different content. I haven’t seen where I can send different EOT reminder emails based on the membership level. What do you advise?

I’m sorry, the reminders system is general for all, doesn’t filter by level or capabilities… There may be a way to hack it, but I haven’t studied it yet. I agree that it’d be better to have different sequences for each, and I plan to address this in the future, it’s on my list.

I’m just running the same demotion tests that you ran now.

Great :slight_smile:

You’re probably using the Advanced exporter. Try the simper one. it gives less columns. You can also get a more readable export, but keep in mind that it’s not re-importable.

export-1-1000.zip

No, it’s actually from the one you suggest. See attached. This is what gets downloaded when I run the User/Member Exportation, not the advanced one.

My testing worked just as yours did. My level 2 was demoted to level 1 after its EOT was reached and my level 1 was demoted to subscriber when its EOT was reached.

1 Like