isaumya / wp-server-stats

Monitor your WordPress site the right way with most important server stats like memory usage, CPU load, uptime & more.
https://wordpress.org/plugins/wp-server-stats/
MIT License
15 stars 7 forks source link

Warnings logged #8

Open robertoschwald opened 2 years ago

robertoschwald commented 2 years ago

The following warnings are logged. Checked with Query Monitor plugin, but you can enable server logs to see it as well:

  1. Trying to access array offset on value of type bool wp-content/plugins/wp-server-stats/wp-server-stats.php:249 Plugin: wp-server-stats

  2. Warning file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 wp-content/plugins/wp-server-stats/wp-server-stats.php:239 Plugin: wp-server-stats

  3. Warning file_get_contents(http://ip-api.com/php/xxx.xxx.xxx.xxx): failed to open stream: no suitable wrapper could be found wp-content/plugins/wp-server-stats/wp-server-stats.php:239 Plugin: wp-server-stats

Maybe add support for MaxMind, so location info is taken from local database if needed.

robertoschwald commented 1 year ago

For the allow_url_fopen=0 warning, I strongly recommend to either check if allow_url_fopen is enabled e.g.

if( ini_get('allow_url_fopen') ) {
}

or use curl_exec()