Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory

Wrote a script myself, along with a blog post. Contributions for improvements are appreciated. Refer to this link for answer: Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory

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