Funny you say that, because before TJ beat him the UFC was marketing Barao was the #1 P4P fighter in the world haha. There were a decent amount of people parroting that notion as well. I wasn't one of them but I certainly didn't think TJ would handle him so thoroughly.
Even when he was on his run and was the man, he had holes in his game that none of his opponents had the right combination of skills to exploit until TJ. McDonald showed that a hard puncher with decent fundamentals in the pocket can take advantage of his lack of head movement and rock him badly, but his own lack of speed and rhythm manipulation made him easy to figure out. Wineland confused him early with his rhythm manipulation but lacked the defense and exhibition of fundamentals to really capitalize before Barao caught him off guard. TJ came with all those positives and none of those negatives, and Barao had no answer. Since then it seems to be a combination of the weight cut, his faults being exposed in a big way, and TJ possibly breaking him that has caused him to nosedive. I think before TJ there was maybe an argument to be made that he was the GOAT or shaping up to be (I still would've gone Cruz), but that argument fell apart starting with the first beating he took from TJ.