Page Visit Counter - Version 4.0.2

Version Description

  • 06-10-2016 =
  • Fixies - Fixed the Globally count issue.
  • Change the readme file.
Download this release

Release Info

Developer dots
Plugin Icon 128x128 Page Visit Counter
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

README.txt CHANGED
@@ -3,8 +3,8 @@ Plugin Name: Page Visit Counter
3
  Plugin URI: http://multidots.com/
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
- Contributors: dots
7
- Stable tag: 4.0.1
8
  Tags: page counter,page visit, post counter, post visit, wordpress post view, wordpress page view, page visit graph, post visit graph,
9
  Requires at least: 2.1
10
  Tested up to: 4.6.1
@@ -18,8 +18,6 @@ This plugin will count the total visits of your sites pages.
18
  == Description ==
19
  This Plugin use for front side post and pages counter. After activation of plugin it will automatically add page counts on bottom of all pages. So, that all visitors can see page counts for entire site pages. Plugin provide search by page title and search by page published date facilities. Settings are required for page counter. Plugin provide to select specific post type to include in post /pages counter. Plugin also provide to exclude specific IP/s and specific register user to exude from post/pages counter.
20
 
21
- = Important Note: To start the count of the page/post please select the Cpt (custom post type), page or post from "Post Type" select box under the "Basic Configuration settings" box. If you keep the blank it will not start to count of the Cpt (custom post type), page or post. =
22
-
23
  = Page Counter Settings: =
24
  * In these options you can do different setting for page visit counter.
25
  * Short Code: There are two shortcuts that you can use to manually add page view count to any content on admin or post/page template created by your theme or plugin that's creating its own display content in a page / post.
@@ -54,17 +52,21 @@ In this option you can see all pages listing within Page ID, Page Title and Tota
54
  * Dutch
55
  * Indonesian
56
 
57
- We always welcome user suggestions. Let us know what you think about this plugin you liked or may have disliked. Users feedback is important for us to improve more our plugins.
58
 
59
  = You can check our other plugins: =
60
 
61
- 1. <a href ="https://store.multidots.com/go/dotstore-woo-category-banner">Woocommerce Category Banner Management</a>
62
- 2. <a href ="https://store.multidots.com/go/dotstore-adflatrate-shippingmethod">Advance Flat Rate Shipping Method For WooCommerce</a>
63
- 3. <a href ="https://store.multidots.com/go/dotstore-woo-extra-fees">Woocommerce Conditional Extra Fees</a>
64
- 4. <a href ="https://store.multidots.com/go/dotstore-woo-product-sizechart">Woocommerce Advanced Product Size Charts</a>
65
- 5. <a href ="https://store.multidots.com/go/dotstore-admenumanager-wp">Advance Menu Manager for WordPress</a>
66
- 6. <a href ="https://store.multidots.com/go/dotstore-woo-savefor-later">Woocommerce Save For Later Cart Enhancement</a>
67
- 7. <a href ="https://store.multidots.com/go/dotstore-aapify-theme">Appify - Multipurpose One Page Mobile App landing page HTML</a>
 
 
 
 
68
 
69
  == Installation ==
70
 
@@ -109,8 +111,12 @@ Automatic updates should work great for you. As always, though, we recommend ba
109
 
110
  == Changelog ==
111
 
 
 
 
 
112
  = 4.0.1 - 03-10-2016 =
113
- * Chnage the readme file.
114
  * Added note on the admin plugin configuration
115
 
116
  = 4.0 - 30-09-2016 =
@@ -185,4 +191,6 @@ Automatic updates should work great for you. As always, though, we recommend ba
185
  * Tweak - Remote request handles on activate.
186
 
187
  = 1.1 - 07.11.2015 =
188
- * Tweak - Class file added for admin settings page output.
 
 
3
  Plugin URI: http://multidots.com/
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
+ Contributors: dots, ketuchetan, chiragpatel
7
+ Stable tag: 4.0.2
8
  Tags: page counter,page visit, post counter, post visit, wordpress post view, wordpress page view, page visit graph, post visit graph,
9
  Requires at least: 2.1
10
  Tested up to: 4.6.1
18
  == Description ==
19
  This Plugin use for front side post and pages counter. After activation of plugin it will automatically add page counts on bottom of all pages. So, that all visitors can see page counts for entire site pages. Plugin provide search by page title and search by page published date facilities. Settings are required for page counter. Plugin provide to select specific post type to include in post /pages counter. Plugin also provide to exclude specific IP/s and specific register user to exude from post/pages counter.
20
 
 
 
