-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheasy-ip-blocker.php
More file actions
54 lines (46 loc) · 1.32 KB
/
easy-ip-blocker.php
File metadata and controls
54 lines (46 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Plugin Name: Easy IP Blocker
* Version: 2.1.0
* Plugin URI: https://wordpress.org/plugins/easy-ip-blocker/
* Description: Quickly block unwanted IPs in your WP site with CDN/proxy-aware IP detection
* Author: Carl Alberto
* Author URI: https://carlalberto.code.blog/
* Requires at least: 5.0
* Tested up to: 6.9
* Requires PHP: 7.4
*
* Text Domain: easy-ip-blocker
* Domain Path: /lang/
*
* @package Easy_IP_Blocker
* @author Carl Alberto
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load plugin class files.
require_once 'includes/class-easy-ip-blocker.php';
require_once 'includes/class-easy-ip-blocker-settings.php';
// Load plugin libraries.
require_once 'includes/lib/class-easy-ip-blocker-admin-api.php';
// Register WP-CLI commands.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once 'includes/class-easy-ip-blocker-cli.php';
WP_CLI::add_command( 'eib', 'Easy_IP_Blocker_CLI' );
}
/**
* Returns the main instance of Easy_IP_Blocker to prevent the need to use globals.
*
* @since 1.0.0
* @return Easy_IP_Blocker Plugin instance.
*/
function easy_ip_blocker() {
$instance = Easy_IP_Blocker::instance( __FILE__, '2.1.0' );
if ( is_null( $instance->settings ) ) {
$instance->settings = Easy_IP_Blocker_Settings::instance( $instance );
}
return $instance;
}
easy_ip_blocker();