WordPress provides a handy solution to do AJAX calls – the admin-ajax.php file which is located in /wp-admin/. Sometimes AJAX calls can bloat your website and result in loading times which aren’t funny anymore.
You ask yourself now: How can I analyze this? How can I find the particular piece on my website which results in calling admin-ajax.php for seconds? I often read “Disable all plugins, enable one plugin and check the performance again.” Yep, that is definitely one way to start but even if you find the plugin that is responsible for calling admin-ajax.php sometimes it is not a solution to just delete the plugin.
The solution? Do a performance analysis with GTmetrix
I started an analysis with GTmetrix and took a look at the waterfall diagram of this service. I searched for “admin-ajax” and saw this:
You can see that the plugin AdRotate calls admin-ajax.php three times, every time with the parameter adrotate_impression. This is because I used three banners in dynamic mode on this page. The dynamic mode changes banners every few seconds even when the visitor is only reading and not navigating on the page. Three banners, three calls. The loading/idle time is 9.95 seconds, compared to the total loading time of 17.79s, this is more than 55%!
After I saw this, I disabled the dynamic mode in AdRotate and the loading time shrinked by 9 seconds.
Leave a Reply