Yandex Metrica - Version 1.2

Version Description

  • Improved error checking for API request
    • Possible connectivity case added
    • Minor tweaks

1.1.2

  • Russian language pack added. Props and oleg0789
  • API connectivity check improved
  • Minor fixes

1.1.1

  • Dashboard widget daily order fixed
Download this release

Release Info

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

Code changes from version 1.1.2 to 1.2

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: 2015-11-22 19:19+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: ru\n"
@@ -321,6 +321,14 @@ msgid "Are you sure you selected the correct counter? Please confirm."
321
  msgstr "Вы уверены, что выбрали правильный счетчик? Пожалуйста, подтвердите."
322
 
323
  #: yandex-metrica.php:149
 
 
 
 
 
 
 
 
324
  msgid "Temporary, connectivity problem!"
325
  msgstr "Временная проблема с подключением!"
326
 
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"
321
  msgstr "Вы уверены, что выбрали правильный счетчик? Пожалуйста, подтвердите."
322
 
323
  #: yandex-metrica.php:149
324
+ msgid ""
325
+ "Did you change your Yandex password? If changed, you need to re-authorize "
326
+ "this plugin."
327
+ msgstr ""
328
+ "Вы изменили пароль Яндекса? Если изменилось, то необходимо повторно "
329
+ "разрешить этот плагин."
330
+
331
+ #: yandex-metrica.php:150
332
  msgid "Temporary, connectivity problem!"
333
  msgstr "Временная проблема с подключением!"
334
 
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: 2015-11-22 19:18+0200\n"
7
  "Last-Translator: Mustafa Uysal <mustafa@lettoblog.com>\n"
8
  "Language-Team: \n"
9
  "Language: en\n"
@@ -322,6 +322,14 @@ msgstr ""
322
  "internet adresinin doğru olduğundan emin olunuz."
323
 
324
  #: yandex-metrica.php:149
 
 
 
 
 
 
 
 
325
  msgid "Temporary, connectivity problem!"
326
  msgstr ""
327
  "Düşük bir olasılıkta olsa, geçici bir bağlantı sorunu yaşamış olabilirsiniz."
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"
322
  "internet adresinin doğru olduğundan emin olunuz."
323
 
324
  #: yandex-metrica.php:149
325
+ msgid ""
326
+ "Did you change your Yandex password? If changed, you need to re-authorize "
327
+ "this plugin."
328
+ msgstr ""
329
+ "Yandex şifrenizi mi değiştirdiniz? Şifre değişimlerinde eklenti yeniden "
330
+ "yetkilendirilmelidir."
331
+
332
+ #: yandex-metrica.php:150
333
  msgid "Temporary, connectivity problem!"
334
  msgstr ""
335
  "Düşük bir olasılıkta olsa, geçici bir bağlantı sorunu yaşamış olabilirsiniz."
languages/yandex_metrica.pot CHANGED
@@ -5,12 +5,13 @@ msgstr ""
5
  "Project-Id-Version: Yandex Metrica 1.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
7
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: libs/widget.php:27
16
  msgid "Display statistics within selected period."
@@ -169,7 +170,6 @@ msgstr ""
169
  msgid "All options cleared!"
170
  msgstr ""
171
 
172
- #. #-#-#-#-# plugin.pot (Yandex Metrica 1.1.1) #-#-#-#-#
173
  #. Plugin Name of the plugin/theme
174
  #: templates/settings.php:59 yandex-metrica.php:85
175
  msgid "Yandex Metrica"
@@ -304,6 +304,12 @@ msgid "Are you sure you selected the correct counter? Please confirm."
304
  msgstr ""
305
 
306
  #: yandex-metrica.php:149
 
 
 
 
 
 
307
  msgid "Temporary, connectivity problem!"
308
  msgstr ""
309
 
5
  "Project-Id-Version: Yandex Metrica 1.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/yandex-metrica\n"
7
  "POT-Creation-Date: 2015-11-22 17:06:56+00:00\n"
8
+ "PO-Revision-Date: 2016-04-13 02:29+0200\n"
9
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Generator: Poedit 1.6.7\n"
 
 
15
 
16
  #: libs/widget.php:27
17
  msgid "Display statistics within selected period."
170
  msgid "All options cleared!"
171
  msgstr ""
172
 
 
173
  #. Plugin Name of the plugin/theme
174
  #: templates/settings.php:59 yandex-metrica.php:85
175
  msgid "Yandex Metrica"
304
  msgstr ""
305
 
306
  #: yandex-metrica.php:149
307
+ msgid ""
308
+ "Did you change your Yandex password? If changed, you need to re-authorize "
309
+ "this plugin."
310
+ msgstr ""
311
+
312
+ #: yandex-metrica.php:150
313
  msgid "Temporary, connectivity problem!"
