Home>Support>30 second login delay using Vantage theme and CiviCRM

30 second login delay using Vantage theme and CiviCRM

Hello,

I have a WordPress site using the Vantage theme, also using CiviCRM. I’ve noticed that if I have both enabled, logins have a 30 second delay to the /wp-admin/admin-ajax.php URL. Browser spins from when you click Login until this delay clears, and then the login proceeds quickly.

Turn off CiviCRM, login is fine (but as CiviCRM is critical to the site, this isn’t an option).

Turn off Vantage theme, login is fine (but I like the Vantage theme…).

Have not found any other plugin that contributes.

Any ideas how to resolve, or at least do more diagnostics?

(PHP 7.4.32, using php-fpm)

Thanks.

Michael

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 1 year, 10 months ago Andrew Misplon
    Hi, I Work Here

    Hi Michael

    Thanks for getting in touch.

    If possible, please, check to see if the issue persists with all plugins temporarily deactivated except for CiviCRM.

    It’s unlikely an issue like this will produce PHP errors. To check, please, enable WP_DEBUG and WP_DEBUG_LOG in your WordPress config.php file.

    https://wordpress.org/support/article/debugging-in-wordpress/

    Errors may be present in the browser console; here is how to check: https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/#step-3-diagnosis.

    The console network tab might be useful: https://developer.chrome.com/docs/devtools/network/.

  2. 1 year, 10 months ago Mike

    Thanks for the response, Andrew. I didn’t turn off every plugin except CiviCRM in my testing at the same time, but did them one by one. Using a different them with all the plugins normally active, active, removes the slow login too. I’ve done the WP_DEBUG etc. stuff (didn’t mention, forgot to include that), and you are correct, nothing’s being logged. The browser diagnostics is what led me to the /wp-admin/admin-ajax.php call in the first place, and turning on response time in the custom SSL Apache log proved that was taking at least 30 seconds, but only for those login calls.

    So, Vantage theme without CiviCRM – fine
    Everything without CiviCRM – fine
    Everything with another theme (went with Twenty Twenty Two as random built in choice) and CiviCRM – fine

    I haven’t tried CiviCRM with all other plugins disabled and Vantage theme, as this is a live site and sometimes disabling/enabling plugins has other unwanted cleanup efforts, but if there’s a way to collect more information I’d be more willing to try something else. Tempting to try and turn on step by step debugging of PHP at least for the admin-ajax call, but not even sure if that’s possible and pretty sure I don’t really want to do that. Maybe more thorough timing logging, but all admin-ajax does is act as a gateway for all the other code that may get called.

    Sure wish I could just put the server-side Aternity performance monitoring agent on here, but it doesn’t support PHP yet.

    Googling around for a little bit of information to be dangerous with, there are some suggestions that session handling may be a reason, but I can’t find anything in the Vantage theme that cares about (PHP) sessions. Only mention of ‘session’ is in the js/jquery.flexslider.js file, which I can’t see how that’s related.

    Michael

  3. 1 year, 10 months ago Andrew Misplon
    Hi, I Work Here

    Hi Michael

    Thanks for the updates.

    Could you perhaps set up a local instance with Vantage and your CRM plugin?

    To test with FlexSlider, you could temporarily remove or comment out line 408 in the theme’s functions.php file.

  4. 1 year, 10 months ago Mike

    Thanks for the suggestion on FlexSlider. As expected, commenting out line 408 had no impact.

    I could set up a local instance somewhere to test, but again, would need to know what the actual test would be. You could also probably set up a test instance to see if this is reproducible on a system you have complete control over, although there are lots of variables to consider, many of which probably don’t matter (this started with CiviCRM 5.48, but that’s what I started with; been doing this for several WordPress updates too — caveat, can’t say exactly when it started because the “main players” here – CiviCRM, WordPress, Vantage – have been around from the beginning of when it was more than just me setting it up). Running CentOS 9 Stream using remi PHP 7.4 as I ran into problems with default PHP 8 compatibility early on.

    …. and it just occurred to me that I have the Vantage them on another CiviCRM website that only sees traffic between April and June pretty much, and it’s working fine. Oh, the confusion builds. So maybe it’s not the Vantage theme itself, but something only available on the Vantage theme… all I can think of is the image slider, which is only visible when you aren’t logged in. And not using it has no impact.

    So yeah, need to figure out how to better diagnose this…

    Michael

  5. 1 year, 10 months ago Alex S
    Hi, I Work Here

    Hi Michael,

    Thanks for checking. :)
    The test Andrew suggested is likely to identify whether you’re able to replicate this on a different server. There are situations where servers can have something present (typically a web application firewall) that can cause issues with certain requests and if you’re able to replicate it locally that rules out a host of potential causes. If your other website isn’t on the same server or has different settings at the account level, it’s possible those differences are related to the issue.

    With all of that said, it’s very likely there’s a specific function or filter being used by Vantage that doesn’t sit well with CiviCRM. This filter/function isn’t used by any of the default WordPress themes so they’re unaffected by them.

    It’s possible Query Monitor may provide more insight into the request. I’m unable to really guide you in using that plugin in this instance due to the large unknown about the potential cause.

    Kind regards,
    Alex

  6. 1 year, 10 months ago Mike

    I have Query Monitor too, which wasn’t able to tell me anything that made sense to me with regards to this problem. Although not sure how to get specific-to-the-login-delay query output using that plugin as it seems to be more about current session queries, which by definition haven’t started yet. Certainly not seeing anything by itself to explain the 30 second delay, nor is anything obviously contributing (300 tenth of a second delay calls, etc.).

  7. 1 year, 10 months ago Alex S
    Hi, I Work Here

    Hi Mike,

    Thanks for trying. Sometimes Query Monitor can log slow queries and stuff like that so I had hoped it would have flagged something as being problematic. You mentioned that this issue isn’t occurring on your other website. If your other website isn’t on the same server or has different settings at the server level, it’s possible those differences are related to the issue.

    Kind regards,
    Alex

  8. 1 year, 9 months ago Mike

    Just to close the loop on this, it seems that the JetPack plugin was also involved. Their support noticed a sync issue between my server and their end (of as yet undetermined nature from what I’ve received), fixed it, and subsequent logins are now fast again. So the session cookie seems to have bad data in it, and the next login fixes that issue (theory). Turns out any theme that I tried beyond the ones that came with WordPress had the slow login issue, so it was nothing to do with any of your products. Thanks for your help though.

  9. 1 year, 9 months ago Andrew Misplon
    Hi, I Work Here

    Hi Mike

    Thanks for the detailed explanation; much appreciated. I’m glad to hear you’ve found the cause of the issue.

    Please, let us know if any queries or requests arise in the future.

    Cheers for now.

    Andrew

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More