Skip to content

Commit

Permalink
v1.4.9
Browse files Browse the repository at this point in the history
* Compatible PHP8.x,
* Add translations,
* Correction phpcs 3.7.2 warning Wordpress,
* Update GeoIP Database 20240223.
  • Loading branch information
thanatos-vf-2000 committed Feb 24, 2024
1 parent 4e054ae commit 252b044
Show file tree
Hide file tree
Showing 46 changed files with 1,302 additions and 1,337 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits,
Requires at least: 5.7
Tested up to: 6.4.3
Requires PHP: 7.4
Stable tag: 1.4.8
Stable tag: 1.4.9
License: GPLv2

This plugin gives you the complete information on your website's visitors.
Expand Down Expand Up @@ -97,17 +97,13 @@ License: The GNU AGPL is an open-source license
Source: https://jvectormap.com/


###1.4.8 (2402-SFP1)
*Release Date - 11 Febrary 2023*
### 1.4.9 (2402-SFP2)
*Release Date - 24 Febrary 2023*

* Compatible Wordpress 6.4.3,
* Update GeoIP Database 20240209,
* Correction phpcs 3.7.2 error,
* Change Google GeoChart by jVectorMap 2.0.5,
* Correction country map to used parameters,
* Correction Use of undefined constant stats4wp_file,
* Add Data OS Ubuntu, Fedora,
* Add Data device pda.
* Compatible PHP8.x,
* Add translations,
* Correction phpcs 3.7.2 warning Wordpress,
* Update GeoIP Database 20240223.

