Debugging for plugin development?

Hi, I am trying to develop a plugin but don’t seem to be able to start…
I have the plugin, it creates the DB tables it needs and then I am stuck. I registered a hook, it’s supposed to write to the DB when that gets executed, nothing happens and I can’t figure out how to find why.

In bullet points:

[li] At the link to “Enable debug logging and SQL profiling” is wrong, it should link to Troubleshooting - Analytics Platform - Matomo
[/li][li] At Troubleshooting - Analytics Platform - Matomo it should be added that except “screen” there are other options (file and database)
[/li][li] I enabled logging to file, now in piwik/tmp/logs/logger_message.htm I have SQL queries. However, these are all SELECT queries. New visitors are being tracked, so there should be INSERT queries into piwik_log_visit but they are not there.
[/li][li] I cannot even understand if the hook is being activated (‘Tracker.newVisitorInformation’ => ‘newVisitorInformation’) and my code in the newVisitorInformation function runs when a new visitor is recorded. If it does, is there an error in it and where is it logged?
[/li][li] The query I have there is not in the log (it is an INSERT too).
[/li][li] How can I display it on screen to verify it is correct?

Thanks fixed first two.

For your issue, maybe you forgot to set ‘TrackerPlugin’ => true,
in the getInformation() function in your plugin class?

To display & debug piwik.php tracking requests, see:

Yes, I have ‘TrackerPlugin’ => true

The issue with debugging is that sometimes I make an error in the SQL (say, forget to put ‘’ around a text value), or it is a logical problem - trying to INSERT with a NULL value where I don’t know it is NULL (e.g. I expect something from the object but it’s not there). So, I just want to display the query on screen, to try in the DB and see the response. It is not an error as such, so would not be in the error log.

What I ended up doing - I made a temporary table, and INSERT the prepared query in it so I can then try it out. Slow solution, but helps.