diff --git a/mailpoet/assets/js/src/settings/pages/advanced/advanced.tsx b/mailpoet/assets/js/src/settings/pages/advanced/advanced.tsx
index 7392100017..a0439c9b8f 100644
--- a/mailpoet/assets/js/src/settings/pages/advanced/advanced.tsx
+++ b/mailpoet/assets/js/src/settings/pages/advanced/advanced.tsx
@@ -12,6 +12,7 @@ import { Reinstall } from './reinstall';
import { RecalculateSubscriberScore } from './recalculate-subscriber-score';
import { Logging } from './logging';
import { BounceAddress } from './bounce-address';
+import { CaptchaOnSignup } from './captcha-on-signup';
export function Advanced() {
return (
@@ -27,6 +28,7 @@ export function Advanced() {
+
diff --git a/mailpoet/assets/js/src/settings/pages/advanced/captcha-on-signup.tsx b/mailpoet/assets/js/src/settings/pages/advanced/captcha-on-signup.tsx
new file mode 100644
index 0000000000..510c05a3ef
--- /dev/null
+++ b/mailpoet/assets/js/src/settings/pages/advanced/captcha-on-signup.tsx
@@ -0,0 +1,44 @@
+import { t } from 'common/functions';
+import { Radio } from 'common/form/radio/radio';
+import { useSelector, useSetting } from 'settings/store/hooks';
+import { Inputs, Label } from 'settings/components';
+
+export function CaptchaOnSignup() {
+ const [enabled, setEnabled] = useSetting(
+ 'captcha',
+ 'on_register_forms',
+ 'enabled',
+ );
+ const hasWooCommerce = useSelector('hasWooCommerce')();
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/mailpoet/assets/js/src/settings/store/normalize-settings.ts b/mailpoet/assets/js/src/settings/store/normalize-settings.ts
index 122356a0eb..b9d32c9640 100644
--- a/mailpoet/assets/js/src/settings/store/normalize-settings.ts
+++ b/mailpoet/assets/js/src/settings/store/normalize-settings.ts
@@ -50,6 +50,7 @@ function asObject(schema: T) {
function asIs(value: T): T {
return value;
}
+
export function normalizeSettings(data: Record): Settings {
const text = asString('');
const disabledCheckbox = asBoolean('1', '0', '0');
@@ -135,6 +136,9 @@ export function normalizeSettings(data: Record): Settings {
recaptcha_secret_token: text,
recaptcha_invisible_site_token: text,
recaptcha_invisible_secret_token: text,
+ on_register_forms: asObject({
+ enabled: disabledRadio,
+ }),
}),
logging: asEnum(['everything', 'errors', 'nothing'], 'errors'),
mta_group: asEnum(['mailpoet', 'website', 'smtp'], 'website'),
diff --git a/mailpoet/assets/js/src/settings/store/types.ts b/mailpoet/assets/js/src/settings/store/types.ts
index d098d06074..41f6fe13f1 100644
--- a/mailpoet/assets/js/src/settings/store/types.ts
+++ b/mailpoet/assets/js/src/settings/store/types.ts
@@ -65,6 +65,9 @@ export type Settings = {
recaptcha_secret_token: string;
recaptcha_invisible_site_token: string;
recaptcha_invisible_secret_token: string;
+ on_register_forms: {
+ enabled: '' | '1';
+ };
};
logging: 'everything' | 'errors' | 'nothing';
mta_group: 'mailpoet' | 'website' | 'smtp';
diff --git a/mailpoet/views/settings_translations.html b/mailpoet/views/settings_translations.html
index 49956441ff..667a246c9f 100644
--- a/mailpoet/views/settings_translations.html
+++ b/mailpoet/views/settings_translations.html
@@ -109,7 +109,7 @@
'libs3rdPartyDescription': __('E.g. Google Fonts in the Form and Email editor and DocsBot to get help. When disabled, you can still reach support at [link]www.mailpoet.com/support/[/link].'),
'shareDataTitle': __('Share anonymous data'),
'shareDataDescription': __('Share anonymous data and help us improve the plugin. We appreciate your help!'),
- 'captchaTitle': __('Protect your forms against spam signups'),
+ 'captchaTitle': __('Protect your MailPoet forms against spam signups'),
'captchaDescription': __('Built-in CAPTCHA protects your subscription forms against bots. Alternatively, use reCAPTCHA by Google.'),
'reCaptchaDescription': __('Please use the same reCAPTCHA type as in Google reCAPTCHA Settings.'),
'signupForCaptchaKey': __('Sign up for an API key pair here.'),
@@ -120,6 +120,9 @@
'yourReCaptchaKey': __('Your reCAPTCHA Site Key'),
'yourReCaptchaSecret': __('Your reCAPTCHA Secret Key'),
'fillReCaptchaKeys': __('Please fill the reCAPTCHA keys.'),
+ 'captchaOnRegisterTitle': __('Protect registration forms'),
+ 'captchaOnRegisterWooInactiveDescription': __('Protect WordPress registration pages with a CAPTCHA.'),
+ 'captchaOnRegisterWooActiveDescription': __('Protect WordPress and WooCommerce registration pages with a CAPTCHA.'),
'disable': __('Disable'),
'recalculateSubscribersScoreTitle': __('Recalculate Subscriber Scores'),
'recalculateSubscribersScoreDescription': __('MailPoet will recalculate subscriber engagement scores for all subscribers. This may take some time to complete.'),