To get more information on how to configure and optimize Piwik itself, I recommend to have a look at the Piwik website and the Piwik community forums.
Maybe this link will help you: https://forum.piwik.org/t/using-htaccess-to-restrict-access/1532/82
I’m not sure if this also allows full access to the reporting API, but it’s worth a try. If not, maybe you can get in contact with the guys there. Or, if Piwik and WP-Piwik are running on the same server, you can use the PHP API, so WP-Piwik does not need HTTP access to Piwik.
Piwik and WP are running on the same server and I have changed the connection to PHP API and it works very well, thanks for the tip!