Version Description
- Tweak: Added number_format_i18n for displayed views count
- Tweak: Additional action hook for developers
Download this release
Release Info
Developer | dfactory |
Plugin | Post Views Counter |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- includes/counter.php +3 -1
- includes/functions.php +2 -2
- post-views-counter.php +3 -3
- readme.txt +9 -4
includes/counter.php
CHANGED
@@ -273,7 +273,7 @@ class Post_Views_Counter_Counter
|
|
273 |
{
|
274 |
$expiration = $this->get_timestamp(Post_Views_Counter()->get_attribute('options', 'general', 'time_between_counts', 'type'), Post_Views_Counter()->get_attribute('options', 'general', 'time_between_counts', 'number'));
|
275 |
|
276 |
-
// is it new cookie?
|
277 |
if(empty($cookie))
|
278 |
{
|
279 |
// sets cookie
|
@@ -384,6 +384,8 @@ class Post_Views_Counter_Counter
|
|
384 |
)
|
385 |
);
|
386 |
}
|
|
|
|
|
387 |
}
|
388 |
|
389 |
|
273 |
{
|
274 |
$expiration = $this->get_timestamp(Post_Views_Counter()->get_attribute('options', 'general', 'time_between_counts', 'type'), Post_Views_Counter()->get_attribute('options', 'general', 'time_between_counts', 'number'));
|
275 |
|
276 |
+
// is it a new cookie?
|
277 |
if(empty($cookie))
|
278 |
{
|
279 |
// sets cookie
|
384 |
)
|
385 |
);
|
386 |
}
|
387 |
+
|
388 |
+
do_action('pvc_after_count_visit', $id);
|
389 |
}
|
390 |
|
391 |
|
includes/functions.php
CHANGED
@@ -57,7 +57,7 @@ if(!function_exists('pvc_post_views'))
|
|
57 |
'<div class="post-views post-'.$post_id.' entry-meta">
|
58 |
'.($options['display_style']['icon'] && $icon_class !== '' ? $icon : '').'
|
59 |
'.($options['display_style']['text'] ? '<span class="post-views-label">'.$label.' </span>' : '').'
|
60 |
-
<span class="post-views-count">'
|
61 |
</div>',
|
62 |
$post_id,
|
63 |
$views,
|
@@ -152,7 +152,7 @@ if(!function_exists('pvc_most_viewed_posts'))
|
|
152 |
}
|
153 |
|
154 |
$html .= '
|
155 |
-
<a class="post-title" href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a>'.($args['show_post_views'] ? ' <span class="count">('.pvc_get_post_views($post->ID).')</span>' : '');
|
156 |
|
157 |
$excerpt = '';
|
158 |
|
57 |
'<div class="post-views post-'.$post_id.' entry-meta">
|
58 |
'.($options['display_style']['icon'] && $icon_class !== '' ? $icon : '').'
|
59 |
'.($options['display_style']['text'] ? '<span class="post-views-label">'.$label.' </span>' : '').'
|
60 |
+
<span class="post-views-count">'.number_format_i18n($views).'</span>
|
61 |
</div>',
|
62 |
$post_id,
|
63 |
$views,
|
152 |
}
|
153 |
|
154 |
$html .= '
|
155 |
+
<a class="post-title" href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a>'.($args['show_post_views'] ? ' <span class="count">('.number_format_i18n(pvc_get_post_views($post->ID)).')</span>' : '');
|
156 |
|
157 |
$excerpt = '';
|
158 |
|
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.
|
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.
|
84 |
);
|
85 |
|
86 |
|
@@ -231,7 +231,7 @@ class Post_Views_Counter
|
|
231 |
|
232 |
|
233 |
/**
|
234 |
-
*
|
235 |
*/
|
236 |
public function admin_scripts_styles($page)
|
237 |
{
|
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.5
|
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.5'
|
84 |
);
|
85 |
|
86 |
|
231 |
|
232 |
|
233 |
/**
|
234 |
+
* Enqueues admin scripts and styles
|
235 |
*/
|
236 |
public function admin_scripts_styles($page)
|
237 |
{
|
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: 4.1
|
7 |
-
Stable tag: 1.0.
|
8 |
License: MIT License
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
@@ -52,6 +52,10 @@ No questions yet.
|
|
52 |
|
53 |
== Changelog ==
|
54 |
|
|
|
|
|
|
|
|
|
55 |
= 1.0.4 =
|
56 |
* Fix: Possible issue with remove_post_views_count function
|
57 |
|
@@ -67,5 +71,6 @@ Initial release
|
|
67 |
|
68 |
== Upgrade Notice ==
|
69 |
|
70 |
-
= 1.0.
|
71 |
-
*
|
|
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.1
|
7 |
+
Stable tag: 1.0.5
|
8 |
License: MIT License
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
52 |
|
53 |
== Changelog ==
|
54 |
|
55 |
+
= 1.0.5 =
|
56 |
+
* Tweak: Added number_format_i18n for displayed views count
|
57 |
+
* Tweak: Additional action hook for developers
|
58 |
+
|
59 |
= 1.0.4 =
|
60 |
* Fix: Possible issue with remove_post_views_count function
|
61 |
|
71 |
|
72 |
== Upgrade Notice ==
|
73 |
|
74 |
+
= 1.0.5 =
|
75 |
+
* Tweak: Added number_format_i18n for displayed views count
|
76 |
+
* Tweak: Additional action hook for developers
|