SLP_Premier_Security_Block_IP
extends SLPlus_BaseClass_Object
in package
Class SLP_Premier_Security_Block_IP
Manage the functionality for blocking an IP.
Table of Contents
Properties
- $addon : object
- $myslp : MySLP
- $slplus : SLPlus
- $uses_myslp : bool
- $uses_slplus : bool
- $slug : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- get_instance() : static
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- initialize() : mixed
- Things we do at the start.
- set_properties() : mixed
- Set our properties.
- track_request_ips() : array<string|int, mixed>
- Track query request IP addresses.
- add_hooks() : mixed
- Add the hooks needed for logging IP addresses.
- cidr_match() : bool
- Test if IP address within CIDR
- get_blocked_response() : array<string|int, mixed>
- get_the_user_ip() : string
- Get the users IP address.
- ip_address_is_whitelisted() : bool
- Is the IP address on the whitelist.
- update_request_list() : array<string|int, mixed>
- Add latest request to the request list, drop requests outside the Block Requests Time Span
Properties
$addon
public
object
$addon
$myslp
public
MySLP
$myslp
$slplus
public
SLPlus
$slplus
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slug
protected
mixed
$slug
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolget_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([bool $no_global = false ][, mixed $params = array() ]) : static
Parameters
- $no_global : bool = false
-
set to true to skip assigning object to SLP global as a property.
- $params : mixed = array()
-
object init params
Return values
staticinitialize()
Things we do at the start.
public
initialize() : mixed
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
track_request_ips()
Track query request IP addresses.
public
track_request_ips(array<string|int, mixed> $results) : array<string|int, mixed>
Parameters
- $results : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —$results
add_hooks()
Add the hooks needed for logging IP addresses.
private
add_hooks() : mixed
cidr_match()
Test if IP address within CIDR
private
cidr_match(string $ip, string $cidr) : bool
Parameters
- $ip : string
- $cidr : string
Return values
boolget_blocked_response()
private
get_blocked_response(array<string|int, mixed> $results) : array<string|int, mixed>
Parameters
- $results : array<string|int, mixed>
Return values
array<string|int, mixed>get_the_user_ip()
Get the users IP address.
private
get_the_user_ip() : string
Return values
stringip_address_is_whitelisted()
Is the IP address on the whitelist.
private
ip_address_is_whitelisted(string $ip_address) : bool
Parameters
- $ip_address : string
Return values
boolupdate_request_list()
Add latest request to the request list, drop requests outside the Block Requests Time Span
private
update_request_list(array<string|int, mixed> $request_list) : array<string|int, mixed>
Parameters
- $request_list : array<string|int, mixed>