@@ -155,6 +155,22 @@ public function test_versions() {
155
155
} else {
156
156
$ this ->html_table_row ('GIT is installed? ' , 'No ' , 'Yes ' , 'No ' , 'error ' );
157
157
}
158
+
159
+ $ this ->html_table_row ('Remote IP via $_SERVER["REMOTE_ADDR"] ' , '' , '' , $ _SERVER ["REMOTE_ADDR " ], 'info ' );
160
+
161
+ if ( isset ($ _SERVER ["HTTP_X_FORWARDED_FOR " ]) ) {
162
+ $ this ->html_table_row ('Remote IP via $_SERVER["HTTP_X_FORWARDED_FOR"] ' , '' , '' , $ _SERVER ["HTTP_X_FORWARDED_FOR " ], 'info ' );
163
+ }
164
+
165
+ if ( isset ($ _SERVER ["HTTP_X_FORWARDED " ]) ) {
166
+ $ this ->html_table_row ('Remote IP via $_SERVER["HTTP_X_FORWARDED"] ' , '' , '' , $ _SERVER ["HTTP_X_FORWARDED " ], 'info ' );
167
+ }
168
+
169
+ if ( isset ($ _SERVER ["HTTP_CLIENT_IP " ]) ) {
170
+ $ this ->html_table_row ('Remote IP via $_SERVER["HTTP_CLIENT_IP"] ' , '' , '' , $ _SERVER ["HTTP_CLIENT_IP " ], 'info ' );
171
+ }
172
+
173
+ $ this ->html_table_row ('Real remote IP via AJAX call ' , '' , '' , '... js loading ... ' , 'warning realip ' );
158
174
}
159
175
160
176
public function test_php_extensions () {
@@ -449,6 +465,7 @@ public function test_php_config() {
449
465
public function return_bytes ($ val ) {
450
466
$ val = trim ($ val );
451
467
$ last = strtolower ($ val [strlen ($ val )-1 ]);
468
+ $ val = (int ) $ val ;
452
469
switch ($ last ) {
453
470
// Le modifieur 'G' est disponible depuis PHP 5.1.0
454
471
case 'g ' :
@@ -625,8 +642,16 @@ public function get_footer() {
625
642
626
643
$ output .= '<footer>© <a href="http://beapi.fr">BE API</a> ' . date ( 'Y ' ) . '</footer> ' . "\n" ;
627
644
$ output .= '</div> ' . "\n" ;
645
+
628
646
$ output .= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> ' . "\n" ;
629
647
$ output .= '<script src="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> ' . "\n" ;
648
+
649
+ $ output .= '<script type="text/javascript">
650
+ $.getJSON("//freegeoip.net/json/?callback=?", function(data) {
651
+ $(".realip td:last").html(data.ip);
652
+ });
653
+ </script> ' . "\n" ;
654
+
630
655
$ output .= '</body> ' . "\n" ;
631
656
$ output .= '</html> ' . "\n" ;
632
657
@@ -1147,4 +1172,4 @@ private function _command_exists($command) {
1147
1172
}
1148
1173
1149
1174
// Init render
1150
- phpwpinfo ();
1175
+ phpwpinfo ();
0 commit comments