k bindings source names must contain a namespace prefix. Example: my-plugin/my-custom-source' ), '6.5.0' ); return false; } if ( $this->is_registered( $source_name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Block bindings source name. */ sprintf( __( 'Block bindings source "%s" already registered.' ), $source_name ), '6.5.0' ); return false; } // Validates that the source properties contain the label. if ( ! isset( $source_properties['label'] ) ) { _doing_it_wrong( __METHOD__, __( 'The $source_properties must contain a "label".' ), '6.5.0' ); return false; } // Validates that the source properties contain the get_value_callback. if ( ! isset( $source_properties['get_value_callback'] ) ) { _doing_it_wrong( __METHOD__, __( 'The $source_properties must contain a "get_value_callback".' ), '6.5.0' ); return false; } // Validates that the get_value_callback is a valid callback. if ( ! is_callable( $source_properties['get_value_callback'] ) ) { _doing_it_wrong( __METHOD__, __( 'The "get_value_callback" parameter must be a valid callback.' ), '6.5.0' ); return false; } // Validates that the uses_context parameter is an array. if ( isset( $source_properties['uses_context'] ) && ! is_array( $source_properties['uses_context'] ) ) { _doing_it_wrong( __METHOD__, __( 'The "uses_context" parameter must be an array.' ), '6.5.0' ); return false; } if ( ! empty( array_diff( array_keys( $source_properties ), $this->allowed_source_properties ) ) ) { _doing_it_wrong( __METHOD__, __( 'The $source_properties array contains invalid properties.' ), '6.5.0' ); return false; } $source = new WP_Block_Bindings_Source( $source_name, $source_properties ); $this->sources[ $source_name ] = $source; return $source; } /** * Unregisters a block bindings source. * * @since 6.5.0 * * @param string $source_name Block bindings source name including namespace. * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise. */ public function unregister( string $source_name ) { if ( ! $this->is_registered( $source_name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Block bindings source name. */ sprintf( __( 'Block binding "%s" not found.' ), $source_name ), '6.5.0' ); return false; } $unregistered_source = $this->sources[ $source_name ]; unset( $this->sources[ $source_name ] ); return $unregistered_source; } /** * Retrieves the list of all registered block bindings sources. * * @since 6.5.0 * * @return WP_Block_Bindings_Source[] The array of registered sources. */ public function get_all_registered() { return $this->sources; } /** * Retrieves a registered block bindings source. * * @since 6.5.0 * * @param string $source_name The name of the source. * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered. */ public function get_registered( string $source_name ) { if ( ! $this->is_registered( $source_name ) ) { return null; } return $this->sources[ $source_name ]; } /** * Checks if a block bindings source is registered. * * @since 6.5.0 * * @param string $source_name The name of the source. * @return bool `true` if the block bindings source is registered, `false` otherwise. */ public function is_registered( $source_name ) { return isset( $this->sources[ $source_name ] ); } /** * Wakeup magic method. * * @since 6.5.0 */ public function __wakeup() { if ( ! $this->sources ) { return; } if ( ! is_array( $this->sources ) ) { throw new UnexpectedValueException(); } foreach ( $this->sources as $value ) { if ( ! $value instanceof WP_Block_Bindings_Source ) { throw new UnexpectedValueException(); } } } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.5.0 * * @return WP_Block_Bindings_Registry The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } } leted = $worker->processTaskStrategy($task, $this->timer); } catch (\Exception $e) { $this->stopProgress($task); throw $e; } if ($completed) { $this->complete($task); } $this->stopProgress($task); return (bool)$completed; } private function rescheduleOutdated(ScheduledTaskEntity $task) { $currentTime = Carbon::createFromTimestamp($this->wp->currentTime('timestamp')); if (empty($task->getUpdatedAt())) { // missing updatedAt, consider this task outdated (set year to 2000) and reschedule $updatedAt = Carbon::createFromDate(2000); } else if (!$task->getUpdatedAt() instanceof Carbon) { $updatedAt = new Carbon($task->getUpdatedAt()); } else { $updatedAt = $task->getUpdatedAt(); } // If the task is running for too long consider it stuck and reschedule if (!empty($task->getUpdatedAt()) && $updatedAt->diffInMinutes($currentTime, false) > self::TASK_RUN_TIMEOUT) { $this->stopProgress($task); $this->cronWorkerScheduler->reschedule($task, self::TIMED_OUT_TASK_RESCHEDULE_TIMEOUT); return true; } return false; } private function isInProgress(ScheduledTaskEntity $task) { if ($task->getInProgress()) { // Do not run multiple instances of the task return true; } return false; } private function startProgress(ScheduledTaskEntity $task) { $task->setInProgress(true); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } private function stopProgress(ScheduledTaskEntity $task) { $task->setInProgress(false); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } private function complete(ScheduledTaskEntity $task) { $task->setProcessedAt(Carbon::createFromTimestamp($this->wp->currentTime('timestamp'))); $task->setStatus(ScheduledTaskEntity::STATUS_COMPLETED); $this->scheduledTasksRepository->persist($task); $this->scheduledTasksRepository->flush(); } }
Fatal error: Uncaught Error: Class "MailPoet\Cron\CronWorkerRunner" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2800 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2820): MailPoetGenerated\FreeCachedContainer->getCronWorkerRunnerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2750): MailPoetGenerated\FreeCachedContainer->getDaemonService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2830): MailPoetGenerated\FreeCachedContainer->getDaemonRunService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2790): MailPoetGenerated\FreeCachedContainer->getDaemonActionSchedulerRunnerService() #4 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getCronTriggerService() #5 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): 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(194): require_once('/htdocs/wp-cont...') #11 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #12 /htdocs/wp-config.php(85): 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 2800