--- John Watson aka Ian MacLaren, according impressive sleuthing by Quote Investigator, June 2010.
From the Quote Investigator article, which traced it back to the late 19th century (and not to Plato or Philo of Alexandria):
Another citation in 1898 provides the name of a publication in Britain that published the message of MacLaren. The name “MacLaren is spelled “Maclaren” in this cite also [CM]:
“Be pitiful, for every man is fighting a hard battle,” was the tender Christmas message sent by Ian Maclaren to the readers of The British Weekly.
An extended discussion of the theme of the aphorism is present in a book published under MacLaren’s real name John Watson in 1903. The book section is titled “Courtesy” [HV]:
This man beside us also has a hard fight with an unfavouring world, with strong temptations, with doubts and fears, with wounds of the past which have skinned over, but which smart when they are touched. It is a fact, however surprising. And when this occurs to us we are moved to deal kindly with him, to bid him be of good cheer, to let him understand that we are also fighting a battle; we are bound not to irritate him, nor press hardly upon him nor help his lower self.
(The abbreviations in square brackets are references in the article.)
More recent versions reflect contemporary language preferences, e.g. this from the Seattle Times in 1984:
“Be kind. Everyone you meet is carrying a heavy burden.”