Files
roi-theme/search.php
FrankZamora de5fff4f5c Fase 1: Estructura Base y DI Container - Clean Architecture
COMPLETADO: Fase 1 de la migración a Clean Architecture + POO

## Estructura de Carpetas
- ✓ Estructura completa de 4 capas (Domain, Application, Infrastructure, Presentation)
- ✓ Carpetas de Use Cases (SaveComponent, GetComponent, DeleteComponent, SyncSchema)
- ✓ Estructura de tests (Unit, Integration, E2E)
- ✓ Carpetas de schemas y templates

## Composer y Autoloading
- ✓ PSR-4 autoloading configurado para ROITheme namespace
- ✓ Autoloader optimizado regenerado

## DI Container
- ✓ DIContainer implementado con patrón Singleton
- ✓ Métodos set(), get(), has() para gestión de servicios
- ✓ Getters específicos para ComponentRepository, ValidationService, CacheService
- ✓ Placeholders que serán implementados en Fase 5
- ✓ Prevención de clonación y deserialización

## Interfaces
- ✓ ComponentRepositoryInterface (Domain)
- ✓ ValidationServiceInterface (Application)
- ✓ CacheServiceInterface (Application)
- ✓ Component entity placeholder (Domain)

## Bootstrap
- ✓ functions.php actualizado con carga de Composer autoloader
- ✓ Inicialización del DIContainer
- ✓ Helper function roi_container() disponible globalmente

## Tests
- ✓ 10 tests unitarios para DIContainer (100% cobertura)
- ✓ Total: 13 tests unitarios, 28 assertions
- ✓ Suite de tests pasando correctamente

## Validación
- ✓ Script de validación automatizado (48/48 checks pasados)
- ✓ 100% de validaciones exitosas

La arquitectura base está lista para la Fase 2.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:48:24 -06:00

129 lines
3.4 KiB
PHP

<?php
/**
* The template for displaying search results pages
*
* IMPORTANT: This theme has search functionality disabled.
* All search attempts will be redirected to 404.
* This template serves as a fallback and will display a 404 error.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package ROI_Theme
* @since 1.0.0
*/
// Force 404 status
status_header( 404 );
nocache_headers();
get_header();
?>
<main id="main-content" class="site-main" role="main">
<div class="content-wrapper">
<section class="error-404 not-found search-disabled" aria-labelledby="search-error-title">
<!-- Error Header -->
<header class="page-header">
<h1 id="search-error-title" class="page-title">
<?php esc_html_e( 'Search Unavailable', 'roi-theme' ); ?>
</h1>
</header><!-- .page-header -->
<!-- Error Content -->
<div class="page-content">
<p class="error-message">
<?php esc_html_e( 'The search functionality is currently disabled on this website.', 'roi-theme' ); ?>
</p>
<!-- Helpful Actions -->
<div class="error-actions">
<h2><?php esc_html_e( 'How to find content:', 'roi-theme' ); ?></h2>
<ul class="error-suggestions">
<li>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php esc_html_e( 'Go to the homepage', 'roi-theme' ); ?>
</a>
</li>
<li>
<?php esc_html_e( 'Use the navigation menu above', 'roi-theme' ); ?>
</li>
<li>
<?php esc_html_e( 'Browse by category below', 'roi-theme' ); ?>
</li>
</ul>
<!-- Categories -->
<?php
$categories = get_categories(
array(
'orderby' => 'count',
'order' => 'DESC',
'number' => 10,
'hide_empty' => true,
)
);
if ( ! empty( $categories ) ) :
?>
<div class="categories-section">
<h3><?php esc_html_e( 'Browse by Category', 'roi-theme' ); ?></h3>
<ul class="categories-list" role="list">
<?php foreach ( $categories as $category ) : ?>
<li>
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>">
<?php echo esc_html( $category->name ); ?>
<span class="category-count">(<?php echo esc_html( $category->count ); ?>)</span>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<!-- Recent Posts -->
<?php
$recent_posts = wp_get_recent_posts(
array(
'numberposts' => 10,
'post_status' => 'publish',
)
);
if ( ! empty( $recent_posts ) ) :
?>
<div class="recent-posts-section">
<h3><?php esc_html_e( 'Recent Posts', 'roi-theme' ); ?></h3>
<ul class="recent-posts-list" role="list">
<?php foreach ( $recent_posts as $recent ) : ?>
<li>
<a href="<?php echo esc_url( get_permalink( $recent['ID'] ) ); ?>">
<?php echo esc_html( $recent['post_title'] ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php
wp_reset_postdata();
endif;
?>
</div><!-- .error-actions -->
</div><!-- .page-content -->
</section><!-- .error-404 -->
</div><!-- .content-wrapper -->
</main><!-- #main-content -->
<?php
get_footer();