• Resolved wilmerlm11

    (@wilmerlm11)


    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] => 119

    Started 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @wilmerlm11 ,
    can you please replace the line 119 with this and tell me if the problem persists?

    if( ( !defined( 'WP_CLI' ) || (defined('WP_CLI') && WP_CLI === false) ) && strcasecmp($_SERVER['REQUEST_METHOD'], "GET") == 0 && !is_admin() && !$this->is_login_page() && $this->get_single_config("cf_fallback_cache", 0) > 0 && $this->objects["cache_controller"]->is_cache_enabled() ) {

    Thank you

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Update to 4.3.8

    Thread Starter wilmerlm11

    (@wilmerlm11)

    Thank you! Just did! ??
    I’ll let you know if this error comes up again.
    Otherwise, thank you very much for your fast reply and even faster fix.

    regards,
    Wil

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Undefined index: REQUEST_METHOD on CRON Job (swcfpc_cache_preloader)’ is closed to new replies.