[Hustle Pro] geoplugin.net/json.gp?ip=34.204.238.218: Too Many Requests

I’ve disabled the IP tracking in Hustle and saved, but keep seeing this error message.  How can I stop it from flooding my debug.log?

[26-Oct-2021 13:03:59 UTC] PHP Warning:  file_get_contents(http://www.geoplugin.net/json.gp?ip=34.204.238.218): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests
 in /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php on line 259
[26-Oct-2021 13:03:59 UTC] PHP Stack trace:
[26-Oct-2021 13:03:59 UTC] PHP   1. {main}() /public_html/index.php:0
[26-Oct-2021 13:03:59 UTC] PHP   2. require() /public_html/index.php:17
[26-Oct-2021 13:03:59 UTC] PHP   3. require_once() /public_html/wp-blog-header.php:19
[26-Oct-2021 13:03:59 UTC] PHP   4. do_action() /public_html/wp-includes/template-loader.php:13
[26-Oct-2021 13:03:59 UTC] PHP   5. WP_Hook->do_action() /public_html/wp-includes/plugin.php:470
[26-Oct-2021 13:03:59 UTC] PHP   6. WP_Hook->apply_filters() /public_html/wp-includes/class-wp-hook.php:327
[26-Oct-2021 13:03:59 UTC] PHP   7. Hustle_Module_Front->create_modules() /public_html/wp-includes/class-wp-hook.php:303
[26-Oct-2021 13:03:59 UTC] PHP   8. Hustle_Meta_Base_Visibility->is_allowed_to_display() /public_html/wp-content/plugins/hustle/inc/front/hustle-module-front.php:555
[26-Oct-2021 13:03:59 UTC] PHP   9. Opt_In_Condition_Visitor_Country->is_allowed() /public_html/wp-content/plugins/hustle/inc/metas/class-hustle-meta-base-visibility.php:119
[26-Oct-2021 13:03:59 UTC] PHP  10. Opt_In_Condition_Visitor_Country->test_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:27
[26-Oct-2021 13:03:59 UTC] PHP  11. Opt_In_Geo->get_user_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:49
[26-Oct-2021 13:03:59 UTC] PHP  12. Opt_In_Geo->get_country_from_ip() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:105
[26-Oct-2021 13:03:59 UTC] PHP  13. Opt_In_Geo->_country_from_api() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:355
[26-Oct-2021 13:03:59 UTC] PHP  14. file_get_contents() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:259
 

Also, just as a heads up… at least for me, the

code

button doesn’t seem to be producing the code shortcode on the support ticket.

  • Adam Czajczyk
    • Support Gorilla

    Hi Hi-Line

    I hope you’re well today!

    The error that you shared shows that the issue isn’t related to tracking but to the visibility condition. Specifically, some module (like popup) must have the “Visitor’s Country” visibility rule added.

    A standard way to “recognize” visitor’s country is to get visitor’s IP and “geolocate” it (convert IP to country flag) and that’s what’s happening if that visibility rule is used. The error happens because apparently the target service (that’s used to perform IP to location conversion) is responding with “too many requests” HTTP status – it’s just rejecting these requests.

    This would also mean that “Visitor’s country” visibility condition is not working currently.

    For now, the simplest thing to do would be to remove this condition form all modules on site (popups etc).

    As for why this is happening, it seems that site was making way too many requests for geolocation as the geoplugin.net service is limited to up to 120 lookups per minute per IP (see first response there):

    https://www.geoplugin.com/faq

    Is the site getting so many visits (bots included) that it could possibly trigger these modules/popups on average more than twice a second? Is the site getting some unusual traffic recently?

    Best regards,
    Adam

  • Hi-Line
    • New Recruit

    (this is splaquet , filing a report using one my client’s WPMU accounts)

    I realized this was actually being called by Mailster’s integration. The email collect form is on the bottom of every page… so yeah, it was getting called with every visitors’ page load (and probably every LiteSpeed crawler’s crawl)

    I believe that I’ve been able to resolve it, as the log isn’t flooding with those messages now.

    thank you for the clear explanation Adam . hopefully this will help someone else out down the road!

  • Hi-Line
    • New Recruit

    ugh… i was mistaken. the notices went away in the debug.log, so i thought i figured it out. well, they came back.

    turns out that it is coming from Hustle. i cannot seem to find the setting that controls this. any suggestions Adam ?

    [26-Oct-2021 19:59:34 UTC] PHP Warning:  file_get_contents(http://www.geoplugin.net/json.gp?ip=34.204.238.218): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests
     in /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php on line 259
    [26-Oct-2021 19:59:34 UTC] PHP Stack trace:
    [26-Oct-2021 19:59:34 UTC] PHP   1. {main}() /public_html/index.php:0
    [26-Oct-2021 19:59:34 UTC] PHP   2. require() /public_html/index.php:17
    [26-Oct-2021 19:59:34 UTC] PHP   3. require_once() /public_html/wp-blog-header.php:19
    [26-Oct-2021 19:59:34 UTC] PHP   4. do_action() /public_html/wp-includes/template-loader.php:13
    [26-Oct-2021 19:59:34 UTC] PHP   5. WP_Hook->do_action() /public_html/wp-includes/plugin.php:470
    [26-Oct-2021 19:59:34 UTC] PHP   6. WP_Hook->apply_filters() /public_html/wp-includes/class-wp-hook.php:327
    [26-Oct-2021 19:59:34 UTC] PHP   7. Hustle_Module_Front->create_modules() /public_html/wp-includes/class-wp-hook.php:303
    [26-Oct-2021 19:59:34 UTC] PHP   8. Hustle_Meta_Base_Visibility->is_allowed_to_display() /public_html/wp-content/plugins/hustle/inc/front/hustle-module-front.php:555
    [26-Oct-2021 19:59:34 UTC] PHP   9. Opt_In_Condition_Visitor_Country->is_allowed() /public_html/wp-content/plugins/hustle/inc/metas/class-hustle-meta-base-visibility.php:119
    [26-Oct-2021 19:59:34 UTC] PHP  10. Opt_In_Condition_Visitor_Country->test_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:29
    [26-Oct-2021 19:59:34 UTC] PHP  11. Opt_In_Geo->get_user_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:49
    [26-Oct-2021 19:59:34 UTC] PHP  12. Opt_In_Geo->get_country_from_ip() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:105
    [26-Oct-2021 19:59:34 UTC] PHP  13. Opt_In_Geo->_country_from_api() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:355
    [26-Oct-2021 19:59:34 UTC] PHP  14. file_get_contents() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:259
    [26-Oct-2021 19:59:34 UTC] PHP Warning:  file_get_contents(http://www.geoplugin.net/json.gp?ip=34.204.238.218): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests
     in /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php on line 259
    [26-Oct-2021 19:59:34 UTC] PHP Stack trace:
    [26-Oct-2021 19:59:34 UTC] PHP   1. {main}() /public_html/index.php:0
    [26-Oct-2021 19:59:34 UTC] PHP   2. require() /public_html/index.php:17
    [26-Oct-2021 19:59:34 UTC] PHP   3. require_once() /public_html/wp-blog-header.php:19
    [26-Oct-2021 19:59:34 UTC] PHP   4. do_action() /public_html/wp-includes/template-loader.php:13
    [26-Oct-2021 19:59:34 UTC] PHP   5. WP_Hook->do_action() /public_html/wp-includes/plugin.php:470
    [26-Oct-2021 19:59:34 UTC] PHP   6. WP_Hook->apply_filters() /public_html/wp-includes/class-wp-hook.php:327
    [26-Oct-2021 19:59:34 UTC] PHP   7. Hustle_Module_Front->create_modules() /public_html/wp-includes/class-wp-hook.php:303
    [26-Oct-2021 19:59:34 UTC] PHP   8. Hustle_Meta_Base_Visibility->is_allowed_to_display() /public_html/wp-content/plugins/hustle/inc/front/hustle-module-front.php:555
    [26-Oct-2021 19:59:34 UTC] PHP   9. Opt_In_Condition_Visitor_Country->is_allowed() /public_html/wp-content/plugins/hustle/inc/metas/class-hustle-meta-base-visibility.php:119
    [26-Oct-2021 19:59:34 UTC] PHP  10. Opt_In_Condition_Visitor_Country->test_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:29
    [26-Oct-2021 19:59:34 UTC] PHP  11. Opt_In_Geo->get_user_country() /public_html/wp-content/plugins/hustle/inc/display-conditions/class-opt-in-condition-visitor-country.php:49
    [26-Oct-2021 19:59:34 UTC] PHP  12. Opt_In_Geo->get_country_from_ip() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:105
    [26-Oct-2021 19:59:34 UTC] PHP  13. Opt_In_Geo->_country_from_api() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:355
    [26-Oct-2021 19:59:34 UTC] PHP  14. file_get_contents() /public_html/wp-content/plugins/hustle/inc/opt-in-geo.php:259
    
    # grep -ril 'www.geoplugin.net'
    hustle/inc/opt-in-geo.php