Yandex Metrica - Version 1.9.3

Version Description

(November 6, 2022) = - minor tweaks & improvements - Added uninstaller - tested with WordPress 6.1

Download this release

Release Info

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

Code changes from version 1.9.2 to 1.9.3

Files changed (5) hide show
  1. README.md +5 -194
  2. libs/Yandex_Metrica.php +7 -7
  3. readme.txt +10 -5
  4. uninstall.php +16 -0
  5. yandex-metrica.php +3 -3
README.md CHANGED
@@ -1,25 +1,11 @@
1
- # Yandex Metrica #
2
 
3
- Contributors: m_uysl, ildarkhasanshin
4
- Tags: yandex,metrica,stats,statistics,tools,analytics,analytics tool,metrika
5
- Requires at least: 3.8
6
- Tested up to: 5.8
7
- Stable tag: 1.9.1
8
- License: GPLv2 (or later)
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
-
12
- Easy way to use Yandex Metrica on your WordPress site.
13
-
14
- ## Description ##
15
 
16
  The best Yandex Metrica plugin for WordPress.
17
 
18
- ### What is Metrica ###
19
-
20
- Metrica is an analytics tool like just like google analytics. You can learn more about from [official website] (https://metrica.yandex.com).
21
-
22
-
23
  ### Features ###
24
 
25
  - Easy to manage counter's tracking options.
@@ -30,181 +16,6 @@ Metrica is an analytics tool like just like google analytics. You can learn more
30
  - i18n support: Completely translation ready!
31
 
32
 
33
- ### Translations ###
34
-
35
- * English (en_US), built-in
36
- * Turkish (tr_TR), native support
37
- * Russian (ru_RU), [oleg0789](https://profiles.wordpress.org/oleg0789) and Ксения Рыбка
38
-
39
- ## Installation ##
40
-
41
- 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.
42
-
43
- ## Frequently Asked Questions ##
44
-
45
- * What is metrica?
46
- - Metrica is a powerful analytics tool that provided by Yandex.
47
-
48
- * Is it free?
49
- - Definitely, metrica service and this plugin are totally free.
50
-
51
- * Can I see statistics on the WordPress dashboard?
52
- - Yes! (You have to use advanced mode, this feature needs API access)
53
-
54
- * I can see dashboard widget but no graph?
55
- - Probably your counter is not working correctly, please check counter status on the official metrica website. Sometimes we can't retrieve the statistical data via API, especially on the fresh counters.
56
-
57
- * Everything done, but metrica service doesn't work for me?
58
- - Yandex Metrica plugin uses wp_head hook for the adds necessary tracking code. Please, ensure your theme has wp_footer hook?
59
-
60
-
61
- ## Screenshots ##
62
-
63
- 1. Select mode, basic mode for who don't want to use metrica api. But advanced mode recommended!
64
- ![Multiple Mode](https://ps.w.org/yandex-metrica/assets/screenshot-1.png)
65
-
66
- 2. Displaying graph with metrica results.
67
- ![Dashboard widget](https://ps.w.org/yandex-metrica/assets/screenshot-2.png)
68
-
69
- 3. Settings page.
70
- ![Settings page](https://ps.w.org/yandex-metrica/assets/screenshot-3.png)
71
-
72
-
73
- ## Changelog ##
74
-
75
- ### 1.9.1 ###
76
- - hotfix: uppercase Chart.min.js
77
-
78
- ### 1.9 ###
79
- - chart.js update
80
- - Improved security
81
- - New filters: `yandex_metrica_app_id` and `yandex_metrica_app_secret`
82
-
83
- ### 1.8.3 ###
84
- - fixed an XSS
85
- - tested with WordPress 5.8
86
-
87
- ### 1.8.2 ###
88
- - Add composer support
89
- - tested with WordPress 5.5
90
-
91
- ### 1.8.1 ###
92
- - an option added for the dispatching e-commerce data
93
-
94
- ### 1.8 ###
95
- - Authorization method changed, URL parameters no longer acccepted
96
- - use wp_head instead wp_footer for the tracking code
97
- - tested with WordPress 5.1.x
98
-
99
- ### 1.7 ###
100
- - switched to new metrica tracking code by default
101
- - added an option for [new Yandex's tracking code](https://yandex.com/support/metrika/code/counter-initialize.html) (props @ildarkhasanshin)
102
- - Better tracker-address handling. (Don't save default addresses.)
103
- - tested with WordPress 5.x
104
-
105
- ### 1.6.3 ###
106
- - now users are able to change Tracker JS address
107
- - new filter `yandex_metrica_noscript_img_base` added
108
-
109
- ### 1.6.2 ###
110
- - prevent (possible) chart.js conflict with page builder plugins. Props @zzsnowballzz
111
-
112
- ### 1.6.1 ###
113
- - prevent inline js loading globally. Props Makaka Games
114
- - script handler renamed
115
- - chart options updated; bar charts start from zero and line charts are using index mode for tooltips
116
-
117
- ### 1.6 ###
118
- - charting library changed. (Switched to Chart.js)
119
- - daily stats using bar type
120
- - minor tweaks
121
-
122
- ### 1.5 ###
123
- - Metrica API upgraded, fixes api related problems
124
- - `sslverify` parameter set to true
125
- - UI improvements
126
- - Informer widget address update
127
- - Widget: showing visitors fix. Props Эльвира Капитонова
128
- - requires at least WordPress 3.7
129
-
130
- ### 1.4.3 ###
131
- - minor bug fix about HTTP request
132
-
133
- ### 1.4.2 ###
134
- - minor bug fixes
135
-
136
- ### 1.4.1 ###
137
- - array-multisort bug fix. Props Николай Астраханцев
138
-
139
- ### 1.4 ###
140
- - Text Domain changed
141
- - Nonces added to settings page
142
- - Wrong option name fixed. Props [romapad](https://github.com/romapad)
143
-
144
- ### 1.3 ###
145
- - Updated metrica tracking code
146
- - New hash tracking option added
147
-
148
- ### 1.2 ###
149
- - Improved error checking for API request
150
- - Possible connectivity case added
151
- - Minor tweaks
152
-
153
- #### 1.1.2 ####
154
- - Russian language pack added. Props Ксения Рыбка and oleg0789
155
- - API connectivity check improved
156
- - Minor fixes
157
-
158
- #### 1.1.1 ####
159
- - Dashboard widget daily order fixed
160
-
161
- ### 1.1 ###
162
- - Dashboard widget UI improvements
163
- - Bug fixes
164
-
165
- #### 1.0.2 ####
166
- - Capability checking before display temporary dashboard widget
167
-
168
- #### 1.0.1 ####
169
- - Closure function removed
170
- - Typo fix
171
-
172
- ### 1.0 ###
173
- - Metrica API integration
174
- - Backward compatibility mode
175
- - Tracking by user role
176
- - Dashboard widget
177
- - New widget, informer widget still exist
178
- - Better localization
179
- - Performance improvements
180
- - Special thanks to Yandex Team for all support.
181
-
182
- #### 0.1.3 ####
183
- - Minor bug fixes
184
-
185
- #### 0.1.2 ####
186
- - Bug fix - about options
187
-
188
- #### 0.1.1 ####
189
- - bug fix - header output
190
-
191
- #### 0.1 ####
192
- - Initial release.
193
-
194
- ## Upgrade Notice ##
195
-
196
- ### 1.0 ###
197
-
198
- Including major changes, recommended update!
199
-
200
- ### 1.5 ###
201
-
202
- Metrica api upgraded, if you get authentication related problems reset plugin settings and connect to API again (that will generate new token)
203
-
204
- ### 1.7 ###
205
-
206
- Switched to the new tracking code by default. You can turn off from the options.
207
-
208
- ### 1.8.3 ###
209
 
210
- Security release. Update the plugin ASAP!
 
1
+ # [Yandex Metrica](https://wordpress.org/plugins/yandex-metrica/) #
2
 
3
+ ![Support Level](https://img.shields.io/badge/support-active-green.svg) [![Release Version](https://img.shields.io/wordpress/plugin/v/yandex-metrica?label=Release%20Version)](https://github.com/mustafauysal/yandex-metrica/releases) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/yandex-metrica?label=WordPress) ![Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/yandex-metrica?label=PHP)
 
 
 
 
 
 
4
 
5
+ ### Welcome to our GitHub Repository
 
 
 
6
 
7
  The best Yandex Metrica plugin for WordPress.
8
 
 
 
 
 
 
9
  ### Features ###
10
 
11
  - Easy to manage counter's tracking options.
16
  - i18n support: Completely translation ready!
17
 
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ ## Support ##
21
+ This is a developer's portal for Yandex Metrica and should _not_ be used for support. Please visit the [support forums](https://wordpress.org/support/plugin/yandex-metrica/) if you need to submit a support request.
libs/Yandex_Metrica.php CHANGED
@@ -188,12 +188,12 @@ class Yandex_Metrica {
188
  }
189
 
190
  $total = array(
191
- 'pageviews' => $response['totals'][0][0],
192
- 'visits' => $response['totals'][0][1],
193
- 'visitors' => $response['totals'][0][2],
194
- 'new_visitors' => $response['totals'][0][3],
195
- 'page_depth' => $response['totals'][0][4],
196
- 'duration' => $response['totals'][0][5],
197
  );
198
 
199
  $stats = array(
@@ -236,7 +236,7 @@ class Yandex_Metrica {
236
 
237
  foreach ( $popular_content_result['data'] as $data_key => $data ) {
238
  $popular_content[ $data_key ]['url'] = $data['dimensions'][0]['name'];
239
- $popular_content[ $data_key ]['pageviews'] = $popular_content_result['totals'][0][ $data_key ];
240
  if ( count( $popular_content ) >= $per_page ) {
241
  break;
242
  }
188
  }
189
 
190
  $total = array(
191
+ 'pageviews' => ( isset( $response['totals'][0][0] ) ? absint( $response['totals'][0][0] ) : 0 ),
192
+ 'visits' => ( isset( $response['totals'][0][1] ) ? absint( $response['totals'][0][1] ) : 0 ),
193
+ 'visitors' => ( isset( $response['totals'][0][2] ) ? absint( $response['totals'][0][2] ) : 0 ),
194
+ 'new_visitors' => ( isset( $response['totals'][0][3] ) ? absint( $response['totals'][0][3] ) : 0 ),
195
+ 'page_depth' => ( isset( $response['totals'][0][4] ) ? absint( $response['totals'][0][4] ) : 0 ),
196
+ 'duration' => ( isset( $response['totals'][0][5] ) ? absint( $response['totals'][0][5] ) : 0 ),
197
  );
198
 
199
  $stats = array(
236
 
237
  foreach ( $popular_content_result['data'] as $data_key => $data ) {
238
  $popular_content[ $data_key ]['url'] = $data['dimensions'][0]['name'];
239
+ $popular_content[ $data_key ]['pageviews'] = ( isset( $popular_content_result['totals'][0][ $data_key ] ) ? $popular_content_result['totals'][0][ $data_key ] : 0 );
240
  if ( count( $popular_content ) >= $per_page ) {
241
  break;
242
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Yandex Metrica ===
2
-
3
- Contributors: m_uysl, ildarkhasanshin
4
- Tags: yandex,metrica,stats,statistics,tools,analytics,analytics tool,metrika
5
  Requires at least: 3.8
6
- Tested up to: 5.9
7
- Stable tag: 1.9.2
 
8
  License: GPLv2 (or later)
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,6 +65,11 @@ Yandex Metrica plugin uses wp_head hook for the adds necessary tracking code. Pl
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
68
  = 1.9.2 =
69
  - fix valid counter control
70
  - tested with WordPress 5.9
1
  === Yandex Metrica ===
2
+ Contributors: m_uysl
3
+ Tags: yandex, metrica, stats, statistics, tools, analytics, analytics tool, metrika
 
4
  Requires at least: 3.8
5
+ Tested up to: 6.1
6
+ Stable tag: 1.9.3
7
+ Requires PHP: 5.6
8
  License: GPLv2 (or later)
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
65
 
66
  == Changelog ==
67
 
68
+ = 1.9.3 (November 6, 2022) =
69
+ - minor tweaks & improvements
70
+ - Added uninstaller
71
+ - tested with WordPress 6.1
72
+
73
  = 1.9.2 =
74
  - fix valid counter control
75
  - tested with WordPress 5.9
uninstall.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Uninstall Yandex Metrica
4
+ *
5
+ * Deletes all plugin related data and configurations
6
+ *
7
+ */
8
+
9
+ // Exit if accessed directly.
10
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
11
+ exit;
12
+ }
13
+
14
+ require_once 'yandex-metrica.php';
15
+
16
+ delete_option( 'metrica_options' );
yandex-metrica.php CHANGED
@@ -4,7 +4,8 @@ Plugin Name: Yandex Metrica
4
  Plugin URI: https://github.com/mustafauysal/yandex-metrica
5
  Description: The best Yandex Metrica plugin for WordPress.
6
  Author: Mustafa Uysal
7
- Version: 1.9.2
 
8
  Text Domain: yandex-metrica
9
  Domain Path: /languages/
10
  Author URI: https://uysalmustafa.com
@@ -284,10 +285,9 @@ class WP_Yandex_Metrica extends WP_Stack_Plugin {
284
  'Metrica Informer',
285
  array( $this, 'metrica_informer' ),
286
  array(
287
- 'description' => 'Add metrica Informer to your sidebar, share daily statistics'
288
  )
289
  );
290
-
291
  }
292
 
293
  /**
4
  Plugin URI: https://github.com/mustafauysal/yandex-metrica
5
  Description: The best Yandex Metrica plugin for WordPress.
6
  Author: Mustafa Uysal
7
+ Version: 1.9.3
8
+ Requires PHP: 5.6
9
  Text Domain: yandex-metrica
10
  Domain Path: /languages/
11
  Author URI: https://uysalmustafa.com
285
  'Metrica Informer',
286
  array( $this, 'metrica_informer' ),
287
  array(
288
+ 'description' => esc_html__( 'Add metrica Informer to your sidebar, share daily statistics', 'yandex-metrica' )
289
  )
290
  );
 
291
  }
292
 
293
  /**