fix(adsense): Disable output buffer causing content loss
The output buffer in adsense-delay.php was causing conflicts with zlib compression buffer, resulting in ads being generated but not appearing in final HTML. Root cause: Multiple output buffers (zlib + adsense-delay) were nested improperly, causing ob_end_flush() failures and content loss. Solution: Disable the output buffer since AdsensePlacementRenderer already generates scripts with type="text/plain" data-adsense-push. The buffer was redundant and only needed for external AdSense sources. Debug logs confirmed: - Filter generates ads correctly (598+601 chars) - Content exists after filter (54765 chars) - But ads missing in final HTML (0 roi-ad-slot found) - ob_end_flush() errors in debug.log 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17,12 +17,20 @@ if (!defined('ABSPATH')) {
|
||||
/**
|
||||
* Retarda la carga de scripts de AdSense interceptando el buffer de salida
|
||||
*
|
||||
* NOTA: Este output buffer solo se activa cuando delay_enabled está activo
|
||||
* en adsense-placement. El renderer ya genera scripts con type="text/plain",
|
||||
* pero este buffer procesa scripts de AdSense que vienen de otras fuentes
|
||||
* (plugins, código manual, etc.)
|
||||
* DESACTIVADO: El renderer (AdsensePlacementRenderer) ya genera scripts con
|
||||
* type="text/plain" data-adsense-push, por lo que este output buffer es
|
||||
* REDUNDANTE y causa conflictos con otros buffers (zlib compression).
|
||||
*
|
||||
* El buffer solo sería necesario para procesar scripts de AdSense de plugins
|
||||
* externos, pero causa pérdida de contenido al interferir con otros buffers.
|
||||
*
|
||||
* @see Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php
|
||||
*/
|
||||
function roi_delay_adsense_scripts() {
|
||||
// DESACTIVADO: Output buffer causa conflictos y pérdida de contenido
|
||||
// El renderer ya genera scripts con type="text/plain"
|
||||
return;
|
||||
|
||||
// Solo ejecutar en frontend
|
||||
if (is_admin()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user