Undefined index: REQUEST_METHOD on CRON Job (swcfpc_cache_preloader)
-
Hi,
I’m seeing some errors being logged over and over again:
[message] => Undefined index: REQUEST_METHOD
[file] => …/wp-content/plugins/wp-cloudflare-page-cache/wp-cloudflare-super-page-cache.php
[line] => 119Started by wp_swcfpc_cache_preloader_background_process_cron .
After some research, I found out that:
If WP Cron is called from CLI, variable $_SERVER[‘REQUEST_METHOD’] is not set.So the condition on line 119 would need to be updated to check CLI first:
if ( strcasecmp($_SERVER['REQUEST_METHOD'], "GET") == 0 && ( !defined( 'WP_CLI' ) || (defined('WP_CLI') && WP_CLI === false) ) && !is_admin() && !$this->is_login_page() && $this->get_single_config("cf_fallback_cache", 0) > 0 && $this->objects["cache_controller"]->is_cache_enabled() ) {
Could you guys check it plz?
Thanks
- The topic ‘Undefined index: REQUEST_METHOD on CRON Job (swcfpc_cache_preloader)’ is closed to new replies.