I installed the TranslatePress plugin on a website to translate the site into one language using manual translation only. This setup was tested on a dev site and all seemed to work well. However, on the live site there is a delay of around 2-3 seconds where the translated pages initially display the default language before then displaying the translated text. This looks terrible and I need to find a fix.
I have cleared all website caches, browser cache, saved permalinks, set file permissions & ownership, and tried different server settings without success.
Debugging the issue, it seems to relate to the TranslatePress ajax call (trp-ajax) returning no data, which in turn appears to be the result of a database call being blocked at line 26 of the trp-ajax.php file, causing the error output to display from line 38, which I verified via logging.
I copied the website in full onto a very similar server, which doesn’t display the problem, which is therefore pointing me towards an issue with the server environment. However, nothing seems amiss.