• waynesmall

    (@waynesmall)


    I’m trying to track down information on a random issue we have on a church site. We will get random 404 errors on SOME pages on the site at time which do not go away until you login to the wp-admin page.

    When you login to the wp-admin page, instantly without doing anything else at all, the page you were trying to get too will work just fine. We’ve tried disabling themes etc, but I’m trying to come back to the root of the issue and that is that when we login to wp-admin, the issue clears. Therefore there must be some code running or some function that is doing something when we do the login that is “fixing” the problem. If I knew what that was, then it would certainly help to further narrow down the issue we have with the site.

    Does anyone know what this might be?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator t-p

    (@t-p)

    We will get random 404 errors on SOME pages on the site at time which do not go away until you login to the wp-admin page

    Sounds like access to those pages is restricted for logged in users only; most likely via a plugin, or could be via a code snippet.

    So, check and find out how those pages are set and how access to them is restricted for only logged in users.

    Thread Starter waynesmall

    (@waynesmall)

    Thanks for the response – the issue is that the pages are public, and not restricted. They work fine – sometimes for a day and then randomly will give the 404 for anyone that visits that page. Then we login to the site (from an entirely different location/IP) and the error clears entirely.

    I’m wondering about caching plugins or something like that which might trigger some action when I login to wp-admin itself… ie the act of displaying something in the WP panel will then cause it to work.

    Moderator t-p

    (@t-p)

    404 indicates failure to communicate with the server. Reasons for this failure to communicate with the server can vary.
    – it could be configuration issue
    – it could be memory issue
    – it could be optimization issue
    – it could be permalinks issue, try reviewing this: How to fix 404 error when using Pretty Permalinks?
    – it could be a conflict with plugin: try deactivating ALL (yes all) plugins temporarily to see if this resolves the problem (plugin functions can interfere). If this works, re-activate them individually (one-by-one) to find the problematic plugin(s).

    Thread Starter waynesmall

    (@waynesmall)

    Yup – I get what a 404 is. I’m used to doing troubleshooting on Windows IIS servers, but this is on Linux and WordPress – both things I’m not good at ??

    The challenge we have with all of this is that the issue is random and not reproducible.

    I’m working through the logic of your suggestions (not trying to knock them down, but trying to understand them)

    If it’s configuration then should it not be a hard fail all the time, rather than randomly failing?

    If it’s a memory issue – then I would expect memory usage to be high when we have the failures. Based on server monitoring this does not appear to be the case unless it’s some other memory allocation setting that I’m not aware of. Is there a specific memory setting you’d recommend I check?

    If it were a permalinks issue then I would think it would be broken permanently, not randomly, but I will dig into the article you mention for sure.

    Deactivating ALL plugins is not possible – we might be able to pull back on some, but we need the plugins for the site to run. I’ll talk to the developer and see if we can pull back on the absolute minimum plugins as a first step.

    I really do appreciate your help here, and not trying to be obstinate, but trying to understand which specific area to dig more into.

    Thanks
    Wayne

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Caching plugins is a good guess. They often behave differently for logged in users via not logged in viewers. Usually this is simply triggered by the presence of the cookie.

    When you login, the site sends you back a cookie. This cookie is sent with every request you make to the site. It’s how the site knows you’re logged in. So yes, the site, and the caching plugin, can know you’re logged in and behave differently.

    Thread Starter waynesmall

    (@waynesmall)

    Ok – I’ve been able to see a couple of examples in the last few days where the site “breaks” which is AWESOME, because the problem seems to be changing just a little.
    1. We’ve minimised the number of plugins to the bare minimum we need for the site to operate.
    2. We’ve renamed the .htaccess file and had it regenerate and the issue still occurs.
    3. I’ve personally now seen the issue when the site is in a broken state. What happens is that we have WooCommerce and FooEvents selling “tickets” for $0. The issue occurs during the checkout process at the point where normally you’d get a credit card transaction dialog I believe. I’ve noticed that the order will be at a processing stage in WooCommerce at this point. It shows the URL for the transaction and then gives a 404. If I then login to the wp-admin site in another tab, and go to save permalinks, and then go back to the original tab and refresh, it refreshes and the order then moves to Completed status, and the person receives their email of order completion etc. The site then continues to work without issues, until at some point it breaks again. Given I’ve now verified exactly where in the process it breaks, unless there’s more that people on this thread can provide, I’m going to chase down the WooCommerce side of things a little more.

    The info above about the cookie is valuable, and not something I knew. I’m wondering how it impacts things though…

    Moderator t-p

    (@t-p)

    The info above about the cookie is valuable, and not something I knew. I’m wondering how it impacts things though

    Hope these sources help:

    Cookies


    https://www.wpbeginner.com/glossary/cookies/
    https://wpengine.com/resources/wordpress-cookies/

    Thread Starter waynesmall

    (@waynesmall)

    I’m good to close this thread out for now… I’m taking up further discussion in the woocommerce support forums given we’ve tracked the specifics down to that.

    Appreciate all the help given. Many thanks!

    Moderator t-p

    (@t-p)

    I’m taking up further discussion in the woocommerce support forums

    I see two threads started by you there. So that I can properly close this one here, please tell one of those two is connected to this topic here?

    Thread Starter waynesmall

    (@waynesmall)

    Further discussion on this thread – https://www.ads-software.com/support/topic/random-404-during-checkout-process/

    Apologies for the multiple posting.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘What happens when you login via wp-admin?’ is closed to new replies.