• Resolved johanbalowie

    (@johanbalowie)


    When I purge with the plugin I get the following in the error log:

    Error: Cannot modify header information – headers already sent in /plugins/litespeed-cache/src/tag.cls.php on line 120

    Something worth fixing mabye?

    • This topic was modified 2 years, 7 months ago by johanbalowie.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support qtwrk

    (@qtwrk)

    now that is weird , because that line is @header() , the @ should silence any error message , what’s your PHP version though ?

    Thread Starter johanbalowie

    (@johanbalowie)

    8.2 πŸ‘€

    Plugin Support qtwrk

    (@qtwrk)

    em , I could not reproduce it , maybe some of your plugin interfered , could you please try this on a clean wp and if it happens ?

    Thread Starter johanbalowie

    (@johanbalowie)

    Im using it on ACF settings page:

    add_action('acf/options_page/save', array($this, 'clear_cache_on_acf_settings_page_save'), 99, 2);
    
    static function clear_cache_on_acf_settings_page_save($post_id, $acf) {
    if (class_exists('\LiteSpeed\Purge')) {
    \LiteSpeed\Purge::purge_all();
    }
    }

    Changed the priority back and forth but nu success. I know I can put the hook in the plugin, but want to have it in my code….

    Anything wrong here? I cant see it

    Thread Starter johanbalowie

    (@johanbalowie)

    But its the same now when IΒ΄ve put acf/options_page/save in the plugin hook list that should clear the cache… same problem

    Thread Starter johanbalowie

    (@johanbalowie)

    Nah, but I have a custom error catcher that spits it to a Slack chanel… Its not showing, just in the logs. But an error is still an error πŸ™‚

    Plugin Support qtwrk

    (@qtwrk)

    try

    if ( defined('LSCWP_V')) {
      do_action( 'litespeed_purge_all' );
    }

    in that code.

    Thread Starter johanbalowie

    (@johanbalowie)

    Same problem, but nvm. It just fills up my error log and I wanted to let you know

    Plugin Support qtwrk

    (@qtwrk)

    emm , it still weirds me , my guess is something else called ob_start() ad flush it before SCWP finishes its operation

    Thread Starter johanbalowie

    (@johanbalowie)

    I dont have any ob_start() but in a shortcode I have… but that can hardly be an issue:

    ob_start();

    get_template_part(‘templates/parts/how-to-boxes’);

    $output = ob_get_clean();

    return $output;

    Thread Starter johanbalowie

    (@johanbalowie)

    Also get:

    Error: urldecode(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/litespeed-cache/src/control.cls.php on line 528

    Thread Starter johanbalowie

    (@johanbalowie)

    Nevermind… Had an init hook that I changed from priority 10 to 1 and then It worked !

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Error: Cannot modify header information – headers already sent’ is closed to new replies.