Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tirmidhi:3509Ibrāhīm b. Yaʿqūb > Zayd b. Ḥubāb > Ḥumayd al-Makkī a freed slave of Ibn ʿAlqamah > ʿAṭāʾ b. Abū Rabāḥ > Abū Hurayrah

“When you pass by the gardens of Paradise, then feast.” I said: “O Messenger of Allah, and what are the gardens of Paradise?” He said, “The Masajid.” I said: “And what is feasting, O Messenger of Allah?” He said: “‘Glory is to Allah, (Subḥān Allāh)’ and ‘All praise is due to Allah, (Al-Ḥamdulillāh)’ and ‘None has the right to be worshipped but Allah, (Lā Ilāha Illallāh)’ and ‘Allah is the Greatest (Allāhu Akbar).’”  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Gharīb.
الترمذي:٣٥٠٩حَدَّثَنَا إِبْرَاهِيمُ بْنُ يَعْقُوبَ حَدَّثَنَا زَيْدُ بْنُ حُبَابٍ أَنَّ حُمَيْدًا الْمَكِّيَّ مَوْلَى ابْنِ عَلْقَمَةَ حَدَّثَهُ أَنَّ عَطَاءَ بْنَ أَبِي رَبَاحٍ حَدَّثَهُ عَنْ أَبِي هُرَيْرَةَ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِذَا مَرَرْتُمْ بِرِيَاضِ الْجَنَّةِ فَارْتَعُوا قُلْتُ يَا رَسُولَ اللَّهِ وَمَا رِيَاضُ الْجَنَّةِ قَالَ الْمَسَاجِدُ قُلْتُ وَمَا الرَّتْعُ يَا رَسُولَ اللَّهِ قَالَ سُبْحَانَ اللَّهِ وَالْحَمْدُ لِلَّهِ وَلاَ إِلَهَ إِلاَّ اللَّهُ وَاللَّهُ أَكْبَرُ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ

See similar narrations below:

Collected by Suyūṭī
suyuti:2648a

“When you pass by the gardens of Paradise, then feast.” I said: “O Messenger of Allah, and what are the gardens of Paradise?” He said, “The Masajid.” I said: “And what is feasting, O Messenger of Allah?” He said: “‘Glory is to Allah, (Subḥān Allāh)’ and ‘All praise is due to Allah, (Al-Ḥamdulillāh)’ and ‘None has the right to be worshipped but Allah, (Lā Ilāha Illallāh)’ and ‘Allah is the Greatest (Allāhu Akbar).’” (Using translation from Tirmidhī 3509)   

السيوطي:٢٦٤٨a

"إذَا مَررْتُمْ برياضِ الجنَّةِ فارْتُعوا، قِيلَ: يا رسولَ الله! وما رياضُ الجنَّةِ؟ قال: المساجدُ، قِيلَ: وما الرَّتْعُ؟ قال: سُبْحانَ الله، والحمدُ لله، ولا إلهَ إلَّا الله والله أكبرُ".  

[ت] الترمذي غريب عن أبي هريرة