What is the exact model of the Mac? You can get this information by clicking the Apple menu and selecting "About This Mac".
FYI, the quality of third party Lithium-ion Batteries is extremely poor, sometimes even when purchased from a reputable vendor like OWC or iFixIt (these are my first two choices whenever an official OEM battery is not available through an Apple repair/replacement). While there are some decent vendors selling on the Amazon marketplace, it can be hard to tell which ones, plus many times a vendor may not be able to get the same quality battery every time they restock. The Amazon reviews are worthless these days for multiple reasons (paid reviews, and Amazon infrastructure issues allowing ratings & reviews to be "transferred" to other items & vendors as examples).
Try unplugging the charger from the electrical outlet for a minute to reset the charger's internal circuitry. And try plugging the charger into another electrical outlet (or into the wall outlet if using a power surge strip). There may be small thin metal or even a staple stuck in the Magsafe port. Here is an Apple article with some other Magsafe charger troubleshooting tips:
If your MagSafe cable or power adapter isn't working - Apple Support
If this does not lead to a solution, then it is anyone's guess at what hardware on the laptop is faulty. Usually the weakest link is the battery. Liquid damage is also another common reason for issues (only takes a single drop of liquid at the right place on the electronics). Troubleshooting generally requires known good spare parts to confirm which part(s) are faulty. Unfortunately running the Apple Diagnostics won't help if it reports a bad battery since the diagnostics will fail when some third party batteries are installed. They would be useful if they reported some other failure. Or if they had passed the battery tests with the third party battery, then later failed them once you discovered a problem.