WPML – PHP Fatal error: Uncaught Error: Call to undefined function str_contains()

To fix it urgently, I had to put a str_contains() polyfill right into wp-config.php:

if (!function_exists('str_contains')) {
    /**
     * Check if substring is contained in string
     *
     * @param $haystack
     * @param $needle
     *
     * @return bool
     */
    function str_contains($haystack, $needle)
    {   
        return (strpos($haystack, $needle) !== false);
    }
}

I used the polyfill from gdarko at https://gist.github.com/gdarko/5dbcf96dccb2a3eece6c10d084d008af

And the site works now with that patch.

Note that if you are having that error, you probably have a WordPress version under 5.9 as Pat J pointed out in the comments, and PHP before version 8. You might be stuck with that version for the time being, so the solution above can be a temporary urgent patch to resolve.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)