How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?

How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?

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