Prevent add_filter being applied to wp-admin pages

You need the !is_admin() check. This will return false on admin pages, failing your condition. On front end pages, that condition will return true, executing your conditional statement

if ( !is_admin() ) {
    // Do something only on frontend
}

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