如果用户试图访问网站scouce代码,如何阻止用户ip [关闭]

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!)

Welcome to stackoverflow. The user send the ip automatic. So you can just filter it on the top of your Webpage.

<?php
if ($_session('REMOTE_ADDR') == 'the ip you want to block') {
    exit;
}
?>

While it is impossible to write a script that guarantees your server will be informed when the visitor is trying to look at the client-side source code (that's what client-side entails), it should be possible to detect whether the internal developer toolbox/console is opened in most browsers. Find out whether Chrome console is open

Another method you should consider to make it harder to reverse-engineer or mess with your code is using automatic code obfuscation before you deploy your website.