Community Support Forums — WordPress® ( Users Helping Users ) — 2010-08-27T14:21:26-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=486 2010-08-27T14:21:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2623#p2623 <![CDATA[Re: EOT / Delete Notifications not working?]]> on those variables being present for an EOT to be processed.
This is the intended behavior.

~ As always, great to have your feedback.
Please report all bugs.

Statistics: Posted by Jason Caldwell — August 27th, 2010, 2:21 pm


]]>
2010-08-24T12:58:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2558#p2558 <![CDATA[Re: EOT / Delete Notifications not working?]]>
I checked the code for version 3.2.2 in

auto-eots.inc.php

and it still seems to require that both "custom" and "subscr_id" must be set before sending a notification.

Is that not correct?

EDIT - I will have to test it.

Thanks, Marty

Statistics: Posted by martonic — August 24th, 2010, 12:58 pm


]]>
2010-08-24T12:27:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2556#p2556 <![CDATA[Re: EOT / Delete Notifications not working?]]>
martonic wrote:
Hi again Jason,

What about an EOT - will a notification now be sent when demotion occurs In all cases - even when there is no subscriber-id? :?:

Yes, that is correct. s2Member's Auto-EOT system also follows this same logic. This new rule applies to ALL forms of EOT/Deletions; including even when the Auto-EOT System is handling things, and there is no payment associated.

* I confirmed this against the latest release of s2Member v3.2.2.
However, I'm pretty sure this has been the case since 3.2.0 though.

Statistics: Posted by Jason Caldwell — August 24th, 2010, 12:27 pm


]]>
2010-08-18T12:11:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2468#p2468 <![CDATA[Re: EOT / Delete Notifications not working?]]>
What about an EOT - will a notification now be sent when demotion occurs In all cases - even when there is no subscriber-id? :?:

Statistics: Posted by martonic — August 18th, 2010, 12:11 pm


]]>
2010-08-17T14:21:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2383#p2383 <![CDATA[Re: EOT / Delete Notifications not working?]]> Update on this topic. ~ Thanks everyone.
This issue was addressed in the release of s2Member v3.2

@COMPLETED/TODO

- API Behavior. s2Member's API Notification for EOT/Deletions, has been changed slightly. In previous versions, the EOT/Deletion notification was only processed for a ( paid ) Member, who reached the end of their term, OR ... if a ( paid ) Member was manually deleted by an Administrator through the Dashboard. Starting with s2Member v3.2+, an EOT/Deletion Notification will be processed, EVEN if the account is NOT currently associated with a ( paid ) Member. In other words, starting with s2Member v3.2, if you delete an account manually ( through your WP Dashboard ) this will ALWAYS trigger s2Member's EOT/Deletion Notification; no matter what. For further details, check your Dashboard: `s2Member -> API Notifications -> EOT/Deletion`.

Statistics: Posted by Jason Caldwell — August 17th, 2010, 2:21 pm


]]>
2010-08-10T12:08:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2247#p2247 <![CDATA[Re: EOT / Delete Notifications not working?]]>
This problem exists both here:

user-deletions.inc.php

and here:

auto-eots.inc.php

:arrow: So if anyone wants to "hack" it fixed, you need to hack both of the above files.

Statistics: Posted by martonic — August 10th, 2010, 12:08 pm


]]>
2010-08-05T15:13:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2151#p2151 <![CDATA[Re: EOT / Delete Notifications not working?]]>

I have a reason for EOT urls to be pinged when ANY user is deleted, not just ones that were originally paid members. I think s2member could change the documentation to explain this a little better OR (cross fingers) support the pinging of EOT URLS when ANY user is deleted :)

I love s2member but this little snafo cost me about 7.5 hours :|

To be clear, I don't think this is a bug ... I think s2member is behaving as it was designed, I just didn't find the design of this area particularly intuitive.

Just wanted to let you know that I saw this.
I'll consider a change in a future release. Possibly an option that controls this behavior. Originally, this was designed to prevent a notification to an outside script that would *assume* it was for a paid Customer, and possibly cause further confusion; but I can see now that having this as an option would make s2Member even more powerful in this regard - under certain circumstances.

Statistics: Posted by Jason Caldwell — August 5th, 2010, 3:13 pm


]]>
2010-08-01T01:55:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=2014#p2014 <![CDATA[Re: EOT / Delete Notifications not working?]]>
How can we have members who have not paid through Paypal? One way, is if they paid by check! And this has to be supported, at least in the system I'm working on at the moment.

Thanks for a helpful insight and code snippet here! :mrgreen:

