• PHP Warning: session_start(): Cannot start session when headers already sent in /home/u987556932/domains/staging.10xtek.com/public_html/bobshop/wp-content/plugins/id-services/verifypass.php on line 37

    I fixed this by doing the below changes

    <?php
    if (!defined(‘ABSPATH’)) exit;
    /**

    class verifypass {

        private $config;
    
        private $groups = [
            'mil' => 'Military',
            'fir' => 'First Responder',
            'edu' => 'Student',
            'tea' => 'Teacher'
        ];
    
        public function __construct(){
          add_filter('plugin_action_links', array($this, 'add_settings_link'), 10, 2 );
               add_action('admin_menu', array($this,'add_admin_page'));
          add_action('woocommerce_before_cart', array($this,'hook_before_cart'));
          add_action('woocommerce_before_checkout_form', array($this,'hook_before_checkout'));
          add_action('woocommerce_cart_coupon', array($this,'hook_after_coupon'));
          $this->config = $this->get_config();
          // Check if headers have been sent before calling session_start()
            if ( ! headers_sent() ) {
                if (session_status() == PHP_SESSION_NONE) {
                    session_start();
                }
            }
        }
  • The topic ‘Verify Pass Headers Already Sent’ is closed to new replies.