The wikipedia article has a good discussion of the claims of the various individuals to be the author. It has what would seem to be a clinching point in favour of King John IV of Portugal, a manuscript in his library which predates John Wade's version. This detail is not mentioned in this other discussion of the topic which argues strongly for Wade.
From both articles it appears that Wade worked a lot with plainchant and worked to revive it. And King John was also a musician and collected,composed and arranged a good quantity of music. An arrangement still used today of "Crux fidelis", a 6th century Latin hymn is attributed to him.
My own view on this is that any answer has to treat the text and music separately.
I'd say that both Wade and King John would be more likely to arrange existing words, rather than write an original, since respect for tradition, and the importance of a connection to the past are part of the Catholic tradition, to which both belonged. So for me, on balance of probability, the real author of the text was an unknown monk and both of them worked with versions of that text.
I couldn't find an online copy of King John's version, but if it is the same as the version called "The Portuguese hymn", the tune is different to Wade's.(ref wikipedia article).
So, author of words unknown, many different arrangements.