Page Visit Counter - Version 4.0.9

Version Description

  • 29-05-2018 =
  • minor bug fixed.
Download this release

Release Info

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

Code changes from version 4.0.8 to 4.0.9

README.txt CHANGED
@@ -4,7 +4,7 @@ Plugin URI: http://multidots.com/
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
  Contributors: dots, ketuchetan, chiragpatel, jitendrabanjara1991
7
- Stable tag: 4.0.8
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.9.6
@@ -115,6 +115,9 @@ Automatic updates should work great for you. As always, though, we recommend ba
115
 
116
  == Changelog ==
117
 
 
 
 
118
  = 4.0.8 - 25-05-2018 =
119
  * minor bug fixed.
120
 
4
  Author: Multidots
5
  Author URI: http://multidots.com/
6
  Contributors: dots, ketuchetan, chiragpatel, jitendrabanjara1991
7
+ Stable tag: 4.0.9
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.9.6
115
 
116
  == Changelog ==
117
 
118
+ = 4.0.9 - 29-05-2018 =
119
+ * minor bug fixed.
120
+
121
  = 4.0.8 - 25-05-2018 =
122
  * minor bug fixed.
123
 
admin/class-page-visit-counter-admin.php CHANGED
@@ -139,9 +139,9 @@ class page_visit_counter_Admin
139
  wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false, 1);
140
 
141
  $colorpicker_l10n = array(
142
- 'clear' => __('Clear'),
143
- 'defaultString' => __('Default'),
144
- 'pick' => __('Select Color')
145
  );
146
  if (!empty($colorpicker_l10n) || $colorpicker_l10n != "") {
147
  wp_localize_script('wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n);
@@ -162,17 +162,17 @@ class page_visit_counter_Admin
162
  } else {
163
  wp_localize_script('one', 'get_post_option', array('optionsarray' => ''));
164
  }
165
-
166
  $fetchSelecetedIpAddress = get_option('ipaddress_visit');
167
  if (!empty($fetchSelecetedIpAddress) || $fetchSelecetedIpAddress != "") {
168
  $optionsIpAddress = !empty($fetchSelecetedIpAddress) ? $fetchSelecetedIpAddress : json_encode(array());
169
  if (!empty($optionsIpAddress) || $optionsIpAddress != "") {
170
- wp_localize_script('one', 'get_ip_option', array('ipaddressarray' => $optionsIpAddress));
171
  } else {
172
- wp_localize_script('one', 'get_ip_option', array('ipaddressarray' => ''));
173
  }
174
  } else {
175
- wp_localize_script('one', 'get_ip_option', array('ipaddressarray' => ''));
176
  }
177
 
178
  $fetchSelecetedUserId = get_option('userlist_visit');
@@ -227,15 +227,14 @@ class page_visit_counter_Admin
227
  {
228
  ?>
229
  <div class="wrap about-wrap">
230
- <h1 style="font-size: 2.1em;"><?php printf(__('Welcome to Page Visit Counter', 'page-visit-counter')); ?></h1>
231
 
232
  <div class="about-text woocommerce-about-text">
233
  <?php
234
  $message = '';
235
- printf(__('%s This plugin will count the total visits of your sites pages.', 'page-visit-counter'), $message, $this->version);
236
  ?>
237
- <img class="version_logo_img"
238
- src="<?php echo plugin_dir_url(__FILE__) . 'images/page_visit_counter.png'; ?>">
239
  </div>
240
 
241
  <?php
@@ -243,13 +242,12 @@ class page_visit_counter_Admin
243
  "about" => "Overview",
244
  "other_plugins" => "Checkout our other plugins"
245
  ));
246
- $current_tab_wc = (isset($_GET['tab'])) ? $_GET['tab'] : 'general';
247
- $aboutpage = isset($_GET['page'])
248
  ?>
249
  <h2 id="woo-extra-cost-tab-wrapper" class="nav-tab-wrapper">
250
  <?php
251
  foreach ($setting_tabs_wc as $name => $label) {
252
- echo '<a href="' . esc_url(home_url('wp-admin/index.php?page=page-visit-counter-about&tab=' . $name)) . '" class="nav-tab ' . ($current_tab_wc == $name ? 'nav-tab-active' : '') . '">' . esc_html($label) . '</a>';
253
  }
254
  ?>
255
  </h2>
@@ -265,7 +263,7 @@ class page_visit_counter_Admin
265
  ?>
266
  <hr/>
267
  <div class="return-to-dashboard">
268
- <a href="<?php echo esc_url(home_url('/wp-admin/admin.php?page=page_visit_settings')); ?>"><?php _e('Go to Page Visit Counter Settings', 'page-visit-counter'); ?></a>
269
  </div>
270
  </div>
271
  <?php
