Skip to content

Commit

Permalink
stats4wp: v1.4.0
Browse files Browse the repository at this point in the history
* Compatible Wordpress 6.2,
* Delete cdn charjs Option,
* Sanitized Data, Escaped, and Validated (used sanitize_text_field),
* Variables and options must be escaped,
* Update ChartJS 4.2.0 to 4.2.1,
* Update GeoIP Database 20230321.
  • Loading branch information
thanatos-vf-2000 committed Mar 22, 2023
1 parent 4b0d043 commit 9e13ac3
Show file tree
Hide file tree
Showing 102 changed files with 2,198 additions and 2,072 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
Contributors: vanhoucke
Tags: analytics, wordpress analytics, stats, statistics, visit, visitors, hits, chart, browser, today, yesterday, week, month, year, total, post, page, sidebar, google, live visit, search word, agent, google analytics, webmasters, google webmasters, geoip, location
Requires at least: 5.7
Tested up to: 6.1.1
Tested up to: 6.2
Requires PHP: 7.4
Stable tag: 1.3.9
Stable tag: 1.4.0
License: GPLv2

This plugin gives you the complete information on your website's visitors.
Expand Down Expand Up @@ -96,17 +96,15 @@ GeoChart
Source: https://developers.google.com/chart/interactive/docs/gallery/geochart


### 1.3.9 (2302-SFP2)
*Release Date - 08 Febrary 2023*
### 1.4.0 (2300-SFP1)
*Release Date - 22 March 2023*

* Bug 1.3.8,
* Update ChartJS 3.9.1 to 4.2.0,
* Add option CDN for ChartJS,
* Update GeoIP Database 20230203,
* Add device type gaming and television,
* Add agent type opera and Samsung Internet,
* request Optimisation,
* Correction php warning.
* Compatible Wordpress 6.2,
* Delete cdn charjs Option,
* Sanitized Data, Escaped, and Validated (used sanitize_text_field),
* Variables and options must be escaped,
* Update ChartJS 4.2.0 to 4.2.1,
* Update GeoIP Database 20230321.

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

Expand Down
65 changes: 33 additions & 32 deletions assets/defaults.php
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
<?php
/**
* default variables in menu
*
* @category assets
* @package STATS4WPPlugin
* @Version 1.3.8
* @link https://ginkgos.net/
* @author VANHOUCKE Franck <[email protected]>
* @license GPLv2 or later
* @version 1.4.0
*/

