Can't solve a 503 Admin.ajax GET error with my Wordpress Website.

March 27, 2018 1.6k views
WordPress Ubuntu 16.04

Having issues with a form submission that uses Ajax and can't figure out what it is, I keep getting a 503 error (https://imgur.com/a/24kJx). I've been told from the plugin developer it's a host issue but my log files are clean and using gravity forms with ajax works just fine.

Wondering if anyone can help me make sense of the error and the code that's flagging the error (or at least I think it's the right code). The plugin is from iHomefinder (Optima Express) so I have a hard time believing it's an issue with them as they have thousands of people most likely with it installed and Im sure they would be aware of it.


(function(){
    var a=function(){
        var c=jQuery("#ihf-main-container #ihf-main-container");
        c.each(function(){
            var e=jQuery(this);
            var d=e.children();
            d.insertBefore(e);e.remove()})};
    var b=function(){
        jQuery("[data-ihf-remote-submit=true]:not([data-ihf-remote-submit-bound])").each(function(){
            var c=jQuery(this);
            c.attr("data-ihf-remote-submit-bound",true);
            var d=c.find("form").addBack("form");
            d.on("submit",function(g){
                g.preventDefault();
                var e=jQuery(this);
                var i=e.find("button[type=submit]");
                i.attr("disabled",true);
                var f=e.attr("action");
                var j=e.attr("method");
                var h=e.serializeArray();
                jQuery.ajax({
                    url:f,type:j,data:h,success:function(k){
                        c.replaceWith(k);a()
                    },
                    error:function(){
                        c.replaceWith("Error 988a")
                    }
                })
            })
        })
    };
                b();jQuery(document).on("ready",function(){b()})})();

From my understanding this error has to do with to many requests being sent to Admin-ajax.php. Im using serverpilot for this and checked the nginx, apache, and php error logs and they were empty.

other things I've tried include the following:

  • Changing themes (no change)
  • disabling all plugins with the exception of Optima Express (no change)
  • Rebooted my server (no change)
  • Rebooted PHP (no change)
  • Increased memory limit (no change)
  • Installed the heartbeat plugin (no change)

I have the site on Cloudflare as well but have enabled development mode and cleared the cache with no notable change.

Hoping some fresh eyes can give me some ideas on what else I can try.

1 Answer

Figured it out,

This was an issue with some Page Rules and Cloudflare. In the past I've setup rules to protect the Wordpress admin but this specific plugin was being blocked by Cloudflare.

  • Can you share what you did to unblock on Cloudflare? I am facing the same issue.

    • For sure,

      Not sure if it will be the same case for you but I usually setup added page rules in my Cloudflare account for the Wordpress admin (wp-admin) section. One of them was One of theme involved security level set to "Im Under Attack", I changed that to High and things started working again.

      If you leave more details here on your site or something I can maybe take a look.

      How I found out was using Chrome Developer Tools, it would flag the error in the Console and then leave a link on that error. Once I clicked that link it redirected me to Cloudflare's DDOS protection so I knew it was something to do with that.

      Hope that helps

Have another answer? Share your knowledge.