WP Statistics - Version 12.5.4

Version Description

  • Disabled: Notice cache in all admin pages just enabled in the summary and setting of WP-Statistics pages.
  • Improved: Some methods. params() and get_hash_string().
Download this release

Release Info

Developer mostafa.s1990
Plugin Icon 128x128 WP Statistics
Version 12.5.4
Comparing to
See all releases

Code changes from version 12.5.3 to 12.5.4

includes/classes/class-wp-statistics-admin.php CHANGED
@@ -255,7 +255,6 @@ class WP_Statistics_Admin {
255
  return $use;
256
  }
257
 
258
-
259
  /*
260
  * Show Notification Cache Plugin
261
  */
@@ -263,8 +262,10 @@ class WP_Statistics_Admin {
263
  global $WP_Statistics;
264
 
265
  $screen = get_current_screen();
266
- if ( $screen->id != "statistics_page_" . WP_Statistics::$page['settings'] ) {
 
267
  $plugin = self::user_is_use_cache_plugin();
 
268
  if ( ! $WP_Statistics->get_option( 'use_cache_plugin' ) and $plugin['status'] === true ) {
269
  echo '<div class="notice notice-warning is-dismissible"><p>';
270
 
255
  return $use;
256
  }
257
 
 
258
  /*
259
  * Show Notification Cache Plugin
260
  */
262
  global $WP_Statistics;
263
 
264
  $screen = get_current_screen();
265
+
266
+ if ( $screen->id == "toplevel_page_" . WP_Statistics::$page['overview'] or $screen->id == "statistics_page_" . WP_Statistics::$page['settings'] ) {
267
  $plugin = self::user_is_use_cache_plugin();
268
+
269
  if ( ! $WP_Statistics->get_option( 'use_cache_plugin' ) and $plugin['status'] === true ) {
270
  echo '<div class="notice notice-warning is-dismissible"><p>';
271
 
includes/classes/class-wp-statistics-rest.php CHANGED
@@ -108,9 +108,10 @@ class WP_Statistics_Rest {
108
  */
109
  static public function params( $params ) {
110
  if ( isset( $_POST[ self::_POST ] ) ) {
111
- $data = json_decode( stripslashes( $_POST[ self::_POST ] ), true );
112
- if ( isset( $data[ $params ] ) ) {
113
- return $data[ $params ];
 
114
  }
115
  }
116
 
108
  */
109
  static public function params( $params ) {
110
  if ( isset( $_POST[ self::_POST ] ) ) {
111
+ $data = wp_unslash( $_POST[ self::_POST ] );
112
+ $json_data = json_decode( $data, true );
113
+ if ( isset( $json_data[ $params ] ) ) {
114
+ return $json_data[ $params ];
115
  }
116
  }
117
 
includes/classes/class-wp-statistics.php CHANGED
@@ -419,16 +419,16 @@ class WP_Statistics {
419
  * Generate hash string
420
  */
421
  public function get_hash_string() {
422
- //Check If Rest Request
423
  if ( $this->restapi->is_rest() ) {
424
  return $this->restapi->params( 'hash_ip' );
425
  }
426
 
427
- //Set Key
428
  if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) ) {
429
  $key = $_SERVER['HTTP_USER_AGENT'];
430
  } else {
431
- $key = wp_salt();
432
  }
433
 
434
  return '#hash#' . sha1( $this->ip . $key );
419
  * Generate hash string
420
  */
421
  public function get_hash_string() {
422
+ // Check If Rest Request
423
  if ( $this->restapi->is_rest() ) {
424
  return $this->restapi->params( 'hash_ip' );
425
  }
426
 
427
+ // Check the user agent has exist.
428
  if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) ) {
429
  $key = $_SERVER['HTTP_USER_AGENT'];
430
  } else {
431
+ $key = 'Unknown';
432
  }
433
 
434
  return '#hash#' . sha1( $this->ip . $key );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wp-statistics.com/donate/
4
  Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits, chart, browser, today, yesterday, week, month, year, total, post, page, sidebar, google, live visit, search word, agent, google analytics, webmasters, google webmasters, geoip, location
5
  Requires at least: 3.0
6
  Tested up to: 4.9
7
- Stable tag: 12.5.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -116,6 +116,10 @@ http://yourwebsite.com/wp-json/wpstatistics/v1
116
  To register, go to the Permalink page and update the permalink with press Save Changes.
117
 
118
  == Changelog ==
 
 
 
 
119
  = 12.5.3 =
120
  * Added: Option for enabling/disabling the hits meta box chart in the edit of all post types page and that option is disabled by default.
121
  * Improved: The responsive problem of Recent Visitors and Latest Search Words widgets in WP Dashboard.
4
  Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits, chart, browser, today, yesterday, week, month, year, total, post, page, sidebar, google, live visit, search word, agent, google analytics, webmasters, google webmasters, geoip, location
5
  Requires at least: 3.0
6
  Tested up to: 4.9
7
+ Stable tag: 12.5.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
116
  To register, go to the Permalink page and update the permalink with press Save Changes.
117
 
118
  == Changelog ==
119
+ = 12.5.4 =
120
+ * Disabled: Notice cache in all admin pages just enabled in the summary and setting of WP-Statistics pages.
121
+ * Improved: Some methods. `params()` and `get_hash_string()`.
122
+
123
  = 12.5.3 =
124
  * Added: Option for enabling/disabling the hits meta box chart in the edit of all post types page and that option is disabled by default.
125
  * Improved: The responsive problem of Recent Visitors and Latest Search Words widgets in WP Dashboard.
wp-statistics.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Statistics
4
  * Plugin URI: https://wp-statistics.com/
5
  * Description: Complete WordPress Analytics and Statistics for your site!
6
- * Version: 12.5.3
7
  * Author: Verona Labs
8
  * Author URI: http://veronalabs.com/
9
  *
3
  * Plugin Name: WP Statistics
4
  * Plugin URI: https://wp-statistics.com/
5
  * Description: Complete WordPress Analytics and Statistics for your site!
6
+ * Version: 12.5.4
7
  * Author: Verona Labs
8
  * Author URI: http://veronalabs.com/
9
  *