Wordpress admin ajax return 504 error

Please check this community tip about this error: 504. It provides some suggestions and links to further reading about this and similar errors that occur between your origin and third-party servers.