# 404-solution/4.3.0/includes/frontend/FrontendHitRecorder.php

404 Solution, version 4.3.0. 36 lines.

- Page: https://pluginprobe.com/plugins/404-solution/4.3.0/code/includes/frontend/FrontendHitRecorder.php
- Raw: https://pluginprobe.com/plugins/404-solution/4.3.0/raw/includes/frontend/FrontendHitRecorder.php
- Modified: 2026-06-23T05:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/404-solution/4.3.0/code/includes/frontend/FrontendHitRecorder.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) {
    exit;
}

/**
 * Writes frontend redirect-hit log records when a compatible log writer exists.
 */
class ABJ_404_Solution_FrontendHitRecorder {

    /** @var mixed */
    private $logsRepository;

    /**
     * @param mixed $logsRepository Object exposing logRedirectHit().
     */
    function __construct($logsRepository) {
        $this->logsRepository = $logsRepository;
    }

    /**
     * @param string $requestedUrl
     * @param string $action
     * @param string $matchReason
     * @param string|null $requestedUrlDetail
     * @param list<array{step: string, outcome: string, detail: string}>|null $pipelineTrace
     */
    function record(string $requestedUrl, string $action, string $matchReason, ?string $requestedUrlDetail = null, ?array $pipelineTrace = null): void {
        if (!is_object($this->logsRepository) || !is_callable(array($this->logsRepository, 'logRedirectHit'))) {
            return;
        }
        call_user_func(array($this->logsRepository, 'logRedirectHit'), ABJ_404_Solution_RedirectHitLogEntry::create($requestedUrl, $action, $matchReason, $requestedUrlDetail, $pipelineTrace));
    }
}

```
