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

40
.commitlintrc.json Normal file
View File

@@ -0,0 +1,40 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"perf",
"test",
"build",
"ci",
"chore",
"revert"
]
],
"scope-enum": [
2,
"always",
[
"plugin",
"search",
"api",
"admin",
"assets",
"sql",
"includes",
"config",
"deps"
]
],
"subject-case": [2, "always", "lower-case"],
"subject-max-length": [2, "always", 72],
"body-max-line-length": [2, "always", 72]
}
}

43
.gitignore vendored Normal file
View File

@@ -0,0 +1,43 @@
# Node modules (commitlint, husky)
node_modules/
npm-debug.log
package-lock.json
# Log files
*.log
error_log
debug.log
# System files
.DS_Store
Thumbs.db
Desktop.ini
# Temporary files
*.tmp
*.temp
*.swp
*.swo
*~
# Environment files
.env
.env.*
# IDE files
.vscode/
.idea/
*.sublime-project
*.sublime-workspace
# Backup files
*.sql
*.sql.gz
*.tar.gz
*.zip
# Claude Code tools
.playwright-mcp/
.serena/
.claude/
nul

1
.husky/commit-msg Normal file
View File

@@ -0,0 +1 @@
npx --no -- commitlint --edit $1

1
.husky/pre-commit Normal file
View File

@@ -0,0 +1 @@
npm test

View File

@@ -330,7 +330,6 @@ final class ROI_APU_Analytics_Dashboard
$infraposicionados = $repository->getInfraposicionados($days, 3, 5, 10); $infraposicionados = $repository->getInfraposicionados($days, 3, 5, 10);
// v2 Recommendations // v2 Recommendations
$zero_results = $repository->getZeroResults($days, 10);
$quick_wins = $repository->getQuickWins($days, 10); $quick_wins = $repository->getQuickWins($days, 10);
$contenido_estrella = $repository->getContenidoEstrella($days, 10); $contenido_estrella = $repository->getContenidoEstrella($days, 10);
$decay_content = $repository->getDecayContent($days, 10); $decay_content = $repository->getDecayContent($days, 10);
@@ -479,44 +478,6 @@ final class ROI_APU_Analytics_Dashboard
<!-- ═══════════════ RECOMENDACIONES ACCIONABLES ═══════════════ --> <!-- ═══════════════ 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% --> <!-- 🟡 REVISAR: Títulos con CTR 0% -->
<?php if (!empty($ctr_zero)) : ?> <?php if (!empty($ctr_zero)) : ?>
<div class="card mb-4 shadow-sm" style="border-left: 4px solid #f59e0b;"> <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> <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>
<div class="card-body p-0"> <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"> <div class="table-responsive">
<table class="table table-striped table-hover mb-0"> <table class="table table-striped table-hover mb-0">
<thead class="table-light"> <thead class="table-light">
@@ -1028,13 +992,6 @@ final class ROI_APU_Analytics_Dashboard
sinResultados: '<?php echo esc_js($sin_resultados); ?>', sinResultados: '<?php echo esc_js($sin_resultados); ?>',
posProm: '<?php echo esc_js($pos_prom); ?>' 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 // v2: CTR Zero
ctrZero: <?php echo wp_json_encode(array_map(function($term) { ctrZero: <?php echo wp_json_encode(array_map(function($term) {
return [ return [

22
package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "roi-apu-search",
"version": "1.0.0",
"description": "Plugin WordPress para búsqueda de APUs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky"
},
"repository": {
"type": "git",
"url": "git+https://github.com/prime-leads-app/roi-apu-search.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"husky": "^9.1.7"
}
}