FAQ: Why do I get "Not Found" when I click Save or Sync?
Any action you perform that doesn't reload the whole page is an Ajax action. Loco Translate performs various actions via Ajax, including Save and Sync operations from the editor. We've received many reports of these actions throwing generic errors like "Not Found", "Forbidden" and - even weirder - "Not implemented". In almost all cases the source of the error is external to our plugin and related to your server setup.
It's not possible to use Loco Translate without Ajax, but here are some suggestions for fixing the problem.
Check your security software
Loco Translate does not produce these errors itself, which means something is getting in the way and stopping it from working. In the majority of cases we've seen, the culprit is security software designed to protect your site from attackers and malicious code.
This may take the form of a server module like mod_security or another WordPress plugin like WordFence. Their jobs are to examine requests to the server and block anything that looks "bad". Generally this blocking is done according to specific rules that have been configured on purpose, and for reasons unknown to us some rules can cause Ajax requests from our plugin to be blocked.
We can only make guesses at why requests are blocked, but one thing we've learned is that overwriting files that are managed by WordPress can ring alarm bells. Make sure you're following our recommendations for saving custom translations and avoid writing to any files that an application firewall might deem suspicious.
We don't believe our plugin does anything unsafe or unreasonable, and follows WordPress standards closely whenever possible. We can't say the same for every bit of software you might have installed, so avoid disabling security software yourself and seek expert help.
Check output compression setting
It has been reported that PHP's
zlib.output_compression setting can interfere with our plugin's Ajax requests.
We can't simulate this problem ourselves, but the setting is known to raise PHP notices due to the way WordPress closes output buffers. Try disabling this setting and see if your problem disappears.
Talk to your hosting provider
If your site is on a managed server you may find you need help from your hosting provider to check your server configuration.
Hosting company support staff tend to know lots about servers, but may know very little about WordPress development. Tell the support team that something is blocking Ajax requests from your WordPress site, but you don't know what or why. Avoid mentioning specific functionality of Loco Translate as they will simply refer you back to us.
It's not uncommon for hosting providers to say a problem is not their fault, only to find out later that it was. Please exhaust this line of enquiry before asking us to solve your server problems. If they cant help you, you'll have to dig deeper into the problem yourself and find out more information.
Examine the error page
The first step to debugging HTTP errors is to actually see the error page being sent back from your server. You won't see it in the Loco Translate dashboard because Ajax actions are hidden. Most web browsers have some kind of "Network inspector" that will let you see the Ajax response with your own eyes. If you don't know how to access your network inspector, try this guide for Chrome.
Chrome has a "Preview" tab which will render the HTML (if there is any), as in the following example:
Note in this screenshot that the
/wp-admin/admin-ajax.php request is highlighted, but there will be others that look the same because this is a core WordPress file.
Erroneous entries might be highlighted in red, but if you're unsure which to select then watch the list as you perform actions in Loco Translate. The correct entry should appear just as the "Not Found" error appears on the page.
If you're lucky this page will tell you exactly why the request was blocked. However, in some cases (particularly 404s) the page may simply be the standard error page from your WordPress theme. For other errors (like 403 Forbidden) you may see a generic error page produced by your web server. This won't necessarily tell you why the request is blocked, but will at least give you something to go to your hosting provider with.
If the network inspector tells you nothing, you can try digging into your error logs.
It really is a bug
We're not ruling out a fault in Loco Translate, but our experience is that HTTP errors tend to be external to our plugin. That's not to say that there isn't some kind of conflict we can address, but we must be able to reproduce the issue on our own servers.
If you want to report your issue as a bug, please do so in the support forum and provide useful diagnostics.