WP YouTube Lyte - Version 1.1.6

Version Description

  • bugfix: remove noscript-stuff from the_excerpt as requested by wordpressvoxbox13
  • bugfix: switch HTTPS detection to is_ssl() WordPress function to avoid breakage on MS IIS
  • removed the "DoNotTrack" bonus feature due to added complexity, at least one bug and the fact that WP DoNotTrack does a better job at this
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 WP YouTube Lyte
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

external/donottrack-min.js DELETED
@@ -1 +0,0 @@
1
- function sanitizer(a){a=a.toLowerCase();if(mode==="blacklist"){for(x in list["black"]){if(a.indexOf(list["black"][x].toLowerCase())!==-1){a=true;break}}}else{for(x in list["white"]){if(a.indexOf(list["white"][x].toLowerCase())!==-1){tmpS=false;break}else{tmpS=true}}if(tmpS===true)a=tmpS}return a}function aop_around(a,b){aop.around({target:a,method:b},function(a){if(typeof a.arguments[0].src==="string"&&(a.arguments[0].tagName.toLowerCase()==="script"||a.arguments[0].tagName.toLowerCase()==="img"||a.arguments[0].tagName.toLowerCase()==="iframe")){if(sanitizer(a.arguments[0].src)===true){a.arguments[0].src="javascript:void(0)"}}return a.proceed()})}(function(){var _after=1;var _afterThrow=2;var _afterFinally=3;var _before=4;var _around=5;var _intro=6;var _regexEnabled=true;var _arguments="arguments";var _undef="undefined";var getType=function(){var a=Object.prototype.toString,b={},c={1:"element",3:"textnode",9:"document",11:"fragment"},d="Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window".split(" ");for(var e=d.length;e--;){var f=d[e],g=window[f];if(g){try{b[a.call(new g)]=f.toLowerCase()}catch(h){}}}return function(d){return d==null&&(d===undefined?_undef:"null")||d.nodeType&&c[d.nodeType]||typeof d.length=="number"&&(d.callee&&_arguments||d.alert&&"window"||d.item&&"nodelist")||b[a.call(d)]}}();var isFunc=function(a){return getType(a)=="function"};var weaveOne=function(source,method,advice){var old=source[method];if(advice.type!=_intro&&!isFunc(old)){var oldObject=old;old=function(){var code=arguments.length>0?_arguments+"[0]":"";for(var i=1;i<arguments.length;i++){code+=","+_arguments+"["+i+"]"}return eval("oldObject("+code+");")}}var aspect;if(advice.type==_after||advice.type==_afterThrow||advice.type==_afterFinally)aspect=function(){var a,b=null;try{a=old.apply(this,arguments)}catch(c){b=c}if(advice.type==_after)if(b==null)a=advice.value.apply(this,[a,method]);else throw b;else if(advice.type==_afterThrow&&b!=null)a=advice.value.apply(this,[b,method]);else if(advice.type==_afterFinally)a=advice.value.apply(this,[a,b,method]);return a};else if(advice.type==_before)aspect=function(){advice.value.apply(this,[arguments,method]);return old.apply(this,arguments)};else if(advice.type==_intro)aspect=function(){return advice.value.apply(this,arguments)};else if(advice.type==_around){aspect=function(){var a={object:this,args:Array.prototype.slice.call(arguments)};return advice.value.apply(a.object,[{arguments:a.args,method:method,proceed:function(){return old.apply(a.object,a.args)}}])}}aspect.unweave=function(){source[method]=old;pointcut=source=aspect=old=null};source[method]=aspect;return aspect};var search=function(a,b,c){var d=[];for(var e in a){var f=null;try{f=a[e]}catch(g){}if(f!=null&&e.match(b.method)&&isFunc(f))d[d.length]={source:a,method:e,advice:c}}return d};var weave=function(a,b){var c=typeof a.target.prototype!=_undef?a.target.prototype:a.target;var d=[];if(b.type!=_intro&&typeof c[a.method]==_undef){var e=search(a.target,a,b);if(e.length==0)e=search(c,a,b);for(var f in e)d[d.length]=weaveOne(e[f].source,e[f].method,e[f].advice)}else{d[0]=weaveOne(c,a.method,b)}return _regexEnabled?d:d[0]};aop={after:function(a,b){return weave(a,{type:_after,value:b})},afterThrow:function(a,b){return weave(a,{type:_afterThrow,value:b})},afterFinally:function(a,b){return weave(a,{type:_afterFinally,value:b})},before:function(a,b){return weave(a,{type:_before,value:b})},around:function(a,b){return weave(a,{type:_around,value:b})},introduction:function(a,b){return weave(a,{type:_intro,value:b})},setup:function(a){_regexEnabled=a.regexMatch}}})();if(dnt_config.ifdnt!=="1"||navigator.doNotTrack==="yes"){var mode=dnt_config.mode;var list=[];list["black"]=dnt_config.black;list["white"]=dnt_config.white;aop.around({target:document,method:"write"},function(a){if(a.arguments[0].search(/img|script|iframe/i)!==-1){if(sanitizer(a.arguments[0])===true){a.arguments[0]=a.arguments[0].replace(/</g,"<!-- ").replace(/>/g," -->")}}return a.proceed()});scriptParent=document.getElementsByTagName("script")[0].parentNode;if(scriptParent.tagName.toLowerCase!=="head"){head=document.getElementsByTagName("head")[0];aop_around(head,"insertBefore");aop_around(head,"appendChild")}aop_around(scriptParent,"insertBefore");aop_around(scriptParent,"appendChild");var a2a_config=a2a_config||{};a2a_config.no_3p=1;var addthis_config={data_use_cookies:false};var _gaq=_gaq||[];_gaq.push(["_gat._anonymizeIp"])}
 
