Page Visit Counter - Version 3.0.4

Version Description

  • 26-08-2016 =
  • Check wordpress and woocommerce compatibility
  • Fixies - Shop page and checkout page error handled
Download this release

Release Info

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

Code changes from version 3.0.3 to 3.0.4

README.txt CHANGED
@@ -4,10 +4,10 @@ Plugin URI: http://multidots.com/
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
  Contributors: dots
7
- Stable tag: 3.0.3
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.5.3
11
  Donate link:
12
  Copyright: (c) 2014-2016 Multidots Solutions PVT LTD (info@multidots.com)
13
  License: GPLv3 or later
@@ -56,9 +56,13 @@ We always welcome user suggestions. Let us know what you think about this plugin
56
 
57
  = You can check our other plugins: =
58
 
59
- 1. <a href ="http://codecanyon.net/item/advance-menu-manager/15275037?s_rank=1">Advance Menu Manager</a>
60
- 2. <a href ="http://codecanyon.net/item/advance-flat-rate-shipping-method-for-woocommerce/15831725">Advance Flat Rate Shipping Method For WooCommerce</a>
61
- 3. <a href ="http://codecanyon.net/item/advance-extra-cost-plugin-for-woocommerce/16351490">Advance Extra Cost Plugin for WooCommerce</a>
 
 
 
 
62
 
63
  == Installation ==
64
 
@@ -95,7 +99,7 @@ In the search field type Page Visit Counter and click Search Plugins. Once you'v
95
 
96
  In which WordPress version this Plugin is compatible?
97
 
98
- It is compatible from 2.1 to 4.5.3 WordPress version.
99
 
100
  == Upgrade Notice ==
101
 
@@ -103,6 +107,10 @@ Automatic updates should work great for you. As always, though, we recommend ba
103
 
104
  == Changelog ==
105
 
 
 
 
 
106
  = 3.0.3 - 14.07.2016 =
107
  * Fixies - PHP error notice handled.
108
 
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
  Contributors: dots
7
+ Stable tag: 3.0.4
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
11
  Donate link:
12
  Copyright: (c) 2014-2016 Multidots Solutions PVT LTD (info@multidots.com)
13
  License: GPLv3 or later
56
 
57
  = You can check our other plugins: =
58
 
59
+ 1. <a href ="https://store.multidots.com/go/dotstore-woo-category-banner">Woocommerce Category Banner Management</a>
60
+ 2. <a href ="https://store.multidots.com/go/dotstore-adflatrate-shippingmethod">Advance Flat Rate Shipping Method For WooCommerce</a>
61
+ 3. <a href ="https://store.multidots.com/go/dotstore-woo-extra-fees">Woocommerce Conditional Extra Fees</a>
62
+ 4. <a href ="https://store.multidots.com/go/dotstore-woo-product-sizechart">Woocommerce Advanced Product Size Charts</a>
63
+ 5. <a href ="https://store.multidots.com/go/dotstore-admenumanager-wp">Advance Menu Manager for WordPress</a>
64
+ 6. <a href ="https://store.multidots.com/go/dotstore-woo-savefor-later">Woocommerce Save For Later Cart Enhancement</a>
65
+ 7. <a href ="https://store.multidots.com/go/dotstore-aapify-theme">Appify - Multipurpose One Page Mobile App landing page HTML</a>
66
 
67
  == Installation ==
68
 
99
 
100
  In which WordPress version this Plugin is compatible?
101
 
102
+ It is compatible from 2.1 to 4.6 WordPress version.
103
 
104
  == Upgrade Notice ==
105
 
107
 
108
  == Changelog ==
109
 
110
+ = 3.0.4 - 26-08-2016 =
111
+ * Check wordpress and woocommerce compatibility
112
+ * Fixies - Shop page and checkout page error handled
113
+
114
  = 3.0.3 - 14.07.2016 =
115
  * Fixies - PHP error notice handled.
116
 
admin/class-page-visit-counter-admin.php CHANGED
@@ -83,7 +83,7 @@ class page_visit_counter_Admin {
83
  wp_enqueue_style('color-box-style', plugin_dir_url( __FILE__ ) . 'css/colorbox.css');
84
  //wp_enqueue_style('color-picker', plugin_dir_url( __FILE__ ) . 'css/color-picker.min.css');
85
  wp_enqueue_style( 'wp-color-picker' );
86
-
87
  }
88
 
