ListLevelCountsOfUnsubscribedAfter($thirtyDaysAgo); $result['subscribedCount'] = $this->subscribersRepository->getCountOfLastSubscribedAfter($thirtyDaysAgo); $result['unsubscribedCount'] = $this->subscribersRepository->getCountOfUnsubscribedAfter($thirtyDaysAgo); $result['subscribedSubscribersCount'] = $this->subscribersRepository->getCountOfSubscribersForStates([SubscriberEntity::STATUS_SUBSCRIBED]); $this->setCacheItem( TransientCache::SUBSCRIBERS_HOMEPAGE_STATISTICS_COUNT_KEY, $result, 0 ); return $result; } public function removeRedundancyFromStatisticsCache() { $segments = $this->segmentsRepository->findAll(); $segmentIds = array_map(function (SegmentEntity $segment): int { return (int)$segment->getId(); }, $segments); foreach ($this->transientCache->getItems(TransientCache::SUBSCRIBERS_STATISTICS_COUNT_KEY) as $id => $item) { if (!in_array($id, $segmentIds)) { $this->transientCache->invalidateItem(TransientCache::SUBSCRIBERS_STATISTICS_COUNT_KEY, $id); } } } /** * Use cache only if subscribers count is above minimum */ private function getCacheItem(string $key, int $id): ?array { if ($this->subscribersFeature->isSubscribersCountEnoughForCache()) { return $this->transientCache->getItem($key, $id); } return []; } private function setCacheItem(string $key, array $item, int $id): void { if ($this->subscribersFeature->isSubscribersCountEnoughForCache()) { $this->transientCache->setItem($key, $item, $id); } } /** * @return array */ public function getTagsStatisticsCount(?string $status, bool $isDeleted): array { return $this->tagRepository->getSubscriberStatisticsCount($status, $isDeleted); } }
Fatal error: Uncaught Error: Class "MailPoet\Subscribers\SubscribersCountsController" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:5288 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(926): MailPoetGenerated\FreeCachedContainer->getSubscribersCountsControllerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5592): MailPoetGenerated\FreeCachedContainer->getSettingsService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getDotcomLicenseProvisionerService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #5 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #6 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #8 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #9 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #10 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 5288