314
  msgstr ""
315
 
libs/Yandex_Metrica.php CHANGED
@@ -15,6 +15,12 @@ class Yandex_Metrica {
15
  public function fetch_data( $url ) {
16
  $data = wp_remote_get( $url, array( 'timeout' => 7, 'httpversion' => '1.1', 'sslverify' => false ) );
17
 
 
 
 
 
 
 
18
  if ( isset( $data['response']['message'] ) && 'OK' != $data['response']['message'] ) {
19
  $this->error = "API connectivity problem.";
20
 
15
  public function fetch_data( $url ) {
16
  $data = wp_remote_get( $url, array( 'timeout' => 7, 'httpversion' => '1.1', 'sslverify' => false ) );
17
 
18
+ if ( $data instanceof WP_Error ) {
19
+ $this->error = "HTTP Request problem";
20
+
21
+ return false;
22
+ }
23
+
24
  if ( isset( $data['response']['message'] ) && 'OK' != $data['response']['message'] ) {
25
  $this->error = "API connectivity problem.";
26
 
readme.txt CHANGED
@@ -3,8 +3,8 @@
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.4
7
- Stable tag: 1.1.2
8
  License: GPLv2 (or later)
9
 
10
  Easy way to use Yandex Metrica in your WordPress site.
@@ -73,6 +73,11 @@ Extract the zip file and just drop the contents in the `wp-content/plugins/` dir
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
76
  #### 1.1.2 ####
77
  - Russian language pack added. Props Ксения Рыбка and oleg0789
78
  - API connectivity check improved
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.
73
 
74
  == Changelog ==
75
 
76
+ = 1.2 =
77
+ - Improved error checking for API request
78
+ - Possible connectivity case added
79
+ - Minor tweaks
80
+
81
  #### 1.1.2 ####
82
  - Russian language pack added. Props Ксения Рыбка and oleg0789
83
  - API connectivity check improved
templates/tracker-js.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <!-- Yandex.Metrika counter by Yandex Metrica Plugin -->
2
  <script type="text/javascript">
3
  (function (d, w, c) {
1
+ <?php defined( 'ABSPATH' ) or die(); ?>
2
  <!-- Yandex.Metrika counter by Yandex Metrica Plugin -->
3
  <script type="text/javascript">
4
  (function (d, w, c) {
yandex-metrica.php CHANGED
@@ -4,13 +4,16 @@ 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.1.2
8
  Text Domain: yandex_metrica
9
  Domain Path: /languages/
10
  Author URI: http://uysalmustafa.com
11
  License: GPLv2 (or later)
12
  */
13
 
 
 
 
14
 
15
  require_once( dirname( __FILE__ ) . '/libs/wp-stack-plugin.php' );
16
  require_once( dirname( __FILE__ ) . '/libs/Yandex_Oauth.php' );
@@ -146,6 +149,7 @@ class WP_Yandex_Metrica extends WP_Stack_Plugin {
146
  echo '<ol><li>' . __( 'If selected a new counter (recently created), please give a few hours for verification. Please be patient.', 'yandex_metrica' ) . '</li>';
147
  echo '<li>' . __( 'Did you save options? You need to save options at least once after account confirmation.', 'yandex_metrica' ) . '</li>';
148
  echo '<li>' . __( 'Are you sure you selected the correct counter? Please confirm.', 'yandex_metrica' ) . '</li>';
 
149
  echo '<li>' . __( 'Temporary, connectivity problem!', 'yandex_metrica' ) . '</li><ol>';
150
  }
151
 
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
11
  License: GPLv2 (or later)
12
  */
13
 
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
+ }
17
 
18
  require_once( dirname( __FILE__ ) . '/libs/wp-stack-plugin.php' );
19
  require_once( dirname( __FILE__ ) . '/libs/Yandex_Oauth.php' );
149
  echo '<ol><li>' . __( 'If selected a new counter (recently created), please give a few hours for verification. Please be patient.', 'yandex_metrica' ) . '</li>';
150
  echo '<li>' . __( 'Did you save options? You need to save options at least once after account confirmation.', 'yandex_metrica' ) . '</li>';
151
  echo '<li>' . __( 'Are you sure you selected the correct counter? Please confirm.', 'yandex_metrica' ) . '</li>';
152
+ echo '<li>' . __( 'Did you change your Yandex password? If changed, you need to re-authorize this plugin.', 'yandex_metrica' ) . '</li>';
153
  echo '<li>' . __( 'Temporary, connectivity problem!', 'yandex_metrica' ) . '</li><ol>';
154
  }
155