fix(dashboard): eliminar card duplicado de búsquedas sin resultados

- Eliminar card "ACCIÓN URGENTE: Contenido a Crear" (duplicaba información)
- Mantener card "Búsquedas Sin Resultados" con paginación
- Añadir texto descriptivo al card conservado
- Limpiar variable $zero_results y objeto JS no utilizados

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-12-04 19:33:57 -06:00
parent 5e7626725d
commit 9acfd0a495
6 changed files with 110 additions and 46 deletions

View File

@@ -330,7 +330,6 @@ final class ROI_APU_Analytics_Dashboard
$infraposicionados = $repository->getInfraposicionados($days, 3, 5, 10);
// v2 Recommendations
$zero_results = $repository->getZeroResults($days, 10);
$quick_wins = $repository->getQuickWins($days, 10);
$contenido_estrella = $repository->getContenidoEstrella($days, 10);
$decay_content = $repository->getDecayContent($days, 10);
@@ -479,44 +478,6 @@ final class ROI_APU_Analytics_Dashboard
<!-- ═══════════════ RECOMENDACIONES ACCIONABLES ═══════════════ -->
<!-- 🔴 ACCIÓN URGENTE: Contenido a Crear -->
<?php if (!empty($zero_results)) : ?>
<div class="card mb-4 shadow-sm" style="border-left: 4px solid #ef4444;">
<div class="card-header d-flex justify-content-between align-items-center" style="background-color: #ef4444; color: white;">
<h6 class="mb-0 d-flex align-items-center gap-2">
<i class="bi bi-exclamation-triangle-fill"></i>
<?php esc_html_e('ACCIÓN URGENTE: Contenido a Crear', 'roi-apu-search'); ?>
</h6>
<span class="badge bg-light text-dark"><?php echo count($zero_results); ?></span>
</div>
<div class="card-body p-0">
<p class="small text-muted px-3 pt-3 mb-2">
<?php esc_html_e('Los usuarios buscan esto pero NO encuentran nada. ¡Crea este contenido!', 'roi-apu-search'); ?>
</p>
<div class="table-responsive">
<table class="table table-striped table-hover mb-0">
<thead class="table-light">
<tr>
<th style="width: 70%;"><?php esc_html_e('Término buscado', 'roi-apu-search'); ?></th>
<th class="text-center"><?php esc_html_e('Frecuencia', 'roi-apu-search'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($zero_results as $term) : ?>
<tr>
<td><strong><?php echo esc_html(mb_strimwidth($term['q_term'], 0, 80, '...')); ?></strong></td>
<td class="text-center">
<span class="badge bg-danger"><?php echo esc_html(number_format((int)$term['frecuencia'])); ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>
<!-- 🟡 REVISAR: Títulos con CTR 0% -->
<?php if (!empty($ctr_zero)) : ?>
<div class="card mb-4 shadow-sm" style="border-left: 4px solid #f59e0b;">
@@ -959,6 +920,9 @@ final class ROI_APU_Analytics_Dashboard
<span class="badge bg-light text-dark"><?php echo esc_html($total_counts['total_zero_results']); ?> <?php esc_html_e('términos', 'roi-apu-search'); ?></span>
</div>
<div class="card-body p-0">
<p class="small text-muted px-3 pt-3 mb-2">
<?php esc_html_e('Los usuarios buscan esto pero NO encuentran nada. ¡Crea este contenido!', 'roi-apu-search'); ?>
</p>
<div class="table-responsive">
<table class="table table-striped table-hover mb-0">
<thead class="table-light">
@@ -1028,13 +992,6 @@ final class ROI_APU_Analytics_Dashboard
sinResultados: '<?php echo esc_js($sin_resultados); ?>',
posProm: '<?php echo esc_js($pos_prom); ?>'
},
// v2: Urgent - Zero Results
zeroResults: <?php echo wp_json_encode(array_map(function($term) {
return [
'term' => $term['q_term'],
'frecuencia' => (int) $term['frecuencia']
];
}, $zero_results)); ?>,
// v2: CTR Zero
ctrZero: <?php echo wp_json_encode(array_map(function($term) {
return [