get_current_url())) { $my_country = admin_block_country_get_country_from_ip($_SERVER['REMOTE_ADDR']); if ($my_country != "") { foreach(admin_block_country_current_countries_blocked() as $country) { if ($country == $my_country) { exit; } } } } } add_action( 'admin_init', 'AdminBlockCountry\register_admin_block_country_settings' ); function register_admin_block_country_settings() { register_setting( 'admin-block-country-settings-group', 'admin_block_country_list' ); register_setting( 'admin-block-country-settings-group', 'admin_block_country_method' ); } add_action('admin_menu', 'AdminBlockCountry\register_admin_block_country_page'); function register_admin_block_country_page() { add_menu_page('Block Country', 'Block Country', 'manage_options', 'admin-block-country/admin-block-country.php', 'AdminBlockCountry\admin_block_country_initial_page'); } function admin_block_country_initial_page() { $abcTom = new ABCTomM8(); wp_register_script("admin_block_countries", plugins_url("/js/application.js", __FILE__)); wp_enqueue_script("admin_block_countries"); wp_register_style("admin_block_countries", plugins_url("/css/style.css", __FILE__)); wp_enqueue_style("admin_block_countries"); if (isset($_POST["action"]) && sanitize_text_field($_POST["action"]) == "Upload") { $abc_verify_upload = wp_verify_nonce($_REQUEST["_wpnonce"], "abc-upload-abc"); $allowedExts = array("dat"); $temp = explode(".", $_FILES["block_country_upload_file"]["name"][0]); $extension = end($temp); if ($abc_verify_upload && $_FILES["block_country_upload_file"]["name"][0] == "GeoLiteCity.dat" && in_array($extension, $allowedExts)) { move_uploaded_file($_FILES["block_country_upload_file"]["tmp_name"][0], ABSPATH."/wp-content/uploads/".$_FILES["block_country_upload_file"]["name"][0]); echo("
Upload was a success.
Invalid upload, can only upload GeoLityCity.dat file.
Service Updated
Admin Block Was Successful.
Please choose which countries you wish to exclude from accessing the admin site.
You cannot block your own country, for your own protection. has been taken off the list.