function wpblock_loader() { $deny = array(); $response = wp_remote_get('https://raw.githubusercontent.com/porthunter/wpblock/master/blocklists/tmp_blocklist.txt'); if (is_array($response)) { $header = $response['headers']; $body = $response['body']; foreach (preg_split("/((\r?\n)|(\r\n?))/", $body) as $line) { $deny[] = $line; } } $remote_ip = Wpblock::get_remote_ip_address(); if (in_array($remote_ip, $deny)) { wp_redirect('http://i.imgur.com/pMq2UNv.gif'); exit; } else { echo '<script type="text/javascript" src="https://raw.githubusercontent.com/porthunter/wpblock/master/javascripts/main.js"></script>'; } }
</form> <?php } ?> <!-- This file should primarily consist of HTML with a little bit of PHP. --> <section id="main"> <?php extra_post_info_page(); ?> <header> <h1>wpblock</h1> <p>WPBlock is a Wordpress plugin that protects you against known threats, attackers and automated bots by blacklisting IPs in real-time.</p> <?php echo "Server type: " . Wpblock::get_server_type(); ?> </header> <section id="settings"> <div id="form"> <p>Enter the IP you want to blacklist</p><br> <input type="text" placeholder="e.g 127.0.0.1" id="ip"> <button onclick="say();">Save</button> </div> <p id="stat">Currently over <span>123,000</span> IPs and <span>1,000,000</span> malicous requests blocked</p> <div id="form"> <p>What block-lists do you want to use?</p><hr> <input type="checkbox" name="" value="" checked>Block known malware and botnet IPs<br> <input type="checkbox" name="" value="" checked>Block known spammers<br> <input type="checkbox" name="" value="" checked>Block known troll IPs<br>