s2Member API / Notifications section no longer work since the beginning of April when they worked very well for more than 2 years.
I specify that I have the PRO version of s2Member up to date and that it is perhaps the last update which created this problem, I cannot verify it.
I am having a similar issue with webhooks periodically failing through Stripe. Seeing errors from the API as well. Is your issue with Stripe? I posted about this here…Webhooks Failing in Stripe Suddenly I’ve been going crazy trying to pinpoint the issue. Some webhooks work, some don’t. When retried, they usually work. This all started on April 2. I have the previous version of S2Member. I’m afraid to update right now. It was pointed out that this may be due to network congestion, which makes a lot of sense. However, I have users that sign up and pay and S2Member doesn’t update their account properly because the failure. I have spoken to my host and Stripe. My host says no problems, Stripe says it’s network time outs with my server. The internet may officially be broken.
It sounds like are describing something different.
Stripe and PayPal webhooks all seem to be working correctly according to Stripe and PayPal reports, and the member’s registrations are also done correctly within s2Member.
Only the files supposed to be called thanks to the API / Notifications section are no longer called.
Yes, I think my hosting provider changed something on April 2 on my dedicated server, but they’re not being very helpful. I noticed that MySQL server was perhaps reset and since then I’ve been having these time outs with webhooks failing. This has got to be related, but they won’t address my questions regarding this since the website is working fine otherwise.
@Seth78 - Could you restate your problem. I am not sure what problem you are having.
You said “s2Member API / Notifications section no longer work”. I’m not sure what that means…I’m not sure what “S2 Section” you are referring to…the admin options box seen in the admin page? When you say it “no longer works”…can you give a specific example like…I select the S2member level and when I update the page the setting is not remembered…
You also refer to " the files supposed to be called thanks to the API / Notifications section are no longer called"…what files and what do those “files” supposed to do that they are no longer doing?
If you provide a clearer description of the change from what used to work that no longer works in end-user terms it will be easier for us to assist. What did the end-user / admin experience look like when it WAS working and what is that experience now that it is NOT working.
I thought I was clear. I am not an English speaker so I may be expressing myself poorly in English.
I’m talking about the section called “API / Notifications” in administration menu of the plugin itself.
This section is supposed to be more reliable than the “API / Tracking” section and allows to add functions related to the different “webhooks” of s2Member. It was that I called “files supposed to be called thanks to the API / Notifications section”.
My problem is therefore: the files called for more than 2 years without problem with this section, are not been called since the beginning of April.
Ok. Thanks for that. There are 9 notification hooks (Signup, registration, etc) . Which of the 9 notifications are you hooking and which worked before and are now not working. Be specific.
So, for example, do you have 1 hook, 2 hooks, which hooks, have they all stopped working, have some stopped working, if so…which ones.
In April did you add any new plugins?
In April did you switch themes?
Was there anything that you can think of that you changed on the website in April…did you upgrade the PHP on your server?
With the answers to these questions we can narrow things down. I’m online for the next 12 hours so I’ll respond to you as soon as you post info.
I only use the API / Notifications webhooks related to registration, payment, EOT, cancellation and refund.
They allow me to load PHP files for different interactions such as billing and creating / deleting custom profiles.
Since beginning of April, these PHP files aren’t called.
I have changed absolutely nothing on my server or my website for months, only updates of plugins and themes are made regularly.
Besides, there was also an update to Wordpress 5.4, it could possibly come from that.
It is difficult for me to test because these functions are directly linked to my professional environment, these tests would therefore create problems in my databases and billings.
What do you think about this?
I’ll do a couple of tests to see if they are working. I multiplexing with some client work so it will take me about an hour. Check back in 1.5 hours and I will post an update here on what I find. We’ll go from there.
Actually, before I do the tests, can you answer me another question @Seth78? Do you have a firewall plugin installed or is there a host firewall. The reason I ask is that the first thing I would test if I got the error you are having would be to check the network traffic.
You see…you use the word “files” but that is not exactly how the hook works. The hook doesn’t call your code files…you put a URL in the hook, the hook calls the URL, you have logic somewhere that receives that URL and processes it. Where is that logic and who wrote it…you or someone else? Are your hook urls terminating on a network service like Zapier or IFTTT?
Before I invest in testing s2member hooks…can you clarify where your logic is that is triggered by the s2hooks (same server, different server, intermediated by Zapier, IFTTT or other )? Walk me through one of your hooks.
You are absolutely right, s2Member webhooks only generate URLs which in turn call my PHP files.
I am a programmer so these are my files directly.
I don’t use extern network service like Zapier or IFTTT, files in question simply process the data received by the “Replacement Codes” in the “API / Notifications” section by creating data and billing lines in the MySQL database (on the same server).
I am using a firewall on the server and on Wordpress but I haven’t changed the settings for a long time.
Thanks for your help.
Ahh…a techie. Excellent. Any chance you can trigger a hook (test registration) and see if it shows up in your apache / nginx log? I just want to see if the traffic is getting through or is getting rejected (e.g. 404 / 500) before setting up a test on my end.
I looked at “error logs” of all my security system logs, apache logs and firewalls logs: no error appeared at the time of the last “s2Member payment’s hook” anywhere…
I don’t understand why it doesn’t work anymore.
So I can reproduce, is your url an ajax style url that terminates in some AJAX logic or do your hook urls end with .php (e.g. triggering a php file directly)?
The urls that I use are like “https://mysite.com/wp-content/themes/somedirectory/facturation.php?idclient=%%subscr_id%%&idpaiement=%%txn_id%%&monnaie=%%currency%%&montant=%%amount%%&level=%%cv1%%&code=%%cv2%%&reduction=%%cv3%%&passerelle=%%cv4%%&facilite=%%cv5%%&programme=%%cv6%%”
Have you tried to call them directly (externally or via curl statement in the console)? If they don’t work directly then they won’t work from the s2hooks.
This also raises a question about security. Can these hook functions be called from the Internet! What happens if someone maliciously calls them? Have you blocked internet access to these php functions? If so, how (e.g. via firewall)?
Yes I have protected these functions by passwords and administrator controls.
Unfortunately, as I told you, I can’t really manually call these functions as they are for testing without causing unmanageable consequences in my database.
So I will have to modify the code in test mode for this.
I’ll keep you informed.
Ok. here’s an idea that should be simple.
You said that you are hooking registration, payment, EOT, cancellation and refund and you can’t test call those.
Ok…leave those alone. Add a test hook to S2 Signup notifications that calls a new test function you create. See if that works when called directly. You can test by adding a testuser to trigger the callback.
I did a test by copying a “s2hook URL” in my browser and replacing variables type “%% … %%” with normal values and it worked.
It is therefore not a security system or firewall that blocks URLs in the “API / Notifications” section.
In addition, I noticed that recurring payments (new debits from an existing member with recurring payments) always called this function correctly.
Only initial payments and initial registrations for new members seem to be a problem.