• Hi there, I am trying out this plugin but unfortunately it breaks the javascript on my website, plugin I get these warnings in php error log:

    [10-Mar-2025 16:46:18 UTC] PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /web/htdocs/home/v2/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/class.cf7pe.lib.php on line 354

    [10-Mar-2025 16:46:21 UTC] PHP Warning:  Undefined array key “cf7pe_use_paypal” in /web/htdocs/home/v2/wp-content/plugins/contact-form-7-paypal-extension/inc/admin/class.cf7pe.admin.action.php on line 298

    [10-Mar-2025 16:46:21 UTC] PHP Warning:  Undefined array key “cf7pe_mode_sandbox” in /web/htdocshome/v2/wp-content/plugins/contact-form-7-paypal-extension/inc/admin/class.cf7pe.admin.action.php on line 298

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ZealousWeb

    (@zealopensource)

    Hello @frafor,

    Thank you for reaching out to me. We are currently looking into this issue.

    If you have any further questions, please feel free to ask. I am here to assist you.

    Thank you,
    ZealousWeb

    Thread Starter frafor

    (@frafor)

    @zealopensource As for the plugin breaking js, I figured it out: you are loading “jquery-core” in class.cf7pe.front.action.php. If other plugins are loading full “jquery”, this leads to jquery core functions being loaded twice, hence subsequent jquery-dependant scripts may experience unpredictable behaviour, most likely failing. I have just switched your script dependancies to rely on “jquery” and it seems to do the trick.

    The “undefined array key” error seems to have gone after deactivating/reactivating the plugin, but I’ll monitor it.

    I am still getting the “headers already sent” error, but that shouldn’t prevent the plugin to do the job. I still have to test it thou, will come back later with an update.

    Thread Starter frafor

    (@frafor)

    I have found another issue in class.cf7pe.lib.php: after testing, the description passed to PayPal was always the website name.

    This is happening because $description field is defined on line 612 as:

    $description = get_post_meta( $form_ID, CF7PE_META_PREFIX . 'description', true );

    Then, it’s overridden on line 621 gathering the value from $posted_data:

    $description = ( ( !empty( $description ) && array_key_exists( $description, $posted_data ) ) ? $posted_data[$description] : get_bloginfo( 'name' ) );

    That would be ok, but still on line 627, a new variable $description_val is defined and later it’s the one sent to PayPal. Unfortunately, $description_val will always default to get_bloginfo(‘name’), because $description has been overwritten:

    $description_val = ( ( !empty( $description ) && array_key_exists( $description, $posted_data ) ) ? $posted_data[$description] : get_bloginfo( 'name' ) );

    This was most likely a mistake as the second evaluation for $description shouldn’t be there.

    I also noticed that $mail defined in line 620 is never used, should it be left there hanging?

    Plugin Author ZealousWeb

    (@zealopensource)

    Dear @frafor,

    Thank you for bringing this issue to our attention. We are currently investigating it.

    If you have any questions, please feel free to ask—I’m here to assist you.

    Thank you,
    ZealousWeb

    Plugin Author ZealousWeb

    (@zealopensource)

    Dear @frafor,

    Thank you so much. We are currently investigating it.

    If you have any questions, please feel free to ask—I’m here to assist you.

    Thank you,
    ZealousWeb

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

The topic ‘Several warnings in error.log, plugin breaks javascript’ is closed to new replies.