Changeset 2088935
- Timestamp:
- 05/16/2019 08:16:24 AM (7 years ago)
- Location:
- matomo-tracker
- Files:
-
- 6 edited
-
assets/icon-128x128.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/inc/frontend/class-frontend.php (modified) (1 diff)
-
trunk/inc/frontend/piwik.php (modified) (1 diff)
-
trunk/matomo-tracker.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
matomo-tracker/trunk/README.txt
r1957367 r2088935 4 4 Tags: matomo, piwik, analytics, tracking code 5 5 Requires at least: 3.0.1 6 Tested up to: 4.9.86 Tested up to: 5.2 7 7 Requires PHP: 5.6.0 8 Stable tag: 1. 2.38 Stable tag: 1.3.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 * Added an option to disable logged-in users tracking 71 71 72 = 1. 2.3=72 = 1.3.0 = 73 73 * Fixed track.js loading in header 74 75 = 1.3.0 = 76 * Fixed tracking issue for subfolder install -
matomo-tracker/trunk/inc/frontend/class-frontend.php
r1957367 r2088935 128 128 echo '<!-- MATOMO TRACKING CODE DISABLED FOR '. get_option( $this->plugin_name.'-users-auth' ) .' USERS -->'; 129 129 } 130 /*131 private function update_tracker_settings() {132 if ( get_option( $this->plugin_name.'-tracking-mode' ) != 'php' && !empty(get_option( $this->plugin_name.'-url' )) && !empty(get_option( $this->plugin_name.'-tracking-id' )) && !empty(get_option( $this->plugin_name.'-token' )) ) {133 $piwikJsFile = plugin_dir_url( __FILE__ ) . 'track.js';134 file_put_contents($piwikJsFile, $this->get_javascript_tracking_code());135 }136 }137 */138 139 140 141 142 130 143 131 private function get_javascript_tracking_code() { 144 132 $currentDomain = get_site_url(); 133 $parse = parse_url($currentDomain); 145 134 $piwikFileDir = str_replace($currentDomain, "", plugin_dir_url( __FILE__ ) ); 135 if (!empty($parse['path'])) $piwikFileDir = $parse['path'] . $piwikFileDir; 146 136 $currentDomain = preg_replace("(^https?:)", "", $currentDomain ); 147 137 $piwikId = get_option( $this->plugin_name.'-tracking-id' ); 148 138 update_option( $this->plugin_name.'-frontend', plugin_dir_url( __FILE__ ) ); 149 return 'var _paq = _paq || []; _paq.push(["trackPageView"]);_paq.push(["enableLinkTracking"]);(function() {var u="'. $currentDomain .'";var v= "'. $piwikFileDir .'";_paq.push(["setTrackerUrl", u+v+"piwik.php"]); _paq.push(["setSiteId", "'. $piwikId .'"]);var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+v+"piwik.php";console.log(u+v+"piwik.php"); s.parentNode.insertBefore(g,s);})();'; 150 /* 151 return 'var _paq = _paq || []; _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function() {var u="'. $piwikFileDir .'piwik.php"; _paq.push(["setTrackerUrl", u]); _paq.push(["setSiteId", "'. $piwikId .'"]); var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; g.async=true; g.defer=true; g.src=u; s.parentNode.insertBefore(g,s); })();'; 152 */ 139 return 'var _paq = _paq || []; _paq.push(["trackPageView"]);_paq.push(["enableLinkTracking"]);(function() {var u="'. $currentDomain .'";var v= "'. $piwikFileDir .'";_paq.push(["setTrackerUrl", u+v+"piwik.php"]); _paq.push(["setSiteId", "'. $piwikId .'"]);var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+v+"piwik.php";s.parentNode.insertBefore(g,s);})();'; 153 140 } 154 155 141 156 142 public function disallow_javascript_tracking( $output, $public ) { -
matomo-tracker/trunk/inc/frontend/piwik.php
r1949242 r2088935 15 15 define( 'WP_USE_THEMES', false ); 16 16 $root = $_SERVER['DOCUMENT_ROOT']; 17 $file = $_SERVER['REQUEST_URI']; 18 if (strpos($file, '/wp-content') !== 0) {//CHECK FOR SUBFOLDER INSTALL 19 $dirs = explode("/", $file); 20 foreach ($dirs as $dir) { 21 if($dir === 'wp-content') break; 22 $root = rtrim($root, '/'); 23 $root .= '/'.$dir; 24 } 25 } 17 26 require_once($root.'/wp-load.php'); 18 27 include_once($root.'/wp-admin/includes/plugin.php' ); -
matomo-tracker/trunk/matomo-tracker.php
r1957367 r2088935 16 16 * Plugin URI: https://wordpress.org/plugins/matomo-tracker/ 17 17 * Description: Matomo tracker adds matomo (formerly piwik) tracking code to your website while hiding your matomo installation url 18 * Version: 1. 2.318 * Version: 1.3.0 19 19 * Author: Niroma 20 20 * Author URI: https://www.niroma.net/ … … 40 40 define( NS . 'PLUGIN_NAME', 'matomo-tracker' ); 41 41 42 define( NS . 'PLUGIN_VERSION', '1. 2.3' );42 define( NS . 'PLUGIN_VERSION', '1.3.0' ); 43 43 44 44 define( NS . 'PLUGIN_NAME_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.