Title: Debug php warning
Last modified: January 30, 2025

---

# Debug php warning

 *  Resolved [Mati](https://wordpress.org/support/users/mattheus/)
 * (@mattheus)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/)
 * [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](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18275149)
 * Thanks for reaching out, will check on this.
 *  Plugin Author [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18275190)
 * 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](https://snipboard.io/yrf5hq.jpg)
   
   Please let me know how it goes, thanks.
    -  This reply was modified 1 year, 4 months ago by [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/).
 *  Thread Starter [Mati](https://wordpress.org/support/users/mattheus/)
 * (@mattheus)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18275599)
 * Hello [@glenwpcoder](https://wordpress.org/support/users/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
 *  [WebTM](https://wordpress.org/support/users/moviero/)
 * (@moviero)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18279373)
 * Seems to be on 
   setcookie( ‘wpcf7_guest_user_id’, $guest_id, time() + 3600 * 
   12, ‘/’ );
 *     ```wp-block-code
       // 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](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18279475)
 * [@mattheus](https://wordpress.org/support/users/mattheus/) [@moviero](https://wordpress.org/support/users/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](https://wordpress.org/support/users/mattheus/)
 * (@mattheus)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18279477)
 * for me it works. thnx!
 *  [nikosmdtps](https://wordpress.org/support/users/nikosmdtps/)
 * (@nikosmdtps)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18280056)
 * Hello guys, are you going to change line 62 at next update?
 *  Plugin Author [Glen Don Mongaya](https://wordpress.org/support/users/glenwpcoder/)
 * (@glenwpcoder)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18280453)
 * [@nikosmdtps](https://wordpress.org/support/users/nikosmdtps/) yes, it will be
   included.
 *  [nikosmdtps](https://wordpress.org/support/users/nikosmdtps/)
 * (@nikosmdtps)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18280813)
 * Thanks a lot for your response!

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

The topic ‘Debug php warning’ is closed to new replies.

 * ![](https://ps.w.org/drag-and-drop-multiple-file-upload-contact-form-7/assets/
   icon-128x128.jpg?rev=1984850)
 * [Drag and Drop Multiple File Upload for Contact Form 7](https://wordpress.org/plugins/drag-and-drop-multiple-file-upload-contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/drag-and-drop-multiple-file-upload-contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/drag-and-drop-multiple-file-upload-contact-form-7/reviews/)

 * 12 replies
 * 4 participants
 * Last reply from: [nikosmdtps](https://wordpress.org/support/users/nikosmdtps/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/debug-php-warning-2/#post-18280813)
 * Status: resolved