From 06ab50159738011ff487537d057df2201a848b26 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 3 Feb 2020 23:17:43 +0530 Subject: [PATCH 1/3] Change readme --- readme.txt | 14 ++++++++------ wp-post-views.php | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/readme.txt b/readme.txt index d38426b..509db5b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === Wp Post Views - Wordpress Post views counter === -Contributors: vanpariyar, Brijeshdhanani +Contributors: vanpariyar, ankitatanti, Brijeshdhanani, Tags: post views, count wordpress site views, show post views, post view counter, WP Post Views, post view count based on ip Requires at least: 4.0 Requires PHP: 5.3 @@ -14,8 +14,6 @@ Wordpress Post views counter Wordpress post views counter counts the view of your Built in post type and Custom post type. -= Features = - ### Features And Options: * Simple, and easy to understand. * Option to filter views on IP address to get accurate post count. @@ -25,10 +23,14 @@ Wordpress post views counter counts the view of your Built in post type and Cust == Installation == 1. Install the plugin either via the WordPress.org plugin directory, or by uploading the files to your server (in the /wp-content/plugins/ directory). -2. Activate the User Registration plugin through the 'Plugins' menu in WordPress. -3. TO make settings Go to User Admin panel Settings->WP Post views +2. Activate the plugin through the 'Plugins' menu in WordPress. +3. TO make settings Go to User Admin panel Settings->WP Post views +4. You can select your custom post type as per requirement. == Screenshots == -1. screenshot \ No newline at end of file +1. screenshot-1 +2. screenshot-2 +3. screenshot-3 +4. screenshot-4 \ No newline at end of file diff --git a/wp-post-views.php b/wp-post-views.php index 61195d6..38fe375 100644 --- a/wp-post-views.php +++ b/wp-post-views.php @@ -13,9 +13,9 @@ * Description: WP Post Views. * Version: 1.0 * Requires at least: 5.0 - * Requires PHP: 7.0 + * Requires PHP: 5.0 * Author: Ronak J Vanpariya - * Author URI: https://example.com + * Author URI: https://vanpariyar.github.io * Text Domain: wp-post-views * License: GPL v2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.txt From a5908f0c9d338bfeb50695dadbbf4641240f9a74 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 23 Feb 2020 21:06:07 +0530 Subject: [PATCH 2/3] Error Fix --- wp-post-views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-post-views.php b/wp-post-views.php index 38fe375..4645541 100644 --- a/wp-post-views.php +++ b/wp-post-views.php @@ -122,7 +122,7 @@ public function validate_ip($ip) { public function counter(){ global $post; - $stored_ip_addresses = ''; + $stored_ip_addresses = 0; $options = get_option( 'wppv_api_settings' ); $selected_type = array(); isset($options['wppv_api_post_checkbox_1']) ? $selected_type = $options['wppv_api_post_checkbox_1'] : ''; From eada825daadd84d366c52b03b308b6cfde2639c6 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 23 Feb 2020 21:09:50 +0530 Subject: [PATCH 3/3] Fix the small errors --- wp-post-views.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-post-views.php b/wp-post-views.php index 4645541..352fcff 100644 --- a/wp-post-views.php +++ b/wp-post-views.php @@ -151,7 +151,10 @@ public function counter(){ else { $meta_key = 'entry_views'; - $view_post_meta = get_post_meta(get_the_ID(), $meta_key, true); + $view_post_meta = get_post_meta(get_the_ID(), $meta_key, true); + if( ! is_int($view_post_meta) ){ + $view_post_meta = 0; + } $new_viewed_count = $view_post_meta + 1; update_post_meta(get_the_ID(), $meta_key, $new_viewed_count); $ip_arr[] = $this->get_ip_address();