Automatic EoT settings not sticking

Excuse the poorly phrased title. I am having an issue with the automatic EoT behavior for paypal.

Right now, the setting is blank and there are no S2 associated cron jobs scheduled. I change and save the setting to ( Yes / enable via WP-Cron ), a new S2 cron job is created (ws_plugin__s2member_auto_eot_system__schedule), and it appears to be working.

The problem is that when I leave my site and come back after some time, the setting does not persist, there is no automatic EoT behavior configured, and the cron job is gone.

I tried deleting and reinstalling the plug in, but that did not work, though I kept safegaurds on.

Any insight or suggestions would be appreciated.

s2Member Framework Version 241114
s2Member Pro v220421
Wordpress v6.7

1 Like

Wordpress Cron is a mess. It only works when you have traffic. When nobody visits your site for too long the cron jobs aren’t triggered.

I curl my website every few minutes from within itself, since I run it on a VPS. It was hell to set it up in a way it worked, took me weeks and multiple tutorials but I got it done.

I hope you can figure out the same for yours.

1 Like

Thanks for the response. I agree and have so found that wp-cron can be unreliable at times. However, the issue I am having is that the setting option within the plug in is resetting itself, for lack of a better word.

It will be set and appears in the cron queue for a short time, but eventually disappears.

I tried to manually schedule the task in the WordPress cron scheduler, and that seems to have stuck when I check the PayPal Options settings menu, but I have not been able to get it to send expiration notifications to my test accounts.

Sorry if this is poorly explained, I am responding from my phone.

1 Like

s2member has a separate way to call its Cron Job. I also curl yourdomainhere/?s2member_auto_eot_system_via_cron=1

Maybe you can test it out? Then, set up an automated routine to curl that address every few minutes?

There’s also many tutorials towards disabling the native automatic cron that runs on Wordpress and using your server to ping itself (if you run a VPS). I know I experimented a lot but I don’t remember how I set up things anymore, sorry.

I feel you’ll find a good routine that suits your needs, since you might be running Apache, NGinx or something else, for example.

The way you set things up vary a little. And the choices you might want to make. The amount of traffic your site gets also interferes with that choice. I know I had to set the self call because even with enough traffic Wordpress wouldn’t run its cron jobs otherwise.

It’s an old problem. It’s not related to Cron. I didn’t have it often in the last 3-4 years but before the setting would be lost once every 2-3 months. No idea what’s the bug responsible for it. No way to solve except finding the bug

2 Likes

It is an old weird behavior that some few have seen over the years. There seems to be something in those setups that removes s2’s cron and affects the EOT setting.

See: https://s2member.com/kb-article/automatic-eot-system-option-goes-blank-why/

:slight_smile:

1 Like

But that article is wrong - It happened to me in a clean test installation with nothing but s2member and wordpress (but a huge user database). I rather think it happens if it chokes on too many deleletions with a timeout or something similar. and my php has pretty crazy execution limits.

2 Likes

Thanks for that insight, Felix! I guess Jason figured that with what he had reported to him at the time. Not being able reproduce it consistently makes it hard to pinpoint the cause.

Okay, then it seems to be related even more directly to a flaw in WP Cron itself under some extreme conditions… But not sure yet.

It’d be lovely to have something more reliable that doesn’t require the site owner to set up a cron job in the server…

It would be great if s2member could just check it once a day and reset if the cron job is deleted. I really don’t know what’s the reason but with less traffic and users it happens less often. Or my dedicated server is just crazy overpowered for 1000 users a day (core i5 12500, 128GB Ram, 2TB Nvme Raid, 2*8TB data storage, 1gbit/s connection) just to serve the 2 websites…

1 Like

Yes, I’m thinking that maybe something could be done along those lines…

Sounds like you’re on the run from an AI company with all that gear… :yum: