“Whoever gave naseehat [advice] to his brother [Muslim] quietly has given him naseehat. Whoever has given naseehat in front of everyone has put his brother [Muslim] to shame.” (Imaam Shaafi’ Rahmatullahi Alaih)
[Yes, if the wrongdoer openly transgresses, or rejects the naseehat with contempt, then it will be salubrious to proclaim the naseehat publicly. Perhaps he takes heed out of shame.
Similarly, if there is wanton and wide spread commission of sin then this should be addressed openly and the naseehat offered should be disseminated widely.]