Version Description
- [Update] Removed options to enable or disable tracking of "internal" and outbound links, as they were confusing many users, based on the feedback we received. Now all links are tracked, regardless of their type. This will increase the size of the "events" table, however it will also make your reports more accurate, and track data needed to generate heatmaps and other metrics.
- [Fix] The Activity Log will now group page views not just by session, but also by other events: change of IP, user logged out, etc (thank you, catmaniax).
- [Fix] The Browscap Library could not be installed if the FS_METHOD constant was not set to 'direct' in wp-config.php (thank you computershowtopro).
- [Fix] A PHP notice was being displayed if the widget_id for the new Slimstat Widget element was not set.
- [Fix] In order to calculate its internal timestamps without any conflicts with other plugins, Slimstat was supposed to temporarily deactivate any WordPress filters on the function
date_i18n
. It turns out something had changed in the way WordPress was structuring that information, with the side effect that Slimstat was not able to restore those filters (thank you, catmaniax).
Download this release
Release Info
Developer | coolmann |
Plugin | Slimstat Analytics |
Version | 4.6.2 |
Comparing to | |
See all releases |
Code changes from version 4.6.1 to 4.6.2
- admin/config/index.php +1 -3
- admin/view/right-now.php +2 -2
- admin/wp-slimstat-admin.php +1 -13
- browscap/browser.php +50 -36
- readme.txt +8 -1
- wp-slimstat.js +75 -82
- wp-slimstat.min.js +1 -1
- wp-slimstat.php +17 -14
admin/config/index.php
CHANGED
@@ -104,8 +104,6 @@ $settings = array(
|
|
104 |
'title' => __( 'Tracker', 'wp-slimstat' ),
|
105 |
'rows' => array(
|
106 |
'filters_outbound_header' => array( 'description' => __( 'Link Tracking', 'wp-slimstat' ), 'type' => 'section_header' ),
|
107 |
-
'enable_outbound_tracking' => array( 'description' => __( 'Track Outbound Clicks', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __('Track when your visitors click on link to external websites. This option required Spy Mode to be enabled.','wp-slimstat') ),
|
108 |
-
'track_internal_links' => array( 'description' => __( 'Track Internal Clicks', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "Collect mouse coordinates and other information for clicks on internal links. Recommended if you're using our heatmap add-on. By default, this information is only collected for external links.", 'wp-slimstat' ) ),
|
109 |
'ignore_outbound_classes_rel_href' => array( 'description' => __( 'No Callback', 'wp-slimstat' ), 'type' => 'textarea', 'long_description' => __( "Track the event but do not invoke the callback function on links marked with one of these class names, <em>rel</em> attribute or whose <em>href</em> attribute contains one of these strings. Useful to prevent conflicts with lightbox and similar libraries.", 'wp-slimstat' ) ),
|
110 |
'do_not_track_outbound_classes_rel_href' => array( 'description' => __( 'Do Not Track', 'wp-slimstat' ), 'type' => 'textarea', 'long_description' => __( "Slimstat will ignore links marked with one of these class names, <em>rel</em> attributes or whose <em>href</em> attribute contains one of these strings. Please keep in mind that the class <code>noslimstat</code> is also used to avoid tracking interactive links throughout the reports. If you remove it from this list, some features might not work as expected.", 'wp-slimstat' ) ),
|
111 |
'track_same_domain_referers' => array( 'description' => __( 'Same-Domain Referrers', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'By default, when the domain of the referrer for a given page view is the same as the current site, that information is not tracked to save space in the database. However, if you are running a multisite network with subfolders, you might need to track same-domain referrers from one site to another, as they are technically "separate" websites.', 'wp-slimstat' ) ),
|
@@ -115,7 +113,7 @@ $settings = array(
|
|
115 |
'session_duration' => array('description' => __( 'Session Duration', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'How many seconds should a human session last? Google Analytics sets it to 1800 seconds.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
|
116 |
'extend_session' => array( 'description' => __( 'Extend Session', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Extend the duration of a session each time the user visits a new page.', 'wp-slimstat' ) ),
|
117 |
'enable_cdn' => array('description' => __('Enable CDN','wp-slimstat'), 'type' => 'toggle', 'long_description' => __("Use <a href='http://www.jsdelivr.com/' target='_blank'>JSDelivr</a>'s CDN, by serving our tracking code from their fast and reliable network (free service).",'wp-slimstat')),
|
118 |
-
'extensions_to_track' => array('description' => __('Extensions to Track','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the file extensions that you want to be treated as Downloads. Please note that links pointing to external resources (i.e. PDFs on
|
119 |
|
120 |
'advanced_external_pages_header' => array('description' => __('External Pages','wp-slimstat'), 'type' => 'section_header'),
|
121 |
'external_pages_script' => array('type' => 'static', 'skip_update' => 'yes', 'description' => __('Add the following code to all the non-WP pages you want to track, right before the closing BODY tag. Please make sure to change the protocol of all the URLs to HTTPS, if you external site is served over a secure channel.','wp-slimstat'), 'long_description' => '<script type="text/javascript">
|
104 |
'title' => __( 'Tracker', 'wp-slimstat' ),
|
105 |
'rows' => array(
|
106 |
'filters_outbound_header' => array( 'description' => __( 'Link Tracking', 'wp-slimstat' ), 'type' => 'section_header' ),
|
|
|
|
|
107 |
'ignore_outbound_classes_rel_href' => array( 'description' => __( 'No Callback', 'wp-slimstat' ), 'type' => 'textarea', 'long_description' => __( "Track the event but do not invoke the callback function on links marked with one of these class names, <em>rel</em> attribute or whose <em>href</em> attribute contains one of these strings. Useful to prevent conflicts with lightbox and similar libraries.", 'wp-slimstat' ) ),
|
108 |
'do_not_track_outbound_classes_rel_href' => array( 'description' => __( 'Do Not Track', 'wp-slimstat' ), 'type' => 'textarea', 'long_description' => __( "Slimstat will ignore links marked with one of these class names, <em>rel</em> attributes or whose <em>href</em> attribute contains one of these strings. Please keep in mind that the class <code>noslimstat</code> is also used to avoid tracking interactive links throughout the reports. If you remove it from this list, some features might not work as expected.", 'wp-slimstat' ) ),
|
109 |
'track_same_domain_referers' => array( 'description' => __( 'Same-Domain Referrers', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'By default, when the domain of the referrer for a given page view is the same as the current site, that information is not tracked to save space in the database. However, if you are running a multisite network with subfolders, you might need to track same-domain referrers from one site to another, as they are technically "separate" websites.', 'wp-slimstat' ) ),
|
113 |
'session_duration' => array('description' => __( 'Session Duration', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'How many seconds should a human session last? Google Analytics sets it to 1800 seconds.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
|
114 |
'extend_session' => array( 'description' => __( 'Extend Session', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Extend the duration of a session each time the user visits a new page.', 'wp-slimstat' ) ),
|
115 |
'enable_cdn' => array('description' => __('Enable CDN','wp-slimstat'), 'type' => 'toggle', 'long_description' => __("Use <a href='http://www.jsdelivr.com/' target='_blank'>JSDelivr</a>'s CDN, by serving our tracking code from their fast and reliable network (free service).",'wp-slimstat')),
|
116 |
+
'extensions_to_track' => array('description' => __('Extensions to Track','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the file extensions that you want to be treated as Downloads. Please note that links pointing to external resources (i.e. PDFs on an external website) are considered Downloads and not Outbound Links (and tracked as such), if their extension matches one of the ones listed here below.",'wp-slimstat')),
|
117 |
|
118 |
'advanced_external_pages_header' => array('description' => __('External Pages','wp-slimstat'), 'type' => 'section_header'),
|
119 |
'external_pages_script' => array('type' => 'static', 'skip_update' => 'yes', 'description' => __('Add the following code to all the non-WP pages you want to track, right before the closing BODY tag. Please make sure to change the protocol of all the URLs to HTTPS, if you external site is served over a secure channel.','wp-slimstat'), 'long_description' => '<script type="text/javascript">
|
admin/view/right-now.php
CHANGED
@@ -73,7 +73,7 @@ else {
|
|
73 |
$date_time = "<i class='spaced slimstat-font-clock' title='".__( 'Date and Time', 'wp-slimstat' )."'></i> " . date_i18n( wp_slimstat::$settings[ 'date_format' ] . ' ' . wp_slimstat::$settings[ 'time_format' ], $results[ $i ][ 'dt' ], true );
|
74 |
|
75 |
// Print visit header?
|
76 |
-
if ( $i == 0 || $results[ $i - 1 ][ 'visit_id' ] != $results[ $i ][ 'visit_id' ] ||
|
77 |
|
78 |
// Color-coded headers
|
79 |
$highlight_row = !empty($results[$i]['searchterms'])?' is-search-engine':(($results[$i]['browser_type'] != 1)?' is-direct':'');
|
@@ -213,7 +213,7 @@ else {
|
|
213 |
$notes = '';
|
214 |
if ( is_admin() && !empty( $results[ $i ][ 'notes' ] ) ) {
|
215 |
$notes = str_replace(array(';', ':'), array('<br/>', ': '), $results[$i]['notes']);
|
216 |
-
$notes = "<i class='slimstat-font-edit slimstat-tooltip-trigger'
|
217 |
}
|
218 |
|
219 |
// Avoid XSS attacks through the referer URL
|
73 |
$date_time = "<i class='spaced slimstat-font-clock' title='".__( 'Date and Time', 'wp-slimstat' )."'></i> " . date_i18n( wp_slimstat::$settings[ 'date_format' ] . ' ' . wp_slimstat::$settings[ 'time_format' ], $results[ $i ][ 'dt' ], true );
|
74 |
|
75 |
// Print visit header?
|
76 |
+
if ( $i == 0 || $results[ $i - 1 ][ 'visit_id' ] != $results[ $i ][ 'visit_id' ] || $results[ $i - 1 ][ 'ip' ] != $results[ $i ][ 'ip' ] || $results[ $i - 1 ][ 'browser' ] != $results[ $i ][ 'browser' ] || $results[ $i - 1 ][ 'platform' ] != $results[ $i ][ 'platform' ] || $results[ $i - 1 ][ 'username' ] != $results[ $i ][ 'username' ] ) {
|
77 |
|
78 |
// Color-coded headers
|
79 |
$highlight_row = !empty($results[$i]['searchterms'])?' is-search-engine':(($results[$i]['browser_type'] != 1)?' is-direct':'');
|
213 |
$notes = '';
|
214 |
if ( is_admin() && !empty( $results[ $i ][ 'notes' ] ) ) {
|
215 |
$notes = str_replace(array(';', ':'), array('<br/>', ': '), $results[$i]['notes']);
|
216 |
+
$notes = "<i class='slimstat-font-edit slimstat-tooltip-trigger'><b class='slimstat-tooltip-content'>{$notes}</b></i>";
|
217 |
}
|
218 |
|
219 |
// Avoid XSS attacks through the referer URL
|
admin/wp-slimstat-admin.php
CHANGED
@@ -11,7 +11,7 @@ class wp_slimstat_admin {
|
|
11 |
* Init -- Sets things up.
|
12 |
*/
|
13 |
public static function init() {
|
14 |
-
self::$admin_notice = "
|
15 |
|
16 |
// self::$admin_notice = "A few releases ago, Slimstat contained a bug that would trigger a white screen of death under certain circumstances. We have already apologized for the inconvenience this might have caused to our users, and although we promptly released an update to patch the bug, we still receive requests (almost a month later) from users who don't know how to fix the problem. We understand your frustration when this happens. With a small team, we try our best to test various scenarios before releasing a new update. However, occasionally, something sneaks through our tests unnoticed. For this reason, we would like to renew our invitation to join our list of beta testers, and help us avoid this kind of bugaboos in the future. Please contact our <a href='http://support.wp-slimstat.com/' target='_blank'>support team</a> today if you would like to help. P.S.: how do you like the new charts?";
|
17 |
|
@@ -657,18 +657,6 @@ class wp_slimstat_admin {
|
|
657 |
}
|
658 |
// --- END: Updates for version 4.4.5 ---
|
659 |
|
660 |
-
// --- Updates for version 4.5 ---
|
661 |
-
if ( version_compare( wp_slimstat::$settings[ 'version' ], '4.5', '<' ) ) {
|
662 |
-
// Download the new Browscap data structure, if the old one was installed
|
663 |
-
slim_browser::update_browscap_database( true );
|
664 |
-
|
665 |
-
// Clean up after yourself, son!
|
666 |
-
if ( file_exists( wp_slimstat::$upload_dir . '/browscap-db.php' ) ) {
|
667 |
-
@unlink( wp_slimstat::$upload_dir . '/browscap-db.php' );
|
668 |
-
}
|
669 |
-
}
|
670 |
-
// --- END: Updates for version 4.5 ---
|
671 |
-
|
672 |
// Now we can update the version stored in the database
|
673 |
wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
|
674 |
|
11 |
* Init -- Sets things up.
|
12 |
*/
|
13 |
public static function init() {
|
14 |
+
self::$admin_notice = "Have you tested our new widget/shortcode feature yet? Version 4.6.1 introduced the ability to display your reports as widgets and shortcodes on your website. You can now add any report (including the charts and the world map!) to any page on your website. Please <strong><a href='https://slimstat.freshdesk.com/solution/articles/5000631833-what-is-the-syntax-of-a-slimstat-shortcode-#slimstat-operators' target='_blank'>take a look at our knowledge base</a></strong> to learn more about the new syntax. Or simply head over to your Appearance > Widgets admin screen and add the Slimstat widget to any of your sidebars. Please keep in mind that this feature is still experimental, and do not hesitate to contact us if you have any questions or to let us know about a bug you might have found.";
|
15 |
|
16 |
// self::$admin_notice = "A few releases ago, Slimstat contained a bug that would trigger a white screen of death under certain circumstances. We have already apologized for the inconvenience this might have caused to our users, and although we promptly released an update to patch the bug, we still receive requests (almost a month later) from users who don't know how to fix the problem. We understand your frustration when this happens. With a small team, we try our best to test various scenarios before releasing a new update. However, occasionally, something sneaks through our tests unnoticed. For this reason, we would like to renew our invitation to join our list of beta testers, and help us avoid this kind of bugaboos in the future. Please contact our <a href='http://support.wp-slimstat.com/' target='_blank'>support team</a> today if you would like to help. P.S.: how do you like the new charts?";
|
17 |
|
657 |
}
|
658 |
// --- END: Updates for version 4.4.5 ---
|
659 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
// Now we can update the version stored in the database
|
661 |
wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
|
662 |
|
browscap/browser.php
CHANGED
@@ -17,11 +17,14 @@ class slim_browser {
|
|
17 |
self::$browscap_autoload_path = wp_slimstat::$upload_dir . '/browscap-db/autoload.php';
|
18 |
|
19 |
if ( file_exists( self::$browscap_autoload_path ) && version_compare( PHP_VERSION, '5.5', '>=' ) ) {
|
20 |
-
$
|
21 |
-
require_once( self::$browscap_autoload_path );
|
22 |
|
23 |
-
if (
|
24 |
-
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
}
|
27 |
}
|
@@ -55,6 +58,10 @@ class slim_browser {
|
|
55 |
return array( 2, __( 'No updates are performed during AJAX requests.', 'wp-slimstat' ) );
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
58 |
// Create the folder, if it doesn't exist
|
59 |
if ( !file_exists( wp_slimstat::$upload_dir ) ) {
|
60 |
@mkdir( wp_slimstat::$upload_dir );
|
@@ -62,6 +69,7 @@ class slim_browser {
|
|
62 |
|
63 |
$download_remote_file = $_force_download;
|
64 |
$local_version = 0;
|
|
|
65 |
$browscap_zip = wp_slimstat::$upload_dir . '/browscap-db.zip';
|
66 |
|
67 |
if ( empty( wp_slimstat::$settings[ 'browscap_last_modified' ] ) ) {
|
@@ -75,42 +83,48 @@ class slim_browser {
|
|
75 |
|
76 |
// The variable could be still empty if the file does not exist or stat failed to open it
|
77 |
if ( empty( wp_slimstat::$settings[ 'browscap_last_modified' ] ) ) {
|
78 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] =
|
79 |
}
|
80 |
|
81 |
wp_slimstat::slimstat_save_options();
|
82 |
}
|
83 |
|
84 |
// Check for updates once a week ( 604800 seconds ), if $_force_download is not true
|
85 |
-
if (
|
|
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
if ( false === $handle ) {
|
90 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] = date( 'U' );
|
91 |
-
wp_slimstat::slimstat_save_options();
|
92 |
-
return array( 3, __( 'The Browscap Library could not be opened on your filesystem. Please check your server permissions and try again.', 'wp-slimstat' ) );
|
93 |
-
}
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
99 |
}
|
100 |
-
}
|
101 |
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
|
105 |
-
$response = wp_remote_get( 'http://s3.amazonaws.com/browscap/autoload.txt' );
|
106 |
-
if ( !is_array( $response ) || is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
107 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] = date( 'U' );
|
108 |
-
wp_slimstat::slimstat_save_options();
|
109 |
-
return array( 4, __( 'There was an error checking the remote library version. Please try again later.', 'wp-slimstat' ) );
|
110 |
-
}
|
111 |
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
|
116 |
// Download the most recent version of our pre-processed Browscap database
|
@@ -118,25 +132,25 @@ class slim_browser {
|
|
118 |
$response = wp_safe_remote_get( 'http://s3.amazonaws.com/browscap/browscap-db.zip', array( 'timeout' => 300, 'stream' => true, 'filename' => $browscap_zip ) );
|
119 |
|
120 |
if ( !file_exists( $browscap_zip ) ) {
|
121 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] =
|
122 |
wp_slimstat::slimstat_save_options();
|
123 |
-
return array(
|
124 |
}
|
125 |
|
126 |
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
127 |
@unlink( $browscap_zip );
|
128 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] =
|
129 |
wp_slimstat::slimstat_save_options();
|
130 |
-
return array(
|
131 |
}
|
132 |
|
133 |
// Init the filesystem API
|
134 |
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
135 |
if ( !function_exists( 'wp_filesystem' ) ) {
|
136 |
@unlink( $browscap_zip );
|
137 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] =
|
138 |
wp_slimstat::slimstat_save_options();
|
139 |
-
return array(
|
140 |
}
|
141 |
|
142 |
wp_filesystem();
|
@@ -150,9 +164,9 @@ class slim_browser {
|
|
150 |
if ( !$unzip_done || !file_exists( self::$browscap_autoload_path ) ) {
|
151 |
@unlink( $browscap_zip );
|
152 |
$GLOBALS[ 'wp_filesystem' ]->rmdir( dirname( self::$browscap_autoload_path ) . '/', true );
|
153 |
-
wp_slimstat::$settings[ 'browscap_last_modified' ] =
|
154 |
wp_slimstat::slimstat_save_options();
|
155 |
-
return array(
|
156 |
}
|
157 |
|
158 |
if ( file_exists( $browscap_zip ) ) {
|
17 |
self::$browscap_autoload_path = wp_slimstat::$upload_dir . '/browscap-db/autoload.php';
|
18 |
|
19 |
if ( file_exists( self::$browscap_autoload_path ) && version_compare( PHP_VERSION, '5.5', '>=' ) ) {
|
20 |
+
$return_code = self::update_browscap_database( false );
|
|
|
21 |
|
22 |
+
if ( is_array( $return_code ) && $return_code[ 0 ] === 0 ) {
|
23 |
+
require_once( self::$browscap_autoload_path );
|
24 |
+
|
25 |
+
if ( method_exists( 'slimBrowscapConnector', 'get_browser_from_browscap' ) ) {
|
26 |
+
self::$browser = slimBrowscapConnector::get_browser_from_browscap( self::$browser );
|
27 |
+
}
|
28 |
}
|
29 |
}
|
30 |
}
|
58 |
return array( 2, __( 'No updates are performed during AJAX requests.', 'wp-slimstat' ) );
|
59 |
}
|
60 |
|
61 |
+
if ( defined( 'FS_METHOD' ) && FS_METHOD != 'direct' ) {
|
62 |
+
return array( 3, __( 'Please set your <code>FS_METHOD</code> variable to "direct" in your wp-config.php file, or contact our support to obtain a copy of our Browscap Library.', 'wp-slimstat' ) );
|
63 |
+
}
|
64 |
+
|
65 |
// Create the folder, if it doesn't exist
|
66 |
if ( !file_exists( wp_slimstat::$upload_dir ) ) {
|
67 |
@mkdir( wp_slimstat::$upload_dir );
|
69 |
|
70 |
$download_remote_file = $_force_download;
|
71 |
$local_version = 0;
|
72 |
+
$current_timestamp = intval( date( 'U' ) );
|
73 |
$browscap_zip = wp_slimstat::$upload_dir . '/browscap-db.zip';
|
74 |
|
75 |
if ( empty( wp_slimstat::$settings[ 'browscap_last_modified' ] ) ) {
|
83 |
|
84 |
// The variable could be still empty if the file does not exist or stat failed to open it
|
85 |
if ( empty( wp_slimstat::$settings[ 'browscap_last_modified' ] ) ) {
|
86 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
87 |
}
|
88 |
|
89 |
wp_slimstat::slimstat_save_options();
|
90 |
}
|
91 |
|
92 |
// Check for updates once a week ( 604800 seconds ), if $_force_download is not true
|
93 |
+
if ( file_exists( self::$browscap_autoload_path ) ) {
|
94 |
+
if ( $current_timestamp - wp_slimstat::$settings[ 'browscap_last_modified' ] > 604800 ) {
|
95 |
|
96 |
+
// No matter what the outcome is, we'll check again in one week
|
97 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
+
// Find the version of the local data file
|
100 |
+
$handle = @fopen( self::$browscap_autoload_path, "rb" );
|
101 |
+
if ( false === $handle ) {
|
102 |
+
wp_slimstat::slimstat_save_options();
|
103 |
+
return array( 4, __( 'The Browscap Library could not be opened on your filesystem. Please check your server permissions and try again.', 'wp-slimstat' ) );
|
104 |
}
|
|
|
105 |
|
106 |
+
while ( ( $buffer = @fgets( $handle, 4096 ) ) !== false ) {
|
107 |
+
if ( strpos( $buffer, 'source_version' ) !== false ) {
|
108 |
+
$local_version = intval( filter_var( $buffer, FILTER_SANITIZE_NUMBER_INT ) );
|
109 |
+
break;
|
110 |
+
}
|
111 |
+
}
|
112 |
|
113 |
+
fclose( $handle );
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
// Now check the version number on the server
|
116 |
+
$response = wp_remote_get( 'http://s3.amazonaws.com/browscap/autoload.txt' );
|
117 |
+
if ( !is_array( $response ) || is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
118 |
+
wp_slimstat::slimstat_save_options();
|
119 |
+
return array( 5, __( 'There was an error checking the remote library version. Please try again later.', 'wp-slimstat' ) );
|
120 |
+
}
|
121 |
+
|
122 |
+
$remote_version = intval( wp_remote_retrieve_body( $response ) );
|
123 |
+
$download_remote_file = ( $local_version < $remote_version );
|
124 |
+
}
|
125 |
+
else {
|
126 |
+
return array( 0, __( 'Your version of the library does not need to be updated.', 'wp-slimstat' ) );
|
127 |
+
}
|
128 |
}
|
129 |
|
130 |
// Download the most recent version of our pre-processed Browscap database
|
132 |
$response = wp_safe_remote_get( 'http://s3.amazonaws.com/browscap/browscap-db.zip', array( 'timeout' => 300, 'stream' => true, 'filename' => $browscap_zip ) );
|
133 |
|
134 |
if ( !file_exists( $browscap_zip ) ) {
|
135 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
136 |
wp_slimstat::slimstat_save_options();
|
137 |
+
return array( 6, __( 'There was an error saving the Browscap data file on your server. Please check your folder permissions.', 'wp-slimstat' ) );
|
138 |
}
|
139 |
|
140 |
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
141 |
@unlink( $browscap_zip );
|
142 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
143 |
wp_slimstat::slimstat_save_options();
|
144 |
+
return array( 7, __( 'There was an error downloading the Browscap data file from our server. Please try again later.', 'wp-slimstat' ) );
|
145 |
}
|
146 |
|
147 |
// Init the filesystem API
|
148 |
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
149 |
if ( !function_exists( 'wp_filesystem' ) ) {
|
150 |
@unlink( $browscap_zip );
|
151 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
152 |
wp_slimstat::slimstat_save_options();
|
153 |
+
return array( 8, __( 'Could not initialize the WP Filesystem API. Please check your folder permissions and PHP configuration.', 'wp-slimstat' ) );
|
154 |
}
|
155 |
|
156 |
wp_filesystem();
|
164 |
if ( !$unzip_done || !file_exists( self::$browscap_autoload_path ) ) {
|
165 |
@unlink( $browscap_zip );
|
166 |
$GLOBALS[ 'wp_filesystem' ]->rmdir( dirname( self::$browscap_autoload_path ) . '/', true );
|
167 |
+
wp_slimstat::$settings[ 'browscap_last_modified' ] = $current_timestamp;
|
168 |
wp_slimstat::slimstat_save_options();
|
169 |
+
return array( 9, __( 'There was an error uncompressing the Browscap data file on your server. Please check your folder permissions and PHP configuration.', 'wp-slimstat' ) );
|
170 |
}
|
171 |
|
172 |
if ( file_exists( $browscap_zip ) ) {
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, on
|
|
5 |
Text Domain: wp-slimstat
|
6 |
Requires at least: 3.8
|
7 |
Tested up to: 4.8
|
8 |
-
Stable tag: 4.6.
|
9 |
|
10 |
== Description ==
|
11 |
[youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
|
@@ -68,6 +68,13 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
|
|
68 |
5. **Responsive layout** - Keep an eye on your reports on the go
|
69 |
|
70 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
= 4.6.1 =
|
72 |
* [New] You spoke, we listened. Many users have been asking us over time to add a feature to display metrics and reports on their front-facing website. Although Slimstat has been supporting shortcodes for many years, they felt like they needed more than that basic feature. We are now extending the shortcode syntax to allow users to place widgets on their websites in just a few steps. Please [refer to our knowledge base](https://slimstat.freshdesk.com/support/solutions/folders/5000259023) to learn more about this new feature, or feel free to contact us if you need help implementing it on your website.
|
73 |
* [New] Hovering a report's title will reveal its unique ID, which you can [use in your shortcode](https://slimstat.freshdesk.com/support/solutions/folders/5000259023) to display it on your website.
|
5 |
Text Domain: wp-slimstat
|
6 |
Requires at least: 3.8
|
7 |
Tested up to: 4.8
|
8 |
+
Stable tag: 4.6.2
|
9 |
|
10 |
== Description ==
|
11 |
[youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
|
68 |
5. **Responsive layout** - Keep an eye on your reports on the go
|
69 |
|
70 |
== Changelog ==
|
71 |
+
= 4.6.2 =
|
72 |
+
* [Update] Removed options to enable or disable tracking of "internal" and outbound links, as they were confusing many users, based on the feedback we received. Now all links are tracked, regardless of their type. This will increase the size of the "events" table, however it will also make your reports more accurate, and track data needed to generate heatmaps and other metrics.
|
73 |
+
* [Fix] The Activity Log will now group page views not just by session, but also by other events: change of IP, user logged out, etc (thank you, [catmaniax](https://wordpress.org/support/topic/cant-tell-which-user-is-which/)).
|
74 |
+
* [Fix] The Browscap Library could not be installed if the FS_METHOD constant was not set to 'direct' in wp-config.php (thank you [computershowtopro](https://wordpress.org/support/topic/browscap-dp-php-is-present-but-not-seen-by-slimstat)).
|
75 |
+
* [Fix] A PHP notice was being displayed if the widget_id for the new Slimstat Widget element was not set.
|
76 |
+
* [Fix] In order to calculate its internal timestamps without any conflicts with other plugins, Slimstat was supposed to temporarily deactivate any WordPress filters on the function `date_i18n`. It turns out something had changed in the way WordPress was structuring that information, with the side effect that Slimstat was not able to restore those filters (thank you, [catmaniax](https://wordpress.org/support/topic/slimstat-month-name-issue)).
|
77 |
+
|
78 |
= 4.6.1 =
|
79 |
* [New] You spoke, we listened. Many users have been asking us over time to add a feature to display metrics and reports on their front-facing website. Although Slimstat has been supporting shortcodes for many years, they felt like they needed more than that basic feature. We are now extending the shortcode syntax to allow users to place widgets on their websites in just a few steps. Please [refer to our knowledge base](https://slimstat.freshdesk.com/support/solutions/folders/5000259023) to learn more about this new feature, or feel free to contact us if you need help implementing it on your website.
|
80 |
* [New] Hovering a report's title will reveal its unique ID, which you can [use in your shortcode](https://slimstat.freshdesk.com/support/solutions/folders/5000259023) to display it on your website.
|
wp-slimstat.js
CHANGED
@@ -397,104 +397,97 @@ var SlimStat = {
|
|
397 |
}
|
398 |
|
399 |
SlimStat.add_event( window, "load", function() {
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
// Do not invoke the callback or don't track links with given classes
|
425 |
-
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && ( to_ignore.length > 0 || to_not_track.length > 0 ) ) {
|
426 |
-
classes_current_link = ( "undefined" != typeof cur_link.className && cur_link.className ) ? cur_link.className.split( " " ) : [];
|
427 |
-
|
428 |
-
for ( var cl = 0; cl < classes_current_link.length; cl++ ) {
|
429 |
-
if ( SlimStat.in_array_substring( classes_current_link[ cl ], to_ignore ) ) {
|
430 |
-
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
431 |
-
}
|
432 |
-
if ( SlimStat.in_array_substring( classes_current_link[ cl ], to_not_track ) ) {
|
433 |
-
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
434 |
-
break;
|
435 |
-
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
// Do not invoke the callback on links with given rel
|
440 |
-
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && "undefined" != typeof cur_link.attributes.rel && cur_link.attributes.rel.value ) {
|
441 |
-
if ( SlimStat.in_array_substring( cur_link.attributes.rel.value, to_ignore ) ) {
|
442 |
-
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
443 |
-
}
|
444 |
-
if ( SlimStat.in_array_substring( cur_link.attributes.rel.value, to_not_track ) ) {
|
445 |
-
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
446 |
-
}
|
447 |
-
}
|
448 |
-
|
449 |
-
// Do not invoke the callback on links with given href
|
450 |
-
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && "undefined" != typeof cur_link.href && cur_link.href ) {
|
451 |
-
if ( SlimStat.in_array_substring( cur_link.href, to_ignore ) ) {
|
452 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
453 |
}
|
454 |
-
if ( SlimStat.in_array_substring(
|
455 |
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
|
|
456 |
}
|
457 |
}
|
|
|
458 |
|
459 |
-
|
460 |
-
|
461 |
-
if (
|
462 |
-
cur_link.setAttribute( "data-slimstat-tracking", "true" );
|
463 |
-
cur_link.setAttribute( "data-slimstat-type", 1 );
|
464 |
-
}
|
465 |
-
|
466 |
-
// Do not invoke the callback on links that open a new window
|
467 |
-
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && cur_link.target && !cur_link.target.match( /^_(self|parent|top)$/i ) ) {
|
468 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
469 |
}
|
|
|
|
|
|
|
|
|
470 |
|
471 |
-
|
472 |
-
|
|
|
473 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
474 |
}
|
|
|
|
|
|
|
|
|
475 |
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
|
|
|
|
480 |
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
})( this, e );
|
486 |
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
}
|
493 |
-
else
|
494 |
-
this.
|
495 |
}
|
496 |
-
}
|
497 |
-
|
|
|
|
|
|
|
498 |
}
|
499 |
} );
|
500 |
|
397 |
}
|
398 |
|
399 |
SlimStat.add_event( window, "load", function() {
|
400 |
+
all_links = document.getElementsByTagName( "a" );
|
401 |
+
var extensions_to_track = ( "undefined" != typeof SlimStatParams.extensions_to_track && SlimStatParams.extensions_to_track ) ? SlimStatParams.extensions_to_track.split( ',' ) : [];
|
402 |
+
var to_ignore = ( "undefined" != typeof SlimStatParams.outbound_classes_rel_href_to_ignore && SlimStatParams.outbound_classes_rel_href_to_ignore ) ? SlimStatParams.outbound_classes_rel_href_to_ignore.split( ',' ) : [];
|
403 |
+
var to_not_track = ( "undefined" != typeof SlimStatParams.outbound_classes_rel_href_to_not_track && SlimStatParams.outbound_classes_rel_href_to_not_track ) ? SlimStatParams.outbound_classes_rel_href_to_not_track.split( ',' ) : [];
|
404 |
+
|
405 |
+
for (var i = 0; i < all_links.length; i++) {
|
406 |
+
var cur_link = all_links[i];
|
407 |
+
|
408 |
+
// Types
|
409 |
+
// 0: external
|
410 |
+
// 1: download
|
411 |
+
// 2: internal
|
412 |
+
|
413 |
+
cur_link.setAttribute( "data-slimstat-clicked", "false" );
|
414 |
+
cur_link.setAttribute( "data-slimstat-type", ( cur_link.href && ( cur_link.hostname == location.hostname || cur_link.href.indexOf('://') == -1 ) ) ? 2 : 0 );
|
415 |
+
cur_link.setAttribute( "data-slimstat-tracking", "true" );
|
416 |
+
cur_link.setAttribute( "data-slimstat-callback", "true" );
|
417 |
+
|
418 |
+
// Do not invoke the callback or don't track links with given classes
|
419 |
+
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && ( to_ignore.length > 0 || to_not_track.length > 0 ) ) {
|
420 |
+
classes_current_link = ( "undefined" != typeof cur_link.className && cur_link.className ) ? cur_link.className.split( " " ) : [];
|
421 |
+
|
422 |
+
for ( var cl = 0; cl < classes_current_link.length; cl++ ) {
|
423 |
+
if ( SlimStat.in_array_substring( classes_current_link[ cl ], to_ignore ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
425 |
}
|
426 |
+
if ( SlimStat.in_array_substring( classes_current_link[ cl ], to_not_track ) ) {
|
427 |
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
428 |
+
break;
|
429 |
}
|
430 |
}
|
431 |
+
}
|
432 |
|
433 |
+
// Do not invoke the callback on links with given rel
|
434 |
+
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && "undefined" != typeof cur_link.attributes.rel && cur_link.attributes.rel.value ) {
|
435 |
+
if ( SlimStat.in_array_substring( cur_link.attributes.rel.value, to_ignore ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
437 |
}
|
438 |
+
if ( SlimStat.in_array_substring( cur_link.attributes.rel.value, to_not_track ) ) {
|
439 |
+
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
440 |
+
}
|
441 |
+
}
|
442 |
|
443 |
+
// Do not invoke the callback on links with given href
|
444 |
+
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && "undefined" != typeof cur_link.href && cur_link.href ) {
|
445 |
+
if ( SlimStat.in_array_substring( cur_link.href, to_ignore ) ) {
|
446 |
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
447 |
}
|
448 |
+
if ( SlimStat.in_array_substring( cur_link.href, to_not_track ) ) {
|
449 |
+
cur_link.setAttribute( "data-slimstat-tracking", "false" );
|
450 |
+
}
|
451 |
+
}
|
452 |
|
453 |
+
// Downloadable extensions (internal)
|
454 |
+
extension_current_link = cur_link.pathname.split( /[?#]/ )[ 0 ].split( '.' ).pop().replace( /[\/\-]/g, '' );
|
455 |
+
if ( extensions_to_track.length > 0 && 2 == cur_link.getAttribute( "data-slimstat-type" ) && SlimStat.in_array( extension_current_link, extensions_to_track ) ) {
|
456 |
+
cur_link.setAttribute( "data-slimstat-tracking", "true" );
|
457 |
+
cur_link.setAttribute( "data-slimstat-type", 1 );
|
458 |
+
}
|
459 |
|
460 |
+
// Do not invoke the callback on links that open a new window
|
461 |
+
if ( "true" == cur_link.getAttribute( "data-slimstat-tracking" ) && cur_link.target && !cur_link.target.match( /^_(self|parent|top)$/i ) ) {
|
462 |
+
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
463 |
+
}
|
|
|
464 |
|
465 |
+
// No callback if this link is not being tracked
|
466 |
+
if ( "false" == cur_link.getAttribute( "data-slimstat-tracking" ) ) {
|
467 |
+
cur_link.setAttribute( "data-slimstat-callback", "false" );
|
468 |
+
}
|
469 |
+
|
470 |
+
SlimStat.add_event( cur_link, "click", function( e ) {
|
471 |
+
if ( "true" == this.getAttribute( "data-slimstat-tracking" ) && "false" == this.getAttribute( "data-slimstat-clicked" ) ) {
|
472 |
+
if ( "true" == this.getAttribute( "data-slimstat-callback" ) ) {
|
473 |
+
this.setAttribute( "data-slimstat-clicked", "true" );
|
474 |
+
|
475 |
+
(function( node, event_object ) {
|
476 |
+
SlimStat.ss_track( event_object, node.getAttribute( "data-slimstat-type" ), "", function() {
|
477 |
+
SlimStat.event_fire( node, event_object );
|
478 |
+
}, ( node.getAttribute( "data-slimstat-callback" ) == "true" ) );
|
479 |
+
})( this, e );
|
480 |
+
|
481 |
+
return false;
|
482 |
}
|
483 |
+
else{
|
484 |
+
SlimStat.ss_track( e, this.getAttribute( "data-slimstat-type" ), "", function() {}, ( this.getAttribute( "data-slimstat-callback" ) == "true" ) );
|
485 |
}
|
486 |
+
}
|
487 |
+
else if ( "true" == this.getAttribute( "data-slimstat-clicked" ) ) {
|
488 |
+
this.setAttribute( "data-slimstat-clicked", "false" );
|
489 |
+
}
|
490 |
+
});
|
491 |
}
|
492 |
} );
|
493 |
|
wp-slimstat.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var SlimStat={_id:"undefined"!=typeof SlimStatParams.id?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},director:{substrings:["Shockwave","Director"],active_x_strings:["SWCtl.SWCtl"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},real:{substrings:["RealPlayer"],active_x_strings:["rmocx.RealPlayer G2 Control","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(a){var b,c,d="";for(a=a.replace(/\r\n/g,"\n"),b=0;b<a.length;b++)c=a.charCodeAt(b),c<128?d+=String.fromCharCode(c):c>127&&c<2048?(d+=String.fromCharCode(c>>6|192),d+=String.fromCharCode(63&c|128)):(d+=String.fromCharCode(c>>12|224),d+=String.fromCharCode(c>>6&63|128),d+=String.fromCharCode(63&c|128));return d},_base64_encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=SlimStat._utf8_encode(a);j<a.length;)b=a.charCodeAt(j++),c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+SlimStat._base64_key_str.charAt(e)+SlimStat._base64_key_str.charAt(f)+SlimStat._base64_key_str.charAt(g)+this._base64_key_str.charAt(h);return i},_detect_single_plugin_not_ie:function(a){var c,d,e,f;for(e in navigator.plugins){c=""+navigator.plugins[e].name+navigator.plugins[e].description,d=0;for(f in SlimStat._plugins[a].substrings)c.indexOf(SlimStat._plugins[a].substrings[f])!=-1&&d++;if(d==SlimStat._plugins[a].substrings.length)return!0}return!1},_detect_single_plugin_ie:function(a){var b;for(b in SlimStat._plugins[a].active_x_strings)try{return new ActiveXObject(SlimStat._plugins[a].active_x_strings[b]),!0}catch(a){return!1}},_detect_single_plugin:function(a){return navigator.plugins.length?this.detect=this._detect_single_plugin_not_ie:this.detect=this._detect_single_plugin_ie,this.detect(a)},detect_plugins:function(){var a,b=[];for(a in SlimStat._plugins)SlimStat._detect_single_plugin(a)&&b.push(a);return b.join(",")},get_page_performance:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},send_to_server:function(a,b,c){if("undefined"==typeof SlimStatParams.ajaxurl||"undefined"==typeof a)return"function"==typeof b&&b(),!1;if("undefined"==typeof c&&(c=!0),slimstat_data_with_client_info=a+"&sw="+screen.width+"&sh="+screen.height+"&bw="+window.innerWidth+"&bh="+window.innerHeight+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins(),c&&navigator.sendBeacon)navigator.sendBeacon(SlimStatParams.ajaxurl,slimstat_data_with_client_info),"function"==typeof b&&b();else{try{window.XMLHttpRequest?request=new XMLHttpRequest:window.ActiveXObject&&(request=new ActiveXObject("Microsoft.XMLHTTP"))}catch(a){return"function"==typeof b&&b(),!1}if(request)return request.open("POST",SlimStatParams.ajaxurl,!0),request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),request.send(slimstat_data_with_client_info),request.onreadystatechange=function(){4==request.readyState&&("undefined"==typeof SlimStatParams.id?(parsed_id=parseInt(request.responseText),!isNaN(parsed_id)&&parsed_id>0&&(SlimStat._id=request.responseText)):SlimStat._id=SlimStatParams.id,"function"==typeof b&&b())},!0}return!1},ss_track:function(a,b,c,d,e){if(a=a?a:window.event,type="undefined"==typeof b?0:parseInt(b),note_array=[],"undefined"==typeof e&&(e=!0),parsed_id=parseInt(SlimStat._id),isNaN(parsed_id)||parsed_id<=0)return"function"==typeof d&&d(),!1;if(node="undefined"!=typeof a.target?a.target:"undefined"!=typeof a.srcElement&&a.srcElement,!node)return"function"==typeof d&&d(),!1;switch(3==node.nodeType&&(node=node.parentNode),parent_node=node.parentNode,resource_url="",node.nodeName){case"FORM":"undefined"!=typeof node.action&&node.action&&(resource_url=node.action);break;case"INPUT":for(;"undefined"!=typeof parent_node&&"FORM"!=parent_node.nodeName&&"BODY"!=parent_node.nodeName;)parent_node=parent_node.parentNode;if("undefined"!=typeof parent_node.action&&parent_node.action){resource_url=parent_node.action;break}default:if("A"!=node.nodeName)for(;"undefined"!=typeof node.parentNode&&null!=node.parentNode&&"A"!=node.nodeName&&"BODY"!=node.nodeName;)node=node.parentNode;"undefined"!=typeof node.hash&&node.hash&&node.hostname==location.hostname?resource_url=node.hash:"undefined"!=typeof node.href&&(resource_url=node.href),"function"==typeof node.getAttribute&&("undefined"!=typeof node.getAttribute("title")&&node.getAttribute("title")&¬e_array.push("Title:"+node.getAttribute("title")),"undefined"!=typeof node.getAttribute("id")&&node.getAttribute("id")&¬e_array.push("ID:"+node.getAttribute("id")))}return pos_x=-1,pos_y=-1,position="","undefined"!=typeof a.pageX&&"undefined"!=typeof a.pageY?(pos_x=a.pageX,pos_y=a.pageY):"undefined"!=typeof a.clientX&&"undefined"!=typeof a.clientY&&"undefined"!=typeof document.body.scrollLeft&&"undefined"!=typeof document.documentElement.scrollLeft&&"undefined"!=typeof document.body.scrollTop&&"undefined"!=typeof document.documentElement.scrollTop&&(pos_x=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,pos_y=a.clientY+document.body.scrollTop+document.documentElement.scrollTop),pos_x>0&&pos_y>0&&(position=pos_x+","+pos_y),event_description=a.type,"keypress"==a.type?event_description+="; keypress:"+String.fromCharCode(parseInt(a.which)):"click"==a.type&&(event_description+="; which:"+a.which),"undefined"!=typeof c&&c&¬e_array.push(c),note_string=SlimStat._base64_encode(note_array.join(", ")),requested_op="add",1==type?resource_url=resource_url.substring(resource_url.indexOf(location.hostname)+location.hostname.length):0!=type&&2!=type||(requested_op="update"),SlimStat.send_to_server("action=slimtrack&op="+requested_op+"&id="+SlimStat._id+"&ty="+type+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(resource_url)+"&pos="+position+"&des="+SlimStat._base64_encode(event_description)+"&no="+note_string,d,e),!0},add_event:function(a,b,c){a&&a.addEventListener?a.addEventListener(b,c,!1):a&&a.attachEvent?(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c])):a["on"+b]=a["e"+b+c]},event_fire:function(a,b){document.createEvent?(new_event=document.createEvent("MouseEvents"),new_event.initEvent(b.type,!0,!1,document.defaultView,b.button),a.dispatchEvent(new_event)):document.createEventObject&&(new_event=document.createEventObject(),a.fireEvent("on"+b.type,new_event))},in_array:function(a,b){for(var c=0;c<b.length;c++)if(b[c].trim()==a)return!0;return!1},in_array_substring:function(a,b){for(var c=0;c<b.length;c++)if(a.indexOf(b[c].trim())!=-1)return!0;return!1}};SlimStat.add_event(window,"load",function(){if("undefined"==typeof SlimStatParams.disable_outbound_tracking){all_links=document.getElementsByTagName("a");for(var a="undefined"!=typeof SlimStatParams.extensions_to_track&&SlimStatParams.extensions_to_track?SlimStatParams.extensions_to_track.split(","):[],b="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_ignore&&SlimStatParams.outbound_classes_rel_href_to_ignore?SlimStatParams.outbound_classes_rel_href_to_ignore.split(","):[],c="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_not_track&&SlimStatParams.outbound_classes_rel_href_to_not_track?SlimStatParams.outbound_classes_rel_href_to_not_track.split(","):[],d=0;d<all_links.length;d++){var e=all_links[d];if(e.setAttribute("data-slimstat-clicked","false"),e.setAttribute("data-slimstat-type",!e.href||e.hostname!=location.hostname&&e.href.indexOf("://")!=-1?0:2),e.setAttribute("data-slimstat-tracking","true"),e.setAttribute("data-slimstat-callback","true"),2!=e.getAttribute("data-slimstat-type")||"undefined"!=typeof SlimStatParams.track_internal_links&&"false"!=SlimStatParams.track_internal_links||e.setAttribute("data-slimstat-tracking","false"),"true"==e.getAttribute("data-slimstat-tracking")&&(b.length>0||c.length>0)){classes_current_link="undefined"!=typeof e.className&&e.className?e.className.split(" "):[];for(var f=0;f<classes_current_link.length;f++)if(SlimStat.in_array_substring(classes_current_link[f],b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(classes_current_link[f],c)){e.setAttribute("data-slimstat-tracking","false");break}}"true"==e.getAttribute("data-slimstat-tracking")&&"undefined"!=typeof e.attributes.rel&&e.attributes.rel.value&&(SlimStat.in_array_substring(e.attributes.rel.value,b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(e.attributes.rel.value,c)&&e.setAttribute("data-slimstat-tracking","false")),"true"==e.getAttribute("data-slimstat-tracking")&&"undefined"!=typeof e.href&&e.href&&(SlimStat.in_array_substring(e.href,b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(e.href,c)&&e.setAttribute("data-slimstat-tracking","false")),extension_current_link=e.pathname.split(/[?#]/)[0].split(".").pop().replace(/[\/\-]/g,""),a.length>0&&2==e.getAttribute("data-slimstat-type")&&SlimStat.in_array(extension_current_link,a)&&(e.setAttribute("data-slimstat-tracking","true"),e.setAttribute("data-slimstat-type",1)),"true"==e.getAttribute("data-slimstat-tracking")&&e.target&&!e.target.match(/^_(self|parent|top)$/i)&&e.setAttribute("data-slimstat-callback","false"),"false"==e.getAttribute("data-slimstat-tracking")&&e.setAttribute("data-slimstat-callback","false"),SlimStat.add_event(e,"click",function(a){if("true"==this.getAttribute("data-slimstat-tracking")&&"false"==this.getAttribute("data-slimstat-clicked")){if("true"==this.getAttribute("data-slimstat-callback"))return this.setAttribute("data-slimstat-clicked","true"),function(a,b){SlimStat.ss_track(b,a.getAttribute("data-slimstat-type"),"",function(){SlimStat.event_fire(a,b)},"true"==a.getAttribute("data-slimstat-callback"))}(this,a),!1;SlimStat.ss_track(a,this.getAttribute("data-slimstat-type"),"",function(){},"true"==this.getAttribute("data-slimstat-callback"))}else"true"==this.getAttribute("data-slimstat-clicked")&&this.setAttribute("data-slimstat-clicked","false")})}}});var slimstat_data="action=slimtrack",use_beacon=!1;"undefined"!=typeof SlimStatParams.id&&parseInt(SlimStatParams.id)>0?(slimstat_data+="&op=update&id="+SlimStatParams.id,use_beacon=!0):"undefined"!=typeof SlimStatParams.ci?slimstat_data+="&op=add&id="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href):slimstat_data="",slimstat_data.length>0&&SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(slimstat_data,"",use_beacon)},0)}),"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});
|
1 |
+
var SlimStat={_id:"undefined"!=typeof SlimStatParams.id?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},director:{substrings:["Shockwave","Director"],active_x_strings:["SWCtl.SWCtl"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},real:{substrings:["RealPlayer"],active_x_strings:["rmocx.RealPlayer G2 Control","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(a){var b,c,d="";for(a=a.replace(/\r\n/g,"\n"),b=0;b<a.length;b++)c=a.charCodeAt(b),c<128?d+=String.fromCharCode(c):c>127&&c<2048?(d+=String.fromCharCode(c>>6|192),d+=String.fromCharCode(63&c|128)):(d+=String.fromCharCode(c>>12|224),d+=String.fromCharCode(c>>6&63|128),d+=String.fromCharCode(63&c|128));return d},_base64_encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=SlimStat._utf8_encode(a);j<a.length;)b=a.charCodeAt(j++),c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+SlimStat._base64_key_str.charAt(e)+SlimStat._base64_key_str.charAt(f)+SlimStat._base64_key_str.charAt(g)+this._base64_key_str.charAt(h);return i},_detect_single_plugin_not_ie:function(a){var c,d,e,f;for(e in navigator.plugins){c=""+navigator.plugins[e].name+navigator.plugins[e].description,d=0;for(f in SlimStat._plugins[a].substrings)c.indexOf(SlimStat._plugins[a].substrings[f])!=-1&&d++;if(d==SlimStat._plugins[a].substrings.length)return!0}return!1},_detect_single_plugin_ie:function(a){var b;for(b in SlimStat._plugins[a].active_x_strings)try{return new ActiveXObject(SlimStat._plugins[a].active_x_strings[b]),!0}catch(a){return!1}},_detect_single_plugin:function(a){return navigator.plugins.length?this.detect=this._detect_single_plugin_not_ie:this.detect=this._detect_single_plugin_ie,this.detect(a)},detect_plugins:function(){var a,b=[];for(a in SlimStat._plugins)SlimStat._detect_single_plugin(a)&&b.push(a);return b.join(",")},get_page_performance:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},send_to_server:function(a,b,c){if("undefined"==typeof SlimStatParams.ajaxurl||"undefined"==typeof a)return"function"==typeof b&&b(),!1;if("undefined"==typeof c&&(c=!0),slimstat_data_with_client_info=a+"&sw="+screen.width+"&sh="+screen.height+"&bw="+window.innerWidth+"&bh="+window.innerHeight+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins(),c&&navigator.sendBeacon)navigator.sendBeacon(SlimStatParams.ajaxurl,slimstat_data_with_client_info),"function"==typeof b&&b();else{try{window.XMLHttpRequest?request=new XMLHttpRequest:window.ActiveXObject&&(request=new ActiveXObject("Microsoft.XMLHTTP"))}catch(a){return"function"==typeof b&&b(),!1}if(request)return request.open("POST",SlimStatParams.ajaxurl,!0),request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),request.send(slimstat_data_with_client_info),request.onreadystatechange=function(){4==request.readyState&&("undefined"==typeof SlimStatParams.id?(parsed_id=parseInt(request.responseText),!isNaN(parsed_id)&&parsed_id>0&&(SlimStat._id=request.responseText)):SlimStat._id=SlimStatParams.id,"function"==typeof b&&b())},!0}return!1},ss_track:function(a,b,c,d,e){if(a=a?a:window.event,type="undefined"==typeof b?0:parseInt(b),note_array=[],"undefined"==typeof e&&(e=!0),parsed_id=parseInt(SlimStat._id),isNaN(parsed_id)||parsed_id<=0)return"function"==typeof d&&d(),!1;if(node="undefined"!=typeof a.target?a.target:"undefined"!=typeof a.srcElement&&a.srcElement,!node)return"function"==typeof d&&d(),!1;switch(3==node.nodeType&&(node=node.parentNode),parent_node=node.parentNode,resource_url="",node.nodeName){case"FORM":"undefined"!=typeof node.action&&node.action&&(resource_url=node.action);break;case"INPUT":for(;"undefined"!=typeof parent_node&&"FORM"!=parent_node.nodeName&&"BODY"!=parent_node.nodeName;)parent_node=parent_node.parentNode;if("undefined"!=typeof parent_node.action&&parent_node.action){resource_url=parent_node.action;break}default:if("A"!=node.nodeName)for(;"undefined"!=typeof node.parentNode&&null!=node.parentNode&&"A"!=node.nodeName&&"BODY"!=node.nodeName;)node=node.parentNode;"undefined"!=typeof node.hash&&node.hash&&node.hostname==location.hostname?resource_url=node.hash:"undefined"!=typeof node.href&&(resource_url=node.href),"function"==typeof node.getAttribute&&("undefined"!=typeof node.getAttribute("title")&&node.getAttribute("title")&¬e_array.push("Title:"+node.getAttribute("title")),"undefined"!=typeof node.getAttribute("id")&&node.getAttribute("id")&¬e_array.push("ID:"+node.getAttribute("id")))}return pos_x=-1,pos_y=-1,position="","undefined"!=typeof a.pageX&&"undefined"!=typeof a.pageY?(pos_x=a.pageX,pos_y=a.pageY):"undefined"!=typeof a.clientX&&"undefined"!=typeof a.clientY&&"undefined"!=typeof document.body.scrollLeft&&"undefined"!=typeof document.documentElement.scrollLeft&&"undefined"!=typeof document.body.scrollTop&&"undefined"!=typeof document.documentElement.scrollTop&&(pos_x=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,pos_y=a.clientY+document.body.scrollTop+document.documentElement.scrollTop),pos_x>0&&pos_y>0&&(position=pos_x+","+pos_y),event_description=a.type,"keypress"==a.type?event_description+="; keypress:"+String.fromCharCode(parseInt(a.which)):"click"==a.type&&(event_description+="; which:"+a.which),"undefined"!=typeof c&&c&¬e_array.push(c),note_string=SlimStat._base64_encode(note_array.join(", ")),requested_op="add",1==type?resource_url=resource_url.substring(resource_url.indexOf(location.hostname)+location.hostname.length):0!=type&&2!=type||(requested_op="update"),SlimStat.send_to_server("action=slimtrack&op="+requested_op+"&id="+SlimStat._id+"&ty="+type+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(resource_url)+"&pos="+position+"&des="+SlimStat._base64_encode(event_description)+"&no="+note_string,d,e),!0},add_event:function(a,b,c){a&&a.addEventListener?a.addEventListener(b,c,!1):a&&a.attachEvent?(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c])):a["on"+b]=a["e"+b+c]},event_fire:function(a,b){document.createEvent?(new_event=document.createEvent("MouseEvents"),new_event.initEvent(b.type,!0,!1,document.defaultView,b.button),a.dispatchEvent(new_event)):document.createEventObject&&(new_event=document.createEventObject(),a.fireEvent("on"+b.type,new_event))},in_array:function(a,b){for(var c=0;c<b.length;c++)if(b[c].trim()==a)return!0;return!1},in_array_substring:function(a,b){for(var c=0;c<b.length;c++)if(a.indexOf(b[c].trim())!=-1)return!0;return!1}};SlimStat.add_event(window,"load",function(){all_links=document.getElementsByTagName("a");for(var a="undefined"!=typeof SlimStatParams.extensions_to_track&&SlimStatParams.extensions_to_track?SlimStatParams.extensions_to_track.split(","):[],b="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_ignore&&SlimStatParams.outbound_classes_rel_href_to_ignore?SlimStatParams.outbound_classes_rel_href_to_ignore.split(","):[],c="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_not_track&&SlimStatParams.outbound_classes_rel_href_to_not_track?SlimStatParams.outbound_classes_rel_href_to_not_track.split(","):[],d=0;d<all_links.length;d++){var e=all_links[d];if(e.setAttribute("data-slimstat-clicked","false"),e.setAttribute("data-slimstat-type",!e.href||e.hostname!=location.hostname&&e.href.indexOf("://")!=-1?0:2),e.setAttribute("data-slimstat-tracking","true"),e.setAttribute("data-slimstat-callback","true"),"true"==e.getAttribute("data-slimstat-tracking")&&(b.length>0||c.length>0)){classes_current_link="undefined"!=typeof e.className&&e.className?e.className.split(" "):[];for(var f=0;f<classes_current_link.length;f++)if(SlimStat.in_array_substring(classes_current_link[f],b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(classes_current_link[f],c)){e.setAttribute("data-slimstat-tracking","false");break}}"true"==e.getAttribute("data-slimstat-tracking")&&"undefined"!=typeof e.attributes.rel&&e.attributes.rel.value&&(SlimStat.in_array_substring(e.attributes.rel.value,b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(e.attributes.rel.value,c)&&e.setAttribute("data-slimstat-tracking","false")),"true"==e.getAttribute("data-slimstat-tracking")&&"undefined"!=typeof e.href&&e.href&&(SlimStat.in_array_substring(e.href,b)&&e.setAttribute("data-slimstat-callback","false"),SlimStat.in_array_substring(e.href,c)&&e.setAttribute("data-slimstat-tracking","false")),extension_current_link=e.pathname.split(/[?#]/)[0].split(".").pop().replace(/[\/\-]/g,""),a.length>0&&2==e.getAttribute("data-slimstat-type")&&SlimStat.in_array(extension_current_link,a)&&(e.setAttribute("data-slimstat-tracking","true"),e.setAttribute("data-slimstat-type",1)),"true"==e.getAttribute("data-slimstat-tracking")&&e.target&&!e.target.match(/^_(self|parent|top)$/i)&&e.setAttribute("data-slimstat-callback","false"),"false"==e.getAttribute("data-slimstat-tracking")&&e.setAttribute("data-slimstat-callback","false"),SlimStat.add_event(e,"click",function(a){if("true"==this.getAttribute("data-slimstat-tracking")&&"false"==this.getAttribute("data-slimstat-clicked")){if("true"==this.getAttribute("data-slimstat-callback"))return this.setAttribute("data-slimstat-clicked","true"),function(a,b){SlimStat.ss_track(b,a.getAttribute("data-slimstat-type"),"",function(){SlimStat.event_fire(a,b)},"true"==a.getAttribute("data-slimstat-callback"))}(this,a),!1;SlimStat.ss_track(a,this.getAttribute("data-slimstat-type"),"",function(){},"true"==this.getAttribute("data-slimstat-callback"))}else"true"==this.getAttribute("data-slimstat-clicked")&&this.setAttribute("data-slimstat-clicked","false")})}});var slimstat_data="action=slimtrack",use_beacon=!1;"undefined"!=typeof SlimStatParams.id&&parseInt(SlimStatParams.id)>0?(slimstat_data+="&op=update&id="+SlimStatParams.id,use_beacon=!0):"undefined"!=typeof SlimStatParams.ci?slimstat_data+="&op=add&id="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href):slimstat_data="",slimstat_data.length>0&&SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(slimstat_data,"",use_beacon)},0)}),"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});
|
wp-slimstat.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Slim Stat Analytics
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
-
Version: 4.6.
|
7 |
Author: Jason Crouse
|
8 |
Author URI: http://www.wp-slimstat.com/
|
9 |
Text Domain: wp-slimstat
|
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$settings ) ) {
|
|
15 |
}
|
16 |
|
17 |
class wp_slimstat {
|
18 |
-
public static $version = '4.6.
|
19 |
public static $settings = array();
|
20 |
public static $options = array(); // To be removed, here just for backward compatibility
|
21 |
|
@@ -1306,6 +1306,7 @@ class wp_slimstat {
|
|
1306 |
|
1307 |
case 'platform':
|
1308 |
$output[ $result_idx ][ $a_column ] .= __( $a_result[ $a_column ], 'wp-slimstat' );
|
|
|
1309 |
|
1310 |
case 'post_link':
|
1311 |
$post_id = url_to_postid( $a_result[ 'resource' ] );
|
@@ -1355,12 +1356,14 @@ class wp_slimstat {
|
|
1355 |
if ( $_turn_on && !empty( self::$date_i18n_filters ) && is_array( self::$date_i18n_filters ) ) {
|
1356 |
foreach ( self::$date_i18n_filters as $i18n_priority => $i18n_func_list ) {
|
1357 |
foreach ( $i18n_func_list as $func_name => $func_args ) {
|
1358 |
-
|
|
|
|
|
1359 |
}
|
1360 |
}
|
1361 |
}
|
1362 |
-
else if ( !empty( $GLOBALS[ 'wp_filter' ][ 'date_i18n' ] ) ) {
|
1363 |
-
self::$date_i18n_filters = $GLOBALS[ 'wp_filter' ][ 'date_i18n' ];
|
1364 |
remove_all_filters( 'date_i18n' );
|
1365 |
}
|
1366 |
}
|
@@ -1390,8 +1393,6 @@ class wp_slimstat {
|
|
1390 |
'auto_purge_delete' => 'yes',
|
1391 |
|
1392 |
// Tracker
|
1393 |
-
'enable_outbound_tracking' => 'yes',
|
1394 |
-
'track_internal_links' => 'no',
|
1395 |
'ignore_outbound_classes_rel_href' => '',
|
1396 |
'do_not_track_outbound_classes_rel_href' => 'noslimstat,ab-item',
|
1397 |
'track_same_domain_referers' => 'no',
|
@@ -1493,12 +1494,6 @@ class wp_slimstat {
|
|
1493 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
1494 |
);
|
1495 |
|
1496 |
-
if ( self::$settings[ 'enable_outbound_tracking' ] == 'no' ) {
|
1497 |
-
$params[ 'disable_outbound_tracking' ] = 'true';
|
1498 |
-
}
|
1499 |
-
if ( self::$settings[ 'track_internal_links' ] == 'yes' ) {
|
1500 |
-
$params[ 'track_internal_links' ] = 'true';
|
1501 |
-
}
|
1502 |
if ( !empty( self::$settings[ 'extensions_to_track' ] ) ) {
|
1503 |
$params[ 'extensions_to_track' ] = str_replace( ' ', '', self::$settings[ 'extensions_to_track' ] );
|
1504 |
}
|
@@ -1616,7 +1611,15 @@ class slimstat_widget extends WP_Widget {
|
|
1616 |
*/
|
1617 |
public function widget( $args, $instance ) {
|
1618 |
extract( $instance );
|
1619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1620 |
}
|
1621 |
|
1622 |
/**
|
3 |
Plugin Name: Slim Stat Analytics
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
+
Version: 4.6.2
|
7 |
Author: Jason Crouse
|
8 |
Author URI: http://www.wp-slimstat.com/
|
9 |
Text Domain: wp-slimstat
|
15 |
}
|
16 |
|
17 |
class wp_slimstat {
|
18 |
+
public static $version = '4.6.2';
|
19 |
public static $settings = array();
|
20 |
public static $options = array(); // To be removed, here just for backward compatibility
|
21 |
|
1306 |
|
1307 |
case 'platform':
|
1308 |
$output[ $result_idx ][ $a_column ] .= __( $a_result[ $a_column ], 'wp-slimstat' );
|
1309 |
+
break;
|
1310 |
|
1311 |
case 'post_link':
|
1312 |
$post_id = url_to_postid( $a_result[ 'resource' ] );
|
1356 |
if ( $_turn_on && !empty( self::$date_i18n_filters ) && is_array( self::$date_i18n_filters ) ) {
|
1357 |
foreach ( self::$date_i18n_filters as $i18n_priority => $i18n_func_list ) {
|
1358 |
foreach ( $i18n_func_list as $func_name => $func_args ) {
|
1359 |
+
if ( !empty( $func_args[ 'function' ] ) && is_string( $func_args[ 'function' ] ) ) {
|
1360 |
+
add_filter( 'date_i8n', $func_args[ 'function' ], $i18n_priority, intval( $func_args[ 'accepted_args' ] ) );
|
1361 |
+
}
|
1362 |
}
|
1363 |
}
|
1364 |
}
|
1365 |
+
else if ( !empty( $GLOBALS[ 'wp_filter' ][ 'date_i18n' ][ 'callbacks' ] ) && is_array( $GLOBALS[ 'wp_filter' ][ 'date_i18n' ][ 'callbacks' ] ) ) {
|
1366 |
+
self::$date_i18n_filters = $GLOBALS[ 'wp_filter' ][ 'date_i18n' ][ 'callbacks' ];
|
1367 |
remove_all_filters( 'date_i18n' );
|
1368 |
}
|
1369 |
}
|
1393 |
'auto_purge_delete' => 'yes',
|
1394 |
|
1395 |
// Tracker
|
|
|
|
|
1396 |
'ignore_outbound_classes_rel_href' => '',
|
1397 |
'do_not_track_outbound_classes_rel_href' => 'noslimstat,ab-item',
|
1398 |
'track_same_domain_referers' => 'no',
|
1494 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
1495 |
);
|
1496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1497 |
if ( !empty( self::$settings[ 'extensions_to_track' ] ) ) {
|
1498 |
$params[ 'extensions_to_track' ] = str_replace( ' ', '', self::$settings[ 'extensions_to_track' ] );
|
1499 |
}
|
1611 |
*/
|
1612 |
public function widget( $args, $instance ) {
|
1613 |
extract( $instance );
|
1614 |
+
|
1615 |
+
$slimstat_widget_filters = empty( $slimstat_widget_filters ) ? '' : $slimstat_widget_filters;
|
1616 |
+
|
1617 |
+
if ( !empty( $slimstat_widget_id ) ) {
|
1618 |
+
echo do_shortcode( "[slimstat f='widget' w='{$slimstat_widget_id}']{$slimstat_widget_filters}[/slimstat]" );
|
1619 |
+
}
|
1620 |
+
else {
|
1621 |
+
echo '';
|
1622 |
+
}
|
1623 |
}
|
1624 |
|
1625 |
/**
|