Wrong IP being sent - why? HOW?!

Hi, hoping someone recognises this issue and can maybe help. I’ve been running s2member in conjunction with idev affiliate for about four years without major issue… until 23rd February this year when, for a reason still unknown, commissions stopped tracking in idev.

The reason for this is that the wrong IP address is being passed in the url to idev. But I don’t know why that’s happening, or how to get the right IP address to be passed again.

Here’s what I’ve managed to establish (I’m not a techie but have a little awareness) -

  • Affiliate click tracking continues to be correctly pegged against the clicker’s IP within idev
  • All s2member payment and membership functionality continue to work fine
  • iDev is configured correctly
  • A different IP from that which clicked the affiliate link is being sent in the url to idev, example below:

https://www.horseracingexperts.co.uk/affiliates/sale.php?profile=83&idev_saleamt=12.00&idev_ordernum=I-9H0A75AUJ52P&coupon_code=Old12&ip_address=89.242.20.155&idev_option_1=customer_name&idev_option_2=customer_email&idev_option_3=items_purchased

The output being sent should be &ip_address=92.0.164.13 [that’s my static IP here]

Instead it is &ip_address=89.242.20.155

I’ve seen references to REMOTE_ADDR in some help locations and wonder if introducing that might assist.

Any thoughts on why this is happening, and what to do about it would be most welcome.

Thanks in advance,
Matt

So let me see if I have this right…

I have been an s2member user for over four years without a hitch. My business is predicated on using this membership script in conjunction with idev affiliate, and suddenly, inexplicably, that handshake has stopped working. Yet there is no recourse to support from s2member. That’s more than a touch disappointing.

I have been working with idev support for a week to get to where I am in terms of understanding this issue, and yet now there is nobody within s2member available to pick up the baton.

I don’t know the cause of the issue nor how to fix it and, in the (protracted) meantime, I have difficult conversations to have with my loyal affiliates.

Can somebody please acknowledge this message and at least confirm that my understanding of the support situation is correct. It might be time to investigate alternative membership scripts. (That is not a pleasant thought as those of you ensconced in the s2member way of life will attest).

Thanks for reading, if anyone actually has read this…

Matt

OK, I spent some money on upwork to get this resolved. Below is the (slightly hacky) fix. In the absence of a properly coded solution in the product (s2member, come on guys), this may assist others with a similar issue…

To repeat, I had a fully operational s2member/idev/wordpress menage a trois for over four years, and have done more than a million dollars in business through that arrangement. Then, one day last month, it stopped working.

SOLUTION

This code added to functions.php (on my child theme) -

// if (preg_match(’/^185.82.177./’, $_SERVER[‘REMOTE_ADDR’])) {
function idev_ip_fix_func( $atts, $content = “” ) {
$content = preg_replace(’/(custom="’.preg_quote($_SERVER[‘HTTP_HOST’]).’)"/i’, ‘${1}|’.$_SERVER[‘REMOTE_ADDR’].’"’, $content);
return do_shortcode($content);
}
add_shortcode( ‘idev-ip-fix’, ‘idev_ip_fix_func’ );
// }

That enables my s2member button form code to be wrapped in [idev-ip-fix][/idev-ip-fix] shortcodes.

The issue is/was around the passing of the correct IP address. Using REMOTE_ADDR is core to bypassing that problem.

Hopefully the above update might be useful to anyone else suffering with a similar challenge.

Matt