WordPress.org

Forums

FeedPress
[resolved] Debug Errors in Version 1.5.9 (4 posts)

  1. Jeremiah
    Member
    Posted 7 months ago #

    Good Day!

    Just wanted to let you know about the following errors:

    PHP Notice: Undefined index: HTTP_USER_AGENT in /httpd/www/wp-content/plugins/feedpress/feedpress.php on line 803
    PHP Notice: Undefined index: HTTP_USER_AGENT in /httpd/www/wp-content/plugins/feedpress/feedpress.php on line 804
    PHP Notice: Undefined index: HTTP_USER_AGENT in /httpd/www/wp-content/plugins/feedpress/feedpress.php on line 805
    PHP Notice: Undefined index: HTTP_USER_AGENT in /httpd/www/wp-content/plugins/feedpress/feedpress.php on line 806

    I think you should be able to resolve the error by capturing it in a variable and using the variable instead. Untested Example:

    // Handle feed redirections
    $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
    if (!preg_match('/feedpress/i', $user_agent) &&
        !preg_match('/uri\.lv/i', $user_agent) &&
        !preg_match('/feedvalidator/i', $user_agent) &&
        !preg_match('/googlebot/i', $user_agent)) {
    
        add_action('template_redirect', 'feedpress_redirect', 1);
    
    }

    https://wordpress.org/plugins/feedpress/

  2. maximevalette
    Member
    Plugin Author

    Posted 7 months ago #

    Thanks for spotting that.

    I've fixed it in the current version (I didn't make a new version because we don't recommend having PHP with notices enabled in production so it's probably not a major issue). I'm testing the UA variable in the statement to avoid preg_matches on an empty var.

    Thanks again!

  3. Jeremiah
    Member
    Posted 7 months ago #

    You're welcome, and thank you for the quick response. I'm just going through a client's site identifying and cleaning up debug log errors and thought I'd let you know. Keep up the good work!

  4. maximevalette
    Member
    Plugin Author

    Posted 7 months ago #

    Thanks a lot!

Reply

You must log in to post.

About this Plugin

About this Topic