return array(
'anonymize_ips' => array(
'title' => __('Anonymize IP.','stats4wp'),
'title' => __('Anonymize IP.', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField') ,
'type' => 'checkboxField'),
'ip_method' => array(
'title' => __('IP methode','stats4wp'),
'message' => __('chose $_SERVER.', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'listField' ,
'choices' => array(
'REMOTE_ADDR' => __('REMOTE_ADDR','stats4wp'),
'HTTP_CLIENT_IP' => __('HTTP_CLIENT_IP','stats4wp'),
'HTTP_X_FORWARDED_FOR' => __('HTTP_X_FORWARDED_FOR','stats4wp'),
'HTTP_X_FORWARDED' => __('HTTP_X_FORWARDED','stats4wp'),
'HTTP_FORWARDED_FOR' => __('HTTP_FORWARDED_FOR','stats4wp'),
'HTTP_FORWARDED' => __('HTTP_FORWARDED','stats4wp'),
'HTTP_X_REAL_IP' => __('HTTP_X_REAL_IP','stats4wp'),
'HTTP_X_CLUSTER_CLIENT_IP' => __('HTTP_X_CLUSTER_CLIENT_IP','stats4wp')
'title' => __('IP methode', 'stats4wp'),
'message' => __('chose _SERVER.', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'listField',
'choices' => array(
'REMOTE_ADDR' => __('REMOTE_ADDR', 'stats4wp'),
'HTTP_CLIENT_IP' => __('HTTP_CLIENT_IP', 'stats4wp'),
'HTTP_X_FORWARDED_FOR' => __('HTTP_X_FORWARDED_FOR', 'stats4wp'),
'HTTP_X_FORWARDED' => __('HTTP_X_FORWARDED', 'stats4wp'),
'HTTP_FORWARDED_FOR' => __('HTTP_FORWARDED_FOR', 'stats4wp'),
'HTTP_FORWARDED' => __('HTTP_FORWARDED', 'stats4wp'),
'HTTP_X_REAL_IP' => __('HTTP_X_REAL_IP', 'stats4wp'),
'HTTP_X_CLUSTER_CLIENT_IP' => __('HTTP_X_CLUSTER_CLIENT_IP', 'stats4wp')
)
),
'addsearchwords' => array(
'title' => __('Add search words','stats4wp'),
'title' => __('Add search words', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField') ,
'type' => 'checkboxField'),
'store_ua' => array(
'title' => __('Store User Agent.','stats4wp'),
'title' => __('Store User Agent.', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField'),
'check_online' => array(
'title' => __('Max time user Online check','stats4wp'),
'title' => __('Max time user Online check', 'stats4wp'),
'message' => __('Delete user in table useronile after xxx seconds (default 120).', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'TextField'),
'top_page' => array(
'title' => __('Number of result in top pages','stats4wp'),
'title' => __('Number of result in top pages', 'stats4wp'),
'message' => __('(default 10).', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'TextField'),
'disableadminstat' => array(
'title' => __('Disabled statistics for the administration part (/wp-admin/).','stats4wp'),
'title' => __('Disabled statistics for the administration part (/wp-admin/).', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField'),
'geochart' => array(
'title' => __('Enable Google GeoChart','stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField',
'message' => __('Locations are geocoded by Google Maps. Any data that does not require geocoding is not sent to any server. Please see the Google Maps Terms of Service for more information on their data policy.','stats4wp'),
'link' => 'https://developers.google.com/maps/terms'),
'cdn_chartjs' => array(
'title' => __('Enable CDN Chart JS','stats4wp'),
'title' => __('Enable Google GeoChart', 'stats4wp'),
'section' => STATS4WP_NAME.'_admin_index',
'type' => 'checkboxField',
'message' => __('Use CDN for Chart.js: https://cdnjs.cloudflare.com/ajax/libs/Chart.js/<version>/chart.min.js.','stats4wp'),
'link' => 'https://cdnjs.com/libraries/Chart.js')
);
'message' => __('Locations are geocoded by Google Maps. Any data that does not require geocoding is not sent to any server. Please see the Google Maps Terms of Service for more information on their data policy.', 'stats4wp'),
'link' => 'https://developers.google.com/maps/terms')
);
132 changes: 69 additions & 63 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,84 +1,90 @@
/**
* Template Name: ct4gg - Admin
*/
(function() {
* Template Name: ct4gg - Admin
*/
(function () {
"use strict";

/**
* Easy selector helper function
*/
const select = (el, all = false) => {
el = el.trim()
if (all) {
return [...document.querySelectorAll(el)]
} else {
return document.querySelector(el)
}
}

/**
* Easy event listener function
*/
const on = (type, el, listener, all = false) => {
let selectEl = select(el, all)
if (selectEl) {
/**
* Easy selector helper function
*/
const select = (el, all = false) => {
el = el.trim()
if (all) {
selectEl.forEach(e => e.addEventListener(type, listener))
return [...document.querySelectorAll(el)]
} else {
selectEl.addEventListener(type, listener)
return document.querySelector(el)
}
}
}

/**
* Admin Tab
*/
on('click', 'ul.stats4wp-nav-tabs > li', function(e) {
e.preventDefault(),
document.querySelector("ul.stats4wp-nav-tabs li.active").classList.remove("active"),
document.querySelector(".stats4wp-tab-pane.active").classList.remove("active");
var t=e.currentTarget,
n=e.target.getAttribute("href");
t.classList.add("active"),
document.querySelector(n).classList.add("active");
}, true)

/**
* Flag Interval
*/
on('click', '#stats4wp-interval-flag', function(e) {
var flag = document.querySelector('#stats4wp-interval-flag');
var interval = document.querySelector('#stats4wp-interval');
var from = document.querySelector('#stats4wp-from');
if(flag.checked) {
from.setAttribute("disabled", "disabled");
interval.removeAttribute("disabled");
} else {
from.removeAttribute("disabled");
interval.setAttribute("disabled", "disabled");
/**
* Easy event listener function
*/
const on = (type, el, listener, all = false) => {
let selectEl = select(el, all)
if (selectEl) {
if (all) {
selectEl.forEach(e => e.addEventListener(type, listener))
} else {
selectEl.addEventListener(type, listener)
}
}
}

}, true)
/**
* Admin Tab
*/
on(
'click', 'ul.stats4wp-nav-tabs > li', function(e) {
e.preventDefault(),
document.querySelector("ul.stats4wp-nav-tabs li.active").classList.remove("active"),
document.querySelector(".stats4wp-tab-pane.active").classList.remove("active");
var t=e.currentTarget,
n=e.target.getAttribute("href");
t.classList.add("active"),
document.querySelector(n).classList.add("active");
}, true
)

/**
* Flag Interval
*/
on(
'click', '#stats4wp-interval-flag', function(e) {
var flag = document.querySelector('#stats4wp-interval-flag');
var interval = document.querySelector('#stats4wp-interval');
var from = document.querySelector('#stats4wp-from');
if(flag.checked) {
from.setAttribute("disabled", "disabled");
interval.removeAttribute("disabled");
} else {
from.removeAttribute("disabled");
interval.setAttribute("disabled", "disabled");
}

}, true
)


})();
var acc = document.getElementsByClassName("stats4wp-accordion");
var i;

for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("stats4wp-active");
acc[i].addEventListener(
"click", function() {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("stats4wp-active");

/* Toggle between hiding and showing the active panel */
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
});
/* Toggle between hiding and showing the active panel */
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
}
);
}

jQuery(document).ready(function () {
Expand Down
20 changes: 12 additions & 8 deletions assets/js/chart.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/js/chart.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/chart.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9e13ac3

Please sign in to comment.