• Resolved camya

    (@ecc)


    Hi,

    I recently wondered, why my log file is filled with PHP notices like this:

    Trying to access array offset on value of type bool in 404-monitor/class-monitor.php on line 187.

    I investigated and found a really strange method called parse_user_agent( $u_agent ) in class-monitor.php.

    What’s strange about it?

    This method sends data to an unknown external website. (if a 404 error is detected and UserAgent is found)

    The method’s DocBlock says… “Parses a user-agent string into its parts.” The DocBlock also says, that this method uses a project called “https://github.com/donatj/PhpUserAgent“. This project should parse the UserAgent on the server. (I not further looked into this project yet.)

    The reality: The method doesn’t use this GitHub project. Instead it makes an EXTERNAL API CALL to https://api.redirect.li/v1/useragent/. and sends the UserAgent, if a 404 error is detected and UserAgent is found.

    Here is the code in class-monitor.php: (Line 182)

    $response = wp_remote_get( 'https://api.redirect.li/v1/useragent/' . urlencode( $u_agent ) );

    About the external api site.

    The api.redirect.li site is registered in Liechtenstein (Europe) by a company or single person from the UK (London).

    Api call intended?

    Is this implementation really intended? For me it looks like it should use the “PhpUserAgent” GitHub project on the server, and the API call is some kind of development left-over?

    Best,
    Andreas

    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
    • This topic was modified 3 years, 11 months ago by camya.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    Yes, we are using an external library that just returns the user-agent if someone has enabled the advanced logging in the 404 monitor. Also, the comment on that file is incorrect and will be corrected in an upcoming version.

    Also, we will see if we can replace the external service with some native PHP library.

    We will let you know as soon as we do that.

    We seek your patience and understanding in this matter.

    In the meantime, if there’s anything else we can help you with, please let us know. We are here to assist.

    Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Hope you are doing well.

    Please update to the latest version, 1.0.45, we have updated the function and are now using a local library instead of relying on a 3rd party service.

    We appreciate your patience and understanding in this matter.

    If there’s anything else we can help you with, please let us know.

    We are here to assist. Thank you.

    Thread Starter camya

    (@ecc)

    Great. I saw, that you now use the PhpUserAgent project in parse_user_agent() instead of the external API.

    Thank you for the rapid update.

    Cheers,
    Andreas

    Plugin Author Rank Math

    (@rankmath)

    Hello @ecc

    Glad that helped and appreciate your patience.

    If it isn’t too much to ask for – would you mind leaving us a review here?
    https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

    It only takes a couple of minutes but helps us tremendously.

    It would mean so much to us and would go a really long way.

    Thank you.​​

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem: 404 monitor sends UserAgent to external Website! (api.redirect.li)’ is closed to new replies.