Changeset 2072236
- Timestamp:
- 04/21/2019 08:45:35 PM (7 years ago)
- Location:
- heimdall/trunk
- Files:
-
- 2 added
- 2 edited
-
heimdall.php (modified) (11 diffs)
-
includes/access.php (added)
-
includes/commons.php (added)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
heimdall/trunk/heimdall.php
r2070861 r2072236 23 23 Plugin URI: https://wordpress.org/plugins/heimdall 24 24 Description: A simple way to tracking clients activities. 25 Version: 1. 1.325 Version: 1.2.0 26 26 Author: Arman Afzal 27 27 Author URI: https://github.com/Rmanaf … … 33 33 defined('ABSPATH') or die; 34 34 35 require_once __DIR__ . "/includes/commons.php"; 35 36 require_once __DIR__ . "/includes/query-builder.php"; 37 require_once __DIR__ . "/includes/access.php"; 36 38 37 39 if (!class_exists('WP_Heimdall_Plugin')) { … … 69 71 70 72 73 //new WP_Access_Plugin(); 74 75 71 76 add_shortcode('statistics', [$this, 'statistics_shortcode']); 72 73 77 74 78 add_action('admin_init', [$this, 'admin_init']); … … 95 99 { 96 100 $hooks = self::$hit_hooks; 97 } else {101 } else { 98 102 $hooks = explode(',' , $hooks ); 99 103 } … … 192 196 { 193 197 194 $ip = $this->get_ip_address();198 $ip = WP_Heimdall_Commons::get_ip_address(); 195 199 196 200 if($ip == null) … … 384 388 </style> 385 389 386 <h2> Most used keywords</h2>390 <h2><?php _e("Most used keywords" , self::$text_domain); ?></h2> 387 391 <ul id="most-used-keywords" class="tags"></ul> 388 392 <hr /> 389 393 390 <h2> Weekly report</h2>394 <h2><?php _e("Weekly report" , self::$text_domain); ?></h2> 391 395 <div class="chart-container" style="position: relative; width:100%; height:300px;"> 392 396 <canvas id="statisticsChart"></canvas> … … 406 410 $list[] = [ 407 411 'template' => "[statistics class='' params='' hook='']", 408 'description' => __("Renders the number of visitors", self::$text_domain), 412 'description' => __("Renders the number of visitors", self::$text_domain) 413 ]; 414 415 $list[] = [ 416 'template' => "[access ip='' error='' before='' after='' die='']", 417 'description' => __("Restricts access to a page or a part of it according to the client's IP.", self::$text_domain) 409 418 ]; 410 419 … … 441 450 $tag = strtolower(trim($tag)); 442 451 443 return "<$tag data-statistics-value=\"$count\" class=\"$class statistics-$style\">$count</$tag>"; 452 $result = "<$tag data-statistics-value=\"$count\" class=\"$class statistics-$style\">$count</$tag>"; 453 454 return apply_filters("heimdall_statistics_result" , $result); 444 455 445 456 } … … 485 496 </th> 486 497 <td> 487 <?php _e("<p>If you faced any issues, please tell us on <strong><a target=\"_blank\" href=\"https://github.com/Rmanaf/wp- statistics/issues/new\">Github</a></strong>"); ?>498 <?php _e("<p>If you faced any issues, please tell us on <strong><a target=\"_blank\" href=\"https://github.com/Rmanaf/wp-heimdall/issues/new\">Github</a></strong>"); ?> 488 499 </td> 489 500 </tr> … … 669 680 670 681 671 672 /**673 * returns client ip address674 * @since 1.0.0675 */676 private function get_ip_address()677 {678 679 foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key) {680 681 if (array_key_exists($key, $_SERVER) === true) {682 683 foreach (explode(',', $_SERVER[$key]) as $ip) {684 $ip = trim($ip);685 686 if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {687 return $ip;688 }689 690 }691 692 }693 694 }695 696 }697 698 699 682 /** 700 683 * records client activity … … 734 717 } 735 718 736 $ip = $this->get_ip_address();719 $ip = WP_Heimdall_Commons::get_ip_address(); 737 720 738 721 if($ip == null) -
heimdall/trunk/readme.txt
r2070861 r2072236 5 5 Tested up to: 5.1.1 6 6 Requires PHP: 5.2.4 7 Stable tag: 1. 1.37 Stable tag: 1.2.0 8 8 License: Apache License, Version 2.0 9 9 License URI: https://github.com/Rmanaf/wp-heimdall/blob/master/LICENSE
Note: See TracChangeset
for help on using the changeset viewer.