Got a replacement Iphone 5s and battery might be defective?

Last week before I went to bed, I put my iPhone 5s on the charger and it was fine. When I woke up the next day, I went to unplug it and my phone was off and I tried everything to turn it on and it didn't work so Tmobile sent me another iPhone 5s for free since I'm still under warranty. I backed it up from iCloud but it only saved stuff from a year ago and couldn't back it up from my iTunes at the time because I didn't have my laptop with me since I was in work. I went to charge it and it said it was charging but the battery percentage wasn't going up. Is it because the battery is effective or maybe because I didn't update it with the right software? This is so inconvenient for me right now and don't have the time to runaround to Tmobile to get a replacement phone that was supposed to work since it is the phone to replace my broken one in the first place. Somebody please help me lol

Added (1). I meant defective* not effective

Well, its never good to charge your phone overnight, it only really needs 45-60 minutes of charging, after that, your frying the battery by overcharging it. Typically it doesn't have crazy reprecussions, at least initially. But to prevent it from happening again, charge it once a day, only for the time it needs