• Resolved Mati

    (@mattheus)


    [30-Jan-2025 14:34:08 UTC] PHP Warning: Cannot modify header information – headers already sent in /public_html/wp-content/plugins/drag-and-drop-multiple-file-upload-contact-form-7/inc/dnd-upload-cf7.php on line 88

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Thanks for reaching out, will check on this.

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    I tried in my server and staging but I cannot see the error.

    Are you able to provide me your Site Health? by going to Tools -> Site Health -> Info

    Or try editing this line to see if it works. (replace “init” with “plugins_loaded” on line 62)

    From: add_action( ‘init’, ‘dnd_cf7_generate_cookie’ );
    To: add_action( ‘plugins_loaded’, ‘dnd_cf7_generate_cookie’ );

    If not remove empty space the top after <?php see this : https://snipboard.io/yrf5hq.jpg

    Please let me know how it goes, thanks.

    Thread Starter Mati

    (@mattheus)

    Hello @glenwpcoder

    I want to share the data but not make it public here because it contains sensitive data. Can I email it?

    I tried the code changes but nothing helped

    Seems to be on
    setcookie( ‘wpcf7_guest_user_id’, $guest_id, time() + 3600 * 12, ‘/’ );

    // Generate cookie
    function dnd_cf7_generate_cookie() {
        if ( ! isset( $_COOKIE['wpcf7_guest_user_id'] ) ) {
            $characters       = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
            $charactersLength = strlen( $characters );
            $randomString     = '';
    
            for ( $i = 0; $i < 12; $i++ ) {
                $randomString .= $characters[ random_int( 0, $charactersLength - 1 ) ] ;
            }
    
            $guest_id = $randomString .'-'. mt_rand(1000, 9999);
            setcookie( 'wpcf7_guest_user_id', $guest_id, time() + 3600 * 12, '/' );
        }
    }

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    @mattheus @moviero

    Try to change the code on line 62.

    From:  add_action( ‘init’, ‘dnd_cf7_generate_cookie’ );
    To:  add_action( ‘send_headers’, ‘dnd_cf7_generate_cookie’ );

    Please let me know how it goes.

    Thread Starter Mati

    (@mattheus)

    for me it works. thnx!

    Hello guys, are you going to change line 62 at next update?

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    @nikosmdtps yes, it will be included.

    Thanks a lot for your response!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.