debug: Add more logging including post_id and postTopHtml preview
Additional debug info: - Log post_id and URL to identify which post is being processed - Log first 200 chars of postTopHtml to verify content - Log final content length 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -184,7 +184,9 @@ function roi_inject_content_ads(string $content): string
|
|||||||
global $container;
|
global $container;
|
||||||
|
|
||||||
// DEBUG: Log para diagnosticar problema de ads no inyectados
|
// DEBUG: Log para diagnosticar problema de ads no inyectados
|
||||||
error_log('ROI AdSense Debug: roi_inject_content_ads called');
|
$post_id = get_the_ID();
|
||||||
|
$post_url = get_permalink();
|
||||||
|
error_log('ROI AdSense Debug: roi_inject_content_ads called for post_id=' . $post_id . ', url=' . $post_url);
|
||||||
|
|
||||||
// Solo en posts individuales
|
// Solo en posts individuales
|
||||||
if (!is_single() || !in_the_loop() || !is_main_query()) {
|
if (!is_single() || !in_the_loop() || !is_main_query()) {
|
||||||
@@ -237,9 +239,11 @@ function roi_inject_content_ads(string $content): string
|
|||||||
);
|
);
|
||||||
$content = $injector->inject($content);
|
$content = $injector->inject($content);
|
||||||
|
|
||||||
error_log('ROI AdSense Debug: Final injection done. postTop=' . strlen($postTopHtml) . ', postBottom=' . strlen($postBottomHtml));
|
$finalContent = $postTopHtml . $content . $postBottomHtml;
|
||||||
|
error_log('ROI AdSense Debug: Final injection done. postTop=' . strlen($postTopHtml) . ', postBottom=' . strlen($postBottomHtml) . ', finalLength=' . strlen($finalContent));
|
||||||
|
error_log('ROI AdSense Debug: First 200 chars of postTopHtml: ' . substr($postTopHtml, 0, 200));
|
||||||
|
|
||||||
return $postTopHtml . $content . $postBottomHtml;
|
return $finalContent;
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
error_log('ROI AdSense Content ERROR: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine());
|
error_log('ROI AdSense Content ERROR: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine());
|
||||||
|
|||||||
Reference in New Issue
Block a user