PluginProbe
DoLogin Security / trunk
DoLogin Security vtrunk
5.0.10 4.8.3 trunk 1.0 1.1 1.1.1 1.2 1.2.1 1.2.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 1.6 All 64 releases
dologin / tpl / widget.tpl.php

widget.tpl.php in DoLogin Security trunk, at tpl/widget.tpl.php

77 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Dashboard overview widget template.
4 *
5 * @package dologin
6 */
7
8 namespace dologin;
9
10 defined( 'WPINC' ) || exit;
11
12 $dologin_list = $this->cls( 'Auth' )->history_list( 20, 0 );
13 $dologin_count = $this->cls( 'Auth' )->count_list();
14 $dologin_is_admin = current_user_can( 'manage_options' );
15
16 echo '<h2>' . esc_html__( 'Blocked login attempts total', 'dologin' ) . ': ' . (int) $dologin_count . '</h2>';
17 echo '<h2>' . esc_html__( 'Login Attempts Log', 'dologin' ) . '</h2>';
18 ?>
19 <style type="text/css">
20 .dologin-widget-table {
21 width: 100%;
22 max-width: 100%;
23 border-collapse: collapse;
24 }
25
26 .dologin-widget-table thead th {
27 background-color: #222;
28 color: #FFFFFF;
29 font-weight: bold;
30 border-color: #474747;
31 text-align: left;
32 padding: 6px 4px;
33 border: 1px solid #cccccc;
34 }
35
36 .dologin-widget-table tbody td {
37 text-align: left;
38 padding: 6px 4px;
39 border: 1px solid #cccccc;
40 }
41 </style>
42 <table class="wp-list-table striped dologin-widget-table">
43 <thead>
44 <tr>
45 <th><?php esc_html_e( 'IP', 'dologin' ); ?></th>
46 <th><?php esc_html_e( 'GeoLocation', 'dologin' ); ?></th>
47 <th><?php esc_html_e( 'Date', 'dologin' ); ?></th>
48 </tr>
49 </thead>
50 <tbody>
51 <?php if ( ! $dologin_list ) : ?>
52 <tr>
53 <td colspan="3"><?php esc_html_e( 'No list yet.', 'dologin' ); ?></td>
54 </tr>
55 <?php else : ?>
56 <?php
57 foreach ( $dologin_list as $dologin_v ) {
58 $dologin_ip_geo = explode( ', ', $dologin_v->ip_geo );
59 $dologin_ip_geo_desc = array();
60 foreach ( $dologin_ip_geo as $dologin_v2 ) {
61 $dologin_v2 = explode( ':', $dologin_v2 );
62 if ( in_array( $dologin_v2[0], array( 'country', 'city' ), true ) ) {
63 $dologin_ip_geo_desc[] = $dologin_v2[1];
64 }
65 }
66 $dologin_ip_geo_desc = implode( '-', $dologin_ip_geo_desc );
67 echo '<tr><td>' . ( ! $dologin_is_admin ? '**' : esc_html( $dologin_v->ip ) ) . '</td><td>' . esc_html( $dologin_ip_geo_desc ) . '</td><td>' . esc_html( date_i18n( 'm/d H:i', $dologin_v->dateline ) ) . '</td></tr>';
68 }
69 ?>
70 <?php endif; ?>
71 </tbody>
72 </table>
73
74 <div>
75 <a href="<?php echo esc_url( menu_page_url( 'dologin', 0 ) ); ?>#log" style="text-align: right; display: block;"><?php esc_html_e( 'Check more', 'dologin' ); ?></a>
76 </div>
77