Plugin Directory

Changeset 1244796


Ignore:
Timestamp:
09/14/2015 05:25:01 AM (10 years ago)
Author:
svs-websoft
Message:

Bug Fixing

Location:
svs-shortlink-analytics/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • svs-shortlink-analytics/trunk/ShortlinkAnalyticsMain.php

    r1233974 r1244796  
    55 * Plugin URI: http://svs-websoft.com
    66 * Description: Generate short links & show link analytics.
    7  * Version: 1.0.0
     7 * Version: 1.0.1
    88 * Author: SVS WebSoft
    99 * Author URI: http://svs-websoft.com
     
    1313require_once "ShortlinkAnalyticsUtils.php";
    1414require_once "ShortlinkAnalyticsModel.php";
     15global $wpdb;
    1516
    1617/**
  • svs-shortlink-analytics/trunk/ShortlinkAnalyticsModel.php

    r1113225 r1244796  
    111111        $wp_svs_shortlinks = $this->db->prefix . 'svs_shortlinks';
    112112        $wp_svs_statistics = $this->db->prefix . 'svs_statistics';
    113         $name = esc_sql($_POST['name']);
    114         $select_http = esc_sql($_POST['select_http']);
    115         $url = esc_sql($_POST['url']);
     113        if (empty($_POST)){
     114            return false;
     115        }
     116        $name = esc_sql(@$_POST['name']);
     117        $select_http = esc_sql(@$_POST['select_http']);
     118        $url = esc_sql(@$_POST['url']);
    116119        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
    117120            $insert_url = $select_http.$url;
     
    129132                $generated_link = get_site_url() . "/" . $randomnumber;
    130133                $this->db->insert(
    131                     'wp_svs_shortlinks',
     134                    $wp_svs_shortlinks,
    132135                    array(
    133136                        'name_link' => esc_sql($_POST['name']),
     
    193196        $wp_svs_statistics = $this->db->prefix . 'svs_statistics';
    194197
    195         $id = esc_sql($_GET['id']);
    196         $filter = esc_sql($_GET['filter']);
    197         $display_range = esc_sql($_GET['displayRange']);
    198         $startDate = esc_sql($_GET['Startdate']);
    199         $endDate = esc_sql($_GET['Enddate']);
     198        $id = esc_sql(@$_GET['id']);
     199        $filter = esc_sql(@$_GET['filter']);
     200        $display_range = esc_sql(@$_GET['displayRange']);
     201        $startDate = esc_sql(@$_GET['Startdate']);
     202        $endDate = esc_sql(@$_GET['Enddate']);
    200203
    201204
     
    269272    private function getCurrentUrl() {
    270273        $pageURL = 'http';
    271         if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
     274        if (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    272275        $pageURL .= "://";
    273276        if ($_SERVER["SERVER_PORT"] != "80") {
     
    313316                $town = (string)((!empty($details_obs->geoplugin_city)) ? $details_obs->geoplugin_city : "Unknown");
    314317                $this->db->insert(
    315                     'wp_svs_statistics',
     318                    $wp_svs_statistics,
    316319                    array(
    317320                        'FK_links' => $id,
  • svs-shortlink-analytics/trunk/readme.txt

    r1238594 r1244796  
    4141
    4242== Changelog ==
     43= 1.0.1 =
     44* Bug fixing.
     45
    4346= 1.0.0 =
    4447* Initial Release.
  • svs-shortlink-analytics/trunk/style/css_svs.css

    r1113225 r1244796  
    4444#back_button {
    4545    float:right;
    46     top: 20px;
    47     right: 20px;
    48     position: absolute;
    4946}
    5047#filters_svs, #charts_svs {
  • svs-shortlink-analytics/trunk/views/statistics.php

    r1113225 r1244796  
    4343<?php
    4444
    45     $id = esc_sql($_GET['id']);
    46     $filter = esc_sql($_GET['filter']);
     45    $id = esc_sql(@$_GET['id']);
     46    $filter = esc_sql(@$_GET['filter']);
    4747    if (!$filter) {
    4848        $filter = "country";
    4949    }
    50     $displayRange = esc_sql($_GET['displayRange']);
    51     $startDate = esc_sql($_GET['Startdate']);
    52     $endDate = esc_sql($_GET['Enddate']);
     50    $displayRange = esc_sql(@$_GET['displayRange']);
     51    $startDate = esc_sql(@$_GET['Startdate']);
     52    $endDate = esc_sql(@$_GET['Enddate']);
    5353    $today = date('Y-m-d');
    5454    $firstday = date('Y-m-01');
     
    6060            <h2 style="font-size: 20px;padding-top: 40px">Filter by</h2>
    6161        </div>
    62         <p <?php if($_GET['filter'] == 'country' or !$_GET['filter']){ echo "class='selected_filter'"; } ?> >
     62        <p <?php if(@$_GET['filter'] == 'country' or !@$_GET['filter']){ echo "class='selected_filter'"; } ?> >
    6363            <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=country&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate"?>">Country</a></p>
    64         <p <?php if($_GET['filter'] == 'town'){ echo "class='selected_filter'"; } ?> >
     64        <p <?php if(@$_GET['filter'] == 'town'){ echo "class='selected_filter'"; } ?> >
    6565            <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=town&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">City</a></p>
    66         <p <?php if($_GET['filter'] == 'browser'){ echo "class='selected_filter'"; } ?> >
     66        <p <?php if(@$_GET['filter'] == 'browser'){ echo "class='selected_filter'"; } ?> >
    6767            <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=browser&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">Browser</a></p>
    68         <p <?php if($_GET['filter'] == 'system'){ echo "class='selected_filter'"; } ?>  style="border-bottom: 1px solid #E1DBDB;">
     68        <p <?php if(@$_GET['filter'] == 'system'){ echo "class='selected_filter'"; } ?>  style="border-bottom: 1px solid #E1DBDB;">
    6969            <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=system&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">Operating System</a></p>
    7070
     
    8383        <label>Select Date:</label>
    8484        <select id="select_sort" onchange="sort()" name="date">
    85             <option  <?php if ($_GET['displayRange'] == 'total') { echo "selected"; }?> value="total">Total</option>
    86             <option  <?php if ($_GET['displayRange'] == 'thisweek') { echo "selected"; }?> value="thisweek">This Week</option>
    87             <option  <?php if ($_GET['displayRange'] == 'thismonth') { echo "selected"; }?> value="thismonth">This Month</option>
    88             <option  <?php if ($_GET['displayRange'] == 'lastmonth') { echo "selected"; }?> value="lastmonth">Last Month</option>
    89             <option  <?php if ($_GET['displayRange'] == 'custom') { echo "selected"; }?> value="custom">Custom</option>
     85            <option  <?php if (@$_GET['displayRange'] == 'total') { echo "selected"; }?> value="total">Total</option>
     86            <option  <?php if (@$_GET['displayRange'] == 'thisweek') { echo "selected"; }?> value="thisweek">This Week</option>
     87            <option  <?php if (@$_GET['displayRange'] == 'thismonth') { echo "selected"; }?> value="thismonth">This Month</option>
     88            <option  <?php if (@$_GET['displayRange'] == 'lastmonth') { echo "selected"; }?> value="lastmonth">Last Month</option>
     89            <option  <?php if (@$_GET['displayRange'] == 'custom') { echo "selected"; }?> value="custom">Custom</option>
    9090        </select>
    9191        <div onload id="datepiker" style="display: none;">
     
    108108        <h2 style="font-size: 20px; text-align: center;">Clicks and Views filter by
    109109            <?php
    110             if($_GET['filter'] == 'country' or !$_GET['filter']){ echo "Country "; }
    111             else if ($_GET['filter'] == 'town' or !$_GET['filter']){ echo "City "; }
    112             else if ($_GET['filter'] == 'browser' or !$_GET['filter']){ echo "Browser "; }
    113             else if ($_GET['filter'] == 'system' or !$_GET['filter']){ echo "Operating System "; }
    114             if ($_GET['displayRange'] or $_GET['displayRange'] != "" or $_GET['displayRange'] != "total"){
    115                 if($_GET['displayRange'] == "thisweek") {
     110            if(@$_GET['filter'] == 'country' or !@$_GET['filter']){ echo "Country "; }
     111            else if (@$_GET['filter'] == 'town' or !@$_GET['filter']){ echo "City "; }
     112            else if (@$_GET['filter'] == 'browser' or !@$_GET['filter']){ echo "Browser "; }
     113            else if (@$_GET['filter'] == 'system' or !@$_GET['filter']){ echo "Operating System "; }
     114            if (@$_GET['displayRange'] or @$_GET['displayRange'] != "" or @$_GET['displayRange'] != "total"){
     115                if(@$_GET['displayRange'] == "thisweek") {
    116116                    $start = (date('D') != 'Mon') ? date('Y-m-d', strtotime('last Monday')) : date('Y-m-d');
    117117                    $today = date("Y-m-d");
    118118                    echo " and period: ".$start." / " .$today;
    119                 }else if($_GET['displayRange'] == "thismonth") {
     119                }else if(@$_GET['displayRange'] == "thismonth") {
    120120                    echo ": ".date('Y-M');
    121                 }else if($_GET['displayRange'] == "lastmonth") {
     121                }else if(@$_GET['displayRange'] == "lastmonth") {
    122122                    echo ": ".date('Y-M', strtotime(date('Y-m')." -1 month"));
    123                 }else if($_GET['displayRange'] == "custom" and $_GET['Startdate'] != "" and $_GET['Enddate'] != "") {
     123                }else if(@$_GET['displayRange'] == "custom" and @$_GET['Startdate'] != "" and @$_GET['Enddate'] != "") {
    124124                    echo " and period: ".$startDate." / " .$endDate;
    125125                }
     
    140140            <th  id="title_table_field">
    141141                <?php
    142                 $title_filter = esc_sql($_GET['filter']);
     142                $title_filter = esc_sql(@$_GET['filter']);
    143143                if (!$title_filter) {
    144144                    echo "Country";
     
    163163            <th  id="title_table_field">
    164164                <?php
    165                 $title_filter = esc_sql($_GET['filter']);
     165                $title_filter = esc_sql(@$_GET['filter']);
    166166                if (!$title_filter) {
    167167                    echo "Country";
Note: See TracChangeset for help on using the changeset viewer.