ttersRepository->fetchChildrenIds($ids); $ids = array_merge($ids, $childrenIds); $this->entityManager->beginTransaction(); try { // Delete statistics data $this->statisticsNewslettersRepository->deleteByNewsletterIds($ids); $this->statisticsOpensRepository->deleteByNewsletterIds($ids); $this->statisticsClicksRepository->deleteByNewsletterIds($ids); // Update WooCommerce statistics and remove newsletter and click id $this->statisticsWooCommercePurchasesRepository->removeNewsletterDataByNewsletterIds($ids); // Delete newsletter posts, options, links, and segments $this->newsletterPostsRepository->deleteByNewsletterIds($ids); $this->newsletterOptionsRepository->deleteByNewsletterIds($ids); $this->newsletterLinkRepository->deleteByNewsletterIds($ids); $this->newsletterSegmentRepository->deleteByNewsletterIds($ids); // Delete stats notifications and related tasks /** @var string[] $taskIds */ $taskIds = $this->entityManager->createQueryBuilder() ->select('IDENTITY(sn.task)') ->from(StatsNotificationEntity::class, 'sn') ->where('sn.newsletter IN (:ids)') ->setParameter('ids', $ids) ->getQuery() ->getSingleColumnResult(); $taskIds = array_map('intval', $taskIds); $this->scheduledTasksRepository->deleteByIds($taskIds); $this->statsNotificationsRepository->deleteByNewsletterIds($ids); // Delete scheduled task subscribers, scheduled tasks, and sending queues /** @var string[] $taskIds */ $taskIds = $this->entityManager->createQueryBuilder() ->select('IDENTITY(q.task)') ->from(SendingQueueEntity::class, 'q') ->where('q.newsletter IN (:ids)') ->setParameter('ids', $ids) ->getQuery() ->getSingleColumnResult(); $taskIds = array_map('intval', $taskIds); $this->scheduledTaskSubscribersRepository->deleteByTaskIds($taskIds); $this->scheduledTasksRepository->deleteByIds($taskIds); $this->sendingQueuesRepository->deleteByNewsletterIds($ids); // Fetch WP Posts IDs and delete them /** @var string[] $wpPostIds */ $wpPostIds = $this->entityManager->createQueryBuilder() ->select('IDENTITY(n.wpPost) AS id') ->from(NewsletterEntity::class, 'n') ->where('n.id IN (:ids)') ->andWhere('n.wpPost IS NOT NULL') ->setParameter('ids', $ids) ->getQuery() ->getSingleColumnResult(); $wpPostIds = array_map('intval', $wpPostIds); foreach ($wpPostIds as $wpPostId) { $this->wp->wpDeletePost($wpPostId, true); } // Delete newsletter entities $this->newslettersRepository->deleteByIds($ids); $this->entityManager->commit(); } catch (Throwable $e) { $this->entityManager->rollback(); throw $e; } return count($ids); } }
Fatal error: Uncaught Error: Class "MailPoet\Newsletter\NewsletterDeleteController" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:3881 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2033): MailPoetGenerated\FreeCachedContainer->getNewsletterDeleteControllerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2058): MailPoetGenerated\FreeCachedContainer->getAutomationEditorLoadingHooksService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getMailPoetIntegrationService() #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 3881