• Resolved razvanfrandes

    (@razvanfrandes)


    Hello Nicu,

    I have tested with woocommerce api and got some issues.

    – The routes are protected with JWT, not all, some are whitelisted.
    – I changed the Header key Autorization to JWT_TOKEN so it won’t get in conflict with Woocommerce Header.
    – The Woocommerce api’s works using the the configuration I build but the default api’s don’t work. For example just accessing /wp-json dosen’t work if it’s protected.
    – If I deactivate woocommerce, the default endpoints works.


    This is the error I get: “Parse Error: Header overflow”

    Thank you. Hope is a ez fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter razvanfrandes

    (@razvanfrandes)

    I downgraded woocommerce from the last verstion until the first version which works withSJWT plugin and also SJWT plugin until it’s first release. But the same problems exists. Is somthing I do wrong?

    Thread Starter razvanfrandes

    (@razvanfrandes)

    I found the problem.

    Is with woocomerce analytics api. It interfers with the default api.
    I disabled the wc analytics and now works.

    If anyone want’s to remove analytics from api :

    add_filter('woocommerce_admin_disabled', function () {
    // Check if the request is a REST API request
    if (defined('REST_REQUEST') && REST_REQUEST) {
    return true; // Disable
    }
    return false; // Keep
    });

    Here is what Woocommerce does when you access a endpoint.

    [09-Dec-2024 17:55:34 UTC] Request start: 1733766934.9904

    [09-Dec-2024 17:55:35 UTC] REST Request: /wc-analytics/reports

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/revenue/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/orders/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/products/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/variations/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/categories/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/coupons/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/taxes/stats

    [09-Dec-2024 17:55:36 UTC] REST Request: /wc-analytics/reports/downloads/stats

    [09-Dec-2024 17:55:37 UTC] REST Request: /wp/v2/posts

    [09-Dec-2024 17:55:37 UTC] Request end: 1733766937.535
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Woocommerce conflict with default API’ is closed to new replies.