Post Views Counter - Version 1.0.4

Version Description

  • Fix: Possible issue with remove_post_views_count function
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Post Views Counter
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.4

Files changed (3) hide show
  1. includes/counter.php +2 -2
  2. post-views-counter.php +2 -2
  3. readme.txt +7 -5
includes/counter.php CHANGED
@@ -101,7 +101,7 @@ class Post_Views_Counter_Counter
101
  $excluded_ips = Post_Views_Counter()->get_attribute('options', 'general', 'exclude_ips');
102
 
103
  // whether to count this ip
104
- if(!empty($excluded_ips) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) && in_array($_SERVER['REMOTE_ADDR'], $excluded_ips, true))
105
  exit;
106
 
107
  // gets groups to check them faster
@@ -173,7 +173,7 @@ class Post_Views_Counter_Counter
173
  $ips = Post_Views_Counter()->get_attribute('options', 'general', 'exclude_ips');
174
 
175
  // whether to count this ip
176
- if(!empty($ips) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) && in_array($_SERVER['REMOTE_ADDR'], $ips, true))
177
  return;
178
 
179
  // gets groups to check them faster
101
  $excluded_ips = Post_Views_Counter()->get_attribute('options', 'general', 'exclude_ips');
102
 
103
  // whether to count this ip
104
+ if(!empty($excluded_ips) && filter_var(preg_replace('/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR']), FILTER_VALIDATE_IP) && in_array($_SERVER['REMOTE_ADDR'], $excluded_ips, true))
105
  exit;
106
 
107
  // gets groups to check them faster
173
  $ips = Post_Views_Counter()->get_attribute('options', 'general', 'exclude_ips');
174
 
175
  // whether to count this ip
176
+ if(!empty($ips) && filter_var(preg_replace('/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR']), FILTER_VALIDATE_IP) && in_array($_SERVER['REMOTE_ADDR'], $ips, true))
177
  return;
178
 
179
  // gets groups to check them faster
post-views-counter.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
- Version: 1.0.3
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
@@ -80,7 +80,7 @@ class Post_Views_Counter
80
  'link_to_post' => true,
81
  'icon_class' => 'dashicons-visibility'
82
  ),
83
- 'version' => '1.0.3'
84
  );
85
 
86
 
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Forget WP-PostViews. Display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
+ Version: 1.0.4
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
80
  'link_to_post' => true,
81
  'icon_class' => 'dashicons-visibility'
82
  ),
83
+ 'version' => '1.0.4'
84
  );
85
 
86
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: counter, hits, postviews, post views, views, count
5
  Requires at least: 3.8.0
6
- Tested up to: 3.9.1
7
- Stable tag: 1.0.3
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -52,6 +52,9 @@ No questions yet.
52
 
53
  == Changelog ==
54
 
 
 
 
55
  = 1.0.3 =
56
  * New: Russian translation, thanks to moonkir
57
  * Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty
@@ -64,6 +67,5 @@ Initial release
64
 
65
  == Upgrade Notice ==
66
 
67
- = 1.0.3 =
68
- * New: Russian translation, thanks to moonkir
69
- * Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty
3
  Donate link: http://www.dfactory.eu/
4
  Tags: counter, hits, postviews, post views, views, count
5
  Requires at least: 3.8.0
6
+ Tested up to: 4.1
7
+ Stable tag: 1.0.4
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
52
 
53
  == Changelog ==
54
 
55
+ = 1.0.4 =
56
+ * Fix: Possible issue with remove_post_views_count function
57
+
58
  = 1.0.3 =
59
  * New: Russian translation, thanks to moonkir
60
  * Fix: Remove [post-views] shortcode from post excerpts if excerpt is empty
67
 
68
  == Upgrade Notice ==
69
 
70
+ = 1.0.4 =
71
+ * Fix: Possible issue with remove_post_views_count function