• Resolved Wes

    (@wlefebvre)


    Hello, it appears that after one of the recent two updates, the plugin began to have issues on my site. Also to note, I use w3Total Cache and it too was recently updated.

    When I clear all of the caches on w3Total Cache the WordPress Popular Posts appears to work fine for a day or less, then most, if not all, of the pages begin displaying a red status bar where the posts typically appear in the right sidebar.

    Here is the error I’m seeing through inspection with my browser:

    “Failed to load resource: the server responded with a status of 403 () /wp-json/wordpress-popular-posts/v2/widget?is_single=0:1”

    Then when I click the above url: /wp-json/wordpress… I get

    “{“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}”

    Note: it is working properly as I just cleared the cache, but I have tested this multiple times over multiple days, so I’m hoping it fails again by the time you get a chance to take a look. Or perhaps it won’t because I just updated w3total cache again. However, it was failed immediately after the update, but worked after I cleared the w3total cache.

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Wes

    (@wlefebvre)

    Also, I don’t ever remember seeing the red status bar before. Now, even when it works it appears for a second, then loads.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @wlefebvre,

    A 403 (Forbidden) error response that goes away after clearing W3TC’s cache usually means that the page caching rules you’re using with it are a bit too aggressive. Please make sure that the page cache expires at least once per day (I recommend every 12 hours or so).

    Then when I click the above url: /wp-json/wordpress… I get

    “{“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}”

    Yep, that’s to be expected. This URL is supposed to be accessed via POST only. GET requests (which is what happens when you try to access an URL via address bar and/or by clicking on a regular link) will result in a 404 (not found) response. That’s fine and it’s not related to the issue you’re having.

    Thread Starter Wes

    (@wlefebvre)

    Hi Hector, Thanks for the response. As far as I can tell the page cache is set to 900 seconds. When I cleared the cache for an individual page previously the popular posts still did not appear. It was not until I cleared all of the caches except Cloudflare that it began working again. I have not changed anything in regards to caching in probably years.. When it breaks again I will go through and clear each cache module one-by-one to help narrow this down more.

    • This reply was modified 1 year, 7 months ago by Wes.
    Plugin Author Hector Cabrera

    (@hcabrera)

    Also, next time it happens please check your browser’s console and check whether there are any error messages that may be related. It might help figure out what’s going on.

    Also, take a screenshot of the 403 error message, more specifically the response returned by your server (you can see this on the browser console as well).

    You can also post a message here once it happens and if I’m around (I’m on the EST timezone and do monitor this forum frequently) I’ll check it out right away so I can see the error myself.

    Thread Starter Wes

    (@wlefebvre)

    Hi Hector, It is happening again. Before I do any further testing such as clearing the caches one-by-one, I’ll leave it up so you can take a look when you have a chance. Thx. https://www.aprfinder.com/institutions/ally-bank

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @wlefebvre,

    Had a busy morning and then a power outage happened, I’m just reading this message. Thank you for not clearing your site’s cache though, I was able to see the issue in action.

    As pointed out before, yep, something -most likely caching related- is causing your popular posts list to not be able to pull data from your server.

    The reason why your server is responding with “cookie nonce is invalid” is because the request that WordPress Popular Posts sends to it contains a nonce (security token basically) to confirm that the request is a genuine one, however this nonce is stored on the current page as a text string and if said nonce isn’t regenerated at least once per day then this happens: WPP will attempt to use said nonce, WordPress will find that it has expired (it’s default lifetime is one day(ish)) and then will reject the request, hence 403.

    I know you said that you haven’t changed anything caching related in a long time but I recommend having another look at your site’s configuration (including page caching rules) as something must have changed that’s now causing this issue.

    • This reply was modified 1 year, 7 months ago by Hector Cabrera. Reason: Reworded for clarity
    Thread Starter Wes

    (@wlefebvre)

    Ok. Thank you. Yeah I definitely haven’t changed any settings, but the w3Total Cache plugin was recently updated too, so that must have something to do with it.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Since you’re using Cloudflare, try checking the page caching rules there as well. Might not have anything to do with the problem (eg. you’re not using CF’s page cache) but I figured it’s something I would check.

    Thread Starter Wes

    (@wlefebvre)

    Thank you, I will do that.

    Yeah, it’s weird. I tried clearing each caching module individually and it didn’t fix itself, including the page cache of that individual page. The only one I hadn’t tried was the clear ALL “page cache” module before going in and clicking to edit that post, then clicking the “update” button. At that point, it began working on all pages again.. Just an FYI.

    Hey @wlefebvre, any update on this issue? Were you able to fix it?

    I am encountering the same issue and if i clear cache it works fine for a day and then stops working again.

    Plugin Author Hector Cabrera

    (@hcabrera)

    OP doesn’t seem to be using the plugin anymore so chances are they were not able to figure out what the problem was @ayu1 (or maybe they did, then later on decided that they didn’t need the plugin anymore), and because it’s been 5 months since OP’s last reply I’m marking this topic as resolved.

    Please feel free to open a new topic and share as much details about your site (eg. URL, active plugins, etc) so that I can help.

    Thread Starter Wes

    (@wlefebvre)

    Hey @ayu1, unfortunately, I was never able to get it to work.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Failed to load resource status 403: /wp-json…’ is closed to new replies.