How to test for a class (from a plugin) in functions.php

You should use standard php function

if class_exists('WC_Product_Variation') { ...} 

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