WP Photo Seller plugin headers already sent

Home Forums BulletProof Security Pro WP Photo Seller plugin headers already sent

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43479
    jenni101
    Participant

    Hello,

    I’d appreciate your advice with the following…

    I’ve just reinstalled BPS Pro on a standard WP install on Hostinger, and after runing the setup wizard (and repeatedly since then) I get this php warning:

    PHP Warning: Cannot modify header information – headers already sent in /home/xxxxxxxx/domains/mydomain.com/public_html/wp-content/plugins/wp-photo-seller/models/WPSSession.php on line 167

    Is this something specific with WP Photo Seller that I can whitelist?? Or should I follow your advise above in this post?

    Many thanks.

    #43481
    AITpro Admin
    Keymaster

    Most likely there is a coding mistake in the WP Photo Seller plugin in this file > /wp-content/plugins/wp-photo-seller/models/WPSSession.php on line 167.  You can send the file to me and I can tell you what code needs to be fixed in that file or you can contact the plugin author so that they can permanently fix their plugin’s code.  Looks like this plugin is made by Tips and Tricks HQ. From personal experience (I purchased one of their plugins) most of their plugins create Sessions incorrectly, which is causing the php error.

    #43491
    AITpro Admin
    Keymaster

    File: /wp-content/plugins/wp-photo-seller/models/WPSSession.php
    Code Line: 167:

    $return = setcookie('WPSSID', self::$_data['session_id'], 0, COOKIEPATH, COOKIE_DOMAIN);
        if($return === true){
        }else{
            WPSCommon::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Setcookie for session failed!");
        }

    After editing the code and adding a headers_sent() checking condition to check if headers have already been sent.

    if ( !headers_sent() ) {
    
            	$return = setcookie('WPSSID', self::$_data['session_id'], 0, COOKIEPATH, COOKIE_DOMAIN);
            
            } else {
            
            	$return = '';
               }
            
            if($return === true){
            }else{
                WPSCommon::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Setcookie for session failed!");
            }
    #43493
    jenni101
    Participant

    Hi,

    Thanks for that. I did try to add the code in myself just to see if it would remove the errors, but I must have added it in incorrectly as my site then failed stating a ‘critical error’!

    So back to the WP photo Seller original file and I’ll email them to let them know about the error and the suggested fix.

    Will update here for other when I hear from them.

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