diff --git a/Admin/Infrastructure/Ui/AdminDashboardRenderer.php b/Admin/Infrastructure/Ui/AdminDashboardRenderer.php index cb05ddc8..2c8c4f37 100644 --- a/Admin/Infrastructure/Ui/AdminDashboardRenderer.php +++ b/Admin/Infrastructure/Ui/AdminDashboardRenderer.php @@ -128,6 +128,11 @@ final class AdminDashboardRenderer implements DashboardRendererInterface 'label' => 'AdSense', 'icon' => 'bi-megaphone', ], + 'recaptcha-settings' => [ + 'id' => 'recaptcha-settings', + 'label' => 'reCAPTCHA', + 'icon' => 'bi-shield-check', + ], 'custom-css-manager' => [ 'id' => 'custom-css-manager', 'label' => 'CSS Personalizado', diff --git a/Admin/RecaptchaSettings/Infrastructure/FieldMapping/RecaptchaSettingsFieldMapper.php b/Admin/RecaptchaSettings/Infrastructure/FieldMapping/RecaptchaSettingsFieldMapper.php new file mode 100644 index 00000000..78970a98 --- /dev/null +++ b/Admin/RecaptchaSettings/Infrastructure/FieldMapping/RecaptchaSettingsFieldMapper.php @@ -0,0 +1,42 @@ + ['group' => 'visibility', 'attribute' => 'is_enabled'], + + // Credentials + 'recaptchaSiteKey' => ['group' => 'credentials', 'attribute' => 'site_key'], + 'recaptchaSecretKey' => ['group' => 'credentials', 'attribute' => 'secret_key'], + + // Behavior + 'recaptchaScoreThreshold' => ['group' => 'behavior', 'attribute' => 'score_threshold'], + 'recaptchaActionNewsletter' => ['group' => 'behavior', 'attribute' => 'action_newsletter'], + 'recaptchaActionContact' => ['group' => 'behavior', 'attribute' => 'action_contact'], + 'recaptchaFailOpen' => ['group' => 'behavior', 'attribute' => 'fail_open'], + 'recaptchaLogBlocked' => ['group' => 'behavior', 'attribute' => 'log_blocked'], + ]; + } +} diff --git a/Admin/RecaptchaSettings/Infrastructure/Ui/RecaptchaSettingsFormBuilder.php b/Admin/RecaptchaSettings/Infrastructure/Ui/RecaptchaSettingsFormBuilder.php new file mode 100644 index 00000000..0e93e764 --- /dev/null +++ b/Admin/RecaptchaSettings/Infrastructure/Ui/RecaptchaSettingsFormBuilder.php @@ -0,0 +1,314 @@ +buildHeader($componentId); + $html .= $this->buildVisibilityGroup($componentId); + $html .= $this->buildCredentialsGroup($componentId); + $html .= $this->buildBehaviorGroup($componentId); + $html .= $this->buildHelpSection(); + + return $html; + } + + private function buildHeader(string $componentId): string + { + $html = '
wp-content/debug.log