- 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
74 lines
2.0 KiB
PHP
74 lines
2.0 KiB
PHP
<?php declare( strict_types=1 );
|
|
|
|
namespace KadenceWP\KadenceBlocks\Optimizer\Response;
|
|
|
|
/**
|
|
* Data Transfer Object representing a page section or element with layout information.
|
|
*
|
|
* Contains section metadata including dimensions, DOM path, fold position,
|
|
* and content flags for images and background elements.
|
|
*/
|
|
final class Section {
|
|
|
|
public string $id;
|
|
public float $height;
|
|
public string $tagName;
|
|
public string $className;
|
|
public string $path;
|
|
public bool $isAboveFold;
|
|
public bool $hasImages;
|
|
public bool $hasBackground;
|
|
|
|
private function __construct(
|
|
string $id,
|
|
float $height,
|
|
string $tagName,
|
|
string $className,
|
|
string $path,
|
|
bool $isAboveFold,
|
|
bool $hasImages,
|
|
bool $hasBackground
|
|
) {
|
|
$this->id = $id;
|
|
$this->height = $height;
|
|
$this->tagName = $tagName;
|
|
$this->className = $className;
|
|
$this->path = $path;
|
|
$this->isAboveFold = $isAboveFold;
|
|
$this->hasImages = $hasImages;
|
|
$this->hasBackground = $hasBackground;
|
|
}
|
|
|
|
/**
|
|
* @param array{id: string, height: float, tagName: string, className: string, path: string, isAboveFold: bool, hasImages: bool, hasBackground: bool} $attributes
|
|
*/
|
|
public static function from( array $attributes ): self {
|
|
return new self(
|
|
$attributes['id'],
|
|
$attributes['height'],
|
|
$attributes['tagName'],
|
|
$attributes['className'],
|
|
$attributes['path'],
|
|
$attributes['isAboveFold'],
|
|
$attributes['hasImages'],
|
|
$attributes['hasBackground']
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @return array{id: string, height: float, tagName: string, className: string, path: string, isAboveFold: bool, hasImages: bool, hasBackground: bool}
|
|
*/
|
|
public function toArray(): array {
|
|
return [
|
|
'id' => $this->id,
|
|
'height' => $this->height,
|
|
'tagName' => $this->tagName,
|
|
'className' => $this->className,
|
|
'path' => $this->path,
|
|
'isAboveFold' => $this->isAboveFold,
|
|
'hasImages' => $this->hasImages,
|
|
'hasBackground' => $this->hasBackground,
|
|
];
|
|
}
|
|
}
|