Hi there,
at a glance i do not see anything malicious in the code, but you need to be aware of this note in that post:
Note: Please change your Twitter Handle in above Twitter Sharing Link. Search for via=wplogout and replace it with via=yourtwitterusername in the above code
And with any custom code, if you have issues with it, then you may not get the support you need….
Plugins wise, i generally use the premium Novashare: https://novashare.io
Or if you need a free one: https://wordpress.org/plugins/shared-counts/