feat: initial ACRIB WordPress deployment

- WordPress 6.9.4 (es_ES) with Kadence theme
- Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto
- Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold
- Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI)
- Plugins: Kadence Blocks, Polylang, Contact Form 7
- Custom CSS with full brand styling and responsive layout
- HTTPS enforced via wp-config.php proxy detection
This commit is contained in:
Malin
2026-05-19 19:25:59 +02:00
commit f3ff7b7186
6119 changed files with 1984255 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php declare( strict_types=1 );
namespace KadenceWP\KadenceBlocks\Cache;
/**
* Caches AI Related files.
*/
final class Ai_Cache extends Block_Library_Cache {
/**
* Create a hashed file name from provided identifier.
*
* @param mixed $identifier Unique data to identify this file.
*
* @return string
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
protected function filename( $identifier ): string {
return $this->hasher->hash( [
'kadence-ai-generated-content',
$identifier,
] ) . $this->ext;
}
}

View File

@@ -0,0 +1,184 @@
<?php declare( strict_types=1 );
namespace KadenceWP\KadenceBlocks\Cache;
use InvalidArgumentException;
use KadenceWP\KadenceBlocks\Hasher;
use KadenceWP\KadenceBlocks\Psr\Log\LoggerInterface;
use KadenceWP\KadenceBlocks\Shutdown\Contracts\Terminable;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Storage\Contracts\Storage;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Storage\Exceptions\StorageException;
/**
* Caches Block Library files.
*/
class Block_Library_Cache implements Terminable {
/**
* @var Storage
*/
protected $storage;
/**
* @var Hasher
*/
protected $hasher;
/**
* @var Config
*/
protected $config;
/**
* @var LoggerInterface
*/
protected $logger;
/**
* The filename extension for all files.
*
* @var string
*/
protected $ext;
/**
* The data to be cached on shutdown, indexed by a filename.
*
* @var array<string, mixed>
*/
protected $items;
/**
* @param Storage $storage The file storage library.
* @param Hasher $hasher The hashing library.
* @param Config $config The cache configuration.
* @param LoggerInterface $logger The logger, enabled if WP_DEBUG is set to true.
* @param string $ext The file extension all files will be saved with.
*
* @throws InvalidArgumentException
*/
public function __construct(
Storage $storage,
Hasher $hasher,
Config $config,
LoggerInterface $logger,
string $ext = '.json'
) {
$this->storage = $storage;
$this->hasher = $hasher;
$this->config = $config;
$this->logger = $logger;
$this->ext = $ext;
if ( ! str_starts_with( $ext, '.' ) || str_starts_with( $ext, '..' ) ) {
throw new InvalidArgumentException( 'The $ext must start with a single period' );
}
}
/**
* Prime data to be cached when the WordPress shutdown action occurs.
*
* @param mixed $identifier Unique data to identify this file.
* @param mixed $data The data to store.
*
* @return void
* @throws InvalidArgumentException
* @throws \RuntimeException
*/
public function cache( $identifier, $data ): void {
$identifier = $this->filename( $identifier );
$this->items[ $identifier ] = $data;
}
/**
* Write cache file on shutdown.
*
* @action shutdown
*
* @return void
*/
public function terminate(): void {
$this->write();
}
/**
* Writes the data to the file system cache on WordPress's shutdown action.
*
* @action shutdown
*
* @return void
*/
private function write(): void {
if ( ! isset( $this->items ) ) {
return;
}
foreach ( $this->items as $filename => $data ) {
if ( $this->storage->has( $filename ) ) {
$this->logger->debug( 'Filename already exists, deleting file...', [
'filename' => $filename,
] );
try {
$this->storage->delete( $filename );
} catch ( StorageException $e ) {
$this->logger->error( 'Error deleting existing cache file', [
'filename' => $filename,
'exception' => $e->getMessage(),
] );
}
}
try {
$this->logger->debug( sprintf( 'Writing cache file: %s', $filename ) );
$this->storage->put( $filename, $data );
} catch ( StorageException $e ) {
$this->logger->error( 'Error saving cache file', [
'filename' => $filename,
'exception' => $e->getMessage(),
] );
}
}
unset( $this->items );
}
/**
* Get a file from the cache.
*
* @param mixed $identifier Unique data to identify this file.
*
* @return string The file contents.
* @throws InvalidArgumentException
* @throws \KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Storage\Exceptions\NotFoundException
* @throws \RuntimeException
*/
public function get( $identifier ): string {
$identifier = $this->filename( $identifier );
$content = $this->storage->get( $identifier );
$this->logger->debug( sprintf( 'Found cache file: %s', $identifier ) );
return $content;
}
/**
* Create a hashed file name from provided identifier.
*
* @param mixed $identifier Unique data to identify this file.
*
* @return string
* @throws InvalidArgumentException
* @throws \RuntimeException
*/
protected function filename( $identifier ): string {
return $this->hasher->hash( [
$this->config->base_url(),
$this->config->base_path(),
$identifier,
] ) . $this->ext;
}
}

View File

@@ -0,0 +1,47 @@
<?php declare( strict_types=1 );
namespace KadenceWP\KadenceBlocks\Cache;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Storage\Contracts\Storage;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Storage\Drivers\LocalStorage;
use KadenceWP\KadenceBlocks\Symfony\Component\Filesystem\Filesystem;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts\Provider;
final class Cache_Provider extends Provider {
/**
* @inheritDoc
*/
public function register(): void {
$base_path = apply_filters( 'kadence_block_library_local_data_base_path', trailingslashit( wp_get_upload_dir()['basedir'] ) );
$base_url = apply_filters( 'kadence_block_library_local_data_base_url', content_url() );
$this->container->singleton( Config::class, new Config( $base_path, $base_url ) );
$this->register_block_library_storage();
$this->register_ai_storage();
}
private function register_block_library_storage(): void {
$library_subfolder = apply_filters( 'kadence_block_library_local_data_subfolder_name', 'kadence_blocks_library' );
$path = $this->container->get( Config::class )->base_path() . $library_subfolder;
$this->container->when( Block_Library_Cache::class )
->needs( Storage::class )
->give( new LocalStorage( $this->container->get( Filesystem::class ), $path ) );
$this->container->singleton( Block_Library_Cache::class, Block_Library_Cache::class );
}
private function register_ai_storage(): void {
$ai_subfolder = apply_filters( 'kadence_block_ai_local_data_subfolder_name', 'kadence_ai' );
$path = $this->container->get( Config::class )->base_path() . $ai_subfolder;
$this->container->when( Ai_Cache::class )
->needs( Storage::class )
->give( new LocalStorage( $this->container->get( Filesystem::class ), $path ) );
$this->container->singleton( Ai_Cache::class, Ai_Cache::class );
}
}

View File

@@ -0,0 +1,40 @@
<?php declare( strict_types=1 );
namespace KadenceWP\KadenceBlocks\Cache;
/**
* Cache configuration.
*/
final class Config {
/**
* The base server path to the uploads folder.
*
* @var string
*/
private $base_path;
/**
* The base URL to the uploads folder.
*
* @var string
*/
private $base_url;
public function __construct(
string $base_path,
string $base_url
) {
$this->base_path = $base_path;
$this->base_url = $base_url;
}
public function base_path(): string {
return $this->base_path;
}
public function base_url(): string {
return $this->base_url;
}
}