Admin_Page.php
6 months ago
Analytics_Page.php
6 months ago
Campaign_Builder_Page.php
2 years ago
Click_Tracking_Page.php
1 year ago
Debug_Page.php
1 year ago
Integrations_Pages.php
1 year ago
Settings_Page.php
2 years ago
Support_Page.php
1 year ago
Updates_Page.php
1 year ago
Visitor_Page.php
5 months ago
Debug_Page.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Admin_Page; |
| 4 | |
| 5 | use IAWP\Utils\Request; |
| 6 | /** @internal */ |
| 7 | class Debug_Page extends \IAWP\Admin_Page\Admin_Page |
| 8 | { |
| 9 | protected function render_page() |
| 10 | { |
| 11 | echo \IAWPSCOPED\iawp_blade()->run('debug', ['detected_ip' => Request::ip(), 'custom_ip_header' => $this->custom_ip_header(), 'header_details' => $this->header_details()]); |
| 12 | } |
| 13 | private function custom_ip_header() : string |
| 14 | { |
| 15 | $custom_ip_header = Request::custom_ip_header(); |
| 16 | if ($custom_ip_header === null) { |
| 17 | $custom_ip_header = ''; |
| 18 | } |
| 19 | return $custom_ip_header; |
| 20 | } |
| 21 | private function header_details() : array |
| 22 | { |
| 23 | $result = []; |
| 24 | foreach (Request::ip_headers() as $header) { |
| 25 | if (isset($_SERVER[$header])) { |
| 26 | $result[] = [$header, $_SERVER[$header]]; |
| 27 | } else { |
| 28 | $result[] = [$header, '']; |
| 29 | } |
| 30 | } |
| 31 | return $result; |
| 32 | } |
| 33 | } |
| 34 |