Support » Plugin: Very Simple Contact Form » PHP warning when updating contact page

  • Resolved John

    (@dsl225)



    Hi Guido,

    I just updated a site that was running on version 7.4 to the latest version and left all settings, under settings page, unmodified (empty) as I don’t really use them. I only clicked on Save Changes.

    Now, when updating the contact page that uses your shortcode I get this PHP warning:

    PHP Warning: Cannot modify header information – headers already sent by (output started at /…/wp-includes/functions.php:1476) in /…/wp-admin/post.php on line 198

    PHP Warning: Cannot modify header information – headers already sent by (output started at /…/wp-includes/functions.php:1476) in /…/wp-includes/pluggable.php on line 1216

    Although there is no direct reference to your plugin, I’m sure it’s related because it happened only after I updated it and happens only when updating the contact page.
    As this error usually refers to empty spaces in php files, I wonder whether the problem comes from the fact that my settings page is empty?

    (the contact form still works fine though)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi John,

    I tried to duplicate your situation but I don’t get an error here.

    – Using PHP 7.1.9 (local install)
    – Removed all previous plugin settings from database
    – Clicked “Save Changes” once
    – Updated my contact form page

    When clicking “Save Changes” without changing anything the plugin settings are added to the database; the checkboxes get value “no” and the text inputs become empty values.

    Did this PHP warning occured once or every time you re-save your contact page?

    Guido

    Thanks for testing Guido.

    That site is on PHP 7.1.17
    In the meanwhile, I filled in all Label fields of VSCF settings and the issue remains the same.

    So it doesn’t seem to be related to this as I thought.

    What happens is the following and only with the page that holds the shortcode:

    [contact from_header=”info@mysite.com” email_to=”mysite@gmail.com”]

    When I edit this page and change something in there (or even don’t change anything) and then click on UPDATE the main screen becomes blank empty and remain only the dashboard menus at left and the PHP warning is written in the log.

    If I go one step backwards with the browser, everything is back to normal and when I check that page again all edits have been taken into account correctly and the form is still working fine.

    So, if you are unable to reproduce this, it might be a conflict with another plugin or something wrong with my shortcode? I also tried other variations of the shortcode but always getting same results…

    I really don’t know what else to test.

    Plugin Author Guido

    (@guido07111975)

    Ho John,

    I did take a look at the files that are mentioned:

    PHP Warning: Cannot modify header information – headers already sent by (output started at /…/wp-includes/functions.php:1476) in /…/wp-admin/post.php on line 198

    This has something to do with the nonce field and the cookie that is being set.

    There’s another related thread on VSCF forum, posted today, regarding a validation error (duplicate ID in plugin code). Meanwhile I found out the nonce code is loaded twice. This might cause your problem as well. I don’t know why the nonce code is being loaded twice so that’s why I’ve started a thread. You can find it here.

    If you have a test site you could remove the nonce code from plugin file vscf-form (line 339) and update page again. Error should not occur anymore…

    Guido

    Thanks for the update!

    I just tested at a quite minimal site running on same server, same PHP version and same WordPress 4.9.6 and I didn’t get this issue!

    So, that’s quite strange and could mean a plugin or theme conflict.

    I’ll be waiting for your own results first and see what happens before exploring this further.

    Plugin Author Guido

    (@guido07111975)

    Hi John,

    Have updated plugin few moments ago.

    I hope the PHP warning is fixed / gone now as well..

    Guido

    Absolutely!
    Everything works fine now, without errors.

    Many thanks for your prompt reaction and issue solving!

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