• Resolved Strothi

    (@strothi)


    Hey guys,

    Thanks for the great plugin. After quite some debugging, I found that unfortunately, your plugin is causing a conflict with Buddypress, specifically with the ability of my users to accept friend requests.

    The moment I click on the Accept Friend Request button, I can see in the console that it says “Failed to load resource: the server responded with a status of 403 ()” with the URL pointing to /wp-admin/admin-ajax.php

    Ajax requests are exempt from caching via the corresponding setting in the backend and the pages should not be cached anyhow for logged-in users, but somehow the request is blocked.

    Any idea what I could do / might be causing the issue?

    Kind regards, Philip

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    what the above information, it is almost impossible to understand what’s going on. If ajax requests are being bypassed then they should not be cached. Please check the response data that you care getting in the ajax request. You will see it in the network tab.

    Also in the plugin setting under the cache tab, try enabling the option to bypass cache for WP-JSON API endpoint and see if that is solving the issue or not.

    Thread Starter Strothi

    (@strothi)

    Dear @isaumya,

    Thanks for getting back to me. I tried disabling the JSON API endpoint as part of my initial debugging, but it didn’t do anything.

    I’m not sure what you would like me to post from the network tab. The response is 403, as outlined above.

    If you are interested in the headers data, you can check out a screenshot here: https://www.evernote.com/l/AAKv0e1JA7xP6qbA_ODe2X7El95vJ4DIInsB/image.png

    Kind regards, Philip

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    The screenshot you have provided, can you click on the response tab (Headers – Preview – Response) and see what response you are getting? Please provide that screenshot too.

    Thread Starter Strothi

    (@strothi)

    Dear @isaumya,

    it literally just says: “The link you followed has expired.</p><p>Please try again.

    Kind regards, Philip

    Plugin Contributor iSaumya

    (@isaumya)

    Well, it is impossible for me to say why that is happening, but as you have already sen in the screenshot you have posted above that the admin-ajax request is not being cached by Cloudflare and instead is BYPASSED.

    That being said, unfortunately, you have to dig deeper to see why the link has been expired and what is causing the link to expire as this is not a cache issue that is related to this plugin.

    Thread Starter Strothi

    (@strothi)

    Dear @isaumya,

    Well, somehow the plugin does seem to affect the function here because I don’t even need to disable it to get the function working again, simply deactivating caching in your plugin’s settings does the trick!

    Which however renders it useless, so it would be great if we could figure out, what’s causing the issue ??

    Kind regards, Philip

    Plugin Contributor iSaumya

    (@isaumya)

    Well, it is impossible for me to say what is causing this as from the header I can see that the ajax request is bypassed from cloudflare and it is not getting cached.

    Maybe there is some kind of conflict with an existing plugin but without debugging it, it is hard to say.

    In the browser console are you seeing any errors?

    Thread Starter Strothi

    (@strothi)

    @isaumya,

    well, nothing other than what I already showed you. I set WP to debug mode, plus switched on the log on the server side, but nothing appears in the logs.

    If you tell me what exactly you’d like to see, I am happy to provide screencasts for you.

    I don’t have Cloudflare set up for my dev environment, so I can’t replicate the issue there. I guess you have it running on your environment? Would you mind checking if the error appears also on your end when using Buddypress?

    Kind regards, Philip

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    have you tried using the worker mode of the plugin?
    Is the issue also happening when you are using the worker mode?

    Thread Starter Strothi

    (@strothi)

    Dear @isaumya,

    it works fine with the worker mode. It says in the plugin “This mode is only recommended if there are conflicts with the current web server or other plugins, as it is not 100% free.”

    What are the implications of using the worker mode?

    Kind regards, Philip

    Plugin Contributor iSaumya

    (@isaumya)

    Alright, so I think the issue is as I expected. Page rules (default mode) has certain limitations when it comes to cookie identification and taking dynamic decision.

    This is why in complicated sites like yours where page rule does not work properly it is highly recommend to use the worker mode.

    Here is why you are having the problem. When a user is visiting the profile page without being logged in, Cloudflare catches that page. Then when the user logs in and certain WP login cookies are created, when the user tries to do any dymaic work on the page CF still provides cached page instead of identifying the loggedin session.

    These kind of problems are well managed in the worker mode where the worker looks at the whole picture and then takes a decision which is not possible in the page rule mode.

    That is why in complicated sites like budypress, it is recommended to use the worker mode. Yes worker is not 100% free and you will get 100,000 requests per day for free but if you have a high traffic site, you can get a worker plan that satisfies your request needs. Cloudflare worker pricing is super cheap to begin with.

    • This reply was modified 3 years, 5 months ago by iSaumya.
    Thread Starter Strothi

    (@strothi)

    Ok great, that sounds reasonable enough. I doubt that I will get to that treshold soon, so that solves the issue then ?? Thanks a lot for you support, much appreciated!

    Kind regards, Philip

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Conflict with Buddypress Friend Request Function’ is closed to new replies.