juanguillermo
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Membership] SWPM cannot process this access requestHello!
Yep, in fact, I am creating the user using the SWPM API.
However the documentation doesn’t say anything about Login.
Do you have an API for login?
What part of the plugin is blocking login through the WordPress API?
Regards.
Forum: Plugins
In reply to: [Simple Membership] SWPM cannot process this access requestUpdate:
When I GET request from Insomnia, if the SWPM plugin is active, I get a 500 error in the response body. But if it’s inactive, I get the 200 code, user data in the body, and WP login cookies in the header.Insomnia’s settings say that it automatically stores these cookies and sends them when they are needed.
Now (the interesting thing) if I reactivate the SWPM plugin and do GET, I get code 200, the user data and NEW WP login cookies + SWPM login cookies.
From then on, all the requests you make to WP will be code 200. Logically, in each login request the cookies change.
Now, if I copy these cookies to my fetch code in Node.js, I also get 200 code from WP, even if the SWPM plugin is enabled.
Logically, these cookies expire and it is not something that can be used in production, but this information may help to solve the problem.
Forum: Plugins
In reply to: [Affiliates Manager] Cookies for future purchases: are they always necessary?I already solved the issue with cookies overwriting. Now check if it exists before calling setcookie().
I’ll leave the code here in case someone else needs it:
That’s the line 48 in file clicktraking.php:
setcookie('wpam_id', $aff_id, $cookie_life_time, "/", COOKIE_DOMAIN);
Replace by:
if(!isset($_COOKIE['wpam_id'])) {setcookie('wpam_id', $aff_id, $cookie_life_time, "/", COOKIE_DOMAIN);}
Code considerations:
1. This is a “patch” solution, something temporary for further development. I would not use it for production environment.
2. They should be careful and alert when the plugin is updated, it is possible that the code will return to its original state.I hope the plugin developers can release some official update soon, ideally with option 1 from my previous post.
You guys have a great plugin!!
Forum: Plugins
In reply to: [Affiliates Manager] Cookies for future purchases: are they always necessary?I was thinking of another solution, and I think it is easier to implement:
How can I prevent the cookie from being overwritten?
If Person A shares their referral link with Person B, and Person B signs up with that link for free membership, a cookie is written with Person A’s id.
I can set a long duration for that cookie, so when Person B makes a purchase, the commission is assigned to Person A.
However, if by any chance Person B re-enters the page through another affiliate link (for example, Person C’s link), the cookie value will be replaced by this new ID, and the commission will of the sale will be assigned to Person C, even if Person B already has their free membership on file.
This can be solved in two ways, as far as I understand:
1. Linking Person B’s email to Person A’s affiliate account, even if Person B only “purchased” the free membership. It would be something like “email commission tracking”.
2. Setting the first cookie with long duration and preventing the first cookie from being overwritten by a new cookie.
I would prefer the first option, since this way the commission is guaranteed regardless of whether the cookies are deleted from the device.
But I understand that it is a medium-sized development that will surely take time.
The second option seems easier to implement.
Could I hire your development team to help me with any of the solutions?
PS: Please consider developing option 1, either as a built-in feature or as a premium plugin.
I’ve been reviewing other affiliate plugins and SAAS and most of them track commissions only by cookies, and not by email.
Forum: Plugins
In reply to: [Affiliates Manager] Cookies for future purchases: are they always necessary?No, signing up for a free membership definitely does not count as a purchase.
What options do I have to be able to achieve this?
Do you have plans in your roadmap to upgrade WPAM to track free signups so you can award lifetime commissions?
Do you have a development service that I can hire?
Yes, I read it. In fact I was using that extension when the problem happened.
What I did was the following:
I used the “swpm_before_login_request_is_processed” hook to check if the user who is trying to login exists in the database. If it exists, I check if your membership is expired. If it is expired, I change it to active and downgrade membership to 2 (free).I don’t know if it’s correct to leave the code here. Please let me know.
Forum: Plugins
In reply to: [PWA for WP & AMP] jQuery is not definedI’m not so sure which version you are referring to. Please let me know if you mean any of these:
– PWA for WP: Version 1.7.49.
– Current version: 6.0.2.
– Chrome: Version 105.0.5195.102 (Official Build) (64 bits).Forum: Plugins
In reply to: [PWA for WP & AMP] jQuery is not definedI apologize, I was out of town.
I tried clearing the cache and the error message on the console disappeared.
However, less than 1 hour later it reappeared.
I also tried deactivating the plugin and activating it again, with the same result.
This is the message that appears on the console:
pwaforwp.min.js?ver=1.7.49.26:8 Uncaught ReferenceError: jQuery is not defined at pwaforwp.min.js?ver=1.7.49.26:8:40 (anonymous) @ pwaforwp.min.js?ver=1.7.49.26:8 jquery-migrate.min.js?ver=3.3.2:2 JQMIGRATE: Migrate is installed, version 3.3.2 pwa-register-sw.js?ver=1.7.49:16 Congratulations!!Service Worker Registered ServiceWorker scope: https://www.sobreviviendoalacrisis.com/
I don’t know much about programming, but it seems to me that I need to load JQuery before PWA for WP runs… I just don’t know the correct way to do that.