The source of Oscar Wilde’s pun on Ernest/Earnest
In an earlier article I tried to show that in John Gambril Nicholson’s verse Of Boys’ Names (Wilde’s putative source of the Ernest/Earnest pun) there are other boys’ names with Wildean parallels.
Research now leads me to a further connection.
In a back issue of The Book Collector (Summer, 1978), there is chapter about Nicholson’s 1892 Love in Earnest: Sonnets, Ballades, and Lyrics (the anthology that includes the poem in question).
The reason for interest among bibliophiles in 1978 was that Nicholson’s own copy of the book had just come to light in a Cambridge (UK) bookshop—and The Book Collector made some intriguing revelations (above).
First, we learn there were thee issues of the only edition of Love in Earnest: the first being rare, and the second being viewable in full here.
Fortunately for scholars, Nicholson’s own copy was neither. It was an even rarer, and possibly unique, hybrid version of both editions, extensively annotated by Nicholson. His manuscript notes include minutiae about the date, place and often the time of day of composition, together with other symbols and emendations.
For the poem Of Boys’ Names, the existence of this first issue and Nicholson’s copy provides two points of interest for Wildeans:
1) we now see that the reference to Cyril (the name of one of Wilde’s two sons, both of whom are mentioned in the poem) appears only in the second issue; the wording “Cyril is lordly” replacing the wording “Basil is kingly” in the first issue. Again this is another obviously Wildean name: that of Basil Hallward, the painter in Wilde’s The Picture of Dorian Gray published a year earlier. Intriguingly, the textual alteration is possibly in a hand other than Nicholson’s.
2) in Nicholson’s copy, tipped in  to face the title page there is a photograph, taken in Llandudno, of Nicholson together with William Ernest Mather —the mysterious “W.E.M.” to whom the poem Of Boys’ Names is dedicated. The existence of the photograph of him in Nicholson’s personal copy reinforces Mather as the Ernest of the poem, and the source of the Earnest in Wilde’s play. 
Wordsmiths will no doubt recognize that “Basil is kingly” is a literal allusion: the word Basil in Greek (basileus) means royal. Thus, most of the definitions of other names in the poem (reprinted here) have etymological roots.
 tipped in: in the book trade, a tipped-in page or, if it is an illustration, tipped-in plate or simply plate, is a page that is attached to, but not integral to, the binding of the book.
 the photograph of Nicholson with Mather is quite rare, e.g. no example has been found online. However the picture is reproduced in the issue of The Book Collector now discussed (p. 220).
 In addition to the dedication “W.E.M.” in the printed edition, Nicholson makes frequent manuscript references, in his copy, not only to “W.E.M.”, but also to “E.S”, identified in another manuscript note as Ernest Stanley. Presumably he is the second Ernest that Nicholson references in his semi-autobiographical but innocuous novel “The Romance of a Choir-boy” (1916) in which he describes photographs of two boys called Ernest.