is it possible to block IP address if any user tried to access your WordPress website source code?
and i found this Wordpress plugin which does some sort of a activity like that.
https://codecanyon.net/item/hide-my-wp-amazing-security-plugin-for-wordpress/4177158 this plugin Notify you when someone is mousing about your WordPress site (included with visitor details like IP, user agent, referrer and even username!)