external/donottrack.js DELETED
@@ -1,472 +0,0 @@
1
- /**
2
- * jQuery AOP - jQuery plugin to add features of aspect-oriented programming (AOP) to jQuery.
3
- * http://jquery-aop.googlecode.com/
4
- *
5
- * Licensed under the MIT license:
6
- * http://www.opensource.org/licenses/mit-license.php
7
- *
8
- * Version: 1.3
9
- *
10
- * Cross-frame type detection based on Daniel Steigerwald's code (http://daniel.steigerwald.cz)
11
- * http://gist.github.com/204554
12
- *
13
- */
14
-
15
- (function() {
16
-
17
- var _after = 1;
18
- var _afterThrow = 2;
19
- var _afterFinally = 3;
20
- var _before = 4;
21
- var _around = 5;
22
- var _intro = 6;
23
- var _regexEnabled = true;
24
- var _arguments = 'arguments';
25
- var _undef = 'undefined';
26
-
27
- var getType = (function() {
28
-
29
- var toString = Object.prototype.toString,
30
- toStrings = {},
31
- nodeTypes = { 1: 'element', 3: 'textnode', 9: 'document', 11: 'fragment' },
32
- types = 'Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window'.split(' ');
33
-
34
- for (var i = types.length; i--; ) {
35
- var type = types[i], constructor = window[type];
36
- if (constructor) {
37
- try { toStrings[toString.call(new constructor)] = type.toLowerCase(); }
38
- catch (e) { }
39
- }
40
- }
41
-
42
- return function(item) {
43
- return item == null && (item === undefined ? _undef : 'null') ||
44
- item.nodeType && nodeTypes[item.nodeType] ||
45
- typeof item.length == 'number' && (
46
- item.callee && _arguments ||
47
- item.alert && 'window' ||
48
- item.item && 'nodelist') ||
49
- toStrings[toString.call(item)];
50
- };
51
-
52
- })();
53
-
54
- var isFunc = function(obj) { return getType(obj) == 'function'; };
55
-
56
- /**
57
- * Private weaving function.
58
- */
59
- var weaveOne = function(source, method, advice) {
60
-
61
- var old = source[method];
62
-
63
- // Work-around IE6/7 behavior on some native method that return object instances
64
- if (advice.type != _intro && !isFunc(old)) {
65
- var oldObject = old;
66
- old = function() {
67
- var code = arguments.length > 0 ? _arguments + '[0]' : '';
68
-
69
- for (var i=1;i<arguments.length;i++) {
70
- code += ',' + _arguments + '[' + i + ']';
71
- }
72
-
73
- return eval('oldObject(' + code + ');');
74
- };
75
- }
76
-
77
- var aspect;
78
- if (advice.type == _after || advice.type == _afterThrow || advice.type == _afterFinally)
79
- aspect = function() {
80
- var returnValue, exceptionThrown = null;
81
-
82
- try {
83
- returnValue = old.apply(this, arguments);
84
- } catch (e) {
85
- exceptionThrown = e;
86
- }
87
-
88
- if (advice.type == _after)
89
- if (exceptionThrown == null)
90
- returnValue = advice.value.apply(this, [returnValue, method]);
91
- else
92
- throw exceptionThrown;
93
- else if (advice.type == _afterThrow && exceptionThrown != null)
94
- returnValue = advice.value.apply(this, [exceptionThrown, method]);
95
- else if (advice.type == _afterFinally)
96
- returnValue = advice.value.apply(this, [returnValue, exceptionThrown, method]);
97
-
98
- return returnValue;
99
- };
100
- else if (advice.type == _before)
101
- aspect = function() {
102
- advice.value.apply(this, [arguments, method]);
103
- return old.apply(this, arguments);
104
- };
105
- else if (advice.type == _intro)
106
- aspect = function() {
107
- return advice.value.apply(this, arguments);
108
- };
109
- else if (advice.type == _around) {
110
- aspect = function() {
111
- var invocation = { object: this, args: Array.prototype.slice.call(arguments) };
112
- return advice.value.apply(invocation.object, [{ arguments: invocation.args, method: method, proceed :
113
- function() {
114
- return old.apply(invocation.object, invocation.args);
115
- }
116
- }] );
117
- };
118
- }
119
-
120
- aspect.unweave = function() {
121
- source[method] = old;
122
- pointcut = source = aspect = old = null;
123
- };
124
-
125
- source[method] = aspect;
126
-
127
- return aspect;
128
-
129
- };
130
-
131
- /**
132
- * Private method search
133
- */
134
- var search = function(source, pointcut, advice) {
135
-
136
- var methods = [];
137
-
138
- for (var method in source) {
139
-
140
- var item = null;
141
-
142
- // Ignore exceptions during method retrival
143
- try {
144
- item = source[method];
145
- }
146
- catch (e) { }
147
-
148
- if (item != null && method.match(pointcut.method) && isFunc(item))
149
- methods[methods.length] = { source: source, method: method, advice: advice };
150
-
151
- }
152
-
153
- return methods;
154
- };
155
-
156
- /**
157
- * Private weaver and pointcut parser.
158
- */
159
- var weave = function(pointcut, advice) {
160
- var source = typeof(pointcut.target.prototype) != _undef ? pointcut.target.prototype : pointcut.target;
161
- var advices = [];
162
-
163
- // If it's not an introduction and no method was found, try with regex...
164
- if (advice.type != _intro && typeof(source[pointcut.method]) == _undef) {
165
-
166
- // First try directly on target
167
- var methods = search(pointcut.target, pointcut, advice);
168
-
169
- // No method found, re-try directly on prototype
170
- if (methods.length == 0)
171
- methods = search(source, pointcut, advice);
172
-
173
- for (var i in methods)
174
- advices[advices.length] = weaveOne(methods[i].source, methods[i].method, methods[i].advice);
175
-
176
- }
177
- else
178
- {
179
- // Return as an array of one element
180
- advices[0] = weaveOne(source, pointcut.method, advice);
181
- }
182
-
183
- return _regexEnabled ? advices : advices[0];
184
-
185
- };
186
-
187
- aop =
188
- {
189
- /**
190
- * Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
191
- * has completed execution successfully, and will receive one parameter with the result of the execution.
192
- * This function returns an array of weaved aspects (Function).
193
- *
194
- * @example jQuery.aop.after( {target: window, method: 'MyGlobalMethod'}, function(result) {
195
- * alert('Returned: ' + result);
196
- * return result;
197
- * } );
198
- * @result Array<Function>
199
- *
200
- * @example jQuery.aop.after( {target: String, method: 'indexOf'}, function(index) {
201
- * alert('Result found at: ' + index + ' on:' + this);
202
- * return index;
203
- * } );
204
- * @result Array<Function>
205
- *
206
- * @name after
207
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
208
- * @option Object target Target object to be weaved.
209
- * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
210
- * @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
211
- * with the result of the point-cut's execution. The function can choose to return this same value or a different one.
212
- *
213
- * @type Array<Function>
214
- * @cat Plugins/General
215
- */
216
- after : function(pointcut, advice)
217
- {
218
- return weave( pointcut, { type: _after, value: advice } );
219
- },
220
-
221
- /**
222
- * Creates an advice after the defined point-cut only for unhandled exceptions. The advice will be executed
223
- * after the point-cut method only if the execution failed and an exception has been thrown. It will receive one
224
- * parameter with the exception thrown by the point-cut method.
225
- * This function returns an array of weaved aspects (Function).
226
- *
227
- * @example jQuery.aop.afterThrow( {target: String, method: 'indexOf'}, function(exception) {
228
- * alert('Unhandled exception: ' + exception);
229
- * return -1;
230
- * } );
231
- * @result Array<Function>
232
- *
233
- * @example jQuery.aop.afterThrow( {target: calculator, method: 'Calculate'}, function(exception) {
234
- * console.log('Unhandled exception: ' + exception);
235
- * throw exception;
236
- * } );
237
- * @result Array<Function>
238
- *
239
- * @name afterThrow
240
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
241
- * @option Object target Target object to be weaved.
242
- * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
243
- * @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
244
- * with the exception thrown by the point-cut method.
245
- *
246
- * @type Array<Function>
247
- * @cat Plugins/General
248
- */
249
- afterThrow : function(pointcut, advice)
250
- {
251
- return weave( pointcut, { type: _afterThrow, value: advice } );
252
- },
253
-
254
- /**
255
- * Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
256
- * regardless of its success or failure, and it will receive two parameters: one with the
257
- * result of a successful execution or null, and another one with the exception thrown or null.
258
- * This function returns an array of weaved aspects (Function).
259
- *
260
- * @example jQuery.aop.afterFinally( {target: window, method: 'MyGlobalMethod'}, function(result, exception) {
261
- * if (exception == null)
262
- * return 'Returned: ' + result;
263
- * else
264
- * return 'Unhandled exception: ' + exception;
265
- * } );
266
- * @result Array<Function>
267
- *
268
- * @name afterFinally
269
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
270
- * @option Object target Target object to be weaved.
271
- * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
272
- * @param Function advice Function containing the code that will get called after the execution of the point-cut regardless of its success or failure.
273
- * It receives two parameters, the first one with the result of a successful execution or null, and the second one with the
274
- * exception or null.
275
- *
276
- * @type Array<Function>
277
- * @cat Plugins/General
278
- */
279
- afterFinally : function(pointcut, advice)
280
- {
281
- return weave( pointcut, { type: _afterFinally, value: advice } );
282
- },
283
-
284
-
285
- /**
286
- * Creates an advice before the defined point-cut. The advice will be executed before the point-cut method
287
- * but cannot modify the behavior of the method, or prevent its execution.
288
- * This function returns an array of weaved aspects (Function).
289
- *
290
- * @example jQuery.aop.before( {target: window, method: 'MyGlobalMethod'}, function() {
291
- * alert('About to execute MyGlobalMethod');
292
- * } );
293
- * @result Array<Function>
294
- *
295
- * @example jQuery.aop.before( {target: String, method: 'indexOf'}, function(index) {
296
- * alert('About to execute String.indexOf on: ' + this);
297
- * } );
298
- * @result Array<Function>
299
- *
300
- * @name before
301
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
302
- * @option Object target Target object to be weaved.
303
- * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
304
- * @param Function advice Function containing the code that will get called before the execution of the point-cut.
305
- *
306
- * @type Array<Function>
307
- * @cat Plugins/General
308
- */
309
- before : function(pointcut, advice)
310
- {
311
- return weave( pointcut, { type: _before, value: advice } );
312
- },
313
-
314
-
315
- /**
316
- * Creates an advice 'around' the defined point-cut. This type of advice can control the point-cut method execution by calling
317
- * the functions '.proceed()' on the 'invocation' object, and also, can modify the arguments collection before sending them to the function call.
318
- * This function returns an array of weaved aspects (Function).
319
- *
320
- * @example jQuery.aop.around( {target: window, method: 'MyGlobalMethod'}, function(invocation) {
321
- * alert('# of Arguments: ' + invocation.arguments.length);
322
- * return invocation.proceed();
323
- * } );
324
- * @result Array<Function>
325
- *
326
- * @example jQuery.aop.around( {target: String, method: 'indexOf'}, function(invocation) {
327
- * alert('Searching: ' + invocation.arguments[0] + ' on: ' + this);
328
- * return invocation.proceed();
329
- * } );
330
- * @result Array<Function>
331
- *
332
- * @example jQuery.aop.around( {target: window, method: /Get(\d+)/}, function(invocation) {
333
- * alert('Executing ' + invocation.method);
334
- * return invocation.proceed();
335
- * } );
336
- * @desc Matches all global methods starting with 'Get' and followed by a number.
337
- * @result Array<Function>
338
- *
339
- *
340
- * @name around
341
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
342
- * @option Object target Target object to be weaved.
343
- * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
344
- * @param Function advice Function containing the code that will get called around the execution of the point-cut. This advice will be called with one
345
- * argument containing one function '.proceed()', the collection of arguments '.arguments', and the matched method name '.method'.
346
- *
347
- * @type Array<Function>
348
- * @cat Plugins/General
349
- */
350
- around : function(pointcut, advice)
351
- {
352
- return weave( pointcut, { type: _around, value: advice } );
353
- },
354
-
355
- /**
356
- * Creates an introduction on the defined point-cut. This type of advice replaces any existing methods with the same
357
- * name. To restore them, just unweave it.
358
- * This function returns an array with only one weaved aspect (Function).
359
- *
360
- * @example jQuery.aop.introduction( {target: window, method: 'MyGlobalMethod'}, function(result) {
361
- * alert('Returned: ' + result);
362
- * } );
363
- * @result Array<Function>
364
- *
365
- * @example jQuery.aop.introduction( {target: String, method: 'log'}, function() {
366
- * alert('Console: ' + this);
367
- * } );
368
- * @result Array<Function>
369
- *
370
- * @name introduction
371
- * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
372
- * @option Object target Target object to be weaved.
373
- * @option String method Name of the function to be weaved.
374
- * @param Function advice Function containing the code that will be executed on the point-cut.
375
- *
376
- * @type Array<Function>
377
- * @cat Plugins/General
378
- */
379
- introduction : function(pointcut, advice)
380
- {
381
- return weave( pointcut, { type: _intro, value: advice } );
382
- },
383
-
384
- /**
385
- * Configures global options.
386
- *
387
- * @name setup
388
- * @param Map settings Configuration options.
389
- * @option Boolean regexMatch Enables/disables regex matching of method names.
390
- *
391
- * @example jQuery.aop.setup( { regexMatch: false } );
392
- * @desc Disable regex matching.
393
- *
394
- * @type Void
395
- * @cat Plugins/General
396
- */
397
- setup: function(settings)
398
- {
399
- _regexEnabled = settings.regexMatch;
400
- }
401
- };
402
- })();
403
-
404
- function aop_around(myTarget, myMethod) {
405
- aop.around( {target: myTarget, method: myMethod },
406
- function(invocation) {
407
- if ((typeof(invocation.arguments[0].src)==='string')&&((invocation.arguments[0].tagName.toLowerCase()==='script')||(invocation.arguments[0].tagName.toLowerCase()==='img')||(invocation.arguments[0].tagName.toLowerCase()==='iframe'))) {
408
- if (sanitizer(invocation.arguments[0].src)===true) {
409
- invocation.arguments[0].src='javascript:void(0)';
410
- }
411
- }
412
- return invocation.proceed();
413
- }
414
- );
415
- }
416
-
417
- function sanitizer(tS) {
418
- tS=tS.toLowerCase();
419
- if (mode==='blacklist') {
420
- for (x in list['black']) {
421
- if (tS.indexOf(list['black'][x].toLowerCase()) !== -1) {
422
- tS=true;
423
- break;
424
- }
425
- }
426
- } else {
427
- for (x in list['white']) {
428
- if (tS.indexOf(list['white'][x].toLowerCase()) !== -1) {
429
- tmpS=false;
430
- break;
431
- } else {
432
- tmpS=true;
433
- }
434
- }
435
- if (tmpS===true) tS=tmpS;
436
- }
437
- return tS;
438
- }
439
-
440
- if ((dnt_config.ifdnt!=="1")||(navigator.doNotTrack==="yes")) {
441
- var mode=dnt_config.mode;
442
- var list = [];
443
- list['black']=dnt_config.black;
444
- list['white']=dnt_config.white;
445
-
446
- // for document.write, has to be sanitized differently from others
447
- aop.around( {target: document, method: 'write' },
448
- function(invocation) {
449
- if (invocation.arguments[0].search(/img|script|iframe/i)!==-1) {
450
- if (sanitizer(invocation.arguments[0])===true) {
451
- invocation.arguments[0]=invocation.arguments[0].replace(/</g,'<!-- ').replace(/>/g,' -->');
452
- }
453
- }
454
- return invocation.proceed();
455
- }
456
- );
457
-
458
- // for dom-methods insertBefore and appendChild on parent of first script and/or head
459
- scriptParent=document.getElementsByTagName('script')[0].parentNode;
460
- if (scriptParent.tagName.toLowerCase!=="head") {
461
- head = document.getElementsByTagName('head')[0];
462
- aop_around ( head, "insertBefore" );
463
- aop_around ( head, "appendChild" );
464
- }
465
- aop_around ( scriptParent, "insertBefore" );
466
- aop_around ( scriptParent, "appendChild" );
467
-
468
- // some specific configs to have 3rd parties behave
469
- var a2a_config = a2a_config || {};a2a_config.no_3p=1;
470
- var addthis_config = { data_use_cookies: false };
471
- var _gaq=_gaq || [];_gaq.push(['_gat._anonymizeIp']);
472
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options.php CHANGED
@@ -16,7 +16,6 @@ function register_lyte_settings() {
16
  register_setting( 'lyte-settings-group', 'size' );
17
  register_setting( 'lyte-settings-group', 'hidef' );
18
  register_setting( 'lyte-settings-group', 'position' );
19
- register_setting( 'lyte-settings-group', 'donottrack' );
20
  register_setting( 'lyte-settings-group', 'notification' );
21
  }
22
 
@@ -30,12 +29,12 @@ function lyte_admin_styles() {
30
  }
31
 
32
  function lyte_admin_notice(){
33
- echo '<div class="updated"><p><strong>Hi there WP YouTube Lyte user!</strong></p><p>Just to let you know that, if you use Lyte Widgets, <a href="http://apiblog.youtube.com/2012/03/minimum-embeds-200px-x-200px.html">from the end of April 2012 onwards YouTube requires the <strong>the minimum size for an embedded player to be 200X200px</strong></a>. If YouTube enforces this, the <strong>smaller widget sizes will not work any more</strong> and for that reason should be considered deprecated from now on. A new widget with size 200X200 is now available to allow you to continue to use WP YouTube Lyte widgets.</p><p>Have a swell day!<br /><a href="http://blog.futtta.be/">frank</a>.</div>';
34
  }
35
 
36
- if (get_option('notification','0')!=="1") {
37
  add_action('admin_notices', 'lyte_admin_notice');
38
- update_option('notification','1');
39
  }
40
 
41
  function lyte_settings_page() {
@@ -106,14 +105,10 @@ function lyte_settings_page() {
106
  <tr valign="top">
107
  <th scope="row"><?php _e("Bonus feature: ","wp-youtube-lyte") ?><a href="http://wordpress.org/extend/plugins/wp-donottrack/" target="_blank">DoNotTrack</a></th>
108
  <td>
109
- <fieldset>
110
- <legend class="screen-reader-text"><span>Activate DoNotTrack</span></legend>
111
- <label title="Enable DoNotTrack"><input type="radio" name="donottrack" value="1" <?php if (get_option('donottrack')==="1") echo "checked" ?> /><?php _e("Disable 3rd party tracking.","wp-youtube-lyte") ?></label><br />
112
- <label title="Leave DoNotTrack disabled (default)"><input type="radio" name="donottrack" value="0" <?php if (get_option('donottrack')!=="1") echo "checked" ?> /><?php _e("I don't mind 3rd party tracking (default)","wp-youtube-lyte") ?></label>
113
- </fieldset>
114
- <span class="description"><?php _e( "This stops tracking by Quantcast as initiated by some <a href=\"http://profiles.wordpress.org/users/automattic/profile/public/\" target=\"_blank\">Automattic plugins</a>. You can also <a href=\"http://wordpress.org/extend/plugins/wp-donottrack/\" target=\"_blank\">try out WP DoNotTrack</a>, a new plugin that provides these features and more (custom black- or whitelist, conditional DoNotTrack, ...)", "wp-donottrack" ) ?></span>
115
- </td>
116
- </tr>
117
  </table>
118
 
119
  <p class="submit">
@@ -154,7 +149,7 @@ function lyte_settings_page() {
154
 
155
  function show_feed(id) {
156
  jQuery('#futtta_feed').rssfeed(feed[id], {
157
- <?php if ($_SERVER['HTTPS']) echo "ssl: true,"; ?>
158
  limit: 4,
159
  date: true,
160
  header: false
16
  register_setting( 'lyte-settings-group', 'size' );
17
  register_setting( 'lyte-settings-group', 'hidef' );
18
  register_setting( 'lyte-settings-group', 'position' );
 
19
  register_setting( 'lyte-settings-group', 'notification' );
20
  }
21
 
29
  }
30
 
31
  function lyte_admin_notice(){
32
+ echo '<div class="updated"><p>Hello WP YouTube Lyte user!<br />Just to let you know that <strong>the bonus feature, DoNotTrack, was removed</strong> from WP YouTube Lyte. If you would like to keep blocking third party tracking on your blog, you might want to <strong>install <a href="http://wordpress.org/extend/plugins/wp-donottrack/" title="WP DoNotTrack">WP DoNotTrack</a></strong>, which is a more powerful and flexible solution.</p><p>Have a great day!<br /><a href="http://blog.futtta.be/">frank</a>.</div>';
33
  }
34
 
35
+ if (get_option('notification','0')!=="2") {
36
  add_action('admin_notices', 'lyte_admin_notice');
37
+ update_option('notification','2');
38
  }
39
 
40
  function lyte_settings_page() {
105
  <tr valign="top">
106
  <th scope="row"><?php _e("Bonus feature: ","wp-youtube-lyte") ?><a href="http://wordpress.org/extend/plugins/wp-donottrack/" target="_blank">DoNotTrack</a></th>
107
  <td>
108
+ <?php _e("The DoNotTrack bonus feature has been removed from WP YouTube Lyte. If you need this functionality you might want to install <a href=\"http://wordpress.org/extend/plugins/wp-donottrack/\">WP DoNotTrack</a>, which offers a more flexible and powerful solution","wp-youtube-lyte") ?>
109
+
110
+ </td>
111
+ </tr>
 
 
 
 
112
  </table>
113
 
114
  <p class="submit">
149
 
150
  function show_feed(id) {
151
  jQuery('#futtta_feed').rssfeed(feed[id], {
152
+ <?php if ( is_ssl() ) echo "ssl: true,"; ?>
153
  limit: 4,
154
  date: true,
155
  header: false
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: futtta
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio, playlist, youtube playlist, hd, performance, accessibility, sidebar, lazy load
4
  Requires at least: 2.9
5
  Tested up to: 3.4
6
- Stable tag: 1.1.5
7
 
8
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
9
 
@@ -23,8 +23,7 @@ Just add a YouTube-link for a video or [an entire playlist](http://blog.futtta.b
23
  Or using shortcodes (beta):
24
  `[lyte id="_SQkWbRublY" /]`
25
  `[lyte id="_SQkWbRublY" audio="true" /]`
26
- `[lyte id="A486E741B25F8E00" playlist="true" /]
27
-
28
 
29
  WP YouTube Lyte has been written with optimal performance as primary goal, but has been tested for maximum browser-compatibility (iPad included) while keeping an eye on accessibility. The plugin is fully multi-language, with support for Catalan, Dutch, English, French, German, Hebrew, Romanian, Spanish and Slovene.
30
 
@@ -77,6 +76,11 @@ Just tell me, I like the feedback! Use the [Contact-page on my blog](http://blog
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
80
  = 1.1.5 =
81
  * bugfix: added missing lyte/controls-400.png, which was needed for the new widget-size in 1.1.4
82
  * bugfix: force margin for widget to 0 for themes that think they know better (as reported by long-time user [FruityOaty](http://fruityoaty.com/))
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio, playlist, youtube playlist, hd, performance, accessibility, sidebar, lazy load
4
  Requires at least: 2.9
5
  Tested up to: 3.4
6
+ Stable tag: 1.1.6
7
 
8
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
9
 
23
  Or using shortcodes (beta):
24
  `[lyte id="_SQkWbRublY" /]`
25
  `[lyte id="_SQkWbRublY" audio="true" /]`
26
+ `[lyte id="A486E741B25F8E00" playlist="true" /]`
 
27
 
28
  WP YouTube Lyte has been written with optimal performance as primary goal, but has been tested for maximum browser-compatibility (iPad included) while keeping an eye on accessibility. The plugin is fully multi-language, with support for Catalan, Dutch, English, French, German, Hebrew, Romanian, Spanish and Slovene.
29
 
76
 
77
  == Changelog ==
78
 
79
+ = 1.1.6 =
80
+ * bugfix: remove noscript-stuff from the_excerpt [as requested by wordpressvoxbox13](http://wordpress.org/support/topic/plugin-wp-youtube-lyte-wp-youtube-lyte-adds-text-to-my-posts?replies=8#post-2977006)
81
+ * bugfix: switch HTTPS detection to is_ssl() WordPress function to avoid breakage on MS IIS
82
+ * removed the "DoNotTrack" bonus feature due to added complexity, [at least one bug](http://wordpress.org/support/topic/wp-youtube-lyte-conflicts-with-wysija-newsletter) and the fact that [WP DoNotTrack](http://wordpress.org/extend/plugins/wp-donottrack/) does a better job at this
83
+
84
  = 1.1.5 =
85
  * bugfix: added missing lyte/controls-400.png, which was needed for the new widget-size in 1.1.4
86
  * bugfix: force margin for widget to 0 for themes that think they know better (as reported by long-time user [FruityOaty](http://fruityoaty.com/))
wp-youtube-lyte.php CHANGED
@@ -4,14 +4,21 @@ Plugin Name: WP YouTube Lyte
4
  Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
5
  Description: Lite and accessible YouTube audio and video embedding.
6
  Author: Frank Goossens (futtta)
7
- Version: 1.1.5
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
11
  */
12
 
13
- $wyl_version="1.1.5";
14
- #$wyl_version=rand()/1000;
 
 
 
 
 
 
 
15
 
16
  $plugin_dir = basename(dirname(__FILE__)).'/languages';
17
  load_plugin_textdomain( 'wp-youtube-lyte', null, $plugin_dir );
@@ -37,10 +44,10 @@ $lyteSettings['sizeArray']=$sArray;
37
  $lyteSettings['selSize']=$selSize;
38
  $lyteSettings['path']=$wp_lyte_plugin_url.'lyte/';
39
  $lyteSettings['links']=get_option('show_links');
40
- $lyteSettings['version']=$wyl_version;
41
  $lyteSettings['position']=get_option('position','0');
42
 
43
- function lyte_parse($the_content) {
44
  global $lyteSettings;
45
 
46
  $urlArr=parse_url($lyteSettings['path']);
@@ -57,7 +64,7 @@ function lyte_parse($the_content) {
57
  $hidefClass="";
58
  }
59
 
60
- if ($_SERVER['HTTPS']) {
61
  $scheme="https";
62
  } else {
63
  $scheme="http";
@@ -143,6 +150,8 @@ function lyte_parse($the_content) {
143
  $noscript="<noscript><a href=\"".$scheme."://youtu.be/".$vid."\"><img src=\"".$scheme."://img.youtube.com/vi/".$vid."/0.jpg\" alt=\"\" width=\"".$lyteSettings[2]."\" height=\"".$NSimgHeight."\" />".$noscript_post."</a> ".$NSbanner."</noscript>";
144
  }
145
 
 
 
146
  $lytetemplate = "<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\" style=\"width:".$lyteSettings[2]."px;height:".$divHeight."px;overflow:hidden;\">".$noscript."</div>".$lytelinks_txt;
147
  $the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(((watch(\?v\=|\/v\/)|.+?v\=|)([a-zA-Z0-9\-\_]{11}))|(playlist\?list\=PL([a-zA-Z0-9\-\_]{16})))([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
148
  }
@@ -164,9 +173,13 @@ function lyte_init() {
164
  $pos="auto";
165
  }
166
  echo "<script type=\"text/javascript\">var bU='".$lyteSettings['path']."';style = document.createElement('style');style.type = 'text/css';rules = document.createTextNode('.lyte img {border:0px !important;padding:0px;spacing:0px;margin:0px;display:inline;background-color:transparent;max-width:100%} .lL {margin:5px ".$pos.";} .lP {background-color:#fff;margin:5px ".$pos.";} .pL {cursor:pointer;text-align:center;overflow:hidden;position:relative;margin:0px !important;} .tC {left:0;top:0;position:absolute;width:100%;background-color:rgba(0,0,0,0.6);} .tT {padding:5px 10px;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;} .ctrl {position:absolute;left:0px;bottom:0px;}');if(style.styleSheet) { style.styleSheet.cssText = rules.nodeValue;} else {style.appendChild(rules);}document.getElementsByTagName('head')[0].appendChild(style);</script>";
167
- echo "<script type=\"text/javascript\" async=true src=\"".$lyteSettings['path']."lyte-min.js?wylver=".$lyteSettings['version']."\"></script>";
168
  }
169
 
 
 
 
 
170
  /** YouTube shortcode */
171
  function shortcode_lyte($atts) {
172
  extract(shortcode_atts(array(
@@ -185,33 +198,7 @@ if ( is_admin() ) {
185
  require_once(dirname(__FILE__).'/options.php');
186
  } else {
187
  add_filter('the_content', 'lyte_parse', 4);
188
- add_filter('the_excerpt', 'lyte_parse', 4);
189
  add_shortcode("lyte", "shortcode_lyte");
190
  }
191
-
192
- /* donottrack */
193
- $donottrack_js=$wp_lyte_plugin_url."external/donottrack-min.js";
194
-
195
- if ($_SERVER['HTTPS']) {
196
- $donottrack_js = str_replace( "http:","https:",$donottrack_js );
197
- }
198
-
199
- function lyte_donottrack_init() {
200
- global $donottrack_js;
201
- wp_enqueue_script( 'donottrack',$donottrack_js );
202
- }
203
-
204
- function lyte_donottrack_config() {
205
- echo "<script type=\"text/javascript\">var dnt_config={ifdnt:\"\",mode:\"blacklist\",black:[\"media6degrees.com\",\"quantserve.com\",\"lockerz.com\"],white:[]};</script>\n";
206
- }
207
-
208
- function lyte_donottrack_footer() {
209
- echo "<script type=\"text/javascript\">aop_around(document.body, 'appendChild'); aop_around(document.body, 'insertBefore');</script>";
210
- }
211
-
212
- if (get_option('donottrack')==="1") {
213
- add_action('wp_print_scripts', 'lyte_donottrack_config');
214
- add_action('init', 'lyte_donottrack_init');
215
- add_action('wp_footer', 'lyte_donottrack_footer');
216
- }
217
  ?>
4
  Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
5
  Description: Lite and accessible YouTube audio and video embedding.
6
  Author: Frank Goossens (futtta)
7
+ Version: 1.1.6
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
11
  */
12
 
13
+ $debug=false;
14
+
15
+ if (!$debug) {
16
+ $wyl_version="1.1.6";
17
+ $wyl_file="lyte-min.js";
18
+ } else {
19
+ $wyl_version=rand()/1000;
20
+ $wyl_file="lyte.js";
21
+ }
22
 
23
  $plugin_dir = basename(dirname(__FILE__)).'/languages';
24
  load_plugin_textdomain( 'wp-youtube-lyte', null, $plugin_dir );
44
  $lyteSettings['selSize']=$selSize;
45
  $lyteSettings['path']=$wp_lyte_plugin_url.'lyte/';
46
  $lyteSettings['links']=get_option('show_links');
47
+ $lyteSettings['file']=$wyl_file."?wyl_version=".$wyl_version;
48
  $lyteSettings['position']=get_option('position','0');
49
 
50
+ function lyte_parse($the_content,$doExcerpt="false") {
51
  global $lyteSettings;
52
 
53
  $urlArr=parse_url($lyteSettings['path']);
64
  $hidefClass="";
65
  }
66
 
67
+ if ( is_ssl() ) {
68
  $scheme="https";
69
  } else {
70
  $scheme="http";
150
  $noscript="<noscript><a href=\"".$scheme."://youtu.be/".$vid."\"><img src=\"".$scheme."://img.youtube.com/vi/".$vid."/0.jpg\" alt=\"\" width=\"".$lyteSettings[2]."\" height=\"".$NSimgHeight."\" />".$noscript_post."</a> ".$NSbanner."</noscript>";
151
  }
152
 
153
+ if ($doExcerpt) {$noscript="";}
154
+
155
  $lytetemplate = "<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\" style=\"width:".$lyteSettings[2]."px;height:".$divHeight."px;overflow:hidden;\">".$noscript."</div>".$lytelinks_txt;
156
  $the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(((watch(\?v\=|\/v\/)|.+?v\=|)([a-zA-Z0-9\-\_]{11}))|(playlist\?list\=PL([a-zA-Z0-9\-\_]{16})))([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
157
  }
173
  $pos="auto";
174
  }
175
  echo "<script type=\"text/javascript\">var bU='".$lyteSettings['path']."';style = document.createElement('style');style.type = 'text/css';rules = document.createTextNode('.lyte img {border:0px !important;padding:0px;spacing:0px;margin:0px;display:inline;background-color:transparent;max-width:100%} .lL {margin:5px ".$pos.";} .lP {background-color:#fff;margin:5px ".$pos.";} .pL {cursor:pointer;text-align:center;overflow:hidden;position:relative;margin:0px !important;} .tC {left:0;top:0;position:absolute;width:100%;background-color:rgba(0,0,0,0.6);} .tT {padding:5px 10px;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;} .ctrl {position:absolute;left:0px;bottom:0px;}');if(style.styleSheet) { style.styleSheet.cssText = rules.nodeValue;} else {style.appendChild(rules);}document.getElementsByTagName('head')[0].appendChild(style);</script>";
176
+ echo "<script type=\"text/javascript\" async=true src=\"".$lyteSettings['path'].$lyteSettings['file']."\"></script>";
177
  }
178
 
179
+ function lyte_parse_excerpt($the_content){
180
+ lyte_parse($the_content,$doExcerpt="true");
181
+ }
182
+
183
  /** YouTube shortcode */
184
  function shortcode_lyte($atts) {
185
  extract(shortcode_atts(array(
198
  require_once(dirname(__FILE__).'/options.php');
199
  } else {
200
  add_filter('the_content', 'lyte_parse', 4);
201
+ add_filter('the_excerpt', 'lyte_parse_excerpt', 4);
202
  add_shortcode("lyte", "shortcode_lyte");
203
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  ?>