21
  = Page Counter Settings: =
22
  * In these options you can do different setting for page visit counter.
23
  * Short Code: There are two shortcuts that you can use to manually add page view count to any content on admin or post/page template created by your theme or plugin that's creating its own display content in a page / post.
52
  * Dutch
53
  * Indonesian
54
 
55
+ We always welcome user suggestions. Let us know what you think about this plugin you liked or may have disliked. User's feedback is important for us to improve more our plugins.
56
 
57
  = You can check our other plugins: =
58
 
59
+ 1. <a href ="https://store.multidots.com/go/flat-rate">Advance Flat Rate Shipping Method For WooCommerce</a>
60
+ 2. <a href ="https://store.multidots.com/go/dotstore-woocommerce-blocker">WooCommerce Blocker - Prevent Fake Orders And Blacklist Fraud Customers</a>
61
+ 3. <a href ="https://store.multidots.com/go/dotstore-enhanced-ecommerce-tracking">WooCommerce Enhanced Ecommerce Analytics Integration With Conversion Tracking</a>
62
+ 4. <a href ="https://store.multidots.com/go/dotstore-woo-category-banner">Woocommerce Category Banner Management</a>
63
+ 5. <a href ="https://store.multidots.com/go/dotstore-woo-extra-fees">Woocommerce Conditional Extra Fees</a>
64
+ 6. <a href ="https://store.multidots.com/go/dotstore-woo-product-sizechart">Woocommerce Advanced Product Size Charts</a>
65
+ 7. <a href ="https://store.multidots.com/go/dotstore-admenumanager-wp">Advance Menu Manager for WordPress</a>
66
+ 8. <a href ="https://store.multidots.com/go/dotstore-woo-savefor-later">Woocommerce Save For Later Cart Enhancement</a>
67
+ 9. <a href ="https://store.multidots.com/go/brandagency">Brand Agency- One Page HTML Template For Agency,Startup And Business</a>
68
+ 10. <a href ="https://store.multidots.com/go/Meraki">Meraki One Page HTML Resume Template</a>
69
+ 11. <a href ="https://store.multidots.com/go/dotstore-aapify-theme">Appify - Multipurpose One Page Mobile App landing page HTML</a>
70
 
71
  == Installation ==
72
 
111
 
112
  == Changelog ==
113
 
114
+ = 4.0.2 - 06-10-2016 =
115
+ * Fixies - Fixed the Globally count issue.
116
+ * Change the readme file.
117
+
118
  = 4.0.1 - 03-10-2016 =
119
+ * Change the readme file.
120
  * Added note on the admin plugin configuration
121
 
122
  = 4.0 - 30-09-2016 =
191
  * Tweak - Remote request handles on activate.
192
 
193
  = 1.1 - 07.11.2015 =
194
+ * Tweak - Class file added for admin settings page output.
195
+
196
+
admin/class-page-visit-counter-admin.php CHANGED
@@ -887,7 +887,7 @@ class page_visit_counter_Admin {
887
  } ?>
888
  </select>
889
  <p><?php echo __('(Select post types for which post views will be counted.)', 'page-visit-counter');?></p>
890
- <p>(<b><?php echo __('Note: To start the count of the page/post please select the Cpt (custom post type), page or post from above select box. If you not select any one then it will not start to count.', 'page-visit-counter'); ?></b>)</p>
891
  </td>
892
  </tr>
893
 
887
  } ?>
888
  </select>
889
  <p><?php echo __('(Select post types for which post views will be counted.)', 'page-visit-counter');?></p>
