Forum Replies Created

Viewing 15 replies - 31 through 45 (of 58 total)
  • @drnick2,
    Sorry to hear that.
    I have not heard back yet but sounds like there might be only one solution and that would be moving to another hosting company.

    It’s too bad because I really like Hostgator and codeguard but I need the correct customer IP.

    Here’s hoping a solution can be found without that.
    .

    @drnick,
    I also sent an email to the System admin that originally gave me the information I posted.

    I included the information from @johndcoy “thank you”.

    Will let you know what comes of that.

    Looks like the same code you posted from Hostgator that did not work.

    Hope this will solve it one way or the other.

    Thanks @fastrak,
    Sounds like that’s exactly what’s going on.

    When I contacted Hostgator they said-

    “We found that this issue began to occur between February 21, 2019 at 4:20 pm PST and February 22, 2019 at 8:05 am PST. During this window of a timeframe, I found that the only major change to occur was an upgrade from EasyApache 3 to EasyApache 4. Unfortunately when cPanel is updated to use EasyApache 4, it is a server-wide change, of which we do not plans of reverting.”

    This is when the problem started for our site and we did not do any updates that might have affected it.

    Like you said it a matter of getting them to help out on this problem if it’s possible.

    Thanks drnick2,
    I asked because I also run that plugin on a test site and I figured I could remove it and go back to http and not https.
    I could do some test orders and see if I get the real customer IP.

    I’m just thinking along the lines of what fastrack stated….. unless I’m just beating a dead horse with this idea.

    The only other solution I can think of is find another host.

    @fastrak,
    Thanks for the input.

    Sounding like this “is” a HostGator issue.

    @drnick2,
    By any chance do you use the Really Simple SSL plugin on your site?

    As I mentioned in a previous post- I didn’t do any plugin updates and it started about 2/21/19 when Hostgator upgraded from EasyApache 3 to EasyApache 4.

    This is a small bite from what they sent me-
    The rest is on the other thread-
    https://www.ads-software.com/support/topic/same-ip-address-for-all-orders/

    “The fact that the correct IP address is being returned by PHP, indicated that the issue at hand is not directly related to the server environment, but rather the way in which WooCommerce is obtaining the customer’s IP, when an order is placed.”

    I use security plugins that really depend on the customer IP as well and like you said it’s a real pain.

    I really hope we can get a plugin support tech to chime in on this again.

    Thanks drnick2,
    It’s only a matter of time before more Hostgator customers notice this problem.

    I hope they take a look at this thread and figure something out other than customers having to move hosting.

    drnick2,
    Since there have been no other comments posted with different hosts involved, I am thinking this is a Hostgator issue.
    This started for me when they updated the Apache servers in late February.

    drnick2,
    Here is the email I was sent:

    Thank you for contacting HostGator.com. It is understood that you’ve observed the incorrect IP being displayed within the Order’s section, of Woocommerce, within the WordPress installation for ‘yoursite.com’. I’m happy to help. Upon review, I found that this issue began to occur between February 21, 2019 at 4:20 pm PST and February 22, 2019 at 8:05 am PST. During this window of a timeframe, I found that the only major change to occur was an upgrade from EasyApache 3 to EasyApache 4. Unfortunately when cPanel is updated to use EasyApache 4, it is a server-wide change, of which we do not plans of reverting.

    In an extensive review, I had attempted to identify the exact change from the upgrade, that would be preventing the customer’s IP address from being displayed, and display your cPanel IP address instead. During this review, a test was performed, to confirm that PHP is indeed reporting the correct remote IP address. This was done by creating the following file.

    [root@cloudxxxx /home/yoursite/public_html]# cat /home/yoursite/public_html/test.php
    <?php
    echo “REMOTE_ADDR: ” . $_SERVER[‘REMOTE_ADDR’];

    ?>

    After creating this file, I went ahead and accessed ‘https://yoursite.com/test.php&#8217;, in which I found that the correct IP address is being returned by PHP. You should be able to confirm this by going to the URL, on your end as well.

    The fact that the correct IP address is being returned by PHP, indicated that the issue at hand is not directly related to the server environment, but rather the way in which WooCommerce is obtaining the customer’s IP, when an order is placed. Based on reviewing the PHP code, that makes up the function to get the IP address, it appears that the script is checking for the ‘$_SERVER[‘HTTP_X_FORWARDED_FOR’, before the $_SERVER[‘REMOTE_ADDR’], which contains the visitor’s IP address you’re expecting to see. This can be seen in the following section of the plugin file ‘class-wc-geolocation.php’.

    /home/yoursite/public_html/wp-content/plugins/woocommerce/includes/class-wc-geolocation.php
    136 public static function get_ip_address() {
    137 if ( isset( $_SERVER[‘HTTP_X_REAL_IP’] ) ) { // WPCS: input var ok, CSRF ok.
    138 return sanitize_text_field( wp_unslash( $_SERVER[‘HTTP_X_REAL_IP’] ) );
    138 // WPCS: input var ok, CSRF ok.
    139 } elseif ( isset( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) ) { // WPCS: input var ok,
    139 CSRF ok.
    140 // Proxy servers can send through this header like this: X-Forwarded-For
    140 : client1, proxy1, proxy2
    141 // Make sure we always only send through the first IP in the list which
    141 should always be the client IP.
    142 return (string) rest_is_ip_address( trim( current( preg_split( ‘/,/’, sa
    142 nitize_text_field( wp_unslash( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) ) ) ) ) ); // WPCS: input var
    142 ok, CSRF ok.
    143 } elseif ( isset( $_SERVER[‘REMOTE_ADDR’] ) ) { // @codingStandardsIgnoreLine
    144 return sanitize_text_field( wp_unslash( $_SERVER[‘REMOTE_ADDR’] ) ); // 144 @codingStandardsIgnoreLine
    145 }
    146 return ”;

    According to Hostgator from what I gather “way in which WooCommerce is obtaining the customer’s IP, when an order is placed is the issue”

    • This reply was modified 5 years, 8 months ago by wooguy.

    Hey drnick2,
    Did try NameCheap for another site when they had a sale going.

    I currently have the Business Cloud hosting from Hostgator.
    Do you have cloud or regular hosting?
    I am curious as to if this problem is across all of their packages.

    If enough users have this issue, it might draw enough attention to the problem to get some sort of fix.
    Probably quite a few have not noticed the problem that use Hostgator.

    Hi drnick2
    Sorry to hear that didn’t work.
    I was hoping it would since switching hosting is a pain but having the correct IP address is important for our store.

    You mentioned you have another host that the IP work correctly with.
    Are you happy with them and the performance?
    Any name you wouldn’t mind mentioning?

    Thanks for reaching out to Hostgator.

    I posted what they sent me on the other thread and was told it’s a Woocommerce issue and how it get’s handled in the script.

    Thanks

    drnick2,
    Thanks for the info.

    gidvmail- Do you also use Hostgator?

    There is also a thread regarding this over here-
    https://www.ads-software.com/support/topic/same-ip-address-for-all-orders/

    My host “Hostgator” still tells me it’s an issue with Woocommerce.

    Hope to get to the bottom of this.

    Hi Nazzgull,

    I tried this just as a test but had no luck.-

    https://blog.sqlauthority.com/2017/07/22/wordpress-ip-addresses-comments-local-server/

    I was hoping for a simple solution.

    Maybe someone will pick up on this thread.

Viewing 15 replies - 31 through 45 (of 58 total)