Skip to content

Wordpress Plugin to specify which Plugins should be active while answering an ajax call to admin-ajax.php - much better performance.

License

Notifications You must be signed in to change notification settings

ibes/shy-ajax-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shy-ajax-handler

WordPress plugin to specify which plugins should be active while answering an ajax call to admin-ajax.php - much better performance.

When a WordPress plugin calls admin-ajax.php WordPress will load every active plugin to answer the request. In a lot of cases only the calling plugin is needed to answer the request. The overhead of loading the other plugins will slow the answer down. For autocomplete and similar services, this can be painful.

Install and use the plugin

This plugin should be put in the mu-plugins folder within wp-content (maybe you need to create the folder). MU-Plugins are loaded before all the other plugins.

This plugin is intented to be used by developers. There is no GUI. See the example code in the plugin file how to use it.

You need to find out which action the AJAX call is using.

Learn how plugins use the admin-ajax.php (http://solislab.com/blog/5-tips-for-using-ajax-in-wordpress/)

Get to know the action by looking in the plugin code:

add_action( 'wp_ajax_nopriv_{THE_ACTION}', 'myajax_submit' ); // not logged in
add_action( 'wp_ajax_{THE_ACTION}', 'myajax_submit' );        // logged in

Or check our browsers developer tool for XHR requests and the the action of the request you want to speed up.

About

Wordpress Plugin to specify which Plugins should be active while answering an ajax call to admin-ajax.php - much better performance.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages