Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there!

    Thanks for contacting us! ??

    I understand you are using WooCommerce webhooks and for some of the sites, you are getting IP addresses in the X-WC-Webhook-Source header.

    Looking at the code line that you shared, it seems like WooCommerce uses WordPress function home_url() which in turn uses get_option( 'home' ). This means the address value is pulled from the Site Address (URL) field under WP Admin > General > Settings.

    For the site/s in question, you could check if there’s an IP address instead of a URL in field Site Address (URL) under WP Admin > General > Settings.

    I hope this helps!

    Thread Starter andresgonzalez

    (@andresgonzalez)

    Hi Kaushik, Thanks for your response.
    I can confirm that the site address is the URL. This problem occurs occasionally, not always, and in many sites.

    Hi @andresgonzalez

    This problem occurs occasionally, not always

    That makes it impossible for us to witness the behavior or to replicate it. Did you notice any pattern about under what circumstances is the problem happening?

    … in many sites

    Are the sites hosted on the same server? To rule out any issues from the host’s side have you contacted the hosting provider?

    Thread Starter andresgonzalez

    (@andresgonzalez)

    Hi Margaret!! Thank you very much for replying.

    The sites are hosted in separated AWS LightSail instances (single site, Bitnami WP).

    I agree that it is very difficult to reproduce the problem, even for me. Besides, I am not an expert in PHP.

    I’m looking at the get_option code. It gets the siteurl from the wp_options table in the database. I queried the db directly and there is only one record with the right value.

    I am suspecting that a connection problem with the db might lead to a default value (see line 203), but I couldn’t follow to find where it is replaced by an ip address.

    Is there a way to troubleshoot db connection issues?

    Hi @andresgonzalez, how’s it going today?

    Just to be sure, x-wc-webhook-source sometimes return an IP instead of the site URL, is that correct?

    WooCommerce saves logs of all events triggering a webhook (like x-wc-webhook-source). Webhook logs are found at: WooCommerce > Status > Logs.

    Can you double-check if there’s any log in there? If so, paste them here in your response.

    In the same location, you may find any WooCommerce Fatal error.

    You can also check for PHP errors, they’re usually saved on your server, but the folder may vary. You can check with your hosting company the exact path but it should be something similar to:

    • in your server’s root folder, called error.log
    • in public_html or similar folder, called error.log
    • in var/logs or similar, called error.log
    • Let us know if there’re any logs, it will help us to diagnose it!

      My very best,

    We haven’t heard back from you in a while, so I’m marking this thread closed for now – we’ll be here if and/or when you are ready to continue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘home_url returns ip address instead of site url’ is closed to new replies.