Changeset 2133590
- Timestamp:
- 08/04/2019 11:26:15 AM (7 years ago)
- Location:
- clickervolt/trunk
- Files:
-
- 10 edited
-
admin/js/stats.js (modified) (1 diff)
-
admin/reporting/handlers/handlerBase.php (modified) (4 diffs)
-
admin/reporting/handlers/handlerClicks.php (modified) (8 diffs)
-
admin/reporting/segment.php (modified) (3 diffs)
-
admin/views/dashboard.php (modified) (3 diffs)
-
admin/views/dashboardTabReports.php (modified) (1 diff)
-
clickervolt.php (modified) (1 diff)
-
db/db.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
redirect/jsTracking/js/cvTrack.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clickervolt/trunk/admin/js/stats.js
r2129157 r2133590 933 933 var suspiciousScoreSum = row['suspiciousScoreSum']; 934 934 var suspiciousTrafficRate = clicks > 0 935 ? parseInt(suspiciousScoreSum / clicks)935 ? Math.min(100, parseInt(suspiciousScoreSum / clicks)) 936 936 : null; 937 937 -
clickervolt/trunk/admin/reporting/handlers/handlerBase.php
r2080903 r2133590 5 5 require_once __DIR__ . '/handler.php'; 6 6 7 class HandlerBase extends Handler {8 7 class HandlerBase extends Handler 8 { 9 9 /** 10 10 * 11 11 * @return [] (first element is for 'select from', others are for joins - the ones for joins must include the join clause) 12 12 */ 13 protected function getTableNames( $request ) {14 13 protected function getTableNames($request) 14 { 15 15 $table = new \ClickerVolt\TableStatsBase(); 16 return [ $table->getName()];16 return [$table->getName()]; 17 17 } 18 18 … … 21 21 * @return [] 22 22 */ 23 protected function getMapper( $request ) {24 23 protected function getMapper($request) 24 { 25 25 $timestampCol = $this->getTimestampColumn(); 26 26 … … 41 41 self::MAP_SELECT => "concat(date_format(from_unixtime({$timestampCol}), '%H'), ':00-', date_format(from_unixtime(3600 + {$timestampCol}), '%H'), ':00')" 42 42 ], 43 44 Segment::TYPE_SUSPICIOUS_VS_CLEAN => [ 45 self::MAP_SELECT => "if( suspiciousScoreSum = 0, 'All Clean', 'Suspicious' )" 46 ], 47 48 Segment::TYPE_SUSPICIOUS_BUCKETS => [ 49 self::MAP_SELECT => "case 50 when suspiciousScoreSum = 0 then 'All Clean' 51 when (suspiciousScoreSum / clicks) <= 25 then '1 to 25%' 52 when (suspiciousScoreSum / clicks) <= 50 then '26 to 50%' 53 when (suspiciousScoreSum / clicks) <= 75 then '51 to 75%' 54 when (suspiciousScoreSum / clicks) <= 99 then '76 to 99%' 55 when (suspiciousScoreSum / clicks) >= 100 then '100% Suspicious' 56 else null 57 end" 58 ], 43 59 ]; 44 60 … … 49 65 * 50 66 */ 51 protected function formatValue( $value, $segmentType ) {52 53 switch ( $segmentType) {67 protected function formatValue($value, $segmentType) 68 { 69 switch ($segmentType) { 54 70 55 71 case Segment::TYPE_TIME_DAY_OF_WEEK: { 56 72 57 $dayToString = [58 1 => 'Sunday',59 2 => 'Monday',60 3 => 'Tuesday',61 4 => 'Wednesday',62 5 => 'Thursday',63 6 => 'Friday',64 7 => 'Saturday',65 ];73 $dayToString = [ 74 1 => 'Sunday', 75 2 => 'Monday', 76 3 => 'Tuesday', 77 4 => 'Wednesday', 78 5 => 'Thursday', 79 6 => 'Friday', 80 7 => 'Saturday', 81 ]; 66 82 67 if( !empty($dayToString[$value]) ) { 68 $value = $dayToString[$value]; 83 if (!empty($dayToString[$value])) { 84 $value = $dayToString[$value]; 85 } 69 86 } 70 } 71 break; 87 break; 72 88 73 89 default: 74 $value = parent::formatValue( $value, $segmentType);90 $value = parent::formatValue($value, $segmentType); 75 91 break; 76 92 } -
clickervolt/trunk/admin/reporting/handlers/handlerClicks.php
r2080903 r2133590 7 7 use ClickerVolt\TableURLsPaths; 8 8 9 class HandlerClicks extends HandlerWholePath {10 9 class HandlerClicks extends HandlerWholePath 10 { 11 11 /** 12 12 * 13 13 * @return [] (first element is for 'select from', others are for joins - the ones for joins must include the join clause) 14 14 */ 15 protected function getTableNames( $request ) {16 15 protected function getTableNames($request) 16 { 17 17 $tableClicksName = (new \ClickerVolt\TableClicks())->getName(); 18 18 $tableAIDsName = (new \ClickerVolt\TableAIDs())->getName(); … … 27 27 ]; 28 28 29 $mapper = $this->getMapper( $request);29 $mapper = $this->getMapper($request); 30 30 $devicesTableNeeded = false; 31 31 $geosTableNeeded = false; 32 32 $referrersTableNeeded = false; 33 33 34 foreach ( $request->segments as $segment) {35 if ( strpos($mapper[$segment->getType()][self::MAP_SELECT], 'devices.') !== false) {34 foreach ($request->segments as $segment) { 35 if (strpos($mapper[$segment->getType()][self::MAP_SELECT], 'devices.') !== false) { 36 36 $devicesTableNeeded = true; 37 37 } 38 if ( strpos($mapper[$segment->getType()][self::MAP_SELECT], 'geos.') !== false) {38 if (strpos($mapper[$segment->getType()][self::MAP_SELECT], 'geos.') !== false) { 39 39 $geosTableNeeded = true; 40 40 } 41 if ( strpos($mapper[$segment->getType()][self::MAP_SELECT], 'ref.') !== false) {41 if (strpos($mapper[$segment->getType()][self::MAP_SELECT], 'ref.') !== false) { 42 42 $referrersTableNeeded = true; 43 43 } 44 44 } 45 45 46 if ( $devicesTableNeeded) {46 if ($devicesTableNeeded) { 47 47 $tableDevices = new \ClickerVolt\TableDevices(); 48 48 $tables[] = $tableDevices->getName() . " as devices on devices.deviceHash = {$tableClicksName}.deviceHash"; 49 49 } 50 50 51 if ( $geosTableNeeded) {51 if ($geosTableNeeded) { 52 52 $tableGeos = new \ClickerVolt\TableGeos(); 53 53 $tables[] = $tableGeos->getName() . " as geos on geos.geoHash = {$tableClicksName}.geoHash"; 54 54 } 55 55 56 if ( $referrersTableNeeded) {56 if ($referrersTableNeeded) { 57 57 $tableReferrers = new \ClickerVolt\TableReferrers(); 58 58 $tables[] = $tableReferrers->getName() . " as ref on ref.referrerHash = {$tableClicksName}.referrerHash"; 59 59 } 60 60 61 if ( $request->isSegmentPresent( Segment::TYPE_FUNNEL_LINK )) {61 if ($request->isSegmentPresent(Segment::TYPE_FUNNEL_LINK)) { 62 62 63 63 $tableURLsPaths = new TableURLsPaths(); … … 72 72 * 73 73 */ 74 protected function formatValue( $value, $segmentType ) {75 76 $value = parent::formatValue( $value, $segmentType);74 protected function formatValue($value, $segmentType) 75 { 76 $value = parent::formatValue($value, $segmentType); 77 77 78 78 $otherHandlers = []; … … 80 80 $otherHandlers[] = new HandlerWholePathGeos(); 81 81 $otherHandlers[] = new HandlerWholePathReferrers(); 82 foreach ( $otherHandlers as $handler) {83 $value = $handler->formatValue( $value, $segmentType);82 foreach ($otherHandlers as $handler) { 83 $value = $handler->formatValue($value, $segmentType); 84 84 } 85 85 … … 90 90 * 91 91 */ 92 protected function getTimestampColumn() { 92 protected function getTimestampColumn() 93 { 93 94 return "timestamp"; 94 95 } … … 97 98 * 98 99 */ 99 protected function getSQLMetrics( $request ) {100 100 protected function getSQLMetrics($request) 101 { 101 102 $table = new \ClickerVolt\TableClicks(); 102 103 $tname = $table->getName(); … … 117 118 * @return [] 118 119 */ 119 protected function getMapper( $request ) { 120 protected function getMapper($request) 121 { 122 $mapper = [ 123 Segment::TYPE_SUSPICIOUS_VS_CLEAN => [ 124 self::MAP_SELECT => "n/a" // too slow - return unknown 125 ], 120 126 121 $mapper = [ 127 Segment::TYPE_SUSPICIOUS_BUCKETS => [ 128 self::MAP_SELECT => "n/a" // too slow - return unknown 129 ], 122 130 123 131 Segment::TYPE_IP_RANGE_C => [ … … 178 186 $handleReferrers = new HandlerWholePathReferrers(); 179 187 180 return array_merge( 181 $handleDevices->getMapper($request), 182 $handleGeos->getMapper($request), 183 $handleReferrers->getMapper($request), 184 parent::getMapper($request), 185 $mapper ); 188 return array_merge( 189 $handleDevices->getMapper($request), 190 $handleGeos->getMapper($request), 191 $handleReferrers->getMapper($request), 192 parent::getMapper($request), 193 $mapper 194 ); 186 195 } 187 196 } -
clickervolt/trunk/admin/reporting/segment.php
r2080903 r2133590 3 3 namespace ClickerVolt\Reporting; 4 4 5 class Segment {6 5 class Segment 6 { 7 7 const TYPE_EMPTY = 'Empty'; 8 8 const TYPE_CLICK_ID = 'Click ID'; … … 10 10 const TYPE_FUNNEL_LINK = 'Funnel Links'; 11 11 const TYPE_SOURCE = 'Source'; 12 const TYPE_SUSPICIOUS_VS_CLEAN = 'Suspicious VS Clean'; 13 const TYPE_SUSPICIOUS_BUCKETS = 'Suspicious Buckets'; 12 14 const TYPE_URL = 'URL'; 13 15 const TYPE_DEVICE_TYPE = 'Device Type'; … … 59 61 ]; 60 62 61 function __construct( $type, $filter = null ) { 63 function __construct($type, $filter = null) 64 { 62 65 $this->type = $type; 63 66 $this->filter = $filter !== '' ? $filter : null; 64 67 } 65 68 66 function getType() { 69 function getType() 70 { 67 71 return $this->type; 68 72 } 69 73 70 function getFilter() { 74 function getFilter() 75 { 71 76 return $this->filter; 72 77 } 73 78 74 function isVar() { 75 return in_array( $this->getType(), self::VAR_TYPES ); 79 function isVar() 80 { 81 return in_array($this->getType(), self::VAR_TYPES); 76 82 } 77 83 -
clickervolt/trunk/admin/views/dashboard.php
r2129157 r2133590 581 581 break; 582 582 583 case "Source > Suspicious VS Clean": 584 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SOURCE); 585 jQuery("#segment2").val(clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_VS_CLEAN); 586 break; 587 588 case "Source > Suspicious Buckets": 589 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SOURCE); 590 jQuery("#segment2").val(clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_BUCKETS); 591 break; 592 583 593 case "Source > V1": 584 594 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SOURCE); … … 697 707 jQuery("#segment2").val(clickerVoltVars.const.ReportingSegments.TYPE_URL); 698 708 jQuery("#segment3").val(clickerVoltVars.const.ReportingSegments.TYPE_FUNNEL_LINK); 709 break; 710 711 case "Source > Suspicious VS Clean > Funnel Links": 712 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SOURCE); 713 jQuery("#segment2").val(clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_VS_CLEAN); 714 jQuery("#segment3").val(clickerVoltVars.const.ReportingSegments.TYPE_FUNNEL_LINK); 715 break; 716 717 case "Suspicious VS Clean": 718 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_VS_CLEAN); 719 break; 720 721 case "Suspicious Buckets": 722 jQuery("#segment1").val(clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_BUCKETS); 699 723 break; 700 724 … … 817 841 clickerVoltVars.const.ReportingSegments.TYPE_FUNNEL_LINK, 818 842 clickerVoltVars.const.ReportingSegments.TYPE_SOURCE, 843 clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_VS_CLEAN, 844 clickerVoltVars.const.ReportingSegments.TYPE_SUSPICIOUS_BUCKETS, 819 845 clickerVoltVars.const.ReportingSegments.TYPE_URL, 820 846 clickerVoltVars.const.ReportingSegments.TYPE_DEVICE_TYPE, -
clickervolt/trunk/admin/views/dashboardTabReports.php
r2129157 r2133590 4 4 5 5 <div class="stat-buttons-shortcuts"> 6 <button class="button stat-button" list="Funnel Links|Funnel Links > URL|Source > Funnel Links|Source > URL > Funnel Links ">Funnel Links</button>7 <button class="button stat-button" list="Source|Source > URL|Source > V1|Source > V2|Source > V3|Source > V4|Source > V5|Source > V6|Source > V7|Source > V8|Source > V9|Source > V10">Source</button>6 <button class="button stat-button" list="Funnel Links|Funnel Links > URL|Source > Funnel Links|Source > URL > Funnel Links|Source > Suspicious VS Clean > Funnel Links">Funnel Links</button> 7 <button class="button stat-button" list="Source|Source > Suspicious VS Clean|Source > Suspicious Buckets|Source > URL|Source > V1|Source > V2|Source > V3|Source > V4|Source > V5|Source > V6|Source > V7|Source > V8|Source > V9|Source > V10">Source</button> 8 8 <button class="button stat-button" list="V1|V2|V3|V4|V5|V6|V7|V8|V9|V10">Source Vars</button> 9 <button class="button stat-button" list="Suspicious VS Clean|Suspicious Buckets">Suspicious Traffic</button> 9 10 <button class="button stat-button">URL</button> 10 11 <button class="button stat-button" list="Device Type|Device Brand|Device Name">Device</button> -
clickervolt/trunk/clickervolt.php
r2133010 r2133590 5 5 * Plugin URI: https://clickervolt.com/ 6 6 * Description: Advanced click tracking, link cloaking and affiliate campaigns management made easy. 7 * Version: 1.12 57 * Version: 1.126 8 8 * Author: ClickerVolt.com 9 9 * License: GPLv3 -
clickervolt/trunk/db/db.php
r2133010 r2133590 11 11 class DB 12 12 { 13 const VERSION = 1.12 5;13 const VERSION = 1.126; 14 14 15 15 const OPTION_VERSION = 'clickervolt-version'; -
clickervolt/trunk/readme.txt
r2133010 r2133590 1 1 === ClickerVolt - Advanced Click + Link Tracking for Affiliates === 2 Contributors: clickervolt 2 Contributors: clickervolt, freemius 3 3 Tags: affiliate, tracker, link, tracking, click, shortlink, url, page cloaker, link cloaker, cloaker, cloaking, redirect, redirection, drilldown, stats, statistics, marketing, aida 4 4 Requires at least: 4.9 … … 263 263 264 264 == Changelog == 265 = 1.126 = 266 * Added new "suspicious" related segments in reporting tab 267 265 268 = 1.125 = 266 269 * Removed Peerfly affiliate network template (they stopped business) -
clickervolt/trunk/redirect/jsTracking/js/cvTrack.js
r2133010 r2133590 25 25 referrer: CVTrack.getReferrer(), 26 26 }; 27 28 window.addEventListener("beforeunload", function () { 29 // We force that the page must be seen at least 3 seconds to 30 // be sure the remote tracking has a chance to be triggered... 31 var minTimeOnPage = 3; 32 do { 33 var curTime = Date.now() / 1000; 34 } while (curTime < (window.clickerVolt.timeOnPageStart + minTimeOnPage)); 35 }); 27 36 } 28 37 … … 168 177 if (callback) { 169 178 request.onreadystatechange = function () { 170 if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { 179 // We don't use XMLHttpRequest.DONE anymore because 180 // some libs override the XMLHttpRequest object. 181 var DONE = 4; 182 if (this.readyState === DONE && this.status === 200) { 171 183 callback(this.response); 172 184 }
Note: See TracChangeset
for help on using the changeset viewer.