Post Views Counter - Version 1.3.10

Version Description

  • Fix: Post views column not working properly
  • Tweak: Switched to openssl_encrypt method for IP encryption
  • Tweak: Improved user input escaping
Download this release

Release Info

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

Code changes from version 1.3.9 to 1.3.10

css/gutenberg.min.css DELETED
@@ -1 +0,0 @@
1
- .edit-post-post-views-popover .components-popover__content{padding:10px}.edit-post-post-views-popover .components-popover__content legend{font-weight:600;margin-bottom:1em;margin-top:.5em;padding:0}
 
includes/class-columns.php CHANGED
@@ -72,8 +72,8 @@ class Post_Views_Counter_Columns {
72
  <div id="post-views-input-container" class="hide-if-js">
73
 
74
  <p><?php _e( 'Adjust the views count for this post.', 'post-views-counter' ); ?></p>
75
- <input type="hidden" name="current_post_views" id="post-views-current" value="<?php echo $count; ?>" />
76
- <input type="text" name="post_views" id="post-views-input" value="<?php echo $count; ?>"/><br />
77
  <p>
78
  <a href="#post-views" class="save-post-views hide-if-no-js button"><?php _e( 'OK', 'post-views-counter' ); ?></a>
79
  <a href="#post-views" class="cancel-post-views hide-if-no-js"><?php _e( 'Cancel', 'post-views-counter' ); ?></a>
@@ -151,8 +151,15 @@ class Post_Views_Counter_Columns {
151
  * @return void
152
  */
153
  public function register_new_column() {
 
 
 
 
 
 
 
154
  // get post types
155
- $post_types = Post_Views_Counter()->options['general']['post_types_count'];
156
 
157
  // any post types?
158
  if ( ! empty( $post_types ) ) {
@@ -204,33 +211,34 @@ class Post_Views_Counter_Columns {
204
  * @return array
205
  */
206
  public function add_new_column( $columns ) {
207
- $offset = 0;
 
 
 
208
 
209
- // date column?
210
- if ( isset( $columns['date'] ) )
211
- $offset++;
212
 
213
- // comments column?
214
- if ( isset( $columns['comments'] ) )
215
- $offset++;
 
216
 
217
- // any skipped columns?
218
- if ( $offset > 0 ) {
219
- $data = array_slice( $columns, -$offset, $offset, true );
220
 
221
- // unset columns
222
- foreach ( $data as $column => $name ) {
223
- unset( $columns[$column] );
224
- }
225
 
226
- $columns['post_views'] = '<span class="dash-icon dashicons dashicons-chart-bar" title="' . __( 'Post Views', 'post-views-counter' ) . '"></span><span class="dash-title">' . __( 'Post Views', 'post-views-counter' ) . '</span>';
 
 
227
 
228
- // again add columns
229
- foreach ( $data as $column => $name ) {
230
- $columns[$column] = $name;
231
- }
232
- } else
233
- $columns['post_views'] = '<span class="dash-icon dashicons dashicons-chart-bar" title="' . __( 'Post Views', 'post-views-counter' ) . '"></span><span class="dash-title">' . __( 'Post Views', 'post-views-counter' ) . '</span>';
234
 
235
  return $columns;
236
  }
@@ -247,7 +255,7 @@ class Post_Views_Counter_Columns {
247
  // get total post views
248
  $count = pvc_get_post_views( $id );
249
 
250
- echo $count;
251
  }
252
  }
253
 
@@ -503,6 +511,6 @@ class Post_Views_Counter_Columns {
503
  $html .= '
504
  </style>';
505
 
506
- echo $html;
507
  }
508
  }
72
  <div id="post-views-input-container" class="hide-if-js">
73
 
74
  <p><?php _e( 'Adjust the views count for this post.', 'post-views-counter' ); ?></p>
75
+ <input type="hidden" name="current_post_views" id="post-views-current" value="<?php echo esc_attr( $count ); ?>" />
76
+ <input type="text" name="post_views" id="post-views-input" value="<?php echo esc_attr( $count ); ?>"/><br />
77
  <p>
78
  <a href="#post-views" class="save-post-views hide-if-no-js button"><?php _e( 'OK', 'post-views-counter' ); ?></a>
79
  <a href="#post-views" class="cancel-post-views hide-if-no-js"><?php _e( 'Cancel', 'post-views-counter' ); ?></a>
151
  * @return void
152
  */
153
  public function register_new_column() {
154
+ // get main instance
155
+ $pvc = Post_Views_Counter();
156
+
157
+ // is posts views column active?
158
+ if ( ! $pvc->options['general']['post_views_column'] )
159
+ return;
160
+
161
  // get post types
162
+ $post_types = $pvc->options['general']['post_types_count'];
163
 
164
  // any post types?
165
  if ( ! empty( $post_types ) ) {
211
  * @return array
212
  */
213
  public function add_new_column( $columns ) {
214
+ // date column exists?
215
+ if ( isset( $columns['date'] ) ) {
216
+ // store date column
217
+ $date = $columns['date'];
218
 
219
+ // unset date column
220
+ unset( $columns['date'] );
221
+ }
222
 
223
+ // comments column exists?
224
+ if ( isset( $columns['comments'] ) ) {
225
+ // store comments column
226
+ $comments = $columns['comments'];
227
 
228
+ // unset comments column
229
+ unset( $columns['comments'] );
230
+ }
231
 
232
+ // add post views column
233
+ $columns['post_views'] = '<span class="dash-icon dashicons dashicons-chart-bar" title="' . esc_attr__( 'Post Views', 'post-views-counter' ) . '"><span class="screen-reader-text">' . esc_attr__( 'Post Views', 'post-views-counter' ) . '</span></span>';
 
 
234
 
235
+ // restore date column
236
+ if ( isset( $date ) )
237
+ $columns['date'] = $date;
238
 
239
+ // restore comments column
240
+ if ( isset( $comments ) )
241
+ $columns['comments'] = $comments;
 
 
 
242
 
243
  return $columns;
244
  }
255
  // get total post views
256
  $count = pvc_get_post_views( $id );
257
 
258
+ echo esc_html( $count );
259
  }
260
  }
261
 
511
  $html .= '
512
  </style>';
513
 
514
+ echo wp_kses( $html, array( 'style' => array() ) );
515
  }
516
  }
includes/class-counter.php CHANGED
@@ -17,9 +17,9 @@ class Post_Views_Counter_Counter {
17
 
18
  private $db_insert_values = '';
19
  private $cookie = [
20
- 'exists' => false,
21
- 'visited_posts' => [],
22
- 'expiration' => 0
23
  ];
24
 
25
  /**
@@ -54,7 +54,7 @@ class Post_Views_Counter_Counter {
54
  elseif ( $pvc->options['general']['counter_mode'] === 'js' ) {
55
  add_action( 'wp_ajax_pvc-check-post', [ $this, 'check_post_js' ] );
56
  add_action( 'wp_ajax_nopriv_pvc-check-post', [ $this, 'check_post_js' ] );
57
- // REST API?
58
  } elseif ( $pvc->options['general']['counter_mode'] === 'rest_api' )
59
  add_action( 'rest_api_init', [ $this, 'rest_api_init' ] );
60
  }
@@ -137,7 +137,7 @@ class Post_Views_Counter_Counter {
137
  // exclude specific roles?
138
  elseif ( in_array( 'roles', $groups, true ) && $this->is_user_role_excluded( $user_id, $pvc->options['general']['exclude']['roles'] ) )
139
  return;
140
- // exclude guests?
141
  } elseif ( in_array( 'guests', $groups, true ) )
142
  return;
143
 
@@ -157,7 +157,7 @@ class Post_Views_Counter_Counter {
157
  $this->save_cookie( $id, $this->cookie, false );
158
 
159
  return;
160
- // update cookie
161
  } else
162
  $this->save_cookie( $id, $this->cookie );
163
  } else {
@@ -242,7 +242,6 @@ class Post_Views_Counter_Counter {
242
  return new WP_Error( 'pvc_rest_api_disabled', __( 'REST API method is disabled.', 'post-views-counter' ), [ 'status' => 404 ] );
243
 
244
  // @todo: get current user id in direct api endpoint calls
245
-
246
  // check if post exists
247
  $post = get_post( $post_id );
248
 
@@ -293,9 +292,9 @@ class Post_Views_Counter_Counter {
293
 
294
  // update cookie
295
  $this->cookie = [
296
- 'exists' => true,
297
- 'visited_posts' => $visited_posts,
298
- 'expiration' => max( $expirations )
299
  ];
300
  }
301
  }
@@ -456,11 +455,11 @@ class Post_Views_Counter_Counter {
456
  $date = explode( '-', date( 'W-d-m-Y-o', current_time( 'timestamp', true ) ) );
457
 
458
  foreach ( [
459
- 0 => $date[3] . $date[2] . $date[1], // day like 20140324
460
- 1 => $date[4] . $date[0], // week like 201439
461
- 2 => $date[3] . $date[2], // month like 201405
462
- 3 => $date[3], // year like 2014
463
- 4 => 'total' // total views
464
  ] as $type => $period ) {
465
  if ( $using_object_cache ) {
466
  $cache_key = $id . self::CACHE_KEY_SEPARATOR . $type . self::CACHE_KEY_SEPARATOR . $period;
@@ -506,12 +505,12 @@ class Post_Views_Counter_Counter {
506
  */
507
  public function get_timestamp( $type, $number, $timestamp = true ) {
508
  $converter = [
509
- 'minutes' => 60,
510
- 'hours' => 3600,
511
- 'days' => 86400,
512
- 'weeks' => 604800,
513
- 'months' => 2592000,
514
- 'years' => 946080000
515
  ];
516
 
517
  return (int) ( ( $timestamp ? current_time( 'timestamp', true ) : 0 ) + $number * $converter[$type] );
@@ -641,11 +640,11 @@ class Post_Views_Counter_Counter {
641
  $count = 1;
642
 
643
  return $wpdb->query(
644
- $wpdb->prepare( "
645
  INSERT INTO " . $wpdb->prefix . "post_views (id, type, period, count)
646
  VALUES (%d, %d, %s, %d)
647
  ON DUPLICATE KEY UPDATE count = count + %d", $id, $type, $period, $count, $count
648
- )
649
  );
650
  }
651
 
@@ -789,9 +788,13 @@ class Post_Views_Counter_Counter {
789
  public function encrypt_ip( $ip ) {
790
  $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
791
  $auth_iv = defined( 'NONCE_KEY' ) ? NONCE_KEY : '';
 
792
 
793
- // mcrypt strong encryption
794
- if ( function_exists( 'mcrypt_encrypt' ) && function_exists( 'mcrypt_get_key_size' ) && function_exists( 'mcrypt_get_iv_size' ) && defined( 'MCRYPT_BLOWFISH' ) ) {
 
 
 
795
  // get max key size of the mcrypt mode
796
  $max_key_size = mcrypt_get_key_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
797
  $max_iv_size = mcrypt_get_iv_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
@@ -800,7 +803,7 @@ class Post_Views_Counter_Counter {
800
  $encrypt_iv = mb_strimwidth( $auth_iv, 0, $max_iv_size );
801
 
802
  $encrypted_ip = strtr( base64_encode( mcrypt_encrypt( MCRYPT_BLOWFISH, $encrypt_key, $ip, MCRYPT_MODE_CBC, $encrypt_iv ) ), '+/=', '-_,' );
803
- // simple encryption
804
  } elseif ( function_exists( 'gzdeflate' ) )
805
  $encrypted_ip = base64_encode( convert_uuencode( gzdeflate( $ip ) ) );
806
  // no encryption
@@ -819,9 +822,13 @@ class Post_Views_Counter_Counter {
819
  public function decrypt_ip( $encrypted_ip ) {
820
  $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
821
  $auth_iv = defined( 'NONCE_KEY' ) ? NONCE_KEY : '';
 
822
 
 
 
 
823
  // mcrypt strong encryption
824
- if ( function_exists( 'mcrypt_decrypt' ) && function_exists( 'mcrypt_get_key_size' ) && function_exists( 'mcrypt_get_iv_size' ) && defined( 'MCRYPT_BLOWFISH' ) ) {
825
  // get max key size of the mcrypt mode
826
  $max_key_size = mcrypt_get_key_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
827
  $max_iv_size = mcrypt_get_iv_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
@@ -830,7 +837,7 @@ class Post_Views_Counter_Counter {
830
  $encrypt_iv = mb_strimwidth( $auth_iv, 0, $max_iv_size );
831
 
832
  $ip = mcrypt_decrypt( MCRYPT_BLOWFISH, $encrypt_key, base64_decode( strtr( $encrypted_ip, '-_,', '+/=' ) ), MCRYPT_MODE_CBC, $encrypt_iv );
833
- // simple encryption
834
  } elseif ( function_exists( 'gzinflate' ) )
835
  $ip = gzinflate( convert_uudecode( base64_decode( $encrypted_ip ) ) );
836
  // no encryption
@@ -848,26 +855,26 @@ class Post_Views_Counter_Counter {
848
  public function rest_api_init() {
849
  // view post route
850
  register_rest_route( 'post-views-counter', '/view-post/', [
851
- 'methods' => [ 'GET', 'POST' ],
852
- 'callback' => [ $this, 'check_post_rest_api' ],
853
- 'permission_callback' => [ $this, 'post_views_permissions_check' ],
854
- 'args' => [
855
  'id' => [
856
- 'default' => 0,
857
- 'sanitize_callback' => 'absint'
858
  ]
859
  ]
860
  ] );
861
 
862
  // get views route
863
  register_rest_route( 'post-views-counter', '/get-post-views/', [
864
- 'methods' => [ 'GET', 'POST' ],
865
- 'callback' => [ $this, 'get_post_views_rest_api' ],
866
- 'permission_callback' => [ $this, 'get_post_views_permissions_check' ],
867
- 'args' => [
868
  'id' => [
869
- 'default' => 0,
870
- 'user_id' => get_current_user_id()
871
  ]
872
  ]
873
  ] );
@@ -904,4 +911,5 @@ class Post_Views_Counter_Counter {
904
  public function get_post_views_permissions_check( $request ) {
905
  return (bool) apply_filters( 'pvc_rest_api_get_post_views_check', true, $request );
906
  }
907
- }
 
17
 
18
  private $db_insert_values = '';
19
  private $cookie = [
20
+ 'exists' => false,
21
+ 'visited_posts' => [],
22
+ 'expiration' => 0
23
  ];
24
 
25
  /**
54
  elseif ( $pvc->options['general']['counter_mode'] === 'js' ) {
55
  add_action( 'wp_ajax_pvc-check-post', [ $this, 'check_post_js' ] );
56
  add_action( 'wp_ajax_nopriv_pvc-check-post', [ $this, 'check_post_js' ] );
57
+ // REST API?
58
  } elseif ( $pvc->options['general']['counter_mode'] === 'rest_api' )
59
  add_action( 'rest_api_init', [ $this, 'rest_api_init' ] );
60
  }
137
  // exclude specific roles?
138
  elseif ( in_array( 'roles', $groups, true ) && $this->is_user_role_excluded( $user_id, $pvc->options['general']['exclude']['roles'] ) )
139
  return;
140
+ // exclude guests?
141
  } elseif ( in_array( 'guests', $groups, true ) )
142
  return;
143
 
157
  $this->save_cookie( $id, $this->cookie, false );
158
 
159
  return;
160
+ // update cookie
161
  } else
162
  $this->save_cookie( $id, $this->cookie );
163
  } else {
242
  return new WP_Error( 'pvc_rest_api_disabled', __( 'REST API method is disabled.', 'post-views-counter' ), [ 'status' => 404 ] );
243
 
244
  // @todo: get current user id in direct api endpoint calls
 
245
  // check if post exists
246
  $post = get_post( $post_id );
247
 
292
 
293
  // update cookie
294
  $this->cookie = [
295
+ 'exists' => true,
296
+ 'visited_posts' => $visited_posts,
297
+ 'expiration' => max( $expirations )
298
  ];
299
  }
300
  }
455
  $date = explode( '-', date( 'W-d-m-Y-o', current_time( 'timestamp', true ) ) );
456
 
457
  foreach ( [
458
+ 0 => $date[3] . $date[2] . $date[1], // day like 20140324
459
+ 1 => $date[4] . $date[0], // week like 201439
460
+ 2 => $date[3] . $date[2], // month like 201405
461
+ 3 => $date[3], // year like 2014
462
+ 4 => 'total' // total views
463
  ] as $type => $period ) {
464
  if ( $using_object_cache ) {
465
  $cache_key = $id . self::CACHE_KEY_SEPARATOR . $type . self::CACHE_KEY_SEPARATOR . $period;
505
  */
506
  public function get_timestamp( $type, $number, $timestamp = true ) {
507
  $converter = [
508
+ 'minutes' => 60,
509
+ 'hours' => 3600,
510
+ 'days' => 86400,
511
+ 'weeks' => 604800,
512
+ 'months' => 2592000,
513
+ 'years' => 946080000
514
  ];
515
 
516
  return (int) ( ( $timestamp ? current_time( 'timestamp', true ) : 0 ) + $number * $converter[$type] );
640
  $count = 1;
641
 
642
  return $wpdb->query(
643
+ $wpdb->prepare( "
644
  INSERT INTO " . $wpdb->prefix . "post_views (id, type, period, count)
645
  VALUES (%d, %d, %s, %d)
646
  ON DUPLICATE KEY UPDATE count = count + %d", $id, $type, $period, $count, $count
647
+ )
648
  );
649
  }
650
 
788
  public function encrypt_ip( $ip ) {
789
  $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
790
  $auth_iv = defined( 'NONCE_KEY' ) ? NONCE_KEY : '';
791
+ $cipher = 'AES-256-CBC';
792
 
793
+ // open ssl encryption
794
+ if ( function_exists( 'openssl_encrypt' ) && in_array( $cipher, openssl_get_cipher_methods() ) ) {
795
+ $encrypted_ip = strtr( base64_encode( openssl_encrypt( $ip, $cipher, $auth_key, $options = 0, $auth_iv ) ) );
796
+ // mcrypt strong encryption
797
+ } elseif ( function_exists( 'mcrypt_encrypt' ) && function_exists( 'mcrypt_get_key_size' ) && function_exists( 'mcrypt_get_iv_size' ) && defined( 'MCRYPT_BLOWFISH' ) ) {
798
  // get max key size of the mcrypt mode
799
  $max_key_size = mcrypt_get_key_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
800
  $max_iv_size = mcrypt_get_iv_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
803
  $encrypt_iv = mb_strimwidth( $auth_iv, 0, $max_iv_size );
804
 
805
  $encrypted_ip = strtr( base64_encode( mcrypt_encrypt( MCRYPT_BLOWFISH, $encrypt_key, $ip, MCRYPT_MODE_CBC, $encrypt_iv ) ), '+/=', '-_,' );
806
+ // simple encryption
807
  } elseif ( function_exists( 'gzdeflate' ) )
808
  $encrypted_ip = base64_encode( convert_uuencode( gzdeflate( $ip ) ) );
809
  // no encryption
822
  public function decrypt_ip( $encrypted_ip ) {
823
  $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';
824
  $auth_iv = defined( 'NONCE_KEY' ) ? NONCE_KEY : '';
825
+ $cipher = 'AES-256-CBC';
826
 
827
+ // open ssl decryption
828
+ if ( function_exists( 'openssl_encrypt' ) && in_array( $cipher, openssl_get_cipher_methods() ) ) {
829
+ $ip = openssl_decrypt( $encrypted_ip, $cipher, $auth_key, $options = 0, $auth_iv );
830
  // mcrypt strong encryption
831
+ } elseif ( function_exists( 'mcrypt_decrypt' ) && function_exists( 'mcrypt_get_key_size' ) && function_exists( 'mcrypt_get_iv_size' ) && defined( 'MCRYPT_BLOWFISH' ) ) {
832
  // get max key size of the mcrypt mode
833
  $max_key_size = mcrypt_get_key_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
834
  $max_iv_size = mcrypt_get_iv_size( MCRYPT_BLOWFISH, MCRYPT_MODE_CBC );
837
  $encrypt_iv = mb_strimwidth( $auth_iv, 0, $max_iv_size );
838
 
839
  $ip = mcrypt_decrypt( MCRYPT_BLOWFISH, $encrypt_key, base64_decode( strtr( $encrypted_ip, '-_,', '+/=' ) ), MCRYPT_MODE_CBC, $encrypt_iv );
840
+ // simple encryption
841
  } elseif ( function_exists( 'gzinflate' ) )
842
  $ip = gzinflate( convert_uudecode( base64_decode( $encrypted_ip ) ) );
843
  // no encryption
855
  public function rest_api_init() {
856
  // view post route
857
  register_rest_route( 'post-views-counter', '/view-post/', [
858
+ 'methods' => [ 'GET', 'POST' ],
859
+ 'callback' => [ $this, 'check_post_rest_api' ],
860
+ 'permission_callback' => [ $this, 'post_views_permissions_check' ],
861
+ 'args' => [
862
  'id' => [
863
+ 'default' => 0,
864
+ 'sanitize_callback' => 'absint'
865
  ]
866
  ]
867
  ] );
868
 
869
  // get views route
870
  register_rest_route( 'post-views-counter', '/get-post-views/', [
871
+ 'methods' => [ 'GET', 'POST' ],
872
+ 'callback' => [ $this, 'get_post_views_rest_api' ],
873
+ 'permission_callback' => [ $this, 'get_post_views_permissions_check' ],
874
+ 'args' => [
875
  'id' => [
876
+ 'default' => 0,
877
+ 'user_id' => get_current_user_id()
878
  ]
879
  ]
880
  ] );
911
  public function get_post_views_permissions_check( $request ) {
912
  return (bool) apply_filters( 'pvc_rest_api_get_post_views_check', true, $request );
913
  }
914
+
915
+ }
includes/class-settings.php CHANGED
@@ -711,9 +711,6 @@ class Post_Views_Counter_Settings {
711
  * @return array
712
  */
713
  public function validate_exclude( $input, $field ) {
714
- // get main instance
715
- $pvc = Post_Views_Counter();
716
-
717
  // any groups?
718
  if ( isset( $input['exclude']['groups'] ) ) {
719
  $groups = [];
@@ -749,10 +746,12 @@ class Post_Views_Counter_Settings {
749
  * @return string
750
  */
751
  public function setting_exclude_ips() {
 
752
  $ips = Post_Views_Counter()->options['general']['exclude_ips'];
753
 
754
  $html = '';
755
 
 
756
  if ( ! empty( $ips ) ) {
757
  foreach ( $ips as $key => $ip ) {
758
  $html .= '
@@ -782,9 +781,6 @@ class Post_Views_Counter_Settings {
782
  * @return array
783
  */
784
  public function validate_exclude_ips( $input, $field ) {
785
- // get main instance
786
- $pvc = Post_Views_Counter();
787
-
788
  // any ip addresses?
789
  if ( isset( $input['exclude_ips'] ) ) {
790
  $ips = [];
@@ -864,9 +860,6 @@ class Post_Views_Counter_Settings {
864
  * @return array
865
  */
866
  public function validate_restrict_display( $input, $field ) {
867
- // get main instance
868
- $pvc = Post_Views_Counter();
869
-
870
  // any groups?
871
  if ( isset( $input['restrict_display']['groups'] ) ) {
872
  $groups = [];
711
  * @return array
712
  */
713
  public function validate_exclude( $input, $field ) {
 
 
 
714
  // any groups?
715
  if ( isset( $input['exclude']['groups'] ) ) {
716
  $groups = [];
746
  * @return string
747
  */
748
  public function setting_exclude_ips() {
749
+ // get ip addresses
750
  $ips = Post_Views_Counter()->options['general']['exclude_ips'];
751
 
752
  $html = '';
753
 
754
+ // any ip addresses?
755
  if ( ! empty( $ips ) ) {
756
  foreach ( $ips as $key => $ip ) {
757
  $html .= '
781
  * @return array
782
  */
783
  public function validate_exclude_ips( $input, $field ) {
 
 
 
784
  // any ip addresses?
785
  if ( isset( $input['exclude_ips'] ) ) {
786
  $ips = [];
860
  * @return array
861
  */
862
  public function validate_restrict_display( $input, $field ) {
 
 
 
863
  // any groups?
864
  if ( isset( $input['restrict_display']['groups'] ) ) {
865
  $groups = [];
includes/functions.php CHANGED
@@ -44,7 +44,7 @@ if ( ! function_exists( 'pvc_get_post_views' ) ) {
44
  $post_views = (int) $wpdb->get_var( $query );
45
 
46
  // set the cache expiration, 5 minutes by default
47
- $expire = absint( apply_filters( 'pvc_object_cache_expire', 5 * 60 ) );
48
 
49
  wp_cache_add( md5( $query ), $post_views, 'pvc-get_post_views', $expire );
50
  }
@@ -600,7 +600,7 @@ function pvc_update_post_views( $post_id = 0, $post_views = 0 ) {
600
 
601
  /**
602
  * View post manually function.
603
- *
604
  * @since 1.2.0
605
  * @param int $post_id
606
  * @return bool
44
  $post_views = (int) $wpdb->get_var( $query );
45
 
46
  // set the cache expiration, 5 minutes by default
47
+ $expire = absint( apply_filters( 'pvc_object_cache_expire', 300 ) );
48
 
49
  wp_cache_add( md5( $query ), $post_views, 'pvc-get_post_views', $expire );
50
  }
600
 
601
  /**
602
  * View post manually function.
603
+ *
604
  * @since 1.2.0
605
  * @param int $post_id
606
  * @return bool
js/gutenberg.min.js DELETED
@@ -1 +0,0 @@
1
- !function(n){var i={};function o(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}wp.i18n.__;var n=wp.element,i=n.Fragment,u=n.Component,o=wp.compose,p=(o.withState,o.compose,wp.data),d=p.withSelect,f=(p.withDispatch,wp.plugins.registerPlugin),w=wp.components,h=w.TextControl,v=w.Button,b=w.Popover,m=wp.editPost.PluginPostStatusInfo,g=function(e){function i(){var e,t,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),t=this,(e=!(n=l(i).apply(this,arguments))||"object"!==s(n)&&"function"!=typeof n?c(t):n).state={postViews:pvcEditorArgs.postViews,isVisible:!1},e.handleClick=e.handleClick.bind(c(c(e))),e.handleClickOutside=e.handleClickOutside.bind(c(c(e))),e.handleCancel=e.handleCancel.bind(c(c(e))),e.handleSetViews=e.handleSetViews.bind(c(c(e))),e}var t,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(i,u),t=i,o=[{key:"getDerivedStateFromProps",value:function(e,t){!e.isPublishing&&!e.isSaving||e.isAutoSaving||wp.apiRequest({path:"/post-views-counter/update-post-views/?id=".concat(e.postId),method:"POST",data:{post_views:t.postViews}}).then(function(e){return console.log(e),e},function(e){return console.log(data),e})}}],(n=[{key:"handleClick",value:function(e){e.target.classList.contains("edit-post-post-views-toggle-link")&&this.setState(function(e){return{isVisible:!e.isVisible}})}},{key:"handleClickOutside",value:function(e){e.target.classList.contains("edit-post-post-views-toggle-link")||this.setState(function(e){return{isVisible:!e.isVisible}})}},{key:"handleCancel",value:function(e){this.setState(function(e){return{postViews:pvcEditorArgs.postViews,isVisible:!e.isVisible}})}},{key:"handleSetViews",value:function(e){wp.data.dispatch("core/editor").editPost({meta:{_pvc_post_views:e}}),this.setState(function(){return{postViews:e}})}},{key:"render",value:function(){return wp.element.createElement(y,{postViews:this.state.postViews,isVisible:this.state.isVisible,handleClick:this.handleClick,handleClickOutside:this.handleClickOutside,handleCancel:this.handleCancel,handleSetViews:this.handleSetViews})}}])&&r(t.prototype,n),o&&r(t,o),i}(),y=function(e){return wp.element.createElement(i,null,wp.element.createElement(m,{className:"edit-post-post-views"},wp.element.createElement("span",null,pvcEditorArgs.textPostViews),!pvcEditorArgs.canEdit&&wp.element.createElement("span",null,e.postViews),pvcEditorArgs.canEdit&&wp.element.createElement(v,{isLink:!0,className:"edit-post-post-views-toggle-link",onClick:e.handleClick},e.postViews,e.isVisible&&wp.element.createElement(b,{position:"bottom right",className:"edit-post-post-views-popover",onClickOutside:e.handleClickOutside},wp.element.createElement("legend",null,pvcEditorArgs.textPostViews),wp.element.createElement(h,{className:"edit-post-post-views-input",type:"number",key:"post_views",value:e.postViews,onChange:e.handleSetViews}),wp.element.createElement("p",{className:"description"},pvcEditorArgs.textHelp),wp.element.createElement(v,{isLink:!0,className:"edit-post-post-views-cancel-link",onClick:e.handleCancel},pvcEditorArgs.textCancel)))))};f("post-views-counter",{icon:"",render:d(function(e,t){var n=t.forceIsSaving,i=e("core/editor"),o=i.getCurrentPostId,s=i.isSavingPost,r=i.isPublishingPost,l=i.isAutosavingPost;return{postId:o(),isSaving:n||s(),isAutoSaving:l(),isPublishing:r()}})(g)})}]);
 
languages/post-views-counter.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Post Views Counter\n"
5
- "POT-Creation-Date: 2021-09-16 11:46+0200\n"
6
  "PO-Revision-Date: 2015-04-08 18:59+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
@@ -18,598 +18,584 @@ msgstr ""
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
 
21
- #: ../includes/columns.php:51 ../includes/columns.php:154
22
- #: ../includes/columns.php:197 ../includes/columns.php:348
23
- #: ../includes/columns.php:354 ../includes/columns.php:404
24
- #: ../includes/dashboard.php:94 ../includes/dashboard.php:198
25
- #: ../includes/dashboard.php:207 ../includes/dashboard.php:216
26
- #: ../includes/dashboard.php:302 ../includes/dashboard.php:432
27
- msgid "Post Views"
28
- msgstr ""
29
-
30
- #: ../includes/columns.php:87 ../includes/columns.php:91
31
- #: ../includes/columns.php:118 ../includes/columns.php:122
32
  msgid "You are not allowed to edit this item."
33
  msgstr ""
34
 
35
- #: ../includes/columns.php:114 ../includes/counter.php:241
36
  msgid "Invalid post ID."
37
  msgstr ""
38
 
39
- #: ../includes/columns.php:155 ../includes/columns.php:210
 
 
 
 
 
 
 
 
40
  msgid "Adjust the views count for this post."
41
  msgstr ""
42
 
43
- #: ../includes/columns.php:156 ../includes/columns.php:215
44
  msgid "Cancel"
45
  msgstr ""
46
 
47
- #: ../includes/columns.php:206
48
  msgid "Edit"
49
  msgstr ""
50
 
51
- #: ../includes/columns.php:214
52
  msgid "OK"
53
  msgstr ""
54
 
55
- #: ../includes/counter.php:233
56
  msgid "REST API method is disabled."
57
  msgstr ""
58
 
59
- #: ../includes/counter.php:247
60
  msgid "Post type excluded."
61
  msgstr ""
62
 
63
- #: ../includes/cron.php:61
64
  msgid "Post Views Counter reset daily counts interval"
65
  msgstr ""
66
 
67
- #: ../includes/cron.php:66
68
  msgid "Post Views Counter cache flush interval"
69
  msgstr ""
70
 
71
- #: ../includes/dashboard.php:32 ../includes/settings.php:160
72
- #: ../includes/settings.php:173 ../includes/settings.php:185
73
  msgid "Post Views Counter"
74
  msgstr ""
75
 
76
- #: ../includes/dashboard.php:94
77
  msgid ""
78
  "Displays the chart of most viewed post types for a selected time period."
79
  msgstr ""
80
 
81
- #: ../includes/dashboard.php:118
82
  msgid "Top Posts"
83
  msgstr ""
84
 
85
- #: ../includes/dashboard.php:118
86
  msgid "Displays the list of most viewed posts and pages on your website."
87
  msgstr ""
88
 
89
- #: ../includes/dashboard.php:147 ../includes/dashboard.php:150
90
- #: ../includes/dashboard.php:387 ../includes/dashboard.php:390
91
- #: ../includes/dashboard.php:504
92
  msgid "You do not have permission to access this page."
93
  msgstr ""
94
 
95
- #: ../includes/dashboard.php:215
96
  msgid "Year"
97
  msgstr ""
98
 
99
- #: ../includes/dashboard.php:230 ../includes/dashboard.php:316
100
  msgid "Total Views"
101
  msgstr ""
102
 
103
- #: ../includes/dashboard.php:431
104
  msgid "Post"
105
  msgstr ""
106
 
107
- #: ../includes/dashboard.php:455 ../includes/widgets.php:58
108
  msgid "No most viewed posts found"
109
  msgstr ""
110
 
111
- #: ../includes/functions.php:476
112
- msgid "No Posts"
113
  msgstr ""
114
 
115
- #: ../includes/settings.php:40
116
- msgid "PHP"
 
 
 
 
117
  msgstr ""
118
 
119
- #: ../includes/settings.php:41
120
- msgid "JavaScript"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  msgstr ""
122
 
123
- #: ../includes/settings.php:42
124
- msgid "Fast AJAX"
 
 
 
 
125
  msgstr ""
126
 
127
- #: ../includes/settings.php:46
128
  msgid "REST API"
129
  msgstr ""
130
 
131
- #: ../includes/settings.php:49
132
  msgid "minutes"
133
  msgstr ""
134
 
135
- #: ../includes/settings.php:50
136
  msgid "hours"
137
  msgstr ""
138
 
139
- #: ../includes/settings.php:51
140
  msgid "days"
141
  msgstr ""
142
 
143
- #: ../includes/settings.php:52
144
  msgid "weeks"
145
  msgstr ""
146
 
147
- #: ../includes/settings.php:53
148
  msgid "months"
149
  msgstr ""
150
 
151
- #: ../includes/settings.php:54
152
  msgid "years"
153
  msgstr ""
154
 
155
- #: ../includes/settings.php:58
156
  msgid "robots"
157
  msgstr ""
158
 
159
- #: ../includes/settings.php:59
160
  msgid "logged in users"
161
  msgstr ""
162
 
163
- #: ../includes/settings.php:60
164
  msgid "guests"
165
  msgstr ""
166
 
167
- #: ../includes/settings.php:61
168
  msgid "selected user roles"
169
  msgstr ""
170
 
171
- #: ../includes/settings.php:65
172
- msgid "before the content"
173
  msgstr ""
174
 
175
- #: ../includes/settings.php:66
176
- msgid "after the content"
177
  msgstr ""
178
 
179
- #: ../includes/settings.php:67
180
- msgid "manual"
181
  msgstr ""
182
 
183
- #: ../includes/settings.php:71
184
- msgid "icon"
185
  msgstr ""
186
 
187
- #: ../includes/settings.php:72
188
- msgid "label"
 
 
189
  msgstr ""
190
 
191
- #: ../includes/settings.php:77
192
- msgid "General"
193
  msgstr ""
194
 
195
- #: ../includes/settings.php:83
196
- msgid "Display"
 
 
197
  msgstr ""
198
 
199
- #: ../includes/settings.php:95
200
- msgid "Home"
201
  msgstr ""
202
 
203
- #: ../includes/settings.php:96
204
- msgid "Archives"
205
  msgstr ""
206
 
207
- #: ../includes/settings.php:97
208
- msgid "Single pages"
209
  msgstr ""
210
 
211
- #: ../includes/settings.php:98
212
- msgid "Search results"
213
  msgstr ""
214
 
215
- #: ../includes/settings.php:187
216
- msgid "Need support?"
217
  msgstr ""
218
 
219
- #: ../includes/settings.php:188
220
- #, php-format
221
- msgid ""
222
- "If you are having problems with this plugin, please browse it's <a href=\"%s"
223
- "\" target=\"_blank\">Documentation</a> or talk about them in the <a href=\"%s"
224
- "\" target=\"_blank\">Support forum</a>"
225
  msgstr ""
226
 
227
- #: ../includes/settings.php:190
228
- msgid "Do you like this plugin?"
229
  msgstr ""
230
 
231
- #: ../includes/settings.php:191
232
- #, php-format
233
- msgid "<a href=\"%s\" target=\"_blank\">Rate it 5</a> on WordPress.org"
234
  msgstr ""
235
 
236
- #: ../includes/settings.php:192
237
- #, php-format
238
  msgid ""
239
- "Blog about it & link to the <a href=\"%s\" target=\"_blank\">plugin page</a>."
 
240
  msgstr ""
241
 
242
- #: ../includes/settings.php:193
243
- #, php-format
244
- msgid ""
245
- "Check out our other <a href=\"%s\" target=\"_blank\">WordPress plugins</a>."
246
  msgstr ""
247
 
248
- #: ../includes/settings.php:212
249
- msgid "Reset to defaults"
250
  msgstr ""
251
 
252
- #: ../includes/settings.php:228
253
- msgid "General settings"
254
  msgstr ""
255
 
256
- #: ../includes/settings.php:229
257
- msgid "Post Types Count"
258
  msgstr ""
259
 
260
- #: ../includes/settings.php:230
261
- msgid "Counter Mode"
262
  msgstr ""
263
 
264
- #: ../includes/settings.php:231
265
- msgid "Post Views Column"
266
  msgstr ""
267
 
268
- #: ../includes/settings.php:232
269
- msgid "Restrict Edit"
270
  msgstr ""
271
 
272
- #: ../includes/settings.php:233
273
- msgid "Count Interval"
274
  msgstr ""
275
 
276
- #: ../includes/settings.php:234
277
- msgid "Reset Data Interval"
278
  msgstr ""
279
 
280
- #: ../includes/settings.php:235
281
- msgid "Flush Object Cache Interval"
282
  msgstr ""
283
 
284
- #: ../includes/settings.php:236
285
- msgid "Exclude Visitors"
286
  msgstr ""
287
 
288
- #: ../includes/settings.php:237
289
- msgid "Exclude IPs"
290
  msgstr ""
291
 
292
- #: ../includes/settings.php:238
293
- msgid "Strict counts"
294
  msgstr ""
295
 
296
- #: ../includes/settings.php:239
297
- msgid "Tools"
298
  msgstr ""
299
 
300
- #: ../includes/settings.php:240
301
- msgid "Deactivation"
302
  msgstr ""
303
 
304
- #: ../includes/settings.php:244
305
- msgid "Display settings"
 
 
 
306
  msgstr ""
307
 
308
- #: ../includes/settings.php:245
309
- msgid "Post Views Label"
310
  msgstr ""
311
 
312
- #: ../includes/settings.php:246
313
- msgid "Post Type"
314
  msgstr ""
315
 
316
- #: ../includes/settings.php:247
317
- msgid "Page Type"
318
  msgstr ""
319
 
320
- #: ../includes/settings.php:248
321
- msgid "User Type"
322
  msgstr ""
323
 
324
- #: ../includes/settings.php:249
325
- msgid "Position"
326
  msgstr ""
327
 
328
- #: ../includes/settings.php:250 ../includes/widgets.php:150
329
- msgid "Display Style"
330
  msgstr ""
331
 
332
- #: ../includes/settings.php:251
 
 
 
 
333
  msgid "Icon Class"
334
  msgstr ""
335
 
336
- #: ../includes/settings.php:252
 
 
 
 
 
 
 
337
  msgid "Toolbar Chart"
338
  msgstr ""
339
 
340
- #: ../includes/settings.php:263
341
- msgid "Enter the label for the post views counter field."
 
 
342
  msgstr ""
343
 
344
- #: ../includes/settings.php:281
345
- msgid "Select post types for which post views will be counted."
346
  msgstr ""
347
 
348
- #: ../includes/settings.php:298
349
- msgid "Select post types for which the views count will be displayed."
350
  msgstr ""
351
 
352
- #: ../includes/settings.php:317
353
- msgid ""
354
- "Select the method of collecting post views data. If you are using any of the "
355
- "caching plugins select Javascript or REST API (if available)."
356
  msgstr ""
357
 
358
- #: ../includes/settings.php:317
359
- msgid ""
360
- "Optionally try the Fast AJAX experimental method, usually 10+ times faster "
361
- "than Javascript or REST API."
362
  msgstr ""
363
 
364
- #: ../includes/settings.php:327
365
- msgid ""
366
- "Enable to display post views count column for each of the selected post "
367
- "types."
368
  msgstr ""
369
 
370
- #: ../includes/settings.php:347
 
 
 
 
 
 
 
 
371
  msgid "Enter the time between single user visit count."
372
  msgstr ""
373
 
374
- #: ../includes/settings.php:367
 
375
  msgid ""
376
- "Delete single day post views data older than specified above. Enter 0 "
377
- "(number zero) if you want to preserve your data regardless of its age."
378
  msgstr ""
379
 
380
- #: ../includes/settings.php:387
 
381
  msgid ""
382
  "How often to flush cached view counts from the object cache into the "
383
  "database. This feature is used only if a persistent object cache is detected "
384
- "and the interval is greater than 0 (number zero). When used, view counts "
385
- "will be collected and stored in the object cache instead of the database and "
386
- "will then be asynchronously flushed to the database according to the "
387
- "specified interval.<br /><strong>Notice:</strong> Potential data loss may "
388
- "occur if the object cache is cleared/unavailable for the duration of the "
389
- "interval."
390
  msgstr ""
391
 
392
- #: ../includes/settings.php:405
393
  msgid "Use it exclude specific user groups from post views count."
394
  msgstr ""
395
 
396
- #: ../includes/settings.php:414
397
  msgid "Use it exclude specific user roles from post views count."
398
  msgstr ""
399
 
400
- #: ../includes/settings.php:434 ../includes/settings.php:440
401
  msgid "Remove"
402
  msgstr ""
403
 
404
- #: ../includes/settings.php:445
405
  msgid "Add new"
406
  msgstr ""
407
 
408
- #: ../includes/settings.php:445
409
  msgid "Add my current IP"
410
  msgstr ""
411
 
412
- #: ../includes/settings.php:446
413
  msgid "Enter the IP addresses to be excluded from post views count."
414
  msgstr ""
415
 
416
- #: ../includes/settings.php:456
417
- msgid ""
418
- "Enable to prevent bypassing the counts interval (for e.g. using incognito "
419
- "browser window or by clearing cookies)."
420
- msgstr ""
421
-
422
- #: ../includes/settings.php:467
423
  msgid "Import views"
424
  msgstr ""
425
 
426
- #: ../includes/settings.php:467
427
  msgid "Override existing views data."
428
  msgstr ""
429
 
430
- #: ../includes/settings.php:468
431
  msgid "Import post views data from WP-PostViews plugin."
432
  msgstr ""
433
 
434
- #: ../includes/settings.php:469
435
  msgid "Delete views"
436
  msgstr ""
437
 
438
- #: ../includes/settings.php:470
439
- msgid "Delete ALL the existing post views data."
440
- msgstr ""
441
-
442
- #: ../includes/settings.php:481
443
- msgid "Enable to restrict post views editing to admins only."
444
- msgstr ""
445
-
446
- #: ../includes/settings.php:491
447
- msgid "Enable to delete all plugin data on deactivation."
448
- msgstr ""
449
-
450
- #: ../includes/settings.php:508
451
- msgid "Select page types where the views count will be displayed."
452
  msgstr ""
453
 
454
- #: ../includes/settings.php:527
455
- msgid ""
456
- "Select where would you like to display the post views counter. Use [post-"
457
- "views] shortcode for manual display."
458
- msgstr ""
459
-
460
- #: ../includes/settings.php:546
461
- msgid "Choose how to display the post views counter."
462
- msgstr ""
463
-
464
- #: ../includes/settings.php:557
465
- #, php-format
466
- msgid ""
467
- "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
468
- "\">Dashicons</a> classes are available."
469
- msgstr ""
470
-
471
- #: ../includes/settings.php:567
472
- msgid "Enable to display the post views chart at the toolbar."
473
- msgstr ""
474
-
475
- #: ../includes/settings.php:568
476
- msgid ""
477
- "The post views chart will be displayed for the post types that are being "
478
- "counted."
479
- msgstr ""
480
-
481
- #: ../includes/settings.php:590
482
  msgid "Use it to hide the post views counter from selected type of visitors."
483
  msgstr ""
484
 
485
- #: ../includes/settings.php:599
486
  msgid "Use it to hide the post views counter from selected user roles."
487
  msgstr ""
488
 
489
- #: ../includes/settings.php:632
490
- msgid "Post views data imported succesfully."
491
- msgstr ""
492
-
493
- #: ../includes/settings.php:634
494
- msgid "There was no post views data to import."
495
- msgstr ""
496
-
497
- #: ../includes/settings.php:644
498
- msgid "All existing data deleted succesfully."
499
- msgstr ""
500
-
501
- #: ../includes/settings.php:646
502
- msgid "Error occurred. All existing data were not deleted."
503
- msgstr ""
504
-
505
- #: ../includes/settings.php:829
506
- msgid "General settings restored to defaults."
507
- msgstr ""
508
-
509
- #: ../includes/settings.php:834
510
- msgid "Display settings restored to defaults."
511
- msgstr ""
512
-
513
- #: ../includes/update.php:75
514
  msgid ""
515
  "<strong>Post Views Counter</strong> - this version requires a database "
516
  "update. Make sure to back up your database first."
517
  msgstr ""
518
 
519
- #: ../includes/update.php:76
520
  msgid "Run the Update"
521
  msgstr ""
522
 
523
- #: ../includes/update.php:117
524
  msgid "Thank you! Datebase was succesfully updated."
525
  msgstr ""
526
 
527
- #: ../includes/widgets.php:42 ../includes/widgets.php:48
528
  msgid "Most Viewed Posts"
529
  msgstr ""
530
 
531
- #: ../includes/widgets.php:43
532
  msgid "Displays a list of the most viewed posts"
533
  msgstr ""
534
 
535
- #: ../includes/widgets.php:62
536
  msgid "Ascending"
537
  msgstr ""
538
 
539
- #: ../includes/widgets.php:63
540
  msgid "Descending"
541
  msgstr ""
542
 
543
- #: ../includes/widgets.php:67
544
  msgid "Unordered list"
545
  msgstr ""
546
 
547
- #: ../includes/widgets.php:68
548
  msgid "Ordered list"
549
  msgstr ""
550
 
551
- #: ../includes/widgets.php:114
552
  msgid "Title"
553
  msgstr ""
554
 
555
- #: ../includes/widgets.php:118
556
  msgid "Post Types"
557
  msgstr ""
558
 
559
- #: ../includes/widgets.php:130
560
  msgid "Number of posts to show"
561
  msgstr ""
562
 
563
- #: ../includes/widgets.php:134
564
  msgid "No posts message"
565
  msgstr ""
566
 
567
- #: ../includes/widgets.php:138
568
  msgid "Order"
569
  msgstr ""
570
 
571
- #: ../includes/widgets.php:162
572
  msgid "Display post views?"
573
  msgstr ""
574
 
575
- #: ../includes/widgets.php:164
576
  msgid "Display post excerpt?"
577
  msgstr ""
578
 
579
- #: ../includes/widgets.php:166
580
  msgid "Display post author?"
581
  msgstr ""
582
 
583
- #: ../includes/widgets.php:168
584
  msgid "Display post thumbnail?"
585
  msgstr ""
586
 
587
- #: ../includes/widgets.php:171
588
  msgid "Thumbnail size"
589
  msgstr ""
590
 
591
- #: ../post-views-counter.php:253
 
 
 
 
592
  #, php-format
593
  msgid ""
594
  "Hey, you've been using <strong>Post Views Counter</strong> for more than %s."
595
  msgstr ""
596
 
597
- #: ../post-views-counter.php:253
598
  msgid ""
599
  "Could you please do me a BIG favor and give it a 5-star rating on WordPress "
600
  "to help us spread the word and boost our motivation."
601
  msgstr ""
602
 
603
- #: ../post-views-counter.php:253
604
  msgid "Your help is much appreciated. Thank you very much"
605
  msgstr ""
606
 
607
- #: ../post-views-counter.php:253
608
  #, php-format
609
  msgid "founder of <a href=\"%s\" target=\"_blank\">dFactory</a> plugins."
610
  msgstr ""
611
 
612
- #: ../post-views-counter.php:253
613
  #, php-format
614
  msgid ""
615
  "<a href=\"%s\" class=\"pvc-dismissible-notice\" target=\"_blank\" rel="
@@ -619,18 +605,18 @@ msgid ""
619
  "notice\" rel=\"noopener\">I already did</a>"
620
  msgstr ""
621
 
622
- #: ../post-views-counter.php:535
623
  msgid "Are you sure you want to reset these settings to defaults?"
624
  msgstr ""
625
 
626
- #: ../post-views-counter.php:536
627
  msgid "Are you sure you want to delete all existing data?"
628
  msgstr ""
629
 
630
- #: ../post-views-counter.php:590
631
  msgid "Support"
632
  msgstr ""
633
 
634
- #: ../post-views-counter.php:614
635
  msgid "Settings"
636
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Post Views Counter\n"
5
+ "POT-Creation-Date: 2021-11-29 21:17+0100\n"
6
  "PO-Revision-Date: 2015-04-08 18:59+0100\n"
7
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: dFactory <info@dfactory.eu>\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
 
21
+ #: ../includes/class-admin.php:65 ../includes/class-admin.php:69
22
+ #: ../includes/class-admin.php:99 ../includes/class-admin.php:103
 
 
 
 
 
 
 
 
 
23
  msgid "You are not allowed to edit this item."
24
  msgstr ""
25
 
26
+ #: ../includes/class-admin.php:95 ../includes/class-counter.php:249
27
  msgid "Invalid post ID."
28
  msgstr ""
29
 
30
+ #: ../includes/class-admin.php:140 ../includes/class-columns.php:61
31
+ #: ../includes/class-columns.php:233 ../includes/class-columns.php:295
32
+ #: ../includes/class-dashboard.php:99 ../includes/class-dashboard.php:197
33
+ #: ../includes/class-dashboard.php:217 ../includes/class-dashboard.php:226
34
+ #: ../includes/class-dashboard.php:318 ../includes/class-dashboard.php:454
35
+ msgid "Post Views"
36
+ msgstr ""
37
+
38
+ #: ../includes/class-admin.php:141 ../includes/class-columns.php:74
39
  msgid "Adjust the views count for this post."
40
  msgstr ""
41
 
42
+ #: ../includes/class-admin.php:142 ../includes/class-columns.php:79
43
  msgid "Cancel"
44
  msgstr ""
45
 
46
+ #: ../includes/class-columns.php:70
47
  msgid "Edit"
48
  msgstr ""
49
 
50
+ #: ../includes/class-columns.php:78
51
  msgid "OK"
52
  msgstr ""
53
 
54
+ #: ../includes/class-counter.php:242
55
  msgid "REST API method is disabled."
56
  msgstr ""
57
 
58
+ #: ../includes/class-counter.php:256
59
  msgid "Post type excluded."
60
  msgstr ""
61
 
62
+ #: ../includes/class-cron.php:77
63
  msgid "Post Views Counter reset daily counts interval"
64
  msgstr ""
65
 
66
+ #: ../includes/class-cron.php:82
67
  msgid "Post Views Counter cache flush interval"
68
  msgstr ""
69
 
70
+ #: ../includes/class-dashboard.php:38 ../includes/class-settings.php:335
 
71
  msgid "Post Views Counter"
72
  msgstr ""
73
 
74
+ #: ../includes/class-dashboard.php:99
75
  msgid ""
76
  "Displays the chart of most viewed post types for a selected time period."
77
  msgstr ""
78
 
79
+ #: ../includes/class-dashboard.php:120
80
  msgid "Top Posts"
81
  msgstr ""
82
 
83
+ #: ../includes/class-dashboard.php:120
84
  msgid "Displays the list of most viewed posts and pages on your website."
85
  msgstr ""
86
 
87
+ #: ../includes/class-dashboard.php:146 ../includes/class-dashboard.php:149
88
+ #: ../includes/class-dashboard.php:409 ../includes/class-dashboard.php:412
89
+ #: ../includes/class-dashboard.php:526
90
  msgid "You do not have permission to access this page."
91
  msgstr ""
92
 
93
+ #: ../includes/class-dashboard.php:225
94
  msgid "Year"
95
  msgstr ""
96
 
97
+ #: ../includes/class-dashboard.php:240 ../includes/class-dashboard.php:332
98
  msgid "Total Views"
99
  msgstr ""
100
 
101
+ #: ../includes/class-dashboard.php:453
102
  msgid "Post"
103
  msgstr ""
104
 
105
+ #: ../includes/class-dashboard.php:476 ../includes/class-widgets.php:72
106
  msgid "No most viewed posts found"
107
  msgstr ""
108
 
109
+ #: ../includes/class-settings-api.php:190
110
+ msgid "Need support?"
111
  msgstr ""
112
 
113
+ #: ../includes/class-settings-api.php:191
114
+ #, php-format
115
+ msgid ""
116
+ "If you are having problems with this plugin, please browse it's <a href=\"%s"
117
+ "\" target=\"_blank\">Documentation</a> or talk about them in the <a href=\"%s"
118
+ "\" target=\"_blank\">Support forum</a>"
119
  msgstr ""
120
 
121
+ #: ../includes/class-settings-api.php:193
122
+ msgid "Do you like this plugin?"
123
+ msgstr ""
124
+
125
+ #: ../includes/class-settings-api.php:194
126
+ #, php-format
127
+ msgid "<a href=\"%s\" target=\"_blank\">Rate it 5</a> on WordPress.org"
128
+ msgstr ""
129
+
130
+ #: ../includes/class-settings-api.php:195
131
+ #, php-format
132
+ msgid ""
133
+ "Blog about it & link to the <a href=\"%s\" target=\"_blank\">plugin page</a>."
134
+ msgstr ""
135
+
136
+ #: ../includes/class-settings-api.php:196
137
+ #, php-format
138
+ msgid ""
139
+ "Check out our other <a href=\"%s\" target=\"_blank\">WordPress plugins</a>."
140
+ msgstr ""
141
+
142
+ #: ../includes/class-settings-api.php:223
143
+ msgid "Reset to defaults"
144
+ msgstr ""
145
+
146
+ #: ../includes/class-settings-api.php:555
147
+ msgid "Settings saved."
148
+ msgstr ""
149
+
150
+ #: ../includes/class-settings-api.php:581
151
+ msgid "Settings restored to defaults."
152
  msgstr ""
153
 
154
+ #: ../includes/class-settings.php:54
155
+ msgid "PHP"
156
+ msgstr ""
157
+
158
+ #: ../includes/class-settings.php:55
159
+ msgid "JavaScript"
160
  msgstr ""
161
 
162
+ #: ../includes/class-settings.php:60
163
  msgid "REST API"
164
  msgstr ""
165
 
166
+ #: ../includes/class-settings.php:77
167
  msgid "minutes"
168
  msgstr ""
169
 
170
+ #: ../includes/class-settings.php:78
171
  msgid "hours"
172
  msgstr ""
173
 
174
+ #: ../includes/class-settings.php:79
175
  msgid "days"
176
  msgstr ""
177
 
178
+ #: ../includes/class-settings.php:80
179
  msgid "weeks"
180
  msgstr ""
181
 
182
+ #: ../includes/class-settings.php:81
183
  msgid "months"
184
  msgstr ""
185
 
186
+ #: ../includes/class-settings.php:82
187
  msgid "years"
188
  msgstr ""
189
 
190
+ #: ../includes/class-settings.php:87
191
  msgid "robots"
192
  msgstr ""
193
 
194
+ #: ../includes/class-settings.php:88
195
  msgid "logged in users"
196
  msgstr ""
197
 
198
+ #: ../includes/class-settings.php:89
199
  msgid "guests"
200
  msgstr ""
201
 
202
+ #: ../includes/class-settings.php:90
203
  msgid "selected user roles"
204
  msgstr ""
205
 
206
+ #: ../includes/class-settings.php:101 ../includes/class-settings.php:334
207
+ msgid "Post Views Counter Settings"
208
  msgstr ""
209
 
210
+ #: ../includes/class-settings.php:114
211
+ msgid "Post Types Count"
212
  msgstr ""
213
 
214
+ #: ../includes/class-settings.php:118
215
+ msgid "Select post types for which post views will be counted."
216
  msgstr ""
217
 
218
+ #: ../includes/class-settings.php:123
219
+ msgid "Counter Mode"
220
  msgstr ""
221
 
222
+ #: ../includes/class-settings.php:126
223
+ msgid ""
224
+ "Select the method of collecting post views data. If you are using any of the "
225
+ "caching plugins select JavaScript or REST API (if available)."
226
  msgstr ""
227
 
228
+ #: ../includes/class-settings.php:131
229
+ msgid "Post Views Column"
230
  msgstr ""
231
 
232
+ #: ../includes/class-settings.php:135
233
+ msgid ""
234
+ "Enable to display post views count column for each of the selected post "
235
+ "types."
236
  msgstr ""
237
 
238
+ #: ../includes/class-settings.php:139
239
+ msgid "Restrict Edit"
240
  msgstr ""
241
 
242
+ #: ../includes/class-settings.php:143
243
+ msgid "Enable to restrict post views editing to admins only."
244
  msgstr ""
245
 
246
+ #: ../includes/class-settings.php:147
247
+ msgid "Count Interval"
248
  msgstr ""
249
 
250
+ #: ../includes/class-settings.php:159
251
+ msgid "Reset Data Interval"
252
  msgstr ""
253
 
254
+ #: ../includes/class-settings.php:171
255
+ msgid "Flush Object Cache Interval"
256
  msgstr ""
257
 
258
+ #: ../includes/class-settings.php:183
259
+ msgid "Exclude Visitors"
 
 
 
 
260
  msgstr ""
261
 
262
+ #: ../includes/class-settings.php:196
263
+ msgid "Exclude IPs"
264
  msgstr ""
265
 
266
+ #: ../includes/class-settings.php:205
267
+ msgid "Strict counts"
 
268
  msgstr ""
269
 
270
+ #: ../includes/class-settings.php:209
 
271
  msgid ""
272
+ "Enable to prevent bypassing the counts interval (for e.g. using incognito "
273
+ "browser window or by clearing cookies)."
274
  msgstr ""
275
 
276
+ #: ../includes/class-settings.php:213
277
+ msgid "Tools"
 
 
278
  msgstr ""
279
 
280
+ #: ../includes/class-settings.php:222
281
+ msgid "Deactivation"
282
  msgstr ""
283
 
284
+ #: ../includes/class-settings.php:226
285
+ msgid "Enable to delete all plugin data on deactivation."
286
  msgstr ""
287
 
288
+ #: ../includes/class-settings.php:230
289
+ msgid "Post Views Label"
290
  msgstr ""
291
 
292
+ #: ../includes/class-settings.php:233
293
+ msgid "Enter the label for the post views counter field."
294
  msgstr ""
295
 
296
+ #: ../includes/class-settings.php:240
297
+ msgid "Post Type"
298
  msgstr ""
299
 
300
+ #: ../includes/class-settings.php:244
301
+ msgid "Select post types for which the views count will be displayed."
302
  msgstr ""
303
 
304
+ #: ../includes/class-settings.php:249
305
+ msgid "Page Type"
306
  msgstr ""
307
 
308
+ #: ../includes/class-settings.php:253
309
+ msgid "Select page types where the views count will be displayed."
310
  msgstr ""
311
 
312
+ #: ../includes/class-settings.php:257
313
+ msgid "Home"
314
  msgstr ""
315
 
316
+ #: ../includes/class-settings.php:258
317
+ msgid "Archives"
318
  msgstr ""
319
 
320
+ #: ../includes/class-settings.php:259
321
+ msgid "Single pages"
322
  msgstr ""
323
 
324
+ #: ../includes/class-settings.php:260
325
+ msgid "Search results"
326
  msgstr ""
327
 
328
+ #: ../includes/class-settings.php:266
329
+ msgid "User Type"
330
  msgstr ""
331
 
332
+ #: ../includes/class-settings.php:279
333
+ msgid "Position"
334
  msgstr ""
335
 
336
+ #: ../includes/class-settings.php:282
337
+ #, php-format
338
+ msgid ""
339
+ "Select where would you like to display the post views counter. Use %s "
340
+ "shortcode for manual display."
341
  msgstr ""
342
 
343
+ #: ../includes/class-settings.php:284
344
+ msgid "before the content"
345
  msgstr ""
346
 
347
+ #: ../includes/class-settings.php:285
348
+ msgid "after the content"
349
  msgstr ""
350
 
351
+ #: ../includes/class-settings.php:286
352
+ msgid "manual"
353
  msgstr ""
354
 
355
+ #: ../includes/class-settings.php:291 ../includes/class-widgets.php:162
356
+ msgid "Display Style"
357
  msgstr ""
358
 
359
+ #: ../includes/class-settings.php:294
360
+ msgid "Choose how to display the post views counter."
361
  msgstr ""
362
 
363
+ #: ../includes/class-settings.php:298
364
+ msgid "icon"
365
  msgstr ""
366
 
367
+ #: ../includes/class-settings.php:299
368
+ msgid "label"
369
+ msgstr ""
370
+
371
+ #: ../includes/class-settings.php:304
372
  msgid "Icon Class"
373
  msgstr ""
374
 
375
+ #: ../includes/class-settings.php:307
376
+ #, php-format
377
+ msgid ""
378
+ "Enter the post views icon class. Any of the <a href=\"%s\" target=\"_blank"
379
+ "\">Dashicons</a> classes are available."
380
+ msgstr ""
381
+
382
+ #: ../includes/class-settings.php:312
383
  msgid "Toolbar Chart"
384
  msgstr ""
385
 
386
+ #: ../includes/class-settings.php:315
387
+ msgid ""
388
+ "The post views chart will be displayed for the post types that are being "
389
+ "counted."
390
  msgstr ""
391
 
392
+ #: ../includes/class-settings.php:316
393
+ msgid "Enable to display the post views chart at the toolbar."
394
  msgstr ""
395
 
396
+ #: ../includes/class-settings.php:340
397
+ msgid "General"
398
  msgstr ""
399
 
400
+ #: ../includes/class-settings.php:344
401
+ msgid "Display"
 
 
402
  msgstr ""
403
 
404
+ #: ../includes/class-settings.php:393
405
+ msgid "Post views data imported succesfully."
 
 
406
  msgstr ""
407
 
408
+ #: ../includes/class-settings.php:395
409
+ msgid "There was no post views data to import."
 
 
410
  msgstr ""
411
 
412
+ #: ../includes/class-settings.php:404
413
+ msgid "All existing data deleted succesfully."
414
+ msgstr ""
415
+
416
+ #: ../includes/class-settings.php:406
417
+ msgid "Error occurred. All existing data were not deleted."
418
+ msgstr ""
419
+
420
+ #: ../includes/class-settings.php:531
421
  msgid "Enter the time between single user visit count."
422
  msgstr ""
423
 
424
+ #: ../includes/class-settings.php:580
425
+ #, php-format
426
  msgid ""
427
+ "Delete single day post views data older than specified above. Enter %s if "
428
+ "you want to preserve your data regardless of its age."
429
  msgstr ""
430
 
431
+ #: ../includes/class-settings.php:635
432
+ #, php-format
433
  msgid ""
434
  "How often to flush cached view counts from the object cache into the "
435
  "database. This feature is used only if a persistent object cache is detected "
436
+ "and the interval is greater than %s. When used, view counts will be "
437
+ "collected and stored in the object cache instead of the database and will "
438
+ "then be asynchronously flushed to the database according to the specified "
439
+ "interval.<br /><strong>Notice:</strong> Potential data loss may occur if the "
440
+ "object cache is cleared/unavailable for the duration of the interval."
 
441
  msgstr ""
442
 
443
+ #: ../includes/class-settings.php:691
444
  msgid "Use it exclude specific user groups from post views count."
445
  msgstr ""
446
 
447
+ #: ../includes/class-settings.php:700
448
  msgid "Use it exclude specific user roles from post views count."
449
  msgstr ""
450
 
451
+ #: ../includes/class-settings.php:759 ../includes/class-settings.php:765
452
  msgid "Remove"
453
  msgstr ""
454
 
455
+ #: ../includes/class-settings.php:770
456
  msgid "Add new"
457
  msgstr ""
458
 
459
+ #: ../includes/class-settings.php:770
460
  msgid "Add my current IP"
461
  msgstr ""
462
 
463
+ #: ../includes/class-settings.php:771
464
  msgid "Enter the IP addresses to be excluded from post views count."
465
  msgstr ""
466
 
467
+ #: ../includes/class-settings.php:811
 
 
 
 
 
 
468
  msgid "Import views"
469
  msgstr ""
470
 
471
+ #: ../includes/class-settings.php:811
472
  msgid "Override existing views data."
473
  msgstr ""
474
 
475
+ #: ../includes/class-settings.php:812
476
  msgid "Import post views data from WP-PostViews plugin."
477
  msgstr ""
478
 
479
+ #: ../includes/class-settings.php:813
480
  msgid "Delete views"
481
  msgstr ""
482
 
483
+ #: ../includes/class-settings.php:814
484
+ msgid "Delete all the existing post views data."
 
 
 
 
 
 
 
 
 
 
 
 
485
  msgstr ""
486
 
487
+ #: ../includes/class-settings.php:840
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  msgid "Use it to hide the post views counter from selected type of visitors."
489
  msgstr ""
490
 
491
+ #: ../includes/class-settings.php:849
492
  msgid "Use it to hide the post views counter from selected user roles."
493
  msgstr ""
494
 
495
+ #: ../includes/class-update.php:82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  msgid ""
497
  "<strong>Post Views Counter</strong> - this version requires a database "
498
  "update. Make sure to back up your database first."
499
  msgstr ""
500
 
501
+ #: ../includes/class-update.php:83
502
  msgid "Run the Update"
503
  msgstr ""
504
 
505
+ #: ../includes/class-update.php:126
506
  msgid "Thank you! Datebase was succesfully updated."
507
  msgstr ""
508
 
509
+ #: ../includes/class-widgets.php:54 ../includes/class-widgets.php:62
510
  msgid "Most Viewed Posts"
511
  msgstr ""
512
 
513
+ #: ../includes/class-widgets.php:56
514
  msgid "Displays a list of the most viewed posts"
515
  msgstr ""
516
 
517
+ #: ../includes/class-widgets.php:77
518
  msgid "Ascending"
519
  msgstr ""
520
 
521
+ #: ../includes/class-widgets.php:78
522
  msgid "Descending"
523
  msgstr ""
524
 
525
+ #: ../includes/class-widgets.php:83
526
  msgid "Unordered list"
527
  msgstr ""
528
 
529
+ #: ../includes/class-widgets.php:84
530
  msgid "Ordered list"
531
  msgstr ""
532
 
533
+ #: ../includes/class-widgets.php:124
534
  msgid "Title"
535
  msgstr ""
536
 
537
+ #: ../includes/class-widgets.php:128
538
  msgid "Post Types"
539
  msgstr ""
540
 
541
+ #: ../includes/class-widgets.php:141
542
  msgid "Number of posts to show"
543
  msgstr ""
544
 
545
+ #: ../includes/class-widgets.php:145
546
  msgid "No posts message"
547
  msgstr ""
548
 
549
+ #: ../includes/class-widgets.php:149
550
  msgid "Order"
551
  msgstr ""
552
 
553
+ #: ../includes/class-widgets.php:175
554
  msgid "Display post views?"
555
  msgstr ""
556
 
557
+ #: ../includes/class-widgets.php:177
558
  msgid "Display post excerpt?"
559
  msgstr ""
560
 
561
+ #: ../includes/class-widgets.php:179
562
  msgid "Display post author?"
563
  msgstr ""
564
 
565
+ #: ../includes/class-widgets.php:181
566
  msgid "Display post thumbnail?"
567
  msgstr ""
568
 
569
+ #: ../includes/class-widgets.php:184
570
  msgid "Thumbnail size"
571
  msgstr ""
572
 
573
+ #: ../includes/functions.php:477
574
+ msgid "No Posts"
575
+ msgstr ""
576
+
577
+ #: ../post-views-counter.php:281
578
  #, php-format
579
  msgid ""
580
  "Hey, you've been using <strong>Post Views Counter</strong> for more than %s."
581
  msgstr ""
582
 
583
+ #: ../post-views-counter.php:281
584
  msgid ""
585
  "Could you please do me a BIG favor and give it a 5-star rating on WordPress "
586
  "to help us spread the word and boost our motivation."
587
  msgstr ""
588
 
589
+ #: ../post-views-counter.php:281
590
  msgid "Your help is much appreciated. Thank you very much"
591
  msgstr ""
592
 
593
+ #: ../post-views-counter.php:281
594
  #, php-format
595
  msgid "founder of <a href=\"%s\" target=\"_blank\">dFactory</a> plugins."
596
  msgstr ""
597
 
598
+ #: ../post-views-counter.php:281
599
  #, php-format
600
  msgid ""
601
  "<a href=\"%s\" class=\"pvc-dismissible-notice\" target=\"_blank\" rel="
605
  "notice\" rel=\"noopener\">I already did</a>"
606
  msgstr ""
607
 
608
+ #: ../post-views-counter.php:584
609
  msgid "Are you sure you want to reset these settings to defaults?"
610
  msgstr ""
611
 
612
+ #: ../post-views-counter.php:585
613
  msgid "Are you sure you want to delete all existing data?"
614
  msgstr ""
615
 
616
+ #: ../post-views-counter.php:641
617
  msgid "Support"
618
  msgstr ""
619
 
620
+ #: ../post-views-counter.php:666
621
  msgid "Settings"
622
  msgstr ""
post-views-counter.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Post Views Counter allows you to display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
- Version: 1.3.9
6
  Author: Digital Factory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
@@ -31,7 +31,7 @@ if ( ! class_exists( 'Post_Views_Counter' ) ) {
31
  * Post Views Counter final class.
32
  *
33
  * @class Post_Views_Counter
34
- * @version 1.3.9
35
  */
36
  final class Post_Views_Counter {
37
 
@@ -84,7 +84,7 @@ if ( ! class_exists( 'Post_Views_Counter' ) ) {
84
  'icon_class' => 'dashicons-chart-bar',
85
  'toolbar_statistics' => true
86
  ],
87
- 'version' => '1.3.9'
88
  ];
89
 
90
  /**
@@ -361,7 +361,7 @@ if ( ! class_exists( 'Post_Views_Counter' ) ) {
361
  return;
362
 
363
  if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'pvc_dismiss_notice' ) ) {
364
- $notice_action = empty( $_REQUEST['notice_action'] ) || $_REQUEST['notice_action'] === 'hide' ? 'hide' : esc_attr( $_REQUEST['notice_action'] );
365
 
366
  switch ( $notice_action ) {
367
  // delay notice
2
  /*
3
  Plugin Name: Post Views Counter
4
  Description: Post Views Counter allows you to display how many times a post, page or custom post type had been viewed in a simple, fast and reliable way.
5
+ Version: 1.3.10
6
  Author: Digital Factory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/post-views-counter/
31
  * Post Views Counter final class.
32
  *
33
  * @class Post_Views_Counter
34
+ * @version 1.3.10
35
  */
36
  final class Post_Views_Counter {
37
 
84
  'icon_class' => 'dashicons-chart-bar',
85
  'toolbar_statistics' => true
86
  ],
87
+ 'version' => '1.3.10'
88
  ];
89
 
90
  /**
361
  return;
362
 
363
  if ( wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'pvc_dismiss_notice' ) ) {
364
+ $notice_action = empty( $_REQUEST['notice_action'] ) || $_REQUEST['notice_action'] === 'hide' ? 'hide' : sanitize_text_field( $_REQUEST['notice_action'] );
365
 
366
  switch ( $notice_action ) {
367
  // delay notice
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: counter, hits, posts, postviews, post views, views, count, statistics, sta
5
  Requires at least: 5.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.8.2
8
- Stable tag: 1.3.9
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
@@ -62,6 +62,11 @@ No questions yet.
62
 
63
  == Changelog ==
64
 
 
 
 
 
 
65
  = 1.3.9 =
66
  * Tweak: Remove unnecessary plugin files
67
 
@@ -228,5 +233,7 @@ Initial release
228
 
229
  == Upgrade Notice ==
230
 
231
- = 1.3.9 =
232
- * Tweak: Remove unnecessary plugin files
 
 
5
  Requires at least: 5.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.8.2
8
+ Stable tag: 1.3.10
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
62
 
63
  == Changelog ==
64
 
65
+ = 1.3.10 =
66
+ * Fix: Post views column not working properly
67
+ * Tweak: Switched to openssl_encrypt method for IP encryption
68
+ * Tweak: Improved user input escaping
69
+
70
  = 1.3.9 =
71
  * Tweak: Remove unnecessary plugin files
72
 
233
 
234
  == Upgrade Notice ==
235
 
236
+ = 1.3.10 =
237
+ * Fix: Post views column not working properly
238
+ * Tweak: Switched to openssl_encrypt method for IP encryption
239
+ * Tweak: Improved user input escaping