Skip to content

Conversation

@tsteur
Copy link
Contributor

@tsteur tsteur commented Oct 28, 2021

We have a report from a user in https://wordpress.org/support/topic/fatal-error-when-trying-to-activate-bot-tracker/ who wanted to use this plugin in Matomo for WordPress. However, it resulted in an error because when BotTracker.php is loaded as a WordPress plugin, then PIWIK_INCLUDE_PATH might not exist. In the plugins where we used a functions.php we instead changed it to load the functions.php a bit later (in this time every time the plugin is being loaded on every request). It will also use the new method getPluginDirectory which we added in one of the last releases in Matomo 3.X so this way it supports Matomo's feature to customise the plugins directory.

We have a report from a user in https://wordpress.org/support/topic/fatal-error-when-trying-to-activate-bot-tracker/ who wanted to use this plugin in Matomo for WordPress. However, it resulted in an error because when `BotTracker.php` is loaded as a WordPress plugin, then `PIWIK_INCLUDE_PATH` might not exist. In the plugins where we used a `functions.php` we instead changed it to load the functions.php a bit later (in this time every time the plugin is being loaded on every request). It will also use the new method `getPluginDirectory` which we added in one of the last releases in Matomo 3.X so this way it supports Matomo's feature to customise the plugins directory.
@Thomas--F Thomas--F merged commit 74db352 into Thomas--F:master Oct 28, 2021
@tsteur tsteur deleted the patch-3 branch October 28, 2021 18:42
tsteur added a commit to tsteur/BotTracker that referenced this pull request Oct 28, 2021
follow up from  Thomas--F#83

The plugin now failed in the API.php where it shouldn't be needed to load the functions.php as it's already done when loading the plugin.

Sorry about that and about not including it in the other PR. Should have checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants