run_accessed_at'])) { return null; } if ($daemon['run_accessed_at'] <= (int)$daemon['run_started_at']) { return true; } if ( $daemon['run_accessed_at'] + self::DAEMON_REQUEST_TIMEOUT < time() && $daemon['run_accessed_at'] > (int)$daemon['run_started_at'] ) { return false; } return null; } public function queryCronUrl($url) { $args = $this->wp->applyFilters( 'mailpoet_cron_request_args', [ 'blocking' => true, 'sslverify' => false, 'timeout' => self::DAEMON_REQUEST_TIMEOUT, 'user-agent' => 'MailPoet Cron', ] ); return $this->wp->wpRemotePost($url, $args); } public function getCronUrl($action, $data = false) { $url = Router::buildRequest( CronDaemonEndpoint::ENDPOINT, $action, $data ); $customCronUrl = $this->wp->applyFilters('mailpoet_cron_request_url', $url); return ($customCronUrl === $url) ? str_replace(home_url(), $this->getSiteUrl(), $url) : $customCronUrl; } public function getSiteUrl($siteUrl = false) { // additional check for some sites running inside a virtual machine or behind // proxy where there could be different ports (e.g., host:8080 => guest:80) if (!$siteUrl) { $siteUrl = defined('MAILPOET_CRON_SITE_URL') ? MAILPOET_CRON_SITE_URL : $this->wp->homeUrl(); } $parsedUrl = parse_url($siteUrl); if (!is_array($parsedUrl)) { throw new \Exception(__('Site URL is unreachable.', 'mailpoet')); } $callScheme = ''; if (isset($parsedUrl['scheme']) && ($parsedUrl['scheme'] === 'https')) { $callScheme = 'ssl://'; } // 1. if site URL does not contain a port, return the URL if (!isset($parsedUrl['port']) || empty($parsedUrl['port'])) return $siteUrl; // 2. if site URL contains valid port, try connecting to it $urlHost = $parsedUrl['host'] ?? ''; $fp = @fsockopen($callScheme . $urlHost, $parsedUrl['port'], $errno, $errstr, 1); if ($fp) return $siteUrl; // 3. if connection fails, attempt to connect the standard port derived from URL // schema $urlScheme = $parsedUrl['scheme'] ?? ''; $port = (strtolower($urlScheme) === 'http') ? 80 : 443; $fp = @fsockopen($callScheme . $urlHost, $port, $errno, $errstr, 1); if ($fp) return sprintf('%s://%s', $urlScheme, $urlHost); // 4. throw an error if all connection attempts failed throw new \Exception(__('Site URL is unreachable.', 'mailpoet')); } public function enforceExecutionLimit($timer) { $elapsedTime = microtime(true) - $timer; $limit = $this->getDaemonExecutionLimit(); if ($elapsedTime >= $limit) { throw new \Exception( sprintf( // translators: %1$d is the number of seconds the daemon is allowed to run, %2$d is how many more seconds the daemon did run. __( 'The maximum execution time of %1$d seconds was exceeded by %2$d seconds. This task will resume during the next run.', 'mailpoet' ), (int)round($limit), (int)round($elapsedTime - $limit) ), self::DAEMON_EXECUTION_LIMIT_REACHED ); } } }
Fatal error: Uncaught Error: Class "MailPoet\Cron\CronHelper" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2780 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getCronHelperService() #1 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Cron\\C...', 1) #2 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Cron\\C...') #3 /htdocs/wp-content/plugins/mailpoet/lib/Cron/Workers/SimpleWorker.php(46): MailPoet\DI\ContainerWrapper->get('MailPoet\\Cron\\C...') #4 /htdocs/wp-content/plugins/mailpoet/lib/Cron/Workers/KeyCheck/KeyCheckWorker.php(26): MailPoet\Cron\Workers\SimpleWorker->__construct(Object(MailPoet\WP\Functions)) #5 /htdocs/wp-content/plugins/mailpoet/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php(33): MailPoet\Cron\Workers\KeyCheck\KeyCheckWorker->__construct(Object(MailPoet\Cron\CronWorkerScheduler)) #6 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2950): MailPoet\Cron\Workers\KeyCheck\SendingServiceKeyCheck->__construct(Object(MailPoet\Settings\SettingsController), Object(MailPoet\Config\ServicesChecker), Object(MailPoet\Cron\CronWorkerScheduler)) #7 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(916): MailPoetGenerated\FreeCachedContainer->getSendingServiceKeyCheckService() #8 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5592): MailPoetGenerated\FreeCachedContainer->getServicesService() #9 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getDotcomLicenseProvisionerService() #10 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #11 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #12 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #13 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #14 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #15 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #16 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #17 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #18 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #19 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #20 /htdocs/index.php(17): require('/htdocs/wp-blog...') #21 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 2780