| 1 |
<?php |
| 2 |
$wp_analytify = new WP_Analytify(); |
| 3 |
|
| 4 |
if (! function_exists( 'curl_init' ) ) { |
| 5 |
esc_html_e('This plugin requires the CURL PHP extension'); |
| 6 |
return false; |
| 7 |
} |
| 8 |
|
| 9 |
if (! function_exists( 'json_decode' ) ) { |
| 10 |
esc_html_e('This plugin requires the JSON PHP extension'); |
| 11 |
return false; |
| 12 |
} |
| 13 |
|
| 14 |
if (! function_exists( 'http_build_query' )) { |
| 15 |
esc_html_e('This plugin requires http_build_query()'); |
| 16 |
return false; |
| 17 |
} |
| 18 |
|
| 19 |
// Save access code |
| 20 |
if ( isset( $_POST[ 'save_code' ] ) ) { |
| 21 |
|
| 22 |
if( isset($_POST['auth_step']) and $_POST['auth_step'] == 'user_keys' ) { |
| 23 |
|
| 24 |
update_option('ANALYTIFY_CLIENTID' , $_POST['analytify_clientid']); |
| 25 |
update_option('ANALYTIFY_CLIENTSECRET' , $_POST['analytify_clientsecret']); |
| 26 |
update_option('ANALYTIFY_DEV_KEY' , $_POST['analytify_apikey']); |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
if( isset($_POST['auth_step']) and $_POST['auth_step'] == 'user_access_code' ) { |
| 32 |
|
| 33 |
$key_google_token = $_POST[ 'key_google_token' ]; |
| 34 |
|
| 35 |
if( $wp_analytify->pt_save_data( $key_google_token )){ |
| 36 |
$update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Access code saved.</strong></p></div>'; |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
} |
| 42 |
|
| 43 |
$url = http_build_query( array( |
| 44 |
'next' => $wp_analytify->pa_setting_url(), |
| 45 |
'scope' => ANALYTIFY_SCOPE, |
| 46 |
'response_type' => 'code', |
| 47 |
'redirect_uri' => ANALYTIFY_REDIRECT, |
| 48 |
'client_id' => get_option('ANALYTIFY_CLIENTID'), |
| 49 |
'access_type' => 'offline', |
| 50 |
'approval_prompt' => 'auto' |
| 51 |
) |
| 52 |
); |
| 53 |
|
| 54 |
// Saving settings for back end Analytics for Posts and Pages. |
| 55 |
if ( isset( $_POST[ 'save_settings_admin' ] ) ) { |
| 56 |
|
| 57 |
update_option( 'post_analytics_settings_back' , $_POST[ 'backend' ] ); |
| 58 |
update_option( 'analytify_posts_stats' , $_POST[ 'posts' ] ); |
| 59 |
update_option( 'post_analytics_access_back' , $_POST[ 'access_role_back' ] ); |
| 60 |
update_option( 'post_analytics_disable_back' , $_POST[ 'disable_back' ] ); |
| 61 |
update_option( 'post_analytics_exclude_posts_back', @$_POST[ 'exclude_posts_back' ]); |
| 62 |
|
| 63 |
$update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Admin changes are saved.</strong></p></div>'; |
| 64 |
|
| 65 |
} // endif |
| 66 |
|
| 67 |
// Saving Profiles |
| 68 |
if (isset($_POST[ 'save_profile' ])) { |
| 69 |
|
| 70 |
$profile_id = $_POST[ 'webprofile' ]; |
| 71 |
$display_tracking_code = $_POST[ 'display_tracking_code' ]; |
| 72 |
$tracking_code = $_POST[ 'tracking_code' ]; |
| 73 |
$web_profile_dashboard = $_POST[ 'webprofile_dashboard' ]; |
| 74 |
$web_profile_url = $_POST[ $web_profile_dashboard ]; |
| 75 |
$webPropertyId = $_POST[ $profile_id."-1"]; |
| 76 |
|
| 77 |
update_option( 'pt_webprofile', $profile_id ); |
| 78 |
update_option( 'webPropertyId', $webPropertyId); |
| 79 |
update_option( 'pt_webprofile_dashboard', $web_profile_dashboard ); |
| 80 |
update_option( 'pt_webprofile_url', urldecode( urldecode( $web_profile_url ))); |
| 81 |
update_option( 'analytify_tracking_code', $tracking_code); |
| 82 |
update_option( 'display_tracking_code', $display_tracking_code); |
| 83 |
|
| 84 |
if( isset( $_POST[ 'ga_code' ] ) ) { |
| 85 |
update_option( 'analytify_code', 1 ); |
| 86 |
} |
| 87 |
else{ |
| 88 |
update_option( 'analytify_code', 0 ); |
| 89 |
} |
| 90 |
$update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"> |
| 91 |
<p><strong>Your Google Analytics Profile Saved.</strong></p></div>'; |
| 92 |
} |
| 93 |
|
| 94 |
// Clear Authorization and other data |
| 95 |
if (isset($_POST[ "clear" ])) { |
| 96 |
|
| 97 |
delete_option( 'pt_webprofile' ); |
| 98 |
delete_option( 'pt_webprofile_dashboard' ); |
| 99 |
delete_option( 'pt_webprofile_url' ); |
| 100 |
delete_option( 'pa_google_token' ); |
| 101 |
delete_option( 'pa_welcome_message' ); |
| 102 |
delete_option( 'post_analytics_token' ); |
| 103 |
$update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"> |
| 104 |
<p><strong>Authentication Cleared login again.</strong></p></div>'; |
| 105 |
} |
| 106 |
?> |
| 107 |
|
| 108 |
<div class="wrap"> |
| 109 |
<h2 class='opt-title'><span id='icon-options-general' class='analytics-options'><img src="<?php echo plugins_url('wp-analytify/images/wp-analytics-logo.png');?>" alt=""></span> |
| 110 |
<?php echo __( 'Analytify Settings', 'wp-analytify'); ?> |
| 111 |
</h2> |
| 112 |
|
| 113 |
<?php |
| 114 |
if (isset($update_message)) echo $update_message; |
| 115 |
|
| 116 |
if ( isset ( $_GET['tab'] ) ) $wp_analytify->pa_settings_tabs($_GET['tab']); |
| 117 |
else $wp_analytify->pa_settings_tabs( 'authentication' ); |
| 118 |
|
| 119 |
if ( isset ( $_GET['tab'] ) ) |
| 120 |
$tab = $_GET['tab']; |
| 121 |
else |
| 122 |
$tab = 'authentication'; |
| 123 |
|
| 124 |
// Authentication Tab section |
| 125 |
if( $tab == 'authentication' ) { |
| 126 |
?> |
| 127 |
|
| 128 |
<form action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>" method="post" name="settings_form" id="settings_form"> |
| 129 |
<table width="1004" class="form-table"> |
| 130 |
<tbody> |
| 131 |
<?php if( get_option( 'pa_google_token' ) ) { ?> |
| 132 |
<tr> |
| 133 |
<p class="description"><br />Do you want to re-authenticate ? Click reset button and get your new Access code.<p> |
| 134 |
|
| 135 |
</tr> |
| 136 |
<tr> |
| 137 |
<th><?php esc_html_e( 'Clear Authentication', 'wp-analytify' ); ?></th> |
| 138 |
<td><input type="submit" class="button-primary" value="Reset" name="clear" /></td> |
| 139 |
</tr> |
| 140 |
<?php |
| 141 |
} |
| 142 |
else { ?> |
| 143 |
|
| 144 |
<tr> |
| 145 |
<th></th> |
| 146 |
|
| 147 |
<td> |
| 148 |
<p class="description"> To fully enjoy this plugin, you need to create a Project in Google <a target="_blank" href="https://console.developers.google.com/project">Console</a>. Read this simple 3 minutes <a target="_blank" href="http://wp-analytify.com/google-api-tutorial">tutorial</a> to get your ClientID, Client Secret and API Key and enter them in below inputs.</p> |
| 149 |
</td> |
| 150 |
</tr> |
| 151 |
|
| 152 |
|
| 153 |
<tr> |
| 154 |
<th></th> |
| 155 |
|
| 156 |
<td> |
| 157 |
<input type="radio" value="user_keys" <?php if(!get_option('ANALYTIFY_CLIENTID')) echo 'checked'; ?> name="auth_step" id="user_keys" /> Step 1. Enter Your API Keys<br /> |
| 158 |
<?php |
| 159 |
|
| 160 |
if( get_option('ANALYTIFY_CLIENTID') and get_option('ANALYTIFY_CLIENTSECRET') and get_option('ANALYTIFY_DEV_KEY') ) { |
| 161 |
?> |
| 162 |
<input type="radio" checked value="user_access_code" name="auth_step" id ="user_access_code" /> Step 2. Enter Access Code<br /> |
| 163 |
<?php |
| 164 |
} |
| 165 |
?> |
| 166 |
</td> |
| 167 |
</tr> |
| 168 |
|
| 169 |
<tr class="user_keys"> |
| 170 |
<th></th> |
| 171 |
<td> |
| 172 |
<span><a href="#nogo" id="populate_keys">Auto Populate following fields</a></span> |
| 173 |
</td> |
| 174 |
</tr> |
| 175 |
<tr class="user_keys"> |
| 176 |
<th></th> |
| 177 |
<td> |
| 178 |
<input type="text" placeholder="<?php esc_html_e('Your ClientID')?>" name="analytify_clientid" id="analytify_clientid" value="<?php echo get_option('ANALYTIFY_CLIENTID'); ?>" style="width:450px;"/> |
| 179 |
<p class="description"><?php esc_html_e('ClientID:')?></p> |
| 180 |
</td> |
| 181 |
</tr> |
| 182 |
|
| 183 |
<tr class="user_keys"> |
| 184 |
<th></th> |
| 185 |
<td> |
| 186 |
<input type="text" placeholder="<?php esc_html_e('Your Client Secret')?>" name="analytify_clientsecret" id="analytify_clientsecret" value="<?php echo get_option('ANALYTIFY_CLIENTSECRET'); ?>" style="width:450px;"/> |
| 187 |
<p class="description"><?php esc_html_e('Client Secret:')?> </p> |
| 188 |
</td> |
| 189 |
</tr> |
| 190 |
|
| 191 |
|
| 192 |
<tr class="user_keys"> |
| 193 |
<th width="115"></th> |
| 194 |
<td width="877"> |
| 195 |
<input type="text" placeholder="<?php esc_html_e('Your API Key')?>" name="analytify_apikey" id="analytify_apikey" value="<?php echo get_option('ANALYTIFY_DEV_KEY'); ?>" style="width:450px;"/> |
| 196 |
<p class="description"><?php esc_html_e( 'API Key:' )?></p> |
| 197 |
</td> |
| 198 |
</tr> |
| 199 |
|
| 200 |
<tr class="user_access_code"> |
| 201 |
<th width="115"></th> |
| 202 |
<td width="877"> |
| 203 |
<a target="_blank" href="javascript:void(0);" onclick="window.open('https://accounts.google.com/o/oauth2/auth?<?php echo $url ?>','activate','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');">Get Your Access Code</a> |
| 204 |
</td> |
| 205 |
</tr> |
| 206 |
<tr class="user_access_code"> |
| 207 |
<th></th> |
| 208 |
<td> |
| 209 |
<input type="text" name="key_google_token" placeholder="<?php esc_html_e('Your Access Code')?>" value="<?php echo get_option( 'post_analytics_token'); ?>" style="width:450px;"/> |
| 210 |
<p class="description">Paste here Access Code.</p> |
| 211 |
</td> |
| 212 |
</tr> |
| 213 |
<tr> |
| 214 |
<th></th> |
| 215 |
<td> |
| 216 |
<p class="submit"> |
| 217 |
<input type="submit" class="button-primary" value="Save Changes" name="save_code" /> |
| 218 |
</p> |
| 219 |
</td> |
| 220 |
</tr> |
| 221 |
<?php } ?> |
| 222 |
</tbody> |
| 223 |
</table> |
| 224 |
</form> |
| 225 |
<?php |
| 226 |
} // endif |
| 227 |
// Choose profiles for dashboard and posts at front/back. |
| 228 |
if( $tab == 'profile' ){ |
| 229 |
|
| 230 |
$profiles = $wp_analytify->pt_get_analytics_accounts(); |
| 231 |
|
| 232 |
if( isset( $profiles ) ) { ?> |
| 233 |
<p class="description"><br /><?php esc_html_e( 'Select your profiles for front-end and backend sections.', 'wp-analytify' ); ?></p> |
| 234 |
|
| 235 |
<form action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>" method="post"> |
| 236 |
<table width="1004" class="form-table"> |
| 237 |
<tbody> |
| 238 |
<tr> |
| 239 |
<th width="115"><?php esc_html_e( 'Install Google Analytics tracking code :', 'wp-analytify' ); ?></th> |
| 240 |
<td width="877"> |
| 241 |
<input type="checkbox" name="ga_code" value="1" |
| 242 |
<?php if( get_option( 'analytify_code' ) == 1 ) { echo 'checked'; } ?>> |
| 243 |
<p class="description">Insert Google Analytics JS code in header to track the visitors. You can uncheck this option if you have already insert the GA code in your website.</p> |
| 244 |
</td> |
| 245 |
</tr> |
| 246 |
<tr> |
| 247 |
<th width="115"> |
| 248 |
<?php esc_html_e( 'Exclude users from tracking :', 'wp-analytify' ); ?> |
| 249 |
</th> |
| 250 |
<td> |
| 251 |
<select multiple name="display_tracking_code[]" class="analytify-chosen" style="width:306px"> |
| 252 |
<?php |
| 253 |
|
| 254 |
if ( !isset( $wp_roles ) ) { |
| 255 |
|
| 256 |
$wp_roles = new WP_Roles(); |
| 257 |
} |
| 258 |
|
| 259 |
foreach ( $wp_roles->role_names as $role => $name ) { ?> |
| 260 |
|
| 261 |
<option value="<?php echo $role; ?>" |
| 262 |
<?php |
| 263 |
|
| 264 |
if ( is_array( get_option( 'display_tracking_code' ) ) ) { |
| 265 |
|
| 266 |
selected( in_array( $role, get_option('display_tracking_code') ) ); |
| 267 |
|
| 268 |
} |
| 269 |
|
| 270 |
?>> |
| 271 |
<?php echo $name; ?> |
| 272 |
</option> |
| 273 |
<?php |
| 274 |
} |
| 275 |
?> |
| 276 |
</select> |
| 277 |
<p class="description">Don't insert the tracking code for above user roles.</p> |
| 278 |
</td> |
| 279 |
</tr> |
| 280 |
<tr> |
| 281 |
<th width="115"><?php esc_html_e( 'Tracking code type :', 'wp-analytify' ); ?></th> |
| 282 |
<td width="877"> |
| 283 |
<select name='tracking_code' class="analytify-chosen"> |
| 284 |
<option value="universal" <?php selected( 'universal', get_option( 'analytify_tracking_code' ) ); ?>> |
| 285 |
Universal Code (analytics.js) |
| 286 |
</option> |
| 287 |
<option value="ga" <?php selected( 'ga', get_option( 'analytify_tracking_code' ) ); ?>> |
| 288 |
Tranditional Code (ga.js) |
| 289 |
</option> |
| 290 |
|
| 291 |
</select> |
| 292 |
<p class="description">Which type of tracking code to use i-e (Analytics.js , ga.js) Google recommends to use Analytics.js now <a href="https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs" target="_blank">Read More</a>.</p> |
| 293 |
</td> |
| 294 |
</tr> |
| 295 |
<tr> |
| 296 |
<th width="115"><?php esc_html_e( 'Profile for posts (Backend/Front-end) :', 'wp-analytify' ); ?></th> |
| 297 |
<td width="877"> |
| 298 |
<?php //print_r($profiles->items); ?> |
| 299 |
<select name='webprofile' class="analytify-chosen"> |
| 300 |
<?php foreach ( $profiles->items as $profile ) { ?> |
| 301 |
<option value="<?php echo $profile[ 'id' ];?>" |
| 302 |
<?php selected( $profile[ 'id' ], get_option( 'pt_webprofile' ) ); ?>> |
| 303 |
<?php echo $profile[ 'websiteUrl' ];?> - <?php echo $profile[ 'name' ];?> |
| 304 |
</option> |
| 305 |
<?php } ?> |
| 306 |
</select> |
| 307 |
<?php |
| 308 |
foreach ( $profiles->items as $profile ) { ?> |
| 309 |
<input type="hidden" name="<?php echo $profile[ 'id' ]; ?>-1" value="<?php echo $profile['webPropertyId'] ?>"> |
| 310 |
<?php } ?> |
| 311 |
<p class="description">Select your website profile for wp-admin edit pages and fron-end pages. Select profile which matches your current WordPress website.</p> |
| 312 |
</td> |
| 313 |
|
| 314 |
</tr> |
| 315 |
<tr> |
| 316 |
<th width="115"><?php esc_html_e( 'Profile for Dashboard :', 'wp-analytify' );?></th> |
| 317 |
<td width="877"> |
| 318 |
<select name='webprofile_dashboard' class="analytify-chosen"> |
| 319 |
<?php foreach ($profiles->items as $profile) { ?> |
| 320 |
<option value="<?php echo $profile[ 'id' ];?>" |
| 321 |
<?php selected( $profile[ 'id' ], get_option( 'pt_webprofile_dashboard' )); ?> |
| 322 |
> |
| 323 |
<?php echo $profile[ 'websiteUrl' ];?> - <?php echo $profile[ 'name' ];?> |
| 324 |
</option> |
| 325 |
<?php } ?> |
| 326 |
</select> |
| 327 |
<?php |
| 328 |
foreach ( $profiles->items as $profile ) { ?> |
| 329 |
<input type="hidden" name="<?php echo $profile[ 'id' ]; ?>" value="<?php echo urlencode(urlencode($profile[ 'websiteUrl' ])); ?>"> |
| 330 |
<?php } ?> |
| 331 |
<p class="description">Select your website profile for Dashboard Stats. You can select your any Website profile. It will show Analytics for your selected website profile.</p> |
| 332 |
</td> |
| 333 |
</tr> |
| 334 |
<tr> |
| 335 |
<th></th> |
| 336 |
<td> |
| 337 |
<p class="submit"> |
| 338 |
<input type="submit" name="save_profile" value="Save Changes" class="button-primary"> |
| 339 |
</p> |
| 340 |
</td> |
| 341 |
</tr> |
| 342 |
<?php } ?> |
| 343 |
</tbody> |
| 344 |
</table> |
| 345 |
</form> |
| 346 |
<?php } |
| 347 |
|
| 348 |
// Choose metrics for posts at admin. |
| 349 |
if( $tab == 'admin' ) { ?> |
| 350 |
|
| 351 |
<p class="description"><br /><?php esc_html_e( 'Following are the settings for Admin side. Google Analytics will appear under the posts, custom post types or pages.', 'wp-analytify' ); ?></p> |
| 352 |
|
| 353 |
<form action="" method="post"> |
| 354 |
<table width="1004" class="form-table"> |
| 355 |
<tbody> |
| 356 |
<tr></tr> |
| 357 |
<tr> |
| 358 |
<th><?php _e( 'Disable Analytics under posts/pages (wp-admin):', 'wp-analytify') ?></th> |
| 359 |
<td> |
| 360 |
<input type="checkbox" name="disable_back" value="1" <?php if ( get_option( 'post_analytics_disable_back') == 1 ) { ?> checked <?php } ?>> |
| 361 |
<p class="description">Check it, If you don't want to load Stats by default on all pages. Remember, There is a section under each post/page. You can still view Stats on pages you want.</p> |
| 362 |
</td> |
| 363 |
|
| 364 |
</tr> |
| 365 |
<tr> |
| 366 |
<th width="115"><?php esc_html_e( 'Show Analytics to (roles) :', 'wp-analytify' ); ?></th> |
| 367 |
<td> |
| 368 |
<select multiple name="access_role_back[]" class="analytify-chosen" style="width:400px"> |
| 369 |
<?php |
| 370 |
if ( !isset( $wp_roles ) ){ |
| 371 |
|
| 372 |
$wp_roles = new WP_Roles(); |
| 373 |
} |
| 374 |
|
| 375 |
$i=0; |
| 376 |
foreach ( $wp_roles->role_names as $role => $name ) { |
| 377 |
|
| 378 |
if ($role!='subscriber'){ |
| 379 |
|
| 380 |
$i++; |
| 381 |
|
| 382 |
?> |
| 383 |
<option value="<?php echo $role; ?>" |
| 384 |
<?php |
| 385 |
|
| 386 |
if ( is_array( get_option( 'post_analytics_access_back' ) ) ) { |
| 387 |
selected( in_array( $role, get_option( 'post_analytics_access_back' ) ) ); |
| 388 |
} |
| 389 |
?>> |
| 390 |
<?php echo $name; ?> |
| 391 |
</option> |
| 392 |
<?php |
| 393 |
} |
| 394 |
} |
| 395 |
?> |
| 396 |
</select> |
| 397 |
<p class="description">Show Analytics to above selected user roles only.</p> |
| 398 |
</td> |
| 399 |
</tr> |
| 400 |
<tr> |
| 401 |
<!-- Area For backend settings --> |
| 402 |
<th width="115"><?php esc_html_e( 'Analytics on Post types :' ,'wp-analytify'); ?></th> |
| 403 |
<td> |
| 404 |
<select class="analytify-chosen" name="posts[]" multiple="multiple" style="width:400px"> |
| 405 |
|
| 406 |
<option value="post" <?php if ( is_array( get_option( 'analytify_posts_stats' ) ) ) { |
| 407 |
selected(in_array('post', get_option('analytify_posts_stats'))); |
| 408 |
} ?> |
| 409 |
>Posts</option> |
| 410 |
<option value="page" <?php if ( is_array( get_option( 'analytify_posts_stats' ) ) ) { |
| 411 |
selected(in_array('page', get_option('analytify_posts_stats'))); |
| 412 |
} ?> |
| 413 |
>Pages</option> |
| 414 |
|
| 415 |
</select> |
| 416 |
<p class="description">Show Analytics under the above post types only. Buy <a href="http://wp-analytify.com/" target="_blank">Premium</a> version for Custom Post Types.</p> |
| 417 |
</td> |
| 418 |
</tr> |
| 419 |
<tr> |
| 420 |
<!-- Area For backend settings --> |
| 421 |
<th width="115"><?php esc_html_e( 'Edit pages/posts Analytics panels:' ); ?></th> |
| 422 |
<td> |
| 423 |
<select class="analytify-chosen" name="backend[]" multiple="multiple" style="width:400px"> |
| 424 |
<option value="show-overall-back" |
| 425 |
<?php |
| 426 |
if ( is_array( get_option( 'post_analytics_settings_back' ) ) ) { |
| 427 |
selected(in_array("show-overall-back", get_option('post_analytics_settings_back'))); |
| 428 |
} |
| 429 |
?>> |
| 430 |
<?php esc_html_e( 'General Stats' )?> |
| 431 |
</option> |
| 432 |
<option value="show-country-back" |
| 433 |
<?php |
| 434 |
if ( is_array( get_option( 'post_analytics_settings_back' ) ) ) { |
| 435 |
selected( in_array( "show-country-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 436 |
} |
| 437 |
?>> |
| 438 |
<?php esc_html_e( 'Country Stats' )?> |
| 439 |
</option> |
| 440 |
|
| 441 |
<option value="show-keywords-back" |
| 442 |
<?php |
| 443 |
if ( is_array ( get_option( 'post_analytics_settings_back' ) ) ) { |
| 444 |
selected( in_array( "show-keywords-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 445 |
} |
| 446 |
?>> |
| 447 |
<?php esc_html_e( 'Keywords Stats' ); ?> |
| 448 |
</option> |
| 449 |
<option value="show-social-back" |
| 450 |
<?php |
| 451 |
if ( is_array ( get_option( 'post_analytics_settings_back' ) ) ) { |
| 452 |
selected( in_array( "show-social-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 453 |
} |
| 454 |
?>> |
| 455 |
<?php esc_html_e( 'Social Media Stats' ); ?> |
| 456 |
</option> |
| 457 |
<option value="show-browser-back" |
| 458 |
<?php |
| 459 |
if ( is_array( get_option( 'post_analytics_settings_back' ) ) ) { |
| 460 |
selected( in_array( "show-browser-back", get_option( 'post_analytics_settings_back') ) ); |
| 461 |
} |
| 462 |
?>> |
| 463 |
<?php esc_html_e( 'Browser Stats' ); ?> |
| 464 |
</option> |
| 465 |
<option value="show-referrer-back" |
| 466 |
<?php |
| 467 |
if ( is_array( get_option( 'post_analytics_settings_back' ) ) ) { |
| 468 |
selected( in_array( "show-referrer-back", get_option( 'post_analytics_settings_back') ) ); |
| 469 |
} |
| 470 |
?>> |
| 471 |
<?php esc_html_e( 'Referrers' ); ?> |
| 472 |
</option> |
| 473 |
<option value="show-pages-back" |
| 474 |
<?php |
| 475 |
if ( is_array( get_option( 'post_analytics_settings_back' ) ) ) { |
| 476 |
selected( in_array( "show-pages-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 477 |
} |
| 478 |
?>> |
| 479 |
<?php esc_html_e(' Page bounce and exit stats '); ?> |
| 480 |
</option> |
| 481 |
<option value="show-mobile-back" |
| 482 |
<?php |
| 483 |
if ( is_array ( get_option( 'post_analytics_settings_back' ) ) ) { |
| 484 |
selected( in_array( "show-mobile-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 485 |
} |
| 486 |
?>> |
| 487 |
<?php esc_html_e( 'Mobile Devices Stats' ); ?> |
| 488 |
</option> |
| 489 |
<option value="show-os-back" |
| 490 |
<?php |
| 491 |
if ( is_array ( get_option( 'post_analytics_settings_back' ) ) ) { |
| 492 |
selected( in_array( "show-os-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 493 |
} |
| 494 |
?>> |
| 495 |
<?php esc_html_e( 'Operating System Stats' ); ?> |
| 496 |
</option> |
| 497 |
<option value="show-city-back" |
| 498 |
<?php |
| 499 |
if ( is_array ( get_option( 'post_analytics_settings_back' ) ) ) { |
| 500 |
selected( in_array( "show-city-back", get_option( 'post_analytics_settings_back' ) ) ); |
| 501 |
} |
| 502 |
?>> |
| 503 |
<?php esc_html_e( 'City Stats' ); ?> |
| 504 |
</option> |
| 505 |
</select> |
| 506 |
<p class="description">Select which Stats panels you want to display under posts/pages. Only 'General Stats' will visible in Free Version. Buy <a href="http://wp-analytify.com/" target="_blank">Premium</a> version to see the full statistics.</p> |
| 507 |
</td> |
| 508 |
</tr> |
| 509 |
<tr> |
| 510 |
<th width="115"><?php esc_html_e( 'Exclude Analytics on specific pages:', 'wp-analytify' ); ?></th> |
| 511 |
<td> |
| 512 |
<input type="text" name="exclude_posts_back" id="exclude_posts_back" value="<?php echo get_option('post_analytics_exclude_posts_back'); ?>" class="regular-text" /> |
| 513 |
<p class="description">Enter ID's of posts or pages separated by commas on which you don't want to show Analytics e.g 11,45,66</p> |
| 514 |
</td> |
| 515 |
</tr> |
| 516 |
<tr> |
| 517 |
<th></th> |
| 518 |
<td> |
| 519 |
<p class="submit"> |
| 520 |
<input type="submit" name="save_settings_admin" value="Save Changes" class="button-primary"> |
| 521 |
</p> |
| 522 |
</td> |
| 523 |
</tr> |
| 524 |
</tbody> |
| 525 |
</table> |
| 526 |
</form> |
| 527 |
<?php |
| 528 |
} |
| 529 |
?> |
| 530 |
|
| 531 |
</div> |
| 532 |
</div> |
| 533 |
<div class="right-area"> |
| 534 |
<table class="wa_feature_table"> |
| 535 |
<tbody> |
| 536 |
<tr> |
| 537 |
<th>Features</th> |
| 538 |
<th>Free</th> |
| 539 |
<th>Pro</th> |
| 540 |
</tr> |
| 541 |
<tr> |
| 542 |
<td><strong>Support</strong></td> |
| 543 |
<td>No</td> |
| 544 |
<td>Yes</td> |
| 545 |
</tr> |
| 546 |
<tr> |
| 547 |
<td><strong>Dashboard</strong></td> |
| 548 |
<td>Yes</td> |
| 549 |
<td>Yes</td> |
| 550 |
</tr> |
| 551 |
<tr> |
| 552 |
<td><strong>Live Stats</strong></td> |
| 553 |
<td>No</td> |
| 554 |
<td>Yes</td> |
| 555 |
</tr> |
| 556 |
<tr> |
| 557 |
<td><strong>ShortCodes</strong></td> |
| 558 |
<td>No</td> |
| 559 |
<td>Yes</td> |
| 560 |
</tr> |
| 561 |
|
| 562 |
<tr> |
| 563 |
<td><strong>Extensions</strong></td> |
| 564 |
<td>No</td> |
| 565 |
<td>Yes</td> |
| 566 |
</tr> |
| 567 |
<tr> |
| 568 |
<td><strong>Analytics under Posts (admin)</strong></td> |
| 569 |
<td>Yes (limited)</td> |
| 570 |
<td>Yes</td> |
| 571 |
</tr> |
| 572 |
<tr> |
| 573 |
<td><strong>Analytify under Pages (admin)</strong></td> |
| 574 |
<td>Yes (limited)</td> |
| 575 |
<td>Yes</td> |
| 576 |
</tr> |
| 577 |
<tr> |
| 578 |
<td><strong>Analytify under Custom Post Types (front/admin)</strong></td> |
| 579 |
<td>No</td> |
| 580 |
<td>Yes</td> |
| 581 |
</tr> |
| 582 |
</tbody> |
| 583 |
</table> |
| 584 |
<div class="postbox-container side"> |
| 585 |
<div class="metabox-holder"> |
| 586 |
<div class="grids_auto_size wpa_side_box" style="width: 95%;"> |
| 587 |
<div class="grid_title cen"> UPGRADE to PRO </div> |
| 588 |
|
| 589 |
<div class="grid_footer cen" style="background-color:white;"> |
| 590 |
<a href="http://wp-analytify.com/upgrade-from-free" title="Analytify Support">Buy Now</a> the PRO version of Analytify and get tons of benefits including premium features, support and updates. |
| 591 |
</div> |
| 592 |
</div> |
| 593 |
<div class="grids_auto_size wpa_side_box" style=" width: 95%;"> |
| 594 |
<div class="grid_footer cen"> |
| 595 |
made with ♥ by <a href="http://wpbrigade.com" title="WPBrigade | A Brigade of WordPress Developers." />WPBrigade</a> |
| 596 |
</div> |
| 597 |
</div> |
| 598 |
</div> |
| 599 |
</div> |
| 600 |
</div> |