Warning: Class "Automattic\WooCommerce\StoreApi\Routes\V1\ProductCategoriesById" not found in /htdocs/wp-content/plugins/woocommerce/src/StoreApi/deprecated.php on line 73
($tasksCount) { $isSimpleWorkerActive = true; break; } } return ( $this->isSendingQueueActive() || $this->isBounceActive() || $this->isSendingServiceKeyCheckActive() || $this->isPremiumKeyCheckActive() || $this->isSubscriberStatsReportActive() || $this->isBeamerCheckActive() || $isSimpleWorkerActive ); } public function stop() { $cronDaemon = $this->cronHelper->getDaemon(); if ($cronDaemon) { $this->cronHelper->deactivateDaemon($cronDaemon); } } private function isSendingQueueActive(): bool { $scheduledQueues = $this->scheduledTasksRepository->findScheduledSendingTasks(SchedulerWorker::TASK_BATCH_SIZE); $runningQueues = $this->scheduledTasksRepository->findRunningSendingTasks(SendingQueueWorker::TASK_BATCH_SIZE); $sendingLimitReached = MailerLog::isSendingLimitReached(); $sendingIsPaused = MailerLog::isSendingPaused(); $sendingWaitingForRetry = MailerLog::isSendingWaitingForRetry(); return (($scheduledQueues || $runningQueues) && !$sendingLimitReached && !$sendingIsPaused && !$sendingWaitingForRetry); } private function isBounceActive(): bool { $mpSendingEnabled = Bridge::isMPSendingServiceEnabled(); $bounceDueTasks = $this->getTasksCount([ 'type' => BounceWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_PAST], 'status' => ['null', ScheduledTaskEntity::STATUS_SCHEDULED], ]); $bounceFutureTasks = $this->getTasksCount([ 'type' => BounceWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_FUTURE], 'status' => [ScheduledTaskEntity::STATUS_SCHEDULED], ]); return ($mpSendingEnabled && ($bounceDueTasks || !$bounceFutureTasks)); } private function isSendingServiceKeyCheckActive(): bool { $mpSendingEnabled = Bridge::isMPSendingServiceEnabled(); $msskeycheckDueTasks = $this->getTasksCount([ 'type' => SendingServiceKeyCheckWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_PAST], 'status' => ['null', ScheduledTaskEntity::STATUS_SCHEDULED], ]); $msskeycheckFutureTasks = $this->getTasksCount([ 'type' => SendingServiceKeyCheckWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_FUTURE], 'status' => [ScheduledTaskEntity::STATUS_SCHEDULED], ]); return ($mpSendingEnabled && ($msskeycheckDueTasks || !$msskeycheckFutureTasks)); } private function isPremiumKeyCheckActive(): bool { $premiumKeySpecified = Bridge::isPremiumKeySpecified(); $premiumKeycheckDueTasks = $this->getTasksCount([ 'type' => PremiumKeyCheckWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_PAST], 'status' => ['null', ScheduledTaskEntity::STATUS_SCHEDULED], ]); $premiumKeycheckFutureTasks = $this->getTasksCount([ 'type' => PremiumKeyCheckWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_FUTURE], 'status' => [ScheduledTaskEntity::STATUS_SCHEDULED], ]); return ($premiumKeySpecified && ($premiumKeycheckDueTasks || !$premiumKeycheckFutureTasks)); } private function isSubscriberStatsReportActive(): bool { $validAccountKey = $this->serviceChecker->getValidAccountKey(); $statsReportDueTasks = $this->getTasksCount([ 'type' => SubscribersStatsReport::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_PAST], 'status' => ['null', ScheduledTaskEntity::STATUS_SCHEDULED], ]); $statsReportFutureTasks = $this->getTasksCount([ 'type' => SubscribersStatsReport::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_FUTURE], 'status' => [ScheduledTaskEntity::STATUS_SCHEDULED], ]); return ($validAccountKey && ($statsReportDueTasks || !$statsReportFutureTasks)); } private function isBeamerCheckActive(): bool { $beamerDueChecks = $this->getTasksCount([ 'type' => BeamerWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_PAST], 'status' => ['null', ScheduledTaskEntity::STATUS_SCHEDULED], ]); $beamerFutureChecks = $this->getTasksCount([ 'type' => BeamerWorker::TASK_TYPE, 'scheduled_in' => [self::SCHEDULED_IN_THE_FUTURE], 'status' => [ScheduledTaskEntity::STATUS_SCHEDULED], ]); return $beamerDueChecks || !$beamerFutureChecks; } private function loadTasksCounts(): void { $scheduledTasksTableName = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName(); $sql = " SELECT type, status, count(*) AS count, CASE WHEN scheduled_at <= :now THEN :past ELSE :future END AS scheduled_in FROM $scheduledTasksTableName WHERE deleted_at IS NULL AND (status != :statusCompleted OR status IS NULL) GROUP BY type, status, scheduled_in"; $stmt = $this->entityManager->getConnection()->prepare($sql); $stmt->bindValue('now', date('Y-m-d H:i:s', $this->wp->currentTime('timestamp'))); $stmt->bindValue('past', self::SCHEDULED_IN_THE_PAST); $stmt->bindValue('future', self::SCHEDULED_IN_THE_FUTURE); $stmt->bindValue('statusCompleted', ScheduledTaskEntity::STATUS_COMPLETED); $rows = $stmt->executeQuery()->fetchAllAssociative(); $this->tasksCounts = []; foreach ($rows as $r) { if (empty($this->tasksCounts[$r['type']])) { $this->tasksCounts[$r['type']] = []; } if (empty($this->tasksCounts[$r['type']][$r['scheduled_in']])) { $this->tasksCounts[$r['type']][$r['scheduled_in']] = []; } $this->tasksCounts[$r['type']][$r['scheduled_in']][$r['status'] ?: 'null'] = $r['count']; } } private function getTasksCount(array $options): int { $count = 0; $type = $options['type']; foreach ($options['scheduled_in'] as $scheduledIn) { foreach ($options['status'] as $status) { if (!empty($this->tasksCounts[$type][$scheduledIn][$status])) { $count += $this->tasksCounts[$type][$scheduledIn][$status]; } } } return $count; } }
Fatal error: Uncaught Error: Class "MailPoet\Cron\Triggers\WordPress" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2860 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2790): MailPoetGenerated\FreeCachedContainer->getWordPress2Service() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getCronTriggerService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #5 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #6 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #8 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #9 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 2860