890
+ <!--<p>(<b><?php //echo __('Note: To start the count of the page/post please select the Cpt (custom post type), page or post from above select box. If you not select any one then it will not start to count.', 'page-visit-counter'); ?></b>)</p>-->
891
  </td>
892
  </tr>
893
 
includes/class-page-visit-counter-activator.php CHANGED
@@ -56,6 +56,20 @@ class class_Page_Visit_Activator {
56
  $flag = '0';
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  /*global $current_user;
61
  wp_get_current_user();
56
  $flag = '0';
57
  }
58
 
59
+ $post_types = get_post_types();
60
+ $postArr = array();
61
+ if (isset($post_types) && !empty($post_types)) {
62
+ foreach ($post_types as $cpost) {
63
+ if($cpost != "attachment" && $cpost != "revision" && $cpost != "nav_menu_item" && $cpost != "product_variation" && $cpost != "shop_order" && $cpost != "shop_order_refund" && $cpost != "shop_coupon" && $cpost != "shop_webhook" && $cpost != "scheduled-action" && $cpost != "shop_subscription"&& $cpost != "wpcf7_contact_form"&& $cpost != "mc4wp-form") {
64
+ $postArr[] = $cpost;
65
+ }
66
+ }
67
+ }
68
+
69
+ delete_option('wfap_post_type');
70
+ if (isset($postArr) && $postArr != null) {
71
+ update_option('wfap_post_type',json_encode(array_values($postArr)));
72
+ }
73
 
74
  /*global $current_user;
75
  wp_get_current_user();
page_visit_counter.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin URI: http://www.multidots.com/
8
  * Description: This plugin will count the total visits of your sites pages.
9
  * Author: Multidots
10
- * Version: 4.0.1
11
  * Author URI: http://www.multidots.com/
12
  */
13
  // If this file is called directly, abort.
7
  * Plugin URI: http://www.multidots.com/
8
  * Description: This plugin will count the total visits of your sites pages.
9
  * Author: Multidots
10
+ * Version: 4.0.2
11
  * Author URI: http://www.multidots.com/
12
  */
13
  // If this file is called directly, abort.
public/class-page-visit-counter-public.php CHANGED
@@ -184,6 +184,24 @@ class page_visit_counter_Public {
184
  $ipaddress = $_SERVER['REMOTE_ADDR'];
185
 
186
  $fetchSelecetedPostTypes = get_option('wfap_post_type');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  $postTypeSelectedDecodeArr = !empty( $fetchSelecetedPostTypes ) ? $fetchSelecetedPostTypes : json_encode( array() );
188
 
189
 
@@ -194,12 +212,10 @@ class page_visit_counter_Public {
194
  $fetchSelecetedUserId = get_option('userlist_visit');
195
  $optionsUserIdDecodedArr = !empty( $fetchSelecetedUserId ) ? $fetchSelecetedUserId : json_encode( array() );
196
 
197
-
198
  $pageCount = $wpdb->get_results("SELECT * from $table_name where page_id=$page AND ipaddress = '$ipaddress' AND date = '$currentdate' LIMIT 1");
199
 
200
  $getPageSetting = get_post_meta($page,'enable_page_count',true);
201
 
202
-
203
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
204
 
205
  $bname = 'Unknown';
@@ -763,7 +779,6 @@ class page_visit_counter_Public {
763
 
764
  }
765
 
766
-
767
  /**
768
  * BN code added
769
  */
184
  $ipaddress = $_SERVER['REMOTE_ADDR'];
185
 
186
  $fetchSelecetedPostTypes = get_option('wfap_post_type');
187
+ if ($fetchSelecetedPostTypes == '' || $fetchSelecetedPostTypes == null) {
188
+ $post_types = get_post_types();
189
+ $postArr = array();
190
+ if (isset($post_types) && !empty($post_types)) {
191
+ foreach ($post_types as $cpost) {
192
+ if($cpost != "attachment" && $cpost != "revision" && $cpost != "nav_menu_item" && $cpost != "product_variation" && $cpost != "shop_order" && $cpost != "shop_order_refund" && $cpost != "shop_coupon" && $cpost != "shop_webhook" && $cpost != "scheduled-action" && $cpost != "shop_subscription"&& $cpost != "wpcf7_contact_form"&& $cpost != "mc4wp-form") {
193
+ $postArr[] = $cpost;
194
+ }
195
+ }
196
+ }
197
+
198
+ delete_option('wfap_post_type');
199
+ if (isset($postArr) && $postArr != null) {
200
+ update_option('wfap_post_type',json_encode(array_values($postArr)));
201
+ }
202
+ $fetchSelecetedPostTypes = get_option('wfap_post_type');
203
+ }
204
+
205
  $postTypeSelectedDecodeArr = !empty( $fetchSelecetedPostTypes ) ? $fetchSelecetedPostTypes : json_encode( array() );
206
 
207
 
212
  $fetchSelecetedUserId = get_option('userlist_visit');
213
  $optionsUserIdDecodedArr = !empty( $fetchSelecetedUserId ) ? $fetchSelecetedUserId : json_encode( array() );
214
 
 
215
  $pageCount = $wpdb->get_results("SELECT * from $table_name where page_id=$page AND ipaddress = '$ipaddress' AND date = '$currentdate' LIMIT 1");
216
 
217
  $getPageSetting = get_post_meta($page,'enable_page_count',true);
218
 
 
219
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
220
 
221
  $bname = 'Unknown';
779
 
780
  }
781
 
 
782
  /**
783
  * BN code added
784
  */