AUTHOR: al-’Allaamah ‘Abdurrahmaan as-Sa’dee (rahimahullaah)
“ Say (O Muhammad ): “I am only a man like you. It has been inspired to me that your Ilâh (God) is One Ilâh (Allâh). So whoever hopes for the Meeting with his Lord, let him work righteousness and associate none as a partner in the worship of his Lord.”
“ Whosoever desires the life of the world and its glitter; to them We shall pay in full (the wages of) their deeds therein, and they will have no diminution therein. They are those for whom there is nothing in the Hereafter but Fire; and vain are the deeds they did therein. And of no effect is that which they used to do.”
The Prophet (sallallaahu ‘alayhi wasallam) said;
“Allaah said, ‘ I am most independent and free from needing partners. Whoever does a deed associating something in it with me, he and his shirk are forsaken.’ 
From Abu Sa’eed al-Khudhriyy (radhiyAllaahu ‘anhu) that the Prophet (sallallaahu ‘alayhi wasallam) said:
“Shall I not inform you of what I fear most for you than al-maseeh ad- dajjaal ?” They said, “Yes O Messenger of Allah! ” He said, “ Hidden shirk (riyaa). A man stands to pray, so he beautifies his prayer when he notices someone looking at him.”
From Abu Hurayrah (radhiyAllaahu ‘anhu) that he said the Prophet (sallallaahu ‘alayhi wasallam) said;
“Ruin for the worshipper of the dinar, Ruin for the worshipper of the dirham, Ruin for the worshipper of the khamisah! Ruin for the worshipper of the khamilah! If he is given, he is pleased, and if he is not given he is displeased. Ruin and humiliation! He can not even find relief from the slightest prick! But toobaa is for the worshipper taking the reins of his horse in the cause of Allaah: his hair flying, his feet dusty. If he is assigned the watch, then he remains on watch. If he is assigned the rear guard, he guards the rear .Yet if he asks permission, he is not permitted, And if he intercedes, his intercession is not granted.”
Commentary by al-‘Allaamah ‘Abdur-Rahmaan as-Sa’dee (rahimahullah):
Know that sincerity for Allaah is the foundation of the religion, and the essence of tawheed and worship. It is when the worshipper intends all of his deeds for the Face of Allaah, for His rewards, and His favours. So he maintains the six foundations of faith, the five signs of Islaam, and the fulfillment of faith – ihsaan – as well as the rights of Allaah and the rights of His worshippers. In this way his intention is perfected for the Face of Allaah and for the abode of the Hereafter. He does not intend by this to be seen, nor to be heard of, nor does he do it for position, or for worldly matters. By this he will have completed his faith and tawheed.
Among the worst behaviors that diminish the sincerity is to perform deeds just to be seen by people, for their praise, or to honour them, or doing deeds for the sake of worldly matters. This degrades sincerity and tawheed.
There are some details about riyaa:
If a worshipper does a deed with the goal of having people see it , and he remains with this evil intention , then his deed is disgraced , and he commits shirk, and he runs the risk of it leading him to major shirk.
If a worshipper does a deed intending the Face of Allaah and with that, he is also intending it for the sake of people – if he does not remonve the riyaa from his deed – then the texts are clear that this deed is also false.
When a worshipper does a deed for the sake of Allaah alone , but riyaa surfaces for an instant during his deed , if he wards it off and purifies his sincerity for Allaah, then there is no harm in that deed. But if he settles for that – becoming tranquil with it – then the value of the deed diminishes, resulting in a weakening of his faith in proportion to the amount of riyaa that survived in his heart. Still, the deed remains for Allaah , but whatever portion of it he mixed up and was confused about is riyaa.
Riyaa is a dangerous disease which requires the soul to hasten to disciplining itself in sincerity , to wage war in defence against the destruction caused by riyaa, to oppose its assault , seeking Allaah’s help to defend against it , so that perhaps Allaah will purify the worshippers’ faith and complete his tawheed.
As for deed done merely for worldly reasons or for the attainment of things in the world : if the worshippers’ intent is always for this goal , without having the objective of doing things for the Face of Allaah and the abode of the Hereafter , then there will be no reward for him in the Hereafter for these acts.
Acts characterized in this manner will not be found in the hearts of the believers , as the believer – even if his faith is weak – will certainly bring the goal of Allaah and the abode of the Hereafter in mind.
As for the one who does such acts for the Face of Allaah , as well as for the sake of the world ; these objectives being equal or approximately so , then these will – if he is a believer – diminish his faith , tawheed and sincerity . His deed will be diminished because he has forsaken complete sincerity in them.
One who does a deed for Allaah alone , and he is most sincere in his deed – having complete sincerity in it – but for that deed recieves wages designated to help in work for the religion , wages that are to be spent on good deeds – such as the mujaahid who deserves some spoils of war or provisions for his struggling , or like in the case of an endowment that is responsible for paying the salaries of those who work in the masjids , schools , and other religious positions – then there is no harm on the worshipper’s faith and tawheed to accept such wages , since it is not being used for worldly work , it is only intended for the religion , and the objective is that the individual who recieves it does work in the religion.
For this reason Allaah designated a great portion of the sharee’ah wealth , like zakaah and the spoils of war , for those who work for religious endowments , as well as helping to benefit in the world. This topic is well known.
The previous examples help to make the rulings for these many important issues clearer to you , it is up to you to judge similar cases in the proper light. And Allaah knows best.
Footnotes: Qur’aan 18:110
 Qur’aan 11:15-16
 Ibn Maajah, al-Bayhaqee, Saheeh al-Jaami’ (No. 2607)
 Al-Bukhaaree and a shorter version with Ibn Maajah. The examples given in the hadeeth are intended to be clear opposites : the first person can only be pleased by things, and he is never satisfied. The second remains in the utmost sincerity for Allaah , without any compliant , although he is the kind of person whose requests are not commonly granted by people , nor his intercession. In this way , he is opposite of the person who is always used to getting his way , doing all that he does with that goal in mind.