Ajax 403 error

This support request was posted in Flatbase by techgekko

Request ID #35225 Resolved
  • Hello,

    As soon as I activate the theme on my WordPress, I get a 403 error with calls to wp-admin/admin-ajax.php.

    If I disable the theme and put another default one, it works.

    Do you have any idea ?

    Thanks,
    Bastien

    Hello Bastien,

    Thank you for writing. I hope you are doing well.

    The 403 error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason. It shouldn’t be related to the theme, given that the ajax handler is part of WordPress core and not the theme.

    Would you please share your site access details with me (in a private reply) so I can take a look? Is this response happening in any case in particular?

    Best,
    Juan.

    Hello,

    Currently, the domain-name is not set and the access to the server is restricted to our office, so I can’t provide you any direct access to the website.

    The theme-changing issue is what I just noticed : with a default theme I never have any 403 error. As soon as I enable Flatbase, I have 403 errors all the time for the same HTTP requests.

    My WordPress instance is installed on a Debian GNU/Linux 8 machine, with PHP 5.6+ installed on it.

    I didn’t change the rights of the folder, just changed the owner on the folder to www-data where WordPress in installed.

    If you have any clue ?

    Thanks,
    Bastien

    Could it be because currently I’m kind of “faking” the domain name while updating my /etc/hosts to link a real URL and the server ?

    It seems to be on every AJAX request. Below the console logs when I try to upload a logo for the theme :

    Full size img : https://i.imgur.com/GtBjhsR.png

    errors

    I tried this :

    Open a new incognito tab in Chrome and try to reach :

    http://[my_server_add]/wp-admin/admin-ajax.php

    With this I get no error.

    If I log in, and try to reach the same address, it gives me a 403 error.

    Any clue ?

    Andrés Villarreal

    HI Bastien,

    The hosts file should not be a problem, since is usual for local environments to be set up by modifying that file.

    Are you currently using any plugin on your site? The theme is not supposed to mess with AJAX calls, but sometimes errors like this are triggered by incompatibilities between a theme and a plugin, or between two plugins. Could you try disabling your plugins one by one and checking if the issue persists?

    Some other data that could be useful for us to debug this issue is the form data of some of those failing calls. You can see that information by clicking the name of any of the AJAX calls inside the Network tab in Chrome Developer Tools (you should be seeing something like this: https://www.dropbox.com/s/aydtdx54vtemw25/Screenshot%202017-11-15%2015.53.27.png?dl=0). If you could just that information to the clipboard, paste it in a txt file and share it with us in a private reply, that would be great.

    Also, could you tell us if this is happening in the admin side of your WordPress setup only, or is the public side of the site affected too?

    Best,

    Andrés.

    Hello,

    The DNS is ready, you can log in into the site here :

    http://help.gekko-holding.com
    Login : nicethemes
    PW : nicethemes2017

    I activated the theme so that you will see the errors.

    Thanks for the help,
    Bastien

    Andrés Villarreal

    Hi Bastien,

    Thank you for that. After seeing the issue in action, we can confirm it’s due to a bug on our side. We’re gonna be releasing a new version of the theme soon with a fix, but in the meantime I took the liberty to add a function to the functions.php file of your Child Theme, so now your AJAX requests are working fine. Once you’ve updated the theme to the new version, you can safely remove that code.

    Can you please confirm if you see this working on your side?

    Best,

    Andrés.

    Hello,

    I confirm it’s working now with both the child theme and the updated one.

    Thanks for the update, great job !

    Best regards,
    Bastien

    Andrés Villarreal

    Hi Bastien,

    It’s great to see that everything is working fine. Thanks for reaching out, and sorry for the inconvenience 🙂

    If you already updated the theme, feel free to use the original functions.php file.

    Best,

    Andrés.

Viewing 11 posts - 1 through 11 (of 11 total)

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server