• Resolved serloo

    (@serloo)


    I build 2 test site A & B, there’re only 2 plugins in it — Stock Sync for WooCommerce and WooCommerce.

    Site A is in siteground and site B in Kinsta.

    When checking API in site A, it is not accessible to site B.

    When chekcing API in site B, it is acessible to site A.

    I want to buy a pro version, before that, can you help me with this issue?

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WP Trio

    (@wooelements)

    Some web application firewalls or WP security plugins such as Defender might block REST API connections by default. In that case the connection needs to be whitelisted but how this is done depends on what’s blocking it.

    API Check should provide debugging info which contains the exact error message (“View response for debugging“). What does it look like?

    Thread Starter serloo

    (@serloo)

    Debugging response shows as below:

    Response code 200

    Headers

    date Wed, 10 Jan 2024 01:37:39 GMT

    content-type text/html; charset=UTF-8

    cf-cache-status DYNAMIC

    link <https://serloo.cloud/index.php?rest_route=/&gt;; rel=”https://api.w.org/&#8221;

    vary Accept-Encoding

    ki-cache-type None

    ki-cf-cache-status BYPASS

    ki-edge v=20.2.5;mv=3.0.1

    ki-edge-o2o yes

    ki-origin g1p

    x-content-type-options nosniff

    x-edge-location-klb 1

    x-kinsta-cache BYPASS

    report-to {“endpoints”:[{“url”:”https:\/\/a.nel.cloudflare.com\/report\/v3?s=2GzmOgfOz6odhUGTopPoomxlYNmA0lgsaxAeJaCAhdWNfxy11EEb4XWbaepBqE8i%2Fsj0ApmuXQ4ZxFLv6O5mcSn6WoNhULq%2FsxHt9UKgZsQufDuQFXnOCTtDybEKaw%3D%3D”}],”group”:”cf-nel”,”max_age”:604800}

    nel {“success_fraction”:0.01,”report_to”:”cf-nel”,”max_age”:604800}

    server cloudflare

    cf-ray 8431322d2fe910aa-HKG

    alt-svc h3=”:443″; ma=86400

    Response body: too long, how to upload a file?

    Plugin Author WP Trio

    (@wooelements)

    Thanks for reporting back.

    The error message suggests that Cloudflare deems the connection unsafe and blocks it. Please see here for whitelisting instructions.

    Let me know if that works.

    Thread Starter serloo

    (@serloo)

    Here is the reply from hosting provider, could you help to check?

    ———————

    So far, we’ve ruled out the server / LXD or container issue (by getting both 2 sites on the same location/LXD).

    And as per the access.log real time review (while you did the action) I didn’t see any blocking requests there (and there’s no CF RAY ID either as per your screenshot).

    I would suggest to report this issue to the plugin’s support team.

    ————————

    Thread Starter serloo

    (@serloo)

    This is the server error log:

    [error] 1929#1929: *646 FastCGI sent in stderr: “PHP message: PHP Warning: Attempt to read property “order_awaiting_payment” on null in /www/test2r_482/public/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 185″ while reading response header from upstream, client: 35.187.247.7, server: turtle.asia, request: “GET /wp-json/wc/v2/?consumer_key=invalid&consumer_secret=invalid HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php8.1-fpm-test2r.sock:”, host: “turtle.asia:55616”

    Thread Starter serloo

    (@serloo)

    The issue has fixed after changing the permalinks to post name in wordpress settings.

    It is not related to cloudflare or hosting.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘RestAPI is not accessible’ is closed to new replies.