Error 400

Support forumCategory: BugsError 400
Jack Wright asked 3 years ago
Whenever I try to save the options in the admin screen (i.e. add a location) I get a HTTP error 400. My WordPress version is 5.7. Plugin version is version 3.4.6. I did start seeing this issue since I upgraded the plugin to 3.4.6 from the very previous version. I cannot replicate this issue on a Windows machine using WAMP. However, I do get the issue on a server with cPanel with network protections in place. I will contact them later today to see if it is an issue on their end. POST data: {"name":"dfgfd","address":"dfgfdg","location":"dfgfdgfd","id":null} POST request headers: POST /wp-admin/admin-ajax.php?&_wpnonce=15c9754b37&action=ea_location HTTP/1.1
Host: hiddendomain.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Accept: application/json, text/plain, */*
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://hiddendomain.com/wp-admin/admin.php?page=easy_app_locations
Content-Type: text/json
Content-Length: 67
Origin: (hidden)
Connection: keep-alive
Cookie: wordpress_sec_71538dbe42b038b9a65e46110e6471a5=admin%7C1616673393%7Cry5QXkcVDe4M7myFHPDTuB2rqKomMdkzagLywEPlHoA%7C6eaf4f796a3fb5dbfed2ef1b6d57bf91ce14833455ba49efeb403ec022ab1790; hip=74bebadc73dfd4aadeca1b1aa1fa137e; __stripe_mid=d41c5db8-3407-4692-901a-17e7571af9916caac0; wp-settings-1=editor%3Dtinymce%26libraryContent%3Dbrowse; wp-settings-time-1=1616498002; wordpress_test_cookie=WP+Cookie+check; PHPSESSID=b9dbd4a99d4f2ba0005bbe731dd77df5; wordpress_logged_in_71538dbe42b038b9a65e46110e6471a5=admin%7C1616673393%7Cry5QXkcVDe4M7myFHPDTuB2rqKomMdkzagLywEPlHoA%7Cfbdd2678aabce5c82668915c69a7c500d070c1e19b7b9ca805678e0d2bd8c18b Response headers: HTTP/2 400 Bad Request
date: Tue, 23 Mar 2021 12:22:29 GMT
server: Apache
x-powered-by: PHP/7.1.33
x-robots-tag: noindex
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff, nosniff
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN, SAMEORIGIN, SAMEORIGIN
content-type: text/html; charset=UTF-8
X-Firefox-Spdy: h2 Response: {"err":true}   Any help would get greatly appreciated!
5 Answers
Nikola Loncar Staff answered 3 years ago
Hi, can you please tell me do you have issues when you try to save some other thing. For example adding the location? Best regards, Nikola
jackawardls replied 3 years ago

I cant add locations, workers or services. But I can save settings and create other WordPress pages and posts (which also use AJAX).

Nikola Loncar Staff replied 3 years ago

Hi, thanks for update it will be fixed during the day.

Best regards,
Nikola

jackawardls replied 3 years ago

Have you identified it as a plugin issue?

Nikola Loncar Staff replied 3 years ago

Some hosting providers are blocking requests with some header values. We will alter those values from EA side. This effects some of users. For example if you try locally on Wamp there will be no issues.

Best regards,
Nikola

jackawardls replied 3 years ago

Ooh what you said makes a lot of sense! Thanks a lot!

jackawardls replied 3 years ago

Which header is the most problematic?

Nikola Loncar Staff replied 3 years ago

Content type was text/json and it should be application/json in order to pass

jackawardls replied 3 years ago

I have just edited my local copy of your plugin and have confirmed that does indeed fix the issue!

Could you please let me know when this new version is available at jack@awardls.com?

Many thanks!

ArleyMcB replied 3 years ago

What files specifically did you edit?

ArleyMcB answered 3 years ago
I am also having this issue on a clinic site (https://atwellcentre.ca/booking) - "GET https://atwellcentre.ca/wp-admin/admin-ajax.php?location=1&service=3&worker=1&date=2021-05-14&end_date=2021-05-14&start=09%3A00&check=2e12ba8bab&action=ea_res_appointment 400" Which is rough, it worked flawlessly on staging...  I recognize this is an issue with our server, any help is appreciated. This is an excellent plugin!
Nikola Loncar Staff answered 3 years ago
Hi do you have caching engine on that site? Maybe it's caching nonce value. Best regards, Nikola
ArleyMcB replied 3 years ago

There are no caching plugins, but I’ll ask the host as there have been other weird things I can’t configure myself. Thanks!

chrslcy answered 3 years ago
I'm having a similar issue on one of my client's site. Has this been resolved? The site is running these versions:
  • WordPress: 5.7.2
  • Easy Appointments: 3.5.2
When I switch to troubleshooting mode with all plugins disabled except Easy Appointments and the default WordPress theme activated, I'm still getting the problem when trying to add or edit Services. All other admin pages are unaffected. Here are the headers: General Request URL: https://www.hiddendomain.com/wp-admin/admin-ajax.php?&_wpnonce=4a1215982a&action=ea_service&id=1&_method=PUT Request Method: POST Status Code: 400 Remote Address: 45.8.225.243:443 Referrer Policy: strict-origin-when-cross-origin Response Headers access-control-allow-credentials: true access-control-allow-origin: https://www.hiddendomain.com access-control-allow-origin: https://www.hiddendomain.com cache-control: no-cache, must-revalidate, max-age=0 content-type: text/html; charset=UTF-8 date: Wed, 09 Jun 2021 09:30:10 GMT expires: Wed, 11 Jan 1984 05:00:00 GMT referrer-policy: strict-origin-when-cross-origin server: Apache x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-robots-tag: noindex Request Headers :authority: www.hiddendomain.com :method: POST :path: /wp-admin/admin-ajax.php?&_wpnonce=4a1215982a&action=ea_service&id=1&_method=PUT :scheme: https accept: application/json, text/plain, */* accept-encoding: gzip, deflate, br accept-language: en-GB,en;q=0.9,en-US;q=0.8,en-ZA;q=0.7,en-NZ;q=0.6,en-IN;q=0.5,en-CA;q=0.4,en-AU;q=0.3,cy;q=0.2,hu;q=0.1 content-length: 121 content-type: application/json cookie: wordpress_sec_eb77aea8c677453ff37cba17a307aa8e=sch-admin%7C1623354060%7Co8TwMgPKSf1mFcZKcu740wbyCyAXCf2cOhGOTYl1aEQ%7Cc0a1dcfb898ca539283a627459650669a4125b4ea6fcf6b1e45d3c1a201c90c0; PHPSESSID=44a1ce32605f683c189cf1bb98f1e58a; wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_eb77aea8c677453ff37cba17a307aa8e=sch-admin%7C1623354060%7Co8TwMgPKSf1mFcZKcu740wbyCyAXCf2cOhGOTYl1aEQ%7Ce12569884d43c731768d7eb26b4d50faf22f9b5bd9fb3e40b3a3b6d52e064242; wp-settings-1=editor%3Dtinymce%26libraryContent%3Dbrowse%26unfold%3D1%26mfold%3Do%26imgsize%3Dthumbnail%26advImgDetails%3Dshow%26post_dfw%3Doff%26posts_list_mode%3Dlist; wp-settings-time-1=1623181261; wp-health-check-disable-plugins=817bff9a882c018e4d4ddfcefea9fbee origin: https://www.hiddendomain.com referer: https://www.hiddendomain.com/wp-admin/admin.php?page=easy_app_services sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91" sec-ch-ua-mobile: ?0 sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-origin user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Response {"err":true} Any assistance would be greatly appreciated. Thanks, Chris
ArleyMcB replied 3 years ago

For me the solution was cache. Not in the form of a plugin, but the webhost had it. I was on the support chat a few times to sort that out.

Nikola Loncar Staff answered 3 years ago
@chrslcy can you please turn on compatibility mode on inside EA Settings. Looks like PUT method is blocked by your hosting. Also clear cache as mentioned before. Best regards, Nikola