-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor JS snippet to use WP AJAX (#109)
* Refactored JS tracking to use WP AJAX The custom GET request intercepts normal page generation and might trigger other plugins' actions before Statify is loaded. It also provided an open door for lightweight malicious requests targeting the statistics. Using WP AJAX including Nonce verification reduces both problems. * Move sanitization of target and referrer out of if-else block * Reset AJAX request from jQuery back to vanilla JS with XmlHttpRequest * Remove superflous sanitization in pre-sanitized var in target filter * rework target and referrer sanitization again * Use minifed version of the snippet, set version to 1.7.0 (consistent with the PHPDoc) Co-authored-by: Patrick Robrecht <[email protected]>
- Loading branch information
1 parent
2ab4a90
commit 71c4680
Showing
7 changed files
with
74 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
}, | ||
"globals": { | ||
"Chartist": "readonly", | ||
"statify_ajax": "readonly", | ||
"statify_translations": "readonly" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.