WordPress Post Like without Plugin

In muchad.com you can find love picture in every after post. This “post like” is integrated with my theme, medio theme.

Post Like in Medio Theme

I using Post Like system by Sven Hofmann’s, it’s pretty cool. This is the scenario:
When an anonymous user clicks the like button:
– User’s IP address is stored in the post’s meta as an array.
– These IP addresses are utilized to prevent anonymous users from liking posts more than once.
– Post like count is incremented +1 and stored in post meta.
When a registered user clicks the like button:
– WP User ID in the post’s meta as an array.
– Post like count is incremented +1 and stored in post meta.
– Post ID is stored as user meta.
– User like count is incremented +1 and stored as user meta.

If you want use it in your theme, you can read full tutorial in his website from this link or directly read his gist: