on category page get name of category as a string

read https://developer.wordpress.org/reference/functions/single_cat_title/

set the $display parameter to false;

i.e. use:
if(in_array( single_cat_title( '', false ), $visible_titles)) {

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