It is necessary not to confuse delusions with hypocrisy (riya). Satan tells man that his worshipping is hypocrisy in order to drive him away from worshipping. If man does not notice that it is delusion, this will cause problems in man. As he thinks about it, he starts to fall into despair. Therefore, we should try to worship without expecting any worldly benefits from worshipping. In addition, we should not give importance to the delusions that come to the mind.
There is no hypocrisy in fards. It is not appropriate to perform fard deeds secretly. It is necessary to perform fard deeds openly. Furthermore, it is more appropriate to perform sunnah deeds that are about to pass into oblivion openly so that they will not be forgotten. When one does so, he will not propagate himself, but the deed of worshipping.