• Resolved benji7

    (@benji7)


    Hi 👋

    After updating WordPress, WooCommerce, and PHP to version 8.3, the WooCommerce Analytics section disappeared from the WordPress admin menu.

    Here are the details:

    • WordPress version: 6.8.3
    • WooCommerce version: 10.1.2
    • PHP version: 8.3
    • Theme: my own custom php/twig (timber) theme
    • Environment: Apache with nginx proxy | AlmaLinux 8 | MySQL 8.0.43

    When I go to WooCommerce → Reports (/wp-admin/admin.php?page=wc-reports), I see the following notice (translated from Polish):

    “As of WooCommerce 4.0, these reports are being replaced. A new, improved Analytics section is now available for users running WordPress 5.3 or higher. Go to WooCommerce Analytics or learn more about the new Analytics documentation.”

    However, when I click on “Go to WooCommerce Analytics” (link: /wp-admin/admin.php?page=wc-admin&path=/analytics/overview), the page starts loading with the WooCommerce spinner, then the loader changes to “Forbidden”, and finally shows:

    “You do not have permission to access this page.”

    There are no errors or warnings in the debug.log, and the issue persists even after clearing all caches and transients

    It seems like WooCommerce Admin (Analytics) fails to initialize correctly or loses capability mapping after the update.

    Has anyone experienced the same issue on PHP 8.3 or the latest WooCommerce versions?
    Any insights or fixes would be greatly appreciated.

    Thank you!
    — Szymon

    • This topic was modified 1 month, 2 weeks ago by benji7. Reason: bad url

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thanks for sharing the details, and I understand how concerning it can be when the Analytics section disappears after an update.

    Please go to WooCommerce → Settings → Advanced → Features and make sure the “Enable WooCommerce Analytics” option is checked. This ensures the new Analytics interface is active in your admin area.

    If the option is already enabled but you’re still seeing the “Forbidden” message, please try the following:

    • Clear your browser cache and cookies, then log back in.
    • Ensure your user role has the manage_woocommerce capability (this is required to access Analytics).

    If the issue persists after these steps, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further.

    Thread Starter benji7

    (@benji7)

    The checkbox has been checked already. It’s strange that it’s kinda blocked (the checkbox is gray, “block” cursor on checkbox hover and I can’t change the value).

    • ✅ Clear your browser cache and cookies, then log back in.
    • ✅ Ensure your user role has the manage_woocommerce capability (this is required to access Analytics).

    System Status Report:
    https://pastebin.com/6sL6NZJj

    WooCommerce > Status > Logs (no fatals):
    https://pastebin.com/vt4inypi

    • This reply was modified 1 month, 2 weeks ago by Yui.
    • This reply was modified 1 month, 2 weeks ago by benji7. Reason: Forgot about the blocked checkbox
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for sharing the details.

    I’ve checked the system status report and noticed that WooCommerce is not up to date. Please update the plugin to the latest version (10.2.2).

    Also, the error log you shared indicates that a feature used by your site (or one of your plugins/themes) is deprecated. The WooCommerce Admin Navigation feature and its related classes — Screen, Menu, and CoreMenu — were deprecated starting from WooCommerce 9.3.

    For testing purposes, please perform a conflict test by deactivating all plugins except WooCommerce , Analytical woocommerce and switching to a default theme such as Storefront.

    You can find more information on how to run a conflict test here:
    🔗 How to test for conflicts

    Thread Starter benji7

    (@benji7)

    (/wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview)

    The screenshot taken after disabling all plugins excluding WooCommerce and WooCommerce Analytics, also theme set to default twentytwentyfive.

    Before I updated WooCommerce to 10.2.2 also on my local development copy instance it’s not working – same as on production.

    • This reply was modified 1 month, 2 weeks ago by benji7.
    • This reply was modified 1 month, 2 weeks ago by benji7.
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for sharing the details about the issue.

    Since you mentioned that the “Enable WooCommerce Analytics” option is grayed out, this indicates that WooCommerce Admin is currently disabled. Could you please confirm if you’re seeing the message “WooCommerce Admin has been disabled” below that option?

    Also, please try adding the following code using the Code Snippets plugin and see if that resolves the issue:

    add_filter( 'woocommerce_admin_disabled', '__return_false' );

    Let us know if that works for you.

    Thread Starter benji7

    (@benji7)

    Yes! You’re right! Thank you very much! 🙂

    There’s still one more issue to resolve. The WooCommerce Analytics dashboard now loads and opens correctly, but no statistics are being displayed. Each chart shows the error:

    “There was an error getting your stats.”

    You can see it in the attached screenshot:

    (The screenshot was taken with all plugins disabled — except WooCommerce and WooCommerce Analytics — and the active theme switched to twentytwentyfive.)

    Thread Starter benji7

    (@benji7)

    That’s me again 😉

    When accessing directly:

    https://local.beautysofa24.de/wp-json/wc-analytics/reports/orders/stats

    it always returns:

    {"code":"woocommerce_rest_cannot_view","message":"Entschuldigung, es können keine Ressourcen aufgelistet werden.","data":{"status":401}}

    This happens even when logged in as administrator (user ID 1).

    I verified that the administrator role includes all the required WooCommerce capabilities:

    wp eval "print_r( get_role('administrator')->capabilities );"

    Output includes:

    'manage_woocommerce' => true
    'view_woocommerce_reports' => true
    'view_woocommerce_analytics' => true

    But checking the current user:

    wp eval "var_dump( current_user_can('view_woocommerce_reports') );"

    returns bool(false)

    So the role has the capability, but the user context in CLI and REST does not recognize it.

    wp wc tool list --user=1

    shows all analytics tools, including clear_woocommerce_analytics_cache,
    so WooCommerce Admin is properly registered.

    wp user meta get 1 wp_capabilities

    returns: array ('administrator' => true,) → so the user is indeed an administrator.

    What to do now?

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @benji7,

    Thanks so much for the detailed follow-up, and great job narrowing this down. You’ve already done a ton of diagnostic work, and that’s making it much easier to pinpoint the issue.

    Now that WooCommerce Analytics is loading correctly, the remaining problem seems to be with the REST API permissions. Specifically, the endpoint:

    /wp-json/wc-analytics/reports/orders/stats
    

    
is returning a 401 Unauthorized error, even when you’re logged in as an administrator. That suggests a mismatch between the user’s actual capabilities and what WooCommerce expects during REST requests. Here are the next steps to try:

    • Sometimes custom themes or plugins interfere with capability mapping. Try adding this via Code Snippets:
      add_filter( 'woocommerce_analytics_enabled', '__return_true' );
      add_filter( 'woocommerce_admin_disabled', '__return_false' );
      • Clear the analytics cache at WooCommerce → Status → Tools, find the Clear Analytics Cache tool and click “Clear” to run it.
      • If that doesn’t resolve it, try re-importing historical data. Go to WooCommerce → Analytics → Settings, look for the option to re-import historical data and run the import process. After clearing the cache, give it a few minutes for the system to regenerate the data, then refresh your analytics dashboard.
      • Some security or optimization plugins may interfere with REST API headers. Try disabling all plugins temporarily and retest, then re-enable them one by one.

        I hope that helps. Let us know if you need anything else.

        Plugin Support Chris Moreira – a11n

        (@chrism245)

        It seems we haven’t heard back from you for a while, so I’ll go ahead and mark this thread as resolved. Feel free to reach out whenever you’re ready to continue.

        If you have time, we’d be grateful for a review: https://wordpress.org/support/plugin/woocommerce-analytics/reviews/

      Viewing 9 replies - 1 through 9 (of 9 total)

      You must be logged in to reply to this topic.