logic->getTableOptions($sub); // Sanitizing unchecked table options $tableOptions = $this->logic->sanitizePostData($tableOptions); // Modern page wrapper echo '
| ' . esc_html__('Loading logs…', '404-solution') . ' |
|---|
| '; // Generate column headers (sortable if the underlying column is indexed). foreach ($columns as $key => $col) { $orderbyCol = $col['orderby']; if ($orderbyCol === '') { $html .= ' | ' . esc_html($col['title']) . ' | '; continue; } $sortUrl = "?page=" . ABJ404_PP . "&subpage=abj404_logs"; $sortUrl .= "&orderby=" . $orderbyCol; $sortState = $this->getHeaderSortState($tableOptions, $orderbyCol, false); $newOrder = $sortState['nextOrder']; $sortUrl .= "&order=" . $newOrder; $sortClass = trim($sortState['thClass']); $sortClassAttr = ($sortClass !== '') ? ' class="' . $sortClass . '"' : ''; $sortIndicator = $sortState['indicator']; $html .= '' . esc_html($col['title']) . $sortIndicator . ' | '; } $html .= '|||
|---|---|---|---|---|---|
| '; if ($hasTrace) { $html .= ''; } else { $html .= ''; } $html .= ' | '; // URL column $url = is_string($row['url'] ?? '') ? (string)($row['url'] ?? '') : ''; $urlDetail = is_string($row['url_detail'] ?? '') ? (string)($row['url_detail'] ?? '') : ''; $fullVisitorURL = esc_url(home_url($url)); $urlDisplay = '' . esc_html($url) . ''; if ($urlDetail !== '' && trim($urlDetail) !== '') { $urlDisplay .= ' (' . esc_html(trim($urlDetail)) . ')'; } $html .= '' . $urlDisplay . ' | '; // IP Address $remoteHost = is_string($row['remote_host'] ?? '') ? (string)($row['remote_host'] ?? '') : ''; $html .= '' . esc_html($remoteHost) . ' | '; // Referrer $referrer = is_string($row['referrer'] ?? '') ? (string)($row['referrer'] ?? '') : ''; $html .= ''; if ($referrer != "") { $html .= '' . esc_html($referrer) . ''; } else { $html .= '-'; } $html .= ' | '; // Action Taken (with engine on second line) $action = trim(is_string($row['action'] ?? '') ? (string)($row['action'] ?? '') : ''); $engineVal = is_string($row['engine'] ?? '') ? (string)($row['engine'] ?? '') : ''; $html .= '';
if ($action === '' || $action == "404" || $action == "http://404") {
$html .= '' . __('404', '404-solution') . '';
} else {
$html .= '' . __('Redirect', '404-solution') . '';
$html .= ' ' . esc_html($action) . ''; } if ($engineVal !== '') { $html .= ' ' . esc_html($engineVal) . ''; } $html .= ' | ';
// Date (with user on second line)
$timeToDisplay = abs(is_scalar($row['timestamp'] ?? 0) ? intval($row['timestamp'] ?? 0) : 0);
$rowUsername = is_string($row['username'] ?? '') ? (string)($row['username'] ?? '') : '';
$html .= '' . (string)wp_date('Y/m/d', $timeToDisplay) . ' ' . (string)wp_date('h:i:s A', $timeToDisplay); if ($rowUsername !== '') { $html .= ' ' . esc_html($rowUsername) . ''; } $html .= ' | ';
$html .= '