Plugin Directory

Changeset 3277253


Ignore:
Timestamp:
04/19/2025 03:58:24 PM (10 months ago)
Author:
webstat
Message:

Version 2.6

Location:
web-stat
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • web-stat/tags/2.6/Web-Stat.php

    r3276820 r3277253  
    44Plugin URI: https://www.web-stat.com/
    55Description: Free, real-time stats for your website with full visitor details and traffic analytics.
    6 Version: 2.5.9
     6Version: 2.6
    77Author: <a href="https://www.web-stat.com" target="_new">Web-Stat</a>
    88License: GPLv2 or later
     
    1818
    1919class WebStatPlugin {
    20     const VERSION = '2.5.9';
     20    const VERSION = '2.6';
    2121    private $site_id = null;
    2222    private $alias = null;
     
    2828    private $has_json = false;
    2929    private $oc_a2 = null;
     30    private $oc = null;
    3031    private $is_admin_user = 0;
    3132    private $is_admin_page = 0;
     
    5758        delete_option('wts_db');
    5859        delete_option('wts_oc_a2');
     60        delete_option('wts_oc');
    5961    }
    6062   
     
    7072        $this->alias = get_option('wts_alias');
    7173        $this->db = get_option('wts_db');
     74        $this->oc = get_option('wts_oc');
    7275        $this->oc_a2 = current_user_can('install_plugins') ? (get_option('wts_oc_a2')) : null;
    7376        $this->language = substr(get_bloginfo('language'), 0, 2);
     
    108111            }
    109112            $wts_data['php_ajax_url'] = admin_url('admin-ajax.php');
     113            $wts_data['oc'] = $this->oc;
    110114            $wts_data['oc_a2'] = $this->oc_a2;
    111115            $wts_data['is_admin_user'] = 1;
     
    163167                update_option('wts_db', $this->db);
    164168
     169                if (isset($decoded['oc'])) {
     170                    update_option('wts_oc', $decoded['oc']);
     171                }
    165172                if (isset($decoded['oc_a2'])) {
    166173                    update_option('wts_oc_a2', $decoded['oc_a2']);
     
    250257        $url = $host . '/' . $page . '?oc_a2=' . $this->oc_a2 . '&is_admin=' . $this->is_admin_user . '&version=' . self::VERSION . '&source=WordPress';
    251258        if (!$host || !$page || !$this->oc_a2){
    252            self::send_php_error('Could not display dashboard / host = ' . $host . ' / page = ' . $page . ' / oc_a2 = ' . $this->oc_a2);
     259           self::send_php_error('Could not display page ' . $url);
    253260        }
    254261        echo '
     
    272279        }
    273280        </style>
    274         <iframe src="' . $url . '" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" id="wts_iframe"></iframe>';
     281        <iframe src="' . esc_url($url) . '" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" id="wts_iframe"></iframe>';
    275282    }
    276283    private function get_host() {
     
    302309        }
    303310    }
    304     public function render_dashboard_widget() {
    305         $dashboard_url = urlencode(admin_url());
    306         $host = $this->get_host();
    307         $url = $host . '/wpFrame.htm?&oc_a2=' . $this->oc_a2 . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
    308         if (!$host || !$this->oc_a2){
    309            self::send_php_error('Could not display dashboard widget / host = ' . $host . ' / oc_a2 = ' . $this->oc_a2 . ' / dashboard_url = '.$dashboard_url);
    310         }
    311         echo '<iframe src="' . $url . '" style="width:100%; height:500px;" id="wts_iframe"></iframe>';
    312     }
     311    public function render_dashboard_widget() {
     312        $dashboard_url = urlencode(admin_url());
     313        $host = $this->get_host();
     314        if ($host && $this->oc_a2) {
     315            $url = $host . '/wpFrame.htm?&oc_a2=' . $this->oc_a2 . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
     316        }
     317        elseif ($host && $this->oc) {
     318            $url = $host . '/wpFrame.htm?&oc=' . $this->oc . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
     319        }
     320        else {
     321            self::send_php_error('Could not display dashboard widget at ' . $url .' / dashboard_url = ' . $dashboard_url);
     322            return; // Exit early
     323        }
     324        echo '<iframe src="' . esc_url($url) . '" style="width:100%; height:500px;" id="wts_iframe"></iframe>';
     325    }
    313326   
    314327    public function add_plugin_row_meta($links, $plugin_file) {
  • web-stat/tags/2.6/js/wts_script.js

    r3276820 r3277253  
    1111        window.wts_data.is_admin_page = window.wts_data.is_admin_page || "0";
    1212
    13         if (window.wts_data.is_admin_user === "0" && window.wts_data.alias && window.wts_data.db) {
     13        if (
     14            window.wts_data.is_admin_user === "0" &&
     15            window.wts_data.alias &&
     16            window.wts_data.db &&
     17            window.wts_data.oc
     18        ) {
    1419            window.wts_data.fetched = 1;
    15         } else if (
     20        }
     21        else if (
    1622            window.wts_data.is_admin_user === "1" &&
    1723            window.wts_data.alias &&
     
    2228        }
    2329
    24         if (window.wts_data.fetched == 1 && window.wts_data.is_admin_page === "0") {
    25             recordHit();
     30        if (window.wts_data.fetched == 1) {
     31            if (window.wts_data.is_admin_page === "0"){
     32               recordHit();
     33            }
    2634            return;
    2735        }
  • web-stat/tags/2.6/readme.txt

    r3276820 r3277253  
    55Requires at least: 4.9.5
    66Tested up to: 6.8
    7 Stable tag: 2.5.9
     7Stable tag: 2.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9393== Changelog ==
    9494
     95= 2.6 =
     96* Released: 2025-04-19
     97* 2.6 Allow dashboard widget in guest mode
    9598= 2.5.9 =
    9699* Released: 2025-04-17
     
    200203 
    201204== Upgrade Notice ==
     205= 2.6 =
     206* 2.6 Allow dashboard widget in guest mode
    202207= 2.5.9 =
    203208* 2.5.9 Improved error logging
  • web-stat/trunk/Web-Stat.php

    r3276820 r3277253  
    44Plugin URI: https://www.web-stat.com/
    55Description: Free, real-time stats for your website with full visitor details and traffic analytics.
    6 Version: 2.5.9
     6Version: 2.6
    77Author: <a href="https://www.web-stat.com" target="_new">Web-Stat</a>
    88License: GPLv2 or later
     
    1818
    1919class WebStatPlugin {
    20     const VERSION = '2.5.9';
     20    const VERSION = '2.6';
    2121    private $site_id = null;
    2222    private $alias = null;
     
    2828    private $has_json = false;
    2929    private $oc_a2 = null;
     30    private $oc = null;
    3031    private $is_admin_user = 0;
    3132    private $is_admin_page = 0;
     
    5758        delete_option('wts_db');
    5859        delete_option('wts_oc_a2');
     60        delete_option('wts_oc');
    5961    }
    6062   
     
    7072        $this->alias = get_option('wts_alias');
    7173        $this->db = get_option('wts_db');
     74        $this->oc = get_option('wts_oc');
    7275        $this->oc_a2 = current_user_can('install_plugins') ? (get_option('wts_oc_a2')) : null;
    7376        $this->language = substr(get_bloginfo('language'), 0, 2);
     
    108111            }
    109112            $wts_data['php_ajax_url'] = admin_url('admin-ajax.php');
     113            $wts_data['oc'] = $this->oc;
    110114            $wts_data['oc_a2'] = $this->oc_a2;
    111115            $wts_data['is_admin_user'] = 1;
     
    163167                update_option('wts_db', $this->db);
    164168
     169                if (isset($decoded['oc'])) {
     170                    update_option('wts_oc', $decoded['oc']);
     171                }
    165172                if (isset($decoded['oc_a2'])) {
    166173                    update_option('wts_oc_a2', $decoded['oc_a2']);
     
    250257        $url = $host . '/' . $page . '?oc_a2=' . $this->oc_a2 . '&is_admin=' . $this->is_admin_user . '&version=' . self::VERSION . '&source=WordPress';
    251258        if (!$host || !$page || !$this->oc_a2){
    252            self::send_php_error('Could not display dashboard / host = ' . $host . ' / page = ' . $page . ' / oc_a2 = ' . $this->oc_a2);
     259           self::send_php_error('Could not display page ' . $url);
    253260        }
    254261        echo '
     
    272279        }
    273280        </style>
    274         <iframe src="' . $url . '" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" id="wts_iframe"></iframe>';
     281        <iframe src="' . esc_url($url) . '" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" id="wts_iframe"></iframe>';
    275282    }
    276283    private function get_host() {
     
    302309        }
    303310    }
    304     public function render_dashboard_widget() {
    305         $dashboard_url = urlencode(admin_url());
    306         $host = $this->get_host();
    307         $url = $host . '/wpFrame.htm?&oc_a2=' . $this->oc_a2 . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
    308         if (!$host || !$this->oc_a2){
    309            self::send_php_error('Could not display dashboard widget / host = ' . $host . ' / oc_a2 = ' . $this->oc_a2 . ' / dashboard_url = '.$dashboard_url);
    310         }
    311         echo '<iframe src="' . $url . '" style="width:100%; height:500px;" id="wts_iframe"></iframe>';
    312     }
     311    public function render_dashboard_widget() {
     312        $dashboard_url = urlencode(admin_url());
     313        $host = $this->get_host();
     314        if ($host && $this->oc_a2) {
     315            $url = $host . '/wpFrame.htm?&oc_a2=' . $this->oc_a2 . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
     316        }
     317        elseif ($host && $this->oc) {
     318            $url = $host . '/wpFrame.htm?&oc=' . $this->oc . '&version=' . self::VERSION . '&dashboard_url=' . $dashboard_url;
     319        }
     320        else {
     321            self::send_php_error('Could not display dashboard widget at ' . $url .' / dashboard_url = ' . $dashboard_url);
     322            return; // Exit early
     323        }
     324        echo '<iframe src="' . esc_url($url) . '" style="width:100%; height:500px;" id="wts_iframe"></iframe>';
     325    }
    313326   
    314327    public function add_plugin_row_meta($links, $plugin_file) {
  • web-stat/trunk/js/wts_script.js

    r3276820 r3277253  
    1111        window.wts_data.is_admin_page = window.wts_data.is_admin_page || "0";
    1212
    13         if (window.wts_data.is_admin_user === "0" && window.wts_data.alias && window.wts_data.db) {
     13        if (
     14            window.wts_data.is_admin_user === "0" &&
     15            window.wts_data.alias &&
     16            window.wts_data.db &&
     17            window.wts_data.oc
     18        ) {
    1419            window.wts_data.fetched = 1;
    15         } else if (
     20        }
     21        else if (
    1622            window.wts_data.is_admin_user === "1" &&
    1723            window.wts_data.alias &&
     
    2228        }
    2329
    24         if (window.wts_data.fetched == 1 && window.wts_data.is_admin_page === "0") {
    25             recordHit();
     30        if (window.wts_data.fetched == 1) {
     31            if (window.wts_data.is_admin_page === "0"){
     32               recordHit();
     33            }
    2634            return;
    2735        }
  • web-stat/trunk/readme.txt

    r3276820 r3277253  
    55Requires at least: 4.9.5
    66Tested up to: 6.8
    7 Stable tag: 2.5.9
     7Stable tag: 2.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9393== Changelog ==
    9494
     95= 2.6 =
     96* Released: 2025-04-19
     97* 2.6 Allow dashboard widget in guest mode
    9598= 2.5.9 =
    9699* Released: 2025-04-17
     
    200203 
    201204== Upgrade Notice ==
     205= 2.6 =
     206* 2.6 Allow dashboard widget in guest mode
    202207= 2.5.9 =
    203208* 2.5.9 Improved error logging
Note: See TracChangeset for help on using the changeset viewer.