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,81 @@
<?php declare(strict_types=1);
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log\Formatters;
use KadenceWP\KadenceBlocks\Monolog\Formatter\LineFormatter;
use KadenceWP\KadenceBlocks\Psr\Log\LogLevel;
class ColoredLineFormatter extends LineFormatter
{
public const MODE_COLOR_LEVEL_ALL = -1;
public const MODE_COLOR_LEVEL_FIRST = 1;
private const RESET = "\033[0m";
/**
* Color scheme - use ANSI colour sequences
*
* @var array<string, string>
*/
private array $colorScheme = [
LogLevel::DEBUG => "\033[0;37m",
LogLevel::INFO => "\033[1;32m",
LogLevel::NOTICE => "\033[1;34m",
LogLevel::WARNING => "\033[1;33m",
LogLevel::ERROR => "\033[0;33m",
LogLevel::CRITICAL => "\033[1;31m",
LogLevel::ALERT => "\033[0;31m",
LogLevel::EMERGENCY => "\033[1;35m",
];
/**
* ColoredLineFormatter constructor.
*
* @param string|null $format The format of the message
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
* @param array<string>|null $colorScheme @see ColoredLineFormatter::$colorScheme
* @param int $colorMode Whether we want to replace all '%level_name%' occurrences or only the first.
* Only useful if no %color_start%/%color_end% specified in $format
*/
public function __construct(
?string $format = '[%datetime%] %level_name%: %message% %context% %extra%' . PHP_EOL,
?string $dateFormat = null,
bool $allowInlineLineBreaks = false,
bool $ignoreEmptyContextAndExtra = true,
?array $colorScheme = null,
int $colorMode = self::MODE_COLOR_LEVEL_ALL
) {
parent::__construct($format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra);
if (strpos($this->format, '%color_start%') === false && strpos($this->format, '%color_end%') === false) {
$updatedFormat = preg_replace(
'/%level_name%/',
'%color_start%%level_name%%color_end%',
$this->format,
$colorMode
);
if (! is_null($updatedFormat)) {
$this->format = $updatedFormat;
}
}
if (! is_null($colorScheme)) {
$this->colorScheme = $colorScheme;
}
}
/**
* Formats a log record, with color.
*
* @param mixed[] $record A log record to format.
*
* @return string The formatted and colored record
*/
public function format(array $record): string {
$formatted = parent::format($record);
$formatted = str_replace('%color_start%', $this->colorScheme[\KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log\LogLevel::toPsrLogLevel($record['level'])], $formatted);
return str_replace('%color_end%', self::RESET, $formatted);
}
}

View File

@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log\Handlers;
use KadenceWP\KadenceBlocks\Monolog\Handler\AbstractHandler;
/**
* Black hole.
*
* Any record it can handle will be thrown away.
*/
final class NullHandler extends AbstractHandler
{
public function handle(array $record): bool {
return $record['level'] >= $this->level;
}
}

View File

@@ -0,0 +1,141 @@
<?php declare(strict_types=1);
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log;
use UnhandledMatchError;
/**
* A wrapper implementation for getting Monolog
* levels.
*/
final class LogLevel
{
/**
* Detailed debug information
*/
public const DEBUG = 100;
/**
* Interesting events
*
* Examples: User logs in, SQL logs.
*/
public const INFO = 200;
/**
* Uncommon events
*/
public const NOTICE = 250;
/**
* Exceptional occurrences that are not errors
*
* Examples: Use of deprecated APIs, poor use of an API,
* undesirable things that are not necessarily wrong.
*/
public const WARNING = 300;
/**
* Runtime errors
*/
public const ERROR = 400;
/**
* Critical conditions
*
* Example: Application component unavailable, unexpected exception.
*/
public const CRITICAL = 500;
/**
* Action must be taken immediately
*
* Example: Entire website down, database unavailable, etc.
* This should trigger the SMS alerts and wake you up.
*/
public const ALERT = 550;
/**
* Urgent alert.
*/
public const EMERGENCY = 600;
/**
* Get a Monolog log level code from a name.
*
* @param string $level The log level.
*
* @throws UnhandledMatchError
*
* @return int The Monolog level code.
*/
public static function fromName(string $level): int {
switch ($level) {
default:
throw new UnhandledMatchError($level);
case 'debug':
case 'Debug':
case 'DEBUG':
return self::DEBUG;
case 'info':
case 'Info':
case 'INFO':
return self::INFO;
case 'notice':
case 'Notice':
case 'NOTICE':
return self::NOTICE;
case 'warning':
case 'Warning':
case 'WARNING':
return self::WARNING;
case 'error':
case 'Error':
case 'ERROR':
return self::ERROR;
case 'critical':
case 'Critical':
case 'CRITICAL':
return self::CRITICAL;
case 'alert':
case 'Alert':
case 'ALERT':
return self::ALERT;
case 'emergency':
case 'Emergency':
case 'EMERGENCY':
return self::EMERGENCY;
}
}
/**
* Returns the PSR-3 level matching the Monolog level code.
*
*
* @throws UnhandledMatchError
*
* @phpstan-return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::*
*/
public static function toPsrLogLevel(int $level): string {
switch ($level) {
default:
throw new UnhandledMatchError((string) $level);
case self::DEBUG:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::DEBUG;
case self::INFO:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::INFO;
case self::NOTICE:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::NOTICE;
case self::WARNING:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::WARNING;
case self::ERROR:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::ERROR;
case self::CRITICAL:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::CRITICAL;
case self::ALERT:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::ALERT;
case self::EMERGENCY:
return \KadenceWP\KadenceBlocks\Psr\Log\LogLevel::EMERGENCY;
}
}
}