89
  /**
@@ -112,6 +112,10 @@ class page_visit_counter_Admin {
112
  //wp_enqueue_script( 'wp-jquery-ui-dialog' );
113
  wp_enqueue_script( 'jquery-ui-dialog' );
114
 
 
 
 
 
115
  wp_enqueue_script('one', plugin_dir_url( __FILE__ ) . 'js/custom.js', array( 'jquery' ), $this->version, false );
116
 
117
  wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
@@ -145,6 +149,260 @@ class page_visit_counter_Admin {
145
  }
146
 
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  /**
149
  * admin menu page fnction
150
  * add menu in admin menubar.
@@ -407,7 +665,8 @@ class page_visit_counter_Admin {
407
  }
408
 
409
 
410
- public function wp_add_plugin_userfn() {
 
411
  $email_id= $_POST['email_id'];
412
  $log_url = $_SERVER['HTTP_HOST'];
413
  $cur_date = date('Y-m-d');
@@ -423,7 +682,8 @@ class page_visit_counter_Admin {
423
  update_option('pvcp_plugin_notice_shown', 'true');
424
  }
425
 
426
- public function hide_subscribe_pvcpfn() {
 
427
  $email_id= $_POST['email_id'];
428
  update_option('pvcp_plugin_notice_shown', 'true');
429
  }
@@ -914,8 +1174,9 @@ class page_visit_counter_Admin {
914
  unset($topRefererArr);
915
  }
916
 
 
917
  //$queryWeeklyReport = "SELECT SUM(page_id) AS total,DATE_ADD(date, INTERVAL(0-WEEKDAY(date)) DAY) as Week_Start_Date,DATE_ADD(date, INTERVAL(6-WEEKDAY(date)) DAY) as week_end_date,YEARWEEK( DATE, 1 ) AS YearAndWeek FROM $table_name WHERE page_id = $pageId GROUP BY YEARWEEK(date,1) ORDER BY YearAndWeek DESC LIMIT 5";
918
- $queryWeeklyReport = "SELECT SUM(page_id) AS total,DATE_ADD(date, INTERVAL(0-WEEKDAY(date)) DAY) as Week_Start_Date,DATE_ADD(date, INTERVAL(6-WEEKDAY(date)) DAY) as week_end_date,YEARWEEK( DATE, 1 ) AS YearAndWeek, YEAR(DATE) as year, WEEK( DATE,1 ) as week FROM wp_page_visit_history WHERE page_id = 1 GROUP BY YEARWEEK(date,1) ORDER BY YearAndWeek DESC LIMIT 5";
919
 
920
  $topWeeklyArr = $wpdb->get_results($queryWeeklyReport);
921
 
@@ -971,7 +1232,49 @@ class page_visit_counter_Admin {
971
  }
972
 
973
  die();
974
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
975
 
976
  }
977
 
@@ -1020,4 +1323,25 @@ class My_Widget extends WP_Widget {
1020
  return $instance;
1021
  }
1022
  }
1023
- add_action( 'widgets_init', create_function('', 'return register_widget("My_Widget");') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  wp_enqueue_style('color-box-style', plugin_dir_url( __FILE__ ) . 'css/colorbox.css');
84
  //wp_enqueue_style('color-picker', plugin_dir_url( __FILE__ ) . 'css/color-picker.min.css');
85
  wp_enqueue_style( 'wp-color-picker' );
86
+ wp_enqueue_style( 'wp-pointer' );
87
  }
88
 
89
  /**
112
  //wp_enqueue_script( 'wp-jquery-ui-dialog' );
113
  wp_enqueue_script( 'jquery-ui-dialog' );
114
 
115
+ //enqueue script for notice pointer
116
+ wp_enqueue_script( 'wp-pointer' );
117
+
118
+
119
  wp_enqueue_script('one', plugin_dir_url( __FILE__ ) . 'js/custom.js', array( 'jquery' ), $this->version, false );
120
 
121
  wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
149
  }
150
 
151
 
152
+ public function welcome_page_visit_counter_screen_do_activation_redirect() {
153
+ // if no activation redirect
154
+ if (!get_transient('_welcome_screen_page_visitor_activation_redirect_data')) {
155
+ return;
156
+ }
157
+
158
+ // Delete the redirect transient
159
+ delete_transient('_welcome_screen_page_visitor_activation_redirect_data');
160
+
161
+ // if activating from network, or bulk
162
+ if (is_network_admin() || isset($_GET['activate-multi'])) {
163
+ return;
164
+ }
165
+ // Redirect to extra cost welcome page
166
+ wp_safe_redirect(add_query_arg(array('page' => 'page-visit-counter-about&tab=about'), admin_url('index.php')));
167
+ }
168
+
169
+ public function welcome_pages_screen_page_visit_counter() {
170
+ add_dashboard_page(
171
+ 'Page Visit counter Dashboard', 'Page Visit counter Dashboard', 'read', 'page-visit-counter-about', array(&$this, 'welcome_screen_content_page_visit_counter')
172
+ );
173
+ }
174
+
175
+ public function admin_css() {
176
+ wp_enqueue_style($this->plugin_name . 'welcome-page', plugin_dir_url(__FILE__) . 'css/style.css', array(), $this->version, 'all');
177
+ }
178
+
179
+ public function welcome_screen_content_page_visit_counter() {
180
+ ?>
181
+ <div class="wrap about-wrap">
182
+ <h1 style="font-size: 2.1em;"><?php printf(__('Welcome to Page Visit Counter', 'page-visit-counter')); ?></h1>
183
+
184
+ <div class="about-text woocommerce-about-text">
185
+ <?php
186
+ $message = '';
187
+ printf(__('%s This plugin will count the total visits of your sites pages.', 'page-visit-counter'), $message, $this->version);
188
+ ?>
189
+ <img class="version_logo_img" src="<?php echo plugin_dir_url(__FILE__) . 'images/page_visit_counter.png'; ?>">
190
+ </div>
191
+
192
+ <?php
193
+ $setting_tabs_wc = apply_filters('page_visit_counter_setting_tab', array("about" => "Overview", "other_plugins" => "Checkout our other plugins"));
194
+ $current_tab_wc = (isset($_GET['tab'])) ? $_GET['tab'] : 'general';
195
+ $aboutpage = isset($_GET['page'])
196
+ ?>
197
+ <h2 id="woo-extra-cost-tab-wrapper" class="nav-tab-wrapper">
198
+ <?php
199
+ foreach ($setting_tabs_wc as $name => $label)
200
+ echo '<a href="' . home_url('wp-admin/index.php?page=page-visit-counter-about&tab=' . $name) . '" class="nav-tab ' . ( $current_tab_wc == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
201
+ ?>
202
+ </h2>
203
+
204
+ <?php
205
+ foreach ($setting_tabs_wc as $setting_tabkey_wc => $setting_tabvalue) {
206
+ switch ($setting_tabkey_wc) {
207
+ case $current_tab_wc:
208
+ do_action('page_visit_counter_' . $current_tab_wc);
209
+ break;
210
+ }
211
+ }
212
+ ?>
213
+ <hr />
214
+ <div class="return-to-dashboard">
215
+ <a href="<?php echo home_url('/wp-admin/admin.php?page=page_visit_settings'); ?>"><?php _e('Go to Page Visit Counter Settings', 'page-visit-counter'); ?></a>
216
+ </div>
217
+ </div>
218
+ <?php
219
+ }
220
+
221
+ /**
222
+ * Extra flate rate overview welcome page content function
223
+ *
224
+ */
225
+ public function page_visit_counter_about() {
226
+ //do_action('my_own');
227
+ $current_user = wp_get_current_user();
228
+
229
+ ?>
230
+ <div class="changelog">
231
+
232
+ </br>
233
+ <style type="text/css">
234
+ p.page_visit_overview {max-width: 100% !important;margin-left: auto;margin-right: auto;font-size: 15px;line-height: 1.5;}.Page_Counter_Settings_Content_ul ul li {margin-left: 3%;list-style: initial;line-height: 23px;}
235
+ </style>
236
+ <div class="changelog about-integrations">
237
+ <div class="wc-feature feature-section col three-col">
238
+ <div>
239
+ <p class="page_visit_overview"><?php _e('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.', 'page-visit-counter'); ?></p>
240
+ <p class="page_visit_overview"><strong>Page Counter Settings: </strong></p>
241
+ <div class="Page_Counter_Settings_Content_ul">
242
+ <ul>
243
+ <li>In these options you can do different setting for page visit counter.</li>
244
+ <li>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.</li>
245
+ <li>Post Type: You can select the post type from the drop down menu for which post views will be counted. If you leave blank on post type, then all pages or all past type posts will be counted.</li>
246
+ <li>Exclude IPs (Ip Address): Enter the IP addresses which you want to be excluded from post views count.</li>
247
+ <li>Exclude Users: Select users from your project/system to be excluded from post view count.</li>
248
+ <li>Show front view counter: Check the box if you want to display counter view on front end.</li>
249
+ <li>Choose color for the front end view: select color from color picker to choose the color for display visit pages text on front side as well as in the shortcode.</li>
250
+ </ul>
251
+ </div>
252
+
253
+ <p class="page_visit_overview"><strong>Page Counter Settings: </strong></p>
254
+
255
+ <p class="page_visit_overview">In this option you can see all pages listing within Page ID, Page Title and Total Count. It will display all pages of your site. If you excluded particular post type from page visit counter then also it will display that post type, posts pages on table but it will not count those pages and "total count" will be "0" for excluded post type, post pages.</p>
256
+
257
+ <div class="Page_Counter_Settings_Content_ul">
258
+ <ul>
259
+ <li>Search facility: This provides you the extra facility to search pages by title and search page by its crated date.</li>
260
+ <li>Sharing facility: This provides you to share specific page on Facebook, Twitter and Google Plus.</li>
261
+ <li>Reports: This provides you the specific page vise reports like Top browsers, Top 10 IP address, Top referer, weekly report and Monthly report using chart.</li>
262
+ </ul>
263
+ </div>
264
+
265
+
266
+ </div>
267
+
268
+ </div>
269
+ </div>
270
+ </div>
271
+ <?php
272
+ if (!get_option('pvcp_plugin_notice_shown')) {
273
+ echo '<div id="pvcp_dialog" title="Basic dialog"> <p> Subscribe for latest plugin update and get notified when we update our plugin and launch new products for free! </p> <p><input type="text" id="txt_user_sub_pvcp" class="regular-text" name="txt_user_sub_pvcp" value="'.$current_user->user_email.'"></p></div>';
274
+
275
+ ?>
276
+
277
+
278
+ <script type="text/javascript">
279
+
280
+ jQuery( document ).ready(function() {
281
+ jQuery( "#pvcp_dialog" ).dialog({
282
+ modal: true, title: 'Subscribe Now', zIndex: 10000, autoOpen: true,
283
+ width: '500', resizable: false,
284
+ position: {my: "center", at:"center", of: window },
285
+ dialogClass: 'dialogButtons',
286
+ buttons: {
287
+ Yes: function () {
288
+ // $(obj).removeAttr('onclick');
289
+ // $(obj).parents('.Parent').remove();
290
+ var email_id = jQuery('#txt_user_sub_pvcp').val();
291
+ var data = {
292
+ 'action': 'add_plugin_user_pvcp',
293
+ 'email_id': email_id
294
+ };
295
+
296
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
297
+ jQuery.post(ajaxurl, data, function(response) {
298
+ jQuery('#pvcp_dialog').html('<h2>You have been successfully subscribed');
299
+ jQuery(".ui-dialog-buttonpane").remove();
300
+ });
301
+
302
+
303
+ },
304
+ No: function () {
305
+ var email_id = jQuery('#txt_user_sub_pvcp').val();
306
+
307
+ var data = {
308
+ 'action': 'hide_subscribe_pvcpfn',
309
+ 'email_id': email_id
310
+ };
311
+
312
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
313
+ jQuery.post(ajaxurl, data, function(response) {
314
+
315
+ });
316
+
317
+ jQuery(this).dialog("close");
318
+
319
+ }
320
+ },
321
+ close: function (event, ui) {
322
+ jQuery(this).remove();
323
+ }
324
+ });
325
+ jQuery("div.dialogButtons .ui-dialog-buttonset button").addClass("button-primary woocommerce-save-button");
326
+ jQuery("div.dialogButtons .ui-dialog-buttonpane .ui-button").css("width","80px");
327
+ });
328
+ </script>
329
+ <?php
330
+
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Extra flate rate other plugin welcome page content function
336
+ *
337
+ */
338
+ public function page_visit_counter_other_plugins() {
339
+ global $wpdb;
340
+ $url = 'http://www.multidots.com/store/wp-content/themes/business-hub-child/API/checkout_other_plugin.php';
341
+ $response = wp_remote_post( $url, array('method' => 'POST',
342
+ 'timeout' => 45,
343
+ 'redirection' => 5,
344
+ 'httpversion' => '1.0',
345
+ 'blocking' => true,
346
+ 'headers' => array(),
347
+ 'body' => array('plugin' => 'advance-flat-rate-shipping-method-for-woocommerce'),
348
+ 'cookies' => array()));
349
+
350
+ $response_new = array();
351
+ $response_new = json_decode($response['body']);
352
+ $get_other_plugin = maybe_unserialize($response_new);
353
+
354
+ $paid_arr = array();
355
+ ?>
356
+
357
+ <div class="plug-containter">
358
+ <div class="paid_plugin">
359
+ <h3>Paid Plugins</h3>
360
+ <?php foreach ($get_other_plugin as $key=>$val) {
361
+ if ($val['plugindesc'] =='paid') {?>
362
+
363
+
364
+ <div class="contain-section">
365
+ <div class="contain-img"><img src="<?php echo $val['pluginimage']; ?>"></div>
366
+ <div class="contain-title"><a target="_blank" href="<?php echo $val['pluginurl'];?>"><?php echo $key;?></a></div>
367
+ </div>
368
+
369
+
370
+ <?php }else {
371
+
372
+ $paid_arry[$key]['plugindesc']= $val['plugindesc'];
373
+ $paid_arry[$key]['pluginimage']= $val['pluginimage'];
374
+ $paid_arry[$key]['pluginurl']= $val['pluginurl'];
375
+ $paid_arry[$key]['pluginname']= $val['pluginname'];
376
+
377
+ ?>
378
+
379
+
380
+ <?php } }?>
381
+ </div>
382
+ <?php if (isset($paid_arry) && !empty($paid_arry)) {?>
383
+ <div class="free_plugin">
384
+ <h3>Free Plugins</h3>
385
+ <?php foreach ($paid_arry as $key=>$val) { ?>
386
+ <div class="contain-section">
387
+ <div class="contain-img"><img src="<?php echo $val['pluginimage']; ?>"></div>
388
+ <div class="contain-title"><a target="_blank" href="<?php echo $val['pluginurl'];?>"><?php echo $key;?></a></div>
389
+ </div>
390
+ <?php } }?>
391
+ </div>
392
+
393
+ </div>
394
+
395
+ <?php
396
+ }
397
+
398
+ /**
399
+ * Remove the Extra flate rate menu in dashboard
400
+ *
401
+ */
402
+ public function welcome_screen_remove_menus() {
403
+ remove_submenu_page('index.php', 'page-visit-counter-about');
404
+ }
405
+
406
  /**
407
  * admin menu page fnction
408
  * add menu in admin menubar.
665
  }
666
 
667
 
668
+ public function wp_add_plugin_userfn() {
669
+ global $wpdb;
670
  $email_id= $_POST['email_id'];
671
  $log_url = $_SERVER['HTTP_HOST'];
672
  $cur_date = date('Y-m-d');
682
  update_option('pvcp_plugin_notice_shown', 'true');
683
  }
684
 
685
+ public function hide_subscribe_pvcpfn() {
686
+ global $wpdb;
687
  $email_id= $_POST['email_id'];
688
  update_option('pvcp_plugin_notice_shown', 'true');
689
  }
1174
  unset($topRefererArr);
1175
  }
1176
 
1177
+ $custom_page_visit_history_datatbase_table_name = $wpdb->prefix."page_visit_history";
1178
  //$queryWeeklyReport = "SELECT SUM(page_id) AS total,DATE_ADD(date, INTERVAL(0-WEEKDAY(date)) DAY) as Week_Start_Date,DATE_ADD(date, INTERVAL(6-WEEKDAY(date)) DAY) as week_end_date,YEARWEEK( DATE, 1 ) AS YearAndWeek FROM $table_name WHERE page_id = $pageId GROUP BY YEARWEEK(date,1) ORDER BY YearAndWeek DESC LIMIT 5";
1179
+ $queryWeeklyReport = "SELECT SUM(page_id) AS total,DATE_ADD(date, INTERVAL(0-WEEKDAY(date)) DAY) as Week_Start_Date,DATE_ADD(date, INTERVAL(6-WEEKDAY(date)) DAY) as week_end_date,YEARWEEK( DATE, 1 ) AS YearAndWeek, YEAR(DATE) as year, WEEK( DATE,1 ) as week FROM $custom_page_visit_history_datatbase_table_name WHERE page_id = 1 GROUP BY YEARWEEK(date,1) ORDER BY YearAndWeek DESC LIMIT 5";
1180
 
1181
  $topWeeklyArr = $wpdb->get_results($queryWeeklyReport);
1182
 
1232
  }
1233
 
1234
  die();
1235
+ }
1236
+
1237
+
1238
+ public function custom_admin_pointers_footer() {
1239
+ $admin_pointers = custom_admin_pointers();
1240
+ ?>
1241
+ <script type="text/javascript">
1242
+ /* <![CDATA[ */
1243
+ ( function($) {
1244
+ <?php
1245
+ foreach ( $admin_pointers as $pointer => $array ) {
1246
+ if ( $array['active'] ) {
1247
+ ?>
1248
+ $( '<?php echo $array['anchor_id']; ?>' ).pointer( {
1249
+ content: '<?php echo $array['content']; ?>',
1250
+ position: {
1251
+ edge: '<?php echo $array['edge']; ?>',
1252
+ align: '<?php echo $array['align']; ?>'
1253
+ },
1254
+ close: function() {
1255
+ $.post( ajaxurl, {
1256
+ pointer: '<?php echo $pointer; ?>',
1257
+ action: 'dismiss-wp-pointer'
1258
+ } );
1259
+ }
1260
+ } ).pointer( 'open' );
1261
+ <?php
1262
+ }
1263
+ }
1264
+ ?>
1265
+ } )(jQuery);
1266
+ /* ]]> */
1267
+ </script>
1268
+ <?php
1269
+ }
1270
+
1271
+
1272
+ /**
1273
+ * Function For display pointer in admin side
1274
+ *
1275
+ */
1276
+
1277
+
1278
 
1279
  }
