• Resolved DamianDadswell

    (@damiandadswell)


    Hi there,

    WP-Piwik is currently unable to connect to the Piwik installation, nothing has changed on the server other than the plugin being updated.

    I am currently running the following setup:

    wordpress version 4.2.2
    wp piwik 1.0.1
    piwik 2.13.1.

    When I run the test script I get the following report

    WP-Piwik 1.0.1
    Mode: http
    
    Test 1/3: global.getPiwikVersion
    
    bool(false)
    
    array(2) {
      [0]=>
      bool(false)
      [1]=>
      string(146) "https://analytics.mksmart.org/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3Dn%2Fa&token_auth=..."
    }
    
    Test 2/3: SitesManager.getSitesWithAtLeastViewAccess
    
    bool(false)
    
    array(2) {
      [0]=>
      bool(false)
      [1]=>
      string(223) "https://analytics.mksmart.org/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3Dn%2Fa&urls[1]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3Dn%2Fa&token_auth=..."
    }
    
    Test 3/3: SitesManager.getSitesIdFromSiteUrl
    
    bool(false)
    
    array(2) {
      [0]=>
      bool(false)
      [1]=>
      string(329) "https://analytics.mksmart.org/?module=API&method=API.getBulkRequest&format=php&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3Dn%2Fa&urls[1]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3Dn%2Fa&urls[2]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3Dn%2Fa%26url%3Dhttp%3A%2F%2Fwww.mksmart.org&token_auth=..."
    }
    
    array(2) {
      ["global_settings"]=>
      array(52) {
        ["revision"]=>
        string(10) "2015053001"
        ["last_settings_update"]=>
        string(10) "1433340121"
        ["piwik_mode"]=>
        string(4) "http"
        ["piwik_url"]=>
        string(29) "https://analytics.mksmart.org/"
        ["piwik_path"]=>
        string(36) "\data\web\analytics.mksmart.org\www\"
        ["piwik_user"]=>
        string(0) ""
        ["piwik_token"]=>
        string(3) "set"
        ["auto_site_config"]=>
        string(1) "1"
        ["default_date"]=>
        string(9) "yesterday"
        ["stats_seo"]=>
        string(1) "0"
        ["dashboard_widget"]=>
        string(8) "disabled"
        ["dashboard_chart"]=>
        string(1) "0"
        ["dashboard_seo"]=>
        string(1) "0"
        ["toolbar"]=>
        string(1) "0"
        ["capability_read_stats"]=>
        array(5) {
          ["administrator"]=>
          string(1) "1"
          ["editor"]=>
          string(1) "0"
          ["author"]=>
          string(1) "0"
          ["contributor"]=>
          string(1) "0"
          ["subscriber"]=>
          string(1) "0"
        }
        ["perpost_stats"]=>
        string(1) "0"
        ["plugin_display_name"]=>
        string(8) "WP-Piwik"
        ["piwik_shortcut"]=>
        string(1) "0"
        ["shortcodes"]=>
        string(1) "0"
        ["track_mode"]=>
        string(8) "disabled"
        ["track_codeposition"]=>
        string(6) "footer"
        ["track_noscript"]=>
        string(1) "0"
        ["track_nojavascript"]=>
        string(1) "0"
        ["proxy_url"]=>
        string(0) ""
        ["track_content"]=>
        string(8) "disabled"
        ["track_search"]=>
        string(1) "0"
        ["track_404"]=>
        string(1) "0"
        ["add_post_annotations"]=>
        string(1) "0"
        ["add_customvars_box"]=>
        string(1) "0"
        ["add_download_extensions"]=>
        string(0) ""
        ["disable_cookies"]=>
        string(1) "0"
        ["limit_cookies"]=>
        string(1) "0"
        ["limit_cookies_visitor"]=>
        string(8) "34186669"
        ["limit_cookies_session"]=>
        string(4) "1800"
        ["limit_cookies_referral"]=>
        string(8) "15778463"
        ["track_admin"]=>
        string(1) "0"
        ["capability_stealth"]=>
        array(0) {
        }
        ["track_across"]=>
        string(1) "0"
        ["track_across_alias"]=>
        string(1) "0"
        ["track_feed"]=>
        string(1) "0"
        ["track_feed_addcampaign"]=>
        string(1) "0"
        ["track_feed_campaign"]=>
        string(4) "feed"
        ["cache"]=>
        string(1) "1"
        ["disable_timelimit"]=>
        string(1) "0"
        ["connection_timeout"]=>
        string(1) "5"
        ["disable_ssl_verify"]=>
        string(1) "0"
        ["piwik_useragent"]=>
        string(3) "php"
        ["piwik_useragent_string"]=>
        string(8) "WP-Piwik"
        ["track_datacfasync"]=>
        string(1) "0"
        ["track_cdnurl"]=>
        string(0) ""
        ["track_cdnurlssl"]=>
        string(0) ""
        ["force_protocol"]=>
        string(8) "disabled"
      }
      ["settings"]=>
      array(6) {
        ["name"]=>
        string(0) ""
        ["site_id"]=>
        string(3) "n/a"
        ["noscript_code"]=>
        string(0) ""
        ["tracking_code"]=>
        string(640) "<!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u="//analytics.mksmart.org/";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 1]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <noscript><p><img src="//analytics.mksmart.org/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
    <!-- End Piwik Code -->"
        ["last_tracking_code_update"]=>
        string(1) "0"
        ["dashboard_revision"]=>
        string(1) "0"
      }
    }

    If I browse to the URL provided in the report (including my auth token) I get the following output

    a:1:{i:0;s:6:”2.13.1″;}

    Thanks for your help with this matter.

    https://www.ads-software.com/plugins/wp-piwik/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author braekling

    (@braekling)

    The request is not sent or the server does not reply… even no status code is responded.

    Are you using any caching plugin/tool? Can you try to clear/disable this?

    Please also try to disable WP-Piwik’s caching… this should not affect the test script results, but just to be sure. (Settings -> WP-Piwik -> Expert settings)

    Thread Starter DamianDadswell

    (@damiandadswell)

    Thanks for your reply.

    I am not using any caching plugin, so nothing to disable there.

    I disabled WP-Piwik caching as per your request but the situation is still the same.

    Plugin Author braekling

    (@braekling)

    Did you check the WP-Piwik settings or the WP-Piwik dashboard within the last weeks or months? If your server configuration changes but WP-Piwik is well configure, the tracking code is added as expected and the dashboard/settings page is not used, this issue may be noticed after a WP-Piwik update, only.

    Why I ask this question? The behavior shown by your test script typically appears if the request is blocked by mod_security or similar solutions.

    If you are absolutely sure it worked just before the update was performed: Are you able to switch to the PHP API? This works if Piwik and WordPress are running at the same server; you just need the full file path to Piwik (e.g., /var/www/vhost/piwik.example.com/httpdocs/, /var/www/piwik/, …).

    Thread Starter DamianDadswell

    (@damiandadswell)

    I switched to using the PHP API and the connection is now back up and running.

    Many thanks for your help on this matter!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP-Piwik 1.0.1 was not able to connect to Piwik using your configuration.’ is closed to new replies.