Chris John retained his WBA featherweight title after coming through a real battle against Chonlatarn Piriyapinyo in Singapore.