1280
 
1323
  return $instance;
1324
  }
1325
  }
1326
+ add_action( 'widgets_init', create_function('', 'return register_widget("My_Widget");') );
1327
+
1328
+ function custom_admin_pointers() {
1329
+
1330
+ $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
1331
+ $version = '1_0'; // replace all periods in 1.0 with an underscore
1332
+ $prefix = 'custom_admin_pointers' . $version . '_';
1333
+
1334
+ $new_pointer_content = '<h3>' . __( 'Page Visit Counter' ) . '</h3>';
1335
+ $new_pointer_content .= '<p>' . __( 'This plugin will count the total visits of your sites pages.' ) . '</p>';
1336
+
1337
+ return array(
1338
+ $prefix . 'page_visit_counter_notice_view' => array(
1339
+ 'content' => $new_pointer_content,
1340
+ 'anchor_id' => '#toplevel_page_page_visit_counter',
1341
+ 'edge' => 'left',
1342
+ 'align' => 'left',
1343
+ 'active' => ( ! in_array( $prefix . 'page_visit_counter_notice_view', $dismissed ) )
1344
+ )
1345
+ );
1346
+
1347
+ }
admin/css/style.css CHANGED
@@ -57,6 +57,98 @@ a.canvasjs-chart-credit {display: none !important;}
57
  padding-bottom: 20px;
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  .free_plugin h3 {
61
  padding-bottom: 20px;
62
  border-bottom: 1px solid #ccc;
57
  padding-bottom: 20px;
58
  }
