fix(rail-ads): revertir a anuncio 160px fijo centrado en container responsive
This commit is contained in:
@@ -97,9 +97,6 @@ function roi_render_rail_ads(): string
|
||||
global $container;
|
||||
|
||||
if ($container === null) {
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: container is NULL');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -108,34 +105,22 @@ function roi_render_rail_ads(): string
|
||||
$settings = $repository->getComponentSettings('adsense-placement');
|
||||
|
||||
if (empty($settings)) {
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: settings are EMPTY');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
// Verificar exclusiones
|
||||
if (roi_is_ad_excluded($settings)) {
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: EXCLUDED by roi_is_ad_excluded');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
// Obtener renderer desde DIContainer (DIP compliant)
|
||||
$renderer = $container->getAdsensePlacementRenderer();
|
||||
|
||||
$html = $renderer->renderRailAds($settings);
|
||||
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: renderRailAds returned ' . strlen($html) . ' chars');
|
||||
}
|
||||
|
||||
return $html;
|
||||
return $renderer->renderRailAds($settings);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI AdSense Rail Ads ERROR: ' . $e->getMessage());
|
||||
error_log('ROI AdSense Rail Ads: ' . $e->getMessage());
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@@ -145,19 +130,8 @@ function roi_render_rail_ads(): string
|
||||
* Hook para inyectar Rail Ads en el footer
|
||||
*/
|
||||
add_action('wp_footer', function() {
|
||||
// DEBUG: Verificar que el hook se ejecuta
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: wp_footer hook fired');
|
||||
}
|
||||
|
||||
$output = roi_render_rail_ads();
|
||||
|
||||
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||
error_log('ROI Rail Ads: output length = ' . strlen($output));
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $output;
|
||||
echo roi_render_rail_ads();
|
||||
}, 50);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user