Thomas--F / BotTracker

BotTracker-Plugin for Piwik
GNU General Public License v3.0
32 stars 14 forks source link

PHP error on Matomo #65

Closed G4Zz0L1 closed 3 years ago

G4Zz0L1 commented 4 years ago

I don't know if this plugin is still maintained, but I'll report it anyway. The plugin on Matomo returns the following error:

PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/matomo/plugins/BotTracker/BotTracker.php on line 141
PHP Stack trace:
PHP   1. {main}() /usr/share/webapps/matomo/matomo.php:0
PHP   2. include() /usr/share/webapps/matomo/matomo.php:15
PHP   3. Piwik\\Tracker->main($handler = *uninitialized*, $requestSet = *uninitialized*) /usr/share/webapps/matomo/piwik.php:76
PHP   4. Piwik\\Tracker->track($handler = *uninitialized*, $requestSet = *uninitialized*) /usr/share/webapps/matomo/core/Tracker.php:112
PHP   5. Piwik\\Tracker\\Handler->process($tracker = *uninitialized*, $requestSet = *uninitialized*) /usr/share/webapps/matomo/core/Tracker.php:135
PHP   6. Piwik\\Tracker->trackRequest($request = *uninitialized*) /usr/share/webapps/matomo/core/Tracker/Handler.php:57
PHP   7. Piwik\\Tracker\\Visit->handle() /usr/share/webapps/matomo/core/Tracker.php:155
PHP   8. Piwik\\Plugins\\CoreHome\\Tracker\\VisitRequestProcessor->processRequestParams($visitProperties = *uninitialized*, $request = *uninitialized*) /usr/share/webapps/matomo/core/Tracker/Visit.php:158
PHP   9. Piwik\\Tracker\\VisitExcluded->isExcluded() /usr/share/webapps/matomo/plugins/CoreHome/Tracker/VisitRequestProcessor.php:99
PHP  10. Piwik\\Piwik::postEvent($eventName = *uninitialized*, $params = *uninitialized*, $pending = *uninitialized*, $plugins = *uninitialized*) /usr/share/webapps/matomo/core/Tracker/VisitExcluded.php:96
PHP  11. Piwik\\EventDispatcher->postEvent($eventName = *uninitialized*, $params = *uninitialized*, $pending = *uninitialized*, $plugins = *uninitialized*) /usr/share/webapps/matomo/core/Piwik.php:775
PHP  12. call_user_func_array:{/usr/share/webapps/matomo/core/EventDispatcher.php:141}(*uninitialized*, *uninitialized*) /usr/share/webapps/matomo/core/EventDispatcher.php:141
PHP  13. Piwik\\Plugins\\BotTracker\\BotTracker->checkBot($exclude = *uninitialized*, $request = *uninitialized*) /usr/share/webapps/matomo/core/EventDispatcher.php:141
Thomas--F commented 4 years ago

I no longer use Piwik/Matomo so there will be no features in this plugin - at least not from me. But I will try to fix errors so others can use it. Just give me some time to setup a test enviroment....

G4Zz0L1 commented 4 years ago

If I may, which software replaced your piwik/matomo instance? Thanks for the trouble to fix this, even if you don't use it anymore.

Thomas--F commented 4 years ago

I don't need an analysing-tool anymore because we shut down our shop-webpage. Today I maintain only some non-profit-pages which are mainly for members. So I don't have the urge to analyse the visitors.

OK, my test enviroment ist running now on Matomo 3.13.5. Where did you get the error?

Thomas--F commented 4 years ago

I'm a little bit confused... The PHP Notice is thrown in "BotTracker/BotTracker.php on line 141" In this line is a simple string with a log-path defined. No array, no bool.

Which version are you running? 1.06?

G4Zz0L1 commented 4 years ago

Yep, I've just checked, v1.06

Thomas--F commented 4 years ago

What enviroment do you use? PHP-Version, Matomo-Version?

G4Zz0L1 commented 4 years ago

PHP 7.4.6 with matomo 3.13.5 on an Arch machine

Thomas--F commented 4 years ago

OK, I've updates PHP to 7.4.6 and now I get the same PHP notice but on line 114 (not 141). I've fixed the "error". If you want to test it, just download and exchange the file "BotTracker.php". I will do some more tests and then I commit a new release.

G4Zz0L1 commented 4 years ago

Thanks, I'll try it as soon as I have some time to test it

Thomas--F commented 3 years ago

fixed on version 2.0 for Matomo 4