59
 
60
+ .free_plugin h3 {
61
+ padding-bottom: 20px;
62
+ border-bottom: 1px solid #ccc;
63
+ }
64
+
65
+ /**** Welcome page****/
66
+ p.welcome-page-functionality {
67
+ font-size: 16px;
68
+ font-weight: bold;
69
+ }
70
+ .about-wrap .return-to-dashboard {
71
+ margin: 30px 0 0 -5px;
72
+ font-size: 14px;
73
+ font-weight: 700;
74
+ }
75
+ p.welocme-page-content {
76
+ font-size: 14px;
77
+ font-weight: bold;
78
+ }
79
+ .main-functionality-content {
80
+ margin: 0 0 0 16px;
81
+ }
82
+ .plug-containter {
83
+ width: 100%;
84
+ display: inline-block;
85
+ margin-left: 20px;
86
+ }
87
+ .plug-containter .contain-section {
88
+ width: 25%;
89
+ display: inline-block;
90
+ margin-top: 30px;
91
+ }
92
+ .plug-containter .contain-section .contain-img {
93
+ width: 30%;
94
+ display: inline-block;
95
+ }
96
+ .plug-containter .contain-section .contain-title {
97
+ width: 50%;
98
+ display: inline-block;
99
+ vertical-align: middle;
100
+ margin-left: 10px;
101
+ }
102
+ .plug-containter .contain-section .contain-title a {
103
+ text-decoration: none;
104
+ line-height: 20px;
105
+ font-weight: bold;
106
+ }
107
+
108
+ .method_type_selector {
109
+ display: inline-block;
110
+ top: -2px;
111
+ position: relative
112
+ }
113
+ .method_type_selector select {
114
+ font-size: 13px!important;
115
+ margin: 0 0 0 1em;
116
+ vertical-align: middle;
117
+ font-family: sans-serif;
118
+ display: inline-block
119
+ }
120
+ .method_type_selector .add-new-h2 {
121
+ vertical-align: middle;
122
+ margin-left: 0;
123
+ top: 0;
124
+ color: #21759b;
125
+ cursor: pointer
126
+ }
127
+ .version_logo_img {
128
+ position: absolute;
129
+ right: 0;
130
+ top: 0;
131
+ }
132
+ .txt_location_own {
133
+ line-height: 1.4em;
134
+ font-size: 14px;
135
+ font-style: italic;
136
+ }
137
+ #afrsm_dialog {width:500px; font-size:15px; font-weight:bold;}
138
+ #afrsm_dialog p {font-size:15px; font-weight:bold;}
139
+ .free_plugin {
140
+ margin-bottom: 20px;
141
+ }
142
+
143
+ .paid_plugin {
144
+ margin-bottom: 20px;
145
+ }
146
+
147
+ .paid_plugin h3 {
148
+ border-bottom: 1px solid #ccc;
149
+ padding-bottom: 20px;
150
+ }
151
+
152
  .free_plugin h3 {
153
  padding-bottom: 20px;
154
  border-bottom: 1px solid #ccc;
admin/images/page_visit_counter.png ADDED
Binary file
includes/class-page-visit-counter-activator.php CHANGED
@@ -47,6 +47,9 @@ class class_Page_Visit_Activator {
47
  update_option('counter_hide_show_front_vew','');
48
  update_option("text_color_page_visit","#000000");
49
 
 
 
 
50
  if( in_array( 'woocommerce/woocommerce.php',apply_filters('active_plugins',get_option('active_plugins'))) && !is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) {
51
  $flag = '1';
52
  } else {
47
  update_option('counter_hide_show_front_vew','');
48
  update_option("text_color_page_visit","#000000");
49
 
50
+ //Set Transist once pluign activated
51
+ set_transient( '_welcome_screen_page_visitor_activation_redirect_data', true, 30 );
52
+
53
  if( in_array( 'woocommerce/woocommerce.php',apply_filters('active_plugins',get_option('active_plugins'))) && !is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) {
54
  $flag = '1';
55
  } else {
includes/class-page-visit-counter.php CHANGED
@@ -132,6 +132,7 @@ class page_visit_counter {
132
 
133
  $this->loader->add_action( 'admin_enqueue_scripts',$plugin_admin, 'enqueue_styles' );
134
  $this->loader->add_action( 'admin_enqueue_scripts',$plugin_admin, 'enqueue_scripts' );
 
135
  $this->loader->add_action( 'admin_menu',$plugin_admin, 'page_visit_counter_menu' );
136
  $this->loader->add_action( 'wp_dashboard_setup',$plugin_admin, 'my_custom_dashboard_widgets' );
137
 
@@ -151,6 +152,18 @@ class page_visit_counter {
151
 
152
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_custom_meta_box_page_visit' );
153
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  $this->loader->add_action( 'plugins_loaded', $plugin_admin, 'check_page_visit_history_table_exisit' );
155
 
156
  add_action( 'wp_loaded', function ()
132
 
133
  $this->loader->add_action( 'admin_enqueue_scripts',$plugin_admin, 'enqueue_styles' );
134
  $this->loader->add_action( 'admin_enqueue_scripts',$plugin_admin, 'enqueue_scripts' );
135
+
136
  $this->loader->add_action( 'admin_menu',$plugin_admin, 'page_visit_counter_menu' );
137
  $this->loader->add_action( 'wp_dashboard_setup',$plugin_admin, 'my_custom_dashboard_widgets' );
138
 
152
 
153
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_custom_meta_box_page_visit' );
154
 
155
+ //$this->loader->add_action('admin_body_class', $plugin_admin, 'extra_flat_rate_add_body_class', 10, 1);
156
+ $this->loader->add_action('admin_init', $plugin_admin, 'welcome_page_visit_counter_screen_do_activation_redirect');
157
+ //admin menu intilization hooks
158
+ $this->loader->add_action('admin_menu', $plugin_admin, 'welcome_pages_screen_page_visit_counter');
159
+
160
+ $this->loader->add_action('page_visit_counter_other_plugins', $plugin_admin, 'page_visit_counter_other_plugins');
161
+ $this->loader->add_action('page_visit_counter_about', $plugin_admin, 'page_visit_counter_about');
162
+
163
+ $this->loader->add_action('admin_print_footer_scripts', $plugin_admin, 'custom_admin_pointers_footer');
164
+
165
+
166
+
167
  $this->loader->add_action( 'plugins_loaded', $plugin_admin, 'check_page_visit_history_table_exisit' );
168
 
169
  add_action( 'wp_loaded', function ()
page_visit_counter.php CHANGED
@@ -5,9 +5,9 @@
5
  * @package page-visit-counter
6
  * Plugin Name: Page Visit Counter
7
  * Plugin URI: http://www.multidots.com/
8
- * Description: Plugin for show visited page
9
  * Author: Multidots
10
- * Version: 3.0.3
11
  * Author URI: http://www.multidots.com/
12
  */
13
  // If this file is called directly, abort.
5
  * @package page-visit-counter
6
  * Plugin Name: Page Visit Counter
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: 3.0.4
11
  * Author URI: http://www.multidots.com/
12
  */
13
  // If this file is called directly, abort.
public/class-page-visit-counter-public.php CHANGED
@@ -89,7 +89,6 @@ class page_visit_counter_Public {
89
  global $wpdb, $wp, $post, $wp_query;
90
 
91
  //$pageurl = $_POST['pageurl'];
92
-
93
  $flag = 0;
94
  // Check the site running on HTTPS. If the site running on HTTPS then we are removing S from HTTPS
95
  if (is_ssl()) {
@@ -110,10 +109,19 @@ class page_visit_counter_Public {
110
  }
111
  }
112
  $pageID = $page;
113
- if ($_SERVER['REQUEST_URI'] == '/shop/' && $pageID == 0) {
114
- $page = (int) get_option( 'woocommerce_shop_page_id' );
 
 
 
 
 
 
 
 
 
115
  }
116
-
117
 
118
  if ($flag == 0) {
119
 
@@ -166,6 +174,7 @@ class page_visit_counter_Public {
166
 
167
  if ($page != 0) {
168
 
 
169
  $table_name = $wpdb->prefix."page_visit";
170
  $table_name_history = $wpdb->prefix . "page_visit_history";
171
  $last_date = '';
@@ -529,9 +538,8 @@ class page_visit_counter_Public {
529
  // }
530
  //
531
  // }
532
-
533
- if ($pageID != 0) {
534
 
 
535
  $post = get_post($pageID);
536
 
537
  $fetchSelecetedPostTypes = get_option('wfap_post_type');
@@ -549,7 +557,6 @@ class page_visit_counter_Public {
549
  $pageCount = $wpdb->get_results("SELECT SUM(page_visit) as total FROM $table_name WHERE `page_id` = $pageID");
550
 
551
  $total = (int) $pageCount[0]->total;
552
-
553
  $html = '';
554
  $hide_show_option = get_option('counter_hide_show_front_vew');
555
  if( $hide_show_option == 1 ){
89
  global $wpdb, $wp, $post, $wp_query;
90
 
91
  //$pageurl = $_POST['pageurl'];
 
92
  $flag = 0;
93
  // Check the site running on HTTPS. If the site running on HTTPS then we are removing S from HTTPS
94
  if (is_ssl()) {
109
  }
110
  }
111
  $pageID = $page;
112
+ if( in_array( 'woocommerce/woocommerce.php',apply_filters('active_plugins',get_option('active_plugins'))) ) {
113
+ if( is_shop() ){
114
+ $page = (int) get_option( 'woocommerce_shop_page_id' );
115
+ }
116
+ if ( is_cart() ) {
117
+ $page = (int) get_option( 'woocommerce_cart_page_id' );
118
+ }
119
+ if( is_checkout() ){
120
+ $page = (int) get_option( 'woocommerce_checkout_page_id' );
121
+
122
+ }
123
  }
124
+
125
 
126
  if ($flag == 0) {
127
 
174
 
175
  if ($page != 0) {
176
 
177
+
178
  $table_name = $wpdb->prefix."page_visit";
179
  $table_name_history = $wpdb->prefix . "page_visit_history";
180
  $last_date = '';
538
  // }
539
  //
540
  // }
 
 
541
 
542
+ if ($pageID != 0) {
543
  $post = get_post($pageID);
544
 
545
  $fetchSelecetedPostTypes = get_option('wfap_post_type');
557
  $pageCount = $wpdb->get_results("SELECT SUM(page_visit) as total FROM $table_name WHERE `page_id` = $pageID");
558
 
559
  $total = (int) $pageCount[0]->total;
 
560
  $html = '';
561
  $hide_show_option = get_option('counter_hide_show_front_vew');
562
  if( $hide_show_option == 1 ){