Try a different DNS service for opening websites ...
Open System Preferences > Network > Advanced > DNS
Click + and type:
Click + again and do the same.
If Safari is open, quit and relaunch Safari and try opening a wab page.
If that doesn't help, open System Preferences > Network > Advanced > Proxies
Deselect any checked boxes on the left, quit and relaunch Safari to test.
If that doesn't load web pages, try troubleshooting Safar extenions and plug-ins.
Try troubleshooting extensions and third party plug-ins.
From your Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that off if there are any installed. Quit and relaunch Safari to test. If that helped, turn extensions back on then uninstall one a time to test.
If it's not an extensions issue, try troubleshooting third party plug-ins.
Back to Safari > Preferences. This time select the Security tab. Deselect: Allow all other plug-ins. Quit and relaunch Safari to test.
If that made a difference, instructions for troubleshooting plugins here.
As for the charging issue, the problem may be the power adapter > Troubleshooting MagSafe adapters
If the adapter appears to be ok, try Resetting the System Management Controller (SMC)