Undefined index PHP errors - HTTP_USER_AGENT

Seeing a lot of this error in the WP debug.log relating to sitewide-privacy-options.php:

PHP Notice: Undefined index: HTTP_USER_AGENT

Lines 144, 148, 152, 156, 160

    Ash

    Hello ds281

    I hope you are well today and thanks for asking the question.

    In fact, notice is not harmful for your project. And the plugin will run perfectly with the notice. The notice is used for developer, to check existence of that variable.

    If you want to turn of the notices, you can simple off the debug mode in wp-config.php file.

    define('WP_DEBUG', false);

    Also, if you want to edit the code so that it won's appear in server log, then go to /wp-content/plugins/sitewide-privacy-options/sitewide-privacy-options.php . Go to line 143 to 162:

    //WordPress for iOS
        if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-iphone' ) !== false ) {
            return true;
        }
        //WordPress for Android
        elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-android' ) !== false ) {
            return true;
        }
        //WordPress for Windows Phone 7
        elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-windowsphone' ) !== false ) {
            return true;
        }
        //WordPress for Nokia
        elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-nokia' ) !== false ) {
            return true;
        }
        //WordPress for Blackberry
        elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-blackberry' ) !== false ) {
            return true;
        }

    Replace with the following:

    if(isset($_SERVER['HTTP_USER_AGENT'])) {
            //WordPress for iOS
            if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-iphone' ) !== false ) {
                return true;
            }
            //WordPress for Android
            elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-android' ) !== false ) {
                return true;
            }
            //WordPress for Windows Phone 7
            elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-windowsphone' ) !== false ) {
                return true;
            }
            //WordPress for Nokia
            elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-nokia' ) !== false ) {
                return true;
            }
            //WordPress for Blackberry
            elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'wp-blackberry' ) !== false ) {
                return true;
            }
        }

    It should fix. But, be sure, notice is okay and no harmful.

    Let me know, if it fixes.

    Cheers
    Ash