Title: Troubleshooting: Failed to get echo data from WPAPI
Last modified: May 14, 2025

---

# Troubleshooting: Failed to get echo data from WPAPI

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/troubleshooting-guide-wpapi-echo-data-failure/)
 * **Step 1: Verify IP Detection**
 * Add this code snippet to your theme’s `functions.php` file:
 *     ```wp-block-code
       function ip_check_callback() {
           $data = array(
               'remote_ip'         => $_SERVER['REMOTE_ADDR'] ?? 'Null',
               'x_forwarded_for'   => $_SERVER['HTTP_X_FORWARDED_FOR'] ?? 'Null',
               'proxy_remote_addr' => $_SERVER['PROXY_REMOTE_ADDR'] ?? 'Null'
           );
   
           return rest_ensure_response($data);
       }
   
       function register_ip_check_route() {
           register_rest_route('lscwp', '/ip-check', array(
               'methods'  => 'GET',
               'callback' => 'ip_check_callback'
           ));
       }
   
       add_action('rest_api_init', 'register_ip_check_route');
       ```
   
 * This creates a REST API endpoint for IP verification. Test it by visiting:
   `https://
   your_domain.com/?rest_route=/lscwp/ip-check`
 * **Expected Result:**
 *     ```wp-block-code
       {
         "remote_ip": "79.xxx.xxx.183",
         "x_forwarded_for": "79.xxx.xxx.183, 176.xxx.xxx.157",
         "proxy_remote_addr": "176.xxx.xxx.157"
       }
       ```
   
    - `remote_ip` should match your actual IP (verify at [whatsmyip.org](https://www.whatsmyip.org/))
    - This confirms PHP detects the correct client IP
 * **Problem Scenario:**
 *     ```wp-block-code
       {
         "remote_ip": "176.xxx.xxx.157",
         "x_forwarded_for": "79.xxx.xxx.183, 176.xxx.xxx.157",
         "proxy_remote_addr": "176.xxx.xxx.157"
       }
       ```
   
 * If `remote_ip` doesn’t match your actual IP, your server isn’t properly forwarding
   client IPs. This typically occurs when using:
    - CloudFlare
    - CDN services
    - Reverse proxies
 * **Solution:** Contact your hosting provider to properly configure the client 
   IP detection:
    - For LSWS/OLS: Enable “Use client IP in header” in webadmin console
    - For Apache: Install and configure `mod_remoteIP`
    - Other web servers: Implement corresponding client IP detection solution
 * **Step 2: Check REST API Accessibility**
 * If you receive 401, 403, or 404 errors:
    - Your WP REST API may be disabled
    - Common causes: Security plugins or optimization plugins
    - Action: Re-enable WP REST API (required for plugin functionality)
 * **Step 3: Advanced Troubleshooting**
 * If steps 1 and 2 all check out
 * **3.1 Submit Report**
    1. Go to LiteSpeed Cache → Toolbox → Report
    2. Click “Send to LiteSpeed”
    3. Share the 8-character report number (e.g., “ABCDEFGH”) when you create topic
 * **3.2 Enable Debug Logging**
    1. Navigate to LiteSpeed Cache → Toolbox → Debug Settings
    2. Configure:
    3.  - Debug Log: ON
        - Debug Level: Advanced
        - Debug Include URI: `rest_route=/litespeed`
    4. Clear existing logs (Toolbox → Log View)
    5. Our team will send test requests
    6. Share logs via [Ubuntu Pastebin](https://pastebin.ubuntu.com/) or similar service
 * If you have enabled debug log , please also mention it when you create topic
 * This should help us efficiently diagnose and resolve your WPAPI issues.
    -  This topic was modified 1 year, 2 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
    -  This topic was modified 1 year, 2 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).

The topic ‘Troubleshooting: Failed to get echo data from WPAPI’ is closed to new
replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 0 replies
 * 5 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/troubleshooting-guide-wpapi-echo-data-failure/)
 * Status: not a support question