Version Description
- 20-11-2019 =
- Compatible with WooCommerce 3.9.x
Download this release
Release Info
Developer | dots |
Plugin | Page Visit Counter |
Version | 6.0.3 |
Comparing to | |
See all releases |
Code changes from version 6.0.2 to 6.0.3
- README.txt +21 -67
- admin/class-page-visit-counter-admin.php +4 -4
- admin/partials/header/plugin-header.php +123 -123
- admin/partials/pvcp-add-new-page.php +74 -74
- admin/partials/pvcp-get-started-page.php +73 -73
- admin/partials/pvcp-plugin-dashboard-page.php +140 -140
- admin/partials/pvcp-plugin-dashboard-post.php +140 -140
- admin/partials/pvcp-plugin-dashboard.php +237 -237
- admin/partials/pvcp-plugin-settings.php +129 -129
- admin/partials/pvcp-wizard-list-page.php +110 -110
- admin/partials/pvcp-wizard-setting.php +105 -105
- assets/images/ajax-loader.gif +0 -0
- assets/images/background_img.jpg +0 -0
- assets/images/bk_ +0 -0
- assets/images/loader.svg +9 -0
- freemius/assets/img/woocommerce-conditional-discount-rules-for-checkout.png +0 -0
- includes/class-page-visit-counter-activator.php +2 -2
- includes/class-page-visit-counter-constant.php +43 -43
- includes/class-page-visit-counter.php +8 -2
- page-visit-counter.php +4 -3
- public/class-page-visit-counter-public.php +13 -13
README.txt
CHANGED
@@ -4,7 +4,8 @@ Plugin URI: https://www.thedotstore.com/
|
|
4 |
Author: Thedotstore
|
5 |
Author URI: https://www.thedotstore.com/
|
6 |
Contributors: dots, ketuchetan, chiragpatel, jitendrabanjara1991, niravcse006
|
7 |
-
Stable tag: 6.0.
|
|
|
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: 3.0
|
10 |
Tested up to: 5.2.2
|
@@ -16,76 +17,26 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
|
16 |
This plugin will count the total visits of your sites pages.
|
17 |
|
18 |
== Description ==
|
19 |
-
|
20 |
|
21 |
-
|
22 |
|
23 |
-
Page
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
= Key features =
|
33 |
|
34 |
-
* Plugin used for front side post and pages visit counter.
|
35 |
-
* Front-end side, you can display individual page visit count as well as total website count to the bottom of the pages and posts on your WordPress website.
|
36 |
-
* Display page visit counter on page and post
|
37 |
-
* Enable / Disable Page Visit Count for all pages and posts.
|
38 |
-
* Set the background as well as font color to display a page visit counter on the website.
|
39 |
-
* You can exclude by IP, User, and User Role for page coun
|
40 |
-
* Page view with last month with top 10-page graph and all page list.
|
41 |
-
* Post view with last month with top 10 post graph and all post list.
|
42 |
-
* Search by post/page name in page/post list.
|
43 |
-
* Check individual page/post-visit history with its graph.
|
44 |
-
* Enable/Disable individual page visit count through meta box in page and post. Also, you can display today's page visit count
|
45 |
-
* Reset individual page count through meta box in page and post.
|
46 |
-
* You can add custom CSS.
|
47 |
-
* You can see the admin dashboard with a different type of report. As per below
|
48 |
-
* Website site visitors summary like today, yesterday, last week, last year, etc.
|
49 |
-
* Browse and operating system report
|
50 |
-
* Top 10 Country, Post, Page, Referral site and IP list based visitor reports
|
51 |
|
52 |
-
|
|
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
The plugin provides a default setting for the page visit counter.
|
58 |
-
|
59 |
-
* Title: Enter the title which you want to be displayed in front side counter for the wizard.
|
60 |
-
* 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.
|
61 |
-
* Front View Counter: It will use to display all page/posts visit count on the front side without using any wizard/shortcode. By default it is Disable.
|
62 |
-
* Style: You can set different styles with font family, font size, font color, background color, border, border-radius, padding as per your requirement.
|
63 |
-
* Counter View & Position: You can set your page visit counter position as per your requirement on the front side. And also you can specify who is the display page visit counter on the front side. Also, you can manage the post-visit counter icon as per your requirement.
|
64 |
-
* Exclude IPs (Ip Address): Enter the IP addresses which you want to be excluded from post views count.
|
65 |
-
* Exclude Users: Select users from your project/system to be excluded from post view count.
|
66 |
-
* Exclude User Role: Select user role from your project/system to be excluded from post view count.
|
67 |
-
* Exclude Country: Select the country in which you want to be excluded from post view count.
|
68 |
-
* Custom CSS: You can add custom CSS as per your requirement.
|
69 |
-
* Short Code: Total Website Count - It will display the sum of all page/post count.
|
70 |
-
* Short Code: Individual Wizard - It will display individual page/post count.
|
71 |
-
|
72 |
-
== Pro Plugin Overview: ==
|
73 |
-
Need even more features? upgrade to <a href ="https://www.thedotstore.com/page-visit-counter/" target="_blank">Page Visit Counter PRO</a> to get all the advanced features:
|
74 |
-
|
75 |
-
* Multiple Create shortcode and wizard
|
76 |
-
* Visitors Counter is fully customizable. Visitors Counter is fully customizable.
|
77 |
-
* Exclude Page visit counter by User Roles
|
78 |
-
* Exclude Page visit counter by Country
|
79 |
-
* Counter view - Who will see this page visit counter by Guest Only, Registered Users only
|
80 |
-
* Upload Counter Icon
|
81 |
-
* Monthwise Website Visit Counter Report
|
82 |
-
* Yearwise Website Visit Report
|
83 |
-
* Individual Page/Post Graph with 2 Month
|
84 |
-
* Individual Page/Post Graph with 3 Month
|
85 |
-
* Individual Page/Post Graph with 6 Month
|
86 |
-
* Page/Post summary with User Role
|
87 |
-
* Backend Individual wizard setting
|
88 |
-
* Backend Individual wizard Delete
|
89 |
|
90 |
= Example: =
|
91 |
1. Admin can see all pages counter in table format from admin site in "Page Visit Counter" option.
|
@@ -155,7 +106,10 @@ Automatic updates should work great for you. As always, though, we recommend ba
|
|
155 |
|
156 |
== Changelog ==
|
157 |
|
158 |
-
= 6.0.
|
|
|
|
|
|
|
159 |
* Compatible with Wordpress 5.3.x
|
160 |
* Compatible with WooCommerce 3.8.x
|
161 |
|
4 |
Author: Thedotstore
|
5 |
Author URI: https://www.thedotstore.com/
|
6 |
Contributors: dots, ketuchetan, chiragpatel, jitendrabanjara1991, niravcse006
|
7 |
+
Stable tag: 6.0.3
|
8 |
+
WC tested up to: 3.9
|
9 |
Tags: page counter,page visit, post counter, post visit, wordpress post view, wordpress page view, page visit graph, post visit graph,
|
10 |
Requires at least: 3.0
|
11 |
Tested up to: 5.2.2
|
17 |
This plugin will count the total visits of your sites pages.
|
18 |
|
19 |
== Description ==
|
20 |
+
This Plugin used for front side post and pages counter. After activation of the plugin, You need to check checkbox from plugins setting. It will add page counter on the bottom of all pages. So, that all visitors can see page counts for entire site pages. The plugin provides search by page title and search by page published date facilities. Settings are required for page counter. The plugin provides to select specific post type to include in post /pages counter. The plugin also provides to exclude specific IP/s and specific register user to exude from post/pages counter.
|
21 |
|
22 |
+
Plugin Demo : <a href ="http://pluginsdemo.thedotstore.com/page-visit-counter/" target="_blank">View Demo</a>
|
23 |
|
24 |
+
= Page Counter Settings: =
|
25 |
+
* In these options you can do different setting for page visit counter.
|
26 |
+
* 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.
|
27 |
+
* 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.
|
28 |
+
* Exclude IPs (Ip Address): Enter the IP addresses which you want to be excluded from post views count.
|
29 |
+
* Exclude Users: Select users from your project/system to be excluded from post view count.
|
30 |
+
* Show front view counter: Check the box if you want to display counter view on front end.
|
31 |
+
* 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.
|
|
|
|
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
= Page Visit Counter: =
|
35 |
+
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.
|
36 |
|
37 |
+
* Search facility: This provides you the extra facility to search pages by title and search page by its crated date.
|
38 |
+
* Sharing facility: This provides you to share specific page on Facebook, Twitter and Google Plus.
|
39 |
+
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
= Example: =
|
42 |
1. Admin can see all pages counter in table format from admin site in "Page Visit Counter" option.
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 6.0.3 - 20-11-2019 =
|
110 |
+
* Compatible with WooCommerce 3.9.x
|
111 |
+
|
112 |
+
= 6.0.2 - 20-11-2019 =
|
113 |
* Compatible with Wordpress 5.3.x
|
114 |
* Compatible with WooCommerce 3.8.x
|
115 |
|
admin/class-page-visit-counter-admin.php
CHANGED
@@ -1084,10 +1084,10 @@ class Page_Visit_Counter_Admin
|
|
1084 |
array_multisort( $orderByDate, SORT_DESC, $page_report_arr );
|
1085 |
$resultsArr[get_the_title( $page_id->page_id )] = $page_report_arr;
|
1086 |
}
|
|
|
|
|
1087 |
}
|
1088 |
|
1089 |
-
echo wp_json_encode( $resultsArr, JSON_NUMERIC_CHECK ) ;
|
1090 |
-
unset( $resultsArr );
|
1091 |
die;
|
1092 |
}
|
1093 |
|
@@ -1152,10 +1152,10 @@ class Page_Visit_Counter_Admin
|
|
1152 |
array_multisort( $orderByDate, SORT_DESC, $post_report_arr );
|
1153 |
$resultsArr[get_the_title( $post_id->page_id )] = $post_report_arr;
|
1154 |
}
|
|
|
|
|
1155 |
}
|
1156 |
|
1157 |
-
echo wp_json_encode( $resultsArr, JSON_NUMERIC_CHECK ) ;
|
1158 |
-
unset( $resultsArr );
|
1159 |
die;
|
1160 |
}
|
1161 |
|
1084 |
array_multisort( $orderByDate, SORT_DESC, $page_report_arr );
|
1085 |
$resultsArr[get_the_title( $page_id->page_id )] = $page_report_arr;
|
1086 |
}
|
1087 |
+
echo wp_json_encode( $resultsArr, JSON_NUMERIC_CHECK ) ;
|
1088 |
+
unset( $resultsArr );
|
1089 |
}
|
1090 |
|
|
|
|
|
1091 |
die;
|
1092 |
}
|
1093 |
|
1152 |
array_multisort( $orderByDate, SORT_DESC, $post_report_arr );
|
1153 |
$resultsArr[get_the_title( $post_id->page_id )] = $post_report_arr;
|
1154 |
}
|
1155 |
+
echo wp_json_encode( $resultsArr, JSON_NUMERIC_CHECK ) ;
|
1156 |
+
unset( $resultsArr );
|
1157 |
}
|
1158 |
|
|
|
|
|
1159 |
die;
|
1160 |
}
|
1161 |
|
admin/partials/header/plugin-header.php
CHANGED
@@ -1,84 +1,84 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
global $pvc_fs ;
|
7 |
-
$plugin_name = PVCP_PLUGIN_NAME;
|
8 |
-
$plugin_version = PVCP_VERSION;
|
9 |
-
$current_page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
|
10 |
-
$pvcp_list = ( isset( $current_page ) && 'pvcp-list' === $current_page || 'pvcp-edit-wizard' === $current_page || 'pvcp-add-new' === $current_page || 'pvcp-wizard-setting' === $current_page ? 'active' : '' );
|
11 |
-
$pvcp_add_new = ( isset( $current_page ) && 'pvcp-add-new' === $current_page ? 'active' : '' );
|
12 |
-
$pvcp_settings = ( isset( $current_page ) && 'pvcp-settings' === $current_page ? 'active' : '' );
|
13 |
-
$pvcp_getting_started = ( isset( $current_page ) && 'pvcp-get-started' === $current_page ? 'active' : '' );
|
14 |
-
$pvcp_quick_info = ( isset( $current_page ) && 'pvcp-quick-information' === $current_page ? 'active' : '' );
|
15 |
-
$pvcp_abount_plugin = ( isset( $current_page ) && 'pvcp-quick-information' === $current_page || isset( $current_page ) && 'pvcp-get-started' === $current_page ? 'active' : '' );
|
16 |
-
$pvcp_list_dashboard = ( isset( $current_page ) && 'pvcp-main-dashboard' === $current_page ? 'active' : '' );
|
17 |
-
$pvcp_page_summary = ( isset( $current_page ) && 'pvcp-dashboard-page' === $current_page ? 'active' : '' );
|
18 |
-
$pvcp_post_summary = ( isset( $current_page ) && 'pvcp-dashboard-post' === $current_page ? 'active' : '' );
|
19 |
-
$pvcp_action = filter_input( INPUT_GET, 'action', FILTER_SANITIZE_STRING );
|
20 |
-
|
21 |
-
if ( isset( $pvcp_action ) && !empty($pvcp_action) ) {
|
22 |
-
if ( 'add' === $pvcp_action || 'edit' === $pvcp_action ) {
|
23 |
-
$pvcp_add_new = 'active';
|
24 |
-
}
|
25 |
-
|
26 |
-
if ( 'edit' === $pvcp_action && 'pvcp-edit-wizard' === $pvcp_action ) {
|
27 |
-
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
28 |
-
$pvcpnonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
29 |
-
$wizard_header_title = EDIT_WIZARD;
|
30 |
-
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) );
|
31 |
-
} else {
|
32 |
-
$wizard_header_title = ADD_NEW_WIZARD;
|
33 |
-
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-add-new' ) );
|
34 |
-
}
|
35 |
-
|
36 |
-
} else {
|
37 |
-
$wizard_header_title = ADD_NEW_WIZARD;
|
38 |
-
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-add-new' ) );
|
39 |
-
}
|
40 |
-
|
41 |
-
?>
|
42 |
|
43 |
<div id="dotsstoremain">
|
44 |
<div class="all-pad">
|
45 |
<header class="dots-header">
|
46 |
<div class="dots-logo-main">
|
47 |
-
<img src="<?php
|
48 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/pvcp-icon.png' ) ;
|
49 |
?>">
|
50 |
</div>
|
51 |
<div class="dots-header-right">
|
52 |
<div class="logo-detail">
|
53 |
-
<strong><?php
|
54 |
-
esc_html_e( $plugin_name );
|
55 |
?> </strong>
|
56 |
-
<span><?php
|
57 |
-
esc_html_e( PVCP_VERSION_TEXT, PVCP_TEXT_DOMAIN );
|
58 |
-
?> <?php
|
59 |
-
esc_html_e( PVCP_VERSION );
|
60 |
?></span>
|
61 |
</div>
|
62 |
<div class="button-group">
|
63 |
-
<?php
|
64 |
-
?>
|
65 |
<div class="button-dots-left">
|
66 |
-
<span class="support_dotstore_image"><a target="_blank" href="<?php
|
67 |
-
echo $pvc_fs->get_upgrade_url() ;
|
68 |
?>">
|
69 |
-
<img src="<?php
|
70 |
-
echo PVCP_PLUGIN_URL . 'admin/images/upgrade_new.png' ;
|
71 |
?>"></a>
|
72 |
</span>
|
73 |
</div>
|
74 |
-
<?php
|
75 |
-
?>
|
76 |
<div class="button-dots">
|
77 |
-
<span class="support_dotstore_image"><a target="_blank" href="<?php
|
78 |
-
echo esc_url( 'http://www.thedotstore.com/support/' ) ;
|
79 |
?>">
|
80 |
-
<img src="<?php
|
81 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/support_new.png' ) ;
|
82 |
?>"></a>
|
83 |
</span>
|
84 |
</div>
|
@@ -89,94 +89,94 @@ echo esc_url( PVCP_PLUGIN_URL . 'admin/images/support_new.png' ) ;
|
|
89 |
<nav>
|
90 |
<ul>
|
91 |
<li>
|
92 |
-
<a class="dotstore_plugin <?php
|
93 |
-
echo esc_attr( $pvcp_list_dashboard ) ;
|
94 |
-
?>" href="<?php
|
95 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-main-dashboard' ) ) ;
|
96 |
-
?>"><?php
|
97 |
-
esc_html_e( 'Dashboard', PVCP_TEXT_DOMAIN );
|
98 |
?></a>
|
99 |
</li>
|
100 |
<li>
|
101 |
-
<a class="dotstore_plugin <?php
|
102 |
-
echo esc_attr( $pvcp_page_summary ) ;
|
103 |
-
?>" href="<?php
|
104 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
105 |
-
?>"><?php
|
106 |
-
esc_html_e( 'Page Summary', PVCP_TEXT_DOMAIN );
|
107 |
?></a>
|
108 |
</li>
|
109 |
<li>
|
110 |
-
<a class="dotstore_plugin <?php
|
111 |
-
echo esc_attr( $pvcp_post_summary ) ;
|
112 |
-
?>" href="<?php
|
113 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
114 |
-
?>"><?php
|
115 |
-
esc_html_e( 'Post Summary', PVCP_TEXT_DOMAIN );
|
116 |
?></a>
|
117 |
</li>
|
118 |
<li>
|
119 |
-
<a class="dotstore_plugin <?php
|
120 |
-
echo esc_attr( $pvcp_list ) ;
|
121 |
-
?>" href="<?php
|
122 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) ;
|
123 |
-
?>"><?php
|
124 |
-
esc_html_e( LIST_PAGE_TITLE, PVCP_TEXT_DOMAIN );
|
125 |
?></a>
|
126 |
</li>
|
127 |
<li>
|
128 |
-
<a class="dotstore_plugin <?php
|
129 |
-
echo esc_attr( $pvcp_settings ) ;
|
130 |
-
?>" href="<?php
|
131 |
-
echo esc_url( admin_url( '/admin.php?page=pvcp-settings' ) ) ;
|
132 |
-
?>"> <?php
|
133 |
-
esc_html_e( 'Setting', PVCP_TEXT_DOMAIN );
|
134 |
?></a>
|
135 |
</li>
|
136 |
<li>
|
137 |
-
<a class="dotstore_plugin <?php
|
138 |
-
echo esc_attr( $pvcp_abount_plugin ) ;
|
139 |
-
?>" href="<?php
|
140 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-get-started' ) ) ;
|
141 |
-
?>"><?php
|
142 |
-
esc_html_e( ABOUT_PLUGIN, PVCP_TEXT_DOMAIN );
|
143 |
?></a>
|
144 |
<ul class="sub-menu">
|
145 |
-
<li><a class="dotstore_plugin <?php
|
146 |
-
echo esc_attr( $pvcp_getting_started ) ;
|
147 |
-
?>" href="<?php
|
148 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-get-started' ) ) ;
|
149 |
-
?>"><?php
|
150 |
-
esc_html_e( GETTING_STARTED, PVCP_TEXT_DOMAIN );
|
151 |
?></a></li>
|
152 |
-
<li><a class="dotstore_plugin <?php
|
153 |
-
echo esc_attr( $pvcp_quick_info ) ;
|
154 |
-
?>" href="<?php
|
155 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-quick-information' ) ) ;
|
156 |
-
?>"><?php
|
157 |
-
esc_html_e( QUICK_INFO, PVCP_TEXT_DOMAIN );
|
158 |
?></a></li>
|
159 |
</ul>
|
160 |
</li>
|
161 |
<li>
|
162 |
-
<a class="dotstore_plugin" target="_blank" href="https://www.thedotstore.com/woocommerce-plugins/"><?php
|
163 |
-
esc_html_e( 'Dotstore', PVCP_TEXT_DOMAIN );
|
164 |
?></a>
|
165 |
<ul class="sub-menu">
|
166 |
-
<li><a target="_blank" href="<?php
|
167 |
-
echo esc_url( "https://www.thedotstore.com/woocommerce-plugins" ) ;
|
168 |
-
?>"><?php
|
169 |
-
esc_html_e( 'WooCommerce Plugins', PVCP_TEXT_DOMAIN );
|
170 |
?></a></li>
|
171 |
-
<li><a target="_blank" href="<?php
|
172 |
-
echo esc_url( "https://www.thedotstore.com/wordpress-plugins" ) ;
|
173 |
-
?>"><?php
|
174 |
-
esc_html_e( 'WordPress Plugins', PVCP_TEXT_DOMAIN );
|
175 |
?></a></li><br>
|
176 |
-
<li><a target="_blank" href="<?php
|
177 |
-
echo esc_url( "https://www.thedotstore.com/support" ) ;
|
178 |
-
?>"><?php
|
179 |
-
esc_html_e( 'Contact Support', PVCP_TEXT_DOMAIN );
|
180 |
?></a></li>
|
181 |
</ul>
|
182 |
</li>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
global $pvc_fs ;
|
7 |
+
$plugin_name = PVCP_PLUGIN_NAME;
|
8 |
+
$plugin_version = PVCP_VERSION;
|
9 |
+
$current_page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
|
10 |
+
$pvcp_list = ( isset( $current_page ) && 'pvcp-list' === $current_page || 'pvcp-edit-wizard' === $current_page || 'pvcp-add-new' === $current_page || 'pvcp-wizard-setting' === $current_page ? 'active' : '' );
|
11 |
+
$pvcp_add_new = ( isset( $current_page ) && 'pvcp-add-new' === $current_page ? 'active' : '' );
|
12 |
+
$pvcp_settings = ( isset( $current_page ) && 'pvcp-settings' === $current_page ? 'active' : '' );
|
13 |
+
$pvcp_getting_started = ( isset( $current_page ) && 'pvcp-get-started' === $current_page ? 'active' : '' );
|
14 |
+
$pvcp_quick_info = ( isset( $current_page ) && 'pvcp-quick-information' === $current_page ? 'active' : '' );
|
15 |
+
$pvcp_abount_plugin = ( isset( $current_page ) && 'pvcp-quick-information' === $current_page || isset( $current_page ) && 'pvcp-get-started' === $current_page ? 'active' : '' );
|
16 |
+
$pvcp_list_dashboard = ( isset( $current_page ) && 'pvcp-main-dashboard' === $current_page ? 'active' : '' );
|
17 |
+
$pvcp_page_summary = ( isset( $current_page ) && 'pvcp-dashboard-page' === $current_page ? 'active' : '' );
|
18 |
+
$pvcp_post_summary = ( isset( $current_page ) && 'pvcp-dashboard-post' === $current_page ? 'active' : '' );
|
19 |
+
$pvcp_action = filter_input( INPUT_GET, 'action', FILTER_SANITIZE_STRING );
|
20 |
+
|
21 |
+
if ( isset( $pvcp_action ) && !empty($pvcp_action) ) {
|
22 |
+
if ( 'add' === $pvcp_action || 'edit' === $pvcp_action ) {
|
23 |
+
$pvcp_add_new = 'active';
|
24 |
+
}
|
25 |
+
|
26 |
+
if ( 'edit' === $pvcp_action && 'pvcp-edit-wizard' === $pvcp_action ) {
|
27 |
+
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
28 |
+
$pvcpnonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
29 |
+
$wizard_header_title = EDIT_WIZARD;
|
30 |
+
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) );
|
31 |
+
} else {
|
32 |
+
$wizard_header_title = ADD_NEW_WIZARD;
|
33 |
+
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-add-new' ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
} else {
|
37 |
+
$wizard_header_title = ADD_NEW_WIZARD;
|
38 |
+
$wizard_header_url = esc_url( site_url( '/wp-admin/admin.php?page=pvcp-add-new' ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
?>
|
42 |
|
43 |
<div id="dotsstoremain">
|
44 |
<div class="all-pad">
|
45 |
<header class="dots-header">
|
46 |
<div class="dots-logo-main">
|
47 |
+
<img src="<?php
|
48 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/pvcp-icon.png' ) ;
|
49 |
?>">
|
50 |
</div>
|
51 |
<div class="dots-header-right">
|
52 |
<div class="logo-detail">
|
53 |
+
<strong><?php
|
54 |
+
esc_html_e( $plugin_name );
|
55 |
?> </strong>
|
56 |
+
<span><?php
|
57 |
+
esc_html_e( PVCP_VERSION_TEXT, PVCP_TEXT_DOMAIN );
|
58 |
+
?> <?php
|
59 |
+
esc_html_e( PVCP_VERSION );
|
60 |
?></span>
|
61 |
</div>
|
62 |
<div class="button-group">
|
63 |
+
<?php
|
64 |
+
?>
|
65 |
<div class="button-dots-left">
|
66 |
+
<span class="support_dotstore_image"><a target="_blank" href="<?php
|
67 |
+
echo $pvc_fs->get_upgrade_url() ;
|
68 |
?>">
|
69 |
+
<img src="<?php
|
70 |
+
echo PVCP_PLUGIN_URL . 'admin/images/upgrade_new.png' ;
|
71 |
?>"></a>
|
72 |
</span>
|
73 |
</div>
|
74 |
+
<?php
|
75 |
+
?>
|
76 |
<div class="button-dots">
|
77 |
+
<span class="support_dotstore_image"><a target="_blank" href="<?php
|
78 |
+
echo esc_url( 'http://www.thedotstore.com/support/' ) ;
|
79 |
?>">
|
80 |
+
<img src="<?php
|
81 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/support_new.png' ) ;
|
82 |
?>"></a>
|
83 |
</span>
|
84 |
</div>
|
89 |
<nav>
|
90 |
<ul>
|
91 |
<li>
|
92 |
+
<a class="dotstore_plugin <?php
|
93 |
+
echo esc_attr( $pvcp_list_dashboard ) ;
|
94 |
+
?>" href="<?php
|
95 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-main-dashboard' ) ) ;
|
96 |
+
?>"><?php
|
97 |
+
esc_html_e( 'Dashboard', PVCP_TEXT_DOMAIN );
|
98 |
?></a>
|
99 |
</li>
|
100 |
<li>
|
101 |
+
<a class="dotstore_plugin <?php
|
102 |
+
echo esc_attr( $pvcp_page_summary ) ;
|
103 |
+
?>" href="<?php
|
104 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
105 |
+
?>"><?php
|
106 |
+
esc_html_e( 'Page Summary', PVCP_TEXT_DOMAIN );
|
107 |
?></a>
|
108 |
</li>
|
109 |
<li>
|
110 |
+
<a class="dotstore_plugin <?php
|
111 |
+
echo esc_attr( $pvcp_post_summary ) ;
|
112 |
+
?>" href="<?php
|
113 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
114 |
+
?>"><?php
|
115 |
+
esc_html_e( 'Post Summary', PVCP_TEXT_DOMAIN );
|
116 |
?></a>
|
117 |
</li>
|
118 |
<li>
|
119 |
+
<a class="dotstore_plugin <?php
|
120 |
+
echo esc_attr( $pvcp_list ) ;
|
121 |
+
?>" href="<?php
|
122 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) ;
|
123 |
+
?>"><?php
|
124 |
+
esc_html_e( LIST_PAGE_TITLE, PVCP_TEXT_DOMAIN );
|
125 |
?></a>
|
126 |
</li>
|
127 |
<li>
|
128 |
+
<a class="dotstore_plugin <?php
|
129 |
+
echo esc_attr( $pvcp_settings ) ;
|
130 |
+
?>" href="<?php
|
131 |
+
echo esc_url( admin_url( '/admin.php?page=pvcp-settings' ) ) ;
|
132 |
+
?>"> <?php
|
133 |
+
esc_html_e( 'Setting', PVCP_TEXT_DOMAIN );
|
134 |
?></a>
|
135 |
</li>
|
136 |
<li>
|
137 |
+
<a class="dotstore_plugin <?php
|
138 |
+
echo esc_attr( $pvcp_abount_plugin ) ;
|
139 |
+
?>" href="<?php
|
140 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-get-started' ) ) ;
|
141 |
+
?>"><?php
|
142 |
+
esc_html_e( ABOUT_PLUGIN, PVCP_TEXT_DOMAIN );
|
143 |
?></a>
|
144 |
<ul class="sub-menu">
|
145 |
+
<li><a class="dotstore_plugin <?php
|
146 |
+
echo esc_attr( $pvcp_getting_started ) ;
|
147 |
+
?>" href="<?php
|
148 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-get-started' ) ) ;
|
149 |
+
?>"><?php
|
150 |
+
esc_html_e( GETTING_STARTED, PVCP_TEXT_DOMAIN );
|
151 |
?></a></li>
|
152 |
+
<li><a class="dotstore_plugin <?php
|
153 |
+
echo esc_attr( $pvcp_quick_info ) ;
|
154 |
+
?>" href="<?php
|
155 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-quick-information' ) ) ;
|
156 |
+
?>"><?php
|
157 |
+
esc_html_e( QUICK_INFO, PVCP_TEXT_DOMAIN );
|
158 |
?></a></li>
|
159 |
</ul>
|
160 |
</li>
|
161 |
<li>
|
162 |
+
<a class="dotstore_plugin" target="_blank" href="https://www.thedotstore.com/woocommerce-plugins/"><?php
|
163 |
+
esc_html_e( 'Dotstore', PVCP_TEXT_DOMAIN );
|
164 |
?></a>
|
165 |
<ul class="sub-menu">
|
166 |
+
<li><a target="_blank" href="<?php
|
167 |
+
echo esc_url( "https://www.thedotstore.com/woocommerce-plugins" ) ;
|
168 |
+
?>"><?php
|
169 |
+
esc_html_e( 'WooCommerce Plugins', PVCP_TEXT_DOMAIN );
|
170 |
?></a></li>
|
171 |
+
<li><a target="_blank" href="<?php
|
172 |
+
echo esc_url( "https://www.thedotstore.com/wordpress-plugins" ) ;
|
173 |
+
?>"><?php
|
174 |
+
esc_html_e( 'WordPress Plugins', PVCP_TEXT_DOMAIN );
|
175 |
?></a></li><br>
|
176 |
+
<li><a target="_blank" href="<?php
|
177 |
+
echo esc_url( "https://www.thedotstore.com/support" ) ;
|
178 |
+
?>"><?php
|
179 |
+
esc_html_e( 'Contact Support', PVCP_TEXT_DOMAIN );
|
180 |
?></a></li>
|
181 |
</ul>
|
182 |
</li>
|
admin/partials/pvcp-add-new-page.php
CHANGED
@@ -1,107 +1,107 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
9 |
-
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
10 |
-
$wizard_title = '';
|
11 |
-
$wizard_shortcode = '';
|
12 |
-
$wizard_status = '';
|
13 |
-
$btnValue = __( ADD_NEW_WIZARD_SAVE_BUTTON_NAME, PVCP_TEXT_DOMAIN );
|
14 |
-
if ( isset( $_POST['submitWizard'] ) && sanitize_text_field( wp_unslash( $_POST['submitWizard'] ) ) === EDIT_NEW_WIZARD_SAVE_BUTTON_NAME ) {
|
15 |
-
|
16 |
-
if ( !wp_verify_nonce( $retrieved_nonce, 'wizardfrm' ) ) {
|
17 |
-
die( 'Failed security check' );
|
18 |
-
} else {
|
19 |
-
$data_post = $_POST;
|
20 |
-
if ( method_exists( $this, 'pvcp_wizard_save' ) ) {
|
21 |
-
$this->pvcp_wizard_save( $data_post, 'add', $data_post['wizard_post_id'] );
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
}
|
26 |
-
if ( isset( $_REQUEST['action'] ) && sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) === 'edit' ) {
|
27 |
-
|
28 |
-
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcpwznonce' ) ) {
|
29 |
-
die( 'Failed security check' );
|
30 |
-
} else {
|
31 |
-
$btnValue = __( EDIT_NEW_WIZARD_SAVE_BUTTON_NAME, PVCP_TEXT_DOMAIN );
|
32 |
-
$get_rows = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_wizard WHERE ID=%d", $wizard_id ) );
|
33 |
-
//db call ok; no-cache ok
|
34 |
-
|
35 |
-
if ( !empty($get_rows) && isset( $get_rows ) ) {
|
36 |
-
$get_wizard_id = esc_attr( $get_rows->ID );
|
37 |
-
$wizard_title = esc_attr( $get_rows->name );
|
38 |
-
$wizard_shortcode = esc_attr( $get_rows->shortcode );
|
39 |
-
$wizard_status = esc_attr( $get_rows->status );
|
40 |
-
}
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
}
|
45 |
-
?>
|
46 |
<div class="pvcp-main-table res-cl">
|
47 |
-
<h2><?php
|
48 |
-
esc_html_e( 'Wizard Configuration', PVCP_TEXT_DOMAIN );
|
49 |
?></h2>
|
50 |
<form method="POST" name="wizardfrm" action="">
|
51 |
-
<?php
|
52 |
-
wp_nonce_field( 'wizardfrm' );
|
53 |
-
?>
|
54 |
-
<input type="hidden" name="wizard_post_id" value="<?php
|
55 |
-
echo esc_attr( $wizard_id ) ;
|
56 |
?>">
|
57 |
<table class="form-table table-outer counter-wizard-table">
|
58 |
<tbody>
|
59 |
<tr valign="top">
|
60 |
<th class="titledesc" scope="row">
|
61 |
-
<label for="wizard_title"><?php
|
62 |
-
esc_html_e( WIZARD_TITLE, PVCP_TEXT_DOMAIN );
|
63 |
?><span class="required-star">*</span></label></th>
|
64 |
<td class="forminp mdtooltip">
|
65 |
-
<input type="text" name="wizard_title" class="text-class half_width" id="wizard_title" value="<?php
|
66 |
-
echo ( !empty(esc_attr( $wizard_title )) ? esc_attr( $wizard_title ) : '' ) ;
|
67 |
-
?>" required="1" placeholder="<?php
|
68 |
-
esc_html_e( WIZARD_TITLE_PLACEHOLDER, PVCP_TEXT_DOMAIN );
|
69 |
?>">
|
70 |
<span class="pvcp_tooltip_icon"></span>
|
71 |
-
<p class="pcvp_tooltip_desc description"><?php
|
72 |
-
esc_html_e( WIZARD_TITLE_DESCRIPTION, PVCP_TEXT_DOMAIN );
|
73 |
?></p>
|
74 |
</td>
|
75 |
</tr>
|
76 |
<tr valign="top">
|
77 |
<th class="titledesc" scope="row">
|
78 |
-
<label for="wizard_shortcode"><?php
|
79 |
-
esc_html_e( WIZARD_SHORTCODE, PVCP_TEXT_DOMAIN );
|
80 |
?></label>
|
81 |
</th>
|
82 |
<td class="forminp mdtooltip">
|
83 |
<div class="product_cost_left_div">
|
84 |
-
<input type="text" name="wizard_shortcode" required="1" class="text-class" id="wizard_shortcode" value="<?php
|
85 |
-
echo ( !empty(esc_attr( $wizard_shortcode )) ? esc_attr( $wizard_shortcode ) : '' ) ;
|
86 |
?>" readonly>
|
87 |
<span class="pvcp_tooltip_icon"></span>
|
88 |
<p class="pcvp_tooltip_desc description">
|
89 |
-
<?php
|
90 |
-
esc_html_e( WIZARD_SHORTCODE_DESCRIPTION, PVCP_TEXT_DOMAIN );
|
91 |
-
?>
|
92 |
</p>
|
93 |
</div>
|
94 |
</td>
|
95 |
</tr>
|
96 |
<tr valign="top">
|
97 |
<th class="titledesc" scope="row">
|
98 |
-
<label for="wizard_status"><?php
|
99 |
-
esc_html_e( WIZARD_STATUS, PVCP_TEXT_DOMAIN );
|
100 |
?></label></th>
|
101 |
<td class="forminp mdtooltip">
|
102 |
<label class="switch">
|
103 |
-
<input type="checkbox" name="wizard_status" value="on" <?php
|
104 |
-
echo ( !empty(esc_attr( $wizard_status )) && esc_attr( $wizard_status ) === 'off' ? '' : 'checked' ) ;
|
105 |
?>>
|
106 |
<div class="slider round"></div>
|
107 |
</label>
|
@@ -109,10 +109,10 @@ echo ( !empty(esc_attr( $wizard_status )) && esc_attr( $wizard_status ) === 'of
|
|
109 |
</tr>
|
110 |
</tbody>
|
111 |
</table>
|
112 |
-
<p class="submit"><input type="submit" name="submitWizard" class="button button-primary button-large" value="<?php
|
113 |
-
echo esc_attr( $btnValue ) ;
|
114 |
?>"></p>
|
115 |
</form>
|
116 |
</div>
|
117 |
-
<?php
|
118 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
9 |
+
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
10 |
+
$wizard_title = '';
|
11 |
+
$wizard_shortcode = '';
|
12 |
+
$wizard_status = '';
|
13 |
+
$btnValue = __( ADD_NEW_WIZARD_SAVE_BUTTON_NAME, PVCP_TEXT_DOMAIN );
|
14 |
+
if ( isset( $_POST['submitWizard'] ) && sanitize_text_field( wp_unslash( $_POST['submitWizard'] ) ) === EDIT_NEW_WIZARD_SAVE_BUTTON_NAME ) {
|
15 |
+
|
16 |
+
if ( !wp_verify_nonce( $retrieved_nonce, 'wizardfrm' ) ) {
|
17 |
+
die( 'Failed security check' );
|
18 |
+
} else {
|
19 |
+
$data_post = $_POST;
|
20 |
+
if ( method_exists( $this, 'pvcp_wizard_save' ) ) {
|
21 |
+
$this->pvcp_wizard_save( $data_post, 'add', $data_post['wizard_post_id'] );
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
26 |
+
if ( isset( $_REQUEST['action'] ) && sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) === 'edit' ) {
|
27 |
+
|
28 |
+
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcpwznonce' ) ) {
|
29 |
+
die( 'Failed security check' );
|
30 |
+
} else {
|
31 |
+
$btnValue = __( EDIT_NEW_WIZARD_SAVE_BUTTON_NAME, PVCP_TEXT_DOMAIN );
|
32 |
+
$get_rows = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_wizard WHERE ID=%d", $wizard_id ) );
|
33 |
+
//db call ok; no-cache ok
|
34 |
+
|
35 |
+
if ( !empty($get_rows) && isset( $get_rows ) ) {
|
36 |
+
$get_wizard_id = esc_attr( $get_rows->ID );
|
37 |
+
$wizard_title = esc_attr( $get_rows->name );
|
38 |
+
$wizard_shortcode = esc_attr( $get_rows->shortcode );
|
39 |
+
$wizard_status = esc_attr( $get_rows->status );
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
+
?>
|
46 |
<div class="pvcp-main-table res-cl">
|
47 |
+
<h2><?php
|
48 |
+
esc_html_e( 'Wizard Configuration', PVCP_TEXT_DOMAIN );
|
49 |
?></h2>
|
50 |
<form method="POST" name="wizardfrm" action="">
|
51 |
+
<?php
|
52 |
+
wp_nonce_field( 'wizardfrm' );
|
53 |
+
?>
|
54 |
+
<input type="hidden" name="wizard_post_id" value="<?php
|
55 |
+
echo esc_attr( $wizard_id ) ;
|
56 |
?>">
|
57 |
<table class="form-table table-outer counter-wizard-table">
|
58 |
<tbody>
|
59 |
<tr valign="top">
|
60 |
<th class="titledesc" scope="row">
|
61 |
+
<label for="wizard_title"><?php
|
62 |
+
esc_html_e( WIZARD_TITLE, PVCP_TEXT_DOMAIN );
|
63 |
?><span class="required-star">*</span></label></th>
|
64 |
<td class="forminp mdtooltip">
|
65 |
+
<input type="text" name="wizard_title" class="text-class half_width" id="wizard_title" value="<?php
|
66 |
+
echo ( !empty(esc_attr( $wizard_title )) ? esc_attr( $wizard_title ) : '' ) ;
|
67 |
+
?>" required="1" placeholder="<?php
|
68 |
+
esc_html_e( WIZARD_TITLE_PLACEHOLDER, PVCP_TEXT_DOMAIN );
|
69 |
?>">
|
70 |
<span class="pvcp_tooltip_icon"></span>
|
71 |
+
<p class="pcvp_tooltip_desc description"><?php
|
72 |
+
esc_html_e( WIZARD_TITLE_DESCRIPTION, PVCP_TEXT_DOMAIN );
|
73 |
?></p>
|
74 |
</td>
|
75 |
</tr>
|
76 |
<tr valign="top">
|
77 |
<th class="titledesc" scope="row">
|
78 |
+
<label for="wizard_shortcode"><?php
|
79 |
+
esc_html_e( WIZARD_SHORTCODE, PVCP_TEXT_DOMAIN );
|
80 |
?></label>
|
81 |
</th>
|
82 |
<td class="forminp mdtooltip">
|
83 |
<div class="product_cost_left_div">
|
84 |
+
<input type="text" name="wizard_shortcode" required="1" class="text-class" id="wizard_shortcode" value="<?php
|
85 |
+
echo ( !empty(esc_attr( $wizard_shortcode )) ? esc_attr( $wizard_shortcode ) : '' ) ;
|
86 |
?>" readonly>
|
87 |
<span class="pvcp_tooltip_icon"></span>
|
88 |
<p class="pcvp_tooltip_desc description">
|
89 |
+
<?php
|
90 |
+
esc_html_e( WIZARD_SHORTCODE_DESCRIPTION, PVCP_TEXT_DOMAIN );
|
91 |
+
?>
|
92 |
</p>
|
93 |
</div>
|
94 |
</td>
|
95 |
</tr>
|
96 |
<tr valign="top">
|
97 |
<th class="titledesc" scope="row">
|
98 |
+
<label for="wizard_status"><?php
|
99 |
+
esc_html_e( WIZARD_STATUS, PVCP_TEXT_DOMAIN );
|
100 |
?></label></th>
|
101 |
<td class="forminp mdtooltip">
|
102 |
<label class="switch">
|
103 |
+
<input type="checkbox" name="wizard_status" value="on" <?php
|
104 |
+
echo ( !empty(esc_attr( $wizard_status )) && esc_attr( $wizard_status ) === 'off' ? '' : 'checked' ) ;
|
105 |
?>>
|
106 |
<div class="slider round"></div>
|
107 |
</label>
|
109 |
</tr>
|
110 |
</tbody>
|
111 |
</table>
|
112 |
+
<p class="submit"><input type="submit" name="submitWizard" class="button button-primary button-large" value="<?php
|
113 |
+
echo esc_attr( $btnValue ) ;
|
114 |
?>"></p>
|
115 |
</form>
|
116 |
</div>
|
117 |
+
<?php
|
118 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
admin/partials/pvcp-get-started-page.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
?>
|
9 |
|
10 |
<div class="pvcp-main-table res-cl">
|
11 |
|
12 |
-
<h2><?php
|
13 |
-
esc_html_e( 'Thanks For Installing ' . PVCP_PLUGIN_NAME, PVCP_TEXT_DOMAIN );
|
14 |
?></h2>
|
15 |
|
16 |
<table class="table-outer">
|
@@ -19,110 +19,110 @@ esc_html_e( 'Thanks For Installing ' . PVCP_PLUGIN_NAME, PVCP_TEXT_DOMAIN );
|
|
19 |
<tr>
|
20 |
<td class="fr-2">
|
21 |
|
22 |
-
<p class="block gettingstarted"><strong><?php
|
23 |
-
esc_html_e( 'Getting Started', PVCP_TEXT_DOMAIN );
|
24 |
?> </strong></p>
|
25 |
-
<?php
|
26 |
-
?>
|
27 |
<p class="block textgetting">
|
28 |
-
<?php
|
29 |
-
esc_html_e( 'Page Visit Counter counts the visit of the website. It enables site owners to exclude specific IP/s, register user from post/pages counter. There is an option to select specific post type that include in post/pages counter.', PVCP_TEXT_DOMAIN );
|
30 |
-
?>
|
31 |
</p>
|
32 |
|
33 |
<p class="block textgetting">
|
34 |
-
<strong><?php
|
35 |
-
esc_html_e( 'Step 1', PVCP_TEXT_DOMAIN );
|
36 |
-
?>
|
37 |
-
:</strong> <?php
|
38 |
-
esc_html_e( 'Wizard Configuration', PVCP_TEXT_DOMAIN );
|
39 |
-
?>
|
40 |
<span class="gettingstarted">
|
41 |
-
<img src="<?php
|
42 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_01.png' ) ;
|
43 |
?>">
|
44 |
</span>
|
45 |
</p>
|
46 |
|
47 |
<p class="block textgetting">
|
48 |
-
<strong><?php
|
49 |
-
esc_html_e( 'Step 2', PVCP_TEXT_DOMAIN );
|
50 |
-
?>
|
51 |
-
:</strong> <?php
|
52 |
-
esc_html_e( 'You can see list of all created wizard', PVCP_TEXT_DOMAIN );
|
53 |
-
?>
|
54 |
<span class="gettingstarted">
|
55 |
-
<img src="<?php
|
56 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_02.png' ) ;
|
57 |
?>">
|
58 |
</span>
|
59 |
</p>
|
60 |
|
61 |
<p class="block textgetting">
|
62 |
-
<strong><?php
|
63 |
-
esc_html_e( 'Step 3', PVCP_TEXT_DOMAIN );
|
64 |
-
?>
|
65 |
-
:</strong> <?php
|
66 |
-
esc_html_e( 'You can configure individual wizard.', PVCP_TEXT_DOMAIN );
|
67 |
-
?>
|
68 |
<span class="gettingstarted">
|
69 |
-
<img src="<?php
|
70 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_03.png' ) ;
|
71 |
?>">
|
72 |
</span>
|
73 |
</p>
|
74 |
|
75 |
<p class="block textgetting">
|
76 |
-
<strong><?php
|
77 |
-
esc_html_e( 'Step 4', PVCP_TEXT_DOMAIN );
|
78 |
-
?>
|
79 |
-
:</strong> <?php
|
80 |
-
esc_html_e( 'You can configure default/general wizard.', PVCP_TEXT_DOMAIN );
|
81 |
-
?>
|
82 |
<span class="gettingstarted">
|
83 |
-
<img src="<?php
|
84 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_04.png' ) ;
|
85 |
?>">
|
86 |
</span>
|
87 |
</p>
|
88 |
-
<?php
|
89 |
-
?>
|
90 |
|
91 |
<p class="block textgetting">
|
92 |
-
<strong><?php
|
93 |
-
esc_html_e( 'Step 5', PVCP_TEXT_DOMAIN );
|
94 |
-
?> :</strong> <?php
|
95 |
-
esc_html_e( 'Set wizard shortcode in page/post which you want to display it.', PVCP_TEXT_DOMAIN );
|
96 |
-
?>
|
97 |
<span class="gettingstarted">
|
98 |
-
<img src="<?php
|
99 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_05.png' ) ;
|
100 |
?>">
|
101 |
</span>
|
102 |
</p>
|
103 |
|
104 |
<p class="block textgetting">
|
105 |
-
<strong><?php
|
106 |
-
esc_html_e( 'Step 6', PVCP_TEXT_DOMAIN );
|
107 |
-
?> :</strong> <?php
|
108 |
-
esc_html_e( 'Also you can manage page visit counter by metabox.', PVCP_TEXT_DOMAIN );
|
109 |
-
?>
|
110 |
<span class="gettingstarted">
|
111 |
-
<img src="<?php
|
112 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_06.png' ) ;
|
113 |
?>">
|
114 |
</span>
|
115 |
</p>
|
116 |
|
117 |
<p class="block textgetting">
|
118 |
-
<strong><?php
|
119 |
-
esc_html_e( 'Step 7', PVCP_TEXT_DOMAIN );
|
120 |
-
?> :</strong> <?php
|
121 |
-
esc_html_e( 'Front view page counter.', PVCP_TEXT_DOMAIN );
|
122 |
-
?>
|
123 |
<span class="gettingstarted">
|
124 |
-
<img src="<?php
|
125 |
-
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_07.png' ) ;
|
126 |
?>">
|
127 |
</span>
|
128 |
</p>
|
@@ -132,5 +132,5 @@ echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_07.png' ) ;
|
|
132 |
</tbody>
|
133 |
</table>
|
134 |
</div>
|
135 |
-
<?php
|
136 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
?>
|
9 |
|
10 |
<div class="pvcp-main-table res-cl">
|
11 |
|
12 |
+
<h2><?php
|
13 |
+
esc_html_e( 'Thanks For Installing ' . PVCP_PLUGIN_NAME, PVCP_TEXT_DOMAIN );
|
14 |
?></h2>
|
15 |
|
16 |
<table class="table-outer">
|
19 |
<tr>
|
20 |
<td class="fr-2">
|
21 |
|
22 |
+
<p class="block gettingstarted"><strong><?php
|
23 |
+
esc_html_e( 'Getting Started', PVCP_TEXT_DOMAIN );
|
24 |
?> </strong></p>
|
25 |
+
<?php
|
26 |
+
?>
|
27 |
<p class="block textgetting">
|
28 |
+
<?php
|
29 |
+
esc_html_e( 'Page Visit Counter counts the visit of the website. It enables site owners to exclude specific IP/s, register user from post/pages counter. There is an option to select specific post type that include in post/pages counter.', PVCP_TEXT_DOMAIN );
|
30 |
+
?>
|
31 |
</p>
|
32 |
|
33 |
<p class="block textgetting">
|
34 |
+
<strong><?php
|
35 |
+
esc_html_e( 'Step 1', PVCP_TEXT_DOMAIN );
|
36 |
+
?>
|
37 |
+
:</strong> <?php
|
38 |
+
esc_html_e( 'Wizard Configuration', PVCP_TEXT_DOMAIN );
|
39 |
+
?>
|
40 |
<span class="gettingstarted">
|
41 |
+
<img src="<?php
|
42 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_01.png' ) ;
|
43 |
?>">
|
44 |
</span>
|
45 |
</p>
|
46 |
|
47 |
<p class="block textgetting">
|
48 |
+
<strong><?php
|
49 |
+
esc_html_e( 'Step 2', PVCP_TEXT_DOMAIN );
|
50 |
+
?>
|
51 |
+
:</strong> <?php
|
52 |
+
esc_html_e( 'You can see list of all created wizard', PVCP_TEXT_DOMAIN );
|
53 |
+
?>
|
54 |
<span class="gettingstarted">
|
55 |
+
<img src="<?php
|
56 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_02.png' ) ;
|
57 |
?>">
|
58 |
</span>
|
59 |
</p>
|
60 |
|
61 |
<p class="block textgetting">
|
62 |
+
<strong><?php
|
63 |
+
esc_html_e( 'Step 3', PVCP_TEXT_DOMAIN );
|
64 |
+
?>
|
65 |
+
:</strong> <?php
|
66 |
+
esc_html_e( 'You can configure individual wizard.', PVCP_TEXT_DOMAIN );
|
67 |
+
?>
|
68 |
<span class="gettingstarted">
|
69 |
+
<img src="<?php
|
70 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_03.png' ) ;
|
71 |
?>">
|
72 |
</span>
|
73 |
</p>
|
74 |
|
75 |
<p class="block textgetting">
|
76 |
+
<strong><?php
|
77 |
+
esc_html_e( 'Step 4', PVCP_TEXT_DOMAIN );
|
78 |
+
?>
|
79 |
+
:</strong> <?php
|
80 |
+
esc_html_e( 'You can configure default/general wizard.', PVCP_TEXT_DOMAIN );
|
81 |
+
?>
|
82 |
<span class="gettingstarted">
|
83 |
+
<img src="<?php
|
84 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_04.png' ) ;
|
85 |
?>">
|
86 |
</span>
|
87 |
</p>
|
88 |
+
<?php
|
89 |
+
?>
|
90 |
|
91 |
<p class="block textgetting">
|
92 |
+
<strong><?php
|
93 |
+
esc_html_e( 'Step 5', PVCP_TEXT_DOMAIN );
|
94 |
+
?> :</strong> <?php
|
95 |
+
esc_html_e( 'Set wizard shortcode in page/post which you want to display it.', PVCP_TEXT_DOMAIN );
|
96 |
+
?>
|
97 |
<span class="gettingstarted">
|
98 |
+
<img src="<?php
|
99 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_05.png' ) ;
|
100 |
?>">
|
101 |
</span>
|
102 |
</p>
|
103 |
|
104 |
<p class="block textgetting">
|
105 |
+
<strong><?php
|
106 |
+
esc_html_e( 'Step 6', PVCP_TEXT_DOMAIN );
|
107 |
+
?> :</strong> <?php
|
108 |
+
esc_html_e( 'Also you can manage page visit counter by metabox.', PVCP_TEXT_DOMAIN );
|
109 |
+
?>
|
110 |
<span class="gettingstarted">
|
111 |
+
<img src="<?php
|
112 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_06.png' ) ;
|
113 |
?>">
|
114 |
</span>
|
115 |
</p>
|
116 |
|
117 |
<p class="block textgetting">
|
118 |
+
<strong><?php
|
119 |
+
esc_html_e( 'Step 7', PVCP_TEXT_DOMAIN );
|
120 |
+
?> :</strong> <?php
|
121 |
+
esc_html_e( 'Front view page counter.', PVCP_TEXT_DOMAIN );
|
122 |
+
?>
|
123 |
<span class="gettingstarted">
|
124 |
+
<img src="<?php
|
125 |
+
echo esc_url( PVCP_PLUGIN_URL . 'admin/images/Getting_Started_07.png' ) ;
|
126 |
?>">
|
127 |
</span>
|
128 |
</p>
|
132 |
</tbody>
|
133 |
</table>
|
134 |
</div>
|
135 |
+
<?php
|
136 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
admin/partials/pvcp-plugin-dashboard-page.php
CHANGED
@@ -1,209 +1,209 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$page_id_wpnonce = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_STRING );
|
9 |
-
$page_id = ( empty($page_id_wpnonce) ? '' : sanitize_text_field( wp_unslash( $page_id_wpnonce ) ) );
|
10 |
-
$duration = filter_input( INPUT_GET, 'duration', FILTER_SANITIZE_STRING );
|
11 |
-
$last_week = ( isset( $duration ) && '7' === $duration ? 'active' : '' );
|
12 |
-
$month_1 = ( isset( $duration ) && '30' === $duration ? 'active' : '' );
|
13 |
-
?>
|
14 |
|
15 |
|
16 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
17 |
|
18 |
-
<?php
|
19 |
-
|
20 |
-
if ( !empty($page_id) ) {
|
21 |
-
?>
|
22 |
<h2>
|
23 |
-
<?php
|
24 |
-
esc_html_e( get_the_title( $page_id ) . ' Page Summary', PVCP_TEXT_DOMAIN );
|
25 |
-
?>
|
26 |
-
<a class="add-new-btn back-button" id="back_button" href="<?php
|
27 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
28 |
?>">Back to Page List</a>
|
29 |
</h2>
|
30 |
<ul>
|
31 |
-
<li><a class="pvcp-action-link <?php
|
32 |
-
echo esc_attr( $last_week ) ;
|
33 |
-
?>" href="<?php
|
34 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&type=page&duration=7&page_id=' . esc_attr( $page_id ) ) ) ;
|
35 |
-
?>"><?php
|
36 |
-
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
37 |
?></a></li>
|
38 |
-
<li><a class="pvcp-action-link <?php
|
39 |
-
echo esc_attr( $month_1 ) ;
|
40 |
-
?>" href="<?php
|
41 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&type=page&duration=30&page_id=' . esc_attr( $page_id ) ) ) ;
|
42 |
-
?>"><?php
|
43 |
-
esc_html_e( '1 Month', PVCP_TEXT_DOMAIN );
|
44 |
?></a></li>
|
45 |
-
<?php
|
46 |
-
?>
|
47 |
</ul>
|
48 |
<!-- Page History Report-->
|
49 |
<div class="dash-page-history pvcp-table-cover">
|
50 |
-
<div id="chartContainerByPage<?php
|
51 |
-
echo esc_attr( $page_id ) ;
|
52 |
?>" class="chartContainerHeight"></div>
|
53 |
</div>
|
54 |
|
55 |
<!-- Top Page List -->
|
56 |
<div class="dash-top-page">
|
57 |
-
<h2><?php
|
58 |
-
esc_html_e( get_the_title( $page_id ) . ' Page Summary', PVCP_TEXT_DOMAIN );
|
59 |
?></h2>
|
60 |
<table class="pvcp-form-data-table display">
|
61 |
<thead>
|
62 |
<tr>
|
63 |
-
<th><?php
|
64 |
-
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
65 |
?></th>
|
66 |
-
<th><?php
|
67 |
-
esc_html_e( 'Browser Name', PVCP_TEXT_DOMAIN );
|
68 |
?></th>
|
69 |
-
<th><?php
|
70 |
-
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
71 |
?></th>
|
72 |
-
<th><?php
|
73 |
-
esc_html_e( 'Date', PVCP_TEXT_DOMAIN );
|
74 |
?></th>
|
75 |
-
<?php
|
76 |
-
?>
|
77 |
</tr>
|
78 |
</thead>
|
79 |
<tbody>
|
80 |
-
<?php
|
81 |
-
$page_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_history WHERE type = %s AND page_id = %d ORDER BY date DESC", 'page', $page_id ) );
|
82 |
-
//db call ok; no-cache ok
|
83 |
-
|
84 |
-
if ( $page_info ) {
|
85 |
-
$i = 1;
|
86 |
-
foreach ( $page_info as $in_page ) {
|
87 |
-
|
88 |
-
if ( "MSIE" === $in_page->browser_short_name ) {
|
89 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
90 |
-
} elseif ( "Firefox" === $in_page->browser_short_name ) {
|
91 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/firefox.png';
|
92 |
-
} elseif ( "Opera" === $in_page->browser_short_name ) {
|
93 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/opera.png';
|
94 |
-
} elseif ( "Chrome" === $in_page->browser_short_name ) {
|
95 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/chrome.png';
|
96 |
-
} elseif ( "Safari" === $in_page->browser_short_name ) {
|
97 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/safari.png';
|
98 |
-
} elseif ( "Netscape" === $in_page->browser_short_name ) {
|
99 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/netscape.png';
|
100 |
-
} elseif ( "Edge" === $in_page->browser_short_name ) {
|
101 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
102 |
-
} else {
|
103 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/other-bw.png';
|
104 |
-
}
|
105 |
-
|
106 |
-
?>
|
107 |
|
108 |
<tr>
|
109 |
-
<td><?php
|
110 |
-
esc_html_e( $i, PVCP_TEXT_DOMAIN );
|
111 |
?></td>
|
112 |
-
<td><img src="<?php
|
113 |
-
echo esc_url( $browser_url ) ;
|
114 |
-
?>" title="<?php
|
115 |
-
echo esc_attr( $in_page->browser_short_name ) ;
|
116 |
-
?>" alt="<?php
|
117 |
-
echo esc_attr( $in_page->browser_short_name ) ;
|
118 |
?>" width="16"></td>
|
119 |
-
<td><?php
|
120 |
-
esc_html_e( $in_page->ipaddress, PVCP_TEXT_DOMAIN );
|
121 |
?></td>
|
122 |
-
<td><?php
|
123 |
-
esc_html_e( $in_page->date, PVCP_TEXT_DOMAIN );
|
124 |
?></td>
|
125 |
-
<?php
|
126 |
-
?>
|
127 |
</tr>
|
128 |
-
<?php
|
129 |
-
$i++;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
?>
|
134 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
-
<?php
|
138 |
-
} else {
|
139 |
-
?>
|
140 |
<h2>
|
141 |
-
<?php
|
142 |
-
esc_html_e( 'Page Summary', PVCP_TEXT_DOMAIN );
|
143 |
-
?>
|
144 |
</h2>
|
145 |
<!-- Monthly Report -->
|
146 |
<div class="monthly-report pvcp-table-cover">
|
147 |
-
<h2><?php
|
148 |
-
esc_html_e( 'Monthly report', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerReportByMonthPage" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
|
153 |
<!-- Top Page List -->
|
154 |
<div class="dash-top-page">
|
155 |
-
<h2><?php
|
156 |
-
esc_html_e( 'Pages Summary', PVCP_TEXT_DOMAIN );
|
157 |
?></h2>
|
158 |
<table class="pvcp-form-data-table display">
|
159 |
<thead>
|
160 |
<tr>
|
161 |
-
<th><?php
|
162 |
-
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
163 |
?></th>
|
164 |
-
<th><?php
|
165 |
-
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
166 |
?></th>
|
167 |
-
<th><?php
|
168 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
169 |
?></th>
|
170 |
</tr>
|
171 |
</thead>
|
172 |
<tbody>
|
173 |
-
<?php
|
174 |
-
$top_pages = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type != 'post' GROUP BY page_id ORDER BY COUNT(id) DESC" );
|
175 |
-
//db call ok; no-cache ok
|
176 |
-
if ( $top_pages ) {
|
177 |
-
foreach ( $top_pages as $dash_page ) {
|
178 |
-
$pvcp_page_nonce = wp_create_nonce( 'pvcp-page-nonce' );
|
179 |
-
?>
|
180 |
<tr>
|
181 |
-
<td><?php
|
182 |
-
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
183 |
?></td>
|
184 |
-
<td><a href="<?php
|
185 |
-
echo esc_url( $dash_page->http_referer ) ;
|
186 |
-
?>" target="_blank"><?php
|
187 |
-
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
188 |
?></a></td>
|
189 |
-
<td><a class="pvcp-action-link" id="<?php
|
190 |
-
echo esc_attr( $dash_page->page_id ) ;
|
191 |
-
?>" href="<?php
|
192 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&duration=30&type=page&page_id=' . esc_attr( $dash_page->page_id ) ) ) ;
|
193 |
-
?>"><?php
|
194 |
-
esc_html_e( $dash_page->visit, PVCP_TEXT_DOMAIN );
|
195 |
?></a></td>
|
196 |
</tr>
|
197 |
-
<?php
|
198 |
-
}
|
199 |
-
}
|
200 |
-
?>
|
201 |
</tbody>
|
202 |
</table>
|
203 |
</div>
|
204 |
-
<?php
|
205 |
-
}
|
206 |
-
|
207 |
-
?>
|
208 |
|
209 |
</div>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$page_id_wpnonce = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_STRING );
|
9 |
+
$page_id = ( empty($page_id_wpnonce) ? '' : sanitize_text_field( wp_unslash( $page_id_wpnonce ) ) );
|
10 |
+
$duration = filter_input( INPUT_GET, 'duration', FILTER_SANITIZE_STRING );
|
11 |
+
$last_week = ( isset( $duration ) && '7' === $duration ? 'active' : '' );
|
12 |
+
$month_1 = ( isset( $duration ) && '30' === $duration ? 'active' : '' );
|
13 |
+
?>
|
14 |
|
15 |
|
16 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
17 |
|
18 |
+
<?php
|
19 |
+
|
20 |
+
if ( !empty($page_id) ) {
|
21 |
+
?>
|
22 |
<h2>
|
23 |
+
<?php
|
24 |
+
esc_html_e( get_the_title( $page_id ) . ' Page Summary', PVCP_TEXT_DOMAIN );
|
25 |
+
?>
|
26 |
+
<a class="add-new-btn back-button" id="back_button" href="<?php
|
27 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
28 |
?>">Back to Page List</a>
|
29 |
</h2>
|
30 |
<ul>
|
31 |
+
<li><a class="pvcp-action-link <?php
|
32 |
+
echo esc_attr( $last_week ) ;
|
33 |
+
?>" href="<?php
|
34 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&type=page&duration=7&page_id=' . esc_attr( $page_id ) ) ) ;
|
35 |
+
?>"><?php
|
36 |
+
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
37 |
?></a></li>
|
38 |
+
<li><a class="pvcp-action-link <?php
|
39 |
+
echo esc_attr( $month_1 ) ;
|
40 |
+
?>" href="<?php
|
41 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&type=page&duration=30&page_id=' . esc_attr( $page_id ) ) ) ;
|
42 |
+
?>"><?php
|
43 |
+
esc_html_e( '1 Month', PVCP_TEXT_DOMAIN );
|
44 |
?></a></li>
|
45 |
+
<?php
|
46 |
+
?>
|
47 |
</ul>
|
48 |
<!-- Page History Report-->
|
49 |
<div class="dash-page-history pvcp-table-cover">
|
50 |
+
<div id="chartContainerByPage<?php
|
51 |
+
echo esc_attr( $page_id ) ;
|
52 |
?>" class="chartContainerHeight"></div>
|
53 |
</div>
|
54 |
|
55 |
<!-- Top Page List -->
|
56 |
<div class="dash-top-page">
|
57 |
+
<h2><?php
|
58 |
+
esc_html_e( get_the_title( $page_id ) . ' Page Summary', PVCP_TEXT_DOMAIN );
|
59 |
?></h2>
|
60 |
<table class="pvcp-form-data-table display">
|
61 |
<thead>
|
62 |
<tr>
|
63 |
+
<th><?php
|
64 |
+
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
65 |
?></th>
|
66 |
+
<th><?php
|
67 |
+
esc_html_e( 'Browser Name', PVCP_TEXT_DOMAIN );
|
68 |
?></th>
|
69 |
+
<th><?php
|
70 |
+
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
71 |
?></th>
|
72 |
+
<th><?php
|
73 |
+
esc_html_e( 'Date', PVCP_TEXT_DOMAIN );
|
74 |
?></th>
|
75 |
+
<?php
|
76 |
+
?>
|
77 |
</tr>
|
78 |
</thead>
|
79 |
<tbody>
|
80 |
+
<?php
|
81 |
+
$page_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_history WHERE type = %s AND page_id = %d ORDER BY date DESC", 'page', $page_id ) );
|
82 |
+
//db call ok; no-cache ok
|
83 |
+
|
84 |
+
if ( $page_info ) {
|
85 |
+
$i = 1;
|
86 |
+
foreach ( $page_info as $in_page ) {
|
87 |
+
|
88 |
+
if ( "MSIE" === $in_page->browser_short_name ) {
|
89 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
90 |
+
} elseif ( "Firefox" === $in_page->browser_short_name ) {
|
91 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/firefox.png';
|
92 |
+
} elseif ( "Opera" === $in_page->browser_short_name ) {
|
93 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/opera.png';
|
94 |
+
} elseif ( "Chrome" === $in_page->browser_short_name ) {
|
95 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/chrome.png';
|
96 |
+
} elseif ( "Safari" === $in_page->browser_short_name ) {
|
97 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/safari.png';
|
98 |
+
} elseif ( "Netscape" === $in_page->browser_short_name ) {
|
99 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/netscape.png';
|
100 |
+
} elseif ( "Edge" === $in_page->browser_short_name ) {
|
101 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
102 |
+
} else {
|
103 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/other-bw.png';
|
104 |
+
}
|
105 |
+
|
106 |
+
?>
|
107 |
|
108 |
<tr>
|
109 |
+
<td><?php
|
110 |
+
esc_html_e( $i, PVCP_TEXT_DOMAIN );
|
111 |
?></td>
|
112 |
+
<td><img src="<?php
|
113 |
+
echo esc_url( $browser_url ) ;
|
114 |
+
?>" title="<?php
|
115 |
+
echo esc_attr( $in_page->browser_short_name ) ;
|
116 |
+
?>" alt="<?php
|
117 |
+
echo esc_attr( $in_page->browser_short_name ) ;
|
118 |
?>" width="16"></td>
|
119 |
+
<td><?php
|
120 |
+
esc_html_e( $in_page->ipaddress, PVCP_TEXT_DOMAIN );
|
121 |
?></td>
|
122 |
+
<td><?php
|
123 |
+
esc_html_e( $in_page->date, PVCP_TEXT_DOMAIN );
|
124 |
?></td>
|
125 |
+
<?php
|
126 |
+
?>
|
127 |
</tr>
|
128 |
+
<?php
|
129 |
+
$i++;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
?>
|
134 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
+
<?php
|
138 |
+
} else {
|
139 |
+
?>
|
140 |
<h2>
|
141 |
+
<?php
|
142 |
+
esc_html_e( 'Page Summary', PVCP_TEXT_DOMAIN );
|
143 |
+
?>
|
144 |
</h2>
|
145 |
<!-- Monthly Report -->
|
146 |
<div class="monthly-report pvcp-table-cover">
|
147 |
+
<h2><?php
|
148 |
+
esc_html_e( 'Monthly report', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerReportByMonthPage" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
|
153 |
<!-- Top Page List -->
|
154 |
<div class="dash-top-page">
|
155 |
+
<h2><?php
|
156 |
+
esc_html_e( 'Pages Summary', PVCP_TEXT_DOMAIN );
|
157 |
?></h2>
|
158 |
<table class="pvcp-form-data-table display">
|
159 |
<thead>
|
160 |
<tr>
|
161 |
+
<th><?php
|
162 |
+
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
163 |
?></th>
|
164 |
+
<th><?php
|
165 |
+
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
166 |
?></th>
|
167 |
+
<th><?php
|
168 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
169 |
?></th>
|
170 |
</tr>
|
171 |
</thead>
|
172 |
<tbody>
|
173 |
+
<?php
|
174 |
+
$top_pages = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type != 'post' GROUP BY page_id ORDER BY COUNT(id) DESC" );
|
175 |
+
//db call ok; no-cache ok
|
176 |
+
if ( $top_pages ) {
|
177 |
+
foreach ( $top_pages as $dash_page ) {
|
178 |
+
$pvcp_page_nonce = wp_create_nonce( 'pvcp-page-nonce' );
|
179 |
+
?>
|
180 |
<tr>
|
181 |
+
<td><?php
|
182 |
+
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
183 |
?></td>
|
184 |
+
<td><a href="<?php
|
185 |
+
echo esc_url( $dash_page->http_referer ) ;
|
186 |
+
?>" target="_blank"><?php
|
187 |
+
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
188 |
?></a></td>
|
189 |
+
<td><a class="pvcp-action-link" id="<?php
|
190 |
+
echo esc_attr( $dash_page->page_id ) ;
|
191 |
+
?>" href="<?php
|
192 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page&duration=30&type=page&page_id=' . esc_attr( $dash_page->page_id ) ) ) ;
|
193 |
+
?>"><?php
|
194 |
+
esc_html_e( $dash_page->visit, PVCP_TEXT_DOMAIN );
|
195 |
?></a></td>
|
196 |
</tr>
|
197 |
+
<?php
|
198 |
+
}
|
199 |
+
}
|
200 |
+
?>
|
201 |
</tbody>
|
202 |
</table>
|
203 |
</div>
|
204 |
+
<?php
|
205 |
+
}
|
206 |
+
|
207 |
+
?>
|
208 |
|
209 |
</div>
|
admin/partials/pvcp-plugin-dashboard-post.php
CHANGED
@@ -1,208 +1,208 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$post_id_wpnonce = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_STRING );
|
9 |
-
$post_ids = ( empty($post_id_wpnonce) ? '' : sanitize_text_field( wp_unslash( $post_id_wpnonce ) ) );
|
10 |
-
$duration = filter_input( INPUT_GET, 'duration', FILTER_SANITIZE_STRING );
|
11 |
-
$last_week = ( isset( $duration ) && '7' === $duration ? 'active' : '' );
|
12 |
-
$month_1 = ( isset( $duration ) && '30' === $duration ? 'active' : '' );
|
13 |
-
?>
|
14 |
|
15 |
|
16 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
17 |
|
18 |
-
<?php
|
19 |
-
|
20 |
-
if ( !empty($post_ids) ) {
|
21 |
-
?>
|
22 |
<h2>
|
23 |
-
<?php
|
24 |
-
esc_html_e( get_the_title( $post_ids ) . ' Post Summary', PVCP_TEXT_DOMAIN );
|
25 |
-
?>
|
26 |
-
<a class="add-new-btn back-button" id="back_button" href="<?php
|
27 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
28 |
?>">Back to Post List</a>
|
29 |
</h2>
|
30 |
<ul>
|
31 |
-
<li><a class="pvcp-action-link <?php
|
32 |
-
echo esc_attr( $last_week ) ;
|
33 |
-
?>" href="<?php
|
34 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&type=post&duration=7&page_id=' . esc_attr( $post_ids ) ) ) ;
|
35 |
-
?>"><?php
|
36 |
-
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
37 |
?></a></li>
|
38 |
-
<li><a class="pvcp-action-link <?php
|
39 |
-
echo esc_attr( $month_1 ) ;
|
40 |
-
?>" href="<?php
|
41 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&type=post&duration=30&page_id=' . esc_attr( $post_ids ) ) ) ;
|
42 |
-
?>"><?php
|
43 |
-
esc_html_e( '1 Month', PVCP_TEXT_DOMAIN );
|
44 |
?></a></li>
|
45 |
-
<?php
|
46 |
-
?>
|
47 |
</ul>
|
48 |
<!-- Post History -->
|
49 |
<div class="dash-post-history pvcp-table-cover">
|
50 |
-
<div id="chartContainerByPage<?php
|
51 |
-
echo esc_attr( $post_ids ) ;
|
52 |
?>" class="chartContainerHeight"></div>
|
53 |
</div>
|
54 |
|
55 |
<!-- Top Page List -->
|
56 |
<div class="dash-top-page">
|
57 |
-
<h2><?php
|
58 |
-
esc_html_e( get_the_title( $post_ids ) . ' Post Summary', PVCP_TEXT_DOMAIN );
|
59 |
?></h2>
|
60 |
<table class="pvcp-form-data-table display">
|
61 |
<thead>
|
62 |
<tr>
|
63 |
-
<th><?php
|
64 |
-
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
65 |
?></th>
|
66 |
-
<th><?php
|
67 |
-
esc_html_e( 'Browser Name', PVCP_TEXT_DOMAIN );
|
68 |
?></th>
|
69 |
-
<th><?php
|
70 |
-
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
71 |
?></th>
|
72 |
-
<th><?php
|
73 |
-
esc_html_e( 'Date', PVCP_TEXT_DOMAIN );
|
74 |
?></th>
|
75 |
-
<?php
|
76 |
-
?>
|
77 |
</tr>
|
78 |
</thead>
|
79 |
<tbody>
|
80 |
-
<?php
|
81 |
-
$post_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_history WHERE type = %s AND page_id = %d ORDER BY date DESC", 'post', $post_ids ) );
|
82 |
-
//db call ok; no-cache ok
|
83 |
-
|
84 |
-
if ( $post_info ) {
|
85 |
-
$i = 1;
|
86 |
-
// get browser icon
|
87 |
-
foreach ( $post_info as $in_post ) {
|
88 |
-
|
89 |
-
if ( "MSIE" === $in_post->browser_short_name ) {
|
90 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
91 |
-
} elseif ( "Firefox" === $in_post->browser_short_name ) {
|
92 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/firefox.png';
|
93 |
-
} elseif ( "Opera" === $in_post->browser_short_name ) {
|
94 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/opera.png';
|
95 |
-
} elseif ( "Chrome" === $in_post->browser_short_name ) {
|
96 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/chrome.png';
|
97 |
-
} elseif ( "Safari" === $in_post->browser_short_name ) {
|
98 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/safari.png';
|
99 |
-
} elseif ( "Netscape" === $in_post->browser_short_name ) {
|
100 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/netscape.png';
|
101 |
-
} elseif ( "Edge" === $in_post->browser_short_name ) {
|
102 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
103 |
-
} else {
|
104 |
-
$browser_url = PVCP_PLUGIN_URL . 'admin/images/other-bw.png';
|
105 |
-
}
|
106 |
-
|
107 |
-
?>
|
108 |
<tr>
|
109 |
-
<td><?php
|
110 |
-
esc_html_e( $i, PVCP_TEXT_DOMAIN );
|
111 |
?></td>
|
112 |
-
<td><img src="<?php
|
113 |
-
echo esc_url( $browser_url ) ;
|
114 |
-
?>" title="<?php
|
115 |
-
echo esc_attr( $in_post->browser_short_name ) ;
|
116 |
-
?>" alt="<?php
|
117 |
-
echo esc_attr( $in_post->browser_short_name ) ;
|
118 |
?>" width="16"></td>
|
119 |
-
<td><?php
|
120 |
-
esc_html_e( $in_post->ipaddress, PVCP_TEXT_DOMAIN );
|
121 |
?></td>
|
122 |
-
<td><?php
|
123 |
-
esc_html_e( $in_post->date, PVCP_TEXT_DOMAIN );
|
124 |
?></td>
|
125 |
-
<?php
|
126 |
-
?>
|
127 |
</tr>
|
128 |
-
<?php
|
129 |
-
$i++;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
?>
|
134 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
-
<?php
|
138 |
-
} else {
|
139 |
-
?>
|
140 |
<h2>
|
141 |
-
<?php
|
142 |
-
esc_html_e( 'Post Summary', PVCP_TEXT_DOMAIN );
|
143 |
-
?>
|
144 |
</h2>
|
145 |
<!-- Monthly Report -->
|
146 |
<div class="monthly-report pvcp-table-cover">
|
147 |
-
<h2><?php
|
148 |
-
esc_html_e( 'Monthly report', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerReportByMonthPost" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
|
153 |
<!-- Top Page List -->
|
154 |
<div class="dash-top-page">
|
155 |
-
<h2><?php
|
156 |
-
esc_html_e( 'Top Post', PVCP_TEXT_DOMAIN );
|
157 |
?></h2>
|
158 |
<table class="pvcp-form-data-table display">
|
159 |
<thead>
|
160 |
<tr>
|
161 |
-
<th><?php
|
162 |
-
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
163 |
?></th>
|
164 |
-
<th><?php
|
165 |
-
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
166 |
?></th>
|
167 |
-
<th><?php
|
168 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
169 |
?></th>
|
170 |
</tr>
|
171 |
</thead>
|
172 |
<tbody>
|
173 |
-
<?php
|
174 |
-
$top_post = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type='post' GROUP BY page_id ORDER BY COUNT(id) DESC" );
|
175 |
-
//db call ok; no-cache ok
|
176 |
-
if ( $top_post ) {
|
177 |
-
foreach ( $top_post as $t_post ) {
|
178 |
-
?>
|
179 |
<tr>
|
180 |
-
<td><?php
|
181 |
-
esc_html_e( get_the_title( $t_post->page_id ), PVCP_TEXT_DOMAIN );
|
182 |
?></td>
|
183 |
-
<td><a href="<?php
|
184 |
-
echo esc_url( $t_post->http_referer ) ;
|
185 |
-
?>" target="_blank"><?php
|
186 |
-
esc_html_e( get_the_title( $t_post->page_id ), PVCP_TEXT_DOMAIN );
|
187 |
?></a></td>
|
188 |
-
<td><a class="pvcp-action-link" id="<?php
|
189 |
-
echo esc_attr( $t_post->page_id ) ;
|
190 |
-
?>" href="<?php
|
191 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&duration=30&type=post&page_id=' . esc_attr( $t_post->page_id ) ) ) ;
|
192 |
-
?>"><?php
|
193 |
-
esc_html_e( $t_post->visit, PVCP_TEXT_DOMAIN );
|
194 |
?></a></td>
|
195 |
</tr>
|
196 |
-
<?php
|
197 |
-
}
|
198 |
-
}
|
199 |
-
?>
|
200 |
</tbody>
|
201 |
</table>
|
202 |
</div>
|
203 |
-
<?php
|
204 |
-
}
|
205 |
-
|
206 |
-
?>
|
207 |
|
208 |
</div>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$post_id_wpnonce = filter_input( INPUT_GET, 'page_id', FILTER_SANITIZE_STRING );
|
9 |
+
$post_ids = ( empty($post_id_wpnonce) ? '' : sanitize_text_field( wp_unslash( $post_id_wpnonce ) ) );
|
10 |
+
$duration = filter_input( INPUT_GET, 'duration', FILTER_SANITIZE_STRING );
|
11 |
+
$last_week = ( isset( $duration ) && '7' === $duration ? 'active' : '' );
|
12 |
+
$month_1 = ( isset( $duration ) && '30' === $duration ? 'active' : '' );
|
13 |
+
?>
|
14 |
|
15 |
|
16 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
17 |
|
18 |
+
<?php
|
19 |
+
|
20 |
+
if ( !empty($post_ids) ) {
|
21 |
+
?>
|
22 |
<h2>
|
23 |
+
<?php
|
24 |
+
esc_html_e( get_the_title( $post_ids ) . ' Post Summary', PVCP_TEXT_DOMAIN );
|
25 |
+
?>
|
26 |
+
<a class="add-new-btn back-button" id="back_button" href="<?php
|
27 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
28 |
?>">Back to Post List</a>
|
29 |
</h2>
|
30 |
<ul>
|
31 |
+
<li><a class="pvcp-action-link <?php
|
32 |
+
echo esc_attr( $last_week ) ;
|
33 |
+
?>" href="<?php
|
34 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&type=post&duration=7&page_id=' . esc_attr( $post_ids ) ) ) ;
|
35 |
+
?>"><?php
|
36 |
+
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
37 |
?></a></li>
|
38 |
+
<li><a class="pvcp-action-link <?php
|
39 |
+
echo esc_attr( $month_1 ) ;
|
40 |
+
?>" href="<?php
|
41 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&type=post&duration=30&page_id=' . esc_attr( $post_ids ) ) ) ;
|
42 |
+
?>"><?php
|
43 |
+
esc_html_e( '1 Month', PVCP_TEXT_DOMAIN );
|
44 |
?></a></li>
|
45 |
+
<?php
|
46 |
+
?>
|
47 |
</ul>
|
48 |
<!-- Post History -->
|
49 |
<div class="dash-post-history pvcp-table-cover">
|
50 |
+
<div id="chartContainerByPage<?php
|
51 |
+
echo esc_attr( $post_ids ) ;
|
52 |
?>" class="chartContainerHeight"></div>
|
53 |
</div>
|
54 |
|
55 |
<!-- Top Page List -->
|
56 |
<div class="dash-top-page">
|
57 |
+
<h2><?php
|
58 |
+
esc_html_e( get_the_title( $post_ids ) . ' Post Summary', PVCP_TEXT_DOMAIN );
|
59 |
?></h2>
|
60 |
<table class="pvcp-form-data-table display">
|
61 |
<thead>
|
62 |
<tr>
|
63 |
+
<th><?php
|
64 |
+
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
65 |
?></th>
|
66 |
+
<th><?php
|
67 |
+
esc_html_e( 'Browser Name', PVCP_TEXT_DOMAIN );
|
68 |
?></th>
|
69 |
+
<th><?php
|
70 |
+
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
71 |
?></th>
|
72 |
+
<th><?php
|
73 |
+
esc_html_e( 'Date', PVCP_TEXT_DOMAIN );
|
74 |
?></th>
|
75 |
+
<?php
|
76 |
+
?>
|
77 |
</tr>
|
78 |
</thead>
|
79 |
<tbody>
|
80 |
+
<?php
|
81 |
+
$post_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_history WHERE type = %s AND page_id = %d ORDER BY date DESC", 'post', $post_ids ) );
|
82 |
+
//db call ok; no-cache ok
|
83 |
+
|
84 |
+
if ( $post_info ) {
|
85 |
+
$i = 1;
|
86 |
+
// get browser icon
|
87 |
+
foreach ( $post_info as $in_post ) {
|
88 |
+
|
89 |
+
if ( "MSIE" === $in_post->browser_short_name ) {
|
90 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
91 |
+
} elseif ( "Firefox" === $in_post->browser_short_name ) {
|
92 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/firefox.png';
|
93 |
+
} elseif ( "Opera" === $in_post->browser_short_name ) {
|
94 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/opera.png';
|
95 |
+
} elseif ( "Chrome" === $in_post->browser_short_name ) {
|
96 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/chrome.png';
|
97 |
+
} elseif ( "Safari" === $in_post->browser_short_name ) {
|
98 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/safari.png';
|
99 |
+
} elseif ( "Netscape" === $in_post->browser_short_name ) {
|
100 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/netscape.png';
|
101 |
+
} elseif ( "Edge" === $in_post->browser_short_name ) {
|
102 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/ie.png';
|
103 |
+
} else {
|
104 |
+
$browser_url = PVCP_PLUGIN_URL . 'admin/images/other-bw.png';
|
105 |
+
}
|
106 |
+
|
107 |
+
?>
|
108 |
<tr>
|
109 |
+
<td><?php
|
110 |
+
esc_html_e( $i, PVCP_TEXT_DOMAIN );
|
111 |
?></td>
|
112 |
+
<td><img src="<?php
|
113 |
+
echo esc_url( $browser_url ) ;
|
114 |
+
?>" title="<?php
|
115 |
+
echo esc_attr( $in_post->browser_short_name ) ;
|
116 |
+
?>" alt="<?php
|
117 |
+
echo esc_attr( $in_post->browser_short_name ) ;
|
118 |
?>" width="16"></td>
|
119 |
+
<td><?php
|
120 |
+
esc_html_e( $in_post->ipaddress, PVCP_TEXT_DOMAIN );
|
121 |
?></td>
|
122 |
+
<td><?php
|
123 |
+
esc_html_e( $in_post->date, PVCP_TEXT_DOMAIN );
|
124 |
?></td>
|
125 |
+
<?php
|
126 |
+
?>
|
127 |
</tr>
|
128 |
+
<?php
|
129 |
+
$i++;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
?>
|
134 |
</tbody>
|
135 |
</table>
|
136 |
</div>
|
137 |
+
<?php
|
138 |
+
} else {
|
139 |
+
?>
|
140 |
<h2>
|
141 |
+
<?php
|
142 |
+
esc_html_e( 'Post Summary', PVCP_TEXT_DOMAIN );
|
143 |
+
?>
|
144 |
</h2>
|
145 |
<!-- Monthly Report -->
|
146 |
<div class="monthly-report pvcp-table-cover">
|
147 |
+
<h2><?php
|
148 |
+
esc_html_e( 'Monthly report', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerReportByMonthPost" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
|
153 |
<!-- Top Page List -->
|
154 |
<div class="dash-top-page">
|
155 |
+
<h2><?php
|
156 |
+
esc_html_e( 'Top Post', PVCP_TEXT_DOMAIN );
|
157 |
?></h2>
|
158 |
<table class="pvcp-form-data-table display">
|
159 |
<thead>
|
160 |
<tr>
|
161 |
+
<th><?php
|
162 |
+
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
163 |
?></th>
|
164 |
+
<th><?php
|
165 |
+
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
166 |
?></th>
|
167 |
+
<th><?php
|
168 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
169 |
?></th>
|
170 |
</tr>
|
171 |
</thead>
|
172 |
<tbody>
|
173 |
+
<?php
|
174 |
+
$top_post = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type='post' GROUP BY page_id ORDER BY COUNT(id) DESC" );
|
175 |
+
//db call ok; no-cache ok
|
176 |
+
if ( $top_post ) {
|
177 |
+
foreach ( $top_post as $t_post ) {
|
178 |
+
?>
|
179 |
<tr>
|
180 |
+
<td><?php
|
181 |
+
esc_html_e( get_the_title( $t_post->page_id ), PVCP_TEXT_DOMAIN );
|
182 |
?></td>
|
183 |
+
<td><a href="<?php
|
184 |
+
echo esc_url( $t_post->http_referer ) ;
|
185 |
+
?>" target="_blank"><?php
|
186 |
+
esc_html_e( get_the_title( $t_post->page_id ), PVCP_TEXT_DOMAIN );
|
187 |
?></a></td>
|
188 |
+
<td><a class="pvcp-action-link" id="<?php
|
189 |
+
echo esc_attr( $t_post->page_id ) ;
|
190 |
+
?>" href="<?php
|
191 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post&duration=30&type=post&page_id=' . esc_attr( $t_post->page_id ) ) ) ;
|
192 |
+
?>"><?php
|
193 |
+
esc_html_e( $t_post->visit, PVCP_TEXT_DOMAIN );
|
194 |
?></a></td>
|
195 |
</tr>
|
196 |
+
<?php
|
197 |
+
}
|
198 |
+
}
|
199 |
+
?>
|
200 |
</tbody>
|
201 |
</table>
|
202 |
</div>
|
203 |
+
<?php
|
204 |
+
}
|
205 |
+
|
206 |
+
?>
|
207 |
|
208 |
</div>
|
admin/partials/pvcp-plugin-dashboard.php
CHANGED
@@ -1,142 +1,142 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
?>
|
9 |
|
10 |
|
11 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
12 |
<h2>
|
13 |
-
<?php
|
14 |
-
esc_html_e( 'Dashboard', PVCP_TEXT_DOMAIN );
|
15 |
-
?>
|
16 |
</h2>
|
17 |
<div class="postbox-container" id="pvcp-postbox-container-1">
|
18 |
<!-- Top Summary -->
|
19 |
<div class="dash-summary pvcp-table-cover">
|
20 |
-
<h2><?php
|
21 |
-
esc_html_e( 'Website Summary', PVCP_TEXT_DOMAIN );
|
22 |
?></h2>
|
23 |
-
<?php
|
24 |
-
$currentDate = date( "Y/m/d" );
|
25 |
-
// current date
|
26 |
-
$yesterday = date( "Y/m/d", strtotime( "-1 days" ) );
|
27 |
-
// yesterday date
|
28 |
-
$lastWeek = date( "Y/m/d", strtotime( "-7 days" ) );
|
29 |
-
// last week date
|
30 |
-
$lastMonth = date( "Y/m/d", strtotime( "-1 month" ) );
|
31 |
-
// last month date
|
32 |
-
$lastyear = date( "Y/m/d", strtotime( "-1 year" ) );
|
33 |
-
// last tear date
|
34 |
-
// Site Visit Count
|
35 |
-
$today_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $currentDate ) );
|
36 |
-
//db call ok; no-cache ok
|
37 |
-
$yesterday_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $yesterday ) );
|
38 |
-
//db call ok; no-cache ok
|
39 |
-
$last_week_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastWeek, $currentDate ) );
|
40 |
-
//db call ok; no-cache ok
|
41 |
-
$last_month_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastMonth, $currentDate ) );
|
42 |
-
//db call ok; no-cache ok
|
43 |
-
$last_year_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastyear, $currentDate ) );
|
44 |
-
//db call ok; no-cache ok
|
45 |
-
$total_count_visit = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history" );
|
46 |
-
//db call ok; no-cache ok
|
47 |
-
// Site Visitor Count
|
48 |
-
$today_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $currentDate ) );
|
49 |
-
//db call ok; no-cache ok
|
50 |
-
$yesterday_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $yesterday ) );
|
51 |
-
//db call ok; no-cache ok
|
52 |
-
$last_week_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastWeek, $currentDate ) );
|
53 |
-
//db call ok; no-cache ok
|
54 |
-
$last_month_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastMonth, $currentDate ) );
|
55 |
-
//db call ok; no-cache ok
|
56 |
-
$last_year_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastyear, $currentDate ) );
|
57 |
-
//db call ok; no-cache ok
|
58 |
-
$total_count_visitor = $wpdb->get_var( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history" );
|
59 |
-
//db call ok; no-cache ok
|
60 |
-
?>
|
61 |
<table class="form-table">
|
62 |
<thead>
|
63 |
<tr>
|
64 |
-
<th width="60%"><?php
|
65 |
-
esc_html_e( '', PVCP_TEXT_DOMAIN );
|
66 |
?></th>
|
67 |
-
<th><?php
|
68 |
-
esc_html_e( 'Visitors', PVCP_TEXT_DOMAIN );
|
69 |
?></th>
|
70 |
-
<th><?php
|
71 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
72 |
?></th>
|
73 |
</tr>
|
74 |
</thead>
|
75 |
<tbody>
|
76 |
<tr>
|
77 |
-
<td><?php
|
78 |
-
esc_html_e( 'Today', PVCP_TEXT_DOMAIN );
|
79 |
?></td>
|
80 |
-
<td><?php
|
81 |
-
esc_html_e( $today_count_visitor, PVCP_TEXT_DOMAIN );
|
82 |
?></td>
|
83 |
-
<td><?php
|
84 |
-
esc_html_e( $today_count_visit, PVCP_TEXT_DOMAIN );
|
85 |
?></td>
|
86 |
</tr>
|
87 |
<tr>
|
88 |
-
<td><?php
|
89 |
-
esc_html_e( 'Yesterday', PVCP_TEXT_DOMAIN );
|
90 |
?></td>
|
91 |
-
<td><?php
|
92 |
-
esc_html_e( $yesterday_count_visitor, PVCP_TEXT_DOMAIN );
|
93 |
?></td>
|
94 |
-
<td><?php
|
95 |
-
esc_html_e( $yesterday_count_visit, PVCP_TEXT_DOMAIN );
|
96 |
?></td>
|
97 |
</tr>
|
98 |
<tr>
|
99 |
-
<td><?php
|
100 |
-
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
101 |
?></td>
|
102 |
-
<td><?php
|
103 |
-
esc_html_e( $last_week_count_visitor, PVCP_TEXT_DOMAIN );
|
104 |
?></td>
|
105 |
-
<td><?php
|
106 |
-
esc_html_e( $last_week_count_visit, PVCP_TEXT_DOMAIN );
|
107 |
?></td>
|
108 |
</tr>
|
109 |
<tr>
|
110 |
-
<td><?php
|
111 |
-
esc_html_e( 'Last Month', PVCP_TEXT_DOMAIN );
|
112 |
?></td>
|
113 |
-
<td><?php
|
114 |
-
esc_html_e( $last_month_count_visitor, PVCP_TEXT_DOMAIN );
|
115 |
?></td>
|
116 |
-
<td><?php
|
117 |
-
esc_html_e( $last_month_count_visit, PVCP_TEXT_DOMAIN );
|
118 |
?></td>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
-
<td><?php
|
122 |
-
esc_html_e( 'Last Year', PVCP_TEXT_DOMAIN );
|
123 |
?></td>
|
124 |
-
<td><?php
|
125 |
-
esc_html_e( $total_count_visitor, PVCP_TEXT_DOMAIN );
|
126 |
?></td>
|
127 |
-
<td><?php
|
128 |
-
esc_html_e( $total_count_visit, PVCP_TEXT_DOMAIN );
|
129 |
?></td>
|
130 |
</tr>
|
131 |
<tr>
|
132 |
-
<td><?php
|
133 |
-
esc_html_e( 'Total', PVCP_TEXT_DOMAIN );
|
134 |
?></td>
|
135 |
-
<td><?php
|
136 |
-
esc_html_e( $last_year_count_visitor, PVCP_TEXT_DOMAIN );
|
137 |
?></td>
|
138 |
-
<td><?php
|
139 |
-
esc_html_e( $last_year_count_visit, PVCP_TEXT_DOMAIN );
|
140 |
?></td>
|
141 |
</tr>
|
142 |
</tbody>
|
@@ -144,73 +144,73 @@ esc_html_e( $last_year_count_visit, PVCP_TEXT_DOMAIN );
|
|
144 |
</div>
|
145 |
<!-- Top Browser History -->
|
146 |
<div class="dash-browser-history pvcp-table-cover">
|
147 |
-
<h2><?php
|
148 |
-
esc_html_e( 'Site Visit By Browser', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerByBrowser" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
<!-- Top Os History -->
|
153 |
<div class="dash-os-history pvcp-table-cover">
|
154 |
-
<h2><?php
|
155 |
-
esc_html_e( 'Site Visit By OS', PVCP_TEXT_DOMAIN );
|
156 |
?></h2>
|
157 |
<div id="chartContainerByOs" class="chartContainerHeight"></div>
|
158 |
</div>
|
159 |
-
<?php
|
160 |
-
?>
|
161 |
<!-- Refer URL List-->
|
162 |
<div class="dash-top-referer pvcp-table-cover">
|
163 |
-
<h2><?php
|
164 |
-
esc_html_e( 'Top 10 Referral Website', PVCP_TEXT_DOMAIN );
|
165 |
?></h2>
|
166 |
<table class="form-table">
|
167 |
<thead>
|
168 |
<tr>
|
169 |
-
<th><?php
|
170 |
-
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
171 |
?></th>
|
172 |
-
<th><?php
|
173 |
-
esc_html_e( 'Referer URL', PVCP_TEXT_DOMAIN );
|
174 |
?></th>
|
175 |
-
<th><?php
|
176 |
-
esc_html_e( 'Count', PVCP_TEXT_DOMAIN );
|
177 |
?></th>
|
178 |
</tr>
|
179 |
</thead>
|
180 |
<tbody>
|
181 |
-
<?php
|
182 |
-
$top_reff = $wpdb->get_results( "SELECT ref_url, count(ref_url) AS total FROM {$wpdb->prefix}page_visit_referer GROUP BY ref_url ORDER BY COUNT(ref_url) DESC LIMIT 10" );
|
183 |
-
//db call ok; no-cache ok
|
184 |
-
|
185 |
-
if ( $top_reff ) {
|
186 |
-
$reff_i = 1;
|
187 |
-
foreach ( $top_reff as $dash_reff ) {
|
188 |
-
?>
|
189 |
<tr>
|
190 |
-
<td><?php
|
191 |
-
esc_html_e( $reff_i, PVCP_TEXT_DOMAIN );
|
192 |
?></td>
|
193 |
-
<td><?php
|
194 |
-
esc_html_e( $dash_reff->ref_url, PVCP_TEXT_DOMAIN );
|
195 |
?></td>
|
196 |
-
<td><?php
|
197 |
-
esc_html_e( $dash_reff->total, PVCP_TEXT_DOMAIN );
|
198 |
?></td>
|
199 |
</tr>
|
200 |
-
<?php
|
201 |
-
$reff_i++;
|
202 |
-
}
|
203 |
-
} else {
|
204 |
-
?>
|
205 |
<tr>
|
206 |
-
<td colspan="3"><?php
|
207 |
-
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
208 |
?></td>
|
209 |
</tr>
|
210 |
-
<?php
|
211 |
-
}
|
212 |
-
|
213 |
-
?>
|
214 |
</tbody>
|
215 |
</table>
|
216 |
</div>
|
@@ -218,189 +218,189 @@ if ( $top_reff ) {
|
|
218 |
</div>
|
219 |
|
220 |
<div class="postbox-container" id="pvcp-postbox-container-2">
|
221 |
-
<?php
|
222 |
-
?>
|
223 |
<!-- Top Page List -->
|
224 |
<div class="dash-top-page pvcp-table-cover">
|
225 |
<div class="for-button-outer">
|
226 |
-
<a href="<?php
|
227 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
228 |
?>" class="handlediv button-link wps-more" type="button" id="wps_top_visitors_more_button" aria-expanded="true">
|
229 |
<span class="dashicons dashicons-external"></span>
|
230 |
<span class="screen-reader-text">More Details</span>
|
231 |
</a>
|
232 |
-
<h2><?php
|
233 |
-
esc_html_e( 'Top 10 Pages', PVCP_TEXT_DOMAIN );
|
234 |
?></h2>
|
235 |
</div>
|
236 |
<table class="form-table">
|
237 |
<thead>
|
238 |
<tr>
|
239 |
-
<th><?php
|
240 |
-
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
241 |
?></th>
|
242 |
-
<th><?php
|
243 |
-
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
244 |
?></th>
|
245 |
-
<th><?php
|
246 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
247 |
?></th>
|
248 |
</tr>
|
249 |
</thead>
|
250 |
<tbody>
|
251 |
-
<?php
|
252 |
-
$top_pages = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type NOT IN ('post') GROUP BY page_id ORDER BY COUNT(id) DESC LIMIT 10" );
|
253 |
-
//db call ok; no-cache ok
|
254 |
-
|
255 |
-
if ( $top_pages ) {
|
256 |
-
foreach ( $top_pages as $dash_page ) {
|
257 |
-
?>
|
258 |
<tr>
|
259 |
-
<td><?php
|
260 |
-
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
261 |
?></td>
|
262 |
-
<td><a href="<?php
|
263 |
-
echo esc_url( $dash_page->http_referer ) ;
|
264 |
-
?>" target="_blank"><?php
|
265 |
-
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
266 |
?></a></td>
|
267 |
-
<td><?php
|
268 |
-
esc_html_e( $dash_page->visit, PVCP_TEXT_DOMAIN );
|
269 |
?></td>
|
270 |
</tr>
|
271 |
-
<?php
|
272 |
-
}
|
273 |
-
} else {
|
274 |
-
?>
|
275 |
<tr>
|
276 |
-
<td colspan="3"><?php
|
277 |
-
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
278 |
?></td>
|
279 |
</tr>
|
280 |
-
<?php
|
281 |
-
}
|
282 |
-
|
283 |
-
?>
|
284 |
</tbody>
|
285 |
</table>
|
286 |
</div>
|
287 |
<!-- Top Post List -->
|
288 |
<div class="dash-top-post pvcp-table-cover">
|
289 |
<div class="for-button-outer">
|
290 |
-
<a href="<?php
|
291 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
292 |
?>"class="handlediv button-link wps-more" type="button" id="wps_top_visitors_more_button" aria-expanded="true">
|
293 |
<span class="dashicons dashicons-external"></span>
|
294 |
<span class="screen-reader-text">More Details</span>
|
295 |
</a>
|
296 |
-
<h2><?php
|
297 |
-
esc_html_e( 'Top 10 Posts', PVCP_TEXT_DOMAIN );
|
298 |
?></h2>
|
299 |
</div>
|
300 |
<table class="form-table">
|
301 |
<thead>
|
302 |
<tr>
|
303 |
-
<th><?php
|
304 |
-
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
305 |
?></th>
|
306 |
-
<th><?php
|
307 |
-
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
308 |
?></th>
|
309 |
-
<th><?php
|
310 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
311 |
?></th>
|
312 |
</tr>
|
313 |
</thead>
|
314 |
<tbody>
|
315 |
-
<?php
|
316 |
-
$top_post = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type='post' GROUP BY page_id ORDER BY COUNT(id) DESC LIMIT 10" );
|
317 |
-
//db call ok; no-cache ok
|
318 |
-
|
319 |
-
if ( $top_post ) {
|
320 |
-
foreach ( $top_post as $dash_post ) {
|
321 |
-
?>
|
322 |
<tr>
|
323 |
-
<td><?php
|
324 |
-
esc_html_e( get_the_title( $dash_post->page_id ), PVCP_TEXT_DOMAIN );
|
325 |
?></td>
|
326 |
-
<td><a href="<?php
|
327 |
-
echo esc_url( $dash_post->http_referer ) ;
|
328 |
-
?>" target="_blank"><?php
|
329 |
-
esc_html_e( get_the_title( $dash_post->page_id ), PVCP_TEXT_DOMAIN );
|
330 |
?></a></td>
|
331 |
-
<td><?php
|
332 |
-
esc_html_e( $dash_post->visit, PVCP_TEXT_DOMAIN );
|
333 |
?></td>
|
334 |
</tr>
|
335 |
-
<?php
|
336 |
-
}
|
337 |
-
} else {
|
338 |
-
?>
|
339 |
<tr>
|
340 |
-
<td colspan="3"><?php
|
341 |
-
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
342 |
?></td>
|
343 |
</tr>
|
344 |
-
<?php
|
345 |
-
}
|
346 |
-
|
347 |
-
?>
|
348 |
</tbody>
|
349 |
</table>
|
350 |
</div>
|
351 |
<!-- Top IP Address -->
|
352 |
<div class="dash-top-ip pvcp-table-cover">
|
353 |
-
<h2><?php
|
354 |
-
esc_html_e( 'Top 10 IPs', PVCP_TEXT_DOMAIN );
|
355 |
?></h2>
|
356 |
<table class="form-table">
|
357 |
<thead>
|
358 |
<tr>
|
359 |
-
<th><?php
|
360 |
-
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
361 |
?></th>
|
362 |
-
<th><?php
|
363 |
-
esc_html_e( 'Visitor', PVCP_TEXT_DOMAIN );
|
364 |
?></th>
|
365 |
-
<th><?php
|
366 |
-
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
367 |
?></th>
|
368 |
</tr>
|
369 |
</thead>
|
370 |
<tbody>
|
371 |
-
<?php
|
372 |
-
$top_ip = $wpdb->get_results( "SELECT ipaddress,count(id) AS visit FROM {$wpdb->prefix}page_visit_history GROUP BY ipaddress ORDER BY COUNT(id) DESC LIMIT 10" );
|
373 |
-
//db call ok; no-cache ok
|
374 |
-
|
375 |
-
if ( $top_ip ) {
|
376 |
-
foreach ( $top_ip as $dash_ip ) {
|
377 |
-
$ip_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE ipaddress = %s", $dash_ip->ipaddress ) );
|
378 |
-
//db call ok; no-cache ok
|
379 |
-
?>
|
380 |
<tr>
|
381 |
-
<td><?php
|
382 |
-
esc_html_e( $dash_ip->ipaddress );
|
383 |
?></td>
|
384 |
-
<td><?php
|
385 |
-
esc_html_e( $ip_visitor, PVCP_TEXT_DOMAIN );
|
386 |
?></td>
|
387 |
-
<td><?php
|
388 |
-
esc_html_e( $dash_ip->visit, PVCP_TEXT_DOMAIN );
|
389 |
?></td>
|
390 |
</tr>
|
391 |
-
<?php
|
392 |
-
}
|
393 |
-
} else {
|
394 |
-
?>
|
395 |
<tr>
|
396 |
-
<td colspan="3"><?php
|
397 |
-
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
398 |
?></td>
|
399 |
</tr>
|
400 |
-
<?php
|
401 |
-
}
|
402 |
-
|
403 |
-
?>
|
404 |
</tbody>
|
405 |
</table>
|
406 |
</div>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
?>
|
9 |
|
10 |
|
11 |
<div class="pvcp-main-dashboard full-cl res-cl">
|
12 |
<h2>
|
13 |
+
<?php
|
14 |
+
esc_html_e( 'Dashboard', PVCP_TEXT_DOMAIN );
|
15 |
+
?>
|
16 |
</h2>
|
17 |
<div class="postbox-container" id="pvcp-postbox-container-1">
|
18 |
<!-- Top Summary -->
|
19 |
<div class="dash-summary pvcp-table-cover">
|
20 |
+
<h2><?php
|
21 |
+
esc_html_e( 'Website Summary', PVCP_TEXT_DOMAIN );
|
22 |
?></h2>
|
23 |
+
<?php
|
24 |
+
$currentDate = date( "Y/m/d" );
|
25 |
+
// current date
|
26 |
+
$yesterday = date( "Y/m/d", strtotime( "-1 days" ) );
|
27 |
+
// yesterday date
|
28 |
+
$lastWeek = date( "Y/m/d", strtotime( "-7 days" ) );
|
29 |
+
// last week date
|
30 |
+
$lastMonth = date( "Y/m/d", strtotime( "-1 month" ) );
|
31 |
+
// last month date
|
32 |
+
$lastyear = date( "Y/m/d", strtotime( "-1 year" ) );
|
33 |
+
// last tear date
|
34 |
+
// Site Visit Count
|
35 |
+
$today_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $currentDate ) );
|
36 |
+
//db call ok; no-cache ok
|
37 |
+
$yesterday_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $yesterday ) );
|
38 |
+
//db call ok; no-cache ok
|
39 |
+
$last_week_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastWeek, $currentDate ) );
|
40 |
+
//db call ok; no-cache ok
|
41 |
+
$last_month_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastMonth, $currentDate ) );
|
42 |
+
//db call ok; no-cache ok
|
43 |
+
$last_year_count_visit = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastyear, $currentDate ) );
|
44 |
+
//db call ok; no-cache ok
|
45 |
+
$total_count_visit = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}page_visit_history" );
|
46 |
+
//db call ok; no-cache ok
|
47 |
+
// Site Visitor Count
|
48 |
+
$today_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $currentDate ) );
|
49 |
+
//db call ok; no-cache ok
|
50 |
+
$yesterday_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date = %s", $yesterday ) );
|
51 |
+
//db call ok; no-cache ok
|
52 |
+
$last_week_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastWeek, $currentDate ) );
|
53 |
+
//db call ok; no-cache ok
|
54 |
+
$last_month_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastMonth, $currentDate ) );
|
55 |
+
//db call ok; no-cache ok
|
56 |
+
$last_year_count_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE date BETWEEN %s AND %s", $lastyear, $currentDate ) );
|
57 |
+
//db call ok; no-cache ok
|
58 |
+
$total_count_visitor = $wpdb->get_var( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history" );
|
59 |
+
//db call ok; no-cache ok
|
60 |
+
?>
|
61 |
<table class="form-table">
|
62 |
<thead>
|
63 |
<tr>
|
64 |
+
<th width="60%"><?php
|
65 |
+
esc_html_e( '', PVCP_TEXT_DOMAIN );
|
66 |
?></th>
|
67 |
+
<th><?php
|
68 |
+
esc_html_e( 'Visitors', PVCP_TEXT_DOMAIN );
|
69 |
?></th>
|
70 |
+
<th><?php
|
71 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
72 |
?></th>
|
73 |
</tr>
|
74 |
</thead>
|
75 |
<tbody>
|
76 |
<tr>
|
77 |
+
<td><?php
|
78 |
+
esc_html_e( 'Today', PVCP_TEXT_DOMAIN );
|
79 |
?></td>
|
80 |
+
<td><?php
|
81 |
+
esc_html_e( $today_count_visitor, PVCP_TEXT_DOMAIN );
|
82 |
?></td>
|
83 |
+
<td><?php
|
84 |
+
esc_html_e( $today_count_visit, PVCP_TEXT_DOMAIN );
|
85 |
?></td>
|
86 |
</tr>
|
87 |
<tr>
|
88 |
+
<td><?php
|
89 |
+
esc_html_e( 'Yesterday', PVCP_TEXT_DOMAIN );
|
90 |
?></td>
|
91 |
+
<td><?php
|
92 |
+
esc_html_e( $yesterday_count_visitor, PVCP_TEXT_DOMAIN );
|
93 |
?></td>
|
94 |
+
<td><?php
|
95 |
+
esc_html_e( $yesterday_count_visit, PVCP_TEXT_DOMAIN );
|
96 |
?></td>
|
97 |
</tr>
|
98 |
<tr>
|
99 |
+
<td><?php
|
100 |
+
esc_html_e( 'Last Week', PVCP_TEXT_DOMAIN );
|
101 |
?></td>
|
102 |
+
<td><?php
|
103 |
+
esc_html_e( $last_week_count_visitor, PVCP_TEXT_DOMAIN );
|
104 |
?></td>
|
105 |
+
<td><?php
|
106 |
+
esc_html_e( $last_week_count_visit, PVCP_TEXT_DOMAIN );
|
107 |
?></td>
|
108 |
</tr>
|
109 |
<tr>
|
110 |
+
<td><?php
|
111 |
+
esc_html_e( 'Last Month', PVCP_TEXT_DOMAIN );
|
112 |
?></td>
|
113 |
+
<td><?php
|
114 |
+
esc_html_e( $last_month_count_visitor, PVCP_TEXT_DOMAIN );
|
115 |
?></td>
|
116 |
+
<td><?php
|
117 |
+
esc_html_e( $last_month_count_visit, PVCP_TEXT_DOMAIN );
|
118 |
?></td>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
+
<td><?php
|
122 |
+
esc_html_e( 'Last Year', PVCP_TEXT_DOMAIN );
|
123 |
?></td>
|
124 |
+
<td><?php
|
125 |
+
esc_html_e( $total_count_visitor, PVCP_TEXT_DOMAIN );
|
126 |
?></td>
|
127 |
+
<td><?php
|
128 |
+
esc_html_e( $total_count_visit, PVCP_TEXT_DOMAIN );
|
129 |
?></td>
|
130 |
</tr>
|
131 |
<tr>
|
132 |
+
<td><?php
|
133 |
+
esc_html_e( 'Total', PVCP_TEXT_DOMAIN );
|
134 |
?></td>
|
135 |
+
<td><?php
|
136 |
+
esc_html_e( $last_year_count_visitor, PVCP_TEXT_DOMAIN );
|
137 |
?></td>
|
138 |
+
<td><?php
|
139 |
+
esc_html_e( $last_year_count_visit, PVCP_TEXT_DOMAIN );
|
140 |
?></td>
|
141 |
</tr>
|
142 |
</tbody>
|
144 |
</div>
|
145 |
<!-- Top Browser History -->
|
146 |
<div class="dash-browser-history pvcp-table-cover">
|
147 |
+
<h2><?php
|
148 |
+
esc_html_e( 'Site Visit By Browser', PVCP_TEXT_DOMAIN );
|
149 |
?></h2>
|
150 |
<div id="chartContainerByBrowser" class="chartContainerHeight"></div>
|
151 |
</div>
|
152 |
<!-- Top Os History -->
|
153 |
<div class="dash-os-history pvcp-table-cover">
|
154 |
+
<h2><?php
|
155 |
+
esc_html_e( 'Site Visit By OS', PVCP_TEXT_DOMAIN );
|
156 |
?></h2>
|
157 |
<div id="chartContainerByOs" class="chartContainerHeight"></div>
|
158 |
</div>
|
159 |
+
<?php
|
160 |
+
?>
|
161 |
<!-- Refer URL List-->
|
162 |
<div class="dash-top-referer pvcp-table-cover">
|
163 |
+
<h2><?php
|
164 |
+
esc_html_e( 'Top 10 Referral Website', PVCP_TEXT_DOMAIN );
|
165 |
?></h2>
|
166 |
<table class="form-table">
|
167 |
<thead>
|
168 |
<tr>
|
169 |
+
<th><?php
|
170 |
+
esc_html_e( 'ID', PVCP_TEXT_DOMAIN );
|
171 |
?></th>
|
172 |
+
<th><?php
|
173 |
+
esc_html_e( 'Referer URL', PVCP_TEXT_DOMAIN );
|
174 |
?></th>
|
175 |
+
<th><?php
|
176 |
+
esc_html_e( 'Count', PVCP_TEXT_DOMAIN );
|
177 |
?></th>
|
178 |
</tr>
|
179 |
</thead>
|
180 |
<tbody>
|
181 |
+
<?php
|
182 |
+
$top_reff = $wpdb->get_results( "SELECT ref_url, count(ref_url) AS total FROM {$wpdb->prefix}page_visit_referer GROUP BY ref_url ORDER BY COUNT(ref_url) DESC LIMIT 10" );
|
183 |
+
//db call ok; no-cache ok
|
184 |
+
|
185 |
+
if ( $top_reff ) {
|
186 |
+
$reff_i = 1;
|
187 |
+
foreach ( $top_reff as $dash_reff ) {
|
188 |
+
?>
|
189 |
<tr>
|
190 |
+
<td><?php
|
191 |
+
esc_html_e( $reff_i, PVCP_TEXT_DOMAIN );
|
192 |
?></td>
|
193 |
+
<td><?php
|
194 |
+
esc_html_e( $dash_reff->ref_url, PVCP_TEXT_DOMAIN );
|
195 |
?></td>
|
196 |
+
<td><?php
|
197 |
+
esc_html_e( $dash_reff->total, PVCP_TEXT_DOMAIN );
|
198 |
?></td>
|
199 |
</tr>
|
200 |
+
<?php
|
201 |
+
$reff_i++;
|
202 |
+
}
|
203 |
+
} else {
|
204 |
+
?>
|
205 |
<tr>
|
206 |
+
<td colspan="3"><?php
|
207 |
+
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
208 |
?></td>
|
209 |
</tr>
|
210 |
+
<?php
|
211 |
+
}
|
212 |
+
|
213 |
+
?>
|
214 |
</tbody>
|
215 |
</table>
|
216 |
</div>
|
218 |
</div>
|
219 |
|
220 |
<div class="postbox-container" id="pvcp-postbox-container-2">
|
221 |
+
<?php
|
222 |
+
?>
|
223 |
<!-- Top Page List -->
|
224 |
<div class="dash-top-page pvcp-table-cover">
|
225 |
<div class="for-button-outer">
|
226 |
+
<a href="<?php
|
227 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-page' ) ) ;
|
228 |
?>" class="handlediv button-link wps-more" type="button" id="wps_top_visitors_more_button" aria-expanded="true">
|
229 |
<span class="dashicons dashicons-external"></span>
|
230 |
<span class="screen-reader-text">More Details</span>
|
231 |
</a>
|
232 |
+
<h2><?php
|
233 |
+
esc_html_e( 'Top 10 Pages', PVCP_TEXT_DOMAIN );
|
234 |
?></h2>
|
235 |
</div>
|
236 |
<table class="form-table">
|
237 |
<thead>
|
238 |
<tr>
|
239 |
+
<th><?php
|
240 |
+
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
241 |
?></th>
|
242 |
+
<th><?php
|
243 |
+
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
244 |
?></th>
|
245 |
+
<th><?php
|
246 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
247 |
?></th>
|
248 |
</tr>
|
249 |
</thead>
|
250 |
<tbody>
|
251 |
+
<?php
|
252 |
+
$top_pages = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type NOT IN ('post') GROUP BY page_id ORDER BY COUNT(id) DESC LIMIT 10" );
|
253 |
+
//db call ok; no-cache ok
|
254 |
+
|
255 |
+
if ( $top_pages ) {
|
256 |
+
foreach ( $top_pages as $dash_page ) {
|
257 |
+
?>
|
258 |
<tr>
|
259 |
+
<td><?php
|
260 |
+
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
261 |
?></td>
|
262 |
+
<td><a href="<?php
|
263 |
+
echo esc_url( $dash_page->http_referer ) ;
|
264 |
+
?>" target="_blank"><?php
|
265 |
+
esc_html_e( get_the_title( $dash_page->page_id ), PVCP_TEXT_DOMAIN );
|
266 |
?></a></td>
|
267 |
+
<td><?php
|
268 |
+
esc_html_e( $dash_page->visit, PVCP_TEXT_DOMAIN );
|
269 |
?></td>
|
270 |
</tr>
|
271 |
+
<?php
|
272 |
+
}
|
273 |
+
} else {
|
274 |
+
?>
|
275 |
<tr>
|
276 |
+
<td colspan="3"><?php
|
277 |
+
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
278 |
?></td>
|
279 |
</tr>
|
280 |
+
<?php
|
281 |
+
}
|
282 |
+
|
283 |
+
?>
|
284 |
</tbody>
|
285 |
</table>
|
286 |
</div>
|
287 |
<!-- Top Post List -->
|
288 |
<div class="dash-top-post pvcp-table-cover">
|
289 |
<div class="for-button-outer">
|
290 |
+
<a href="<?php
|
291 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-dashboard-post' ) ) ;
|
292 |
?>"class="handlediv button-link wps-more" type="button" id="wps_top_visitors_more_button" aria-expanded="true">
|
293 |
<span class="dashicons dashicons-external"></span>
|
294 |
<span class="screen-reader-text">More Details</span>
|
295 |
</a>
|
296 |
+
<h2><?php
|
297 |
+
esc_html_e( 'Top 10 Posts', PVCP_TEXT_DOMAIN );
|
298 |
?></h2>
|
299 |
</div>
|
300 |
<table class="form-table">
|
301 |
<thead>
|
302 |
<tr>
|
303 |
+
<th><?php
|
304 |
+
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
305 |
?></th>
|
306 |
+
<th><?php
|
307 |
+
esc_html_e( 'Link', PVCP_TEXT_DOMAIN );
|
308 |
?></th>
|
309 |
+
<th><?php
|
310 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
311 |
?></th>
|
312 |
</tr>
|
313 |
</thead>
|
314 |
<tbody>
|
315 |
+
<?php
|
316 |
+
$top_post = $wpdb->get_results( "SELECT page_id,http_referer,count(id) AS visit FROM {$wpdb->prefix}page_visit_history WHERE type='post' GROUP BY page_id ORDER BY COUNT(id) DESC LIMIT 10" );
|
317 |
+
//db call ok; no-cache ok
|
318 |
+
|
319 |
+
if ( $top_post ) {
|
320 |
+
foreach ( $top_post as $dash_post ) {
|
321 |
+
?>
|
322 |
<tr>
|
323 |
+
<td><?php
|
324 |
+
esc_html_e( get_the_title( $dash_post->page_id ), PVCP_TEXT_DOMAIN );
|
325 |
?></td>
|
326 |
+
<td><a href="<?php
|
327 |
+
echo esc_url( $dash_post->http_referer ) ;
|
328 |
+
?>" target="_blank"><?php
|
329 |
+
esc_html_e( get_the_title( $dash_post->page_id ), PVCP_TEXT_DOMAIN );
|
330 |
?></a></td>
|
331 |
+
<td><?php
|
332 |
+
esc_html_e( $dash_post->visit, PVCP_TEXT_DOMAIN );
|
333 |
?></td>
|
334 |
</tr>
|
335 |
+
<?php
|
336 |
+
}
|
337 |
+
} else {
|
338 |
+
?>
|
339 |
<tr>
|
340 |
+
<td colspan="3"><?php
|
341 |
+
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
342 |
?></td>
|
343 |
</tr>
|
344 |
+
<?php
|
345 |
+
}
|
346 |
+
|
347 |
+
?>
|
348 |
</tbody>
|
349 |
</table>
|
350 |
</div>
|
351 |
<!-- Top IP Address -->
|
352 |
<div class="dash-top-ip pvcp-table-cover">
|
353 |
+
<h2><?php
|
354 |
+
esc_html_e( 'Top 10 IPs', PVCP_TEXT_DOMAIN );
|
355 |
?></h2>
|
356 |
<table class="form-table">
|
357 |
<thead>
|
358 |
<tr>
|
359 |
+
<th><?php
|
360 |
+
esc_html_e( 'IP Address', PVCP_TEXT_DOMAIN );
|
361 |
?></th>
|
362 |
+
<th><?php
|
363 |
+
esc_html_e( 'Visitor', PVCP_TEXT_DOMAIN );
|
364 |
?></th>
|
365 |
+
<th><?php
|
366 |
+
esc_html_e( 'Visit', PVCP_TEXT_DOMAIN );
|
367 |
?></th>
|
368 |
</tr>
|
369 |
</thead>
|
370 |
<tbody>
|
371 |
+
<?php
|
372 |
+
$top_ip = $wpdb->get_results( "SELECT ipaddress,count(id) AS visit FROM {$wpdb->prefix}page_visit_history GROUP BY ipaddress ORDER BY COUNT(id) DESC LIMIT 10" );
|
373 |
+
//db call ok; no-cache ok
|
374 |
+
|
375 |
+
if ( $top_ip ) {
|
376 |
+
foreach ( $top_ip as $dash_ip ) {
|
377 |
+
$ip_visitor = $wpdb->get_var( $wpdb->prepare( "SELECT count(DISTINCT user_id) FROM {$wpdb->prefix}page_visit_history WHERE ipaddress = %s", $dash_ip->ipaddress ) );
|
378 |
+
//db call ok; no-cache ok
|
379 |
+
?>
|
380 |
<tr>
|
381 |
+
<td><?php
|
382 |
+
esc_html_e( $dash_ip->ipaddress );
|
383 |
?></td>
|
384 |
+
<td><?php
|
385 |
+
esc_html_e( $ip_visitor, PVCP_TEXT_DOMAIN );
|
386 |
?></td>
|
387 |
+
<td><?php
|
388 |
+
esc_html_e( $dash_ip->visit, PVCP_TEXT_DOMAIN );
|
389 |
?></td>
|
390 |
</tr>
|
391 |
+
<?php
|
392 |
+
}
|
393 |
+
} else {
|
394 |
+
?>
|
395 |
<tr>
|
396 |
+
<td colspan="3"><?php
|
397 |
+
esc_html_e( NO_DATA_FOUND, PVCP_TEXT_DOMAIN );
|
398 |
?></td>
|
399 |
</tr>
|
400 |
+
<?php
|
401 |
+
}
|
402 |
+
|
403 |
+
?>
|
404 |
</tbody>
|
405 |
</table>
|
406 |
</div>
|
admin/partials/pvcp-plugin-settings.php
CHANGED
@@ -1,220 +1,220 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
9 |
-
if ( isset( $_POST['submitGeneralSetting'] ) && sanitize_text_field( wp_unslash( $_POST['submitGeneralSetting'] ) ) === 'Save' ) {
|
10 |
-
|
11 |
-
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcp_general_wizardsettingfrm' ) ) {
|
12 |
-
die( 'Failed security check' );
|
13 |
-
} else {
|
14 |
-
$data_post = $_POST;
|
15 |
-
$this->pvcp_general_setting_save( $data_post, 'general-setting' );
|
16 |
-
}
|
17 |
-
|
18 |
-
}
|
19 |
-
$general_wizard_setting = maybe_unserialize( get_option( 'pvcp_general_settings' ) );
|
20 |
-
$pvcp_general_title = ( isset( $general_wizard_setting['pvcp_general_title'] ) && !empty($general_wizard_setting['pvcp_general_title']) ? sanitize_text_field( $general_wizard_setting['pvcp_general_title'] ) : '' );
|
21 |
-
$pvcp_general_post_type = ( isset( $general_wizard_setting['pvcp_general_post_type'] ) && !empty($general_wizard_setting['pvcp_general_post_type']) ? $general_wizard_setting['pvcp_general_post_type'] : '' );
|
22 |
-
$pvcp_general_front_view_counter = ( isset( $general_wizard_setting['pvcp_general_front_view_counter'] ) && !empty($general_wizard_setting['pvcp_general_front_view_counter']) ? $general_wizard_setting['pvcp_general_front_view_counter'] : 'disable' );
|
23 |
-
$pvcp_general_bc_color = ( isset( $general_wizard_setting['pvcp_general_bc_color'] ) && !empty($general_wizard_setting['pvcp_general_bc_color']) ? sanitize_text_field( wp_unslash( $general_wizard_setting['pvcp_general_bc_color'] ) ) : '#FFFFFF' );
|
24 |
-
$pvcp_general_font_color = ( isset( $general_wizard_setting['pvcp_general_font_color'] ) && !empty($general_wizard_setting['pvcp_general_font_color']) ? sanitize_text_field( wp_unslash( $general_wizard_setting['pvcp_general_font_color'] ) ) : '#000000' );
|
25 |
-
$pvcp_general_ip = ( isset( $general_wizard_setting['pvcp_general_ip'] ) && !empty($general_wizard_setting['pvcp_general_ip']) ? $general_wizard_setting['pvcp_general_ip'] : '' );
|
26 |
-
$pvcp_general_css = ( isset( $general_wizard_setting['pvcp_general_css'] ) && !empty($general_wizard_setting['pvcp_general_css']) ? $general_wizard_setting['pvcp_general_css'] : '' );
|
27 |
-
$pvcp_general_user = ( isset( $general_wizard_setting['pvcp_general_user'] ) && !empty($general_wizard_setting['pvcp_general_user']) ? $general_wizard_setting['pvcp_general_user'] : '' );
|
28 |
-
?>
|
29 |
<div class="pvcp-main-table pvcp-default-table res-cl">
|
30 |
<h2>
|
31 |
-
<?php
|
32 |
-
esc_html_e( 'General Setting', PVCP_TEXT_DOMAIN );
|
33 |
-
?>
|
34 |
</h2>
|
35 |
<form method="POST" name="pvcp_general_wizardsettingfrm" class="pvcp_general_wizardsettingfrm"action="" enctype="multipart/form-data">
|
36 |
-
<?php
|
37 |
-
wp_nonce_field( 'pvcp_general_wizardsettingfrm' );
|
38 |
-
?>
|
39 |
<table class="form-table table-outer general-setting">
|
40 |
<tbody>
|
41 |
<tr valign="top">
|
42 |
<th class="titledesc" scope="row">
|
43 |
-
<label for="pvcp_general_title"><?php
|
44 |
-
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
45 |
?></label></th>
|
46 |
<td class="forminp mdtooltip">
|
47 |
-
<input type="text" name="pvcp_general_title" class="text-class" id="pvcp_general_title" value="<?php
|
48 |
-
echo esc_attr( $pvcp_general_title ) ;
|
49 |
-
?>" placeholder="<?php
|
50 |
-
esc_html_e( 'Page visit counter Title', PVCP_TEXT_DOMAIN );
|
51 |
?>">
|
52 |
<span class="pvcp_tooltip_icon"></span>
|
53 |
-
<p class="pcvp_tooltip_desc description"><?php
|
54 |
-
esc_html_e( 'Enter Post Counter Title which you want to display in front side for Wizard.', PVCP_TEXT_DOMAIN );
|
55 |
?></p>
|
56 |
</td>
|
57 |
</tr>
|
58 |
<tr valign="top">
|
59 |
<th class="titledesc" scope="row">
|
60 |
-
<label for="pvcp_general_post_type"><?php
|
61 |
-
esc_html_e( 'Post Type', PVCP_TEXT_DOMAIN );
|
62 |
?></label></th>
|
63 |
<td class="forminp mdtooltip">
|
64 |
-
<?php
|
65 |
-
$post_types = get_post_types();
|
66 |
-
echo '<select name = "pvcp_general_post_type[]" multiple="multiple" class="multiselect2" data-placeholder="' . esc_attr__( ' Add Page/Post Type', PVCP_TEXT_DOMAIN ) . '">' ;
|
67 |
-
foreach ( $post_types as $post_list ) {
|
68 |
-
$selectedVal = ( is_array( $pvcp_general_post_type ) && !empty($pvcp_general_post_type) && in_array( $post_list, $pvcp_general_post_type, true ) ? 'selected=selected' : '' );
|
69 |
-
echo '<option value="' . esc_attr( $post_list ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $post_list ) . '</option>' ;
|
70 |
-
}
|
71 |
-
echo '</select>' ;
|
72 |
-
?>
|
73 |
<span class="pvcp_tooltip_icon"></span>
|
74 |
<p class="pcvp_tooltip_desc description">
|
75 |
-
<?php
|
76 |
-
esc_html_e( 'Select post types for which post views will be counted.', PVCP_TEXT_DOMAIN );
|
77 |
-
?>
|
78 |
</p>
|
79 |
</td>
|
80 |
</tr>
|
81 |
<tr valign="top">
|
82 |
<th class="titledesc" scope="row">
|
83 |
-
<label for="pvcp_general_front_view_counter"><?php
|
84 |
-
esc_html_e( 'Front View Counter', PVCP_TEXT_DOMAIN );
|
85 |
?></label></th>
|
86 |
<td class="forminp mdtooltip">
|
87 |
<select name="pvcp_general_front_view_counter" id="pvcp_general_front_view_counter">
|
88 |
-
<option value="enable" <?php
|
89 |
-
echo ( !empty(esc_attr( $pvcp_general_front_view_counter )) && esc_attr( $pvcp_general_front_view_counter ) === 'enable' ? 'selected="selected"' : '' ) ;
|
90 |
-
?>><?php
|
91 |
-
esc_html_e( 'Enable', PVCP_TEXT_DOMAIN );
|
92 |
?></option>
|
93 |
-
<option value="disable" <?php
|
94 |
-
echo ( !empty(esc_attr( $pvcp_general_front_view_counter )) && esc_attr( $pvcp_general_front_view_counter ) === 'disable' ? 'selected="selected"' : '' ) ;
|
95 |
-
?>><?php
|
96 |
-
esc_html_e( 'Disable', PVCP_TEXT_DOMAIN );
|
97 |
?></option>
|
98 |
</select>
|
99 |
<span class="pvcp_tooltip_icon"></span>
|
100 |
<p class="pcvp_tooltip_desc description">
|
101 |
-
<?php
|
102 |
-
esc_html_e( 'Enable or Disable page counter display in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
103 |
-
?>
|
104 |
</p>
|
105 |
</td>
|
106 |
</tr>
|
107 |
<tr valign="top">
|
108 |
<th class="titledesc" scope="row">
|
109 |
-
<label for="pvcp_general_bc_color"><?php
|
110 |
-
esc_html_e( 'Background Color', PVCP_TEXT_DOMAIN );
|
111 |
?></label></th>
|
112 |
<td class="forminp mdtooltip">
|
113 |
-
<input name="pvcp_general_bc_color" class="jscolor" value="<?php
|
114 |
-
echo esc_attr( $pvcp_general_bc_color ) ;
|
115 |
?>">
|
116 |
<span class="pvcp_tooltip_icon"></span>
|
117 |
<p class="pcvp_tooltip_desc description">
|
118 |
-
<?php
|
119 |
-
esc_html_e( 'Select background color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
120 |
-
?>
|
121 |
</p>
|
122 |
</td>
|
123 |
</tr>
|
124 |
<tr valign="top">
|
125 |
<th class="titledesc" scope="row">
|
126 |
-
<label for="pvcp_general_font_color"><?php
|
127 |
-
esc_html_e( 'Font Color', PVCP_TEXT_DOMAIN );
|
128 |
?></label></th>
|
129 |
<td class="forminp mdtooltip">
|
130 |
-
<input name="pvcp_general_font_color" class="jscolor" value="<?php
|
131 |
-
echo esc_attr( $pvcp_general_font_color ) ;
|
132 |
?>">
|
133 |
<span class="pvcp_tooltip_icon"></span>
|
134 |
<p class="pcvp_tooltip_desc description">
|
135 |
-
<?php
|
136 |
-
esc_html_e( 'Select font color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
137 |
-
?>
|
138 |
</p>
|
139 |
</td>
|
140 |
</tr>
|
141 |
-
<?php
|
142 |
-
?>
|
143 |
<tr valign="top">
|
144 |
<th class="titledesc" scope="row">
|
145 |
-
<label for="pvcp_general_ip"><?php
|
146 |
-
esc_html_e( 'Exclude IPs', PVCP_TEXT_DOMAIN );
|
147 |
?></label></th>
|
148 |
<td class="forminp mdtooltip">
|
149 |
-
<?php
|
150 |
-
echo '<select id="ip_address" name = "pvcp_general_ip[]" multiple="multiple" class="multiselect2 chosen-select-ip category-select" data-placeholder="' . esc_attr__( 'Add IP address separated by comma', PVCP_TEXT_DOMAIN ) . '">' ;
|
151 |
-
echo '<option value=""></option>' ;
|
152 |
-
if ( is_array( $pvcp_general_ip ) && !empty($pvcp_general_ip) ) {
|
153 |
-
foreach ( $pvcp_general_ip as $key => $values ) {
|
154 |
-
echo '<option value="' . esc_attr( $values ) . '" selected=selected>' . esc_attr( $values ) . '</option>' ;
|
155 |
-
}
|
156 |
-
}
|
157 |
-
echo '</select>' ;
|
158 |
-
?>
|
159 |
<span class="pvcp_tooltip_icon"></span>
|
160 |
<p class="pcvp_tooltip_desc description">
|
161 |
-
<?php
|
162 |
-
esc_html_e( 'With this feature, you can exclude IPs which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
163 |
-
?>
|
164 |
</p>
|
165 |
</td>
|
166 |
</tr>
|
167 |
<tr valign="top">
|
168 |
<th class="titledesc" scope="row">
|
169 |
-
<label for="pvcp_general_user"><?php
|
170 |
-
esc_html_e( 'Exclude Users', PVCP_TEXT_DOMAIN );
|
171 |
?></label></th>
|
172 |
<td class="forminp mdtooltip">
|
173 |
-
<?php
|
174 |
-
$blogusers = get_users( array(
|
175 |
-
'fields' => array( 'ID', 'user_login' ),
|
176 |
-
) );
|
177 |
-
echo '<select name = "pvcp_general_user[]" multiple="multiple" class="multiselect2">' ;
|
178 |
-
foreach ( $blogusers as $user ) {
|
179 |
-
$selectedVal = ( is_array( $pvcp_general_user ) && !empty($pvcp_general_user) && in_array( $user->ID, $pvcp_general_user, true ) ? 'selected=selected' : '' );
|
180 |
-
echo '<option value="' . esc_attr( $user->ID ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $user->user_login, PVCP_TEXT_DOMAIN ) . '</option>' ;
|
181 |
-
}
|
182 |
-
echo '</select>' ;
|
183 |
-
?>
|
184 |
<span class="pvcp_tooltip_icon"></span>
|
185 |
<p class="pcvp_tooltip_desc description">
|
186 |
-
<?php
|
187 |
-
esc_html_e( 'With this feature, you can exclude User which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
188 |
-
?>
|
189 |
</p>
|
190 |
</td>
|
191 |
</tr>
|
192 |
-
<?php
|
193 |
-
?>
|
194 |
<tr valign="top">
|
195 |
<th class="titledesc" scope="row">
|
196 |
-
<label for="pvcp_general_font"><?php
|
197 |
-
esc_html_e( 'Custom CSS', PVCP_TEXT_DOMAIN );
|
198 |
?></label></th>
|
199 |
<td class="forminp mdtooltip">
|
200 |
-
<textarea name="pvcp_general_css" placeholder="<?php
|
201 |
-
esc_html_e( 'Custom CSS', PVCP_TEXT_DOMAIN );
|
202 |
-
?>" rows="4" cols="50"><?php
|
203 |
-
echo esc_attr( $pvcp_general_css ) ;
|
204 |
?></textarea>
|
205 |
</td>
|
206 |
</tr>
|
207 |
|
208 |
</tbody>
|
209 |
</table>
|
210 |
-
<p class="submit"><input type="submit" id="submitGeneralSetting" name="submitGeneralSetting" class="button button-primary button-large" value="<?php
|
211 |
-
esc_html_e( 'Save', PVCP_TEXT_DOMAIN );
|
212 |
?>">
|
213 |
-
<a class="pvcp-action-button button-primary reset_all_page_report_count" href="javascript:void(0);" id="reset_all_page_report_count"><?php
|
214 |
-
esc_html_e( 'Reset all pages counts & report ', PVCP_TEXT_DOMAIN );
|
215 |
?></a></p>
|
216 |
</form>
|
217 |
</div>
|
218 |
|
219 |
-
<?php
|
220 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
9 |
+
if ( isset( $_POST['submitGeneralSetting'] ) && sanitize_text_field( wp_unslash( $_POST['submitGeneralSetting'] ) ) === 'Save' ) {
|
10 |
+
|
11 |
+
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcp_general_wizardsettingfrm' ) ) {
|
12 |
+
die( 'Failed security check' );
|
13 |
+
} else {
|
14 |
+
$data_post = $_POST;
|
15 |
+
$this->pvcp_general_setting_save( $data_post, 'general-setting' );
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
19 |
+
$general_wizard_setting = maybe_unserialize( get_option( 'pvcp_general_settings' ) );
|
20 |
+
$pvcp_general_title = ( isset( $general_wizard_setting['pvcp_general_title'] ) && !empty($general_wizard_setting['pvcp_general_title']) ? sanitize_text_field( $general_wizard_setting['pvcp_general_title'] ) : '' );
|
21 |
+
$pvcp_general_post_type = ( isset( $general_wizard_setting['pvcp_general_post_type'] ) && !empty($general_wizard_setting['pvcp_general_post_type']) ? $general_wizard_setting['pvcp_general_post_type'] : '' );
|
22 |
+
$pvcp_general_front_view_counter = ( isset( $general_wizard_setting['pvcp_general_front_view_counter'] ) && !empty($general_wizard_setting['pvcp_general_front_view_counter']) ? $general_wizard_setting['pvcp_general_front_view_counter'] : 'disable' );
|
23 |
+
$pvcp_general_bc_color = ( isset( $general_wizard_setting['pvcp_general_bc_color'] ) && !empty($general_wizard_setting['pvcp_general_bc_color']) ? sanitize_text_field( wp_unslash( $general_wizard_setting['pvcp_general_bc_color'] ) ) : '#FFFFFF' );
|
24 |
+
$pvcp_general_font_color = ( isset( $general_wizard_setting['pvcp_general_font_color'] ) && !empty($general_wizard_setting['pvcp_general_font_color']) ? sanitize_text_field( wp_unslash( $general_wizard_setting['pvcp_general_font_color'] ) ) : '#000000' );
|
25 |
+
$pvcp_general_ip = ( isset( $general_wizard_setting['pvcp_general_ip'] ) && !empty($general_wizard_setting['pvcp_general_ip']) ? $general_wizard_setting['pvcp_general_ip'] : '' );
|
26 |
+
$pvcp_general_css = ( isset( $general_wizard_setting['pvcp_general_css'] ) && !empty($general_wizard_setting['pvcp_general_css']) ? $general_wizard_setting['pvcp_general_css'] : '' );
|
27 |
+
$pvcp_general_user = ( isset( $general_wizard_setting['pvcp_general_user'] ) && !empty($general_wizard_setting['pvcp_general_user']) ? $general_wizard_setting['pvcp_general_user'] : '' );
|
28 |
+
?>
|
29 |
<div class="pvcp-main-table pvcp-default-table res-cl">
|
30 |
<h2>
|
31 |
+
<?php
|
32 |
+
esc_html_e( 'General Setting', PVCP_TEXT_DOMAIN );
|
33 |
+
?>
|
34 |
</h2>
|
35 |
<form method="POST" name="pvcp_general_wizardsettingfrm" class="pvcp_general_wizardsettingfrm"action="" enctype="multipart/form-data">
|
36 |
+
<?php
|
37 |
+
wp_nonce_field( 'pvcp_general_wizardsettingfrm' );
|
38 |
+
?>
|
39 |
<table class="form-table table-outer general-setting">
|
40 |
<tbody>
|
41 |
<tr valign="top">
|
42 |
<th class="titledesc" scope="row">
|
43 |
+
<label for="pvcp_general_title"><?php
|
44 |
+
esc_html_e( 'Title', PVCP_TEXT_DOMAIN );
|
45 |
?></label></th>
|
46 |
<td class="forminp mdtooltip">
|
47 |
+
<input type="text" name="pvcp_general_title" class="text-class" id="pvcp_general_title" value="<?php
|
48 |
+
echo esc_attr( $pvcp_general_title ) ;
|
49 |
+
?>" placeholder="<?php
|
50 |
+
esc_html_e( 'Page visit counter Title', PVCP_TEXT_DOMAIN );
|
51 |
?>">
|
52 |
<span class="pvcp_tooltip_icon"></span>
|
53 |
+
<p class="pcvp_tooltip_desc description"><?php
|
54 |
+
esc_html_e( 'Enter Post Counter Title which you want to display in front side for Wizard.', PVCP_TEXT_DOMAIN );
|
55 |
?></p>
|
56 |
</td>
|
57 |
</tr>
|
58 |
<tr valign="top">
|
59 |
<th class="titledesc" scope="row">
|
60 |
+
<label for="pvcp_general_post_type"><?php
|
61 |
+
esc_html_e( 'Post Type', PVCP_TEXT_DOMAIN );
|
62 |
?></label></th>
|
63 |
<td class="forminp mdtooltip">
|
64 |
+
<?php
|
65 |
+
$post_types = get_post_types();
|
66 |
+
echo '<select name = "pvcp_general_post_type[]" multiple="multiple" class="multiselect2" data-placeholder="' . esc_attr__( ' Add Page/Post Type', PVCP_TEXT_DOMAIN ) . '">' ;
|
67 |
+
foreach ( $post_types as $post_list ) {
|
68 |
+
$selectedVal = ( is_array( $pvcp_general_post_type ) && !empty($pvcp_general_post_type) && in_array( $post_list, $pvcp_general_post_type, true ) ? 'selected=selected' : '' );
|
69 |
+
echo '<option value="' . esc_attr( $post_list ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $post_list ) . '</option>' ;
|
70 |
+
}
|
71 |
+
echo '</select>' ;
|
72 |
+
?>
|
73 |
<span class="pvcp_tooltip_icon"></span>
|
74 |
<p class="pcvp_tooltip_desc description">
|
75 |
+
<?php
|
76 |
+
esc_html_e( 'Select post types for which post views will be counted.', PVCP_TEXT_DOMAIN );
|
77 |
+
?>
|
78 |
</p>
|
79 |
</td>
|
80 |
</tr>
|
81 |
<tr valign="top">
|
82 |
<th class="titledesc" scope="row">
|
83 |
+
<label for="pvcp_general_front_view_counter"><?php
|
84 |
+
esc_html_e( 'Front View Counter', PVCP_TEXT_DOMAIN );
|
85 |
?></label></th>
|
86 |
<td class="forminp mdtooltip">
|
87 |
<select name="pvcp_general_front_view_counter" id="pvcp_general_front_view_counter">
|
88 |
+
<option value="enable" <?php
|
89 |
+
echo ( !empty(esc_attr( $pvcp_general_front_view_counter )) && esc_attr( $pvcp_general_front_view_counter ) === 'enable' ? 'selected="selected"' : '' ) ;
|
90 |
+
?>><?php
|
91 |
+
esc_html_e( 'Enable', PVCP_TEXT_DOMAIN );
|
92 |
?></option>
|
93 |
+
<option value="disable" <?php
|
94 |
+
echo ( !empty(esc_attr( $pvcp_general_front_view_counter )) && esc_attr( $pvcp_general_front_view_counter ) === 'disable' ? 'selected="selected"' : '' ) ;
|
95 |
+
?>><?php
|
96 |
+
esc_html_e( 'Disable', PVCP_TEXT_DOMAIN );
|
97 |
?></option>
|
98 |
</select>
|
99 |
<span class="pvcp_tooltip_icon"></span>
|
100 |
<p class="pcvp_tooltip_desc description">
|
101 |
+
<?php
|
102 |
+
esc_html_e( 'Enable or Disable page counter display in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
103 |
+
?>
|
104 |
</p>
|
105 |
</td>
|
106 |
</tr>
|
107 |
<tr valign="top">
|
108 |
<th class="titledesc" scope="row">
|
109 |
+
<label for="pvcp_general_bc_color"><?php
|
110 |
+
esc_html_e( 'Background Color', PVCP_TEXT_DOMAIN );
|
111 |
?></label></th>
|
112 |
<td class="forminp mdtooltip">
|
113 |
+
<input name="pvcp_general_bc_color" class="jscolor" value="<?php
|
114 |
+
echo esc_attr( $pvcp_general_bc_color ) ;
|
115 |
?>">
|
116 |
<span class="pvcp_tooltip_icon"></span>
|
117 |
<p class="pcvp_tooltip_desc description">
|
118 |
+
<?php
|
119 |
+
esc_html_e( 'Select background color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
120 |
+
?>
|
121 |
</p>
|
122 |
</td>
|
123 |
</tr>
|
124 |
<tr valign="top">
|
125 |
<th class="titledesc" scope="row">
|
126 |
+
<label for="pvcp_general_font_color"><?php
|
127 |
+
esc_html_e( 'Font Color', PVCP_TEXT_DOMAIN );
|
128 |
?></label></th>
|
129 |
<td class="forminp mdtooltip">
|
130 |
+
<input name="pvcp_general_font_color" class="jscolor" value="<?php
|
131 |
+
echo esc_attr( $pvcp_general_font_color ) ;
|
132 |
?>">
|
133 |
<span class="pvcp_tooltip_icon"></span>
|
134 |
<p class="pcvp_tooltip_desc description">
|
135 |
+
<?php
|
136 |
+
esc_html_e( 'Select font color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
137 |
+
?>
|
138 |
</p>
|
139 |
</td>
|
140 |
</tr>
|
141 |
+
<?php
|
142 |
+
?>
|
143 |
<tr valign="top">
|
144 |
<th class="titledesc" scope="row">
|
145 |
+
<label for="pvcp_general_ip"><?php
|
146 |
+
esc_html_e( 'Exclude IPs', PVCP_TEXT_DOMAIN );
|
147 |
?></label></th>
|
148 |
<td class="forminp mdtooltip">
|
149 |
+
<?php
|
150 |
+
echo '<select id="ip_address" name = "pvcp_general_ip[]" multiple="multiple" class="multiselect2 chosen-select-ip category-select" data-placeholder="' . esc_attr__( 'Add IP address separated by comma', PVCP_TEXT_DOMAIN ) . '">' ;
|
151 |
+
echo '<option value=""></option>' ;
|
152 |
+
if ( is_array( $pvcp_general_ip ) && !empty($pvcp_general_ip) ) {
|
153 |
+
foreach ( $pvcp_general_ip as $key => $values ) {
|
154 |
+
echo '<option value="' . esc_attr( $values ) . '" selected=selected>' . esc_attr( $values ) . '</option>' ;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
echo '</select>' ;
|
158 |
+
?>
|
159 |
<span class="pvcp_tooltip_icon"></span>
|
160 |
<p class="pcvp_tooltip_desc description">
|
161 |
+
<?php
|
162 |
+
esc_html_e( 'With this feature, you can exclude IPs which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
163 |
+
?>
|
164 |
</p>
|
165 |
</td>
|
166 |
</tr>
|
167 |
<tr valign="top">
|
168 |
<th class="titledesc" scope="row">
|
169 |
+
<label for="pvcp_general_user"><?php
|
170 |
+
esc_html_e( 'Exclude Users', PVCP_TEXT_DOMAIN );
|
171 |
?></label></th>
|
172 |
<td class="forminp mdtooltip">
|
173 |
+
<?php
|
174 |
+
$blogusers = get_users( array(
|
175 |
+
'fields' => array( 'ID', 'user_login' ),
|
176 |
+
) );
|
177 |
+
echo '<select name = "pvcp_general_user[]" multiple="multiple" class="multiselect2">' ;
|
178 |
+
foreach ( $blogusers as $user ) {
|
179 |
+
$selectedVal = ( is_array( $pvcp_general_user ) && !empty($pvcp_general_user) && in_array( $user->ID, $pvcp_general_user, true ) ? 'selected=selected' : '' );
|
180 |
+
echo '<option value="' . esc_attr( $user->ID ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $user->user_login, PVCP_TEXT_DOMAIN ) . '</option>' ;
|
181 |
+
}
|
182 |
+
echo '</select>' ;
|
183 |
+
?>
|
184 |
<span class="pvcp_tooltip_icon"></span>
|
185 |
<p class="pcvp_tooltip_desc description">
|
186 |
+
<?php
|
187 |
+
esc_html_e( 'With this feature, you can exclude User which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
188 |
+
?>
|
189 |
</p>
|
190 |
</td>
|
191 |
</tr>
|
192 |
+
<?php
|
193 |
+
?>
|
194 |
<tr valign="top">
|
195 |
<th class="titledesc" scope="row">
|
196 |
+
<label for="pvcp_general_font"><?php
|
197 |
+
esc_html_e( 'Custom CSS', PVCP_TEXT_DOMAIN );
|
198 |
?></label></th>
|
199 |
<td class="forminp mdtooltip">
|
200 |
+
<textarea name="pvcp_general_css" placeholder="<?php
|
201 |
+
esc_html_e( 'Custom CSS', PVCP_TEXT_DOMAIN );
|
202 |
+
?>" rows="4" cols="50"><?php
|
203 |
+
echo esc_attr( $pvcp_general_css ) ;
|
204 |
?></textarea>
|
205 |
</td>
|
206 |
</tr>
|
207 |
|
208 |
</tbody>
|
209 |
</table>
|
210 |
+
<p class="submit"><input type="submit" id="submitGeneralSetting" name="submitGeneralSetting" class="button button-primary button-large" value="<?php
|
211 |
+
esc_html_e( 'Save', PVCP_TEXT_DOMAIN );
|
212 |
?>">
|
213 |
+
<a class="pvcp-action-button button-primary reset_all_page_report_count" href="javascript:void(0);" id="reset_all_page_report_count"><?php
|
214 |
+
esc_html_e( 'Reset all pages counts & report ', PVCP_TEXT_DOMAIN );
|
215 |
?></a></p>
|
216 |
</form>
|
217 |
</div>
|
218 |
|
219 |
+
<?php
|
220 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
admin/partials/pvcp-wizard-list-page.php
CHANGED
@@ -1,152 +1,152 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$wizard_post_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
9 |
-
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
10 |
-
|
11 |
-
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'delete' ) {
|
12 |
-
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcpwznonce' ) ) {
|
13 |
-
die( 'Failed security check' );
|
14 |
-
}
|
15 |
-
$delete_sql = $wpdb->delete( WIZARDS_PRO_TABLE, array(
|
16 |
-
'ID' => esc_attr( $wizard_post_id ),
|
17 |
-
), array( '%d' ) );
|
18 |
-
//db call ok; no-cache ok
|
19 |
-
|
20 |
-
if ( $delete_sql === '1' ) {
|
21 |
-
wp_redirect( esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) );
|
22 |
-
exit;
|
23 |
-
} else {
|
24 |
-
esc_html_e( 'Something went wrong. Please try again', PVCP_TEXT_DOMAIN );
|
25 |
-
wp_redirect( esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) );
|
26 |
-
exit;
|
27 |
-
}
|
28 |
-
|
29 |
-
}
|
30 |
-
|
31 |
-
$sel_rows_for_page_wizard = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}page_visit_wizard ORDER BY created_date DESC" );
|
32 |
-
//db call ok; no-cache ok
|
33 |
-
wp_nonce_field( 'delete' );
|
34 |
-
?>
|
35 |
<div class="pvcp-main-table res-cl">
|
36 |
<div class="product_header_title">
|
37 |
<h2>
|
38 |
-
<?php
|
39 |
-
esc_html_e( LIST_PAGE_TITLE, PVCP_TEXT_DOMAIN );
|
40 |
-
?>
|
41 |
-
<?php
|
42 |
-
?>
|
43 |
-
<a class="add-new-btn pvcp-pro-ver" href="javascript:void(0)"><?php
|
44 |
-
esc_html_e( ADD_NEW_WIZARD, PVCP_TEXT_DOMAIN );
|
45 |
?></a>
|
46 |
-
<?php
|
47 |
-
?>
|
48 |
</h2>
|
49 |
</div>
|
50 |
<table id="wizard-listing" class="table-outer form-table all-table-listing">
|
51 |
<thead>
|
52 |
<tr class="pvcp-head">
|
53 |
-
<?php
|
54 |
-
?>
|
55 |
-
<th><?php
|
56 |
-
esc_html_e( 'Name', PVCP_TEXT_DOMAIN );
|
57 |
?></th>
|
58 |
-
<th><?php
|
59 |
-
esc_html_e( 'Shortcode', PVCP_TEXT_DOMAIN );
|
60 |
?></th>
|
61 |
-
<th><?php
|
62 |
-
esc_html_e( 'Status', PVCP_TEXT_DOMAIN );
|
63 |
?></th>
|
64 |
-
<th><?php
|
65 |
-
esc_html_e( 'Action', PVCP_TEXT_DOMAIN );
|
66 |
?></th>
|
67 |
</tr>
|
68 |
</thead>
|
69 |
<tbody>
|
70 |
|
71 |
<tr id="wizard_row_totla_wb">
|
72 |
-
<?php
|
73 |
-
?>
|
74 |
-
<td><?php
|
75 |
-
esc_html_e( 'Total Website Visit', PVCP_TEXT_DOMAIN );
|
76 |
?></td>
|
77 |
-
<td><?php
|
78 |
-
echo esc_attr( '[pvcp_website_count]' ) ;
|
79 |
?></td>
|
80 |
-
<td><?php
|
81 |
-
esc_html_e( 'N/A', PVCP_TEXT_DOMAIN );
|
82 |
?></td>
|
83 |
-
<td><?php
|
84 |
-
esc_html_e( 'N/A', PVCP_TEXT_DOMAIN );
|
85 |
?></td>
|
86 |
</tr>
|
87 |
|
88 |
-
<?php
|
89 |
-
// Total page visit wizard
|
90 |
-
|
91 |
-
if ( !empty($sel_rows_for_page_wizard) && isset( $sel_rows_for_page_wizard ) && is_array( $sel_rows_for_page_wizard ) ) {
|
92 |
-
$i = 1;
|
93 |
-
foreach ( $sel_rows_for_page_wizard as $sel_data ) {
|
94 |
-
$wizard_id = esc_attr( $sel_data->ID );
|
95 |
-
$wizard_title = esc_attr( $sel_data->name );
|
96 |
-
$wizard_shortcode = esc_attr( $sel_data->shortcode );
|
97 |
-
$wizard_status = esc_attr( $sel_data->status );
|
98 |
-
$pvcpnonce = wp_create_nonce( 'pvcpwznonce' );
|
99 |
-
?>
|
100 |
-
<tr id="wizard_row_<?php
|
101 |
-
echo esc_attr( $wizard_id ) ;
|
102 |
?>">
|
103 |
-
<?php
|
104 |
-
?>
|
105 |
<td>
|
106 |
-
<a href="<?php
|
107 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
108 |
-
?>"><?php
|
109 |
-
esc_html_e( $wizard_title, PVCP_TEXT_DOMAIN );
|
110 |
?></a>
|
111 |
</td>
|
112 |
<td>
|
113 |
-
<?php
|
114 |
-
echo esc_attr( $wizard_shortcode ) ;
|
115 |
-
?>
|
116 |
</td>
|
117 |
<td>
|
118 |
-
<?php
|
119 |
-
echo ( !empty(esc_attr( $wizard_status )) && esc_attr( $wizard_status ) === 'on' ? '<span class="active-status">' . esc_html_e( 'Enabled', PVCP_TEXT_DOMAIN ) . '</span>' : '<span class="inactive-status">' . esc_html_e( 'Disabled', PVCP_TEXT_DOMAIN ) . '</span>' ) ;
|
120 |
-
?>
|
121 |
</td>
|
122 |
<td>
|
123 |
-
<a class="pvcp-action-button button-primary" href="<?php
|
124 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
125 |
-
?>"><?php
|
126 |
-
esc_html_e( 'Edit', PVCP_TEXT_DOMAIN );
|
127 |
?></a>
|
128 |
-
<?php
|
129 |
-
?>
|
130 |
-
<a class="pvcp-action-button button-primary setting_single_selected_wizard" href="<?php
|
131 |
-
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-wizard-setting&wizard_id=' . esc_attr( $wizard_id ) . '&action=setting' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
132 |
-
?>" id="setting_single_selected_wizard_<?php
|
133 |
-
echo esc_attr( $wizard_id ) ;
|
134 |
-
?>" data-attr_name="<?php
|
135 |
-
echo esc_attr( $wizard_title ) ;
|
136 |
-
?>"><?php
|
137 |
-
esc_html_e( 'Setting', PVCP_TEXT_DOMAIN );
|
138 |
?></a>
|
139 |
</td>
|
140 |
</tr>
|
141 |
-
<?php
|
142 |
-
$i++;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
?>
|
147 |
</tbody>
|
148 |
</table>
|
149 |
</div>
|
150 |
|
151 |
-
<?php
|
152 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$wizard_post_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
9 |
+
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
10 |
+
|
11 |
+
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'delete' ) {
|
12 |
+
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcpwznonce' ) ) {
|
13 |
+
die( 'Failed security check' );
|
14 |
+
}
|
15 |
+
$delete_sql = $wpdb->delete( WIZARDS_PRO_TABLE, array(
|
16 |
+
'ID' => esc_attr( $wizard_post_id ),
|
17 |
+
), array( '%d' ) );
|
18 |
+
//db call ok; no-cache ok
|
19 |
+
|
20 |
+
if ( $delete_sql === '1' ) {
|
21 |
+
wp_redirect( esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) );
|
22 |
+
exit;
|
23 |
+
} else {
|
24 |
+
esc_html_e( 'Something went wrong. Please try again', PVCP_TEXT_DOMAIN );
|
25 |
+
wp_redirect( esc_url( site_url( '/wp-admin/admin.php?page=pvcp-list' ) ) );
|
26 |
+
exit;
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
$sel_rows_for_page_wizard = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}page_visit_wizard ORDER BY created_date DESC" );
|
32 |
+
//db call ok; no-cache ok
|
33 |
+
wp_nonce_field( 'delete' );
|
34 |
+
?>
|
35 |
<div class="pvcp-main-table res-cl">
|
36 |
<div class="product_header_title">
|
37 |
<h2>
|
38 |
+
<?php
|
39 |
+
esc_html_e( LIST_PAGE_TITLE, PVCP_TEXT_DOMAIN );
|
40 |
+
?>
|
41 |
+
<?php
|
42 |
+
?>
|
43 |
+
<a class="add-new-btn pvcp-pro-ver" href="javascript:void(0)"><?php
|
44 |
+
esc_html_e( ADD_NEW_WIZARD, PVCP_TEXT_DOMAIN );
|
45 |
?></a>
|
46 |
+
<?php
|
47 |
+
?>
|
48 |
</h2>
|
49 |
</div>
|
50 |
<table id="wizard-listing" class="table-outer form-table all-table-listing">
|
51 |
<thead>
|
52 |
<tr class="pvcp-head">
|
53 |
+
<?php
|
54 |
+
?>
|
55 |
+
<th><?php
|
56 |
+
esc_html_e( 'Name', PVCP_TEXT_DOMAIN );
|
57 |
?></th>
|
58 |
+
<th><?php
|
59 |
+
esc_html_e( 'Shortcode', PVCP_TEXT_DOMAIN );
|
60 |
?></th>
|
61 |
+
<th><?php
|
62 |
+
esc_html_e( 'Status', PVCP_TEXT_DOMAIN );
|
63 |
?></th>
|
64 |
+
<th><?php
|
65 |
+
esc_html_e( 'Action', PVCP_TEXT_DOMAIN );
|
66 |
?></th>
|
67 |
</tr>
|
68 |
</thead>
|
69 |
<tbody>
|
70 |
|
71 |
<tr id="wizard_row_totla_wb">
|
72 |
+
<?php
|
73 |
+
?>
|
74 |
+
<td><?php
|
75 |
+
esc_html_e( 'Total Website Visit', PVCP_TEXT_DOMAIN );
|
76 |
?></td>
|
77 |
+
<td><?php
|
78 |
+
echo esc_attr( '[pvcp_website_count]' ) ;
|
79 |
?></td>
|
80 |
+
<td><?php
|
81 |
+
esc_html_e( 'N/A', PVCP_TEXT_DOMAIN );
|
82 |
?></td>
|
83 |
+
<td><?php
|
84 |
+
esc_html_e( 'N/A', PVCP_TEXT_DOMAIN );
|
85 |
?></td>
|
86 |
</tr>
|
87 |
|
88 |
+
<?php
|
89 |
+
// Total page visit wizard
|
90 |
+
|
91 |
+
if ( !empty($sel_rows_for_page_wizard) && isset( $sel_rows_for_page_wizard ) && is_array( $sel_rows_for_page_wizard ) ) {
|
92 |
+
$i = 1;
|
93 |
+
foreach ( $sel_rows_for_page_wizard as $sel_data ) {
|
94 |
+
$wizard_id = esc_attr( $sel_data->ID );
|
95 |
+
$wizard_title = esc_attr( $sel_data->name );
|
96 |
+
$wizard_shortcode = esc_attr( $sel_data->shortcode );
|
97 |
+
$wizard_status = esc_attr( $sel_data->status );
|
98 |
+
$pvcpnonce = wp_create_nonce( 'pvcpwznonce' );
|
99 |
+
?>
|
100 |
+
<tr id="wizard_row_<?php
|
101 |
+
echo esc_attr( $wizard_id ) ;
|
102 |
?>">
|
103 |
+
<?php
|
104 |
+
?>
|
105 |
<td>
|
106 |
+
<a href="<?php
|
107 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
108 |
+
?>"><?php
|
109 |
+
esc_html_e( $wizard_title, PVCP_TEXT_DOMAIN );
|
110 |
?></a>
|
111 |
</td>
|
112 |
<td>
|
113 |
+
<?php
|
114 |
+
echo esc_attr( $wizard_shortcode ) ;
|
115 |
+
?>
|
116 |
</td>
|
117 |
<td>
|
118 |
+
<?php
|
119 |
+
echo ( !empty(esc_attr( $wizard_status )) && esc_attr( $wizard_status ) === 'on' ? '<span class="active-status">' . esc_html_e( 'Enabled', PVCP_TEXT_DOMAIN ) . '</span>' : '<span class="inactive-status">' . esc_html_e( 'Disabled', PVCP_TEXT_DOMAIN ) . '</span>' ) ;
|
120 |
+
?>
|
121 |
</td>
|
122 |
<td>
|
123 |
+
<a class="pvcp-action-button button-primary" href="<?php
|
124 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-edit-wizard&wizard_id=' . esc_attr( $wizard_id ) . '&action=edit' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
125 |
+
?>"><?php
|
126 |
+
esc_html_e( 'Edit', PVCP_TEXT_DOMAIN );
|
127 |
?></a>
|
128 |
+
<?php
|
129 |
+
?>
|
130 |
+
<a class="pvcp-action-button button-primary setting_single_selected_wizard" href="<?php
|
131 |
+
echo esc_url( site_url( '/wp-admin/admin.php?page=pvcp-wizard-setting&wizard_id=' . esc_attr( $wizard_id ) . '&action=setting' . '&_wpnonce=' . esc_attr( $pvcpnonce ) ) ) ;
|
132 |
+
?>" id="setting_single_selected_wizard_<?php
|
133 |
+
echo esc_attr( $wizard_id ) ;
|
134 |
+
?>" data-attr_name="<?php
|
135 |
+
echo esc_attr( $wizard_title ) ;
|
136 |
+
?>"><?php
|
137 |
+
esc_html_e( 'Setting', PVCP_TEXT_DOMAIN );
|
138 |
?></a>
|
139 |
</td>
|
140 |
</tr>
|
141 |
+
<?php
|
142 |
+
$i++;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
?>
|
147 |
</tbody>
|
148 |
</table>
|
149 |
</div>
|
150 |
|
151 |
+
<?php
|
152 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
admin/partials/pvcp-wizard-setting.php
CHANGED
@@ -1,158 +1,158 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
-
global $wpdb ;
|
8 |
-
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
9 |
-
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
10 |
-
if ( isset( $_POST['submitWizardSetting'] ) && sanitize_text_field( wp_unslash( $_POST['submitWizardSetting'] ) ) === 'Save' ) {
|
11 |
-
|
12 |
-
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcp_ind_wizardsettingfrm' ) ) {
|
13 |
-
die( 'Failed security check' );
|
14 |
-
} else {
|
15 |
-
$data_post = $_POST;
|
16 |
-
$this->pvcp_wizard_save( $data_post, 'setting', $data_post['pvcp_ind_wizard_post_id'] );
|
17 |
-
}
|
18 |
-
|
19 |
-
}
|
20 |
-
$wizard_setting_rows = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_wizard WHERE ID=%d", array( $wizard_id ) ) );
|
21 |
-
//db call ok; no-cache ok
|
22 |
-
$wizard_title = ( empty($wizard_setting_rows->name) ? '' : $wizard_setting_rows->name );
|
23 |
-
$wizard_setting = ( empty($wizard_setting_rows->wizard_setting) ? '' : maybe_unserialize( $wizard_setting_rows->wizard_setting ) );
|
24 |
-
$pvcp_ind_wz_bc_color = ( isset( $wizard_setting['pvcp_ind_wz_bc_color'] ) && !empty($wizard_setting['pvcp_ind_wz_bc_color']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_bc_color'] ) ) : '' );
|
25 |
-
$pvcp_ind_wz_font_color = ( isset( $wizard_setting['pvcp_ind_wz_font_color'] ) && !empty($wizard_setting['pvcp_ind_wz_font_color']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font_color'] ) ) : '' );
|
26 |
-
$pvcp_ind_wz_font_size = ( isset( $wizard_setting['pvcp_ind_wz_font_size'] ) && !empty($wizard_setting['pvcp_ind_wz_font_size']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font_size'] ) ) : '' );
|
27 |
-
$pvcp_ind_wz_padding = ( isset( $wizard_setting['pvcp_ind_wz_padding'] ) && !empty($wizard_setting['pvcp_ind_wz_padding']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_padding'] ) ) : '' );
|
28 |
-
$pvcp_ind_wz_border = ( isset( $wizard_setting['pvcp_ind_wz_border'] ) && !empty($wizard_setting['pvcp_ind_wz_border']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_border'] ) ) : '' );
|
29 |
-
$pvcp_ind_wz_border_radius = ( isset( $wizard_setting['pvcp_ind_wz_border_radius'] ) && !empty($wizard_setting['pvcp_ind_wz_border_radius']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_border_radius'] ) ) : '' );
|
30 |
-
$pvcp_ind_wz_font = ( isset( $wizard_setting['pvcp_ind_wz_font'] ) && !empty($wizard_setting['pvcp_ind_wz_font']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font'] ) ) : '' );
|
31 |
-
$pvcp_ind_wz_counter_pos = ( isset( $wizard_setting['pvcp_ind_wz_counter_pos'] ) && !empty($wizard_setting['pvcp_ind_wz_counter_pos']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_counter_pos'] ) ) : '' );
|
32 |
-
$pvcp_ind_wz_counter_view = ( isset( $wizard_setting['pvcp_ind_wz_counter_view'] ) && !empty($wizard_setting['pvcp_ind_wz_counter_view']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_counter_view'] ) ) : '' );
|
33 |
-
$pvcp_ind_wz_user = ( isset( $wizard_setting['pvcp_ind_wz_user'] ) && !empty($wizard_setting['pvcp_ind_wz_user']) ? $wizard_setting['pvcp_ind_wz_user'] : '' );
|
34 |
-
// WPCS: XSS OK.
|
35 |
-
$pvcp_ind_wz_user_role = ( isset( $wizard_setting['pvcp_ind_wz_user_role'] ) && !empty($wizard_setting['pvcp_ind_wz_user_role']) ? $wizard_setting['pvcp_ind_wz_user_role'] : '' );
|
36 |
-
// WPCS: XSS OK.
|
37 |
-
$pvcp_ind_wz_ip = ( isset( $wizard_setting['pvcp_ind_wz_ip'] ) && !empty($wizard_setting['pvcp_ind_wz_ip']) ? $wizard_setting['pvcp_ind_wz_ip'] : '' );
|
38 |
-
// WPCS: XSS OK.
|
39 |
-
?>
|
40 |
<div class="pvcp-main-table res-cl">
|
41 |
<h2>
|
42 |
-
<?php
|
43 |
-
esc_html_e( 'Wizard Setting For', PVCP_TEXT_DOMAIN );
|
44 |
-
?> <?php
|
45 |
-
echo wp_kses_post( $wizard_title ) ;
|
46 |
-
?>
|
47 |
-
<a class="add-new-btn back-button" id="back_button" href="<?php
|
48 |
-
echo esc_url( admin_url( '/admin.php?page=pvcp-list' ) ) ;
|
49 |
-
?>"><?php
|
50 |
-
esc_html_e( BACK_TO_WIZARD_LIST, PVCP_TEXT_DOMAIN );
|
51 |
?></a>
|
52 |
</h2>
|
53 |
<form method="POST" name="pvcp_ind_wizardsettingfrm" action="">
|
54 |
-
<?php
|
55 |
-
wp_nonce_field( 'pvcp_ind_wizardsettingfrm' );
|
56 |
-
?>
|
57 |
-
<input type="hidden" name="pvcp_ind_wizard_post_id" value="<?php
|
58 |
-
echo esc_attr( $wizard_id ) ;
|
59 |
?>">
|
60 |
<table class="form-table table-outer product-fee-table">
|
61 |
<tbody>
|
62 |
<tr valign="top">
|
63 |
<th class="titledesc" scope="row">
|
64 |
-
<label for="perfect_match_title"><?php
|
65 |
-
esc_html_e( 'Background Color', PVCP_TEXT_DOMAIN );
|
66 |
?></label></th>
|
67 |
<td class="forminp mdtooltip">
|
68 |
-
<input name="pvcp_ind_wz_bc_color" class="jscolor" value="<?php
|
69 |
-
echo esc_attr( $pvcp_ind_wz_bc_color ) ;
|
70 |
?>">
|
71 |
<span class="pvcp_tooltip_icon"></span>
|
72 |
<p class="pcvp_tooltip_desc description">
|
73 |
-
<?php
|
74 |
-
esc_html_e( 'Select background color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
75 |
-
?>
|
76 |
</p>
|
77 |
</td>
|
78 |
</tr>
|
79 |
<tr valign="top">
|
80 |
<th class="titledesc" scope="row">
|
81 |
-
<label for="perfect_match_title"><?php
|
82 |
-
esc_html_e( 'Font Color', PVCP_TEXT_DOMAIN );
|
83 |
?></label></th>
|
84 |
<td class="forminp mdtooltip">
|
85 |
-
<input name="pvcp_ind_wz_font_color" class="jscolor" value="<?php
|
86 |
-
echo esc_attr( $pvcp_ind_wz_font_color ) ;
|
87 |
?>">
|
88 |
<span class="pvcp_tooltip_icon"></span>
|
89 |
<p class="pcvp_tooltip_desc description">
|
90 |
-
<?php
|
91 |
-
esc_html_e( 'Select font color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
92 |
-
?>
|
93 |
</p>
|
94 |
</td>
|
95 |
</tr>
|
96 |
-
<?php
|
97 |
-
?>
|
98 |
<tr valign="top">
|
99 |
<th class="titledesc" scope="row">
|
100 |
-
<label for="pvcp_ind_wz_ip"><?php
|
101 |
-
esc_html_e( 'Exclude IPs', PVCP_TEXT_DOMAIN );
|
102 |
?></label></th>
|
103 |
<td class="forminp mdtooltip">
|
104 |
-
<?php
|
105 |
-
echo '<select id="ip_address" name = "pvcp_ind_wz_ip[]" multiple="multiple" class="multiselect2 chosen-select-ip category-select" data-placeholder="' . esc_attr( 'Add IP address separated by comma' ) . '">' ;
|
106 |
-
echo '<option value=""></option>' ;
|
107 |
-
if ( is_array( $pvcp_ind_wz_ip ) && !empty($pvcp_ind_wz_ip) ) {
|
108 |
-
foreach ( $pvcp_ind_wz_ip as $key => $values ) {
|
109 |
-
echo '<option value="' . esc_attr( $values ) . '" selected=selected>' . esc_attr( $values ) . '</option>' ;
|
110 |
-
}
|
111 |
-
}
|
112 |
-
echo '</select>' ;
|
113 |
-
?>
|
114 |
<span class="pvcp_tooltip_icon"></span>
|
115 |
<p class="pcvp_tooltip_desc description">
|
116 |
-
<?php
|
117 |
-
esc_html_e( 'With this feature, you can exclude IPs which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
118 |
-
?>
|
119 |
</p>
|
120 |
</td>
|
121 |
</tr>
|
122 |
<tr valign="top">
|
123 |
<th class="titledesc" scope="row">
|
124 |
-
<label for="pvcp_ind_wz_user"><?php
|
125 |
-
esc_html_e( 'Exclude Users', PVCP_TEXT_DOMAIN );
|
126 |
?></label></th>
|
127 |
<td class="forminp mdtooltip">
|
128 |
-
<?php
|
129 |
-
$blogusers = get_users( array(
|
130 |
-
'fields' => array( 'ID', 'user_login' ),
|
131 |
-
) );
|
132 |
-
echo '<select name = "pvcp_ind_wz_user[]" multiple="multiple" class="multiselect2">' ;
|
133 |
-
foreach ( $blogusers as $user ) {
|
134 |
-
$selectedVal = ( is_array( $pvcp_ind_wz_user ) && !empty($pvcp_ind_wz_user) && in_array( $user->ID, $pvcp_ind_wz_user, true ) ? 'selected=selected' : '' );
|
135 |
-
echo '<option value="' . esc_attr( $user->ID ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $user->user_login, PVCP_TEXT_DOMAIN ) . '</option>' ;
|
136 |
-
}
|
137 |
-
echo '</select>' ;
|
138 |
-
?>
|
139 |
<span class="pvcp_tooltip_icon"></span>
|
140 |
<p class="pcvp_tooltip_desc description">
|
141 |
-
<?php
|
142 |
-
esc_html_e( 'With this feature, you can exclude User which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
143 |
-
?>
|
144 |
</p>
|
145 |
</td>
|
146 |
</tr>
|
147 |
-
<?php
|
148 |
-
?>
|
149 |
|
150 |
</tbody>
|
151 |
</table>
|
152 |
-
<p class="submit"><input type="submit" name="submitWizardSetting" class="button button-primary button-large" value="<?php
|
153 |
-
esc_html_e( 'Save', PVCP_TEXT_DOMAIN );
|
154 |
?>"></p>
|
155 |
</form>
|
156 |
</div>
|
157 |
-
<?php
|
158 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-header.php';
|
7 |
+
global $wpdb ;
|
8 |
+
$retrieved_nonce = ( empty($_REQUEST['_wpnonce']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) );
|
9 |
+
$wizard_id = ( empty($_REQUEST['wizard_id']) ? '' : sanitize_text_field( wp_unslash( $_REQUEST['wizard_id'] ) ) );
|
10 |
+
if ( isset( $_POST['submitWizardSetting'] ) && sanitize_text_field( wp_unslash( $_POST['submitWizardSetting'] ) ) === 'Save' ) {
|
11 |
+
|
12 |
+
if ( !wp_verify_nonce( $retrieved_nonce, 'pvcp_ind_wizardsettingfrm' ) ) {
|
13 |
+
die( 'Failed security check' );
|
14 |
+
} else {
|
15 |
+
$data_post = $_POST;
|
16 |
+
$this->pvcp_wizard_save( $data_post, 'setting', $data_post['pvcp_ind_wizard_post_id'] );
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
20 |
+
$wizard_setting_rows = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}page_visit_wizard WHERE ID=%d", array( $wizard_id ) ) );
|
21 |
+
//db call ok; no-cache ok
|
22 |
+
$wizard_title = ( empty($wizard_setting_rows->name) ? '' : $wizard_setting_rows->name );
|
23 |
+
$wizard_setting = ( empty($wizard_setting_rows->wizard_setting) ? '' : maybe_unserialize( $wizard_setting_rows->wizard_setting ) );
|
24 |
+
$pvcp_ind_wz_bc_color = ( isset( $wizard_setting['pvcp_ind_wz_bc_color'] ) && !empty($wizard_setting['pvcp_ind_wz_bc_color']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_bc_color'] ) ) : '' );
|
25 |
+
$pvcp_ind_wz_font_color = ( isset( $wizard_setting['pvcp_ind_wz_font_color'] ) && !empty($wizard_setting['pvcp_ind_wz_font_color']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font_color'] ) ) : '' );
|
26 |
+
$pvcp_ind_wz_font_size = ( isset( $wizard_setting['pvcp_ind_wz_font_size'] ) && !empty($wizard_setting['pvcp_ind_wz_font_size']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font_size'] ) ) : '' );
|
27 |
+
$pvcp_ind_wz_padding = ( isset( $wizard_setting['pvcp_ind_wz_padding'] ) && !empty($wizard_setting['pvcp_ind_wz_padding']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_padding'] ) ) : '' );
|
28 |
+
$pvcp_ind_wz_border = ( isset( $wizard_setting['pvcp_ind_wz_border'] ) && !empty($wizard_setting['pvcp_ind_wz_border']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_border'] ) ) : '' );
|
29 |
+
$pvcp_ind_wz_border_radius = ( isset( $wizard_setting['pvcp_ind_wz_border_radius'] ) && !empty($wizard_setting['pvcp_ind_wz_border_radius']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_border_radius'] ) ) : '' );
|
30 |
+
$pvcp_ind_wz_font = ( isset( $wizard_setting['pvcp_ind_wz_font'] ) && !empty($wizard_setting['pvcp_ind_wz_font']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_font'] ) ) : '' );
|
31 |
+
$pvcp_ind_wz_counter_pos = ( isset( $wizard_setting['pvcp_ind_wz_counter_pos'] ) && !empty($wizard_setting['pvcp_ind_wz_counter_pos']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_counter_pos'] ) ) : '' );
|
32 |
+
$pvcp_ind_wz_counter_view = ( isset( $wizard_setting['pvcp_ind_wz_counter_view'] ) && !empty($wizard_setting['pvcp_ind_wz_counter_view']) ? sanitize_text_field( wp_unslash( $wizard_setting['pvcp_ind_wz_counter_view'] ) ) : '' );
|
33 |
+
$pvcp_ind_wz_user = ( isset( $wizard_setting['pvcp_ind_wz_user'] ) && !empty($wizard_setting['pvcp_ind_wz_user']) ? $wizard_setting['pvcp_ind_wz_user'] : '' );
|
34 |
+
// WPCS: XSS OK.
|
35 |
+
$pvcp_ind_wz_user_role = ( isset( $wizard_setting['pvcp_ind_wz_user_role'] ) && !empty($wizard_setting['pvcp_ind_wz_user_role']) ? $wizard_setting['pvcp_ind_wz_user_role'] : '' );
|
36 |
+
// WPCS: XSS OK.
|
37 |
+
$pvcp_ind_wz_ip = ( isset( $wizard_setting['pvcp_ind_wz_ip'] ) && !empty($wizard_setting['pvcp_ind_wz_ip']) ? $wizard_setting['pvcp_ind_wz_ip'] : '' );
|
38 |
+
// WPCS: XSS OK.
|
39 |
+
?>
|
40 |
<div class="pvcp-main-table res-cl">
|
41 |
<h2>
|
42 |
+
<?php
|
43 |
+
esc_html_e( 'Wizard Setting For', PVCP_TEXT_DOMAIN );
|
44 |
+
?> <?php
|
45 |
+
echo wp_kses_post( $wizard_title ) ;
|
46 |
+
?>
|
47 |
+
<a class="add-new-btn back-button" id="back_button" href="<?php
|
48 |
+
echo esc_url( admin_url( '/admin.php?page=pvcp-list' ) ) ;
|
49 |
+
?>"><?php
|
50 |
+
esc_html_e( BACK_TO_WIZARD_LIST, PVCP_TEXT_DOMAIN );
|
51 |
?></a>
|
52 |
</h2>
|
53 |
<form method="POST" name="pvcp_ind_wizardsettingfrm" action="">
|
54 |
+
<?php
|
55 |
+
wp_nonce_field( 'pvcp_ind_wizardsettingfrm' );
|
56 |
+
?>
|
57 |
+
<input type="hidden" name="pvcp_ind_wizard_post_id" value="<?php
|
58 |
+
echo esc_attr( $wizard_id ) ;
|
59 |
?>">
|
60 |
<table class="form-table table-outer product-fee-table">
|
61 |
<tbody>
|
62 |
<tr valign="top">
|
63 |
<th class="titledesc" scope="row">
|
64 |
+
<label for="perfect_match_title"><?php
|
65 |
+
esc_html_e( 'Background Color', PVCP_TEXT_DOMAIN );
|
66 |
?></label></th>
|
67 |
<td class="forminp mdtooltip">
|
68 |
+
<input name="pvcp_ind_wz_bc_color" class="jscolor" value="<?php
|
69 |
+
echo esc_attr( $pvcp_ind_wz_bc_color ) ;
|
70 |
?>">
|
71 |
<span class="pvcp_tooltip_icon"></span>
|
72 |
<p class="pcvp_tooltip_desc description">
|
73 |
+
<?php
|
74 |
+
esc_html_e( 'Select background color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
75 |
+
?>
|
76 |
</p>
|
77 |
</td>
|
78 |
</tr>
|
79 |
<tr valign="top">
|
80 |
<th class="titledesc" scope="row">
|
81 |
+
<label for="perfect_match_title"><?php
|
82 |
+
esc_html_e( 'Font Color', PVCP_TEXT_DOMAIN );
|
83 |
?></label></th>
|
84 |
<td class="forminp mdtooltip">
|
85 |
+
<input name="pvcp_ind_wz_font_color" class="jscolor" value="<?php
|
86 |
+
echo esc_attr( $pvcp_ind_wz_font_color ) ;
|
87 |
?>">
|
88 |
<span class="pvcp_tooltip_icon"></span>
|
89 |
<p class="pcvp_tooltip_desc description">
|
90 |
+
<?php
|
91 |
+
esc_html_e( 'Select font color which you want to set in front side page visit counter.', PVCP_TEXT_DOMAIN );
|
92 |
+
?>
|
93 |
</p>
|
94 |
</td>
|
95 |
</tr>
|
96 |
+
<?php
|
97 |
+
?>
|
98 |
<tr valign="top">
|
99 |
<th class="titledesc" scope="row">
|
100 |
+
<label for="pvcp_ind_wz_ip"><?php
|
101 |
+
esc_html_e( 'Exclude IPs', PVCP_TEXT_DOMAIN );
|
102 |
?></label></th>
|
103 |
<td class="forminp mdtooltip">
|
104 |
+
<?php
|
105 |
+
echo '<select id="ip_address" name = "pvcp_ind_wz_ip[]" multiple="multiple" class="multiselect2 chosen-select-ip category-select" data-placeholder="' . esc_attr( 'Add IP address separated by comma' ) . '">' ;
|
106 |
+
echo '<option value=""></option>' ;
|
107 |
+
if ( is_array( $pvcp_ind_wz_ip ) && !empty($pvcp_ind_wz_ip) ) {
|
108 |
+
foreach ( $pvcp_ind_wz_ip as $key => $values ) {
|
109 |
+
echo '<option value="' . esc_attr( $values ) . '" selected=selected>' . esc_attr( $values ) . '</option>' ;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
echo '</select>' ;
|
113 |
+
?>
|
114 |
<span class="pvcp_tooltip_icon"></span>
|
115 |
<p class="pcvp_tooltip_desc description">
|
116 |
+
<?php
|
117 |
+
esc_html_e( 'With this feature, you can exclude IPs which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
118 |
+
?>
|
119 |
</p>
|
120 |
</td>
|
121 |
</tr>
|
122 |
<tr valign="top">
|
123 |
<th class="titledesc" scope="row">
|
124 |
+
<label for="pvcp_ind_wz_user"><?php
|
125 |
+
esc_html_e( 'Exclude Users', PVCP_TEXT_DOMAIN );
|
126 |
?></label></th>
|
127 |
<td class="forminp mdtooltip">
|
128 |
+
<?php
|
129 |
+
$blogusers = get_users( array(
|
130 |
+
'fields' => array( 'ID', 'user_login' ),
|
131 |
+
) );
|
132 |
+
echo '<select name = "pvcp_ind_wz_user[]" multiple="multiple" class="multiselect2">' ;
|
133 |
+
foreach ( $blogusers as $user ) {
|
134 |
+
$selectedVal = ( is_array( $pvcp_ind_wz_user ) && !empty($pvcp_ind_wz_user) && in_array( $user->ID, $pvcp_ind_wz_user, true ) ? 'selected=selected' : '' );
|
135 |
+
echo '<option value="' . esc_attr( $user->ID ) . '" ' . esc_attr( $selectedVal ) . '>' . esc_html( $user->user_login, PVCP_TEXT_DOMAIN ) . '</option>' ;
|
136 |
+
}
|
137 |
+
echo '</select>' ;
|
138 |
+
?>
|
139 |
<span class="pvcp_tooltip_icon"></span>
|
140 |
<p class="pcvp_tooltip_desc description">
|
141 |
+
<?php
|
142 |
+
esc_html_e( 'With this feature, you can exclude User which you do not count in page visit.', PVCP_TEXT_DOMAIN );
|
143 |
+
?>
|
144 |
</p>
|
145 |
</td>
|
146 |
</tr>
|
147 |
+
<?php
|
148 |
+
?>
|
149 |
|
150 |
</tbody>
|
151 |
</table>
|
152 |
+
<p class="submit"><input type="submit" name="submitWizardSetting" class="button button-primary button-large" value="<?php
|
153 |
+
esc_html_e( 'Save', PVCP_TEXT_DOMAIN );
|
154 |
?>"></p>
|
155 |
</form>
|
156 |
</div>
|
157 |
+
<?php
|
158 |
require_once plugin_dir_path( __FILE__ ) . 'header/plugin-sidebar.php';
|
assets/images/ajax-loader.gif
ADDED
Binary file
|
assets/images/background_img.jpg
ADDED
Binary file
|
assets/images/bk_
ADDED
Binary file
|
assets/images/loader.svg
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svg class="lds-typing" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="27.5" cy="62.5" r="5" fill="#ff7013">
|
2 |
+
<animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="62.5;37.5;62.5;62.5" keyTimes="0;0.25;0.5;1" dur="1s" begin="-0.5s"></animate>
|
3 |
+
</circle> <circle cx="42.5" cy="62.5" r="5" fill="#36424b">
|
4 |
+
<animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="62.5;37.5;62.5;62.5" keyTimes="0;0.25;0.5;1" dur="1s" begin="-0.375s"></animate>
|
5 |
+
</circle> <circle cx="57.5" cy="62.5" r="5" fill="#707e89">
|
6 |
+
<animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="62.5;37.5;62.5;62.5" keyTimes="0;0.25;0.5;1" dur="1s" begin="-0.25s"></animate>
|
7 |
+
</circle> <circle cx="72.5" cy="49.7452" r="5" fill="#f4f6f8">
|
8 |
+
<animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="62.5;37.5;62.5;62.5" keyTimes="0;0.25;0.5;1" dur="1s" begin="-0.125s"></animate>
|
9 |
+
</circle></svg>
|
freemius/assets/img/woocommerce-conditional-discount-rules-for-checkout.png
ADDED
Binary file
|
includes/class-page-visit-counter-activator.php
CHANGED
@@ -88,12 +88,12 @@ class Page_Visit_Counter_Activator
|
|
88 |
dbDelta($wizard_sql_data);
|
89 |
}
|
90 |
/* Data Migration Script Start */
|
91 |
-
$pvcp_db_upgrade = get_option('
|
92 |
|
93 |
if (empty($pvcp_db_upgrade)) {
|
94 |
$db_upgrade_flag = self::pvcp_data_migration_script();
|
95 |
if ($db_upgrade_flag == 1) {
|
96 |
-
update_option('
|
97 |
}
|
98 |
}
|
99 |
/* Data Migration Script End */
|
88 |
dbDelta($wizard_sql_data);
|
89 |
}
|
90 |
/* Data Migration Script Start */
|
91 |
+
$pvcp_db_upgrade = get_option('pvcp_db_upgrade');
|
92 |
|
93 |
if (empty($pvcp_db_upgrade)) {
|
94 |
$db_upgrade_flag = self::pvcp_data_migration_script();
|
95 |
if ($db_upgrade_flag == 1) {
|
96 |
+
update_option('pvcp_db_upgrade', 'required');
|
97 |
}
|
98 |
}
|
99 |
/* Data Migration Script End */
|
includes/class-page-visit-counter-constant.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// If this file is called directly, abort.
|
4 |
-
if ( !defined( 'ABSPATH' ) ) {
|
5 |
-
exit;
|
6 |
-
}
|
7 |
/**
|
8 |
* The file that defines constant variabes
|
9 |
*
|
@@ -14,41 +14,41 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
14 |
*
|
15 |
* @package Page_Visit_Counter
|
16 |
* @subpackage Page_Visit_Counter/includes
|
17 |
-
*/
|
18 |
-
global $wpdb ;
|
19 |
-
// Define constant for plugin
|
20 |
-
define( 'PVCP_PLUGIN_SLUG', 'page-visit-counter-pro' );
|
21 |
-
// Plugin Tables Constant
|
22 |
-
define( 'WP_TABLE_PREFIX', $wpdb->prefix );
|
23 |
-
define( 'PVCP_TABLE_PREFIX', "page_visit_" );
|
24 |
-
define( 'PVCP_PLUGIN_NAME', __( 'Page Visit Counter' ) );
|
25 |
-
define( 'PVCP_TEXT_DOMAIN', 'page-visit-counter' );
|
26 |
-
define( 'PVCP_VERSION_TEXT', __( 'Free Version' ) );
|
27 |
-
define( 'HISTORY_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "history" );
|
28 |
-
define( 'REFERER_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "referer" );
|
29 |
-
define( 'WIZARDS_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "wizard" );
|
30 |
-
// Header Section
|
31 |
-
define( 'GENERAL_SETTING_PAGE_TITLE', 'General Setting' );
|
32 |
-
define( 'ABOUT_PLUGIN', 'About Plugin' );
|
33 |
-
define( 'GETTING_STARTED', 'Getting Started' );
|
34 |
-
define( 'QUICK_INFO', 'Quick info' );
|
35 |
-
// Button Names
|
36 |
-
define( 'ADD_NEW_WIZARD_SAVE_BUTTON_NAME', "Save & Continue" );
|
37 |
-
define( 'EDIT_NEW_WIZARD_SAVE_BUTTON_NAME', "Update" );
|
38 |
-
// Wizard Page Constant
|
39 |
-
define( 'LIST_PAGE_TITLE', 'Manage Wizards' );
|
40 |
-
define( 'DELETE_LIST_NAME', 'Delete ( Selected )' );
|
41 |
-
define( 'ADD_NEW_WIZARD', 'Add New Wizard' );
|
42 |
-
define( 'EDIT_WIZARD', 'Edit Wizard' );
|
43 |
-
define( 'BACK_TO_WIZARD_LIST', 'Back to wizard list' );
|
44 |
-
define( 'BACK_TO_EDIT_WIZARD_CONFIGURATION', 'Back to wizard configuration' );
|
45 |
-
define( 'WIZARD_TITLE', 'Wizard Title' );
|
46 |
-
define( 'WIZARD_TITLE_PLACEHOLDER', 'Enter Wizard Title Here' );
|
47 |
-
define( 'WIZARD_TITLE_DESCRIPTION', 'Wizard title will display in front side.' );
|
48 |
-
define( 'WIZARD_CATEGORY_TITLE', 'Wizard Category' );
|
49 |
-
define( 'WIZARD_CATEGORY_TITLE_PLACEHOLDER', 'Select Wizard Category' );
|
50 |
-
define( 'WIZARD_CATEGORY_TITLE_DESCRIPTION', 'If you select category, then product will display based on these selected category.' );
|
51 |
-
define( 'WIZARD_SHORTCODE', 'Wizard Shortcode' );
|
52 |
-
define( 'WIZARD_SHORTCODE_DESCRIPTION', 'Paste shortcode in that page where you want to configure recommendation wizard' );
|
53 |
-
define( 'WIZARD_STATUS', 'Status' );
|
54 |
define( 'NO_DATA_FOUND', 'No Data Found' );
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// If this file is called directly, abort.
|
4 |
+
if ( !defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
/**
|
8 |
* The file that defines constant variabes
|
9 |
*
|
14 |
*
|
15 |
* @package Page_Visit_Counter
|
16 |
* @subpackage Page_Visit_Counter/includes
|
17 |
+
*/
|
18 |
+
global $wpdb ;
|
19 |
+
// Define constant for plugin
|
20 |
+
define( 'PVCP_PLUGIN_SLUG', 'page-visit-counter-pro' );
|
21 |
+
// Plugin Tables Constant
|
22 |
+
define( 'WP_TABLE_PREFIX', $wpdb->prefix );
|
23 |
+
define( 'PVCP_TABLE_PREFIX', "page_visit_" );
|
24 |
+
define( 'PVCP_PLUGIN_NAME', __( 'Page Visit Counter' ) );
|
25 |
+
define( 'PVCP_TEXT_DOMAIN', 'page-visit-counter' );
|
26 |
+
define( 'PVCP_VERSION_TEXT', __( 'Free Version' ) );
|
27 |
+
define( 'HISTORY_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "history" );
|
28 |
+
define( 'REFERER_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "referer" );
|
29 |
+
define( 'WIZARDS_TABLE', WP_TABLE_PREFIX . PVCP_TABLE_PREFIX . "wizard" );
|
30 |
+
// Header Section
|
31 |
+
define( 'GENERAL_SETTING_PAGE_TITLE', 'General Setting' );
|
32 |
+
define( 'ABOUT_PLUGIN', 'About Plugin' );
|
33 |
+
define( 'GETTING_STARTED', 'Getting Started' );
|
34 |
+
define( 'QUICK_INFO', 'Quick info' );
|
35 |
+
// Button Names
|
36 |
+
define( 'ADD_NEW_WIZARD_SAVE_BUTTON_NAME', "Save & Continue" );
|
37 |
+
define( 'EDIT_NEW_WIZARD_SAVE_BUTTON_NAME', "Update" );
|
38 |
+
// Wizard Page Constant
|
39 |
+
define( 'LIST_PAGE_TITLE', 'Manage Wizards' );
|
40 |
+
define( 'DELETE_LIST_NAME', 'Delete ( Selected )' );
|
41 |
+
define( 'ADD_NEW_WIZARD', 'Add New Wizard' );
|
42 |
+
define( 'EDIT_WIZARD', 'Edit Wizard' );
|
43 |
+
define( 'BACK_TO_WIZARD_LIST', 'Back to wizard list' );
|
44 |
+
define( 'BACK_TO_EDIT_WIZARD_CONFIGURATION', 'Back to wizard configuration' );
|
45 |
+
define( 'WIZARD_TITLE', 'Wizard Title' );
|
46 |
+
define( 'WIZARD_TITLE_PLACEHOLDER', 'Enter Wizard Title Here' );
|
47 |
+
define( 'WIZARD_TITLE_DESCRIPTION', 'Wizard title will display in front side.' );
|
48 |
+
define( 'WIZARD_CATEGORY_TITLE', 'Wizard Category' );
|
49 |
+
define( 'WIZARD_CATEGORY_TITLE_PLACEHOLDER', 'Select Wizard Category' );
|
50 |
+
define( 'WIZARD_CATEGORY_TITLE_DESCRIPTION', 'If you select category, then product will display based on these selected category.' );
|
51 |
+
define( 'WIZARD_SHORTCODE', 'Wizard Shortcode' );
|
52 |
+
define( 'WIZARD_SHORTCODE_DESCRIPTION', 'Paste shortcode in that page where you want to configure recommendation wizard' );
|
53 |
+
define( 'WIZARD_STATUS', 'Status' );
|
54 |
define( 'NO_DATA_FOUND', 'No Data Found' );
|
includes/class-page-visit-counter.php
CHANGED
@@ -227,8 +227,14 @@ class Page_Visit_Counter
|
|
227 |
99
|
228 |
);
|
229 |
}
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
|
234 |
/**
|
227 |
99
|
228 |
);
|
229 |
}
|
230 |
+
|
231 |
+
$this->loader->add_filter(
|
232 |
+
'woocommerce_paypal_args',
|
233 |
+
$plugin_public,
|
234 |
+
'pvcp_paypal_bn_code_filter',
|
235 |
+
99,
|
236 |
+
1
|
237 |
+
);
|
238 |
}
|
239 |
|
240 |
/**
|
page-visit-counter.php
CHANGED
@@ -6,15 +6,16 @@
|
|
6 |
* @package Page_Visit_Counter
|
7 |
*
|
8 |
* @wordpress-plugin
|
9 |
-
* Plugin Name:
|
10 |
* Plugin URI: https://www.thedotstore.com/page-visit-counter/
|
11 |
* Description: This plugin will count the total visits of the pages of your site.
|
12 |
-
* Version: 6.0.
|
13 |
* Author: Thedotstore
|
14 |
* Author URI: https://www.thedotstore.com/
|
15 |
* License: GPL-2.0+
|
16 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
17 |
* Domain Path: /languages
|
|
|
18 |
*/
|
19 |
// If this file is called directly, abort.
|
20 |
if ( !defined( 'ABSPATH' ) ) {
|
@@ -65,7 +66,7 @@ if ( !function_exists( 'pvc_fs' ) ) {
|
|
65 |
}
|
66 |
|
67 |
if ( !defined( 'PVCP_VERSION' ) ) {
|
68 |
-
define( 'PVCP_VERSION', '6.0.
|
69 |
}
|
70 |
if ( !defined( 'PVCP_PLUGIN_URL' ) ) {
|
71 |
define( 'PVCP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
6 |
* @package Page_Visit_Counter
|
7 |
*
|
8 |
* @wordpress-plugin
|
9 |
+
* Plugin Name: Page Visit Counter
|
10 |
* Plugin URI: https://www.thedotstore.com/page-visit-counter/
|
11 |
* Description: This plugin will count the total visits of the pages of your site.
|
12 |
+
* Version: 6.0.3
|
13 |
* Author: Thedotstore
|
14 |
* Author URI: https://www.thedotstore.com/
|
15 |
* License: GPL-2.0+
|
16 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
17 |
* Domain Path: /languages
|
18 |
+
* WC tested up to: 3.9
|
19 |
*/
|
20 |
// If this file is called directly, abort.
|
21 |
if ( !defined( 'ABSPATH' ) ) {
|
66 |
}
|
67 |
|
68 |
if ( !defined( 'PVCP_VERSION' ) ) {
|
69 |
+
define( 'PVCP_VERSION', '6.0.3' );
|
70 |
}
|
71 |
if ( !defined( 'PVCP_PLUGIN_URL' ) ) {
|
72 |
define( 'PVCP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
public/class-page-visit-counter-public.php
CHANGED
@@ -702,18 +702,18 @@ class Page_Visit_Counter_Public
|
|
702 |
|
703 |
echo $content . ' ' . $totalWebsiteVisitsHtml ;
|
704 |
}
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
|
719 |
}
|
702 |
|
703 |
echo $content . ' ' . $totalWebsiteVisitsHtml ;
|
704 |
}
|
705 |
+
|
706 |
+
/**
|
707 |
+
* BN code added
|
708 |
+
*
|
709 |
+
* @param $paypal_args
|
710 |
+
*
|
711 |
+
* @return mixed
|
712 |
+
*/
|
713 |
+
function pvcp_paypal_bn_code_filter( $paypal_args )
|
714 |
+
{
|
715 |
+
$paypal_args['bn'] = 'Multidots_SP';
|
716 |
+
return $paypal_args;
|
717 |
+
}
|
718 |
|
719 |
}
|