View File

@@ -0,0 +1,110 @@
<?php declare(strict_types=1);
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log;
use KadenceWP\KadenceBlocks\lucatume\DI52\Container;
use KadenceWP\KadenceBlocks\Monolog\Formatter\LineFormatter;
use KadenceWP\KadenceBlocks\Monolog\Handler\ErrorLogHandler;
use KadenceWP\KadenceBlocks\Monolog\Handler\StreamHandler;
use KadenceWP\KadenceBlocks\Monolog\Logger;
use KadenceWP\KadenceBlocks\Psr\Log\LoggerInterface;
use RuntimeException;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts\Provider;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log\Formatters\ColoredLineFormatter;
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Log\Handlers\NullHandler;
final class LogProvider extends Provider
{
public const LOG_LEVEL = 'prophecy.log.log_level';
public const CHANNELS = [
'console' => [
'class' => StreamHandler::class,
'formatter' => ColoredLineFormatter::class,
],
'errorlog' => [
'class' => ErrorLogHandler::class,
'formatter' => LineFormatter::class,
],
'stack' => [
'console',
'errorlog',
],
'null' => [
'class' => NullHandler::class,
],
];
/**
* {@inheritDoc}
*/
public function register(): void {
$this->container->singleton(self::LOG_LEVEL, LogLevel::fromName($this->config->get('log.level', 'debug')));
$this->container->when(ColoredLineFormatter::class)
->needs('$dateFormat')
->give('Y-m-d H:i:s.v e');
$channel = $this->config->get('log.channel');
$this->container->singleton(
StreamHandler::class,
fn ($c) => new StreamHandler(
$this->config->get("log.channels.$channel.with.stream", 'php://stdout'),
$c->get(self::LOG_LEVEL)
)
);
$this->container->bind(
LoggerInterface::class,
static function (Container $c) use ($channel): LoggerInterface {
$handler = self::CHANNELS[$channel] ?? false;
if (! $handler) {
throw new RuntimeException(
sprintf(
'Invalid log channel. Valid options are: %s',
implode(',', array_keys(self::CHANNELS))
)
);
}
$logger = new Logger($channel);
/**
* @var array{handler: \KadenceWP\KadenceBlocks\Monolog\Handler\AbstractProcessingHandler, formatter: string|class-string} $handlers
*/
$handlers = [];
// Single handler channel.
if (! empty($handler['class'])) {
$handlers[] = [
'handler' => $c->get($handler['class']),
'formatter' => $handler['formatter'] ?? '',
];
} else {
// We are on a stack channel, which uses multiple existing handlers.
foreach ($handler as $stackChannel) {
$handlers[] = [
'handler' => $c->get(self::CHANNELS[$stackChannel]['class']),
'formatter' => self::CHANNELS[$stackChannel]['formatter'] ?? '',
];
}
}
/** @var array{handler: \KadenceWP\KadenceBlocks\Monolog\Handler\AbstractProcessingHandler, formatter: string|class-string} $registeredHandler */
foreach ($handlers as $registeredHandler) {
if (! empty($registeredHandler['formatter'])) {
$registeredHandler['handler']->setFormatter($c->get($registeredHandler['formatter']));
}
// Set the configured log level for each handler.
$registeredHandler['handler']->setLevel($c->get(self::LOG_LEVEL));
$logger->pushHandler($registeredHandler['handler']);
}
return $logger;
}
);
}
}

View File

@@ -0,0 +1,68 @@
# Prophecy Log
> ⚠️ **This is a read-only repository!**
> For pull requests or issues, see [stellarwp/prophecy-monorepo](https://github.com/stellarwp/prophecy-monorepo).
A logging library using [Monolog](https://github.com/Seldaek/monolog) that implements the `Psr\Log\LoggerInterface` interface.
## Installation
Update your composer.json and add the following to your `repositories` object:
```json
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:stellarwp/prophecy-container.git"
},
{
"type": "vcs",
"url": "git@github.com:stellarwp/prophecy-log.git"
}
]
}
```
Then, install:
```shell
composer require stellarwp/prophecy-log
```
If using the [di52 container](https://github.com/lucatume/di52), create a `config.php` and register
it in the container with:
```php
$this->container->bind(Dot::class, new Dot(require_once dirname(__FILE__) . '/config.php'));
```
The config.php file map environment variables, either from an `.env` file or manually set, e.g.
```php
<?php declare(strict_types=1);
return [
'log' => [
'level' => $_ENV['APP_LOG_LEVEL'] ?? 'debug',
'channel' => $_ENV['APP_LOG_CHANNEL'] ?? 'null', // console, errorlog, stack (both console and errorlog) or null
'channels' => [
'errorlog' => [],
'console' => [
'with' => [
'stream' => 'php://stdout',
],
],
'stack' => [
'with' => [
'stream' => 'php://stdout',
],
],
],
],
];
```
Then, include the [LogProvider.php](./LogProvider.php) in your
application and call the `register` method. Anytime you inject a `Psr\Log\LoggerInterface` instance into another class, it will use
your provided configuration.