See [changelog.txt](https://plugins.svn.wordpress.org/stats4wp/trunk/changelog.txt) for older changelog

Expand Down
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
This file contains older changelog entries, so we can keep the size of the standard WordPress readme.txt file reasonable.
For the latest changes, please see the "Changelog" section of the [readme.txt file](https://plugins.svn.wordpress.org/stats4wp/trunk/readme.txt).

= 1.4.9 (2402-SFP2) =
*Release Date - 24 Febrary 2023*

* Compatible PHP8.x,
* Add translations,
* Correction phpcs 3.7.2 warning Wordpress,
* Update GeoIP Database 20240223.

= 1.4.8 (2402-SFP1) =
*Release Date - 11 Febrary 2023*

Expand Down
Binary file modified db/GeoLite2-Country.mmdb
Binary file not shown.
6 changes: 3 additions & 3 deletions inc/Api/AdminGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Franck VANHOUCKE <[email protected]>
* @copyright 2021-2023 Copyright 2023, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
* @version 1.4.6 GIT:https://github.com/thanatos-vf-2000/WordPress
* @version 1.4.9 GIT:https://github.com/thanatos-vf-2000/WordPress
* @link https://ginkgos.net
*/

Expand Down Expand Up @@ -155,11 +155,11 @@ public static function get_var( $var ) {
case 6:
return gmdate( 'Y-m-d', strtotime( '-2 years' ) );
break;
case 7;
case 7:
if ( ! isset( $wpdb->stats4wp_visitor ) ) {
$wpdb->stats4wp_visitor = DB::table( 'visitor' );}
$visitor = $wpdb->get_row( "SELECT min(last_counter) as minimum FROM $wpdb->stats4wp_visitor" );
return $visitor->minimum;
return $visitor->minimum;
break;
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions inc/Api/GeoIP.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.7
* @version 1.4.9
*/
namespace STATS4WP\Api;

Expand All @@ -14,7 +14,7 @@ class GeoIP {
*
* @var string
*/
public static $geoip_date = '20240209';
public static $geoip_date = '20240223';

/**
* Date of database GeoIpLitle User IP
Expand Down
8 changes: 4 additions & 4 deletions inc/Api/TimeZone.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/
namespace STATS4WP\Api;

Expand Down Expand Up @@ -39,12 +39,12 @@ public static function set_timezone() {
public static function get_current_date( $format = 'Y-m-d H:i:s', $strtotime = null, $relative = null ) {
if ( $strtotime ) {
if ( $relative ) {
return date( $format, strtotime( "{$strtotime} day", $relative ) + self::set_timezone() );
return gmdate( $format, strtotime( "{$strtotime} day", $relative ) + self::set_timezone() );
} else {
return date( $format, strtotime( "{$strtotime} day" ) + self::set_timezone() );
return gmdate( $format, strtotime( "{$strtotime} day" ) + self::set_timezone() );
}
} else {
return date( $format, time() + self::set_timezone() );
return gmdate( $format, time() + self::set_timezone() );
}
}

Expand Down
4 changes: 2 additions & 2 deletions inc/Core/CoreHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/
namespace STATS4WP\Core;

Expand All @@ -15,7 +15,7 @@ class CoreHelper {
public static function is_login_page() {

// Check From global WordPress
if ( isset( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ) {
if ( isset( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ), false ) ) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions inc/Core/DB.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/
namespace STATS4WP\Core;

Expand Down Expand Up @@ -121,7 +121,7 @@ public static function table( $export = 'all', $except = array() ) {
public static function exist_row( $tbl ) {
global $wpdb;

if ( ! in_array( $tbl, self::$db_table ) ) {
if ( ! in_array( $tbl, self::$db_table, false ) ) {
return false;
}
if ( in_array( $tbl, self::$db_table_exist, true ) ) {
Expand Down
15 changes: 15 additions & 0 deletions inc/Core/Fonctions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.9
*/

/**
* @param $string
*
* @return string
*/
function filter_string_polyfill( string $string ): string {
$str = preg_replace( '/\x00|<[^>]*>?/', '', $string );
return str_replace( array( "'", '"' ), array( '&#39;', '&#34;' ), $str );
}
4 changes: 3 additions & 1 deletion inc/Init.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/

namespace STATS4WP;

use STATS4WP\Core\Options;
use STATS4WP\Core\Install;

require STATS4WP_PATH . 'inc/Core/Fonctions.php';

final class Init {

/**
Expand Down
21 changes: 14 additions & 7 deletions inc/Stats/Page.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.7
* @version 1.4.9
*/
namespace STATS4WP\Stats;

Expand All @@ -10,6 +10,7 @@
use STATS4WP\Core\CoreHelper;
use STATS4WP\Core\DB;
use STATS4WP\Core\Options;
use STATS4WP\Core\Fonctions;

class Page {

Expand Down Expand Up @@ -115,7 +116,7 @@ public static function get_page_type() {
/**
* Is search page
*/
$search_query = filter_var( get_search_query( false ), FILTER_SANITIZE_STRING );
$search_query = filter_var( get_search_query( false ), FILTER_CALLBACK, array( 'options' => 'filter_string_polyfill' ) );
if ( trim( $search_query ) !== '' ) {
return array(
'type' => 'search',
Expand Down Expand Up @@ -197,14 +198,20 @@ public static function get_page_uri() {
/**
* Get the site's path from the URL.
*/
$site_uri = wp_parse_url( site_url(), PHP_URL_PATH );
$site_uri_len = strlen( $site_uri );
$site_uri = wp_parse_url( site_url(), PHP_URL_PATH );
if ( isset( $site_uri ) ) {
$site_uri_len = strlen( $site_uri );
} else {
$site_uri_len = 0;}

/**
* Get the site's path from the URL.
*/
$home_uri = wp_parse_url( home_url(), PHP_URL_PATH );
$home_uri_len = strlen( $home_uri );
$home_uri = wp_parse_url( home_url(), PHP_URL_PATH );
if ( isset( $home_uri ) ) {
$home_uri_len = strlen( $home_uri );
} else {
$home_uri_len = 0;}

/**
* Get the current page URI.
Expand Down Expand Up @@ -242,7 +249,7 @@ public static function get_page_uri() {
/**
* Sanitize Xss injection
*/
$page_uri = filter_var( $page_uri, FILTER_SANITIZE_STRING );
$page_uri = filter_var( $page_uri, FILTER_CALLBACK, array( 'options' => 'filter_string_polyfill' ) );

/**
* If we're at the root (aka the URI is blank), let's make sure to indicate it.
Expand Down
10 changes: 7 additions & 3 deletions inc/Ui/CSVExport.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.6
* @version 1.4.9
*/

namespace STATS4WP\Ui;
Expand All @@ -20,6 +20,10 @@ class CSVExport extends BaseController {

public $subpages = array();

public $settings;

public $separator;

public function register() {
$this->settings = new SettingsApi();

Expand Down Expand Up @@ -70,9 +74,9 @@ public function generate_csv( $table ) {
global $wpdb;

switch ( $table ) {
case 'visitor';
case 'visitor':
$field = 'last_counter';
break;
break;
case 'pages':
$field = 'date';
break;
Expand Down
4 changes: 2 additions & 2 deletions inc/Ui/DashBoard.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/

namespace STATS4WP\Ui;
Expand Down Expand Up @@ -91,7 +91,7 @@ public function set_fields() {
$defaults = $this->get_customizer_configuration_defaults();
$all_defaults = $this->load_php_config( STATS4WP_PATH . 'assets/defaults.php' );
foreach ( $this->managers as $key => $value ) {
if ( ! in_array( $key, array( 'version', 't', 'install' ) ) ) {
if ( ! in_array( $key, array( 'version', 't', 'install' ), false ) ) {
$config = wp_parse_args( $all_defaults[ $key ], $defaults );
switch ( $config['type'] ) {
case 'checkboxField':
Expand Down
4 changes: 3 additions & 1 deletion inc/Ui/Pages.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/

namespace STATS4WP\Ui;
Expand All @@ -19,6 +19,8 @@ class Pages extends BaseController {

public $subpages = array();

public $settings;

public function register() {
$this->settings = new SettingsApi();

Expand Down
4 changes: 3 additions & 1 deletion inc/Ui/Settings.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/

namespace STATS4WP\Ui;
Expand All @@ -19,6 +19,8 @@ class Settings extends BaseController {

public $subpages = array();

public $settings;

public function register() {
$this->settings = new SettingsApi();

Expand Down
8 changes: 7 additions & 1 deletion inc/Ui/Visitors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package STATS4WPPlugin
* @version 1.4.5
* @version 1.4.9
*/

namespace STATS4WP\Ui;
Expand All @@ -19,6 +19,12 @@ class Visitors extends BaseController {

public $subpages = array();

public $settings;

public function __set( string $settings, mixed $value ): void {
$this->{$settings} = $value;
}

public function register() {
$this->settings = new SettingsApi();

Expand Down
Loading

0 comments on commit 252b044

Please sign in to comment.