Is it a good idea to init ajax functions only while ‘DOING_AJAX’

The best way to know is to test yourself…but you will most likely find that the performance difference is negligible. Adding those actions don’t mean that the “my_ajax_method_” will be evaluated. It is just setting up a reference…and the reference is only executed if the AJAX call comes in.

admin ajax is not working for non logged in users

There are some “magic” request parameters that are better avoided, mostly anything that can be used as a parameter name at a request url but also some more like “email” (don’t think it is well documented and a quick google failed to bring a good reference). Try to change the names of your parameters especially … Read more