Yandex Metrica - Version 1.9.2

Version Description

  • fix valid counter control
    • tested with WordPress 5.9
Download this release

Release Info

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

Code changes from version 1.9.1 to 1.9.2

Files changed (3) hide show
  1. libs/Yandex_Metrica.php +12 -3
  2. readme.txt +6 -2
  3. yandex-metrica.php +1 -1
libs/Yandex_Metrica.php CHANGED
@@ -106,11 +106,20 @@ class Yandex_Metrica {
106
  public function is_valid_counter( $counter_id ) {
107
  $current_counter = $this->fetch_counter( $counter_id );
108
 
109
- if ( $current_counter["counter"]["code_status"] == "CS_OK" ) {
110
  return true;
111
- } else {
112
- return false;
113
  }
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  /**
106
  public function is_valid_counter( $counter_id ) {
107
  $current_counter = $this->fetch_counter( $counter_id );
108
 
109
+ if ( isset( $current_counter["counter"]["code_status"] ) && 'CS_OK' === $current_counter["counter"]["code_status"] ) {
110
  return true;
 
 
111
  }
112
+
113
+ /**
114
+ * The management API can return `CS_ERR_UNKNOWN` while counter is active.
115
+ *
116
+ * @since 1.9.2
117
+ */
118
+ if ( isset( $current_counter["counter"]["status"] ) && 'Active' === $current_counter["counter"]["status"] ) {
119
+ return true;
120
+ }
121
+
122
+ return false;
123
  }
124
 
125
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@
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
 
@@ -65,6 +65,10 @@ Yandex Metrica plugin uses wp_head hook for the adds necessary tracking code. Pl
65
 
66
  == Changelog ==
67
 
 
 
 
 
68
  = 1.9.1 =
69
  - hotfix: uppercase Chart.min.js
70
 
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
 
66
  == Changelog ==
67
 
68
+ = 1.9.2 =
69
+ - fix valid counter control
70
+ - tested with WordPress 5.9
71
+
72
  = 1.9.1 =
73
  - hotfix: uppercase Chart.min.js
74
 
yandex-metrica.php CHANGED
@@ -4,7 +4,7 @@ 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.1
8
  Text Domain: yandex-metrica
9
  Domain Path: /languages/
10
  Author URI: https://uysalmustafa.com
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