You can't access this resource as it requires a 'superuser' access.
-
Hello,
I upgraded my wordpress blogs to WP-Piwik 0.10.0.3.
I use a piwik account which has only view rights to all the websites.
Piwik interface is only available using https, so I forced https and disabled the peer verification in expert settings.It worked fine with your plugin previous version.
Now, when i reconfigured it (since settings were lost), it can’t find the associated website from Piwik (they all already exists).The plugin is well connected to my piwiki :
WP-Piwik 0.10.0.3 is successfully connected to Piwik 2.13.1. You are running WordPress 4.2.2
I keep gettings these errors :
PHP Warning: Illegal string offset ‘main_url’ in plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120
I added this on line 120 in wp-piwik/classes/WP_Piwik/Admin/Settings.ph :
echo "<pre>"; print_r( $piwikSiteDetails ); echo "</pre>";
Here’s what I got :
Array ( [result] => error [message] => You can't access this resource as it requires a 'superuser' access. )
On the plugin select site list, i have this :
<option value="result" selected="selected">e (e)</option> <option value="message">Y (Y)</option>
If i give superuser access (admin access is not enough) to the user I use, it works (and creates a new site if “Auto config” is on).
I have no errors on Piwik side.
Any idea ?
-
Can you please run the test script and post the results here? (Support tab -> Run test script.)
This should give the used URL to call Piwik which you can also try to use in your browser.
Piwik returns that you don’t have sufficient rights to call the API function which delivers the site list. Maybe the URL gives a hint why this did not happen with the previous version of WP-Piwik.
This is with the user being superadmin.
WP-Piwik 0.10.0.3 Mode: http Test 1/3: global.getPiwikVersion string(6) "2.13.1" Test 2/3: SitesManager.getSitesWithAtLeastViewAccess array(12) { [0]=> string(165) "https://piwik.apteo.com/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3Dresult&token_auth=..." [1]=> string(259) "HTTP/1.1 200 OK Server: nginx Date: Mon, 11 May 2015 21:02:49 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block " [2]=> array(16) { ["idsite"]=> string(1) "1" ["name"]=> string(9) "DixitCall" ["main_url"]=> string(24) "https://www.dixitcall.com" ["ts_created"]=> string(19) "2015-04-13 14:19:45" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [3]=> array(16) { ["idsite"]=> string(1) "2" ["name"]=> string(14) "Blog DixitCall" ["main_url"]=> string(25) "https://blog.dixitcall.com" ["ts_created"]=> string(19) "2015-04-14 08:03:25" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [4]=> array(16) { ["idsite"]=> string(1) "3" ["name"]=> string(5) "Bajoo" ["main_url"]=> string(20) "https://www.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:03:52" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [5]=> array(16) { ["idsite"]=> string(1) "4" ["name"]=> string(10) "Blog Bajoo" ["main_url"]=> string(21) "https://blog.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:04:08" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [6]=> array(16) { ["idsite"]=> string(1) "5" ["name"]=> string(15) "Blog ImprimShop" ["main_url"]=> string(26) "https://blog.imprimshop.com" ["ts_created"]=> string(19) "2015-04-14 08:04:36" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [7]=> array(16) { ["idsite"]=> string(1) "6" ["name"]=> string(7) "Colliat" ["main_url"]=> string(22) "https://www.colliat.com" ["ts_created"]=> string(19) "2015-04-14 08:04:52" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [8]=> array(16) { ["idsite"]=> string(1) "7" ["name"]=> string(16) "Bajoo Sécurité" ["main_url"]=> string(24) "https://securite.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:05:13" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [9]=> array(16) { ["idsite"]=> string(1) "8" ["name"]=> string(10) "ImprimShop" ["main_url"]=> string(25) "https://www.imprimshop.com" ["ts_created"]=> string(19) "2015-04-14 12:13:27" ["ecommerce"]=> string(1) "1" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [10]=> array(16) { ["idsite"]=> string(1) "9" ["name"]=> string(11) "Forum Bajoo" ["main_url"]=> string(22) "https://forum.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 12:58:29" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [11]=> array(16) { ["idsite"]=> string(2) "10" ["name"]=> string(6) "Colpic" ["main_url"]=> string(21) "https://www.colpic.com" ["ts_created"]=> string(19) "2015-04-16 10:34:06" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } } Test 3/3: SitesManager.getSitesWithAtLeastViewAccess array(3) { [0]=> string(198) "https://piwik.apteo.com/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3Dresult%26url%3Dhttp%3A%2F%2Fblog.imprimshop.com&token_auth=..." [1]=> string(259) "HTTP/1.1 200 OK Server: nginx Date: Mon, 11 May 2015 21:02:49 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block " [2]=> array(1) { ["idsite"]=> string(1) "5" } }
And this is with the user only having view right.
This seems similar to the result with super-admin access, but, i still have the same problem.WP-Piwik 0.10.0.3 Mode: http Test 1/3: global.getPiwikVersion string(6) "2.13.1" Test 2/3: SitesManager.getSitesWithAtLeastViewAccess array(12) { [0]=> string(160) "https://piwik.apteo.com/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3D1&token_auth=..." [1]=> string(259) "HTTP/1.1 200 OK Server: nginx Date: Mon, 11 May 2015 21:03:39 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block " [2]=> array(16) { ["idsite"]=> string(1) "1" ["name"]=> string(9) "DixitCall" ["main_url"]=> string(24) "https://www.dixitcall.com" ["ts_created"]=> string(19) "2015-04-13 14:19:45" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [3]=> array(16) { ["idsite"]=> string(1) "2" ["name"]=> string(14) "Blog DixitCall" ["main_url"]=> string(25) "https://blog.dixitcall.com" ["ts_created"]=> string(19) "2015-04-14 08:03:25" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [4]=> array(16) { ["idsite"]=> string(1) "3" ["name"]=> string(5) "Bajoo" ["main_url"]=> string(20) "https://www.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:03:52" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [5]=> array(16) { ["idsite"]=> string(1) "4" ["name"]=> string(10) "Blog Bajoo" ["main_url"]=> string(21) "https://blog.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:04:08" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [6]=> array(16) { ["idsite"]=> string(1) "5" ["name"]=> string(15) "Blog ImprimShop" ["main_url"]=> string(26) "https://blog.imprimshop.com" ["ts_created"]=> string(19) "2015-04-14 08:04:36" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [7]=> array(16) { ["idsite"]=> string(1) "6" ["name"]=> string(7) "Colliat" ["main_url"]=> string(22) "https://www.colliat.com" ["ts_created"]=> string(19) "2015-04-14 08:04:52" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [8]=> array(16) { ["idsite"]=> string(1) "7" ["name"]=> string(16) "Bajoo Sécurité" ["main_url"]=> string(24) "https://securite.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 08:05:13" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [9]=> array(16) { ["idsite"]=> string(1) "8" ["name"]=> string(10) "ImprimShop" ["main_url"]=> string(25) "https://www.imprimshop.com" ["ts_created"]=> string(19) "2015-04-14 12:13:27" ["ecommerce"]=> string(1) "1" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [10]=> array(16) { ["idsite"]=> string(1) "9" ["name"]=> string(11) "Forum Bajoo" ["main_url"]=> string(22) "https://forum.bajoo.fr" ["ts_created"]=> string(19) "2015-04-14 12:58:29" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } [11]=> array(16) { ["idsite"]=> string(2) "10" ["name"]=> string(6) "Colpic" ["main_url"]=> string(21) "https://www.colpic.com" ["ts_created"]=> string(19) "2015-04-16 10:34:06" ["ecommerce"]=> string(1) "0" ["sitesearch"]=> string(1) "1" ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(12) "Europe/Paris" ["currency"]=> string(3) "EUR" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> string(1) "0" } } Test 3/3: SitesManager.getSitesWithAtLeastViewAccess array(3) { [0]=> string(193) "https://piwik.apteo.com/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3D1%26url%3Dhttp%3A%2F%2Fblog.imprimshop.com&token_auth=..." [1]=> string(259) "HTTP/1.1 200 OK Server: nginx Date: Mon, 11 May 2015 21:03:39 GMT Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block " [2]=> array(1) { ["idsite"]=> string(1) "5" } }
Can you go to the expert settings, disable caching and try again, please?
Done, I edited my two previous posts with the updated results.
A few php errors i have on the wordpress server side, when not using a superadmin token.
[Mon May 11 23:03:39 2015] [error] PHP Warning: array_unshift() expects parameter 1 to be array, string given in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Rest.php on line 48, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Missing argument 2 for WP_Piwik\\Request::register(), called in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 601 and defined in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php on line 15, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Invalid argument supplied for foreach() in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php on line 62, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Illegal string offset 'name' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Illegal string offset 'main_url' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Illegal string offset 'name' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:03:39 2015] [error] PHP Warning: Illegal string offset 'main_url' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:05:23 2015] [error] PHP Warning: Illegal string offset 'name' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php&sitebrowser=1 [Mon May 11 23:05:23 2015] [error] PHP Warning: Illegal string offset 'main_url' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php&sitebrowser=1 [Mon May 11 23:05:23 2015] [error] PHP Warning: Illegal string offset 'name' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php&sitebrowser=1 [Mon May 11 23:05:23 2015] [error] PHP Warning: Illegal string offset 'main_url' in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 120, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php&sitebrowser=1 [Mon May 11 23:05:28 2015] [error] PHP Warning: Missing argument 2 for WP_Piwik\\Request::register(), called in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 596 and defined in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php on line 15, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:05:28 2015] [error] PHP Warning: Invalid argument supplied for foreach() in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php on line 62, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:05:28 2015] [error] PHP Warning: array_unshift() expects parameter 1 to be array, string given in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Rest.php on line 48, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php [Mon May 11 23:05:28 2015] [error] PHP Warning: Missing argument 2 for WP_Piwik\\Request::register(), called in wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php on line 601 and defined in wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php on line 15, referer: https://blog.imprimshop.com/wp-admin/options-general.php?page=wp-piwik%2Fclasses%2FWP_Piwik.php
And WP-Piwik is still not able to estimate the site if your Piwik account has no super user role?
Indeed, that’s the main issue i’m having.
With super admin access, auto config find the site and in manual mode, i have all my sites listed.If i go to “Site browser”, it display “result” as the site ID.
Yeah, that’s right. You get the notices and the “result” string as site ID because Piwik answers “You can’t access this resource as it requires a ‘superuser’ access.”.
Of course, I should try to fetch this error message (and I will do so), but this won’t solve the issue itself. We have to estimate, why the site request requires superuser access and the test script (which also tries to fetch the sites) works without superuser access.
I can’t check this until this evening, but maybe you can help me to get behind the issue.
- Roll back to your initial, not-working setup (using an account without super user access).
- Go to your WP-Piwik settings site.
- Open wp-piwik/config.php and change
define ( 'WP_PIWIK_ACTIVATE_LOGGER', 0 );
todefine ( 'WP_PIWIK_ACTIVATE_LOGGER', 2 );
- Make sure the folder wp-piwik/logs is writable.
- Reload your settings page.
- Copy and paste the contents from the log file store in wp-piwik/logs here. Important: Please remove your auth token if it’s shown there!
- Deactivate the logging again (
define ( 'WP_PIWIK_ACTIVATE_LOGGER', 0 );
).
Thank you very much!
[ 0.000 sec] Logging started ------------------------------- [ 0.000 sec] Store default settings [ 0.000 sec] Load settings [ 0.001 sec] Changed global option revision: 98004 [ 0.002 sec] Upgrade WP-Piwik to 0.10.0.4 [ 0.002 sec] Include update/2015051101.php [ 0.002 sec] Save settings [ 0.018 sec] Running WP-Piwik installation [ 0.018 sec] Changed global option revision: 2015051101 [ 0.018 sec] Changed global option last_settings_update: 1431419085 [ 0.018 sec] Save settings [ 0.158 sec] Logging finished ------------------------------ [ 0.000 sec] Logging started ------------------------------- [ 0.000 sec] Store default settings [ 0.000 sec] Load settings [ 0.001 sec] Changed global option revision: 98004 [ 0.001 sec] Upgrade WP-Piwik to 0.10.0.4 [ 0.002 sec] Include update/2015051101.php [ 0.002 sec] Save settings [ 0.016 sec] Running WP-Piwik installation [ 0.016 sec] Changed global option revision: 2015051101 [ 0.016 sec] Changed global option last_settings_update: 1431419089 [ 0.016 sec] Save settings [ 0.187 sec] Perform request: global.getPiwikVersion [ 0.246 sec] Result string: a:1:{i:0;s:6:"2.13.1";} [ 0.250 sec] Perform request: method=SitesManager.getAllSites [ 0.309 sec] Result string: a:1:{i:0;a:2:{s:6:"result";s:5:"error";s:7:"message";s:67:"You can't access this resource as it requires a 'superuser' access.";}} [ 1.900 sec] Logging finished ------------------------------
And the same test running the testscript, we can see that the first query work but the second fails :
[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. Don’t use blockquote. ]
[ 0.000 sec] Logging started ------------------------------- [ 0.000 sec] Store default settings [ 0.000 sec] Load settings [ 0.001 sec] Changed global option revision: 98004 [ 0.001 sec] Upgrade WP-Piwik to 0.10.0.4 [ 0.002 sec] Include update/2015051101.php [ 0.002 sec] Save settings [ 0.016 sec] Running WP-Piwik installation [ 0.016 sec] Changed global option revision: 2015051101 [ 0.016 sec] Changed global option last_settings_update: 1431419153 [ 0.016 sec] Save settings [ 0.182 sec] Perform request: global.getPiwikVersion [ 0.237 sec] Result string: a:1:{i:0;s:6:"2.13.1";} [ 0.240 sec] Perform request: method=SitesManager.getSitesWithAtLeastViewAccess [ 0.302 sec] Result string: a:1:{i:0;a:10:{i:0;a:16:{s:6:"idsite";s:1:"1";s:4:"name";s:9:"DixitCall";s:8:"main_url";s:24:"https://www.dixitcall.com";s:10:"ts_created";s:19:"2015-04-13 14:19:45";s:9:"ecom merce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"exclud ed_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:1;a:16:{s:6:"idsite";s:1:"2";s:4:"name ";s:14:"Blog DixitCall";s:8:"main_url";s:25:"https://blog.dixitcall.com";s:10:"ts_created";s:19:"2015-04-14 08:03:25";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters ";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents" ;s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:2;a:16:{s:6:"idsite";s:1:"3";s:4:"name";s:5:"Bajoo";s:8:"main_url";s:20:"https://www.bajoo.fr";s:10:"ts_created";s :19:"2015-04-14 08:03:52";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s: 8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:3;a :16:{s:6:"idsite";s:1:"4";s:4:"name";s:10:"Blog Bajoo";s:8:"main_url";s:21:"https://blog.bajoo.fr";s:10:"ts_created";s:19:"2015-04-14 08:04:08";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"si tesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:""; s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:4;a:16:{s:6:"idsite";s:1:"5";s:4:"name";s:15:"Blog ImprimShop";s:8:"main_url";s:26:"htt p://blog.imprimshop.com";s:10:"ts_created";s:19:"2015-04-14 08:04:36";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters"; s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"webs ite";s:17:"keep_url_fragment";s:1:"0";}i:5;a:16:{s:6:"idsite";s:1:"6";s:4:"name";s:7:"Colliat";s:8:"main_url";s:22:"https://www.colliat.com";s:10:"ts_created";s:19:"2015-04-14 08:04:52";s:9:"ecommerce";s :1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips"; s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:6;a:16:{s:6:"idsite";s:1:"7";s:4:"name";s:16:" Bajoo Sécurité";s:8:"main_url";s:24:"https://securite.bajoo.fr";s:10:"ts_created";s:19:"2015-04-14 08:05:13";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:""; s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s :5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:7;a:16:{s:6:"idsite";s:1:"8";s:4:"name";s:10:"ImprimShop";s:8:"main_url";s:25:"https://www.imprimshop.com";s:10:"ts_created" ;s:19:"2015-04-14 12:13:27";s:9:"ecommerce";s:1:"1";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris"; s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:8 ;a:16:{s:6:"idsite";s:1:"9";s:4:"name";s:11:"Forum Bajoo";s:8:"main_url";s:22:"https://forum.bajoo.fr";s:10:"ts_created";s:19:"2015-04-14 12:58:29";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29 :"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8:"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0 :"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17:"keep_url_fragment";s:1:"0";}i:9;a:16:{s:6:"idsite";s:2:"10";s:4:"name";s:6:"Colpic";s:8:"main_url";s:21:"https://w ww.colpic.com";s:10:"ts_created";s:19:"2015-04-16 10:34:06";s:9:"ecommerce";s:1:"0";s:10:"sitesearch";s:1:"1";s:29:"sitesearch_keyword_parameters";s:0:"";s:30:"sitesearch_category_parameters";s:0:"";s:8 :"timezone";s:12:"Europe/Paris";s:8:"currency";s:3:"EUR";s:12:"excluded_ips";s:0:"";s:19:"excluded_parameters";s:0:"";s:20:"excluded_user_agents";s:0:"";s:5:"group";s:0:"";s:4:"type";s:7:"website";s:17: "keep_url_fragment";s:1:"0";}}} [ 0.306 sec] Perform request: method=SitesManager.getSitesIdFromSiteUrl&url=https://blog.imprimshop.com [ 0.365 sec] Result string: a:1:{i:0;a:1:{i:0;a:1:{s:6:"idsite";s:1:"5";}}} [ 0.368 sec] Perform request: global.getPiwikVersion [ 0.370 sec] Perform request: method=SitesManager.getAllSites [ 0.428 sec] Result string: a:1:{i:0;a:2:{s:6:"result";s:5:"error";s:7:"message";s:67:"You can't access this resource as it requires a 'superuser' access.";}} [ 2.007 sec] Logging finished ------------------------------
Thank you very, very much – I got it ??
I will provide an update today.
If you like to solve this via hotfix:
- Open wp-piwik/classes/WP-Piwik.php
- Go to line 972:
$id = WP_Piwik\Request::register ( 'SitesManager.getAllSites', array () );
- Change to:
$id = WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array () );
I’m so sorry… This was a really dopy error.
No problem, it happens and i was able to make it works with superadmin access anyway ??
I don’t know if you can, but I can’t edit my old posts and i’d rather not let the blogs or piwik urls stay public ??
If you can, please delete my posts or remove the logs.
Thanks.So, I’ve tried that line 972 fix and I get a properly populated dropdown, but I can’t get any tracking code or stats from within WP.
The error message says “The parameter ‘idSite=’ is missing from the request.”
- The topic ‘You can't access this resource as it requires a 'superuser' access.’ is closed to new replies.