Insert into your index.asp or index.php or home section the following example code:
Set App = CreateObject("FlexFirewallManager.Admin")
App.FormatOutput="xml"
App.Username="Plesk Domain User"
App.Password="Plesk Domain Pass"
Dim strIP : strIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If strIP = "" Then strIP = Request.ServerVariables("REMOTE_ADDR")
Dim returnstring : returnstring = App.InfoIP(strIP)
Set objxml = CreateObject("Msxml2.DOMDocument")
objxml.LoadXml(return_string)
if lcase(objxml.SelectSingleNode("/output/result").text) = "true" then
if ucase(objxml.SelectSingleNode("/output/countrycode").text) = "CN" then
App.BlockIp(strIP)
end if
end if
$app = new COM("FlexFirewallManager.Admin");
$app->FormatOutput="json";
$app->Username="Plesk Domain User";
$app->Password="Plesk Domain Pass";
$strIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
if ($strIP == ""){$strIP = $_SERVER['REMOTE_ADDR'];}
$returnstring = app->InfoIP($strIP);
$appjson = json_decode($returnstring);
if($appjson->result){
if ($appjson->countrycode" == "CN"){
$app->BlockIp($strIP);
}
}