Version Description
Please consider that after updating, you will probably see some changes in Hits. The reason is that we have better-recognized crawlers and robots to get more accurate statistics for you.
If the cache option is enabled in your WordPress, you should make sure the below endpoint registered in your WordPress. http://yourwebsite.com/wp-json/wpstatistics/v1
To register, go to the Permalink page and update the permalink with press Save Changes.
=
Download this release
Release Info
Developer | mostafa.s1990 |
Plugin | WP Statistics |
Version | 12.5.3 |
Comparing to | |
See all releases |
Code changes from version 12.5.2 to 12.5.3
- assets/css/log.css +4 -0
- includes/classes/class-wp-statistics-admin-pages.php +11 -7
- includes/classes/class-wp-statistics-admin.php +5 -5
- includes/classes/class-wp-statistics-dashboard.php +1 -1
- includes/classes/class-wp-statistics-editor.php +21 -2
- includes/classes/class-wp-statistics-frontend.php +6 -12
- includes/classes/class-wp-statistics-install.php +1 -0
- includes/classes/class-wp-statistics-network-admin.php +1 -1
- includes/classes/class-wp-statistics-rest.php +9 -11
- includes/classes/class-wp-statistics-schedule.php +6 -4
- includes/classes/class-wp-statistics-tinymce.php +3 -2
- includes/classes/class-wp-statistics-updates.php +0 -5
- includes/classes/class-wp-statistics.php +20 -23
- includes/functions/export.php +1 -1
- includes/functions/functions.php +135 -117
- includes/github/elidickinson/php-export-data/php-export-data.class.php +43 -43
- includes/log/authors.php +3 -9
- includes/log/searched-phrases.php +2 -2
- includes/log/widgets/recent.php +2 -0
- includes/log/widgets/top.visitors.php +2 -0
- includes/log/widgets/words.php +2 -0
- includes/optimization/tabs/wps-optimization-export.php +1 -1
- includes/settings/tabs/wps-general.php +21 -3
- includes/templates/welcome.php +1 -1
- readme.txt +17 -5
- wp-statistics.php +1 -1
assets/css/log.css
CHANGED
@@ -375,3 +375,7 @@
|
|
375 |
.button-link.wps-refresh {
|
376 |
text-decoration: none !important;
|
377 |
}
|
|
|
|
|
|
|
|
375 |
.button-link.wps-refresh {
|
376 |
text-decoration: none !important;
|
377 |
}
|
378 |
+
|
379 |
+
.wp-statistics-table {
|
380 |
+
overflow-x: auto;
|
381 |
+
}
|
includes/classes/class-wp-statistics-admin-pages.php
CHANGED
@@ -50,7 +50,7 @@ class WP_Statistics_Admin_Pages {
|
|
50 |
);
|
51 |
add_meta_box(
|
52 |
'wps_searched_phrases_postbox',
|
53 |
-
__( 'Top
|
54 |
'wp_statistics_generate_overview_postbox_contents',
|
55 |
$WP_Statistics->menu_slugs['overview'],
|
56 |
'normal',
|
@@ -145,18 +145,21 @@ class WP_Statistics_Admin_Pages {
|
|
145 |
}
|
146 |
|
147 |
//Set Default Hidden MetaBox
|
148 |
-
|
149 |
}
|
150 |
|
151 |
/*
|
152 |
* Default Hidden Meta Box
|
153 |
*/
|
154 |
-
static public function default_hide_meta_box($hidden)
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
158 |
}
|
159 |
|
|
|
160 |
/**
|
161 |
* Plugins
|
162 |
*/
|
@@ -324,7 +327,8 @@ class WP_Statistics_Admin_Pages {
|
|
324 |
if( !isset($_POST['update_geoip']) and isset($_POST['wps_'.$geo_opt]) ) {
|
325 |
|
326 |
//Check File Not Exist
|
327 |
-
$
|
|
|
328 |
if ( !file_exists($file) ) {
|
329 |
$result = WP_Statistics_Updates::download_geoip($geo_name);
|
330 |
if(isset($result['status']) and $result['status'] === false) {
|
50 |
);
|
51 |
add_meta_box(
|
52 |
'wps_searched_phrases_postbox',
|
53 |
+
__( 'Top Search Words (30 Days)', 'wp-statistics' ),
|
54 |
'wp_statistics_generate_overview_postbox_contents',
|
55 |
$WP_Statistics->menu_slugs['overview'],
|
56 |
'normal',
|
145 |
}
|
146 |
|
147 |
//Set Default Hidden MetaBox
|
148 |
+
add_filter( 'default_hidden_meta_boxes', array( 'WP_Statistics_Admin_Pages', 'default_hide_meta_box' ), 10, 2 );
|
149 |
}
|
150 |
|
151 |
/*
|
152 |
* Default Hidden Meta Box
|
153 |
*/
|
154 |
+
static public function default_hide_meta_box($hidden, $screen)
|
155 |
+
{
|
156 |
+
if($screen->id =="toplevel_page_wps_overview_page") {
|
157 |
+
$hidden[] = 'wps_searched_phrases_postbox';
|
158 |
+
}
|
159 |
+
return $hidden;
|
160 |
}
|
161 |
|
162 |
+
|
163 |
/**
|
164 |
* Plugins
|
165 |
*/
|
327 |
if( !isset($_POST['update_geoip']) and isset($_POST['wps_'.$geo_opt]) ) {
|
328 |
|
329 |
//Check File Not Exist
|
330 |
+
$upload_dir = wp_upload_dir();
|
331 |
+
$file = $upload_dir['basedir'] . '/wp-statistics/'.WP_Statistics_Updates::$geoip[$geo_name]['file'].'.mmdb';
|
332 |
if ( !file_exists($file) ) {
|
333 |
$result = WP_Statistics_Updates::download_geoip($geo_name);
|
334 |
if(isset($result['status']) and $result['status'] === false) {
|
includes/classes/class-wp-statistics-admin.php
CHANGED
@@ -77,7 +77,7 @@ class WP_Statistics_Admin {
|
|
77 |
// Load TinyMce Function
|
78 |
new WP_Statistics_TinyMCE();
|
79 |
|
80 |
-
//Add Notice Use cache plugin
|
81 |
add_action( 'admin_notices', array( $this, 'notification_use_cache_plugin' ) );
|
82 |
|
83 |
//Admin Notice Setting
|
@@ -288,7 +288,7 @@ class WP_Statistics_Admin {
|
|
288 |
if ( false === ( $check_rest_api = get_transient( '_check_rest_api_wp_statistics' ) ) ) {
|
289 |
|
290 |
$set_transient = true;
|
291 |
-
$alert = '<div class="notice notice-warning is-dismissible"><p>' . __( '
|
292 |
$request = wp_remote_post( path_join( get_rest_url(), WP_Statistics_Rest::route . '/' . WP_Statistics_Rest::func ), array(
|
293 |
'method' => 'POST',
|
294 |
'body' => array( 'rest-api-wp-statistics' => 'wp-statistics' )
|
@@ -299,7 +299,7 @@ class WP_Statistics_Admin {
|
|
299 |
}
|
300 |
$body = wp_remote_retrieve_body( $request );
|
301 |
$data = json_decode( $body, true );
|
302 |
-
if ( ! isset( $data['rest-api-wp-statistics'] ) ) {
|
303 |
echo $alert;
|
304 |
$set_transient = false;
|
305 |
}
|
@@ -680,7 +680,7 @@ class WP_Statistics_Admin {
|
|
680 |
* @param string $hook Not Used
|
681 |
*/
|
682 |
static function enqueue_scripts( $hook ) {
|
683 |
-
global $pagenow;
|
684 |
|
685 |
// Load our CSS to be used.
|
686 |
wp_enqueue_style(
|
@@ -715,7 +715,7 @@ class WP_Statistics_Admin {
|
|
715 |
}
|
716 |
|
717 |
//Load in Post Page
|
718 |
-
if ( $pagenow == "post.php" ) {
|
719 |
$load_chart = true;
|
720 |
}
|
721 |
|
77 |
// Load TinyMce Function
|
78 |
new WP_Statistics_TinyMCE();
|
79 |
|
80 |
+
// Add Notice Use cache plugin
|
81 |
add_action( 'admin_notices', array( $this, 'notification_use_cache_plugin' ) );
|
82 |
|
83 |
//Admin Notice Setting
|
288 |
if ( false === ( $check_rest_api = get_transient( '_check_rest_api_wp_statistics' ) ) ) {
|
289 |
|
290 |
$set_transient = true;
|
291 |
+
$alert = '<div class="notice notice-warning is-dismissible"><p>' . sprintf( __( 'Here is an error associated with Connecting WordPress Rest API, Please Flushing rewrite rules or activate wp rest api for performance WP-Statistics Plugin Cache / Go %1$sSettings->Permalinks%2$s', 'wp-statistics' ), '<a href="' . esc_url( admin_url( 'options-permalink.php' ) ) . '">', '</a>' ) . '</div>';
|
292 |
$request = wp_remote_post( path_join( get_rest_url(), WP_Statistics_Rest::route . '/' . WP_Statistics_Rest::func ), array(
|
293 |
'method' => 'POST',
|
294 |
'body' => array( 'rest-api-wp-statistics' => 'wp-statistics' )
|
299 |
}
|
300 |
$body = wp_remote_retrieve_body( $request );
|
301 |
$data = json_decode( $body, true );
|
302 |
+
if ( ! isset( $data['rest-api-wp-statistics'] ) and $set_transient === true ) {
|
303 |
echo $alert;
|
304 |
$set_transient = false;
|
305 |
}
|
680 |
* @param string $hook Not Used
|
681 |
*/
|
682 |
static function enqueue_scripts( $hook ) {
|
683 |
+
global $pagenow, $WP_Statistics;
|
684 |
|
685 |
// Load our CSS to be used.
|
686 |
wp_enqueue_style(
|
715 |
}
|
716 |
|
717 |
//Load in Post Page
|
718 |
+
if ( $pagenow == "post.php" and $WP_Statistics->get_option( 'hit_post_metabox' ) ) {
|
719 |
$load_chart = true;
|
720 |
}
|
721 |
|
includes/classes/class-wp-statistics-dashboard.php
CHANGED
@@ -187,7 +187,7 @@ class WP_Statistics_Dashboard {
|
|
187 |
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
188 |
wp_add_dashboard_widget(
|
189 |
'wp-statistics-searched-phrases-widget',
|
190 |
-
__( 'Top
|
191 |
'WP_Statistics_Dashboard::generate_postbox_contents',
|
192 |
$control_callback = null,
|
193 |
array( 'widget' => 'searched.phrases' )
|
187 |
if ( $WP_Statistics->get_option( 'visitors' ) ) {
|
188 |
wp_add_dashboard_widget(
|
189 |
'wp-statistics-searched-phrases-widget',
|
190 |
+
__( 'Top Search Words (30 Days)', 'wp-statistics' ),
|
191 |
'WP_Statistics_Dashboard::generate_postbox_contents',
|
192 |
$control_callback = null,
|
193 |
array( 'widget' => 'searched.phrases' )
|
includes/classes/class-wp-statistics-editor.php
CHANGED
@@ -54,7 +54,12 @@ class WP_Statistics_Editor {
|
|
54 |
return;
|
55 |
}
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
foreach ( $screens as $screen ) {
|
60 |
|
@@ -100,7 +105,8 @@ class WP_Statistics_Editor {
|
|
100 |
static function inline_javascript() {
|
101 |
$screen = get_current_screen();
|
102 |
|
103 |
-
|
|
|
104 |
return;
|
105 |
}
|
106 |
|
@@ -182,4 +188,17 @@ class WP_Statistics_Editor {
|
|
182 |
</script>
|
183 |
<?php
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
54 |
return;
|
55 |
}
|
56 |
|
57 |
+
// If the admin has disabled the Hit Post MetaBox.
|
58 |
+
if ( ! $WP_Statistics->get_option( 'hit_post_metabox' ) ) {
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
$screens = self::get_list_post_type();
|
63 |
|
64 |
foreach ( $screens as $screen ) {
|
65 |
|
105 |
static function inline_javascript() {
|
106 |
$screen = get_current_screen();
|
107 |
|
108 |
+
$screens = self::get_list_post_type();
|
109 |
+
if ( ! in_array( $screen->id, $screens ) ) {
|
110 |
return;
|
111 |
}
|
112 |
|
188 |
</script>
|
189 |
<?php
|
190 |
}
|
191 |
+
|
192 |
+
public static function get_list_post_type() {
|
193 |
+
$post_types = array( 'post', 'page' );
|
194 |
+
$get_post_types = get_post_types( array(
|
195 |
+
'public' => true,
|
196 |
+
'_builtin' => false
|
197 |
+
), 'names', 'and' );
|
198 |
+
foreach ( $get_post_types as $name ) {
|
199 |
+
$post_types[] = $name;
|
200 |
+
}
|
201 |
+
|
202 |
+
return $post_types;
|
203 |
+
}
|
204 |
}
|
includes/classes/class-wp-statistics-frontend.php
CHANGED
@@ -23,7 +23,7 @@ class WP_Statistics_Frontend {
|
|
23 |
add_action( 'wp', 'WP_Statistics_Frontend::init' );
|
24 |
|
25 |
//Add inline Rest Request
|
26 |
-
add_action( '
|
27 |
|
28 |
//Add Html Comment in head
|
29 |
if ( $WP_Statistics->use_cache ) {
|
@@ -57,14 +57,10 @@ class WP_Statistics_Frontend {
|
|
57 |
* @param string $hook Not Used
|
58 |
*/
|
59 |
static function enqueue_scripts( $hook ) {
|
60 |
-
global $WP_Statistics;
|
61 |
|
62 |
// Load our CSS to be used.
|
63 |
-
|
64 |
-
|
65 |
-
if ( $WP_Statistics->use_cache ) {
|
66 |
-
//Load Jquery
|
67 |
-
wp_enqueue_script( 'jquery' );
|
68 |
}
|
69 |
}
|
70 |
|
@@ -76,7 +72,7 @@ class WP_Statistics_Frontend {
|
|
76 |
|
77 |
if ( $WP_Statistics->use_cache ) {
|
78 |
self::html_comment();
|
79 |
-
echo '<script>
|
80 |
}
|
81 |
}
|
82 |
|
@@ -149,10 +145,8 @@ class WP_Statistics_Frontend {
|
|
149 |
$params[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
|
150 |
}
|
151 |
|
152 |
-
$array = array();
|
153 |
-
$array[ WP_Statistics_Rest::_POST ] = $params;
|
154 |
|
155 |
-
return
|
156 |
}
|
157 |
|
158 |
|
@@ -169,7 +163,7 @@ class WP_Statistics_Frontend {
|
|
169 |
}
|
170 |
|
171 |
//Disable if User Active cache Plugin
|
172 |
-
if ( $WP_Statistics->use_cache
|
173 |
|
174 |
$h = new WP_Statistics_GEO_IP_Hits;
|
175 |
|
23 |
add_action( 'wp', 'WP_Statistics_Frontend::init' );
|
24 |
|
25 |
//Add inline Rest Request
|
26 |
+
add_action( 'wp_head', 'WP_Statistics_Frontend::add_inline_rest_js' );
|
27 |
|
28 |
//Add Html Comment in head
|
29 |
if ( $WP_Statistics->use_cache ) {
|
57 |
* @param string $hook Not Used
|
58 |
*/
|
59 |
static function enqueue_scripts( $hook ) {
|
|
|
60 |
|
61 |
// Load our CSS to be used.
|
62 |
+
if ( is_admin_bar_showing() ) {
|
63 |
+
wp_enqueue_style( 'wpstatistics-css', WP_Statistics::$reg['plugin-url'] . 'assets/css/frontend.css', true, WP_Statistics::$reg['version'] );
|
|
|
|
|
|
|
64 |
}
|
65 |
}
|
66 |
|
72 |
|
73 |
if ( $WP_Statistics->use_cache ) {
|
74 |
self::html_comment();
|
75 |
+
echo '<script>var WP_Statistics_http = new XMLHttpRequest();WP_Statistics_http.open(\'POST\', \'' . add_query_arg( array( '_' => time() ), path_join( get_rest_url(), WP_Statistics_Rest::route . '/' . WP_Statistics_Rest::func ) ) . '\', true);WP_Statistics_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");WP_Statistics_http.send("'.WP_Statistics_Rest::_POST.'=" + JSON.stringify('.self::set_default_params().'));</script>' . "\n";
|
76 |
}
|
77 |
}
|
78 |
|
145 |
$params[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
|
146 |
}
|
147 |
|
|
|
|
|
148 |
|
149 |
+
return json_encode($params, JSON_UNESCAPED_SLASHES);
|
150 |
}
|
151 |
|
152 |
|
163 |
}
|
164 |
|
165 |
//Disable if User Active cache Plugin
|
166 |
+
if ( ! $WP_Statistics->use_cache ) {
|
167 |
|
168 |
$h = new WP_Statistics_GEO_IP_Hits;
|
169 |
|
includes/classes/class-wp-statistics-install.php
CHANGED
@@ -261,6 +261,7 @@ class WP_Statistics_Install {
|
|
261 |
'wps_use_cache_plugin',
|
262 |
'wps_geoip_city',
|
263 |
'wps_disable_column',
|
|
|
264 |
'wps_menu_bar',
|
265 |
'wps_hide_notices',
|
266 |
'wps_chart_totals',
|
261 |
'wps_use_cache_plugin',
|
262 |
'wps_geoip_city',
|
263 |
'wps_disable_column',
|
264 |
+
'wps_hit_post_metabox',
|
265 |
'wps_menu_bar',
|
266 |
'wps_hide_notices',
|
267 |
'wps_chart_totals',
|
includes/classes/class-wp-statistics-network-admin.php
CHANGED
@@ -87,7 +87,7 @@ class WP_Statistics_Network_Admin {
|
|
87 |
__( 'Online', 'wp-statistics' ) => WP_Statistics::$page['online'],
|
88 |
__( 'Referrers', 'wp-statistics' ) => WP_Statistics::$page['referrers'],
|
89 |
__( 'Search Words', 'wp-statistics' ) => WP_Statistics::$page['words'],
|
90 |
-
__( '
|
91 |
__( 'Searches', 'wp-statistics' ) => WP_Statistics::$page['searches'],
|
92 |
__( 'Pages', 'wp-statistics' ) => WP_Statistics::$page['pages'],
|
93 |
__( 'Visitors', 'wp-statistics' ) => WP_Statistics::$page['visitors'],
|
87 |
__( 'Online', 'wp-statistics' ) => WP_Statistics::$page['online'],
|
88 |
__( 'Referrers', 'wp-statistics' ) => WP_Statistics::$page['referrers'],
|
89 |
__( 'Search Words', 'wp-statistics' ) => WP_Statistics::$page['words'],
|
90 |
+
__( 'Top Search Words', 'wp-statistics' ) => WP_Statistics::$page['searched-phrases'],
|
91 |
__( 'Searches', 'wp-statistics' ) => WP_Statistics::$page['searches'],
|
92 |
__( 'Pages', 'wp-statistics' ) => WP_Statistics::$page['pages'],
|
93 |
__( 'Visitors', 'wp-statistics' ) => WP_Statistics::$page['visitors'],
|
includes/classes/class-wp-statistics-rest.php
CHANGED
@@ -23,7 +23,7 @@ class WP_Statistics_Rest {
|
|
23 |
/*
|
24 |
* add Router Rest Api
|
25 |
*/
|
26 |
-
if ( $WP_Statistics->use_cache ) {
|
27 |
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
|
28 |
}
|
29 |
}
|
@@ -53,13 +53,9 @@ class WP_Statistics_Rest {
|
|
53 |
return array( "rest-api-wp-statistics" => "OK" );
|
54 |
}
|
55 |
|
56 |
-
/*
|
57 |
-
* Check Security Referer Only This Domain Access
|
58 |
-
*/
|
59 |
-
$header = $WP_Statistics::getAllHeader();
|
60 |
|
61 |
//Check Auth Key Request
|
62 |
-
if ( ! isset( $
|
63 |
return new WP_Error( 'error', 'You have no right to access', array( 'status' => 403 ) );
|
64 |
}
|
65 |
|
@@ -98,9 +94,8 @@ class WP_Statistics_Rest {
|
|
98 |
static public function is_rest() {
|
99 |
global $WP_Statistics;
|
100 |
|
101 |
-
if ( $WP_Statistics->use_cache
|
102 |
-
|
103 |
-
if ( isset( $header['X-Ajax-Wp-Statistics'] ) and isset( $_POST[ self::_POST ] ) ) {
|
104 |
return true;
|
105 |
}
|
106 |
}
|
@@ -112,8 +107,11 @@ class WP_Statistics_Rest {
|
|
112 |
* Get Params Request
|
113 |
*/
|
114 |
static public function params( $params ) {
|
115 |
-
if ( isset( $_POST[ self::_POST ]
|
116 |
-
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
return false;
|
23 |
/*
|
24 |
* add Router Rest Api
|
25 |
*/
|
26 |
+
if ( isset( $WP_Statistics ) and $WP_Statistics->use_cache ) {
|
27 |
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
|
28 |
}
|
29 |
}
|
53 |
return array( "rest-api-wp-statistics" => "OK" );
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
56 |
|
57 |
//Check Auth Key Request
|
58 |
+
if ( ! isset( $_POST[ self::_POST ] ) ) {
|
59 |
return new WP_Error( 'error', 'You have no right to access', array( 'status' => 403 ) );
|
60 |
}
|
61 |
|
94 |
static public function is_rest() {
|
95 |
global $WP_Statistics;
|
96 |
|
97 |
+
if ( isset( $WP_Statistics ) and $WP_Statistics->use_cache ) {
|
98 |
+
if ( isset( $_POST[ self::_POST ] ) ) {
|
|
|
99 |
return true;
|
100 |
}
|
101 |
}
|
107 |
* Get Params Request
|
108 |
*/
|
109 |
static public function params( $params ) {
|
110 |
+
if ( isset( $_POST[ self::_POST ] ) ) {
|
111 |
+
$data = json_decode( stripslashes( $_POST[ self::_POST ] ), true );
|
112 |
+
if ( isset( $data[ $params ] ) ) {
|
113 |
+
return $data[ $params ];
|
114 |
+
}
|
115 |
}
|
116 |
|
117 |
return false;
|
includes/classes/class-wp-statistics-schedule.php
CHANGED
@@ -183,10 +183,12 @@ class WP_Statistics_Schedule {
|
|
183 |
// We're also going to look to see if our filesize is to small, this means the plugin stub still exists and should
|
184 |
// be replaced with a proper file.
|
185 |
$is_require_update = false;
|
186 |
-
foreach (WP_Statistics_Updates::$geoip as $geoip_name => $geoip_array) {
|
187 |
-
$
|
188 |
-
if (
|
189 |
-
$
|
|
|
|
|
190 |
}
|
191 |
}
|
192 |
|
183 |
// We're also going to look to see if our filesize is to small, this means the plugin stub still exists and should
|
184 |
// be replaced with a proper file.
|
185 |
$is_require_update = false;
|
186 |
+
foreach ( WP_Statistics_Updates::$geoip as $geoip_name => $geoip_array ) {
|
187 |
+
$file_path = $upload_dir['basedir'] . '/wp-statistics/' . WP_Statistics_Updates::$geoip[ $geoip_name ]['file'] . '.mmdb';
|
188 |
+
if ( file_exists( $file_path ) ) {
|
189 |
+
if ( $lastupdate < $thisupdate ) {
|
190 |
+
$is_require_update = true;
|
191 |
+
}
|
192 |
}
|
193 |
}
|
194 |
|
includes/classes/class-wp-statistics-tinymce.php
CHANGED
@@ -137,9 +137,10 @@ class WP_Statistics_TinyMCE {
|
|
137 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
138 |
});
|
139 |
';
|
140 |
-
|
|
|
141 |
echo '
|
142 |
-
tinyMCEPreInit.load_ext("'.rtrim( WP_Statistics::$reg['plugin-url'], "/").'", "'
|
143 |
</script>
|
144 |
';
|
145 |
}
|
137 |
editor.settings.toolbar1 += \',wp_statistic_tc_button\';
|
138 |
});
|
139 |
';
|
140 |
+
$lang = WP_Statistics_TinyMCE::lang();
|
141 |
+
echo $lang['translate'];
|
142 |
echo '
|
143 |
+
tinyMCEPreInit.load_ext("'.rtrim( WP_Statistics::$reg['plugin-url'], "/").'", "'.$lang['locale'].'");
|
144 |
</script>
|
145 |
';
|
146 |
}
|
includes/classes/class-wp-statistics-updates.php
CHANGED
@@ -28,12 +28,7 @@ class WP_Statistics_Updates {
|
|
28 |
* Update option process.
|
29 |
*/
|
30 |
static function do_upgrade() {
|
31 |
-
GLOBAL $WP_Statistics;
|
32 |
|
33 |
-
// Enable the Anonymize IP Addresses option by default
|
34 |
-
if( !$WP_Statistics->isset_option('anonymize_ips') ) {
|
35 |
-
$WP_Statistics->update_option('anonymize_ips');
|
36 |
-
}
|
37 |
}
|
38 |
|
39 |
/**
|
28 |
* Update option process.
|
29 |
*/
|
30 |
static function do_upgrade() {
|
|
|
31 |
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
/**
|
includes/classes/class-wp-statistics.php
CHANGED
@@ -356,7 +356,7 @@ class WP_Statistics {
|
|
356 |
WP_Statistics::$page['referrers'] = 'wps_referrers_page';
|
357 |
//define('WP_STATISTICS_REFERRERS_PAGE', 'wps_referrers_page');
|
358 |
/**
|
359 |
-
* Searched
|
360 |
*/
|
361 |
WP_Statistics::$page['searched-phrases'] = 'wps_searched_phrases_page';
|
362 |
//define('WP_STATISTICS_SEARCHED_PHRASES_PAGE', 'wps_searched_phrases_page');
|
@@ -424,7 +424,14 @@ class WP_Statistics {
|
|
424 |
return $this->restapi->params( 'hash_ip' );
|
425 |
}
|
426 |
|
427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
}
|
429 |
|
430 |
/**
|
@@ -451,7 +458,8 @@ class WP_Statistics {
|
|
451 |
*/
|
452 |
static function geoip_loader( $pack ) {
|
453 |
|
454 |
-
$
|
|
|
455 |
if ( file_exists( $geoip ) ) {
|
456 |
try {
|
457 |
$reader = new GeoIp2\Database\Reader( $geoip );
|
@@ -895,7 +903,7 @@ class WP_Statistics {
|
|
895 |
|
896 |
// If the anonymize IP enabled for GDPR.
|
897 |
if ( $this->get_option( 'anonymize_ips' ) == true ) {
|
898 |
-
$this->ip = substr( $this->ip, 0, strrpos( $this->ip, '.' ) ) . '.
|
899 |
}
|
900 |
|
901 |
return $this->ip;
|
@@ -922,7 +930,6 @@ class WP_Statistics {
|
|
922 |
* @return array|\string[]
|
923 |
*/
|
924 |
public function get_UserAgent() {
|
925 |
-
|
926 |
//Check If Rest Request
|
927 |
if ( $this->restapi->is_rest() ) {
|
928 |
return array(
|
@@ -932,7 +939,14 @@ class WP_Statistics {
|
|
932 |
);
|
933 |
}
|
934 |
|
935 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
$agent = array(
|
937 |
'browser' => ( isset( $result->browser->name ) ) ? $result->browser->name : _x( 'Unknown', 'Browser', 'wp-statistics' ),
|
938 |
'platform' => ( isset( $result->os->name ) ) ? $result->os->name : _x( 'Unknown', 'Platform', 'wp-statistics' ),
|
@@ -1437,23 +1451,6 @@ class WP_Statistics {
|
|
1437 |
return "<a href='{$html_nr_referrer}' title='{$html_nr_referrer}'>{$base_url['host']}</a>";
|
1438 |
}
|
1439 |
|
1440 |
-
/*
|
1441 |
-
* Get All Headers
|
1442 |
-
*/
|
1443 |
-
public static function getAllHeader() {
|
1444 |
-
if ( ! function_exists( 'getallheaders' ) ) {
|
1445 |
-
$headers = [];
|
1446 |
-
foreach ( $_SERVER as $name => $value ) {
|
1447 |
-
if ( substr( $name, 0, 5 ) == 'HTTP_' ) {
|
1448 |
-
$headers[ str_replace( ' ', '-', ucwords( strtolower( str_replace( '_', ' ', substr( $name, 5 ) ) ) ) ) ] = $value;
|
1449 |
-
}
|
1450 |
-
}
|
1451 |
-
} else {
|
1452 |
-
$headers = getallheaders();
|
1453 |
-
}
|
1454 |
-
|
1455 |
-
return $headers;
|
1456 |
-
}
|
1457 |
|
1458 |
/**
|
1459 |
* Unsupported Version Admin Notice
|
356 |
WP_Statistics::$page['referrers'] = 'wps_referrers_page';
|
357 |
//define('WP_STATISTICS_REFERRERS_PAGE', 'wps_referrers_page');
|
358 |
/**
|
359 |
+
* Searched Words Page
|
360 |
*/
|
361 |
WP_Statistics::$page['searched-phrases'] = 'wps_searched_phrases_page';
|
362 |
//define('WP_STATISTICS_SEARCHED_PHRASES_PAGE', 'wps_searched_phrases_page');
|
424 |
return $this->restapi->params( 'hash_ip' );
|
425 |
}
|
426 |
|
427 |
+
//Set Key
|
428 |
+
if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) ) {
|
429 |
+
$key = $_SERVER['HTTP_USER_AGENT'];
|
430 |
+
} else {
|
431 |
+
$key = wp_salt();
|
432 |
+
}
|
433 |
+
|
434 |
+
return '#hash#' . sha1( $this->ip . $key );
|
435 |
}
|
436 |
|
437 |
/**
|
458 |
*/
|
459 |
static function geoip_loader( $pack ) {
|
460 |
|
461 |
+
$upload_dir = wp_upload_dir();
|
462 |
+
$geoip = $upload_dir['basedir'] . '/wp-statistics/' . WP_Statistics_Updates::$geoip[ $pack ]['file'] . '.mmdb';
|
463 |
if ( file_exists( $geoip ) ) {
|
464 |
try {
|
465 |
$reader = new GeoIp2\Database\Reader( $geoip );
|
903 |
|
904 |
// If the anonymize IP enabled for GDPR.
|
905 |
if ( $this->get_option( 'anonymize_ips' ) == true ) {
|
906 |
+
$this->ip = substr( $this->ip, 0, strrpos( $this->ip, '.' ) ) . '.0';
|
907 |
}
|
908 |
|
909 |
return $this->ip;
|
930 |
* @return array|\string[]
|
931 |
*/
|
932 |
public function get_UserAgent() {
|
|
|
933 |
//Check If Rest Request
|
934 |
if ( $this->restapi->is_rest() ) {
|
935 |
return array(
|
939 |
);
|
940 |
}
|
941 |
|
942 |
+
// Check function exist.
|
943 |
+
if ( function_exists( 'getallheaders' ) ) {
|
944 |
+
$user_agent = getallheaders();
|
945 |
+
} else {
|
946 |
+
$user_agent = $_SERVER['HTTP_USER_AGENT'];
|
947 |
+
}
|
948 |
+
|
949 |
+
$result = new WhichBrowser\Parser( $user_agent );
|
950 |
$agent = array(
|
951 |
'browser' => ( isset( $result->browser->name ) ) ? $result->browser->name : _x( 'Unknown', 'Browser', 'wp-statistics' ),
|
952 |
'platform' => ( isset( $result->os->name ) ) ? $result->os->name : _x( 'Unknown', 'Platform', 'wp-statistics' ),
|
1451 |
return "<a href='{$html_nr_referrer}' title='{$html_nr_referrer}'>{$base_url['host']}</a>";
|
1452 |
}
|
1453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1454 |
|
1455 |
/**
|
1456 |
* Unsupported Version Admin Notice
|
includes/functions/export.php
CHANGED
@@ -100,4 +100,4 @@ function wp_statistics_export_data() {
|
|
100 |
exit;
|
101 |
}
|
102 |
}
|
103 |
-
}
|
100 |
exit;
|
101 |
}
|
102 |
}
|
103 |
+
}
|
includes/functions/functions.php
CHANGED
@@ -400,19 +400,30 @@ function wp_statistics_ua_list( $rangestartdate = null, $rangeenddate = null ) {
|
|
400 |
global $wpdb;
|
401 |
|
402 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
403 |
-
$
|
404 |
-
$wpdb->
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
} else {
|
412 |
$result = $wpdb->get_results( "SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor", ARRAY_N );
|
413 |
}
|
414 |
|
415 |
-
$
|
416 |
|
417 |
foreach ( $result as $out ) {
|
418 |
$Browsers[] = $out[0];
|
@@ -645,15 +656,15 @@ function wp_statistics_searchengine_list( $all = false ) {
|
|
645 |
'querykey' => 'text',
|
646 |
'image' => 'yandex.png',
|
647 |
),
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
);
|
658 |
|
659 |
if ( $all == false ) {
|
@@ -906,39 +917,39 @@ function wp_statistics_searchengine( $search_engine = 'all', $time = 'total' ) {
|
|
906 |
}
|
907 |
|
908 |
//This Function will return the referrer list
|
909 |
-
function wp_statistics_referrer($time = null) {
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
}
|
943 |
|
944 |
// This function will return the statistics for a given search engine for a given time frame.
|
@@ -1263,16 +1274,16 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1263 |
$today = $WP_Statistics->Current_Date( 'm/d/Y' );
|
1264 |
|
1265 |
// Re-create the range start/end strings from our utime's to make sure we get ride of any cruft and have them in the format we want.
|
1266 |
-
$rangestart = $WP_Statistics->Local_Date( get_option("date_format"), $rangestart_utime );
|
1267 |
-
$rangeend = $WP_Statistics->Local_Date( get_option("date_format"), $rangeend_utime );
|
1268 |
|
1269 |
// If the rangeend isn't today OR it is but not one of the standard range values, then it's a custom selected value and we need to flag it as such.
|
1270 |
if ( $rangeend != $today || ( $rangeend == $today && ! in_array( $current, $range ) ) ) {
|
1271 |
$current = - 1;
|
1272 |
} else {
|
1273 |
// If on the other hand we are a standard range, let's reset the custom range selector to match it.
|
1274 |
-
$rangestart = $WP_Statistics->Current_Date( get_option("date_format"), '-' . $current );
|
1275 |
-
$rangeend = $WP_Statistics->Current_Date( get_option("date_format") );
|
1276 |
}
|
1277 |
|
1278 |
echo '<form method="get"><ul class="subsubsub wp-statistics-sub-fullwidth">' . "\r\n";
|
@@ -1324,13 +1335,13 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1324 |
echo '<input type="text" size="10" name="rangestart" id="datestartpicker" value="' .
|
1325 |
$rangestart .
|
1326 |
'" placeholder="' .
|
1327 |
-
__( wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")), 'wp-statistics' ) .
|
1328 |
'"> ' .
|
1329 |
__( 'to', 'wp-statistics' ) .
|
1330 |
' <input type="text" size="10" name="rangeend" id="dateendpicker" value="' .
|
1331 |
$rangeend .
|
1332 |
'" placeholder="' .
|
1333 |
-
__( wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")), 'wp-statistics' ) .
|
1334 |
'"> <input type="submit" value="' .
|
1335 |
__( 'Go', 'wp-statistics' ) .
|
1336 |
'" class="button-primary">' .
|
@@ -1341,72 +1352,75 @@ function wp_statistics_date_range_selector( $page, $current, $range = array(), $
|
|
1341 |
|
1342 |
echo '</form>' . "\r\n";
|
1343 |
|
1344 |
-
echo '<script>jQuery(function() { jQuery( "#datestartpicker" ).datepicker({dateFormat: \''.wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")).'\'}); jQuery( "#dateendpicker" ).datepicker({dateFormat: \''.wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")).'\'}); });</script>' .
|
1345 |
"\r\n";
|
1346 |
}
|
1347 |
|
1348 |
/*
|
1349 |
* Convert php dateformat to Jquery Ui
|
1350 |
*/
|
1351 |
-
function wp_statistics_dateformat_php_to_jqueryui($php_format)
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
|
|
|
|
|
|
1410 |
}
|
1411 |
|
1412 |
// This function is used to calculate the number of days and thier respective unix timestamps.
|
@@ -1532,6 +1546,10 @@ function wp_statistics_admin_notice_result( $type, $message ) {
|
|
1532 |
$class = 'notice notice-error';
|
1533 |
break;
|
1534 |
|
|
|
|
|
|
|
|
|
1535 |
case 'success':
|
1536 |
$class = 'notice notice-success';
|
1537 |
break;
|
400 |
global $wpdb;
|
401 |
|
402 |
if ( $rangestartdate != null && $rangeenddate != null ) {
|
403 |
+
if ( $rangeenddate == 'CURDATE()' ) {
|
404 |
+
$result = $wpdb->get_results(
|
405 |
+
$wpdb->prepare(
|
406 |
+
"SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND CURDATE()",
|
407 |
+
$rangestartdate
|
408 |
+
),
|
409 |
+
ARRAY_N
|
410 |
+
);
|
411 |
+
} else {
|
412 |
+
$result = $wpdb->get_results(
|
413 |
+
$wpdb->prepare(
|
414 |
+
"SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor WHERE `last_counter` BETWEEN %s AND %s",
|
415 |
+
$rangestartdate,
|
416 |
+
$rangeenddate
|
417 |
+
),
|
418 |
+
ARRAY_N
|
419 |
+
);
|
420 |
+
}
|
421 |
+
|
422 |
} else {
|
423 |
$result = $wpdb->get_results( "SELECT DISTINCT agent FROM {$wpdb->prefix}statistics_visitor", ARRAY_N );
|
424 |
}
|
425 |
|
426 |
+
$Browsers = array();
|
427 |
|
428 |
foreach ( $result as $out ) {
|
429 |
$Browsers[] = $out[0];
|
656 |
'querykey' => 'text',
|
657 |
'image' => 'yandex.png',
|
658 |
),
|
659 |
+
'qwant' => array(
|
660 |
+
'name' => 'Qwant',
|
661 |
+
'translated' => __( 'Qwant', 'wp-statistics' ),
|
662 |
+
'tag' => 'qwant',
|
663 |
+
'sqlpattern' => '%qwant.com%',
|
664 |
+
'regexpattern' => 'qwant\.com',
|
665 |
+
'querykey' => 'q',
|
666 |
+
'image' => 'qwant.png',
|
667 |
+
)
|
668 |
);
|
669 |
|
670 |
if ( $all == false ) {
|
917 |
}
|
918 |
|
919 |
//This Function will return the referrer list
|
920 |
+
function wp_statistics_referrer( $time = null ) {
|
921 |
+
global $wpdb, $WP_Statistics;
|
922 |
+
|
923 |
+
$timezone = array(
|
924 |
+
'today' => 0,
|
925 |
+
'yesterday' => - 1,
|
926 |
+
'week' => - 7,
|
927 |
+
'month' => - 30,
|
928 |
+
'year' => - 365,
|
929 |
+
'total' => 'ALL',
|
930 |
+
);
|
931 |
+
$sql = "SELECT `referred` FROM `" . $wpdb->prefix . "statistics_visitor` WHERE referred <> ''";
|
932 |
+
if ( array_key_exists( $time, $timezone ) ) {
|
933 |
+
if ( $time != "total" ) {
|
934 |
+
$sql .= " AND (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', $timezone[$time] )}')";
|
935 |
+
}
|
936 |
+
} else {
|
937 |
+
//Set Default
|
938 |
+
$sql .= " AND (`last_counter` = '{$WP_Statistics->Current_Date( 'Y-m-d', $time )}')";
|
939 |
+
}
|
940 |
+
$result = $wpdb->get_results( $sql );
|
941 |
+
|
942 |
+
$urls = array();
|
943 |
+
foreach ( $result as $item ) {
|
944 |
+
$url = parse_url( $item->referred );
|
945 |
+
if ( empty( $url['host'] ) || stristr( get_bloginfo( 'url' ), $url['host'] ) ) {
|
946 |
+
continue;
|
947 |
+
}
|
948 |
+
$urls[] = $url['scheme'] . '://' . $url['host'];
|
949 |
+
}
|
950 |
+
$get_urls = array_count_values( $urls );
|
951 |
+
|
952 |
+
return count( $get_urls );
|
953 |
}
|
954 |
|
955 |
// This function will return the statistics for a given search engine for a given time frame.
|
1274 |
$today = $WP_Statistics->Current_Date( 'm/d/Y' );
|
1275 |
|
1276 |
// Re-create the range start/end strings from our utime's to make sure we get ride of any cruft and have them in the format we want.
|
1277 |
+
$rangestart = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangestart_utime );
|
1278 |
+
$rangeend = $WP_Statistics->Local_Date( get_option( "date_format" ), $rangeend_utime );
|
1279 |
|
1280 |
// If the rangeend isn't today OR it is but not one of the standard range values, then it's a custom selected value and we need to flag it as such.
|
1281 |
if ( $rangeend != $today || ( $rangeend == $today && ! in_array( $current, $range ) ) ) {
|
1282 |
$current = - 1;
|
1283 |
} else {
|
1284 |
// If on the other hand we are a standard range, let's reset the custom range selector to match it.
|
1285 |
+
$rangestart = $WP_Statistics->Current_Date( get_option( "date_format" ), '-' . $current );
|
1286 |
+
$rangeend = $WP_Statistics->Current_Date( get_option( "date_format" ) );
|
1287 |
}
|
1288 |
|
1289 |
echo '<form method="get"><ul class="subsubsub wp-statistics-sub-fullwidth">' . "\r\n";
|
1335 |
echo '<input type="text" size="10" name="rangestart" id="datestartpicker" value="' .
|
1336 |
$rangestart .
|
1337 |
'" placeholder="' .
|
1338 |
+
__( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) .
|
1339 |
'"> ' .
|
1340 |
__( 'to', 'wp-statistics' ) .
|
1341 |
' <input type="text" size="10" name="rangeend" id="dateendpicker" value="' .
|
1342 |
$rangeend .
|
1343 |
'" placeholder="' .
|
1344 |
+
__( wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ), 'wp-statistics' ) .
|
1345 |
'"> <input type="submit" value="' .
|
1346 |
__( 'Go', 'wp-statistics' ) .
|
1347 |
'" class="button-primary">' .
|
1352 |
|
1353 |
echo '</form>' . "\r\n";
|
1354 |
|
1355 |
+
echo '<script>jQuery(function() { jQuery( "#datestartpicker" ).datepicker({dateFormat: \'' . wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ) . '\'}); jQuery( "#dateendpicker" ).datepicker({dateFormat: \'' . wp_statistics_dateformat_php_to_jqueryui( get_option( "date_format" ) ) . '\'}); });</script>' .
|
1356 |
"\r\n";
|
1357 |
}
|
1358 |
|
1359 |
/*
|
1360 |
* Convert php dateformat to Jquery Ui
|
1361 |
*/
|
1362 |
+
function wp_statistics_dateformat_php_to_jqueryui( $php_format ) {
|
1363 |
+
$SYMBOLS_MATCHING = array(
|
1364 |
+
// Day
|
1365 |
+
'd' => 'dd',
|
1366 |
+
'D' => 'D',
|
1367 |
+
'j' => 'd',
|
1368 |
+
'l' => 'DD',
|
1369 |
+
'N' => '',
|
1370 |
+
'S' => '',
|
1371 |
+
'w' => '',
|
1372 |
+
'z' => 'o',
|
1373 |
+
// Week
|
1374 |
+
'W' => '',
|
1375 |
+
// Month
|
1376 |
+
'F' => 'MM',
|
1377 |
+
'm' => 'mm',
|
1378 |
+
'M' => 'M',
|
1379 |
+
'n' => 'm',
|
1380 |
+
't' => '',
|
1381 |
+
// Year
|
1382 |
+
'L' => '',
|
1383 |
+
'o' => '',
|
1384 |
+
'Y' => 'yy',
|
1385 |
+
'y' => 'y',
|
1386 |
+
// Time
|
1387 |
+
'a' => '',
|
1388 |
+
'A' => '',
|
1389 |
+
'B' => '',
|
1390 |
+
'g' => '',
|
1391 |
+
'G' => '',
|
1392 |
+
'h' => '',
|
1393 |
+
'H' => '',
|
1394 |
+
'i' => '',
|
1395 |
+
's' => '',
|
1396 |
+
'u' => ''
|
1397 |
+
);
|
1398 |
+
$jqueryui_format = "";
|
1399 |
+
$escaping = false;
|
1400 |
+
for ( $i = 0; $i < strlen( $php_format ); $i ++ ) {
|
1401 |
+
$char = $php_format[ $i ];
|
1402 |
+
if ( $char === '\\' ) {
|
1403 |
+
$i ++;
|
1404 |
+
if ( $escaping ) {
|
1405 |
+
$jqueryui_format .= $php_format[ $i ];
|
1406 |
+
} else {
|
1407 |
+
$jqueryui_format .= '\'' . $php_format[ $i ];
|
1408 |
+
}
|
1409 |
+
$escaping = true;
|
1410 |
+
} else {
|
1411 |
+
if ( $escaping ) {
|
1412 |
+
$jqueryui_format .= "'";
|
1413 |
+
$escaping = false;
|
1414 |
+
}
|
1415 |
+
if ( isset( $SYMBOLS_MATCHING[ $char ] ) ) {
|
1416 |
+
$jqueryui_format .= $SYMBOLS_MATCHING[ $char ];
|
1417 |
+
} else {
|
1418 |
+
$jqueryui_format .= $char;
|
1419 |
+
}
|
1420 |
+
}
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
return $jqueryui_format;
|
1424 |
}
|
1425 |
|
1426 |
// This function is used to calculate the number of days and thier respective unix timestamps.
|
1546 |
$class = 'notice notice-error';
|
1547 |
break;
|
1548 |
|
1549 |
+
case 'warning':
|
1550 |
+
$class = 'notice notice-warning';
|
1551 |
+
break;
|
1552 |
+
|
1553 |
case 'success':
|
1554 |
$class = 'notice notice-success';
|
1555 |
break;
|
includes/github/elidickinson/php-export-data/php-export-data.class.php
CHANGED
@@ -17,9 +17,9 @@ abstract class ExportData {
|
|
17 |
$this->exportTo = $exportTo;
|
18 |
$this->filename = $filename;
|
19 |
}
|
20 |
-
|
21 |
public function initialize() {
|
22 |
-
|
23 |
switch($this->exportTo) {
|
24 |
case 'browser':
|
25 |
$this->sendHttpHeaders();
|
@@ -32,18 +32,18 @@ abstract class ExportData {
|
|
32 |
$this->tempFile = fopen($this->tempFilename, "w");
|
33 |
break;
|
34 |
}
|
35 |
-
|
36 |
$this->write($this->generateHeader());
|
37 |
}
|
38 |
-
|
39 |
public function addRow($row) {
|
40 |
$this->write($this->generateRow($row));
|
41 |
}
|
42 |
-
|
43 |
public function finalize() {
|
44 |
-
|
45 |
$this->write($this->generateFooter());
|
46 |
-
|
47 |
switch($this->exportTo) {
|
48 |
case 'browser':
|
49 |
flush();
|
@@ -58,13 +58,13 @@ abstract class ExportData {
|
|
58 |
break;
|
59 |
}
|
60 |
}
|
61 |
-
|
62 |
public function getString() {
|
63 |
return $this->stringData;
|
64 |
}
|
65 |
-
|
66 |
abstract public function sendHttpHeaders();
|
67 |
-
|
68 |
protected function write($data) {
|
69 |
switch($this->exportTo) {
|
70 |
case 'browser':
|
@@ -78,24 +78,24 @@ abstract class ExportData {
|
|
78 |
break;
|
79 |
}
|
80 |
}
|
81 |
-
|
82 |
protected function generateHeader() {
|
83 |
// can be overridden by subclass to return any data that goes at the top of the exported file
|
84 |
}
|
85 |
-
|
86 |
protected function generateFooter() {
|
87 |
-
// can be overridden by subclass to return any data that goes at the bottom of the exported file
|
88 |
}
|
89 |
-
|
90 |
// In subclasses generateRow will take $row array and return string of it formatted for export type
|
91 |
abstract protected function generateRow($row);
|
92 |
-
|
93 |
}
|
94 |
/**
|
95 |
* ExportDataTSV - Exports to TSV (tab separated value) format.
|
96 |
*/
|
97 |
class ExportDataTSV extends ExportData {
|
98 |
-
|
99 |
function generateRow($row) {
|
100 |
foreach ($row as $key => $value) {
|
101 |
// Escape inner quotes and wrap all contents in new quotes.
|
@@ -104,7 +104,7 @@ class ExportDataTSV extends ExportData {
|
|
104 |
}
|
105 |
return implode("\t", $row) . "\n";
|
106 |
}
|
107 |
-
|
108 |
function sendHttpHeaders() {
|
109 |
header("Content-type: text/tab-separated-values");
|
110 |
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
@@ -114,7 +114,7 @@ class ExportDataTSV extends ExportData {
|
|
114 |
* ExportDataCSV - Exports to CSV (comma separated value) format.
|
115 |
*/
|
116 |
class ExportDataCSV extends ExportData {
|
117 |
-
|
118 |
function generateRow($row) {
|
119 |
foreach ($row as $key => $value) {
|
120 |
// Escape inner quotes and wrap all contents in new quotes.
|
@@ -123,64 +123,64 @@ class ExportDataCSV extends ExportData {
|
|
123 |
}
|
124 |
return implode(",", $row) . "\n";
|
125 |
}
|
126 |
-
|
127 |
function sendHttpHeaders() {
|
128 |
header("Content-type: text/csv");
|
129 |
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
130 |
}
|
131 |
}
|
132 |
/**
|
133 |
-
* ExportDataExcel exports data into an XML format (spreadsheetML) that can be
|
134 |
* read by MS Excel 2003 and newer as well as OpenOffice
|
135 |
-
*
|
136 |
* Creates a workbook with a single worksheet (title specified by
|
137 |
* $title).
|
138 |
-
*
|
139 |
* Note that using .XML is the "correct" file extension for these files, but it
|
140 |
* generally isn't associated with Excel. Using .XLS is tempting, but Excel 2007 will
|
141 |
* throw a scary warning that the extension doesn't match the file type.
|
142 |
-
*
|
143 |
* Based on Excel XML code from Excel_XML (http://github.com/oliverschwarz/php-excel)
|
144 |
* by Oliver Schwarz
|
145 |
*/
|
146 |
class ExportDataExcel extends ExportData {
|
147 |
-
|
148 |
const XmlHeader = "<?xml version=\"1.0\" encoding=\"%s\"?\>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">";
|
149 |
const XmlFooter = "</Workbook>";
|
150 |
-
|
151 |
-
public $encoding = 'UTF-8'; // encoding type to specify in file.
|
152 |
// Note that you're on your own for making sure your data is actually encoded to this encoding
|
153 |
-
|
154 |
-
public $title = 'Sheet1'; // title for Worksheet
|
155 |
-
|
156 |
function generateHeader() {
|
157 |
-
|
158 |
// workbook header
|
159 |
$output = stripslashes(sprintf(self::XmlHeader, $this->encoding)) . "\n";
|
160 |
-
|
161 |
// Set up styles
|
162 |
$output .= "<Styles>\n";
|
163 |
$output .= "<Style ss:ID=\"sDT\"><NumberFormat ss:Format=\"Short Date\"/></Style>\n";
|
164 |
$output .= "</Styles>\n";
|
165 |
-
|
166 |
// worksheet header
|
167 |
$output .= sprintf("<Worksheet ss:Name=\"%s\">\n <Table>\n", htmlentities($this->title));
|
168 |
-
|
169 |
return $output;
|
170 |
}
|
171 |
-
|
172 |
function generateFooter() {
|
173 |
$output = '';
|
174 |
-
|
175 |
// worksheet footer
|
176 |
$output .= " </Table>\n</Worksheet>\n";
|
177 |
-
|
178 |
// workbook footer
|
179 |
$output .= self::XmlFooter;
|
180 |
-
|
181 |
return $output;
|
182 |
}
|
183 |
-
|
184 |
function generateRow($row) {
|
185 |
$output = '';
|
186 |
$output .= " <Row>\n";
|
@@ -190,12 +190,12 @@ class ExportDataExcel extends ExportData {
|
|
190 |
$output .= " </Row>\n";
|
191 |
return $output;
|
192 |
}
|
193 |
-
|
194 |
private function generateCell($item) {
|
195 |
$output = '';
|
196 |
$style = '';
|
197 |
-
|
198 |
-
// Tell Excel to treat as a number. Note that Excel only stores roughly 15 digits, so keep
|
199 |
// as text if number is longer than that.
|
200 |
if(preg_match("/^-?\d+(?:[.,]\d+)?$/",$item) && (strlen($item) < 15)) {
|
201 |
$type = 'Number';
|
@@ -204,7 +204,7 @@ class ExportDataExcel extends ExportData {
|
|
204 |
// also have an optional time after the date.
|
205 |
//
|
206 |
// Note we want to be very strict in what we consider a date. There is the possibility
|
207 |
-
// of really screwing up the data if we try to reformat a string that was not actually
|
208 |
// intended to represent a date.
|
209 |
elseif(preg_match("/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/",$item) &&
|
210 |
($timestamp = strtotime($item)) &&
|
@@ -217,7 +217,7 @@ class ExportDataExcel extends ExportData {
|
|
217 |
else {
|
218 |
$type = 'String';
|
219 |
}
|
220 |
-
|
221 |
$item = str_replace(''', ''', htmlspecialchars($item, ENT_QUOTES));
|
222 |
$output .= " ";
|
223 |
$output .= $style ? "<Cell ss:StyleID=\"$style\">" : "<Cell>";
|
17 |
$this->exportTo = $exportTo;
|
18 |
$this->filename = $filename;
|
19 |
}
|
20 |
+
|
21 |
public function initialize() {
|
22 |
+
|
23 |
switch($this->exportTo) {
|
24 |
case 'browser':
|
25 |
$this->sendHttpHeaders();
|
32 |
$this->tempFile = fopen($this->tempFilename, "w");
|
33 |
break;
|
34 |
}
|
35 |
+
|
36 |
$this->write($this->generateHeader());
|
37 |
}
|
38 |
+
|
39 |
public function addRow($row) {
|
40 |
$this->write($this->generateRow($row));
|
41 |
}
|
42 |
+
|
43 |
public function finalize() {
|
44 |
+
|
45 |
$this->write($this->generateFooter());
|
46 |
+
|
47 |
switch($this->exportTo) {
|
48 |
case 'browser':
|
49 |
flush();
|
58 |
break;
|
59 |
}
|
60 |
}
|
61 |
+
|
62 |
public function getString() {
|
63 |
return $this->stringData;
|
64 |
}
|
65 |
+
|
66 |
abstract public function sendHttpHeaders();
|
67 |
+
|
68 |
protected function write($data) {
|
69 |
switch($this->exportTo) {
|
70 |
case 'browser':
|
78 |
break;
|
79 |
}
|
80 |
}
|
81 |
+
|
82 |
protected function generateHeader() {
|
83 |
// can be overridden by subclass to return any data that goes at the top of the exported file
|
84 |
}
|
85 |
+
|
86 |
protected function generateFooter() {
|
87 |
+
// can be overridden by subclass to return any data that goes at the bottom of the exported file
|
88 |
}
|
89 |
+
|
90 |
// In subclasses generateRow will take $row array and return string of it formatted for export type
|
91 |
abstract protected function generateRow($row);
|
92 |
+
|
93 |
}
|
94 |
/**
|
95 |
* ExportDataTSV - Exports to TSV (tab separated value) format.
|
96 |
*/
|
97 |
class ExportDataTSV extends ExportData {
|
98 |
+
|
99 |
function generateRow($row) {
|
100 |
foreach ($row as $key => $value) {
|
101 |
// Escape inner quotes and wrap all contents in new quotes.
|
104 |
}
|
105 |
return implode("\t", $row) . "\n";
|
106 |
}
|
107 |
+
|
108 |
function sendHttpHeaders() {
|
109 |
header("Content-type: text/tab-separated-values");
|
110 |
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
114 |
* ExportDataCSV - Exports to CSV (comma separated value) format.
|
115 |
*/
|
116 |
class ExportDataCSV extends ExportData {
|
117 |
+
|
118 |
function generateRow($row) {
|
119 |
foreach ($row as $key => $value) {
|
120 |
// Escape inner quotes and wrap all contents in new quotes.
|
123 |
}
|
124 |
return implode(",", $row) . "\n";
|
125 |
}
|
126 |
+
|
127 |
function sendHttpHeaders() {
|
128 |
header("Content-type: text/csv");
|
129 |
header("Content-Disposition: attachment; filename=".basename($this->filename));
|
130 |
}
|
131 |
}
|
132 |
/**
|
133 |
+
* ExportDataExcel exports data into an XML format (spreadsheetML) that can be
|
134 |
* read by MS Excel 2003 and newer as well as OpenOffice
|
135 |
+
*
|
136 |
* Creates a workbook with a single worksheet (title specified by
|
137 |
* $title).
|
138 |
+
*
|
139 |
* Note that using .XML is the "correct" file extension for these files, but it
|
140 |
* generally isn't associated with Excel. Using .XLS is tempting, but Excel 2007 will
|
141 |
* throw a scary warning that the extension doesn't match the file type.
|
142 |
+
*
|
143 |
* Based on Excel XML code from Excel_XML (http://github.com/oliverschwarz/php-excel)
|
144 |
* by Oliver Schwarz
|
145 |
*/
|
146 |
class ExportDataExcel extends ExportData {
|
147 |
+
|
148 |
const XmlHeader = "<?xml version=\"1.0\" encoding=\"%s\"?\>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">";
|
149 |
const XmlFooter = "</Workbook>";
|
150 |
+
|
151 |
+
public $encoding = 'UTF-8'; // encoding type to specify in file.
|
152 |
// Note that you're on your own for making sure your data is actually encoded to this encoding
|
153 |
+
|
154 |
+
public $title = 'Sheet1'; // title for Worksheet
|
155 |
+
|
156 |
function generateHeader() {
|
157 |
+
|
158 |
// workbook header
|
159 |
$output = stripslashes(sprintf(self::XmlHeader, $this->encoding)) . "\n";
|
160 |
+
|
161 |
// Set up styles
|
162 |
$output .= "<Styles>\n";
|
163 |
$output .= "<Style ss:ID=\"sDT\"><NumberFormat ss:Format=\"Short Date\"/></Style>\n";
|
164 |
$output .= "</Styles>\n";
|
165 |
+
|
166 |
// worksheet header
|
167 |
$output .= sprintf("<Worksheet ss:Name=\"%s\">\n <Table>\n", htmlentities($this->title));
|
168 |
+
|
169 |
return $output;
|
170 |
}
|
171 |
+
|
172 |
function generateFooter() {
|
173 |
$output = '';
|
174 |
+
|
175 |
// worksheet footer
|
176 |
$output .= " </Table>\n</Worksheet>\n";
|
177 |
+
|
178 |
// workbook footer
|
179 |
$output .= self::XmlFooter;
|
180 |
+
|
181 |
return $output;
|
182 |
}
|
183 |
+
|
184 |
function generateRow($row) {
|
185 |
$output = '';
|
186 |
$output .= " <Row>\n";
|
190 |
$output .= " </Row>\n";
|
191 |
return $output;
|
192 |
}
|
193 |
+
|
194 |
private function generateCell($item) {
|
195 |
$output = '';
|
196 |
$style = '';
|
197 |
+
|
198 |
+
// Tell Excel to treat as a number. Note that Excel only stores roughly 15 digits, so keep
|
199 |
// as text if number is longer than that.
|
200 |
if(preg_match("/^-?\d+(?:[.,]\d+)?$/",$item) && (strlen($item) < 15)) {
|
201 |
$type = 'Number';
|
204 |
// also have an optional time after the date.
|
205 |
//
|
206 |
// Note we want to be very strict in what we consider a date. There is the possibility
|
207 |
+
// of really screwing up the data if we try to reformat a string that was not actually
|
208 |
// intended to represent a date.
|
209 |
elseif(preg_match("/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/",$item) &&
|
210 |
($timestamp = strtotime($item)) &&
|
217 |
else {
|
218 |
$type = 'String';
|
219 |
}
|
220 |
+
|
221 |
$item = str_replace(''', ''', htmlspecialchars($item, ENT_QUOTES));
|
222 |
$output .= " ";
|
223 |
$output .= $style ? "<Cell ss:StyleID=\"$style\">" : "<Cell>";
|
includes/log/authors.php
CHANGED
@@ -37,24 +37,18 @@
|
|
37 |
$html = __( 'Select Author', 'wp-statistics' ) . ': ';
|
38 |
$html .= '<select name="author" id="author">';
|
39 |
|
40 |
-
$authors_list =
|
41 |
-
'html=0&style=none&echo=0&exclude_admin=0&optioncount=0&show_fullname=1&hide_empty=1&orderby=name&order=ASC'
|
42 |
-
);
|
43 |
-
|
44 |
-
$authors_array = explode( ',', $authors_list );
|
45 |
|
46 |
-
foreach ( $
|
47 |
-
$author_obj = get_user_by( 'slug', $value );
|
48 |
|
49 |
if ( $author_obj !== false ) {
|
50 |
-
// Check to see if this tag is the one that is currently selected.
|
51 |
if ( $author_obj->ID === $author ) {
|
52 |
$selected = ' SELECTED';
|
53 |
} else {
|
54 |
$selected = '';
|
55 |
}
|
56 |
|
57 |
-
$html .= '<option value="' . $author_obj->ID .
|
58 |
}
|
59 |
}
|
60 |
|
37 |
$html = __( 'Select Author', 'wp-statistics' ) . ': ';
|
38 |
$html .= '<select name="author" id="author">';
|
39 |
|
40 |
+
$authors_list = get_users( 'who=authors' );
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
foreach ( $authors_list as $author_obj ) {
|
|
|
43 |
|
44 |
if ( $author_obj !== false ) {
|
|
|
45 |
if ( $author_obj->ID === $author ) {
|
46 |
$selected = ' SELECTED';
|
47 |
} else {
|
48 |
$selected = '';
|
49 |
}
|
50 |
|
51 |
+
$html .= '<option value="' . $author_obj->ID . "\"{$selected}>" . ($author_obj->display_name !="" ? $author_obj->display_name : $author_obj->user_login) . '</option>';
|
52 |
}
|
53 |
}
|
54 |
|
includes/log/searched-phrases.php
CHANGED
@@ -71,7 +71,7 @@ if ( $phrase ) {
|
|
71 |
|
72 |
?>
|
73 |
<div class="wrap">
|
74 |
-
<h2><?php _e( 'Top
|
75 |
<?php do_action( 'wp_statistics_after_title' ); ?>
|
76 |
|
77 |
<div><?php wp_statistics_date_range_selector(
|
@@ -119,7 +119,7 @@ if ( $phrase ) {
|
|
119 |
<?php if ( $phrase ) {
|
120 |
$paneltitle = sprintf( __( 'Searched Phrase: %s', 'wp-statistics' ), esc_html( $phrase ) );
|
121 |
} else {
|
122 |
-
$paneltitle = __( 'Top
|
123 |
}; ?>
|
124 |
<button class="handlediv" type="button" aria-expanded="true">
|
125 |
<span class="screen-reader-text"><?php printf(
|
71 |
|
72 |
?>
|
73 |
<div class="wrap">
|
74 |
+
<h2><?php _e( 'Top Search Words', 'wp-statistics' ); ?></h2>
|
75 |
<?php do_action( 'wp_statistics_after_title' ); ?>
|
76 |
|
77 |
<div><?php wp_statistics_date_range_selector(
|
119 |
<?php if ( $phrase ) {
|
120 |
$paneltitle = sprintf( __( 'Searched Phrase: %s', 'wp-statistics' ), esc_html( $phrase ) );
|
121 |
} else {
|
122 |
+
$paneltitle = __( 'Top Search Words', 'wp-statistics' );
|
123 |
}; ?>
|
124 |
<button class="handlediv" type="button" aria-expanded="true">
|
125 |
<span class="screen-reader-text"><?php printf(
|
includes/log/widgets/recent.php
CHANGED
@@ -6,6 +6,7 @@ function wp_statistics_generate_recent_postbox_content( $ISOCountryCode, $count
|
|
6 |
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT 0, {$count}"
|
7 |
);
|
8 |
|
|
|
9 |
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
10 |
<tr>";
|
11 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
@@ -100,4 +101,5 @@ function wp_statistics_generate_recent_postbox_content( $ISOCountryCode, $count
|
|
100 |
}
|
101 |
|
102 |
echo "</table>";
|
|
|
103 |
}
|
6 |
"SELECT * FROM `{$wpdb->prefix}statistics_visitor` ORDER BY `{$wpdb->prefix}statistics_visitor`.`ID` DESC LIMIT 0, {$count}"
|
7 |
);
|
8 |
|
9 |
+
echo "<div class=\"wp-statistics-table\">";
|
10 |
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
11 |
<tr>";
|
12 |
echo "<td>" . __( 'Browser', 'wp-statistics' ) . "</td>";
|
101 |
}
|
102 |
|
103 |
echo "</table>";
|
104 |
+
echo "</div>";
|
105 |
}
|
includes/log/widgets/top.visitors.php
CHANGED
@@ -21,6 +21,7 @@ function wp_statistics_generate_top_visitors_postbox_content(
|
|
21 |
}
|
22 |
|
23 |
?>
|
|
|
24 |
<table width="100%" class="widefat table-stats" id="last-referrer">
|
25 |
<tr>
|
26 |
<td><?php _e( 'Rank', 'wp-statistics' ); ?></td>
|
@@ -87,5 +88,6 @@ function wp_statistics_generate_top_visitors_postbox_content(
|
|
87 |
}
|
88 |
?>
|
89 |
</table>
|
|
|
90 |
<?php
|
91 |
}
|
21 |
}
|
22 |
|
23 |
?>
|
24 |
+
<div class="wp-statistics-table">
|
25 |
<table width="100%" class="widefat table-stats" id="last-referrer">
|
26 |
<tr>
|
27 |
<td><?php _e( 'Rank', 'wp-statistics' ); ?></td>
|
88 |
}
|
89 |
?>
|
90 |
</table>
|
91 |
+
</div>
|
92 |
<?php
|
93 |
}
|
includes/log/widgets/words.php
CHANGED
@@ -23,6 +23,7 @@ function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count =
|
|
23 |
}
|
24 |
|
25 |
if ( sizeof( $result ) > 0 ) {
|
|
|
26 |
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
27 |
<tr>";
|
28 |
echo "<td>" . __( 'Word', 'wp-statistics' ) . "</td>";
|
@@ -134,6 +135,7 @@ function wp_statistics_generate_words_postbox_content( $ISOCountryCode, $count =
|
|
134 |
}
|
135 |
|
136 |
echo "</table>";
|
|
|
137 |
}
|
138 |
}
|
139 |
|
23 |
}
|
24 |
|
25 |
if ( sizeof( $result ) > 0 ) {
|
26 |
+
echo "<div class=\"wp-statistics-table\">";
|
27 |
echo "<table width=\"100%\" class=\"widefat table-stats\" id=\"last-referrer\">
|
28 |
<tr>";
|
29 |
echo "<td>" . __( 'Word', 'wp-statistics' ) . "</td>";
|
135 |
}
|
136 |
|
137 |
echo "</table>";
|
138 |
+
echo "</div>";
|
139 |
}
|
140 |
}
|
141 |
|
includes/optimization/tabs/wps-optimization-export.php
CHANGED
@@ -64,4 +64,4 @@
|
|
64 |
</tbody>
|
65 |
</table>
|
66 |
</form>
|
67 |
-
</div>
|
64 |
</tbody>
|
65 |
</table>
|
66 |
</form>
|
67 |
+
</div>
|
includes/settings/tabs/wps-general.php
CHANGED
@@ -28,6 +28,7 @@ if ( $wps_nonce_valid ) {
|
|
28 |
'wps_track_all_pages',
|
29 |
'wps_use_cache_plugin',
|
30 |
'wps_disable_column',
|
|
|
31 |
'wps_show_hits',
|
32 |
'wps_display_hits_position',
|
33 |
'wps_check_online',
|
@@ -231,22 +232,38 @@ if ( $wps_nonce_valid ) {
|
|
231 |
?>
|
232 |
<tr valign="top">
|
233 |
<th scope="row">
|
234 |
-
<label for="disable_column"><?php _e( '
|
235 |
</th>
|
236 |
|
237 |
<td>
|
238 |
<input id="disable_column" type="checkbox" value="1"
|
239 |
name="wps_disable_column" <?php echo $WP_Statistics->get_option( 'disable_column' ) == true
|
240 |
? "checked='checked'" : ''; ?>>
|
241 |
-
<label for="disable_column"><?php _e( '
|
242 |
|
243 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
244 |
</td>
|
245 |
</tr>
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
<tr valign="top">
|
248 |
<th scope="row">
|
249 |
-
<label for="show_hits"><?php _e( '
|
250 |
</th>
|
251 |
|
252 |
<td>
|
@@ -309,6 +326,7 @@ if ( $wps_nonce_valid ) {
|
|
309 |
<label for="use_cache_plugin"><?php _e( 'Yes', 'wp-statistics' ); ?></label>
|
310 |
|
311 |
<p class="description"><?php _e( 'If you use WordPress Cache Plugins, enable this option.', 'wp-statistics' ); ?></p>
|
|
|
312 |
</td>
|
313 |
</tr>
|
314 |
|
28 |
'wps_track_all_pages',
|
29 |
'wps_use_cache_plugin',
|
30 |
'wps_disable_column',
|
31 |
+
'wps_hit_post_metabox',
|
32 |
'wps_show_hits',
|
33 |
'wps_display_hits_position',
|
34 |
'wps_check_online',
|
232 |
?>
|
233 |
<tr valign="top">
|
234 |
<th scope="row">
|
235 |
+
<label for="disable_column"><?php _e( 'Hits column', 'wp-statistics' ); ?></label>
|
236 |
</th>
|
237 |
|
238 |
<td>
|
239 |
<input id="disable_column" type="checkbox" value="1"
|
240 |
name="wps_disable_column" <?php echo $WP_Statistics->get_option( 'disable_column' ) == true
|
241 |
? "checked='checked'" : ''; ?>>
|
242 |
+
<label for="disable_column"><?php _e( 'Disable', 'wp-statistics' ); ?></label>
|
243 |
|
244 |
<p class="description"><?php _e( 'Enable or disable this feature', 'wp-statistics' ); ?></p>
|
245 |
</td>
|
246 |
</tr>
|
247 |
|
248 |
+
|
249 |
+
<tr valign="top">
|
250 |
+
<th scope="row">
|
251 |
+
<label for="hit_post_metabox"><?php _e( 'Hit metabox chart:', 'wp-statistics' ); ?></label>
|
252 |
+
</th>
|
253 |
+
|
254 |
+
<td>
|
255 |
+
<input id="hit_post_metabox" type="checkbox" value="1"
|
256 |
+
name="wps_hit_post_metabox" <?php echo $WP_Statistics->get_option( 'hit_post_metabox' ) == true
|
257 |
+
? "checked='checked'" : ''; ?>>
|
258 |
+
<label for="hit_post_metabox"><?php _e( 'Enable', 'wp-statistics' ); ?></label>
|
259 |
+
|
260 |
+
<p class="description"><?php _e( 'Show hits meta box chart in the edit of all post types page.', 'wp-statistics' ); ?></p>
|
261 |
+
</td>
|
262 |
+
</tr>
|
263 |
+
|
264 |
<tr valign="top">
|
265 |
<th scope="row">
|
266 |
+
<label for="show_hits"><?php _e( 'Hits in single page:', 'wp-statistics' ); ?></label>
|
267 |
</th>
|
268 |
|
269 |
<td>
|
326 |
<label for="use_cache_plugin"><?php _e( 'Yes', 'wp-statistics' ); ?></label>
|
327 |
|
328 |
<p class="description"><?php _e( 'If you use WordPress Cache Plugins, enable this option.', 'wp-statistics' ); ?></p>
|
329 |
+
<p class="description"><?php echo sprintf( __( 'To register WP-Statistics REST API endpoint ( %s ) , go to the <a href="%s">Permalink page</a> and update the permalink with press Save Changes.', 'wp-statistics' ), WP_Statistics_Rest::route ,admin_url( 'options-permalink.php' ) ); ?></p>
|
330 |
</td>
|
331 |
</tr>
|
332 |
|
includes/templates/welcome.php
CHANGED
@@ -95,7 +95,7 @@
|
|
95 |
</section>
|
96 |
|
97 |
<section class="center-section logo">
|
98 |
-
<a href="https://veronalabs.com" target="_blank" title="WordPress Solutions and Services"><img src="
|
99 |
<p><?php echo __( 'WP-Statistics is one of the VeronaLabs.com projects.', 'wp-statistics' ); ?></p>
|
100 |
<h4><?php echo sprintf( __( 'To help us, you can make <a href="%s" target="_blank">donate</a> or <a href="%s" target="_blank">purchase</a> Add-Ons. 😊', 'wp-statistics' ), 'https://wp-statistics.com/donate/', 'https://wp-statistics.com/add-ons/' ); ?></h4>
|
101 |
</section>
|
95 |
</section>
|
96 |
|
97 |
<section class="center-section logo">
|
98 |
+
<a href="https://veronalabs.com" target="_blank" title="WordPress Solutions and Services"><img src="http://bit.ly/2FsmZlq"/></a>
|
99 |
<p><?php echo __( 'WP-Statistics is one of the VeronaLabs.com projects.', 'wp-statistics' ); ?></p>
|
100 |
<h4><?php echo sprintf( __( 'To help us, you can make <a href="%s" target="_blank">donate</a> or <a href="%s" target="_blank">purchase</a> Add-Ons. 😊', 'wp-statistics' ), 'https://wp-statistics.com/donate/', 'https://wp-statistics.com/add-ons/' ); ?></h4>
|
101 |
</section>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wp-statistics.com/donate/
|
|
4 |
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
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 12.5.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -107,12 +107,24 @@ If IPv6 is not enabled, you may see an warning like:
|
|
107 |
10. Theme widget
|
108 |
|
109 |
== Upgrade Notice ==
|
110 |
-
= 12.
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
114 |
|
115 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= 12.5.2 =
|
117 |
* Improved: Some issues in php v5.4
|
118 |
|
4 |
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
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 12.5.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
107 |
10. Theme widget
|
108 |
|
109 |
== Upgrade Notice ==
|
110 |
+
= 12.5.3 =
|
111 |
+
Please consider that after updating, you will probably see some changes in Hits. The reason is that we have better-recognized crawlers and robots to get more accurate statistics for you.
|
112 |
+
|
113 |
+
If the cache option is enabled in your WordPress, you should make sure the below endpoint registered in your WordPress.
|
114 |
+
http://yourwebsite.com/wp-json/wpstatistics/v1
|
115 |
+
|
116 |
+
To register, go to the Permalink page and update the permalink with press Save Changes.
|
117 |
|
118 |
== Changelog ==
|
119 |
+
= 12.5.3 =
|
120 |
+
* Added: Option for enabling/disabling the hits meta box chart in the edit of all post types page and that option is disabled by default.
|
121 |
+
* Improved: The responsive problem of Recent Visitors and Latest Search Words widgets in WP Dashboard.
|
122 |
+
* Improved: Avoid using jQuery in the inline script to for send request when the cache is enabled.
|
123 |
+
* Improved: The GeoIP updater.
|
124 |
+
* Improved: The cache process in the plugin.
|
125 |
+
* Improved: Get location for Anonymize IP Addresses.
|
126 |
+
* Improved: The query in the Author Statistics page.
|
127 |
+
|
128 |
= 12.5.2 =
|
129 |
* Improved: Some issues in php v5.4
|
130 |
|
wp-statistics.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: Complete WordPress Analytics and Statistics for your site!
|
6 |
-
* Version: 12.5.
|
7 |
* Author: Verona Labs
|
8 |
* Author URI: http://veronalabs.com/
|
9 |
*
|
3 |
* Plugin Name: WP Statistics
|
4 |
* Plugin URI: https://wp-statistics.com/
|
5 |
* Description: Complete WordPress Analytics and Statistics for your site!
|
6 |
+
* Version: 12.5.3
|
7 |
* Author: Verona Labs
|
8 |
* Author URI: http://veronalabs.com/
|
9 |
*
|