if ($displayErrorNotice) { $dateTime = new DateTime(); $date = $dateTime->formatDate(strtotime($premiumKey['data']['expire_at'])); $error = Helpers::replaceLinkTags( // translators: %s is a date. __("Your License Key for MailPoet is expiring! Don't forget to [link]renew your license[/link] by %s to keep enjoying automatic updates and Premium support.", 'mailpoet'), 'https://account.mailpoet.com', ['target' => '_blank'] ); $error = sprintf($error, $date); WPNotice::displayWarning($error); } return true; } elseif ($premiumKey['state'] === Bridge::KEY_VALID) { return true; } return false; } public function isBundledSubscription(): bool { $subscriptionType = $this->settings->get(Bridge::SUBSCRIPTION_TYPE_SETTING_NAME); return $subscriptionType === Bridge::WPCOM_BUNDLE_SUBSCRIPTION_TYPE; } public function isMailPoetAPIKeyPendingApproval(): bool { $mssActive = Bridge::isMPSendingServiceEnabled(); $mssKeyValid = $this->isMailPoetAPIKeyValid(); $isApproved = $this->settings->get('mta.mailpoet_api_key_state.data.is_approved'); $mssKeyPendingApproval = $isApproved === false || $isApproved === 'false'; // API unfortunately saves this as a string return $mssActive && $mssKeyValid && $mssKeyPendingApproval; } public function isUserActivelyPaying(): bool { $isPremiumKeyValid = $this->isPremiumKeyValid(false); $mssActive = Bridge::isMPSendingServiceEnabled(); $isMssKeyValid = $this->isMailPoetAPIKeyValid(false); if (!$mssActive || ($isPremiumKeyValid && !$isMssKeyValid)) { return $this->subscribersFeature->hasPremiumSupport(); } else { return $this->subscribersFeature->hasMssPremiumSupport(); } } /** * Return a key when it can be used for account administration purposes (stats report, auth. addresses or domains administration) * Key can be used when it is valid for MSS or Premium, but also when it is valid but has no privileges for MSS or Premium (API returns 403). */ public function getValidAccountKey(): ?string { if ($this->isMailPoetAPIKeyValid(false, true)) { return $this->settings->get(Bridge::API_KEY_SETTING_NAME); } $mssKeyState = $this->settings->get(Bridge::API_KEY_STATE_SETTING_NAME); if (($mssKeyState['state'] ?? null) === Bridge::KEY_VALID_UNDERPRIVILEGED) { return $this->settings->get(Bridge::API_KEY_SETTING_NAME); } if ($this->isPremiumKeyValid(false)) { return $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME); } $premiumKeyState = $this->settings->get(Bridge::PREMIUM_KEY_STATE_SETTING_NAME); if (($premiumKeyState['state'] ?? null) === Bridge::KEY_VALID_UNDERPRIVILEGED) { return $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME); } return null; } public function generatePartialApiKey(): string { $key = (string)($this->getValidAccountKey()); if ($key) { $halfKeyLength = (int)(strlen($key) / 2); return substr($key, 0, $halfKeyLength); } return ''; } }
Fatal error: Uncaught Error: Class "MailPoet\Config\ServicesChecker" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:3387 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4374): MailPoetGenerated\FreeCachedContainer->getRenderer5Service() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4384): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailCustomizerService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4474): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailMailerService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4634): MailPoetGenerated\FreeCachedContainer->getSubscriberActionsService() #4 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2248): MailPoetGenerated\FreeCachedContainer->getCommentService() #5 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2276): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #6 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #7 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #8 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #9 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #10 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(206): require_once('/htdocs/wp-cont...') #11 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #12 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #13 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #14 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #15 /htdocs/index.php(17): require('/htdocs/wp-blog...') #16 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 3387