Version Description
- Added experimental WPMU support
- Switch to disable Google Chart API
- Added Albanian [sq] language file
- Added Belorussian [be_BY] language file
Download this release
Release Info
Developer | Braekling |
Plugin | WP-Matomo (WP-Piwik) |
Version | 0.6.0 |
Comparing to | |
See all releases |
Code changes from version 0.5.0 to 0.6.0
- dashboard/browsers.php +6 -1
- dashboard/screens.php +6 -1
- dashboard/systems.php +6 -1
- dashboard/visitors.php +6 -1
- languages/wp-piwik-be_BY.mo +0 -0
- languages/wp-piwik-be_BY.po +186 -0
- languages/wp-piwik-de_DE.mo +0 -0
- languages/wp-piwik-de_DE.po +33 -0
- languages/wp-piwik-sq.mo +0 -0
- languages/wp-piwik-sq.po +193 -0
- readme.txt +74 -32
- wp-piwik.php +259 -48
- wpmu/wpmu-piwik.php +9 -0
dashboard/browsers.php
CHANGED
@@ -27,9 +27,14 @@
|
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
|
|
|
|
|
|
|
|
|
|
30 |
/***************************************************************************/ ?>
|
31 |
<div class="wp-piwik-graph-wide">
|
32 |
-
|
33 |
</div>
|
34 |
<div class="table">
|
35 |
<table class="widefat wp-piwik-table">
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
30 |
+
if (self::$bolWPMU)
|
31 |
+
$bolDisableGAPI = get_site_option('wpmu-piwik_disable_gapi');
|
32 |
+
else
|
33 |
+
$bolDisableGAPI = get_option('wp-piwik_disable_gapi');
|
34 |
+
|
35 |
/***************************************************************************/ ?>
|
36 |
<div class="wp-piwik-graph-wide">
|
37 |
+
<?php if (!$bolDisableGAPI) { ?><img src="<?php echo $strBase.$strGraph; ?>" width="500" height="220" alt="Visits graph" /><?php } ?>
|
38 |
</div>
|
39 |
<div class="table">
|
40 |
<table class="widefat wp-piwik-table">
|
dashboard/screens.php
CHANGED
@@ -27,9 +27,14 @@
|
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
|
|
|
|
|
|
|
|
|
|
30 |
/***************************************************************************/ ?>
|
31 |
<div class="wp-piwik-graph-wide">
|
32 |
-
|
33 |
</div>
|
34 |
<div class="table">
|
35 |
<table class="widefat wp-piwik-table">
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
30 |
+
if (self::$bolWPMU)
|
31 |
+
$bolDisableGAPI = get_site_option('wpmu-piwik_disable_gapi');
|
32 |
+
else
|
33 |
+
$bolDisableGAPI = get_option('wp-piwik_disable_gapi');
|
34 |
+
|
35 |
/***************************************************************************/ ?>
|
36 |
<div class="wp-piwik-graph-wide">
|
37 |
+
<?php if (!$bolDisableGAPI) { ?><img src="<?php echo $strBase.$strGraph; ?>" width="500" height="220" alt="Visits graph" /><?php } ?>
|
38 |
</div>
|
39 |
<div class="table">
|
40 |
<table class="widefat wp-piwik-table">
|
dashboard/systems.php
CHANGED
@@ -27,9 +27,14 @@
|
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
|
|
|
|
|
|
|
|
|
|
30 |
/***************************************************************************/ ?>
|
31 |
<div class="wp-piwik-graph-wide">
|
32 |
-
|
33 |
</div>
|
34 |
<div class="table">
|
35 |
<table class="widefat wp-piwik-table">
|
27 |
'chd=t:'.$strValues.'&'.
|
28 |
'chl='.$strLabels.'&'.
|
29 |
'chco=90AAD9,A0BAE9&';
|
30 |
+
if (self::$bolWPMU)
|
31 |
+
$bolDisableGAPI = get_site_option('wpmu-piwik_disable_gapi');
|
32 |
+
else
|
33 |
+
$bolDisableGAPI = get_option('wp-piwik_disable_gapi');
|
34 |
+
|
35 |
/***************************************************************************/ ?>
|
36 |
<div class="wp-piwik-graph-wide">
|
37 |
+
<?php if (!$bolDisableGAPI) { ?><img src="<?php echo $strBase.$strGraph; ?>" width="500" height="220" alt="Visits graph" /><?php } ?>
|
38 |
</div>
|
39 |
<div class="table">
|
40 |
<table class="widefat wp-piwik-table">
|
dashboard/visitors.php
CHANGED
@@ -47,9 +47,14 @@
|
|
47 |
'chm=B,D4E2ED,0,1,0|B,E4F2FD,1,2,0|B,FDE4F2,2,3,0&'.
|
48 |
'chxt=x,y&'.
|
49 |
'chxr=1,0,'.$intMax.','.$intStep;
|
|
|
|
|
|
|
|
|
|
|
50 |
/***************************************************************************/ ?>
|
51 |
<div class="wp-piwik-graph-wide">
|
52 |
-
|
53 |
</div>
|
54 |
<div class="table">
|
55 |
<table class="widefat wp-piwik-table">
|
47 |
'chm=B,D4E2ED,0,1,0|B,E4F2FD,1,2,0|B,FDE4F2,2,3,0&'.
|
48 |
'chxt=x,y&'.
|
49 |
'chxr=1,0,'.$intMax.','.$intStep;
|
50 |
+
if (self::$bolWPMU)
|
51 |
+
$bolDisableGAPI = get_site_option('wpmu-piwik_disable_gapi');
|
52 |
+
else
|
53 |
+
$bolDisableGAPI = get_option('wp-piwik_disable_gapi');
|
54 |
+
|
55 |
/***************************************************************************/ ?>
|
56 |
<div class="wp-piwik-graph-wide">
|
57 |
+
<?php if (!$bolDisableGAPI) { ?><img src="<?php echo $strBase.$strGraph; ?>" width="500" height="220" alt="Visits graph" /><?php } ?>
|
58 |
</div>
|
59 |
<div class="table">
|
60 |
<table class="widefat wp-piwik-table">
|
languages/wp-piwik-be_BY.mo
ADDED
Binary file
|
languages/wp-piwik-be_BY.po
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# WP-Piwik 0.3.0 - Belorussian language file
|
2 |
+
# Copyright (C) 2009 Andre Braekling
|
3 |
+
# This file is distributed under the same license as the WP-Piwik package.
|
4 |
+
# Andre Braekling <webmaster@braekling.de>, 2009.
|
5 |
+
# FatCow http://www.fatcow.com, 2009.
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: 0.3.0\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-piwik\n"
|
10 |
+
"POT-Creation-Date: 2009-06-09 19:05+0000\n"
|
11 |
+
"PO-Revision-Date: 2009-11-14 16:25+0200\n"
|
12 |
+
"Last-Translator: Fat Cow <zhr@tut.by>\n"
|
13 |
+
"Language-Team: FatCow <zhr@tut.by>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Poedit-Language: Belarusian\n"
|
18 |
+
"X-Poedit-Country: BELARUS\n"
|
19 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
20 |
+
|
21 |
+
#: dashboard/browsers.php:8
|
22 |
+
#: dashboard/browsers.php:37
|
23 |
+
msgid "Browser"
|
24 |
+
msgstr "Браузер"
|
25 |
+
|
26 |
+
msgid "Resolution"
|
27 |
+
msgstr "Разрешение"
|
28 |
+
|
29 |
+
msgid "Operating System"
|
30 |
+
msgstr "Операционная система"
|
31 |
+
|
32 |
+
#: dashboard/browsers.php:37
|
33 |
+
#: dashboard/keywords.php:13
|
34 |
+
#: dashboard/visitors.php:56
|
35 |
+
#: dashboard/websites.php:13
|
36 |
+
msgid "Unique"
|
37 |
+
msgstr "Уникальность"
|
38 |
+
|
39 |
+
#: dashboard/browsers.php:37
|
40 |
+
msgid "Percent"
|
41 |
+
msgstr "Процентов"
|
42 |
+
|
43 |
+
#: dashboard/keywords.php:8
|
44 |
+
msgid "Keywords"
|
45 |
+
msgstr "Ключевые слова"
|
46 |
+
|
47 |
+
#: dashboard/keywords.php:13
|
48 |
+
msgid "Keyword"
|
49 |
+
msgstr "Ключевое слово"
|
50 |
+
|
51 |
+
#: dashboard/overview.php:8
|
52 |
+
msgid "Overview"
|
53 |
+
msgstr "Описание"
|
54 |
+
|
55 |
+
#: dashboard/overview.php:16
|
56 |
+
#: dashboard/visitors.php:21
|
57 |
+
msgid "Visitors"
|
58 |
+
msgstr "Посетителей"
|
59 |
+
|
60 |
+
#: dashboard/overview.php:17
|
61 |
+
msgid "Unique visitors"
|
62 |
+
msgstr "Уникальных посетителей"
|
63 |
+
|
64 |
+
#: dashboard/overview.php:18
|
65 |
+
msgid "Page views"
|
66 |
+
msgstr "Просмотров страницы"
|
67 |
+
|
68 |
+
#: dashboard/overview.php:19
|
69 |
+
msgid "Max. page views in one visit"
|
70 |
+
msgstr "Макс. страниц просмтрено за один визит"
|
71 |
+
|
72 |
+
#: dashboard/overview.php:20
|
73 |
+
msgid "Total time spent by visitors"
|
74 |
+
msgstr "Всего времени, проведенного посетителем"
|
75 |
+
|
76 |
+
#: dashboard/overview.php:21
|
77 |
+
msgid "Bounce count"
|
78 |
+
msgstr "Количество отказов"
|
79 |
+
|
80 |
+
#: dashboard/visitors.php:56
|
81 |
+
msgid "Date"
|
82 |
+
msgstr "Дата"
|
83 |
+
|
84 |
+
#: dashboard/visitors.php:56
|
85 |
+
msgid "Visits"
|
86 |
+
msgstr "Визитов"
|
87 |
+
|
88 |
+
#: dashboard/visitors.php:56
|
89 |
+
msgid "Bounced"
|
90 |
+
msgstr "Отказов"
|
91 |
+
|
92 |
+
#: dashboard/websites.php:8
|
93 |
+
msgid "Websites"
|
94 |
+
msgstr "Сайтов"
|
95 |
+
|
96 |
+
#: dashboard/websites.php:13
|
97 |
+
msgid "Website"
|
98 |
+
msgstr "Вебсайт"
|
99 |
+
|
100 |
+
#: wp-piwik.php:49
|
101 |
+
#: wp-piwik.php:147
|
102 |
+
msgid "Piwik Statistics"
|
103 |
+
msgstr "Piwik статистика"
|
104 |
+
|
105 |
+
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
106 |
+
#. Plugin Name of an extension
|
107 |
+
#: wp-piwik.php:49
|
108 |
+
msgid "WP-Piwik"
|
109 |
+
msgstr "WP-Piwik"
|
110 |
+
|
111 |
+
#: wp-piwik.php:53
|
112 |
+
#: wp-piwik.php:185
|
113 |
+
msgid "WP-Piwik Settings"
|
114 |
+
msgstr "WP-Piwik настройки"
|
115 |
+
|
116 |
+
#: wp-piwik.php:59
|
117 |
+
msgid "Settings"
|
118 |
+
msgstr "Настройки"
|
119 |
+
|
120 |
+
#: wp-piwik.php:112
|
121 |
+
msgid "Remote access to Piwik not possible. Enable allow_url_fopen or CURL."
|
122 |
+
msgstr "Удаленный доступ к Piwik невозможен. Включите allow_url_fopen или CURL."
|
123 |
+
|
124 |
+
#: wp-piwik.php:190
|
125 |
+
msgid "Account settings"
|
126 |
+
msgstr "Настройки аккаунта"
|
127 |
+
|
128 |
+
#: wp-piwik.php:192
|
129 |
+
msgid "Piwik URL"
|
130 |
+
msgstr "Piwik URL"
|
131 |
+
|
132 |
+
#: wp-piwik.php:196
|
133 |
+
msgid "Auth token"
|
134 |
+
msgstr "Авто token"
|
135 |
+
|
136 |
+
#: wp-piwik.php:200
|
137 |
+
msgid "To enable Piwik statistics, please enter your Piwik base URL (like http://mydomain.com/piwik) and your personal authentification token. You can get the token on the API page inside your Piwik interface. It looks like "1234a5cd6789e0a12345b678cd9012ef"."
|
138 |
+
msgstr "Для того чтобы Piwik статистике, пожалуйста, введите Ваш Piwik Базовый URL (например, http://mydomain.com/piwik), и ваш личный знак подлинности. Вы можете получить знак на странице API внутри интерфейса Piwik. It looks like "1234a5cd6789e0a12345b678cd9012ef"."
|
139 |
+
|
140 |
+
#: wp-piwik.php:205
|
141 |
+
#: wp-piwik.php:207
|
142 |
+
msgid "An error occured"
|
143 |
+
msgstr "Произошла ошибка"
|
144 |
+
|
145 |
+
#: wp-piwik.php:205
|
146 |
+
msgid "Please check URL and auth token. You need at least view access to one site."
|
147 |
+
msgstr "Пожалуйста, проверьте URL и AUTH маркера. Вам потребуется минимум открыть доступ к одному сайту."
|
148 |
+
|
149 |
+
#: wp-piwik:php:215
|
150 |
+
msgid "Choose site"
|
151 |
+
msgstr "Выбрать сайт"
|
152 |
+
|
153 |
+
#: wp-piwik.php:221
|
154 |
+
msgid "If your template uses wp_footer(), WP-Piwik can automatically add the Piwik javascript code to your blog."
|
155 |
+
msgstr "Если в шаблоне используются wp_footer (), РГ-Piwik может автоматически добавить Piwik кода JavaScript в вашем блоге."
|
156 |
+
|
157 |
+
#: wp-piwik.php:226
|
158 |
+
msgid "Add script to wp_footer()"
|
159 |
+
msgstr "Добавить скрипт в wp_footer()"
|
160 |
+
|
161 |
+
msgid "Tracking filter"
|
162 |
+
msgstr "Следящий фильтр"
|
163 |
+
|
164 |
+
msgid "Choose users by user role you do <strong>not</strong> want to track. Requires enabled "Add script to wp_footer()"-functionality."
|
165 |
+
msgstr "Wähle Nutzer anhand ihrer Nutzerrolle, die <strong>nicht</strong> erfasst werden sollen. Die Funktion "Skript zu wp_footer() hinzufügen" muss dazu verwendet werden."
|
166 |
+
|
167 |
+
#: wp-piwik.php:229
|
168 |
+
msgid "Save settings"
|
169 |
+
msgstr "Сохранить настройки"
|
170 |
+
|
171 |
+
#. Plugin URI of an extension
|
172 |
+
msgid "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
173 |
+
msgstr "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
174 |
+
|
175 |
+
#. Description of an extension
|
176 |
+
msgid "Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer."
|
177 |
+
msgstr "Добавляет Piwik статистику по меню и панели инструментов Piwik кода на WordPress колонтитула."
|
178 |
+
|
179 |
+
#. Author of an extension
|
180 |
+
msgid "André Bräkling"
|
181 |
+
msgstr "André Bräkling"
|
182 |
+
|
183 |
+
#. Author URI of an extension
|
184 |
+
msgid "http://www.braekling.de"
|
185 |
+
msgstr "http://www.braekling.de"
|
186 |
+
|
languages/wp-piwik-de_DE.mo
CHANGED
Binary file
|
languages/wp-piwik-de_DE.po
CHANGED
@@ -169,6 +169,10 @@ msgstr "Wähle Nutzer anhand ihrer Nutzerrolle, die <strong>nicht</strong> e
|
|
169 |
"werden sollen. Die Funktion "Skript zu wp_footer() hinzufügen" muss "
|
170 |
"dazu verwendet werden."
|
171 |
|
|
|
|
|
|
|
|
|
172 |
msgid "Display statistics to"
|
173 |
msgstr "Statistiken sichtbar für"
|
174 |
|
@@ -182,6 +186,35 @@ msgstr "Mindestens benötigter User Level, um die Statistiken einzusehen."
|
|
182 |
msgid "Save settings"
|
183 |
msgstr "Einstellungen speichern"
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
#. Plugin URI of an extension
|
186 |
msgid "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
187 |
msgstr "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
169 |
"werden sollen. Die Funktion "Skript zu wp_footer() hinzufügen" muss "
|
170 |
"dazu verwendet werden."
|
171 |
|
172 |
+
msgid "Choose users by user role you do <strong>not</strong> want to track."
|
173 |
+
msgstr "Wähle Nutzer anhand ihrer Nutzerrolle, die <strong>nicht</strong> erfasst "
|
174 |
+
"werden sollen."
|
175 |
+
|
176 |
msgid "Display statistics to"
|
177 |
msgstr "Statistiken sichtbar für"
|
178 |
|
186 |
msgid "Save settings"
|
187 |
msgstr "Einstellungen speichern"
|
188 |
|
189 |
+
msgid "Currently shown stats:"
|
190 |
+
msgstr "Aktuell angezeigte Statistiken:"
|
191 |
+
|
192 |
+
msgid "Change"
|
193 |
+
msgstr "Auswählen"
|
194 |
+
|
195 |
+
msgid "WPMU-Piwik Settings"
|
196 |
+
msgstr "WPMU-Piwik Einstellungen"
|
197 |
+
|
198 |
+
msgid "<strong>Important note:</strong> You have to choose a token which provides administration access. WPMU-Piwik will "
|
199 |
+
"create new Piwik sites for each blog if it is shown the first time and it is not added yet. All users can access "
|
200 |
+
"their own statistics only, while site admins can access all statistics. To avoid conflicts, you should use a clean Piwik "
|
201 |
+
"installation without other sites added. The provided themes should use wp_footer, because it adds the Piwik javascript "
|
202 |
+
"code to each page."
|
203 |
+
msgstr "<strong>Wichtiger Hinweis:</strong> Du solltest einen Token mit Adminstrator-Zugang angeben. WPMU-Piwik erstellt "
|
204 |
+
"für jedes Blog eine eigene Piwik Site, sobald es zum ersten Mal angezeigt wird. Nutzer können nur ihre eigenen "
|
205 |
+
"Statistiken einsehen, während Site Admins Zugriff auf alle Statistiken haben. Um Konflikte zu vermeiden, solltest Du "
|
206 |
+
"eine neue Piwik-Installation ohne andere Sites verwenden. Alle verwendeten Themes sollten wp_footer benutzen, da diese "
|
207 |
+
"Funktion den Piwik JavaScript Code zu jeder Seite hinzufügt."
|
208 |
+
|
209 |
+
msgid "<strong>Important note:</strong> If you do not host this blog on your own, your site admin is able to get your auth token from the database. So he is able to access your statistics. You should never use an auth token with more than simple view access!"
|
210 |
+
msgstr "<strong>Wichtiger Hinweis:</strong> Wenn Du dieses Blog nicht selber hostest, kann Dein Site Admin Deinen Auth Token aus der Datenbank auslesen. Dadurch kann er auf Deine Statistiken zugreifen. Du solltest niemals einen Auth Token mit mehr als einfachen View-Rechten verwenden!"
|
211 |
+
|
212 |
+
msgid "WP-Piwik uses the Google Chart API to create graphs. To avoid this, just check this box."
|
213 |
+
msgstr "WP-Piwik benutzt das Google Chart API um Graphen zu erzeugen. Möchtest Du dies verhindern, markiere diese Box."
|
214 |
+
|
215 |
+
msgid "Disable Google Chart API"
|
216 |
+
msgstr "Google Chart API ausschalten"
|
217 |
+
|
218 |
#. Plugin URI of an extension
|
219 |
msgid "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
220 |
msgstr "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
languages/wp-piwik-sq.mo
ADDED
Binary file
|
languages/wp-piwik-sq.po
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# WP-Piwik 0.3.0 - Albanian language file
|
2 |
+
# Copyright (C) 2009 Andre Braekling
|
3 |
+
# This file is distributed under the same license as the WP-Piwik package.
|
4 |
+
# Andre Braekling <webmaster@braekling.de>, 2009.
|
5 |
+
# Besnik Bleta <besnik@programeshqip.org>, 2009.
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: 0.3.0\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-piwik\n"
|
10 |
+
"POT-Creation-Date: 2009-06-09 19:05+0000\n"
|
11 |
+
"PO-Revision-Date: 2009-11-14 00:45+0200\n"
|
12 |
+
"Last-Translator: Besnik Bleta <besnik@programeshqip.org>\n"
|
13 |
+
"Language-Team: Albanian <besnik@programeshqip.org>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18 |
+
|
19 |
+
#: dashboard/browsers.php:8
|
20 |
+
#: dashboard/browsers.php:37
|
21 |
+
msgid "Browser"
|
22 |
+
msgstr "Shfletues"
|
23 |
+
|
24 |
+
msgid "Resolution"
|
25 |
+
msgstr "Qartësi"
|
26 |
+
|
27 |
+
msgid "Operating System"
|
28 |
+
msgstr "Sistem Operativ"
|
29 |
+
|
30 |
+
#: dashboard/browsers.php:37
|
31 |
+
#: dashboard/keywords.php:13
|
32 |
+
#: dashboard/visitors.php:56
|
33 |
+
#: dashboard/websites.php:13
|
34 |
+
msgid "Unique"
|
35 |
+
msgstr "Unikë"
|
36 |
+
|
37 |
+
#: dashboard/browsers.php:37
|
38 |
+
msgid "Percent"
|
39 |
+
msgstr "Përqindje"
|
40 |
+
|
41 |
+
#: dashboard/keywords.php:8
|
42 |
+
msgid "Keywords"
|
43 |
+
msgstr "Fjalëkyça"
|
44 |
+
|
45 |
+
#: dashboard/keywords.php:13
|
46 |
+
msgid "Keyword"
|
47 |
+
msgstr "Fjalëkyç"
|
48 |
+
|
49 |
+
#: dashboard/overview.php:8
|
50 |
+
msgid "Overview"
|
51 |
+
msgstr "Përmbledhje"
|
52 |
+
|
53 |
+
#: dashboard/overview.php:16
|
54 |
+
#: dashboard/visitors.php:21
|
55 |
+
msgid "Visitors"
|
56 |
+
msgstr "Vizitorë"
|
57 |
+
|
58 |
+
#: dashboard/overview.php:17
|
59 |
+
msgid "Unique visitors"
|
60 |
+
msgstr "Vizitorë unikë"
|
61 |
+
|
62 |
+
#: dashboard/overview.php:18
|
63 |
+
msgid "Page views"
|
64 |
+
msgstr "Parje faqesh"
|
65 |
+
|
66 |
+
#: dashboard/overview.php:19
|
67 |
+
msgid "Max. page views in one visit"
|
68 |
+
msgstr "Maksimum parje faqesh në një vizitë"
|
69 |
+
|
70 |
+
#: dashboard/overview.php:20
|
71 |
+
msgid "Total time spent by visitors"
|
72 |
+
msgstr "Kohë e harxhuar nga vizitorët gjithsej"
|
73 |
+
|
74 |
+
#: dashboard/overview.php:21
|
75 |
+
msgid "Bounce count"
|
76 |
+
msgstr "Numër kthimesh"
|
77 |
+
|
78 |
+
#: dashboard/visitors.php:56
|
79 |
+
msgid "Date"
|
80 |
+
msgstr "Datë"
|
81 |
+
|
82 |
+
#: dashboard/visitors.php:56
|
83 |
+
msgid "Visits"
|
84 |
+
msgstr "Vizita"
|
85 |
+
|
86 |
+
#: dashboard/visitors.php:56
|
87 |
+
msgid "Bounced"
|
88 |
+
msgstr "Të kthyera"
|
89 |
+
|
90 |
+
#: dashboard/websites.php:8
|
91 |
+
msgid "Websites"
|
92 |
+
msgstr "\"Websites\"-e"
|
93 |
+
|
94 |
+
#: dashboard/websites.php:13
|
95 |
+
msgid "Website"
|
96 |
+
msgstr "\"Website\""
|
97 |
+
|
98 |
+
#: wp-piwik.php:49
|
99 |
+
#: wp-piwik.php:147
|
100 |
+
msgid "Piwik Statistics"
|
101 |
+
msgstr "Statistika Piwik"
|
102 |
+
|
103 |
+
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
104 |
+
#. Plugin Name of an extension
|
105 |
+
#: wp-piwik.php:49
|
106 |
+
msgid "WP-Piwik"
|
107 |
+
msgstr "WP-Piwik"
|
108 |
+
|
109 |
+
#: wp-piwik.php:53
|
110 |
+
#: wp-piwik.php:185
|
111 |
+
msgid "WP-Piwik Settings"
|
112 |
+
msgstr "Rregullime për WP-Piwik"
|
113 |
+
|
114 |
+
#: wp-piwik.php:59
|
115 |
+
msgid "Settings"
|
116 |
+
msgstr "Rregullime"
|
117 |
+
|
118 |
+
#: wp-piwik.php:112
|
119 |
+
msgid "Remote access to Piwik not possible. Enable allow_url_fopen or CURL."
|
120 |
+
msgstr "Nuk arrihet hyrja e largët te Piwik. Aktivizoni allow_url_fopen ose CURL."
|
121 |
+
|
122 |
+
#: wp-piwik.php:190
|
123 |
+
msgid "Account settings"
|
124 |
+
msgstr "Rregullime llogarie"
|
125 |
+
|
126 |
+
#: wp-piwik.php:192
|
127 |
+
msgid "Piwik URL"
|
128 |
+
msgstr "URL Piwik-u"
|
129 |
+
|
130 |
+
#: wp-piwik.php:196
|
131 |
+
msgid "Auth token"
|
132 |
+
msgstr "\"Token\" mirëfilltësimi"
|
133 |
+
|
134 |
+
#: wp-piwik.php:200
|
135 |
+
msgid "To enable Piwik statistics, please enter your Piwik base URL (like http://mydomain.com/piwik) and your personal authentification token. You can get the token on the API page inside your Piwik interface. It looks like "1234a5cd6789e0a12345b678cd9012ef"."
|
136 |
+
msgstr "Për të aktivizuar statistikat Piwik, ju lutem jepni URL-në tuaj bazë për Piwik-un (diçka të ngjashme me http://përkatësiaime.com/piwik) dhe varguan për mirëfilltësimin tuaj personal. Vargun do ta gjeni te faqja për API-n brenda ndërfaqes së Piwik-ut tuaj. Ngjan me diçka si "1234a5cd6789e0a12345b678cd9012ef"."
|
137 |
+
|
138 |
+
#: wp-piwik.php:205
|
139 |
+
#: wp-piwik.php:207
|
140 |
+
msgid "An error occured"
|
141 |
+
msgstr "Ndodhi një gabim"
|
142 |
+
|
143 |
+
#: wp-piwik.php:205
|
144 |
+
msgid "Please check URL and auth token. You need at least view access to one site."
|
145 |
+
msgstr "Ju lutem, kontrolloni URL-në dhe vargun e mirëfilltësimit. Keni nevojë për të drejta parjeje të paktën në një \"site\"."
|
146 |
+
|
147 |
+
#: wp-piwik:php:215
|
148 |
+
msgid "Choose site"
|
149 |
+
msgstr "Zgjidhni \"site\""
|
150 |
+
|
151 |
+
#: wp-piwik.php:221
|
152 |
+
msgid "If your template uses wp_footer(), WP-Piwik can automatically add the Piwik javascript code to your blog."
|
153 |
+
msgstr "Po qe se gjedhja juaj përdor wp_footer(), WP-Piwik mund të shtojë vetvetiu te blogu juaj kodin Javascript për Piwik-un."
|
154 |
+
|
155 |
+
#: wp-piwik.php:226
|
156 |
+
msgid "Add script to wp_footer()"
|
157 |
+
msgstr "Shtoje \"script\"-in te wp_footer()"
|
158 |
+
|
159 |
+
msgid "Tracking filter"
|
160 |
+
msgstr "Filtër Gjurmimesh"
|
161 |
+
|
162 |
+
msgid "Choose users by user role you do <strong>not</strong> want to track. Requires enabled "Add script to wp_footer()"-functionality."
|
163 |
+
msgstr "Zgjidhni përdoruesa sipas rolit të përdoruesit të cilin <strong>nuk</strong> doni të gjurmohet. Lyp të aktivizuar funksionin "Add script to wp_footer()"."
|
164 |
+
|
165 |
+
msgid "Display statistics to"
|
166 |
+
msgstr "Shfaqja statistikat"
|
167 |
+
|
168 |
+
msgid "or above"
|
169 |
+
msgstr "ose sipër"
|
170 |
+
|
171 |
+
msgid "Minimum user level required to display statistics page."
|
172 |
+
msgstr "Shkallë minimum e përdoruesit, e domosdoshme për t'i shfaqur faqen e statistikave."
|
173 |
+
|
174 |
+
#: wp-piwik.php:229
|
175 |
+
msgid "Save settings"
|
176 |
+
msgstr "Ruaji rregullimet"
|
177 |
+
|
178 |
+
#. Plugin URI of an extension
|
179 |
+
msgid "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
180 |
+
msgstr "http://dev.braekling.de/wordpress-plugins/dev/wp-piwik/index.html"
|
181 |
+
|
182 |
+
#. Description of an extension
|
183 |
+
msgid "Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer."
|
184 |
+
msgstr "Shton te menuja e pultit tuaj statistika Piwik dhe kodin për Piwik te \"footer\"-i juaj Wordpress."
|
185 |
+
|
186 |
+
#. Author of an extension
|
187 |
+
msgid "André Bräkling"
|
188 |
+
msgstr "André Bräkling"
|
189 |
+
|
190 |
+
#. Author URI of an extension
|
191 |
+
msgid "http://www.braekling.de"
|
192 |
+
msgstr "http://www.braekling.de"
|
193 |
+
|
readme.txt
CHANGED
@@ -1,14 +1,21 @@
|
|
1 |
-
=== WP-Piwik ===
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
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.
|
13 |
|
14 |
You need a running Piwik installation and at least view access to your stats.
|
@@ -19,15 +26,44 @@ Look at the [Piwik website](http://piwik.org/) to get further information about
|
|
19 |
|
20 |
License: GNU General Public License Version 3, 29 June 2007
|
21 |
|
22 |
-
Languages: English, German
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
3. Open the new 'Settings/WP-Piwik Settings' menu, enter your Piwik base URL and your auth token. Save settings.
|
28 |
4. If you have view access to multiple site stats, choose your blog and save settings again.
|
29 |
5. Look at 'Dashboard/WP-Piwik' to get your site stats.
|
30 |
|
|
|
31 |
== Screenshots ==
|
32 |
|
33 |
1. WP-Piwik stats page.
|
@@ -35,30 +71,36 @@ Languages: English, German
|
|
35 |
|
36 |
== Changelog ==
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
= 0.5.0 =
|
39 |
-
|
40 |
-
|
41 |
|
42 |
= 0.4.0 =
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
= 0.3.2 =
|
49 |
-
|
50 |
|
51 |
= 0.3.1 =
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
|
57 |
= 0.3.0 =
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
= 0.2.0 =
|
64 |
-
|
1 |
+
=== WP-Piwik ===
|
2 |
+
|
3 |
+
Contributors: braekling
|
4 |
+
|
5 |
+
Requires at least: 2.7
|
6 |
+
|
7 |
+
Tested up to: 2.9.0
|
8 |
+
|
9 |
+
Stable tag: 0.6.0
|
10 |
+
|
11 |
+
Donate link: http://www.amazon.de/gp/registry/wishlist/111VUJT4HP1RA?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=12&y=14
|
12 |
+
Tags: statistics, stats, analytics, piwik, wpmu
|
13 |
+
|
14 |
+
This plugin adds a piwik stats site to your WordPress or WordPressMU dashboard.
|
15 |
+
|
16 |
+
|
17 |
+
== Description ==
|
18 |
+
|
19 |
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.
|
20 |
|
21 |
You need a running Piwik installation and at least view access to your stats.
|
26 |
|
27 |
License: GNU General Public License Version 3, 29 June 2007
|
28 |
|
29 |
+
Languages: English, German, Albanian, Belorussian
|
30 |
+
|
31 |
+
= WPMU =
|
32 |
+
Version 0.6.0 includes experimental WPMU support.
|
33 |
+
|
34 |
+
**Experimental**
|
35 |
+
|
36 |
+
The WPMU support is currently experimental. Please test it on your own (e.g. using a local copy of your WPMU) before you use it in an user context.
|
37 |
+
|
38 |
+
**Simple**
|
39 |
+
|
40 |
+
Just add WP-Piwik to your /wp-content/plugins folder. So each user can enable WP-Piwik and use his own Piwik instance.
|
41 |
+
|
42 |
+
**Extended**
|
43 |
+
|
44 |
+
1. Add the whole WP-Piwik folder to /wp-content/mu-plugins.
|
45 |
+
2. Copy /wp-content/mu-plugins/wp-piwik/wpmu/wpmu-piwik.php to /wp-content/mu-plugins/wpmu-piwik.php.
|
46 |
+
3. Go to the WPMU-Piwik settings page and enter the Piwik URL and the auth token. You should use a clear Piwik installation and a token with full admin rights due to avoid conflicts. WPMU-Piwik will add a new site to Piwik each time a new blog is visited the first time.
|
47 |
+
4. Users have access to their own statistics, site admins can access each blog's statistics.
|
48 |
+
|
49 |
+
= Credits =
|
50 |
+
|
51 |
+
* Albanian [sq] language file by [Besnik Bleta](http://blogu.programeshqip.org/).
|
52 |
+
* Belorussian [be_BY] language file by [FatCow](http://www.fatcow.com/).
|
53 |
+
|
54 |
+
Thank you, guys!
|
55 |
+
|
56 |
+
== Installation ==
|
57 |
+
|
58 |
+
1. Upload the full `wp-piwik` directory into your `wp-content/plugins` directory.
|
59 |
+
|
60 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
61 |
+
|
62 |
3. Open the new 'Settings/WP-Piwik Settings' menu, enter your Piwik base URL and your auth token. Save settings.
|
63 |
4. If you have view access to multiple site stats, choose your blog and save settings again.
|
64 |
5. Look at 'Dashboard/WP-Piwik' to get your site stats.
|
65 |
|
66 |
+
|
67 |
== Screenshots ==
|
68 |
|
69 |
1. WP-Piwik stats page.
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 0.6.0 =
|
75 |
+
* Added experimental WPMU support
|
76 |
+
* Switch to disable Google Chart API
|
77 |
+
* Added Albanian [sq] language file
|
78 |
+
* Added Belorussian [be_BY] language file
|
79 |
+
|
80 |
= 0.5.0 =
|
81 |
+
* Display statistics to selected user roles
|
82 |
+
* Some HTML fixes (settings page)
|
83 |
|
84 |
= 0.4.0 =
|
85 |
+
* Tracking filter added
|
86 |
+
* Resolution stats
|
87 |
+
* Operating System stats
|
88 |
+
* Plugin stats
|
89 |
|
90 |
= 0.3.2 =
|
91 |
+
* If allow_url_fopen is disabled in php.ini, WP-Piwik tries to use CURL instead of file_get_contents.
|
92 |
|
93 |
= 0.3.1 =
|
94 |
+
* WordPress 2.8 compatible
|
95 |
+
* Bugfix: Warnings on WP 2.8 plugins site
|
96 |
+
* Dashboard revised
|
97 |
+
* Partly optimized code
|
98 |
|
99 |
= 0.3.0 =
|
100 |
+
* WP-Piwik dashboard widgetized.
|
101 |
+
* Stats-boxes sortable and closeable.
|
102 |
+
* German language file added
|
103 |
+
* Browser stats and bounced visitors
|
104 |
|
105 |
= 0.2.0 =
|
106 |
+
* First public version.
|
wp-piwik.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/*
|
3 |
Plugin Name: WP-Piwik
|
4 |
|
5 |
-
Plugin URI: http://
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
|
8 |
|
9 |
-
Version: 0.
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
@@ -29,26 +29,41 @@ Author URI: http://www.braekling.de
|
|
29 |
|
30 |
class wp_piwik {
|
31 |
|
32 |
-
public static $intRevisionId =
|
33 |
public static $intDashboardID = 5;
|
|
|
|
|
34 |
|
35 |
function __construct() {
|
36 |
-
|
|
|
|
|
|
|
37 |
if ($intCurrentRevision < self::$intRevisionId) $this->install();
|
38 |
$strLocale = get_locale();
|
39 |
if ( !empty( $strLocale ) ) {
|
40 |
-
$strMOfile = ABSPATH . 'wp-content/
|
|
|
|
|
41 |
load_textdomain('wp-piwik', $strMOfile);
|
42 |
}
|
|
|
43 |
register_activation_hook(__FILE__, array($this, 'install'));
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
47 |
add_action('wp_footer', array($this, 'footer'));
|
|
|
|
|
48 |
}
|
49 |
|
50 |
function install() {
|
51 |
-
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
function footer() {
|
@@ -56,34 +71,59 @@ class wp_piwik {
|
|
56 |
get_currentuserinfo();
|
57 |
$bolDisplay = true;
|
58 |
if (!empty($current_user->roles)) {
|
59 |
-
$aryFilter = get_option('wp-piwik_filter');
|
60 |
foreach ($current_user->roles as $strRole)
|
61 |
if (isset($aryFilter[$strRole]) && $aryFilter[$strRole])
|
62 |
$bolDisplay = false;
|
63 |
}
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
function build_menu() {
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
//add_filter('manage_posts_columns', array($this, 'display_post_unique_column'));
|
79 |
//add_action('manage_posts_custom_column', array($this, 'display_post_unique_content'), $intDisplayTo, 2);
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
function set_plugin_meta($strLinks, $strFile) {
|
@@ -101,17 +141,17 @@ class wp_piwik {
|
|
101 |
function load_scripts() {
|
102 |
wp_enqueue_script(
|
103 |
'wp-piwik',
|
104 |
-
$this->get_plugin_url().'js/wp-piwik.js',
|
105 |
array('jquery', 'admin-comments', 'postbox')
|
106 |
);
|
107 |
}
|
108 |
|
109 |
function add_admin_header() {
|
110 |
-
echo '<link rel="stylesheet" href="'.$this->get_plugin_url().'css/wp-piwik.css" type="text/css"/>';
|
111 |
}
|
112 |
|
113 |
function get_plugin_url() {
|
114 |
-
return trailingslashit(WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)));
|
115 |
}
|
116 |
|
117 |
function get_remote_file($strURL) {
|
@@ -133,9 +173,19 @@ class wp_piwik {
|
|
133 |
function call_API($strMethod, $strPeriod='', $strDate='', $intLimit='') {
|
134 |
$strKey = $strMethod.'_'.$strPeriod.'_'.$strDate.'_'.$intLimit;
|
135 |
if (empty($this->aryCache[$strKey])) {
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
138 |
$intSite = get_option('wp-piwik_siteid');
|
|
|
|
|
|
|
|
|
|
|
139 |
if (empty($strToken) || empty($strURL)) {
|
140 |
$this->aryCache[$key] = array(
|
141 |
'result' => 'error',
|
@@ -148,14 +198,40 @@ class wp_piwik {
|
|
148 |
$strURL .= '&idSite='.$intSite.'&period='.$strPeriod.'&date='.$strDate;
|
149 |
$strURL .= '&format=PHP&filter_limit='.$intLimit;
|
150 |
$strURL .= '&token_auth='.$strToken;
|
151 |
-
|
152 |
-
$strResult = $this->get_remote_file($strURL);
|
153 |
$this->aryCache[$strKey] = unserialize($strResult);
|
154 |
}
|
155 |
-
return $this->aryCache[$strKey];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
|
158 |
function create_dashboard_widget($strFile, $aryConfig) {
|
|
|
159 |
foreach ($aryConfig['params'] as $strParam)
|
160 |
if (!empty($strParam)) {
|
161 |
$strDesc .= $strParam.', ';
|
@@ -181,13 +257,13 @@ class wp_piwik {
|
|
181 |
}
|
182 |
|
183 |
function show_stats() {
|
|
|
|
|
184 |
$arySortOrder = get_user_option('meta-box-order_wppiwik');
|
185 |
$aryClosed = get_user_option('closedpostboxes_wppiwik');
|
186 |
if (empty($aryClosed)) $aryClosed = array();
|
187 |
$aryDashboard = array();
|
188 |
-
|
189 |
-
$intCurrentDashboard = get_option('wp-piwik_dashboardid',0);
|
190 |
-
|
191 |
if (!$arySortOrder) {
|
192 |
// Set default configuration
|
193 |
$arySortOrder = array(
|
@@ -202,16 +278,15 @@ class wp_piwik {
|
|
202 |
$arySortOrder['normal'] .= ',screens_day_yesterday,systems_day_yesterday';
|
203 |
$arySortOrder['side'] .= ',plugins_day_yesterday';
|
204 |
global $current_user;
|
205 |
-
|
206 |
update_user_option($current_user->ID, 'meta-box-order_wppiwik', $arySortOrder);
|
207 |
update_option('wp-piwik_dashboardid', self::$intDashboardID);
|
208 |
}
|
209 |
-
|
210 |
foreach ($arySortOrder as $strCol => $strWidgets) {
|
211 |
-
|
212 |
if (is_array($aryWidgets)) foreach ($aryWidgets as $strParams) {
|
213 |
$aryParams = explode('_', $strParams);
|
214 |
-
|
215 |
'params' => array(
|
216 |
'period' => (isset($aryParams[1])?$aryParams[1]:''),
|
217 |
'date' => (isset($aryParams[2])?$aryParams[2]:''),
|
@@ -225,6 +300,28 @@ class wp_piwik {
|
|
225 |
<div class="wrap">
|
226 |
<div id="icon-post" class="icon32"><br /></div>
|
227 |
<h2><?php _e('Piwik Statistics', 'wp-piwik'); ?></h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
<div id="dashboard-widgets-wrap">
|
229 |
<div id="dashboard-widgets" class="metabox-holder">
|
230 |
<div id="postbox-container" class="wp-piwik-side" style="width:290px; float:left;">
|
@@ -252,9 +349,26 @@ class wp_piwik {
|
|
252 |
</div>
|
253 |
</div>
|
254 |
<?php /************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
}
|
256 |
|
257 |
function show_settings() {
|
|
|
|
|
|
|
|
|
258 |
$strToken = get_option('wp-piwik_token');
|
259 |
$strURL = get_option('wp-piwik_url');
|
260 |
$intSite = get_option('wp-piwik_siteid');
|
@@ -262,8 +376,7 @@ class wp_piwik {
|
|
262 |
<div class="wrap">
|
263 |
<h2><?php _e('WP-Piwik Settings', 'wp-piwik') ?></h2>
|
264 |
<div class="inside">
|
265 |
-
<form method="post" action="
|
266 |
-
<?php wp_nonce_field('update-options'); ?>
|
267 |
<table class="form-table">
|
268 |
<tr><td colspan="2"><h3><?php _e('Account settings', 'wp-piwik'); ?></h3></td></tr>
|
269 |
<tr>
|
@@ -283,6 +396,10 @@ class wp_piwik {
|
|
283 |
' like "1234a5cd6789e0a12345b678cd9012ef".'
|
284 |
, 'wp-piwik'
|
285 |
); ?>
|
|
|
|
|
|
|
|
|
286 |
</span></td></tr>
|
287 |
<?php /************************************************************************/
|
288 |
if (!empty($strToken) && !empty($strURL)) {
|
@@ -291,7 +408,7 @@ class wp_piwik {
|
|
291 |
echo '<tr><td></td><td><p><strong>'.__('An error occured', 'wp-piwik').': </strong>'.
|
292 |
__('Please check URL and auth token. You need at least view access to one site.', 'wp-piwik').
|
293 |
'</p></td></tr>';
|
294 |
-
} elseif ($aryData['result'] == 'error') {
|
295 |
echo '<tr><td colspan="2"><p><strong>'.__('An error occured', 'wp-piwik').
|
296 |
': </strong>'.$aryData['message'].'</p></td></tr>';
|
297 |
} else {
|
@@ -307,6 +424,7 @@ class wp_piwik {
|
|
307 |
update_option('wp-piwik_siteid', $aryData[0]['idsite']);
|
308 |
$intSite = get_option('wp-piwik_siteid');
|
309 |
$intAddJS = get_option('wp-piwik_addjs');
|
|
|
310 |
$strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
|
311 |
if ($intAddJS)
|
312 |
update_option('wp-piwik_jscode', $strJavaScript);
|
@@ -319,6 +437,12 @@ class wp_piwik {
|
|
319 |
__('If your template uses wp_footer(), WP-Piwik can automatically'.
|
320 |
' add the Piwik javascript code to your blog.', 'wp-piwik').
|
321 |
'</span></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
global $wp_roles;
|
323 |
echo '<tr><td>'.__('Tracking filter', 'wp-piwik').':</td><td>';
|
324 |
$aryFilter = get_option('wp-piwik_filter');
|
@@ -345,14 +469,101 @@ class wp_piwik {
|
|
345 |
}
|
346 |
/***************************************************************************/ ?>
|
347 |
</table>
|
348 |
-
<input type="hidden" name="action" value="
|
349 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
<p class="submit">
|
351 |
<input type="submit" name="Submit" value="<?php _e('Save settings', 'wp-piwik') ?>" />
|
352 |
</p>
|
353 |
</form>
|
354 |
</div>
|
|
|
355 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
<?php /************************************************************************/
|
357 |
}
|
358 |
}
|
2 |
/*
|
3 |
Plugin Name: WP-Piwik
|
4 |
|
5 |
+
Plugin URI: http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/
|
6 |
|
7 |
Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
|
8 |
|
9 |
+
Version: 0.6.0
|
10 |
Author: André Bräkling
|
11 |
Author URI: http://www.braekling.de
|
12 |
|
29 |
|
30 |
class wp_piwik {
|
31 |
|
32 |
+
public static $intRevisionId = 12;
|
33 |
public static $intDashboardID = 5;
|
34 |
+
public static $bolWPMU = false;
|
35 |
+
public static $bolOverall = false;
|
36 |
|
37 |
function __construct() {
|
38 |
+
if ($GLOBALS['wp-piwik_wpmu']) {
|
39 |
+
self::$bolWPMU = true;
|
40 |
+
$intCurrentRevision = get_site_option('wpmu-piwik_revision', 0);
|
41 |
+
} else $intCurrentRevision = get_option('wp-piwik_revision',0);
|
42 |
if ($intCurrentRevision < self::$intRevisionId) $this->install();
|
43 |
$strLocale = get_locale();
|
44 |
if ( !empty( $strLocale ) ) {
|
45 |
+
$strMOfile = ABSPATH . 'wp-content/'.
|
46 |
+
(self::$bolWPMU?'mu-':'').'plugins/'.
|
47 |
+
basename(dirname(__FILE__)).'/languages/wp-piwik-'.$strLocale.'.mo';
|
48 |
load_textdomain('wp-piwik', $strMOfile);
|
49 |
}
|
50 |
+
|
51 |
register_activation_hook(__FILE__, array($this, 'install'));
|
52 |
+
|
53 |
+
if (!self::$bolWPMU)
|
54 |
+
add_filter('plugin_row_meta', array($this, 'set_plugin_meta'), 10, 2);
|
55 |
+
|
56 |
+
if (self::$bolWPMU || get_option('wp-piwik_addjs') == 1)
|
57 |
add_action('wp_footer', array($this, 'footer'));
|
58 |
+
|
59 |
+
add_action('admin_menu', array($this, 'build_menu'));
|
60 |
}
|
61 |
|
62 |
function install() {
|
63 |
+
if (self::$bolWPMU)
|
64 |
+
update_site_option('wpmu-piwik_revision', self::$intRevisionId);
|
65 |
+
else
|
66 |
+
update_option('wp-piwik_revision', self::$intRevisionId);
|
67 |
}
|
68 |
|
69 |
function footer() {
|
71 |
get_currentuserinfo();
|
72 |
$bolDisplay = true;
|
73 |
if (!empty($current_user->roles)) {
|
74 |
+
$aryFilter = (self::$bolWPMU?get_site_option('wpmu-piwik_filter'):get_option('wp-piwik_filter'));
|
75 |
foreach ($current_user->roles as $strRole)
|
76 |
if (isset($aryFilter[$strRole]) && $aryFilter[$strRole])
|
77 |
$bolDisplay = false;
|
78 |
}
|
79 |
+
$strJSCode = get_option('wp-piwik_jscode', '');
|
80 |
+
|
81 |
+
if (self::$bolWPMU && empty($strJSCode)) {
|
82 |
+
$aryReturn = $this->create_wpmu_site();
|
83 |
+
$strJSCode = $aryReturn['js'];
|
84 |
+
}
|
85 |
+
if ($bolDisplay) echo $strJSCode;
|
86 |
}
|
87 |
|
88 |
function build_menu() {
|
89 |
+
if (!self::$bolWPMU) {
|
90 |
+
$intDisplayTo = get_option('wp-piwik_displayto', 8);
|
91 |
+
$strToken = get_option('wp-piwik_token');
|
92 |
+
$strPiwikURL = get_option('wp-piwik_url');
|
93 |
+
} else {
|
94 |
+
$intDisplayTo = 8;
|
95 |
+
$strToken = get_site_option('wpmu-piwik_token');
|
96 |
+
$strPiwikURL = get_site_option('wpmu-piwik_url');
|
97 |
+
}
|
98 |
+
if (!empty($strToken) && !empty($strPiwikURL)) {
|
99 |
+
$intStatsPage = add_dashboard_page(
|
100 |
+
__('Piwik Statistics', 'wp-piwik'),
|
101 |
+
__('WP-Piwik', 'wp-piwik'),
|
102 |
+
$intDisplayTo,
|
103 |
+
__FILE__,
|
104 |
+
array($this, 'show_stats')
|
105 |
+
);
|
106 |
+
add_action('admin_print_scripts-'.$intStatsPage, array($this, 'load_scripts'));
|
107 |
+
add_action('admin_head-'.$intStatsPage, array($this, 'add_admin_header'));
|
108 |
+
}
|
109 |
//add_filter('manage_posts_columns', array($this, 'display_post_unique_column'));
|
110 |
//add_action('manage_posts_custom_column', array($this, 'display_post_unique_content'), $intDisplayTo, 2);
|
111 |
+
if (!self::$bolWPMU)
|
112 |
+
add_options_page(
|
113 |
+
__('WP-Piwik', 'wp-piwik'),
|
114 |
+
__('WP-Piwik', 'wp-piwik'),
|
115 |
+
8,
|
116 |
+
__FILE__,
|
117 |
+
array($this, 'show_settings')
|
118 |
+
);
|
119 |
+
elseif (is_site_admin())
|
120 |
+
add_options_page(
|
121 |
+
__('WPMU-Piwik', 'wpmu-piwik'),
|
122 |
+
__('WPMU-Piwik', 'wpmu-piwik'),
|
123 |
+
8,
|
124 |
+
__FILE__,
|
125 |
+
array($this, 'show_mu_settings')
|
126 |
+
);
|
127 |
}
|
128 |
|
129 |
function set_plugin_meta($strLinks, $strFile) {
|
141 |
function load_scripts() {
|
142 |
wp_enqueue_script(
|
143 |
'wp-piwik',
|
144 |
+
$this->get_plugin_url().(self::$bolWPMU?'wp-piwik/':'').'js/wp-piwik.js',
|
145 |
array('jquery', 'admin-comments', 'postbox')
|
146 |
);
|
147 |
}
|
148 |
|
149 |
function add_admin_header() {
|
150 |
+
echo '<link rel="stylesheet" href="'.$this->get_plugin_url().(self::$bolWPMU?'wp-piwik/':'').'css/wp-piwik.css" type="text/css"/>';
|
151 |
}
|
152 |
|
153 |
function get_plugin_url() {
|
154 |
+
return trailingslashit(WP_CONTENT_URL.'/'.(self::$bolWPMU?'mu-':'').'plugins/'.plugin_basename(dirname(__FILE__)));
|
155 |
}
|
156 |
|
157 |
function get_remote_file($strURL) {
|
173 |
function call_API($strMethod, $strPeriod='', $strDate='', $intLimit='') {
|
174 |
$strKey = $strMethod.'_'.$strPeriod.'_'.$strDate.'_'.$intLimit;
|
175 |
if (empty($this->aryCache[$strKey])) {
|
176 |
+
if (self::$bolWPMU) {
|
177 |
+
$strToken = get_site_option('wpmu-piwik_token');
|
178 |
+
$strURL = get_site_option('wpmu-piwik_url');
|
179 |
+
} else {
|
180 |
+
$strToken = get_option('wp-piwik_token');
|
181 |
+
$strURL = get_option('wp-piwik_url');
|
182 |
+
}
|
183 |
$intSite = get_option('wp-piwik_siteid');
|
184 |
+
if (self::$bolWPMU && empty($intSite)) {
|
185 |
+
$aryReturn = $this->create_wpmu_site();
|
186 |
+
$intSite = $aryReturn['id'];
|
187 |
+
}
|
188 |
+
if (self::$bolOverall) $intSite = 'all';
|
189 |
if (empty($strToken) || empty($strURL)) {
|
190 |
$this->aryCache[$key] = array(
|
191 |
'result' => 'error',
|
198 |
$strURL .= '&idSite='.$intSite.'&period='.$strPeriod.'&date='.$strDate;
|
199 |
$strURL .= '&format=PHP&filter_limit='.$intLimit;
|
200 |
$strURL .= '&token_auth='.$strToken;
|
201 |
+
$strResult = $this->get_remote_file($strURL);
|
|
|
202 |
$this->aryCache[$strKey] = unserialize($strResult);
|
203 |
}
|
204 |
+
return $this->aryCache[$strKey];
|
205 |
+
}
|
206 |
+
|
207 |
+
function create_wpmu_site() {
|
208 |
+
$strToken = get_site_option('wpmu-piwik_token');
|
209 |
+
$strURL = get_site_option('wpmu-piwik_url');
|
210 |
+
$strJavaScript = '';
|
211 |
+
$intSite = NULL;
|
212 |
+
if (!empty($strToken) && !empty($strURL)) {
|
213 |
+
$intSite = get_option('wp-piwik_siteid');
|
214 |
+
if (empty($intSite)) {
|
215 |
+
$strName = get_bloginfo('name');
|
216 |
+
$strBlogURL = get_bloginfo('url');
|
217 |
+
if (substr($strURL, -1, 1) != '/') $strURL .= '/';
|
218 |
+
$strURL .= '?module=API&method=SitesManager.addSite';
|
219 |
+
$strURL .= '&siteName='.urlencode('WPMU: '.$strName).'&urls='.urlencode($strBlogURL);
|
220 |
+
$strURL .= '&format=PHP';
|
221 |
+
$strURL .= '&token_auth='.$strToken;
|
222 |
+
$strResult = unserialize($this->get_remote_file($strURL));
|
223 |
+
if (!empty($strResult)) {
|
224 |
+
update_option('wp-piwik_siteid', $strResult);
|
225 |
+
$strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
|
226 |
+
}
|
227 |
+
} else $strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
|
228 |
+
update_option('wp-piwik_jscode', $strJavaScript);
|
229 |
+
}
|
230 |
+
return array('js' => $strJavaScript, 'id' => $intSite);
|
231 |
}
|
232 |
|
233 |
function create_dashboard_widget($strFile, $aryConfig) {
|
234 |
+
$strDesc = $strID = '';
|
235 |
foreach ($aryConfig['params'] as $strParam)
|
236 |
if (!empty($strParam)) {
|
237 |
$strDesc .= $strParam.', ';
|
257 |
}
|
258 |
|
259 |
function show_stats() {
|
260 |
+
$strToken = get_option('wp-piwik_token');
|
261 |
+
$strPiwikURL = get_option('wp-piwik_url');
|
262 |
$arySortOrder = get_user_option('meta-box-order_wppiwik');
|
263 |
$aryClosed = get_user_option('closedpostboxes_wppiwik');
|
264 |
if (empty($aryClosed)) $aryClosed = array();
|
265 |
$aryDashboard = array();
|
266 |
+
$intCurrentDashboard = get_option('wp-piwik_dashboardid',0);
|
|
|
|
|
267 |
if (!$arySortOrder) {
|
268 |
// Set default configuration
|
269 |
$arySortOrder = array(
|
278 |
$arySortOrder['normal'] .= ',screens_day_yesterday,systems_day_yesterday';
|
279 |
$arySortOrder['side'] .= ',plugins_day_yesterday';
|
280 |
global $current_user;
|
281 |
+
get_currentuserinfo();
|
282 |
update_user_option($current_user->ID, 'meta-box-order_wppiwik', $arySortOrder);
|
283 |
update_option('wp-piwik_dashboardid', self::$intDashboardID);
|
284 |
}
|
|
|
285 |
foreach ($arySortOrder as $strCol => $strWidgets) {
|
286 |
+
$aryWidgets = explode(',', $strWidgets);
|
287 |
if (is_array($aryWidgets)) foreach ($aryWidgets as $strParams) {
|
288 |
$aryParams = explode('_', $strParams);
|
289 |
+
$aryDashboard[$strCol][$aryParams[0]] = array(
|
290 |
'params' => array(
|
291 |
'period' => (isset($aryParams[1])?$aryParams[1]:''),
|
292 |
'date' => (isset($aryParams[2])?$aryParams[2]:''),
|
300 |
<div class="wrap">
|
301 |
<div id="icon-post" class="icon32"><br /></div>
|
302 |
<h2><?php _e('Piwik Statistics', 'wp-piwik'); ?></h2>
|
303 |
+
<?php /************************************************************************/
|
304 |
+
|
305 |
+
if (self::$bolWPMU && function_exists('is_site_admin') && is_site_admin()) {
|
306 |
+
if (isset($_POST['wpmu_show_stats']))
|
307 |
+
/*if ($_POST['wpmu_show_stats'] == 'all') self::$bolOverall = true;
|
308 |
+
else*/ switch_to_blog((int) $_POST['wpmu_show_stats']);
|
309 |
+
global $blog_id;
|
310 |
+
$aryBlogs = get_blog_list(0, 'all');
|
311 |
+
echo '<form method="POST" action="">'."\n";
|
312 |
+
echo '<select name="wpmu_show_stats">'."\n";
|
313 |
+
// echo '<option value="all">Overall stats</option>';
|
314 |
+
foreach ($aryBlogs as $aryBlog) {
|
315 |
+
$objBlog = get_blog_details($aryBlog['blog_id'], true);
|
316 |
+
echo '<option value="'.$objBlog->blog_id.'"'.($blog_id == $objBlog->blog_id?' selected="selected"':'').'>'.$objBlog->blogname.'</option>'."\n";
|
317 |
+
}
|
318 |
+
echo '</select><input type="submit" value="'.__('Change').'" />'."\n ";
|
319 |
+
if (!self::$bolOverall) echo __('Currently shown stats:').' <a href="'.get_bloginfo('url').'">'.get_bloginfo('name').'</a>'."\n";
|
320 |
+
else _e('Current shown stats: <strong>Overall</strong>');
|
321 |
+
echo '</form>'."\n";
|
322 |
+
}
|
323 |
+
|
324 |
+
/***************************************************************************/ ?>
|
325 |
<div id="dashboard-widgets-wrap">
|
326 |
<div id="dashboard-widgets" class="metabox-holder">
|
327 |
<div id="postbox-container" class="wp-piwik-side" style="width:290px; float:left;">
|
349 |
</div>
|
350 |
</div>
|
351 |
<?php /************************************************************************/
|
352 |
+
if (self::$bolWPMU && function_exists('is_site_admin') && is_site_admin()) {
|
353 |
+
restore_current_blog(); self::$bolOverall = false;
|
354 |
+
}
|
355 |
+
}
|
356 |
+
|
357 |
+
function save_settings() {
|
358 |
+
update_option('wp-piwik_token', $_POST['wp-piwik_token'],'');
|
359 |
+
update_option('wp-piwik_url', $_POST['wp-piwik_url'],'');
|
360 |
+
update_option('wp-piwik_siteid', $_POST['wp-piwik_siteid'],'');
|
361 |
+
update_option('wp-piwik_addjs', $_POST['wp-piwik_addjs'],'');
|
362 |
+
update_option('wp-piwik_filter', $_POST['wp-piwik_filter'],'');
|
363 |
+
update_option('wp-piwik_displayto', $_POST['wp-piwik_displayto'],'');
|
364 |
+
update_option('wp-piwik_disable_gapi', $_POST['wp-piwik_disable_gapi'],'');
|
365 |
}
|
366 |
|
367 |
function show_settings() {
|
368 |
+
|
369 |
+
if (isset($_POST['action']) && $_POST['action'] == 'save_settings')
|
370 |
+
$this->save_settings();
|
371 |
+
|
372 |
$strToken = get_option('wp-piwik_token');
|
373 |
$strURL = get_option('wp-piwik_url');
|
374 |
$intSite = get_option('wp-piwik_siteid');
|
376 |
<div class="wrap">
|
377 |
<h2><?php _e('WP-Piwik Settings', 'wp-piwik') ?></h2>
|
378 |
<div class="inside">
|
379 |
+
<form method="post" action="">
|
|
|
380 |
<table class="form-table">
|
381 |
<tr><td colspan="2"><h3><?php _e('Account settings', 'wp-piwik'); ?></h3></td></tr>
|
382 |
<tr>
|
396 |
' like "1234a5cd6789e0a12345b678cd9012ef".'
|
397 |
, 'wp-piwik'
|
398 |
); ?>
|
399 |
+
<?php _e(
|
400 |
+
'<strong>Important note:</strong> If you do not host this blog on your own, your site admin is able to get your auth token from the database. So he is able to access your statistics. You should never use an auth token with more than simple view access!'
|
401 |
+
);
|
402 |
+
?>
|
403 |
</span></td></tr>
|
404 |
<?php /************************************************************************/
|
405 |
if (!empty($strToken) && !empty($strURL)) {
|
408 |
echo '<tr><td></td><td><p><strong>'.__('An error occured', 'wp-piwik').': </strong>'.
|
409 |
__('Please check URL and auth token. You need at least view access to one site.', 'wp-piwik').
|
410 |
'</p></td></tr>';
|
411 |
+
} elseif (isset($aryData['result']) && $aryData['result'] == 'error') {
|
412 |
echo '<tr><td colspan="2"><p><strong>'.__('An error occured', 'wp-piwik').
|
413 |
': </strong>'.$aryData['message'].'</p></td></tr>';
|
414 |
} else {
|
424 |
update_option('wp-piwik_siteid', $aryData[0]['idsite']);
|
425 |
$intSite = get_option('wp-piwik_siteid');
|
426 |
$intAddJS = get_option('wp-piwik_addjs');
|
427 |
+
$intDisableGAPI = get_option('wp-piwik_disable_gapi');
|
428 |
$strJavaScript = $this->call_API('SitesManager.getJavascriptTag');
|
429 |
if ($intAddJS)
|
430 |
update_option('wp-piwik_jscode', $strJavaScript);
|
437 |
__('If your template uses wp_footer(), WP-Piwik can automatically'.
|
438 |
' add the Piwik javascript code to your blog.', 'wp-piwik').
|
439 |
'</span></td></tr>';
|
440 |
+
echo '<tr><td>'.__('Disable Google Chart API', 'wp-piwik').
|
441 |
+
':</td><td><input type="checkbox" value="1" name="wp-piwik_disable_gapi" '.
|
442 |
+
($intDisableGAPI?' checked="checked"':'').'/></td></tr>';
|
443 |
+
echo '<tr><td></td><td><span class="setting-description">'.
|
444 |
+
__('WP-Piwik uses the Google Chart API to create graphs. To avoid this, just check this box.', 'wp-piwik').
|
445 |
+
'</span></td></tr>';
|
446 |
global $wp_roles;
|
447 |
echo '<tr><td>'.__('Tracking filter', 'wp-piwik').':</td><td>';
|
448 |
$aryFilter = get_option('wp-piwik_filter');
|
469 |
}
|
470 |
/***************************************************************************/ ?>
|
471 |
</table>
|
472 |
+
<input type="hidden" name="action" value="save_settings" />
|
473 |
+
<p class="submit">
|
474 |
+
<input type="submit" name="Submit" value="<?php _e('Save settings', 'wp-piwik') ?>" />
|
475 |
+
</p>
|
476 |
+
</form>
|
477 |
+
</div>
|
478 |
+
<?php $this->credits(); ?>
|
479 |
+
</div>
|
480 |
+
<?php /************************************************************************/
|
481 |
+
}
|
482 |
+
|
483 |
+
function save_mu_settings() {
|
484 |
+
update_site_option('wpmu-piwik_token', $_POST['wp-piwik_token'],'');
|
485 |
+
update_site_option('wpmu-piwik_url', $_POST['wp-piwik_url'],'');
|
486 |
+
update_site_option('wpmu-piwik_filter', $_POST['wp-piwik_filter'],'');
|
487 |
+
update_site_option('wpmu-piwik_disable_gapi', $_POST['wp-piwik_disable_gapi'],'');
|
488 |
+
}
|
489 |
+
|
490 |
+
function show_mu_settings() {
|
491 |
+
|
492 |
+
if (isset($_POST['action']) && $_POST['action'] == 'save_settings')
|
493 |
+
$this->save_mu_settings();
|
494 |
+
|
495 |
+
$strToken = get_site_option('wpmu-piwik_token');
|
496 |
+
$strURL = get_site_option('wpmu-piwik_url');
|
497 |
+
/***************************************************************************/ ?>
|
498 |
+
<div class="wrap">
|
499 |
+
<h2><?php _e('WPMU-Piwik Settings', 'wp-piwik') ?></h2>
|
500 |
+
<div class="inside">
|
501 |
+
<form method="post" action="">
|
502 |
+
<table class="form-table">
|
503 |
+
<tr><td colspan="2"><h3><?php _e('Account settings', 'wp-piwik'); ?></h3></td></tr>
|
504 |
+
<tr>
|
505 |
+
<td><?php _e('Piwik URL', 'wp-piwik'); ?>:</td>
|
506 |
+
<td><input type="text" name="wp-piwik_url" id="wp-piwik_url" value="<?php echo $strURL; ?>" /></td>
|
507 |
+
</tr>
|
508 |
+
<tr>
|
509 |
+
<td><?php _e('Auth token', 'wp-piwik'); ?>:</td>
|
510 |
+
<td><input type="text" name="wp-piwik_token" id="wp-piwik_token" value="<?php echo $strToken; ?>" /></td>
|
511 |
+
</tr>
|
512 |
+
<tr><td></td><td><span class="setting-description">
|
513 |
+
<?php _e(
|
514 |
+
'To enable Piwik statistics, please enter your Piwik'.
|
515 |
+
' base URL (like http://mydomain.com/piwik) and your'.
|
516 |
+
' personal authentification token. You can get the token'.
|
517 |
+
' on the API page inside your Piwik interface. It looks'.
|
518 |
+
' like "1234a5cd6789e0a12345b678cd9012ef".'
|
519 |
+
, 'wp-piwik'
|
520 |
+
); ?><br />
|
521 |
+
<?php _e(
|
522 |
+
'<strong>Important note:</strong> You have to choose a token which provides administration access. WPMU-Piwik will create new Piwik sites for each blog if it is shown the first time and it is not added yet. All users can access their own statistics only, while site admins can access all statistics. To avoid conflicts, you should use a clean Piwik installation without other sites added. The provided themes should use wp_footer, because it adds the Piwik javascript code to each page.'
|
523 |
+
);
|
524 |
+
?>
|
525 |
+
</span></td></tr>
|
526 |
+
<?php /************************************************************************/
|
527 |
+
if (!empty($strToken) && !empty($strURL)) {
|
528 |
+
global $wp_roles;
|
529 |
+
$intDisableGAPI = get_site_option('wpmu-piwik_disable_gapi');
|
530 |
+
echo '<tr><td>'.__('Disable Google Chart API', 'wp-piwik').
|
531 |
+
':</td><td><input type="checkbox" value="1" name="wp-piwik_disable_gapi" '.
|
532 |
+
($intDisableGAPI?' checked="checked"':'').'/></td></tr>';
|
533 |
+
echo '<tr><td></td><td><span class="setting-description">'.
|
534 |
+
__('WP-Piwik uses the Google Chart API to create graphs. To avoid this, just check this box.', 'wp-piwik').
|
535 |
+
'</span></td></tr>';
|
536 |
+
echo '<tr><td>'.__('Tracking filter', 'wp-piwik').':</td><td>';
|
537 |
+
$aryFilter = get_site_option('wpmu-piwik_filter');
|
538 |
+
foreach($wp_roles->role_names as $strKey => $strName) {
|
539 |
+
echo '<input type="checkbox" '.(isset($aryFilter[$strKey]) && $aryFilter[$strKey]?'checked="checked" ':'').'value="1" name="wp-piwik_filter['.$strKey.']" /> '.$strName.' ';
|
540 |
+
}
|
541 |
+
echo '</td></tr>';
|
542 |
+
echo '<tr><td></td><td><span class="setting-description">'.
|
543 |
+
__('Choose users by user role you do <strong>not</strong> want to track.', 'wp-piwik').
|
544 |
+
'</span></td></tr>';
|
545 |
+
}
|
546 |
+
/***************************************************************************/ ?>
|
547 |
+
</table>
|
548 |
+
<input type="hidden" name="action" value="save_settings" />
|
549 |
<p class="submit">
|
550 |
<input type="submit" name="Submit" value="<?php _e('Save settings', 'wp-piwik') ?>" />
|
551 |
</p>
|
552 |
</form>
|
553 |
</div>
|
554 |
+
<?php $this->credits(); ?>
|
555 |
</div>
|
556 |
+
<?php /************************************************************************/
|
557 |
+
}
|
558 |
+
|
559 |
+
function credits() {
|
560 |
+
/***************************************************************************/ ?>
|
561 |
+
<h2>Credits</h2>
|
562 |
+
<div class="inside">
|
563 |
+
<p>Thank you very much, <a href="http://blogu.programeshqip.org/">Besnik Bleta</a> and <a href="http://www.fatcow.com/">FatCow</a> for your translation work!</p>
|
564 |
+
<p>Thank you very much, all users who send me mails containing criticism, commendation, feature requests and bug reports! You help me to make WP-Piwik much better.</p>
|
565 |
+
<p>Thank <strong>you</strong> for using my plugin. It is the best commendation if my piece of code is really used!</p>
|
566 |
+
</div>
|
567 |
<?php /************************************************************************/
|
568 |
}
|
569 |
}
|
wpmu/wpmu-piwik.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* WPMU WP-Piwik loader
|
3 |
+
*
|
4 |
+
* 1. Copy the whole wp-piwik folder to /wp-content/mu-plugins/
|
5 |
+
* 2. Copy /wp-content/mu-plugins/wp-piwik/wpmu/wpmu-piwik.php to /wp-content/mu-plugins/wpmu-piwik.php
|
6 |
+
*/
|
7 |
+
|
8 |
+
$GLOBALS['wp-piwik_wpmu'] = true;
|
9 |
+
require_once('wp-piwik/wp-piwik.php');
|