@@ -279,10 +277,8 @@ class page_visit_counter_Admin
279
  {
280
  //do_action('my_own');
281
  $current_user = wp_get_current_user();
282
-
283
  ?>
284
  <div class="changelog">
285
-
286
  </br>
287
  <style type="text/css">
288
  p.page_visit_overview {
@@ -302,35 +298,35 @@ class page_visit_counter_Admin
302
  <div class="changelog about-integrations">
303
  <div class="wc-feature feature-section col three-col">
304
  <div>
305
- <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>
306
- <p class="page_visit_overview"><strong><?php _e('Page Counter Settings:', 'page-visit-counter');?> </strong></p>
307
  <div class="Page_Counter_Settings_Content_ul">
308
  <ul>
309
- <li><?php _e("In these options you can do different setting for page visit counter.', 'page-visit-counter');?></li>
310
- <li><?php _e('Short Code: There are two shortcuts that you can use to manually add page view count
311
  to any content on admin or post/page template created by your theme or plugin that's
312
  creating its own display content in a page / post.", 'page-visit-counter');?>
313
  </li>
314
- <li><?php _e("Post Type: You can select the post type from the drop down menu for which post views
315
  will be counted. If you leave blank on post type, then all pages or all past type
316
  posts will be counted.", 'page-visit-counter');?>
317
  </li>
318
- <li><?php _e("Exclude IPs (Ip Address): Enter the IP addresses which you want to be excluded from
319
  post views count.", 'page-visit-counter');?>
320
  </li>
321
- <li><?php _e("Exclude Users: Select users from your project/system to be excluded from post view
322
  count.", 'page-visit-counter');?>
323
  </li>
324
- <li><?php _e("Show front view counter: Check the box if you want to display counter view on front
325
  end.", 'page-visit-counter');?>
326
  </li>
327
- <li><?php _e("Choose color for the front end view: select color from color picker to choose the
328
  color for display visit pages text on front side as well as in the shortcode.", 'page-visit-counter');?>
329
  </li>
330
  </ul>
331
  </div>
332
 
333
- <p class="page_visit_overview"><strong><?php _e("Page Counter Settings:", 'page-visit-counter');?> </strong></p>
334
 
335
  <p class="page_visit_overview"><?php _e("In this option you can see all pages listing within Page ID, Page
336
  Title and Total Count. It will display all pages of your site. If you excluded particular
@@ -340,13 +336,13 @@ class page_visit_counter_Admin
340
 
341
  <div class="Page_Counter_Settings_Content_ul">
342
  <ul>
343
- <li><?php _e('Search facility: This provides you the extra facility to search pages by title and
344
  search page by its crated date.', 'page-visit-counter');?>
345
  </li>
346
- <li><?php _e('Sharing facility: This provides you to share specific page on Facebook, Twitter and
347
  Google Plus.', 'page-visit-counter');?>
348
  </li>
349
- <li><?php _e('Reports: This provides you the specific page vise reports like Top browsers, Top 10
350
  IP address, Top referer, weekly report and Monthly report using chart.', 'page-visit-counter');?>
351
  </li>
352
  </ul>
@@ -359,84 +355,7 @@ class page_visit_counter_Admin
359
  </div>
360
  </div>
361
  <?php
362
- if (!get_option('pvcp_plugin_notice_shown')) {
363
- echo '<div id="pvcp_dialog" title="Basic dialog"> <p>'._e('Subscribe for latest plugin update and get notified when we update our plugin and launch new products for free!', 'page-visit-counter').' </p> <p><input type="text" id="txt_user_sub_pvcp" class="regular-text" name="txt_user_sub_pvcp" value="' . esc_attr($current_user->user_email) . '"></p></div>';
364
- }
365
- }
366
-
367
- /**
368
- * Extra flate rate other plugin welcome page content function
369
- *
370
- */
371
- public function page_visit_counter_other_plugins()
372
- {
373
- global $wpdb;
374
- $url = 'https://store.multidots.com/wp-content/themes/business-hub-child/API/checkout_other_plugin.php';
375
- $response = wp_remote_post($url, array(
376
- 'method' => 'POST',
377
- 'timeout' => 45,
378
- 'redirection' => 5,
379
- 'httpversion' => '1.0',
380
- 'blocking' => true,
381
- 'headers' => array(),
382
- 'body' => array('plugin' => 'advance-flat-rate-shipping-method-for-woocommerce'),
383
- 'cookies' => array()
384
- ));
385
-
386
- $response_new = array();
387
- $response_new = json_decode($response['body']);
388
- $get_other_plugin = maybe_unserialize($response_new);
389
-
390
- $paid_arr = array();
391
- ?>
392
-
393
- <div class="plug-containter">
394
- <div class="paid_plugin">
395
- <h3><?php _e('Paid Plugins', 'page-visit-counter');?></h3>
396
- <?php if (!empty($get_other_plugin) || $get_other_plugin != '') { ?>
397
- <?php foreach ($get_other_plugin as $key => $val) {
398
- if ($val['plugindesc'] == 'paid') { ?>
399
-
400
-
401
- <div class="contain-section">
402
- <div class="contain-img"><img src="<?php echo esc_url($val['pluginimage']); ?>"></div>
403
- <div class="contain-title"><a target="_blank" href="<?php echo esc_url($val['pluginurl']); ?>"><?php echo esc_attr($key); ?></a>
404
- </div>
405
- </div>
406
-
407
-
408
- <?php } else {
409
-
410
- $paid_arry[$key]['plugindesc'] = $val['plugindesc'];
411
- $paid_arry[$key]['pluginimage'] = $val['pluginimage'];
412
- $paid_arry[$key]['pluginurl'] = $val['pluginurl'];
413
- $paid_arry[$key]['pluginname'] = $val['pluginname'];
414
-
415
- ?>
416
-
417
-
418
- <?php }
419
- }
420
- }
421
- ?>
422
- </div>
423
- <?php if (isset($paid_arry) && !empty($paid_arry)) { ?>
424
- <div class="free_plugin">
425
- <h3><?php _e('Free Plugins', 'page-visit-counter');?></h3>
426
- <?php foreach ($paid_arry as $key => $val) { ?>
427
- <div class="contain-section">
428
- <div class="contain-img"><img src="<?php echo esc_url($val['pluginimage']); ?>"></div>
429
- <div class="contain-title"><a target="_blank" href="<?php echo esc_url($val['pluginurl']); ?>"><?php echo esc_attr($key); ?></a>
430
- </div>
431
- </div>
432
- <?php }
433
- } ?>
434
- </div>
435
-
436
- </div>
437
-
438
- <?php
439
- }
440
 
441
  /**
442
  * Remove the Extra flate rate menu in dashboard
@@ -454,8 +373,8 @@ class page_visit_counter_Admin
454
  */
455
  public function page_visit_counter_menu()
456
  {
457
- add_menu_page(__('Page-Visit-Counter', 'page-visit-counter'), __('PageVisitCounter', 'page-visit-counter'), 'manage_options', 'page_visit_counter', 'extra_page_visit_function_custom', plugins_url('page-visit-counter/admin/images/icon.png'));
458
- add_submenu_page('page_visit_counter', __('Counter-Settings', 'page-visit-counter'), __('Settings', 'page-visit-counter'), 'manage_options', 'page_visit_settings', 'custom_page_visit_settings');
459
  /**
460
  * extra_page_visit_function_custom use the menu callback function
461
  * $name pass the arguments
@@ -481,7 +400,7 @@ class page_visit_counter_Admin
481
 
482
  <div class="main-page-visit set_pvc_containter">
483
  <div class="page-title">
484
- <h1><?php echo __('Page Visit Counter', 'page-visit-counter'); ?></h1>
485
  </div>
486
 
487
  <?php
@@ -512,28 +431,28 @@ class page_visit_counter_Admin
512
  width: 50%;
513
  }
514
  </style>
515
- <div class="back"><h5><a class="button button-primary" href="<?php echo esc_url(site_url().'/wp-admin/admin.php?page=page_visit_counter');?>">&#x2190;<?php echo _e('Back to list', 'page-visit-counter'); ?></a></h5></div>
516
  <div style="">
517
  <div id="page-vist-fancybox" class="page-counter-fancybox">
518
  <div id="tabs">
519
  <div id="chartContainer-main">
520
- <span><?php echo _e('Top Browsers', 'page-visit-counter'); ?></span>
521
  <div id="chartContainer" style="width: 100%; height: 500px;"></div>
522
  </div>
523
  <div id="chartContainer1-main">
524
- <span><?php echo _e('Top 10 IP address', 'page-visit-counter'); ?></span>
525
  <div id="chartContainer1" style="width: 100%; height: 500px;"></div>
526
  </div>
527
  <div id="chartContainer2-main">
528
- <span><?php echo _e('Top referer', 'page-visit-counter'); ?></span>
529
  <div id="chartContainer2" style="width: 100%; height: 500px;"></div>
530
  </div>
531
  <div id="chartContainer3-main">
532
- <span><?php echo _e('Weekly report', 'page-visit-counter'); ?> </span>
533
  <div id="chartContainer3" style="width: 100%; height: 500px;"></div>
534
  </div>
535
  <div id="chartContainer5-main">
536
- <span><?php echo _e('Monthly report', 'page-visit-counter'); ?></span>
537
  <div id="chartContainer5" style="width: 100%; height: 500px;"></div>
538
  </div>
539
  </div>
@@ -684,7 +603,7 @@ class page_visit_counter_Admin
684
 
685
  };
686
 
687
- var page_id = <?php echo $_REQUEST['id']; ?>;
688
  jQuery.ajax({
689
  type: "POST",
690
  url: pagevisit.ajaxurl,
@@ -833,10 +752,11 @@ class page_visit_counter_Admin
833
  } else { ?>
834
  <form id="movies-filter" method="get">
835
  <?php
836
- $test_list_table->search_box(__('Search'), 'page-visit-counter');
837
- foreach ($_GET as $key => $value) { // http://stackoverflow.com/a/8763624/1287812
838
  if ('s' !== $key) // don't include the search query
839
  {
 
840
  echo("<input type='hidden' name='$key' value='$value' />");
841
  }
842
  }
@@ -902,18 +822,12 @@ class page_visit_counter_Admin
902
  $post_list = array();
903
  $post = json_decode(get_option('wfap_post_type'));
904
  $post_list = $post;
905
-
906
  $text_color_page_visit = get_option('text_color_page_visit');
907
  if (isset($text_color_page_visit) && $text_color_page_visit != null) {
908
  $text_color_page_visit = $text_color_page_visit;
909
  } else {
910
  $text_color_page_visit = '#000000';
911
  }
912
-
913
- if (!get_option('pvcp_plugin_notice_shown')) {
914
- echo '<div id="pvcp_dialog" title="Basic dialog"> <p>'._e('Subscribe for latest plugin update and get notified when we update our plugin and launch new products for free!', 'page-visit-counter').'</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>';
915
- }
916
-
917
  ?>
918
  <div class="main-page-visit-settings">
919
  <div class="page-title-settings">
@@ -922,35 +836,35 @@ class page_visit_counter_Admin
922
  <input type="hidden" name="action" value="submit_form_pvc"/>
923
  <input id="action_which" type="hidden" name="action-which" value="add"/>
924
  <div class="set_pvc_containter set_plugin_descriptions">
925
- <h3><?php echo __('Page Counter Settings', 'page-visit-counter'); ?></h3>
926
- <p><?php echo __('Page Visit Counter 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.', 'page-visit-counter'); ?></p>
927
  <ul style="list-style-type: disc;padding: 3px 2px 2px 34px;">
928
  <li>
929
- <p><?php echo __('Specific page vise reports like Top browsers, Top 10 IP address, Top referer, weekly report and Monthly report using chart.', 'page-visit-counter'); ?></p>
930
  </li>
931
  <li>
932
- <p><?php echo __('Search facility: search pages by title and search page by its created date.', 'page-visit-counter'); ?></p>
933
  </li>
934
  <li>
935
- <p><?php echo __('Sharing facility: share specific page on Facebook, Twitter and Google Plus.', 'page-visit-counter'); ?></p>
936
  </li>
937
  </ul>
938
  </div>
939
 
940
  <div class="set_pvc_containter set_plugin_descriptions_shortcode">
941
  <fieldset>
942
- <legend><?php echo __('Short Code', 'page-visit-counter'); ?></legend>
943
- <p><?php echo __('There are two shortcodes 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 thats create it\'s own display content in page/post.', 'page-visit-counter'); ?></p>
944
- <p><?php echo __('Use this shortcode to add admin side content on page/post:', 'page-visit-counter'); ?>
945
  <b><?php echo __(htmlspecialchars('[page_visit_counter_md id="<page_id/post_id>"]'), 'page-visit-counter'); ?></b>
946
  </p>
947
- <p><?php echo __('Use this shortcode to display total sites visit to add admin side content on page/post:', 'page-visit-counter'); ?>
948
  <b><?php echo __(htmlspecialchars('[page_visit_counter_md_total_sites_visit backgroundcolor="#ff0000" countboxcolor="#000000" fontcolor="#FFFFFF" bordercolor="#ff0000"]'), 'page-visit-counter'); ?></b>
949
  </p>
950
- <p><?php echo __('Use this shortcode to add page/post template (.php) file of your own template:', 'page-visit-counter'); ?>
951
  <b> <?php echo "&lt;?php echo do_shortcode('[page_visit_counter_md id='page_id/post_id']');?&gt;" ?></b>
952
  </p>
953
- <p><?php echo __('Use this shortcode to display total sites visit to add page/post template (.php) file of your own template:', 'page-visit-counter'); ?>
954
  <br><b> &lt;?php echo do_shortcode('[page_visit_counter_md_total_sites_visit
955
  backgroundcolor='#ff0000' countboxcolor='#000000' fontcolor='#FFFFFF'
956
  bordercolor='#ff0000']');?&gt; </b></p>
@@ -959,7 +873,7 @@ class page_visit_counter_Admin
959
 
960
  <div class="set_pvc_containter set_plugin_descriptions">
961
  <fieldset>
962
- <legend><?php echo __('Basic Configuration settings', 'page-visit-counter'); ?></legend>
963
  <?php
964
  $get_option_value = json_decode(get_option('page_count_settings'));
965
  $input_values = isset($get_option_value[1]) ? $get_option_value[1] : array();
@@ -968,64 +882,65 @@ class page_visit_counter_Admin
968
  <table border="0" cellpadding="10" cellspacing="0">
969
  <tbody>
970
  <tr>
971
- <th scope="row"><label for="blogname"><?php echo __('Post Type', 'page-visit-counter'); ?></label>
972
  </th>
973
  <td>
974
- <select id="post_type" data-placeholder=" <?php echo __('Add Page/Post Type', 'page-visit-counter'); ?>" name="post_ty[]" multiple="true" class="chosen-select-post category-select chosen-rtl validate_field1">
975
  <option value=""></option>
976
  <?php
977
  if (isset($post_types) && !empty($post_types)) {
978
  foreach ($post_types as $cpost) {
979
  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") { ?>
980
- <option
981
- value="<?php echo $cpost; ?>"><?php echo $cpost; ?></option><?php
982
  }
983
  }
984
  } ?>
985
  </select>
986
- <p><?php echo __('(Select post types for which post views will be counted.)', 'page-visit-counter'); ?></p>
987
  </td>
988
  </tr>
989
 
990
  <tr class="ipaddress">
991
- <th scope="row"><label for="blogname"><?php echo __('Exclude IPs (Ip Address)', 'page-visit-counter'); ?></label>
992
  </th>
993
  <td>
994
- <select id="ip_address" data-placeholder=" <?php echo __('Add IP Address in comma seprated', 'page-visit-counter'); ?>" name="ip-basic[]" multiple="true" class="chosen-select-ip category-select chosen-rtl validate_field1">
995
  <option value=""></option><?php
996
  $get_option_value_ip = json_decode(get_option('ipaddress_visit'));
 
 
 
997
  if (isset($get_option_value_ip) && !empty($get_option_value_ip)) {
998
  foreach ($get_option_value_ip as $ip) { ?>
999
- <option
1000
- value="<?php echo $ip; ?>"><?php echo $ip; ?></option><?php
1001
  }
1002
  } ?>
1003
  </select>
1004
- <p><?php echo __('(Enter the IP addresses to be excluded from post views count.)', 'page-visit-counter'); ?></p>
1005
  </td>
1006
  </tr>
1007
 
1008
  <tr class="users">
1009
- <th scope="row"><label for="blogname"><?php echo __('Exclude Users', 'page-visit-counter'); ?></label>
1010
  </th>
1011
  <td>
1012
- <select id="users_list" data-placeholder="<?php echo __('Select Registerd Users', 'page-visit-counter'); ?>" name="user-basic[]" multiple="true" class="chosen-select category-select chosen-rtl validate_field1">
1013
  <option value=""></option><?php
1014
  $query = "SELECT * FROM $wpdb->users";
1015
  $resultSetsArr = $wpdb->get_results($query);
1016
  if (isset($resultSetsArr) && !empty($resultSetsArr)) {
1017
  foreach ($resultSetsArr as $value) { ?>
1018
- <option
1019
- value="<?php echo $value->ID; ?>"><?php echo $value->user_email; ?></option><?php
1020
  }
1021
  } ?>
1022
  </select>
1023
- <p><?php echo __('(Select the users to be excluded from post views count.)', 'page-visit-counter'); ?></p>
1024
  </td>
1025
  </tr>
1026
 
1027
  <tr class="hidefront">
1028
- <th scope="row"><label for="blogname"><?php echo __('Show front view counter', 'page-visit-counter'); ?></label>
1029
  </th>
1030
  <?php
1031
  $hide_show_option = get_option('counter_hide_show_front_vew');
@@ -1035,12 +950,12 @@ class page_visit_counter_Admin
1035
  $cheked = '';
1036
  } ?>
1037
  <td class="information">
1038
- <input type="checkbox" name="hidefrontview" id="hide_front_view" <?php echo $cheked; ?>><?php echo __('Check the box if you want to display counter view on front end.', 'page-visit-counter'); ?>
1039
  </td>
1040
  </tr>
1041
 
1042
  <tr class="hidefront" style="display:none;">
1043
- <th scope="row"><label for="blogname"><?php echo __('Last How many days count you want to display on front end.', 'page-visit-counter'); ?></label>
1044
  </th>
1045
  <td class="information">
1046
  <?php
@@ -1049,15 +964,15 @@ class page_visit_counter_Admin
1049
  $get_no_of_days = '';
1050
  }
1051
  ?>
1052
- <input type="text" name="no_of_days_to_display" id="no_of_days_to_display" value="<?php echo $get_no_of_days; ?>">
1053
  </td>
1054
  </tr>
1055
 
1056
  <tr class="">
1057
- <th scope="row"><label for="blogname"><?php echo __('Choose color for the front end view', 'page-visit-counter'); ?></label>
1058
  </th>
1059
  <td class="information">
1060
- <input id="text_color_page_visit" type="text" name="textcolor" value="<?php echo $text_color_page_visit; ?>" class="my-color-field" data-default-color="<?php echo $text_color_page_visit; ?>"/>
1061
  </td>
1062
  </tr>
1063
  </tbody>
@@ -1065,9 +980,9 @@ class page_visit_counter_Admin
1065
  </fieldset>
1066
  </div>
1067
  <p class="submit">
1068
- <input type="submit" name="submit" class="button button-primary" value="<?php echo __('Save Changes', 'page-visit-counter'); ?>">
1069
- <input type="submit" id="pvc_reset_settings" value="<?php echo __('Reset all settings', 'page-visit-counter'); ?>" class="button button-primary">
1070
- <input type="submit" id="pvc_reset_counter" value="<?php echo __('Reset all pages counts & report ', 'page-visit-counter'); ?>" class="button button-primary">
1071
  </p>
1072
  </form>
1073
  </div>
@@ -1076,41 +991,6 @@ class page_visit_counter_Admin
1076
  }
1077
  }
1078
 
1079
-
1080
- public function wp_add_plugin_userfn()
1081
- {
1082
- $email_id = (isset($_POST["email_id"]) && !empty($_POST["email_id"])) ? $_POST["email_id"] : '';
1083
- $log_url = !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
1084
- $cur_date = date('Y-m-d');
1085
- $request_url = 'https://store.multidots.com/wp-content/themes/business-hub-child/API/wp-add-plugin-users.php';
1086
- if (!empty($email_id)) {
1087
- $response_args = array(
1088
- 'method' => 'POST',
1089
- 'timeout' => 45,
1090
- 'redirection' => 5,
1091
- 'httpversion' => '1.0',
1092
- 'blocking' => true,
1093
- 'headers' => array(),
1094
- 'body' => array(
1095
- 'user' => array(
1096
- 'plugin_id' => '6',
1097
- 'user_email' => $email_id,
1098
- 'plugin_site' => $log_url,
1099
- 'status' => 1,
1100
- 'activation_date' => $cur_date
1101
- )
1102
- ),
1103
- 'cookies' => array()
1104
- );
1105
- $request_response = wp_remote_post($request_url, $response_args);
1106
- if (!is_wp_error($request_response)) {
1107
- update_option('pvcp_plugin_notice_shown', 'true');
1108
- }
1109
- }
1110
- wp_die();
1111
- }
1112
-
1113
-
1114
  /**
1115
  * function create dashboad widget.
1116
  * view most visited page in dashboard.
@@ -1119,7 +999,7 @@ class page_visit_counter_Admin
1119
  function my_custom_dashboard_widgets()
1120
  {
1121
  global $wp_meta_boxes;
1122
- wp_add_dashboard_widget('custom_help_widget', __('Most Visited Page', 'page-visit-counter'), 'custom_dashboard_help');
1123
  function custom_dashboard_help()
1124
  {
1125
  global $wpdb;
@@ -1132,9 +1012,9 @@ class page_visit_counter_Admin
1132
  if (!empty($count_visit) && isset($count_visit)) {
1133
  $html .= '<table border="0" cellpadding="5" cellspacing="10">';
1134
  $html .= '<tr>';
1135
- $html .= '<th>' . __('Page id', 'page-visit-counter') . '</th>';
1136
- $html .= '<th>' . __('Page Name', 'page-visit-counter') . '</th>';
1137
- $html .= '<th>' . __('Total Count', 'page-visit-counter') . '</th>';
1138
  $html .= '</tr>';
1139
 
1140
  foreach ($count_visit as $visitpage) {
@@ -1148,7 +1028,7 @@ class page_visit_counter_Admin
1148
  }
1149
  $html .= '</table>';
1150
  } else {
1151
- $html .= __('No Page Found.', 'page-visit-counter');
1152
  }
1153
  $html .= '</div>';
1154
  echo $html;
@@ -1173,11 +1053,12 @@ class page_visit_counter_Admin
1173
  if (!isset($_POST['pvc_setting']) || !wp_verify_nonce($_POST['pvc_setting'], basename(__FILE__))) {
1174
  die('Failed security check');
1175
  }
1176
- $type = isset($_POST['post_ty']) ? $_POST['post_ty'] : array();
1177
- $ipAddress = isset($_POST['ip-basic']) ? $_POST['ip-basic'] : array();
1178
- $userList = isset($_POST['user-basic']) ? $_POST['user-basic'] : array();
1179
- $hidefrontview = isset($_POST['hidefrontview']) ? $_POST['hidefrontview'] : '';
1180
- $text_color_page_visit = isset($_POST['textcolor']) ? $_POST['textcolor'] : '';
 
1181
 
1182
  $twitter_url_page_visit = isset($_POST['twitter_url_page_visit']) ? $_POST['twitter_url_page_visit'] : '';
1183
  $gplus_url_page_visit = isset($_POST['gplus_url_page_visit']) ? $_POST['gplus_url_page_visit'] : '';
@@ -1271,12 +1152,12 @@ class page_visit_counter_Admin
1271
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1272
  <thead>
1273
  <tr>
1274
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1275
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1276
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1277
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1278
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1279
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1280
  </tr>
1281
  </thead>
1282
  <tbody>';
@@ -1304,7 +1185,7 @@ class page_visit_counter_Admin
1304
  $html .= '<td>' . esc_attr($counter) . '</td>';
1305
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1306
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1307
- $html .= '<td><a href="' . esc_url($edit_url) . '">' . __($results->post_title, 'page-visit-counter') . '</a></td>';
1308
  $sel_qry = $wpdb->prepare('SELECT SUM(page_visit) as page_visit from ' . $table_name . ' where page_id=%d', $results->ID);
1309
  $count_visit = $wpdb->get_results($sel_qry);
1310
  $count = 0;
@@ -1325,18 +1206,18 @@ class page_visit_counter_Admin
1325
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1326
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1327
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1328
- $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID) . '" title="' . __($results->post_title, 'page-visit-counter') . '" class="" id="' . esc_attr($results->ID) . '">' . __('View Report', 'page-visit-counter') . '</a></td>';
1329
  $html .= '</tr>';
1330
  }
1331
  }
1332
  $html .= '</tbody>
1333
  <tfoot><tr>
1334
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1335
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1336
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1337
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1338
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1339
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1340
  </tr></tfoot></table>';
1341
  echo $html;
1342
  } else {
@@ -1363,12 +1244,12 @@ class page_visit_counter_Admin
1363
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1364
  <thead>
1365
  <tr>
1366
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1367
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1368
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1369
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1370
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1371
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1372
  </tr></thead><tbody>';
1373
  $counter = 0;
1374
  foreach ($notvisit as $results) {
@@ -1377,7 +1258,7 @@ class page_visit_counter_Admin
1377
  $html .= '<td>' . esc_attr($counter) . '</td>';
1378
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1379
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1380
- $html .= '<td><a href="' . esc_url($edit_url) . '">' . __($results->post_title, 'page-visit-counter') . '</a></td>';
1381
  $html .= '<td> 0 </td>';
1382
  $site_title = get_bloginfo('name');
1383
  $page_social_content = $results->post_title . ' - Total Visits 0 - ' . $site_title;
@@ -1386,29 +1267,29 @@ class page_visit_counter_Admin
1386
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1387
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1388
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1389
- $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID) . '" title="' . __($results->post_title, 'page-visit-counter') . '" class="" id="' . esc_attr($results->ID) . '">' . __('View Report', 'page-visit-counter') . '</a></td>';
1390
  $html .= '</tr>';
1391
  }
1392
  $html .= '</tbody><tfoot>
1393
  <tr>
1394
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1395
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1396
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1397
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1398
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1399
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1400
  </tr></tfoot></table>';
1401
  echo $html;
1402
  } else if ($dataquery != '') {
1403
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1404
  <thead>
1405
  <tr>
1406
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1407
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1408
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1409
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1410
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1411
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1412
  </tr></thead><tbody>';
1413
  $counter = 0;
1414
  foreach ($dataquery as $results) {
@@ -1417,7 +1298,7 @@ class page_visit_counter_Admin
1417
  $html .= '<td>' . esc_attr($counter) . '</td>';
1418
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1419
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1420
- $html .= '<td><a href="' . esc_url($edit_url) . '">' . __($results->post_title, 'page-visit-counter') . '</a></td>';
1421
  $str = '';
1422
  if ($page_title != '') {
1423
  if ($page_date != '') {
@@ -1457,18 +1338,18 @@ class page_visit_counter_Admin
1457
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1458
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1459
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1460
- $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID). '" title="' . __($results->post_title, 'page-visit-counter') . '" class="" id="' . esc_attr($results->ID) . '">' . __('View Report', 'page-visit-counter') . '</a></td>';
1461
 
1462
  $html .= '</tr>';
1463
  }
1464
  $html .= '</tbody><tfoot>
1465
  <tr>
1466
- <th width="10%">' . __('No', 'page-visit-counter') . '</th>
1467
- <th width="10%">' . __('Page ID', 'page-visit-counter') . '</th>
1468
- <th>' . __('Page Title', 'page-visit-counter') . '</th>
1469
- <th width="20%">' . __('Total Count', 'page-visit-counter') . '</th>
1470
- <th width="20%">' . __('Share', 'page-visit-counter') . '</th>
1471
- <th width="10%">' . __('Report', 'page-visit-counter') . '</th>
1472
  </tr></tfoot</table>';
1473
  echo $html;
1474
  }
@@ -1503,7 +1384,7 @@ class page_visit_counter_Admin
1503
  {
1504
 
1505
  return array_merge($columns,
1506
- array('page_visit_count' => __('Total Visits', 'page-visit-counter')));
1507
 
1508
 
1509
  }
@@ -1536,40 +1417,40 @@ class page_visit_counter_Admin
1536
  $total = (int)$pageCount[0]->total;
1537
  ?>
1538
  <input name="pageidvisit" type="hidden" value="<?php echo $post_id; ?>">
1539
- <p><?php echo __('Do you want to enable page visits count for this page?', 'page-visit-counter'); ?></p>
1540
  <p>
1541
  <?php if ($enable_page_count == '') { ?>
1542
  <input type="radio" checked="checked" name="autoupdate_page_visit" id="autoupdate_page1"
1543
- value="yes"><?php echo __('Yes', 'page-visit-counter'); ?>
1544
  <input type="radio" name="autoupdate_page_visit" id="autoupdate_page2"
1545
- value="no"><?php echo __('No', 'page-visit-counter'); ?>
1546
  <?php } else { ?>
1547
  <input type="radio" <?php if ($enable_page_count == 'yes') { ?> checked="checked" <?php } ?>
1548
- name="autoupdate_page_visit" id="autoupdate_page1" value="yes"> <?php echo __('Yes', 'page-visit-counter'); ?>
1549
  <input type="radio" <?php if ($enable_page_count == 'no') { ?> checked="checked" <?php } ?>
1550
- name="autoupdate_page_visit" id="autoupdate_page2" value="no"> <?php echo __('No', 'page-visit-counter'); ?><?php
1551
  } ?>
1552
  </p>
1553
- <p><?php echo __('Do you want to display today page visits count for this page?', 'page-visit-counter'); ?></p>
1554
  <p>
1555
  <?php if ($enable_page_count_day_wise == '') { ?>
1556
- <input type="radio" checked="checked" name="autoupdate_page_visit_day_wise" id="autoupdate_page1_day_wise" value="yes"><?php echo __('Yes', 'page-visit-counter'); ?>
1557
- <input type="radio" name="autoupdate_page_visit_day_wise" id="autoupdate_page2_day_wise" value="no"><?php echo __('No', 'page-visit-counter'); ?>
1558
  <?php } else { ?>
1559
  <input type="radio" <?php if ($enable_page_count_day_wise == 'yes') { ?> checked="checked" <?php } ?>
1560
- name="autoupdate_page_visit_day_wise" id="autoupdate_page1_day_wise" value="yes"> <?php echo __('Yes', 'page-visit-counter'); ?>
1561
  <input type="radio" <?php if ($enable_page_count_day_wise == 'no') { ?> checked="checked" <?php } ?>
1562
- name="autoupdate_page_visit_day_wise" id="autoupdate_page2_day_wise" value="no"><?php echo __('No', 'page-visit-counter'); ?><?php
1563
  } ?>
1564
  </p>
1565
- <p><?php echo __('Do you want to reset all visits count for this page?', 'page-visit-counter'); ?></p>
1566
  <p>
1567
  <input type="radio" name="page_visit_reset" id="page_visit_reset_yes"
1568
- value="yes"><?php echo __('Yes', 'page-visit-counter'); ?>
1569
  <input type="radio" checked="checked" name="page_visit_reset" id="page_visit_reset_yes"
1570
- value="no"><?php echo __('No', 'page-visit-counter'); ?>
1571
  </p>
1572
- <p><?php echo __('Total visits:', 'page-visit-counter'); ?><?php echo esc_attr($total); ?></p>
1573
  <?php
1574
  }
1575
  }
@@ -1867,8 +1748,8 @@ function custom_admin_pointers()
1867
  $version = '1_0'; // replace all periods in 1.0 with an underscore
1868
  $prefix = 'custom_admin_pointers' . $version . '_';
1869
 
1870
- $new_pointer_content = '<h3>' . __('Page Visit Counter') . '</h3>';
1871
- $new_pointer_content .= '<p>' . __('This plugin will count the total visits of your sites pages.') . '</p>';
1872
 
1873
  return array(
1874
  $prefix . 'page_visit_counter_notice_view' => array(
139
  wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false, 1);
140
 
141
  $colorpicker_l10n = array(
142
+ 'clear' => esc_html__('Clear', 'page-visit-counter'),
143
+ 'defaultString' => esc_html__('Default', 'page-visit-counter'),
144
+ 'pick' => esc_html__('Select Color', 'page-visit-counter')
145
  );
146
  if (!empty($colorpicker_l10n) || $colorpicker_l10n != "") {
147
  wp_localize_script('wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n);
162
  } else {
163
  wp_localize_script('one', 'get_post_option', array('optionsarray' => ''));
164
  }
165
+
166
  $fetchSelecetedIpAddress = get_option('ipaddress_visit');
167
  if (!empty($fetchSelecetedIpAddress) || $fetchSelecetedIpAddress != "") {
168
  $optionsIpAddress = !empty($fetchSelecetedIpAddress) ? $fetchSelecetedIpAddress : json_encode(array());
169
  if (!empty($optionsIpAddress) || $optionsIpAddress != "") {
170
+ wp_localize_script('one', 'get_ip_option_arr', array('ipaddressarrayIP' => $optionsIpAddress));
171
  } else {
172
+ wp_localize_script('one', 'get_ip_option_arr', array('ipaddressarrayIP' => 'test12'));
173
  }
174
  } else {
175
+ wp_localize_script('one', 'get_ip_option_arr', array('ipaddressarrayIP' => 'test122'));
176
  }
177
 
178
  $fetchSelecetedUserId = get_option('userlist_visit');
227
  {
228
  ?>
229
  <div class="wrap about-wrap">
230
+ <h1 style="font-size: 2.1em;"><?php printf(esc_html__('Welcome to Page Visit Counter', 'page-visit-counter')); ?></h1>
231
 
232
  <div class="about-text woocommerce-about-text">
233
  <?php
234
  $message = '';
235
+ printf(esc_html__('%s This plugin will count the total visits of your sites pages.', 'page-visit-counter'), $message, $this->version);
236
  ?>
237
+ <img class="version_logo_img" src="<?php echo esc_url(plugin_dir_url(__FILE__) . 'images/page_visit_counter.png'); ?>">
 
238
  </div>
239
 
240
  <?php
242
  "about" => "Overview",
243
  "other_plugins" => "Checkout our other plugins"
244
  ));
245
+ $current_tab_wc = (isset($_GET['tab'])) ? sanitize_text_field(wp_unslash($_GET['tab'])) : 'general';
 
246
  ?>
247
  <h2 id="woo-extra-cost-tab-wrapper" class="nav-tab-wrapper">
248
  <?php
249
  foreach ($setting_tabs_wc as $name => $label) {
250
+ echo '<a href="' . esc_url(home_url('wp-admin/index.php?page=page-visit-counter-about&tab=' . esc_attr($name))) . '" class="nav-tab ' . ($current_tab_wc == $name ? 'nav-tab-active' : '') . '">' . esc_html($label) . '</a>';
251
  }
252
  ?>
253
  </h2>
263
  ?>
264
  <hr/>
265
  <div class="return-to-dashboard">
266
+ <a href="<?php echo esc_url(home_url('/wp-admin/admin.php?page=page_visit_settings')); ?>"><?php esc_html_e('Go to Page Visit Counter Settings', 'page-visit-counter'); ?></a>
267
  </div>
268
  </div>
269
  <?php
277
  {
278
  //do_action('my_own');
279
  $current_user = wp_get_current_user();
 
280
  ?>
281
  <div class="changelog">
 
282
  </br>
283
  <style type="text/css">
284
  p.page_visit_overview {
298
  <div class="changelog about-integrations">
299
  <div class="wc-feature feature-section col three-col">
300
  <div>
301
+ <p class="page_visit_overview"><?php esc_html_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>
302
+ <p class="page_visit_overview"><strong><?php esc_html_e('Page Counter Settings:', 'page-visit-counter');?> </strong></p>
303
  <div class="Page_Counter_Settings_Content_ul">
304
  <ul>
305
+ <li><?php esc_html_e("In these options you can do different setting for page visit counter.", 'page-visit-counter');?></li>
306
+ <li><?php esc_html_e("Short Code: There are two shortcuts that you can use to manually add page view count
307
  to any content on admin or post/page template created by your theme or plugin that's
308
  creating its own display content in a page / post.", 'page-visit-counter');?>
309
  </li>
310
+ <li><?php esc_html_e("Post Type: You can select the post type from the drop down menu for which post views
311
  will be counted. If you leave blank on post type, then all pages or all past type
312
  posts will be counted.", 'page-visit-counter');?>
313
  </li>
314
+ <li><?php esc_html_e("Exclude IPs (Ip Address): Enter the IP addresses which you want to be excluded from
315
  post views count.", 'page-visit-counter');?>
316
  </li>
317
+ <li><?php esc_html_e("Exclude Users: Select users from your project/system to be excluded from post view
318
  count.", 'page-visit-counter');?>
319
  </li>
320
+ <li><?php esc_html_e("Show front view counter: Check the box if you want to display counter view on front
321
  end.", 'page-visit-counter');?>
322
  </li>
323
+ <li><?php esc_html_e("Choose color for the front end view: select color from color picker to choose the
324
  color for display visit pages text on front side as well as in the shortcode.", 'page-visit-counter');?>
325
  </li>
326
  </ul>
327
  </div>
328
 
329
+ <p class="page_visit_overview"><strong><?php esc_html_e("Page Counter Settings:", 'page-visit-counter');?> </strong></p>
330
 
331
  <p class="page_visit_overview"><?php _e("In this option you can see all pages listing within Page ID, Page
332
  Title and Total Count. It will display all pages of your site. If you excluded particular
336
 
337
  <div class="Page_Counter_Settings_Content_ul">
338
  <ul>
339
+ <li><?php esc_html_e('Search facility: This provides you the extra facility to search pages by title and
340
  search page by its crated date.', 'page-visit-counter');?>
341
  </li>
342
+ <li><?php esc_html_e('Sharing facility: This provides you to share specific page on Facebook, Twitter and
343
  Google Plus.', 'page-visit-counter');?>
344
  </li>
345
+ <li><?php esc_html_e('Reports: This provides you the specific page vise reports like Top browsers, Top 10
346
  IP address, Top referer, weekly report and Monthly report using chart.', 'page-visit-counter');?>
347
  </li>
348
  </ul>
355
  </div>
356
  </div>
357
  <?php
358
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
 
360
  /**
361
  * Remove the Extra flate rate menu in dashboard
373
  */
374
  public function page_visit_counter_menu()
375
  {
376
+ add_menu_page(esc_html__('Page-Visit-Counter', 'page-visit-counter'), esc_html__('PageVisitCounter', 'page-visit-counter'), 'manage_options', 'page_visit_counter', 'extra_page_visit_function_custom', plugins_url('page-visit-counter/admin/images/icon.png'));
377
+ add_submenu_page('page_visit_counter', esc_html__('Counter-Settings', 'page-visit-counter'), esc_html__('Settings', 'page-visit-counter'), 'manage_options', 'page_visit_settings', 'custom_page_visit_settings');
378
  /**
379
  * extra_page_visit_function_custom use the menu callback function
380
  * $name pass the arguments
400
 
401
  <div class="main-page-visit set_pvc_containter">
402
  <div class="page-title">
403
+ <h1><?php echo esc_html__('Page Visit Counter', 'page-visit-counter'); ?></h1>
404
  </div>
405
 
406
  <?php
431
  width: 50%;
432
  }
433
  </style>
434
+ <div class="back"><h5><a class="button button-primary" href="<?php echo esc_url(site_url().'/wp-admin/admin.php?page=page_visit_counter');?>">&#x2190;<?php echo esc_html_e('Back to list', 'page-visit-counter'); ?></a></h5></div>
435
  <div style="">
436
  <div id="page-vist-fancybox" class="page-counter-fancybox">
437
  <div id="tabs">
438
  <div id="chartContainer-main">
439
+ <span><?php echo esc_html_e('Top Browsers', 'page-visit-counter'); ?></span>
440
  <div id="chartContainer" style="width: 100%; height: 500px;"></div>
441
  </div>
442
  <div id="chartContainer1-main">
443
+ <span><?php echo esc_html_e('Top 10 IP address', 'page-visit-counter'); ?></span>
444
  <div id="chartContainer1" style="width: 100%; height: 500px;"></div>
445
  </div>
446
  <div id="chartContainer2-main">
447
+ <span><?php echo esc_html_e('Top referer', 'page-visit-counter'); ?></span>
448
  <div id="chartContainer2" style="width: 100%; height: 500px;"></div>
449
  </div>
450
  <div id="chartContainer3-main">
451
+ <span><?php echo esc_html_e('Weekly report', 'page-visit-counter'); ?> </span>
452
  <div id="chartContainer3" style="width: 100%; height: 500px;"></div>
453
  </div>
454
  <div id="chartContainer5-main">
455
+ <span><?php echo esc_html_e('Monthly report', 'page-visit-counter'); ?></span>
456
  <div id="chartContainer5" style="width: 100%; height: 500px;"></div>
457
  </div>
458
  </div>
603
 
604
  };
605
 
606
+ var page_id = <?php echo intval($_REQUEST['id']); ?>;
607
  jQuery.ajax({
608
  type: "POST",
609
  url: pagevisit.ajaxurl,
752
  } else { ?>
753
  <form id="movies-filter" method="get">
754
  <?php
755
+ $test_list_table->search_box('Search','');
756
+ foreach ($_GET as $key => $value) {
757
  if ('s' !== $key) // don't include the search query
758
  {
759
+ // echo("<input type='hidden' name='".esc_attr($key)."' value='".esc_attr($value)."' />");
760
  echo("<input type='hidden' name='$key' value='$value' />");
761
  }
762
  }
822
  $post_list = array();
823
  $post = json_decode(get_option('wfap_post_type'));
824
  $post_list = $post;
 
825
  $text_color_page_visit = get_option('text_color_page_visit');
826
  if (isset($text_color_page_visit) && $text_color_page_visit != null) {
827
  $text_color_page_visit = $text_color_page_visit;
828
  } else {
829
  $text_color_page_visit = '#000000';
830
  }
 
 
 
 
 
831
  ?>
832
  <div class="main-page-visit-settings">
833
  <div class="page-title-settings">
836
  <input type="hidden" name="action" value="submit_form_pvc"/>
837
  <input id="action_which" type="hidden" name="action-which" value="add"/>
838
  <div class="set_pvc_containter set_plugin_descriptions">
839
+ <h3><?php echo esc_html__('Page Counter Settings', 'page-visit-counter'); ?></h3>
840
+ <p><?php echo esc_html__('Page Visit Counter 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.', 'page-visit-counter'); ?></p>
841
  <ul style="list-style-type: disc;padding: 3px 2px 2px 34px;">
842
  <li>
843
+ <p><?php echo esc_html__('Specific page vise reports like Top browsers, Top 10 IP address, Top referer, weekly report and Monthly report using chart.', 'page-visit-counter'); ?></p>
844
  </li>
845
  <li>
846
+ <p><?php echo esc_html__('Search facility: search pages by title and search page by its created date.', 'page-visit-counter'); ?></p>
847
  </li>
848
  <li>
849
+ <p><?php echo esc_html__('Sharing facility: share specific page on Facebook, Twitter and Google Plus.', 'page-visit-counter'); ?></p>
850
  </li>
851
  </ul>
852
  </div>
853
 
854
  <div class="set_pvc_containter set_plugin_descriptions_shortcode">
855
  <fieldset>
856
+ <legend><?php echo esc_html__('Short Code', 'page-visit-counter'); ?></legend>
857
+ <p><?php echo esc_html__('There are two shortcodes 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 thats create it\'s own display content in page/post.', 'page-visit-counter'); ?></p>
858
+ <p><?php echo esc_html__('Use this shortcode to add admin side content on page/post:', 'page-visit-counter'); ?>
859
  <b><?php echo __(htmlspecialchars('[page_visit_counter_md id="<page_id/post_id>"]'), 'page-visit-counter'); ?></b>
860
  </p>
861
+ <p><?php echo esc_html__('Use this shortcode to display total sites visit to add admin side content on page/post:', 'page-visit-counter'); ?>
862
  <b><?php echo __(htmlspecialchars('[page_visit_counter_md_total_sites_visit backgroundcolor="#ff0000" countboxcolor="#000000" fontcolor="#FFFFFF" bordercolor="#ff0000"]'), 'page-visit-counter'); ?></b>
863
  </p>
864
+ <p><?php echo esc_html__('Use this shortcode to add page/post template (.php) file of your own template:', 'page-visit-counter'); ?>
865
  <b> <?php echo "&lt;?php echo do_shortcode('[page_visit_counter_md id='page_id/post_id']');?&gt;" ?></b>
866
  </p>
867
+ <p><?php echo esc_html__('Use this shortcode to display total sites visit to add page/post template (.php) file of your own template:', 'page-visit-counter'); ?>
868
  <br><b> &lt;?php echo do_shortcode('[page_visit_counter_md_total_sites_visit
869
  backgroundcolor='#ff0000' countboxcolor='#000000' fontcolor='#FFFFFF'
870
  bordercolor='#ff0000']');?&gt; </b></p>
873
 
874
  <div class="set_pvc_containter set_plugin_descriptions">
875
  <fieldset>
876
+ <legend><?php echo esc_html__('Basic Configuration settings', 'page-visit-counter'); ?></legend>
877
  <?php
878
  $get_option_value = json_decode(get_option('page_count_settings'));
879
  $input_values = isset($get_option_value[1]) ? $get_option_value[1] : array();
882
  <table border="0" cellpadding="10" cellspacing="0">
883
  <tbody>
884
  <tr>
885
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Post Type', 'page-visit-counter'); ?></label>
886
  </th>
887
  <td>
888
+ <select id="post_type" data-placeholder=" <?php echo esc_html__('Add Page/Post Type', 'page-visit-counter'); ?>" name="post_ty[]" multiple="true" class="chosen-select-post category-select chosen-rtl validate_field1">
889
  <option value=""></option>
890
  <?php
891
  if (isset($post_types) && !empty($post_types)) {
892
  foreach ($post_types as $cpost) {
893
  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") { ?>
894
+ <option value="<?php echo esc_attr($cpost); ?>"><?php echo esc_attr($cpost); ?></option><?php
 
895
  }
896
  }
897
  } ?>
898
  </select>
899
+ <p><?php echo esc_html__('(Select post types for which post views will be counted.)', 'page-visit-counter'); ?></p>
900
  </td>
901
  </tr>
902
 
903
  <tr class="ipaddress">
904
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Exclude IPs (Ip Address)', 'page-visit-counter'); ?></label>
905
  </th>
906
  <td>
907
+ <select id="ip_address" data-placeholder=" <?php echo esc_html__('Add IP Address in comma seprated', 'page-visit-counter'); ?>" name="ip-basic[]" multiple="true" class="chosen-select-ip category-select chosen-rtl validate_field1">
908
  <option value=""></option><?php
909
  $get_option_value_ip = json_decode(get_option('ipaddress_visit'));
910
+ echo '<pre>';
911
+ print_r($get_option_value_ip);
912
+ echo '</pre>';
913
  if (isset($get_option_value_ip) && !empty($get_option_value_ip)) {
914
  foreach ($get_option_value_ip as $ip) { ?>
915
+ <option value="<?php echo esc_attr($ip); ?>"><?php echo esc_attr($ip); ?></option><?php
 
916
  }
917
  } ?>
918
  </select>
919
+ <p><?php echo esc_html__('(Enter the IP addresses to be excluded from post views count.)', 'page-visit-counter'); ?></p>
920
  </td>
921
  </tr>
922
 
923
  <tr class="users">
924
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Exclude Users', 'page-visit-counter'); ?></label>
925
  </th>
926
  <td>
927
+ <select id="users_list" data-placeholder="<?php echo esc_html__('Select Registerd Users', 'page-visit-counter'); ?>" name="user-basic[]" multiple="true" class="chosen-select category-select chosen-rtl validate_field1">
928
  <option value=""></option><?php
929
  $query = "SELECT * FROM $wpdb->users";
930
  $resultSetsArr = $wpdb->get_results($query);
931
  if (isset($resultSetsArr) && !empty($resultSetsArr)) {
932
  foreach ($resultSetsArr as $value) { ?>
933
+ <option value="<?php echo esc_attr($value->ID); ?>"><?php echo esc_attr($value->user_email); ?></option>
934
+ <?php
935
  }
936
  } ?>
937
  </select>
938
+ <p><?php echo esc_html__('(Select the users to be excluded from post views count.)', 'page-visit-counter'); ?></p>
939
  </td>
940
  </tr>
941
 
942
  <tr class="hidefront">
943
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Show front view counter', 'page-visit-counter'); ?></label>
944
  </th>
945
  <?php
946
  $hide_show_option = get_option('counter_hide_show_front_vew');
950
  $cheked = '';
951
  } ?>
952
  <td class="information">
953
+ <input type="checkbox" name="hidefrontview" id="hide_front_view" <?php echo esc_attr($cheked); ?>><?php echo esc_html__('Check the box if you want to display counter view on front end.', 'page-visit-counter'); ?>
954
  </td>
955
  </tr>
956
 
957
  <tr class="hidefront" style="display:none;">
958
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Last How many days count you want to display on front end.', 'page-visit-counter'); ?></label>
959
  </th>
960
  <td class="information">
961
  <?php
964
  $get_no_of_days = '';
965
  }
966
  ?>
967
+ <input type="text" name="no_of_days_to_display" id="no_of_days_to_display" value="<?php echo esc_attr($get_no_of_days); ?>">
968
  </td>
969
  </tr>
970
 
971
  <tr class="">
972
+ <th scope="row"><label for="blogname"><?php echo esc_html__('Choose color for the front end view', 'page-visit-counter'); ?></label>
973
  </th>
974
  <td class="information">
975
+ <input id="text_color_page_visit" type="text" name="textcolor" value="<?php echo esc_attr($text_color_page_visit); ?>" class="my-color-field" data-default-color="<?php echo esc_attr($text_color_page_visit); ?>"/>
976
  </td>
977
  </tr>
978
  </tbody>
980
  </fieldset>
981
  </div>
982
  <p class="submit">
983
+ <input type="submit" name="submit" class="button button-primary" value="<?php echo esc_html__('Save Changes', 'page-visit-counter'); ?>">
984
+ <input type="submit" id="pvc_reset_settings" value="<?php echo esc_html__('Reset all settings', 'page-visit-counter'); ?>" class="button button-primary">
985
+ <input type="submit" id="pvc_reset_counter" value="<?php echo esc_html__('Reset all pages counts & report ', 'page-visit-counter'); ?>" class="button button-primary">
986
  </p>
987
  </form>
988
  </div>
991
  }
992
  }
993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994
  /**
995
  * function create dashboad widget.
996
  * view most visited page in dashboard.
999
  function my_custom_dashboard_widgets()
1000
  {
1001
  global $wp_meta_boxes;
1002
+ wp_add_dashboard_widget('custom_help_widget', esc_html__('Most Visited Page', 'page-visit-counter'), 'custom_dashboard_help');
1003
  function custom_dashboard_help()
1004
  {
1005
  global $wpdb;
1012
  if (!empty($count_visit) && isset($count_visit)) {
1013
  $html .= '<table border="0" cellpadding="5" cellspacing="10">';
1014
  $html .= '<tr>';
1015
+ $html .= '<th>' . esc_html__('Page id', 'page-visit-counter') . '</th>';
1016
+ $html .= '<th>' . esc_html__('Page Name', 'page-visit-counter') . '</th>';
1017
+ $html .= '<th>' . esc_html__('Total Count', 'page-visit-counter') . '</th>';
1018
  $html .= '</tr>';
1019
 
1020
  foreach ($count_visit as $visitpage) {
1028
  }
1029
  $html .= '</table>';
1030
  } else {
1031
+ $html .= esc_html__('No Page Found.', 'page-visit-counter');
1032
  }
1033
  $html .= '</div>';
1034
  echo $html;
1053
  if (!isset($_POST['pvc_setting']) || !wp_verify_nonce($_POST['pvc_setting'], basename(__FILE__))) {
1054
  die('Failed security check');
1055
  }
1056
+
1057
+ $type = isset($_POST['post_ty']) ? array_map('sanitize_text_field', $_POST['post_ty']) : array();
1058
+ $ipAddress = isset($_POST['ip-basic']) ? array_map('sanitize_text_field', $_POST['ip-basic']) : array();
1059
+ $userList = isset($_POST['user-basic']) ? array_map('sanitize_text_field', $_POST['user-basic']) : array();
1060
+ $hidefrontview = isset($_POST['hidefrontview']) ? sanitize_text_field(wp_unslash($_POST['hidefrontview'])) : '';
1061
+ $text_color_page_visit = isset($_POST['textcolor']) ? sanitize_text_field(wp_unslash($_POST['textcolor'])) : '';
1062
 
1063
  $twitter_url_page_visit = isset($_POST['twitter_url_page_visit']) ? $_POST['twitter_url_page_visit'] : '';
1064
  $gplus_url_page_visit = isset($_POST['gplus_url_page_visit']) ? $_POST['gplus_url_page_visit'] : '';
1152
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1153
  <thead>
1154
  <tr>
1155
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1156
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1157
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1158
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1159
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1160
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1161
  </tr>
1162
  </thead>
1163
  <tbody>';
1185
  $html .= '<td>' . esc_attr($counter) . '</td>';
1186
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1187
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1188
+ $html .= '<td><a href="' . esc_url($edit_url) . '">' . wp_kses_post($results->post_title) . '</a></td>';
1189
  $sel_qry = $wpdb->prepare('SELECT SUM(page_visit) as page_visit from ' . $table_name . ' where page_id=%d', $results->ID);
1190
  $count_visit = $wpdb->get_results($sel_qry);
1191
  $count = 0;
1206
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1207
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1208
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1209
+ $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID) . '" title="' . wp_kses_post($results->post_title) . '" class="" id="' . esc_attr($results->ID) . '">' . esc_html__('View Report', 'page-visit-counter') . '</a></td>';
1210
  $html .= '</tr>';
1211
  }
1212
  }
1213
  $html .= '</tbody>
1214
  <tfoot><tr>
1215
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1216
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1217
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1218
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1219
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1220
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1221
  </tr></tfoot></table>';
1222
  echo $html;
1223
  } else {
1244
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1245
  <thead>
1246
  <tr>
1247
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1248
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1249
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1250
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1251
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1252
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1253
  </tr></thead><tbody>';
1254
  $counter = 0;
1255
  foreach ($notvisit as $results) {
1258
  $html .= '<td>' . esc_attr($counter) . '</td>';
1259
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1260
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1261
+ $html .= '<td><a href="' . esc_url($edit_url) . '">' . wp_kses_post($results->post_title) . '</a></td>';
1262
  $html .= '<td> 0 </td>';
1263
  $site_title = get_bloginfo('name');
1264
  $page_social_content = $results->post_title . ' - Total Visits 0 - ' . $site_title;
1267
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1268
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1269
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1270
+ $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID) . '" title="' . wp_kses_post($results->post_title) . '" class="" id="' . esc_attr($results->ID) . '">' . esc_html__('View Report', 'page-visit-counter') . '</a></td>';
1271
  $html .= '</tr>';
1272
  }
1273
  $html .= '</tbody><tfoot>
1274
  <tr>
1275
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1276
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1277
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1278
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1279
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1280
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1281
  </tr></tfoot></table>';
1282
  echo $html;
1283
  } else if ($dataquery != '') {
1284
  $html .= '<table id="example" class="display" cellpadding="0" cellspacing="0">
1285
  <thead>
1286
  <tr>
1287
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1288
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1289
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1290
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1291
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1292
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1293
  </tr></thead><tbody>';
1294
  $counter = 0;
1295
  foreach ($dataquery as $results) {
1298
  $html .= '<td>' . esc_attr($counter) . '</td>';
1299
  $html .= '<td>' . esc_attr($results->ID) . '</td>';
1300
  $edit_url = get_admin_url() . 'post.php?post=' . esc_attr($results->ID) . '&action=edit';
1301
+ $html .= '<td><a href="' . esc_url($edit_url) . '">' . esc_html__($results->post_title, 'page-visit-counter') . '</a></td>';
1302
  $str = '';
1303
  if ($page_title != '') {
1304
  if ($page_date != '') {
1338
  <a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Facebook.png', dirname(__FILE__))) . '" /></a>
1339
  <a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text=' . $page_social_content . '&url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/twitter.png', dirname(__FILE__))) . '" /></a>
1340
  <a target="_blank" href="https://plus.google.com/share?url=' . esc_url(get_permalink($results->ID)) . '"><img src="' . esc_url(plugins_url('images/Google_Plus.png', dirname(__FILE__))) . '" /></a></td>';
1341
+ $html .= '<td><a href="' . esc_url(site_url() . '/wp-admin/admin.php?page=page_visit_counter&id=' . $results->ID). '" title="' . wp_kses_post($results->post_title) . '" class="" id="' . esc_attr($results->ID) . '">' . esc_html__('View Report', 'page-visit-counter') . '</a></td>';
1342
 
1343
  $html .= '</tr>';
1344
  }
1345
  $html .= '</tbody><tfoot>
1346
  <tr>
1347
+ <th width="10%">' . esc_html__('No', 'page-visit-counter') . '</th>
1348
+ <th width="10%">' . esc_html__('Page ID', 'page-visit-counter') . '</th>
1349
+ <th>' . esc_html__('Page Title', 'page-visit-counter') . '</th>
1350
+ <th width="20%">' . esc_html__('Total Count', 'page-visit-counter') . '</th>
1351
+ <th width="20%">' . esc_html__('Share', 'page-visit-counter') . '</th>
1352
+ <th width="10%">' . esc_html__('Report', 'page-visit-counter') . '</th>
1353
  </tr></tfoot</table>';
1354
  echo $html;
1355
  }
1384
  {
1385
 
1386
  return array_merge($columns,
1387
+ array('page_visit_count' => esc_html__('Total Visits', 'page-visit-counter')));
1388
 
1389
 
1390
  }
1417
  $total = (int)$pageCount[0]->total;
1418
  ?>
1419
  <input name="pageidvisit" type="hidden" value="<?php echo $post_id; ?>">
1420
+ <p><?php echo esc_html__('Do you want to enable page visits count for this page?', 'page-visit-counter'); ?></p>
1421
  <p>
1422
  <?php if ($enable_page_count == '') { ?>
1423
  <input type="radio" checked="checked" name="autoupdate_page_visit" id="autoupdate_page1"
1424
+ value="yes"><?php echo esc_html__('Yes', 'page-visit-counter'); ?>
1425
  <input type="radio" name="autoupdate_page_visit" id="autoupdate_page2"
1426
+ value="no"><?php echo esc_html__('No', 'page-visit-counter'); ?>
1427
  <?php } else { ?>
1428
  <input type="radio" <?php if ($enable_page_count == 'yes') { ?> checked="checked" <?php } ?>
1429
+ name="autoupdate_page_visit" id="autoupdate_page1" value="yes"> <?php echo esc_html__('Yes', 'page-visit-counter'); ?>
1430
  <input type="radio" <?php if ($enable_page_count == 'no') { ?> checked="checked" <?php } ?>
1431
+ name="autoupdate_page_visit" id="autoupdate_page2" value="no"> <?php echo esc_html__('No', 'page-visit-counter'); ?><?php
1432
  } ?>
1433
  </p>
1434
+ <p><?php echo esc_html__('Do you want to display today page visits count for this page?', 'page-visit-counter'); ?></p>
1435
  <p>
1436
  <?php if ($enable_page_count_day_wise == '') { ?>
1437
+ <input type="radio" checked="checked" name="autoupdate_page_visit_day_wise" id="autoupdate_page1_day_wise" value="yes"><?php echo esc_html__('Yes', 'page-visit-counter'); ?>
1438
+ <input type="radio" name="autoupdate_page_visit_day_wise" id="autoupdate_page2_day_wise" value="no"><?php echo esc_html__('No', 'page-visit-counter'); ?>
1439
  <?php } else { ?>
1440
  <input type="radio" <?php if ($enable_page_count_day_wise == 'yes') { ?> checked="checked" <?php } ?>
1441
+ name="autoupdate_page_visit_day_wise" id="autoupdate_page1_day_wise" value="yes"> <?php echo esc_html__('Yes', 'page-visit-counter'); ?>
1442
  <input type="radio" <?php if ($enable_page_count_day_wise == 'no') { ?> checked="checked" <?php } ?>
1443
+ name="autoupdate_page_visit_day_wise" id="autoupdate_page2_day_wise" value="no"><?php echo esc_html__('No', 'page-visit-counter'); ?><?php
1444
  } ?>
1445
  </p>
1446
+ <p><?php echo esc_html__('Do you want to reset all visits count for this page?', 'page-visit-counter'); ?></p>
1447
  <p>
1448
  <input type="radio" name="page_visit_reset" id="page_visit_reset_yes"
1449
+ value="yes"><?php echo esc_html__('Yes', 'page-visit-counter'); ?>
1450
  <input type="radio" checked="checked" name="page_visit_reset" id="page_visit_reset_yes"
1451
+ value="no"><?php echo esc_html__('No', 'page-visit-counter'); ?>
1452
  </p>
1453
+ <p><?php echo esc_html__('Total visits:', 'page-visit-counter'); ?><?php echo esc_attr($total); ?></p>
1454
  <?php
1455
  }
1456
  }
1748
  $version = '1_0'; // replace all periods in 1.0 with an underscore
1749
  $prefix = 'custom_admin_pointers' . $version . '_';
1750
 
1751
+ $new_pointer_content = '<h3>' . esc_html__('Page Visit Counter') . '</h3>';
1752
+ $new_pointer_content .= '<p>' . esc_html__('This plugin will count the total visits of your sites pages.') . '</p>';
1753
 
1754
  return array(
1755
  $prefix . 'page_visit_counter_notice_view' => array(
admin/js/custom.js CHANGED
@@ -1,56 +1,6 @@
1
  (function($) {
2
  $(window).load(function() {
3
-
4
- jQuery("#pvcp_dialog").dialog({
5
- modal: true, title: 'Subscribe Now', zIndex: 10000, autoOpen: true,
6
- width: '500', resizable: false,
7
- position: {my: "center", at: "center", of: window},
8
- dialogClass: 'dialogButtons',
9
- buttons: {
10
- Yes: function() {
11
- // $(obj).removeAttr('onclick');
12
- // $(obj).parents('.Parent').remove();
13
- var email_id = jQuery('#txt_user_sub_pvcp').val();
14
-
15
- var data = {
16
- 'action': 'add_plugin_user_pvcp',
17
- 'email_id': email_id
18
- };
19
-
20
- // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
21
- jQuery.post(ajaxurl, data, function(response) {
22
- jQuery('#pvcp_dialog').html('<h2>You have been successfully subscribed');
23
- jQuery(".ui-dialog-buttonpane").remove();
24
- });
25
-
26
-
27
- },
28
- No: function() {
29
- var email_id = jQuery('#txt_user_sub_pvcp').val();
30
-
31
- var data = {
32
- 'action': 'hide_subscribe_pvcp',
33
- 'email_id': email_id
34
- };
35
-
36
- // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
37
- jQuery.post(ajaxurl, data, function(response) {
38
-
39
- });
40
-
41
- jQuery(this).dialog("close");
42
-
43
- }
44
- },
45
- close: function(event, ui) {
46
- jQuery(this).remove();
47
- }
48
- });
49
- jQuery("div.dialogButtons .ui-dialog-buttonset button").removeClass('ui-state-default');
50
- jQuery("div.dialogButtons .ui-dialog-buttonset button").addClass("button-primary woocommerce-save-button");
51
- jQuery("div.dialogButtons .ui-dialog-buttonpane .ui-button").css("width", "80px");
52
-
53
-
54
  $('#MyDate').datepicker({dateFormat: 'yy-mm-dd'});
55
  $('#example').DataTable({
56
  "iDisplayLength": 10,
@@ -128,9 +78,9 @@
128
  });
129
  }
130
  }
131
- var get_ip_option_data = get_ip_option.ipaddressarray;
132
  if (get_ip_option_data != '') {
133
- var selectedIpArray = JSON.parse(get_ip_option.ipaddressarray);
134
  var selectedIpglobalarr = [];
135
  for (var i in selectedIpArray) {
136
  selectedIpglobalarr.push(selectedIpArray[i]);
@@ -195,12 +145,7 @@
195
  for (var selectorpost in configpost) {
196
  $(selectorpost).chosen(configpost[selectorpost]);
197
  }
198
-
199
-
200
-
201
-
202
-
203
-
204
  $('body').on('keyup', '#ip_address_chosen ul.chosen-choices li.search-field input', function(evt) {
205
  var c = evt.keyCode;
206
 
1
  (function($) {
2
  $(window).load(function() {
3
+ 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  $('#MyDate').datepicker({dateFormat: 'yy-mm-dd'});
5
  $('#example').DataTable({
6
  "iDisplayLength": 10,
78
  });
79
  }
80
  }
81
+ var get_ip_option_data = get_ip_option_arr.ipaddressarrayIP;
82
  if (get_ip_option_data != '') {
83
+ var selectedIpArray = JSON.parse(get_ip_option_arr.ipaddressarrayIP);
84
  var selectedIpglobalarr = [];
85
  for (var i in selectedIpArray) {
86
  selectedIpglobalarr.push(selectedIpArray[i]);
145
  for (var selectorpost in configpost) {
146
  $(selectorpost).chosen(configpost[selectorpost]);
147
  }
148
+
 
 
 
 
 
149
  $('body').on('keyup', '#ip_address_chosen ul.chosen-choices li.search-field input', function(evt) {
150
  var c = evt.keyCode;
151
 
includes/class-page-visit-counter.php CHANGED
@@ -156,7 +156,6 @@ class page_visit_counter {
156
  //admin menu intilization hooks
157
  $this->loader->add_action('admin_menu', $plugin_admin, 'welcome_pages_screen_page_visit_counter');
158
 
159
- $this->loader->add_action('page_visit_counter_other_plugins', $plugin_admin, 'page_visit_counter_other_plugins');
160
  $this->loader->add_action('page_visit_counter_about', $plugin_admin, 'page_visit_counter_about');
161
 
162
  $this->loader->add_action('admin_print_footer_scripts', $plugin_admin, 'custom_admin_pointers_footer');
156
  //admin menu intilization hooks
157
  $this->loader->add_action('admin_menu', $plugin_admin, 'welcome_pages_screen_page_visit_counter');
158
 
 
159
  $this->loader->add_action('page_visit_counter_about', $plugin_admin, 'page_visit_counter_about');
160
 
161
  $this->loader->add_action('admin_print_footer_scripts', $plugin_admin, 'custom_admin_pointers_footer');
includes/class-tt-pvc-list-table.php CHANGED
@@ -162,7 +162,8 @@ class TT_Example_List_Table extends WP_List_Table {
162
  foreach ($result as $results) {
163
  $counter = $counter + 1;
164
 
165
- $pageCount = $wpdb->get_results("SELECT SUM(page_visit) as total FROM $table_name WHERE `page_id` = $results->ID");
 
166
 
167
  $total = (int) $pageCount[0]->total;
168
  $site_title = get_bloginfo( 'name' );
@@ -170,10 +171,10 @@ class TT_Example_List_Table extends WP_List_Table {
170
 
171
  $data[] = array(
172
  'id' => $results->ID,
173
- 'title' => '<a href="'.get_admin_url().'post.php?post='.$results->ID.'&action=edit">'.__($results->post_title,'page-visit-counter').'</a>',
174
  'count' => $total,
175
- 'share' => '<a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u='.esc_url( get_permalink($results->ID) ).'"><img src="' . plugins_url( 'images/Facebook.png', dirname(__FILE__) ) . '" /></a><a target="_blank" style="margin-right: 5px;" href="https://twitter.com/intent/tweet?text='.$page_social_content.'&url='.esc_url( get_permalink($results->ID) ).'"><img src="' . plugins_url( 'images/twitter.png', dirname(__FILE__) ) . '" /></a><a target="_blank" href="https://plus.google.com/share?url='.esc_url( get_permalink($results->ID) ).'"><img src="' . plugins_url( 'images/Google_Plus.png', dirname(__FILE__) ) . '" /></a>',
176
- 'report' => '<a href="'.site_url().'/wp-admin/admin.php?page=page_visit_counter&id='.$results->ID.'" title="'.__($results->post_title,'page-visit-counter').'" class="" id="'.$results->ID.'">'.__('View Report','page-visit-counter').'</a>'
177
  );
178
  }
179
  }
162
  foreach ($result as $results) {
163
  $counter = $counter + 1;
164
 
165
+ $pageCount_qry = $wpdb->prepare('SELECT SUM(page_visit) as total FROM ' . $table_name . ' WHERE page_id=%d', $results->ID);
166
+ $pageCount = $wpdb->get_results($pageCount_qry);
167
 
168
  $total = (int) $pageCount[0]->total;
169
  $site_title = get_bloginfo( 'name' );
171
 
172
  $data[] = array(
173
  'id' => $results->ID,
174
+ 'title' => '<a href="'.esc_url(get_admin_url().'post.php?post='.$results->ID.'&action=edit').'">'.wp_kses_post($results->post_title).'</a>',
175
  'count' => $total,
176
+ 'share' => '<a target="_blank" style="margin-right: 5px;" href="https://www.facebook.com/sharer/sharer.php?u='.esc_url( get_permalink($results->ID) ).'"><img src="' . esc_url(plugins_url( 'images/Facebook.png', dirname(__FILE__) )) . '" /></a><a target="_blank" style="margin-right: 5px;" href="'.esc_url('https://twitter.com/intent/tweet?text='.$page_social_content.'&url='.esc_url( get_permalink($results->ID) )).'"><img src="' . esc_url(plugins_url( 'images/twitter.png', dirname(__FILE__) )) . '" /></a><a target="_blank" href="https://plus.google.com/share?url='.esc_url( get_permalink($results->ID) ).'"><img src="' . esc_url(plugins_url( 'images/Google_Plus.png', dirname(__FILE__) )) . '" /></a>',
177
+ 'report' => '<a href="'.esc_url(site_url().'/wp-admin/admin.php?page=page_visit_counter&id='.$results->ID).'" title="'.wp_kses_post($results->post_title).'" class="" id="'.esc_attr($results->ID).'">'.esc_html__('View Report','page-visit-counter').'</a>'
178
  );
179
  }
180
  }
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.8
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.9
11
  * Author URI: http://www.multidots.com/
12
  */
13
  // If this file is called directly, abort.
public/class-page-visit-counter-public.php CHANGED
@@ -92,7 +92,6 @@ class page_visit_counter_Public {
92
  public function insert_page_visit_counter() {
93
  global $wpdb, $wp, $post, $wp_query;
94
 
95
- //$pageurl = $_POST['pageurl'];
96
  $flag = 0;
97
  // Check the site running on HTTPS. If the site running on HTTPS then we are removing S from HTTPS
98
  if (is_ssl()) {
@@ -101,7 +100,7 @@ class page_visit_counter_Public {
101
  $page = 0;
102
  $flag = 1;
103
  } else {
104
- $page = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',$actual_link));
105
  }
106
  } else {
107
  $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
@@ -109,7 +108,7 @@ class page_visit_counter_Public {
109
  $page = 0;
110
  $flag = 1;
111
  } else {
112
- $page = url_to_postid( $actual_link );
113
  }
114
  }
115
  $pageID = $page;
@@ -190,7 +189,9 @@ class page_visit_counter_Public {
190
  $fetchSelecetedUserId = get_option('userlist_visit');
191
  $optionsUserIdDecodedArr = !empty( $fetchSelecetedUserId ) ? $fetchSelecetedUserId : json_encode( array() );
192
 
193
- $pageCount = $wpdb->get_results("SELECT * from $table_name where page_id=$page AND ipaddress = '$ipaddress' AND date = '$currentdate' LIMIT 1");
 
 
194
 
195
  $getPageSetting = get_post_meta($page,'enable_page_count',true);
196
 
@@ -366,7 +367,7 @@ class page_visit_counter_Public {
366
  public function display_page_visit_counter_ajax() {
367
  global $wpdb, $wp, $post;
368
 
369
- $pageurl = $_POST['pageurl'];
370
 
371
  if (is_ssl()) {
372
  $pageID = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',$pageurl));
@@ -457,9 +458,9 @@ class page_visit_counter_Public {
457
  if(!is_feed() && !is_home()) {
458
  if ($fetchSelecetedPostTypes == '' || $fetchSelecetedPostTypes == null) {
459
  if ('yes' === $enableToday || '' === $enableToday) {
460
- $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.$text_color_page_visit.'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.$total.'</span>'.__('total visits,','page-visit-counter').'<span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor_today">'.$totalToday.'</span>'.__('visits today','page-visit-counter').'</p>';
461
  } else {
462
- $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.$text_color_page_visit.'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.$total.'</span>'.__('total visits.','page-visit-counter').'</p>';
463
  }
464
  } else {
465
  $postTypeSelectedEncodeArr = json_decode($fetchSelecetedPostTypes);
@@ -467,9 +468,9 @@ class page_visit_counter_Public {
467
  $innerSettings = get_post_meta($pageID,'enable_page_count',true);
468
  if ($innerSettings == '' || $innerSettings == 'yes') {
469
  if ('yes' === $enableToday || '' === $enableToday) {
470
- $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.$text_color_page_visit.'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.$total.'</span>'.__('total visits,','page-visit-counter').'<span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor_today">'.$totalToday.'</span>'.__('visits today','page-visit-counter').'</p>';
471
  } else {
472
- $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.$text_color_page_visit.'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.$total.'</span>'.__('total visits.','page-visit-counter').'</p>';
473
  }
474
  }
475
  }
@@ -477,9 +478,9 @@ class page_visit_counter_Public {
477
  }
478
  }
479
 
480
- echo $content.' '.$html;
481
  } else {
482
- echo $content;
483
  }
484
 
485
  }
@@ -489,10 +490,10 @@ class page_visit_counter_Public {
489
 
490
  if (is_ssl()) {
491
  $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
492
- $pageID = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',$actual_link));
493
  } else {
494
  $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
495
- $pageID = url_to_postid( $actual_link );
496
  }
497
 
498
  if (($_SERVER['REQUEST_URI'] == '/shop/' || strpos($_SERVER['REQUEST_URI'], '/shop/') !== false ) && $pageID == 0) {
@@ -507,7 +508,7 @@ class page_visit_counter_Public {
507
  $text_color_page_visit = get_option('text_color_page_visit');
508
 
509
  if (isset($text_color_page_visit) && $text_color_page_visit != null) {
510
- $text_color_page_visit = 'style="color: '.$text_color_page_visit.';"';
511
  } else {
512
  $text_color_page_visit = 'style="color: #000000;"';
513
  }
92
  public function insert_page_visit_counter() {
93
  global $wpdb, $wp, $post, $wp_query;
94
 
 
95
  $flag = 0;
96
  // Check the site running on HTTPS. If the site running on HTTPS then we are removing S from HTTPS
97
  if (is_ssl()) {
100
  $page = 0;
101
  $flag = 1;
102
  } else {
103
+ $page = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',esc_url($actual_link)));
104
  }
105
  } else {
106
  $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
108
  $page = 0;
109
  $flag = 1;
110
  } else {
111
+ $page = url_to_postid( esc_url($actual_link) );
112
  }
113
  }
114
  $pageID = $page;
189
  $fetchSelecetedUserId = get_option('userlist_visit');
190
  $optionsUserIdDecodedArr = !empty( $fetchSelecetedUserId ) ? $fetchSelecetedUserId : json_encode( array() );
191
 
192
+ $pageCount_limit = intval(1);
193
+ $pageCount_qry = $wpdb->prepare('SELECT * FROM ' . $table_name . ' WHERE page_id=%d AND ipaddress=%s AND date=%s LIMIT %d', $page, $ipaddress, $currentdate, $pageCount_limit);
194
+ $pageCount = $wpdb->get_results($pageCount_qry);
195
 
196
  $getPageSetting = get_post_meta($page,'enable_page_count',true);
197
 
367
  public function display_page_visit_counter_ajax() {
368
  global $wpdb, $wp, $post;
369
 
370
+ $pageurl = sanitize_text_field(wp_unslash($_POST['pageurl']));
371
 
372
  if (is_ssl()) {
373
  $pageID = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',$pageurl));
458
  if(!is_feed() && !is_home()) {
459
  if ($fetchSelecetedPostTypes == '' || $fetchSelecetedPostTypes == null) {
460
  if ('yes' === $enableToday || '' === $enableToday) {
461
+ $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.esc_attr($text_color_page_visit).'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.esc_attr($total).'</span>'.__('total visits,','page-visit-counter').'<span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor_today">'.esc_attr($totalToday).'</span>'.__('visits today','page-visit-counter').'</p>';
462
  } else {
463
+ $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.esc_attr($text_color_page_visit).'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.esc_attr($total).'</span>'.__('total visits.','page-visit-counter').'</p>';
464
  }
465
  } else {
466
  $postTypeSelectedEncodeArr = json_decode($fetchSelecetedPostTypes);
468
  $innerSettings = get_post_meta($pageID,'enable_page_count',true);
469
  if ($innerSettings == '' || $innerSettings == 'yes') {
470
  if ('yes' === $enableToday || '' === $enableToday) {
471
+ $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.esc_attr($text_color_page_visit).'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.esc_attr($total).'</span>'.__('total visits,','page-visit-counter').'<span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor_today">'.esc_attr($totalToday).'</span>'.__('visits today','page-visit-counter').'</p>';
472
  } else {
473
+ $html .= '<p id="default-loop-page-visit-counter" class="page-visit-counter-block" '.esc_attr($text_color_page_visit).'><img src="'.esc_url(site_url().'/wp-content/plugins/page-visit-counter/images/1456175371_vector_65_14.png').'" /><span style="margin-left: 5px;margin-right: 5px;" class="page_amount_visitor">'.esc_attr($total).'</span>'.__('total visits.','page-visit-counter').'</p>';
474
  }
475
  }
476
  }
478
  }
479
  }
480
 
481
+ echo $content.' '.$html; // WPCS: XSS OK.
482
  } else {
483
+ echo $content; // WPCS: XSS OK.
484
  }
485
 
486
  }
490
 
491
  if (is_ssl()) {
492
  $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
493
+ $pageID = url_to_postid(preg_replace('/^https(?=:\/\/)/i','http',esc_url($actual_link)));
494
  } else {
495
  $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
496
+ $pageID = url_to_postid( esc_url($actual_link) );
497
  }
498
 
499
  if (($_SERVER['REQUEST_URI'] == '/shop/' || strpos($_SERVER['REQUEST_URI'], '/shop/') !== false ) && $pageID == 0) {
508
  $text_color_page_visit = get_option('text_color_page_visit');
509
 
510
  if (isset($text_color_page_visit) && $text_color_page_visit != null) {
511
+ $text_color_page_visit = 'style="color: '.esc_attr($text_color_page_visit).';"';
512
  } else {
513
  $text_color_page_visit = 'style="color: #000000;"';
514
  }