I run Toolset on many client sites, including the one in this support ticket. Recently, I've been investigating some very sluggish behavior, and I'm hoping you can help me.
Please see the screenshots from Chrome DevTools. I'm consistently seeing these same results across many, many sites that are using legacy views. (The screenshots come from the home page of the site I chose in creating the ticket.)
The servers have plenty of CPU overhead, so I don't think they're the problem. Could you shed any light on why these calls are so slow?
Hi there,
Thank you for the details, I understand that the admin-ajax calls are from the view, but the content used inside the view and the overall environment can have an effect so it needs to be tested.
What I suggest that you do is to use the Lighthouse Chrome extension to measure the performance of the website on the homepage on the scenarios below and get back to us with the result:
1. No theme and no third-party plugins.
- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Toolset and its add-ons.
- Record the performance score.
- Also check the admin-ajax.php call payload and efficiency and see if you see any difference or not.
2. With the theme and no third-party plugins
- IMPORTANT STEP! Create a backup of your website.
- Keep the current theme of the website intact.
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Toolset and its add-ons.
- Record the performance score.
- Also check the admin-ajax.php call payload and efficiency and see if you see any difference or not.
3. With the theme and third-party plugins
- Keep the current theme of the website and third-party plugins intact.
- Record the performance score.
- You already shared the payload for admin-ajax.php in this scenario.
Get back to us with the results.
Thank you.
Thanks! I'll take these steps on a dev site and get back to you. It may take a week or so for me to get to it, but I'll report back.
Okay, I have the results of these. I can send you HTML files of the Lighthouse testing if you'll provide a way for me to share them, but in short, the worst performance was with only the Toolset plugins activated. Here are the scores of your 1, 2, and 3 scenarios:
1. 86 (by far the best score w/ the Genesis theme deactivated, because there are no views on the page; admin-ajax payload not applicable here)
2. 25 (only toolset plugins activated, w/ genesis theme; this score is probably mostly worse because of the lack of image compression; admin-ajax payload slightly better but still high, at 1.38s and 1.40s)
3. 51 (the site as it is in production, w/ all plugins activated and genesis theme)
I'm concerned w/ #2, as I'm seeing sky-high numbers on main-thread work, contentful paint, and javascript execution time. (I know the images are large, and I'm not taking that into consideration here.)
Just doing a little more testing to understand the relationship w/ the theme and found something that might be helpful.
I'm working with a copy of the original site on a staging server so I can compare load times quickly. When I go to the slug /industry/industrial-manufacturing, which houses quite a few views in the actual page content (not the theme files), I can test views with and without the Genesis theme.
With the TwentyTwenty theme activated, there are NO calls to admin-ajax.php. With the Genesis theme activated, we see the same behavior I originally asked about, w/ two calls to admin-ajax.php initiated by jquery that each take about 2 seconds.
I can leave the dev site set up like this so you can compare...let me know if I can send you links privately so you can see what I mean.
Hi there,
Thank you for the information.
So with the information you gave, there is something going on in Genesis theme that causes the calls.
Would you please share the login information of the staging website. And give us the link to the page that has the views which can be tested without genesis, and with genesis.
We might be able to find something that can help, but there is no guarantee as we do not know the ins and outs of the Genesis theme.
The fact that no extra calls are called when Toolset is with 2020 shows that the issue is not Toolset codebase per see
But we will investigate more.
Please make the next reply as private while giving the info.
Thank you.
Ok Thank you. For the first step I wonder what is the impact if you as a test go to Toolset > Content Templates Industries (Single)
And remove the shortcodes I annotated in the screenshot? with and without Genesis. Please keep all other plugins deactivated as it is now.
I want to see if the admin-ajax calls changes in that context in Genesis or not.
Also test it with parent Genesis and the child one.
Remove the views and test:
1- With 2020
2. With Genesis
3. With the Child Theme
Thanks.
Without these two shortcodes, here are the results:
1. 2020: still 2 calls to admin-ajax.php (same as in original question)
2. Genesis: no calls to admin-ajax.php
3. Genesis child: no calls to admin-ajax.php
Note that I had to activate WooCommerce, as the child theme makes lots of calls to WC hooks.
Hi there,
So the issues are related to the views in question. As in a situation that you are interested in (Genesis Child) there is no admin-ajax calls without those views.
I checked both of those views and the only thing that I think might be a culprit is the usage of "wpv-post-featured-image" shortcode.
You use the cropping feature with the size of custom, which forces Toolset to do the cropping and that might cause some calls here and there, but I am not sure.
Unfortunately, I can not see any big calls on my chrome browser to be able to determine and I again need to ask you to keep the views intact and this time remove the "wpv-post-featured-image" shortcodes from the views and see what is the final result.
If that is the culprit, try to avoid using cropping feature and use whatever method you already have to do the cropping as you mentioned some big images is used on your website.
I did my best to find something that might be Toolset related here in conjunction with the overall performance.
Thanks.
Hi Christopher, I don't see how it could be the views (or featured image sizing) that you asked to be taken away, given that the admin-ajax calls are still happening on 2020 with those views completely removed.
I do find it incredibly strange that the admin-ajax calls happen with 2020 activated, but not the Genesis child theme, with or without the views. This leads me to wonder why Toolset is making those calls. Is there any way you or someone else could dig deeper on this?
It's going to take me a few more days to come back to this, but I'd appreciate it if you could leave the ticket open. Thanks again for your help!
Hi there,
That is strange for me too. The bottom line is that the Genesis Child is the key now.
So what I suggest is that you enable the plugins one by one while Genesis Child is active, and check the performance, to see in which step the admin-ajax calls come back.
That will lead to the combination of the plugins that might cause the issue.
Thank you.
It appears this is not a plugin or theme compatibility problem. I think this is what's happening -- when there is an active Toolset view using Ajax pagination, we see these extremely long calls to admin-ajax.php
Using the Genesis child theme, I activated all plugins, and there was no issue. When views w/ no pagination are added to the active content template, there is no issue. But when I add a view w/ ajax pagination, the calls happen. (In the case of the page we're testing, the view is the featured posts slider in the pre-footer area. When I change the view to have no pagination, no more calls to admin-ajax.php.)
Using admin-ajax.php may or may not be the correct behavior when using Ajax in views, but either way, the length of these calls seems excessive.
Hi there,
Thank you. Good observation, The usage of admin-ajas.php in Ajax calls in WordPress is a standard procedure.
I will report this to see if I can get more insight and get back to you.
Meanwhile, I want to ask if it is ok if we copy your website from the staging if needed.
Thanks.
Thank you! Yes, please feel free to copy the site to your servers.