Changeset 3277253
- Timestamp:
- 04/19/2025 03:58:24 PM (10 months ago)
- Location:
- web-stat
- Files:
-
- 3 edited
- 4 copied
-
tags/2.6 (copied) (copied from web-stat/trunk)
-
tags/2.6/Web-Stat.php (copied) (copied from web-stat/trunk/Web-Stat.php) (10 diffs)
-
tags/2.6/js/wts_script.js (copied) (copied from web-stat/trunk/js/wts_script.js) (2 diffs)
-
tags/2.6/readme.txt (copied) (copied from web-stat/trunk/readme.txt) (3 diffs)
-
trunk/Web-Stat.php (modified) (10 diffs)
-
trunk/js/wts_script.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
web-stat/tags/2.6/Web-Stat.php
r3276820 r3277253 4 4 Plugin URI: https://www.web-stat.com/ 5 5 Description: Free, real-time stats for your website with full visitor details and traffic analytics. 6 Version: 2. 5.96 Version: 2.6 7 7 Author: <a href="https://www.web-stat.com" target="_new">Web-Stat</a> 8 8 License: GPLv2 or later … … 18 18 19 19 class WebStatPlugin { 20 const VERSION = '2. 5.9';20 const VERSION = '2.6'; 21 21 private $site_id = null; 22 22 private $alias = null; … … 28 28 private $has_json = false; 29 29 private $oc_a2 = null; 30 private $oc = null; 30 31 private $is_admin_user = 0; 31 32 private $is_admin_page = 0; … … 57 58 delete_option('wts_db'); 58 59 delete_option('wts_oc_a2'); 60 delete_option('wts_oc'); 59 61 } 60 62 … … 70 72 $this->alias = get_option('wts_alias'); 71 73 $this->db = get_option('wts_db'); 74 $this->oc = get_option('wts_oc'); 72 75 $this->oc_a2 = current_user_can('install_plugins') ? (get_option('wts_oc_a2')) : null; 73 76 $this->language = substr(get_bloginfo('language'), 0, 2); … … 108 111 } 109 112 $wts_data['php_ajax_url'] = admin_url('admin-ajax.php'); 113 $wts_data['oc'] = $this->oc; 110 114 $wts_data['oc_a2'] = $this->oc_a2; 111 115 $wts_data['is_admin_user'] = 1; … … 163 167 update_option('wts_db', $this->db); 164 168 169 if (isset($decoded['oc'])) { 170 update_option('wts_oc', $decoded['oc']); 171 } 165 172 if (isset($decoded['oc_a2'])) { 166 173 update_option('wts_oc_a2', $decoded['oc_a2']); … … 250 257 $url = $host . '/' . $page . '?oc_a2=' . $this->oc_a2 . '&is_admin=' . $this->is_admin_user . '&version=' . self::VERSION . '&source=WordPress'; 251 258 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); 253 260 } 254 261 echo ' … … 272 279 } 273 280 </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>'; 275 282 } 276 283 private function get_host() { … … 302 309 } 303 310 } 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 } 313 326 314 327 public function add_plugin_row_meta($links, $plugin_file) { -
web-stat/tags/2.6/js/wts_script.js
r3276820 r3277253 11 11 window.wts_data.is_admin_page = window.wts_data.is_admin_page || "0"; 12 12 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 ) { 14 19 window.wts_data.fetched = 1; 15 } else if ( 20 } 21 else if ( 16 22 window.wts_data.is_admin_user === "1" && 17 23 window.wts_data.alias && … … 22 28 } 23 29 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 } 26 34 return; 27 35 } -
web-stat/tags/2.6/readme.txt
r3276820 r3277253 5 5 Requires at least: 4.9.5 6 6 Tested up to: 6.8 7 Stable tag: 2. 5.97 Stable tag: 2.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 93 93 == Changelog == 94 94 95 = 2.6 = 96 * Released: 2025-04-19 97 * 2.6 Allow dashboard widget in guest mode 95 98 = 2.5.9 = 96 99 * Released: 2025-04-17 … … 200 203 201 204 == Upgrade Notice == 205 = 2.6 = 206 * 2.6 Allow dashboard widget in guest mode 202 207 = 2.5.9 = 203 208 * 2.5.9 Improved error logging -
web-stat/trunk/Web-Stat.php
r3276820 r3277253 4 4 Plugin URI: https://www.web-stat.com/ 5 5 Description: Free, real-time stats for your website with full visitor details and traffic analytics. 6 Version: 2. 5.96 Version: 2.6 7 7 Author: <a href="https://www.web-stat.com" target="_new">Web-Stat</a> 8 8 License: GPLv2 or later … … 18 18 19 19 class WebStatPlugin { 20 const VERSION = '2. 5.9';20 const VERSION = '2.6'; 21 21 private $site_id = null; 22 22 private $alias = null; … … 28 28 private $has_json = false; 29 29 private $oc_a2 = null; 30 private $oc = null; 30 31 private $is_admin_user = 0; 31 32 private $is_admin_page = 0; … … 57 58 delete_option('wts_db'); 58 59 delete_option('wts_oc_a2'); 60 delete_option('wts_oc'); 59 61 } 60 62 … … 70 72 $this->alias = get_option('wts_alias'); 71 73 $this->db = get_option('wts_db'); 74 $this->oc = get_option('wts_oc'); 72 75 $this->oc_a2 = current_user_can('install_plugins') ? (get_option('wts_oc_a2')) : null; 73 76 $this->language = substr(get_bloginfo('language'), 0, 2); … … 108 111 } 109 112 $wts_data['php_ajax_url'] = admin_url('admin-ajax.php'); 113 $wts_data['oc'] = $this->oc; 110 114 $wts_data['oc_a2'] = $this->oc_a2; 111 115 $wts_data['is_admin_user'] = 1; … … 163 167 update_option('wts_db', $this->db); 164 168 169 if (isset($decoded['oc'])) { 170 update_option('wts_oc', $decoded['oc']); 171 } 165 172 if (isset($decoded['oc_a2'])) { 166 173 update_option('wts_oc_a2', $decoded['oc_a2']); … … 250 257 $url = $host . '/' . $page . '?oc_a2=' . $this->oc_a2 . '&is_admin=' . $this->is_admin_user . '&version=' . self::VERSION . '&source=WordPress'; 251 258 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); 253 260 } 254 261 echo ' … … 272 279 } 273 280 </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>'; 275 282 } 276 283 private function get_host() { … … 302 309 } 303 310 } 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 } 313 326 314 327 public function add_plugin_row_meta($links, $plugin_file) { -
web-stat/trunk/js/wts_script.js
r3276820 r3277253 11 11 window.wts_data.is_admin_page = window.wts_data.is_admin_page || "0"; 12 12 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 ) { 14 19 window.wts_data.fetched = 1; 15 } else if ( 20 } 21 else if ( 16 22 window.wts_data.is_admin_user === "1" && 17 23 window.wts_data.alias && … … 22 28 } 23 29 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 } 26 34 return; 27 35 } -
web-stat/trunk/readme.txt
r3276820 r3277253 5 5 Requires at least: 4.9.5 6 6 Tested up to: 6.8 7 Stable tag: 2. 5.97 Stable tag: 2.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 93 93 == Changelog == 94 94 95 = 2.6 = 96 * Released: 2025-04-19 97 * 2.6 Allow dashboard widget in guest mode 95 98 = 2.5.9 = 96 99 * Released: 2025-04-17 … … 200 203 201 204 == Upgrade Notice == 205 = 2.6 = 206 * 2.6 Allow dashboard widget in guest mode 202 207 = 2.5.9 = 203 208 * 2.5.9 Improved error logging
Note: See TracChangeset
for help on using the changeset viewer.