Statistics: Posted by martonic — August 1st, 2010, 1:55 am


]]>
2010-07-30T16:23:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=1990#p1990 <![CDATA[Re: EOT / Delete Notifications not working?]]>
Open up ../includes/functions/user-deletions.inc.php

Locate this code:

Code:
$custom = get_usermeta ($user_id, "s2member_custom");
$subscr_id = get_usermeta ($user_id, "s2member_subscr_id");


and replace it with this code:

Code:
$custom = get_usermeta ($user_id, "s2member_custom");
if (empty($custom) OR $custom =='' OR is_null($custom)) { $custom = true; }
$subscr_id = get_usermeta ($user_id, "s2member_subscr_id");
if (empty($subscr_id) OR $subscr_id =='' OR is_null($subscr_id)) { $subscr_id = true; }


This change will allow EOT notifications to be sent out when a user is deleted with or without the custom or subscriber id. Alternatively, we could just remove the conditional checks from the 'IF' statement but when your dealing with 3rd party code it's best to add your own code that you can remove later rather than start removing their code.

All this change is doing is making sure that the $subscr_id and $custom variables are true IF they do not currently have a value (otherwise they would be false and we'd be in the same spot we started).

I hope that s2member considers a more permanent solution in their next release whether it is to support non-member EOT/Delete notifications or to simply change the documentation a little bit.

Statistics: Posted by mycodetree — July 30th, 2010, 4:23 pm


]]>
2010-07-30T15:33:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=1989#p1989 <![CDATA[Re: EOT / Delete Notifications not working?]]>
Code:
if (is_object ($user = new WP_User ($user_id)) && $user->ID && $subscr_id && $custom && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))


If !$subscr_id or !$custom, the condition will never fire (and the eot notification urls will never be pinged).

Now this may seem unintuitive but in my opinion, the EOT/Deletion notifications should still fire EVEN IF the user doesn't have a paypal subscriber ID. I know, you're saying but why would they be a user if they never made it through the paypal process? I can think of a hundred reasons to have WP users that aren't 'paid members'.

Beyond that though, s2member docs say that it will ping the EOT/Delete notification URLS even in the case of a manual delete from the Dashboard. To me, that indicates any user that I choose to delete via WP Admin. What the docs don't mention is that the user has to have been a 'paid member' and have gone through the 'process' first.

I have a reason for EOT urls to be pinged when ANY user is deleted, not just ones that were originally paid members. I think s2member could change the documentation to explain this a little better OR (cross fingers) support the pinging of EOT URLS when ANY user is deleted :)

I love s2member but this little snafo cost me about 7.5 hours :|

To be clear, I don't think this is a bug ... I think s2member is behaving as it was designed, I just didn't find the design of this area particularly intuitive.

Statistics: Posted by mycodetree — July 30th, 2010, 3:33 pm


]]>
2010-07-30T14:56:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=1988#p1988 <![CDATA[Re: EOT / Delete Notifications not working?]]>
The 'sticky' area seems to be:

/includes/functions/user-deletions.inc.php

Specifaically, this chunk of code:
Code:
            
if (is_object ($user = new WP_User ($user_id)) && $user->ID && $subscr_id && $custom && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
               {
                  foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle eot notifications on user deletion. */
                            if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($subscr_id)), $url)))
                        if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
                           if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
                              if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
                                 /**/
                                 if (($url = trim ($url))) /* Empty? */
                                    ws_plugin__s2member_remote ($url);
                  /**/
                  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                  do_action ("ws_plugin__s2member_during_handle_user_deletions", get_defined_vars ());
                  unset ($__refs, $__v); /* Unset defined __refs, __v. */
               }

That is the conditional statement that determines if the EOT urls are notified with the ws_plugin_s2member_remote() function. You'll notice that at the end of the condition an 'empty' check is done ($url=trim($url)) and if it isn't true, nothing is notified.

Through debuging so far, I have found that the $url var is empty (not null) by the time it gets to the $url=trim($url) comparison.

Off the top, this looks like it might be a reg ex issue, I need to do some additional backtrace at dump the $url var at all stages though.

Statistics: Posted by mycodetree — July 30th, 2010, 2:56 pm


]]>
2010-07-30T13:12:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=486&p=1984#p1984 <![CDATA[EOT / Delete Notifications not working?]]>
Any ideas?

Here are the specs on my s2member:

Version: 3.1.5
Stable tag: 3.1.5
Framework: WS-P-3.0

I'm using WP 3.0.1

Statistics: Posted by mycodetree — July 30th, 2010, 1:12 pm


]]>