chore(php): add toc debug logging for guest visibility issue
Temporary debug logging to diagnose why TOC shows for logged users but not for guests. Logs visibility checks at each layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,15 @@ final class PageVisibilityHelper
|
||||
$container = DIContainer::getInstance();
|
||||
$useCase = $container->getEvaluateComponentVisibilityUseCase();
|
||||
|
||||
return $useCase->execute($componentName);
|
||||
$result = $useCase->execute($componentName);
|
||||
|
||||
// DEBUG: Log visibility evaluation
|
||||
if ($componentName === 'table-of-contents') {
|
||||
$isLoggedIn = is_user_logged_in();
|
||||
error_log("PageVisibilityHelper DEBUG [{$componentName}] [" . ($isLoggedIn ? "LOGGED" : "GUEST") . "]: result=" . ($result ? "true" : "false"));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,18 @@ final class WordPressPageTypeDetector implements PageTypeDetectorInterface
|
||||
{
|
||||
public function detect(): PageType
|
||||
{
|
||||
// DEBUG: Log all checks for diagnosis
|
||||
$isLoggedIn = is_user_logged_in();
|
||||
$debugData = [
|
||||
'is_front_page' => is_front_page(),
|
||||
'is_home' => is_home(),
|
||||
'is_single' => is_single(),
|
||||
'is_page' => is_page(),
|
||||
'is_search' => is_search(),
|
||||
'is_archive' => is_archive(),
|
||||
];
|
||||
error_log("PageTypeDetector DEBUG [" . ($isLoggedIn ? "LOGGED" : "GUEST") . "]: " . json_encode($debugData));
|
||||
|
||||
if ($this->isHome()) {
|
||||
return PageType::home();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user