S2Member API / Notifications no longer work

Nice detective work :slight_smile:

That narrows the problem considerably. I’ll try to reproduce. It will take a few hours. I’m multiplexing with my client work.

Hi @Seth78 - I have tested the s2member code for a registration notification hook while using a code debugger to trace the s2member logic for the registration notification hook and it worked fine for an external url. I traced it all the way through to successful conclusion.

I did have a low-level CURL failure (errorcode 7) when I tried to call a local php file. I am using docker on Windows as my development environment and there are some idiosyncrasies in trying to call a localhost non-80/443 port since this trips over loopback and security logic. So a php function that I could call via the browser triggered a curl error 7 (could not connect) when placed in the s2member registration notification hook.

What that means for you…you will need to clone your site and work with a code debugger / network debugger to trace down why your loopback is being blocked. This would be a conversation you would need to have with your hoster. Also keep in mind that loopback involving WordPress in a docker container may be more quirky than WordPress in a VM.

One stack-overflow experiencing a curl error 7 traced it down to their hosting provider blocking http packets addressed to their IP block that originated from within their IP block.

Let us know how you go. But this does not appear to be an s2member error. @clavaque - any thoughts?

If you want to keep using your existing php code you could consider switching to using s2member hooks / filters instead of notifiation triggers. The former is better for co-located customisation code and the latter is better for remote customisation code. See https://localhost:32771/wp-admin/admin.php?page=ws-plugin--s2member-scripting

Hi,
Thank you very much for your investigations.
What I don’t understand is why it worked well for more than 2 full years and now these errors appear regularly.
Anyway, I will continue to investigate on my side according to your comments and try your workarounds.
Thank you so much.

Could be a WordPress change, or a php module change, or most likely a tightening of the server by your hoster. The question is whether your dedicated server is actually a physical server or a fixed capacity virtual server on a physical server. If it is the latter case then loopback to the server from itself may have been restricted by your hoster. You can test that. just write two php functions ith one calling the other using a URL and CURL…see if it works. If it doesn’t then talk to your hoster.

CORRECTION: My last comment assumed you were on a dedicated server. That was Matt’s server though. I realise now that you didn’t say what type of hosting you use or who your hoster is. If you are on shared hosting then your hoster tightening up loopbacks would DEFINITELY be my top suspect. Do the CURL loopback test I previously suggested and you can prove it and then go to your hoster with questions.

Hi,
Little back on this problem: it has been resolved by itself over time.
I think it was due to network problems related to crowding during confinement related to COVID-19.
Thanks for your help.
Best regards.