What is necessary to secure a WP plugin against direct file access attempts?

the .htaccess method will work only for apache and not even for all possible configurations of it, and empty index.php/index.html are to prevent directory listing, so the only proper solution is to check if ABSPATH is defined.

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