• Resolved Reventlov

    (@reventlov)


    Hello,

    I am experiencing issues with the Burst plugin on my website. Multiple errors are appearing in the browser console, indicating failed resource loading with a 403 status.

    Here are a few examples of the errors encountered:

    Failed to load resource: the server responded with a status of 403 () /wp-json/burst/v1/data/datatable?nonce=ad85578067&token=ycrtq&date_start=2024-06-12&date_end=2024-06-18&date_range=last-7-days&_locale=user
    Failed to load resource: the server responded with a status of 403 () /wp-json/burst/v1/data/datatable?nonce=ad85578067&token=muyjv&date_start=2024-06-12&date_end=2024-06-18&date_range=last-7-days&_locale=user
    Failed to load resource: the server responded with a status of 403 () /wp-json/burst/v1/data/devicesSubtitle?nonce=ad85578067&token=uvafw&date_start=2024-06-12&date_end=2024-06-18&date_range=last-7-days&_locale=user

    These errors continue to appear consistently, disrupting the proper functioning of the plugin.

    Additionally, I have set specific capabilities for the editor role (manage_burst_statistics, view_burst_statistics), and this issue affects all user roles except for the administrator.

    Could you please assist me in resolving this issue?

    Thank you in advance for your help.

    Best regards,

    • This topic was modified 5 months ago by Reventlov.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @reventlov the 403 error could be occur if the user does not have view_burst_statistics capability, but does have manage_burst_statistics capability. Is it possible that this is the case? In that case, giving those users view_burst_statistics capability should resolve the problem.

    Thread Starter Reventlov

    (@reventlov)

    Hello,

    Tahnk you for you reply.

    As I told you in my first post, the role has both capabilities “view_burst_statistics” and “manage_burst_statistics capability”.
    The issue appears with that configuration.

    Regards.

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @reventlov Thanks for confirming. I have tried to reproduce the issue by adding the burst capabilities to the author role, then creating a user with the author role. I could load the statistics dashboard without issues, and didn’t get any 403 responses.

    What tool do you use to manage the roles? Maybe I can try to reproduce with the samen plugin.

    Thread Starter Reventlov

    (@reventlov)

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @reventlov,

    I’ve installed the user role editor, and created a user role with only the burst capabilities. I wasn’t able to reproduce any issues with this strangely enough.

    Do you have any other plugins that might interfere?

    Thread Starter Reventlov

    (@reventlov)

    Hi,

    Thank you for your time with it.

    I make some tests this week and will be back to you.

    Regards.

    Thread Starter Reventlov

    (@reventlov)

    Hi @rogierlankhorst,

    Thank you for your continued assistance.

    After conducting several tests, I believe I have identified the source of the problem. To view the site as my clients do, I use the “View Admin As” plugin. However, when I switch to the editor view, it prevents the statistics from being displayed. Conversely, when I log in directly as an editor, the statistics appear correctly.

    I think the issue might be due to an incompatibility between “View Admin As” and the Burst plugin. In fact, I don’t have an issue since my editor clients can see their statistics.

    Thanks again for your help and time.

    Best regards,`

    Hi @reventlov and @rogierlankhorst

    Jumping in on this topic as the author of View Admin As. Do you have any pointers for me I could check for to find the compatibility issue? I use this plugin together with many other plugins to test switching roles etc. without issues so I’m wondering why you have issues with the results while switching.

    @rogierlankhorst Could it be that you validate the current user’s capabilities in the plugins_loaded hook with a very early priority?

    Cheers, Jory

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @keraweb,

    Thanks for your reply, the earliest point that Burst loads (the initial loading of the main class) is plugins_loaded, priority 8.

    But this class in turn loads most other stuff with default priorities, so it doesn’t sound like that could be an issue. Priorities are then validated on the fly with the burst_user_can_view() function, which uses current_user_can( ‘view_burst_statistics’ ) to check for capabilities.

    Hi @reventlov and @rogierlankhorst

    Just ran some various tests with VAA active and inactive but I cannot seem to reproduce this issue.
    Once I’ve added the capabilities I can access the Burst pages and the REST responses all return a 200 status. Even when trying the same for a Contributor role which barely has any capabilities this seems to work perfectly.

    For this reason I doubt that View Admin As is the actual issue here but it might be a combination of other plugins.
    @reventlov Can you reproduce the issue with only Burst and VAA active? And if you can, do you have the option to create a development/staging environment where you can reproduce this from scratch with only Burst and VAA active?

    Cheers! Jory

    Thread Starter Reventlov

    (@reventlov)

    Hello,

    Thank you for your time! It’s really appreciated.

    I tried again and here are some additional details:

    I have set specific capabilities for the editor role (manage_burst_statistics, view_burst_statistics).

    • When I log in as an admin, Burst runs perfectly.
    • Using View Admin As, I switch to a “global” editor role: it works for Burst.
    • Using View Admin As, I switch to a specific user who has the editor user role: it doesn’t work.

    This issue is not specific to the editor user role. Any user role with the Burst capabilities reacts the same way. The global role works, but specific users do not.

    If you can’t reproduce the issue, I will do my best to set up a clean staging environment as requested.

    Have a good day.

    Best regards,

    • This reply was modified 3 months, 2 weeks ago by Reventlov.

    Hi @reventlov

    Thanks for checking and verifying!
    Just to be sure, you can reproduce the same behavior with all other plugins deactivated?

    If so, then in that case it’s definitely something else so it would be helpful to have a staging environment where we can do some more thorough testing.
    In case you are unable to create a staging environment I can do this for you so you can install and recreate your environment there.

    Please note that the WP forums do not allow sharing any login info of any kind.
    You can reach me on Slack, GitHub or through keraweb.nl to continue.

    I’ll make sure to keep this topic updated with any relevant information about this issue.

    Cheers, Jory

    Plugin Author Hessel de Jong

    (@hesseldejong)

    Hi @reventlov and @keraweb,

    I think I’ve reproduced the issues on an empty environment with just Burst and View Admin As.

    Here is a screen recording: https://www.loom.com/share/96ce09f1452c4ae580af56e1d0ed3cac

    I’m uncertain whether this is an issue with Burst or View Admin As. I believe you have a better understanding of what might be happening, Jory. If you need our help or assistance, we are happy to fix any issues on our side!

    Kind regards,
    Hessel

    Hi @hesseldejong

    I’ve been testing and researching these issues and this looks like it’s related to the login cookie.
    View Admin As does not change the login cookie, it only switches the user within WordPress at a really early stage. Therefore the cookie is still linked to the original logged in user which is also cached in View Admin As so the admin bar menu is still available.

    Why this does work with the REST API using the Block Editor but not with your plugin is still a mystery to me. I would think that both use the same routing and validation process.

    Cheers, Jory

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.