Al-Ḥāfiẓ Ibn Ḥajar has quoted ‘Allāmah Ibn Baṭṭāl رحمهما الله in his famed ‘Fatḥ-Al-Bārī', whilst commenting on the final hadith in Ṣaḥīḥ Al-Bukhārī, as saying:
'The virtues of dhikr (remembrance of Allāh) which appear in the aḥādīth are only for those who have a standing and are [somewhat] perfect in Dīn, like being free from ḥarām and major sins. Do not think that whosoever addicts himself to dhikr whilst persisting in fulfilling his unlawful desires and violating the rights of Allah, that he will reach the same status as those who are pure and noble in Dīn, just because he has uttered a few words with his tongue, without any taqwā and good deeds.'
If a person continues committing major sins and still thinks that he will gain salvation in the Hereafter as a result of frequently having said the incantations of virtue mentioned in the aḥādīth - without repenting from the major sins he is committing - then he is very wrong. However, if he is sincere in his using these adhkār, they will lead him to stop perpetrating the major sins he is indulged in, and so he should continue, but at the same time make an earnest effort to mend his sinful ways.
 فتح الباري شرح صحيح البخاري لابن حجر، دار المعرفة - بيروت، ١٣٧٩، (م:١٣/ص:٥٤١):
قال بن بطال هذه الفضائل الواردة في فضل الذكر إنما هي لأهل الشرف في الدين والكمال كالطهارة من الحرام والمعاصي العظام فلا تظن أن من أدمن الذكر وأصر على ما شاءه من شهواته وانتهك دين الله وحرماته أنه يلتحق بالمطهرين المقدسين ويبلغ منازلهم بكلام أجراه على لسانه ليس معه تقوى ولا عمل صالح