From 74d71a54b2700978d66c09a3a8c6b28c72a253fd Mon Sep 17 00:00:00 2001 From: Mustapha Hadid Date: Fri, 10 Jan 2025 17:25:58 +0700 Subject: [PATCH] Track usage of captcha on register setting in Mixpanel [MAILPOET-6326] --- mailpoet/lib/Analytics/Reporter.php | 6 ++++-- mailpoet/lib/Captcha/CaptchaConstants.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mailpoet/lib/Analytics/Reporter.php b/mailpoet/lib/Analytics/Reporter.php index 14ac1e94f5..6661903a10 100644 --- a/mailpoet/lib/Analytics/Reporter.php +++ b/mailpoet/lib/Analytics/Reporter.php @@ -161,11 +161,10 @@ class Reporter { 'WP_MAX_MEMORY_LIMIT' => WP_MAX_MEMORY_LIMIT, 'PHP memory_limit' => ini_get('memory_limit'), 'PHP max_execution_time' => ini_get('max_execution_time'), - 'users_can_register' => $this->wp->getOption('users_can_register') ? 'yes' : 'no', 'MailPoet Free version' => MAILPOET_VERSION, 'MailPoet Premium version' => (defined('MAILPOET_PREMIUM_VERSION')) ? MAILPOET_PREMIUM_VERSION : 'N/A', 'Total number of subscribers' => $this->subscribersFeature->getSubscribersCount(), - 'Sending Method' => isset($mta['method']) ? $mta['method'] : null, + 'Sending Method' => $mta['method'] ?? null, "Send all site's emails with" => $this->settings->get('send_transactional_emails') ? 'current sending method' : 'default WordPress sending method', 'Date of plugin installation' => $this->settings->get('installed_at'), 'Subscribe in comments' => (boolean)$this->settings->get('subscribe.on_comment.enabled', false), @@ -191,6 +190,9 @@ class Reporter { 'Site is using block theme' => $this->wp->wpIsBlockTheme(), 'Stop sending to inactive subscribers' => $inactiveSubscribersStatus, 'CAPTCHA setting' => $this->settings->get(CaptchaConstants::TYPE_SETTING_NAME, '') ?: 'disabled', + 'Is CAPTCHA on register forms enabled' => $this->settings->get(CaptchaConstants::ON_REGISTER_FORMS_SETTING_NAME, false) ? 'yes' : 'no', + 'users_can_register' => $this->wp->getOption('users_can_register') ? 'yes' : 'no', + 'Is WooCommerce account creation on "My account" enabled' => $this->wp->getOption('woocommerce_enable_myaccount_registration') ?? 'no', 'Plugin > MailPoet Premium' => $this->wp->isPluginActive('mailpoet-premium/mailpoet-premium.php'), 'Plugin > bounce add-on' => $this->wp->isPluginActive('mailpoet-bounce-handler/mailpoet-bounce-handler.php'), 'Plugin > Bloom' => $this->wp->isPluginActive('bloom-for-publishers/bloom.php'), diff --git a/mailpoet/lib/Captcha/CaptchaConstants.php b/mailpoet/lib/Captcha/CaptchaConstants.php index 096010a697..8cd9680436 100644 --- a/mailpoet/lib/Captcha/CaptchaConstants.php +++ b/mailpoet/lib/Captcha/CaptchaConstants.php @@ -8,6 +8,7 @@ class CaptchaConstants { const TYPE_RECAPTCHA_INVISIBLE = 'recaptcha-invisible'; const TYPE_DISABLED = null; const TYPE_SETTING_NAME = 'captcha.type'; + const ON_REGISTER_FORMS_SETTING_NAME = 'captcha.on_register_forms.enabled'; public static function isReCaptcha(?string $captchaType) { return in_array($captchaType, [self::TYPE_RECAPTCHA, self::TYPE_RECAPTCHA_INVISIBLE]);