'html', 'option' => $option_name, 'field' => 'blocked', 'value' => (int)$statistics['blocked'], ) ); // Blocked by countries $count = array(); arsort( $statistics['countries'] ); foreach ( $statistics['countries'] as $key => $val ) { $count[] = array( esc_html( $key ), (int)$val ); } $html = '
'; add_settings_field( $option_name.'_countries', __( 'Blocked by countries', 'ip-geo-block' ), array( $context, 'callback_field' ), $option_slug, $section, array( 'type' => 'html', 'option' => $option_name, 'field' => 'countries', 'value' => $html, ) ); // Blocked hooks by date $zero = array( 'comment' => 0, 'xmlrpc' => 0, 'login' => 0, 'admin' => 0, 'public' => 0, ); $prev = 0; $count = array(); // make array( `time`, `comment`, `xlmrpc`, `login`, `admin`, `public` ) foreach ( $statistics['daystats'] as $key => $val ) { while ( $prev && $key - $prev > DAY_IN_SECONDS ) { $count[] = array( $prev += DAY_IN_SECONDS, 0, 0, 0, 0, 0 ); } $count[] = array_merge( array( $prev = $key ), array_values( array_merge( $zero, $val ) ) ); } // embed array into data attribute as json $html = ''; add_settings_field( $option_name.'_daily', __( 'Blocked per day', 'ip-geo-block' ), array( $context, 'callback_field' ), $option_slug, $section, array( 'type' => 'html', 'option' => $option_name, 'field' => 'daily', 'value' => $html, ) ); // Blocked by type of IP address add_settings_field( $option_name.'_type', __( 'Blocked by type of IP address', 'ip-geo-block' ), array( $context, 'callback_field' ), $option_slug, $section, array( 'type' => 'html', 'option' => $option_name, 'field' => 'type', 'value' => '| IPv4 | IPv6 |
|---|---|
| ' . esc_html( $statistics['IPv4'] ) . ' | ' . '' . esc_html( $statistics['IPv6'] ) . ' | ' . '
| ' . __( 'Name of API', 'ip-geo-block' ) . ' | '; $html .= '' . __( 'Call', 'ip-geo-block' ) . ' | '; $html .= '' . __( 'Response [msec]', 'ip-geo-block' ) . ' | '; $html .= '
|---|---|---|
| ' . esc_html( $key ) . ' | '; $html .= '' . sprintf( '%5d', (int)$val['count'] ) . ' | '; $html .= sprintf( '%4.1f', (float)(1000.0 * $val['time'] / $val['count']) ); $html .= ' |
';
echo str_replace(
$link,
'' . $link . '',
$key
);
echo ' (', (int)$log, ')', sprintf( __( '[ %sRecord “Statistics of validation”%s ] is disabled.', 'ip-geo-block' ), '', '' ), '
', "\n"; echo '', __( 'Please set the proper condition to record and analyze the validation statistics.', 'ip-geo-block' ), '
', "\n"; } public static function warn_validation() { $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' ); echo '', sprintf( __( '[ %sRecord “Validation logs”%s ] is disabled.', 'ip-geo-block' ), '', '' ), '
', "\n"; echo '', __( 'Please set the proper condition to record and analyze the validation logs.', 'ip-geo-block' ), '
', "\n"; } public static function warn_ipadr_cache() { $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' ); echo '', sprintf( __( '[ %sRecord “IP address cache”%s ] is disabled.', 'ip-geo-block' ), '', '' ), '
', "\n"; echo '', __( 'Please set the proper condition to record IP address in cache.', 'ip-geo-block' ), '
', "\n"; } }