Plugin Directory

Changeset 2072236


Ignore:
Timestamp:
04/21/2019 08:45:35 PM (7 years ago)
Author:
rmanaf
Message:

1.2.0

Location:
heimdall/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • heimdall/trunk/heimdall.php

    r2070861 r2072236  
    2323    Plugin URI: https://wordpress.org/plugins/heimdall
    2424    Description: A simple way to tracking clients activities.
    25     Version: 1.1.3
     25    Version: 1.2.0
    2626    Author: Arman Afzal
    2727    Author URI: https://github.com/Rmanaf
     
    3333defined('ABSPATH') or die;
    3434
     35require_once __DIR__ . "/includes/commons.php";
    3536require_once __DIR__ . "/includes/query-builder.php";
     37require_once __DIR__ . "/includes/access.php";
    3638
    3739if (!class_exists('WP_Heimdall_Plugin')) {
     
    6971
    7072           
     73            //new WP_Access_Plugin();
     74
     75
    7176            add_shortcode('statistics', [$this, 'statistics_shortcode']);
    72 
    7377
    7478            add_action('admin_init', [$this, 'admin_init']);
     
    9599            { 
    96100                $hooks = self::$hit_hooks;
    97             }else {
     101            } else {
    98102                $hooks = explode(',' ,  $hooks );
    99103            }
     
    192196            {
    193197
    194                 $ip = $this->get_ip_address();
     198                $ip = WP_Heimdall_Commons::get_ip_address();
    195199
    196200                if($ip == null)
     
    384388            </style>
    385389
    386             <h2>Most used keywords</h2>
     390            <h2><?php _e("Most used keywords" , self::$text_domain); ?></h2>
    387391            <ul id="most-used-keywords" class="tags"></ul>
    388392            <hr />
    389393
    390             <h2>Weekly report</h2>
     394            <h2><?php _e("Weekly report" , self::$text_domain); ?></h2>
    391395            <div class="chart-container" style="position: relative; width:100%; height:300px;">
    392396                <canvas id="statisticsChart"></canvas>
     
    406410            $list[] = [
    407411                '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)
    409418            ];
    410419
     
    441450            $tag = strtolower(trim($tag));
    442451
    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);
    444455
    445456        }
     
    485496                        </th>
    486497                        <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>"); ?>
    488499                        </td>
    489500                    </tr>
     
    669680
    670681
    671 
    672         /**
    673          * returns client ip address
    674          * @since 1.0.0
    675          */
    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 
    699682        /**
    700683         * records client activity
     
    734717            }
    735718
    736             $ip = $this->get_ip_address();
     719            $ip = WP_Heimdall_Commons::get_ip_address();
    737720
    738721            if($ip == null)
  • heimdall/trunk/readme.txt

    r2070861 r2072236  
    55Tested up to: 5.1.1
    66Requires PHP: 5.2.4
    7 Stable tag: 1.1.3
     7Stable tag: 1.2.0
    88License: Apache License, Version 2.0
    99License URI: https://github.com/Rmanaf/wp-heimdall/blob/master/LICENSE
Note: See TracChangeset for help on using the changeset viewer.