Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/82868


Change subject: Turn off HTTPS capability testing for now
......................................................................

Turn off HTTPS capability testing for now

The first round of data collection has concluded and the data is no longer
actively being monitored, so I'm turning it off for now. I checked in with
Dario to confirm.

Change-Id: Ieb31bc46643f7b771a3265de16bb3522380cd3ca
---
M CoreEvents.php
D modules/ext.coreEvents.httpsSupport.js
2 files changed, 0 insertions(+), 107 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CoreEvents 
refs/changes/68/82868/1

diff --git a/CoreEvents.php b/CoreEvents.php
index d722783..e012ada 100644
--- a/CoreEvents.php
+++ b/CoreEvents.php
@@ -32,42 +32,6 @@
 // Configs
 
 /**
- * @var int|bool: Conduct & log test for HTTPS support once per this
- *                many (non-HTTPS) requests.
- */
-$wgHttpsFeatureDetectionSamplingFactor = 2500;
-
-$wgResourceModules += array(
-       'schema.HttpsSupport' => array(
-               'class'         => 'ResourceLoaderSchemaModule',
-               'schema'        => 'HttpsSupport',
-               'revision'      => 5733378,
-               'targets'       => array( 'desktop', 'mobile' ),
-               'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
-       ),
-       'ext.coreEvents.httpsSupport' => array(
-               'scripts'       => 'ext.coreEvents.httpsSupport.js',
-               'localBasePath' => __DIR__ . '/modules',
-               'remoteExtPath' => 'CoreEvents/modules',
-               'dependencies'  => 'schema.HttpsSupport',
-               'targets'       => array( 'desktop', 'mobile' ),
-               'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
-       ),
-);
-
-// Hooks
-
-$wgHooks[ 'BeforePageDisplay' ][] = function ( &$out, &$skin ) {
-       $out->addModules( array( 'schema.HttpsSupport', 
'ext.coreEvents.httpsSupport' ) );
-       return true;
-};
-
-$wgHooks[ 'ResourceLoaderGetConfigVars' ][] = function ( &$vars ) {
-       global $wgHttpsFeatureDetectionSamplingFactor;
-       $vars[ 'wgHttpsFeatureDetectionSamplingFactor' ] = 
$wgHttpsFeatureDetectionSamplingFactor;
-};
-
-/**
  * Log server-side event on successful page edit.
  * @see https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
  * @see https://meta.wikimedia.org/wiki/Schema:PageContentSaveComplete
diff --git a/modules/ext.coreEvents.httpsSupport.js 
b/modules/ext.coreEvents.httpsSupport.js
deleted file mode 100644
index fee3b94..0000000
--- a/modules/ext.coreEvents.httpsSupport.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*global Geo */
-/**
- * JavaScript module for HTTPS feature detection.
- * Detects HTTPS support by firing two requests for the same resource
- * using HTTP for one and HTTPS by other and logs results.
- *
- * @licence GNU GPL v2 or later
- * @author Ori Livneh <[email protected]>
- */
-( function ( mw, $ ) {
-       'use strict';
-
-       var pixelSrc = 
'//upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif';
-
-       function inSample() {
-               var factor = mw.config.get( 
'wgHttpsFeatureDetectionSamplingFactor' );
-               if ( !$.isNumeric( factor ) || factor < 1 ) {
-                       return false;
-               }
-               if ( mw.config.get( 'wgUserId' ) !== null ) {
-                       factor /= 10;
-               }
-               return Math.floor( Math.random() * factor ) === 0;
-       }
-
-       function pingProtocol( proto, timeout ) {
-               var $beacon = $( '<img />' ),
-                       defer = $.Deferred();
-
-               $beacon.on( 'load error abort timeout', defer.resolveWith );
-               setTimeout( function () {
-                       $beacon.trigger( $.Event( 'timeout' ) );
-               }, timeout || 5000 );
-               $beacon.attr( 'src', proto + ':' + pixelSrc + '?' + new Date() 
);
-
-               return defer.then( function () {
-                       var ok = this.type === 'load' && $beacon.prop( 'width' 
) === 1;
-                       return ok ? 'success' : this.type;
-               } );
-       }
-
-       // Log only if user is using HTTP and is included in the random sample.
-       if ( window.location.protocol !== 'https:' && inSample() ) {
-               mw.loader.using( 'schema.HttpsSupport', function () {
-                       $.when(
-                               pingProtocol( 'http' ),
-                               pingProtocol( 'https' )
-                       ).done( function ( httpStatus, httpsStatus ) {
-                               var event = {
-                                       httpStatus  : httpStatus,
-                                       httpsStatus : httpsStatus,
-                                       isAnon      : mw.config.get( 'wgUserId' 
) === null,
-                                       userAgent   : navigator.userAgent
-                               };
-                               if ( mw.mobileFrontend && mw.config.exists( 
'wgMFMode' ) ) {
-                                       event.mobileMode = mw.config.get( 
'wgMFMode' );
-                               }
-                               if ( $.isPlainObject( window.Geo ) ) {
-                                       if ( typeof Geo.country === 'string' && 
Geo.country.length ) {
-                                               event.originCountry = 
Geo.country;
-                                       }
-                                       if ( typeof Geo.city === 'string' && 
Geo.city.length ) {
-                                               event.originCity = Geo.city;
-                                       }
-                               }
-                               mw.eventLog.logEvent( 'HttpsSupport', event );
-                       } );
-               } );
-       }
-
-} ( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/82868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb31bc46643f7b771a3265de16bb3522380cd3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CoreEvents
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to