Yandex Metrica - Version 1.3

Version Description

Download this release

Release Info

Developer m_uysl
Plugin Icon 128x128 Yandex Metrica
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

readme.txt → README.md RENAMED
@@ -1,27 +1,27 @@
1
- === Yandex Metrica ===
2
 
3
  Contributors: m_uysl
4
  Tags: yandex,metrica,stats,statistics,tools,analytics,analytics tool,metrika
5
  Requires at least: 3.0
6
- Tested up to: 4.5
7
- Stable tag: 1.2
8
  License: GPLv2 (or later)
9
 
10
  Easy way to use Yandex Metrica in your WordPress site.
11
 
12
- == Description ==
13
 
14
  Best Metrica plugin for the using Yandex Metrica in your WordPress site.
15
 
16
- = What is Metrica =
17
 
18
  Metrica is an analytics tool like as google analytics.If you didn't hear metrica yet, you can [check official metrica](http://metrica.yandex.com/) page.
19
 
20
- = Что такое Метрика =
21
 
22
  Яндекс Метрика - это система аналитики сайтов, так же как и Гугл Аналиткс. Вы можете посмотреть официальную страницу Яндекс Метрики (http://metrica.yandex.ru/)
23
 
24
- = Features =
25
 
26
  - Easy to manage counter's tracking options.
27
  - Role based user tracking
@@ -30,7 +30,7 @@ Metrica is an analytics tool like as google analytics.If you didn't hear metrica
30
  - Basic mode ready! If you don't want to give API access, you can try basic mode.
31
  - i18n support: Completely translation ready!
32
 
33
- = Особенности =
34
 
35
  - Легкая настройка параметров отслеживания.
36
  - Отслеживание пользователей по ролям
@@ -40,17 +40,17 @@ Metrica is an analytics tool like as google analytics.If you didn't hear metrica
40
  - Поддержка локализации. Готовые переводы на английский, турецкий и русский языки.
41
 
42
 
43
- = Translations =
44
 
45
  * English (en_US), built-in
46
  * Turkish (tr_TR), native support
47
  * Russian (ru_RU), [oleg0789](https://profiles.wordpress.org/oleg0789) and Ксения Рыбка
48
 
49
- == Installation ==
50
 
51
  Extract the zip file and just drop the contents in the `wp-content/plugins/` directory of your WordPress installation and then activate the Plugin from admin's Plugins page.
52
 
53
- == Frequently Asked Questions ==
54
 
55
  * What is metrica?
56
  - Metrica is a powerful analytics tool that provided by Yandex.
@@ -65,15 +65,19 @@ Extract the zip file and just drop the contents in the `wp-content/plugins/` dir
65
  * Everything done, but metrica service doesn't work for me?
66
  - Yandex Metrica plugin uses wp_footer hook for the adds necessary trancking code. Please, check your theme has wp_footer hook?
67
 
68
- == Screenshots ==
69
 
70
  1. Select mode, basic mode for who don't want to use metrica api. But advanced mode recommended!
71
  2. Displaying graph with metrica results.
72
  3. Settings page.
73
 
74
- == Changelog ==
75
 
76
- = 1.2 =
 
 
 
 
77
  - Improved error checking for API request
78
  - Possible connectivity case added
79
  - Minor tweaks
@@ -86,7 +90,7 @@ Extract the zip file and just drop the contents in the `wp-content/plugins/` dir
86
  #### 1.1.1 ####
87
  - Dashboard widget daily order fixed
88
 
89
- = 1.1 =
90
  - Dashboard widget UI improvements
91
  - Bug fixes
92
 
@@ -97,7 +101,7 @@ Extract the zip file and just drop the contents in the `wp-content/plugins/` dir
97
  - Closure function removed
98
  - Typo fix
99
 
100
- = 1.0 =
101
  - Metrica API integration
102
  - Backward compatibility mode
103
  - Tracking by user role
@@ -123,8 +127,8 @@ Extract the zip file and just drop the contents in the `wp-content/plugins/` dir
123
 
124
  - Initial release.
125
 
126
- == Upgrade Notice ==
127
 
128
- = 1.0 =
129
 
130
  Including major changes, recommended update!
1
+ # Yandex Metrica #
2
 
3
  Contributors: m_uysl
4
  Tags: yandex,metrica,stats,statistics,tools,analytics,analytics tool,metrika
5
  Requires at least: 3.0
6
+ Tested up to: 4.6
7
+ Stable tag: 1.3
8
  License: GPLv2 (or later)
9
 
10
  Easy way to use Yandex Metrica in your WordPress site.
11
 
12
+ ## Description ##
13
 
14
  Best Metrica plugin for the using Yandex Metrica in your WordPress site.
15
 
16
+ ### What is Metrica ###
17
 
18
  Metrica is an analytics tool like as google analytics.If you didn't hear metrica yet, you can [check official metrica](http://metrica.yandex.com/) page.
19
 
20
+ ### Что такое Метрика ###
21
 
22
  Яндекс Метрика - это система аналитики сайтов, так же как и Гугл Аналиткс. Вы можете посмотреть официальную страницу Яндекс Метрики (http://metrica.yandex.ru/)
23
 
24
+ ### Features ###
25
 
26
  - Easy to manage counter's tracking options.
27
  - Role based user tracking
30
  - Basic mode ready! If you don't want to give API access, you can try basic mode.
31
  - i18n support: Completely translation ready!
32
 
33
+ ### Особенности ###
34
 
35
  - Легкая настройка параметров отслеживания.
36
  - Отслеживание пользователей по ролям
40
  - Поддержка локализации. Готовые переводы на английский, турецкий и русский языки.
41
 
42
 
43
+ ### Translations ###
44
 
45
  * English (en_US), built-in
46
  * Turkish (tr_TR), native support
47
  * Russian (ru_RU), [oleg0789](https://profiles.wordpress.org/oleg0789) and Ксения Рыбка
48
 
49
+ ## Installation ##
50
 
51
  Extract the zip file and just drop the contents in the `wp-content/plugins/` directory of your WordPress installation and then activate the Plugin from admin's Plugins page.
52
 
53
+ ## Frequently Asked Questions ##
54
 
55
  * What is metrica?
56
  - Metrica is a powerful analytics tool that provided by Yandex.
65
  * Everything done, but metrica service doesn't work for me?
66
  - Yandex Metrica plugin uses wp_footer hook for the adds necessary trancking code. Please, check your theme has wp_footer hook?
67
 
68
+ ## Screenshots ##
69
 
70
  1. Select mode, basic mode for who don't want to use metrica api. But advanced mode recommended!
71
  2. Displaying graph with metrica results.
72
  3. Settings page.
73
 
74
+ ## Changelog ##
75
 
76
+ ### 1.3 ###
77
+ - Updated metrica tracking code
78
+ - New hash tracking option added
79
+
80
+ ### 1.2 ###
81
  - Improved error checking for API request
82
  - Possible connectivity case added
83
  - Minor tweaks
90
  #### 1.1.1 ####
91
  - Dashboard widget daily order fixed
92
 
93
+ ### 1.1 ###
94
  - Dashboard widget UI improvements
95
  - Bug fixes
96
 
101
  - Closure function removed
102
  - Typo fix
103
 
104
+ ### 1.0 ###
105
  - Metrica API integration
106
  - Backward compatibility mode
107
  - Tracking by user role
127
 
128
  - Initial release.
129
 
130
+ ## Upgrade Notice ##
131
 
132
+ ### 1.0 ###
133
 
134
  Including major changes, recommended update!
languages/yandex_metrica-ru_RU.mo CHANGED
Binary file
languages/yandex_metrica-ru_RU.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: Yandex Metrica 1.x\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
5
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
6
- "PO-Revision-Date: 2016-04-13 02:23+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: ru\n"
@@ -251,6 +251,10 @@ msgstr "Отслеживание ссылок, социальных фактор
251
  msgid "Accurate Track Bounce"
252
  msgstr "Точный учет отказов"
253
 
 
 
 
 
254
  #: templates/settings.php:119
255
  msgid "Track logged in users"
256
  msgstr "Отслеживание авторизованных пользователей"
3
  "Project-Id-Version: Yandex Metrica 1.x\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
5
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
6
+ "PO-Revision-Date: 2016-07-10 18:18+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: ru\n"
251
  msgid "Accurate Track Bounce"
252
  msgstr "Точный учет отказов"
253
 
254
+ #. templates/settings.php:115
255
+ msgid "Hash tracking in the browser's address bar"
256
+ msgstr "Признак отслеживания хеша в адресной строке браузера"
257
+
258
  #: templates/settings.php:119
259
  msgid "Track logged in users"
260
  msgstr "Отслеживание авторизованных пользователей"
languages/yandex_metrica-tr_TR.mo CHANGED
Binary file
languages/yandex_metrica-tr_TR.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: Yandex Metrica 1.x\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
5
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
6
- "PO-Revision-Date: 2016-04-13 02:21+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: en\n"
@@ -249,6 +249,10 @@ msgstr "Dış bağlantılar, dosya yüklemeleri ve Paylaş butonu raporu"
249
  msgid "Accurate Track Bounce"
250
  msgstr "Hemen çıkma oranı"
251
 
 
 
 
 
252
  #: templates/settings.php:119
253
  msgid "Track logged in users"
254
  msgstr "Giriş yapmış kullanıcıları dahil et"
3
  "Project-Id-Version: Yandex Metrica 1.x\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
5
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
6
+ "PO-Revision-Date: 2016-07-10 18:18+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: en\n"
249
  msgid "Accurate Track Bounce"
250
  msgstr "Hemen çıkma oranı"
251
 
252
+ #. templates/settings.php:115
253
+ msgid "Hash tracking in the browser's address bar"
254
+ msgstr "Tarayıcının adres satırında hash'in takip edilmesi"
255
+
256
  #: templates/settings.php:119
257
  msgid "Track logged in users"
258
  msgstr "Giriş yapmış kullanıcıları dahil et"
languages/yandex_metrica.pot CHANGED
@@ -241,6 +241,10 @@ msgstr ""
241
  msgid "Accurate Track Bounce"
242
  msgstr ""
243
 
 
 
 
 
244
  #: templates/settings.php:119
245
  msgid "Track logged in users"
246
  msgstr ""
@@ -332,3 +336,4 @@ msgstr ""
332
  #. Author URI of the plugin/theme
333
  msgid "http://uysalmustafa.com"
334
  msgstr ""
 
241
  msgid "Accurate Track Bounce"
242
  msgstr ""
243
 
244
+ #. templates/settings.php:115
245
+ msgid "Hash tracking in the browser's address bar"
246
+ msgstr ""
247
+
248
  #: templates/settings.php:119
249
  msgid "Track logged in users"
250
  msgstr ""
336
  #. Author URI of the plugin/theme
337
  msgid "http://uysalmustafa.com"
338
  msgstr ""
339
+
templates/settings.php CHANGED
@@ -23,6 +23,7 @@ if ( isset( $_POST["yandex-metrica-save"] ) ) {
23
  $this->options['clickmap'] = empty ( $_POST['metrica_clickmap'] ) ? false : true;
24
  $this->options['tracklinks'] = empty( $_POST['metrica_tracklinks'] ) ? false : true;
25
  $this->options['accurate_track'] = empty( $_POST['metrica_accurate_track'] ) ? false : true;
 
26
 
27
  $this->options['track-logged-in'] = ( $_POST['track-logged-in'] == "no" ) ? false : true;
28
  $this->options["untrack-roles"] = ! empty( $_POST["tracker_role"] ) ? array_map( 'esc_attr', $_POST["tracker_role"] ) : "";
@@ -111,6 +112,8 @@ if ( isset( $_POST["reset"] ) ) {
111
  </label><br>
112
  <label><input type="checkbox" <?php checked( $this->options['accurate_track'] ); ?> name="metrica_accurate_track" value="1"> <?php _e( 'Accurate Track Bounce', 'yandex_metrica' ); ?>
113
  </label><br>
 
 
114
  </td>
115
  </tr>
116
 
23
  $this->options['clickmap'] = empty ( $_POST['metrica_clickmap'] ) ? false : true;
24
  $this->options['tracklinks'] = empty( $_POST['metrica_tracklinks'] ) ? false : true;
25
  $this->options['accurate_track'] = empty( $_POST['metrica_accurate_track'] ) ? false : true;
26
+ $this->options['track_hash'] = empty( $_POST['track_hash'] ) ? false : true;
27
 
28
  $this->options['track-logged-in'] = ( $_POST['track-logged-in'] == "no" ) ? false : true;
29
  $this->options["untrack-roles"] = ! empty( $_POST["tracker_role"] ) ? array_map( 'esc_attr', $_POST["tracker_role"] ) : "";
112
  </label><br>
113
  <label><input type="checkbox" <?php checked( $this->options['accurate_track'] ); ?> name="metrica_accurate_track" value="1"> <?php _e( 'Accurate Track Bounce', 'yandex_metrica' ); ?>
114
  </label><br>
115
+ <label><input type="checkbox" <?php checked( $this->options['track_hash'] ); ?> name="track_hash" value="1"> <?php _e( "Hash tracking in the browser's address bar", 'yandex_metrica' ); ?>
116
+ </label><br>
117
  </td>
118
  </tr>
119
 
templates/tracker-js.php CHANGED
@@ -4,11 +4,12 @@
4
  (function (d, w, c) {
5
  (w[c] = w[c] || []).push(function() {
6
  try {
7
- w.yaCounter<?php echo $this->options["counter_id"];?> = new Ya.Metrika({id:<?php echo $this->options["counter_id"];?> ,
8
  webvisor:<?php echo $this->options["webvisor"]?"true":"false";?>,
9
  clickmap:<?php echo $this->options["clickmap"]?"true":"false";?>,
10
- trackLinks:<?php echo $this->options["tracklinks"]?"true":"false";;?>,
11
- accurateTrackBounce:<?php echo $this->options["accurate_track"]?"true":"false";;?>});
 
12
  } catch(e) { }
13
  });
14
 
@@ -17,12 +18,12 @@
17
  f = function () { n.parentNode.insertBefore(s, n); };
18
  s.type = "text/javascript";
19
  s.async = true;
20
- s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
21
 
22
  if (w.opera == "[object Opera]") {
23
  d.addEventListener("DOMContentLoaded", f, false);
24
  } else { f(); }
25
  })(document, window, "yandex_metrika_callbacks");
26
  </script>
27
- <noscript><div><img src="//mc.yandex.ru/watch/<?php echo $this->options["counter_id"];?> " style="position:absolute; left:-9999px;" alt="" /></div></noscript>
28
- <!-- /Yandex.Metrika counter -->
4
  (function (d, w, c) {
5
  (w[c] = w[c] || []).push(function() {
6
  try {
7
+ w.yaCounter<?php echo $this->options["counter_id"];?> = new Ya.Metrika({id:<?php echo $this->options["counter_id"];?>,
8
  webvisor:<?php echo $this->options["webvisor"]?"true":"false";?>,
9
  clickmap:<?php echo $this->options["clickmap"]?"true":"false";?>,
10
+ trackLinks:<?php echo $this->options["tracklinks"]?"true":"false";?>,
11
+ accurateTrackBounce:<?php echo $this->options["accurate_track"]?"true":"false";?>,
12
+ trackHash:<?php echo $this->options["hash_track"]?"true":"false";?>});
13
  } catch(e) { }
14
  });
15
 
18
  f = function () { n.parentNode.insertBefore(s, n); };
19
  s.type = "text/javascript";
20
  s.async = true;
21
+ s.src = "https://mc.yandex.ru/metrika/watch.js";
22
 
23
  if (w.opera == "[object Opera]") {
24
  d.addEventListener("DOMContentLoaded", f, false);
25
  } else { f(); }
26
  })(document, window, "yandex_metrika_callbacks");
27
  </script>
28
+ <noscript><div><img src="https://mc.yandex.ru/watch/<?php echo $this->options["counter_id"];?>" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
29
+ <!-- /Yandex.Metrika counter -->
yandex-metrica.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Yandex Metrica
4
  Plugin URI: http://uysalmustafa.com/plugins/yandex-metrica
5
  Description: Best metrica plugin for the use Yandex Metrica in your WordPress site.
6
  Author: Mustafa Uysal
7
- Version: 1.2
8
  Text Domain: yandex_metrica
9
  Domain Path: /languages/
10
  Author URI: http://uysalmustafa.com
@@ -204,7 +204,7 @@ class WP_Yandex_Metrica extends WP_Stack_Plugin {
204
  public function dashboard_chart_js() {
205
  wp_enqueue_script( 'jquery' );
206
  $statical_data = self::$metrica_api->get_counter_statistics( $this->options["counter_id"], $this->start_date, $this->end_date, "data" );
207
- foreach ($statical_data as $key => $row) {
208
  $days[$key] = $row['date'];
209
  }
210
  array_multisort($days, SORT_ASC, $statical_data);
4
  Plugin URI: http://uysalmustafa.com/plugins/yandex-metrica
5
  Description: Best metrica plugin for the use Yandex Metrica in your WordPress site.
6
  Author: Mustafa Uysal
7
+ Version: 1.3
8
  Text Domain: yandex_metrica
9
  Domain Path: /languages/
10
  Author URI: http://uysalmustafa.com
204
  public function dashboard_chart_js() {
205
  wp_enqueue_script( 'jquery' );
206
  $statical_data = self::$metrica_api->get_counter_statistics( $this->options["counter_id"], $this->start_date, $this->end_date, "data" );
207
+ foreach ( (array) $statical_data as $key => $row) {
208
  $days[$key] = $row['date'];
209
  }
210
  array_multisort($days, SORT_ASC, $statical_data);