Version Description
- [New] Quickly delete single pageviews in the Real-Time Log screen
- [New] Option to fix an issue occurring when the DB server and the website are in different timezones. Please disable this option if your charts seem to be off.
- [New] Using the new WP Proxy CDN feature. Please contact us if you notice any problems with this new option, as this feature is still being tested.
- [Update] Reintroduced the NO PANIC button under Settings > Maintenance > Miscellaneous
- [Fix] Conflict with WP-Jalali, which forces date_i18n to return not western numerals but their Farsi representation
Download this release
Release Info
Developer | coolmann |
Plugin | Slimstat Analytics |
Version | 3.9.1 |
Comparing to | |
See all releases |
Code changes from version 3.9 to 3.9.1
- admin/config/index.php +1 -0
- admin/config/maintenance.php +12 -0
- admin/css/slimstat.css +3 -0
- admin/js/slimstat.admin.js +17 -1
- admin/view/right-now.php +10 -3
- admin/view/wp-slimstat-db.php +49 -32
- admin/wp-slimstat-admin.php +15 -2
- readme.txt +9 -209
- wp-slimstat.php +4 -3
admin/config/index.php
CHANGED
@@ -47,6 +47,7 @@ switch ($config_tabs[$current_tab-1]){
|
|
47 |
'views_basic_header' => array('description' => __('Data and Formats','wp-slimstat'), 'type' => 'section_header'),
|
48 |
'convert_ip_addresses' => array('description' => __('Convert IP Addresses','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display provider names instead of IP addresses.','wp-slimstat')),
|
49 |
'use_european_separators' => array('description' => __('Number Format','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose the number format you want to use for your reports.','wp-slimstat'), 'custom_label_yes' => '1.234,56', 'custom_label_no' => '1,234.56'),
|
|
|
50 |
'enable_sov' => array('description' => __('Enable SOV','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('In linguistic typology, a subject-object-verb (SOV) language is one in which the subject, object, and verb of a sentence appear in that order, like in Japanese.','wp-slimstat')),
|
51 |
'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
|
52 |
'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
|
47 |
'views_basic_header' => array('description' => __('Data and Formats','wp-slimstat'), 'type' => 'section_header'),
|
48 |
'convert_ip_addresses' => array('description' => __('Convert IP Addresses','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display provider names instead of IP addresses.','wp-slimstat')),
|
49 |
'use_european_separators' => array('description' => __('Number Format','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose the number format you want to use for your reports.','wp-slimstat'), 'custom_label_yes' => '1.234,56', 'custom_label_no' => '1,234.56'),
|
50 |
+
'reset_timezone' => array('description' => __('Reset Timezone','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Enable this option if your DB server and your web site use different timezones.','wp-slimstat')),
|
51 |
'enable_sov' => array('description' => __('Enable SOV','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('In linguistic typology, a subject-object-verb (SOV) language is one in which the subject, object, and verb of a sentence appear in that order, like in Japanese.','wp-slimstat')),
|
52 |
'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
|
53 |
'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
|
admin/config/maintenance.php
CHANGED
@@ -212,5 +212,17 @@ $suffixes = array('bytes', 'KB', 'MB', 'GB', 'TB');
|
|
212 |
</form>
|
213 |
</td>
|
214 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
</tbody>
|
216 |
</table>
|
212 |
</form>
|
213 |
</td>
|
214 |
</tr>
|
215 |
+
<tr>
|
216 |
+
<td colspan="2" class="slimstat-options-section-header"><?php _e('Miscellaneous','wp-slimstat') ?></td>
|
217 |
+
</tr>
|
218 |
+
<tr>
|
219 |
+
<th scope="row"><?php _e('Reset Reports','wp-slimstat') ?></th>
|
220 |
+
<td>
|
221 |
+
<a class="button-secondary" href="<?php echo wp_slimstat_admin::$config_url.$current_tab ?>&action=restore-views"
|
222 |
+
onclick="return(confirm('<?php _e('Are you sure you want to restore the default arrangement of your reports?','wp-slimstat'); ?>'))"><?php _e('No Panic Button','wp-slimstat'); ?></a>
|
223 |
+
<span class="description"><?php _e("Reset the default arrangement of your reports. Helpful when, for some reason, reports disappear from your panels or something doesn't look right in your views.",'wp-slimstat') ?></span>
|
224 |
+
</td>
|
225 |
+
</tr>
|
226 |
+
|
227 |
</tbody>
|
228 |
</table>
|
admin/css/slimstat.css
CHANGED
@@ -3,6 +3,9 @@
|
|
3 |
outline: none;
|
4 |
text-decoration: none;
|
5 |
}
|
|
|
|
|
|
|
6 |
|
7 |
/* Admin Notice */
|
8 |
.slimstat-notice{
|
3 |
outline: none;
|
4 |
text-decoration: none;
|
5 |
}
|
6 |
+
[id^=slim_] a.slimstat-delete-entry{
|
7 |
+
color: #bbb;
|
8 |
+
}
|
9 |
|
10 |
/* Admin Notice */
|
11 |
.slimstat-notice{
|
admin/js/slimstat.admin.js
CHANGED
@@ -399,7 +399,7 @@ jQuery(function(){
|
|
399 |
data: data
|
400 |
});
|
401 |
});
|
402 |
-
|
403 |
// Enable ads on click
|
404 |
jQuery(document).on('click', '#slimstat-enable-ads-toggle', function(e){
|
405 |
e.preventDefault();
|
@@ -413,6 +413,22 @@ jQuery(function(){
|
|
413 |
});
|
414 |
});
|
415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
// SlimScroll init
|
417 |
if (SlimStatAdminParams.use_slimscroll == 'yes'){
|
418 |
jQuery('[id^=slim_]:not(.tall) .inside').slimScroll({
|
399 |
data: data
|
400 |
});
|
401 |
});
|
402 |
+
|
403 |
// Enable ads on click
|
404 |
jQuery(document).on('click', '#slimstat-enable-ads-toggle', function(e){
|
405 |
e.preventDefault();
|
413 |
});
|
414 |
});
|
415 |
|
416 |
+
// Delete Pageview
|
417 |
+
jQuery(document).on('click', '.slimstat-delete-entry', function(e){
|
418 |
+
var target = jQuery(this);
|
419 |
+
|
420 |
+
e.preventDefault();
|
421 |
+
data = {action: 'slimstat_delete_pageview', security: jQuery('#meta-box-order-nonce').val(), pageview_id : target.attr('data-pageview-id')};
|
422 |
+
jQuery.ajax({
|
423 |
+
url: ajaxurl,
|
424 |
+
type: 'post',
|
425 |
+
async: true,
|
426 |
+
data: data
|
427 |
+
}).done(function(){
|
428 |
+
target.parents('p').fadeOut(1000);
|
429 |
+
});
|
430 |
+
});
|
431 |
+
|
432 |
// SlimScroll init
|
433 |
if (SlimStatAdminParams.use_slimscroll == 'yes'){
|
434 |
jQuery('[id^=slim_]:not(.tall) .inside').slimScroll({
|
admin/view/right-now.php
CHANGED
@@ -34,6 +34,10 @@ else if (wp_slimstat::$options['async_load'] != 'yes' || !empty($_POST['report_i
|
|
34 |
// Pagination
|
35 |
echo wp_slimstat_reports::report_pagination('slim_p7_02', $count_page_results, $count_all_results);
|
36 |
|
|
|
|
|
|
|
|
|
37 |
// Loop through the results
|
38 |
for($i=0;$i<$count_page_results;$i++){
|
39 |
|
@@ -122,7 +126,6 @@ else if (wp_slimstat::$options['async_load'] != 'yes' || !empty($_POST['report_i
|
|
122 |
echo "<p class='header$highlight_row'>{$results[$i]['country']} $browser_filtered $platform_filtered $browser_type_filtered $ip_address $other_ip_address $notes <span class='plugins'>$plugins</span></p>";
|
123 |
}
|
124 |
|
125 |
-
echo "<p>";
|
126 |
$results[$i]['referer'] = (strpos($results[$i]['referer'], '://') === false)?"http://{$results[$i]['domain']}{$results[$i]['referer']}":$results[$i]['referer'];
|
127 |
|
128 |
$performance = '';
|
@@ -154,8 +157,12 @@ else if (wp_slimstat::$options['async_load'] != 'yes' || !empty($_POST['report_i
|
|
154 |
$results[$i]['outbound_domain'] = (!empty($results[$i]['outbound_domain']) && $results[$i]['outbound_domain'] != $base_host)?"<a class='inline-icon spaced slimstat-font-logout' target='_blank' title='".htmlentities(__('Open this outbound link in a new window','wp-slimstat'), ENT_QUOTES, 'UTF-8')."' href='{$results[$i]['outbound_resource']}'></a> {$results[$i]['outbound_domain']}":'';
|
155 |
$results[$i]['dt'] = "<i class='spaced slimstat-font-clock' title='".__('Date and Time','wp-slimstat')."'></i> {$results[$i]['dt']}";
|
156 |
$results[$i]['content_type'] = !empty($results[$i]['content_type'])?"<i class='spaced slimstat-font-doc' title='".__('Content Type','wp-slimstat')."'></i> <a class='slimstat-filter-link' href='".wp_slimstat_reports::fs_url('content_type equals '.$results[$i]['content_type'])."'>{$results[$i]['content_type']}</a> ":'';
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
159 |
}
|
160 |
|
161 |
// Pagination
|
34 |
// Pagination
|
35 |
echo wp_slimstat_reports::report_pagination('slim_p7_02', $count_page_results, $count_all_results);
|
36 |
|
37 |
+
// Show delete button? (only those who can access the settings can see it)
|
38 |
+
$current_user_can_delete = current_user_can(wp_slimstat::$options['capability_can_admin']);
|
39 |
+
$delete_row = '';
|
40 |
+
|
41 |
// Loop through the results
|
42 |
for($i=0;$i<$count_page_results;$i++){
|
43 |
|
126 |
echo "<p class='header$highlight_row'>{$results[$i]['country']} $browser_filtered $platform_filtered $browser_type_filtered $ip_address $other_ip_address $notes <span class='plugins'>$plugins</span></p>";
|
127 |
}
|
128 |
|
|
|
129 |
$results[$i]['referer'] = (strpos($results[$i]['referer'], '://') === false)?"http://{$results[$i]['domain']}{$results[$i]['referer']}":$results[$i]['referer'];
|
130 |
|
131 |
$performance = '';
|
157 |
$results[$i]['outbound_domain'] = (!empty($results[$i]['outbound_domain']) && $results[$i]['outbound_domain'] != $base_host)?"<a class='inline-icon spaced slimstat-font-logout' target='_blank' title='".htmlentities(__('Open this outbound link in a new window','wp-slimstat'), ENT_QUOTES, 'UTF-8')."' href='{$results[$i]['outbound_resource']}'></a> {$results[$i]['outbound_domain']}":'';
|
158 |
$results[$i]['dt'] = "<i class='spaced slimstat-font-clock' title='".__('Date and Time','wp-slimstat')."'></i> {$results[$i]['dt']}";
|
159 |
$results[$i]['content_type'] = !empty($results[$i]['content_type'])?"<i class='spaced slimstat-font-doc' title='".__('Content Type','wp-slimstat')."'></i> <a class='slimstat-filter-link' href='".wp_slimstat_reports::fs_url('content_type equals '.$results[$i]['content_type'])."'>{$results[$i]['content_type']}</a> ":'';
|
160 |
+
|
161 |
+
if ($current_user_can_delete){
|
162 |
+
$delete_row = "<a class='slimstat-delete-entry slimstat-font-cancel' data-pageview-id='{$results[$i]['id']}' title='".htmlentities(__('Delete this pageview','wp-slimstat'), ENT_QUOTES, 'UTF-8')."' href='#'></a>";
|
163 |
+
}
|
164 |
+
|
165 |
+
echo "<p>{$results[$i]['resource']} <span class='details'>{$results[$i]['searchterms']} {$results[$i]['domain']} {$results[$i]['outbound_domain']} {$results[$i]['content_type']} $performance {$results[$i]['dt']} {$delete_row}</span></p>";
|
166 |
}
|
167 |
|
168 |
// Pagination
|
admin/view/wp-slimstat-db.php
CHANGED
@@ -17,8 +17,11 @@ class wp_slimstat_db {
|
|
17 |
*/
|
18 |
public static function init($_filters = ''){
|
19 |
// Reset MySQL timezone settings, our dates and times are recorded using WP settings
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
// Decimal and thousand separators
|
24 |
if (wp_slimstat::$options['use_european_separators'] == 'no'){
|
@@ -92,6 +95,13 @@ class wp_slimstat_db {
|
|
92 |
// Hook for the array of normalized filters
|
93 |
self::$filters_normalized = apply_filters('slimstat_db_filters_normalized', self::$filters_normalized, $_filters);
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
if (empty(self::$filters_normalized['date']['interval']) && empty(self::$filters_normalized['date']['interval_hours']) && empty(self::$filters_normalized['date']['interval_minutes'])){
|
96 |
|
97 |
if (!empty(self::$filters_normalized['date']['minute'])){
|
@@ -99,9 +109,9 @@ class wp_slimstat_db {
|
|
99 |
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:0,
|
100 |
self::$filters_normalized['date']['minute'],
|
101 |
0,
|
102 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
103 |
-
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:
|
104 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
105 |
);
|
106 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 60;
|
107 |
self::$filters_normalized['utime']['type'] = 'H';
|
@@ -111,9 +121,9 @@ class wp_slimstat_db {
|
|
111 |
self::$filters_normalized['date']['hour'],
|
112 |
0,
|
113 |
0,
|
114 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
115 |
-
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:
|
116 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
117 |
);
|
118 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 3599;
|
119 |
self::$filters_normalized['utime']['type'] = 'H';
|
@@ -123,9 +133,9 @@ class wp_slimstat_db {
|
|
123 |
0,
|
124 |
0,
|
125 |
0,
|
126 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
127 |
self::$filters_normalized['date']['day'],
|
128 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
129 |
);
|
130 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 86399;
|
131 |
self::$filters_normalized['utime']['type'] = 'd';
|
@@ -140,14 +150,14 @@ class wp_slimstat_db {
|
|
140 |
0,
|
141 |
0,
|
142 |
0,
|
143 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
144 |
1,
|
145 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
146 |
);
|
147 |
|
148 |
self::$filters_normalized['utime']['end'] = strtotime(
|
149 |
-
(!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
150 |
-
(!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
151 |
'-01 00:00 +1 month UTC'
|
152 |
)-1;
|
153 |
self::$filters_normalized['utime']['type'] = 'm';
|
@@ -157,12 +167,12 @@ class wp_slimstat_db {
|
|
157 |
self::$filters_normalized['utime']['type'] = 'interval';
|
158 |
|
159 |
self::$filters_normalized['utime']['start'] = mktime(
|
160 |
-
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:
|
161 |
-
!empty(self::$filters_normalized['date']['minute'])?self::$filters_normalized['date']['minute']:
|
162 |
0,
|
163 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
164 |
-
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:
|
165 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:
|
166 |
);
|
167 |
|
168 |
$sign = (self::$filters_normalized['date']['interval_direction'] == 'plus')?'+':'-';
|
@@ -182,8 +192,8 @@ class wp_slimstat_db {
|
|
182 |
}
|
183 |
|
184 |
// If end is in the future, set it to now
|
185 |
-
if (self::$filters_normalized['utime']['end'] >
|
186 |
-
self::$filters_normalized['utime']['end'] =
|
187 |
}
|
188 |
|
189 |
// If start is after end, set it to first of month
|
@@ -192,13 +202,20 @@ class wp_slimstat_db {
|
|
192 |
0,
|
193 |
0,
|
194 |
0,
|
195 |
-
|
196 |
1,
|
197 |
-
|
198 |
);
|
199 |
self::$filters_normalized['date']['hour'] = self::$filters_normalized['date']['day'] = self::$filters_normalized['date']['month'] = self::$filters_normalized['date']['year'] = 0;
|
200 |
}
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
// Now let's translate our filters into SQL clauses
|
203 |
self::$sql_filters = array(
|
204 |
'from' => array(
|
@@ -552,7 +569,7 @@ class wp_slimstat_db {
|
|
552 |
$values_in_interval = array(abs(self::$filters_normalized['date']['interval']), abs(self::$filters_normalized['date']['interval']), 0);
|
553 |
break;
|
554 |
default:
|
555 |
-
$previous['start'] = mktime(0, 0, 0, (!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:
|
556 |
$label_date_format = 'm/Y';
|
557 |
$group_by = array('MONTH', 'DAY', 'j');
|
558 |
$values_in_interval = array(date('t', $previous['start']), date('t', self::$filters_normalized['utime']['start']), 1);
|
@@ -598,8 +615,8 @@ class wp_slimstat_db {
|
|
598 |
for ($i = $values_in_interval[2]; $i < $values_in_interval[0]; $i++){
|
599 |
// Do not include dates in the future
|
600 |
|
601 |
-
if ((empty(self::$filters_normalized['date']['interval']) || date('Ymd', wp_slimstat_db::$filters_normalized['utime']['start'] + ( $i * 86400)) >
|
602 |
-
(!empty(self::$filters_normalized['date']['interval']) || $i >
|
603 |
continue;
|
604 |
}
|
605 |
$output['current']['first_metric'][$i] = 0;
|
@@ -678,21 +695,21 @@ class wp_slimstat_db {
|
|
678 |
// Try to apply strtotime to value
|
679 |
switch($a_filter[1]){
|
680 |
case 'minute':
|
681 |
-
$filters_normalized['date']['minute'] = date('i', strtotime($a_filter[3],
|
682 |
$filters_normalized['date']['is_past'] = true;
|
683 |
break;
|
684 |
case 'hour':
|
685 |
-
$filters_normalized['date']['hour'] = date('H', strtotime($a_filter[3],
|
686 |
$filters_normalized['date']['is_past'] = true;
|
687 |
break;
|
688 |
case 'day':
|
689 |
-
$filters_normalized['date']['day'] = date('j', strtotime($a_filter[3],
|
690 |
break;
|
691 |
case 'month':
|
692 |
-
$filters_normalized['date']['month'] = date('n', strtotime($a_filter[3],
|
693 |
break;
|
694 |
case 'year':
|
695 |
-
$filters_normalized['date']['year'] = date('Y', strtotime($a_filter[3],
|
696 |
break;
|
697 |
default:
|
698 |
break;
|
17 |
*/
|
18 |
public static function init($_filters = ''){
|
19 |
// Reset MySQL timezone settings, our dates and times are recorded using WP settings
|
20 |
+
|
21 |
+
if (wp_slimstat::$options['reset_timezone'] == 'yes'){
|
22 |
+
wp_slimstat::$wpdb->query("SET @@session.time_zone = '+00:00'");
|
23 |
+
date_default_timezone_set('UTC');
|
24 |
+
}
|
25 |
|
26 |
// Decimal and thousand separators
|
27 |
if (wp_slimstat::$options['use_european_separators'] == 'no'){
|
95 |
// Hook for the array of normalized filters
|
96 |
self::$filters_normalized = apply_filters('slimstat_db_filters_normalized', self::$filters_normalized, $_filters);
|
97 |
|
98 |
+
// Temporarily disable any filter on date_i18n
|
99 |
+
$date_i18n_filters = array();
|
100 |
+
if (!empty($GLOBALS['wp_filter']['date_i18n'])){
|
101 |
+
$date_i18n_filters = $GLOBALS['wp_filter']['date_i18n'];
|
102 |
+
remove_all_filters('date_i18n');
|
103 |
+
}
|
104 |
+
|
105 |
if (empty(self::$filters_normalized['date']['interval']) && empty(self::$filters_normalized['date']['interval_hours']) && empty(self::$filters_normalized['date']['interval_minutes'])){
|
106 |
|
107 |
if (!empty(self::$filters_normalized['date']['minute'])){
|
109 |
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:0,
|
110 |
self::$filters_normalized['date']['minute'],
|
111 |
0,
|
112 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'),
|
113 |
+
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:date_i18n('j'),
|
114 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')
|
115 |
);
|
116 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 60;
|
117 |
self::$filters_normalized['utime']['type'] = 'H';
|
121 |
self::$filters_normalized['date']['hour'],
|
122 |
0,
|
123 |
0,
|
124 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'),
|
125 |
+
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:date_i18n('j'),
|
126 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')
|
127 |
);
|
128 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 3599;
|
129 |
self::$filters_normalized['utime']['type'] = 'H';
|
133 |
0,
|
134 |
0,
|
135 |
0,
|
136 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'),
|
137 |
self::$filters_normalized['date']['day'],
|
138 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')
|
139 |
);
|
140 |
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 86399;
|
141 |
self::$filters_normalized['utime']['type'] = 'd';
|
150 |
0,
|
151 |
0,
|
152 |
0,
|
153 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'),
|
154 |
1,
|
155 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')
|
156 |
);
|
157 |
|
158 |
self::$filters_normalized['utime']['end'] = strtotime(
|
159 |
+
(!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')).'-'.
|
160 |
+
(!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n')).
|
161 |
'-01 00:00 +1 month UTC'
|
162 |
)-1;
|
163 |
self::$filters_normalized['utime']['type'] = 'm';
|
167 |
self::$filters_normalized['utime']['type'] = 'interval';
|
168 |
|
169 |
self::$filters_normalized['utime']['start'] = mktime(
|
170 |
+
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:date_i18n('G'),
|
171 |
+
!empty(self::$filters_normalized['date']['minute'])?self::$filters_normalized['date']['minute']:date_i18n('i'),
|
172 |
0,
|
173 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'),
|
174 |
+
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:date_i18n('j'),
|
175 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y')
|
176 |
);
|
177 |
|
178 |
$sign = (self::$filters_normalized['date']['interval_direction'] == 'plus')?'+':'-';
|
192 |
}
|
193 |
|
194 |
// If end is in the future, set it to now
|
195 |
+
if (self::$filters_normalized['utime']['end'] > date_i18n('U')){
|
196 |
+
self::$filters_normalized['utime']['end'] = date_i18n('U');
|
197 |
}
|
198 |
|
199 |
// If start is after end, set it to first of month
|
202 |
0,
|
203 |
0,
|
204 |
0,
|
205 |
+
date_i18n('n', self::$filters_normalized['utime']['end']),
|
206 |
1,
|
207 |
+
date_i18n('Y', self::$filters_normalized['utime']['end'])
|
208 |
);
|
209 |
self::$filters_normalized['date']['hour'] = self::$filters_normalized['date']['day'] = self::$filters_normalized['date']['month'] = self::$filters_normalized['date']['year'] = 0;
|
210 |
}
|
211 |
+
|
212 |
+
// Restore filters on date_i18n
|
213 |
+
foreach ($date_i18n_filters as $i18n_priority => $i18n_func_list) {
|
214 |
+
foreach ($i18n_func_list as $func_name => $func_args) {
|
215 |
+
add_filter('date_i8n', $func_args['function'], $i18n_priority, $func_args['accepted_args']);
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
// Now let's translate our filters into SQL clauses
|
220 |
self::$sql_filters = array(
|
221 |
'from' => array(
|
569 |
$values_in_interval = array(abs(self::$filters_normalized['date']['interval']), abs(self::$filters_normalized['date']['interval']), 0);
|
570 |
break;
|
571 |
default:
|
572 |
+
$previous['start'] = mktime(0, 0, 0, (!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:date_i18n('n'))-1, 1, !empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:date_i18n('Y'));
|
573 |
$label_date_format = 'm/Y';
|
574 |
$group_by = array('MONTH', 'DAY', 'j');
|
575 |
$values_in_interval = array(date('t', $previous['start']), date('t', self::$filters_normalized['utime']['start']), 1);
|
615 |
for ($i = $values_in_interval[2]; $i < $values_in_interval[0]; $i++){
|
616 |
// Do not include dates in the future
|
617 |
|
618 |
+
if ((empty(self::$filters_normalized['date']['interval']) || date('Ymd', wp_slimstat_db::$filters_normalized['utime']['start'] + ( $i * 86400)) > date_i18n('Ymd')) &&
|
619 |
+
(!empty(self::$filters_normalized['date']['interval']) || $i > date_i18n($group_by[2]))){
|
620 |
continue;
|
621 |
}
|
622 |
$output['current']['first_metric'][$i] = 0;
|
695 |
// Try to apply strtotime to value
|
696 |
switch($a_filter[1]){
|
697 |
case 'minute':
|
698 |
+
$filters_normalized['date']['minute'] = date('i', strtotime($a_filter[3], date_i18n('U')));
|
699 |
$filters_normalized['date']['is_past'] = true;
|
700 |
break;
|
701 |
case 'hour':
|
702 |
+
$filters_normalized['date']['hour'] = date('H', strtotime($a_filter[3], date_i18n('U')));
|
703 |
$filters_normalized['date']['is_past'] = true;
|
704 |
break;
|
705 |
case 'day':
|
706 |
+
$filters_normalized['date']['day'] = date('j', strtotime($a_filter[3], date_i18n('U')));
|
707 |
break;
|
708 |
case 'month':
|
709 |
+
$filters_normalized['date']['month'] = date('n', strtotime($a_filter[3], date_i18n('U')));
|
710 |
break;
|
711 |
case 'year':
|
712 |
+
$filters_normalized['date']['year'] = date('Y', strtotime($a_filter[3], date_i18n('U')));
|
713 |
break;
|
714 |
default:
|
715 |
break;
|
admin/wp-slimstat-admin.php
CHANGED
@@ -12,7 +12,7 @@ class wp_slimstat_admin{
|
|
12 |
*/
|
13 |
public static function init(){
|
14 |
if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
|
15 |
-
self::$admin_notice = "We
|
16 |
}
|
17 |
else {
|
18 |
self::$admin_notice = "
|
@@ -138,6 +138,7 @@ class wp_slimstat_admin{
|
|
138 |
add_action('wp_ajax_slimstat_load_report', array('wp_slimstat_reports', 'show_report_wrapper'));
|
139 |
add_action('wp_ajax_slimstat_hide_admin_notice', array(__CLASS__, 'hide_admin_notice'));
|
140 |
add_action('wp_ajax_slimstat_manage_filters', array(__CLASS__, 'manage_filters'));
|
|
|
141 |
add_action('wp_ajax_slimstat_enable_ads_feature', array(__CLASS__, 'enable_ads_feature'));
|
142 |
}
|
143 |
}
|
@@ -421,8 +422,10 @@ class wp_slimstat_admin{
|
|
421 |
* Removes 'spammers' from the database when the corresponding comments are marked as spam
|
422 |
*/
|
423 |
public static function remove_spam($_new_status = '', $_old_status = '', $_comment = ''){
|
|
|
|
|
424 |
if ($_new_status == 'spam' && !empty($_comment->comment_author) && !empty($_comment->comment_author_IP)){
|
425 |
-
|
426 |
}
|
427 |
}
|
428 |
// end remove_spam
|
@@ -729,6 +732,16 @@ class wp_slimstat_admin{
|
|
729 |
}
|
730 |
die();
|
731 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
|
733 |
/**
|
734 |
* Handles the Ajax request to enable the ads network
|
12 |
*/
|
13 |
public static function init(){
|
14 |
if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
|
15 |
+
self::$admin_notice = "We got lots of requests to test our heatmap add-on: thank you all for your help! In order to streamline our support service, we're migrating our ticketing system to Freshdesk (sorry, osTicket). This new site will also include searchable FAQs and much more. <a target='_blank' href='http://support.getused.to.it/'>Feel free to stop by</a> and say hello.";
|
16 |
}
|
17 |
else {
|
18 |
self::$admin_notice = "
|
138 |
add_action('wp_ajax_slimstat_load_report', array('wp_slimstat_reports', 'show_report_wrapper'));
|
139 |
add_action('wp_ajax_slimstat_hide_admin_notice', array(__CLASS__, 'hide_admin_notice'));
|
140 |
add_action('wp_ajax_slimstat_manage_filters', array(__CLASS__, 'manage_filters'));
|
141 |
+
add_action('wp_ajax_slimstat_delete_pageview', array(__CLASS__, 'delete_pageview'));
|
142 |
add_action('wp_ajax_slimstat_enable_ads_feature', array(__CLASS__, 'enable_ads_feature'));
|
143 |
}
|
144 |
}
|
422 |
* Removes 'spammers' from the database when the corresponding comments are marked as spam
|
423 |
*/
|
424 |
public static function remove_spam($_new_status = '', $_old_status = '', $_comment = ''){
|
425 |
+
$my_wpdb = apply_filters('slimstat_custom_wpdb', $GLOBALS['wpdb']);
|
426 |
+
|
427 |
if ($_new_status == 'spam' && !empty($_comment->comment_author) && !empty($_comment->comment_author_IP)){
|
428 |
+
$my_wpdb->query(wp_slimstat::$wpdb->prepare("DELETE ts FROM {$GLOBALS['wpdb']->prefix}slim_stats ts WHERE user = %s OR INET_NTOA(ip) = %s", $_comment->comment_author, $_comment->comment_author_IP));
|
429 |
}
|
430 |
}
|
431 |
// end remove_spam
|
732 |
}
|
733 |
die();
|
734 |
}
|
735 |
+
|
736 |
+
/**
|
737 |
+
* Handles the Ajax request to enable the ads network
|
738 |
+
*/
|
739 |
+
public static function delete_pageview(){
|
740 |
+
$my_wpdb = apply_filters('slimstat_custom_wpdb', $GLOBALS['wpdb']);
|
741 |
+
$pageview_id = intval($_POST['pageview_id']);
|
742 |
+
$my_wpdb->query("DELETE ts FROM {$GLOBALS['wpdb']->prefix}slim_stats ts WHERE ts.id = $pageview_id");
|
743 |
+
die();
|
744 |
+
}
|
745 |
|
746 |
/**
|
747 |
* Handles the Ajax request to enable the ads network
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 3.9
|
8 |
|
9 |
== Description ==
|
10 |
Visit our [website](http://slimstat.getused.to.it/) for more information and to [watch our introductory videos](http://slimstat.getused.to.it/features/video-tutorials/).
|
@@ -51,214 +51,7 @@ Please note: if you decide to uninstall Slimstat, all the stats will be **PERMAN
|
|
51 |
|
52 |
== Frequently Asked Questions ==
|
53 |
|
54 |
-
|
55 |
-
Slimstat's tracking engine has a server-side component, which records all the information available at the time the resource is served,
|
56 |
-
and a client-side component, which collects extra data from your visitors' browsers, like their screen resolution, (x,y) coordinates of their
|
57 |
-
clicks and the events they trigger.
|
58 |
-
|
59 |
-
One of the files handling all the client-server communications is WordPress' `admin-ajax.php`, usually located inside your */wp-admin/* folder.
|
60 |
-
Point your browser to that file directly: if you see an error 404 or 500, then you will need to fix that problem, to allow Slimstat to do its job.
|
61 |
-
If you see the number zero, then the problem could be related to a conflict with another plugin (caching, javascript minimizers, etc).
|
62 |
-
|
63 |
-
= I am using W3 Total Cache (or WP Super Cache, HyperCache, etc), and it looks like Slimstat is not tracking all of my visitors. Can you help me? =
|
64 |
-
Go to Slimstat > Settings > General and set Tracking Mode to Javascript. Don't forget to invalidate/clear your plugin's cache, to let Slimstat add its tracking code to all the newly cached pages.
|
65 |
-
Also, if you're using W3 Total Cache, make sure to exclude wp-slimstat.js from the minifier: our code is already minified, and it looks like W3TC breaks something when it tries to minify it again.
|
66 |
-
|
67 |
-
= My screen goes blank when trying to access the reports / after installing Slimstat =
|
68 |
-
Go to Slimstat > Settings > Maintenance and click the NO PANIC Button. If that doesn't help,
|
69 |
-
[increase the amount of memory](http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP) allocated to PHP.
|
70 |
-
|
71 |
-
= Reports look all messy and not styled =
|
72 |
-
Go to Slimstat > Settings > Maintenance and click the NO PANIC Button. If that doesn't help, make sure you don't have AdBlock installed and active in your browser. For some reason, that plugin doesn't like Slimstat.
|
73 |
-
|
74 |
-
= When trying to access any of options screens, I get the following error: You do not have sufficient permissions to access this page. =
|
75 |
-
You were playing with the plugin's permission settings, weren't you? But don't worry, there's a secret passage that will allow you to unlock your access. Create a new WordPress admin user named `slimstatadmin`. Then log into your WordPress admin area with the new user and... voila: you can now access Slimstat's settings again. Update your users' permissions and then get rid of this newly created user.
|
76 |
-
|
77 |
-
= I am using WP Touch, and mobile visitors are not tracked by your plugin. How can I fix this problem? =
|
78 |
-
WP Touch has an advanced option that they call Restricted Mode, which attempts to fix issues where other plugins load scripts which interfere with WPtouch CSS and JavaScript. If you enable this feature, it will prevent Slimstat from running the tracking script (thank you, [Per](http://wordpress.org/support/topic/known-users-not-logged)).
|
79 |
-
|
80 |
-
= How can I change the colors associated to color-coded pageviews (known user, known visitors, search engines, etc)? =
|
81 |
-
Go to Slimstat > Settings > Advanced tab and paste your custom CSS into the corresponding field. Use the following code as a reference:
|
82 |
-
|
83 |
-
`[id^=slim_] .header.is-search-engine, .is-search-engine{
|
84 |
-
background-color:#c1e751;
|
85 |
-
color:#444;
|
86 |
-
}
|
87 |
-
[id^=slim_] .header.is-direct, .is-direct{
|
88 |
-
background-color:#d0e0eb;
|
89 |
-
color:#111;
|
90 |
-
}
|
91 |
-
[id^=slim_] .header.is-known-user,.is-known-user{
|
92 |
-
background-color:#F1CF90;
|
93 |
-
}
|
94 |
-
[id^=slim_] .header.is-known-visitor,.is-known-visitor{
|
95 |
-
background-color:#EFFD8C;
|
96 |
-
}
|
97 |
-
[id^=slim_] .header.is-spam,.is-spam{
|
98 |
-
background-color:#AAB3AB;
|
99 |
-
color:#222;
|
100 |
-
}`
|
101 |
-
|
102 |
-
= Can I track clicks and other events happening on the page? =
|
103 |
-
Yes, you can. This plugin includes a Javascript handler that can be attached to any event: click, mouseover, focus, keypress, etc. Here's the syntax:
|
104 |
-
|
105 |
-
`SlimStat.ss_track(event, event_id, message)`
|
106 |
-
|
107 |
-
Where:
|
108 |
-
|
109 |
-
* `event` is the event that was triggered (the word 'event' *must* be used when attaching event handlers to HTML tags, see examples below)
|
110 |
-
* `event_id` is a numeric value between 1 and 254 (zero is reserved for outbound clicks)
|
111 |
-
* `message` is a custom message (up to 512 chars long) that can be used to add a note to the event tracked. If the ID attribute is defined, and no note has been specified, the former will be recorded. If the function is attached to a key-related event, the key pressed will be recorded.
|
112 |
-
|
113 |
-
Examples:
|
114 |
-
|
115 |
-
* `onclick="if(typeof SlimStat.ss_track == 'function') SlimStat.ss_track(event, 5, 'clicked on first link');"`
|
116 |
-
* `onkeypress="if(typeof SlimStat.ss_track == 'function') SlimStat.ss_track(event, 20);"`
|
117 |
-
* To make your life easier, a *Google Plus One* callback function is included as well: `<g:plusone callback="SlimStat.slimstat_plusone"></g:plusone>`. Clicks on your Google+ button will be identified by the note 'google-plus-on/off'. Pleae refer to the [official documentation](https://developers.google.com/+/plugins/+1button/) for more information.
|
118 |
-
|
119 |
-
= How do I use all those filters in the dropdown menu? =
|
120 |
-
Here's a brief description of what they mean. Please remember that you can access the same information directly from within the admin, by 'pulling' the Help tab that should appear in the top right hand corner.
|
121 |
-
|
122 |
-
Basic filters:
|
123 |
-
|
124 |
-
* `browser`: user agent (Firefox, Chrome, ...)
|
125 |
-
* `country code`: 2-letter code (us, ru, de, it, ...)
|
126 |
-
* `referring domain`: domain name of the referrer page (i.e., www.google.com if a visitor was coming from Google)
|
127 |
-
* `ip`: visitor's public IP address
|
128 |
-
* `search terms`: keywords visitors used to find your website on a search engine
|
129 |
-
* `language code`: please refer to the [language culture names](http://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx) (first column) for more information
|
130 |
-
* `operating system`: accepts identifiers like win7, win98, macosx, ...; please refer to [this manual page](http://php.net/manual/en/function.get-browser.php) for more information about these codes
|
131 |
-
* `permalink`: URL accessed on your site
|
132 |
-
* `referer`: complete URL of the referrer page
|
133 |
-
* `visitor's name`: visitor's name according to the cookie set by WordPress after leaving a comment
|
134 |
-
|
135 |
-
Advanced filters:
|
136 |
-
|
137 |
-
* `browser capabilities`: plugins or extensions installed by that user (flash, java, silverlight...)
|
138 |
-
* `browser version`: user agent version (9.0, 11, ...)
|
139 |
-
* `browser type`: 1 = search engine crawler, 2 = mobile device, 3 = syndication reader, 0 = all others
|
140 |
-
* `color depth`: visitor's screen's color depth (8, 16, 24, ...)
|
141 |
-
* `css version`: what CSS standard was supported by that browser (1, 2, 3 and other integer values)
|
142 |
-
* `pageview attributes`: this field is set to [pre] if the resource has been accessed through Link Prefetching or similar techniques
|
143 |
-
* `post author`: author associated to that post/page when the resource was accessed
|
144 |
-
* `post category id`: ID of the category/term associated to the resource, when available
|
145 |
-
* `private ip`: visitor's private IP address, if available
|
146 |
-
* `resource content type`: post, page, cpt:*custom-post-type*, attachment, singular, post_type_archive, tag, taxonomy, category, date, author, archive, search, feed, home; please refer to the [Conditional Tags](http://codex.wordpress.org/Conditional_Tags) manual page for more information
|
147 |
-
* `screen resolution`: viewport width and height (1024x768, 800x600, ...)
|
148 |
-
* `visit id`: generally used in conjunction with 'is not empty', identifies human visitors
|
149 |
-
|
150 |
-
= How do I create my own custom reports? =
|
151 |
-
You will need to embed them in a plugin that leverages Slimstat APIs to retrieve the data. You can also access Slimstat's tables directly, for more complicated stuff.
|
152 |
-
Please refer to the database description and API reference guide here below for more information on what tables/methods are available.
|
153 |
-
|
154 |
-
Let's say you came up with your own SQL query, something like
|
155 |
-
|
156 |
-
`SELECT resource, COUNT(*) countresults
|
157 |
-
FROM $this->table_stats
|
158 |
-
WHERE resource <> ''
|
159 |
-
GROUP BY resource
|
160 |
-
ORDER BY countresults DESC
|
161 |
-
LIMIT 0,20`
|
162 |
-
|
163 |
-
Just write a function that gets the results and displays them, making sure to use the same HTML markup shown here below:
|
164 |
-
|
165 |
-
`public function my_cystom_report() {
|
166 |
-
$sql = "SELECT ...";
|
167 |
-
$results = $wpdb->get_results($sql, ARRAY_A);
|
168 |
-
|
169 |
-
// Reports come in two sizes: normal (default) and wide.
|
170 |
-
wp_slimstat_reports:report_header('my_custom_report_id', 'report_size', 'My Custom Report Tooltip', 'My Cool Report Name');
|
171 |
-
|
172 |
-
foreach($results as $a_result){
|
173 |
-
echo "<p>{$a_result['resource']} <span>{$a_result['countresults']}</span></p>";
|
174 |
-
}
|
175 |
-
|
176 |
-
wp_slimstat_reports:report_footer();
|
177 |
-
}`
|
178 |
-
|
179 |
-
Then let Slimstat know about it:
|
180 |
-
|
181 |
-
`add_action('wp_slimstat_custom_report', 'my_cystom_report');`
|
182 |
-
|
183 |
-
Save your file as `my_custom_report.php` and then [follow these instructions](http://codex.wordpress.org/Writing_a_Plugin#Standard_Plugin_Information) to make a plugin out of that file.
|
184 |
-
|
185 |
-
= Can I disable outbound link tracking on a given link? =
|
186 |
-
Yes, you can. This is useful if you notice that, after clicking on a Lightbox-powered thumbnail, the image doesn't open inside the popup window as expected.
|
187 |
-
Let's say you have a link associated to Lightbox (or one of its clones):
|
188 |
-
|
189 |
-
`<a href="/wp-slimstat">Open Image in LightBox</a>`
|
190 |
-
|
191 |
-
Change it to:
|
192 |
-
|
193 |
-
`<a href="/wp-slimstat" class="noslimstat">Open Image in LightBox</a>`
|
194 |
-
|
195 |
-
You can also use the corresponding options under Settings > Filters, and disable outbound link tracking for given categories of links.
|
196 |
-
|
197 |
-
= Why does Slimstat show more page views than actual pages clicked by a user? =
|
198 |
-
"Phantom" page views can occur when a user's browser does automatic feed retrieval,
|
199 |
-
[link pre-fetching](https://developer.mozilla.org/en/Link_prefetching_FAQ), or a page refresh. Slimstat tracks these because they are valid
|
200 |
-
requests from that user's browser and are indistinguishable from user link clicks. You can ignore these visits setting the corresponding option
|
201 |
-
in Slimstat > Settings > Filters
|
202 |
-
|
203 |
-
= Why can't Slimstat track visitors using IPv6? =
|
204 |
-
IPv6 support, as of today, is still limited both in PHP and MySQL. There are a few workarounds that could be implemented, but this
|
205 |
-
would make the DB structure less optimized, add overhead for tracking regular requests, and you would have a half-baked product.
|
206 |
-
|
207 |
-
= How do I prevent Slimstat from tracking spammers? =
|
208 |
-
Go to Slimstat > Settings > Filters and set "Ignore Spammers" to YES.
|
209 |
-
|
210 |
-
= Can I add/show reports on my website? =
|
211 |
-
Yes, you can. Slimstat offers two ways of displaying its reports on your website.
|
212 |
-
|
213 |
-
*Via shortcodes*
|
214 |
-
|
215 |
-
Please download and install [WP Slimstat Shortcodes](http://wordpress.org/extend/plugins/wp-slimstat-shortcodes/) to enable shortcode support in Slimstat.
|
216 |
-
|
217 |
-
You will need to edit your template and add something like this where you want your metrics to appear:
|
218 |
-
|
219 |
-
`// Load WP SlimStat DB, the API library exposing all the reports
|
220 |
-
require_once(WP_PLUGIN_DIR.'/wp-slimstat/admin/view/wp-slimstat-db.php');
|
221 |
-
|
222 |
-
// Initialize the API. You can pass a filter in the options, i.e. show only hits by people who where using Firefox (any version) *and* visiting 'posts':
|
223 |
-
wp_slimstat_db::init('browser contains Firefox&&&content_type equals post');
|
224 |
-
|
225 |
-
// Use the appropriate method to display your stats
|
226 |
-
echo wp_slimstat_db::count_records('1=1', '*', false);`
|
227 |
-
|
228 |
-
You can list more than one filter by using &&& to separate them (which is evaluated as AND among the filters). Please read [these FAQs](http://wordpress.org/plugins/wp-slimstat-shortcodes/faq/) for more information on how to combine filters.
|
229 |
-
|
230 |
-
*Available methods*
|
231 |
-
|
232 |
-
* `count_records($where_clause = '1=1', $column = '*', $use_filters = true, $use_date_filters = true)` - returns the number of records matching your criteria
|
233 |
-
* **$where_clause** is the one used in the SQL query
|
234 |
-
* **$column**, if specified, will count DISTINCT values
|
235 |
-
* **$use_filters** can be true or false, it enables or disables previously set filters (useful to count ALL the records in the database, since by default a filter for the current month is enabled)
|
236 |
-
* **$use_date_filters** can be set to false to count ALL the pageviews from the beginning of time
|
237 |
-
* `count_bouncing_pages()` - returns the number of [pages that 'bounce'](http://en.wikipedia.org/wiki/Bounce_rate#Definition)
|
238 |
-
* `count_exit_pages()` - returns the number of [exit pages](http://support.google.com/analytics/bin/answer.py?hl=en&answer=2525491)
|
239 |
-
* `get_recent($column = 'id', $custom_where = '', $join_tables = '', $having_clause = '')` - returns recent results matching your criteria
|
240 |
-
* **$column** is the column you want group results by
|
241 |
-
* **$custom_where** can be used to replace the default WHERE clause
|
242 |
-
* **$join_tables** by default, this method return all the columns of wp_slim_stats; if you need to access (join) other tables, use this param to list them: `tb.*, tss.*, tci.*`
|
243 |
-
* **$having_clause** can be used to further filter results based on aggregate functions
|
244 |
-
* `get_popular($column = 'id', $custom_where = '', $join_tables = '')`
|
245 |
-
* **$column** is the column you want group results by
|
246 |
-
* **$custom_where** can be used to replace the default WHERE clause
|
247 |
-
* **$_more_columns** to 'group by' more than one column and return the corresponding rows
|
248 |
-
|
249 |
-
*Examples*
|
250 |
-
|
251 |
-
Recent Posts:
|
252 |
-
|
253 |
-
`wp_slimstat_db::init('content_type equals post');
|
254 |
-
$results = wp_slimstat_db::get_recent('t1.resource');
|
255 |
-
foreach ($results...`
|
256 |
-
|
257 |
-
Top Languages last month:
|
258 |
-
|
259 |
-
`wp_slimstat_db::init('month equals last month');
|
260 |
-
$results = wp_slimstat_db::get_popular('t1.language');
|
261 |
-
foreach ($results...`
|
262 |
|
263 |
== Screenshots ==
|
264 |
|
@@ -270,6 +63,13 @@ foreach ($results...`
|
|
270 |
|
271 |
== Changelog ==
|
272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
= 3.9 =
|
274 |
* [Note] Announcing our latest add-on: heatmaps! Get your free copy of our beta: contact our support team today.
|
275 |
* [New] Section under Settings > Filters that allows you to specify what links you want to "leave alone", so that the tracker doesn't interfere with your lightbox treatments.
|
4 |
Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 3.9.1
|
8 |
|
9 |
== Description ==
|
10 |
Visit our [website](http://slimstat.getused.to.it/) for more information and to [watch our introductory videos](http://slimstat.getused.to.it/features/video-tutorials/).
|
51 |
|
52 |
== Frequently Asked Questions ==
|
53 |
|
54 |
+
Our FAQs are available on our [support center](https://slimstat.freshdesk.com/support/solutions/folders/5000156457) website.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
== Screenshots ==
|
57 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 3.9.1 =
|
67 |
+
* [New] Quickly delete single pageviews in the Real-Time Log screen
|
68 |
+
* [New] Option to fix an issue occurring when the DB server and the website are in different timezones. Please disable this option if your charts seem to be off.
|
69 |
+
* [New] Using the new [WP Proxy CDN feature](https://github.com/jsdelivr/jsdelivr/issues/2632). Please contact us if you notice any problems with this new option, as this feature is still being tested.
|
70 |
+
* [Update] Reintroduced the NO PANIC button under Settings > Maintenance > Miscellaneous
|
71 |
+
* [Fix] Conflict with WP-Jalali, which forces date_i18n to return not western numerals but their Farsi representation
|
72 |
+
|
73 |
= 3.9 =
|
74 |
* [Note] Announcing our latest add-on: heatmaps! Get your free copy of our beta: contact our support team today.
|
75 |
* [New] Section under Settings > Filters that allows you to specify what links you want to "leave alone", so that the tracker doesn't interfere with your lightbox treatments.
|
wp-slimstat.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Slimstat
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
-
Version: 3.9
|
7 |
Author: Camu
|
8 |
Author URI: http://slimstat.getused.to.it/
|
9 |
*/
|
@@ -11,7 +11,7 @@ Author URI: http://slimstat.getused.to.it/
|
|
11 |
if (!empty(wp_slimstat::$options)) return true;
|
12 |
|
13 |
class wp_slimstat{
|
14 |
-
public static $version = '3.9';
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
@@ -1106,6 +1106,7 @@ class wp_slimstat{
|
|
1106 |
// Views
|
1107 |
'convert_ip_addresses' => $val_no,
|
1108 |
'use_european_separators' => $val_yes,
|
|
|
1109 |
'enable_sov' => $val_no,
|
1110 |
'show_display_name' => $val_no,
|
1111 |
'show_complete_user_agent_tooltip' => $val_no,
|
@@ -1254,7 +1255,7 @@ class wp_slimstat{
|
|
1254 |
public static function wp_slimstat_enqueue_tracking_script(){
|
1255 |
if (self::$options['enable_cdn'] == 'yes'){
|
1256 |
$schema = is_ssl()?'https':'http';
|
1257 |
-
wp_register_script('wp_slimstat', $schema.'://cdn.jsdelivr.net/wp-slimstat/'.self::$version.'/wp-slimstat.js', array(), null, true);
|
1258 |
}
|
1259 |
else{
|
1260 |
wp_register_script('wp_slimstat', plugins_url('/wp-slimstat.js', __FILE__), array(), null, true);
|
3 |
Plugin Name: WP Slimstat
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
+
Version: 3.9.1
|
7 |
Author: Camu
|
8 |
Author URI: http://slimstat.getused.to.it/
|
9 |
*/
|
11 |
if (!empty(wp_slimstat::$options)) return true;
|
12 |
|
13 |
class wp_slimstat{
|
14 |
+
public static $version = '3.9.1';
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
1106 |
// Views
|
1107 |
'convert_ip_addresses' => $val_no,
|
1108 |
'use_european_separators' => $val_yes,
|
1109 |
+
'reset_timezone' => $val_yes,
|
1110 |
'enable_sov' => $val_no,
|
1111 |
'show_display_name' => $val_no,
|
1112 |
'show_complete_user_agent_tooltip' => $val_no,
|
1255 |
public static function wp_slimstat_enqueue_tracking_script(){
|
1256 |
if (self::$options['enable_cdn'] == 'yes'){
|
1257 |
$schema = is_ssl()?'https':'http';
|
1258 |
+
wp_register_script('wp_slimstat', $schema.'://cdn.jsdelivr.net/wp/wp-slimstat/tags/'.self::$version.'/wp-slimstat.js', array(), null, true);
|
1259 |
}
|
1260 |
else{
|
1261 |
wp_register_script('wp_slimstat', plugins_url('/wp-slimstat.js', __FILE__), array(), null, true);
|