Shia sources say it is complied in reverse order in A'laam ad-Dyn fi sifat al Mu'minyn (page 117) أعلام الدين في صفات المؤمنين by al-Hassan ibn abi al-Hassan ad-Daylami ﺍﻟﺤﺴﻦ ﺑﻦ ﺃﺑﻲ ﺍﻟﺤﺴﻦ ﺍﻟﺪﻳﻠﻤﻲ as a statement of 'Ali ibn abi Talib (see here) and in al-Majlesi's محمد باقر المجلسي Bihar al-Anwar بحار الأنوار (see here) :
مَنْ وَعَظَ أَخَاهُ سِرًّا فَقَدْ زَانَهُ ، وَمَنْ وَعَظَهُ عَلانِيَةً فَقَدْ شَانَهُ
He who has advised his brother alone has adorend him and he who advised him in public has made him ugly.
Exactly the same statement can also be found in imam al-Bayhaqi's sho'ab al-Iman شعب الإيمان on the authority of Umm ad-Dardaa' with a full narrator chain (see here).
Like any library, Islam Stack Exchange offers great information, but does not offer personalized advice or legal verdicts, and does not take the place of seeking such advice from your Mufti, Imam, or other trustworthy Counselor.