Version Description
- Piwik 1.11 compaitbility fixes (Piwik 1.11 required now!)
- Depending on Piwik 1.11 WP-Piwik will use async tracking now
- CDN support added, see http://wordpress.org/support/topic/request-cdn-support-1
Download this release
Release Info
Developer | Braekling |
Plugin | WP-Matomo (WP-Piwik) |
Version | 0.9.9.0 |
Comparing to | |
See all releases |
Code changes from version 0.9.8.1 to 0.9.9.0
- languages/wp-piwik-de_DE.mo +0 -0
- languages/wp-piwik-de_DE.po +7 -1
- languages/wp-piwik-it_IT.mo +0 -0
- languages/wp-piwik-it_IT.po +34 -18
- piwik.php +12 -12
- readme.txt +8 -3
- settings/tracking.php +6 -2
- update/90821.php +2 -0
- wp-piwik.php +37 -29
languages/wp-piwik-de_DE.mo
CHANGED
Binary file
|
languages/wp-piwik-de_DE.po
CHANGED
@@ -659,4 +659,10 @@ msgid "Site Search Keywords"
|
|
659 |
msgstr "Suchanfragen"
|
660 |
|
661 |
msgid "Site Search without Results"
|
662 |
-
msgstr "Suchanfragen ohne Ergebnisse"
|
|
|
|
|
|
|
|
|
|
|
|
659 |
msgstr "Suchanfragen"
|
660 |
|
661 |
msgid "Site Search without Results"
|
662 |
+
msgstr "Suchanfragen ohne Ergebnisse"
|
663 |
+
|
664 |
+
msgid "Disabled in proxy mode."
|
665 |
+
msgstr "Im Proxy-Modus deaktiviert."
|
666 |
+
|
667 |
+
msgid "Leave blank if you do not want to define a CDN URL or you do not know what this is."
|
668 |
+
msgstr "Einfach freilassen, falls Du keine CDN URL definieren möchtest oder nicht weißt, worum es geht."
|
languages/wp-piwik-it_IT.mo
CHANGED
Binary file
|
languages/wp-piwik-it_IT.po
CHANGED
@@ -9,7 +9,7 @@ msgstr ""
|
|
9 |
"Project-Id-Version: WP-Piwik 0.8.4\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-piwik\n"
|
11 |
"POT-Creation-Date: 2010-07-19 18:06+0000\n"
|
12 |
-
"PO-Revision-Date: 2013-
|
13 |
"Last-Translator: Stef Binde <ste@vogliaditerra.com>\n"
|
14 |
"Language-Team: Italian <ste@vogliaditerra.com>\n"
|
15 |
"MIME-Version: 1.0\n"
|
@@ -76,7 +76,7 @@ msgstr "Media durata per visita"
|
|
76 |
|
77 |
#: dashboard/overview.php:47
|
78 |
msgid "Bounce count"
|
79 |
-
msgstr "
|
80 |
|
81 |
#: dashboard/overview.php:49 wp-piwik.php:563
|
82 |
msgid "Shortcut"
|
@@ -216,7 +216,11 @@ msgid ""
|
|
216 |
"your site admin is able to get your auth token from the database. So he is "
|
217 |
"able to access your statistics. You should never use an auth token with more "
|
218 |
"than simple view access!"
|
219 |
-
msgstr "
|
|
|
|
|
|
|
|
|
220 |
|
221 |
#: wp-piwik.php:485 wp-piwik.php:489
|
222 |
msgid "An error occured"
|
@@ -322,6 +326,13 @@ msgid ""
|
|
322 |
"sites added. The provided themes should use wp_footer, because it adds the "
|
323 |
"Piwik javascript code to each page."
|
324 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
|
326 |
#: wp-piwik.php:671
|
327 |
msgid "If you like WP-Piwik, you can support its development by a donation:"
|
@@ -360,7 +371,7 @@ msgid "Thank you very much for your donation"
|
|
360 |
msgstr "Grazie per le vostre donazioni"
|
361 |
|
362 |
msgid "and all people flattering this"
|
363 |
-
msgstr "
|
364 |
|
365 |
msgid ""
|
366 |
"Graphs powered by <a href=\"http://www.jqplot.com/\">jqPlot</a>, an open "
|
@@ -398,16 +409,16 @@ msgid "Changes saved"
|
|
398 |
msgstr "Cambiamenti salvati"
|
399 |
|
400 |
msgid "installed"
|
401 |
-
msgstr "
|
402 |
|
403 |
msgid "Next you should connect to Piwik"
|
404 |
-
msgstr "
|
405 |
|
406 |
msgid "Please validate your configuration"
|
407 |
-
msgstr "
|
408 |
|
409 |
msgid "Default date"
|
410 |
-
msgstr "
|
411 |
|
412 |
msgid "Default date shown on statistics page."
|
413 |
msgstr "Il giorno che verrà mostrato sulla pagina delle statistiche."
|
@@ -435,7 +446,7 @@ msgstr ""
|
|
435 |
"tramite l'URL. Se il tuo blog non è inserito in Piwik Wp-Piwik lo aggiungerà."
|
436 |
|
437 |
msgid "If you add the Piwik javascript code by wp_footer(),"
|
438 |
-
msgstr "
|
439 |
|
440 |
msgid "WP-Piwik can automatically use js/index.php instead of piwik.js. See"
|
441 |
msgstr ""
|
@@ -448,7 +459,7 @@ msgstr ""
|
|
448 |
"POST. Vedi"
|
449 |
|
450 |
msgid "Avoid mod_security"
|
451 |
-
msgstr "
|
452 |
|
453 |
msgid "Determined site"
|
454 |
msgstr "Sito rilevato"
|
@@ -475,14 +486,13 @@ msgstr ""
|
|
475 |
msgid ""
|
476 |
"Configure WP-Piwik widgets to be shown on your WordPress Home Dashboard."
|
477 |
msgstr ""
|
478 |
-
"
|
479 |
-
"erscheinen sollen."
|
480 |
|
481 |
msgid "SEO data"
|
482 |
msgstr "Dati SEO"
|
483 |
|
484 |
msgid "the Piwik team itself"
|
485 |
-
msgstr "
|
486 |
|
487 |
msgid "Metabox support inspired by"
|
488 |
msgstr "Supporto Metabox ispirato da"
|
@@ -546,6 +556,9 @@ msgid ""
|
|
546 |
"<strong>Important note:</strong> If you do not host this blog on your own, "
|
547 |
"your site admin is able to get your auth token from the database."
|
548 |
msgstr ""
|
|
|
|
|
|
|
549 |
|
550 |
msgid "Add tracking code"
|
551 |
msgstr "Inserisci codice tracciamento"
|
@@ -578,10 +591,10 @@ msgid "available"
|
|
578 |
msgstr "disponibile"
|
579 |
|
580 |
msgid "Test script result"
|
581 |
-
msgstr ""
|
582 |
|
583 |
msgid "Please confirm your reset request"
|
584 |
-
msgstr ""
|
585 |
|
586 |
msgid ""
|
587 |
"YES, please reset <strong>all</strong> WP-Piwik settings <strong>except<"
|
@@ -591,7 +604,7 @@ msgstr ""
|
|
591 |
"eccezione del codice di autenticazione e l'Url di Piwik."
|
592 |
|
593 |
msgid "WP-Piwik reset done"
|
594 |
-
msgstr "WP-Piwik
|
595 |
|
596 |
msgid "Get more debug information"
|
597 |
msgstr "Ottieni più informazioni per il debug"
|
@@ -636,7 +649,7 @@ msgstr ""
|
|
636 |
"timeout."
|
637 |
|
638 |
msgid "in network mode"
|
639 |
-
msgstr "
|
640 |
|
641 |
msgid "To enable Piwik statistics, please enter"
|
642 |
msgstr "Per attivare le statistiche di Piwik devi inserire"
|
@@ -699,6 +712,9 @@ msgid ""
|
|
699 |
"please enter your Piwik URL, too. Otherwise your tracking code may be "
|
700 |
"erroneous."
|
701 |
msgstr ""
|
|
|
|
|
|
|
702 |
|
703 |
msgid "Title"
|
704 |
msgstr "Titolo"
|
@@ -716,7 +732,7 @@ msgid "not recommended"
|
|
716 |
msgstr "sconsigliato"
|
717 |
|
718 |
msgid "Invalid path. Please enter the file path to Piwik."
|
719 |
-
msgstr "
|
720 |
|
721 |
msgid "Enable shortcodes in post or page content."
|
722 |
msgstr "Attiva scorciatoie nel contenuto di articoli e pagine. "
|
9 |
"Project-Id-Version: WP-Piwik 0.8.4\n"
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-piwik\n"
|
11 |
"POT-Creation-Date: 2010-07-19 18:06+0000\n"
|
12 |
+
"PO-Revision-Date: 2013-02-21 18:11+0100\n"
|
13 |
"Last-Translator: Stef Binde <ste@vogliaditerra.com>\n"
|
14 |
"Language-Team: Italian <ste@vogliaditerra.com>\n"
|
15 |
"MIME-Version: 1.0\n"
|
76 |
|
77 |
#: dashboard/overview.php:47
|
78 |
msgid "Bounce count"
|
79 |
+
msgstr "Rimbalzi "
|
80 |
|
81 |
#: dashboard/overview.php:49 wp-piwik.php:563
|
82 |
msgid "Shortcut"
|
216 |
"your site admin is able to get your auth token from the database. So he is "
|
217 |
"able to access your statistics. You should never use an auth token with more "
|
218 |
"than simple view access!"
|
219 |
+
msgstr ""
|
220 |
+
"<strong>Nota importante:</strong><strong>Nota importante:</strong> Se non è "
|
221 |
+
"un hosting personale l'amministratore del sito può passarti il codice di "
|
222 |
+
"autorizzazione (auth token) dal database. Mai usare un auth token con più "
|
223 |
+
"diritti che lettura."
|
224 |
|
225 |
#: wp-piwik.php:485 wp-piwik.php:489
|
226 |
msgid "An error occured"
|
326 |
"sites added. The provided themes should use wp_footer, because it adds the "
|
327 |
"Piwik javascript code to each page."
|
328 |
msgstr ""
|
329 |
+
"<strong>Nota importante:</strong> Devi scegliere un token che permette "
|
330 |
+
"accesso come amministratore. WPMU-Piwik creerà nuove pagine Piwik per "
|
331 |
+
"ciascuno blog nuovo non aggiunto già. Gli utenti possono accedere alle loro "
|
332 |
+
"statistiche mentre gli amministratori del sito possono accedere a tutte le "
|
333 |
+
"statistiche. Per evitare conflitti dovresti usare una installazione Piwik "
|
334 |
+
"fresca e pulita. I temi scelti dovrebbero usare wp_footer per aggiungere il "
|
335 |
+
"codice ad ogni pagina."
|
336 |
|
337 |
#: wp-piwik.php:671
|
338 |
msgid "If you like WP-Piwik, you can support its development by a donation:"
|
371 |
msgstr "Grazie per le vostre donazioni"
|
372 |
|
373 |
msgid "and all people flattering this"
|
374 |
+
msgstr "e a tutti gli utenti che cliccano Flattr"
|
375 |
|
376 |
msgid ""
|
377 |
"Graphs powered by <a href=\"http://www.jqplot.com/\">jqPlot</a>, an open "
|
409 |
msgstr "Cambiamenti salvati"
|
410 |
|
411 |
msgid "installed"
|
412 |
+
msgstr "installato"
|
413 |
|
414 |
msgid "Next you should connect to Piwik"
|
415 |
+
msgstr "Adesso crea una connessione a Piwik"
|
416 |
|
417 |
msgid "Please validate your configuration"
|
418 |
+
msgstr "Per favore controlla la tua configurazione"
|
419 |
|
420 |
msgid "Default date"
|
421 |
+
msgstr "Default data"
|
422 |
|
423 |
msgid "Default date shown on statistics page."
|
424 |
msgstr "Il giorno che verrà mostrato sulla pagina delle statistiche."
|
446 |
"tramite l'URL. Se il tuo blog non è inserito in Piwik Wp-Piwik lo aggiungerà."
|
447 |
|
448 |
msgid "If you add the Piwik javascript code by wp_footer(),"
|
449 |
+
msgstr "Se inserisci il codice di Piwik tramite wp_footer() nel tuo blog,"
|
450 |
|
451 |
msgid "WP-Piwik can automatically use js/index.php instead of piwik.js. See"
|
452 |
msgstr ""
|
459 |
"POST. Vedi"
|
460 |
|
461 |
msgid "Avoid mod_security"
|
462 |
+
msgstr "Evita mod_security"
|
463 |
|
464 |
msgid "Determined site"
|
465 |
msgstr "Sito rilevato"
|
486 |
msgid ""
|
487 |
"Configure WP-Piwik widgets to be shown on your WordPress Home Dashboard."
|
488 |
msgstr ""
|
489 |
+
"Configura i widget di WP-Piwik per il resoconto sulla Dashboard di Wordpress."
|
|
|
490 |
|
491 |
msgid "SEO data"
|
492 |
msgstr "Dati SEO"
|
493 |
|
494 |
msgid "the Piwik team itself"
|
495 |
+
msgstr "il team di Piwik stesso"
|
496 |
|
497 |
msgid "Metabox support inspired by"
|
498 |
msgstr "Supporto Metabox ispirato da"
|
556 |
"<strong>Important note:</strong> If you do not host this blog on your own, "
|
557 |
"your site admin is able to get your auth token from the database."
|
558 |
msgstr ""
|
559 |
+
"<strong>Nota importante:</strong> Se non è un hosting personale "
|
560 |
+
"l'amministratore del sito può passarti il codice di autorizzazione (auth "
|
561 |
+
"token) dal database."
|
562 |
|
563 |
msgid "Add tracking code"
|
564 |
msgstr "Inserisci codice tracciamento"
|
591 |
msgstr "disponibile"
|
592 |
|
593 |
msgid "Test script result"
|
594 |
+
msgstr "Risultati del test"
|
595 |
|
596 |
msgid "Please confirm your reset request"
|
597 |
+
msgstr "Conferma la tua richiesta di reset"
|
598 |
|
599 |
msgid ""
|
600 |
"YES, please reset <strong>all</strong> WP-Piwik settings <strong>except<"
|
604 |
"eccezione del codice di autenticazione e l'Url di Piwik."
|
605 |
|
606 |
msgid "WP-Piwik reset done"
|
607 |
+
msgstr "WP-Piwik è stato resettato"
|
608 |
|
609 |
msgid "Get more debug information"
|
610 |
msgstr "Ottieni più informazioni per il debug"
|
649 |
"timeout."
|
650 |
|
651 |
msgid "in network mode"
|
652 |
+
msgstr "in modalità rete"
|
653 |
|
654 |
msgid "To enable Piwik statistics, please enter"
|
655 |
msgstr "Per attivare le statistiche di Piwik devi inserire"
|
712 |
"please enter your Piwik URL, too. Otherwise your tracking code may be "
|
713 |
"erroneous."
|
714 |
msgstr ""
|
715 |
+
"Se preferisci usare PHP API e il tracciamento con WP-Piwik, "
|
716 |
+
"inserisci anche l'Url di Piwik. Altrimenti il tuo codice di tracciamento "
|
717 |
+
"potrebbero contenere degli errori."
|
718 |
|
719 |
msgid "Title"
|
720 |
msgstr "Titolo"
|
732 |
msgstr "sconsigliato"
|
733 |
|
734 |
msgid "Invalid path. Please enter the file path to Piwik."
|
735 |
+
msgstr "Percorso non valido. Per favore inserire il percorso corretto a Piwik."
|
736 |
|
737 |
msgid "Enable shortcodes in post or page content."
|
738 |
msgstr "Attiva scorciatoie nel contenuto di articoli e pagine. "
|
piwik.php
CHANGED
@@ -6,8 +6,7 @@
|
|
6 |
|
7 |
/* PIWIK PROXY SCRIPT */
|
8 |
|
9 |
-
/*
|
10 |
-
== Description ==
|
11 |
This script allows to track statistics using Piwik, without revealing the
|
12 |
Piwik Server URL. This is useful for users who track multiple websites
|
13 |
in the same Piwik server, but don't want to show in the source code of all tracked
|
@@ -32,15 +31,16 @@
|
|
32 |
instead of calling directly the (secret) Piwik Server URL (http://piwik-server.com/piwik/).
|
33 |
7) You now need to add the modified Piwik Javascript Code to the footer of your pages at http://trackedsite.com/
|
34 |
Go to Piwik > Settings > Websites > Show Javascript Tracking Code.
|
35 |
-
Copy the Javascript snippet. Then, edit this code and change the
|
36 |
-
<script type="text/javascript">
|
37 |
-
var pkBaseURL = (("https:" == document.location.protocol) ? "https://trackedsite.com/" : "http://trackedsite.com/");
|
38 |
-
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.php' type='text/javascript'%3E%3C/script%3E"));
|
39 |
-
</script><script type="text/javascript">
|
40 |
-
try {
|
41 |
-
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
|
42 |
[...]
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
What's changed in this code snippet compared to the normal Piwik code?
|
46 |
A) the (secret) Piwik URL is now replaced by your website URL
|
@@ -89,7 +89,7 @@ if(empty($_GET))
|
|
89 |
|
90 |
// set HTTP response headers
|
91 |
header('Vary: Accept-Encoding');
|
92 |
-
|
93 |
// Returns 304 if not modified since
|
94 |
if (!empty($modifiedSince) && $modifiedSince < $lastModified)
|
95 |
{
|
@@ -120,4 +120,4 @@ $stream_options = array('http' => array(
|
|
120 |
'timeout' => $timeout
|
121 |
));
|
122 |
$ctx = stream_context_create($stream_options);
|
123 |
-
echo file_get_contents($url, 0, $ctx);
|
6 |
|
7 |
/* PIWIK PROXY SCRIPT */
|
8 |
|
9 |
+
/* == Description ==
|
|
|
10 |
This script allows to track statistics using Piwik, without revealing the
|
11 |
Piwik Server URL. This is useful for users who track multiple websites
|
12 |
in the same Piwik server, but don't want to show in the source code of all tracked
|
31 |
instead of calling directly the (secret) Piwik Server URL (http://piwik-server.com/piwik/).
|
32 |
7) You now need to add the modified Piwik Javascript Code to the footer of your pages at http://trackedsite.com/
|
33 |
Go to Piwik > Settings > Websites > Show Javascript Tracking Code.
|
34 |
+
Copy the Javascript snippet. Then, edit this code and change the last lines to the following:
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
[...]
|
36 |
+
(function() {
|
37 |
+
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://trackedsite.com/";
|
38 |
+
_paq.push(["setTrackerUrl", u+"piwik.php"]);
|
39 |
+
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
|
40 |
+
g.defer=true; g.async=true; g.src=u+"piwik.php"; s.parentNode.insertBefore(g,s);
|
41 |
+
})();
|
42 |
+
</script>
|
43 |
+
<!-- End Piwik Code -->
|
44 |
|
45 |
What's changed in this code snippet compared to the normal Piwik code?
|
46 |
A) the (secret) Piwik URL is now replaced by your website URL
|
89 |
|
90 |
// set HTTP response headers
|
91 |
header('Vary: Accept-Encoding');
|
92 |
+
|
93 |
// Returns 304 if not modified since
|
94 |
if (!empty($modifiedSince) && $modifiedSince < $lastModified)
|
95 |
{
|
120 |
'timeout' => $timeout
|
121 |
));
|
122 |
$ctx = stream_context_create($stream_options);
|
123 |
+
echo file_get_contents($url, 0, $ctx);
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Contributors: Braekling
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 3.5.1
|
6 |
-
Stable tag: 0.9.
|
7 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
|
8 |
Tags: statistics, stats, analytics, piwik, wpmu
|
9 |
|
@@ -13,7 +13,7 @@ This plugin adds a Piwik stats site to your WordPress or WordPress multisite das
|
|
13 |
|
14 |
This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
|
15 |
|
16 |
-
**You need a running Piwik (at least 1.
|
17 |
|
18 |
Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
|
19 |
|
@@ -110,10 +110,15 @@ Add WP-Piwik to your /wp-content/plugins folder and enable it as [Network Plugin
|
|
110 |
|
111 |
== Upgrade Notice ==
|
112 |
|
113 |
-
Please update Piwik if not done yet (Piwik 1.
|
114 |
|
115 |
== Changelog ==
|
116 |
|
|
|
|
|
|
|
|
|
|
|
117 |
= 0.9.8.1 =
|
118 |
* Warning on empty data removed (overview table)
|
119 |
* Removed a possible deadlock
|
3 |
Contributors: Braekling
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 3.5.1
|
6 |
+
Stable tag: 0.9.9.0
|
7 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
|
8 |
Tags: statistics, stats, analytics, piwik, wpmu
|
9 |
|
13 |
|
14 |
This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
|
15 |
|
16 |
+
**You need a running Piwik (at least 1.11) installation** and at least view access to your stats. Also PHP 5 or higher is strictly required.
|
17 |
|
18 |
Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
|
19 |
|
110 |
|
111 |
== Upgrade Notice ==
|
112 |
|
113 |
+
Please update Piwik if not done yet (Piwik 1.11 or higher is recommended)!
|
114 |
|
115 |
== Changelog ==
|
116 |
|
117 |
+
= 0.9.9.0 =
|
118 |
+
* Piwik 1.11 compaitbility fixes (Piwik 1.11 required now!)
|
119 |
+
* Depending on Piwik 1.11 WP-Piwik will use async tracking now
|
120 |
+
* CDN support added, see http://wordpress.org/support/topic/request-cdn-support-1
|
121 |
+
|
122 |
= 0.9.8.1 =
|
123 |
* Warning on empty data removed (overview table)
|
124 |
* Removed a possible deadlock
|
settings/tracking.php
CHANGED
@@ -29,7 +29,7 @@ if (self::$aryGlobalSettings['add_tracking_code']) {
|
|
29 |
?>
|
30 |
<table id="wp-piwik-tracking-settings" class="wp-piwik-form-table form-table<?php echo (!self::$aryGlobalSettings['add_tracking_code']?' wp-piwik-form-table-hide':''); ?>">
|
31 |
<tr><th><?php _e('Tracking code preview', 'wp-piwik'); ?>:</th><td>
|
32 |
-
<textarea id="wp-piwik_jscode" name="wp-piwik_jscode" readonly="readonly" rows="13" cols="
|
33 |
<?php echo (is_plugin_active_for_network('wp-piwik/wp-piwik.php')?'*** SITE SPECIFIC EXAMPLE CODE ***'."\n":'').htmlentities(self::$arySettings['tracking_code']); ?>
|
34 |
</textarea>
|
35 |
</td></tr>
|
@@ -64,7 +64,11 @@ if (self::$aryGlobalSettings['add_tracking_code']) {
|
|
64 |
</td></tr>
|
65 |
<tr><th><?php _e('Avoid mod_security', 'wp-piwik'); ?>:</th><td>
|
66 |
<input type="checkbox" value="1" id="wp-piwik_reqpost" name="wp-piwik_reqpost"<?php echo (self::$aryGlobalSettings['track_post']?' checked="checked"':''); ?> />
|
67 |
-
<label for="wp-piwik_reqpost"><?php _e('WP-Piwik can automatically force the Tracking Code to sent data in POST. See', 'wp-piwik'); ?> <a href="http://piwik.org/faq/troubleshooting/#faq_100">Piwik FAQ</a
|
|
|
|
|
|
|
|
|
68 |
</td></tr>
|
69 |
<tr><th><?php _e('Tracking filter', 'wp-piwik'); ?>:</th><td>
|
70 |
<?php
|
29 |
?>
|
30 |
<table id="wp-piwik-tracking-settings" class="wp-piwik-form-table form-table<?php echo (!self::$aryGlobalSettings['add_tracking_code']?' wp-piwik-form-table-hide':''); ?>">
|
31 |
<tr><th><?php _e('Tracking code preview', 'wp-piwik'); ?>:</th><td>
|
32 |
+
<textarea id="wp-piwik_jscode" name="wp-piwik_jscode" readonly="readonly" rows="13" cols="80">
|
33 |
<?php echo (is_plugin_active_for_network('wp-piwik/wp-piwik.php')?'*** SITE SPECIFIC EXAMPLE CODE ***'."\n":'').htmlentities(self::$arySettings['tracking_code']); ?>
|
34 |
</textarea>
|
35 |
</td></tr>
|
64 |
</td></tr>
|
65 |
<tr><th><?php _e('Avoid mod_security', 'wp-piwik'); ?>:</th><td>
|
66 |
<input type="checkbox" value="1" id="wp-piwik_reqpost" name="wp-piwik_reqpost"<?php echo (self::$aryGlobalSettings['track_post']?' checked="checked"':''); ?> />
|
67 |
+
<label for="wp-piwik_reqpost"><?php _e('WP-Piwik can automatically force the Tracking Code to sent data in POST. See', 'wp-piwik'); ?> <a href="http://piwik.org/faq/troubleshooting/#faq_100">Piwik FAQ</a>. <?php _e('Disabled in proxy mode.', 'wp-piwik'); ?></label>
|
68 |
+
</td></tr>
|
69 |
+
<tr><th><?php _e('CDN URL', 'wp-piwik'); ?>:</th><td>
|
70 |
+
http(s)://<input type="text" value="<?php echo self::$aryGlobalSettings['track_cdnurl']; ?>" id="wp-piwik_cdnurl" name="wp-piwik_cdnurl" />
|
71 |
+
<label for="wp-piwik_reqpost"><?php _e('Leave blank if you do not want to define a CDN URL or you do not know what this is.', 'wp-piwik'); ?></label>
|
72 |
</td></tr>
|
73 |
<tr><th><?php _e('Tracking filter', 'wp-piwik'); ?>:</th><td>
|
74 |
<?php
|
update/90821.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
self::$aryGlobalSettings['track_cdnurl'] = '';
|
wp-piwik.php
CHANGED
@@ -4,9 +4,9 @@ Plugin Name: WP-Piwik
|
|
4 |
|
5 |
Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
|
6 |
|
7 |
-
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress
|
8 |
|
9 |
-
Version: 0.9.
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
@@ -51,13 +51,13 @@ if (!function_exists('is_plugin_active_for_network'))
|
|
51 |
class wp_piwik {
|
52 |
|
53 |
private static
|
54 |
-
$intRevisionId =
|
55 |
-
$strVersion = '0.9.
|
56 |
$intDashboardID = 30,
|
57 |
$strPluginBasename = NULL,
|
58 |
$bolJustActivated = false,
|
59 |
$aryGlobalSettings = array(
|
60 |
-
'revision' =>
|
61 |
'add_tracking_code' => false,
|
62 |
'last_settings_update' => 0,
|
63 |
'piwik_token' => '',
|
@@ -81,6 +81,7 @@ class wp_piwik {
|
|
81 |
'track_mode' => 0,
|
82 |
'track_post' => false,
|
83 |
'track_proxy' => false,
|
|
|
84 |
'disable_timelimit' => false,
|
85 |
'disable_ssl_verify' => false,
|
86 |
'disable_cookies' => false,
|
@@ -192,8 +193,8 @@ class wp_piwik {
|
|
192 |
if (self::$aryGlobalSettings['shortcodes'])
|
193 |
add_shortcode( 'wp-piwik', array(&$this, 'shortcode'));
|
194 |
|
195 |
-
// Add tracking code to
|
196 |
-
if (self::$aryGlobalSettings['add_tracking_code']) add_action('
|
197 |
}
|
198 |
|
199 |
/**
|
@@ -262,6 +263,9 @@ class wp_piwik {
|
|
262 |
self::includeFile('update/90700');
|
263 |
if (self::$aryGlobalSettings['revision'] < 90805)
|
264 |
self::includeFile('update/90801');
|
|
|
|
|
|
|
265 |
// Install new version
|
266 |
$this->installPlugin();
|
267 |
}
|
@@ -306,7 +310,7 @@ class wp_piwik {
|
|
306 |
/**
|
307 |
* Add tracking code
|
308 |
*/
|
309 |
-
function
|
310 |
// Hotfix: Custom capability problem with WP multisite
|
311 |
if (is_multisite()) {
|
312 |
foreach (self::$aryGlobalSettings['capability_stealth'] as $strKey => $strVal)
|
@@ -314,7 +318,7 @@ class wp_piwik {
|
|
314 |
return;
|
315 |
// Don't add tracking code?
|
316 |
} elseif (current_user_can('wp-piwik_stealth')) {
|
317 |
-
echo '<!-- *** WP-Piwik - see http://
|
318 |
echo '<!-- Current user should not be tracked. -->'."\n";
|
319 |
echo '<!-- *** /WP-Piwik *********************************************************** -->'."\n";
|
320 |
return;
|
@@ -331,17 +335,17 @@ class wp_piwik {
|
|
331 |
}
|
332 |
// Change code if 404
|
333 |
if (is_404() && self::$aryGlobalSettings['track_404'])
|
334 |
-
$strTrackingCode = str_replace('
|
335 |
// Change code if search result
|
336 |
elseif (is_search() && self::$aryGlobalSettings['track_search']) {
|
337 |
$objSearch = new WP_Query("s=" . get_search_query() . '&showposts=-1');
|
338 |
$intResultCount = $objSearch->post_count;
|
339 |
-
$strTrackingCode = str_replace('
|
340 |
// Use default tracking code
|
341 |
} else
|
342 |
$strTrackingCode = self::$arySettings['tracking_code'];
|
343 |
// Send tracking code
|
344 |
-
echo '<!-- *** WP-Piwik - see http://
|
345 |
// Add custom variables if set:
|
346 |
if (is_single()) {
|
347 |
$strCustomVars = '';
|
@@ -352,11 +356,10 @@ class wp_piwik {
|
|
352 |
$strMetaKey = get_post_meta($intID, 'wp-piwik_custom_cat'.$i, true);
|
353 |
// Get value
|
354 |
$strMetaVal = get_post_meta($intID, 'wp-piwik_custom_val'.$i, true);
|
355 |
-
if (!empty($strMetaKey) && !empty($strMetaVal))
|
356 |
-
$strCustomVars .=
|
357 |
-
}
|
358 |
}
|
359 |
-
if (!empty($strMetaKey)) $strTrackingCode = str_replace('
|
360 |
}
|
361 |
echo $strTrackingCode;
|
362 |
echo '<!-- *** /WP-Piwik *********************************************************** -->'."\n";
|
@@ -880,7 +883,7 @@ class wp_piwik {
|
|
880 |
$strName = get_bloginfo('name');
|
881 |
if (empty($strName)) $strName = $strBlogURL;
|
882 |
self::$arySettings['name'] = $strName;
|
883 |
-
$strURL
|
884 |
$strURL .= '&idSite='.self::$arySettings['site_id'];
|
885 |
$strURL .= '&siteName='.urlencode($strName).'&urls='.urlencode($strBlogURL);
|
886 |
$strURL .= '&format=PHP';
|
@@ -897,22 +900,25 @@ class wp_piwik {
|
|
897 |
function applyJSCodeChanges($strCode) {
|
898 |
// Change code if js/index.php should be used
|
899 |
if (self::$aryGlobalSettings['track_mode'] == 1) {
|
900 |
-
$strCode = str_replace('
|
901 |
-
$strCode = str_replace('
|
902 |
} elseif (self::$aryGlobalSettings['track_mode'] == 2) {
|
903 |
-
$strCode = preg_replace('
|
904 |
-
$strCode = str_replace('
|
905 |
-
$
|
906 |
-
$
|
907 |
-
$strProxy = str_replace('https://', '
|
908 |
-
$
|
909 |
-
$strCode = str_replace($
|
910 |
-
|
|
|
|
|
|
|
911 |
}
|
912 |
// Change code if POST is forced to be used
|
913 |
-
if (self::$aryGlobalSettings['track_post']) $strCode = str_replace('
|
914 |
// Change code if cookies are disabled
|
915 |
-
if (self::$aryGlobalSettings['disable_cookies']) $strCode = str_replace('
|
916 |
return $strCode;
|
917 |
}
|
918 |
|
@@ -1239,6 +1245,7 @@ class wp_piwik {
|
|
1239 |
self::$aryGlobalSettings['track_mode'] = (isset($_POST['wp-piwik_trackingmode'])?(int)$_POST['wp-piwik_trackingmode']:0);
|
1240 |
self::$aryGlobalSettings['track_post'] = (isset($_POST['wp-piwik_reqpost'])?$_POST['wp-piwik_reqpost']:false);
|
1241 |
self::$aryGlobalSettings['track_proxy'] = (isset($_POST['wp-piwik_proxy'])?$_POST['wp-piwik_proxy']:false);
|
|
|
1242 |
self::$aryGlobalSettings['capability_stealth'] = (isset($_POST['wp-piwik_filter'])?$_POST['wp-piwik_filter']:array());
|
1243 |
self::$aryGlobalSettings['disable_cookies'] = (isset($_POST['wp-piwik_disable_cookies'])?$_POST['wp-piwik_disable_cookies']:false);
|
1244 |
break;
|
@@ -1403,6 +1410,7 @@ class wp_piwik {
|
|
1403 |
'track_mode' => 0,
|
1404 |
'track_post' => false,
|
1405 |
'track_proxy' => false,
|
|
|
1406 |
'disable_timelimit' => false,
|
1407 |
'disable_cookies' => false,
|
1408 |
'toolbar' => false,
|
4 |
|
5 |
Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
|
6 |
|
7 |
+
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress header.
|
8 |
|
9 |
+
Version: 0.9.9.0
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
51 |
class wp_piwik {
|
52 |
|
53 |
private static
|
54 |
+
$intRevisionId = 90900,
|
55 |
+
$strVersion = '0.9.9.0',
|
56 |
$intDashboardID = 30,
|
57 |
$strPluginBasename = NULL,
|
58 |
$bolJustActivated = false,
|
59 |
$aryGlobalSettings = array(
|
60 |
+
'revision' => 90900,
|
61 |
'add_tracking_code' => false,
|
62 |
'last_settings_update' => 0,
|
63 |
'piwik_token' => '',
|
81 |
'track_mode' => 0,
|
82 |
'track_post' => false,
|
83 |
'track_proxy' => false,
|
84 |
+
'track_cdnurl' => '',
|
85 |
'disable_timelimit' => false,
|
86 |
'disable_ssl_verify' => false,
|
87 |
'disable_cookies' => false,
|
193 |
if (self::$aryGlobalSettings['shortcodes'])
|
194 |
add_shortcode( 'wp-piwik', array(&$this, 'shortcode'));
|
195 |
|
196 |
+
// Add tracking code to header if enabled
|
197 |
+
if (self::$aryGlobalSettings['add_tracking_code']) add_action('wp_head', array($this, 'site_header'));
|
198 |
}
|
199 |
|
200 |
/**
|
263 |
self::includeFile('update/90700');
|
264 |
if (self::$aryGlobalSettings['revision'] < 90805)
|
265 |
self::includeFile('update/90801');
|
266 |
+
if (self::$aryGlobalSettings['revision'] < 90821)
|
267 |
+
self::includeFile('update/90821');
|
268 |
+
|
269 |
// Install new version
|
270 |
$this->installPlugin();
|
271 |
}
|
310 |
/**
|
311 |
* Add tracking code
|
312 |
*/
|
313 |
+
function site_header() {
|
314 |
// Hotfix: Custom capability problem with WP multisite
|
315 |
if (is_multisite()) {
|
316 |
foreach (self::$aryGlobalSettings['capability_stealth'] as $strKey => $strVal)
|
318 |
return;
|
319 |
// Don't add tracking code?
|
320 |
} elseif (current_user_can('wp-piwik_stealth')) {
|
321 |
+
echo '<!-- *** WP-Piwik - see http://wordpress.org/extend/plugins/wp-piwik/ ******** -->'."\n";
|
322 |
echo '<!-- Current user should not be tracked. -->'."\n";
|
323 |
echo '<!-- *** /WP-Piwik *********************************************************** -->'."\n";
|
324 |
return;
|
335 |
}
|
336 |
// Change code if 404
|
337 |
if (is_404() && self::$aryGlobalSettings['track_404'])
|
338 |
+
$strTrackingCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setDocumentTitle', '404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,'%2f') + '/From = ' + String(document.referrer).replace(/\//g,'%2f')]);\n_paq.push(['trackPageView']);", self::$arySettings['tracking_code']);
|
339 |
// Change code if search result
|
340 |
elseif (is_search() && self::$aryGlobalSettings['track_search']) {
|
341 |
$objSearch = new WP_Query("s=" . get_search_query() . '&showposts=-1');
|
342 |
$intResultCount = $objSearch->post_count;
|
343 |
+
$strTrackingCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['trackSiteSearch','".get_search_query()."', false, ".$intResultCount."]);\n_paq.push(['trackPageView']);", self::$arySettings['tracking_code']);
|
344 |
// Use default tracking code
|
345 |
} else
|
346 |
$strTrackingCode = self::$arySettings['tracking_code'];
|
347 |
// Send tracking code
|
348 |
+
echo '<!-- *** WP-Piwik - see http://wordpress.org/extend/plugins/wp-piwik/ ******** -->'."\n";
|
349 |
// Add custom variables if set:
|
350 |
if (is_single()) {
|
351 |
$strCustomVars = '';
|
356 |
$strMetaKey = get_post_meta($intID, 'wp-piwik_custom_cat'.$i, true);
|
357 |
// Get value
|
358 |
$strMetaVal = get_post_meta($intID, 'wp-piwik_custom_val'.$i, true);
|
359 |
+
if (!empty($strMetaKey) && !empty($strMetaVal))
|
360 |
+
$strCustomVars .= "_paq.push(['setCustomVariable',".$i.", '".$strMetaKey."', '".$strMetaVal."', 'page']);\n";
|
|
|
361 |
}
|
362 |
+
if (!empty($strMetaKey)) $strTrackingCode = str_replace("_paq.push(['trackPageView']);", $strCustomVars."_paq.push(['trackPageView']);", $strTrackingCode);
|
363 |
}
|
364 |
echo $strTrackingCode;
|
365 |
echo '<!-- *** /WP-Piwik *********************************************************** -->'."\n";
|
883 |
$strName = get_bloginfo('name');
|
884 |
if (empty($strName)) $strName = $strBlogURL;
|
885 |
self::$arySettings['name'] = $strName;
|
886 |
+
$strURL = '&method=SitesManager.updateSite';
|
887 |
$strURL .= '&idSite='.self::$arySettings['site_id'];
|
888 |
$strURL .= '&siteName='.urlencode($strName).'&urls='.urlencode($strBlogURL);
|
889 |
$strURL .= '&format=PHP';
|
900 |
function applyJSCodeChanges($strCode) {
|
901 |
// Change code if js/index.php should be used
|
902 |
if (self::$aryGlobalSettings['track_mode'] == 1) {
|
903 |
+
$strCode = str_replace('piwik.js', 'js/', $strCode);
|
904 |
+
$strCode = str_replace('piwik.php', 'js/', $strCode);
|
905 |
} elseif (self::$aryGlobalSettings['track_mode'] == 2) {
|
906 |
+
$strCode = preg_replace('/<noscript>(.*)<\/noscript>/', '', $strCode);
|
907 |
+
$strCode = str_replace('piwik.js', 'piwik.php', $strCode);
|
908 |
+
$strURL = str_replace('https://', '://', self::$aryGlobalSettings['piwik_url']);
|
909 |
+
$strURL = str_replace('http://', '://', self::$aryGlobalSettings['piwik_url']);
|
910 |
+
$strProxy = str_replace('https://', '://', plugins_url('wp-piwik/'));
|
911 |
+
$strProxy = str_replace('http://', '://', plugins_url('wp-piwik/'));
|
912 |
+
$strCode = str_replace($strURL, $strProxy, $strCode);
|
913 |
+
}
|
914 |
+
if (!empty(self::$aryGlobalSettings['track_cdnurl'])) {
|
915 |
+
$strCode = str_replace("var d=doc", "var ucdn=(('https:' == document.location.protocol) ? 'https://".self::$aryGlobalSettings['track_cdnurl']."/' : 'http://".self::$aryGlobalSettings['track_cdnurl']."/');\nvar d=doc", $strCode);
|
916 |
+
$strCode = str_replace("g.src=u+", "g.src=ucdn+", $strCode);
|
917 |
}
|
918 |
// Change code if POST is forced to be used
|
919 |
+
if (self::$aryGlobalSettings['track_post'] && self::$aryGlobalSettings['track_mode'] != 2) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['setRequestMethod', 'POST']);\n_paq.push(['trackPageView']);", $strCode);
|
920 |
// Change code if cookies are disabled
|
921 |
+
if (self::$aryGlobalSettings['disable_cookies']) $strCode = str_replace("_paq.push(['trackPageView']);", "_paq.push(['disableCookies']);\n_paq.push(['trackPageView']);", $strCode);
|
922 |
return $strCode;
|
923 |
}
|
924 |
|
1245 |
self::$aryGlobalSettings['track_mode'] = (isset($_POST['wp-piwik_trackingmode'])?(int)$_POST['wp-piwik_trackingmode']:0);
|
1246 |
self::$aryGlobalSettings['track_post'] = (isset($_POST['wp-piwik_reqpost'])?$_POST['wp-piwik_reqpost']:false);
|
1247 |
self::$aryGlobalSettings['track_proxy'] = (isset($_POST['wp-piwik_proxy'])?$_POST['wp-piwik_proxy']:false);
|
1248 |
+
self::$aryGlobalSettings['track_cdnurl'] = trim(isset($_POST['wp-piwik_cdnurl'])?$_POST['wp-piwik_cdnurl']:'');
|
1249 |
self::$aryGlobalSettings['capability_stealth'] = (isset($_POST['wp-piwik_filter'])?$_POST['wp-piwik_filter']:array());
|
1250 |
self::$aryGlobalSettings['disable_cookies'] = (isset($_POST['wp-piwik_disable_cookies'])?$_POST['wp-piwik_disable_cookies']:false);
|
1251 |
break;
|
1410 |
'track_mode' => 0,
|
1411 |
'track_post' => false,
|
1412 |
'track_proxy' => false,
|
1413 |
+
'track_cdnurl' => '',
|
1414 |
'disable_timelimit' => false,
|
1415 |
'disable_cookies' => false,
|
1416 |
'toolbar' => false,
|