=> $interval, 'display' => esc_html__( 'WP Rocket Preload revert stuck failed jobs', 'rocket' ), ]; return $schedules; } /** * Schedule pending preload urls. * * @return void */ public function schedule_pending_jobs() { if ( ! $this->settings->is_enabled() && wp_next_scheduled( 'rocket_preload_process_pending' ) ) { wp_clear_scheduled_hook( 'rocket_preload_process_pending' ); return; } if ( ! $this->settings->is_enabled() ) { return; } if ( wp_next_scheduled( 'rocket_preload_process_pending' ) ) { return; } wp_schedule_event( time() + MINUTE_IN_SECONDS, 'rocket_preload_process_pending', 'rocket_preload_process_pending' ); } /** * Schedule revert stuck failed row cron. * * @return void */ public function schedule_revert_old_failed_rows() { if ( ! $this->settings->is_enabled() && wp_next_scheduled( 'rocket_preload_revert_old_failed_rows' ) ) { wp_clear_scheduled_hook( 'rocket_preload_revert_old_failed_rows' ); return; } if ( ! $this->settings->is_enabled() ) { return; } if ( wp_next_scheduled( 'rocket_preload_revert_old_failed_rows' ) ) { return; } wp_schedule_event( time() + MINUTE_IN_SECONDS, 'rocket_revert_old_failed_rows', 'rocket_preload_revert_old_failed_rows' ); } /** * Remove old urls. * * @return void */ public function remove_old_rows() { /** * Delay before the not accessed row is deleted. * * @param string $delay delay before the not accessed row is deleted. */ $delay = (string) apply_filters( 'rocket_preload_delay_delete_non_accessed', '1 month' ); $parts = explode( ' ', $delay ); if ( '' === $delay || '0' === $delay ) { return; } $value = 1; $unit = 'month'; if ( count( $parts ) === 2 && $parts[0] >= 0 ) { $value = $parts[0]; $unit = $parts[1]; } $this->query->remove_all_not_accessed_rows( $value, $unit ); } /** * Remove old failed urls. * * @return void */ public function revert_old_failed_rows() { $this->query->revert_old_failed(); } }
Fatal error: Uncaught TypeError: WP_Rocket\Event_Management\Event_Manager::add_subscriber(): Argument #1 ($subscriber) must be of type WP_Rocket\Event_Management\Subscriber_Interface, string given, called in /htdocs/wp-content/plugins/wp-rocket/inc/Plugin.php on line 166 and defined in /htdocs/wp-content/plugins/wp-rocket/inc/classes/event-management/class-event-manager.php:33 Stack trace: #0 /htdocs/wp-content/plugins/wp-rocket/inc/Plugin.php(166): WP_Rocket\Event_Management\Event_Manager->add_subscriber('WP_Rocket\\Engin...') #1 /htdocs/wp-content/plugins/wp-rocket/inc/main.php(47): WP_Rocket\Plugin->load() #2 /htdocs/wp-includes/class-wp-hook.php(324): rocket_init('') #3 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #4 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #6 /htdocs/wp-config.php(108): require_once('/htdocs/wp-sett...') #7 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #8 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #9 /htdocs/index.php(17): require('/htdocs/wp-blog...') #10 {main} thrown in /htdocs/wp-content/plugins/wp-rocket/inc/classes/event-management/class-event-manager.php on line 33