Samsung J5 turns off at 30% despite new battery
I'm using the Samsung Galaxy J5, I bought it almost 2 years ago, recently my old battery had bloated, was quickly discharging(especially at low battery) and the phone started clicking randomly, sometimes even making a static noise and then powering off when the battery was around 30%. So I changed the battery to a new one, it definitely takes longer to discharge, albeit not as it was when I first bought, but it takes pretty long to charge, when it reached 8% it shut down(no random clicking or noise this time), next time it shut down at 30%(also no random clicking or noise). Could this be a problem with any other hardware or software on my phone, or have they just given me an old battery at the store, which seems unlikely since they gave a guarantee). All help is appreciated, thank you in advance.