} do_action( 'woocommerce_gla_debug_message', sprintf( 'The %s job has failed due to a timeout error, rescheduling...', $hook ), __METHOD__ ); $this->action_scheduler->schedule_immediate( $hook, $args ); } } /** * Determines whether the given error is an execution "timeout" error. * * @param array $error An associative array describing the error with keys "type", "message", "file" and "line". * * @return bool * * @link https://www.php.net/manual/en/function.error-get-last.php * * @since 1.7.0 */ protected function is_timeout_error( array $error ): bool { return isset( $error['type'] ) && $error['type'] === E_ERROR && isset( $error['message'] ) && strpos( $error ['message'], 'Maximum execution time' ) !== false; } /** * Check whether the job's failure rate is above the specified threshold within the timeframe. * * @param string $hook The job action hook. * @param array|null $args The job arguments. * * @return bool True if the job's error rate is above the threshold, and false otherwise. * * @see ActionSchedulerJobMonitor::get_failure_rate_threshold() * @see ActionSchedulerJobMonitor::get_failure_timeframe() * * @since 1.7.0 */ protected function is_failure_rate_above_threshold( string $hook, ?array $args = null ): bool { $failed_actions = $this->action_scheduler->search( [ 'hook' => $hook, 'args' => $args, 'status' => $this->action_scheduler::STATUS_FAILED, 'per_page' => $this->get_failure_rate_threshold(), 'date' => gmdate( 'U' ) - $this->get_failure_timeframe(), 'date_compare' => '>', ], 'ids' ); return count( $failed_actions ) >= $this->get_failure_rate_threshold(); } /** * Get the job failure rate threshold (per timeframe). * * @return int */ protected function get_failure_rate_threshold(): int { return absint( apply_filters( 'woocommerce_gla_job_failure_rate_threshold', 3 ) ); } /** * Get the job failure timeframe (in seconds). * * @return int */ protected function get_failure_timeframe(): int { return absint( apply_filters( 'woocommerce_gla_job_failure_timeframe', 2 * HOUR_IN_SECONDS ) ); } /** * Generates a unique hash (checksum) for each job using its hook name and arguments. * * @param string $hook * @param array|null $args * * @return string * * @since 1.7.0 */ protected static function get_job_hash( string $hook, ?array $args = null ): string { return hash( 'crc32b', $hook . json_encode( $args ) ); } /** * Determines whether the given set of job hook and arguments is monitored for timeout. * * @param string $hook * @param array|null $args * * @return bool * * @since 1.7.0 */ protected function is_monitored_for_timeout( string $hook, ?array $args = null ): bool { return isset( $this->monitored_hooks[ self::get_job_hash( $hook, $args ) ] ); } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Jobs\ActionSchedulerJobMonitor does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Jobs\UpdateAllProducts does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Exception/ValidateInterface.php on line 22

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Exception/ValidateInterface.php:23 Stack trace: #0 /htdocs/wp-content/plugins/google-listings-and-ads/src/Exception/ValidateInterface.php(23): array_key_exists('Automattic\\WooC...', false) #1 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/JobServiceProvider.php(181): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->validate_interface('Automattic\\WooC...', 'Automattic\\WooC...') #2 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/JobServiceProvider.php(99): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->share_product_syncer_job('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->register() #4 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(172): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->register('Automattic\\WooC...') #5 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #8 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #9 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #10 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #11 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #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/google-listings-and-ads/src/Exception/ValidateInterface.php on line 23