Tag: PHP

How to Sanitize user IP?

If the IP value returned from your server has a special character, you can use:wp_statistics_sanitize_user_ipfilter in your WordPress for getting real user IP from your $_SERVER. For example:If your $_SERVER: 192.000.000.1, 192.000.000.2, 192.000.000.3And your real IP is: 192.000.000.1You can use a final filter like this: Or if your $_SERVER: for=192.000.000.1;proto=http;host=site.comAnd your real IP is: 192.000.000.1Use […]

How stops tracking in WP-Statistics with PHP code

Sometimes you need to enable the Anonymize IP Addresses with PHP code for GDPR, in here is an example to do that. add_action(‘init’, function (){ global $WP_Statistics; $WP_Statistics->update_option( ‘anonymize_ips’, ‘1’ ); });

Optimization Page

The Optimization page will allow you to do some basic maintenance tasks related to WP Statistics. The optimization page looks like this:   It has six tabs; Resources/Information, Export, Purging, Database, Updates and Historical. Resources/Information The Resources/Information page has 4 subsections to it; Resources, Version Info, File Info and Client Info.   Resources The Resources […]

When I upgrade or install WP Statistics 11.0 I get an error message like “Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in…”

Since WP Statistics 11.0, PHP 5.4 or above has been required. If you are using an older version of PHP it cannot understand the new syntax included in WP Statistics 11.0 and generates a parse error. Your hosting provider should have a newer version of PHP available, sometimes you must activate it through your hosting […]

My overview screen is blank, what’s wrong?

This is usually caused by a PHP fatal error, check the page source and PHP logs. The most common fatal error is an out of memory error. Check the Statistics->Optimization page and see how much memory is currently assigned to PHP and how much the overview is using. If it is a memory issue you […]

When I upgrade or install WP Statistics I get an error message

When I upgrade or install WP Statistics I get an error message like Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘(   Since WP Statistics 8.0, PHP 5.3 or above has been required. If you are using an older version of PHP it cannot understand the new syntax included in WP Statistics 8.0 […]

I’m using another statistics plugin/service and get different numbers for them, why?

Pretty much every plugin/service is going to give you different results for visits and vistors, there are several reasons for this: Web crawler detection Detection method (javascript vs server side PHP) Centralized exclusions Services that use centralized databases, like Google Analytics, for spam and robot detection have better detection than WP Statistics can. The trade […]

GeoIP is enabled but no hits are being counted?

The GeoIP code requires several things to function, PHP 5.3 or above, the cURL extension and PHP cannot be running in safe mode. All of these conditions are checked for but there may be additional items required. Check your PHP log files and see if there are any fatal errors listed.