Skip Navigation

[Resolved] Two Calls to admin-ajax.php?

This thread is resolved. Here is a description of the problem and solution.

Problem:
Why does Views call ajax twice (admin-ajax.php file)?

Solution:
Reason explained here:
https://toolset.com/forums/topic/why-is-cred-referring-to-admin-ajax-php/

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by benjaminJ-3 7 years, 2 months ago.

Assisted by: Noman.

Author
Posts
#568896

Hi,

The site I'm looking at was not in your drop down of options: view-source:hidden link

Why does views call ajax twice? The admin-ajax.php file is causing slow load times on the site:

<script type='text/javascript'>
/* <![CDATA[ */
var _wpUtilSettings = {"ajax":{"url":"\/wp-admin\/admin-ajax.php"}};
var _wpUtilSettings = {"ajax":{"url":"\/wp-admin\/admin-ajax.php"}};
/* ]]> */
</script>

#569039

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Benjamin,

Thank you for contacting Toolset support. Can you please tell us where exactly it loads this twice, any screenshot or filename or line number where you see double ajax call?

Thank you

#569235

Line 417 and 418

#569417

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

source code.png

Hello Benjamin,

I have checked the page source code and cannot found admin-ajax.php, not even Line 417 and 418 is present. See attached screenshot.

Can you please provide link and screenshot where you find admin-ajax.php loading twice?

Thank you

#569612

view-source:hidden link

#569683

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Benjamin,

Looks like you have changed something on your site, because there is no any admin-ajax.php file loading when I look into view-source:hidden link see screenshot here:
https://toolset.com/wp-content/uploads/2017/09/569417-source_code.png?x71388

I have tried to reproduce this issue at my local site, but I can confirm you that there is only one admin-ajax.php file loading.

Please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and check the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the screenshot or link where you see admin-ajax.php loading twice.

Thank you

#569936

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Our Views lead developer explained why these are twice in the code, please read here:
https://toolset.com/forums/topic/why-is-cred-referring-to-admin-ajax-php/

These are just placed to do different actions and this does not directly affect the speed, these are variables placed so that it can be used as needed by Views and other plugins. We have not seen any speed complaints because of this, and removing those might not be a good idea. The compressed version or cached version that you were loading previously may help in your case.

Thanks

#569983

Ok. I may write my own light version of views so I don't have to load more than needed.

Thanks,