I found the below information about where the name came from on Wikipedia.
'There are two legends that attempt to explain the origins of the Sweetheart cake. One tells the tale of a couple that lived a very poor life, in imperial China. They loved each other and lived in a small village.
Suddenly, a mysterious disease spread. The husband's father became very sick. The couple spent all of their money in order to treat the man's father, but he was still sick. The wife sold herself as a slave in exchange for money to buy medicine for her father-in-law.
Once the husband learned about what his wife did, he made a cake filled with sweetened winter melon and almond. He dedicated this pastry to his wife, whom he'll never forget and sold it. His cake became so popular that he was able to earn enough money to buy his wife back.
There is another version where the man went searching for his wife after he earned enough money to buy her back. In his search, he had a cup of tea at a local tea house, when he suddenly recognized the pastry they were serving with the tea. They were reunited at the tea house.'Wife Cake is a popular biscuit in Asia with a very long history. There are a few different types of Wife Cake. Yee Hup Wife Cake (Lo Paw Bang) is the lighter version.