Support » Plugin: Usernoise modal feedback / contact form » admin-ajax.php showing 0 not working for non-admin

  • Resolved rconserta


    I have the latest versions 3.0.6 and 3.0.9 with wordpress v3.4.2 and I get access denied for all non-admin logged in users. When I access the admin-ajax.php file in my browser I get a 0, From what I read I’m suppose to get a -1 or something, but I don’t get it. How do I make the admin-ajax.php file accessible by the public? What am I doing wrong?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author karevn


    As far as I remember, you already emailed me that it was not about Usernoise 🙂

    No that wasn’t me. I didn’t email you. I also wanted add that my urls in general settings match, so that isn’t the problem either.

    Is there any way I can use this plugin without allowing wp-admin access to users? When I allow wp-admin access to all users usernoise works, but I would rather just allow the admin-ajax.php file and nothing else.

    I found this:

    So, if you want it to fire for both visitors and logged-in users, you can do this:
    add_action('wp_ajax_my_action', 'my_action_callback');
    add_action('wp_ajax_nopriv_my_action', 'my_action_callback');

    on this page:

    Can I add this somewhere in your code to get it to work?

    Plugin Author karevn


    Hello! You can only allow wp-admin/admin-ajax.php to be publicly accessed (not all the wp-admin folder – that is all Usernoise needs. I dont really like the decision to use admin-ajax.php, but after considering other ones, it is best (other ones are less reliable).

    I’ve read a lot of other places about you saying that you need to allow wp-admin/admin-ajax.php to be publicly accessed without having the entire admin folder accessible, but you never say HOW to make only the admin-ajax.php file accessible. Can you please tell me how I would do this? I changed the permissions of the file to 775 and 777, it didn’t work, and like I said I get a 0 when I access the file in a browser, but usernoise still will not work for logged in users only admins. Please tell me how to make only the admin-ajax.php file publicly accessible.

    It’s a shame that you couldn’t figure out another way, this is an awesome plugin for wordpress.

    Plugin Author karevn


    How did you close wp-admin from public access?

    Through my theme, I use classipress and there is an option to clos wp-admin from everyone that is not an admin.

    Plugin Author karevn


    You need to contact appthemes then, because /wp-admin/admin-ajax.php is a standard “entry point” for ajax calls in WordPress which is used by other plugins too, and it should be available for public access.

    I have problem similar to this, when i click on AJAX tag in new plugin it shows “An unexpected error occurred. Something may be wrong with or this server’s configuration. If you continue to have problems, please try the support forums.”
    Other tags are working fine….

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘admin-ajax.php showing 0 not working for non-admin’ is closed to new replies.