Automatic EOT Time does not get populated after IPN is received?

WordPress Version: 4.9.4
s2Member Version: 170722 + s2Member Pro v170722

On the 17th I created a level 1 member subscription with 1 day try free and then afterwards $1.20 per month. About 1 hour after creating the subscription I cancel the subscription through Paypal and was expecting the member to be demoted back to level 0 free subscriber but it continues to stay on level 1.

[s2Eot /] echos out “Next Payment: Mar 19th, 2018, 10:00 am UTC”

where if I do the following:

$eot = s2member_eot();
echo var_dump($eot);

which echoes out:
array(4) { [“type”]=> string(5) “fixed” [“time”]=> int(1521386410) [“tense”]=> string(6) “future” [“debug”]=> string(146) “This is the estimated EOT time. The PayPal Pro API says this subscription is no longer active, and thus, access should be terminated at this time.” }

echo gmdate("M jS, Y, g:i a T", $eot['time']);

echos out “Mar 18th, 2018, 3:20 pm GMT” which is a different time from using [s2Eot /].

Also I have noticed that no EOT set against the field “Automatic EOT Time” on the users record.

The other confusion is that I have the EOT Grace Time (in seconds) is set to “0” so even s2member_eot() is not right as the EOT should have been now and not 24 hours later which is the default.

It has now gone past 3:20pm, 18th March and I have run the following PHP:

$eot = s2member_eot();
echo var_dump($eot);

which echoes out:
array(4) { [“type”]=> string(5) “fixed” [“time”]=> int(1521386410) [“tense”]=> string(4) “past” [“debug”]=> string(146) “This is the estimated EOT time. The PayPal Pro API says this subscription is no longer active, and thus, access should be terminated at this time.” }

I can see the time is the same but the field tense has now changed to past so s2Member knows its gone past the EOT. But the user has not been demoted and is still on Level 1.

[s2Eot /] echos out now “Access Expires: Mar 18th, 2018, 3:20 pm UTC”

I’ve reported this as a bug on github but it seems there is not a lot happening on there at the moment and I am now hoping that someone on here may have seen this before or knows a workaround I can do to either fix it or patch it to make it work correctly.

Thanks

Hello,

don`t know If my solution will work for you. I had also certain problems with EOT. Sometimes it worked, sometimes not.

Then I checked the php memory. It was set to 256MB. Had a firewall and many other plugins in my background, and if all run at the same time - firewall-scans, hightraffic-rates and WP-Statistics or updates, then the wp-cronjob to demote members stepped out.

I set my PHP Memory higher to 1024 MB, and that fixed all my problems.

Thanks Bob,

The memory was set to 256M and based upon what WP-Memory-Usage plugin was telling me I was using around 25% of memory. But I did try it and raised the memory to 1024M and tried the whole test again.

It did not make any difference but what I have observed now is as soon as the member cancels his subscription through Paypal, s2Member creates a WP transient record and records the date when the access expires which is what I see when I run this code:

$eot = s2member_eot();
echo var_dump($eot);

array(4) { [“type”]=> string(5) “fixed” [“time”]=> int(1521494874) [“tense”]=> string(6) “future” [“debug”]=> string(146) “This is the estimated EOT time. The PayPal Pro API says this subscription is no longer active, and thus, access should be terminated at this time.” }

So based upon that I believe that the WP Cron (ws_plugin__s2member_auto_eot_system__schedule) did run as it must have created the transient record, but what it failed to update was the EOT time on the users record under the field: Automatic EOT Time.

Why did it not update this field?

Hello Merlin,

unfortunately, that special case is way about my knowledge. Good luck.

Thanks for trying Bob… does anyone else have any other ideas?

This is where I am at the moment with this issue:

  1. Free trial subscription is created and member is set on level 1.
  2. Subscription is cancelled by member.
  3. Paypal sends out IPN Cancellation.
  4. s2Member receives IPN Cancellation.
  5. s2Member creates Transient records for EOT.
  6. s2Member FAILS to update Automatic EOT Time field with EOT time on users record?
  7. WP Cron fires but because the field Automatic EOT Time is blank the member does NOT get demoted.

I need to know why point 6 above is not happening as I think it is this that is causing all the issues with EOT?

As a paid member of s2Member how do I get answers for this issues?

Thanks

It sounds to me as though s2Member is not setting its cronjob correctly. There have been a number of reports of this problem both on this forum and o s2Member’s Github page.

Try doing a search in both places to see if anyone has come up with a fix that works for you.

I don’t think its the cronjob as I’ve already debugged what it runs includes/classes/auto-eots.inc.php and tracing this through I can see that this only looks at the user records where the field Automatic EOT Time has a value. If I manually put an EOT Time into this field then the cronjob runs fine and the member gets demoted.

So the issue has to be with when it receives the IPN from Paypal… at this point I believe it should be updating this Automatic EOT Time field on the user record and also firing of the s2notification for cancellation which is also not happening at the moment.

I’ve done a lot of google searching around this but at the moment I’ve not found anything which helps me.

Then I would open an issue on Github and explain all these steps there. That is more likely to get the devs’ attention.

Yep I’ve already done that… but it seems that there is no development going on at the moment as there has not been an update since 22 July 2017 :frowning:

Who cares about updates just for the sake of updates? Most updates are really just fluff.

An update to resolve a specific problem, like yours, is worthwhile.

Talking of updates…

After many hours of looking at this issue I have now fixed the issue! :slight_smile:

All it was… was a plugin conflict with another plugin called iTheme Security. This was all working great some months ago but I guess it must have been one of the recent updates that we applied to iTheme Security which broke s2Members EOT.

I did find this on the issue: https://github.com/websharks/s2member-kb/issues/328 but even disabling those features did not make it work. I even tried disabling all of the features within iTheme Security and that still broke s2Member EOT.

Having looked around I decided to go with Loginizer as it had a particular feature that I required that not all of them have, and I can confirm that this replacement does not have any conflicts with s2Member as I can tell at the moment.

Life is all good again…

:slight_smile:

1 Like

Thanks for reporting back with the good news. I suggest installing a logging plugin like Simple History, so that you will have a log in future of every change that gets made to your site.

Thanks Tim that’s a good Idea I will do that.