Speed Booster Pack - Version 3.8

Version Description

  • Fixed most of the typos
  • Added option: "Disable cart fragments"
  • Added option: "Integrate instant.page"
  • Removed option: JPEG quality
  • Removed all default options for new users
  • Fixed the issues with already defined constants
  • Fixed the double jQuery issue
  • Tested for WordPress 5.2
Download this release

Release Info

Developer optimocha
Plugin Icon 128x128 Speed Booster Pack
Version 3.8
Comparing to
See all releases

Code changes from version 3.7.7 to 3.8

css/style.css CHANGED
@@ -1,656 +1,669 @@
1
- /* `border-box`... ALL THE THINGS! */
2
- html {
3
- box-sizing: border-box;
4
- }
5
-
6
- *,
7
- *:before,
8
- *:after {
9
- box-sizing: inherit;
10
- }
11
-
12
- .sb-pack-show {
13
- display: block;
14
- }
15
-
16
- .sb-pack-hide {
17
- display: none;
18
- }
19
-
20
- h3.sbp-emphasize {
21
- color: #fa5148;
22
- }
23
-
24
- img.sbp-sp {
25
- float: left;
26
- margin-right: 20px;
27
- }
28
-
29
- p.description-link {
30
- margin-top: -5px;
31
- }
32
-
33
- .wrap .sb-pack .welcome-panel .welcome-panel-column:first-child {
34
- display: block !important;
35
- }
36
-
37
- .wrap .sb-pack .welcome-panel h4 {
38
- margin: 1.33em 0 20px;
39
- }
40
-
41
- .wrap .sb-pack .sbp-inline-wrap {
42
- display: inline-block;
43
- margin-right: 10px;
44
- vertical-align: top;
45
- }
46
-
47
- .wrap .sb-pack .sbp-more-width {
48
- width: 300px;
49
- }
50
-
51
- .wrap .sb-pack .sbp-all-enqueued {
52
- background-color: #fcfcfc;
53
- padding: 5px 0px 10px;
54
- border: 1px solid #ddd;
55
- width: auto;
56
- }
57
-
58
- .wrap .sb-pack .sbp-width {
59
- min-width: 200px;
60
- width: auto;
61
- padding: 0 20px;
62
- }
63
-
64
- .wrap .sb-pack .sbp-title-scripts {
65
- min-width: 200px;
66
- width: auto;
67
- display: inline-block;
68
- font-weight: 700;
69
- padding: 0 20px;
70
- }
71
-
72
- .wrap .sb-pack .sbp-columns1 {
73
- display: inline-block;
74
- }
75
-
76
- .wrap .sb-pack .sbp-columns2 {
77
- display: inline-block;
78
- max-width: 73%;
79
- }
80
-
81
- .wrap .sb-pack .sbp-title-div {
82
- height: 50px;
83
- clear: both;
84
- }
85
-
86
- .wrap .sb-pack .sbp-amount {
87
- background-color: transparent;
88
- border: medium none;
89
- box-shadow: none;
90
- }
91
-
92
- .wrap .sb-pack .sbp-slider {
93
- width: 40%;
94
- }
95
-
96
- .wrap .sb-pack p {
97
- color: #464646;
98
- }
99
-
100
- .wrap .sb-pack p.sp-link {
101
- text-align: center;
102
- margin-bottom: 20px;
103
- }
104
-
105
- .wrap .sb-pack .td-margin {
106
- margin: 1.5em 0 1.5em;
107
- }
108
-
109
- .wrap .sb-pack .sbp-div-head {
110
- border-bottom: 1px solid #e1e1e1;
111
- margin: 0 0 5px;
112
- padding: 0 0 5px;
113
- }
114
-
115
- .wrap .sb-pack .td-border {
116
- border-bottom: 1px solid #e1e1e1;
117
- margin: 10px 0;
118
- }
119
-
120
- .wrap .sb-pack .td-border-last {
121
- border-bottom: 1px solid #e1e1e1;
122
- margin: 1.5em 0;
123
- }
124
-
125
- .wrap .sb-pack .sbp-radio-content {
126
- display: block;
127
- }
128
-
129
- .wrap .sb-pack .sbp-radio-content label {
130
- display: block !important;
131
- }
132
-
133
- .wrap .sb-pack .sbp-box hr {
134
- margin-left: 70px;
135
- }
136
-
137
- .wrap .sb-pack .sbp-1 {
138
- padding-top: 10px;
139
- }
140
-
141
- .wrap .sb-pack .sbp-2 {
142
- padding-bottom: 15px;
143
- }
144
-
145
- .wrap .sb-pack .sbp-3 {
146
- padding-top: 5px;
147
- }
148
-
149
- .wrap .sb-pack .sbp-title-div .sbp-title {
150
- font-weight: 300;
151
- line-height: 26px;
152
- padding-top: 16px;
153
- padding-right: 15px;
154
- display: block;
155
- float: left;
156
- }
157
-
158
- .wrap .sb-pack .sbp-box {
159
- background: #fff;
160
- border: 1px solid #e5e5e5;
161
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
162
- padding: 15px;
163
- margin: 15px 0;
164
- position: relative;
165
- text-align: center;
166
- }
167
-
168
- .wrap .sb-pack .sbp-box p {
169
- margin: 5px 0 5px 70px;
170
- color: #777;
171
- }
172
-
173
- .wrap .sb-pack .sbp-infos {
174
- display: block;
175
- margin: 0 auto;
176
- padding-left: 70px;
177
- font-weight: 700;
178
- color: #777;
179
- }
180
-
181
- .wrap .sb-pack .sbp-infos span {
182
- color: #777;
183
- font-weight: 400;
184
- }
185
-
186
- .wrap .sb-pack .sbp-infos-title {
187
- font-weight: 700;
188
- color: #777;
189
- }
190
-
191
- .wrap .sb-pack .sbp-box-legend, .wrap .sb-pack .sbp-box-version {
192
- position: absolute;
193
- left: 0;
194
- top: 0;
195
- height: 100%;
196
- }
197
-
198
- .wrap .sb-pack .sbp-box-version {
199
- background: none repeat scroll 0% 0% #80828f;
200
- padding: 20px 15px;
201
- }
202
-
203
- .wrap .sb-pack .sbp-box-legend {
204
- background: none repeat scroll 0% 0% #fcc500;
205
- padding: 15px 15px;
206
- }
207
-
208
- .wrap .sb-pack .sbp-box-legend:hover {
209
- background-color: #f39c12;
210
- }
211
-
212
- .wrap .sb-pack .sbp-box-version:hover {
213
- background-color: #6c6e79;
214
- }
215
-
216
- .wrap .sb-pack .sbp-icon-help, .wrap .sb-pack .sbp-icon-version {
217
- color: #fff;
218
- }
219
-
220
- .wrap .sb-pack .sbp-icon:before {
221
- content: "\f185";
222
- display: inline-block;
223
- -webkit-font-smoothing: antialiased;
224
- font: normal 36px/0.6 'dashicons';
225
- vertical-align: sub;
226
- color: #fa5148;
227
- padding-right: 5px;
228
- }
229
-
230
- .wrap .sb-pack .sbp-icon-information:before {
231
- content: "\f348";
232
- display: inline-block;
233
- -webkit-font-smoothing: antialiased;
234
- font: normal 28px/1 'dashicons';
235
- vertical-align: middle;
236
- color: #c9d6e2;
237
- padding-right: 5px;
238
- }
239
-
240
- .wrap .sb-pack .sbp-icon-version:before {
241
- content: "\f348";
242
- display: inline-block;
243
- -webkit-font-smoothing: antialiased;
244
- font: normal 30px/1 'dashicons';
245
- vertical-align: top;
246
- }
247
-
248
- .wrap .sb-pack .sbp-icon-help:before {
249
- content: "\f123";
250
- display: inline-block;
251
- -webkit-font-smoothing: antialiased;
252
- font: normal 30px/1 'dashicons';
253
- vertical-align: top;
254
- }
255
-
256
- /* sbp-tooltips */
257
- /**
258
- * Tooltip Styles
259
- */
260
-
261
- /* Base styles for the element that has a tooltip */
262
- [data-tooltip],
263
- .tooltip {
264
- position: relative;
265
- cursor: pointer;
266
- }
267
-
268
- /* Base styles for the entire tooltip */
269
- [data-tooltip]:before,
270
- [data-tooltip]:after,
271
- .tooltip:before,
272
- .tooltip:after {
273
- position: absolute;
274
- visibility: hidden;
275
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
276
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
277
- opacity: 0;
278
- -webkit-transition: opacity 0.2s ease-in-out,
279
- visibility 0.2s ease-in-out,
280
- -webkit-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
281
- -moz-transition: opacity 0.2s ease-in-out,
282
- visibility 0.2s ease-in-out,
283
- -moz-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
284
- transition: opacity 0.2s ease-in-out,
285
- visibility 0.2s ease-in-out,
286
- transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
287
- -webkit-transform: translate3d(0, 0, 0);
288
- -moz-transform: translate3d(0, 0, 0);
289
- transform: translate3d(0, 0, 0);
290
- pointer-events: none;
291
- }
292
-
293
- /* Show the entire tooltip on hover and focus */
294
- [data-tooltip]:hover:before,
295
- [data-tooltip]:hover:after,
296
- [data-tooltip]:focus:before,
297
- [data-tooltip]:focus:after,
298
- .tooltip:hover:before,
299
- .tooltip:hover:after,
300
- .tooltip:focus:before,
301
- .tooltip:focus:after {
302
- visibility: visible;
303
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
304
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
305
- opacity: 1;
306
- }
307
-
308
- /* Base styles for the tooltip's directional arrow */
309
- .tooltip:before,
310
- [data-tooltip]:before {
311
- z-index: 1001;
312
- border: 6px solid transparent;
313
- background: transparent;
314
- content: "";
315
- }
316
-
317
- /* Base styles for the tooltip's content area */
318
- .tooltip:after,
319
- [data-tooltip]:after {
320
- z-index: 1000;
321
- padding: 8px;
322
- width: 360px;
323
- background-color: #000;
324
- background-color: hsla(0, 0%, 20%, 1);
325
- color: #fff;
326
- content: attr(data-tooltip);
327
- line-height: 1.75;
328
- }
329
-
330
- /* Directions */
331
-
332
- /* Top (default) */
333
- [data-tooltip]:before,
334
- [data-tooltip]:after,
335
- .tooltip:before,
336
- .tooltip:after,
337
- .tooltip-top:before,
338
- .tooltip-top:after {
339
- bottom: 100%;
340
- left: 50%;
341
- }
342
-
343
- [data-tooltip]:before,
344
- .tooltip:before,
345
- .tooltip-top:before {
346
- margin-left: -6px;
347
- margin-bottom: -12px;
348
- border-top-color: #000;
349
- border-top-color: hsla(0, 0%, 20%, 0.9);
350
- }
351
-
352
- /* Horizontally align top/bottom tooltips */
353
- [data-tooltip]:after,
354
- .tooltip:after,
355
- .tooltip-top:after {
356
- margin-left: -80px;
357
- }
358
-
359
- [data-tooltip]:hover:before,
360
- [data-tooltip]:hover:after,
361
- [data-tooltip]:focus:before,
362
- [data-tooltip]:focus:after,
363
- .tooltip:hover:before,
364
- .tooltip:hover:after,
365
- .tooltip:focus:before,
366
- .tooltip:focus:after,
367
- .tooltip-top:hover:before,
368
- .tooltip-top:hover:after,
369
- .tooltip-top:focus:before,
370
- .tooltip-top:focus:after {
371
- -webkit-transform: translateY(-12px);
372
- -moz-transform: translateY(-12px);
373
- transform: translateY(-12px);
374
- }
375
-
376
- /* Left */
377
- .tooltip-left:before,
378
- .tooltip-left:after {
379
- right: 100%;
380
- bottom: 50%;
381
- left: auto;
382
- }
383
-
384
- .tooltip-left:before {
385
- margin-left: 0;
386
- margin-right: -12px;
387
- margin-bottom: 0;
388
- border-top-color: transparent;
389
- border-left-color: #000;
390
- border-left-color: hsla(0, 0%, 20%, 0.9);
391
- }
392
-
393
- .tooltip-left:hover:before,
394
- .tooltip-left:hover:after,
395
- .tooltip-left:focus:before,
396
- .tooltip-left:focus:after {
397
- -webkit-transform: translateX(-12px);
398
- -moz-transform: translateX(-12px);
399
- transform: translateX(-12px);
400
- }
401
-
402
- /* Bottom */
403
- .tooltip-bottom:before,
404
- .tooltip-bottom:after {
405
- top: 100%;
406
- bottom: auto;
407
- left: 50%;
408
- }
409
-
410
- .tooltip-bottom:before {
411
- margin-top: -12px;
412
- margin-bottom: 0;
413
- border-top-color: transparent;
414
- border-bottom-color: #000;
415
- border-bottom-color: hsla(0, 0%, 20%, 0.9);
416
- }
417
-
418
- .tooltip-bottom:hover:before,
419
- .tooltip-bottom:hover:after,
420
- .tooltip-bottom:focus:before,
421
- .tooltip-bottom:focus:after {
422
- -webkit-transform: translateY(12px);
423
- -moz-transform: translateY(12px);
424
- transform: translateY(12px);
425
- }
426
-
427
- /* Right */
428
- .tooltip-right:before,
429
- .tooltip-right:after {
430
- bottom: 50%;
431
- left: 100%;
432
- }
433
-
434
- .tooltip-right:before {
435
- margin-bottom: 0;
436
- margin-left: -12px;
437
- border-top-color: transparent;
438
- border-right-color: #000;
439
- border-right-color: hsla(0, 0%, 20%, 0.9);
440
- }
441
-
442
- .tooltip-right:hover:before,
443
- .tooltip-right:hover:after,
444
- .tooltip-right:focus:before,
445
- .tooltip-right:focus:after {
446
- -webkit-transform: translateX(12px);
447
- -moz-transform: translateX(12px);
448
- transform: translateX(12px);
449
- }
450
-
451
- /* Move directional arrows down a bit for left/right tooltips */
452
- .tooltip-left:before,
453
- .tooltip-right:before {
454
- top: 3px;
455
- }
456
-
457
- /* Vertically center tooltip content for left/right tooltips */
458
- .tooltip-left:after,
459
- .tooltip-right:after {
460
- margin-left: 0;
461
- margin-bottom: -16px;
462
- }
463
-
464
-
465
- /* Welcome Logo*/
466
- .wp-badge.sbp-welcome-logo {
467
- background-color: #fff;
468
- background-image: url(../inc/images/icon-128x128.jpg);
469
- background-position: center center;
470
- background-size: 70%;
471
- background-repeat: no-repeat;
472
- padding-top: 160px;
473
- }
474
-
475
-
476
- /* Update design */
477
- .sb-pack .label-text {
478
- display:inline-block;
479
- min-width: 350px;
480
- }
481
-
482
- .sb-pack .onoffswitch-wrapper {
483
- position: relative;
484
- width:100%;
485
- margin-bottom:15px;
486
- }
487
-
488
- .sb-pack .onoffswitch-wrapper span.chekbox-title {
489
- vertical-align: middle;
490
- display:inline-block;
491
- min-width: 350px;
492
- }
493
-
494
- .sb-pack .onoffswitch_label {
495
- display: inline-block;
496
- vertical-align: top;
497
- margin-right: 21px;
498
- margin-top: -1px;
499
- }
500
-
501
- .sb-pack .onoffswitch {
502
- position: relative;
503
- width: 52px;
504
- display: inline-block;
505
- -webkit-user-select: none;
506
- -moz-user-select: none;
507
- -ms-user-select: none;
508
- vertical-align:middle;
509
- }
510
-
511
- .epsilon-toggle {
512
- position: relative;
513
- user-select: none;
514
- display:inline-block;
515
- vertical-align: middle;
516
- }
517
-
518
- .epsilon-toggle__items {
519
- box-sizing: border-box;
520
- }
521
-
522
- .epsilon-toggle__input[type=checkbox] {
523
- border-radius: 2px;
524
- border: 2px solid #6c7781;
525
- margin-right: 12px;
526
- transition: none;
527
- height: 100%;
528
- left: 0;
529
- top: 0;
530
- margin: 0;
531
- padding: 0;
532
- opacity: 0;
533
- position: absolute;
534
- width: 100%;
535
- z-index: 1;
536
- }
537
-
538
- .epsilon-toggle__track {
539
- background-color: #fff;
540
- border: 2px solid #6c7781;
541
- border-radius: 9px;
542
- display: inline-block;
543
- height: 18px;
544
- width: 36px;
545
- vertical-align: top;
546
- transition: background .2s ease;
547
- }
548
-
549
- .epsilon-toggle__thumb {
550
- background-color: #6c7781;
551
- border: 5px solid #6c7781;
552
- border-radius: 50%;
553
- display: block;
554
- height: 10px;
555
- width: 10px;
556
- position: absolute;
557
- left: 4px;
558
- top: 4px;
559
- transition: transform .2s ease;
560
- }
561
-
562
- .epsilon-toggle__off {
563
- position: absolute;
564
- right: 6px;
565
- top: 6px;
566
- color: #6c7781;
567
- fill: currentColor;
568
- }
569
-
570
- .epsilon-toggle__on {
571
- position: absolute;
572
- top: 6px;
573
- left: 8px;
574
- border: 1px solid #fff;
575
- outline: 1px solid transparent;
576
- outline-offset: -1px;
577
- display: none;
578
- }
579
-
580
- /*.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items {*/
581
-
582
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
583
- background-color: #11a0d2;
584
- border: 9px solid transparent;
585
- }
586
-
587
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
588
- background-color: #fff;
589
- border-width: 0;
590
- transform: translateX(18px);
591
- }
592
-
593
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
594
- display: none;
595
- }
596
-
597
- .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__on {
598
- display: inline-block;
599
- }
600
-
601
- .sb-pack-tab .tooltip-right {
602
- display:inline-block;
603
- vertical-align: middle;
604
- }
605
-
606
- +/* Box */
607
- .sbp-box {
608
- margin-top: 15px;
609
- text-align: center;
610
- background: #FFF;
611
- position: relative;
612
- border: 1px solid rgba(0, 0, 0, .1);
613
- }
614
-
615
- .sbp-box img {
616
- width: 125px;
617
- height: 125px;
618
- margin: 0 auto;
619
- margin-bottom: 15px;
620
- display: block;
621
- border: none;
622
- }
623
-
624
- .sbp-box__name {
625
- margin-bottom: 10px;
626
- padding: 0 26px;
627
- font-weight: 600;
628
- }
629
-
630
- .sbp-box__description {
631
- font-size: 0.875em;
632
- margin-bottom: 15px;
633
- font-style: italic;
634
- padding-bottom:30px;
635
- }
636
-
637
- .sbp-box__action-bar {
638
- padding: 15px;
639
- -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
640
- box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
641
- white-space: nowrap;
642
- text-overflow: ellipsis;
643
- background: rgba(255, 255, 255, .65);
644
- text-align: left;
645
- }
646
-
647
- .sbp-box__action-button {
648
- position: absolute;
649
- bottom: 0px;
650
- right: 0px;
651
- padding: 9px 10px 10px;
652
- background: #f6f6f6;
653
- border-top: 1px solid rgba(0, 0, 0, .1);
654
- text-align: center;
655
- width: 100%;
656
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* `border-box`... ALL THE THINGS! */
2
+ html {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ *,
7
+ *:before,
8
+ *:after {
9
+ box-sizing: inherit;
10
+ }
11
+
12
+ .sb-pack-show {
13
+ display: block;
14
+ }
15
+
16
+ .sb-pack-hide {
17
+ display: none;
18
+ }
19
+
20
+ h3.sbp-emphasize {
21
+ color: #fa5148;
22
+ }
23
+
24
+ img.sbp-sp {
25
+ float: left;
26
+ margin-right: 20px;
27
+ }
28
+
29
+ p.description-link {
30
+ margin-top: -5px;
31
+ }
32
+
33
+ .wrap .sb-pack .welcome-panel .welcome-panel-column:first-child {
34
+ display: block !important;
35
+ }
36
+
37
+ .wrap .sb-pack .welcome-panel h4 {
38
+ margin: 1.33em 0 20px;
39
+ }
40
+
41
+ .wrap .sb-pack .sbp-inline-wrap {
42
+ display: inline-block;
43
+ margin-right: 10px;
44
+ vertical-align: top;
45
+ }
46
+
47
+ .wrap .sb-pack .sbp-more-width {
48
+ width: 300px;
49
+ }
50
+
51
+ .wrap .sb-pack .sbp-all-enqueued {
52
+ background-color: #fcfcfc;
53
+ padding: 5px 0px 10px;
54
+ border: 1px solid #ddd;
55
+ width: auto;
56
+ }
57
+
58
+ .wrap .sb-pack .sbp-width {
59
+ min-width: 200px;
60
+ width: auto;
61
+ padding: 0 20px;
62
+ }
63
+
64
+ .wrap .sb-pack .sbp-title-scripts {
65
+ min-width: 200px;
66
+ width: auto;
67
+ display: inline-block;
68
+ font-weight: 700;
69
+ padding: 0 20px;
70
+ }
71
+
72
+ .wrap .sb-pack .sbp-columns1 {
73
+ display: inline-block;
74
+ }
75
+
76
+ .wrap .sb-pack .sbp-columns2 {
77
+ display: inline-block;
78
+ max-width: 73%;
79
+ }
80
+
81
+ .wrap .sb-pack .sbp-title-div {
82
+ height: 50px;
83
+ clear: both;
84
+ }
85
+
86
+ .wrap .sb-pack .sbp-amount {
87
+ background-color: transparent;
88
+ border: medium none;
89
+ box-shadow: none;
90
+ }
91
+
92
+ .wrap .sb-pack .sbp-slider {
93
+ width: 40%;
94
+ }
95
+
96
+ .wrap .sb-pack p {
97
+ color: #464646;
98
+ }
99
+
100
+ .wrap .sb-pack p.sp-link {
101
+ text-align: center;
102
+ margin-bottom: 20px;
103
+ }
104
+
105
+ .wrap .sb-pack .td-margin {
106
+ margin: 1.5em 0 1.5em;
107
+ }
108
+
109
+ .wrap .sb-pack .sbp-div-head {
110
+ border-bottom: 1px solid #e1e1e1;
111
+ margin: 0 0 5px;
112
+ padding: 0 0 5px;
113
+ }
114
+
115
+ .wrap .sb-pack .td-border {
116
+ border-bottom: 1px solid #e1e1e1;
117
+ margin: 10px 0;
118
+ }
119
+
120
+ .wrap .sb-pack .td-border-last {
121
+ border-bottom: 1px solid #e1e1e1;
122
+ margin: 1.5em 0;
123
+ }
124
+
125
+ .wrap .sb-pack .sbp-radio-content {
126
+ display: block;
127
+ }
128
+
129
+ .wrap .sb-pack .sbp-radio-content label {
130
+ display: block !important;
131
+ }
132
+
133
+ .wrap .sb-pack .sbp-box hr {
134
+ margin-left: 70px;
135
+ }
136
+
137
+ .wrap .sb-pack .sbp-1 {
138
+ padding-top: 10px;
139
+ }
140
+
141
+ .wrap .sb-pack .sbp-2 {
142
+ padding-bottom: 15px;
143
+ }
144
+
145
+ .wrap .sb-pack .sbp-3 {
146
+ padding-top: 5px;
147
+ }
148
+
149
+ .wrap .sb-pack .sbp-title-div .sbp-title {
150
+ font-weight: 300;
151
+ line-height: 26px;
152
+ padding-top: 16px;
153
+ padding-right: 15px;
154
+ display: block;
155
+ float: left;
156
+ }
157
+
158
+ .wrap .sb-pack .sbp-box {
159
+ background: #fff;
160
+ border: 1px solid #e5e5e5;
161
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
162
+ padding: 15px;
163
+ margin: 15px 0;
164
+ position: relative;
165
+ text-align: center;
166
+ }
167
+
168
+ .wrap .sb-pack .sbp-box p {
169
+ margin: 5px 0 5px 70px;
170
+ color: #777;
171
+ }
172
+
173
+ .wrap .sb-pack .sbp-infos {
174
+ display: block;
175
+ margin: 0 auto;
176
+ padding-left: 70px;
177
+ font-weight: 700;
178
+ color: #777;
179
+ }
180
+
181
+ .wrap .sb-pack .sbp-infos span {
182
+ color: #777;
183
+ font-weight: 400;
184
+ }
185
+
186
+ .wrap .sb-pack .sbp-infos-title {
187
+ font-weight: 700;
188
+ color: #777;
189
+ }
190
+
191
+ .wrap .sb-pack .sbp-box-legend, .wrap .sb-pack .sbp-box-version {
192
+ position: absolute;
193
+ left: 0;
194
+ top: 0;
195
+ height: 100%;
196
+ }
197
+
198
+ .wrap .sb-pack .sbp-box-version {
199
+ background: none repeat scroll 0% 0% #80828f;
200
+ padding: 20px 15px;
201
+ }
202
+
203
+ .wrap .sb-pack .sbp-box-legend {
204
+ background: none repeat scroll 0% 0% #fcc500;
205
+ padding: 15px 15px;
206
+ }
207
+
208
+ .wrap .sb-pack .sbp-box-legend:hover {
209
+ background-color: #f39c12;
210
+ }
211
+
212
+ .wrap .sb-pack .sbp-box-version:hover {
213
+ background-color: #6c6e79;
214
+ }
215
+
216
+ .wrap .sb-pack .sbp-icon-help, .wrap .sb-pack .sbp-icon-version {
217
+ color: #fff;
218
+ }
219
+
220
+ .wrap .sb-pack .sbp-icon:before {
221
+ content: "\f185";
222
+ display: inline-block;
223
+ -webkit-font-smoothing: antialiased;
224
+ font: normal 36px/0.6 'dashicons';
225
+ vertical-align: sub;
226
+ color: #fa5148;
227
+ padding-right: 5px;
228
+ }
229
+
230
+ .wrap .sb-pack .sbp-icon-information:before {
231
+ content: "\f348";
232
+ display: inline-block;
233
+ -webkit-font-smoothing: antialiased;
234
+ font: normal 28px/1 'dashicons';
235
+ vertical-align: middle;
236
+ color: #c9d6e2;
237
+ padding-right: 5px;
238
+ }
239
+
240
+ .wrap .sb-pack .sbp-icon-version:before {
241
+ content: "\f348";
242
+ display: inline-block;
243
+ -webkit-font-smoothing: antialiased;
244
+ font: normal 30px/1 'dashicons';
245
+ vertical-align: top;
246
+ }
247
+
248
+ .wrap .sb-pack .sbp-icon-help:before {
249
+ content: "\f123";
250
+ display: inline-block;
251
+ -webkit-font-smoothing: antialiased;
252
+ font: normal 30px/1 'dashicons';
253
+ vertical-align: top;
254
+ }
255
+
256
+ /* sbp-tooltips */
257
+ /**
258
+ * Tooltip Styles
259
+ */
260
+
261
+ /* Base styles for the element that has a tooltip */
262
+ [data-tooltip],
263
+ .tooltip {
264
+ position: relative;
265
+ cursor: pointer;
266
+ }
267
+
268
+ /* Base styles for the entire tooltip */
269
+ [data-tooltip]:before,
270
+ [data-tooltip]:after,
271
+ .tooltip:before,
272
+ .tooltip:after {
273
+ position: absolute;
274
+ visibility: hidden;
275
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
276
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
277
+ opacity: 0;
278
+ -webkit-transition: opacity 0.2s ease-in-out,
279
+ visibility 0.2s ease-in-out,
280
+ -webkit-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
281
+ -moz-transition: opacity 0.2s ease-in-out,
282
+ visibility 0.2s ease-in-out,
283
+ -moz-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
284
+ transition: opacity 0.2s ease-in-out,
285
+ visibility 0.2s ease-in-out,
286
+ transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
287
+ -webkit-transform: translate3d(0, 0, 0);
288
+ -moz-transform: translate3d(0, 0, 0);
289
+ transform: translate3d(0, 0, 0);
290
+ pointer-events: none;
291
+ }
292
+
293
+ /* Show the entire tooltip on hover and focus */
294
+ [data-tooltip]:hover:before,
295
+ [data-tooltip]:hover:after,
296
+ [data-tooltip]:focus:before,
297
+ [data-tooltip]:focus:after,
298
+ .tooltip:hover:before,
299
+ .tooltip:hover:after,
300
+ .tooltip:focus:before,
301
+ .tooltip:focus:after {
302
+ visibility: visible;
303
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
304
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
305
+ opacity: 1;
306
+ }
307
+
308
+ /* Base styles for the tooltip's directional arrow */
309
+ .tooltip:before,
310
+ [data-tooltip]:before {
311
+ z-index: 1001;
312
+ border: 6px solid transparent;
313
+ background: transparent;
314
+ content: "";
315
+ }
316
+
317
+ /* Base styles for the tooltip's content area */
318
+ .tooltip:after,
319
+ [data-tooltip]:after {
320
+ z-index: 1000;
321
+ padding: 8px;
322
+ width: 360px;
323
+ background-color: #000;
324
+ background-color: hsla(0, 0%, 20%, 1);
325
+ color: #fff;
326
+ content: attr(data-tooltip);
327
+ line-height: 1.75;
328
+ }
329
+
330
+ /* Directions */
331
+
332
+ /* Top (default) */
333
+ [data-tooltip]:before,
334
+ [data-tooltip]:after,
335
+ .tooltip:before,
336
+ .tooltip:after,
337
+ .tooltip-top:before,
338
+ .tooltip-top:after {
339
+ bottom: 100%;
340
+ left: 50%;
341
+ }
342
+
343
+ [data-tooltip]:before,
344
+ .tooltip:before,
345
+ .tooltip-top:before {
346
+ margin-left: -6px;
347
+ margin-bottom: -12px;
348
+ border-top-color: #000;
349
+ border-top-color: hsla(0, 0%, 20%, 0.9);
350
+ }
351
+
352
+ /* Horizontally align top/bottom tooltips */
353
+ [data-tooltip]:after,
354
+ .tooltip:after,
355
+ .tooltip-top:after {
356
+ margin-left: -80px;
357
+ }
358
+
359
+ [data-tooltip]:hover:before,
360
+ [data-tooltip]:hover:after,
361
+ [data-tooltip]:focus:before,
362
+ [data-tooltip]:focus:after,
363
+ .tooltip:hover:before,
364
+ .tooltip:hover:after,
365
+ .tooltip:focus:before,
366
+ .tooltip:focus:after,
367
+ .tooltip-top:hover:before,
368
+ .tooltip-top:hover:after,
369
+ .tooltip-top:focus:before,
370
+ .tooltip-top:focus:after {
371
+ -webkit-transform: translateY(-12px);
372
+ -moz-transform: translateY(-12px);
373
+ transform: translateY(-12px);
374
+ }
375
+
376
+ /* Left */
377
+ .tooltip-left:before,
378
+ .tooltip-left:after {
379
+ right: 100%;
380
+ bottom: 50%;
381
+ left: auto;
382
+ }
383
+
384
+ .tooltip-left:before {
385
+ margin-left: 0;
386
+ margin-right: -12px;
387
+ margin-bottom: 0;
388
+ border-top-color: transparent;
389
+ border-left-color: #000;
390
+ border-left-color: hsla(0, 0%, 20%, 0.9);
391
+ }
392
+
393
+ .tooltip-left:hover:before,
394
+ .tooltip-left:hover:after,
395
+ .tooltip-left:focus:before,
396
+ .tooltip-left:focus:after {
397
+ -webkit-transform: translateX(-12px);
398
+ -moz-transform: translateX(-12px);
399
+ transform: translateX(-12px);
400
+ }
401
+
402
+ /* Bottom */
403
+ .tooltip-bottom:before,
404
+ .tooltip-bottom:after {
405
+ top: 100%;
406
+ bottom: auto;
407
+ left: 50%;
408
+ }
409
+
410
+ .tooltip-bottom:before {
411
+ margin-top: -12px;
412
+ margin-bottom: 0;
413
+ border-top-color: transparent;
414
+ border-bottom-color: #000;
415
+ border-bottom-color: hsla(0, 0%, 20%, 0.9);
416
+ }
417
+
418
+ .tooltip-bottom:hover:before,
419
+ .tooltip-bottom:hover:after,
420
+ .tooltip-bottom:focus:before,
421
+ .tooltip-bottom:focus:after {
422
+ -webkit-transform: translateY(12px);
423
+ -moz-transform: translateY(12px);
424
+ transform: translateY(12px);
425
+ }
426
+
427
+ /* Right */
428
+ .tooltip-right:before,
429
+ .tooltip-right:after {
430
+ bottom: 50%;
431
+ left: 100%;
432
+ }
433
+
434
+ .tooltip-right:before {
435
+ margin-bottom: 0;
436
+ margin-left: -12px;
437
+ border-top-color: transparent;
438
+ border-right-color: #000;
439
+ border-right-color: hsla(0, 0%, 20%, 0.9);
440
+ }
441
+
442
+ .tooltip-right:hover:before,
443
+ .tooltip-right:hover:after,
444
+ .tooltip-right:focus:before,
445
+ .tooltip-right:focus:after {
446
+ -webkit-transform: translateX(12px);
447
+ -moz-transform: translateX(12px);
448
+ transform: translateX(12px);
449
+ }
450
+
451
+ /* Move directional arrows down a bit for left/right tooltips */
452
+ .tooltip-left:before,
453
+ .tooltip-right:before {
454
+ top: 3px;
455
+ }
456
+
457
+ /* Vertically center tooltip content for left/right tooltips */
458
+ .tooltip-left:after,
459
+ .tooltip-right:after {
460
+ margin-left: 0;
461
+ margin-bottom: -16px;
462
+ }
463
+
464
+
465
+ /* Welcome Logo*/
466
+ .wp-badge.sbp-welcome-logo {
467
+ background-color: #fff;
468
+ background-image: url(../inc/images/icon-128x128.jpg);
469
+ background-position: center center;
470
+ background-size: 70%;
471
+ background-repeat: no-repeat;
472
+ padding-top: 160px;
473
+ }
474
+
475
+
476
+ /* Update design */
477
+ .sb-pack .label-text {
478
+ display:inline-block;
479
+ min-width: 350px;
480
+ }
481
+
482
+ .sb-pack .onoffswitch-wrapper {
483
+ position: relative;
484
+ width:100%;
485
+ margin-bottom:15px;
486
+ }
487
+
488
+ .sb-pack .onoffswitch-wrapper span.chekbox-title {
489
+ vertical-align: middle;
490
+ display:inline-block;
491
+ min-width: 350px;
492
+ }
493
+
494
+ .sb-pack .onoffswitch_label {
495
+ display: inline-block;
496
+ vertical-align: top;
497
+ margin-right: 21px;
498
+ margin-top: -1px;
499
+ }
500
+
501
+ .sb-pack .onoffswitch {
502
+ position: relative;
503
+ width: 52px;
504
+ display: inline-block;
505
+ -webkit-user-select: none;
506
+ -moz-user-select: none;
507
+ -ms-user-select: none;
508
+ vertical-align:middle;
509
+ }
510
+
511
+ .epsilon-toggle {
512
+ position: relative;
513
+ user-select: none;
514
+ display:inline-block;
515
+ vertical-align: middle;
516
+ }
517
+
518
+ .epsilon-toggle__items {
519
+ box-sizing: border-box;
520
+ }
521
+
522
+ .epsilon-toggle__input[type=checkbox] {
523
+ border-radius: 2px;
524
+ border: 2px solid #6c7781;
525
+ margin-right: 12px;
526
+ transition: none;
527
+ height: 100%;
528
+ left: 0;
529
+ top: 0;
530
+ margin: 0;
531
+ padding: 0;
532
+ opacity: 0;
533
+ position: absolute;
534
+ width: 100%;
535
+ z-index: 1;
536
+ }
537
+
538
+ .epsilon-toggle__track {
539
+ background-color: #fff;
540
+ border: 2px solid #6c7781;
541
+ border-radius: 9px;
542
+ display: inline-block;
543
+ height: 18px;
544
+ width: 36px;
545
+ vertical-align: top;
546
+ transition: background .2s ease;
547
+ }
548
+
549
+ .epsilon-toggle__thumb {
550
+ background-color: #6c7781;
551
+ border: 5px solid #6c7781;
552
+ border-radius: 50%;
553
+ display: block;
554
+ height: 10px;
555
+ width: 10px;
556
+ position: absolute;
557
+ left: 4px;
558
+ top: 4px;
559
+ transition: transform .2s ease;
560
+ }
561
+
562
+ .epsilon-toggle__off {
563
+ position: absolute;
564
+ right: 6px;
565
+ top: 6px;
566
+ color: #6c7781;
567
+ fill: currentColor;
568
+ }
569
+
570
+ .epsilon-toggle__on {
571
+ position: absolute;
572
+ top: 6px;
573
+ left: 8px;
574
+ border: 1px solid #fff;
575
+ outline: 1px solid transparent;
576
+ outline-offset: -1px;
577
+ display: none;
578
+ }
579
+
580
+ /*.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items {*/
581
+
582
+ .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
583
+ background-color: #11a0d2;
584
+ border: 9px solid transparent;
585
+ }
586
+
587
+ .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
588
+ background-color: #fff;
589
+ border-width: 0;
590
+ transform: translateX(18px);
591
+ }
592
+
593
+ .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
594
+ display: none;
595
+ }
596
+
597
+ .epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__on {
598
+ display: inline-block;
599
+ }
600
+
601
+ .sb-pack-tab .tooltip-right {
602
+ display:inline-block;
603
+ vertical-align: middle;
604
+ }
605
+
606
+ +/* Box */
607
+ .sbp-box {
608
+ margin-top: 15px;
609
+ text-align: center;
610
+ background: #FFF;
611
+ position: relative;
612
+ border: 1px solid rgba(0, 0, 0, .1);
613
+ }
614
+
615
+ .sbp-box img {
616
+ width: 125px;
617
+ height: 125px;
618
+ margin: 0 auto;
619
+ margin-bottom: 15px;
620
+ display: block;
621
+ border: none;
622
+ }
623
+
624
+ .sbp-box__name {
625
+ margin-bottom: 10px;
626
+ padding: 0 26px;
627
+ font-weight: 600;
628
+ }
629
+
630
+ .sbp-box__description {
631
+ font-size: 0.875em;
632
+ margin-bottom: 15px;
633
+ font-style: italic;
634
+ padding-bottom:30px;
635
+ }
636
+
637
+ .sbp-box__action-bar {
638
+ padding: 15px;
639
+ -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
640
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
641
+ white-space: nowrap;
642
+ text-overflow: ellipsis;
643
+ background: rgba(255, 255, 255, .65);
644
+ text-align: left;
645
+ }
646
+
647
+ .sbp-box__action-button {
648
+ position: absolute;
649
+ bottom: 0px;
650
+ right: 0px;
651
+ padding: 9px 10px 10px;
652
+ background: #f6f6f6;
653
+ border-top: 1px solid rgba(0, 0, 0, .1);
654
+ text-align: center;
655
+ width: 100%;
656
+ }
657
+
658
+ .sbp-static-notice {
659
+ position: relative;
660
+ display: inline-block;
661
+ width: 100%;
662
+ padding: 1% 2%;
663
+ margin: 10px 0 0;
664
+ line-height:1.5;
665
+ border: 1px solid #e4e0e0;
666
+ background: #fff;
667
+ color: #0f81aa;
668
+ box-shadow: 3px 4px 6px -6px #c3bcbc;
669
+ }
css/vendors/jquery-ui/jquery-ui.min.css CHANGED
@@ -1,7 +1,7 @@
1
- /*! jQuery UI - v1.12.1 - 2016-09-14
2
- * http://jqueryui.com
3
- * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
5
- * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
-
7
  .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("jquery-ui/images/ui-icons_444444_256x240.png")} .ui-widget-header .ui-icon{background-image:url("jquery-ui/images/ui-icons_444444_256x240.png")} .ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("jquery-ui/images/ui-icons_555555_256x240.png")} .ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("jquery-ui/images/ui-icons_ffffff_256x240.png")} .ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("jquery-ui/images/ui-icons_777620_256x240.png")} .ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("jquery-ui/images/ui-icons_cc0000_256x240.png")} .ui-button .ui-icon{background-image:url("jquery-ui/images/ui-icons_777777_256x240.png")} .ui-icon-blank{background-position:16px 16px} .ui-icon-caret-1-n{background-position:0 0} .ui-icon-caret-1-ne{background-position:-16px 0} .ui-icon-caret-1-e{background-position:-32px 0} .ui-icon-caret-1-se{background-position:-48px 0} .ui-icon-caret-1-s{background-position:-65px 0} .ui-icon-caret-1-sw{background-position:-80px 0} .ui-icon-caret-1-w{background-position:-96px 0} .ui-icon-caret-1-nw{background-position:-112px 0} .ui-icon-caret-2-n-s{background-position:-128px 0} .ui-icon-caret-2-e-w{background-position:-144px 0} .ui-icon-triangle-1-n{background-position:0 -16px} .ui-icon-triangle-1-ne{background-position:-16px -16px} .ui-icon-triangle-1-e{background-position:-32px -16px} .ui-icon-triangle-1-se{background-position:-48px -16px} .ui-icon-triangle-1-s{background-position:-65px -16px} .ui-icon-triangle-1-sw{background-position:-80px -16px} .ui-icon-triangle-1-w{background-position:-96px -16px} .ui-icon-triangle-1-nw{background-position:-112px -16px} .ui-icon-triangle-2-n-s{background-position:-128px -16px} .ui-icon-triangle-2-e-w{background-position:-144px -16px} .ui-icon-arrow-1-n{background-position:0 -32px} .ui-icon-arrow-1-ne{background-position:-16px -32px} .ui-icon-arrow-1-e{background-position:-32px -32px} .ui-icon-arrow-1-se{background-position:-48px -32px} .ui-icon-arrow-1-s{background-position:-65px -32px} .ui-icon-arrow-1-sw{background-position:-80px -32px} .ui-icon-arrow-1-w{background-position:-96px -32px} .ui-icon-arrow-1-nw{background-position:-112px -32px} .ui-icon-arrow-2-n-s{background-position:-128px -32px} .ui-icon-arrow-2-ne-sw{background-position:-144px -32px} .ui-icon-arrow-2-e-w{background-position:-160px -32px} .ui-icon-arrow-2-se-nw{background-position:-176px -32px} .ui-icon-arrowstop-1-n{background-position:-192px -32px} .ui-icon-arrowstop-1-e{background-position:-208px -32px} .ui-icon-arrowstop-1-s{background-position:-224px -32px} .ui-icon-arrowstop-1-w{background-position:-240px -32px} .ui-icon-arrowthick-1-n{background-position:1px -48px} .ui-icon-arrowthick-1-ne{background-position:-16px -48px} .ui-icon-arrowthick-1-e{background-position:-32px -48px} .ui-icon-arrowthick-1-se{background-position:-48px -48px} .ui-icon-arrowthick-1-s{background-position:-64px -48px} .ui-icon-arrowthick-1-sw{background-position:-80px -48px} .ui-icon-arrowthick-1-w{background-position:-96px -48px} .ui-icon-arrowthick-1-nw{background-position:-112px -48px} .ui-icon-arrowthick-2-n-s{background-position:-128px -48px} .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px} .ui-icon-arrowthick-2-e-w{background-position:-160px -48px} .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px} .ui-icon-arrowthickstop-1-n{background-position:-192px -48px} .ui-icon-arrowthickstop-1-e{background-position:-208px -48px} .ui-icon-arrowthickstop-1-s{background-position:-224px -48px} .ui-icon-arrowthickstop-1-w{background-position:-240px -48px} .ui-icon-arrowreturnthick-1-w{background-position:0 -64px} .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px} .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px} .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px} .ui-icon-arrowreturn-1-w{background-position:-64px -64px} .ui-icon-arrowreturn-1-n{background-position:-80px -64px} .ui-icon-arrowreturn-1-e{background-position:-96px -64px} .ui-icon-arrowreturn-1-s{background-position:-112px -64px} .ui-icon-arrowrefresh-1-w{background-position:-128px -64px} .ui-icon-arrowrefresh-1-n{background-position:-144px -64px} .ui-icon-arrowrefresh-1-e{background-position:-160px -64px} .ui-icon-arrowrefresh-1-s{background-position:-176px -64px} .ui-icon-arrow-4{background-position:0 -80px} .ui-icon-arrow-4-diag{background-position:-16px -80px} .ui-icon-extlink{background-position:-32px -80px} .ui-icon-newwin{background-position:-48px -80px} .ui-icon-refresh{background-position:-64px -80px} .ui-icon-shuffle{background-position:-80px -80px} .ui-icon-transfer-e-w{background-position:-96px -80px} .ui-icon-transferthick-e-w{background-position:-112px -80px} .ui-icon-folder-collapsed{background-position:0 -96px} .ui-icon-folder-open{background-position:-16px -96px} .ui-icon-document{background-position:-32px -96px} .ui-icon-document-b{background-position:-48px -96px} .ui-icon-note{background-position:-64px -96px} .ui-icon-mail-closed{background-position:-80px -96px} .ui-icon-mail-open{background-position:-96px -96px} .ui-icon-suitcase{background-position:-112px -96px} .ui-icon-comment{background-position:-128px -96px} .ui-icon-person{background-position:-144px -96px} .ui-icon-print{background-position:-160px -96px} .ui-icon-trash{background-position:-176px -96px} .ui-icon-locked{background-position:-192px -96px} .ui-icon-unlocked{background-position:-208px -96px} .ui-icon-bookmark{background-position:-224px -96px} .ui-icon-tag{background-position:-240px -96px} .ui-icon-home{background-position:0 -112px} .ui-icon-flag{background-position:-16px -112px} .ui-icon-calendar{background-position:-32px -112px} .ui-icon-cart{background-position:-48px -112px} .ui-icon-pencil{background-position:-64px -112px} .ui-icon-clock{background-position:-80px -112px} .ui-icon-disk{background-position:-96px -112px} .ui-icon-calculator{background-position:-112px -112px} .ui-icon-zoomin{background-position:-128px -112px} .ui-icon-zoomout{background-position:-144px -112px} .ui-icon-search{background-position:-160px -112px} .ui-icon-wrench{background-position:-176px -112px} .ui-icon-gear{background-position:-192px -112px} .ui-icon-heart{background-position:-208px -112px} .ui-icon-star{background-position:-224px -112px} .ui-icon-link{background-position:-240px -112px} .ui-icon-cancel{background-position:0 -128px} .ui-icon-plus{background-position:-16px -128px} .ui-icon-plusthick{background-position:-32px -128px} .ui-icon-minus{background-position:-48px -128px} .ui-icon-minusthick{background-position:-64px -128px} .ui-icon-close{background-position:-80px -128px} .ui-icon-closethick{background-position:-96px -128px} .ui-icon-key{background-position:-112px -128px} .ui-icon-lightbulb{background-position:-128px -128px} .ui-icon-scissors{background-position:-144px -128px} .ui-icon-clipboard{background-position:-160px -128px} .ui-icon-copy{background-position:-176px -128px} .ui-icon-contact{background-position:-192px -128px} .ui-icon-image{background-position:-208px -128px} .ui-icon-video{background-position:-224px -128px} .ui-icon-script{background-position:-240px -128px} .ui-icon-alert{background-position:0 -144px} .ui-icon-info{background-position:-16px -144px} .ui-icon-notice{background-position:-32px -144px} .ui-icon-help{background-position:-48px -144px} .ui-icon-check{background-position:-64px -144px} .ui-icon-bullet{background-position:-80px -144px} .ui-icon-radio-on{background-position:-96px -144px} .ui-icon-radio-off{background-position:-112px -144px} .ui-icon-pin-w{background-position:-128px -144px} .ui-icon-pin-s{background-position:-144px -144px} .ui-icon-play{background-position:0 -160px} .ui-icon-pause{background-position:-16px -160px} .ui-icon-seek-next{background-position:-32px -160px} .ui-icon-seek-prev{background-position:-48px -160px} .ui-icon-seek-end{background-position:-64px -160px} .ui-icon-seek-start{background-position:-80px -160px} .ui-icon-seek-first{background-position:-80px -160px} .ui-icon-stop{background-position:-96px -160px} .ui-icon-eject{background-position:-112px -160px} .ui-icon-volume-off{background-position:-128px -160px} .ui-icon-volume-on{background-position:-144px -160px} .ui-icon-power{background-position:0 -176px} .ui-icon-signal-diag{background-position:-16px -176px} .ui-icon-signal{background-position:-32px -176px} .ui-icon-battery-0{background-position:-48px -176px} .ui-icon-battery-1{background-position:-64px -176px} .ui-icon-battery-2{background-position:-80px -176px} .ui-icon-battery-3{background-position:-96px -176px} .ui-icon-circle-plus{background-position:0 -192px} .ui-icon-circle-minus{background-position:-16px -192px} .ui-icon-circle-close{background-position:-32px -192px} .ui-icon-circle-triangle-e{background-position:-48px -192px} .ui-icon-circle-triangle-s{background-position:-64px -192px} .ui-icon-circle-triangle-w{background-position:-80px -192px} .ui-icon-circle-triangle-n{background-position:-96px -192px} .ui-icon-circle-arrow-e{background-position:-112px -192px} .ui-icon-circle-arrow-s{background-position:-128px -192px} .ui-icon-circle-arrow-w{background-position:-144px -192px} .ui-icon-circle-arrow-n{background-position:-160px -192px} .ui-icon-circle-zoomin{background-position:-176px -192px} .ui-icon-circle-zoomout{background-position:-192px -192px} .ui-icon-circle-check{background-position:-208px -192px} .ui-icon-circlesmall-plus{background-position:0 -208px} .ui-icon-circlesmall-minus{background-position:-16px -208px} .ui-icon-circlesmall-close{background-position:-32px -208px} .ui-icon-squaresmall-plus{background-position:-48px -208px} .ui-icon-squaresmall-minus{background-position:-64px -208px} .ui-icon-squaresmall-close{background-position:-80px -208px} .ui-icon-grip-dotted-vertical{background-position:0 -224px} .ui-icon-grip-dotted-horizontal{background-position:-16px -224px} .ui-icon-grip-solid-vertical{background-position:-32px -224px} .ui-icon-grip-solid-horizontal{background-position:-48px -224px} .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px} .ui-icon-grip-diagonal-se{background-position:-80px -224px} .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px} .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px} .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px} .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px} .ui-widget-overlay{background:#aaa;opacity:.003;filter:Alpha(Opacity=.3)} .ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
1
+ /*! jQuery UI - v1.12.1 - 2016-09-14
2
+ * http://jqueryui.com
3
+ * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
  .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("jquery-ui/images/ui-icons_444444_256x240.png")} .ui-widget-header .ui-icon{background-image:url("jquery-ui/images/ui-icons_444444_256x240.png")} .ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("jquery-ui/images/ui-icons_555555_256x240.png")} .ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("jquery-ui/images/ui-icons_ffffff_256x240.png")} .ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("jquery-ui/images/ui-icons_777620_256x240.png")} .ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("jquery-ui/images/ui-icons_cc0000_256x240.png")} .ui-button .ui-icon{background-image:url("jquery-ui/images/ui-icons_777777_256x240.png")} .ui-icon-blank{background-position:16px 16px} .ui-icon-caret-1-n{background-position:0 0} .ui-icon-caret-1-ne{background-position:-16px 0} .ui-icon-caret-1-e{background-position:-32px 0} .ui-icon-caret-1-se{background-position:-48px 0} .ui-icon-caret-1-s{background-position:-65px 0} .ui-icon-caret-1-sw{background-position:-80px 0} .ui-icon-caret-1-w{background-position:-96px 0} .ui-icon-caret-1-nw{background-position:-112px 0} .ui-icon-caret-2-n-s{background-position:-128px 0} .ui-icon-caret-2-e-w{background-position:-144px 0} .ui-icon-triangle-1-n{background-position:0 -16px} .ui-icon-triangle-1-ne{background-position:-16px -16px} .ui-icon-triangle-1-e{background-position:-32px -16px} .ui-icon-triangle-1-se{background-position:-48px -16px} .ui-icon-triangle-1-s{background-position:-65px -16px} .ui-icon-triangle-1-sw{background-position:-80px -16px} .ui-icon-triangle-1-w{background-position:-96px -16px} .ui-icon-triangle-1-nw{background-position:-112px -16px} .ui-icon-triangle-2-n-s{background-position:-128px -16px} .ui-icon-triangle-2-e-w{background-position:-144px -16px} .ui-icon-arrow-1-n{background-position:0 -32px} .ui-icon-arrow-1-ne{background-position:-16px -32px} .ui-icon-arrow-1-e{background-position:-32px -32px} .ui-icon-arrow-1-se{background-position:-48px -32px} .ui-icon-arrow-1-s{background-position:-65px -32px} .ui-icon-arrow-1-sw{background-position:-80px -32px} .ui-icon-arrow-1-w{background-position:-96px -32px} .ui-icon-arrow-1-nw{background-position:-112px -32px} .ui-icon-arrow-2-n-s{background-position:-128px -32px} .ui-icon-arrow-2-ne-sw{background-position:-144px -32px} .ui-icon-arrow-2-e-w{background-position:-160px -32px} .ui-icon-arrow-2-se-nw{background-position:-176px -32px} .ui-icon-arrowstop-1-n{background-position:-192px -32px} .ui-icon-arrowstop-1-e{background-position:-208px -32px} .ui-icon-arrowstop-1-s{background-position:-224px -32px} .ui-icon-arrowstop-1-w{background-position:-240px -32px} .ui-icon-arrowthick-1-n{background-position:1px -48px} .ui-icon-arrowthick-1-ne{background-position:-16px -48px} .ui-icon-arrowthick-1-e{background-position:-32px -48px} .ui-icon-arrowthick-1-se{background-position:-48px -48px} .ui-icon-arrowthick-1-s{background-position:-64px -48px} .ui-icon-arrowthick-1-sw{background-position:-80px -48px} .ui-icon-arrowthick-1-w{background-position:-96px -48px} .ui-icon-arrowthick-1-nw{background-position:-112px -48px} .ui-icon-arrowthick-2-n-s{background-position:-128px -48px} .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px} .ui-icon-arrowthick-2-e-w{background-position:-160px -48px} .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px} .ui-icon-arrowthickstop-1-n{background-position:-192px -48px} .ui-icon-arrowthickstop-1-e{background-position:-208px -48px} .ui-icon-arrowthickstop-1-s{background-position:-224px -48px} .ui-icon-arrowthickstop-1-w{background-position:-240px -48px} .ui-icon-arrowreturnthick-1-w{background-position:0 -64px} .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px} .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px} .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px} .ui-icon-arrowreturn-1-w{background-position:-64px -64px} .ui-icon-arrowreturn-1-n{background-position:-80px -64px} .ui-icon-arrowreturn-1-e{background-position:-96px -64px} .ui-icon-arrowreturn-1-s{background-position:-112px -64px} .ui-icon-arrowrefresh-1-w{background-position:-128px -64px} .ui-icon-arrowrefresh-1-n{background-position:-144px -64px} .ui-icon-arrowrefresh-1-e{background-position:-160px -64px} .ui-icon-arrowrefresh-1-s{background-position:-176px -64px} .ui-icon-arrow-4{background-position:0 -80px} .ui-icon-arrow-4-diag{background-position:-16px -80px} .ui-icon-extlink{background-position:-32px -80px} .ui-icon-newwin{background-position:-48px -80px} .ui-icon-refresh{background-position:-64px -80px} .ui-icon-shuffle{background-position:-80px -80px} .ui-icon-transfer-e-w{background-position:-96px -80px} .ui-icon-transferthick-e-w{background-position:-112px -80px} .ui-icon-folder-collapsed{background-position:0 -96px} .ui-icon-folder-open{background-position:-16px -96px} .ui-icon-document{background-position:-32px -96px} .ui-icon-document-b{background-position:-48px -96px} .ui-icon-note{background-position:-64px -96px} .ui-icon-mail-closed{background-position:-80px -96px} .ui-icon-mail-open{background-position:-96px -96px} .ui-icon-suitcase{background-position:-112px -96px} .ui-icon-comment{background-position:-128px -96px} .ui-icon-person{background-position:-144px -96px} .ui-icon-print{background-position:-160px -96px} .ui-icon-trash{background-position:-176px -96px} .ui-icon-locked{background-position:-192px -96px} .ui-icon-unlocked{background-position:-208px -96px} .ui-icon-bookmark{background-position:-224px -96px} .ui-icon-tag{background-position:-240px -96px} .ui-icon-home{background-position:0 -112px} .ui-icon-flag{background-position:-16px -112px} .ui-icon-calendar{background-position:-32px -112px} .ui-icon-cart{background-position:-48px -112px} .ui-icon-pencil{background-position:-64px -112px} .ui-icon-clock{background-position:-80px -112px} .ui-icon-disk{background-position:-96px -112px} .ui-icon-calculator{background-position:-112px -112px} .ui-icon-zoomin{background-position:-128px -112px} .ui-icon-zoomout{background-position:-144px -112px} .ui-icon-search{background-position:-160px -112px} .ui-icon-wrench{background-position:-176px -112px} .ui-icon-gear{background-position:-192px -112px} .ui-icon-heart{background-position:-208px -112px} .ui-icon-star{background-position:-224px -112px} .ui-icon-link{background-position:-240px -112px} .ui-icon-cancel{background-position:0 -128px} .ui-icon-plus{background-position:-16px -128px} .ui-icon-plusthick{background-position:-32px -128px} .ui-icon-minus{background-position:-48px -128px} .ui-icon-minusthick{background-position:-64px -128px} .ui-icon-close{background-position:-80px -128px} .ui-icon-closethick{background-position:-96px -128px} .ui-icon-key{background-position:-112px -128px} .ui-icon-lightbulb{background-position:-128px -128px} .ui-icon-scissors{background-position:-144px -128px} .ui-icon-clipboard{background-position:-160px -128px} .ui-icon-copy{background-position:-176px -128px} .ui-icon-contact{background-position:-192px -128px} .ui-icon-image{background-position:-208px -128px} .ui-icon-video{background-position:-224px -128px} .ui-icon-script{background-position:-240px -128px} .ui-icon-alert{background-position:0 -144px} .ui-icon-info{background-position:-16px -144px} .ui-icon-notice{background-position:-32px -144px} .ui-icon-help{background-position:-48px -144px} .ui-icon-check{background-position:-64px -144px} .ui-icon-bullet{background-position:-80px -144px} .ui-icon-radio-on{background-position:-96px -144px} .ui-icon-radio-off{background-position:-112px -144px} .ui-icon-pin-w{background-position:-128px -144px} .ui-icon-pin-s{background-position:-144px -144px} .ui-icon-play{background-position:0 -160px} .ui-icon-pause{background-position:-16px -160px} .ui-icon-seek-next{background-position:-32px -160px} .ui-icon-seek-prev{background-position:-48px -160px} .ui-icon-seek-end{background-position:-64px -160px} .ui-icon-seek-start{background-position:-80px -160px} .ui-icon-seek-first{background-position:-80px -160px} .ui-icon-stop{background-position:-96px -160px} .ui-icon-eject{background-position:-112px -160px} .ui-icon-volume-off{background-position:-128px -160px} .ui-icon-volume-on{background-position:-144px -160px} .ui-icon-power{background-position:0 -176px} .ui-icon-signal-diag{background-position:-16px -176px} .ui-icon-signal{background-position:-32px -176px} .ui-icon-battery-0{background-position:-48px -176px} .ui-icon-battery-1{background-position:-64px -176px} .ui-icon-battery-2{background-position:-80px -176px} .ui-icon-battery-3{background-position:-96px -176px} .ui-icon-circle-plus{background-position:0 -192px} .ui-icon-circle-minus{background-position:-16px -192px} .ui-icon-circle-close{background-position:-32px -192px} .ui-icon-circle-triangle-e{background-position:-48px -192px} .ui-icon-circle-triangle-s{background-position:-64px -192px} .ui-icon-circle-triangle-w{background-position:-80px -192px} .ui-icon-circle-triangle-n{background-position:-96px -192px} .ui-icon-circle-arrow-e{background-position:-112px -192px} .ui-icon-circle-arrow-s{background-position:-128px -192px} .ui-icon-circle-arrow-w{background-position:-144px -192px} .ui-icon-circle-arrow-n{background-position:-160px -192px} .ui-icon-circle-zoomin{background-position:-176px -192px} .ui-icon-circle-zoomout{background-position:-192px -192px} .ui-icon-circle-check{background-position:-208px -192px} .ui-icon-circlesmall-plus{background-position:0 -208px} .ui-icon-circlesmall-minus{background-position:-16px -208px} .ui-icon-circlesmall-close{background-position:-32px -208px} .ui-icon-squaresmall-plus{background-position:-48px -208px} .ui-icon-squaresmall-minus{background-position:-64px -208px} .ui-icon-squaresmall-close{background-position:-80px -208px} .ui-icon-grip-dotted-vertical{background-position:0 -224px} .ui-icon-grip-dotted-horizontal{background-position:-16px -224px} .ui-icon-grip-solid-vertical{background-position:-32px -224px} .ui-icon-grip-solid-horizontal{background-position:-48px -224px} .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px} .ui-icon-grip-diagonal-se{background-position:-80px -224px} .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px} .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px} .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px} .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px} .ui-widget-overlay{background:#aaa;opacity:.003;filter:Alpha(Opacity=.3)} .ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
inc/class-sb-pack-review.php CHANGED
@@ -1,184 +1,184 @@
1
- <?php
2
-
3
- class SB_Pack_Review {
4
-
5
- private static $instance;
6
- private $when = array( 5, 15, 30 );
7
- private $value;
8
- private $messages;
9
- private $link = 'https://wordpress.org/support/plugin/%s/reviews/#new-post';
10
- private $slug = '';
11
- private $option_name = '';
12
-
13
- function __construct( $args ) {
14
-
15
- if ( isset( $args['slug'] ) ) {
16
- $this->slug = $args['slug'];
17
- }
18
-
19
- $this->value = $this->value();
20
-
21
- $this->messages = array(
22
- 'notice' => __( "Hey, I noticed you have installed our plugin for %s day(s) - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'speed-booster-pack' ),
23
- 'rate' => __( 'Ok, you deserve it', 'speed-booster-pack' ),
24
- 'rated' => __( 'I already did', 'speed-booster-pack' ),
25
- 'no_rate' => __( 'No, not good enough', 'speed-booster-pack' ),
26
- );
27
-
28
- if ( isset( $args['messages'] ) ) {
29
- $this->messages = wp_parse_args( $args['messages'], $this->messages );
30
- }
31
-
32
- $this->init();
33
-
34
- }
35
-
36
- public static function get_instance( $args ) {
37
- if ( null === static::$instance ) {
38
- static::$instance = new static( $args );
39
- }
40
-
41
- return static::$instance;
42
- }
43
-
44
- private function init() {
45
- if ( ! is_admin() ) {
46
- return;
47
- }
48
-
49
- add_action( 'wp_ajax_epsilon_review', array( $this, 'ajax' ) );
50
-
51
- if ( $this->check() ) {
52
- add_action( 'admin_notices', array( $this, 'five_star_wp_rate_notice' ) );
53
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
54
- add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
55
- }
56
-
57
- }
58
-
59
- private function check() {
60
-
61
- $options = get_option( 'sbp_settings' );
62
- $option = isset( $options['givemereview'] ) ? $options['givemereview'] : '';
63
- $currDate = date( 'Y-m-d' );
64
- if ( 'already-rated' == $option ) {
65
- return false;
66
- }
67
-
68
- if ( $this->value == $option ) {
69
- return false;
70
- }
71
-
72
- if ( is_array( $this->when ) ) {
73
- foreach ( $this->when as $et ) {
74
- if ( date( 'Y-m-d', strtotime( $currDate . ' +' . $et . ' days' ) ) == $this->value ) {
75
- return true;
76
- }
77
-
78
- }
79
- }
80
-
81
- }
82
-
83
- private function value() {
84
-
85
- $value = get_transient( 'sb_pack_review' );
86
-
87
- if ( $value ) {
88
-
89
- $current_time = time(); // or your date as well
90
- $trans_date = strtotime($value);
91
- $date_diff = $current_time - $trans_date;
92
-
93
- return round($date_diff / (60 * 60 * 24));
94
- }
95
-
96
- $date = date( 'Y-m-d' );
97
- set_transient( 'sb_pack_review', $date, 24 * 30 * HOUR_IN_SECONDS );
98
-
99
- }
100
-
101
- public function five_star_wp_rate_notice() {
102
-
103
- $url = sprintf( $this->link, $this->slug );
104
-
105
- ?>
106
- <div id="<?php echo $this->slug ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
107
- <p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ); ?></p>
108
- <p class="actions">
109
- <a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>"
110
- class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
111
- <a id="epsilon-rated" href="#"
112
- class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['rated'] ); ?></a>
113
- <a id="epsilon-no-rate" href="#"
114
- class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['no_rate'] ); ?></a>
115
- </p>
116
- </div>
117
- <?php
118
- }
119
-
120
- public function ajax() {
121
-
122
- check_ajax_referer( 'epsilon-review', 'security' );
123
-
124
- $options = get_option( 'sbp_settings', array() );
125
-
126
- if ( isset( $_POST['epsilon-review'] ) ) {
127
- $options['givemereview'] = 'already-rated';
128
- } else {
129
- $options['givemereview'] = $this->value;
130
- }
131
-
132
- update_option( 'sbp_settings', $options );
133
-
134
- wp_die( 'ok' );
135
-
136
- }
137
-
138
- public function enqueue() {
139
- wp_enqueue_script( 'jquery' );
140
- }
141
-
142
- public function ajax_script() {
143
-
144
- $ajax_nonce = wp_create_nonce( "epsilon-review" );
145
-
146
- ?>
147
-
148
- <script type="text/javascript">
149
- jQuery(document).ready(function ($) {
150
-
151
- $('.epsilon-review-button').click(function (evt) {
152
- var href = $(this).attr('href'),
153
- id = $(this).attr('id');
154
-
155
- evt.preventDefault();
156
-
157
- var data = {
158
- action: 'epsilon_review',
159
- security: '<?php echo $ajax_nonce; ?>',
160
- };
161
-
162
- if ('epsilon-rated' === id) {
163
- data['epsilon-review'] = 1;
164
- }
165
-
166
- $.post('<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function (response) {
167
- $('#<?php echo $this->slug ?>-epsilon-review-notice').slideUp('fast', function () {
168
- $(this).remove();
169
- });
170
-
171
- if ('epsilon-rate' === id) {
172
- window.location.href = href;
173
- }
174
-
175
- });
176
-
177
- });
178
-
179
- });
180
- </script>
181
-
182
- <?php
183
- }
184
- }
1
+ <?php
2
+
3
+ class SB_Pack_Review {
4
+
5
+ private static $instance;
6
+ private $when = array( 5, 15, 30 );
7
+ private $value;
8
+ private $messages;
9
+ private $link = 'https://wordpress.org/support/plugin/%s/reviews/#new-post';
10
+ private $slug = '';
11
+ private $option_name = '';
12
+
13
+ function __construct( $args ) {
14
+
15
+ if ( isset( $args['slug'] ) ) {
16
+ $this->slug = $args['slug'];
17
+ }
18
+
19
+ $this->value = $this->value();
20
+
21
+ $this->messages = array(
22
+ 'notice' => __( "Hey, I noticed you're using Speed Booster Pack for %s day(s) - that's awesome! Could you please do me a BIG favor and give it a fair rating and a review on WordPress?", 'speed-booster-pack' ),
23
+ 'rate' => __( 'Ok, you deserve it', 'speed-booster-pack' ),
24
+ 'rated' => __( 'I already did', 'speed-booster-pack' ),
25
+ 'no_rate' => __( 'No, not good enough', 'speed-booster-pack' ),
26
+ );
27
+
28
+ if ( isset( $args['messages'] ) ) {
29
+ $this->messages = wp_parse_args( $args['messages'], $this->messages );
30
+ }
31
+
32
+ $this->init();
33
+
34
+ }
35
+
36
+ public static function get_instance( $args ) {
37
+ if ( null === static::$instance ) {
38
+ static::$instance = new static( $args );
39
+ }
40
+
41
+ return static::$instance;
42
+ }
43
+
44
+ private function init() {
45
+ if ( ! is_admin() ) {
46
+ return;
47
+ }
48
+
49
+ add_action( 'wp_ajax_epsilon_review', array( $this, 'ajax' ) );
50
+
51
+ if ( $this->check() ) {
52
+ add_action( 'admin_notices', array( $this, 'five_star_wp_rate_notice' ) );
53
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
54
+ add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
55
+ }
56
+
57
+ }
58
+
59
+ private function check() {
60
+
61
+ $options = get_option( 'sbp_settings' );
62
+ $option = isset( $options['givemereview'] ) ? $options['givemereview'] : '';
63
+ $currDate = date( 'Y-m-d' );
64
+ if ( 'already-rated' == $option ) {
65
+ return false;
66
+ }
67
+
68
+ if ( $this->value == $option ) {
69
+ return false;
70
+ }
71
+
72
+ if ( is_array( $this->when ) ) {
73
+ foreach ( $this->when as $et ) {
74
+ if ( date( 'Y-m-d', strtotime( $currDate . ' +' . $et . ' days' ) ) == $this->value ) {
75
+ return true;
76
+ }
77
+
78
+ }
79
+ }
80
+
81
+ }
82
+
83
+ private function value() {
84
+
85
+ $value = get_transient( 'sb_pack_review' );
86
+
87
+ if ( $value ) {
88
+
89
+ $current_time = time(); // or your date as well
90
+ $trans_date = strtotime($value);
91
+ $date_diff = $current_time - $trans_date;
92
+
93
+ return round($date_diff / (60 * 60 * 24));
94
+ }
95
+
96
+ $date = date( 'Y-m-d' );
97
+ set_transient( 'sb_pack_review', $date, 24 * 30 * HOUR_IN_SECONDS );
98
+
99
+ }
100
+
101
+ public function five_star_wp_rate_notice() {
102
+
103
+ $url = sprintf( $this->link, $this->slug );
104
+
105
+ ?>
106
+ <div id="<?php echo $this->slug ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
107
+ <p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ); ?></p>
108
+ <p class="actions">
109
+ <a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>"
110
+ class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
111
+ <a id="epsilon-rated" href="#"
112
+ class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['rated'] ); ?></a>
113
+ <a id="epsilon-no-rate" href="#"
114
+ class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['no_rate'] ); ?></a>
115
+ </p>
116
+ </div>
117
+ <?php
118
+ }
119
+
120
+ public function ajax() {
121
+
122
+ check_ajax_referer( 'epsilon-review', 'security' );
123
+
124
+ $options = get_option( 'sbp_settings', array() );
125
+
126
+ if ( isset( $_POST['epsilon-review'] ) ) {
127
+ $options['givemereview'] = 'already-rated';
128
+ } else {
129
+ $options['givemereview'] = $this->value;
130
+ }
131
+
132
+ update_option( 'sbp_settings', $options );
133
+
134
+ wp_die( 'ok' );
135
+
136
+ }
137
+
138
+ public function enqueue() {
139
+ wp_enqueue_script( 'jquery' );
140
+ }
141
+
142
+ public function ajax_script() {
143
+
144
+ $ajax_nonce = wp_create_nonce( "epsilon-review" );
145
+
146
+ ?>
147
+
148
+ <script type="text/javascript">
149
+ jQuery(document).ready(function ($) {
150
+
151
+ $('.epsilon-review-button').click(function (evt) {
152
+ var href = $(this).attr('href'),
153
+ id = $(this).attr('id');
154
+
155
+ evt.preventDefault();
156
+
157
+ var data = {
158
+ action: 'epsilon_review',
159
+ security: '<?php echo $ajax_nonce; ?>',
160
+ };
161
+
162
+ if ('epsilon-rated' === id) {
163
+ data['epsilon-review'] = 1;
164
+ }
165
+
166
+ $.post('<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function (response) {
167
+ $('#<?php echo $this->slug ?>-epsilon-review-notice').slideUp('fast', function () {
168
+ $(this).remove();
169
+ });
170
+
171
+ if ('epsilon-rate' === id) {
172
+ window.location.href = href;
173
+ }
174
+
175
+ });
176
+
177
+ });
178
+
179
+ });
180
+ </script>
181
+
182
+ <?php
183
+ }
184
+ }
inc/core.php CHANGED
@@ -1,941 +1,977 @@
1
- <?php
2
-
3
- /*--------------------------------------------------------------------------------------------------------
4
- Plugin Core Functions
5
- ---------------------------------------------------------------------------------------------------------*/
6
-
7
- if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
8
-
9
- class Speed_Booster_Pack_Core {
10
-
11
- public function __construct() {
12
-
13
- global $sbp_options;
14
-
15
- add_action( 'wp_enqueue_scripts', array( $this, 'sbp_no_more_fontawesome' ), 9999 );
16
- add_action( 'wp_enqueue_scripts', array( $this, 'sbp_move_scripts_to_footer' ) );
17
- if ( ! is_admin() and !isset( $sbp_options['jquery_to_footer'] ) ) {
18
- add_action( 'wp_head', array( $this, 'sbp_scripts_to_head' ) );
19
- }
20
- add_action( 'init', array( $this, 'sbp_show_page_load_stats' ), 999 );
21
- add_action( 'after_setup_theme', array( $this, 'sbp_junk_header_tags' ) );
22
- add_action( 'init', array( $this, 'sbp_init' ) );
23
- //enable cdn rewrite
24
- if(!empty($sbp_options['sbp_enable_cdn']) && $sbp_options['sbp_enable_cdn'] == "1" && !empty($sbp_options['sbp_cdn_url'])) {
25
- add_action('template_redirect', array($this,'sbp_cdn_rewrite'));
26
- }
27
-
28
- // Start GA
29
- if(!empty($sbp_options['sbp_enable_local_analytics']) && $sbp_options['sbp_enable_local_analytics'] == "1") {
30
- if(!wp_next_scheduled('sbp_update_ga')) {
31
- wp_schedule_event(time(), 'daily', 'sbp_update_ga');
32
- }
33
-
34
- if(!empty($sbp_options['sbp_monsterinsights']) && $sbp_options['sbp_monsterinsights'] == "1") {
35
- add_filter('monsterinsights_frontend_output_analytics_src', array($this,'sbp_monster_ga'), 1000);
36
- }
37
- else {
38
- if(!empty($sbp_options['sbp_tracking_position']) && $sbp_options['sbp_tracking_position'] == 'footer') {
39
- $tracking_code_position = 'wp_footer';
40
- }
41
- else {
42
- $tracking_code_position = 'wp_head';
43
- }
44
- add_action($tracking_code_position, array($this,'sbp_print_ga'), 0);
45
- }
46
- }
47
- else {
48
- if(wp_next_scheduled('sbp_update_ga')) {
49
- wp_clear_scheduled_hook('sbp_update_ga');
50
- }
51
- }
52
-
53
- add_action('sbp_update_ga', array($this,'sbp_update_ga'));
54
- // End GA
55
-
56
- $this->sbp_css_optimizer(); // CSS Optimizer functions
57
-
58
-
59
- // Use Google Libraries
60
- if ( ! is_admin() and isset( $sbp_options['use_google_libs'] ) ) {
61
- $this->sbp_use_google_libraries();
62
- }
63
-
64
-
65
- // Minifier
66
- if ( ! is_admin() and isset( $sbp_options['minify_html_js'] ) ) {
67
- $this->sbp_minifier();
68
- }
69
-
70
- // Defer parsing of JavaScript
71
- if ( ! is_admin() and isset( $sbp_options['defer_parsing'] ) ) {
72
- add_filter( 'script_loader_tag', array( $this, 'sbp_defer_parsing_of_js' ), 10, 3 );
73
- }
74
-
75
- // Remove query strings from static resources
76
- if ( ! is_admin() and isset( $sbp_options['query_strings'] ) ) {
77
- add_filter( 'script_loader_src', array( $this, 'sbp_remove_query_strings' ), 15, 1 );
78
- add_filter( 'style_loader_src', array( $this, 'sbp_remove_query_strings' ), 15, 1 );
79
- }
80
-
81
-
82
- // JPEG Compression filter
83
- add_filter( 'jpeg_quality', array( $this, 'filter_image_quality' ) );
84
- add_filter( 'wp_editor_set_quality', array( $this, 'filter_image_quality' ) );
85
-
86
-
87
- /**
88
- * @since 3.7
89
- */
90
- // Disable emojis
91
- if ( ! is_admin() && isset( $sbp_options['remove_emojis'] ) ) {
92
- add_action( 'init', array( $this, 'sbp_disable_emojis' ) );
93
- }
94
-
95
- /**
96
- * @since 3.7
97
- */
98
- // Disable XML-RPC
99
- if ( isset( $sbp_options['disable_xmlrpc'] ) ) {
100
- add_filter( 'xmlrpc_enabled', '__return_false' );
101
- add_filter( 'wp_headers', array( $this, 'sbp_remove_x_pingback' ) );
102
- add_filter( 'pings_open', '__return_false', 9999 );
103
- }
104
-
105
- // Disable Self Pingbacks
106
- if ( isset( $sbp_options['disable_self_pingbacks'] ) ) {
107
- add_action( 'pre_ping', array($this,'sbp_remove_self_ping' ));
108
- }
109
-
110
- // Remove REST API Links
111
- if ( isset( $sbp_options['remove_rest_api_links'] ) ) {
112
- remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
113
- }
114
-
115
- //Disable Dash icons
116
- if ( isset( $sbp_options['disable_dashicons'] ) ) {
117
- add_action( 'wp_enqueue_scripts', array( $this, 'sbp_disable_dash_icons' ) );
118
- }
119
-
120
- if ( isset( $sbp_options['disable_google_maps'] ) ) {
121
- add_action( 'wp_loaded', array( $this, 'sbp_disable_google_maps' ) );
122
- }
123
-
124
- if ( isset( $sbp_options['disable_password_strength_meter'] ) ) {
125
- add_action( 'wp_print_scripts', array( $this, 'sbp_disable_password_strength_meter' ), 100 );
126
- }
127
-
128
- if ( isset( $sbp_options['disable_heartbeat'] ) ) {
129
- add_action( 'init', array( $this, 'sbp_disable_heartbeat' ), 1 );
130
- }
131
-
132
- if ( ! empty( $sbp_options['heartbeat_frequency'] ) ) {
133
- add_filter( 'heartbeat_settings', array( $this, 'sbp_heartbeat_frequency' ), 1 );
134
- }
135
-
136
- if ( ! empty( $sbp_options['limit_post_revisions'] ) ) {
137
- define( 'WP_POST_REVISIONS', $sbp_options['limit_post_revisions'] );
138
- }
139
-
140
- if ( ! empty( $sbp_options['autosave_interval'] ) ) {
141
- define( 'AUTOSAVE_INTERVAL', $sbp_options['autosave_interval'] );
142
- }
143
-
144
- } // END public public function __construct
145
-
146
- /*--------------------------------------------------------------------------------------------------------
147
- Disable Dash icons
148
- ---------------------------------------------------------------------------------------------------------*/
149
- function sbp_disable_dash_icons() {
150
- if ( ! is_user_logged_in() ) {
151
- wp_dequeue_style( 'dashicons' );
152
- wp_deregister_style( 'dashicons' );
153
- }
154
- }
155
-
156
- /*--------------------------------------------------------------------------------------------------------
157
- Disable Heartbeat
158
- ---------------------------------------------------------------------------------------------------------*/
159
-
160
- function sbp_disable_heartbeat() {
161
- wp_deregister_script( 'heartbeat' );
162
- }
163
-
164
- /*--------------------------------------------------------------------------------------------------------
165
- Heartbeat Frequency
166
- ---------------------------------------------------------------------------------------------------------*/
167
-
168
- function sbp_heartbeat_frequency() {
169
- global $sbp_options;
170
- $settings['interval'] = $sbp_options['heartbeat_frequency']; //Anything between 15-120
171
-
172
- return $settings;
173
- }
174
-
175
- /*--------------------------------------------------------------------------------------------------------
176
- Disable Google Maps
177
- ---------------------------------------------------------------------------------------------------------*/
178
-
179
- function sbp_disable_google_maps() {
180
- ob_start( array( $this, 'sbp_disable_google_maps_regex' ) );
181
- }
182
-
183
- function sbp_disable_google_maps_regex( $html ) {
184
- $html = preg_replace( '/<script[^<>]*\/\/maps.(googleapis|google|gstatic).com\/[^<>]*><\/script>/i', '', $html );
185
-
186
- return $html;
187
- }
188
-
189
- /*--------------------------------------------------------------------------------------------------------
190
- Disable Password Strength Meter
191
- ---------------------------------------------------------------------------------------------------------*/
192
-
193
- function sbp_disable_password_strength_meter() {
194
- global $wp;
195
-
196
- $wp_check = isset( $wp->query_vars['lost-password'] ) || ( isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) || is_page( 'lost_password' );
197
-
198
- $wc_check = ( class_exists( 'WooCommerce' ) && ( is_account_page() || is_checkout() ) );
199
-
200
- if ( ! $wp_check && ! $wc_check ) {
201
- if ( wp_script_is( 'zxcvbn-async', 'enqueued' ) ) {
202
- wp_dequeue_script( 'zxcvbn-async' );
203
- }
204
-
205
- if ( wp_script_is( 'password-strength-meter', 'enqueued' ) ) {
206
- wp_dequeue_script( 'password-strength-meter' );
207
- }
208
-
209
- if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
210
- wp_dequeue_script( 'wc-password-strength-meter' );
211
- }
212
- }
213
- }
214
-
215
- /*--------------------------------------------------------------------------------------------------------
216
- Init the CSS Optimizer actions
217
- ---------------------------------------------------------------------------------------------------------*/
218
-
219
- function sbp_init() {
220
-
221
- global $sbp_options;
222
-
223
- if ( wp_is_mobile() and isset ( $sbp_options['sbp_is_mobile'] ) ) { // disable all CSS options on mobile devices
224
- return;
225
- }
226
-
227
- if ( ! is_admin() and isset( $sbp_options['sbp_css_async'] ) ) {
228
- add_action( 'wp_print_styles', array( $this, 'sbp_print_styles' ), SBP_FOOTER );
229
- add_action( 'wp_footer', array( $this, 'sbp_print_delayed_styles' ), SBP_FOOTER + 1 );
230
- }
231
-
232
- }
233
-
234
-
235
- /*--------------------------------------------------------------------------------------------------------
236
- Get image quality value if it's set. Otherwise it's set to 90
237
- ---------------------------------------------------------------------------------------------------------*/
238
-
239
- function filter_image_quality() {
240
-
241
- if ( get_option( 'sbp_integer' ) ) {
242
- $sbp_compression = get_option( 'sbp_integer' );
243
- } else {
244
- $sbp_compression = 75; //@since v3.7
245
- }
246
-
247
- return $sbp_compression;
248
- }
249
-
250
-
251
- /*--------------------------------------------------------------------------------------------------------
252
- ACTION wp_print_styles
253
- ---------------------------------------------------------------------------------------------------------*/
254
-
255
- function sbp_print_styles() {
256
- global $sbp_styles_are_async;
257
- global $sbp_styles;
258
- global $sbp_options;
259
-
260
- if ( isset( $sbp_options['sbp_css_minify'] ) ) {
261
- $minify = true;
262
- } else {
263
- $minify = false;
264
- }
265
-
266
- $sbp_styles_are_async = true;
267
-
268
- $sbp_styles = sbp_generate_styles_list();
269
-
270
- if ( ! isset( $sbp_options['sbp_footer_css'] ) ) {
271
-
272
- $not_inlined = array();
273
-
274
- foreach ( $sbp_styles as $style ) {
275
- echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
276
- if ( ! sbp_inline_css( $style['src'], $minify ) ) {
277
- $not_inlined[] = $style;
278
- }
279
- echo "</style>";
280
- }
281
- if ( ! empty( $not_inlined ) ) {
282
- foreach ( $not_inlined as $style ) {
283
- ?>
284
- <link rel="stylesheet" href="<?php echo $style['src'] ?>"
285
- type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
286
- }
287
- }
288
- }
289
-
290
- sbp_unregister_styles();
291
- }
292
-
293
-
294
- /*--------------------------------------------------------------------------------------------------------
295
- ACTION wp_footer
296
- ---------------------------------------------------------------------------------------------------------*/
297
-
298
- function sbp_print_delayed_styles() {
299
- global $sbp_styles;
300
- global $sbp_options;
301
-
302
- if ( isset( $sbp_options['sbp_css_minify'] ) ) {
303
- $minify = true;
304
- } else {
305
- $minify = false;
306
- }
307
-
308
- if ( isset( $sbp_options['sbp_footer_css'] ) ) {
309
-
310
- $not_inlined = array();
311
- foreach ( $sbp_styles as $style ) {
312
- echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
313
- if ( ! sbp_inline_css( $style['src'], $minify ) ) {
314
- $not_inlined[] = $style;
315
- }
316
- echo "</style>";
317
- }
318
- if ( ! empty( $not_inlined ) ) {
319
- foreach ( $not_inlined as $style ) {
320
- ?>
321
- <link rel="stylesheet" href="<?php echo $style['src'] ?>"
322
- type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
323
- }
324
- }
325
- }
326
- }
327
-
328
-
329
- /*--------------------------------------------------------------------------------------------------------
330
- Moves scripts to the footer to decrease page load times, while keeping stylesheets in the header
331
- ---------------------------------------------------------------------------------------------------------*/
332
-
333
- function sbp_move_scripts_to_footer() {
334
-
335
- global $sbp_options;
336
-
337
- if ( ! is_admin() and isset( $sbp_options['jquery_to_footer'] ) ) {
338
-
339
- remove_action( 'wp_head', 'wp_print_scripts' );
340
- remove_action( 'wp_head', 'wp_print_head_scripts', 9 );
341
- remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );
342
-
343
- }
344
-
345
- } // END function sbp_move_scripts_to_footer
346
-
347
-
348
- /*--------------------------------------------------------------------------------------------------------
349
- Put scripts back to the head
350
- ---------------------------------------------------------------------------------------------------------*/
351
-
352
- public function sbp_scripts_to_head() {
353
-
354
-
355
- if ( get_option( 'sbp_head_html_script1' ) ) {
356
- echo get_option( 'sbp_head_html_script1' ) . "\n";
357
- }
358
-
359
- if ( get_option( 'sbp_head_html_script2' ) ) {
360
- echo get_option( 'sbp_head_html_script2' ) . "\n";
361
- }
362
-
363
- if ( get_option( 'sbp_head_html_script3' ) ) {
364
- echo get_option( 'sbp_head_html_script3' ) . "\n";
365
- }
366
-
367
- if ( get_option( 'sbp_head_html_script4' ) ) {
368
- echo get_option( 'sbp_head_html_script4' ) . "\n";
369
- }
370
-
371
- /**
372
- * Default: add jQuery to header always
373
- *
374
- * @since 3.7
375
- */
376
- global $wp_scripts;
377
- $js_footer_exceptions1 = '';
378
- $js_footer_exceptions2 = '';
379
- $js_footer_exceptions3 = '';
380
- $js_footer_exceptions4 = '';
381
-
382
- if ( get_option( 'sbp_js_footer_exceptions1' ) ) {
383
- $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
384
- }
385
-
386
- if ( get_option( 'sbp_js_footer_exceptions2' ) ) {
387
- $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
388
- }
389
-
390
- if ( get_option( 'sbp_js_footer_exceptions3' ) ) {
391
- $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
392
- }
393
-
394
- if ( get_option( 'sbp_js_footer_exceptions4' ) ) {
395
- $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
396
- }
397
-
398
- $sbp_enq = 'enqueued';
399
- $sbp_reg = 'registered';
400
- $sbp_done = 'done';
401
-
402
- /**
403
- * Echo jQuery in header all the time, if none of the other options contain in
404
- *
405
- * @since 3.7
406
- *
407
- * New solution, going forward so not to crash so many sites anymore
408
- *
409
- * This should come BEFORE the fallback function, since jQuery should be ALWAYS
410
- * the first loaded script.
411
- *
412
- */
413
- if ( $js_footer_exceptions1 !== 'jquery-core' || $js_footer_exceptions2 !== 'jquery-core' || $js_footer_exceptions3 !== 'jquery-core' || $js_footer_exceptions4 !== 'jquery-core' ) {
414
-
415
- // if the script actually exists, dequeue it and re-add it for header inclusion
416
- $script_src = $wp_scripts->registered['jquery-core']->src;
417
-
418
- if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
419
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
420
- } else {
421
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
422
- }
423
-
424
- // deregister & dequeue the script
425
- wp_deregister_script( 'jquery-core' );
426
- wp_dequeue_script( 'jquery-core' );
427
- }
428
-
429
-
430
- /**
431
- * Echo the scripts in the header
432
- *
433
- * @since 3.7
434
- *
435
- * Fallback for previous plugin users
436
- *
437
- */
438
- if ( array_key_exists( $js_footer_exceptions1, $wp_scripts->registered ) ) {
439
- $script_src = '';
440
- // if the script actually exists, dequeue it and re-add it for header inclusion
441
- $script_src = $wp_scripts->registered[ $js_footer_exceptions1 ]->src;
442
-
443
- if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
444
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
445
- } else {
446
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
447
- }
448
- }
449
-
450
- if ( array_key_exists( $js_footer_exceptions2, $wp_scripts->registered ) ) {
451
- $script_src = '';
452
- // if the script actually exists, dequeue it and re-add it for header inclusion
453
- $script_src = $wp_scripts->registered[ $js_footer_exceptions2 ]->src;
454
-
455
- if ( strpos( $script_src, 'wp-includes' ) == true ) {
456
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
457
- } else {
458
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
459
- }
460
- }
461
-
462
- if ( array_key_exists( $js_footer_exceptions3, $wp_scripts->registered ) ) {
463
- $script_src = '';
464
- // if the script actually exists, dequeue it and re-add it for header inclusion
465
- $script_src = $wp_scripts->registered[ $js_footer_exceptions3 ]->src;
466
-
467
- if ( strpos( $script_src, 'wp-includes' ) == true ) {
468
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
469
- } else {
470
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
471
- }
472
-
473
- }
474
-
475
- if ( array_key_exists( $js_footer_exceptions4, $wp_scripts->registered ) ) {
476
- $script_src = '';
477
- // if the script actually exists, dequeue it and re-add it for header inclusion
478
- $script_src = $wp_scripts->registered[ $js_footer_exceptions4 ]->src;
479
-
480
- if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
481
- echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
482
- } else {
483
- echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
484
- }
485
- }
486
-
487
-
488
- /**
489
- * De-register the scripts from other parts of the site since they're already echo-ed in the header
490
- */
491
- /*--------------------------------------------------------------------------------------------------------*/
492
- if ( ! empty( $sbp_js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_enq ) ) {
493
- wp_dequeue_script( $js_footer_exceptions1 );
494
- }
495
- if ( ! empty( $sbp_js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_enq ) ) {
496
- wp_dequeue_script( $js_footer_exceptions2 );
497
- }
498
- if ( ! empty( $sbp_js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_enq ) ) {
499
- wp_dequeue_script( $sbp_js_footer_exceptions3 );
500
- }
501
- if ( ! empty( $sbp_js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_enq ) ) {
502
- wp_dequeue_script( $sbp_js_footer_exceptions4 );
503
- }
504
- /*--------------------------------------------------------------------------------------------------------*/
505
- if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_reg ) ) {
506
- wp_deregister_script( $js_footer_exceptions1 );
507
- }
508
- if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_reg ) ) {
509
- wp_deregister_script( $js_footer_exceptions2 );
510
- }
511
- if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_reg ) ) {
512
- wp_deregister_script( $js_footer_exceptions3 );
513
- }
514
- if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_reg ) ) {
515
- wp_deregister_script( $js_footer_exceptions4 );
516
- }
517
- /*--------------------------------------------------------------------------------------------------------*/
518
- if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_done ) ) {
519
- wp_deregister_script( $js_footer_exceptions1 );
520
- }
521
- if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_done ) ) {
522
- wp_deregister_script( $js_footer_exceptions2 );
523
- }
524
- if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_done ) ) {
525
- wp_deregister_script( $js_footer_exceptions3 );
526
- }
527
- if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_done ) ) {
528
- wp_deregister_script( $js_footer_exceptions4 );
529
- }
530
-
531
- }
532
-
533
-
534
- /*--------------------------------------------------------------------------------------------------------
535
- Show Number of Queries and Page Load Time
536
- ---------------------------------------------------------------------------------------------------------*/
537
-
538
- function sbp_show_page_load_stats() {
539
- $timer_stop = timer_stop( 0, 2 ); // to display milliseconds instead of seconds usethe following: $timer_stop = 1000 * ( float ) timer_stop( 0, 4 );
540
- $get_num_queries = get_num_queries();
541
- update_option( 'sbp_page_time', $timer_stop );
542
- update_option( 'sbp_page_queries', $get_num_queries );
543
- }
544
-
545
-
546
- /*--------------------------------------------------------------------------------------------------------
547
- Use Google Libraries
548
- ---------------------------------------------------------------------------------------------------------*/
549
-
550
- function sbp_use_google_libraries() {
551
-
552
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/use-google-libraries.php' );
553
-
554
- if ( class_exists( 'SBP_GoogleLibraries' ) ) {
555
- SBP_GoogleLibraries::configure_plugin();
556
-
557
- }
558
-
559
- } // End function sbp_use_google_libraries()
560
-
561
-
562
- /*--------------------------------------------------------------------------------------------------------
563
- Minify HTML and Javascripts
564
- ---------------------------------------------------------------------------------------------------------*/
565
-
566
- function sbp_minifier() {
567
-
568
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/sbp-minifier.php' );
569
- } // End function sbp_minifier()
570
-
571
-
572
- /*--------------------------------------------------------------------------------------------------------
573
- CSS Optimizer
574
- ---------------------------------------------------------------------------------------------------------*/
575
-
576
- function sbp_css_optimizer() {
577
-
578
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/css-optimizer.php' );
579
-
580
- } // End function sbp_css_optimizer()
581
-
582
- /*--------------------------------------------------------------------------------------------------------
583
- Defer parsing of JavaScript and exclusion files
584
- ---------------------------------------------------------------------------------------------------------*/
585
-
586
- function sbp_defer_parsing_of_js( $tag, $handle, $src ) {
587
-
588
- $defer_exclude1 = '';
589
- $defer_exclude2 = '';
590
- $defer_exclude3 = '';
591
- $defer_exclude4 = '';
592
-
593
- if ( get_option( 'sbp_defer_exceptions1' ) ) {
594
- $defer_exclude1 = get_option( 'sbp_defer_exceptions1' );
595
- }
596
-
597
- if ( get_option( 'sbp_defer_exceptions2' ) ) {
598
- $defer_exclude2 = get_option( 'sbp_defer_exceptions2' );
599
- }
600
-
601
- if ( get_option( 'sbp_defer_exceptions3' ) ) {
602
- $defer_exclude3 = get_option( 'sbp_defer_exceptions3' );
603
- }
604
-
605
- if ( get_option( 'sbp_defer_exceptions4' ) ) {
606
- $defer_exclude4 = get_option( 'sbp_defer_exceptions4' );
607
- }
608
-
609
- $array_with_values[] = $defer_exclude1;
610
- $array_with_values[] = $defer_exclude2;
611
- $array_with_values[] = $defer_exclude3;
612
- $array_with_values[] = $defer_exclude4;
613
-
614
- $array_with_values = apply_filters( 'sbp_exclude_defer_scripts', $array_with_values ); // possibility of extending this via filters
615
- $array_with_values = array_filter( $array_with_values ); // remove empty entries
616
-
617
-
618
- if ( ! in_array( $handle, $array_with_values ) ) {
619
- return '<script src="' . $src . '" defer="defer" type="text/javascript"></script>' . "\n";
620
- }
621
-
622
- return $tag;
623
-
624
- } // END function sbp_defer_parsing_of_js
625
-
626
-
627
- /*--------------------------------------------------------------------------------------------------------
628
- Remove query strings from static resources
629
- ---------------------------------------------------------------------------------------------------------*/
630
-
631
- function sbp_remove_query_strings( $src ) { // remove "?ver" string
632
-
633
- $output = preg_split( "/(\?rev|&ver|\?ver)/", $src );
634
-
635
- return $output[0];
636
-
637
- }
638
-
639
- /*--------------------------------------------------------------------------------------------------------
640
- Disable Emoji
641
- ---------------------------------------------------------------------------------------------------------*/
642
- function sbp_disable_emojis() {
643
- remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
644
- remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
645
- remove_action( 'wp_print_styles', 'print_emoji_styles' );
646
- remove_action( 'admin_print_styles', 'print_emoji_styles' );
647
- remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
648
- remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
649
- remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
650
-
651
- add_filter( 'tiny_mce_plugins', array( $this, 'sbp_disable_emojis_tinymce' ) );
652
- add_filter( 'wp_resource_hints', array( $this, 'sbp_disable_emojis_dns_prefetch' ), 10, 2 );
653
- }
654
-
655
- function sbp_disable_emojis_tinymce( $plugins ) {
656
- if ( is_array( $plugins ) ) {
657
- return array_diff( $plugins, array( 'wpemoji' ) );
658
- } else {
659
- return array();
660
- }
661
- }
662
-
663
- function sbp_disable_emojis_dns_prefetch( $urls, $relation_type ) {
664
- if ( 'dns-prefetch' == $relation_type ) {
665
- $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' );
666
- $urls = array_diff( $urls, array( $emoji_svg_url ) );
667
- }
668
-
669
- return $urls;
670
- }
671
-
672
- /*--------------------------------------------------------------------------------------------------------
673
- Disable XML-RPC
674
- ---------------------------------------------------------------------------------------------------------*/
675
-
676
- function sbp_remove_x_pingback( $headers ) {
677
- unset( $headers['X-Pingback'] );
678
-
679
- return $headers;
680
- }
681
-
682
- /*--------------------------------------------------------------------------------------------------------
683
- Disable Self Pingbacks
684
- ---------------------------------------------------------------------------------------------------------*/
685
-
686
- function sbp_remove_self_ping( &$links ) {
687
-
688
- $home = get_option( 'home' );
689
- foreach ( $links as $l => $link ) {
690
- if ( 0 === strpos( $link, $home ) ) {
691
- unset( $links[ $l ] );
692
- }
693
- }
694
-
695
- }
696
-
697
-
698
- /*--------------------------------------------------------------------------------------------------------
699
- Dequeue extra Font Awesome stylesheet
700
- ---------------------------------------------------------------------------------------------------------*/
701
-
702
- function sbp_no_more_fontawesome() {
703
- global $wp_styles;
704
- global $sbp_options;
705
-
706
- // we'll use preg_match to find only the following patterns as exact matches, to prevent other plugin stylesheets that contain font-awesome expression to be also dequeued
707
- $patterns = array(
708
- 'font-awesome.css',
709
- 'font-awesome.min.css',
710
- );
711
- // multiple patterns hook
712
- $regex = '/(' . implode( '|', $patterns ) . ')/i';
713
- foreach ( $wp_styles->registered as $registered ) {
714
- if ( ! is_admin() and preg_match( $regex, $registered->src ) and isset( $sbp_options['font_awesome'] ) ) {
715
- wp_dequeue_style( $registered->handle );
716
- // FA was dequeued, so here we need to enqueue it again from CDN
717
- wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
718
- } // END if( preg_match...
719
- } // END foreach
720
- } // End function dfa_no_more_fontawesome
721
-
722
-
723
- /*--------------------------------------------------------------------------------------------------------
724
- Remove junk header tags
725
- ---------------------------------------------------------------------------------------------------------*/
726
-
727
- public function sbp_junk_header_tags() {
728
-
729
- global $sbp_options;
730
-
731
- // Remove Adjacent Posts links PREV/NEXT
732
- if ( isset( $sbp_options['remove_adjacent'] ) ) {
733
- remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
734
- }
735
-
736
- // Remove Windows Live Writer Manifest Link
737
- if ( isset( $sbp_options['wml_link'] ) ) {
738
- remove_action( 'wp_head', 'wlwmanifest_link' );
739
- }
740
-
741
- // Remove RSD (Really Simple Discovery) Link
742
- if ( isset( $sbp_options['rsd_link'] ) ) {
743
- remove_action( 'wp_head', 'rsd_link' );
744
- }
745
-
746
- // Remove WordPress Shortlinks from WP Head
747
- if ( isset( $sbp_options['remove_wsl'] ) ) {
748
- remove_action( 'wp_head', 'wp_shortlink_wp_head' );
749
- }
750
-
751
- // Remove WP Generator/Version - for security reasons and cleaning the header
752
- if ( isset( $sbp_options['wp_generator'] ) ) {
753
- remove_action( 'wp_head', 'wp_generator' );
754
- }
755
-
756
- // Remove all feeds
757
- if ( isset( $sbp_options['remove_all_feeds'] ) ) {
758
- remove_action( 'wp_head', 'feed_links_extra', 3 ); // remove the feed links from the extra feeds such as category feeds
759
- remove_action( 'wp_head', 'feed_links', 2 ); // remove the feed links from the general feeds: Post and Comment Feed
760
- }
761
-
762
- } // END public function sbp_junk_header_tags
763
-
764
-
765
- /*--------------------------------
766
- CDN Rewrite URLs
767
- ---------------------------------*/
768
-
769
- function sbp_cdn_rewrite() {
770
- ob_start(array($this,'sbp_cdn_rewriter'));
771
- }
772
-
773
- function sbp_cdn_rewriter($html) {
774
- global $sbp_options;
775
- $sbp_cdn_directories = $sbp_options['sbp_cdn_included_directories'];
776
-
777
- //Prep Site URL
778
- $escapedSiteURL = quotemeta(get_option('home'));
779
- $regExURL = '(https?:|)' . substr($escapedSiteURL, strpos($escapedSiteURL, '//'));
780
-
781
- //Prep Included Directories
782
- $directories = 'wp\-content|wp\-includes';
783
- if(!empty($sbp_cdn_directories)) {
784
- $directoriesArray = array_map('trim', explode(',', $sbp_cdn_directories));
785
- if(count($directoriesArray) > 0) {
786
- $directories = implode('|', array_map('quotemeta', array_filter($directoriesArray)));
787
- }
788
- }
789
-
790
- //Rewrite URLs + Return
791
- $regEx = '#(?<=[(\"\'])(?:' . $regExURL . ')?/(?:((?:' . $directories . ')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
792
- $cdnHTML = preg_replace_callback($regEx, array($this,'sbp_cdn_rewrite_url'), $html);
793
- return $cdnHTML;
794
- }
795
-
796
- function sbp_cdn_rewrite_url($url) {
797
- global $sbp_options;
798
- $sbp_cdn_url = $sbp_options['sbp_cdn_url'];
799
- $sbp_cdn_excluded = $sbp_options['sbp_cdn_exclusions'];
800
-
801
- //Make Sure CDN URL is Set
802
- if(!empty($sbp_cdn_url)) {
803
-
804
- //Don't Rewrite if Excluded
805
- if(!empty($sbp_cdn_excluded)) {
806
- $exclusions = array_map('trim', explode(',', $sbp_cdn_excluded));
807
- foreach($exclusions as $exclusion) {
808
- if(!empty($exclusion) && stristr($url[0], $exclusion) != false) {
809
- return $url[0];
810
- }
811
- }
812
- }
813
-
814
- //Don't Rewrite if Previewing
815
- if(is_admin_bar_showing() && isset($_GET['preview']) && $_GET['preview'] == 'true') {
816
- return $url[0];
817
- }
818
-
819
- //Prep Site URL
820
- $siteURL = get_option('home');
821
- $siteURL = substr($siteURL, strpos($siteURL, '//'));
822
-
823
- //Replace URL w/ No HTTP/S Prefix
824
- if(strpos($url[0], '//') === 0) {
825
- return str_replace($siteURL, $sbp_cdn_url, $url[0]);
826
- }
827
-
828
- //Found Site URL, Replace Non Relative URL w/ HTTP/S Prefix
829
- if(strstr($url[0], $siteURL)) {
830
- return str_replace(array('http:' . $siteURL, 'https:' . $siteURL), $sbp_cdn_url, $url[0]);
831
- }
832
- //Replace Relative URL
833
- return $sbp_cdn_url . $url[0];
834
- }
835
-
836
- //Return Original URL
837
- return $url[0];
838
- }
839
-
840
- /*--------------------------------------------
841
- Google Analytics
842
- --------------------------------------------*/
843
-
844
- //update analytics.js
845
- function sbp_update_ga() {
846
- //paths
847
- $local_file = SPEED_BOOSTER_PACK_URL. 'inc/js/analytics.js';
848
- $host = 'www.google-analytics.com';
849
- $path = '/analytics.js';
850
-
851
- //open connection
852
- $fp = @fsockopen($host, '80', $errno, $errstr, 10);
853
-
854
- if($fp){
855
- //send headers
856
- $header = "GET $path HTTP/1.0\r\n";
857
- $header.= "Host: $host\r\n";
858
- $header.= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\r\n";
859
- $header.= "Accept: */*\r\n";
860
- $header.= "Accept-Language: en-us,en;q=0.5\r\n";
861
- $header.= "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
862
- $header.= "Keep-Alive: 300\r\n";
863
- $header.= "Connection: keep-alive\r\n";
864
- $header.= "Referer: https://$host\r\n\r\n";
865
- fwrite($fp, $header);
866
- $response = '';
867
-
868
- //get response
869
- while($line = fread($fp, 4096)) {
870
- $response.= $line;
871
- }
872
-
873
- //close connection
874
- fclose($fp);
875
-
876
- //remove headers
877
- $position = strpos($response, "\r\n\r\n");
878
- $response = substr($response, $position + 4);
879
-
880
- //create file if needed
881
- if(!file_exists($local_file)) {
882
- fopen($local_file, 'w');
883
- }
884
-
885
- //write response to file
886
- if(is_writable($local_file)) {
887
- if($fp = fopen($local_file, 'w')) {
888
- fwrite($fp, $response);
889
- fclose($fp);
890
- }
891
- }
892
- }
893
- }
894
-
895
-
896
- //print analytics script
897
- function sbp_print_ga() {
898
- global $sbp_options;
899
-
900
- //dont print for logged in admins
901
- if(current_user_can('manage_options') && empty($sbp_options['sbp_track_loggedin_admins'])) {
902
- return;
903
- }
904
-
905
- if(!empty($sbp_options['sbp_ga_tracking_id'])) {
906
- echo "<!-- Local Analytics generated with speed booster pack. -->";
907
- echo "<script>";
908
- echo "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
909
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
910
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
911
- })(window,document,'script','" . SPEED_BOOSTER_PACK_URL . "inc/js/analytics.js','ga');";
912
- echo "ga('create', '" . $sbp_options['sbp_ga_tracking_id'] . "', 'auto');";
913
-
914
- //disable display features
915
- if(!empty($sbp_options['sbp_disable_display_features']) && $sbp_options['sbp_disable_display_features'] == "1") {
916
- echo "ga('set', 'allowAdFeatures', false);";
917
- }
918
-
919
- //anonymize ip
920
- if(!empty($sbp_options['sbp_anonymize_ip']) && $sbp_options['sbp_anonymize_ip'] == "1") {
921
- echo "ga('set', 'anonymizeIp', true);";
922
- }
923
-
924
- echo "ga('send', 'pageview');";
925
-
926
- //adjusted bounce rate
927
- if(!empty($sbp_options['sbp_bounce_rate'])) {
928
- echo 'setTimeout("ga(' . "'send','event','adjusted bounce rate','" . $sbp_options['sbp_bounce_rate'] . " seconds')" . '"' . "," . $sbp_options['sbp_bounce_rate'] * 1000 . ");";
929
- }
930
- echo "</script>";
931
- }
932
- }
933
-
934
- //return local anlytics url for Monster Insights
935
- function sbp_monster_ga($url) {
936
- return SPEED_BOOSTER_PACK_URL . "/inc/js/analytics.js";
937
- }
938
-
939
-
940
- } // END class Speed_Booster_Pack_Core
941
- } // END if(!class_exists('Speed_Booster_Pack_Core'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*--------------------------------------------------------------------------------------------------------
4
+ Plugin Core Functions
5
+ ---------------------------------------------------------------------------------------------------------*/
6
+
7
+ if ( ! class_exists( 'Speed_Booster_Pack_Core' ) ) {
8
+
9
+ class Speed_Booster_Pack_Core {
10
+
11
+ public function __construct() {
12
+
13
+ global $sbp_options;
14
+
15
+ add_action( 'wp_enqueue_scripts', array( $this, 'sbp_no_more_fontawesome' ), 9999 );
16
+ add_action( 'wp_enqueue_scripts', array( $this, 'sbp_move_scripts_to_footer' ) );
17
+ if ( ! is_admin() and isset( $sbp_options['jquery_to_footer'] ) ) {
18
+ add_action( 'wp_head', array( $this, 'sbp_scripts_to_head' ) );
19
+ }
20
+
21
+ add_action( 'after_setup_theme', array( $this, 'sbp_junk_header_tags' ) );
22
+ add_action( 'init', array( $this, 'sbp_init' ) );
23
+ //enable cdn rewrite
24
+ if(!empty($sbp_options['sbp_enable_cdn']) && $sbp_options['sbp_enable_cdn'] == "1" && !empty($sbp_options['sbp_cdn_url'])) {
25
+ add_action('template_redirect', array($this,'sbp_cdn_rewrite'));
26
+ }
27
+
28
+ // Start GA
29
+ if(!empty($sbp_options['sbp_enable_local_analytics']) && $sbp_options['sbp_enable_local_analytics'] == "1") {
30
+ if(!wp_next_scheduled('sbp_update_ga')) {
31
+ wp_schedule_event(time(), 'daily', 'sbp_update_ga');
32
+ }
33
+
34
+ if(!empty($sbp_options['sbp_monsterinsights']) && $sbp_options['sbp_monsterinsights'] == "1") {
35
+ add_filter('monsterinsights_frontend_output_analytics_src', array($this,'sbp_monster_ga'), 1000);
36
+ }
37
+ else {
38
+ if(!empty($sbp_options['sbp_tracking_position']) && $sbp_options['sbp_tracking_position'] == 'footer') {
39
+ $tracking_code_position = 'wp_footer';
40
+ }
41
+ else {
42
+ $tracking_code_position = 'wp_head';
43
+ }
44
+ add_action($tracking_code_position, array($this,'sbp_print_ga'), 0);
45
+ }
46
+ }
47
+ else {
48
+ if(wp_next_scheduled('sbp_update_ga')) {
49
+ wp_clear_scheduled_hook('sbp_update_ga');
50
+ }
51
+ }
52
+
53
+ add_action('sbp_update_ga', array($this,'sbp_update_ga'));
54
+ // End GA
55
+
56
+ $this->sbp_css_optimizer(); // CSS Optimizer functions
57
+
58
+
59
+ // Use Google Libraries
60
+ if ( ! is_admin() and isset( $sbp_options['use_google_libs'] ) ) {
61
+ $this->sbp_use_google_libraries();
62
+ }
63
+
64
+
65
+ // Minifier
66
+ if ( ! is_admin() and isset( $sbp_options['minify_html_js'] ) ) {
67
+ $this->sbp_minifier();
68
+ }
69
+
70
+ // Defer parsing of JavaScript
71
+ if ( ! is_admin() and isset( $sbp_options['defer_parsing'] ) ) {
72
+ add_filter( 'script_loader_tag', array( $this, 'sbp_defer_parsing_of_js' ), 10, 3 );
73
+ }
74
+
75
+ // Remove query strings from static resources
76
+ if ( ! is_admin() and isset( $sbp_options['query_strings'] ) ) {
77
+ add_filter( 'script_loader_src', array( $this, 'sbp_remove_query_strings' ), 15, 1 );
78
+ add_filter( 'style_loader_src', array( $this, 'sbp_remove_query_strings' ), 15, 1 );
79
+ }
80
+
81
+ /**
82
+ * @since 3.7
83
+ */
84
+ // Disable emojis
85
+ if ( ! is_admin() && isset( $sbp_options['remove_emojis'] ) ) {
86
+ add_action( 'init', array( $this, 'sbp_disable_emojis' ) );
87
+ }
88
+
89
+ /**
90
+ * @since 3.7
91
+ */
92
+ // Disable XML-RPC
93
+ if ( isset( $sbp_options['disable_xmlrpc'] ) ) {
94
+ add_filter( 'xmlrpc_enabled', '__return_false' );
95
+ add_filter( 'wp_headers', array( $this, 'sbp_remove_x_pingback' ) );
96
+ add_filter( 'pings_open', '__return_false', 9999 );
97
+ }
98
+
99
+ /**
100
+ * @since 3.8
101
+ */
102
+ // Disable Cart Fragments
103
+ if( isset( $sbp_options[ 'disable_cart_fragments' ] ) ) {
104
+ add_action( 'wp_enqueue_scripts', array( $this, 'sbp_disable_cart_fragments' ), 999 );
105
+ }
106
+
107
+ /**
108
+ * @since 3.8
109
+ */
110
+ // Enable Instant Page
111
+ if( isset( $sbp_options[ 'enable_instant_page' ] ) ) {
112
+ add_action( 'wp_enqueue_scripts', array( $this, 'sbp_enable_instant_page' ) );
113
+ }
114
+
115
+ // Disable Self Pingbacks
116
+ if ( isset( $sbp_options['disable_self_pingbacks'] ) ) {
117
+ add_action( 'pre_ping', array($this,'sbp_remove_self_ping' ));
118
+ }
119
+
120
+ // Remove REST API Links
121
+ if ( isset( $sbp_options['remove_rest_api_links'] ) ) {
122
+ remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
123
+ }
124
+
125
+ //Disable Dash icons
126
+ if ( isset( $sbp_options['disable_dashicons'] ) ) {
127
+ add_action( 'wp_enqueue_scripts', array( $this, 'sbp_disable_dash_icons' ) );
128
+ }
129
+
130
+ if ( isset( $sbp_options['disable_google_maps'] ) ) {
131
+ add_action( 'wp_loaded', array( $this, 'sbp_disable_google_maps' ) );
132
+ }
133
+
134
+ if ( isset( $sbp_options['disable_password_strength_meter'] ) ) {
135
+ add_action( 'wp_print_scripts', array( $this, 'sbp_disable_password_strength_meter' ), 100 );
136
+ }
137
+
138
+ if ( isset( $sbp_options['disable_heartbeat'] ) ) {
139
+ add_action( 'init', array( $this, 'sbp_disable_heartbeat' ), 1 );
140
+ }
141
+
142
+ if ( ! empty( $sbp_options['heartbeat_frequency'] ) ) {
143
+ add_filter( 'heartbeat_settings', array( $this, 'sbp_heartbeat_frequency' ), 1 );
144
+ }
145
+
146
+ if ( ! empty( $sbp_options['limit_post_revisions'] ) && ! defined( 'WP_POST_REVISIONS' ) ) {
147
+ define( 'WP_POST_REVISIONS', $sbp_options['limit_post_revisions'] );
148
+ }
149
+
150
+ if ( ! empty( $sbp_options['autosave_interval'] ) && ! defined( 'AUTOSAVE_INTERVAL' ) ) {
151
+ define( 'AUTOSAVE_INTERVAL', $sbp_options['autosave_interval'] );
152
+ }
153
+
154
+ } // END public public function __construct
155
+
156
+ /*--------------------------------------------------------------------------------------------------------
157
+ Disable Dash icons
158
+ ---------------------------------------------------------------------------------------------------------*/
159
+ function sbp_disable_dash_icons() {
160
+ if ( ! is_user_logged_in() ) {
161
+ wp_dequeue_style( 'dashicons' );
162
+ wp_deregister_style( 'dashicons' );
163
+ }
164
+ }
165
+
166
+ /*--------------------------------------------------------------------------------------------------------
167
+ Disable Heartbeat
168
+ ---------------------------------------------------------------------------------------------------------*/
169
+
170
+ function sbp_disable_heartbeat() {
171
+ wp_deregister_script( 'heartbeat' );
172
+ }
173
+
174
+ /*--------------------------------------------------------------------------------------------------------
175
+ Heartbeat Frequency
176
+ ---------------------------------------------------------------------------------------------------------*/
177
+
178
+ function sbp_heartbeat_frequency() {
179
+ global $sbp_options;
180
+ $settings['interval'] = $sbp_options['heartbeat_frequency']; //Anything between 15-120
181
+
182
+ return $settings;
183
+ }
184
+
185
+ /*--------------------------------------------------------------------------------------------------------
186
+ Disable Google Maps
187
+ ---------------------------------------------------------------------------------------------------------*/
188
+
189
+ function sbp_disable_google_maps() {
190
+ ob_start( array( $this, 'sbp_disable_google_maps_regex' ) );
191
+ }
192
+
193
+ function sbp_disable_google_maps_regex( $html ) {
194
+ $html = preg_replace( '/<script[^<>]*\/\/maps.(googleapis|google|gstatic).com\/[^<>]*><\/script>/i', '', $html );
195
+
196
+ return $html;
197
+ }
198
+
199
+ /*--------------------------------------------------------------------------------------------------------
200
+ Disable Password Strength Meter
201
+ ---------------------------------------------------------------------------------------------------------*/
202
+
203
+ function sbp_disable_password_strength_meter() {
204
+ global $wp;
205
+
206
+ $wp_check = isset( $wp->query_vars['lost-password'] ) || ( isset( $_GET['action'] ) && $_GET['action'] === 'lostpassword' ) || is_page( 'lost_password' );
207
+
208
+ $wc_check = ( class_exists( 'WooCommerce' ) && ( is_account_page() || is_checkout() ) );
209
+
210
+ if ( ! $wp_check && ! $wc_check ) {
211
+ if ( wp_script_is( 'zxcvbn-async', 'enqueued' ) ) {
212
+ wp_dequeue_script( 'zxcvbn-async' );
213
+ }
214
+
215
+ if ( wp_script_is( 'password-strength-meter', 'enqueued' ) ) {
216
+ wp_dequeue_script( 'password-strength-meter' );
217
+ }
218
+
219
+ if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
220
+ wp_dequeue_script( 'wc-password-strength-meter' );
221
+ }
222
+ }
223
+ }
224
+
225
+ /*--------------------------------------------------------------------------------------------------------
226
+ Init the CSS Optimizer actions
227
+ ---------------------------------------------------------------------------------------------------------*/
228
+
229
+ function sbp_init() {
230
+
231
+ global $sbp_options;
232
+
233
+ if ( wp_is_mobile() and isset ( $sbp_options['sbp_is_mobile'] ) ) { // disable all CSS options on mobile devices
234
+ return;
235
+ }
236
+
237
+ if ( ! is_admin() and isset( $sbp_options['sbp_css_async'] ) ) {
238
+ add_action( 'wp_print_styles', array( $this, 'sbp_print_styles' ), SBP_FOOTER );
239
+ add_action( 'wp_footer', array( $this, 'sbp_print_delayed_styles' ), SBP_FOOTER + 1 );
240
+ }
241
+
242
+ }
243
+
244
+
245
+
246
+ /*--------------------------------------------------------------------------------------------------------
247
+ ACTION wp_print_styles
248
+ ---------------------------------------------------------------------------------------------------------*/
249
+
250
+ function sbp_print_styles() {
251
+ global $sbp_styles_are_async;
252
+ global $sbp_styles;
253
+ global $sbp_options;
254
+
255
+ if ( isset( $sbp_options['sbp_css_minify'] ) ) {
256
+ $minify = true;
257
+ } else {
258
+ $minify = false;
259
+ }
260
+
261
+ $sbp_styles_are_async = true;
262
+
263
+ $sbp_styles = sbp_generate_styles_list();
264
+
265
+ if ( ! isset( $sbp_options['sbp_footer_css'] ) ) {
266
+
267
+ $not_inlined = array();
268
+
269
+ foreach ( $sbp_styles as $style ) {
270
+ echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
271
+ if ( ! sbp_inline_css( $style['src'], $minify ) ) {
272
+ $not_inlined[] = $style;
273
+ }
274
+ echo "</style>";
275
+ }
276
+ if ( ! empty( $not_inlined ) ) {
277
+ foreach ( $not_inlined as $style ) {
278
+ ?>
279
+ <link rel="stylesheet" href="<?php echo $style['src'] ?>"
280
+ type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
281
+ }
282
+ }
283
+ }
284
+
285
+ sbp_unregister_styles();
286
+ }
287
+
288
+
289
+ /*--------------------------------------------------------------------------------------------------------
290
+ ACTION wp_footer
291
+ ---------------------------------------------------------------------------------------------------------*/
292
+
293
+ function sbp_print_delayed_styles() {
294
+ global $sbp_styles;
295
+ global $sbp_options;
296
+
297
+ if ( isset( $sbp_options['sbp_css_minify'] ) ) {
298
+ $minify = true;
299
+ } else {
300
+ $minify = false;
301
+ }
302
+
303
+ if ( isset( $sbp_options['sbp_footer_css'] ) ) {
304
+
305
+ $not_inlined = array();
306
+ foreach ( $sbp_styles as $style ) {
307
+ echo "<style type=\"text/css\" " . ( $style['media'] ? "media=\"{$style['media']}\"" : '' ) . ">";
308
+ if ( ! sbp_inline_css( $style['src'], $minify ) ) {
309
+ $not_inlined[] = $style;
310
+ }
311
+ echo "</style>";
312
+ }
313
+ if ( ! empty( $not_inlined ) ) {
314
+ foreach ( $not_inlined as $style ) {
315
+ ?>
316
+ <link rel="stylesheet" href="<?php echo $style['src'] ?>"
317
+ type="text/css" <?php echo $style['media'] ? "media=\"{$style['media']}\"" : '' ?> /><?php
318
+ }
319
+ }
320
+ }
321
+ }
322
+
323
+
324
+ /*--------------------------------------------------------------------------------------------------------
325
+ Moves scripts to the footer to decrease page load times, while keeping stylesheets in the header
326
+ ---------------------------------------------------------------------------------------------------------*/
327
+
328
+ function sbp_move_scripts_to_footer() {
329
+
330
+ global $sbp_options;
331
+
332
+ if ( ! is_admin() and isset( $sbp_options['jquery_to_footer'] ) ) {
333
+
334
+ remove_action( 'wp_head', 'wp_print_scripts' );
335
+ remove_action( 'wp_head', 'wp_print_head_scripts', 9 );
336
+ remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );
337
+
338
+ }
339
+
340
+ } // END function sbp_move_scripts_to_footer
341
+
342
+
343
+ /*--------------------------------------------------------------------------------------------------------
344
+ Put scripts back to the head
345
+ ---------------------------------------------------------------------------------------------------------*/
346
+
347
+ public function sbp_scripts_to_head() {
348
+
349
+
350
+ if ( get_option( 'sbp_head_html_script1' ) ) {
351
+ echo get_option( 'sbp_head_html_script1' ) . "\n";
352
+ }
353
+
354
+ if ( get_option( 'sbp_head_html_script2' ) ) {
355
+ echo get_option( 'sbp_head_html_script2' ) . "\n";
356
+ }
357
+
358
+ if ( get_option( 'sbp_head_html_script3' ) ) {
359
+ echo get_option( 'sbp_head_html_script3' ) . "\n";
360
+ }
361
+
362
+ if ( get_option( 'sbp_head_html_script4' ) ) {
363
+ echo get_option( 'sbp_head_html_script4' ) . "\n";
364
+ }
365
+
366
+ /**
367
+ * Default: add jQuery to header always
368
+ *
369
+ * @since 3.7
370
+ */
371
+ global $wp_scripts;
372
+ $js_footer_exceptions1 = '';
373
+ $js_footer_exceptions2 = '';
374
+ $js_footer_exceptions3 = '';
375
+ $js_footer_exceptions4 = '';
376
+
377
+ if ( get_option( 'sbp_js_footer_exceptions1' ) ) {
378
+ $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
379
+ }
380
+
381
+ if ( get_option( 'sbp_js_footer_exceptions2' ) ) {
382
+ $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
383
+ }
384
+
385
+ if ( get_option( 'sbp_js_footer_exceptions3' ) ) {
386
+ $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
387
+ }
388
+
389
+ if ( get_option( 'sbp_js_footer_exceptions4' ) ) {
390
+ $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
391
+ }
392
+
393
+ $sbp_enq = 'enqueued';
394
+ $sbp_reg = 'registered';
395
+ $sbp_done = 'done';
396
+
397
+ /**
398
+ * Echo jQuery in header all the time, if none of the other options contain in
399
+ *
400
+ * @since 3.7
401
+ *
402
+ * New solution, going forward so not to crash so many sites anymore
403
+ *
404
+ * This should come BEFORE the fallback function, since jQuery should be ALWAYS
405
+ * the first loaded script.
406
+ *
407
+ */
408
+ if ( $js_footer_exceptions1 !== 'jquery-core' || $js_footer_exceptions2 !== 'jquery-core' || $js_footer_exceptions3 !== 'jquery-core' || $js_footer_exceptions4 !== 'jquery-core' ) {
409
+
410
+ // if the script actually exists, dequeue it and re-add it for header inclusion
411
+ $script_src = $wp_scripts->registered['jquery-core']->src;
412
+
413
+ if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
414
+ echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
415
+ } else {
416
+ echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
417
+ }
418
+
419
+ // deregister & dequeue the script
420
+ wp_deregister_script( 'jquery-core' );
421
+ wp_dequeue_script( 'jquery-core' );
422
+ }
423
+
424
+
425
+ /**
426
+ * Echo the scripts in the header
427
+ *
428
+ * @since 3.7
429
+ *
430
+ * Fallback for previous plugin users
431
+ *
432
+ */
433
+ if ( array_key_exists( $js_footer_exceptions1, $wp_scripts->registered ) ) {
434
+ $script_src = '';
435
+ // if the script actually exists, dequeue it and re-add it for header inclusion
436
+ $script_src = $wp_scripts->registered[ $js_footer_exceptions1 ]->src;
437
+
438
+ if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
439
+ echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
440
+ } else {
441
+ echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
442
+ }
443
+ }
444
+
445
+ if ( array_key_exists( $js_footer_exceptions2, $wp_scripts->registered ) ) {
446
+ $script_src = '';
447
+ // if the script actually exists, dequeue it and re-add it for header inclusion
448
+ $script_src = $wp_scripts->registered[ $js_footer_exceptions2 ]->src;
449
+
450
+ if ( strpos( $script_src, 'wp-includes' ) == true ) {
451
+ echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
452
+ } else {
453
+ echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
454
+ }
455
+ }
456
+
457
+ if ( array_key_exists( $js_footer_exceptions3, $wp_scripts->registered ) ) {
458
+ $script_src = '';
459
+ // if the script actually exists, dequeue it and re-add it for header inclusion
460
+ $script_src = $wp_scripts->registered[ $js_footer_exceptions3 ]->src;
461
+
462
+ if ( strpos( $script_src, 'wp-includes' ) == true ) {
463
+ echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
464
+ } else {
465
+ echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
466
+ }
467
+
468
+ }
469
+
470
+ if ( array_key_exists( $js_footer_exceptions4, $wp_scripts->registered ) ) {
471
+ $script_src = '';
472
+ // if the script actually exists, dequeue it and re-add it for header inclusion
473
+ $script_src = $wp_scripts->registered[ $js_footer_exceptions4 ]->src;
474
+
475
+ if ( strpos( $script_src, 'wp-includes' ) == true ) { // it's a local resource, append wordpress installation URL
476
+ echo '<script type="text/javascript" src="' . get_site_url() . esc_attr( $script_src ) . '"></script>';
477
+ } else {
478
+ echo '<script type="text/javascript" src="' . esc_attr( $script_src ) . '"></script>';
479
+ }
480
+ }
481
+
482
+
483
+ /**
484
+ * De-register the scripts from other parts of the site since they're already echo-ed in the header
485
+ */
486
+ /*--------------------------------------------------------------------------------------------------------*/
487
+ if ( ! empty( $sbp_js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_enq ) ) {
488
+ wp_dequeue_script( $js_footer_exceptions1 );
489
+ }
490
+ if ( ! empty( $sbp_js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_enq ) ) {
491
+ wp_dequeue_script( $js_footer_exceptions2 );
492
+ }
493
+ if ( ! empty( $sbp_js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_enq ) ) {
494
+ wp_dequeue_script( $sbp_js_footer_exceptions3 );
495
+ }
496
+ if ( ! empty( $sbp_js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_enq ) ) {
497
+ wp_dequeue_script( $sbp_js_footer_exceptions4 );
498
+ }
499
+ /*--------------------------------------------------------------------------------------------------------*/
500
+ if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_reg ) ) {
501
+ wp_deregister_script( $js_footer_exceptions1 );
502
+ }
503
+ if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_reg ) ) {
504
+ wp_deregister_script( $js_footer_exceptions2 );
505
+ }
506
+ if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_reg ) ) {
507
+ wp_deregister_script( $js_footer_exceptions3 );
508
+ }
509
+ if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_reg ) ) {
510
+ wp_deregister_script( $js_footer_exceptions4 );
511
+ }
512
+ /*--------------------------------------------------------------------------------------------------------*/
513
+ if ( ! empty( $js_footer_exceptions1 ) and wp_script_is( $js_footer_exceptions1, $sbp_done ) ) {
514
+ wp_deregister_script( $js_footer_exceptions1 );
515
+ }
516
+ if ( ! empty( $js_footer_exceptions2 ) and wp_script_is( $js_footer_exceptions2, $sbp_done ) ) {
517
+ wp_deregister_script( $js_footer_exceptions2 );
518
+ }
519
+ if ( ! empty( $js_footer_exceptions3 ) and wp_script_is( $js_footer_exceptions3, $sbp_done ) ) {
520
+ wp_deregister_script( $js_footer_exceptions3 );
521
+ }
522
+ if ( ! empty( $js_footer_exceptions4 ) and wp_script_is( $js_footer_exceptions4, $sbp_done ) ) {
523
+ wp_deregister_script( $js_footer_exceptions4 );
524
+ }
525
+
526
+ }
527
+
528
+ /*--------------------------------------------------------------------------------------------------------
529
+ Use Google Libraries
530
+ ---------------------------------------------------------------------------------------------------------*/
531
+
532
+ function sbp_use_google_libraries() {
533
+
534
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/use-google-libraries.php' );
535
+
536
+ if ( class_exists( 'SBP_GoogleLibraries' ) ) {
537
+ SBP_GoogleLibraries::configure_plugin();
538
+
539
+ }
540
+
541
+ } // End function sbp_use_google_libraries()
542
+
543
+
544
+ /*--------------------------------------------------------------------------------------------------------
545
+ Minify HTML and Javascripts
546
+ ---------------------------------------------------------------------------------------------------------*/
547
+
548
+ function sbp_minifier() {
549
+
550
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/sbp-minifier.php' );
551
+ } // End function sbp_minifier()
552
+
553
+
554
+ /*--------------------------------------------------------------------------------------------------------
555
+ CSS Optimizer
556
+ ---------------------------------------------------------------------------------------------------------*/
557
+
558
+ function sbp_css_optimizer() {
559
+
560
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/css-optimizer.php' );
561
+
562
+ } // End function sbp_css_optimizer()
563
+
564
+ /*--------------------------------------------------------------------------------------------------------
565
+ Defer parsing of JavaScript and exclusion files
566
+ ---------------------------------------------------------------------------------------------------------*/
567
+
568
+ function sbp_defer_parsing_of_js( $tag, $handle, $src ) {
569
+
570
+ $defer_exclude1 = '';
571
+ $defer_exclude2 = '';
572
+ $defer_exclude3 = '';
573
+ $defer_exclude4 = '';
574
+
575
+ if ( get_option( 'sbp_defer_exceptions1' ) ) {
576
+ $defer_exclude1 = get_option( 'sbp_defer_exceptions1' );
577
+ }
578
+
579
+ if ( get_option( 'sbp_defer_exceptions2' ) ) {
580
+ $defer_exclude2 = get_option( 'sbp_defer_exceptions2' );
581
+ }
582
+
583
+ if ( get_option( 'sbp_defer_exceptions3' ) ) {
584
+ $defer_exclude3 = get_option( 'sbp_defer_exceptions3' );
585
+ }
586
+
587
+ if ( get_option( 'sbp_defer_exceptions4' ) ) {
588
+ $defer_exclude4 = get_option( 'sbp_defer_exceptions4' );
589
+ }
590
+
591
+ $array_with_values[] = $defer_exclude1;
592
+ $array_with_values[] = $defer_exclude2;
593
+ $array_with_values[] = $defer_exclude3;
594
+ $array_with_values[] = $defer_exclude4;
595
+
596
+ $array_with_values = apply_filters( 'sbp_exclude_defer_scripts', $array_with_values ); // possibility of extending this via filters
597
+ $array_with_values = array_filter( $array_with_values ); // remove empty entries
598
+
599
+
600
+ if ( ! in_array( $handle, $array_with_values ) ) {
601
+ return '<script src="' . $src . '" defer="defer" type="text/javascript"></script>' . "\n";
602
+ }
603
+
604
+ return $tag;
605
+
606
+ } // END function sbp_defer_parsing_of_js
607
+
608
+
609
+ /*--------------------------------------------------------------------------------------------------------
610
+ Remove query strings from static resources
611
+ ---------------------------------------------------------------------------------------------------------*/
612
+
613
+ function sbp_remove_query_strings( $src ) { // remove "?ver" string
614
+
615
+ $output = preg_split( "/(\?rev|&ver|\?ver)/", $src );
616
+
617
+ return $output[0];
618
+
619
+ }
620
+
621
+ /*--------------------------------------------------------------------------------------------------------
622
+ Disable Emoji
623
+ ---------------------------------------------------------------------------------------------------------*/
624
+ function sbp_disable_emojis() {
625
+ remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
626
+ remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
627
+ remove_action( 'wp_print_styles', 'print_emoji_styles' );
628
+ remove_action( 'admin_print_styles', 'print_emoji_styles' );
629
+ remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
630
+ remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
631
+ remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
632
+
633
+ add_filter( 'tiny_mce_plugins', array( $this, 'sbp_disable_emojis_tinymce' ) );
634
+ add_filter( 'wp_resource_hints', array( $this, 'sbp_disable_emojis_dns_prefetch' ), 10, 2 );
635
+ }
636
+
637
+ function sbp_disable_emojis_tinymce( $plugins ) {
638
+ if ( is_array( $plugins ) ) {
639
+ return array_diff( $plugins, array( 'wpemoji' ) );
640
+ } else {
641
+ return array();
642
+ }
643
+ }
644
+
645
+ function sbp_disable_emojis_dns_prefetch( $urls, $relation_type ) {
646
+ if ( 'dns-prefetch' == $relation_type ) {
647
+ $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' );
648
+ $urls = array_diff( $urls, array( $emoji_svg_url ) );
649
+ }
650
+
651
+ return $urls;
652
+ }
653
+
654
+ /*--------------------------------------------------------------------------------------------------------
655
+ Disable XML-RPC
656
+ ---------------------------------------------------------------------------------------------------------*/
657
+
658
+ function sbp_remove_x_pingback( $headers ) {
659
+ unset( $headers['X-Pingback'] );
660
+
661
+ return $headers;
662
+ }
663
+
664
+ /*--------------------------------------------------------------------------------------------------------
665
+ Disable Self Pingbacks
666
+ ---------------------------------------------------------------------------------------------------------*/
667
+
668
+ function sbp_remove_self_ping( &$links ) {
669
+
670
+ $home = get_option( 'home' );
671
+ foreach ( $links as $l => $link ) {
672
+ if ( 0 === strpos( $link, $home ) ) {
673
+ unset( $links[ $l ] );
674
+ }
675
+ }
676
+
677
+ }
678
+
679
+ /*--------------------------------------------------------------------------------------------------------
680
+ Disable Cart Fragments
681
+ ---------------------------------------------------------------------------------------------------------*/
682
+
683
+ function sbp_disable_cart_fragments() {
684
+ global $wp_scripts;
685
+
686
+ $handle = 'wc-cart-fragments';
687
+
688
+ $load_cart_fragments_path = $wp_scripts->registered[ $handle ]->src;
689
+ $wp_scripts->registered[ $handle ]->src = null;
690
+ wp_add_inline_script(
691
+ 'woocommerce',
692
+ '
693
+ function sbp_getCookie(name) {
694
+ var v = document.cookie.match("(^|;) ?" + name + "=([^;]*)(;|$)");
695
+ return v ? v[2] : null;
696
+ }
697
+
698
+ function sbp_check_wc_cart_script() {
699
+ var cart_src = "' . $load_cart_fragments_path . '";
700
+ var script_id = "sbp_loaded_wc_cart_fragments";
701
+
702
+ if( document.getElementById(script_id) !== null ) {
703
+ return false;
704
+ }
705
+
706
+ if( sbp_getCookie("woocommerce_cart_hash") ) {
707
+ var script = document.createElement("script");
708
+ script.id = script_id;
709
+ script.src = cart_src;
710
+ script.async = true;
711
+ document.head.appendChild(script);
712
+ }
713
+ }
714
+
715
+ sbp_check_wc_cart_script();
716
+ document.addEventListener("click", function(){setTimeout(sbp_check_wc_cart_script,1000);});
717
+ '
718
+ );
719
+ }
720
+
721
+ /*--------------------------------------------------------------------------------------------------------
722
+ Enable Instant Page
723
+ ---------------------------------------------------------------------------------------------------------*/
724
+
725
+ function sbp_enable_instant_page() {
726
+ wp_enqueue_script( 'sbp-instant-page', plugins_url( 'js/instant.page.js', __FILE__ ),
727
+ false,
728
+ '1.2.2',
729
+ true
730
+ );
731
+ }
732
+
733
+
734
+ /*--------------------------------------------------------------------------------------------------------
735
+ Dequeue extra Font Awesome stylesheet
736
+ ---------------------------------------------------------------------------------------------------------*/
737
+
738
+ function sbp_no_more_fontawesome() {
739
+ global $wp_styles;
740
+ global $sbp_options;
741
+
742
+ // we'll use preg_match to find only the following patterns as exact matches, to prevent other plugin stylesheets that contain font-awesome expression to be also dequeued
743
+ $patterns = array(
744
+ 'font-awesome.css',
745
+ 'font-awesome.min.css',
746
+ );
747
+ // multiple patterns hook
748
+ $regex = '/(' . implode( '|', $patterns ) . ')/i';
749
+ foreach ( $wp_styles->registered as $registered ) {
750
+ if ( ! is_admin() and preg_match( $regex, $registered->src ) and isset( $sbp_options['font_awesome'] ) ) {
751
+ wp_dequeue_style( $registered->handle );
752
+ // FA was dequeued, so here we need to enqueue it again from CDN
753
+ wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
754
+ } // END if( preg_match...
755
+ } // END foreach
756
+ } // End function dfa_no_more_fontawesome
757
+
758
+
759
+ /*--------------------------------------------------------------------------------------------------------
760
+ Remove junk header tags
761
+ ---------------------------------------------------------------------------------------------------------*/
762
+
763
+ public function sbp_junk_header_tags() {
764
+
765
+ global $sbp_options;
766
+
767
+ // Remove Adjacent Posts links PREV/NEXT
768
+ if ( isset( $sbp_options['remove_adjacent'] ) ) {
769
+ remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
770
+ }
771
+
772
+ // Remove Windows Live Writer Manifest Link
773
+ if ( isset( $sbp_options['wml_link'] ) ) {
774
+ remove_action( 'wp_head', 'wlwmanifest_link' );
775
+ }
776
+
777
+ // Remove RSD (Really Simple Discovery) Link
778
+ if ( isset( $sbp_options['rsd_link'] ) ) {
779
+ remove_action( 'wp_head', 'rsd_link' );
780
+ }
781
+
782
+ // Remove WordPress Shortlinks from WP Head
783
+ if ( isset( $sbp_options['remove_wsl'] ) ) {
784
+ remove_action( 'wp_head', 'wp_shortlink_wp_head' );
785
+ }
786
+
787
+ // Remove WP Generator/Version - for security reasons and cleaning the header
788
+ if ( isset( $sbp_options['wp_generator'] ) ) {
789
+ remove_action( 'wp_head', 'wp_generator' );
790
+ }
791
+
792
+ // Remove all feeds
793
+ if ( isset( $sbp_options['remove_all_feeds'] ) ) {
794
+ remove_action( 'wp_head', 'feed_links_extra', 3 ); // remove the feed links from the extra feeds such as category feeds
795
+ remove_action( 'wp_head', 'feed_links', 2 ); // remove the feed links from the general feeds: Post and Comment Feed
796
+ }
797
+
798
+ } // END public function sbp_junk_header_tags
799
+
800
+
801
+ /*--------------------------------
802
+ CDN Rewrite URLs
803
+ ---------------------------------*/
804
+
805
+ function sbp_cdn_rewrite() {
806
+ ob_start(array($this,'sbp_cdn_rewriter'));
807
+ }
808
+
809
+ function sbp_cdn_rewriter($html) {
810
+ global $sbp_options;
811
+ $sbp_cdn_directories = $sbp_options['sbp_cdn_included_directories'];
812
+
813
+ //Prep Site URL
814
+ $escapedSiteURL = quotemeta(get_option('home'));
815
+ $regExURL = '(https?:|)' . substr($escapedSiteURL, strpos($escapedSiteURL, '//'));
816
+
817
+ //Prep Included Directories
818
+ $directories = 'wp\-content|wp\-includes';
819
+ if(!empty($sbp_cdn_directories)) {
820
+ $directoriesArray = array_map('trim', explode(',', $sbp_cdn_directories));
821
+ if(count($directoriesArray) > 0) {
822
+ $directories = implode('|', array_map('quotemeta', array_filter($directoriesArray)));
823
+ }
824
+ }
825
+
826
+ //Rewrite URLs + Return
827
+ $regEx = '#(?<=[(\"\'])(?:' . $regExURL . ')?/(?:((?:' . $directories . ')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
828
+ $cdnHTML = preg_replace_callback($regEx, array($this,'sbp_cdn_rewrite_url'), $html);
829
+ return $cdnHTML;
830
+ }
831
+
832
+ function sbp_cdn_rewrite_url($url) {
833
+ global $sbp_options;
834
+ $sbp_cdn_url = $sbp_options['sbp_cdn_url'];
835
+ $sbp_cdn_excluded = $sbp_options['sbp_cdn_exclusions'];
836
+
837
+ //Make Sure CDN URL is Set
838
+ if(!empty($sbp_cdn_url)) {
839
+
840
+ //Don't Rewrite if Excluded
841
+ if(!empty($sbp_cdn_excluded)) {
842
+ $exclusions = array_map('trim', explode(',', $sbp_cdn_excluded));
843
+ foreach($exclusions as $exclusion) {
844
+ if(!empty($exclusion) && stristr($url[0], $exclusion) != false) {
845
+ return $url[0];
846
+ }
847
+ }
848
+ }
849
+
850
+ //Don't Rewrite if Previewing
851
+ if(is_admin_bar_showing() && isset($_GET['preview']) && $_GET['preview'] == 'true') {
852
+ return $url[0];
853
+ }
854
+
855
+ //Prep Site URL
856
+ $siteURL = get_option('home');
857
+ $siteURL = substr($siteURL, strpos($siteURL, '//'));
858
+
859
+ //Replace URL w/ No HTTP/S Prefix
860
+ if(strpos($url[0], '//') === 0) {
861
+ return str_replace($siteURL, $sbp_cdn_url, $url[0]);
862
+ }
863
+
864
+ //Found Site URL, Replace Non Relative URL w/ HTTP/S Prefix
865
+ if(strstr($url[0], $siteURL)) {
866
+ return str_replace(array('http:' . $siteURL, 'https:' . $siteURL), $sbp_cdn_url, $url[0]);
867
+ }
868
+ //Replace Relative URL
869
+ return $sbp_cdn_url . $url[0];
870
+ }
871
+
872
+ //Return Original URL
873
+ return $url[0];
874
+ }
875
+
876
+ /*--------------------------------------------
877
+ Google Analytics
878
+ --------------------------------------------*/
879
+
880
+ //update analytics.js
881
+ function sbp_update_ga() {
882
+ //paths
883
+ $local_file = SPEED_BOOSTER_PACK_URL. 'inc/js/analytics.js';
884
+ $host = 'www.google-analytics.com';
885
+ $path = '/analytics.js';
886
+
887
+ //open connection
888
+ $fp = @fsockopen($host, '80', $errno, $errstr, 10);
889
+
890
+ if($fp){
891
+ //send headers
892
+ $header = "GET $path HTTP/1.0\r\n";
893
+ $header.= "Host: $host\r\n";
894
+ $header.= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\r\n";
895
+ $header.= "Accept: */*\r\n";
896
+ $header.= "Accept-Language: en-us,en;q=0.5\r\n";
897
+ $header.= "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
898
+ $header.= "Keep-Alive: 300\r\n";
899
+ $header.= "Connection: keep-alive\r\n";
900
+ $header.= "Referer: https://$host\r\n\r\n";
901
+ fwrite($fp, $header);
902
+ $response = '';
903
+
904
+ //get response
905
+ while($line = fread($fp, 4096)) {
906
+ $response.= $line;
907
+ }
908
+
909
+ //close connection
910
+ fclose($fp);
911
+
912
+ //remove headers
913
+ $position = strpos($response, "\r\n\r\n");
914
+ $response = substr($response, $position + 4);
915
+
916
+ //create file if needed
917
+ if(!file_exists($local_file)) {
918
+ fopen($local_file, 'w');
919
+ }
920
+
921
+ //write response to file
922
+ if(is_writable($local_file)) {
923
+ if($fp = fopen($local_file, 'w')) {
924
+ fwrite($fp, $response);
925
+ fclose($fp);
926
+ }
927
+ }
928
+ }
929
+ }
930
+
931
+
932
+ //print analytics script
933
+ function sbp_print_ga() {
934
+ global $sbp_options;
935
+
936
+ //dont print for logged in admins
937
+ if(current_user_can('manage_options') && empty($sbp_options['sbp_track_loggedin_admins'])) {
938
+ return;
939
+ }
940
+
941
+ if(!empty($sbp_options['sbp_ga_tracking_id'])) {
942
+ echo "<!-- Local Analytics generated with speed booster pack. -->";
943
+ echo "<script>";
944
+ echo "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
945
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
946
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
947
+ })(window,document,'script','" . SPEED_BOOSTER_PACK_URL . "inc/js/analytics.js','ga');";
948
+ echo "ga('create', '" . $sbp_options['sbp_ga_tracking_id'] . "', 'auto');";
949
+
950
+ //disable display features
951
+ if(!empty($sbp_options['sbp_disable_display_features']) && $sbp_options['sbp_disable_display_features'] == "1") {
952
+ echo "ga('set', 'allowAdFeatures', false);";
953
+ }
954
+
955
+ //anonymize ip
956
+ if(!empty($sbp_options['sbp_anonymize_ip']) && $sbp_options['sbp_anonymize_ip'] == "1") {
957
+ echo "ga('set', 'anonymizeIp', true);";
958
+ }
959
+
960
+ echo "ga('send', 'pageview');";
961
+
962
+ //adjusted bounce rate
963
+ if(!empty($sbp_options['sbp_bounce_rate'])) {
964
+ echo 'setTimeout("ga(' . "'send','event','adjusted bounce rate','" . $sbp_options['sbp_bounce_rate'] . " seconds')" . '"' . "," . $sbp_options['sbp_bounce_rate'] * 1000 . ");";
965
+ }
966
+ echo "</script>";
967
+ }
968
+ }
969
+
970
+ //return local anlytics url for Monster Insights
971
+ function sbp_monster_ga($url) {
972
+ return SPEED_BOOSTER_PACK_URL . "/inc/js/analytics.js";
973
+ }
974
+
975
+
976
+ } // END class Speed_Booster_Pack_Core
977
+ } // END if(!class_exists('Speed_Booster_Pack_Core'))
inc/crazy-lazy.class.php DELETED
@@ -1,172 +0,0 @@
1
- <?php
2
- /**
3
- * CrazyLazy plugin class
4
- *
5
- * @package CrazyLazy
6
- */
7
-
8
- /* Quit */
9
- defined( 'ABSPATH' ) or exit;
10
-
11
-
12
- /**
13
- * Class CrazyLazy
14
- */
15
- final class CrazyLazy {
16
-
17
-
18
- /**
19
- * Class instance
20
- *
21
- * @since 0.0.1
22
- * @change 0.0.1
23
- */
24
- public static function instance() {
25
- new self();
26
- }
27
-
28
-
29
- /**
30
- * Class constructor
31
- *
32
- * @since 0.0.1
33
- * @change 0.0.9
34
- */
35
- public function __construct() {
36
- /* Go home */
37
- if ( is_feed() || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) ) {
38
- return;
39
- }
40
-
41
- /* Hooks */
42
- add_filter(
43
- 'the_content',
44
- array(
45
- __CLASS__,
46
- 'prepare_images',
47
- ),
48
- 12 /* Important for galleries */
49
- );
50
- add_filter(
51
- 'post_thumbnail_html',
52
- array(
53
- __CLASS__,
54
- 'prepare_images',
55
- )
56
- );
57
- add_action(
58
- 'wp_enqueue_scripts',
59
- array(
60
- __CLASS__,
61
- 'print_scripts',
62
- )
63
- );
64
- }
65
-
66
-
67
- /**
68
- * Prepare content images for Crazy Lazy usage
69
- *
70
- * @since 0.0.1
71
- * @change 1.0.0
72
- *
73
- * @param string $content The original post content.
74
- *
75
- * @return string The modified post content.
76
- */
77
- public static function prepare_images( $content ) {
78
- /* No lazy images? */
79
- if ( strpos( $content, '-image' ) === false ) {
80
- return $content;
81
- }
82
-
83
- /* Replace images */
84
- return preg_replace_callback(
85
- '/(?P<all> (?# match the whole img tag )
86
- <img(?P<before>[^>]*) (?# the opening of the img and some optional attributes )
87
- ( (?# match a class attribute followed by some optional ones and the src attribute )
88
- class=["\'](?P<class1>.*?(?:wp-image-|wp-post-image)[^>"\']*)["\']
89
- (?P<between1>[^>]*)
90
- src=["\'](?P<src1>[^>"\']*)["\']
91
- | (?# match same as before, but with the src attribute before the class attribute )
92
- src=["\'](?P<src2>[^>"\']*)["\']
93
- (?P<between2>[^>]*)
94
- class=["\'](?P<class2>.*?(?:wp-image-|wp-post-image)[^>"\']*)["\']
95
- )
96
- (?P<after>[^>]*) (?# match any additional optional attributes )
97
- (?P<closing>\/?)> (?# match the closing of the img tag with or without a self closing slash )
98
- )/x',
99
- array( 'CrazyLazy', 'replace_images' ),
100
- $content
101
- );
102
- }
103
-
104
- /**
105
- * The callback function for the preg_match_callback to modify the img tags.
106
- *
107
- * @since 1.0.0
108
- *
109
- * @param array $matches The regex matches.
110
- *
111
- * @return string The modified content string.
112
- */
113
- public static function replace_images( $matches ) {
114
- /* Empty gif */
115
- $null = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
116
- // Return unmodified image if the "data skip" attribute was found or the image has already been processed.
117
- if ( false !== strpos( $matches['all'], 'data-crazy-lazy="exclude"' ) || false !== strpos( $matches['class1'] . $matches['class2'], 'crazy_lazy' ) ) {
118
- return $matches['all'];
119
- } else {
120
- return '<img ' . $matches['before']
121
- . ' style="display:none" '
122
- . ' class="crazy_lazy ' . $matches['class1'] . $matches['class2'] . '" src="' . $null . '" '
123
- . $matches['between1'] . $matches['between2']
124
- . ' data-src="' . $matches['src1'] . $matches['src2'] . '" '
125
- . $matches['after']
126
- . $matches['closing'] . '><noscript>' . $matches['all'] . '</noscript>';
127
- }
128
- }
129
-
130
-
131
- /**
132
- * Print lazy load scripts in footer
133
- *
134
- * @since 0.0.1
135
- * @change 0.0.6
136
- */
137
- public static function print_scripts() {
138
- /* Globals */
139
- global $wp_scripts;
140
-
141
- /* Check for jQuery */
142
- if ( ! empty( $wp_scripts ) && (bool) $wp_scripts->query( 'jquery' ) ) { /* hot fix for buggy wp_script_is() */
143
- self::_print_jquery_lazyload();
144
- } else {
145
- self::_print_javascript_lazyload();
146
- }
147
- }
148
-
149
-
150
- /**
151
- * Call unveil lazy load jQuery plugin
152
- *
153
- * @since 0.0.5
154
- * @change 0.0.9
155
- */
156
- private static function _print_jquery_lazyload() {
157
- // wp_enqueue_script( 'unveil.js', plugins_url( '/js/jquery.unveil.min.js', CRAZY_LAZY_BASE ), array( 'jquery' ), '', true );
158
- wp_enqueue_script( 'unveil.js', plugin_dir_url( __FILE__ ) . 'js/jquery.unveil.min.js', array( 'jquery' ), SPEED_BOOSTER_PACK_VERSION, true );
159
- }
160
-
161
-
162
- /**
163
- * Call pure javascript lazyload.js
164
- *
165
- * @since 0.0.5
166
- * @change 0.0.9
167
- */
168
- private static function _print_javascript_lazyload() {
169
- // wp_enqueue_script( 'lazyload.js', plugins_url( '/js/lazyload.min.js', CRAZY_LAZY_BASE ), array(), '', true );
170
- wp_enqueue_script( 'lazyload.js', plugin_dir_url( __FILE__ ) . 'js/lazyload.min.js', array( 'jquery' ), SPEED_BOOSTER_PACK_VERSION, true );
171
- }
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/crazy-lazy.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- /*
4
- Copyright (C) 2013-2015 Sergej Müller & https://github.com/pluginkollektiv/crazy-lazy
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License along
17
- with this program; if not, write to the Free Software Foundation, Inc.,
18
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
- */
20
-
21
-
22
- /* Quit */
23
- defined( 'ABSPATH' ) || exit;
24
-
25
-
26
- /* FE only */
27
- if ( is_admin() ) {
28
- return;
29
- }
30
-
31
-
32
- /* Fire! */
33
- define( 'CRAZY_LAZY_BASE', plugin_basename( __FILE__ ) );
34
-
35
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/crazy-lazy.class.php' );
36
-
37
- add_action( 'wp', array( 'CrazyLazy', 'instance' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/css-optimizer.php CHANGED
@@ -1,228 +1,228 @@
1
- <?php
2
-
3
- /*--------------------------------------------------------------------------------------------------------
4
- CSS OPTIMIZER - Generate Styles List
5
- ---------------------------------------------------------------------------------------------------------*/
6
-
7
- function sbp_generate_styles_list() {
8
-
9
- global $wp_styles;
10
-
11
- $list = array();
12
- if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
13
- foreach ( $wp_styles->queue as $style ) {
14
- if ( is_css_excluded( $style ) ) {
15
- // load excluded stylesheet in render-blocking manner
16
- } else {
17
- $list[] = array(
18
- 'src' => $wp_styles->registered[ $style ]->src,
19
- 'media' => $wp_styles->registered[ $style ]->args,
20
- );
21
- }
22
- }
23
- }
24
-
25
- return $list;
26
-
27
- } // END function sbp_generate_styles_list
28
-
29
-
30
- /*--------------------------------------------------------------------------------------------------------
31
- CSS OPTIMIZER - Deregister all styles
32
- ---------------------------------------------------------------------------------------------------------*/
33
-
34
- function sbp_unregister_styles() {
35
-
36
- global $wp_styles;
37
-
38
- if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
39
-
40
- foreach ( $wp_styles->queue as $style ) {
41
- if ( is_css_excluded( $style ) ) {
42
- continue;
43
- }
44
-
45
- wp_dequeue_style( $style );
46
- wp_deregister_style( $style );
47
- }
48
- }
49
-
50
- } // END function sbp_unregister_styles
51
-
52
-
53
- /*--------------------------------------------------------------------------------------------------------
54
- CSS OPTIMIZER - Generate inline styles
55
- ---------------------------------------------------------------------------------------------------------*/
56
-
57
- function sbp_inline_css( $url, $minify = true ) {
58
-
59
- $base_url = get_bloginfo( 'wpurl' );
60
- $path = false;
61
-
62
- if ( strpos( $url, $base_url ) !== false ) {
63
-
64
- $path = str_replace( $base_url, rtrim( ABSPATH, '/' ), $url );
65
-
66
- } elseif ( $url[0] == '/' && $url[1] != '/' ) {
67
-
68
- $path = rtrim( ABSPATH, '/' ) . $url;
69
- $url = $base_url . $url;
70
- }
71
-
72
- if ( $path && file_exists( $path ) ) {
73
-
74
- $css = file_get_contents( $path );
75
-
76
- if ( $minify ) {
77
- $css = sbp_minify_css( $css );
78
- }
79
-
80
- $css = sbp_rebuilding_css_urls( $css, $url );
81
-
82
- echo $css;
83
-
84
- return true;
85
-
86
- } else {
87
-
88
- return false;
89
- }
90
-
91
- } // END function sbp_inline_css
92
-
93
-
94
- /*--------------------------------------------------------------------------------------------------------
95
- CSS OPTIMIZER - Rebuilding CSS URLs
96
- ---------------------------------------------------------------------------------------------------------*/
97
-
98
- function sbp_rebuilding_css_urls( $css, $url ) {
99
- $css_dir = substr( $url, 0, strrpos( $url, '/' ) );
100
-
101
- // old regex expresison
102
- //$css = preg_replace( "/url\((?!data:)['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$1)", $css );
103
-
104
- // new regex expression
105
- $css = preg_replace( "/url(?!\(['\"]?(data:|http:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$2)", $css );
106
-
107
-
108
- return $css;
109
- }
110
-
111
-
112
- /*--------------------------------------------------------------------------------------------------------
113
- CSS OPTIMIZER - Minify All CSS
114
- ---------------------------------------------------------------------------------------------------------*/
115
-
116
-
117
- function sbp_minify_css( $css ) {
118
-
119
- $css = sbp_remove_multiline_comments( $css );
120
- $css = str_replace( array( "\t", "\n", "\r" ), ' ', $css );
121
- $cnt = 1;
122
-
123
- while ( $cnt > 0 ) {
124
- $css = str_replace( ' ', ' ', $css, $cnt );
125
- }
126
-
127
- $css = str_replace( array( ' {', '{ ' ), '{', $css );
128
- $css = str_replace( array( ' }', '} ', ';}' ), '}', $css );
129
- $css = str_replace( ': ', ':', $css );
130
- $css = str_replace( '; ', ';', $css );
131
- $css = str_replace( ', ', ',', $css );
132
-
133
- return $css;
134
- }
135
-
136
-
137
- /*--------------------------------------------------------------------------------------------------------
138
- CSS OPTIMIZER - Remove multi-line comments from CSS
139
- ---------------------------------------------------------------------------------------------------------*/
140
-
141
- function sbp_remove_multiline_comments( $code, $method = 0 ) {
142
-
143
- switch ( $method ) {
144
- case 1:
145
- {
146
-
147
- $code = preg_replace( '/\s*(?!<\")\/\*[^\*]+\*\/(?!\")\s*/', '', $code );
148
- break;
149
- }
150
-
151
- case 0:
152
-
153
- default :
154
- {
155
-
156
- $open_pos = strpos( $code, '/*' );
157
- while ( $open_pos !== false ) {
158
- $close_pos = strpos( $code, '*/', $open_pos ) + 2;
159
- if ( $close_pos ) {
160
- $code = substr( $code, 0, $open_pos ) . substr( $code, $close_pos );
161
- } else {
162
- $code = substr( $code, 0, $open_pos );
163
- }
164
-
165
- $open_pos = strpos( $code, '/*', $open_pos );
166
- }
167
-
168
- break;
169
- }
170
- }
171
-
172
- return $code;
173
- }
174
-
175
-
176
- /*--------------------------------------------------------------------------------------------------------
177
- CSS OPTIMIZER - get stylesheets exception list
178
- ---------------------------------------------------------------------------------------------------------*/
179
-
180
- function sbp_style_exceptions() {
181
-
182
- /**
183
- * Never include these CSS handles/files
184
- *
185
- * @since 3.7
186
- */
187
- $default = array(
188
- 'admin-bar',
189
- 'dashicons',
190
- );
191
-
192
- $array = explode( "\n", get_option( 'sbp_css_exceptions' ) );
193
- $css_exceptions = array();
194
- foreach ( $array as $key => $ex ) {
195
- if ( trim( $ex ) != '' ) {
196
- $css_exceptions[ $key ] = trim( $ex );
197
-
198
- }
199
- }
200
-
201
- // merge defaults with our actual exceptions
202
- $css_exceptions = array_merge( $css_exceptions, $default );
203
-
204
- return (array) $css_exceptions;
205
- }
206
-
207
-
208
- /*--------------------------------------------------------------------------------------------------------
209
- CSS OPTIMIZER - get stylesheets exception names
210
- ---------------------------------------------------------------------------------------------------------*/
211
-
212
- function is_css_excluded( $file ) {
213
- global $wp_styles;
214
- $css_exceptions = sbp_style_exceptions();
215
-
216
- if ( is_string( $file ) && isset( $wp_styles->registered[ $file ] ) ) {
217
- $filename = $file;
218
- $file = $wp_styles->registered[ $file ];
219
- }
220
-
221
- foreach ( $css_exceptions as $ex ) {
222
- if ( $file->handle == $ex || ( strpos( $ex, '.' ) !== false && strpos( $file->src, $ex ) !== false ) ) {
223
- return true;
224
- }
225
- }
226
-
227
- return false;
228
  }
1
+ <?php
2
+
3
+ /*--------------------------------------------------------------------------------------------------------
4
+ CSS OPTIMIZER - Generate Styles List
5
+ ---------------------------------------------------------------------------------------------------------*/
6
+
7
+ function sbp_generate_styles_list() {
8
+
9
+ global $wp_styles;
10
+
11
+ $list = array();
12
+ if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
13
+ foreach ( $wp_styles->queue as $style ) {
14
+ if ( is_css_excluded( $style ) ) {
15
+ // load excluded stylesheet in render-blocking manner
16
+ } else {
17
+ $list[] = array(
18
+ 'src' => $wp_styles->registered[ $style ]->src,
19
+ 'media' => $wp_styles->registered[ $style ]->args,
20
+ );
21
+ }
22
+ }
23
+ }
24
+
25
+ return $list;
26
+
27
+ } // END function sbp_generate_styles_list
28
+
29
+
30
+ /*--------------------------------------------------------------------------------------------------------
31
+ CSS OPTIMIZER - Deregister all styles
32
+ ---------------------------------------------------------------------------------------------------------*/
33
+
34
+ function sbp_unregister_styles() {
35
+
36
+ global $wp_styles;
37
+
38
+ if ( isset( $wp_styles->queue ) && is_array( $wp_styles->queue ) ) {
39
+
40
+ foreach ( $wp_styles->queue as $style ) {
41
+ if ( is_css_excluded( $style ) ) {
42
+ continue;
43
+ }
44
+
45
+ wp_dequeue_style( $style );
46
+ wp_deregister_style( $style );
47
+ }
48
+ }
49
+
50
+ } // END function sbp_unregister_styles
51
+
52
+
53
+ /*--------------------------------------------------------------------------------------------------------
54
+ CSS OPTIMIZER - Generate inline styles
55
+ ---------------------------------------------------------------------------------------------------------*/
56
+
57
+ function sbp_inline_css( $url, $minify = true ) {
58
+
59
+ $base_url = get_bloginfo( 'wpurl' );
60
+ $path = false;
61
+
62
+ if ( strpos( $url, $base_url ) !== false ) {
63
+
64
+ $path = str_replace( $base_url, rtrim( ABSPATH, '/' ), $url );
65
+
66
+ } elseif ( $url[0] == '/' && $url[1] != '/' ) {
67
+
68
+ $path = rtrim( ABSPATH, '/' ) . $url;
69
+ $url = $base_url . $url;
70
+ }
71
+
72
+ if ( $path && file_exists( $path ) ) {
73
+
74
+ $css = file_get_contents( $path );
75
+
76
+ if ( $minify ) {
77
+ $css = sbp_minify_css( $css );
78
+ }
79
+
80
+ $css = sbp_rebuilding_css_urls( $css, $url );
81
+
82
+ echo $css;
83
+
84
+ return true;
85
+
86
+ } else {
87
+
88
+ return false;
89
+ }
90
+
91
+ } // END function sbp_inline_css
92
+
93
+
94
+ /*--------------------------------------------------------------------------------------------------------
95
+ CSS OPTIMIZER - Rebuilding CSS URLs
96
+ ---------------------------------------------------------------------------------------------------------*/
97
+
98
+ function sbp_rebuilding_css_urls( $css, $url ) {
99
+ $css_dir = substr( $url, 0, strrpos( $url, '/' ) );
100
+
101
+ // old regex expresison
102
+ //$css = preg_replace( "/url\((?!data:)['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$1)", $css );
103
+
104
+ // new regex expression
105
+ $css = preg_replace( "/url(?!\(['\"]?(data:|http:))\(['\"]?([^\/][^'\"\)]*)['\"]?\)/i", "url({$css_dir}/$2)", $css );
106
+
107
+
108
+ return $css;
109
+ }
110
+
111
+
112
+ /*--------------------------------------------------------------------------------------------------------
113
+ CSS OPTIMIZER - Minify All CSS
114
+ ---------------------------------------------------------------------------------------------------------*/
115
+
116
+
117
+ function sbp_minify_css( $css ) {
118
+
119
+ $css = sbp_remove_multiline_comments( $css );
120
+ $css = str_replace( array( "\t", "\n", "\r" ), ' ', $css );
121
+ $cnt = 1;
122
+
123
+ while ( $cnt > 0 ) {
124
+ $css = str_replace( ' ', ' ', $css, $cnt );
125
+ }
126
+
127
+ $css = str_replace( array( ' {', '{ ' ), '{', $css );
128
+ $css = str_replace( array( ' }', '} ', ';}' ), '}', $css );
129
+ $css = str_replace( ': ', ':', $css );
130
+ $css = str_replace( '; ', ';', $css );
131
+ $css = str_replace( ', ', ',', $css );
132
+
133
+ return $css;
134
+ }
135
+
136
+
137
+ /*--------------------------------------------------------------------------------------------------------
138
+ CSS OPTIMIZER - Remove multi-line comments from CSS
139
+ ---------------------------------------------------------------------------------------------------------*/
140
+
141
+ function sbp_remove_multiline_comments( $code, $method = 0 ) {
142
+
143
+ switch ( $method ) {
144
+ case 1:
145
+ {
146
+
147
+ $code = preg_replace( '/\s*(?!<\")\/\*[^\*]+\*\/(?!\")\s*/', '', $code );
148
+ break;
149
+ }
150
+
151
+ case 0:
152
+
153
+ default :
154
+ {
155
+
156
+ $open_pos = strpos( $code, '/*' );
157
+ while ( $open_pos !== false ) {
158
+ $close_pos = strpos( $code, '*/', $open_pos ) + 2;
159
+ if ( $close_pos ) {
160
+ $code = substr( $code, 0, $open_pos ) . substr( $code, $close_pos );
161
+ } else {
162
+ $code = substr( $code, 0, $open_pos );
163
+ }
164
+
165
+ $open_pos = strpos( $code, '/*', $open_pos );
166
+ }
167
+
168
+ break;
169
+ }
170
+ }
171
+
172
+ return $code;
173
+ }
174
+
175
+
176
+ /*--------------------------------------------------------------------------------------------------------
177
+ CSS OPTIMIZER - get stylesheets exception list
178
+ ---------------------------------------------------------------------------------------------------------*/
179
+
180
+ function sbp_style_exceptions() {
181
+
182
+ /**
183
+ * Never include these CSS handles/files
184
+ *
185
+ * @since 3.7
186
+ */
187
+ $default = array(
188
+ 'admin-bar',
189
+ 'dashicons',
190
+ );
191
+
192
+ $array = explode( "\n", get_option( 'sbp_css_exceptions' ) );
193
+ $css_exceptions = array();
194
+ foreach ( $array as $key => $ex ) {
195
+ if ( trim( $ex ) != '' ) {
196
+ $css_exceptions[ $key ] = trim( $ex );
197
+
198
+ }
199
+ }
200
+
201
+ // merge defaults with our actual exceptions
202
+ $css_exceptions = array_merge( $css_exceptions, $default );
203
+
204
+ return (array) $css_exceptions;
205
+ }
206
+
207
+
208
+ /*--------------------------------------------------------------------------------------------------------
209
+ CSS OPTIMIZER - get stylesheets exception names
210
+ ---------------------------------------------------------------------------------------------------------*/
211
+
212
+ function is_css_excluded( $file ) {
213
+ global $wp_styles;
214
+ $css_exceptions = sbp_style_exceptions();
215
+
216
+ if ( is_string( $file ) && isset( $wp_styles->registered[ $file ] ) ) {
217
+ $filename = $file;
218
+ $file = $wp_styles->registered[ $file ];
219
+ }
220
+
221
+ foreach ( $css_exceptions as $ex ) {
222
+ if ( $file->handle == $ex || ( strpos( $ex, '.' ) !== false && strpos( $file->src, $ex ) !== false ) ) {
223
+ return true;
224
+ }
225
+ }
226
+
227
+ return false;
228
  }
inc/js/admin-scripts.js CHANGED
@@ -1,75 +1,75 @@
1
- /**
2
- * The contents of this script only gets loaded on the plugin page
3
- */
4
- (function( $ ) {
5
-
6
- 'use strict';
7
-
8
- /**
9
- * Function used to handle admin UI postboxes
10
- */
11
- function admin_postboxes() {
12
-
13
- postboxes.add_postbox_toggles( pagenow );
14
-
15
- // set cursor to pointer
16
- $( '.postbox .hndle' ).css( 'cursor', 'pointer' );
17
- }
18
-
19
-
20
-
21
- /**
22
- * Handle UI tab switching via jQuery instead of relying on CSS only
23
- */
24
- function admin_tab_switching() {
25
-
26
- var nav_tab_selector = '.nav-tab-wrapper a';
27
-
28
- /**
29
- * Default tab handling
30
- */
31
-
32
- // make the first tab active by default
33
- $( nav_tab_selector + ':first' ).addClass( 'nav-tab-active' );
34
-
35
- // get the first tab href
36
- var initial_tab_href = $( nav_tab_selector + ':first' ).attr( 'href' );
37
-
38
- // make all the tabs, except the first one hidden
39
- $( '.sb-pack-tab' ).each( function( index, value ) {
40
- if ( '#' + $( this ).attr( 'id' ) !== initial_tab_href ) {
41
- $( this ).hide();
42
- }
43
- } );
44
-
45
- /**
46
- * Listen for click events on nav-tab links
47
- */
48
- $( nav_tab_selector ).click( function( event ) {
49
-
50
- $( nav_tab_selector ).removeClass( 'nav-tab-active' ); // remove class from previous selector
51
- $( this ).addClass( 'nav-tab-active' ).blur(); // add class to currently clicked selector
52
-
53
- var clicked_tab = $( this ).attr( 'href' );
54
-
55
- $( '.sb-pack-tab' ).each( function( index, value ) {
56
- if ( '#' + $( this ).attr( 'id' ) !== clicked_tab ) {
57
- $( this ).hide();
58
- }
59
-
60
- $( clicked_tab ).fadeIn();
61
-
62
- } );
63
-
64
- // prevent default behavior
65
- event.preventDefault();
66
-
67
- } );
68
- }
69
-
70
- $( document ).ready( function() {
71
- admin_postboxes();
72
- admin_tab_switching();
73
- } );
74
-
75
  })( jQuery );
1
+ /**
2
+ * The contents of this script only gets loaded on the plugin page
3
+ */
4
+ (function( $ ) {
5
+
6
+ 'use strict';
7
+
8
+ /**
9
+ * Function used to handle admin UI postboxes
10
+ */
11
+ function admin_postboxes() {
12
+
13
+ postboxes.add_postbox_toggles( pagenow );
14
+
15
+ // set cursor to pointer
16
+ $( '.postbox .hndle' ).css( 'cursor', 'pointer' );
17
+ }
18
+
19
+
20
+
21
+ /**
22
+ * Handle UI tab switching via jQuery instead of relying on CSS only
23
+ */
24
+ function admin_tab_switching() {
25
+
26
+ var nav_tab_selector = '.nav-tab-wrapper a';
27
+
28
+ /**
29
+ * Default tab handling
30
+ */
31
+
32
+ // make the first tab active by default
33
+ $( nav_tab_selector + ':first' ).addClass( 'nav-tab-active' );
34
+
35
+ // get the first tab href
36
+ var initial_tab_href = $( nav_tab_selector + ':first' ).attr( 'href' );
37
+
38
+ // make all the tabs, except the first one hidden
39
+ $( '.sb-pack-tab' ).each( function( index, value ) {
40
+ if ( '#' + $( this ).attr( 'id' ) !== initial_tab_href ) {
41
+ $( this ).hide();
42
+ }
43
+ } );
44
+
45
+ /**
46
+ * Listen for click events on nav-tab links
47
+ */
48
+ $( nav_tab_selector ).click( function( event ) {
49
+
50
+ $( nav_tab_selector ).removeClass( 'nav-tab-active' ); // remove class from previous selector
51
+ $( this ).addClass( 'nav-tab-active' ).blur(); // add class to currently clicked selector
52
+
53
+ var clicked_tab = $( this ).attr( 'href' );
54
+
55
+ $( '.sb-pack-tab' ).each( function( index, value ) {
56
+ if ( '#' + $( this ).attr( 'id' ) !== clicked_tab ) {
57
+ $( this ).hide();
58
+ }
59
+
60
+ $( clicked_tab ).fadeIn();
61
+
62
+ } );
63
+
64
+ // prevent default behavior
65
+ event.preventDefault();
66
+
67
+ } );
68
+ }
69
+
70
+ $( document ).ready( function() {
71
+ admin_postboxes();
72
+ admin_tab_switching();
73
+ } );
74
+
75
  })( jQuery );
inc/js/analytics.js CHANGED
@@ -1,73 +1,73 @@
1
- (function(){var k=this,l=function(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};var m=function(a){var b=[];if(Array.prototype.indexOf)return a=b.indexOf(a),"number"==typeof a?a:-1;for(var c=0;c<b.length;c++)if(b[c]===a)return c;return-1},n=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},q=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var r=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;var t=window,u=document,v=function(a,b){u.addEventListener?u.addEventListener(a,b,!1):u.attachEvent&&u.attachEvent("on"+a,b)};var w=/:[0-9]+$/,y=function(a,b){var c=function(a){return a?a.replace(":","").toLowerCase():""};c=c(a.protocol)||c(t.location.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":a=x(a);break;case "protocol":a=c;break;case "host":a=(a.hostname||t.location.hostname).replace(w,"").toLowerCase();break;case "port":a=String(Number(a.hostname?a.port:t.location.port)||("http"==c?80:"https"==c?443:""));break;case "path":a="/"==a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");
2
- 0<=m(a[a.length-1])&&(a[a.length-1]="");a=a.join("/");break;case "query":a=a.search.replace("?","");break;case "extension":a=a.pathname.split(".");a=1<a.length?a[a.length-1]:"";a=a.split("/")[0];break;case "fragment":a=a.hash.replace("#","");break;default:a=a&&a.href}return a},x=function(a){var b="";a&&a.href&&(b=a.hash?a.href.replace(a.hash,""):a.href);return b},z=function(a){var b=document.createElement("a");a&&(r.test(a),b.href=a);a=b.pathname;"/"!==a[0]&&(a="/"+a);var c=b.hostname.replace(w,"");
3
- return{href:b.href,protocol:b.protocol,host:b.host,hostname:c,pathname:a,search:b.search,hash:b.hash,port:b.port}};function A(){for(var a=B,b={},c=0;c<a.length;++c)b[a[c]]=c;return b}function C(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a+=a.toLowerCase()+"0123456789-_";return a+"."}
4
- var B,D,E=function(a){B=B||C();D=D||A();for(var b=[],c=0;c<a.length;c+=3){var d=c+1<a.length,e=c+2<a.length,g=a.charCodeAt(c),f=d?a.charCodeAt(c+1):0,h=e?a.charCodeAt(c+2):0,p=g>>2;g=(g&3)<<4|f>>4;f=(f&15)<<2|h>>6;h&=63;e||(h=64,d||(f=64));b.push(B[p],B[g],B[f],B[h])}return b.join("")},F=function(a){function b(b){for(;d<a.length;){var c=a.charAt(d++),e=D[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}B=B||C();D=D||A();for(var c="",d=0;;){var e=
5
- b(-1),g=b(0),f=b(64),h=b(64);if(64===h&&-1===e)return c;c+=String.fromCharCode(e<<2|g>>4);64!=f&&(c+=String.fromCharCode(g<<4&240|f>>2),64!=h&&(c+=String.fromCharCode(f<<6&192|h)))}};var G;function H(a,b){if(!a||b===u.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}var I=function(){var a={};var b=t.google_tag_data;t.google_tag_data=void 0===b?a:b;a=t.google_tag_data;b=a.gl;b&&b.decorators||(b={decorators:[]},a.gl=b);return b};var J=/(.*?)\*(.*?)\*(.*)/,K=/([^?#]+)(\?[^#]*)?(#.*)?/,L=/(.*?)(^|&)_gl=([^&]*)&?(.*)/,N=function(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];void 0!==d&&d===d&&null!==d&&"[object Object]"!==d.toString()&&(b.push(c),b.push(E(String(d))))}a=b.join("*");return["1",M(a),a].join("*")},M=function(a,b){a=[window.navigator.userAgent,(new Date).getTimezoneOffset(),window.navigator.userLanguage||window.navigator.language,Math.floor((new Date).getTime()/60/1E3)-(void 0===b?0:b),a].join("*");
6
- if(!(b=G)){b=Array(256);for(var c=0;256>c;c++){for(var d=c,e=0;8>e;e++)d=d&1?d>>>1^3988292384:d>>>1;b[c]=d}}G=b;b=4294967295;for(c=0;c<a.length;c++)b=b>>>8^G[(b^a.charCodeAt(c))&255];return((b^-1)>>>0).toString(36)},Q=function(a){return function(b){var c=z(t.location.href),d=c.search.replace("?","");a:{var e=d.split("&");for(var g=0;g<e.length;g++){var f=e[g].split("=");if("_gl"==decodeURIComponent(f[0]).replace(/\+/g," ")){e=f.slice(1).join("=");break a}}e=void 0}b.query=O(e||"")||{};e=y(c,"fragment");
7
- g=e.match(L);b.fragment=O(g&&g[3]||"")||{};a&&P(c,d,e)}};function R(a){var b=L.exec(a);if(b){var c=b[2],d=b[4];a=b[1];d&&(a=a+c+d)}return a}
8
- var P=function(a,b,c){function d(a,b){a=R(a);a.length&&(a=b+a);return a}t.history&&t.history.replaceState&&(L.test(b)||L.test(c))&&(a=y(a,"path"),b=d(b,"?"),c=d(c,"#"),t.history.replaceState({},void 0,""+a+b+c))},O=function(a){var b=void 0===b?3:b;try{if(a){a:{for(var c=0;3>c;++c){var d=J.exec(a);if(d){var e=d;break a}a=decodeURIComponent(a)}e=void 0}if(e&&"1"===e[1]){var g=e[2],f=e[3];a:{for(e=0;e<b;++e)if(g===M(f,e)){var h=!0;break a}h=!1}if(h){b={};var p=f?f.split("*"):[];for(f=0;f<p.length;f+=
9
- 2)b[p[f]]=F(p[f+1]);return b}}}}catch(Y){}};function S(a,b,c){function d(a){a=R(a);var b=a.charAt(a.length-1);a&&"&"!==b&&(a+="&");return a+f}c=void 0===c?!1:c;var e=K.exec(b);if(!e)return"";b=e[1];var g=e[2]||"";e=e[3]||"";var f="_gl="+a;c?e="#"+d(e.substring(1)):g="?"+d(g.substring(1));return""+b+g+e}
10
- function T(a,b,c){for(var d={},e={},g=I().decorators,f=0;f<g.length;++f){var h=g[f];(!c||h.forms)&&H(h.domains,b)&&(h.fragment?n(e,h.callback()):n(d,h.callback()))}q(d)&&(b=N(d),c?U(b,a):V(b,a,!1));!c&&q(e)&&(c=N(e),V(c,a,!0))}function V(a,b,c){b.href&&(a=S(a,b.href,void 0===c?!1:c),r.test(a)&&(b.href=a))}
11
- function U(a,b){if(b&&b.action){var c=(b.method||"").toLowerCase();if("get"===c){c=b.childNodes||[];for(var d=!1,e=0;e<c.length;e++){var g=c[e];if("_gl"===g.name){g.setAttribute("value",a);d=!0;break}}d||(c=u.createElement("input"),c.setAttribute("type","hidden"),c.setAttribute("name","_gl"),c.setAttribute("value",a),b.appendChild(c))}else"post"===c&&(a=S(a,b.action),r.test(a)&&(b.action=a))}}
12
- var W=function(a){try{a:{var b=a.target||a.srcElement||{};for(a=100;b&&0<a;){if(b.href&&b.nodeName.match(/^a(?:rea)?$/i)){var c=b;break a}b=b.parentNode;a--}c=null}if(c){var d=c.protocol;"http:"!==d&&"https:"!==d||T(c,c.hostname,!1)}}catch(e){}},X=function(a){try{var b=a.target||a.srcElement||{};if(b.action){var c=y(z(b.action),"host");T(b,c,!0)}}catch(d){}};l("google_tag_data.glBridge.auto",function(a,b,c,d){var e=I();e.init||(v("mousedown",W),v("keyup",W),v("submit",X),e.init=!0);a={callback:a,domains:b,fragment:"fragment"===c,forms:!!d};I().decorators.push(a)});l("google_tag_data.glBridge.decorate",function(a,b,c){c=!!c;a=N(a);if(b.tagName){if("a"==b.tagName.toLowerCase())return V(a,b,c);if("form"==b.tagName.toLowerCase())return U(a,b)}if("string"==typeof b)return S(a,b,c)});l("google_tag_data.glBridge.generate",N);
13
- l("google_tag_data.glBridge.get",function(a,b){var c=Q(!!b);b=I();b.data||(b.data={query:{},fragment:{}},c(b.data));c={};if(b=b.data)n(c,b.query),a&&n(c,b.fragment);return c});})(window);
14
- (function(){function La(a){var b=1,c;if(a)for(b=0,c=a.length-1;0<=c;c--){var d=a.charCodeAt(c);b=(b<<6&268435455)+d+(d<<14);d=b&266338304;b=0!=d?b^d>>21:b}return b};var $c=function(a){this.w=a||[]};$c.prototype.set=function(a){this.w[a]=!0};$c.prototype.encode=function(){for(var a=[],b=0;b<this.w.length;b++)this.w[b]&&(a[Math.floor(b/6)]^=1<<b%6);for(b=0;b<a.length;b++)a[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a[b]||0);return a.join("")+"~"};var vd=new $c;function J(a){vd.set(a)}var Td=function(a){a=Dd(a);a=new $c(a);for(var b=vd.w.slice(),c=0;c<a.w.length;c++)b[c]=b[c]||a.w[c];return(new $c(b)).encode()},Dd=function(a){a=a.get(Gd);ka(a)||(a=[]);return a};var ea=function(a){return"function"==typeof a},ka=function(a){return"[object Array]"==Object.prototype.toString.call(Object(a))},qa=function(a){return void 0!=a&&-1<(a.constructor+"").indexOf("String")},D=function(a,b){return 0==a.indexOf(b)},sa=function(a){return a?a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""},ra=function(){for(var a=O.navigator.userAgent+(M.cookie?M.cookie:"")+(M.referrer?M.referrer:""),b=a.length,c=O.history.length;0<c;)a+=c--^b++;return[hd()^La(a)&2147483647,Math.round((new Date).getTime()/
15
- 1E3)].join(".")},ta=function(a){var b=M.createElement("img");b.width=1;b.height=1;b.src=a;return b},ua=function(){},K=function(a){if(encodeURIComponent instanceof Function)return encodeURIComponent(a);J(28);return a},L=function(a,b,c,d){try{a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)}catch(e){J(27)}},f=/^[\w\-:/.?=&%!\[\]]+$/,wa=function(a,b,c){a&&(c?(c="",b&&f.test(b)&&(c=' id="'+b+'"'),f.test(a)&&M.write("<script"+c+' src="'+a+'">\x3c/script>')):(c=M.createElement("script"),
16
- c.type="text/javascript",c.async=!0,c.src=a,b&&(c.id=b),a=M.getElementsByTagName("script")[0],a.parentNode.insertBefore(c,a)))},be=function(a,b){return E(M.location[b?"href":"search"],a)},E=function(a,b){return(a=a.match("(?:&|#|\\?)"+K(b).replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")+"=([^&#]*)"))&&2==a.length?a[1]:""},xa=function(){var a=""+M.location.hostname;return 0==a.indexOf("www.")?a.substring(4):a},de=function(a,b){var c=a.indexOf(b);if(5==c||6==c)if(a=a.charAt(c+b.length),"/"==a||"?"==a||
17
- ""==a||":"==a)return!0;return!1},ya=function(a,b){var c=M.referrer;if(/^(https?|android-app):\/\//i.test(c)){if(a)return c;a="//"+M.location.hostname;if(!de(c,a))return b&&(b=a.replace(/\./g,"-")+".cdn.ampproject.org",de(c,b))?void 0:c}},za=function(a,b){if(1==b.length&&null!=b[0]&&"object"===typeof b[0])return b[0];for(var c={},d=Math.min(a.length+1,b.length),e=0;e<d;e++)if("object"===typeof b[e]){for(var g in b[e])b[e].hasOwnProperty(g)&&(c[g]=b[e][g]);break}else e<a.length&&(c[a[e]]=b[e]);return c};var ee=function(){this.keys=[];this.values={};this.m={}};ee.prototype.set=function(a,b,c){this.keys.push(a);c?this.m[":"+a]=b:this.values[":"+a]=b};ee.prototype.get=function(a){return this.m.hasOwnProperty(":"+a)?this.m[":"+a]:this.values[":"+a]};ee.prototype.map=function(a){for(var b=0;b<this.keys.length;b++){var c=this.keys[b],d=this.get(c);d&&a(c,d)}};var O=window,M=document,va=function(a,b){return setTimeout(a,b)};var F=window,Ea=document,G=function(a){var b=F._gaUserPrefs;if(b&&b.ioo&&b.ioo()||a&&!0===F["ga-disable-"+a])return!0;try{var c=F.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(g){}a=[];b=String(Ea.cookie||document.cookie).split(";");for(c=0;c<b.length;c++){var d=b[c].split("="),e=d[0].replace(/^\s*|\s*$/g,"");e&&"AMP_TOKEN"==e&&((d=d.slice(1).join("=").replace(/^\s*|\s*$/g,""))&&(d=decodeURIComponent(d)),a.push(d))}for(b=0;b<a.length;b++)if("$OPT_OUT"==a[b])return!0;return!1};var Ca=function(a){var b=[],c=M.cookie.split(";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push(e[1])}return b},zc=function(a,b,c,d,e,g){e=G(e)?!1:eb.test(M.location.hostname)||"/"==c&&vc.test(d)?!1:!0;if(!e)return!1;b&&1200<b.length&&(b=b.substring(0,1200));c=a+"="+b+"; path="+c+"; ";g&&(c+="expires="+(new Date((new Date).getTime()+g)).toGMTString()+"; ");d&&"none"!==d&&(c+="domain="+d+";");d=M.cookie;M.cookie=c;if(!(d=d!=M.cookie))a:{a=Ca(a);
18
- for(d=0;d<a.length;d++)if(b==a[d]){d=!0;break a}d=!1}return d},Cc=function(a){return encodeURIComponent?encodeURIComponent(a).replace(/\(/g,"%28").replace(/\)/g,"%29"):a},vc=/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/,eb=/(^|\.)doubleclick\.net$/i;var oc,Id=/^.*Version\/?(\d+)[^\d].*$/i,ne=function(){if(void 0!==O.__ga4__)return O.__ga4__;if(void 0===oc){var a=O.navigator.userAgent;if(a){var b=a;try{b=decodeURIComponent(a)}catch(c){}if(a=!(0<=b.indexOf("Chrome"))&&!(0<=b.indexOf("CriOS"))&&(0<=b.indexOf("Safari/")||0<=b.indexOf("Safari,")))b=Id.exec(b),a=11<=(b?Number(b[1]):-1);oc=a}else oc=!1}return oc};var Fa,Ga,fb,Ab,ja=/^https?:\/\/[^/]*cdn\.ampproject\.org\//,Ue=/^(?:www\.|m\.|amp\.)+/,Ub=[],da=function(a){a:{if(ja.test(M.referrer)){var b=M.location.hostname.replace(Ue,"");b:{var c=M.referrer;c=c.replace(/^https?:\/\//,"");var d=c.replace(/^[^/]+/,"").split("/"),e=d[2];d=(d="s"==e?d[3]:e)?decodeURIComponent(d):d;if(!d){if(0==c.indexOf("xn--")){c="";break b}(c=c.match(/(.*)\.cdn\.ampproject\.org\/?$/))&&2==c.length&&(d=c[1].replace(/-/g,".").replace(/\.\./g,"-"))}c=d?d.replace(Ue,""):""}if(b==
19
- c){b=!0;break a}else J(78)}b=!1}if(b&&!1!==a[Kd]&&(void 0===Ab&&(b=(b=De.get())&&b._ga||void 0)&&(Ab=b,J(81)),void 0!==Ab))return a[Q]||(a[Q]=Ab),!1;if(a[Kd]){J(67);if(a[ac]&&"cookie"!=a[ac])return!1;if(void 0!==Ab)a[Q]||(a[Q]=Ab);else{a:if(b=String(a[W]||xa()),c=String(a[Yb]||"/"),d=Ca(String(a[U]||"_ga")),b=na(d,b,c),!b||jd.test(b))b=!0;else if(b=Ca("AMP_TOKEN"),0==b.length)b=!0;else{if(1==b.length&&(b=decodeURIComponent(b[0]),"$RETRIEVING"==b||"$OPT_OUT"==b||"$ERROR"==b||"$NOT_FOUND"==b)){b=!0;
20
- break a}b=!1}if(b&&tc(ic,String(a[Na])))return!0}}return!1},ic=function(){Z.D([ua])},tc=function(a,b){var c=Ca("AMP_TOKEN");if(1<c.length)return J(55),!1;c=decodeURIComponent(c[0]||"");if("$OPT_OUT"==c||"$ERROR"==c||G(b))return J(62),!1;if(!ja.test(M.referrer)&&"$NOT_FOUND"==c)return J(68),!1;if(void 0!==Ab)return J(56),va(function(){a(Ab)},0),!0;if(Fa)return Ub.push(a),!0;if("$RETRIEVING"==c)return J(57),va(function(){tc(a,b)},1E4),!0;Fa=!0;c&&"$"!=c[0]||(xc("$RETRIEVING",3E4),setTimeout(Mc,3E4),
21
- c="");return Pc(c,b)?(Ub.push(a),!0):!1},Pc=function(a,b,c){if(!window.JSON)return J(58),!1;var d=O.XMLHttpRequest;if(!d)return J(59),!1;var e=new d;if(!("withCredentials"in e))return J(60),!1;e.open("POST",(c||"https://ampcid.google.com/v1/publisher:getClientId")+"?key=AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM",!0);e.withCredentials=!0;e.setRequestHeader("Content-Type","text/plain");e.onload=function(){Fa=!1;if(4==e.readyState){try{200!=e.status&&(J(61),Qc("","$ERROR",3E4));var d=JSON.parse(e.responseText);
22
- d.optOut?(J(63),Qc("","$OPT_OUT",31536E6)):d.clientId?Qc(d.clientId,d.securityToken,31536E6):!c&&d.alternateUrl?(Ga&&clearTimeout(Ga),Fa=!0,Pc(a,b,d.alternateUrl)):(J(64),Qc("","$NOT_FOUND",36E5))}catch(ca){J(65),Qc("","$ERROR",3E4)}e=null}};d={originScope:"AMP_ECID_GOOGLE"};a&&(d.securityToken=a);e.send(JSON.stringify(d));Ga=va(function(){J(66);Qc("","$ERROR",3E4)},1E4);return!0},Mc=function(){Fa=!1},xc=function(a,b){if(void 0===fb){fb="";for(var c=id(),d=0;d<c.length;d++){var e=c[d];if(zc("AMP_TOKEN",
23
- encodeURIComponent(a),"/",e,"",b)){fb=e;return}}}zc("AMP_TOKEN",encodeURIComponent(a),"/",fb,"",b)},Qc=function(a,b,c){Ga&&clearTimeout(Ga);b&&xc(b,c);Ab=a;b=Ub;Ub=[];for(c=0;c<b.length;c++)b[c](a)};var oe=function(){return(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com"},Da=function(a){this.name="len";this.message=a+"-8192"},ba=function(a,b,c){c=c||ua;if(2036>=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b.length),new Da(b.length);},pe=function(a,b,c,d){d=d||ua;wd(a+"?"+b,"",d,c)},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c,d){var e=O.XMLHttpRequest;
24
- if(!e)return!1;var g=new e;if(!("withCredentials"in g))return!1;a=a.replace(/^http:/,"https:");g.open("POST",a,!0);g.withCredentials=!0;g.setRequestHeader("Content-Type","text/plain");g.onreadystatechange=function(){if(4==g.readyState){if(d)try{var a=g.responseText;if(1>a.length)ge("xhr","ver","0"),c();else if("1"!=a.charAt(0))ge("xhr","ver",String(a.length)),c();else if(3<d.count++)ge("xhr","tmr",""+d.count),c();else if(1==a.length)c();else{var b=a.charAt(1);if("d"==b)pe("https://stats.g.doubleclick.net/j/collect",
25
- d.U,d,c);else if("g"==b){var e="https://www.google.%/ads/ga-audiences".replace("%","com");wc(e,d.google,c);var w=a.substring(2);if(w)if(/^[a-z.]{1,6}$/.test(w)){var ha="https://www.google.%/ads/ga-audiences".replace("%",w);wc(ha,d.google,ua)}else ge("tld","bcc",w)}else ge("xhr","brc",b),c()}}catch(ue){ge("xhr","rsp"),c()}else c();g=null}};g.send(b);return!0},x=function(a,b,c){return O.navigator.sendBeacon?O.navigator.sendBeacon(a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=100*Math.random()||G("?")||
26
- (a=["t=error","_e="+a,"_v=j72","sr=1"],b&&a.push("_f="+b),c&&a.push("_m="+K(c.substring(0,100))),a.push("aip=1"),a.push("z="+hd()),wc("https://www.google-analytics.com/u/d",a.join("&"),ua))};var h=function(a){var b=O.gaData=O.gaData||{};return b[a]=b[a]||{}};var Ha=function(){this.M=[]};Ha.prototype.add=function(a){this.M.push(a)};Ha.prototype.D=function(a){try{for(var b=0;b<this.M.length;b++){var c=a.get(this.M[b]);c&&ea(c)&&c.call(O,a)}}catch(d){}b=a.get(Ia);b!=ua&&ea(b)&&(a.set(Ia,ua,!0),setTimeout(b,10))};function Ja(a){if(100!=a.get(Ka)&&La(P(a,Q))%1E4>=100*R(a,Ka))throw"abort";}function Ma(a){if(G(P(a,Na)))throw"abort";}function Oa(){var a=M.location.protocol;if("http:"!=a&&"https:"!=a)throw"abort";}
27
- function Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];Qa.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&("boolean"==typeof c&&(c*=1),b.push(d.F+"="+K(""+c))))});b.push("z="+Bd());a.set(Ra,b.join("&"),!0)}
28
- function Sa(a){var b=P(a,gd)||oe()+"/collect",c=a.get(qe),d=P(a,fa);!d&&a.get(Vd)&&(d="beacon");if(c)pe(b,P(a,Ra),c,a.get(Ia));else if(d){c=d;d=P(a,Ra);var e=a.get(Ia);e=e||ua;"image"==c?wc(b,d,e):"xhr"==c&&wd(b,d,e)||"beacon"==c&&x(b,d,e)||ba(b,d,e)}else ba(b,P(a,Ra),a.get(Ia));b=a.get(Na);b=h(b);c=b.hitcount;b.hitcount=c?c+1:1;b=a.get(Na);delete h(b).pending_experiments;a.set(Ia,ua,!0)}
29
- function Hc(a){(O.gaData=O.gaData||{}).expId&&a.set(Nc,(O.gaData=O.gaData||{}).expId);(O.gaData=O.gaData||{}).expVar&&a.set(Oc,(O.gaData=O.gaData||{}).expVar);var b=a.get(Na);if(b=h(b).pending_experiments){var c=[];for(d in b)b.hasOwnProperty(d)&&b[d]&&c.push(encodeURIComponent(d)+"."+encodeURIComponent(b[d]));var d=c.join("!")}else d=void 0;d&&a.set(m,d,!0)}function cd(){if(O.navigator&&"preview"==O.navigator.loadPurpose)throw"abort";}
30
- function yd(a){var b=O.gaDevIds;ka(b)&&0!=b.length&&a.set("&did",b.join(","),!0)}function vb(a){if(!a.get(Na))throw"abort";};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){c=R(a,Wa);var d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0<e&&(c=Math.min(c+e,20),a.set(Xa,d));if(0>=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee},Qa=new ee,Za=[];Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?"":""+a},R=function(a,b){a=a.get(b);return void 0==a||""===a?0:1*a};Ya.prototype.set=function(a,b,c){if(a)if("object"==typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};
31
- var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)},bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=Qa.get(a);if(!b)for(var c=0;c<Za.length;c++){var d=Za[c],e=d[0].exec(a);if(e){b=d[1](e);Qa.set(b.name,b);break}}return b},yc=function(a){var b;Qa.map(function(c,d){d.F==a&&(b=d)});return b&&b.name},S=function(a,b,c,d,e){a=new bb(a,b,c,d,e);Qa.set(a.name,a);return a.name},cb=function(a,
32
- b){Za.push([new RegExp("^"+a+"$"),b])},T=function(a,b,c){return S(a,b,c,void 0,db)},db=function(){};var gb=qa(window.GoogleAnalyticsObject)&&sa(window.GoogleAnalyticsObject)||"ga",jd=/^(?:utma\.)?\d+\.\d+$/,kd=/^amp-[\w.-]{22,64}$/,Ba=!1,hb=T("apiVersion","v"),ib=T("clientVersion","_v");S("anonymizeIp","aip");var jb=S("adSenseId","a"),Va=S("hitType","t"),Ia=S("hitCallback"),Ra=S("hitPayload");S("nonInteraction","ni");S("currencyCode","cu");S("dataSource","ds");var Vd=S("useBeacon",void 0,!1),fa=S("transport");S("sessionControl","sc","");S("sessionGroup","sg");S("queueTime","qt");var Ac=S("_s","_s");
33
- S("screenName","cd");var kb=S("location","dl",""),lb=S("referrer","dr"),mb=S("page","dp","");S("hostname","dh");var nb=S("language","ul"),ob=S("encoding","de");S("title","dt",function(){return M.title||void 0});cb("contentGroup([0-9]+)",function(a){return new bb(a[0],"cg"+a[1])});var pb=S("screenColors","sd"),qb=S("screenResolution","sr"),rb=S("viewportSize","vp"),sb=S("javaEnabled","je"),tb=S("flashVersion","fl");S("campaignId","ci");S("campaignName","cn");S("campaignSource","cs");
34
- S("campaignMedium","cm");S("campaignKeyword","ck");S("campaignContent","cc");
35
- var ub=S("eventCategory","ec"),xb=S("eventAction","ea"),yb=S("eventLabel","el"),zb=S("eventValue","ev"),Bb=S("socialNetwork","sn"),Cb=S("socialAction","sa"),Db=S("socialTarget","st"),Eb=S("l1","plt"),Fb=S("l2","pdt"),Gb=S("l3","dns"),Hb=S("l4","rrt"),Ib=S("l5","srt"),Jb=S("l6","tcp"),Kb=S("l7","dit"),Lb=S("l8","clt"),Ve=S("l9","_gst"),We=S("l10","_gbt"),Xe=S("l11","_cst"),Ye=S("l12","_cbt"),Mb=S("timingCategory","utc"),Nb=S("timingVar","utv"),Ob=S("timingLabel","utl"),Pb=S("timingValue","utt");
36
- S("appName","an");S("appVersion","av","");S("appId","aid","");S("appInstallerId","aiid","");S("exDescription","exd");S("exFatal","exf");var Nc=S("expId","xid"),Oc=S("expVar","xvar"),m=S("exp","exp"),Rc=S("_utma","_utma"),Sc=S("_utmz","_utmz"),Tc=S("_utmht","_utmht"),Ua=S("_hc",void 0,0),Xa=S("_ti",void 0,0),Wa=S("_to",void 0,20);cb("dimension([0-9]+)",function(a){return new bb(a[0],"cd"+a[1])});cb("metric([0-9]+)",function(a){return new bb(a[0],"cm"+a[1])});S("linkerParam",void 0,void 0,Bc,db);
37
- var Ze=T("_cd2l",void 0,!1),ld=S("usage","_u"),Gd=S("_um");S("forceSSL",void 0,void 0,function(){return Ba},function(a,b,c){J(34);Ba=!!c});var ed=S("_j1","jid"),ia=S("_j2","gjid");cb("\\&(.*)",function(a){var b=new bb(a[0],a[1]),c=yc(a[0].substring(1));c&&(b.Z=function(a){return a.get(c)},b.o=function(a,b,g,ca){a.set(c,g,ca)},b.F=void 0);return b});
38
- var Qb=T("_oot"),dd=S("previewTask"),Rb=S("checkProtocolTask"),md=S("validationTask"),Sb=S("checkStorageTask"),Uc=S("historyImportTask"),Tb=S("samplerTask"),Vb=S("_rlt"),Wb=S("buildHitTask"),Xb=S("sendHitTask"),Vc=S("ceTask"),zd=S("devIdTask"),Cd=S("timingTask"),Ld=S("displayFeaturesTask"),oa=S("customTask"),V=T("name"),Q=T("clientId","cid"),n=T("clientIdTime"),xd=T("storedClientId"),Ad=S("userId","uid"),Na=T("trackingId","tid"),U=T("cookieName",void 0,"_ga"),W=T("cookieDomain"),Yb=T("cookiePath",
39
- void 0,"/"),Zb=T("cookieExpires",void 0,63072E3),Hd=T("cookieUpdate",void 0,!0),$b=T("legacyCookieDomain"),Wc=T("legacyHistoryImport",void 0,!0),ac=T("storage",void 0,"cookie"),bc=T("allowLinker",void 0,!1),cc=T("allowAnchor",void 0,!0),Ka=T("sampleRate","sf",100),dc=T("siteSpeedSampleRate",void 0,1),ec=T("alwaysSendReferrer",void 0,!1),I=T("_gid","_gid"),la=T("_gcn"),Kd=T("useAmpClientId"),ce=T("_gclid"),fe=T("_gt"),he=T("_ge",void 0,7776E6),ie=T("_gclsrc"),je=T("storeGac",void 0,!0),gd=S("transportUrl"),
40
- Md=S("_r","_r"),qe=S("_dp"),Ud=S("allowAdFeatures",void 0,!0);function X(a,b,c,d){b[a]=function(){try{return d&&J(d),c.apply(this,arguments)}catch(e){throw ge("exc",a,e&&e.name),e;}}};var Od=function(){this.V=100;this.$=this.fa=!1;this.oa="detourexp";this.groups=1},Ed=function(a){var b=new Od,c;if(b.fa&&b.$)return 0;b.$=!0;if(a){if(b.oa&&void 0!==a.get(b.oa))return R(a,b.oa);if(0==a.get(dc))return 0}if(0==b.V)return 0;void 0===c&&(c=Bd());return 0==c%b.V?Math.floor(c/b.V)%b.groups+1:0};function fc(){var a,b;if((b=(b=O.navigator)?b.plugins:null)&&b.length)for(var c=0;c<b.length&&!a;c++){var d=b[c];-1<d.name.indexOf("Shockwave Flash")&&(a=d.description)}if(!a)try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),a="WIN 6,0,21,0",e.AllowScriptAccess="always",a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),a=e.GetVariable("$version")}catch(g){}a&&
41
- (e=a.match(/[\d]+/g))&&3<=e.length&&(a=e[0]+"."+e[1]+" r"+e[2]);return a||void 0};var aa=function(a){var b=Math.min(R(a,dc),100);return La(P(a,Q))%100>=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0<c?(Y(b,Gb),Y(b,Jb),Y(b,Ib),Y(b,Fb),Y(b,Hb),Y(b,Kb),Y(b,Lb),Y(b,Ve),Y(b,We),Y(b,Xe),Y(b,Ye),va(function(){a(b)},10)):L(O,"load",function(){gc(a)},!1))}},Ec=function(a){var b=O.performance||O.webkitPerformance;b=b&&b.timing;if(!b)return!1;var c=b.navigationStart;if(0==c)return!1;a[Eb]=b.loadEventStart-c;a[Gb]=b.domainLookupEnd-b.domainLookupStart;
42
- a[Jb]=b.connectEnd-b.connectStart;a[Ib]=b.responseStart-b.requestStart;a[Fb]=b.responseEnd-b.responseStart;a[Hb]=b.fetchStart-c;a[Kb]=b.domInteractive-c;a[Lb]=b.domContentLoadedEventStart-c;a[Ve]=N.L-c;a[We]=N.ya-c;O.google_tag_manager&&O.google_tag_manager._li&&(b=O.google_tag_manager._li,a[Xe]=b.cst,a[Ye]=b.cbt);return!0},Fc=function(a){if(O.top!=O)return!1;var b=O.external,c=b&&b.onloadT;b&&!b.isValidLoadTime&&(c=void 0);2147483648<c&&(c=void 0);0<c&&b.setPageReadyTime();if(void 0==c)return!1;
43
- a[Eb]=c;return!0},Y=function(a,b){var c=a[b];if(isNaN(c)||Infinity==c||0>c)a[b]=void 0},Fd=function(a){return function(b){if("pageview"==b.get(Va)&&!a.I){a.I=!0;var c=aa(b),d=0<E(b.get(kb),"gclid").length;(c||d)&&gc(function(b){c&&a.send("timing",b);d&&a.send("adtiming",b)})}}};var hc=!1,mc=function(a){if("cookie"==P(a,ac)){if(a.get(Hd)||P(a,xd)!=P(a,Q)){var b=1E3*R(a,Zb);ma(a,Q,U,b)}ma(a,I,la,864E5);if(a.get(je)){var c=a.get(ce);if(c){var d=Math.min(R(a,he),1E3*R(a,Zb));d=Math.min(d,1E3*R(a,fe)+d-(new Date).getTime());a.data.set(he,d);b={};var e=a.get(fe),g=a.get(ie),ca=kc(P(a,Yb)),l=lc(P(a,W));a=P(a,Na);g&&"aw.ds"!=g?b&&(b.ua=!0):(c=["1",e,Cc(c)].join("."),0<d&&(b&&(b.ta=!0),zc("_gac_"+Cc(a),c,ca,l,a,d)));le(b)}}else J(75)}},ma=function(a,b,c,d){var e=nd(a,b);if(e){c=
44
- P(a,c);var g=kc(P(a,Yb)),ca=lc(P(a,W)),l=P(a,Na);if("auto"!=ca)zc(c,e,g,ca,l,d)&&(hc=!0);else{J(32);for(var k=id(),w=0;w<k.length;w++)if(ca=k[w],a.data.set(W,ca),e=nd(a,b),zc(c,e,g,ca,l,d)){hc=!0;return}a.data.set(W,"auto")}}},nc=function(a){if("cookie"==P(a,ac)&&!hc&&(mc(a),!hc))throw"abort";},Yc=function(a){if(a.get(Wc)){var b=P(a,W),c=P(a,$b)||xa(),d=Xc("__utma",c,b);d&&(J(19),a.set(Tc,(new Date).getTime(),!0),a.set(Rc,d.R),(b=Xc("__utmz",c,b))&&d.hash==b.hash&&a.set(Sc,b.R))}},nd=function(a,b){b=
45
- Cc(P(a,b));var c=lc(P(a,W)).split(".").length;a=jc(P(a,Yb));1<a&&(c+="-"+a);return b?["GA1",c,b].join("."):""},Xd=function(a,b){return na(b,P(a,W),P(a,Yb))},na=function(a,b,c){if(!a||1>a.length)J(12);else{for(var d=[],e=0;e<a.length;e++){var g=a[e];var ca=g.split(".");var l=ca.shift();("GA1"==l||"1"==l)&&1<ca.length?(g=ca.shift().split("-"),1==g.length&&(g[1]="1"),g[0]*=1,g[1]*=1,ca={H:g,s:ca.join(".")}):ca=kd.test(g)?{H:[0,0],s:g}:void 0;ca&&d.push(ca)}if(1==d.length)return J(13),d[0].s;if(0==d.length)J(12);
46
- else{J(14);d=Gc(d,lc(b).split(".").length,0);if(1==d.length)return d[0].s;d=Gc(d,jc(c),1);1<d.length&&J(41);return d[0]&&d[0].s}}},Gc=function(a,b,c){for(var d=[],e=[],g,ca=0;ca<a.length;ca++){var l=a[ca];l.H[c]==b?d.push(l):void 0==g||l.H[c]<g?(e=[l],g=l.H[c]):l.H[c]==g&&e.push(l)}return 0<d.length?d:e},lc=function(a){return 0==a.indexOf(".")?a.substr(1):a},id=function(){var a=[],b=xa().split(".");if(4==b.length){var c=b[b.length-1];if(parseInt(c,10)==c)return["none"]}for(c=b.length-2;0<=c;c--)a.push(b.slice(c).join("."));
47
- b=M.location.hostname;eb.test(b)||vc.test(b)||a.push("none");return a},kc=function(a){if(!a)return"/";1<a.length&&a.lastIndexOf("/")==a.length-1&&(a=a.substr(0,a.length-1));0!=a.indexOf("/")&&(a="/"+a);return a},jc=function(a){a=kc(a);return"/"==a?1:a.split("/").length},le=function(a){a.ta&&J(77);a.na&&J(74);a.pa&&J(73);a.ua&&J(69)};function Xc(a,b,c){"none"==b&&(b="");var d=[],e=Ca(a);a="__utma"==a?6:2;for(var g=0;g<e.length;g++){var ca=(""+e[g]).split(".");ca.length>=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){if(null==a)var c=a=1;else c=La(a),a=La(D(a,".")?a.substring(1):"."+a);for(var d=0;d<b.length;d++)if(b[d].hash==c||b[d].hash==a)return b[d]};var od=new RegExp(/^https?:\/\/([^\/:]+)/),De=O.google_tag_data.glBridge,pd=/(.*)([?&#])(?:_ga=[^&#]*)(?:&?)(.*)/,me=/(.*)([?&#])(?:_gac=[^&#]*)(?:&?)(.*)/;function Bc(a){if(a.get(Ze))return J(35),De.generate($e(a));var b=a.get(Q),c=a.get(I)||"";b="_ga=2."+K(pa(c+b,0)+"."+c+"-"+b);(a=af(a))?(J(44),a="&_gac=1."+K([pa(a.qa,0),a.timestamp,a.qa].join("."))):a="";return b+a}
48
- function Ic(a,b){var c=new Date,d=O.navigator,e=d.plugins||[];a=[a,d.userAgent,c.getTimezoneOffset(),c.getYear(),c.getDate(),c.getHours(),c.getMinutes()+b];for(b=0;b<e.length;++b)a.push(e[b].description);return La(a.join("."))}function pa(a,b){var c=new Date,d=O.navigator,e=c.getHours()+Math.floor((c.getMinutes()+b)/60);return La([a,d.userAgent,d.language||"",c.getTimezoneOffset(),c.getYear(),c.getDate()+Math.floor(e/24),(24+e)%24,(60+c.getMinutes()+b)%60].join("."))}
49
- var Dc=function(a){J(48);this.target=a;this.T=!1};Dc.prototype.ca=function(a,b){if(a){if(this.target.get(Ze))return De.decorate($e(this.target),a,b);if(a.tagName){if("a"==a.tagName.toLowerCase()){a.href&&(a.href=qd(this,a.href,b));return}if("form"==a.tagName.toLowerCase())return rd(this,a)}if("string"==typeof a)return qd(this,a,b)}};
50
- var qd=function(a,b,c){var d=pd.exec(b);d&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));(d=me.exec(b))&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));a=a.target.get("linkerParam");var e=b.indexOf("?");d=b.indexOf("#");c?b+=(-1==d?"#":"&")+a:(c=-1==e?"?":"&",b=-1==d?b+(c+a):b.substring(0,d)+c+a+b.substring(d));b=b.replace(/&+_ga=/,"&_ga=");return b=b.replace(/&+_gac=/,"&_gac=")},rd=function(a,b){if(b&&b.action)if("get"==b.method.toLowerCase()){a=a.target.get("linkerParam").split("&");for(var c=0;c<a.length;c++){var d=
51
- a[c].split("="),e=d[1];d=d[0];for(var g=b.childNodes||[],ca=!1,l=0;l<g.length;l++)if(g[l].name==d){g[l].setAttribute("value",e);ca=!0;break}ca||(g=M.createElement("input"),g.setAttribute("type","hidden"),g.setAttribute("name",d),g.setAttribute("value",e),b.appendChild(g))}}else"post"==b.method.toLowerCase()&&(b.action=qd(a,b.action))};
52
- Dc.prototype.S=function(a,b,c){function d(c){try{c=c||O.event;a:{var d=c.target||c.srcElement;for(c=100;d&&0<c;){if(d.href&&d.nodeName.match(/^a(?:rea)?$/i)){var g=d;break a}d=d.parentNode;c--}g={}}("http:"==g.protocol||"https:"==g.protocol)&&sd(a,g.hostname||"")&&g.href&&(g.href=qd(e,g.href,b))}catch(k){J(26)}}var e=this;this.target.get(Ze)?De.auto(function(){return $e(e.target)},a,b?"fragment":"",c):(this.T||(this.T=!0,L(M,"mousedown",d,!1),L(M,"keyup",d,!1)),c&&L(M,"submit",function(b){b=b||O.event;
53
- if((b=b.target||b.srcElement)&&b.action){var c=b.action.match(od);c&&sd(a,c[1])&&rd(e,b)}}))};function sd(a,b){if(b==M.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}function ke(a,b){return b!=Ic(a,0)&&b!=Ic(a,-1)&&b!=Ic(a,-2)&&b!=pa(a,0)&&b!=pa(a,-1)&&b!=pa(a,-2)}function $e(a){var b=af(a);return{_ga:a.get(Q),_gid:a.get(I)||void 0,_gac:b?[b.qa,b.timestamp].join("."):void 0}}
54
- function af(a){function b(a){return void 0==a||""===a?0:Number(a)}var c=a.get(ce);if(c&&a.get(je)){var d=b(a.get(fe));if(1E3*d+b(a.get(he))<=(new Date).getTime())J(76);else return{timestamp:d,qa:c}}};var p=/^(GTM|OPT)-[A-Z0-9]+$/,q=/;_gaexp=[^;]*/g,r=/;((__utma=)|([^;=]+=GAX?\d+\.))[^;]*/g,Aa=/^https?:\/\/[\w\-.]+\.google.com(:\d+)?\/optimize\/opt-launch\.html\?.*$/,t=function(a){function b(a,b){b&&(c+="&"+a+"="+K(b))}var c="https://www.google-analytics.com/gtm/js?id="+K(a.id);"dataLayer"!=a.B&&b("l",a.B);b("t",a.target);b("cid",a.clientId);b("cidt",a.ka);b("gac",a.la);b("aip",a.ia);a.sync&&b("m","sync");b("cycle",a.G);a.qa&&b("gclid",a.qa);Aa.test(M.referrer)&&b("cb",String(hd()));return c};var Jd=function(a,b,c){this.aa=b;(b=c)||(b=(b=P(a,V))&&"t0"!=b?Wd.test(b)?"_gat_"+Cc(P(a,Na)):"_gat_"+Cc(b):"_gat");this.Y=b;this.ra=null},Rd=function(a,b){var c=b.get(Wb);b.set(Wb,function(b){Pd(a,b,ed);Pd(a,b,ia);var d=c(b);Qd(a,b);return d});var d=b.get(Xb);b.set(Xb,function(b){var c=d(b);if(se(b)){if(ne()!==H(a,b)){J(80);var e={U:re(a,b,1),google:re(a,b,2),count:0};pe("https://stats.g.doubleclick.net/j/collect",e.U,e)}else ta(re(a,b,0));b.set(ed,"",!0)}return c})},Pd=function(a,b,c){!1===b.get(Ud)||
55
- b.get(c)||("1"==Ca(a.Y)[0]?b.set(c,"",!0):b.set(c,""+hd(),!0))},Qd=function(a,b){se(b)&&zc(a.Y,"1",b.get(Yb),b.get(W),b.get(Na),6E4)},se=function(a){return!!a.get(ed)&&a.get(Ud)},re=function(a,b,c){var d=new ee,e=function(a){$a(a).F&&d.set($a(a).F,b.get(a))};e(hb);e(ib);e(Na);e(Q);e(ed);if(0==c||1==c)e(Ad),e(ia),e(I);d.set($a(ld).F,Td(b));var g="";d.map(function(a,b){g+=K(a)+"=";g+=K(""+b)+"&"});g+="z="+hd();0==c?g=a.aa+g:1==c?g="t=dc&aip=1&_r=3&"+g:2==c&&(g="t=sr&aip=1&_r=4&slf_rd=1&"+g);return g},
56
- H=function(a,b){null===a.ra&&(a.ra=1===Ed(b),a.ra&&J(33));return a.ra},Wd=/^gtm\d+$/;var fd=function(a,b){a=a.b;if(!a.get("dcLoaded")){var c=new $c(Dd(a));c.set(29);a.set(Gd,c.w);b=b||{};var d;b[U]&&(d=Cc(b[U]));b=new Jd(a,"https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&",d);Rd(b,a);a.set("dcLoaded",!0)}};var Sd=function(a){if(!a.get("dcLoaded")&&"cookie"==a.get(ac)){var b=new Jd(a);Pd(b,a,ed);Pd(b,a,ia);Qd(b,a);if(se(a)){var c=ne()!==H(b,a);a.set(Md,1,!0);c?(J(79),a.set(gd,oe()+"/j/collect",!0),a.set(qe,{U:re(b,a,1),google:re(b,a,2),count:0},!0)):a.set(gd,oe()+"/r/collect",!0)}}};var Lc=function(){var a=O.gaGlobal=O.gaGlobal||{};return a.hid=a.hid||hd()};var ad,bd=function(a,b,c){if(!ad){var d=M.location.hash;var e=O.name,g=/^#?gaso=([^&]*)/;if(e=(d=(d=d&&d.match(g)||e&&e.match(g))?d[1]:Ca("GASO")[0]||"")&&d.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))zc("GASO",""+d,c,b,a,0),window._udo||(window._udo=b),window._utcp||(window._utcp=c),a=e[1],wa("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(a?"prefix="+a+"&":"")+hd(),"_gasojs");ad=!0}};var wb=/^(UA|YT|MO|GP)-(\d+)-(\d+)$/,pc=function(a){function b(a,b){d.b.data.set(a,b)}function c(a,c){b(a,c);d.filters.add(a)}var d=this;this.b=new Ya;this.filters=new Ha;b(V,a[V]);b(Na,sa(a[Na]));b(U,a[U]);b(W,a[W]||xa());b(Yb,a[Yb]);b(Zb,a[Zb]);b(Hd,a[Hd]);b($b,a[$b]);b(Wc,a[Wc]);b(bc,a[bc]);b(cc,a[cc]);b(Ka,a[Ka]);b(dc,a[dc]);b(ec,a[ec]);b(ac,a[ac]);b(Ad,a[Ad]);b(n,a[n]);b(Kd,a[Kd]);b(je,a[je]);b(Ze,a[Ze]);b(hb,1);b(ib,"j72");c(Qb,Ma);c(oa,ua);c(dd,cd);c(Rb,Oa);c(md,vb);c(Sb,nc);c(Uc,Yc);c(Tb,
57
- Ja);c(Vb,Ta);c(Vc,Hc);c(zd,yd);c(Ld,Sd);c(Wb,Pa);c(Xb,Sa);c(Cd,Fd(this));Kc(this.b);Jc(this.b,a[Q]);this.b.set(jb,Lc());bd(this.b.get(Na),this.b.get(W),this.b.get(Yb))},Jc=function(a,b){var c=P(a,U);a.data.set(la,"_ga"==c?"_gid":c+"_gid");if("cookie"==P(a,ac)){hc=!1;c=Ca(P(a,U));c=Xd(a,c);if(!c){c=P(a,W);var d=P(a,$b)||xa();c=Xc("__utma",d,c);void 0!=c?(J(10),c=c.O[1]+"."+c.O[2]):c=void 0}c&&(hc=!0);if(d=c&&!a.get(Hd))if(d=c.split("."),2!=d.length)d=!1;else if(d=Number(d[1])){var e=R(a,Zb);d=d+e<
58
- (new Date).getTime()/1E3}else d=!1;d&&(c=void 0);c&&(a.data.set(xd,c),a.data.set(Q,c),c=Ca(P(a,la)),(c=Xd(a,c))&&a.data.set(I,c));if(a.get(je)&&(c=a.get(ce),d=a.get(ie),!c||d&&"aw.ds"!=d)){c={};if(M){d=[];e=M.cookie.split(";");for(var g=/^\s*_gac_(UA-\d+-\d+)=\s*(.+?)\s*$/,ca=0;ca<e.length;ca++){var l=e[ca].match(g);l&&d.push({ja:l[1],value:l[2]})}e={};if(d&&d.length)for(g=0;g<d.length;g++)(ca=d[g].value.split("."),"1"!=ca[0]||3!=ca.length)?c&&(c.na=!0):ca[1]&&(e[d[g].ja]?c&&(c.pa=!0):e[d[g].ja]=
59
- [],e[d[g].ja].push({timestamp:ca[1],qa:ca[2]}));d=e}else d={};d=d[P(a,Na)];le(c);d&&0!=d.length&&(c=d[0],a.data.set(fe,c.timestamp),a.data.set(ce,c.qa))}}if(a.get(Hd)&&(c=be("_ga",a.get(cc)),d=be("_gl",a.get(cc)),e=De.get(a.get(cc)),g=e._ga,d&&0<d.indexOf("_ga")&&!g&&J(30),c||g))if(c&&g&&J(36),a.get(bc)){if(g&&(J(38),a.data.set(Q,g),e._gid&&(J(51),a.data.set(I,e._gid)),e._gac&&(d=e._gac.split("."))&&2==d.length&&(J(37),a.data.set(ce,d[0]),a.data.set(fe,d[1]))),c)b:if(d=c.indexOf("."),-1==d)J(22);
60
- else{e=c.substring(0,d);g=c.substring(d+1);d=g.indexOf(".");c=g.substring(0,d);g=g.substring(d+1);if("1"==e){if(d=g,ke(d,c)){J(23);break b}}else if("2"==e){d=g.indexOf("-");e="";0<d?(e=g.substring(0,d),d=g.substring(d+1)):d=g.substring(1);if(ke(e+d,c)){J(53);break b}e&&(J(2),a.data.set(I,e))}else{J(22);break b}J(11);a.data.set(Q,d);if(c=be("_gac",a.get(cc)))c=c.split("."),"1"!=c[0]||4!=c.length?J(72):ke(c[3],c[1])?J(71):(a.data.set(ce,c[3]),a.data.set(fe,c[2]),J(70))}}else J(21);b&&(J(9),a.data.set(Q,
61
- K(b)));a.get(Q)||((b=(b=O.gaGlobal&&O.gaGlobal.vid)&&-1!=b.search(jd)?b:void 0)?(J(17),a.data.set(Q,b)):(J(8),a.data.set(Q,ra())));a.get(I)||(J(3),a.data.set(I,ra()));mc(a)},Kc=function(a){var b=O.navigator,c=O.screen,d=M.location;a.set(lb,ya(a.get(ec),a.get(Kd)));if(d){var e=d.pathname||"";"/"!=e.charAt(0)&&(J(31),e="/"+e);a.set(kb,d.protocol+"//"+d.hostname+e+d.search)}c&&a.set(qb,c.width+"x"+c.height);c&&a.set(pb,c.colorDepth+"-bit");c=M.documentElement;var g=(e=M.body)&&e.clientWidth&&e.clientHeight,
62
- ca=[];c&&c.clientWidth&&c.clientHeight&&("CSS1Compat"===M.compatMode||!g)?ca=[c.clientWidth,c.clientHeight]:g&&(ca=[e.clientWidth,e.clientHeight]);c=0>=ca[0]||0>=ca[1]?"":ca.join("x");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"").toLowerCase());a.data.set(ce,be("gclid",!0));a.data.set(ie,be("gclsrc",!0));a.data.set(fe,Math.round((new Date).getTime()/1E3));if(d&&a.get(cc)&&
63
- (b=M.location.hash)){b=b.split(/[?&#]+/);d=[];for(c=0;c<b.length;++c)(D(b[c],"utm_id")||D(b[c],"utm_campaign")||D(b[c],"utm_source")||D(b[c],"utm_medium")||D(b[c],"utm_term")||D(b[c],"utm_content")||D(b[c],"gclid")||D(b[c],"dclid")||D(b[c],"gclsrc"))&&d.push(b[c]);0<d.length&&(b="#"+d.join("&"),a.set(kb,a.get(kb)+b))}};pc.prototype.get=function(a){return this.b.get(a)};pc.prototype.set=function(a,b){this.b.set(a,b)};var qc={pageview:[mb],event:[ub,xb,yb,zb],social:[Bb,Cb,Db],timing:[Mb,Nb,Pb,Ob]};
64
- pc.prototype.send=function(a){if(!(1>arguments.length)){if("string"===typeof arguments[0]){var b=arguments[0];var c=[].slice.call(arguments,1)}else b=arguments[0]&&arguments[0][Va],c=arguments;b&&(c=za(qc[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b.data.m={})}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=c,e=M;e.removeEventListener?e.removeEventListener("visibilitychange",d,!1):e.detachEvent&&e.detachEvent("onvisibilitychange",d)}};L(M,"visibilitychange",c)}};var td=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=td.exec(a[0]);null!=b&&4==b.length&&(this.c=b[1]||"t0",this.K=b[2]||"",this.C=b[3],this.a=[].slice.call(a,1),this.K||(this.A="create"==this.C,this.i="require"==this.C,this.g="provide"==this.C,this.ba="remove"==this.C),this.i&&(3<=this.a.length?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";
65
- if(this.g&&(!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.c)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.c)throw"abort";}};function ud(a){return 0<=a.indexOf(".")||0<=a.indexOf(":")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};
66
- var u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);if(p.test(b)){J(52);a=N.j(a);if(!a)return!0;c=d||{};d={id:b,B:c.dataLayer||"dataLayer",ia:!!a.get("anonymizeIp"),sync:e,G:!1};a.get("&gtm")==b&&(d.G=!0);var g=String(a.get("name"));"t0"!=g&&(d.target=g);G(String(a.get("trackingId")))||(d.clientId=
67
- String(a.get(Q)),d.ka=Number(a.get(n)),c=c.palindrome?r:q,c=(c=M.cookie.replace(/^|(; +)/g,";").match(c))?c.sort().join("").substring(1):void 0,d.la=c,d.qa=E(a.b.get(kb)||"","gclid"));a=d.B;c=(new Date).getTime();O[a]=O[a]||[];c={"gtm.start":c};e||(c.event="gtm.js");O[a].push(c);c=t(d)}!c&&Zd.hasOwnProperty(b)?(J(39),c=b+".js"):J(43);c&&(c&&0<=c.indexOf("/")||(c=(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com/plugins/ua/"+c),d=ae(c),a=d.protocol,c=M.location.protocol,
68
- ("https:"==a||a==c||("http:"!=a?0:"http:"==c))&&B(d)&&(wa(d.url,void 0,e),$d.set(b,!0)))}},v=function(a,b){var c=A.get(a)||[];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;c<b.length;c++)b[c]();A.set(a,[])},B=function(a){var b=ae(M.location.href);if(D(a.url,"https://www.google-analytics.com/gtm/js?id="))return!0;if(a.query||0<=a.url.indexOf("?")||0<=a.path.indexOf("://"))return!1;if(a.host==b.host&&a.port==b.port)return!0;b="http:"==a.protocol?80:443;return"www.google-analytics.com"==
69
- a.host&&(a.port||b)==b&&D(a.path,"/plugins/")?!0:!1},ae=function(a){function b(a){var b=a.hostname||"",c=0<=b.indexOf("]");b=b.split(c?"]":":")[0].toLowerCase();c&&(b+="]");c=(a.protocol||"").toLowerCase();c=1*a.port||("http:"==c?80:"https:"==c?443:"");a=a.pathname||"";D(a,"/")||(a="/"+a);return[b,""+c,a]}var c=M.createElement("a");c.href=M.location.href;var d=(c.protocol||"").toLowerCase(),e=b(c),g=c.search||"",ca=d+"//"+e[0]+(e[1]?":"+e[1]:"");D(a,"//")?a=d+a:D(a,"/")?a=ca+a:!a||D(a,"?")?a=ca+e[2]+
70
- (a||g):0>a.split("/")[0].indexOf(":")&&(a=ca+e[2].substring(0,e[2].lastIndexOf("/"))+"/"+a);c.href=a;d=b(c);return{protocol:(c.protocol||"").toLowerCase(),host:d[0],port:d[1],path:d[2],query:c.search||"",url:a||""}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments);b=Z.f.concat(b);for(Z.f=[];0<b.length&&!Z.v(b[0])&&!(b.shift(),0<Z.f.length););Z.f=Z.f.concat(b)};Z.J=function(a){for(var b=[],c=0;c<arguments.length;c++)try{var d=new sc(arguments[c]);d.g?C(d.a[0],d.a[1]):(d.i&&(d.ha=y(d.c,d.a[0],d.X,d.W)),b.push(d))}catch(e){}return b};
71
- Z.v=function(a){try{if(a.u)a.u.call(O,N.j("t0"));else{var b=a.c==gb?N:N.j(a.c);if(a.A){if("t0"==a.c&&(b=N.create.apply(N,a.a),null===b))return!0}else if(a.ba)N.remove(a.c);else if(b)if(a.i){if(a.ha&&(a.ha=y(a.c,a.a[0],a.X,a.W)),!u(a.a[0],b,a.W))return!0}else if(a.K){var c=a.C,d=a.a,e=b.plugins_.get(a.K);e[c].apply(e,d)}else b[a.C].apply(b,a.a)}}catch(g){}};var N=function(a){J(1);Z.D.apply(Z,[arguments])};N.h={};N.P=[];N.L=0;N.ya=0;N.answer=42;var uc=[Na,W,V];N.create=function(a){var b=za(uc,[].slice.call(arguments));b[V]||(b[V]="t0");var c=""+b[V];if(N.h[c])return N.h[c];if(da(b))return null;b=new pc(b);N.h[c]=b;N.P.push(b);return b};N.remove=function(a){for(var b=0;b<N.P.length;b++)if(N.P[b].get(V)==a){N.P.splice(b,1);N.h[a]=null;break}};N.j=function(a){return N.h[a]};N.getAll=function(){return N.P.slice(0)};
72
- N.N=function(){"ga"!=gb&&J(49);var a=O[gb];if(!a||42!=a.answer){N.L=a&&a.l;N.ya=1*new Date;N.loaded=!0;var b=O[gb]=N;X("create",b,b.create);X("remove",b,b.remove);X("getByName",b,b.j,5);X("getAll",b,b.getAll,6);b=pc.prototype;X("get",b,b.get,7);X("set",b,b.set,4);X("send",b,b.send);X("requireSync",b,b.ma);b=Ya.prototype;X("get",b,b.get);X("set",b,b.set);if("https:"!=M.location.protocol&&!Ba){a:{b=M.getElementsByTagName("script");for(var c=0;c<b.length&&100>c;c++){var d=b[c].src;if(d&&0==d.indexOf("https://www.google-analytics.com/analytics")){b=
73
- !0;break a}}b=!1}b&&(Ba=!0)}(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);C("displayfeatures",fd);C("adfeatures",fd);a=a&&a.q;ka(a)?Z.D.apply(N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b<a.length;b++)a[b].get(V)};var Nd=N.N,te=O[gb];te&&te.r?Nd():z(Nd);z(function(){Z.D(["provide","render",ua])});})(window);
1
+ (function(){var k=this,l=function(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};var m=function(a){var b=[];if(Array.prototype.indexOf)return a=b.indexOf(a),"number"==typeof a?a:-1;for(var c=0;c<b.length;c++)if(b[c]===a)return c;return-1},n=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},q=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var r=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;var t=window,u=document,v=function(a,b){u.addEventListener?u.addEventListener(a,b,!1):u.attachEvent&&u.attachEvent("on"+a,b)};var w=/:[0-9]+$/,y=function(a,b){var c=function(a){return a?a.replace(":","").toLowerCase():""};c=c(a.protocol)||c(t.location.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":a=x(a);break;case "protocol":a=c;break;case "host":a=(a.hostname||t.location.hostname).replace(w,"").toLowerCase();break;case "port":a=String(Number(a.hostname?a.port:t.location.port)||("http"==c?80:"https"==c?443:""));break;case "path":a="/"==a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");
2
+ 0<=m(a[a.length-1])&&(a[a.length-1]="");a=a.join("/");break;case "query":a=a.search.replace("?","");break;case "extension":a=a.pathname.split(".");a=1<a.length?a[a.length-1]:"";a=a.split("/")[0];break;case "fragment":a=a.hash.replace("#","");break;default:a=a&&a.href}return a},x=function(a){var b="";a&&a.href&&(b=a.hash?a.href.replace(a.hash,""):a.href);return b},z=function(a){var b=document.createElement("a");a&&(r.test(a),b.href=a);a=b.pathname;"/"!==a[0]&&(a="/"+a);var c=b.hostname.replace(w,"");
3
+ return{href:b.href,protocol:b.protocol,host:b.host,hostname:c,pathname:a,search:b.search,hash:b.hash,port:b.port}};function A(){for(var a=B,b={},c=0;c<a.length;++c)b[a[c]]=c;return b}function C(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a+=a.toLowerCase()+"0123456789-_";return a+"."}
4
+ var B,D,E=function(a){B=B||C();D=D||A();for(var b=[],c=0;c<a.length;c+=3){var d=c+1<a.length,e=c+2<a.length,g=a.charCodeAt(c),f=d?a.charCodeAt(c+1):0,h=e?a.charCodeAt(c+2):0,p=g>>2;g=(g&3)<<4|f>>4;f=(f&15)<<2|h>>6;h&=63;e||(h=64,d||(f=64));b.push(B[p],B[g],B[f],B[h])}return b.join("")},F=function(a){function b(b){for(;d<a.length;){var c=a.charAt(d++),e=D[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}B=B||C();D=D||A();for(var c="",d=0;;){var e=
5
+ b(-1),g=b(0),f=b(64),h=b(64);if(64===h&&-1===e)return c;c+=String.fromCharCode(e<<2|g>>4);64!=f&&(c+=String.fromCharCode(g<<4&240|f>>2),64!=h&&(c+=String.fromCharCode(f<<6&192|h)))}};var G;function H(a,b){if(!a||b===u.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}var I=function(){var a={};var b=t.google_tag_data;t.google_tag_data=void 0===b?a:b;a=t.google_tag_data;b=a.gl;b&&b.decorators||(b={decorators:[]},a.gl=b);return b};var J=/(.*?)\*(.*?)\*(.*)/,K=/([^?#]+)(\?[^#]*)?(#.*)?/,L=/(.*?)(^|&)_gl=([^&]*)&?(.*)/,N=function(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];void 0!==d&&d===d&&null!==d&&"[object Object]"!==d.toString()&&(b.push(c),b.push(E(String(d))))}a=b.join("*");return["1",M(a),a].join("*")},M=function(a,b){a=[window.navigator.userAgent,(new Date).getTimezoneOffset(),window.navigator.userLanguage||window.navigator.language,Math.floor((new Date).getTime()/60/1E3)-(void 0===b?0:b),a].join("*");
6
+ if(!(b=G)){b=Array(256);for(var c=0;256>c;c++){for(var d=c,e=0;8>e;e++)d=d&1?d>>>1^3988292384:d>>>1;b[c]=d}}G=b;b=4294967295;for(c=0;c<a.length;c++)b=b>>>8^G[(b^a.charCodeAt(c))&255];return((b^-1)>>>0).toString(36)},Q=function(a){return function(b){var c=z(t.location.href),d=c.search.replace("?","");a:{var e=d.split("&");for(var g=0;g<e.length;g++){var f=e[g].split("=");if("_gl"==decodeURIComponent(f[0]).replace(/\+/g," ")){e=f.slice(1).join("=");break a}}e=void 0}b.query=O(e||"")||{};e=y(c,"fragment");
7
+ g=e.match(L);b.fragment=O(g&&g[3]||"")||{};a&&P(c,d,e)}};function R(a){var b=L.exec(a);if(b){var c=b[2],d=b[4];a=b[1];d&&(a=a+c+d)}return a}
8
+ var P=function(a,b,c){function d(a,b){a=R(a);a.length&&(a=b+a);return a}t.history&&t.history.replaceState&&(L.test(b)||L.test(c))&&(a=y(a,"path"),b=d(b,"?"),c=d(c,"#"),t.history.replaceState({},void 0,""+a+b+c))},O=function(a){var b=void 0===b?3:b;try{if(a){a:{for(var c=0;3>c;++c){var d=J.exec(a);if(d){var e=d;break a}a=decodeURIComponent(a)}e=void 0}if(e&&"1"===e[1]){var g=e[2],f=e[3];a:{for(e=0;e<b;++e)if(g===M(f,e)){var h=!0;break a}h=!1}if(h){b={};var p=f?f.split("*"):[];for(f=0;f<p.length;f+=
9
+ 2)b[p[f]]=F(p[f+1]);return b}}}}catch(Y){}};function S(a,b,c){function d(a){a=R(a);var b=a.charAt(a.length-1);a&&"&"!==b&&(a+="&");return a+f}c=void 0===c?!1:c;var e=K.exec(b);if(!e)return"";b=e[1];var g=e[2]||"";e=e[3]||"";var f="_gl="+a;c?e="#"+d(e.substring(1)):g="?"+d(g.substring(1));return""+b+g+e}
10
+ function T(a,b,c){for(var d={},e={},g=I().decorators,f=0;f<g.length;++f){var h=g[f];(!c||h.forms)&&H(h.domains,b)&&(h.fragment?n(e,h.callback()):n(d,h.callback()))}q(d)&&(b=N(d),c?U(b,a):V(b,a,!1));!c&&q(e)&&(c=N(e),V(c,a,!0))}function V(a,b,c){b.href&&(a=S(a,b.href,void 0===c?!1:c),r.test(a)&&(b.href=a))}
11
+ function U(a,b){if(b&&b.action){var c=(b.method||"").toLowerCase();if("get"===c){c=b.childNodes||[];for(var d=!1,e=0;e<c.length;e++){var g=c[e];if("_gl"===g.name){g.setAttribute("value",a);d=!0;break}}d||(c=u.createElement("input"),c.setAttribute("type","hidden"),c.setAttribute("name","_gl"),c.setAttribute("value",a),b.appendChild(c))}else"post"===c&&(a=S(a,b.action),r.test(a)&&(b.action=a))}}
12
+ var W=function(a){try{a:{var b=a.target||a.srcElement||{};for(a=100;b&&0<a;){if(b.href&&b.nodeName.match(/^a(?:rea)?$/i)){var c=b;break a}b=b.parentNode;a--}c=null}if(c){var d=c.protocol;"http:"!==d&&"https:"!==d||T(c,c.hostname,!1)}}catch(e){}},X=function(a){try{var b=a.target||a.srcElement||{};if(b.action){var c=y(z(b.action),"host");T(b,c,!0)}}catch(d){}};l("google_tag_data.glBridge.auto",function(a,b,c,d){var e=I();e.init||(v("mousedown",W),v("keyup",W),v("submit",X),e.init=!0);a={callback:a,domains:b,fragment:"fragment"===c,forms:!!d};I().decorators.push(a)});l("google_tag_data.glBridge.decorate",function(a,b,c){c=!!c;a=N(a);if(b.tagName){if("a"==b.tagName.toLowerCase())return V(a,b,c);if("form"==b.tagName.toLowerCase())return U(a,b)}if("string"==typeof b)return S(a,b,c)});l("google_tag_data.glBridge.generate",N);
13
+ l("google_tag_data.glBridge.get",function(a,b){var c=Q(!!b);b=I();b.data||(b.data={query:{},fragment:{}},c(b.data));c={};if(b=b.data)n(c,b.query),a&&n(c,b.fragment);return c});})(window);
14
+ (function(){function La(a){var b=1,c;if(a)for(b=0,c=a.length-1;0<=c;c--){var d=a.charCodeAt(c);b=(b<<6&268435455)+d+(d<<14);d=b&266338304;b=0!=d?b^d>>21:b}return b};var $c=function(a){this.w=a||[]};$c.prototype.set=function(a){this.w[a]=!0};$c.prototype.encode=function(){for(var a=[],b=0;b<this.w.length;b++)this.w[b]&&(a[Math.floor(b/6)]^=1<<b%6);for(b=0;b<a.length;b++)a[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a[b]||0);return a.join("")+"~"};var vd=new $c;function J(a){vd.set(a)}var Td=function(a){a=Dd(a);a=new $c(a);for(var b=vd.w.slice(),c=0;c<a.w.length;c++)b[c]=b[c]||a.w[c];return(new $c(b)).encode()},Dd=function(a){a=a.get(Gd);ka(a)||(a=[]);return a};var ea=function(a){return"function"==typeof a},ka=function(a){return"[object Array]"==Object.prototype.toString.call(Object(a))},qa=function(a){return void 0!=a&&-1<(a.constructor+"").indexOf("String")},D=function(a,b){return 0==a.indexOf(b)},sa=function(a){return a?a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):""},ra=function(){for(var a=O.navigator.userAgent+(M.cookie?M.cookie:"")+(M.referrer?M.referrer:""),b=a.length,c=O.history.length;0<c;)a+=c--^b++;return[hd()^La(a)&2147483647,Math.round((new Date).getTime()/
15
+ 1E3)].join(".")},ta=function(a){var b=M.createElement("img");b.width=1;b.height=1;b.src=a;return b},ua=function(){},K=function(a){if(encodeURIComponent instanceof Function)return encodeURIComponent(a);J(28);return a},L=function(a,b,c,d){try{a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)}catch(e){J(27)}},f=/^[\w\-:/.?=&%!\[\]]+$/,wa=function(a,b,c){a&&(c?(c="",b&&f.test(b)&&(c=' id="'+b+'"'),f.test(a)&&M.write("<script"+c+' src="'+a+'">\x3c/script>')):(c=M.createElement("script"),
16
+ c.type="text/javascript",c.async=!0,c.src=a,b&&(c.id=b),a=M.getElementsByTagName("script")[0],a.parentNode.insertBefore(c,a)))},be=function(a,b){return E(M.location[b?"href":"search"],a)},E=function(a,b){return(a=a.match("(?:&|#|\\?)"+K(b).replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")+"=([^&#]*)"))&&2==a.length?a[1]:""},xa=function(){var a=""+M.location.hostname;return 0==a.indexOf("www.")?a.substring(4):a},de=function(a,b){var c=a.indexOf(b);if(5==c||6==c)if(a=a.charAt(c+b.length),"/"==a||"?"==a||
17
+ ""==a||":"==a)return!0;return!1},ya=function(a,b){var c=M.referrer;if(/^(https?|android-app):\/\//i.test(c)){if(a)return c;a="//"+M.location.hostname;if(!de(c,a))return b&&(b=a.replace(/\./g,"-")+".cdn.ampproject.org",de(c,b))?void 0:c}},za=function(a,b){if(1==b.length&&null!=b[0]&&"object"===typeof b[0])return b[0];for(var c={},d=Math.min(a.length+1,b.length),e=0;e<d;e++)if("object"===typeof b[e]){for(var g in b[e])b[e].hasOwnProperty(g)&&(c[g]=b[e][g]);break}else e<a.length&&(c[a[e]]=b[e]);return c};var ee=function(){this.keys=[];this.values={};this.m={}};ee.prototype.set=function(a,b,c){this.keys.push(a);c?this.m[":"+a]=b:this.values[":"+a]=b};ee.prototype.get=function(a){return this.m.hasOwnProperty(":"+a)?this.m[":"+a]:this.values[":"+a]};ee.prototype.map=function(a){for(var b=0;b<this.keys.length;b++){var c=this.keys[b],d=this.get(c);d&&a(c,d)}};var O=window,M=document,va=function(a,b){return setTimeout(a,b)};var F=window,Ea=document,G=function(a){var b=F._gaUserPrefs;if(b&&b.ioo&&b.ioo()||a&&!0===F["ga-disable-"+a])return!0;try{var c=F.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(g){}a=[];b=String(Ea.cookie||document.cookie).split(";");for(c=0;c<b.length;c++){var d=b[c].split("="),e=d[0].replace(/^\s*|\s*$/g,"");e&&"AMP_TOKEN"==e&&((d=d.slice(1).join("=").replace(/^\s*|\s*$/g,""))&&(d=decodeURIComponent(d)),a.push(d))}for(b=0;b<a.length;b++)if("$OPT_OUT"==a[b])return!0;return!1};var Ca=function(a){var b=[],c=M.cookie.split(";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push(e[1])}return b},zc=function(a,b,c,d,e,g){e=G(e)?!1:eb.test(M.location.hostname)||"/"==c&&vc.test(d)?!1:!0;if(!e)return!1;b&&1200<b.length&&(b=b.substring(0,1200));c=a+"="+b+"; path="+c+"; ";g&&(c+="expires="+(new Date((new Date).getTime()+g)).toGMTString()+"; ");d&&"none"!==d&&(c+="domain="+d+";");d=M.cookie;M.cookie=c;if(!(d=d!=M.cookie))a:{a=Ca(a);
18
+ for(d=0;d<a.length;d++)if(b==a[d]){d=!0;break a}d=!1}return d},Cc=function(a){return encodeURIComponent?encodeURIComponent(a).replace(/\(/g,"%28").replace(/\)/g,"%29"):a},vc=/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/,eb=/(^|\.)doubleclick\.net$/i;var oc,Id=/^.*Version\/?(\d+)[^\d].*$/i,ne=function(){if(void 0!==O.__ga4__)return O.__ga4__;if(void 0===oc){var a=O.navigator.userAgent;if(a){var b=a;try{b=decodeURIComponent(a)}catch(c){}if(a=!(0<=b.indexOf("Chrome"))&&!(0<=b.indexOf("CriOS"))&&(0<=b.indexOf("Safari/")||0<=b.indexOf("Safari,")))b=Id.exec(b),a=11<=(b?Number(b[1]):-1);oc=a}else oc=!1}return oc};var Fa,Ga,fb,Ab,ja=/^https?:\/\/[^/]*cdn\.ampproject\.org\//,Ue=/^(?:www\.|m\.|amp\.)+/,Ub=[],da=function(a){a:{if(ja.test(M.referrer)){var b=M.location.hostname.replace(Ue,"");b:{var c=M.referrer;c=c.replace(/^https?:\/\//,"");var d=c.replace(/^[^/]+/,"").split("/"),e=d[2];d=(d="s"==e?d[3]:e)?decodeURIComponent(d):d;if(!d){if(0==c.indexOf("xn--")){c="";break b}(c=c.match(/(.*)\.cdn\.ampproject\.org\/?$/))&&2==c.length&&(d=c[1].replace(/-/g,".").replace(/\.\./g,"-"))}c=d?d.replace(Ue,""):""}if(b==
19
+ c){b=!0;break a}else J(78)}b=!1}if(b&&!1!==a[Kd]&&(void 0===Ab&&(b=(b=De.get())&&b._ga||void 0)&&(Ab=b,J(81)),void 0!==Ab))return a[Q]||(a[Q]=Ab),!1;if(a[Kd]){J(67);if(a[ac]&&"cookie"!=a[ac])return!1;if(void 0!==Ab)a[Q]||(a[Q]=Ab);else{a:if(b=String(a[W]||xa()),c=String(a[Yb]||"/"),d=Ca(String(a[U]||"_ga")),b=na(d,b,c),!b||jd.test(b))b=!0;else if(b=Ca("AMP_TOKEN"),0==b.length)b=!0;else{if(1==b.length&&(b=decodeURIComponent(b[0]),"$RETRIEVING"==b||"$OPT_OUT"==b||"$ERROR"==b||"$NOT_FOUND"==b)){b=!0;
20
+ break a}b=!1}if(b&&tc(ic,String(a[Na])))return!0}}return!1},ic=function(){Z.D([ua])},tc=function(a,b){var c=Ca("AMP_TOKEN");if(1<c.length)return J(55),!1;c=decodeURIComponent(c[0]||"");if("$OPT_OUT"==c||"$ERROR"==c||G(b))return J(62),!1;if(!ja.test(M.referrer)&&"$NOT_FOUND"==c)return J(68),!1;if(void 0!==Ab)return J(56),va(function(){a(Ab)},0),!0;if(Fa)return Ub.push(a),!0;if("$RETRIEVING"==c)return J(57),va(function(){tc(a,b)},1E4),!0;Fa=!0;c&&"$"!=c[0]||(xc("$RETRIEVING",3E4),setTimeout(Mc,3E4),
21
+ c="");return Pc(c,b)?(Ub.push(a),!0):!1},Pc=function(a,b,c){if(!window.JSON)return J(58),!1;var d=O.XMLHttpRequest;if(!d)return J(59),!1;var e=new d;if(!("withCredentials"in e))return J(60),!1;e.open("POST",(c||"https://ampcid.google.com/v1/publisher:getClientId")+"?key=AIzaSyA65lEHUEizIsNtlbNo-l2K18dT680nsaM",!0);e.withCredentials=!0;e.setRequestHeader("Content-Type","text/plain");e.onload=function(){Fa=!1;if(4==e.readyState){try{200!=e.status&&(J(61),Qc("","$ERROR",3E4));var d=JSON.parse(e.responseText);
22
+ d.optOut?(J(63),Qc("","$OPT_OUT",31536E6)):d.clientId?Qc(d.clientId,d.securityToken,31536E6):!c&&d.alternateUrl?(Ga&&clearTimeout(Ga),Fa=!0,Pc(a,b,d.alternateUrl)):(J(64),Qc("","$NOT_FOUND",36E5))}catch(ca){J(65),Qc("","$ERROR",3E4)}e=null}};d={originScope:"AMP_ECID_GOOGLE"};a&&(d.securityToken=a);e.send(JSON.stringify(d));Ga=va(function(){J(66);Qc("","$ERROR",3E4)},1E4);return!0},Mc=function(){Fa=!1},xc=function(a,b){if(void 0===fb){fb="";for(var c=id(),d=0;d<c.length;d++){var e=c[d];if(zc("AMP_TOKEN",
23
+ encodeURIComponent(a),"/",e,"",b)){fb=e;return}}}zc("AMP_TOKEN",encodeURIComponent(a),"/",fb,"",b)},Qc=function(a,b,c){Ga&&clearTimeout(Ga);b&&xc(b,c);Ab=a;b=Ub;Ub=[];for(c=0;c<b.length;c++)b[c](a)};var oe=function(){return(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com"},Da=function(a){this.name="len";this.message=a+"-8192"},ba=function(a,b,c){c=c||ua;if(2036>=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b.length),new Da(b.length);},pe=function(a,b,c,d){d=d||ua;wd(a+"?"+b,"",d,c)},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c,d){var e=O.XMLHttpRequest;
24
+ if(!e)return!1;var g=new e;if(!("withCredentials"in g))return!1;a=a.replace(/^http:/,"https:");g.open("POST",a,!0);g.withCredentials=!0;g.setRequestHeader("Content-Type","text/plain");g.onreadystatechange=function(){if(4==g.readyState){if(d)try{var a=g.responseText;if(1>a.length)ge("xhr","ver","0"),c();else if("1"!=a.charAt(0))ge("xhr","ver",String(a.length)),c();else if(3<d.count++)ge("xhr","tmr",""+d.count),c();else if(1==a.length)c();else{var b=a.charAt(1);if("d"==b)pe("https://stats.g.doubleclick.net/j/collect",
25
+ d.U,d,c);else if("g"==b){var e="https://www.google.%/ads/ga-audiences".replace("%","com");wc(e,d.google,c);var w=a.substring(2);if(w)if(/^[a-z.]{1,6}$/.test(w)){var ha="https://www.google.%/ads/ga-audiences".replace("%",w);wc(ha,d.google,ua)}else ge("tld","bcc",w)}else ge("xhr","brc",b),c()}}catch(ue){ge("xhr","rsp"),c()}else c();g=null}};g.send(b);return!0},x=function(a,b,c){return O.navigator.sendBeacon?O.navigator.sendBeacon(a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=100*Math.random()||G("?")||
26
+ (a=["t=error","_e="+a,"_v=j72","sr=1"],b&&a.push("_f="+b),c&&a.push("_m="+K(c.substring(0,100))),a.push("aip=1"),a.push("z="+hd()),wc("https://www.google-analytics.com/u/d",a.join("&"),ua))};var h=function(a){var b=O.gaData=O.gaData||{};return b[a]=b[a]||{}};var Ha=function(){this.M=[]};Ha.prototype.add=function(a){this.M.push(a)};Ha.prototype.D=function(a){try{for(var b=0;b<this.M.length;b++){var c=a.get(this.M[b]);c&&ea(c)&&c.call(O,a)}}catch(d){}b=a.get(Ia);b!=ua&&ea(b)&&(a.set(Ia,ua,!0),setTimeout(b,10))};function Ja(a){if(100!=a.get(Ka)&&La(P(a,Q))%1E4>=100*R(a,Ka))throw"abort";}function Ma(a){if(G(P(a,Na)))throw"abort";}function Oa(){var a=M.location.protocol;if("http:"!=a&&"https:"!=a)throw"abort";}
27
+ function Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];Qa.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&("boolean"==typeof c&&(c*=1),b.push(d.F+"="+K(""+c))))});b.push("z="+Bd());a.set(Ra,b.join("&"),!0)}
28
+ function Sa(a){var b=P(a,gd)||oe()+"/collect",c=a.get(qe),d=P(a,fa);!d&&a.get(Vd)&&(d="beacon");if(c)pe(b,P(a,Ra),c,a.get(Ia));else if(d){c=d;d=P(a,Ra);var e=a.get(Ia);e=e||ua;"image"==c?wc(b,d,e):"xhr"==c&&wd(b,d,e)||"beacon"==c&&x(b,d,e)||ba(b,d,e)}else ba(b,P(a,Ra),a.get(Ia));b=a.get(Na);b=h(b);c=b.hitcount;b.hitcount=c?c+1:1;b=a.get(Na);delete h(b).pending_experiments;a.set(Ia,ua,!0)}
29
+ function Hc(a){(O.gaData=O.gaData||{}).expId&&a.set(Nc,(O.gaData=O.gaData||{}).expId);(O.gaData=O.gaData||{}).expVar&&a.set(Oc,(O.gaData=O.gaData||{}).expVar);var b=a.get(Na);if(b=h(b).pending_experiments){var c=[];for(d in b)b.hasOwnProperty(d)&&b[d]&&c.push(encodeURIComponent(d)+"."+encodeURIComponent(b[d]));var d=c.join("!")}else d=void 0;d&&a.set(m,d,!0)}function cd(){if(O.navigator&&"preview"==O.navigator.loadPurpose)throw"abort";}
30
+ function yd(a){var b=O.gaDevIds;ka(b)&&0!=b.length&&a.set("&did",b.join(","),!0)}function vb(a){if(!a.get(Na))throw"abort";};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){c=R(a,Wa);var d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0<e&&(c=Math.min(c+e,20),a.set(Xa,d));if(0>=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee},Qa=new ee,Za=[];Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?"":""+a},R=function(a,b){a=a.get(b);return void 0==a||""===a?0:1*a};Ya.prototype.set=function(a,b,c){if(a)if("object"==typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};
31
+ var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)},bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=Qa.get(a);if(!b)for(var c=0;c<Za.length;c++){var d=Za[c],e=d[0].exec(a);if(e){b=d[1](e);Qa.set(b.name,b);break}}return b},yc=function(a){var b;Qa.map(function(c,d){d.F==a&&(b=d)});return b&&b.name},S=function(a,b,c,d,e){a=new bb(a,b,c,d,e);Qa.set(a.name,a);return a.name},cb=function(a,
32
+ b){Za.push([new RegExp("^"+a+"$"),b])},T=function(a,b,c){return S(a,b,c,void 0,db)},db=function(){};var gb=qa(window.GoogleAnalyticsObject)&&sa(window.GoogleAnalyticsObject)||"ga",jd=/^(?:utma\.)?\d+\.\d+$/,kd=/^amp-[\w.-]{22,64}$/,Ba=!1,hb=T("apiVersion","v"),ib=T("clientVersion","_v");S("anonymizeIp","aip");var jb=S("adSenseId","a"),Va=S("hitType","t"),Ia=S("hitCallback"),Ra=S("hitPayload");S("nonInteraction","ni");S("currencyCode","cu");S("dataSource","ds");var Vd=S("useBeacon",void 0,!1),fa=S("transport");S("sessionControl","sc","");S("sessionGroup","sg");S("queueTime","qt");var Ac=S("_s","_s");
33
+ S("screenName","cd");var kb=S("location","dl",""),lb=S("referrer","dr"),mb=S("page","dp","");S("hostname","dh");var nb=S("language","ul"),ob=S("encoding","de");S("title","dt",function(){return M.title||void 0});cb("contentGroup([0-9]+)",function(a){return new bb(a[0],"cg"+a[1])});var pb=S("screenColors","sd"),qb=S("screenResolution","sr"),rb=S("viewportSize","vp"),sb=S("javaEnabled","je"),tb=S("flashVersion","fl");S("campaignId","ci");S("campaignName","cn");S("campaignSource","cs");
34
+ S("campaignMedium","cm");S("campaignKeyword","ck");S("campaignContent","cc");
35
+ var ub=S("eventCategory","ec"),xb=S("eventAction","ea"),yb=S("eventLabel","el"),zb=S("eventValue","ev"),Bb=S("socialNetwork","sn"),Cb=S("socialAction","sa"),Db=S("socialTarget","st"),Eb=S("l1","plt"),Fb=S("l2","pdt"),Gb=S("l3","dns"),Hb=S("l4","rrt"),Ib=S("l5","srt"),Jb=S("l6","tcp"),Kb=S("l7","dit"),Lb=S("l8","clt"),Ve=S("l9","_gst"),We=S("l10","_gbt"),Xe=S("l11","_cst"),Ye=S("l12","_cbt"),Mb=S("timingCategory","utc"),Nb=S("timingVar","utv"),Ob=S("timingLabel","utl"),Pb=S("timingValue","utt");
36
+ S("appName","an");S("appVersion","av","");S("appId","aid","");S("appInstallerId","aiid","");S("exDescription","exd");S("exFatal","exf");var Nc=S("expId","xid"),Oc=S("expVar","xvar"),m=S("exp","exp"),Rc=S("_utma","_utma"),Sc=S("_utmz","_utmz"),Tc=S("_utmht","_utmht"),Ua=S("_hc",void 0,0),Xa=S("_ti",void 0,0),Wa=S("_to",void 0,20);cb("dimension([0-9]+)",function(a){return new bb(a[0],"cd"+a[1])});cb("metric([0-9]+)",function(a){return new bb(a[0],"cm"+a[1])});S("linkerParam",void 0,void 0,Bc,db);
37
+ var Ze=T("_cd2l",void 0,!1),ld=S("usage","_u"),Gd=S("_um");S("forceSSL",void 0,void 0,function(){return Ba},function(a,b,c){J(34);Ba=!!c});var ed=S("_j1","jid"),ia=S("_j2","gjid");cb("\\&(.*)",function(a){var b=new bb(a[0],a[1]),c=yc(a[0].substring(1));c&&(b.Z=function(a){return a.get(c)},b.o=function(a,b,g,ca){a.set(c,g,ca)},b.F=void 0);return b});
38
+ var Qb=T("_oot"),dd=S("previewTask"),Rb=S("checkProtocolTask"),md=S("validationTask"),Sb=S("checkStorageTask"),Uc=S("historyImportTask"),Tb=S("samplerTask"),Vb=S("_rlt"),Wb=S("buildHitTask"),Xb=S("sendHitTask"),Vc=S("ceTask"),zd=S("devIdTask"),Cd=S("timingTask"),Ld=S("displayFeaturesTask"),oa=S("customTask"),V=T("name"),Q=T("clientId","cid"),n=T("clientIdTime"),xd=T("storedClientId"),Ad=S("userId","uid"),Na=T("trackingId","tid"),U=T("cookieName",void 0,"_ga"),W=T("cookieDomain"),Yb=T("cookiePath",
39
+ void 0,"/"),Zb=T("cookieExpires",void 0,63072E3),Hd=T("cookieUpdate",void 0,!0),$b=T("legacyCookieDomain"),Wc=T("legacyHistoryImport",void 0,!0),ac=T("storage",void 0,"cookie"),bc=T("allowLinker",void 0,!1),cc=T("allowAnchor",void 0,!0),Ka=T("sampleRate","sf",100),dc=T("siteSpeedSampleRate",void 0,1),ec=T("alwaysSendReferrer",void 0,!1),I=T("_gid","_gid"),la=T("_gcn"),Kd=T("useAmpClientId"),ce=T("_gclid"),fe=T("_gt"),he=T("_ge",void 0,7776E6),ie=T("_gclsrc"),je=T("storeGac",void 0,!0),gd=S("transportUrl"),
40
+ Md=S("_r","_r"),qe=S("_dp"),Ud=S("allowAdFeatures",void 0,!0);function X(a,b,c,d){b[a]=function(){try{return d&&J(d),c.apply(this,arguments)}catch(e){throw ge("exc",a,e&&e.name),e;}}};var Od=function(){this.V=100;this.$=this.fa=!1;this.oa="detourexp";this.groups=1},Ed=function(a){var b=new Od,c;if(b.fa&&b.$)return 0;b.$=!0;if(a){if(b.oa&&void 0!==a.get(b.oa))return R(a,b.oa);if(0==a.get(dc))return 0}if(0==b.V)return 0;void 0===c&&(c=Bd());return 0==c%b.V?Math.floor(c/b.V)%b.groups+1:0};function fc(){var a,b;if((b=(b=O.navigator)?b.plugins:null)&&b.length)for(var c=0;c<b.length&&!a;c++){var d=b[c];-1<d.name.indexOf("Shockwave Flash")&&(a=d.description)}if(!a)try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),a="WIN 6,0,21,0",e.AllowScriptAccess="always",a=e.GetVariable("$version")}catch(g){}if(!a)try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),a=e.GetVariable("$version")}catch(g){}a&&
41
+ (e=a.match(/[\d]+/g))&&3<=e.length&&(a=e[0]+"."+e[1]+" r"+e[2]);return a||void 0};var aa=function(a){var b=Math.min(R(a,dc),100);return La(P(a,Q))%100>=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0<c?(Y(b,Gb),Y(b,Jb),Y(b,Ib),Y(b,Fb),Y(b,Hb),Y(b,Kb),Y(b,Lb),Y(b,Ve),Y(b,We),Y(b,Xe),Y(b,Ye),va(function(){a(b)},10)):L(O,"load",function(){gc(a)},!1))}},Ec=function(a){var b=O.performance||O.webkitPerformance;b=b&&b.timing;if(!b)return!1;var c=b.navigationStart;if(0==c)return!1;a[Eb]=b.loadEventStart-c;a[Gb]=b.domainLookupEnd-b.domainLookupStart;
42
+ a[Jb]=b.connectEnd-b.connectStart;a[Ib]=b.responseStart-b.requestStart;a[Fb]=b.responseEnd-b.responseStart;a[Hb]=b.fetchStart-c;a[Kb]=b.domInteractive-c;a[Lb]=b.domContentLoadedEventStart-c;a[Ve]=N.L-c;a[We]=N.ya-c;O.google_tag_manager&&O.google_tag_manager._li&&(b=O.google_tag_manager._li,a[Xe]=b.cst,a[Ye]=b.cbt);return!0},Fc=function(a){if(O.top!=O)return!1;var b=O.external,c=b&&b.onloadT;b&&!b.isValidLoadTime&&(c=void 0);2147483648<c&&(c=void 0);0<c&&b.setPageReadyTime();if(void 0==c)return!1;
43
+ a[Eb]=c;return!0},Y=function(a,b){var c=a[b];if(isNaN(c)||Infinity==c||0>c)a[b]=void 0},Fd=function(a){return function(b){if("pageview"==b.get(Va)&&!a.I){a.I=!0;var c=aa(b),d=0<E(b.get(kb),"gclid").length;(c||d)&&gc(function(b){c&&a.send("timing",b);d&&a.send("adtiming",b)})}}};var hc=!1,mc=function(a){if("cookie"==P(a,ac)){if(a.get(Hd)||P(a,xd)!=P(a,Q)){var b=1E3*R(a,Zb);ma(a,Q,U,b)}ma(a,I,la,864E5);if(a.get(je)){var c=a.get(ce);if(c){var d=Math.min(R(a,he),1E3*R(a,Zb));d=Math.min(d,1E3*R(a,fe)+d-(new Date).getTime());a.data.set(he,d);b={};var e=a.get(fe),g=a.get(ie),ca=kc(P(a,Yb)),l=lc(P(a,W));a=P(a,Na);g&&"aw.ds"!=g?b&&(b.ua=!0):(c=["1",e,Cc(c)].join("."),0<d&&(b&&(b.ta=!0),zc("_gac_"+Cc(a),c,ca,l,a,d)));le(b)}}else J(75)}},ma=function(a,b,c,d){var e=nd(a,b);if(e){c=
44
+ P(a,c);var g=kc(P(a,Yb)),ca=lc(P(a,W)),l=P(a,Na);if("auto"!=ca)zc(c,e,g,ca,l,d)&&(hc=!0);else{J(32);for(var k=id(),w=0;w<k.length;w++)if(ca=k[w],a.data.set(W,ca),e=nd(a,b),zc(c,e,g,ca,l,d)){hc=!0;return}a.data.set(W,"auto")}}},nc=function(a){if("cookie"==P(a,ac)&&!hc&&(mc(a),!hc))throw"abort";},Yc=function(a){if(a.get(Wc)){var b=P(a,W),c=P(a,$b)||xa(),d=Xc("__utma",c,b);d&&(J(19),a.set(Tc,(new Date).getTime(),!0),a.set(Rc,d.R),(b=Xc("__utmz",c,b))&&d.hash==b.hash&&a.set(Sc,b.R))}},nd=function(a,b){b=
45
+ Cc(P(a,b));var c=lc(P(a,W)).split(".").length;a=jc(P(a,Yb));1<a&&(c+="-"+a);return b?["GA1",c,b].join("."):""},Xd=function(a,b){return na(b,P(a,W),P(a,Yb))},na=function(a,b,c){if(!a||1>a.length)J(12);else{for(var d=[],e=0;e<a.length;e++){var g=a[e];var ca=g.split(".");var l=ca.shift();("GA1"==l||"1"==l)&&1<ca.length?(g=ca.shift().split("-"),1==g.length&&(g[1]="1"),g[0]*=1,g[1]*=1,ca={H:g,s:ca.join(".")}):ca=kd.test(g)?{H:[0,0],s:g}:void 0;ca&&d.push(ca)}if(1==d.length)return J(13),d[0].s;if(0==d.length)J(12);
46
+ else{J(14);d=Gc(d,lc(b).split(".").length,0);if(1==d.length)return d[0].s;d=Gc(d,jc(c),1);1<d.length&&J(41);return d[0]&&d[0].s}}},Gc=function(a,b,c){for(var d=[],e=[],g,ca=0;ca<a.length;ca++){var l=a[ca];l.H[c]==b?d.push(l):void 0==g||l.H[c]<g?(e=[l],g=l.H[c]):l.H[c]==g&&e.push(l)}return 0<d.length?d:e},lc=function(a){return 0==a.indexOf(".")?a.substr(1):a},id=function(){var a=[],b=xa().split(".");if(4==b.length){var c=b[b.length-1];if(parseInt(c,10)==c)return["none"]}for(c=b.length-2;0<=c;c--)a.push(b.slice(c).join("."));
47
+ b=M.location.hostname;eb.test(b)||vc.test(b)||a.push("none");return a},kc=function(a){if(!a)return"/";1<a.length&&a.lastIndexOf("/")==a.length-1&&(a=a.substr(0,a.length-1));0!=a.indexOf("/")&&(a="/"+a);return a},jc=function(a){a=kc(a);return"/"==a?1:a.split("/").length},le=function(a){a.ta&&J(77);a.na&&J(74);a.pa&&J(73);a.ua&&J(69)};function Xc(a,b,c){"none"==b&&(b="");var d=[],e=Ca(a);a="__utma"==a?6:2;for(var g=0;g<e.length;g++){var ca=(""+e[g]).split(".");ca.length>=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){if(null==a)var c=a=1;else c=La(a),a=La(D(a,".")?a.substring(1):"."+a);for(var d=0;d<b.length;d++)if(b[d].hash==c||b[d].hash==a)return b[d]};var od=new RegExp(/^https?:\/\/([^\/:]+)/),De=O.google_tag_data.glBridge,pd=/(.*)([?&#])(?:_ga=[^&#]*)(?:&?)(.*)/,me=/(.*)([?&#])(?:_gac=[^&#]*)(?:&?)(.*)/;function Bc(a){if(a.get(Ze))return J(35),De.generate($e(a));var b=a.get(Q),c=a.get(I)||"";b="_ga=2."+K(pa(c+b,0)+"."+c+"-"+b);(a=af(a))?(J(44),a="&_gac=1."+K([pa(a.qa,0),a.timestamp,a.qa].join("."))):a="";return b+a}
48
+ function Ic(a,b){var c=new Date,d=O.navigator,e=d.plugins||[];a=[a,d.userAgent,c.getTimezoneOffset(),c.getYear(),c.getDate(),c.getHours(),c.getMinutes()+b];for(b=0;b<e.length;++b)a.push(e[b].description);return La(a.join("."))}function pa(a,b){var c=new Date,d=O.navigator,e=c.getHours()+Math.floor((c.getMinutes()+b)/60);return La([a,d.userAgent,d.language||"",c.getTimezoneOffset(),c.getYear(),c.getDate()+Math.floor(e/24),(24+e)%24,(60+c.getMinutes()+b)%60].join("."))}
49
+ var Dc=function(a){J(48);this.target=a;this.T=!1};Dc.prototype.ca=function(a,b){if(a){if(this.target.get(Ze))return De.decorate($e(this.target),a,b);if(a.tagName){if("a"==a.tagName.toLowerCase()){a.href&&(a.href=qd(this,a.href,b));return}if("form"==a.tagName.toLowerCase())return rd(this,a)}if("string"==typeof a)return qd(this,a,b)}};
50
+ var qd=function(a,b,c){var d=pd.exec(b);d&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));(d=me.exec(b))&&3<=d.length&&(b=d[1]+(d[3]?d[2]+d[3]:""));a=a.target.get("linkerParam");var e=b.indexOf("?");d=b.indexOf("#");c?b+=(-1==d?"#":"&")+a:(c=-1==e?"?":"&",b=-1==d?b+(c+a):b.substring(0,d)+c+a+b.substring(d));b=b.replace(/&+_ga=/,"&_ga=");return b=b.replace(/&+_gac=/,"&_gac=")},rd=function(a,b){if(b&&b.action)if("get"==b.method.toLowerCase()){a=a.target.get("linkerParam").split("&");for(var c=0;c<a.length;c++){var d=
51
+ a[c].split("="),e=d[1];d=d[0];for(var g=b.childNodes||[],ca=!1,l=0;l<g.length;l++)if(g[l].name==d){g[l].setAttribute("value",e);ca=!0;break}ca||(g=M.createElement("input"),g.setAttribute("type","hidden"),g.setAttribute("name",d),g.setAttribute("value",e),b.appendChild(g))}}else"post"==b.method.toLowerCase()&&(b.action=qd(a,b.action))};
52
+ Dc.prototype.S=function(a,b,c){function d(c){try{c=c||O.event;a:{var d=c.target||c.srcElement;for(c=100;d&&0<c;){if(d.href&&d.nodeName.match(/^a(?:rea)?$/i)){var g=d;break a}d=d.parentNode;c--}g={}}("http:"==g.protocol||"https:"==g.protocol)&&sd(a,g.hostname||"")&&g.href&&(g.href=qd(e,g.href,b))}catch(k){J(26)}}var e=this;this.target.get(Ze)?De.auto(function(){return $e(e.target)},a,b?"fragment":"",c):(this.T||(this.T=!0,L(M,"mousedown",d,!1),L(M,"keyup",d,!1)),c&&L(M,"submit",function(b){b=b||O.event;
53
+ if((b=b.target||b.srcElement)&&b.action){var c=b.action.match(od);c&&sd(a,c[1])&&rd(e,b)}}))};function sd(a,b){if(b==M.location.hostname)return!1;for(var c=0;c<a.length;c++)if(a[c]instanceof RegExp){if(a[c].test(b))return!0}else if(0<=b.indexOf(a[c]))return!0;return!1}function ke(a,b){return b!=Ic(a,0)&&b!=Ic(a,-1)&&b!=Ic(a,-2)&&b!=pa(a,0)&&b!=pa(a,-1)&&b!=pa(a,-2)}function $e(a){var b=af(a);return{_ga:a.get(Q),_gid:a.get(I)||void 0,_gac:b?[b.qa,b.timestamp].join("."):void 0}}
54
+ function af(a){function b(a){return void 0==a||""===a?0:Number(a)}var c=a.get(ce);if(c&&a.get(je)){var d=b(a.get(fe));if(1E3*d+b(a.get(he))<=(new Date).getTime())J(76);else return{timestamp:d,qa:c}}};var p=/^(GTM|OPT)-[A-Z0-9]+$/,q=/;_gaexp=[^;]*/g,r=/;((__utma=)|([^;=]+=GAX?\d+\.))[^;]*/g,Aa=/^https?:\/\/[\w\-.]+\.google.com(:\d+)?\/optimize\/opt-launch\.html\?.*$/,t=function(a){function b(a,b){b&&(c+="&"+a+"="+K(b))}var c="https://www.google-analytics.com/gtm/js?id="+K(a.id);"dataLayer"!=a.B&&b("l",a.B);b("t",a.target);b("cid",a.clientId);b("cidt",a.ka);b("gac",a.la);b("aip",a.ia);a.sync&&b("m","sync");b("cycle",a.G);a.qa&&b("gclid",a.qa);Aa.test(M.referrer)&&b("cb",String(hd()));return c};var Jd=function(a,b,c){this.aa=b;(b=c)||(b=(b=P(a,V))&&"t0"!=b?Wd.test(b)?"_gat_"+Cc(P(a,Na)):"_gat_"+Cc(b):"_gat");this.Y=b;this.ra=null},Rd=function(a,b){var c=b.get(Wb);b.set(Wb,function(b){Pd(a,b,ed);Pd(a,b,ia);var d=c(b);Qd(a,b);return d});var d=b.get(Xb);b.set(Xb,function(b){var c=d(b);if(se(b)){if(ne()!==H(a,b)){J(80);var e={U:re(a,b,1),google:re(a,b,2),count:0};pe("https://stats.g.doubleclick.net/j/collect",e.U,e)}else ta(re(a,b,0));b.set(ed,"",!0)}return c})},Pd=function(a,b,c){!1===b.get(Ud)||
55
+ b.get(c)||("1"==Ca(a.Y)[0]?b.set(c,"",!0):b.set(c,""+hd(),!0))},Qd=function(a,b){se(b)&&zc(a.Y,"1",b.get(Yb),b.get(W),b.get(Na),6E4)},se=function(a){return!!a.get(ed)&&a.get(Ud)},re=function(a,b,c){var d=new ee,e=function(a){$a(a).F&&d.set($a(a).F,b.get(a))};e(hb);e(ib);e(Na);e(Q);e(ed);if(0==c||1==c)e(Ad),e(ia),e(I);d.set($a(ld).F,Td(b));var g="";d.map(function(a,b){g+=K(a)+"=";g+=K(""+b)+"&"});g+="z="+hd();0==c?g=a.aa+g:1==c?g="t=dc&aip=1&_r=3&"+g:2==c&&(g="t=sr&aip=1&_r=4&slf_rd=1&"+g);return g},
56
+ H=function(a,b){null===a.ra&&(a.ra=1===Ed(b),a.ra&&J(33));return a.ra},Wd=/^gtm\d+$/;var fd=function(a,b){a=a.b;if(!a.get("dcLoaded")){var c=new $c(Dd(a));c.set(29);a.set(Gd,c.w);b=b||{};var d;b[U]&&(d=Cc(b[U]));b=new Jd(a,"https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&",d);Rd(b,a);a.set("dcLoaded",!0)}};var Sd=function(a){if(!a.get("dcLoaded")&&"cookie"==a.get(ac)){var b=new Jd(a);Pd(b,a,ed);Pd(b,a,ia);Qd(b,a);if(se(a)){var c=ne()!==H(b,a);a.set(Md,1,!0);c?(J(79),a.set(gd,oe()+"/j/collect",!0),a.set(qe,{U:re(b,a,1),google:re(b,a,2),count:0},!0)):a.set(gd,oe()+"/r/collect",!0)}}};var Lc=function(){var a=O.gaGlobal=O.gaGlobal||{};return a.hid=a.hid||hd()};var ad,bd=function(a,b,c){if(!ad){var d=M.location.hash;var e=O.name,g=/^#?gaso=([^&]*)/;if(e=(d=(d=d&&d.match(g)||e&&e.match(g))?d[1]:Ca("GASO")[0]||"")&&d.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))zc("GASO",""+d,c,b,a,0),window._udo||(window._udo=b),window._utcp||(window._utcp=c),a=e[1],wa("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(a?"prefix="+a+"&":"")+hd(),"_gasojs");ad=!0}};var wb=/^(UA|YT|MO|GP)-(\d+)-(\d+)$/,pc=function(a){function b(a,b){d.b.data.set(a,b)}function c(a,c){b(a,c);d.filters.add(a)}var d=this;this.b=new Ya;this.filters=new Ha;b(V,a[V]);b(Na,sa(a[Na]));b(U,a[U]);b(W,a[W]||xa());b(Yb,a[Yb]);b(Zb,a[Zb]);b(Hd,a[Hd]);b($b,a[$b]);b(Wc,a[Wc]);b(bc,a[bc]);b(cc,a[cc]);b(Ka,a[Ka]);b(dc,a[dc]);b(ec,a[ec]);b(ac,a[ac]);b(Ad,a[Ad]);b(n,a[n]);b(Kd,a[Kd]);b(je,a[je]);b(Ze,a[Ze]);b(hb,1);b(ib,"j72");c(Qb,Ma);c(oa,ua);c(dd,cd);c(Rb,Oa);c(md,vb);c(Sb,nc);c(Uc,Yc);c(Tb,
57
+ Ja);c(Vb,Ta);c(Vc,Hc);c(zd,yd);c(Ld,Sd);c(Wb,Pa);c(Xb,Sa);c(Cd,Fd(this));Kc(this.b);Jc(this.b,a[Q]);this.b.set(jb,Lc());bd(this.b.get(Na),this.b.get(W),this.b.get(Yb))},Jc=function(a,b){var c=P(a,U);a.data.set(la,"_ga"==c?"_gid":c+"_gid");if("cookie"==P(a,ac)){hc=!1;c=Ca(P(a,U));c=Xd(a,c);if(!c){c=P(a,W);var d=P(a,$b)||xa();c=Xc("__utma",d,c);void 0!=c?(J(10),c=c.O[1]+"."+c.O[2]):c=void 0}c&&(hc=!0);if(d=c&&!a.get(Hd))if(d=c.split("."),2!=d.length)d=!1;else if(d=Number(d[1])){var e=R(a,Zb);d=d+e<
58
+ (new Date).getTime()/1E3}else d=!1;d&&(c=void 0);c&&(a.data.set(xd,c),a.data.set(Q,c),c=Ca(P(a,la)),(c=Xd(a,c))&&a.data.set(I,c));if(a.get(je)&&(c=a.get(ce),d=a.get(ie),!c||d&&"aw.ds"!=d)){c={};if(M){d=[];e=M.cookie.split(";");for(var g=/^\s*_gac_(UA-\d+-\d+)=\s*(.+?)\s*$/,ca=0;ca<e.length;ca++){var l=e[ca].match(g);l&&d.push({ja:l[1],value:l[2]})}e={};if(d&&d.length)for(g=0;g<d.length;g++)(ca=d[g].value.split("."),"1"!=ca[0]||3!=ca.length)?c&&(c.na=!0):ca[1]&&(e[d[g].ja]?c&&(c.pa=!0):e[d[g].ja]=
59
+ [],e[d[g].ja].push({timestamp:ca[1],qa:ca[2]}));d=e}else d={};d=d[P(a,Na)];le(c);d&&0!=d.length&&(c=d[0],a.data.set(fe,c.timestamp),a.data.set(ce,c.qa))}}if(a.get(Hd)&&(c=be("_ga",a.get(cc)),d=be("_gl",a.get(cc)),e=De.get(a.get(cc)),g=e._ga,d&&0<d.indexOf("_ga")&&!g&&J(30),c||g))if(c&&g&&J(36),a.get(bc)){if(g&&(J(38),a.data.set(Q,g),e._gid&&(J(51),a.data.set(I,e._gid)),e._gac&&(d=e._gac.split("."))&&2==d.length&&(J(37),a.data.set(ce,d[0]),a.data.set(fe,d[1]))),c)b:if(d=c.indexOf("."),-1==d)J(22);
60
+ else{e=c.substring(0,d);g=c.substring(d+1);d=g.indexOf(".");c=g.substring(0,d);g=g.substring(d+1);if("1"==e){if(d=g,ke(d,c)){J(23);break b}}else if("2"==e){d=g.indexOf("-");e="";0<d?(e=g.substring(0,d),d=g.substring(d+1)):d=g.substring(1);if(ke(e+d,c)){J(53);break b}e&&(J(2),a.data.set(I,e))}else{J(22);break b}J(11);a.data.set(Q,d);if(c=be("_gac",a.get(cc)))c=c.split("."),"1"!=c[0]||4!=c.length?J(72):ke(c[3],c[1])?J(71):(a.data.set(ce,c[3]),a.data.set(fe,c[2]),J(70))}}else J(21);b&&(J(9),a.data.set(Q,
61
+ K(b)));a.get(Q)||((b=(b=O.gaGlobal&&O.gaGlobal.vid)&&-1!=b.search(jd)?b:void 0)?(J(17),a.data.set(Q,b)):(J(8),a.data.set(Q,ra())));a.get(I)||(J(3),a.data.set(I,ra()));mc(a)},Kc=function(a){var b=O.navigator,c=O.screen,d=M.location;a.set(lb,ya(a.get(ec),a.get(Kd)));if(d){var e=d.pathname||"";"/"!=e.charAt(0)&&(J(31),e="/"+e);a.set(kb,d.protocol+"//"+d.hostname+e+d.search)}c&&a.set(qb,c.width+"x"+c.height);c&&a.set(pb,c.colorDepth+"-bit");c=M.documentElement;var g=(e=M.body)&&e.clientWidth&&e.clientHeight,
62
+ ca=[];c&&c.clientWidth&&c.clientHeight&&("CSS1Compat"===M.compatMode||!g)?ca=[c.clientWidth,c.clientHeight]:g&&(ca=[e.clientWidth,e.clientHeight]);c=0>=ca[0]||0>=ca[1]?"":ca.join("x");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"").toLowerCase());a.data.set(ce,be("gclid",!0));a.data.set(ie,be("gclsrc",!0));a.data.set(fe,Math.round((new Date).getTime()/1E3));if(d&&a.get(cc)&&
63
+ (b=M.location.hash)){b=b.split(/[?&#]+/);d=[];for(c=0;c<b.length;++c)(D(b[c],"utm_id")||D(b[c],"utm_campaign")||D(b[c],"utm_source")||D(b[c],"utm_medium")||D(b[c],"utm_term")||D(b[c],"utm_content")||D(b[c],"gclid")||D(b[c],"dclid")||D(b[c],"gclsrc"))&&d.push(b[c]);0<d.length&&(b="#"+d.join("&"),a.set(kb,a.get(kb)+b))}};pc.prototype.get=function(a){return this.b.get(a)};pc.prototype.set=function(a,b){this.b.set(a,b)};var qc={pageview:[mb],event:[ub,xb,yb,zb],social:[Bb,Cb,Db],timing:[Mb,Nb,Pb,Ob]};
64
+ pc.prototype.send=function(a){if(!(1>arguments.length)){if("string"===typeof arguments[0]){var b=arguments[0];var c=[].slice.call(arguments,1)}else b=arguments[0]&&arguments[0][Va],c=arguments;b&&(c=za(qc[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b.data.m={})}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=c,e=M;e.removeEventListener?e.removeEventListener("visibilitychange",d,!1):e.detachEvent&&e.detachEvent("onvisibilitychange",d)}};L(M,"visibilitychange",c)}};var td=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=td.exec(a[0]);null!=b&&4==b.length&&(this.c=b[1]||"t0",this.K=b[2]||"",this.C=b[3],this.a=[].slice.call(a,1),this.K||(this.A="create"==this.C,this.i="require"==this.C,this.g="provide"==this.C,this.ba="remove"==this.C),this.i&&(3<=this.a.length?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";
65
+ if(this.g&&(!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.c)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.c)throw"abort";}};function ud(a){return 0<=a.indexOf(".")||0<=a.indexOf(":")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};
66
+ var u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);if(p.test(b)){J(52);a=N.j(a);if(!a)return!0;c=d||{};d={id:b,B:c.dataLayer||"dataLayer",ia:!!a.get("anonymizeIp"),sync:e,G:!1};a.get("&gtm")==b&&(d.G=!0);var g=String(a.get("name"));"t0"!=g&&(d.target=g);G(String(a.get("trackingId")))||(d.clientId=
67
+ String(a.get(Q)),d.ka=Number(a.get(n)),c=c.palindrome?r:q,c=(c=M.cookie.replace(/^|(; +)/g,";").match(c))?c.sort().join("").substring(1):void 0,d.la=c,d.qa=E(a.b.get(kb)||"","gclid"));a=d.B;c=(new Date).getTime();O[a]=O[a]||[];c={"gtm.start":c};e||(c.event="gtm.js");O[a].push(c);c=t(d)}!c&&Zd.hasOwnProperty(b)?(J(39),c=b+".js"):J(43);c&&(c&&0<=c.indexOf("/")||(c=(Ba||"https:"==M.location.protocol?"https:":"http:")+"//www.google-analytics.com/plugins/ua/"+c),d=ae(c),a=d.protocol,c=M.location.protocol,
68
+ ("https:"==a||a==c||("http:"!=a?0:"http:"==c))&&B(d)&&(wa(d.url,void 0,e),$d.set(b,!0)))}},v=function(a,b){var c=A.get(a)||[];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;c<b.length;c++)b[c]();A.set(a,[])},B=function(a){var b=ae(M.location.href);if(D(a.url,"https://www.google-analytics.com/gtm/js?id="))return!0;if(a.query||0<=a.url.indexOf("?")||0<=a.path.indexOf("://"))return!1;if(a.host==b.host&&a.port==b.port)return!0;b="http:"==a.protocol?80:443;return"www.google-analytics.com"==
69
+ a.host&&(a.port||b)==b&&D(a.path,"/plugins/")?!0:!1},ae=function(a){function b(a){var b=a.hostname||"",c=0<=b.indexOf("]");b=b.split(c?"]":":")[0].toLowerCase();c&&(b+="]");c=(a.protocol||"").toLowerCase();c=1*a.port||("http:"==c?80:"https:"==c?443:"");a=a.pathname||"";D(a,"/")||(a="/"+a);return[b,""+c,a]}var c=M.createElement("a");c.href=M.location.href;var d=(c.protocol||"").toLowerCase(),e=b(c),g=c.search||"",ca=d+"//"+e[0]+(e[1]?":"+e[1]:"");D(a,"//")?a=d+a:D(a,"/")?a=ca+a:!a||D(a,"?")?a=ca+e[2]+
70
+ (a||g):0>a.split("/")[0].indexOf(":")&&(a=ca+e[2].substring(0,e[2].lastIndexOf("/"))+"/"+a);c.href=a;d=b(c);return{protocol:(c.protocol||"").toLowerCase(),host:d[0],port:d[1],path:d[2],query:c.search||"",url:a||""}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments);b=Z.f.concat(b);for(Z.f=[];0<b.length&&!Z.v(b[0])&&!(b.shift(),0<Z.f.length););Z.f=Z.f.concat(b)};Z.J=function(a){for(var b=[],c=0;c<arguments.length;c++)try{var d=new sc(arguments[c]);d.g?C(d.a[0],d.a[1]):(d.i&&(d.ha=y(d.c,d.a[0],d.X,d.W)),b.push(d))}catch(e){}return b};
71
+ Z.v=function(a){try{if(a.u)a.u.call(O,N.j("t0"));else{var b=a.c==gb?N:N.j(a.c);if(a.A){if("t0"==a.c&&(b=N.create.apply(N,a.a),null===b))return!0}else if(a.ba)N.remove(a.c);else if(b)if(a.i){if(a.ha&&(a.ha=y(a.c,a.a[0],a.X,a.W)),!u(a.a[0],b,a.W))return!0}else if(a.K){var c=a.C,d=a.a,e=b.plugins_.get(a.K);e[c].apply(e,d)}else b[a.C].apply(b,a.a)}}catch(g){}};var N=function(a){J(1);Z.D.apply(Z,[arguments])};N.h={};N.P=[];N.L=0;N.ya=0;N.answer=42;var uc=[Na,W,V];N.create=function(a){var b=za(uc,[].slice.call(arguments));b[V]||(b[V]="t0");var c=""+b[V];if(N.h[c])return N.h[c];if(da(b))return null;b=new pc(b);N.h[c]=b;N.P.push(b);return b};N.remove=function(a){for(var b=0;b<N.P.length;b++)if(N.P[b].get(V)==a){N.P.splice(b,1);N.h[a]=null;break}};N.j=function(a){return N.h[a]};N.getAll=function(){return N.P.slice(0)};
72
+ N.N=function(){"ga"!=gb&&J(49);var a=O[gb];if(!a||42!=a.answer){N.L=a&&a.l;N.ya=1*new Date;N.loaded=!0;var b=O[gb]=N;X("create",b,b.create);X("remove",b,b.remove);X("getByName",b,b.j,5);X("getAll",b,b.getAll,6);b=pc.prototype;X("get",b,b.get,7);X("set",b,b.set,4);X("send",b,b.send);X("requireSync",b,b.ma);b=Ya.prototype;X("get",b,b.get);X("set",b,b.set);if("https:"!=M.location.protocol&&!Ba){a:{b=M.getElementsByTagName("script");for(var c=0;c<b.length&&100>c;c++){var d=b[c].src;if(d&&0==d.indexOf("https://www.google-analytics.com/analytics")){b=
73
+ !0;break a}}b=!1}b&&(Ba=!0)}(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);C("displayfeatures",fd);C("adfeatures",fd);a=a&&a.q;ka(a)?Z.D.apply(N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b<a.length;b++)a[b].get(V)};var Nd=N.N,te=O[gb];te&&te.r?Nd():z(Nd);z(function(){Z.D(["provide","render",ua])});})(window);
inc/js/instant.page.js ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! instant.page v1.2.2 - (C) 2019 Alexandre Dieulot - https://instant.page/license */
2
+
3
+ let urlToPreload
4
+ let mouseoverTimer
5
+ let lastTouchTimestamp
6
+
7
+ const prefetcher = document.createElement('link')
8
+ const isSupported = prefetcher.relList && prefetcher.relList.supports && prefetcher.relList.supports('prefetch')
9
+ const isDataSaverEnabled = navigator.connection && navigator.connection.saveData
10
+ const allowQueryString = 'instantAllowQueryString' in document.body.dataset
11
+ const allowExternalLinks = 'instantAllowExternalLinks' in document.body.dataset
12
+
13
+ if (isSupported && !isDataSaverEnabled) {
14
+ prefetcher.rel = 'prefetch'
15
+ document.head.appendChild(prefetcher)
16
+
17
+ const eventListenersOptions = {
18
+ capture: true,
19
+ passive: true,
20
+ }
21
+ document.addEventListener('touchstart', touchstartListener, eventListenersOptions)
22
+ document.addEventListener('mouseover', mouseoverListener, eventListenersOptions)
23
+ }
24
+
25
+ function touchstartListener(event) {
26
+ /* Chrome on Android calls mouseover before touchcancel so `lastTouchTimestamp`
27
+ * must be assigned on touchstart to be measured on mouseover. */
28
+ lastTouchTimestamp = performance.now()
29
+
30
+ const linkElement = event.target.closest('a')
31
+
32
+ if (!isPreloadable(linkElement)) {
33
+ return
34
+ }
35
+
36
+ linkElement.addEventListener('touchcancel', touchendAndTouchcancelListener, {passive: true})
37
+ linkElement.addEventListener('touchend', touchendAndTouchcancelListener, {passive: true})
38
+
39
+ urlToPreload = linkElement.href
40
+ preload(linkElement.href)
41
+ }
42
+
43
+ function touchendAndTouchcancelListener() {
44
+ urlToPreload = undefined
45
+ stopPreloading()
46
+ }
47
+
48
+ function mouseoverListener(event) {
49
+ if (performance.now() - lastTouchTimestamp < 1100) {
50
+ return
51
+ }
52
+
53
+ const linkElement = event.target.closest('a')
54
+
55
+ if (!isPreloadable(linkElement)) {
56
+ return
57
+ }
58
+
59
+ linkElement.addEventListener('mouseout', mouseoutListener, {passive: true})
60
+
61
+ urlToPreload = linkElement.href
62
+
63
+ mouseoverTimer = setTimeout(() => {
64
+ preload(linkElement.href)
65
+ mouseoverTimer = undefined
66
+ }, 65)
67
+ }
68
+
69
+ function mouseoutListener(event) {
70
+ if (event.relatedTarget && event.target.closest('a') == event.relatedTarget.closest('a')) {
71
+ return
72
+ }
73
+
74
+ if (mouseoverTimer) {
75
+ clearTimeout(mouseoverTimer)
76
+ mouseoverTimer = undefined
77
+ }
78
+ else {
79
+ urlToPreload = undefined
80
+ stopPreloading()
81
+ }
82
+ }
83
+
84
+ function isPreloadable(linkElement) {
85
+ if (!linkElement || !linkElement.href) {
86
+ return
87
+ }
88
+
89
+ if (urlToPreload == linkElement.href) {
90
+ return
91
+ }
92
+
93
+ const preloadLocation = new URL(linkElement.href)
94
+
95
+ if (!allowExternalLinks && preloadLocation.origin != location.origin && !('instant' in linkElement.dataset)) {
96
+ return
97
+ }
98
+
99
+ if (!['http:', 'https:'].includes(preloadLocation.protocol)) {
100
+ return
101
+ }
102
+
103
+ if (preloadLocation.protocol == 'http:' && location.protocol == 'https:') {
104
+ return
105
+ }
106
+
107
+ if (!allowQueryString && preloadLocation.search && !('instant' in linkElement.dataset)) {
108
+ return
109
+ }
110
+
111
+ if (preloadLocation.hash && preloadLocation.pathname + preloadLocation.search == location.pathname + location.search) {
112
+ return
113
+ }
114
+
115
+ if ('noInstant' in linkElement.dataset) {
116
+ return
117
+ }
118
+
119
+ return true
120
+ }
121
+
122
+ function preload(url) {
123
+ prefetcher.href = url
124
+ }
125
+
126
+ function stopPreloading() {
127
+ prefetcher.removeAttribute('href')
128
+ }
inc/js/jquery.unveil.js DELETED
@@ -1,72 +0,0 @@
1
- /**
2
- * jQuery Unveil
3
- * A very lightweight jQuery plugin to lazy load images
4
- * http://luis-almeida.github.com/unveil
5
- *
6
- * Modified by Sergej Müller
7
- * http://wpcoder.de
8
- *
9
- * Licensed under the MIT license.
10
- */
11
-
12
- ;(function($) {
13
- $.fn.unveil = function() {
14
-
15
- var $w = $(window),
16
- images = this,
17
- loaded,
18
- inview,
19
- source;
20
-
21
- this.one(
22
- 'unveil',
23
- function() {
24
- var $$ = $(this),
25
- source = $$.data('src') || $$.attr('data-src');
26
-
27
- if ( source) {
28
- $$
29
- .css('opacity', 0)
30
- .attr('src', source)
31
- .animate(
32
- {
33
- 'opacity': 1
34
- },
35
- 200
36
- );
37
- }
38
- }
39
- );
40
-
41
- function unveil() {
42
- inview = images.filter(
43
- function() {
44
- var $e = $(this),
45
- wt = $w.scrollTop(),
46
- wb = wt + $w.height(),
47
- et = $e.offset().top,
48
- eb = et + $e.height();
49
-
50
- return eb >= wt && et <= wb;
51
- }
52
- );
53
-
54
- loaded = inview.trigger('unveil');
55
- images = images.not(loaded);
56
- }
57
-
58
- $w.scroll(unveil);
59
- $w.resize(unveil);
60
-
61
- unveil();
62
-
63
- return this;
64
- };
65
- })(window.jQuery);
66
-
67
-
68
- jQuery(document).ready(
69
- function(){
70
- jQuery("img.crazy_lazy").css('display', '').unveil();
71
- }
72
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/jquery.unveil.min.js DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * jQuery Unveil
3
- * A very lightweight jQuery plugin to lazy load images
4
- * http://luis-almeida.github.com/unveil
5
- *
6
- * Modified by Sergej Müller
7
- * http://wpcoder.de
8
- *
9
- * Licensed under the MIT license.
10
- */
11
-
12
- (function(c){c.fn.unveil=function(){function b(){e=a.filter(function(){var f=c(this),g=d.scrollTop(),b=g+d.height(),a=f.offset().top;return a+f.height()>=g&&a<=b});h=e.trigger("unveil");a=a.not(h)}var d=c(window),a=this,h,e;this.one("unveil",function(){var a=c(this),b=a.data("src")||a.attr("data-src");b&&a.css("opacity",0).attr("src",b).animate({opacity:1},200)});d.scroll(b);d.resize(b);b();return this}})(window.jQuery);jQuery(document).ready(function(){jQuery("img.crazy_lazy").css("display","").unveil()});
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/lazyload.js DELETED
@@ -1,91 +0,0 @@
1
- /* lazyload.js (c) Lorenzo Giuliani
2
- * MIT License (http://www.opensource.org/licenses/mit-license.html)
3
- *
4
- * Modified by Sergej Müller | http://wpcoder.de
5
- */
6
-
7
-
8
- window.onload = function() {
9
- var $q = function(q, res){
10
- if (document.querySelectorAll) {
11
- res = document.querySelectorAll(q);
12
- } else {
13
- var d=document,
14
- a=d.styleSheets[0] || d.createStyleSheet();
15
-
16
- a.addRule(q,'f:b');
17
- for(var l=d.all,b=0,c=[],f=l.length;b<f;b++)
18
- l[b].currentStyle.f && c.push(l[b]);
19
-
20
- a.removeRule(0);
21
- res = c;
22
- }
23
-
24
- return res;
25
- },
26
-
27
- addEventListener = function(evt, fn) {
28
- window.addEventListener
29
- ? this.addEventListener(evt, fn, false)
30
- : (window.attachEvent)
31
- ? this.attachEvent('on' + evt, fn)
32
- : this['on' + evt] = fn;
33
- },
34
-
35
- _has = function(obj, key) {
36
- return Object.prototype.hasOwnProperty.call(obj, key);
37
- };
38
-
39
- function loadImage (el, fn) {
40
- var img = new Image(),
41
- src = el.getAttribute('data-src');
42
-
43
- img.onload = function() {
44
- if ( !! el.parent )
45
- el.parent.replaceChild(img, el)
46
- else
47
- el.src = src;
48
-
49
- if ( fn ) fn();
50
- }
51
-
52
- img.src = src;
53
- }
54
-
55
- function elementInViewport(el) {
56
- var rect = el.getBoundingClientRect();
57
-
58
- return (
59
- rect.top >= 0
60
- && rect.left >= 0
61
- && rect.top <= (window.innerHeight || document.documentElement.clientHeight)
62
- );
63
- }
64
-
65
- var images = new Array(),
66
- query = $q('img.crazy_lazy'),
67
- processScroll = function() {
68
- for (var i = 0; i < images.length; i++) {
69
- if (elementInViewport(images[i])) {
70
- loadImage(
71
- images[i],
72
- function () {
73
- images.splice(i, i);
74
- }
75
- );
76
- }
77
- }
78
- };
79
-
80
- for (var i = 0; i < query.length; i++) {
81
- query[i].removeAttribute('style');
82
- images.push(query[i]);
83
- };
84
-
85
- processScroll();
86
-
87
- addEventListener(
88
- 'scroll',
89
- processScroll
90
- );
91
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/lazyload.min.js DELETED
@@ -1,8 +0,0 @@
1
- /* lazyload.js (c) Lorenzo Giuliani
2
- * MIT License (http://www.opensource.org/licenses/mit-license.html)
3
- *
4
- * Modified by Sergej Müller | http://wpcoder.de
5
- */
6
-
7
- window.onload=function(){function h(a,e){var c=new Image,b=a.getAttribute("data-src");c.onload=function(){a.parent?a.parent.replaceChild(c,a):a.src=b;e&&e()};c.src=b}function k(a){a=a.getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.top<=(window.innerHeight||document.documentElement.clientHeight)}for(var b=[],f=function(a,e){if(document.querySelectorAll)e=document.querySelectorAll(a);else{var c=document,b=c.styleSheets[0]||c.createStyleSheet();b.addRule(a,"f:b");for(var c=c.all,d=0,f=[],g=c.length;d<
8
- g;d++)c[d].currentStyle.f&&f.push(c[d]);b.removeRule(0);e=f}return e}("img.crazy_lazy"),g=function(){for(var a=0;a<b.length;a++)k(b[a])&&h(b[a],function(){b.splice(a,a)})},d=0;d<f.length;d++)f[d].removeAttribute("style"),b.push(f[d]);g();(function(a,b){window.addEventListener?this.addEventListener(a,b,!1):window.attachEvent?this.attachEvent("on"+a,b):this["on"+a]=b})("scroll",g)};
 
 
 
 
 
 
 
 
inc/js/plugin-install.js CHANGED
@@ -1,55 +1,55 @@
1
- (function( wp, $ ) {
2
- 'use strict';
3
-
4
- if ( ! wp ) {
5
- return;
6
- }
7
-
8
- function activatePlugin( url, el ) {
9
- var message = el.data( 'message' );
10
-
11
- $.ajax( {
12
- async: true,
13
- type: 'GET',
14
- dataType: 'html',
15
- url: url,
16
- success: function() {
17
- el.removeClass( 'sbp-updating' );
18
- el.text( message );
19
- }
20
- } );
21
- }
22
-
23
- $( function() {
24
- $( document ).on( 'click', '.sbp-plugin-button', function( event ) {
25
- var action = $( this ).data( 'action' ),
26
- url = $( this ).attr( 'href' ),
27
- slug = $( this ).data( 'slug' );
28
-
29
- event.preventDefault();
30
-
31
- if ( 'install' === action ) {
32
-
33
- $( this ).addClass( 'sbp-updating disbpled' );
34
-
35
- wp.updates.installPlugin( {
36
- slug: slug
37
- } );
38
-
39
- } else if ( 'activate' === action ) {
40
-
41
- $( this ).addClass( 'sbp-updating disbpled' );
42
- activatePlugin( url, $( this ) );
43
-
44
- }
45
-
46
- } );
47
-
48
- $( document ).on( 'wp-plugin-install-success', function( response, data ) {
49
- var el = $( '.sbp-plugin-button[data-slug="' + data.slug + '"]' );
50
- event.preventDefault();
51
- activatePlugin( data.activateUrl, el );
52
- } );
53
-
54
- } );
55
- })( window.wp, jQuery );
1
+ (function( wp, $ ) {
2
+ 'use strict';
3
+
4
+ if ( ! wp ) {
5
+ return;
6
+ }
7
+
8
+ function activatePlugin( url, el ) {
9
+ var message = el.data( 'message' );
10
+
11
+ $.ajax( {
12
+ async: true,
13
+ type: 'GET',
14
+ dataType: 'html',
15
+ url: url,
16
+ success: function() {
17
+ el.removeClass( 'sbp-updating' );
18
+ el.text( message );
19
+ }
20
+ } );
21
+ }
22
+
23
+ $( function() {
24
+ $( document ).on( 'click', '.sbp-plugin-button', function( event ) {
25
+ var action = $( this ).data( 'action' ),
26
+ url = $( this ).attr( 'href' ),
27
+ slug = $( this ).data( 'slug' );
28
+
29
+ event.preventDefault();
30
+
31
+ if ( 'install' === action ) {
32
+
33
+ $( this ).addClass( 'sbp-updating disbpled' );
34
+
35
+ wp.updates.installPlugin( {
36
+ slug: slug
37
+ } );
38
+
39
+ } else if ( 'activate' === action ) {
40
+
41
+ $( this ).addClass( 'sbp-updating disbpled' );
42
+ activatePlugin( url, $( this ) );
43
+
44
+ }
45
+
46
+ } );
47
+
48
+ $( document ).on( 'wp-plugin-install-success', function( response, data ) {
49
+ var el = $( '.sbp-plugin-button[data-slug="' + data.slug + '"]' );
50
+ event.preventDefault();
51
+ activatePlugin( data.activateUrl, el );
52
+ } );
53
+
54
+ } );
55
+ })( window.wp, jQuery );
inc/sbp-minifier.php CHANGED
@@ -1,121 +1,121 @@
1
- <?php
2
-
3
- /*--------------------------------------------------------------------------------------------------------
4
- MINIFIER - increase your page load speed by minifying JavaScript and HTML
5
- ---------------------------------------------------------------------------------------------------------*/
6
-
7
-
8
- class SBP_HTML_Minifier {
9
- // Minify settings
10
- protected $minify_css = true;
11
- protected $minify_js = false;
12
- protected $info_comment = true;
13
- protected $remove_comments = true;
14
-
15
- // Minify variables
16
- protected $html;
17
- public function __construct($html) {
18
- if (!empty($html)) {
19
- $this->parseHTML($html);
20
- }
21
- }
22
-
23
- public function __toString() {
24
- return $this->html;
25
- }
26
-
27
- protected function bottomComment($raw, $minified) {
28
- $raw = strlen($raw);
29
- $minified = strlen($minified);
30
- $savings = ($raw-$minified) / $raw * 100;
31
- $savings = round($savings, 2);
32
- return '<!--HTML minified, size saved '.$savings.'%. From '.$raw.' bytes, now '.$minified.' bytes-->';
33
- }
34
-
35
- protected function minifyHTML($html) {
36
- $pattern = '/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si';
37
- preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
38
- $overriding = false;
39
- $raw_tag = false;
40
- // Variable reused for output
41
- $html = '';
42
- foreach ($matches as $token) {
43
- $tag = (isset($token['tag'])) ? strtolower($token['tag']) : null;
44
-
45
- $content = $token[0];
46
-
47
- if (is_null($tag)) {
48
- if ( !empty($token['script']) ) {
49
- $strip = $this->minify_js;
50
- } else if ( !empty($token['style']) ) {
51
- $strip = $this->minify_css;
52
- } else if ($content == '<!--sbp-html-minifier no minifier-->'){
53
- $overriding = !$overriding;
54
-
55
- // Don't print the comments
56
- continue;
57
- } else if ($this->remove_comments){
58
- if (!$overriding && $raw_tag != 'textarea'){
59
- // Remove any HTML comments, except MSIE conditional comments
60
- $content = preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->/s', '', $content);
61
- }
62
- }
63
- }else{
64
- if ($tag == 'pre' || $tag == 'textarea'){
65
- $raw_tag = $tag;
66
- }else if ($tag == '/pre' || $tag == '/textarea'){
67
- $raw_tag = false;
68
- }else{
69
- if ($raw_tag || $overriding){
70
- $strip = false;
71
- }else{
72
- $strip = true;
73
- // Remove all empty attributes, except action, alt, content, src
74
- $content = preg_replace('/(\s+)(\w++(?<!\baction|\balt|\bcontent|\bsrc)="")/', '$1', $content);
75
- // Remove all space before the end of self-closing XHTML tags
76
- // JavaScript excluded
77
- $content = str_replace(' />', '/>', $content);
78
- }
79
- }
80
- }
81
-
82
- if ($strip){
83
- $content = $this->removeWhiteSpace($content);
84
- }
85
-
86
- $html .= $content;
87
- }
88
-
89
- return $html;
90
- }
91
-
92
- public function parseHTML($html){
93
- $this->html = $this->minifyHTML($html);
94
-
95
- if ($this->info_comment){
96
- $this->html .= "\n" . $this->bottomComment($html, $this->html);
97
- }
98
- }
99
-
100
- protected function removeWhiteSpace($str){
101
- $str = str_replace("\t", ' ', $str);
102
- $str = str_replace("\n", '', $str);
103
- $str = str_replace("\r", '', $str);
104
-
105
- while (stristr($str, ' ')){
106
- $str = str_replace(' ', ' ', $str);
107
- }
108
-
109
- return $str;
110
- }
111
- }
112
-
113
- function sbp_html_minifier_finish($html){
114
- return new SBP_HTML_Minifier($html);
115
- }
116
-
117
- function sbp_html_minifier_start(){
118
- ob_start('sbp_html_minifier_finish');
119
- }
120
-
121
- add_action('get_header', 'sbp_html_minifier_start');
1
+ <?php
2
+
3
+ /*--------------------------------------------------------------------------------------------------------
4
+ MINIFIER - increase your page load speed by minifying JavaScript and HTML
5
+ ---------------------------------------------------------------------------------------------------------*/
6
+
7
+
8
+ class SBP_HTML_Minifier {
9
+ // Minify settings
10
+ protected $minify_css = true;
11
+ protected $minify_js = false;
12
+ protected $info_comment = true;
13
+ protected $remove_comments = true;
14
+
15
+ // Minify variables
16
+ protected $html;
17
+ public function __construct($html) {
18
+ if (!empty($html)) {
19
+ $this->parseHTML($html);
20
+ }
21
+ }
22
+
23
+ public function __toString() {
24
+ return $this->html;
25
+ }
26
+
27
+ protected function bottomComment($raw, $minified) {
28
+ $raw = strlen($raw);
29
+ $minified = strlen($minified);
30
+ $savings = ($raw-$minified) / $raw * 100;
31
+ $savings = round($savings, 2);
32
+ return '<!-- HTML minified; size reduced '.$savings.'% (from '.$raw.' bytes down to '.$minified.' bytes) -->';
33
+ }
34
+
35
+ protected function minifyHTML($html) {
36
+ $pattern = '/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si';
37
+ preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
38
+ $overriding = false;
39
+ $raw_tag = false;
40
+ // Variable reused for output
41
+ $html = '';
42
+ foreach ($matches as $token) {
43
+ $tag = (isset($token['tag'])) ? strtolower($token['tag']) : null;
44
+
45
+ $content = $token[0];
46
+
47
+ if (is_null($tag)) {
48
+ if ( !empty($token['script']) ) {
49
+ $strip = $this->minify_js;
50
+ } else if ( !empty($token['style']) ) {
51
+ $strip = $this->minify_css;
52
+ } else if ($content == '<!--sbp-html-minifier no minifier-->'){
53
+ $overriding = !$overriding;
54
+
55
+ // Don't print the comments
56
+ continue;
57
+ } else if ($this->remove_comments){
58
+ if (!$overriding && $raw_tag != 'textarea'){
59
+ // Remove any HTML comments, except MSIE conditional comments
60
+ $content = preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->/s', '', $content);
61
+ }
62
+ }
63
+ }else{
64
+ if ($tag == 'pre' || $tag == 'textarea'){
65
+ $raw_tag = $tag;
66
+ }else if ($tag == '/pre' || $tag == '/textarea'){
67
+ $raw_tag = false;
68
+ }else{
69
+ if ($raw_tag || $overriding){
70
+ $strip = false;
71
+ }else{
72
+ $strip = true;
73
+ // Remove all empty attributes, except action, alt, content, src
74
+ $content = preg_replace('/(\s+)(\w++(?<!\baction|\balt|\bcontent|\bsrc)="")/', '$1', $content);
75
+ // Remove all space before the end of self-closing XHTML tags
76
+ // JavaScript excluded
77
+ $content = str_replace(' />', '/>', $content);
78
+ }
79
+ }
80
+ }
81
+
82
+ if ($strip){
83
+ $content = $this->removeWhiteSpace($content);
84
+ }
85
+
86
+ $html .= $content;
87
+ }
88
+
89
+ return $html;
90
+ }
91
+
92
+ public function parseHTML($html){
93
+ $this->html = $this->minifyHTML($html);
94
+
95
+ if ($this->info_comment){
96
+ $this->html .= "\n" . $this->bottomComment($html, $this->html);
97
+ }
98
+ }
99
+
100
+ protected function removeWhiteSpace($str){
101
+ $str = str_replace("\t", ' ', $str);
102
+ $str = str_replace("\n", '', $str);
103
+ $str = str_replace("\r", '', $str);
104
+
105
+ while (stristr($str, ' ')){
106
+ $str = str_replace(' ', ' ', $str);
107
+ }
108
+
109
+ return $str;
110
+ }
111
+ }
112
+
113
+ function sbp_html_minifier_finish($html){
114
+ return new SBP_HTML_Minifier($html);
115
+ }
116
+
117
+ function sbp_html_minifier_start(){
118
+ ob_start('sbp_html_minifier_finish');
119
+ }
120
+
121
+ add_action('get_header', 'sbp_html_minifier_start');
inc/settings.php CHANGED
@@ -1,286 +1,286 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'Speed_Booster_Pack_Options' ) ) {
4
-
5
- class Speed_Booster_Pack_Options {
6
-
7
- private $sbp_options;
8
-
9
- /*--------------------------------------------------------------------------------------------------------
10
- Construct the plugin object
11
- ---------------------------------------------------------------------------------------------------------*/
12
-
13
- public function __construct() {
14
-
15
- add_action( 'admin_init', array( $this, 'sbp_admin_init' ) );
16
- add_action( 'admin_menu', array( $this, 'sbp_add_menu' ) );
17
- add_action( 'wp_footer', array( $this, 'sbp_detected_scripts_handle' ), 999 );
18
- add_action( 'wp_footer', array( $this, 'sbp_detected_scripts_src' ), 999 );
19
- add_action( 'wp_footer', array( $this, 'sbp_detected_styles_handle' ), 999 );
20
-
21
- } // END public function __construct
22
-
23
-
24
- public function sbp_admin_init() {
25
-
26
- register_setting( 'speed_booster_settings_group', 'sbp_settings' );
27
- register_setting( 'speed_booster_settings_group', 'sbp_integer' );
28
- register_setting( 'speed_booster_settings_group', 'sbp_css_exceptions' );
29
- register_setting( 'speed_booster_settings_group', 'sbp_sanitize' );
30
-
31
- register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions1' );
32
- register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions2' );
33
- register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions3' );
34
- register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions4' );
35
-
36
- register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions1' );
37
- register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions2' );
38
- register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions3' );
39
- register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions4' );
40
-
41
- } // END public function admin_init
42
-
43
-
44
- /*--------------------------------------------------------------------------------------------------------
45
- Get enqueued scripts handles
46
- ---------------------------------------------------------------------------------------------------------*/
47
-
48
- public function sbp_detected_scripts_handle( $handles = array() ) {
49
-
50
- global $wp_scripts;
51
-
52
-
53
- // scripts
54
- foreach ( $wp_scripts->registered as $registered ) {
55
- $script_urls[ $registered->handle ] = $registered->src;
56
- }
57
-
58
- // if empty
59
- if ( empty( $handles ) ) {
60
- $handles = array_merge( $wp_scripts->done );
61
- array_values( $handles );
62
- }
63
- // output of values
64
- $get_enqueued_scripts_handle = '';
65
- foreach ( $handles as $handle ) {
66
- if ( ! empty( $script_urls[ $handle ] ) ) {
67
- $get_enqueued_scripts_handle .= $handle . '<br />';
68
- }
69
-
70
- }
71
-
72
- update_option( 'all_theme_scripts_handle', $get_enqueued_scripts_handle );
73
-
74
- }
75
-
76
- /*--------------------------------------------------------------------------------------------------------
77
- Get enqueued scripts src path
78
- ---------------------------------------------------------------------------------------------------------*/
79
-
80
- public function sbp_detected_scripts_src( $handles = array() ) {
81
-
82
- global $wp_scripts;
83
-
84
- // scripts
85
- foreach ( $wp_scripts->registered as $registered ) {
86
- $script_urls[ $registered->handle ] = $registered->src;
87
- }
88
-
89
- // if empty
90
- if ( empty( $handles ) ) {
91
- $handles = array_merge( $wp_scripts->done );
92
- array_values( $handles );
93
- }
94
- // output of values
95
- $get_enqueued_scripts_src = '';
96
- foreach ( $handles as $handle ) {
97
- if ( ! empty( $script_urls[ $handle ] ) ) {
98
- $get_enqueued_scripts_src .= $script_urls[ $handle ] . '<br />';
99
- }
100
-
101
- }
102
-
103
- update_option( 'all_theme_scripts_src', $get_enqueued_scripts_src );
104
-
105
- }
106
-
107
-
108
- /*--------------------------------------------------------------------------------------------------------
109
- Get enqueued style handles
110
- ---------------------------------------------------------------------------------------------------------*/
111
-
112
- public function sbp_detected_styles_handle( $handles = array() ) {
113
-
114
- global $wp_styles;
115
-
116
-
117
- // scripts
118
- foreach ( $wp_styles->registered as $registered ) {
119
- $style_urls[ $registered->handle ] = $registered->src;
120
- }
121
-
122
- // if empty
123
- if ( empty( $handles ) ) {
124
- $handles = array_merge( $wp_styles->queue );
125
- array_values( $handles );
126
- }
127
- // output of values
128
- $get_enqueued_styles_handle = '';
129
- foreach ( $handles as $handle ) {
130
- if ( ! empty( $style_urls[ $handle ] ) ) {
131
- $get_enqueued_styles_handle .= $handle . '<br />';
132
- }
133
-
134
- }
135
-
136
- update_option( 'all_theme_styles_handle', $get_enqueued_styles_handle );
137
-
138
- }
139
-
140
-
141
- /*--------------------------------------------------------------------------------------------------------
142
- Sanitize Options
143
- ---------------------------------------------------------------------------------------------------------*/
144
-
145
- public function sbp_sanitize( $input ) {
146
-
147
- $output = array();
148
-
149
- foreach ( $input as $key => $tigu ) {
150
-
151
- switch ( $key ) {
152
- case 'sbp_js_footer_exceptions1':
153
- $output[ $key ] = esc_html( $tigu );
154
- break;
155
- case 'sbp_js_footer_exceptions2':
156
- $output[ $key ] = esc_html( $tigu );
157
- break;
158
- case 'sbp_js_footer_exceptions3':
159
- $output[ $key ] = esc_html( $tigu );
160
- break;
161
- case 'sbp_js_footer_exceptions4':
162
- $output[ $key ] = esc_html( $tigu );
163
- break;
164
- }
165
-
166
- }
167
-
168
- return $output;
169
- }
170
-
171
-
172
- /*--------------------------------------------------------------------------------------------------------
173
- // Add a page to manage the plugin's settings
174
- ---------------------------------------------------------------------------------------------------------*/
175
-
176
- public function sbp_add_menu() {
177
-
178
- global $sbp_settings_page;
179
- $sbp_settings_page = add_menu_page( __( 'Speed Booster Options', 'speed-booster-pack' ), __( 'Speed Booster', 'speed-booster-pack' ), 'manage_options', 'sbp-options', array(
180
- $this,
181
- 'sbp_plugin_settings_page',
182
- ), plugin_dir_url( __FILE__ ) . 'images/icon-16x16.png' );
183
-
184
- } // END public function add_menu()
185
-
186
-
187
- public function sbp_plugin_settings_page() {
188
-
189
- if ( ! current_user_can( 'manage_options' ) ) {
190
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
191
- }
192
-
193
-
194
- /*--------------------------------------------------------------------------------------------------------
195
- Global Variables used on options HTML page
196
- ---------------------------------------------------------------------------------------------------------*/
197
-
198
- global $sbp_options;
199
-
200
- // Global variables used in plugin options page
201
- $get_enqueued_scripts_handle = get_option( 'all_theme_scripts_handle' );
202
- $get_enqueued_scripts_src = get_option( 'all_theme_scripts_src' );
203
- $get_enqueued_styles_handle = get_option( 'all_theme_styles_handle' );
204
-
205
- // fallback for image compression integer
206
- if ( get_option( 'sbp_integer' ) ) {
207
- $this->image_compression = get_option( 'sbp_integer' );
208
- } else {
209
- $this->image_compression = 75;
210
- }
211
- $this->plugin_url = plugin_dir_url( dirname( __FILE__ ) );
212
-
213
- // fallback for stylesheets exception handle
214
- if ( get_option( 'sbp_css_exceptions' ) ) {
215
- $css_exceptions = get_option( 'sbp_css_exceptions' );
216
- } else {
217
- $css_exceptions = '';
218
- }
219
-
220
- /*--------------------------------------------------------------------------------------------------------*/
221
-
222
- if ( get_option( 'sbp_js_footer_exceptions1' ) ) {
223
- $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
224
- } else {
225
- $js_footer_exceptions1 = '';
226
- }
227
-
228
- if ( get_option( 'sbp_js_footer_exceptions2' ) ) {
229
- $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
230
- } else {
231
- $js_footer_exceptions2 = '';
232
- }
233
-
234
- if ( get_option( 'sbp_js_footer_exceptions3' ) ) {
235
- $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
236
- } else {
237
- $js_footer_exceptions3 = '';
238
- }
239
-
240
- if ( get_option( 'sbp_js_footer_exceptions4' ) ) {
241
- $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
242
- } else {
243
- $js_footer_exceptions4 = '';
244
- }
245
-
246
- /*--------------------------------------------------------------------------------------------------------*/
247
-
248
-
249
-
250
- if ( get_option( 'sbp_defer_exceptions1' ) ) {
251
- $defer_exceptions1 = get_option( 'sbp_defer_exceptions1' );
252
- } else {
253
- $defer_exceptions1 = '';
254
- }
255
-
256
- if ( get_option( 'sbp_defer_exceptions2' ) ) {
257
- $defer_exceptions2 = get_option( 'sbp_defer_exceptions2' );
258
- } else {
259
- $defer_exceptions2 = '';
260
- }
261
-
262
- if ( get_option( 'sbp_defer_exceptions3' ) ) {
263
- $defer_exceptions3 = get_option( 'sbp_defer_exceptions3' );
264
- } else {
265
- $defer_exceptions3 = '';
266
- }
267
-
268
- if ( get_option( 'sbp_defer_exceptions4' ) ) {
269
- $defer_exceptions4 = get_option( 'sbp_defer_exceptions4' );
270
- } else {
271
- $defer_exceptions4 = '';
272
- }
273
-
274
- /*--------------------------------------------------------------------------------------------------------*/
275
-
276
-
277
-
278
- // Render the plugin options page HTML
279
- include( SPEED_BOOSTER_PACK_PATH . 'inc/template/options.php' );
280
-
281
- } // END public function sbp_plugin_settings_page()
282
-
283
-
284
- } // END class Speed_Booster_Pack_Options
285
-
286
- } // END if(!class_exists('Speed_Booster_Pack_Options'))
1
+ <?php
2
+
3
+ if ( ! class_exists( 'Speed_Booster_Pack_Options' ) ) {
4
+
5
+ class Speed_Booster_Pack_Options {
6
+
7
+ private $sbp_options;
8
+
9
+ /*--------------------------------------------------------------------------------------------------------
10
+ Construct the plugin object
11
+ ---------------------------------------------------------------------------------------------------------*/
12
+
13
+ public function __construct() {
14
+
15
+ add_action( 'admin_init', array( $this, 'sbp_admin_init' ) );
16
+ add_action( 'admin_menu', array( $this, 'sbp_add_menu' ) );
17
+ add_action( 'wp_footer', array( $this, 'sbp_detected_scripts_handle' ), 999 );
18
+ add_action( 'wp_footer', array( $this, 'sbp_detected_scripts_src' ), 999 );
19
+ add_action( 'wp_footer', array( $this, 'sbp_detected_styles_handle' ), 999 );
20
+
21
+ } // END public function __construct
22
+
23
+
24
+ public function sbp_admin_init() {
25
+
26
+ register_setting( 'speed_booster_settings_group', 'sbp_settings' );
27
+ register_setting( 'speed_booster_settings_group', 'sbp_integer' );
28
+ register_setting( 'speed_booster_settings_group', 'sbp_css_exceptions' );
29
+ register_setting( 'speed_booster_settings_group', 'sbp_sanitize' );
30
+
31
+ register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions1' );
32
+ register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions2' );
33
+ register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions3' );
34
+ register_setting( 'speed_booster_settings_group', 'sbp_js_footer_exceptions4' );
35
+
36
+ register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions1' );
37
+ register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions2' );
38
+ register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions3' );
39
+ register_setting( 'speed_booster_settings_group', 'sbp_defer_exceptions4' );
40
+
41
+ } // END public function admin_init
42
+
43
+
44
+ /*--------------------------------------------------------------------------------------------------------
45
+ Get enqueued scripts handles
46
+ ---------------------------------------------------------------------------------------------------------*/
47
+
48
+ public function sbp_detected_scripts_handle( $handles = array() ) {
49
+
50
+ global $wp_scripts;
51
+
52
+
53
+ // scripts
54
+ foreach ( $wp_scripts->registered as $registered ) {
55
+ $script_urls[ $registered->handle ] = $registered->src;
56
+ }
57
+
58
+ // if empty
59
+ if ( empty( $handles ) ) {
60
+ $handles = array_merge( $wp_scripts->done );
61
+ array_values( $handles );
62
+ }
63
+ // output of values
64
+ $get_enqueued_scripts_handle = '';
65
+ foreach ( $handles as $handle ) {
66
+ if ( ! empty( $script_urls[ $handle ] ) ) {
67
+ $get_enqueued_scripts_handle .= $handle . '<br />';
68
+ }
69
+
70
+ }
71
+
72
+ update_option( 'all_theme_scripts_handle', $get_enqueued_scripts_handle );
73
+
74
+ }
75
+
76
+ /*--------------------------------------------------------------------------------------------------------
77
+ Get enqueued scripts src path
78
+ ---------------------------------------------------------------------------------------------------------*/
79
+
80
+ public function sbp_detected_scripts_src( $handles = array() ) {
81
+
82
+ global $wp_scripts;
83
+
84
+ // scripts
85
+ foreach ( $wp_scripts->registered as $registered ) {
86
+ $script_urls[ $registered->handle ] = $registered->src;
87
+ }
88
+
89
+ // if empty
90
+ if ( empty( $handles ) ) {
91
+ $handles = array_merge( $wp_scripts->done );
92
+ array_values( $handles );
93
+ }
94
+ // output of values
95
+ $get_enqueued_scripts_src = '';
96
+ foreach ( $handles as $handle ) {
97
+ if ( ! empty( $script_urls[ $handle ] ) ) {
98
+ $get_enqueued_scripts_src .= $script_urls[ $handle ] . '<br />';
99
+ }
100
+
101
+ }
102
+
103
+ update_option( 'all_theme_scripts_src', $get_enqueued_scripts_src );
104
+
105
+ }
106
+
107
+
108
+ /*--------------------------------------------------------------------------------------------------------
109
+ Get enqueued style handles
110
+ ---------------------------------------------------------------------------------------------------------*/
111
+
112
+ public function sbp_detected_styles_handle( $handles = array() ) {
113
+
114
+ global $wp_styles;
115
+
116
+
117
+ // scripts
118
+ foreach ( $wp_styles->registered as $registered ) {
119
+ $style_urls[ $registered->handle ] = $registered->src;
120
+ }
121
+
122
+ // if empty
123
+ if ( empty( $handles ) ) {
124
+ $handles = array_merge( $wp_styles->queue );
125
+ array_values( $handles );
126
+ }
127
+ // output of values
128
+ $get_enqueued_styles_handle = '';
129
+ foreach ( $handles as $handle ) {
130
+ if ( ! empty( $style_urls[ $handle ] ) ) {
131
+ $get_enqueued_styles_handle .= $handle . '<br />';
132
+ }
133
+
134
+ }
135
+
136
+ update_option( 'all_theme_styles_handle', $get_enqueued_styles_handle );
137
+
138
+ }
139
+
140
+
141
+ /*--------------------------------------------------------------------------------------------------------
142
+ Sanitize Options
143
+ ---------------------------------------------------------------------------------------------------------*/
144
+
145
+ public function sbp_sanitize( $input ) {
146
+
147
+ $output = array();
148
+
149
+ foreach ( $input as $key => $tigu ) {
150
+
151
+ switch ( $key ) {
152
+ case 'sbp_js_footer_exceptions1':
153
+ $output[ $key ] = esc_html( $tigu );
154
+ break;
155
+ case 'sbp_js_footer_exceptions2':
156
+ $output[ $key ] = esc_html( $tigu );
157
+ break;
158
+ case 'sbp_js_footer_exceptions3':
159
+ $output[ $key ] = esc_html( $tigu );
160
+ break;
161
+ case 'sbp_js_footer_exceptions4':
162
+ $output[ $key ] = esc_html( $tigu );
163
+ break;
164
+ }
165
+
166
+ }
167
+
168
+ return $output;
169
+ }
170
+
171
+
172
+ /*--------------------------------------------------------------------------------------------------------
173
+ // Add a page to manage the plugin's settings
174
+ ---------------------------------------------------------------------------------------------------------*/
175
+
176
+ public function sbp_add_menu() {
177
+
178
+ global $sbp_settings_page;
179
+ $sbp_settings_page = add_menu_page( __( 'Speed Booster Options', 'speed-booster-pack' ), __( 'Speed Booster', 'speed-booster-pack' ), 'manage_options', 'sbp-options', array(
180
+ $this,
181
+ 'sbp_plugin_settings_page',
182
+ ), plugin_dir_url( __FILE__ ) . 'images/icon-16x16.png' );
183
+
184
+ } // END public function add_menu()
185
+
186
+
187
+ public function sbp_plugin_settings_page() {
188
+
189
+ if ( ! current_user_can( 'manage_options' ) ) {
190
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
191
+ }
192
+
193
+
194
+ /*--------------------------------------------------------------------------------------------------------
195
+ Global Variables used on options HTML page
196
+ ---------------------------------------------------------------------------------------------------------*/
197
+
198
+ global $sbp_options;
199
+
200
+ // Global variables used in plugin options page
201
+ $get_enqueued_scripts_handle = get_option( 'all_theme_scripts_handle' );
202
+ $get_enqueued_scripts_src = get_option( 'all_theme_scripts_src' );
203
+ $get_enqueued_styles_handle = get_option( 'all_theme_styles_handle' );
204
+
205
+ // fallback for image compression integer
206
+ if ( get_option( 'sbp_integer' ) ) {
207
+ $this->image_compression = get_option( 'sbp_integer' );
208
+ } else {
209
+ $this->image_compression = 75;
210
+ }
211
+ $this->plugin_url = plugin_dir_url( dirname( __FILE__ ) );
212
+
213
+ // fallback for stylesheets exception handle
214
+ if ( get_option( 'sbp_css_exceptions' ) ) {
215
+ $css_exceptions = get_option( 'sbp_css_exceptions' );
216
+ } else {
217
+ $css_exceptions = '';
218
+ }
219
+
220
+ /*--------------------------------------------------------------------------------------------------------*/
221
+
222
+ if ( get_option( 'sbp_js_footer_exceptions1' ) ) {
223
+ $js_footer_exceptions1 = get_option( 'sbp_js_footer_exceptions1' );
224
+ } else {
225
+ $js_footer_exceptions1 = '';
226
+ }
227
+
228
+ if ( get_option( 'sbp_js_footer_exceptions2' ) ) {
229
+ $js_footer_exceptions2 = get_option( 'sbp_js_footer_exceptions2' );
230
+ } else {
231
+ $js_footer_exceptions2 = '';
232
+ }
233
+
234
+ if ( get_option( 'sbp_js_footer_exceptions3' ) ) {
235
+ $js_footer_exceptions3 = get_option( 'sbp_js_footer_exceptions3' );
236
+ } else {
237
+ $js_footer_exceptions3 = '';
238
+ }
239
+
240
+ if ( get_option( 'sbp_js_footer_exceptions4' ) ) {
241
+ $js_footer_exceptions4 = get_option( 'sbp_js_footer_exceptions4' );
242
+ } else {
243
+ $js_footer_exceptions4 = '';
244
+ }
245
+
246
+ /*--------------------------------------------------------------------------------------------------------*/
247
+
248
+
249
+
250
+ if ( get_option( 'sbp_defer_exceptions1' ) ) {
251
+ $defer_exceptions1 = get_option( 'sbp_defer_exceptions1' );
252
+ } else {
253
+ $defer_exceptions1 = '';
254
+ }
255
+
256
+ if ( get_option( 'sbp_defer_exceptions2' ) ) {
257
+ $defer_exceptions2 = get_option( 'sbp_defer_exceptions2' );
258
+ } else {
259
+ $defer_exceptions2 = '';
260
+ }
261
+
262
+ if ( get_option( 'sbp_defer_exceptions3' ) ) {
263
+ $defer_exceptions3 = get_option( 'sbp_defer_exceptions3' );
264
+ } else {
265
+ $defer_exceptions3 = '';
266
+ }
267
+
268
+ if ( get_option( 'sbp_defer_exceptions4' ) ) {
269
+ $defer_exceptions4 = get_option( 'sbp_defer_exceptions4' );
270
+ } else {
271
+ $defer_exceptions4 = '';
272
+ }
273
+
274
+ /*--------------------------------------------------------------------------------------------------------*/
275
+
276
+
277
+
278
+ // Render the plugin options page HTML
279
+ include( SPEED_BOOSTER_PACK_PATH . 'inc/template/options.php' );
280
+
281
+ } // END public function sbp_plugin_settings_page()
282
+
283
+
284
+ } // END class Speed_Booster_Pack_Options
285
+
286
+ } // END if(!class_exists('Speed_Booster_Pack_Options'))
inc/template/notice.php CHANGED
@@ -1,35 +1,34 @@
1
- <div class="notice sbp-notice" id="sbp-notice">
2
- <img src="<?php echo esc_url(plugins_url('images/logo.png', dirname(__FILE__))); ?>" width="80">
3
- <h1><?php esc_html_e('Welcome to Speed Booster Pack', 'speed-booster-pack'); ?></h1>
4
- <p><?php printf(esc_html__('Welcome! Thank you for installing Speed Booster Pack! Check out the %sPlugin settings%s for new features that can make your site load faster.', 'speed-booster-pack'), '<a href="admin.php?page=sbp-options">', '</a>'); ?></p>
5
- <p><a href="admin.php?page=sbp-options"
6
- class="button button-primary button-hero"><?php esc_html_e('Get started with Speed Booster Pack', 'speed-booster-pack'); ?></a>
7
- <a href="https://optimocha.com/"
8
- class="button button-primary button-hero" target="_blank"><?php esc_html_e('Pro Optimization Service', 'speed-booster-pack'); ?></a>
9
- </p>
10
- <button type="button" onclick="sbp_dismissNotice();" class="notice-dismiss"><span
11
- class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'speed-booster-pack'); ?></span>
12
- </button>
13
- </div>
14
- <style>
15
- .sbp-notice {
16
- background: #e9eff3;
17
- border: 10px solid #fff;
18
- color: #608299;
19
- padding: 30px;
20
- text-align: center;
21
- position: relative;
22
- }
23
- </style>
24
- <script>
25
- function sbp_dismissNotice() {
26
- jQuery("#sbp-notice").hide();
27
- var data = { action : 'sbp_dismiss_notices'};
28
- jQuery.get('<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', data, function(response) {
29
- data = JSON.parse(response);
30
- if(data["Status"] == 0) {
31
- console.log("dismissed");
32
- }
33
- });
34
- }
35
- </script>
1
+ <div class="notice sbp-notice" id="sbp-notice">
2
+ <img src="<?php echo esc_url(plugins_url('images/logo.png', dirname(__FILE__))); ?>" width="80">
3
+ <h1><?php esc_html_e('Welcome to Speed Booster Pack', 'speed-booster-pack'); ?></h1>
4
+ <p><?php printf(esc_html__('Thank you for installing Speed Booster Pack! Check out the %sPlugin settings%s for new features that can make your site load faster.', 'speed-booster-pack'), '<a href="admin.php?page=sbp-options">', '</a>'); ?></p>
5
+ <p>
6
+ <a href="admin.php?page=sbp-options" class="button button-primary button-hero"><?php esc_html_e('Get started', 'speed-booster-pack'); ?></a>
7
+ <a href="https://optimocha.com/?ref=sbp" class="button button-primary button-hero" target="_blank"><?php esc_html_e('Pro Optimization Service', 'speed-booster-pack'); ?></a>
8
+ </p>
9
+ <button type="button" onclick="sbp_dismissNotice();" class="notice-dismiss"><span
10
+ class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'speed-booster-pack'); ?></span>
11
+ </button>
12
+ </div>
13
+ <style>
14
+ .sbp-notice {
15
+ background: #e9eff3;
16
+ border: 10px solid #fff;
17
+ color: #608299;
18
+ padding: 30px;
19
+ text-align: center;
20
+ position: relative;
21
+ }
22
+ </style>
23
+ <script>
24
+ function sbp_dismissNotice() {
25
+ jQuery("#sbp-notice").hide();
26
+ var data = { action : 'sbp_dismiss_notices'};
27
+ jQuery.get('<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>', data, function(response) {
28
+ data = JSON.parse(response);
29
+ if(data["Status"] == 0) {
30
+ console.log("dismissed");
31
+ }
32
+ });
33
+ }
34
+ </script>
 
inc/template/options.php CHANGED
@@ -1,705 +1,722 @@
1
- <?php
2
-
3
- // handle closed postboxes
4
- $user_id = get_current_user_id();
5
- $option_name = 'closedpostboxes_' . 'toplevel_page_sbp-options'; // use the "pagehook" ID
6
- $option_arr = get_user_option( $option_name, $user_id ); // get the options for that page
7
-
8
-
9
- if ( is_array( $option_arr ) && in_array( 'exclude-from-footer', $option_arr ) ) {
10
- $closed = true;
11
- }
12
-
13
-
14
- if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
15
- $closed_defer = true;
16
- }
17
-
18
- ?>
19
-
20
- <div class="wrap about-wrap">
21
- <div class="sb-pack">
22
-
23
- <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
24
-
25
- <div class="about-text">
26
- <?php
27
- /* Translators: Welcome Screen Description. */
28
- echo esc_html__( 'Speed Booster Pack is a lightweight, frequently updated, easy to use and well supported plugin which allows you to improve your website’s loading speed. Visitors usually close a website if it doesn’t load in a few seconds and the slower a site loads the greater the chances are that the visitors will leave. And you don’t want that to happen, do you?', 'speed-booster-pack' );
29
- ?>
30
- </div>
31
- <div class="wp-badge sbp-welcome-logo"></div>
32
-
33
- <h2 class="nav-tab-wrapper wp-clearfix">
34
- <a class="nav-tab" href="#general-options"><?php esc_html_e( 'General', 'speed-booster-pack' ); ?></a>
35
- <a class="nav-tab" href="#advanced-options"><?php esc_html_e( 'Advanced', 'speed-booster-pack' ); ?></a>
36
- <a class="nav-tab" href="#cdn-options"><?php esc_html_e( 'CDN', 'speed-booster-pack' ); ?></a>
37
- <a class="nav-tab" href="#google-analytics"><?php esc_html_e( 'Google Analytics', 'speed-booster-pack' ); ?></a>
38
- <a class="nav-tab" href="#optimize-more"><?php esc_html_e( 'Optimize More', 'speed-booster-pack' ); ?></a>
39
- </h2>
40
-
41
- <form method="post" action="options.php">
42
-
43
- <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
44
- <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
45
- <?php settings_fields( 'speed_booster_settings_group' ); ?>
46
-
47
- <?php
48
-
49
- $sbp_options_array = array(
50
- //general options panel
51
- 'general-options' => array(
52
- //General section
53
- 'sections' => array(
54
- array(
55
- 'type' => 'section',
56
- 'label' => __( 'General', 'speed-booster-pack' ),
57
- 'items' => array(
58
- 'jquery_to_footer' => array(
59
- 'type' => 'checkbox',
60
- 'label' => __( 'Move scripts to footer', 'speed-booster-pack' ),
61
- 'tooltip' => __( 'This option move all scripts to the footer while keeping stylesheets in the header to improve page loading speed and get a higher score on the major speed testing sites such as GTmetrix or other website speed testing tools', 'speed-booster-pack' ),
62
- 'options_group' => 'sbp_settings',
63
- ),
64
- 'use_google_libs' => array(
65
- 'type' => 'checkbox',
66
- 'label' => __( 'Load JS from Google Libraries', 'speed-booster-pack' ),
67
- 'tooltip' => __( 'Loading WordPress javascript files from Google’s Libraries rather than serving it from your WordPress install directly, will reduce latency, increase parallelism and improve caching.', 'speed-booster-pack' ),
68
- 'options_group' => 'sbp_settings',
69
- ),
70
- 'minify_html_js' => array(
71
- 'type' => 'checkbox',
72
- 'label' => __( 'Minify HTML', 'speed-booster-pack' ),
73
- 'tooltip' => __( 'Activate this option only if you don’t want to use other minify plugins or other speed optimization plugin that has minify option included. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
74
- 'options_group' => 'sbp_settings',
75
- ),
76
- 'defer_parsing' => array(
77
- 'type' => 'checkbox',
78
- 'label' => __( 'Defer parsing of javascript files', 'speed-booster-pack' ),
79
- 'tooltip' => __( '!!!Note: This will be disabled IF Move Scripts to Footer is enabled. By deferring parsing of unneeded JavaScript until it needs to be executed, you can reduce the initial load time of your page. Please note that this option will not defer the main WordPress jQuery script if Load JS from Google Libraries option is not checked.', 'speed-booster-pack' ),
80
- 'options_group' => 'sbp_settings',
81
- ),
82
- 'query_strings' => array(
83
- 'type' => 'checkbox',
84
- 'label' => __( 'Remove query strings', 'speed-booster-pack' ),
85
- 'tooltip' => __( 'Since most proxies do not cache resources with a ? in their URL, this option allows you to remove any query strings (version numbers) from static resources like CSS & JS files, thus improving your speed scores in services like GTmetrix, PageSpeed, YSlow and Pingdoom.', 'speed-booster-pack' ),
86
- 'options_group' => 'sbp_settings',
87
- ),
88
- 'font_awesome' => array(
89
- 'type' => 'checkbox',
90
- 'label' => __( 'Removes extra Font Awesome styles', 'speed-booster-pack' ),
91
- 'tooltip' => __( 'Use this option only if your theme uses Font Awesome, to prevent other plugins that uses Font Awesome, to add their stylesheets to your theme. In other words, this option removes extra Font Awesome stylesheets added to your theme by certain plugins.', 'speed-booster-pack' ),
92
- 'options_group' => 'sbp_settings',
93
- ),
94
- ),
95
- ),
96
- //more settings section
97
- array(
98
- 'type' => 'section',
99
- 'label' => __( 'More settings', 'speed-booster-pack' ),
100
- 'items' => array(
101
- 'remove_emojis' => array(
102
- 'type' => 'checkbox',
103
- 'label' => __( 'Remove WordPress Emoji scripts', 'speed-booster-pack' ),
104
- 'tooltip' => __( 'Emojis are fun and all, but if you are aren’t using them they actually load a JavaScript file (wp-emoji-release.min.js) on every page of your website. For a lot of businesses, this is not needed and simply adds load time to your site. So we recommend disabling this.', 'speed-booster-pack' ),
105
- 'options_group' => 'sbp_settings',
106
- ),
107
- 'remove_wsl' => array(
108
- 'type' => 'checkbox',
109
- 'label' => __( 'Remove WordPress Shortlink', 'speed-booster-pack' ),
110
- 'tooltip' => __( 'WordPress URL shortening is sometimes useful, but it automatically adds an ugly code in your header, so you can remove it.', 'speed-booster-pack' ),
111
- 'options_group' => 'sbp_settings',
112
- ),
113
- 'remove_adjacent' => array(
114
- 'type' => 'checkbox',
115
- 'label' => __( 'Remove Adjacent Posts Links', 'speed-booster-pack' ),
116
- 'tooltip' => __( 'WordPress incorrectly implements this feature that supposedly should fix a pagination issues but it messes up, so there is no reason to keep these around. However, some browsers may use Adjacent Posts Links to navigate your site, although you can remove it if you run a well designed theme.', 'speed-booster-pack' ),
117
- 'options_group' => 'sbp_settings',
118
- ),
119
- 'wml_link' => array(
120
- 'type' => 'checkbox',
121
- 'label' => __( 'Remove Windows Manifest', 'speed-booster-pack' ),
122
- 'tooltip' => __( 'Windows Live Writer (WLW) is a Microsoft application for composing and managing blog posts offline and publish them later. If you are not using Windows Live Writer application, you can remove it from the WP head.', 'speed-booster-pack' ),
123
- 'options_group' => 'sbp_settings',
124
- ),
125
- 'wp_generator' => array(
126
- 'type' => 'checkbox',
127
- 'label' => __( 'Remove the WordPress Version', 'speed-booster-pack' ),
128
- 'tooltip' => __( 'Windows Live Writer (WLW) is a Microsoft application for composing and managing blog posts offline and publish them later. If you are not using Windows Live Writer application, you can remove it from the WP head.', 'speed-booster-pack' ),
129
- 'options_group' => 'sbp_settings',
130
- ),
131
- 'remove_all_feeds' => array(
132
- 'type' => 'checkbox',
133
- 'label' => __( 'Remove all rss feed links', 'speed-booster-pack' ),
134
- 'tooltip' => __( 'This option wil remove all rss feed links to cleanup your WordPress header. It is also useful on Unicorn – The W3C Markup Validation Service to get rid out the “feed does not validate” error.', 'speed-booster-pack' ),
135
- 'options_group' => 'sbp_settings',
136
- ),
137
- 'disable_xmlrpc' => array(
138
- 'type' => 'checkbox',
139
- 'label' => __( 'Disable XML-RPC', 'speed-booster-pack' ),
140
- 'tooltip' => __( 'XML-RPC was added in WordPress 3.5 and allows for remote connections, and unless you are using your mobile device to post to WordPress it does more bad than good. In fact, it can open your site up to a bunch of security risks. There are a few plugins that utilize this such as JetPack, but we don’t recommend using JetPack for performance reasons.', 'speed-booster-pack' ),
141
- 'options_group' => 'sbp_settings',
142
- ),
143
- 'disable_self_pingbacks' => array(
144
- 'type' => 'checkbox',
145
- 'label' => __( 'Disable Self Pingbacks', 'speed-booster-pack' ),
146
- 'tooltip' => __( 'A pingback is a special type of comment that’s created when you link to another blog post, as long as the other blog is set to accept pingbacks.', 'speed-booster-pack' ),
147
- 'options_group' => 'sbp_settings',
148
- ),
149
- 'disable_dashicons' => array(
150
- 'type' => 'checkbox',
151
- 'label' => __( 'Disable Dashicons', 'speed-booster-pack' ),
152
- 'tooltip' => __( 'Disable dashicons from front end.', 'speed-booster-pack' ),
153
- 'options_group' => 'sbp_settings',
154
- ),
155
- 'disable_google_maps' => array(
156
- 'type' => 'checkbox',
157
- 'label' => __( 'Disable Google Maps', 'speed-booster-pack' ),
158
- 'tooltip' => __( 'Disable Google Maps from front end. ', 'speed-booster-pack' ),
159
- 'options_group' => 'sbp_settings',
160
- ),
161
- 'disable_heartbeat' => array(
162
- 'type' => 'checkbox',
163
- 'label' => __( 'Disable Heartbeat', 'speed-booster-pack' ),
164
- 'tooltip' => __( 'Disable heartbeat everywhere ( used for autosaving and revision tracking ).', 'speed-booster-pack' ),
165
- 'options_group' => 'sbp_settings',
166
- ),
167
- 'heartbeat_frequency' => array(
168
- 'type' => 'select',
169
- 'label' => __( 'Heartbeat frequency', 'speed-booster-pack' ),
170
- 'tooltip' => __( 'Controls how often the Wordpress Heartbeat API is allowed to run. ', 'speed-booster-pack' ),
171
- 'options' => array(
172
- '15' => '15',
173
- '30' => '30',
174
- '45' => '45',
175
- '60' => '60',
176
- ),
177
- 'options_group' => 'sbp_settings',
178
- ),
179
- 'limit_post_revisions' => array(
180
- 'type' => 'select',
181
- 'label' => __( 'Limit Post Revision', 'speed-booster-pack' ),
182
- 'tooltip' => __( 'Controls how many Revisions Wordpress will save ', 'speed-booster-pack' ),
183
- 'options' => array(
184
- '1' => '1',
185
- '2' => '2',
186
- '3' => '3',
187
- '4' => '4',
188
- '5' => '5',
189
- '10' => '10',
190
- '15' => '15',
191
- '20' => '20',
192
- '25' => '25',
193
- '30' => '30',
194
- 'false' => 'Disable',
195
- ),
196
- 'options_group' => 'sbp_settings',
197
- ),
198
- 'autosave_interval' => array(
199
- 'type' => 'select',
200
- 'label' => __( 'Autosave interval', 'speed-booster-pack' ),
201
- 'tooltip' => __( 'Controls how wordpress will autosave posts and pages while editing.', 'speed-booster-pack' ),
202
- 'options' => array(
203
- '1' => __( '1 minute ( default )', 'speed-booster-pack' ),
204
- '2' => __( '2 minutes', 'speed-booster-pack' ),
205
- '3' => __( '3 minutes', 'speed-booster-pack' ),
206
- '4' => __( '4 minutes', 'speed-booster-pack' ),
207
- '5' => __( '5 minutes', 'speed-booster-pack' ),
208
- ),
209
- 'options_group' => 'sbp_settings',
210
- ),
211
- 'remove_rest_api_links' => array(
212
- 'type' => 'checkbox',
213
- 'label' => __( 'Remove REST API Links', 'speed-booster-pack' ),
214
- 'tooltip' => __( 'The WordPress REST API provides API endpoints for WordPress data types that allow developers to interact with sites remotely by sending and receiving JSON (JavaScript Object Notation) objects.', 'speed-booster-pack' ),
215
- 'options_group' => 'sbp_settings',
216
- ),
217
- ),
218
- ),
219
- //need even more speed section
220
- array(
221
- 'type' => 'section',
222
- 'label' => __( 'Need even more speed?', 'speed-booster-pack' ),
223
- 'items' => array(
224
- 'sbp_css_async' => array(
225
- 'type' => 'checkbox',
226
- 'label' => __( 'Inline all CSS styles', 'speed-booster-pack' ),
227
- 'tooltip' => __( 'Checking this option will inline the contents of all your stylesheets. This helps with the annoying render blocking error Google Page Speed Insights displays.', 'speed-booster-pack' ),
228
- 'options_group' => 'sbp_settings',
229
- ),
230
- 'sbp_css_minify' => array(
231
- 'type' => 'checkbox',
232
- 'label' => __( 'Minify all (previously) inlined CSS styles', 'speed-booster-pack' ),
233
- 'tooltip' => __( 'Minifying all inlined CSS styles will optimize the CSS delivery and will eliminate the annoying message on Google Page Speed regarding to render-blocking css.', 'speed-booster-pack' ),
234
- 'options_group' => 'sbp_settings',
235
- ),
236
- 'sbp_footer_css' => array(
237
- 'type' => 'checkbox',
238
- 'label' => __( 'Move all inlined CSS into the footer', 'speed-booster-pack' ),
239
- 'tooltip' => __( 'Inserting all CSS styles inline to the footer is a sensitive option that will eliminate render-blocking CSS warning in Google Page Speed test. If there is something broken after activation, you need to disable this option. Please note that before enabling this sensitive option, it is strongly recommended that you also enable the “ Move scripts to the footer” option.', 'speed-booster-pack' ),
240
- 'options_group' => 'sbp_settings',
241
- ),
242
- 'sbp_is_mobile' => array(
243
- 'type' => 'checkbox',
244
- 'label' => __( 'Disable all above CSS options on mobile devices', 'speed-booster-pack' ),
245
- 'tooltip' => __( 'Disable all above CSS options on mobile devices: this option was added to avoid some appearance issues on mobile devices.', 'speed-booster-pack' ),
246
- 'options_group' => 'sbp_settings',
247
- ),
248
- ),
249
- ),
250
- //other options section
251
- array(
252
- 'type' => 'section',
253
- 'items' => array(
254
- 'sbp_css_exceptions' => array(
255
- 'type' => 'textarea',
256
- 'label' => __( 'Exclude styles from being inlined and/or minified option: ', 'speed-booster-pack' ),
257
- 'description' => __( 'Enter one by line, the handles of css files or the final part of the style URL.', 'speed-booster-pack' ),
258
- ),
259
- //CSS handle guidance
260
- 'guidance_options_css' => array(
261
- 'type' => 'guidance',
262
- 'label' => __( 'As a guidance, here is a list of css handles of each enqueued style detected by our plugin:', 'speed-booster-pack' ),
263
- ),
264
- ),
265
- ),
266
- ),
267
- ),
268
- //advanced options panel
269
- 'advanced-options' => array(
270
- //Exclude scripts fro being moved to the footer
271
- 'sections' => array(
272
- array(
273
- 'type' => 'section',
274
- 'label' => __( 'Exclude scripts from being moved to the footer', 'speed-booster-pack' ),
275
- 'description' => __( 'Enter one js handle per text field. Read more <a href="https://docs.machothemes.com/article/119-plugin-options-explained#exclude-scripts-from-being-moved-to-the-footer-50">detailed instructions</a> on this option on plugin documentation.', 'speed-booster-pack' ),
276
- 'items' => array(
277
- 'sbp_js_footer_exceptions1' => array(
278
- 'type' => 'text',
279
- ),
280
- 'sbp_js_footer_exceptions2' => array(
281
- 'type' => 'text',
282
- ),
283
- 'sbp_js_footer_exceptions3' => array(
284
- 'type' => 'text',
285
- ),
286
- 'sbp_js_footer_exceptions4' => array(
287
- 'type' => 'text',
288
- ),
289
- //guidance
290
- 'guidance_options_js' => array(
291
- 'type' => 'guidance',
292
- 'label' => __( 'As a guidance, here is a list of script handles and script paths of each enqueued script detected by our plugin:', 'speed-booster-pack' ),
293
- ),
294
- ),
295
- ),
296
- //Exclude scripts from being deferred
297
- array(
298
- 'type' => 'section',
299
- 'label' => __( 'Exclude scripts from being deferred', 'speed-booster-pack' ),
300
- 'items' => array(
301
- 'sbp_defer_exceptions1' => array(
302
- 'type' => 'text',
303
- ),
304
- 'sbp_defer_exceptions2' => array(
305
- 'type' => 'text',
306
- ),
307
- 'sbp_defer_exceptions3' => array(
308
- 'type' => 'text',
309
- ),
310
- 'sbp_defer_exceptions4' => array(
311
- 'type' => 'text',
312
- ),
313
- 'info' => array(
314
- 'type' => 'guidance',
315
- 'description_only' => true,
316
- 'description' => __( 'Enter one by text field, the handle part of the js files that you want to be excluded from defer parsing option. For example: <code>jquery-core</code> If you want to exclude more than 4 scripts, you can use the following filter: <code>sbp_exclude_defer_scripts</code> which takes an array of script handles as params. If you don\'t know how to handle this, feel free to post on our support forums.', 'speed-booster-pack' ),
317
- ),
318
- ),
319
- ),
320
- ),
321
- ),
322
- 'cdn-options' => array(
323
- 'sections' => array(
324
- array(
325
- 'type' => 'section',
326
- 'label' => __( 'CDN', 'speed-booster-pack' ),
327
- 'description' => __( 'CDN options that allow you to rewrite your site URLs with your CDN URLs.', 'speed-booster-pack' ),
328
- 'items' => array(
329
- 'sbp_enable_cdn' => array(
330
- 'type' => 'checkbox',
331
- 'label' => __( 'Enable CDN Rewrite', 'speed-booster-pack' ),
332
- 'tooltip' => __( 'Enables rewriting of your site URLs with your CDN URLs', 'speed-booster-pack' ),
333
- 'options_group' => 'sbp_settings',
334
- ),
335
- 'sbp_cdn_url' => array(
336
- 'type' => 'text',
337
- 'label' => __( 'CDN URL', 'speed-booster-pack' ),
338
- 'tooltip' => __( 'Enter your CDN URL without the trailing backslash. Example: https://cdn.example.com', 'speed-booster-pack' ),
339
- 'options_group' => 'sbp_settings',
340
- ),
341
- 'sbp_cdn_included_directories' => array(
342
- 'type' => 'text',
343
- 'label' => __( 'Included Directories', 'speed-booster-pack' ),
344
- 'tooltip' => __( 'Enter any directories you would like to be included in CDN rewriting, separated by commas (,). Default: wp-content,wp-includes', 'speed-booster-pack' ),
345
- 'options_group' => 'sbp_settings',
346
- 'default' => 'wp-content,wp-includes',
347
- ),
348
- 'sbp_cdn_exclusions' => array(
349
- 'type' => 'text',
350
- 'label' => __( 'CDN Exclusions', 'speed-booster-pack' ),
351
- 'tooltip' => __( 'Enter any directories or file extensions you would like to be excluded from CDN rewriting, separated by commas (,). Default: .php', 'speed-booster-pack' ),
352
- 'options_group' => 'sbp_settings',
353
- 'default' => '.php',
354
- ),
355
- ),
356
- ),
357
- ),
358
- ),
359
- 'google-analytics' => array(
360
- 'sections' => array(
361
- array(
362
- 'type' => 'section',
363
- 'label' => __( 'Google Analytics', 'speed-booster-pack' ),
364
- 'description' => __( 'Optimization options for Google Analytics.', 'speed-booster-pack' ),
365
- 'items' => array(
366
- 'sbp_enable_local_analytics' => array(
367
- 'type' => 'checkbox',
368
- 'label' => __( 'Enable Local Analytics', 'speed-booster-pack' ),
369
- 'tooltip' => __( 'Enable syncing og the Google Analytics script to your own server.', 'speed-booster-pack' ),
370
- 'options_group' => 'sbp_settings',
371
- ),
372
- 'sbp_ga_tracking_id' => array(
373
- 'type' => 'text',
374
- 'label' => __( 'Tracking ID', 'speed-booster-pack' ),
375
- 'tooltip' => __( 'Enter your Google Analytics tracking ID', 'speed-booster-pack' ),
376
- 'options_group' => 'sbp_settings',
377
- ),
378
- 'sbp_tracking_position' => array(
379
- 'type' => 'select',
380
- 'label' => __( 'Tracking code position', 'speed-booster-pack' ),
381
- 'tooltip' => __( 'Load your analytics script in the header or footer of the site. Default - header', 'speed-booster-pack' ),
382
- 'options_group' => 'sbp_settings',
383
- 'options' => array(
384
- 'header' => 'Header ( default )',
385
- 'footer' => 'Footer',
386
- ),
387
- ),
388
- 'sbp_disable_display_features' => array(
389
- 'type' => 'checkbox',
390
- 'label' => __( 'Disable Display Features', 'speed-booster-pack' ),
391
- 'tooltip' => __( 'Disable marketing and advertising which generates a 2nd HTTP request', 'speed-booster-pack' ),
392
- 'options_group' => 'sbp_settings',
393
- ),
394
- 'sbp_anonymize_ip' => array(
395
- 'type' => 'checkbox',
396
- 'label' => __( 'Anonymize IP', 'speed-booster-pack' ),
397
- 'tooltip' => __( 'Shorten visitor IP to comply with privacy restrictions in some countries.', 'speed-booster-pack' ),
398
- 'options_group' => 'sbp_settings',
399
- ),
400
- 'sbp_track_loggedin_admins' => array(
401
- 'type' => 'checkbox',
402
- 'label' => __( 'Track Logged In Admins', 'speed-booster-pack' ),
403
- 'tooltip' => __( 'Include logged in Wordpress admins in your GA report.', 'speed-booster-pack' ),
404
- 'options_group' => 'sbp_settings',
405
- ),
406
- 'sbp_bounce_rate' => array(
407
- 'type' => 'text',
408
- 'label' => __( 'Adjusted Bounce Rate', 'speed-booster-pack' ),
409
- 'tooltip' => __( 'Set a timeout limit in seconds to better evaluate the quality of your traffic ( 1 - 100 )', 'speed-booster-pack' ),
410
- 'options_group' => 'sbp_settings',
411
- ),
412
- 'sbp_monsterinsights' => array(
413
- 'type' => 'checkbox',
414
- 'label' => __( 'User MonsterInsights', 'speed-booster-pack' ),
415
- 'tooltip' => __( 'Allows MonsterInsights to manage your Google Analaytics while still using the locally hosted analytics.js generated by Speed Booster Pack', 'speed-booster-pack' ),
416
- 'options_group' => 'sbp_settings',
417
- ),
418
- ),
419
- ),
420
- ),
421
- ),
422
- );
423
-
424
- //Start the tabs
425
- foreach ( $sbp_options_array as $k => $values ) { ?>
426
- <!-- Tab sections -->
427
- <div id="<?php echo $k; ?>" class="sb-pack-tab">
428
-
429
- <?php
430
- if ( $k == 'advanced-options' ) {
431
- ?>
432
- <!-- Advanced Options sections -->
433
- <h3><?php _e('Advanced', 'speed-bosoter-pack'); ?></h3>
434
- <div id="poststuff">
435
-
436
- <?php
437
- } else {
438
- ?>
439
- <!-- Sections For General Options -->
440
- <div class="sb-pack">
441
- <?php
442
- if ( isset( $values['label'] ) ) {
443
- ?>
444
- <h3><?php echo $values['label']; ?></h3>
445
- <?php
446
- }
447
- }
448
- //Start the sections
449
- foreach ( $values['sections'] as $section => $section_value ) {
450
- if ( 'advanced-options' != $k ) {
451
- ?>
452
- <h3><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></h3><?php
453
- } else {
454
- ?>
455
- <div class="meta-box-sortables ui-sortable" id="normal-sortables">
456
- <div class="postbox" id="<?php echo $section; ?>">
457
- <button type="button" class="handlediv" aria-expanded="true">
458
- <span class="screen-reader-text"><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></span>
459
- <span class="toggle-indicator" aria-hidden="true"></span>
460
- </button>
461
- <h3 class="hndle ui-sortable-handle" style="cursor: pointer;">
462
- <span><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></span>
463
- </h3>
464
- <div class="inside">
465
- <?php
466
- }
467
- //Start the options
468
- foreach ( $section_value['items'] as $item => $item_value ) {
469
-
470
- if ( 'checkbox' == $item_value['type'] ) { ?>
471
- <div class="onoffswitch-wrapper">
472
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
473
- <span class="tooltip-right"
474
- data-tooltip="<?php echo $item_value['tooltip']; ?>">
475
- <i class="dashicons dashicons-editor-help"></i>
476
- </span>
477
- <?php } ?>
478
- <span class="chekbox-title"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></span>
479
-
480
- <div class="onoffswitch">
481
- <div class="epsilon-toggle">
482
- <input class="epsilon-toggle__input" type="checkbox" id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" value="1" <?php checked( 1, isset( $sbp_options[ $item ] ) ); ?> >
483
- <div class="epsilon-toggle__items">
484
- <span class="epsilon-toggle__track"></span>
485
- <span class="epsilon-toggle__thumb"></span>
486
- <svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 6 6">
487
- <path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
488
- </svg>
489
- <svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 2 6">
490
- <path d="M0 0h2v6H0z"></path>
491
- </svg>
492
- </div>
493
- </div>
494
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"></label>
495
- </div>
496
- </div>
497
- <?php }
498
- if ( 'select' == $item_value['type'] ) { ?>
499
- <p>
500
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
501
- <span class="tooltip-right"
502
- data-tooltip="<?php echo $item_value['tooltip']; ?>">
503
- <i class="dashicons dashicons-editor-help"></i>
504
- </span>
505
- <?php } ?>
506
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
507
- <select id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
508
- name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>">
509
- <?php
510
- foreach ( $item_value['options'] as $option_k => $op_v ) {
511
- ?>
512
- <option value="<?php echo $option_k; ?>" <?php selected( $option_k, $sbp_options[ $item ], true ); ?> ><?php echo $op_v; ?></option>
513
- <?php
514
- }
515
- ?>
516
- </select>
517
- </p>
518
- <?php }
519
-
520
- if ( 'text' == $item_value['type'] ) { ?>
521
- <p>
522
- <?php
523
- $default_value = ( isset( $item_value['default'] ) ) ? $item_value['default'] : "";
524
- if ( isset( $item_value['options_group'] ) ) {
525
- $op_text = ( isset( $sbp_options[ $item ] ) && "" != $sbp_options[ $item ] ) ? $sbp_options[ $item ] : $default_value;
526
- } else {
527
- $op_text = ( get_option( $item ) ) ? get_option( $item ) : $default_value;
528
- }
529
-
530
- ?>
531
- <?php if ( isset( $item_value['tooltip'] ) ) { ?>
532
- <span class="tooltip-right"
533
- data-tooltip="<?php echo $item_value['tooltip']; ?>">
534
- <i class="dashicons dashicons-editor-help"></i>
535
- </span>
536
- <?php } ?>
537
- <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
538
-
539
- <input id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
540
- name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" type="text" value="<?php echo esc_attr( $op_text ); ?>" />
541
- </p>
542
- <?php }
543
-
544
- if ( 'textarea' == $item_value['type'] ) { ?>
545
- <div class="td-border-last"></div>
546
- <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
547
- <p>
548
- <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
549
- id="<?php echo $item; ?>"
550
- value="<?php echo esc_attr( $css_exceptions ); ?>"><?php echo wp_kses_post( $css_exceptions ); ?></textarea>
551
- </p>
552
- <p class="description">
553
- <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
554
- </p>
555
- <?php }
556
-
557
- if ( 'guidance' == $item_value['type'] ) {
558
- //guidance for General options
559
- if ( $item == 'guidance_options_css' ) {
560
- ?>
561
- <div class="td-border-last"></div>
562
-
563
- <p>
564
- <h4><?php $item_value['label']; ?></h4>
565
- </p>
566
-
567
- <div class="sbp-all-enqueued">
568
-
569
- <div class="sbp-div-head">
570
- <div class="sbp-title-scripts"><?php _e( 'CSS Handle', 'speed-booster-pack' ); ?></div>
571
- </div>
572
-
573
- <div class="sbp-inline-wrap">
574
- <div class="sbp-columns1 sbp-width">
575
- <?php print_r( get_option( 'all_theme_styles_handle' ) ); ?>
576
- </div>
577
- </div>
578
- </div>
579
- <?php
580
- }
581
- if ( 'guidance_options_js' == $item ) {
582
- ?>
583
- <div class="td-border-last"></div>
584
- <h4><?php echo $item_value['label']; ?></h4>
585
- <div class="sbp-all-enqueued">
586
- <div class="sbp-div-head">
587
- <div class="sbp-title-scripts"><?php _e( 'Script Handle', 'speed-booster-pack' ); ?></div>
588
- <div class="sbp-title-scripts"><?php _e( 'Script Path', 'speed-booster-pack' ); ?></div>
589
- </div>
590
- <div class="sbp-inline-wrap">
591
-
592
- <div class="sbp-columns1 sbp-width">
593
- <?php
594
- $all_script_handles = get_option( 'all_theme_scripts_handle' );
595
-
596
- $all_script_handles = explode( '<br />', $all_script_handles );
597
-
598
- foreach ( $all_script_handles as $key => $value ) {
599
- if ( ! empty( $value ) ) {
600
- echo '<p>' . esc_html( $value ) . '</p>';
601
- }
602
- }
603
- ?>
604
- </div>
605
-
606
- <div class="sbp-columns2 sbp-width">
607
- <?php
608
- $all_scripts_src = get_option( 'all_theme_scripts_src' );
609
-
610
- $all_scripts_src = explode( '<br />', $all_scripts_src );
611
-
612
- foreach ( $all_scripts_src as $key => $value ) {
613
- if ( ! empty( $value ) ) {
614
- $value = parse_url( $value );
615
- echo '<p>' . esc_html( str_replace( '/wp-content', '', $value['path'] ) ) . '</p>';
616
- }
617
-
618
- }
619
- ?>
620
- </div>
621
- </div>
622
- </div>
623
- <?php
624
- }
625
- if ( isset( $item_value['description_only'] ) && $item_value['description_only'] ) {
626
- ?>
627
- <p class="description"><?php echo $item_value['description']; ?></p>
628
- <?php
629
- }
630
-
631
- }
632
-
633
- }
634
- if ( 'advanced-options' == $k ) {
635
- ?> </div>
636
- </div>
637
- </div>
638
- <?php }
639
- }
640
- ?>
641
- </div><!-- Advanced Options sections || Sections For General Options -->
642
- </div> <!-- Tab sections -->
643
- <?php } ?>
644
-
645
- <div id="optimize-more" class="sb-pack-tab">
646
- <div class="feature-section three-col">
647
-
648
- <div class="col sbp-box">
649
- <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/optimocha.png" alt="Optimocha Speed Optimization Service" />
650
- <div class="sbp-box__name"><?php esc_html_e( 'Optimocha', 'speed-booster-pack' ); ?></div>
651
- <div class="sbp-box__description">
652
- <?php esc_html_e( 'A tailored speed optimization service for WordPress websites. Also the developer and the maintainer of Speed Booster Pack. ', 'speed-booster-pack' ); ?>
653
- </div>
654
-
655
- <div class="sbp-box__action-bar">
656
- <span class="sbp-box__action-button">
657
- <a class="button button-primary" href="<?php echo esc_url( 'https://optimocha.com' ); ?>" target="_blank"><?php esc_html_e( 'Speed Up Your Website', 'speed-booster-pack' ); ?></a>
658
- </span>
659
- </div>
660
- </div>
661
-
662
-
663
- <div class="col sbp-box">
664
- <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/shortpixel.png" alt="ShortPixel Image Optimizer" />
665
- <div class="sbp-box__name"><?php esc_html_e( 'ShortPixel Image Optimizer', 'speed-booster-pack' ); ?></div>
666
-
667
- <div class="sbp-box__description">
668
- <?php esc_html_e( 'Optimized images help your site load faster, especially in the new WebP format. Get ShortPixel to gain more speed!', 'speed-booster-pack' ); ?>
669
- </div>
670
-
671
- <div class="sbp-box__action-bar">
672
- <span class="sbp-box__action-button">
673
- <a class="button" href="<?php echo esc_url( 'https://optimocha.com/go/shortpixel' ); ?>" target="_blank"><?php esc_html_e( 'Optimize Your Images', 'speed-booster-pack' ); ?></a>
674
- </span>
675
- </div>
676
- </div>
677
-
678
-
679
- <div class="col sbp-box">
680
- <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/wp-engine.png" alt="WP Engine Hosting" />
681
- <div class="sbp-box__name"><?php esc_html_e( 'WP engine', 'speed-booster-pack' ); ?></div>
682
-
683
- <div class="sbp-box__description">
684
- <?php esc_html_e( 'Easily one of the best WordPress hosting companies out there. Get 2 (or more!) months for free with an annual payment.', 'speed-booster-pack' ); ?>
685
- </div>
686
-
687
- <div class="sbp-box__action-bar">
688
- <span class="sbp-box__action-button">
689
- <a class="button" href="<?php echo esc_url( 'https://optimocha.com/go/wpengine' ); ?>" target="_blank"><?php esc_html_e( 'Get Better Hosting', 'speed-booster-pack' ); ?></a>
690
- </span>
691
- </div>
692
- </div>
693
-
694
- </div>
695
- </div><!--#optimize-more-->
696
-
697
- <div>
698
- <hr />
699
- <?php submit_button( '', 'button button-primary button-hero' ); ?>
700
- </div>
701
-
702
- </form>
703
-
704
- </div><!--/.sb-pack-->
705
- </div> <!-- end wrap div -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // handle closed postboxes
4
+ $user_id = get_current_user_id();
5
+ $option_name = 'closedpostboxes_' . 'toplevel_page_sbp-options'; // use the "pagehook" ID
6
+ $option_arr = get_user_option( $option_name, $user_id ); // get the options for that page
7
+
8
+
9
+ if ( is_array( $option_arr ) && in_array( 'exclude-from-footer', $option_arr ) ) {
10
+ $closed = true;
11
+ }
12
+
13
+
14
+ if ( is_array( $option_arr ) && in_array( 'defer-from-footer', $option_arr ) ) {
15
+ $closed_defer = true;
16
+ }
17
+
18
+ ?>
19
+
20
+ <div class="wrap about-wrap">
21
+ <div class="sb-pack">
22
+
23
+ <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
24
+
25
+ <div class="about-text">
26
+
27
+ <?php
28
+ /* Translators: Welcome Screen Description. */
29
+ echo esc_html__( 'Speed Booster Pack is a lightweight, frequently updated, easy to use and well supported plugin which helps you speed up your website. People abandon pages that take more than a few seconds to load, which means slow pages lose you visitors (and money). You don’t want that to happen, do you?', 'speed-booster-pack' );
30
+ ?>
31
+ </div>
32
+ <div class="wp-badge sbp-welcome-logo"></div>
33
+
34
+ <h2 class="nav-tab-wrapper wp-clearfix">
35
+ <a class="nav-tab" href="#general-options"><?php esc_html_e( 'General', 'speed-booster-pack' ); ?></a>
36
+ <a class="nav-tab" href="#advanced-options"><?php esc_html_e( 'Advanced', 'speed-booster-pack' ); ?></a>
37
+ <a class="nav-tab" href="#cdn-options"><?php esc_html_e( 'CDN', 'speed-booster-pack' ); ?></a>
38
+ <a class="nav-tab" href="#google-analytics"><?php esc_html_e( 'Google Analytics', 'speed-booster-pack' ); ?></a>
39
+ <a class="nav-tab" href="#optimize-more"><?php esc_html_e( 'Optimize More', 'speed-booster-pack' ); ?></a>
40
+ </h2>
41
+
42
+ <div class="sbp-static-notice">
43
+ <?php _e( '<a href="https://optimocha.com/?ref=sbp" target="_blank" style="text-decoration:none">If you’re ready to <em>invest</em> in speeding up your website, <strong>click here</strong> to reach out to us for our professional, tailored speed optimization services!</a>', 'speed-booster-pack' )?>
44
+ </div>
45
+
46
+ <form method="post" action="options.php">
47
+
48
+ <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
49
+ <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
50
+ <?php settings_fields( 'speed_booster_settings_group' ); ?>
51
+
52
+ <?php
53
+
54
+ $sbp_options_array = array(
55
+ //general options panel
56
+ 'general-options' => array(
57
+ //General section
58
+ 'sections' => array(
59
+ array(
60
+ 'type' => 'section',
61
+ 'label' => __( 'General', 'speed-booster-pack' ),
62
+ 'items' => array(
63
+ 'jquery_to_footer' => array(
64
+ 'type' => 'checkbox',
65
+ 'label' => __( 'Move scripts to footer', 'speed-booster-pack' ),
66
+ 'tooltip' => __( 'This option move all scripts to the footer while keeping stylesheets in the header to improve page loading speed and get a higher score on the major speed testing sites such as GTmetrix or other website speed testing tools', 'speed-booster-pack' ),
67
+ 'options_group' => 'sbp_settings',
68
+ ),
69
+ 'use_google_libs' => array(
70
+ 'type' => 'checkbox',
71
+ 'label' => __( 'Load JS from Google Libraries', 'speed-booster-pack' ),
72
+ 'tooltip' => __( 'Loading WordPress javascript files from Google’s Libraries rather than serving it from your WordPress install directly, will reduce latency, increase parallelism and improve caching.', 'speed-booster-pack' ),
73
+ 'options_group' => 'sbp_settings',
74
+ ),
75
+ 'minify_html_js' => array(
76
+ 'type' => 'checkbox',
77
+ 'label' => __( 'Minify HTML', 'speed-booster-pack' ),
78
+ 'tooltip' => __( 'Activate this option only if you don’t want to use other minify plugins or other speed optimization plugin that has minify option included. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
79
+ 'options_group' => 'sbp_settings',
80
+ ),
81
+ 'enable_instant_page' => array(
82
+ 'type' => 'checkbox',
83
+ 'label' => __( 'Enable instant.page (BETA)', 'speed-booster-pack' ),
84
+ 'tooltip' => __( 'Check this option if you want to use the instant.page link preloader. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
85
+ 'options_group' => 'sbp_settings',
86
+ ),
87
+ 'disable_cart_fragments' => array(
88
+ 'type' => 'checkbox',
89
+ 'label' => __( 'Disable cart fragments (BETA)', 'speed-booster-pack' ),
90
+ 'tooltip' => __( 'Check this option to disable WooCommerce&#39;s &quot;cart fragments&quot; script, which overrides all caching function to update cart totals on each page load in your theme header. This is a new and experimental feature; use with caution. If something goes wrong, simply uncheck this option and save the settings.', 'speed-booster-pack' ),
91
+ 'options_group' => 'sbp_settings',
92
+ ),
93
+ 'defer_parsing' => array(
94
+ 'type' => 'checkbox',
95
+ 'label' => __( 'Defer parsing of JS files', 'speed-booster-pack' ),
96
+ 'tooltip' => __( '!!!Note: This will be disabled IF Move Scripts to Footer is enabled. By deferring parsing of unneeded JavaScript until it needs to be executed, you can reduce the initial load time of your page. Please note that this option will not defer the main WordPress jQuery script if Load JS from Google Libraries option is not checked.', 'speed-booster-pack' ),
97
+ 'options_group' => 'sbp_settings',
98
+ ),
99
+ 'query_strings' => array(
100
+ 'type' => 'checkbox',
101
+ 'label' => __( 'Remove query strings', 'speed-booster-pack' ),
102
+ 'tooltip' => __( 'Since most proxies do not cache resources with a ? in their URL, this option allows you to remove any query strings (version numbers) from static resources like CSS & JS files, thus improving your speed scores in services like GTmetrix, PageSpeed, YSlow and Pingdoom.', 'speed-booster-pack' ),
103
+ 'options_group' => 'sbp_settings',
104
+ ),
105
+ 'font_awesome' => array(
106
+ 'type' => 'checkbox',
107
+ 'label' => __( 'Remove extra Font Awesome styles', 'speed-booster-pack' ),
108
+ 'tooltip' => __( 'Use this option only if your theme uses Font Awesome, to prevent other plugins that uses Font Awesome, to add their stylesheets to your theme. In other words, this option removes extra Font Awesome stylesheets added to your theme by certain plugins.', 'speed-booster-pack' ),
109
+ 'options_group' => 'sbp_settings',
110
+ ),
111
+ ),
112
+ ),
113
+ //more settings section
114
+ array(
115
+ 'type' => 'section',
116
+ 'label' => __( 'More settings', 'speed-booster-pack' ),
117
+ 'items' => array(
118
+ 'remove_emojis' => array(
119
+ 'type' => 'checkbox',
120
+ 'label' => __( 'Remove WordPress Emoji scripts', 'speed-booster-pack' ),
121
+ 'tooltip' => __( 'Emojis are fun and all, but if you are aren’t using them they actually load a JavaScript file (wp-emoji-release.min.js) on every page of your website. For a lot of businesses, this is not needed and simply adds load time to your site. So we recommend disabling this.', 'speed-booster-pack' ),
122
+ 'options_group' => 'sbp_settings',
123
+ ),
124
+ 'remove_wsl' => array(
125
+ 'type' => 'checkbox',
126
+ 'label' => __( 'Remove WordPress Shortlink', 'speed-booster-pack' ),
127
+ 'tooltip' => __( 'WordPress URL shortening is sometimes useful, but it automatically adds an ugly code in your header, so you can remove it.', 'speed-booster-pack' ),
128
+ 'options_group' => 'sbp_settings',
129
+ ),
130
+ 'remove_adjacent' => array(
131
+ 'type' => 'checkbox',
132
+ 'label' => __( 'Remove Adjacent Posts Links', 'speed-booster-pack' ),
133
+ 'tooltip' => __( 'WordPress incorrectly implements this feature that supposedly should fix a pagination issues but it messes up, so there is no reason to keep these around. However, some browsers may use Adjacent Posts Links to navigate your site, although you can remove it if you run a well designed theme.', 'speed-booster-pack' ),
134
+ 'options_group' => 'sbp_settings',
135
+ ),
136
+ 'wml_link' => array(
137
+ 'type' => 'checkbox',
138
+ 'label' => __( 'Remove Windows Live Writer Manifest', 'speed-booster-pack' ),
139
+ 'tooltip' => __( 'Windows Live Writer (WLW) is a Microsoft application for composing and managing blog posts offline and publish them later. If you are not using Windows Live Writer application, you can remove it from the WP head.', 'speed-booster-pack' ),
140
+ 'options_group' => 'sbp_settings',
141
+ ),
142
+ 'wp_generator' => array(
143
+ 'type' => 'checkbox',
144
+ 'label' => __( 'Remove WordPress Version', 'speed-booster-pack' ),
145
+ 'tooltip' => __( 'Windows Live Writer (WLW) is a Microsoft application for composing and managing blog posts offline and publish them later. If you are not using Windows Live Writer application, you can remove it from the WP head.', 'speed-booster-pack' ),
146
+ 'options_group' => 'sbp_settings',
147
+ ),
148
+ 'remove_all_feeds' => array(
149
+ 'type' => 'checkbox',
150
+ 'label' => __( 'Remove all RSS feed links', 'speed-booster-pack' ),
151
+ 'tooltip' => __( 'This option will remove all RSS feed links to cleanup your WordPress header. It is also useful on Unicorn – The W3C Markup Validation Service to get rid out the “feed does not validate” error.', 'speed-booster-pack' ),
152
+ 'options_group' => 'sbp_settings',
153
+ ),
154
+ 'disable_xmlrpc' => array(
155
+ 'type' => 'checkbox',
156
+ 'label' => __( 'Disable XML-RPC', 'speed-booster-pack' ),
157
+ 'tooltip' => __( 'XML-RPC was added in WordPress 3.5 and allows for remote connections, and unless you are using your mobile device to post to WordPress it does more bad than good. In fact, it can open your site up to a bunch of security risks. There are a few plugins that utilize this such as JetPack, but we don’t recommend using JetPack for performance reasons.', 'speed-booster-pack' ),
158
+ 'options_group' => 'sbp_settings',
159
+ ),
160
+ 'disable_self_pingbacks' => array(
161
+ 'type' => 'checkbox',
162
+ 'label' => __( 'Disable Self Pingbacks', 'speed-booster-pack' ),
163
+ 'tooltip' => __( 'A pingback is a special type of comment that’s created when you link to another blog post, as long as the other blog is set to accept pingbacks.', 'speed-booster-pack' ),
164
+ 'options_group' => 'sbp_settings',
165
+ ),
166
+ 'disable_dashicons' => array(
167
+ 'type' => 'checkbox',
168
+ 'label' => __( 'Remove Dashicons', 'speed-booster-pack' ),
169
+ 'tooltip' => __( 'Remove Dashicons from front end.', 'speed-booster-pack' ),
170
+ 'options_group' => 'sbp_settings',
171
+ ),
172
+ 'disable_google_maps' => array(
173
+ 'type' => 'checkbox',
174
+ 'label' => __( 'Remove Google Maps', 'speed-booster-pack' ),
175
+ 'tooltip' => __( 'Remove Google Maps from front end. ', 'speed-booster-pack' ),
176
+ 'options_group' => 'sbp_settings',
177
+ ),
178
+ 'disable_heartbeat' => array(
179
+ 'type' => 'checkbox',
180
+ 'label' => __( 'Disable Heartbeat', 'speed-booster-pack' ),
181
+ 'tooltip' => __( 'Disable heartbeat everywhere ( used for autosaving and revision tracking ).', 'speed-booster-pack' ),
182
+ 'options_group' => 'sbp_settings',
183
+ ),
184
+ 'heartbeat_frequency' => array(
185
+ 'type' => 'select',
186
+ 'label' => __( 'Heartbeat frequency', 'speed-booster-pack' ),
187
+ 'tooltip' => __( 'Controls how often the WordPress Heartbeat API is allowed to run. ', 'speed-booster-pack' ),
188
+ 'options' => array(
189
+ '15' => '15',
190
+ '30' => '30',
191
+ '45' => '45',
192
+ '60' => '60',
193
+ ),
194
+ 'options_group' => 'sbp_settings',
195
+ ),
196
+ 'limit_post_revisions' => array(
197
+ 'type' => 'select',
198
+ 'label' => __( 'Limit Post Revisions', 'speed-booster-pack' ),
199
+ 'tooltip' => __( 'Controls how many revisions WordPress will save ', 'speed-booster-pack' ),
200
+ 'options' => array(
201
+ '1' => '1',
202
+ '2' => '2',
203
+ '3' => '3',
204
+ '4' => '4',
205
+ '5' => '5',
206
+ '10' => '10',
207
+ '15' => '15',
208
+ '20' => '20',
209
+ '25' => '25',
210
+ '30' => '30',
211
+ 'false' => 'Disable',
212
+ ),
213
+ 'options_group' => 'sbp_settings',
214
+ ),
215
+ 'autosave_interval' => array(
216
+ 'type' => 'select',
217
+ 'label' => __( 'Autosave interval', 'speed-booster-pack' ),
218
+ 'tooltip' => __( 'Controls how WordPress will autosave posts and pages while editing.', 'speed-booster-pack' ),
219
+ 'options' => array(
220
+ '1' => __( '1 minute', 'speed-booster-pack' ),
221
+ '2' => __( '2 minutes', 'speed-booster-pack' ),
222
+ '3' => __( '3 minutes', 'speed-booster-pack' ),
223
+ '4' => __( '4 minutes', 'speed-booster-pack' ),
224
+ '5' => __( '5 minutes', 'speed-booster-pack' ),
225
+ ),
226
+ 'options_group' => 'sbp_settings',
227
+ ),
228
+ 'remove_rest_api_links' => array(
229
+ 'type' => 'checkbox',
230
+ 'label' => __( 'Remove REST API Links', 'speed-booster-pack' ),
231
+ 'tooltip' => __( 'The WordPress REST API provides API endpoints for WordPress data types that allow developers to interact with sites remotely by sending and receiving JSON (JavaScript Object Notation) objects.', 'speed-booster-pack' ),
232
+ 'options_group' => 'sbp_settings',
233
+ ),
234
+ ),
235
+ ),
236
+ //need even more speed section
237
+ array(
238
+ 'type' => 'section',
239
+ 'label' => __( 'Need even more speed?', 'speed-booster-pack' ),
240
+ 'items' => array(
241
+ 'sbp_css_async' => array(
242
+ 'type' => 'checkbox',
243
+ 'label' => __( 'Inline all CSS', 'speed-booster-pack' ),
244
+ 'tooltip' => __( 'Checking this option will inline the contents of all your stylesheets. This helps with the annoying render blocking error Google Page Speed Insights displays.', 'speed-booster-pack' ),
245
+ 'options_group' => 'sbp_settings',
246
+ ),
247
+ 'sbp_css_minify' => array(
248
+ 'type' => 'checkbox',
249
+ 'label' => __( 'Minify all (previously) inlined CSS', 'speed-booster-pack' ),
250
+ 'tooltip' => __( 'Minifying all inlined CSS styles will optimize the CSS delivery and will eliminate the annoying message on Google Page Speed regarding to render-blocking css.', 'speed-booster-pack' ),
251
+ 'options_group' => 'sbp_settings',
252
+ ),
253
+ 'sbp_footer_css' => array(
254
+ 'type' => 'checkbox',
255
+ 'label' => __( 'Move all inlined CSS into the footer', 'speed-booster-pack' ),
256
+ 'tooltip' => __( 'Inserting all CSS styles inline to the footer is a sensitive option that will eliminate render-blocking CSS warning in Google Page Speed test. If there is something broken after activation, you need to disable this option. Please note that before enabling this sensitive option, it is strongly recommended that you also enable the “ Move scripts to the footer” option.', 'speed-booster-pack' ),
257
+ 'options_group' => 'sbp_settings',
258
+ ),
259
+ 'sbp_is_mobile' => array(
260
+ 'type' => 'checkbox',
261
+ 'label' => __( 'Disable all above CSS options on mobile devices', 'speed-booster-pack' ),
262
+ 'tooltip' => __( 'Disable all above CSS options on mobile devices: this option was added to avoid some appearance issues on mobile devices.', 'speed-booster-pack' ),
263
+ 'options_group' => 'sbp_settings',
264
+ ),
265
+ ),
266
+ ),
267
+ //other options section
268
+ array(
269
+ 'type' => 'section',
270
+ 'items' => array(
271
+ 'sbp_css_exceptions' => array(
272
+ 'type' => 'textarea',
273
+ 'label' => __( 'Exclude styles from being inlined and/or minified option: ', 'speed-booster-pack' ),
274
+ 'description' => __( 'Enter one by line, the handles of CSS files or the final part of the style URL.', 'speed-booster-pack' ),
275
+ ),
276
+ //CSS handle guidance
277
+ 'guidance_options_css' => array(
278
+ 'type' => 'guidance',
279
+ 'label' => __( 'As a guidance, here is a list of CSS handles of each enqueued style detected by our plugin:', 'speed-booster-pack' ),
280
+ ),
281
+ ),
282
+ ),
283
+ ),
284
+ ),
285
+ //advanced options panel
286
+ 'advanced-options' => array(
287
+ //Exclude scripts fro being moved to the footer
288
+ 'sections' => array(
289
+ array(
290
+ 'type' => 'section',
291
+ 'label' => __( 'Exclude scripts from being moved to the footer', 'speed-booster-pack' ),
292
+ 'description' => __( 'Enter one JS handle per text field. Read more <a href="https://optimocha.com/speed-booster-pack-documentation/#exclude-scripts-from-being-moved-to-the-footer-50">detailed instructions</a> on this option on plugin documentation.', 'speed-booster-pack' ),
293
+ 'items' => array(
294
+ 'sbp_js_footer_exceptions1' => array(
295
+ 'type' => 'text',
296
+ ),
297
+ 'sbp_js_footer_exceptions2' => array(
298
+ 'type' => 'text',
299
+ ),
300
+ 'sbp_js_footer_exceptions3' => array(
301
+ 'type' => 'text',
302
+ ),
303
+ 'sbp_js_footer_exceptions4' => array(
304
+ 'type' => 'text',
305
+ ),
306
+ //guidance
307
+ 'guidance_options_js' => array(
308
+ 'type' => 'guidance',
309
+ 'label' => __( 'As a guidance, here is a list of script handles and script paths of each enqueued script detected by our plugin:', 'speed-booster-pack' ),
310
+ ),
311
+ ),
312
+ ),
313
+ //Exclude scripts from being deferred
314
+ array(
315
+ 'type' => 'section',
316
+ 'label' => __( 'Exclude scripts from being deferred', 'speed-booster-pack' ),
317
+ 'items' => array(
318
+ 'sbp_defer_exceptions1' => array(
319
+ 'type' => 'text',
320
+ ),
321
+ 'sbp_defer_exceptions2' => array(
322
+ 'type' => 'text',
323
+ ),
324
+ 'sbp_defer_exceptions3' => array(
325
+ 'type' => 'text',
326
+ ),
327
+ 'sbp_defer_exceptions4' => array(
328
+ 'type' => 'text',
329
+ ),
330
+ 'info' => array(
331
+ 'type' => 'guidance',
332
+ 'description_only' => true,
333
+ 'description' => __( 'Enter one by text field, the handle part of the JS files that you want to be excluded from defer parsing option. For example: <code>jquery-core</code> If you want to exclude more than 4 scripts, you can use the following filter: <code>sbp_exclude_defer_scripts</code> which takes an array of script handles as params. If you don\'t know how to handle this, feel free to post on our support forums.', 'speed-booster-pack' ),
334
+ ),
335
+ ),
336
+ ),
337
+ ),
338
+ ),
339
+ 'cdn-options' => array(
340
+ 'sections' => array(
341
+ array(
342
+ 'type' => 'section',
343
+ 'label' => __( 'CDN', 'speed-booster-pack' ),
344
+ 'description' => __( 'CDN options that allow you to rewrite your site URLs with your CDN URLs.', 'speed-booster-pack' ),
345
+ 'items' => array(
346
+ 'sbp_enable_cdn' => array(
347
+ 'type' => 'checkbox',
348
+ 'label' => __( 'Enable CDN Rewrite', 'speed-booster-pack' ),
349
+ 'tooltip' => __( 'Enables rewriting of your site URLs with your CDN URLs', 'speed-booster-pack' ),
350
+ 'options_group' => 'sbp_settings',
351
+ ),
352
+ 'sbp_cdn_url' => array(
353
+ 'type' => 'text',
354
+ 'label' => __( 'CDN URL', 'speed-booster-pack' ),
355
+ 'tooltip' => __( 'Enter your CDN URL without the trailing slash. Example: https://cdn.example.com', 'speed-booster-pack' ),
356
+ 'options_group' => 'sbp_settings',
357
+ ),
358
+ 'sbp_cdn_included_directories' => array(
359
+ 'type' => 'text',
360
+ 'label' => __( 'Included Directories', 'speed-booster-pack' ),
361
+ 'tooltip' => __( 'Enter any directories you would like to be included in CDN rewriting, separated by commas (,). Default: wp-content,wp-includes', 'speed-booster-pack' ),
362
+ 'options_group' => 'sbp_settings',
363
+ 'default' => 'wp-content,wp-includes',
364
+ ),
365
+ 'sbp_cdn_exclusions' => array(
366
+ 'type' => 'text',
367
+ 'label' => __( 'CDN Exclusions', 'speed-booster-pack' ),
368
+ 'tooltip' => __( 'Enter any directories or file extensions you would like to be excluded from CDN rewriting, separated by commas (,). Default: .php', 'speed-booster-pack' ),
369
+ 'options_group' => 'sbp_settings',
370
+ 'default' => '.php',
371
+ ),
372
+ ),
373
+ ),
374
+ ),
375
+ ),
376
+ 'google-analytics' => array(
377
+ 'sections' => array(
378
+ array(
379
+ 'type' => 'section',
380
+ 'label' => __( 'Google Analytics', 'speed-booster-pack' ),
381
+ 'description' => __( 'Optimization options for Google Analytics.', 'speed-booster-pack' ),
382
+ 'items' => array(
383
+ 'sbp_enable_local_analytics' => array(
384
+ 'type' => 'checkbox',
385
+ 'label' => __( 'Enable Local Analytics', 'speed-booster-pack' ),
386
+ 'tooltip' => __( 'Enable syncing of the Google Analytics script to your own server.', 'speed-booster-pack' ),
387
+ 'options_group' => 'sbp_settings',
388
+ ),
389
+ 'sbp_ga_tracking_id' => array(
390
+ 'type' => 'text',
391
+ 'label' => __( 'Tracking ID', 'speed-booster-pack' ),
392
+ 'tooltip' => __( 'Enter your Google Analytics tracking ID', 'speed-booster-pack' ),
393
+ 'options_group' => 'sbp_settings',
394
+ ),
395
+ 'sbp_tracking_position' => array(
396
+ 'type' => 'select',
397
+ 'label' => __( 'Tracking code position', 'speed-booster-pack' ),
398
+ 'tooltip' => __( 'Load your GA script in the header or footer of the site. Default - header', 'speed-booster-pack' ),
399
+ 'options_group' => 'sbp_settings',
400
+ 'options' => array(
401
+ 'header' => 'Header (default)',
402
+ 'footer' => 'Footer',
403
+ ),
404
+ ),
405
+ 'sbp_disable_display_features' => array(
406
+ 'type' => 'checkbox',
407
+ 'label' => __( 'Disable Display Features', 'speed-booster-pack' ),
408
+ 'tooltip' => __( 'Disable marketing and advertising which generates a 2nd HTTP request', 'speed-booster-pack' ),
409
+ 'options_group' => 'sbp_settings',
410
+ ),
411
+ 'sbp_anonymize_ip' => array(
412
+ 'type' => 'checkbox',
413
+ 'label' => __( 'Anonymize IP', 'speed-booster-pack' ),
414
+ 'tooltip' => __( 'Shorten visitor IP to comply with privacy restrictions in some countries.', 'speed-booster-pack' ),
415
+ 'options_group' => 'sbp_settings',
416
+ ),
417
+ 'sbp_track_loggedin_admins' => array(
418
+ 'type' => 'checkbox',
419
+ 'label' => __( 'Track Admins', 'speed-booster-pack' ),
420
+ 'tooltip' => __( 'Include logged in WordPress admins in your GA report.', 'speed-booster-pack' ),
421
+ 'options_group' => 'sbp_settings',
422
+ ),
423
+ 'sbp_bounce_rate' => array(
424
+ 'type' => 'text',
425
+ 'label' => __( 'Adjust Bounce Rate', 'speed-booster-pack' ),
426
+ 'tooltip' => __( 'Set a timeout limit in seconds to better evaluate the quality of your traffic (1 - 100)', 'speed-booster-pack' ),
427
+ 'options_group' => 'sbp_settings',
428
+ ),
429
+ 'sbp_monsterinsights' => array(
430
+ 'type' => 'checkbox',
431
+ 'label' => __( 'MonsterInsights Integration', 'speed-booster-pack' ),
432
+ 'tooltip' => __( 'Allows MonsterInsights to manage your Google Analytics while still using the locally hosted analytics.js generated by Speed Booster Pack', 'speed-booster-pack' ),
433
+ 'options_group' => 'sbp_settings',
434
+ ),
435
+ ),
436
+ ),
437
+ ),
438
+ ),
439
+ );
440
+
441
+ //Start the tabs
442
+ foreach ( $sbp_options_array as $k => $values ) { ?>
443
+ <!-- Tab sections -->
444
+ <div id="<?php echo $k; ?>" class="sb-pack-tab">
445
+
446
+ <?php
447
+ if ( $k == 'advanced-options' ) {
448
+ ?>
449
+ <!-- Advanced Options sections -->
450
+ <h3><?php _e('Advanced', 'speed-booster-pack'); ?></h3>
451
+ <div id="poststuff">
452
+
453
+ <?php
454
+ } else {
455
+ ?>
456
+ <!-- Sections For General Options -->
457
+ <div class="sb-pack">
458
+ <?php
459
+ if ( isset( $values['label'] ) ) {
460
+ ?>
461
+ <h3><?php echo $values['label']; ?></h3>
462
+ <?php
463
+ }
464
+ }
465
+ //Start the sections
466
+ foreach ( $values['sections'] as $section => $section_value ) {
467
+ if ( 'advanced-options' != $k ) {
468
+ ?>
469
+ <h3><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></h3><?php
470
+ } else {
471
+ ?>
472
+ <div class="meta-box-sortables ui-sortable" id="normal-sortables">
473
+ <div class="postbox" id="<?php echo $section; ?>">
474
+ <button type="button" class="handlediv" aria-expanded="true">
475
+ <span class="screen-reader-text"><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></span>
476
+ <span class="toggle-indicator" aria-hidden="true"></span>
477
+ </button>
478
+ <h3 class="hndle ui-sortable-handle" style="cursor: pointer;">
479
+ <span><?php echo ( isset( $section_value['label'] ) ) ? $section_value['label'] : ""; ?></span>
480
+ </h3>
481
+ <div class="inside">
482
+ <?php
483
+ }
484
+ //Start the options
485
+ foreach ( $section_value['items'] as $item => $item_value ) {
486
+
487
+ if ( 'checkbox' == $item_value['type'] ) { ?>
488
+ <div class="onoffswitch-wrapper">
489
+ <?php if ( isset( $item_value['tooltip'] ) ) { ?>
490
+ <span class="tooltip-right"
491
+ data-tooltip="<?php echo $item_value['tooltip']; ?>">
492
+ <i class="dashicons dashicons-editor-help"></i>
493
+ </span>
494
+ <?php } ?>
495
+ <span class="chekbox-title"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></span>
496
+
497
+ <div class="onoffswitch">
498
+ <div class="epsilon-toggle">
499
+ <input class="epsilon-toggle__input" type="checkbox" id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" value="1" <?php checked( 1, isset( $sbp_options[ $item ] ) ); ?> >
500
+ <div class="epsilon-toggle__items">
501
+ <span class="epsilon-toggle__track"></span>
502
+ <span class="epsilon-toggle__thumb"></span>
503
+ <svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 6 6">
504
+ <path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
505
+ </svg>
506
+ <svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true" role="img" focusable="false" viewBox="0 0 2 6">
507
+ <path d="M0 0h2v6H0z"></path>
508
+ </svg>
509
+ </div>
510
+ </div>
511
+ <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"></label>
512
+ </div>
513
+ </div>
514
+ <?php }
515
+ if ( 'select' == $item_value['type'] ) { ?>
516
+ <p>
517
+ <?php if ( isset( $item_value['tooltip'] ) ) { ?>
518
+ <span class="tooltip-right"
519
+ data-tooltip="<?php echo $item_value['tooltip']; ?>">
520
+ <i class="dashicons dashicons-editor-help"></i>
521
+ </span>
522
+ <?php } ?>
523
+ <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
524
+ <select id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
525
+ name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>">
526
+ <?php
527
+ foreach ( $item_value['options'] as $option_k => $op_v ) {
528
+ ?>
529
+ <option value="<?php echo $option_k; ?>" <?php selected( $option_k, $sbp_options[ $item ], true ); ?> ><?php echo $op_v; ?></option>
530
+ <?php
531
+ }
532
+ ?>
533
+ </select>
534
+ </p>
535
+ <?php }
536
+
537
+ if ( 'text' == $item_value['type'] ) { ?>
538
+ <p>
539
+ <?php
540
+ $default_value = ( isset( $item_value['default'] ) ) ? $item_value['default'] : "";
541
+ if ( isset( $item_value['options_group'] ) ) {
542
+ $op_text = ( isset( $sbp_options[ $item ] ) && "" != $sbp_options[ $item ] ) ? $sbp_options[ $item ] : $default_value;
543
+ } else {
544
+ $op_text = ( get_option( $item ) ) ? get_option( $item ) : $default_value;
545
+ }
546
+
547
+ ?>
548
+ <?php if ( isset( $item_value['tooltip'] ) ) { ?>
549
+ <span class="tooltip-right"
550
+ data-tooltip="<?php echo $item_value['tooltip']; ?>">
551
+ <i class="dashicons dashicons-editor-help"></i>
552
+ </span>
553
+ <?php } ?>
554
+ <label for="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" class="<?php echo ( isset( $item_value['label'] ) ) ? 'label-text' : ''; ?>"><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></label>
555
+
556
+ <input id="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
557
+ name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>" type="text" value="<?php echo esc_attr( $op_text ); ?>" />
558
+ </p>
559
+ <?php }
560
+
561
+ if ( 'textarea' == $item_value['type'] ) { ?>
562
+ <div class="td-border-last"></div>
563
+ <h4><?php echo ( isset( $item_value['label'] ) ) ? $item_value['label'] : ''; ?></h4>
564
+ <p>
565
+ <textarea cols="50" rows="3" name="<?php echo ( isset( $item_value['options_group'] ) ) ? $item_value['options_group'] . '[' . $item . ']' : $item; ?>"
566
+ id="<?php echo $item; ?>"
567
+ value="<?php echo esc_attr( $css_exceptions ); ?>"><?php echo wp_kses_post( $css_exceptions ); ?></textarea>
568
+ </p>
569
+ <p class="description">
570
+ <?php echo isset( $item_value['description'] ) ? $item_value['description'] : ''; ?>
571
+ </p>
572
+ <?php }
573
+
574
+ if ( 'guidance' == $item_value['type'] ) {
575
+ //guidance for General options
576
+ if ( $item == 'guidance_options_css' ) {
577
+ ?>
578
+ <div class="td-border-last"></div>
579
+
580
+ <p>
581
+ <h4><?php $item_value['label']; ?></h4>
582
+ </p>
583
+
584
+ <div class="sbp-all-enqueued">
585
+
586
+ <div class="sbp-div-head">
587
+ <div class="sbp-title-scripts"><?php _e( 'CSS Handle', 'speed-booster-pack' ); ?></div>
588
+ </div>
589
+
590
+ <div class="sbp-inline-wrap">
591
+ <div class="sbp-columns1 sbp-width">
592
+ <?php print_r( get_option( 'all_theme_styles_handle' ) ); ?>
593
+ </div>
594
+ </div>
595
+ </div>
596
+ <?php
597
+ }
598
+ if ( 'guidance_options_js' == $item ) {
599
+ ?>
600
+ <div class="td-border-last"></div>
601
+ <h4><?php echo $item_value['label']; ?></h4>
602
+ <div class="sbp-all-enqueued">
603
+ <div class="sbp-div-head">
604
+ <div class="sbp-title-scripts"><?php _e( 'Script Handle', 'speed-booster-pack' ); ?></div>
605
+ <div class="sbp-title-scripts"><?php _e( 'Script Path', 'speed-booster-pack' ); ?></div>
606
+ </div>
607
+ <div class="sbp-inline-wrap">
608
+
609
+ <div class="sbp-columns1 sbp-width">
610
+ <?php
611
+ $all_script_handles = get_option( 'all_theme_scripts_handle' );
612
+
613
+ $all_script_handles = explode( '<br />', $all_script_handles );
614
+
615
+ foreach ( $all_script_handles as $key => $value ) {
616
+ if ( ! empty( $value ) ) {
617
+ echo '<p>' . esc_html( $value ) . '</p>';
618
+ }
619
+ }
620
+ ?>
621
+ </div>
622
+
623
+ <div class="sbp-columns2 sbp-width">
624
+ <?php
625
+ $all_scripts_src = get_option( 'all_theme_scripts_src' );
626
+
627
+ $all_scripts_src = explode( '<br />', $all_scripts_src );
628
+
629
+ foreach ( $all_scripts_src as $key => $value ) {
630
+ if ( ! empty( $value ) ) {
631
+ $value = parse_url( $value );
632
+ echo '<p>' . esc_html( str_replace( '/wp-content', '', $value['path'] ) ) . '</p>';
633
+ }
634
+
635
+ }
636
+ ?>
637
+ </div>
638
+ </div>
639
+ </div>
640
+ <?php
641
+ }
642
+ if ( isset( $item_value['description_only'] ) && $item_value['description_only'] ) {
643
+ ?>
644
+ <p class="description"><?php echo $item_value['description']; ?></p>
645
+ <?php
646
+ }
647
+
648
+ }
649
+
650
+ }
651
+ if ( 'advanced-options' == $k ) {
652
+ ?> </div>
653
+ </div>
654
+ </div>
655
+ <?php }
656
+ }
657
+ ?>
658
+ </div><!-- Advanced Options sections || Sections For General Options -->
659
+ </div> <!-- Tab sections -->
660
+ <?php } ?>
661
+
662
+ <div id="optimize-more" class="sb-pack-tab">
663
+ <div class="feature-section three-col">
664
+
665
+ <div class="col sbp-box">
666
+ <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/optimocha.png" alt="Optimocha Speed Optimization Service" />
667
+ <div class="sbp-box__name"><?php esc_html_e( 'Optimocha', 'speed-booster-pack' ); ?></div>
668
+ <div class="sbp-box__description">
669
+ <?php esc_html_e( 'A tailored speed optimization service for WordPress websites. Also the developer and the maintainer of Speed Booster Pack. ', 'speed-booster-pack' ); ?>
670
+ </div>
671
+
672
+ <div class="sbp-box__action-bar">
673
+ <span class="sbp-box__action-button">
674
+ <a class="button button-primary" href="<?php echo esc_url( 'https://optimocha.com/?ref=sbp' ); ?>" target="_blank"><?php esc_html_e( 'Speed Up Your Website', 'speed-booster-pack' ); ?></a>
675
+ </span>
676
+ </div>
677
+ </div>
678
+
679
+
680
+ <div class="col sbp-box">
681
+ <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/shortpixel.png" alt="ShortPixel Image Optimizer" />
682
+ <div class="sbp-box__name"><?php esc_html_e( 'ShortPixel Image Optimizer', 'speed-booster-pack' ); ?></div>
683
+
684
+ <div class="sbp-box__description">
685
+ <?php esc_html_e( 'Optimized images help your site load faster, especially in the new WebP format. Get ShortPixel to gain more speed!', 'speed-booster-pack' ); ?>
686
+ </div>
687
+
688
+ <div class="sbp-box__action-bar">
689
+ <span class="sbp-box__action-button">
690
+ <a class="button" href="<?php echo esc_url( 'https://optimocha.com/go/shortpixel' ); ?>" target="_blank"><?php esc_html_e( 'Optimize Your Images', 'speed-booster-pack' ); ?></a>
691
+ </span>
692
+ </div>
693
+ </div>
694
+
695
+
696
+ <div class="col sbp-box">
697
+ <img src="<?php echo SPEED_BOOSTER_PACK_URL ?>inc/images/wp-engine.png" alt="WP Engine Hosting" />
698
+ <div class="sbp-box__name"><?php esc_html_e( 'WP Engine', 'speed-booster-pack' ); ?></div>
699
+
700
+ <div class="sbp-box__description">
701
+ <?php esc_html_e( 'One of the best WordPress hosting companies out there. Get 2 (or more!) months for free with an annual payment.', 'speed-booster-pack' ); ?>
702
+ </div>
703
+
704
+ <div class="sbp-box__action-bar">
705
+ <span class="sbp-box__action-button">
706
+ <a class="button" href="<?php echo esc_url( 'https://optimocha.com/go/wpengine' ); ?>" target="_blank"><?php esc_html_e( 'Get Better Hosting', 'speed-booster-pack' ); ?></a>
707
+ </span>
708
+ </div>
709
+ </div>
710
+
711
+ </div>
712
+ </div><!--#optimize-more-->
713
+
714
+ <div>
715
+ <hr />
716
+ <?php submit_button( '', 'button button-primary button-hero' ); ?>
717
+ </div>
718
+
719
+ </form>
720
+
721
+ </div><!--/.sb-pack-->
722
+ </div> <!-- end wrap div -->
inc/use-google-libraries.php CHANGED
@@ -1,504 +1,504 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'JCP_UseGoogleLibraries' ) ) {
4
-
5
- class JCP_UseGoogleLibraries {
6
-
7
- protected static $instance;
8
- protected static $plugin_file = __FILE__;
9
- protected static $version = '1.6.2.3';
10
- protected static $noconflict_inject = "<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>\n";
11
-
12
- public static function get_instance() {
13
- if ( ! isset( self::$instance ) ) {
14
- self::$instance = new JCP_UseGoogleLibraries();
15
- }
16
- return self::$instance;
17
- }
18
-
19
- /**
20
- * Registry of script replacement rules
21
- *
22
- * Entries are formatted as follows:
23
- * <code>
24
- * 'script-handle' => array(
25
- * 'google-lib-path',
26
- * 'google-file-name',
27
- * 'google-combined-into')
28
- * </code>
29
- *
30
- * - 'script-handle' -- the handle used by WordPress script
31
- * registration
32
- * - 'google-lib-path' -- path to location on Google CDN( empty
33
- * string if script has been combined).
34
- * - 'google-file-name' -- file name (minus .js) on Google CDN (empty
35
- * string if script has been combined).
36
- * - 'google-combined-into' -- If not empty string, then the given
37
- * handle has been combined into a file loaded by this handle.
38
- *
39
- * @var array
40
- */
41
- protected $google_scripts;
42
-
43
- /**
44
- * Used internally to ensure jQuery.noconflict is executed as close to
45
- * how core WordPress would.
46
- *
47
- * @var bool
48
- */
49
- protected $noconflict_next;
50
-
51
- /**
52
- * script id used for actual jquery script
53
- *
54
- * @var string
55
- *
56
- * @since 5.2
57
- */
58
- protected $jquery_tag;
59
-
60
- /**
61
- * True if using a version of WordPress that allows
62
- * `wp_register_script` to take protocol-relative URLs,
63
- * otherwise False
64
- *
65
- * @since 1.5.2
66
- *
67
- * @var bool
68
- */
69
- protected $protocol_relative_supported;
70
-
71
- /**
72
- * transient name used when caching
73
- *
74
- * @var string
75
- */
76
- protected static $cache_id = 'JCP_UseGoogleLibraries_cache';
77
-
78
- /**
79
- * transient expiration
80
- *
81
- * @var int
82
- */
83
- protected static $cache_len = 90000; // 25 hours
84
-
85
- /**
86
- * Message displayed and logged when a WP_Scripts has been created
87
- * before it's time
88
- *
89
- * @var str
90
- */
91
- protected static $script_before_init_notice =
92
- 'Another plugin has registered or enqued a script before the "init" action. Attempting to work around it.';
93
-
94
- /**
95
- * Registry of scripts available from Google Libraries. Any extra
96
- * scripts listed here not provided by WordPress or another plugin
97
- * will not be registered. This list is just used to chancge where
98
- * things load from.
99
- *
100
- * Entries are in the format:
101
- * <code>
102
- * 'script-handle' => array(
103
- * 'google-lib-path',
104
- * 'google-file-name',
105
- * 'google-combined-into'
106
- * )
107
- * </code>
108
- *
109
- * @var array
110
- */
111
- protected static $default_google_scripts = array(
112
- /* jQuery */
113
- 'jquery' => array( 'jquery', 'jquery.min', '' ),
114
-
115
- /* jQuery UI */
116
- 'jquery-ui-core' => array( 'jqueryui', 'jquery-ui.min', '' ),
117
- 'jquery-ui-accordion' => array( '', '', 'jquery-ui-core' ),
118
- 'jquery-ui-autocomplete' => array( '', '', 'jquery-ui-core' ), /* jQueri UI 1.8 */
119
- 'jquery-ui-button' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
120
- 'jquery-ui-datepicker' => array( '', '', 'jquery-ui-core' ),
121
- 'jquery-ui-dialog' => array( '', '', 'jquery-ui-core' ),
122
- 'jquery-ui-draggable' => array( '', '', 'jquery-ui-core' ),
123
- 'jquery-ui-droppable' => array( '', '', 'jquery-ui-core' ),
124
- 'jquery-ui-menu' => array( '', '', 'jquery-ui-core' ),
125
- 'jquery-ui-mouse' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
126
- 'jquery-ui-position' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
127
- 'jquery-ui-progressbar' => array( '', '', 'jquery-ui-core' ),
128
- 'jquery-ui-resizable' => array( '', '', 'jquery-ui-core' ),
129
- 'jquery-ui-selectable' => array( '', '', 'jquery-ui-core' ),
130
- 'jquery-ui-selectmenu' => array( '', '', 'jquery-ui-core' ),/* jQuery UI 1.11 */
131
- 'jquery-ui-slider' => array( '', '', 'jquery-ui-core' ),
132
- 'jquery-ui-sortable' => array( '', '', 'jquery-ui-core' ),
133
- 'jquery-ui-spinner' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
134
- 'jquery-ui-tabs' => array( '', '', 'jquery-ui-core' ),
135
- 'jquery-ui-tooltip' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
136
- 'jquery-ui-widget' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
137
-
138
- /* jQuery Effects */
139
- 'jquery-effects-core' => array( '', '', 'jquery-ui-core' ),
140
- 'jquery-effects-blind' => array( '', '', 'jquery-ui-core' ),
141
- 'jquery-effects-bounce' => array( '', '', 'jquery-ui-core' ),
142
- 'jquery-effects-clip' => array( '', '', 'jquery-ui-core' ),
143
- 'jquery-effects-drop' => array( '', '', 'jquery-ui-core' ),
144
- 'jquery-effects-explode' => array( '', '', 'jquery-ui-core' ),
145
- 'jquery-effects-fade' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
146
- 'jquery-effects-fold' => array( '', '', 'jquery-ui-core' ),
147
- 'jquery-effects-highlight' => array( '', '', 'jquery-ui-core' ),
148
- 'jquery-effects-puff' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
149
- 'jquery-effects-pulsate' => array( '', '', 'jquery-ui-core' ),
150
- 'jquery-effects-scale' => array( '', '', 'jquery-ui-core' ),
151
- 'jquery-effects-shake' => array( '', '', 'jquery-ui-core' ),
152
- 'jquery-effects-size' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
153
- 'jquery-effects-slide' => array( '', '', 'jquery-ui-core' ),
154
- 'jquery-effects-transfer' => array( '', '', 'jquery-ui-core' ),
155
-
156
- /* prototype */
157
- 'prototype' => array( 'prototype', 'prototype', '' ),
158
-
159
- /* scriptaculous */
160
- 'scriptaculous-root' => array( 'scriptaculous', 'scriptaculous', '' ),
161
- 'scriptaculous-builder' => array( '', '', 'scriptaculous-root' ),
162
- 'scriptaculous-effects' => array( '', '', 'scriptaculous-root' ),
163
- 'scriptaculous-dragdrop' => array( '', '', 'scriptaculous-root' ),
164
- 'scriptaculous-controls' => array( '', '', 'scriptaculous-root' ),
165
- 'scriptaculous-slider' => array( '', '', 'scriptaculous-root' ),
166
- 'scriptaculous-sound' => array( '', '', 'scriptaculous-root' ),
167
-
168
- /* moo tools */
169
- 'mootools' => array( 'mootools', 'mootools-yui-compressed', '' ),
170
-
171
- /* Dojo */
172
- 'dojo' => array( 'dojo', 'dojo.xd', '' ),
173
-
174
- /* swfobject */
175
- 'swfobject' => array( 'swfobject', 'swfobject', '' ),
176
-
177
- /* YUI */
178
- 'yui' => array( 'yui', 'build/yuiloader/yuiloader-min', '' ),
179
-
180
- /* Ext Core */
181
- 'ext-core' => array( 'ext-core', 'ext-core', '' )
182
-
183
- );
184
-
185
- /**
186
- * PHP 5 Constructor
187
- */
188
- function __construct() {
189
- $this->jquery_tag = 'jquery';
190
- $this->google_scripts = self::$default_google_scripts;
191
-
192
- $this->noconflict_next = false;
193
- // protocol-relative URLS accepted by `wp_register_scripts`
194
- // starting with version 3.5
195
- $this->protocol_relative_supported = version_compare(
196
- get_bloginfo( 'version' ), '3.5', '>='
197
- );
198
- }
199
-
200
- static function configure_plugin() {
201
-
202
- add_action(
203
- 'wp_default_scripts',
204
- array(
205
- 'JCP_UseGoogleLibraries',
206
- 'replace_default_scripts_action',
207
- ),
208
- 1000
209
- );
210
- add_filter(
211
- 'script_loader_src',
212
- array( 'JCP_UseGoogleLibraries', 'remove_ver_query_filter' ),
213
- 1000
214
- );
215
- add_filter(
216
- 'init',
217
- array( 'JCP_UseGoogleLibraries', 'setup_filter' )
218
- );
219
-
220
- // There's a chance some plugin has called wp_enqueue_script
221
- // outside of any hooks, which means that this plugin's
222
- // 'wp_default_scripts' hook will never get a chance to fire.
223
- // This tries to work around that.
224
- global $wp_scripts;
225
- if ( is_a( $wp_scripts, 'WP_Scripts' ) ) {
226
- self::debug( self::$script_before_init_notice );
227
- $ugl = self::get_instance();
228
- $ugl->replace_default_scripts( $wp_scripts );
229
- }
230
- }
231
-
232
- /**
233
- * Get markup to show error message in admin when $WP_Script
234
- * created before it's time
235
- *
236
- * @returns string markup for notice display
237
- */
238
- static function script_before_init_admin_notice() {
239
- echo '<div class="error fade"><p>Use Google Libraries: ' .
240
- self::$script_before_init_notice . '</p></div>';
241
- }
242
-
243
- static function setup_filter() {
244
- $ugl = self::get_instance();
245
- $ugl->setup();
246
- }
247
-
248
- /**
249
- * Log message if `WP_DEBUG` enabled.
250
- *
251
- * @since 1.5
252
- *
253
- * @param mixed $message string to log, or object to log via `print_r`
254
- */
255
- static function debug( $message ) {
256
- if ( WP_DEBUG !== false ) {
257
- if ( is_array( $message ) || is_object( $message ) ) {
258
- $message = var_export( $message, true );
259
- }
260
- error_log( 'Use Google Libraries: ' . $message );
261
- }
262
- }
263
-
264
- /**
265
- * Disables script concatination, which breaks when dependencies are not
266
- * all loaded locally.
267
- */
268
- function setup() {
269
- global $concatenate_scripts;
270
- $concatenate_scripts = false;
271
-
272
- }
273
-
274
- static function replace_default_scripts_action( &$scripts ) {
275
- $ugl = self::get_instance();
276
- $ugl->replace_default_scripts( $scripts );
277
- }
278
-
279
- /**
280
- * Sometimes WordPress registes `jquery.js` as `'jquery-core'`, while
281
- * '`jquery`' is some other script with a dependency on
282
- * `'jquery-core'`. If '`jquery-core`' in present in `$scripts`
283
- * this is assumed to be the case and update the registration for
284
- * '`jquery-core`' instead.
285
- *
286
- * @since 1.6
287
- *
288
- * @param object $scripts
289
- */
290
- protected function newscripts_fix_jquery_core( &$scripts ) {
291
- // jquery may really be loaded under jquery-core
292
- // if so, we'll adjust google_scripts here
293
- if ( $scripts->query( 'jquery-core' ) && array_key_exists( 'jquery', $this->google_scripts ) ) {
294
- $this->google_scripts['jquery-core'] = $this->google_scripts['jquery'];
295
- unset( $this->google_scripts['jquery'] );
296
- $this->jquery_tag = 'jquery-core';
297
- }
298
- }
299
-
300
- protected function newscripts_build_url( $name, $lib, $ver, $js, $orig_url ) {
301
-
302
- // if $lib is empty, then this script does not need to be
303
- // exlicitly loaded when using googleapis.com, but we need to keep
304
- // it around for dependencies
305
- if ( $lib != '' ) {
306
- // build new URL
307
- $url = "//ajax.googleapis.com/ajax/libs/$lib/$ver/$js.js";
308
- $proto_url = "http:$url";
309
- $head = wp_remote_head( $proto_url );
310
- if ( wp_remote_retrieve_response_code( $head ) !== 200 ) {
311
- self::debug( "Google servers do not seem to be hosting requested version of $name (version $ver). Using version provided by WordPress." );
312
- return $orig_url;
313
- }
314
- if ( ! $this->protocol_relative_supported ) {
315
- return $proto_url;
316
- }
317
- return $url;
318
- } else {
319
- return '';
320
- }
321
- }
322
-
323
- /**
324
- * Collects replacement script registration data.
325
- *
326
- * Processes standard WordPress script registrations against list of
327
- * scripts hosted on Google's CDN. Will exclude any scripts that
328
- * contain '-' in the version number (used by WordPress devs to signify
329
- * a non-standard version). Also, the new url will be queried to ensure
330
- * it's valid (via `wp_remote_head`).
331
- *
332
- * @since 1.5
333
- *
334
- * @param object $scripts WP_Scripts object
335
- * @return array updated script registration data
336
- */
337
- function build_newscripts( &$scripts ) {
338
- $newscripts = array();
339
- $combine_ok = array();
340
-
341
- $this->newscripts_fix_jquery_core( $scripts );
342
-
343
- foreach ( $this->google_scripts as $name => $values ) {
344
- if ( $script = $scripts->query( $name ) ) {
345
- $lib = $values[0];
346
- $js = $values[1];
347
- $combined = $values[2];
348
- // default to requested ver
349
- $ver = $script->ver;
350
-
351
- if ( strpos( $ver, '-' ) !== false ) {
352
- self::debug( "WordPress appears to be requesting a non-standard version of $name (version $ver). Using version provided by WordPress to ensure compatability." );
353
- continue;
354
- }
355
-
356
- // TODO: replace with more flexible option
357
- // quick and dirty work around for scriptaculous 1.8.0
358
- if ( $name == 'scriptaculous-root' && $ver == '1.8.0' ) {
359
- $ver = '1.8';
360
- }
361
-
362
- if ( $combined !== '' ) {
363
- if ( ! in_array( $combined, $combine_ok ) ) {
364
- self::debug( "Google servers not hosting combined library for $name (version $ver). Using version provided by WordPress to ensure compatability." );
365
- continue;
366
- }
367
- if ( ! in_array( $combined, $script->deps ) ) {
368
- // if this script has been combined into another script
369
- // ensure this handle depends on the combined handle
370
- $script->deps[] = $combined;
371
- }
372
- }
373
-
374
- $script->src = $this->newscripts_build_url(
375
- $name, $lib, $ver, $js, $script->src
376
- );
377
-
378
- $newscripts[] = $script;
379
- $combine_ok[] = $name;
380
- }
381
- }
382
- return $newscripts;
383
-
384
- }
385
-
386
-
387
- /**
388
- * Get new script registration data.
389
- *
390
- * Attempts to load script registration data from the transient cache.
391
- * If not in cache, or if cached data is from a different version of
392
- * either WordPress or this plug-in, then it will be rebuilt. Also
393
- * handles forcing URLS to use SSL if site is currently loaded over
394
- * SSL.
395
- *
396
- * @since 1.5
397
- *
398
- * @param object $scripts WP_Scripts object
399
- * @return array updated script registration data
400
- */
401
- function get_newscripts( &$scripts ) {
402
- $wp_ver = get_bloginfo( 'version' );
403
- if ( false === ( $cache = get_transient( self::$cache_id ) ) ) {
404
- $cache = array();
405
- }
406
- if ( ( ! isset( $cache['ugl_ver'] ) ) || ( $cache['ugl_ver'] !== self::$version ) ||
407
- ( ! isset( $cache['wp_ver'] ) ) || ( $cache['wp_ver'] !== $wp_ver ) ||
408
- ( ! isset( $cache['newscripts'] ) ) ) {
409
- $newscripts = $this->build_newscripts( $scripts );
410
- $cache = array(
411
- 'ugl_ver' => self::$version,
412
- 'wp_ver' => $wp_ver,
413
- 'newscripts' => $newscripts,
414
- );
415
- set_transient( self::$cache_id, $cache, self::$cache_len );
416
- } else {
417
- $newscripts = $cache['newscripts'];
418
- }
419
- // need to handle ssl after cache load, because it may swap
420
- // back and forth depending on the site config/usage
421
- if ( ( ! $this->protocol_relative_supported ) && ( is_ssl() ) ) {
422
- foreach ( $newscripts as $script ) {
423
- $script->src = preg_replace( '/^http:/', 'https:', $script->src );
424
- }
425
- }
426
- return $newscripts;
427
- }
428
-
429
- /**
430
- * Replace as many of the WordPress default script registrations as
431
- * possible with ones from Google
432
- *
433
- * @param object $scripts WP_Scripts object.
434
- */
435
- function replace_default_scripts( &$scripts ) {
436
- $newscripts = $this->get_newscripts( $scripts );
437
- foreach ( $newscripts as $script ) {
438
- $olddata = $this->wp_dependency_get_data( $scripts, $script->handle );
439
- $scripts->remove( $script->handle );
440
- // re-register with original ver
441
- $scripts->add( $script->handle, $script->src, $script->deps, $script->ver );
442
- if ( $olddata ) {
443
- foreach ( $olddata as $data_name => $data ) {
444
- $scripts->add_data( $script->handle, $data_name, $data );
445
- }
446
- }
447
- }
448
- }
449
-
450
-
451
- function wp_dependency_get_data( $dep_obj, $handle, $data_name = false ) {
452
-
453
- if ( ! method_exists( $dep_obj, 'add_data' ) ) {
454
- return false;
455
- }
456
-
457
- if ( ! isset( $dep_obj->registered[ $handle ] ) ) {
458
- return false;
459
- }
460
-
461
- if ( ! $data_name ) {
462
- return $dep_obj->registered[ $handle ]->extra;
463
- }
464
-
465
- if ( ! method_exists( $dep_obj, 'get_data' ) ) {
466
- return $dep_obj->registered[ $handle ]->extra[ $data_name ];
467
- }
468
-
469
- return $dep_obj->get_data( $handle, $data_name );
470
- }
471
-
472
-
473
- /**
474
- * Remove 'ver' from query string for scripts loaded from Google's
475
- * CDN
476
- *
477
- * @param string $src src attribute of script tag
478
- * @return string Updated src attribute
479
- */
480
- function remove_ver_query( $src ) {
481
- if ( $this->noconflict_next ) {
482
- $this->noconflict_next = false;
483
- echo self::$noconflict_inject; // xss ok
484
- }
485
- if ( preg_match( '/ajax\.googleapis\.com\//', $src ) ) {
486
- $src = remove_query_arg( 'ver', $src );
487
- if ( strpos( $src, $this->google_scripts[ $this->jquery_tag ][1] . '.js' ) ) {
488
- $this->noconflict_next = true;
489
- }
490
- }
491
- return $src;
492
- }
493
-
494
- static function remove_ver_query_filter( $src ) {
495
- $ugl = self::get_instance();
496
- return $ugl->remove_ver_query( $src );
497
- }
498
- }
499
- }
500
-
501
- //instantiate the class
502
- if ( class_exists( 'JCP_UseGoogleLibraries' ) ) {
503
- JCP_UseGoogleLibraries::configure_plugin();
504
- }
1
+ <?php
2
+
3
+ if ( ! class_exists( 'JCP_UseGoogleLibraries' ) ) {
4
+
5
+ class JCP_UseGoogleLibraries {
6
+
7
+ protected static $instance;
8
+ protected static $plugin_file = __FILE__;
9
+ protected static $version = '1.6.2.3';
10
+ protected static $noconflict_inject = "<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>\n";
11
+
12
+ public static function get_instance() {
13
+ if ( ! isset( self::$instance ) ) {
14
+ self::$instance = new JCP_UseGoogleLibraries();
15
+ }
16
+ return self::$instance;
17
+ }
18
+
19
+ /**
20
+ * Registry of script replacement rules
21
+ *
22
+ * Entries are formatted as follows:
23
+ * <code>
24
+ * 'script-handle' => array(
25
+ * 'google-lib-path',
26
+ * 'google-file-name',
27
+ * 'google-combined-into')
28
+ * </code>
29
+ *
30
+ * - 'script-handle' -- the handle used by WordPress script
31
+ * registration
32
+ * - 'google-lib-path' -- path to location on Google CDN( empty
33
+ * string if script has been combined).
34
+ * - 'google-file-name' -- file name (minus .js) on Google CDN (empty
35
+ * string if script has been combined).
36
+ * - 'google-combined-into' -- If not empty string, then the given
37
+ * handle has been combined into a file loaded by this handle.
38
+ *
39
+ * @var array
40
+ */
41
+ protected $google_scripts;
42
+
43
+ /**
44
+ * Used internally to ensure jQuery.noconflict is executed as close to
45
+ * how core WordPress would.
46
+ *
47
+ * @var bool
48
+ */
49
+ protected $noconflict_next;
50
+
51
+ /**
52
+ * script id used for actual jquery script
53
+ *
54
+ * @var string
55
+ *
56
+ * @since 5.2
57
+ */
58
+ protected $jquery_tag;
59
+
60
+ /**
61
+ * True if using a version of WordPress that allows
62
+ * `wp_register_script` to take protocol-relative URLs,
63
+ * otherwise False
64
+ *
65
+ * @since 1.5.2
66
+ *
67
+ * @var bool
68
+ */
69
+ protected $protocol_relative_supported;
70
+
71
+ /**
72
+ * transient name used when caching
73
+ *
74
+ * @var string
75
+ */
76
+ protected static $cache_id = 'JCP_UseGoogleLibraries_cache';
77
+
78
+ /**
79
+ * transient expiration
80
+ *
81
+ * @var int
82
+ */
83
+ protected static $cache_len = 90000; // 25 hours
84
+
85
+ /**
86
+ * Message displayed and logged when a WP_Scripts has been created
87
+ * before it's time
88
+ *
89
+ * @var str
90
+ */
91
+ protected static $script_before_init_notice =
92
+ 'Another plugin has registered or enqueued a script before the "init" action. Attempting to work around it.';
93
+
94
+ /**
95
+ * Registry of scripts available from Google Libraries. Any extra
96
+ * scripts listed here not provided by WordPress or another plugin
97
+ * will not be registered. This list is just used to chancge where
98
+ * things load from.
99
+ *
100
+ * Entries are in the format:
101
+ * <code>
102
+ * 'script-handle' => array(
103
+ * 'google-lib-path',
104
+ * 'google-file-name',
105
+ * 'google-combined-into'
106
+ * )
107
+ * </code>
108
+ *
109
+ * @var array
110
+ */
111
+ protected static $default_google_scripts = array(
112
+ /* jQuery */
113
+ 'jquery' => array( 'jquery', 'jquery.min', '' ),
114
+
115
+ /* jQuery UI */
116
+ 'jquery-ui-core' => array( 'jqueryui', 'jquery-ui.min', '' ),
117
+ 'jquery-ui-accordion' => array( '', '', 'jquery-ui-core' ),
118
+ 'jquery-ui-autocomplete' => array( '', '', 'jquery-ui-core' ), /* jQueri UI 1.8 */
119
+ 'jquery-ui-button' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
120
+ 'jquery-ui-datepicker' => array( '', '', 'jquery-ui-core' ),
121
+ 'jquery-ui-dialog' => array( '', '', 'jquery-ui-core' ),
122
+ 'jquery-ui-draggable' => array( '', '', 'jquery-ui-core' ),
123
+ 'jquery-ui-droppable' => array( '', '', 'jquery-ui-core' ),
124
+ 'jquery-ui-menu' => array( '', '', 'jquery-ui-core' ),
125
+ 'jquery-ui-mouse' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
126
+ 'jquery-ui-position' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
127
+ 'jquery-ui-progressbar' => array( '', '', 'jquery-ui-core' ),
128
+ 'jquery-ui-resizable' => array( '', '', 'jquery-ui-core' ),
129
+ 'jquery-ui-selectable' => array( '', '', 'jquery-ui-core' ),
130
+ 'jquery-ui-selectmenu' => array( '', '', 'jquery-ui-core' ),/* jQuery UI 1.11 */
131
+ 'jquery-ui-slider' => array( '', '', 'jquery-ui-core' ),
132
+ 'jquery-ui-sortable' => array( '', '', 'jquery-ui-core' ),
133
+ 'jquery-ui-spinner' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
134
+ 'jquery-ui-tabs' => array( '', '', 'jquery-ui-core' ),
135
+ 'jquery-ui-tooltip' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
136
+ 'jquery-ui-widget' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
137
+
138
+ /* jQuery Effects */
139
+ 'jquery-effects-core' => array( '', '', 'jquery-ui-core' ),
140
+ 'jquery-effects-blind' => array( '', '', 'jquery-ui-core' ),
141
+ 'jquery-effects-bounce' => array( '', '', 'jquery-ui-core' ),
142
+ 'jquery-effects-clip' => array( '', '', 'jquery-ui-core' ),
143
+ 'jquery-effects-drop' => array( '', '', 'jquery-ui-core' ),
144
+ 'jquery-effects-explode' => array( '', '', 'jquery-ui-core' ),
145
+ 'jquery-effects-fade' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.8 */
146
+ 'jquery-effects-fold' => array( '', '', 'jquery-ui-core' ),
147
+ 'jquery-effects-highlight' => array( '', '', 'jquery-ui-core' ),
148
+ 'jquery-effects-puff' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
149
+ 'jquery-effects-pulsate' => array( '', '', 'jquery-ui-core' ),
150
+ 'jquery-effects-scale' => array( '', '', 'jquery-ui-core' ),
151
+ 'jquery-effects-shake' => array( '', '', 'jquery-ui-core' ),
152
+ 'jquery-effects-size' => array( '', '', 'jquery-ui-core' ), /* jQuery UI 1.11 */
153
+ 'jquery-effects-slide' => array( '', '', 'jquery-ui-core' ),
154
+ 'jquery-effects-transfer' => array( '', '', 'jquery-ui-core' ),
155
+
156
+ /* prototype */
157
+ 'prototype' => array( 'prototype', 'prototype', '' ),
158
+
159
+ /* scriptaculous */
160
+ 'scriptaculous-root' => array( 'scriptaculous', 'scriptaculous', '' ),
161
+ 'scriptaculous-builder' => array( '', '', 'scriptaculous-root' ),
162
+ 'scriptaculous-effects' => array( '', '', 'scriptaculous-root' ),
163
+ 'scriptaculous-dragdrop' => array( '', '', 'scriptaculous-root' ),
164
+ 'scriptaculous-controls' => array( '', '', 'scriptaculous-root' ),
165
+ 'scriptaculous-slider' => array( '', '', 'scriptaculous-root' ),
166
+ 'scriptaculous-sound' => array( '', '', 'scriptaculous-root' ),
167
+
168
+ /* moo tools */
169
+ 'mootools' => array( 'mootools', 'mootools-yui-compressed', '' ),
170
+
171
+ /* Dojo */
172
+ 'dojo' => array( 'dojo', 'dojo.xd', '' ),
173
+
174
+ /* swfobject */
175
+ 'swfobject' => array( 'swfobject', 'swfobject', '' ),
176
+
177
+ /* YUI */
178
+ 'yui' => array( 'yui', 'build/yuiloader/yuiloader-min', '' ),
179
+
180
+ /* Ext Core */
181
+ 'ext-core' => array( 'ext-core', 'ext-core', '' )
182
+
183
+ );
184
+
185
+ /**
186
+ * PHP 5 Constructor
187
+ */
188
+ function __construct() {
189
+ $this->jquery_tag = 'jquery';
190
+ $this->google_scripts = self::$default_google_scripts;
191
+
192
+ $this->noconflict_next = false;
193
+ // protocol-relative URLS accepted by `wp_register_scripts`
194
+ // starting with version 3.5
195
+ $this->protocol_relative_supported = version_compare(
196
+ get_bloginfo( 'version' ), '3.5', '>='
197
+ );
198
+ }
199
+
200
+ static function configure_plugin() {
201
+
202
+ add_action(
203
+ 'wp_default_scripts',
204
+ array(
205
+ 'JCP_UseGoogleLibraries',
206
+ 'replace_default_scripts_action',
207
+ ),
208
+ 1000
209
+ );
210
+ add_filter(
211
+ 'script_loader_src',
212
+ array( 'JCP_UseGoogleLibraries', 'remove_ver_query_filter' ),
213
+ 1000
214
+ );
215
+ add_filter(
216
+ 'init',
217
+ array( 'JCP_UseGoogleLibraries', 'setup_filter' )
218
+ );
219
+
220
+ // There's a chance some plugin has called wp_enqueue_script
221
+ // outside of any hooks, which means that this plugin's
222
+ // 'wp_default_scripts' hook will never get a chance to fire.
223
+ // This tries to work around that.
224
+ global $wp_scripts;
225
+ if ( is_a( $wp_scripts, 'WP_Scripts' ) ) {
226
+ self::debug( self::$script_before_init_notice );
227
+ $ugl = self::get_instance();
228
+ $ugl->replace_default_scripts( $wp_scripts );
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Get markup to show error message in admin when $WP_Script
234
+ * created before it's time
235
+ *
236
+ * @returns string markup for notice display
237
+ */
238
+ static function script_before_init_admin_notice() {
239
+ echo '<div class="error fade"><p>Use Google Libraries: ' .
240
+ self::$script_before_init_notice . '</p></div>';
241
+ }
242
+
243
+ static function setup_filter() {
244
+ $ugl = self::get_instance();
245
+ $ugl->setup();
246
+ }
247
+
248
+ /**
249
+ * Log message if `WP_DEBUG` enabled.
250
+ *
251
+ * @since 1.5
252
+ *
253
+ * @param mixed $message string to log, or object to log via `print_r`
254
+ */
255
+ static function debug( $message ) {
256
+ if ( WP_DEBUG !== false ) {
257
+ if ( is_array( $message ) || is_object( $message ) ) {
258
+ $message = var_export( $message, true );
259
+ }
260
+ error_log( 'Use Google Libraries: ' . $message );
261
+ }
262
+ }
263
+
264
+ /**
265
+ * Disables script concatination, which breaks when dependencies are not
266
+ * all loaded locally.
267
+ */
268
+ function setup() {
269
+ global $concatenate_scripts;
270
+ $concatenate_scripts = false;
271
+
272
+ }
273
+
274
+ static function replace_default_scripts_action( &$scripts ) {
275
+ $ugl = self::get_instance();
276
+ $ugl->replace_default_scripts( $scripts );
277
+ }
278
+
279
+ /**
280
+ * Sometimes WordPress registes `jquery.js` as `'jquery-core'`, while
281
+ * '`jquery`' is some other script with a dependency on
282
+ * `'jquery-core'`. If '`jquery-core`' in present in `$scripts`
283
+ * this is assumed to be the case and update the registration for
284
+ * '`jquery-core`' instead.
285
+ *
286
+ * @since 1.6
287
+ *
288
+ * @param object $scripts
289
+ */
290
+ protected function newscripts_fix_jquery_core( &$scripts ) {
291
+ // jquery may really be loaded under jquery-core
292
+ // if so, we'll adjust google_scripts here
293
+ if ( $scripts->query( 'jquery-core' ) && array_key_exists( 'jquery', $this->google_scripts ) ) {
294
+ $this->google_scripts['jquery-core'] = $this->google_scripts['jquery'];
295
+ unset( $this->google_scripts['jquery'] );
296
+ $this->jquery_tag = 'jquery-core';
297
+ }
298
+ }
299
+
300
+ protected function newscripts_build_url( $name, $lib, $ver, $js, $orig_url ) {
301
+
302
+ // if $lib is empty, then this script does not need to be
303
+ // exlicitly loaded when using googleapis.com, but we need to keep
304
+ // it around for dependencies
305
+ if ( $lib != '' ) {
306
+ // build new URL
307
+ $url = "//ajax.googleapis.com/ajax/libs/$lib/$ver/$js.js";
308
+ $proto_url = "http:$url";
309
+ $head = wp_remote_head( $proto_url );
310
+ if ( wp_remote_retrieve_response_code( $head ) !== 200 ) {
311
+ self::debug( "Google servers do not seem to be hosting requested version of $name (version $ver). Using version provided by WordPress." );
312
+ return $orig_url;
313
+ }
314
+ if ( ! $this->protocol_relative_supported ) {
315
+ return $proto_url;
316
+ }
317
+ return $url;
318
+ } else {
319
+ return '';
320
+ }
321
+ }
322
+
323
+ /**
324
+ * Collects replacement script registration data.
325
+ *
326
+ * Processes standard WordPress script registrations against list of
327
+ * scripts hosted on Google's CDN. Will exclude any scripts that
328
+ * contain '-' in the version number (used by WordPress devs to signify
329
+ * a non-standard version). Also, the new url will be queried to ensure
330
+ * it's valid (via `wp_remote_head`).
331
+ *
332
+ * @since 1.5
333
+ *
334
+ * @param object $scripts WP_Scripts object
335
+ * @return array updated script registration data
336
+ */
337
+ function build_newscripts( &$scripts ) {
338
+ $newscripts = array();
339
+ $combine_ok = array();
340
+
341
+ $this->newscripts_fix_jquery_core( $scripts );
342
+
343
+ foreach ( $this->google_scripts as $name => $values ) {
344
+ if ( $script = $scripts->query( $name ) ) {
345
+ $lib = $values[0];
346
+ $js = $values[1];
347
+ $combined = $values[2];
348
+ // default to requested ver
349
+ $ver = $script->ver;
350
+
351
+ if ( strpos( $ver, '-' ) !== false ) {
352
+ self::debug( "WordPress appears to be requesting a non-standard version of $name (version $ver). Using version provided by WordPress to ensure compatability." );
353
+ continue;
354
+ }
355
+
356
+ // TODO: replace with more flexible option
357
+ // quick and dirty work around for scriptaculous 1.8.0
358
+ if ( $name == 'scriptaculous-root' && $ver == '1.8.0' ) {
359
+ $ver = '1.8';
360
+ }
361
+
362
+ if ( $combined !== '' ) {
363
+ if ( ! in_array( $combined, $combine_ok ) ) {
364
+ self::debug( "Google servers not hosting combined library for $name (version $ver). Using version provided by WordPress to ensure compatability." );
365
+ continue;
366
+ }
367
+ if ( ! in_array( $combined, $script->deps ) ) {
368
+ // if this script has been combined into another script
369
+ // ensure this handle depends on the combined handle
370
+ $script->deps[] = $combined;
371
+ }
372
+ }
373
+
374
+ $script->src = $this->newscripts_build_url(
375
+ $name, $lib, $ver, $js, $script->src
376
+ );
377
+
378
+ $newscripts[] = $script;
379
+ $combine_ok[] = $name;
380
+ }
381
+ }
382
+ return $newscripts;
383
+
384
+ }
385
+
386
+
387
+ /**
388
+ * Get new script registration data.
389
+ *
390
+ * Attempts to load script registration data from the transient cache.
391
+ * If not in cache, or if cached data is from a different version of
392
+ * either WordPress or this plug-in, then it will be rebuilt. Also
393
+ * handles forcing URLS to use SSL if site is currently loaded over
394
+ * SSL.
395
+ *
396
+ * @since 1.5
397
+ *
398
+ * @param object $scripts WP_Scripts object
399
+ * @return array updated script registration data
400
+ */
401
+ function get_newscripts( &$scripts ) {
402
+ $wp_ver = get_bloginfo( 'version' );
403
+ if ( false === ( $cache = get_transient( self::$cache_id ) ) ) {
404
+ $cache = array();
405
+ }
406
+ if ( ( ! isset( $cache['ugl_ver'] ) ) || ( $cache['ugl_ver'] !== self::$version ) ||
407
+ ( ! isset( $cache['wp_ver'] ) ) || ( $cache['wp_ver'] !== $wp_ver ) ||
408
+ ( ! isset( $cache['newscripts'] ) ) ) {
409
+ $newscripts = $this->build_newscripts( $scripts );
410
+ $cache = array(
411
+ 'ugl_ver' => self::$version,
412
+ 'wp_ver' => $wp_ver,
413
+ 'newscripts' => $newscripts,
414
+ );
415
+ set_transient( self::$cache_id, $cache, self::$cache_len );
416
+ } else {
417
+ $newscripts = $cache['newscripts'];
418
+ }
419
+ // need to handle ssl after cache load, because it may swap
420
+ // back and forth depending on the site config/usage
421
+ if ( ( ! $this->protocol_relative_supported ) && ( is_ssl() ) ) {
422
+ foreach ( $newscripts as $script ) {
423
+ $script->src = preg_replace( '/^http:/', 'https:', $script->src );
424
+ }
425
+ }
426
+ return $newscripts;
427
+ }
428
+
429
+ /**
430
+ * Replace as many of the WordPress default script registrations as
431
+ * possible with ones from Google
432
+ *
433
+ * @param object $scripts WP_Scripts object.
434
+ */
435
+ function replace_default_scripts( &$scripts ) {
436
+ $newscripts = $this->get_newscripts( $scripts );
437
+ foreach ( $newscripts as $script ) {
438
+ $olddata = $this->wp_dependency_get_data( $scripts, $script->handle );
439
+ $scripts->remove( $script->handle );
440
+ // re-register with original ver
441
+ $scripts->add( $script->handle, $script->src, $script->deps, $script->ver );
442
+ if ( $olddata ) {
443
+ foreach ( $olddata as $data_name => $data ) {
444
+ $scripts->add_data( $script->handle, $data_name, $data );
445
+ }
446
+ }
447
+ }
448
+ }
449
+
450
+
451
+ function wp_dependency_get_data( $dep_obj, $handle, $data_name = false ) {
452
+
453
+ if ( ! method_exists( $dep_obj, 'add_data' ) ) {
454
+ return false;
455
+ }
456
+
457
+ if ( ! isset( $dep_obj->registered[ $handle ] ) ) {
458
+ return false;
459
+ }
460
+
461
+ if ( ! $data_name ) {
462
+ return $dep_obj->registered[ $handle ]->extra;
463
+ }
464
+
465
+ if ( ! method_exists( $dep_obj, 'get_data' ) ) {
466
+ return $dep_obj->registered[ $handle ]->extra[ $data_name ];
467
+ }
468
+
469
+ return $dep_obj->get_data( $handle, $data_name );
470
+ }
471
+
472
+
473
+ /**
474
+ * Remove 'ver' from query string for scripts loaded from Google's
475
+ * CDN
476
+ *
477
+ * @param string $src src attribute of script tag
478
+ * @return string Updated src attribute
479
+ */
480
+ function remove_ver_query( $src ) {
481
+ if ( $this->noconflict_next ) {
482
+ $this->noconflict_next = false;
483
+ echo self::$noconflict_inject; // xss ok
484
+ }
485
+ if ( preg_match( '/ajax\.googleapis\.com\//', $src ) ) {
486
+ $src = remove_query_arg( 'ver', $src );
487
+ if ( strpos( $src, $this->google_scripts[ $this->jquery_tag ][1] . '.js' ) ) {
488
+ $this->noconflict_next = true;
489
+ }
490
+ }
491
+ return $src;
492
+ }
493
+
494
+ static function remove_ver_query_filter( $src ) {
495
+ $ugl = self::get_instance();
496
+ return $ugl->remove_ver_query( $src );
497
+ }
498
+ }
499
+ }
500
+
501
+ //instantiate the class
502
+ if ( class_exists( 'JCP_UseGoogleLibraries' ) ) {
503
+ JCP_UseGoogleLibraries::configure_plugin();
504
+ }
license.txt CHANGED
@@ -1,674 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
readme.txt CHANGED
@@ -1,266 +1,259 @@
1
- === Speed Booster Pack ===
2
- Contributors: optimocha
3
- Tags: speed, optimization, performance, scripts to the footer, google libraries, font awesome cdn, defer parsing of javascript, remove query strings, gtmetrix, google pageSpeed, yslow, compression
4
- Requires at least: 4.6
5
- Tested up to: 5.1
6
- Requires PHP: 5.6
7
- Stable tag: 3.7.7
8
- License: GPLv3 or later
9
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
-
11
- A light, frequently updated and easy to use plugin to make your site load faster and score higher on Google PSI.
12
-
13
- == Description ==
14
-
15
- **Speed Booster Pack** is a standalone plugin built, maintained & operated by the friendly folks over at [OptiMocha](https://optimocha.com/)
16
-
17
- **Speed Booster Pack is a lightweight, frequently updated, easy to use and well supported plugin which allows you to improve your website's loading speed.**
18
-
19
- Improving your site's speed will get you a better score on major speed testing services such as [Google PageSpeed](http://developers.google.com/speed/pagespeed/insights/), [GTmetrix](http://gtmetrix.com/), [YSlow](https://developer.yahoo.com/yslow/), [Pingdom](http://tools.pingdom.com/fpt/), [Webpagetest](http://www.webpagetest.org/) and will also improve your overall site's usability. This will persuade Google and other search engines to rank your site higher in search results thus sending more traffic.
20
-
21
- = Why Site Speed Is Important? =
22
-
23
- Visitors usually close a website if it doesn't load in a few seconds and the slower a site loads the greater the chances are that the visitors will leave. And you don't want that to happen, do you? :-)
24
- Speed Booster Pack is a plugin that can help you speed up your website by tweaking different options.
25
-
26
- = Main Plugin Features =
27
-
28
- * **Eliminate external render-blocking javascript and css** in above-the-fold content.
29
- * **Move scripts to the footer** to improve page loading speed.
30
- * **Load CSS asynchronously** to render your page more quickly and get a higher score on the major speed testing services.
31
- * **Minify and inline all CSS styles and move them to the footer** to eliminate external render-blocking CSS and optimize CSS delivery.
32
- * ** Minify HTML and JavaScript to increase your page load speed.
33
- * **Change image compression level** to keep file sizes smaller; Change JPG quality.
34
- * **Load javascript files from Google Libraries** rather than serving them from your WordPress install directly, to reduce latency, increase parallelism and improve browser caching.
35
- * **Defer parsing of javascript files** to reduce the initial load time of your page.
36
- * **Remove query strings from static resources** to improve your speed scores.
37
- * **Remove extra Font Awesome stylesheets** added to your theme by certain plugins, if *Font Awesome* is already used in your theme.
38
- * **Remove junk header tags** to clean up your WordPress Header.
39
- * **Display page loading time** in the plugin options page.
40
- * **Display the number of executed SQL queries** in the plugin options page.
41
- * **Display the Peak Memory Used** in the plugin options page.
42
- * **Exclude scripts** from being moved to the footer or defered.
43
- * **Remove RSD Link** if you are not using a Weblog Client or some 3rd party sites/programs that use the XML-RPC request formats.
44
- * **Remove WordPress Shortlink**
45
- * **Remove the WordPress Version** this option is added for security reasons and cleaning the header.
46
- * **Remove all rss feed links** to cleanup your WordPress header.
47
-
48
- * For complete usage instructions visit [Plugin Documentation](http://optimocha.com/speed-booster-pack-documentation/)
49
-
50
-
51
- Future Development:
52
-
53
- * Enable compression option.
54
- * Leverage browser caching.
55
- * Option to disable specific plugin actions on specific pages directly via the page edit screen metabox.
56
- * Option to keep specific scripts in the header, since there are many javascript-based plugins scripts, that rely on jQuery to be loaded prior to the HTML elements.
57
-
58
- = Recommended Plugins =
59
-
60
- * [Simple Author Box](http://wordpress.org/plugins/simple-author-box/) - A simple but cool author box with social icons.
61
-
62
- == Installation ==
63
-
64
- 1. Download the plugin (.zip file) on your hard drive.
65
- 2. Unzip the zip file contents.
66
- 3. Upload the `speed-booster-pack` folder to the `/wp-content/plugins/` directory.
67
- 4. Activate the plugin through the 'Plugins' menu in WordPress.
68
- 5. A new sub menu item `Speed Booster Pack` will appear in your main Settings menu.
69
-
70
- == Screenshots ==
71
- 1. Plugin options page, simple view (v2.5)
72
-
73
- == Changelog ==
74
-
75
- = 3.7.7 =
76
- * Speed Booster Pack is acquired by [Optimocha](https://optimocha.com/)!
77
- * Updates to the Optimize More tab
78
-
79
- = 3.7.6 =
80
- * Improved admin UI
81
- * Added "Disable Self Pingbacks" option
82
- * Added "Disable Dashicons" option
83
- * Added "Disable Google Maps" option
84
- * Added "Disable Heartbeat" option
85
- * Added "Heartbeat frequency" option
86
- * Added "Autosave interval" option
87
- * Added "Remove REST API Links" option
88
- * Added "Limit Post Revision" option
89
- * Added CDN options
90
- * Added Google Analytics options
91
- * Removed "Remove RSD(Really Simple Discovery) Link" option
92
- * Removed "Image compression level" option
93
-
94
- = 3.7.5 =
95
- * removed uninstall feedback
96
-
97
- = 3.7.4 =
98
- * minor backend tweaks - notice
99
- * added language files
100
-
101
- = 3.7.3 =
102
- * minor backend tweaks
103
-
104
- = 3.7.2 =
105
- * minor tweaks & version bump
106
- * removed ShortPixel aff integration
107
-
108
- = 3.7.1 =
109
- * Temporarily remove lazyLoad as the bundled JS files, namely, CrazyLazy don't seem to be working properly with the latest jQuery version.
110
-
111
- = 3.7 =
112
-
113
- * Bumped FontAwesome bundled CSS version from 4.1 -> 4.7 and changed to using MaxCDN
114
- * (Hopefully) fixed the issue affecting relative/absolute paths when using minify CSS
115
- * Wrongfully used escape functions
116
- * Should use wp_scripts-> done instead of wp_scripts->queue
117
- * Update Use Google Libraries 3rd party dependency
118
- * Can't be fully translated because of one wrong text-domain string
119
- * Change UI to WordPress Core UI
120
- * Added plugin uninstall feedback
121
- * Added plugin (dedicated) support tab && moved plugin feedback section only to support tab
122
- * Added tooltips to all fields
123
- * Re-worked the page load / site stats bar & added a bit more info
124
- * Removed the old way of handling the uninstall hook & deletion of the sbp_integer variable from SBP when you uninstall it. In case you change your mind & reactivate the plugin, your former image compression value's there waiting for you.
125
- * Addressed a small issue with the "Exclude scripts from being moved to footer" display
126
- * Made all of the plugin's link send to MachoTheme's docs instead of Tiguan
127
- * Updated jQuery UI CSS to latest version & included the PNG sprites that come by default with jQuery UI, eliminating some back-end "asset not found" errors
128
- * Removed unused files
129
- * Added feature: "Remove Emoji scripts"
130
- * Added feature: "Disable XML-RPC" pings
131
- * Added default values. Now it's even easier to get speed boosts without actually having to toggle stuff
132
- * Removed po/mo files from SBP since translations are now handled here: https://translate.wordpress.org/projects/wp-plugins/speed-booster-pack
133
- * jQuery will always be enqueued in the header, as a security/fallback measure.
134
- * Fixed the way "exclude scripts from footer" works. It's now usable and only requires the script handle. Added backwards compat as well
135
- * Fixed the way script deferring works, it's now actually usable. Introduced a filter: sbp_exclude_defer_scripts so users can exclude more than 4 scripts from being deferred
136
- * Rewrote the way the plugin was handling removal of query strings from assets
137
- * Automatically exclude certain known CSS assets from being async/minifed and/or moved from header (ex: dashicons / admin-bar)
138
- * Full list of changes for v3.7, here: https://github.com/MachoThemes/speed-booster-pack/milestone/1?closed=1
139
-
140
- = 3.6.1 =
141
- * Added a section for feedback in the plugin's dashboard
142
-
143
- = 3.6 =
144
- * Changed contributors and fixed a few bugs. Plugin is now under new ownership.
145
-
146
- = 3.5 =
147
- * Fix compatibility with the CrazyLazy plugin.
148
-
149
- = 3.4 =
150
- * Added an option to increase your page load speed by minifying JavaScript and HTML. Removed option to remove RSD Link, since its impact on improving speed was insignificant.
151
-
152
- = 3.3 =
153
- * Fix Lazy Load CSS problem.
154
-
155
- = 3.2 =
156
- * Added Lazy Load feature to improve the web page loading times of your images.
157
-
158
- = 3.1 =
159
- * Following requests from users, added back the option of excluding javascript elements.
160
-
161
- = 3.0 =
162
- * We removed the option of excluding javascript elements as this option falls page speed score, making this plugin almost useless. Also, these options were only for advanced users, for regular users, incorrect use these options could destabilize the entire site functionality.
163
- * We also removed the lazy load images option because it was outdated and broken. We'll come up with a new and updated solution soon.
164
-
165
- = 2.9 =
166
- * Added a new recommended features that can make your site load faster
167
-
168
- = 2.8 =
169
- * Fixed plugin options visibility issue
170
-
171
- = 2.7 =
172
- * All important options switched to off by default (on first plugin activation).
173
-
174
- = 2.6 =
175
- * Added Spanish translation by [Andrew Kurtis](http://www.webhostinghub.com/)
176
-
177
- = 2.5 =
178
- * Added option to exclude certain JS files from being moved to the footer.
179
- * Added option to exclude certain JS files from being defered.
180
- * Added a list of handles of all scripts and styles enqueued by your theme, useful for excluding options.
181
- * Removed FOUC option since is useless with W3 Total Cache.
182
- * Some visual changes on plugin options page.
183
- * Translation updated with the new strings.
184
- * Moved some admin inline scripts to js files.
185
-
186
- = 2.4 =
187
- * Fixed TypeError: $ is not a function when Prevent Flash of Unstyled Content (FOUC) option is active. Thanks to [@Marcio Duarte](http://profiles.wordpress.org/pagelab) for the [bug report](http://wordpress.org/support/topic/javascript-error-53).
188
-
189
- = 2.3 =
190
- * Added option to exclude certain CSS files from being loaded asynchronously.
191
- * Changed the position of the styles when they are inlined to the footer (before js files).
192
- * Added an experimental option to eliminate flash of unstyled content (FOUC) when all CSS styles are inlined to the footer.
193
- * Translations updated.
194
-
195
- = 2.2 =
196
- * Fixed option to disable all CSS Async features on mobile devices.
197
- * Fixed incompatibility with WPtouch plugin. Thanks to [@DevilIce](http://profiles.wordpress.org/devilice) for the [bug report](http://wordpress.org/support/topic/css-asynchronously-and-wptouch-issue).
198
- * Updated function wp_is_mobile() on lazy load images to really disabled this feature on mobile devices.
199
-
200
- = 2.1 =
201
- *Added an option to disable all CSS Async features on mobile devices, to avoid some appearance issues until finding a clean solution to fix it.
202
-
203
- = 2.0 =
204
- *Modified: amended previous except for the admin toolbar css to enqueue its stylesheets only if admin bar is showing, to not break the render blocking plugin option.
205
-
206
- = 1.9 =
207
- * Fix: breaking the SEO by Yoast plugin interface (perhaps as well as to others too). Thanks to [@JahLive](http://profiles.wordpress.org/jahlive) for the [bug report](http://wordpress.org/support/topic/yoast-wordpress-seo-broken-after-update).
208
- * Added an except for the admin toolbar css since the Load CSS asynchronously option removes its dashicons and stylesheets.
209
-
210
-
211
- = 1.8 =
212
- * Added option to load CSS asynchronously to render your page more quickly and get a higher score on the major speed testing services
213
- * Added option to inline and minify all CSS styles and move them to the header or to the footer, to eliminate external render-blocking CSS and optimize CSS delivery.
214
- * Added option to change the default image compression level, to help your pages load faster and keep file sizes smaller.
215
- * Added memory usage information and active plugins number in the plugin options page.
216
- * Replaced PHP version info with memory usage information (more useful).
217
- * Added Romanian translation and POT file. Translators are welcome!
218
-
219
- = 1.7 =
220
- * Fixed Lazy Load missed js.
221
-
222
- = 1.6 =
223
- * Fixed some errors and missed codes from plugin functions.
224
-
225
- = 1.5 =
226
- * Added Lazy Load feature to improve the web page loading times of your images.
227
- * Added an option to remove all rss feed links from WP Head.
228
- * Added plugin options informations to the footer, visible in page source(hidden in front end), useful for debugging.
229
-
230
- = 1.4 =
231
- * Added a new option to remove extra Font Awesome stylesheets added to your theme by certain plugins, if Font Awesome is already used in your theme.
232
- * Added a new option to remove WordPress Version Number.
233
-
234
- = 1.3 =
235
- * Fixed strict standards error: redefining already defined constructor for class.
236
-
237
- = 1.2 =
238
- * Modified the plugin version number variable in plugin options page.
239
-
240
- = 1.1 =
241
- * Modified Readme file
242
-
243
- = 1.0 =
244
- * Initial release
245
-
246
- == Page Load Stats ==
247
-
248
- Page Load Stats is a brief statistic displayed in the plugin options page. It displays your homepage loading speed (in seconds) and number of processed queries.
249
-
250
- **Page loading time** – the progress bar color will be:
251
-
252
- * *green* if the page load takes less than a second
253
- * *orange* when loading the page takes between 1 and 2 seconds
254
- * *red* if the page loading takes longer than 2 seconds
255
-
256
- **Number of executed queries** – the progress bar color will be:
257
-
258
- * *green* if there were less than 100 queries
259
- * *orange* if there were between 100 and 200 queries
260
- * *red* if the page required more than 200 queries
261
-
262
- == Credits ==
263
-
264
- * Thanks to [Jason Penney](http://jasonpenney.net/) for Google Libraries feature.
265
- * CSS option was implemented from Async JS and CSS plugin and updated to our plugin.
266
- * Credits for Lazy Load feature belongs to [pluginkollektiv](https://github.com/pluginkollektiv/crazy-lazy)
1
+ === Speed Booster Pack ===
2
+ Contributors: optimocha
3
+ Tags: speed, optimization, performance, scripts to the footer, google libraries, font awesome cdn, defer parsing of javascript, remove query strings, gtmetrix, google pageSpeed, yslow, compression, instant.page
4
+ Requires at least: 4.6
5
+ Tested up to: 5.2
6
+ Requires PHP: 5.6
7
+ Stable tag: 3.8
8
+ License: GPLv3 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ A light, frequently updated and easy to use plugin to help your website load faster and score higher on Google Page Speed.
12
+
13
+ == Description ==
14
+
15
+ **Speed Booster Pack** is a standalone plugin built, maintained & operated by the friendly folks over at [Optimocha](https://optimocha.com/)
16
+
17
+ **Speed Booster Pack is a lightweight, frequently updated, easy to use and well supported plugin which allows you to improve your website's loading speed.**
18
+
19
+ Improving your site's speed will get you a better score on major speed testing services such as [Google PageSpeed](https://developers.google.com/speed/pagespeed/insights/), [GTmetrix](https://gtmetrix.com/), [Pingdom](http://tools.pingdom.com/fpt/), [WebPageTest](https://www.webpagetest.org/) and will also improve your overall site's usability. This will persuade Google and other search engines to rank your site higher in search results thus sending more traffic.
20
+
21
+ = Why Is Site Speed Important? =
22
+
23
+ People abandon pages that take more than a few seconds to load, which means slow pages lose you visitors (and money). You dont want that to happen, do you? :-)
24
+
25
+ Speed Booster Pack is a plugin that can help you speed up your website by tweaking different options.
26
+
27
+ = Main Plugin Features =
28
+
29
+ * **Eliminate render-blocking JavaScript and CSS** in your content.
30
+ * **Move scripts to the footer** to improve page loading speed.
31
+ * **Minify and inline all CSS and move them to footer** to optimize CSS delivery.
32
+ * **Minify HTML and JavaScript** to increase your page speed.
33
+ * **Load JS files from Google libraries** rather than serving them from your WordPress install directly, to reduce latency, increase parallelism and improve browser caching.
34
+ * **Defer parsing of JavaScript files** to reduce the initial load time of your page.
35
+ * **Remove query strings from static resources** to improve your speed scores.
36
+ * **Remove extra Font Awesome stylesheets** added to your theme by certain plugins, if *Font Awesome* is already used in your theme.
37
+ * **Remove junk header tags** to clean up your WordPress head code.
38
+ * **Exclude scripts** from being moved to the footer or defered.
39
+ * **Remove RSD Link** if you are not using a Weblog Client or some 3rd party sites/programs that use the XML-RPC request formats.
40
+ * **Remove WordPress Version** this option is added for security reasons and cleaning the header.
41
+ * **Remove all RSS feed links** to cleanup your WordPress header.
42
+
43
+ * For complete usage instructions visit [Plugin Documentation](http://optimocha.com/speed-booster-pack-documentation/)
44
+
45
+ == Installation ==
46
+
47
+ 1. Download the plugin (.zip file) on your hard drive.
48
+ 2. Unzip the zip file contents.
49
+ 3. Upload the `speed-booster-pack` folder to the `/wp-content/plugins/` directory.
50
+ 4. Activate the plugin through the 'Plugins' menu in WordPress.
51
+ 5. A new sub menu item `Speed Booster Pack` will appear in your main Settings menu.
52
+
53
+ == Screenshots ==
54
+ 1. Plugin options page
55
+
56
+ == Changelog ==
57
+
58
+ = 3.8 =
59
+ * Fixed most of the typos
60
+ * Added option: "Disable cart fragments"
61
+ * Added option: "Integrate instant.page"
62
+ * Removed option: JPEG quality
63
+ * Removed all default options for new users
64
+ * Fixed the issues with already defined constants
65
+ * Fixed the double jQuery issue
66
+ * Tested for WordPress 5.2
67
+
68
+ = 3.7.7 =
69
+ * Speed Booster Pack is acquired by [Optimocha](https://optimocha.com/)!
70
+ * Updates to the Optimize More tab
71
+
72
+ = 3.7.6 =
73
+ * Improved admin UI
74
+ * Added "Disable Self Pingbacks" option
75
+ * Added "Disable Dashicons" option
76
+ * Added "Disable Google Maps" option
77
+ * Added "Disable Heartbeat" option
78
+ * Added "Heartbeat frequency" option
79
+ * Added "Autosave interval" option
80
+ * Added "Remove REST API Links" option
81
+ * Added "Limit Post Revision" option
82
+ * Added CDN options
83
+ * Added Google Analytics options
84
+ * Removed "Remove RSD(Really Simple Discovery) Link" option
85
+ * Removed "Image compression level" option
86
+
87
+ = 3.7.5 =
88
+ * removed uninstall feedback
89
+
90
+ = 3.7.4 =
91
+ * minor backend tweaks - notice
92
+ * added language files
93
+
94
+ = 3.7.3 =
95
+ * minor backend tweaks
96
+
97
+ = 3.7.2 =
98
+ * minor tweaks & version bump
99
+ * removed ShortPixel aff integration
100
+
101
+ = 3.7.1 =
102
+ * Temporarily remove lazyLoad as the bundled JS files, namely, CrazyLazy don't seem to be working properly with the latest jQuery version.
103
+
104
+ = 3.7 =
105
+
106
+ * Bumped FontAwesome bundled CSS version from 4.1 -> 4.7 and changed to using MaxCDN
107
+ * (Hopefully) fixed the issue affecting relative/absolute paths when using minify CSS
108
+ * Wrongfully used escape functions
109
+ * Should use wp_scripts-> done instead of wp_scripts->queue
110
+ * Update Use Google Libraries 3rd party dependency
111
+ * Can't be fully translated because of one wrong text-domain string
112
+ * Change UI to WordPress Core UI
113
+ * Added plugin uninstall feedback
114
+ * Added plugin (dedicated) support tab && moved plugin feedback section only to support tab
115
+ * Added tooltips to all fields
116
+ * Re-worked the page load / site stats bar & added a bit more info
117
+ * Removed the old way of handling the uninstall hook & deletion of the sbp_integer variable from SBP when you uninstall it. In case you change your mind & reactivate the plugin, your former image compression value's there waiting for you.
118
+ * Addressed a small issue with the "Exclude scripts from being moved to footer" display
119
+ * Made all of the plugin's link send to MachoTheme's docs instead of Tiguan
120
+ * Updated jQuery UI CSS to latest version & included the PNG sprites that come by default with jQuery UI, eliminating some back-end "asset not found" errors
121
+ * Removed unused files
122
+ * Added feature: "Remove Emoji scripts"
123
+ * Added feature: "Disable XML-RPC" pings
124
+ * Added default values. Now it's even easier to get speed boosts without actually having to toggle stuff
125
+ * Removed po/mo files from SBP since translations are now handled here: https://translate.wordpress.org/projects/wp-plugins/speed-booster-pack
126
+ * jQuery will always be enqueued in the header, as a security/fallback measure.
127
+ * Fixed the way "exclude scripts from footer" works. It's now usable and only requires the script handle. Added backwards compat as well
128
+ * Fixed the way script deferring works, it's now actually usable. Introduced a filter: sbp_exclude_defer_scripts so users can exclude more than 4 scripts from being deferred
129
+ * Rewrote the way the plugin was handling removal of query strings from assets
130
+ * Automatically exclude certain known CSS assets from being async/minifed and/or moved from header (ex: dashicons / admin-bar)
131
+ * Full list of changes for v3.7, here: https://github.com/MachoThemes/speed-booster-pack/milestone/1?closed=1
132
+
133
+ = 3.6.1 =
134
+ * Added a section for feedback in the plugin's dashboard
135
+
136
+ = 3.6 =
137
+ * Changed contributors and fixed a few bugs. Plugin is now under new ownership.
138
+
139
+ = 3.5 =
140
+ * Fix compatibility with the CrazyLazy plugin.
141
+
142
+ = 3.4 =
143
+ * Added an option to increase your page load speed by minifying JavaScript and HTML. Removed option to remove RSD Link, since its impact on improving speed was insignificant.
144
+
145
+ = 3.3 =
146
+ * Fix Lazy Load CSS problem.
147
+
148
+ = 3.2 =
149
+ * Added Lazy Load feature to improve the web page loading times of your images.
150
+
151
+ = 3.1 =
152
+ * Following requests from users, added back the option of excluding javascript elements.
153
+
154
+ = 3.0 =
155
+ * We removed the option of excluding javascript elements as this option falls page speed score, making this plugin almost useless. Also, these options were only for advanced users, for regular users, incorrect use these options could destabilize the entire site functionality.
156
+ * We also removed the lazy load images option because it was outdated and broken. We'll come up with a new and updated solution soon.
157
+
158
+ = 2.9 =
159
+ * Added a new recommended features that can make your site load faster
160
+
161
+ = 2.8 =
162
+ * Fixed plugin options visibility issue
163
+
164
+ = 2.7 =
165
+ * All important options switched to off by default (on first plugin activation).
166
+
167
+ = 2.6 =
168
+ * Added Spanish translation by [Andrew Kurtis](http://www.webhostinghub.com/)
169
+
170
+ = 2.5 =
171
+ * Added option to exclude certain JS files from being moved to the footer.
172
+ * Added option to exclude certain JS files from being defered.
173
+ * Added a list of handles of all scripts and styles enqueued by your theme, useful for excluding options.
174
+ * Removed FOUC option since is useless with W3 Total Cache.
175
+ * Some visual changes on plugin options page.
176
+ * Translation updated with the new strings.
177
+ * Moved some admin inline scripts to js files.
178
+
179
+ = 2.4 =
180
+ * Fixed TypeError: $ is not a function when Prevent Flash of Unstyled Content (FOUC) option is active. Thanks to [@Marcio Duarte](http://profiles.wordpress.org/pagelab) for the [bug report](http://wordpress.org/support/topic/javascript-error-53).
181
+
182
+ = 2.3 =
183
+ * Added option to exclude certain CSS files from being loaded asynchronously.
184
+ * Changed the position of the styles when they are inlined to the footer (before js files).
185
+ * Added an experimental option to eliminate flash of unstyled content (FOUC) when all CSS styles are inlined to the footer.
186
+ * Translations updated.
187
+
188
+ = 2.2 =
189
+ * Fixed option to disable all CSS Async features on mobile devices.
190
+ * Fixed incompatibility with WPtouch plugin. Thanks to [@DevilIce](http://profiles.wordpress.org/devilice) for the [bug report](http://wordpress.org/support/topic/css-asynchronously-and-wptouch-issue).
191
+ * Updated function wp_is_mobile() on lazy load images to really disabled this feature on mobile devices.
192
+
193
+ = 2.1 =
194
+ *Added an option to disable all CSS Async features on mobile devices, to avoid some appearance issues until finding a clean solution to fix it.
195
+
196
+ = 2.0 =
197
+ *Modified: amended previous except for the admin toolbar css to enqueue its stylesheets only if admin bar is showing, to not break the render blocking plugin option.
198
+
199
+ = 1.9 =
200
+ * Fix: breaking the SEO by Yoast plugin interface (perhaps as well as to others too). Thanks to [@JahLive](http://profiles.wordpress.org/jahlive) for the [bug report](http://wordpress.org/support/topic/yoast-wordpress-seo-broken-after-update).
201
+ * Added an except for the admin toolbar css since the Load CSS asynchronously option removes its dashicons and stylesheets.
202
+
203
+
204
+ = 1.8 =
205
+ * Added option to load CSS asynchronously to render your page more quickly and get a higher score on the major speed testing services
206
+ * Added option to inline and minify all CSS styles and move them to the header or to the footer, to eliminate external render-blocking CSS and optimize CSS delivery.
207
+ * Added option to change the default image compression level, to help your pages load faster and keep file sizes smaller.
208
+ * Added memory usage information and active plugins number in the plugin options page.
209
+ * Replaced PHP version info with memory usage information (more useful).
210
+ * Added Romanian translation and POT file. Translators are welcome!
211
+
212
+ = 1.7 =
213
+ * Fixed Lazy Load missed js.
214
+
215
+ = 1.6 =
216
+ * Fixed some errors and missed codes from plugin functions.
217
+
218
+ = 1.5 =
219
+ * Added Lazy Load feature to improve the web page loading times of your images.
220
+ * Added an option to remove all rss feed links from WP Head.
221
+ * Added plugin options informations to the footer, visible in page source(hidden in front end), useful for debugging.
222
+
223
+ = 1.4 =
224
+ * Added a new option to remove extra Font Awesome stylesheets added to your theme by certain plugins, if Font Awesome is already used in your theme.
225
+ * Added a new option to remove WordPress Version Number.
226
+
227
+ = 1.3 =
228
+ * Fixed strict standards error: redefining already defined constructor for class.
229
+
230
+ = 1.2 =
231
+ * Modified the plugin version number variable in plugin options page.
232
+
233
+ = 1.1 =
234
+ * Modified Readme file
235
+
236
+ = 1.0 =
237
+ * Initial release
238
+
239
+ == Page Load Stats ==
240
+
241
+ Page Load Stats is a brief statistic displayed in the plugin options page. It displays your homepage loading speed (in seconds) and number of processed queries.
242
+
243
+ **Page loading time** – the progress bar color will be:
244
+
245
+ * *green* if the page load takes less than a second
246
+ * *orange* when loading the page takes between 1 and 2 seconds
247
+ * *red* if the page loading takes longer than 2 seconds
248
+
249
+ **Number of executed queries** – the progress bar color will be:
250
+
251
+ * *green* if there were less than 100 queries
252
+ * *orange* if there were between 100 and 200 queries
253
+ * *red* if the page required more than 200 queries
254
+
255
+ == Credits ==
256
+
257
+ * Thanks to [Jason Penney](http://jasonpenney.net/) for Google Libraries feature.
258
+ * CSS option was implemented from Async JS and CSS plugin and updated to our plugin.
259
+ * Credits for Lazy Load feature belongs to [pluginkollektiv](https://github.com/pluginkollektiv/crazy-lazy)
 
 
 
 
 
 
 
speed-booster-pack.php CHANGED
@@ -1,299 +1,251 @@
1
- <?php
2
- /**
3
- * Plugin Name: Speed Booster Pack
4
- * Plugin URI: http://wordpress.org/plugins/speed-booster-pack/
5
- * Description: Speed Booster Pack allows you to improve your page loading speed and get a higher score on the major speed testing services such as <a href="http://gtmetrix.com/">GTmetrix</a>, <a href="http://developers.google.com/speed/pagespeed/insights/">Google PageSpeed</a> or other speed testing tools.
6
- * Author: Optimocha
7
- * Version: 3.7.7
8
- * Author URI: https://optimocha.com
9
- * License: GPLv3 or later
10
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- * Requires PHP: 5.6
12
- * Text Domain : speed-booster-pack
13
- * Domain Path: /lang
14
- *
15
- * Copyright 2015-2017 Tiguan office@tiguandesign.com
16
- * Copyright 05/05/2017 - 10/04/2017 ShortPixel alex@shortpixel.com
17
- * Copyright 2017-2019 MachoThemes office@machothemes.com
18
- * Copyright 2019 Optimocha baris@optimocha.com
19
- *
20
- * Original Plugin URI: https://tiguan.com/speed-booster-pack/
21
- * Original Author URI: https://tiguan.com
22
- * Original Author: https://profiles.wordpress.org/tiguan/
23
- *
24
- *
25
- * This program is free software; you can redistribute it and/or modify
26
- * it under the terms of the GNU General Public License, version 3, as
27
- * published by the Free Software Foundation.
28
- *
29
- * This program is distributed in the hope that it will be useful,
30
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
- * GNU General Public License for more details.
33
- *
34
- * You should have received a copy of the GNU General Public License
35
- * along with this program; if not, write to the Free software
36
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37
- */
38
-
39
- /*----------------------------------------------------------------------------------------------------------
40
- Global Variables
41
- -----------------------------------------------------------------------------------------------------------*/
42
-
43
- /**
44
- * Default plugin values
45
- *
46
- * @since 3.7
47
- */
48
- $sbp_defaults = array(
49
- 'remove_emojis' => 1, // remove emoji scripts
50
- 'remove_wsl' => 1, // remove WSL link in header
51
- 'remove_adjacent' => 1, // remove post adjacent links
52
- 'wml_link' => 1, // remove Windows Manifest Live link
53
- 'rsd_link' => 1, // remove really simple discovery
54
- 'wp_generator' => 1, // remove WP version
55
- 'remove_all_feeds' => 1, // remove all WP feeds
56
- 'disable_xmlrpc' => 1, // disable XML-RPC pingbacks
57
- 'font_awesome' => 1, // remove extra font awesome styles
58
- 'query_strings' => 1, // remove query strings
59
- 'use_google_libs' => 0, // serve JS assets (when possible) from Google CDN
60
- 'heartbeat_frequency' => 15,
61
- 'autosave_interval' => 1,
62
- 'limit_post_revisions' => 30,
63
- 'sbp_tracking_position' => 'header'
64
- );
65
-
66
- $sbp_options = get_option( 'sbp_settings', (array) $sbp_defaults ); // retrieve the plugin settings from the options table
67
-
68
- /*----------------------------------------------------------------------------------------------------------
69
- Define some useful plugin constants
70
- -----------------------------------------------------------------------------------------------------------*/
71
-
72
- define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) );
73
- define( 'SPEED_BOOSTER_PACK_URL', plugin_dir_url( __FILE__ ) );// Defining plugin dir path
74
- define( 'SPEED_BOOSTER_PACK_VERSION', '3.7.6' ); // Defining plugin version
75
- define( 'SBP_FOOTER', 10 ); // Defining css position
76
- define( 'SBP_FOOTER_LAST', 99999 ); // Defining css last position
77
-
78
- /*----------------------------------------------------------------------------------------------------------
79
- Main Plugin Class
80
- -----------------------------------------------------------------------------------------------------------*/
81
-
82
- if ( ! class_exists( 'Speed_Booster_Pack' ) ) {
83
-
84
- class Speed_Booster_Pack {
85
-
86
- /*----------------------------------------------------------------------------------------------------------
87
- Function Construct
88
- -----------------------------------------------------------------------------------------------------------*/
89
-
90
- public function __construct() {
91
- global $sbp_options;
92
-
93
- // Enqueue admin scripts
94
- add_action( 'admin_enqueue_scripts', array( $this, 'sbp_admin_enqueue_scripts' ) );
95
-
96
- /**
97
- * Should remain disabled until we release wpspeedbooster.com
98
- *
99
- * @since: 3.7
100
- *
101
- */
102
- //add_action( 'wp_dashboard_setup', [ $this, 'sbp_load_dashboard_widget' ] );
103
-
104
-
105
- // load plugin textdomain
106
- add_action( 'plugins_loaded', array( $this, 'sbp_load_translation' ) );
107
-
108
- add_action( 'admin_notices', array( &$this, 'sbp_display_notices' ) );
109
- add_action( 'wp_ajax_sbp_dismiss_notices', array( &$this, 'sbp_dismiss_notices' ) );
110
-
111
- // Load plugin settings page
112
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/settings.php' );
113
- $Speed_Booster_Pack_Options = new Speed_Booster_Pack_Options();
114
-
115
- // Load main plugin functions
116
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/core.php' );
117
- $Speed_Booster_Pack_Core = new Speed_Booster_Pack_Core();
118
-
119
- // Enqueue admin style
120
- add_action( 'admin_enqueue_scripts', array( $this, 'sbp_enqueue_styles' ) );
121
-
122
-
123
- // Filters
124
- $this->path = plugin_basename( __FILE__ );
125
- add_filter( "plugin_action_links_$this->path", array( $this, 'sbp_settings_link' ) );
126
-
127
-
128
- } // END public function __construct
129
-
130
-
131
- function sbp_load_dashboard_widget() {
132
-
133
- require_once plugin_dir_path( __FILE__ ) . 'widgets/dashboard-widget.php';
134
-
135
- }
136
-
137
- /*----------------------------------------------------------------------------------------------------------
138
- Load plugin textdomain
139
- -----------------------------------------------------------------------------------------------------------*/
140
-
141
- function sbp_load_translation() {
142
- load_plugin_textdomain( 'speed-booster-pack', false, SPEED_BOOSTER_PACK_PATH . '/lang/' );
143
- }
144
-
145
-
146
- /*----------------------------------------------------------------------------------------------------------
147
- Display/dismiss admin notices if needed
148
- -----------------------------------------------------------------------------------------------------------*/
149
-
150
- function sbp_display_notices() {
151
- if ( ! get_option( 'sbp_news' ) ) {
152
- global $sbp_settings_page;
153
- $screen = get_current_screen();
154
- if ( $screen->id != $sbp_settings_page ) {
155
- require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/notice.php' );
156
- }
157
- }
158
- }
159
-
160
- function sbp_dismiss_notices() {
161
- update_option( 'sbp_news', true );
162
-
163
- return json_encode( array( "Status" => 0 ) );
164
- }
165
-
166
- /*----------------------------------------------------------------------------------------------------------
167
- Activate the plugin
168
- -----------------------------------------------------------------------------------------------------------*/
169
-
170
- public static function sbp_activate() {
171
-
172
- $sbp_options = get_option( 'sbp_settings', '' );
173
- $timer_stop = timer_stop( 0, 2 );
174
- $get_num_queries = get_num_queries();
175
-
176
- $url = get_site_url();
177
- $response = wp_remote_get( $url, array() );
178
-
179
- $get_enqueued_scripts_handle = get_option( 'all_theme_scripts_handle' );
180
- $get_enqueued_scripts_src = get_option( 'all_theme_scripts_src' );
181
- $get_enqueued_styles_handle = get_option( 'all_theme_styles_handle' );
182
-
183
- if ( get_option( 'sbp_page_time' ) == '' ) {
184
- update_option( 'sbp_page_time', $timer_stop );
185
- }
186
-
187
- if ( get_option( 'sbp_page_queries' ) == '' ) {
188
- update_option( 'sbp_page_queries', $get_num_queries );
189
- }
190
-
191
- if ( get_option( 'all_theme_scripts_handle' ) == '' ) {
192
- update_option( 'all_theme_scripts_handle', $get_enqueued_scripts_handle );
193
- }
194
-
195
- if ( get_option( 'all_theme_scripts_src' ) == '' ) {
196
- update_option( 'all_theme_scripts_src', $get_enqueued_scripts_src );
197
- }
198
-
199
- if ( get_option( 'all_theme_styles_handle' ) == '' ) {
200
- update_option( 'all_theme_styles_handle', $get_enqueued_styles_handle );
201
- }
202
-
203
- } // END public static function sb_activate
204
-
205
-
206
- /*----------------------------------------------------------------------------------------------------------
207
- Deactivate the plugin
208
- -----------------------------------------------------------------------------------------------------------*/
209
-
210
- public static function sbp_deactivate() {
211
- }
212
-
213
-
214
- /*----------------------------------------------------------------------------------------------------------
215
- CSS style of the plugin options page
216
- -----------------------------------------------------------------------------------------------------------*/
217
-
218
- function sbp_enqueue_styles( $hook ) {
219
-
220
- // load stylesheet only on plugin options page
221
- global $sbp_settings_page;
222
- if ( $hook != $sbp_settings_page ) {
223
- return;
224
- }
225
- wp_enqueue_style( 'sbp-styles', plugin_dir_url( __FILE__ ) . 'css/style.css' );
226
- wp_enqueue_style( 'jquery-ui', plugin_dir_url( __FILE__ ) . 'css/vendors/jquery-ui/jquery-ui.min.css' );
227
-
228
- } // End function sbp_enqueue_styles
229
-
230
-
231
- /*----------------------------------------------------------------------------------------------------------
232
- Enqueue admin scripts to plugin options page
233
- -----------------------------------------------------------------------------------------------------------*/
234
-
235
- public function sbp_admin_enqueue_scripts( $hook_sbp ) {
236
- // load scripts only on plugin options page
237
- global $sbp_settings_page;
238
- if ( $hook_sbp != $sbp_settings_page ) {
239
- return;
240
- }
241
- wp_enqueue_script( 'jquery-ui-slider' );
242
- wp_enqueue_script( 'postbox' );
243
-
244
- wp_enqueue_script( 'sbp-admin-scripts', plugins_url( 'inc/js/admin-scripts.js', __FILE__ ), array(
245
- 'jquery',
246
- 'postbox',
247
- 'jquery-ui-slider',
248
- ), SPEED_BOOSTER_PACK_VERSION, true );
249
-
250
- wp_enqueue_script( 'sbp-plugin-install', plugins_url( 'inc/js/plugin-install.js', __FILE__ ), array(
251
- 'jquery',
252
- 'updates',
253
- ), SPEED_BOOSTER_PACK_VERSION, true );
254
-
255
- }
256
-
257
-
258
- /*----------------------------------------------------------------------------------------------------------
259
- Add settings link on plugins page
260
- -----------------------------------------------------------------------------------------------------------*/
261
-
262
- function sbp_settings_link( $links ) {
263
- $pro_link = ' <a href="https://optimocha.com" target="_blank">Pro Help</a > ';
264
- $settings_link = ' <a href="admin.php?page=sbp-options">Settings</a > ';
265
- array_unshift( $links, $settings_link );
266
- array_unshift( $links, $pro_link );
267
-
268
- return $links;
269
-
270
- } // End function sbp_settings_link
271
- }// End class Speed_Booster_Pack
272
- } // End if (!class_exists("Speed_Booster_Pack")) (1)
273
-
274
- if ( class_exists( 'Speed_Booster_Pack' ) ) {
275
-
276
- // Installation and uninstallation hooks
277
- register_activation_hook( __FILE__, array( 'Speed_Booster_Pack', 'sbp_activate' ) );
278
- register_deactivation_hook( __FILE__, array( 'Speed_Booster_Pack', 'sbp_deactivate' ) );
279
-
280
- // instantiate the plugin class
281
- $speed_booster_pack = new Speed_Booster_Pack();
282
-
283
- } // End if (!class_exists("Speed_Booster_Pack")) (2)
284
-
285
- // make sure to update the path to where you cloned the projects to!
286
-
287
- //review function
288
- function sb_pack_check_for_review() {
289
- if ( ! is_admin() ) {
290
- return;
291
- }
292
- require_once SPEED_BOOSTER_PACK_PATH . 'inc/class-sb-pack-review.php';
293
-
294
- SB_Pack_Review::get_instance( array(
295
- 'slug' => 'speed-booster-pack',
296
- ) );
297
- }
298
-
299
- sb_pack_check_for_review();
1
+ <?php
2
+ /**
3
+ * Plugin Name: Speed Booster Pack
4
+ * Plugin URI: http://wordpress.org/plugins/speed-booster-pack/
5
+ * Description: Speed Booster Pack helps you improve your page loading speed and get higher scores on speed test services like GTmetrix, Google PageSpeed or WebPageTest.
6
+ * Author: Optimocha
7
+ * Version: 3.8
8
+ * Author URI: https://optimocha.com
9
+ * License: GPLv3 or later
10
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
+ * Requires PHP: 5.6
12
+ * Text Domain : speed-booster-pack
13
+ * Domain Path: /lang
14
+ *
15
+ * Copyright 2015-2017 Tiguan office@tiguandesign.com
16
+ * Copyright 05/05/2017 - 10/04/2017 ShortPixel alex@shortpixel.com
17
+ * Copyright 2017-2019 MachoThemes office@machothemes.com
18
+ * Copyright 2019- Optimocha baris@optimocha.com
19
+ *
20
+ * Original Plugin URI: https://tiguan.com/speed-booster-pack/
21
+ * Original Author URI: https://tiguan.com
22
+ * Original Author: https://profiles.wordpress.org/tiguan/
23
+ *
24
+ *
25
+ * This program is free software; you can redistribute it and/or modify
26
+ * it under the terms of the GNU General Public License, version 3, as
27
+ * published by the Free Software Foundation.
28
+ *
29
+ * This program is distributed in the hope that it will be useful,
30
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
+ * GNU General Public License for more details.
33
+ *
34
+ * You should have received a copy of the GNU General Public License
35
+ * along with this program; if not, write to the Free software
36
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37
+ */
38
+
39
+ /*----------------------------------------------------------------------------------------------------------
40
+ Define some useful plugin constants
41
+ -----------------------------------------------------------------------------------------------------------*/
42
+
43
+ define( 'SPEED_BOOSTER_PACK_PATH', plugin_dir_path( __FILE__ ) );
44
+ define( 'SPEED_BOOSTER_PACK_URL', plugin_dir_url( __FILE__ ) );
45
+ define( 'SPEED_BOOSTER_PACK_VERSION', '3.8' );
46
+ // Defining css position
47
+ define( 'SBP_FOOTER', 10 );
48
+ // Defining css last position
49
+ define( 'SBP_FOOTER_LAST', 99999 );
50
+
51
+ /*----------------------------------------------------------------------------------------------------------
52
+ Global Variables
53
+ -----------------------------------------------------------------------------------------------------------*/
54
+
55
+ $sbp_options = get_option( 'sbp_settings' ); // retrieve the plugin settings from the options table
56
+
57
+ /*----------------------------------------------------------------------------------------------------------
58
+ Main Plugin Class
59
+ -----------------------------------------------------------------------------------------------------------*/
60
+
61
+ if ( ! class_exists( 'Speed_Booster_Pack' ) ) {
62
+
63
+ class Speed_Booster_Pack {
64
+
65
+ /*----------------------------------------------------------------------------------------------------------
66
+ Function Construct
67
+ -----------------------------------------------------------------------------------------------------------*/
68
+
69
+ public function __construct() {
70
+ global $sbp_options;
71
+
72
+ // Enqueue admin scripts
73
+ add_action( 'admin_enqueue_scripts', array( $this, 'sbp_admin_enqueue_scripts' ) );
74
+
75
+ // load plugin textdomain
76
+ add_action( 'plugins_loaded', array( $this, 'sbp_load_translation' ) );
77
+
78
+ add_action( 'admin_notices', array( &$this, 'sbp_display_notices' ) );
79
+ add_action( 'wp_ajax_sbp_dismiss_notices', array( &$this, 'sbp_dismiss_notices' ) );
80
+
81
+ // Load plugin settings page
82
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/settings.php' );
83
+ $Speed_Booster_Pack_Options = new Speed_Booster_Pack_Options();
84
+
85
+ // Load main plugin functions
86
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/core.php' );
87
+ $Speed_Booster_Pack_Core = new Speed_Booster_Pack_Core();
88
+
89
+ // Enqueue admin style
90
+ add_action( 'admin_enqueue_scripts', array( $this, 'sbp_enqueue_styles' ) );
91
+
92
+
93
+ // Filters
94
+ $this->path = plugin_basename( __FILE__ );
95
+ add_filter( "plugin_action_links_$this->path", array( $this, 'sbp_settings_link' ) );
96
+
97
+
98
+ } // END public function __construct
99
+
100
+ /*----------------------------------------------------------------------------------------------------------
101
+ Load plugin textdomain
102
+ -----------------------------------------------------------------------------------------------------------*/
103
+
104
+ function sbp_load_translation() {
105
+ load_plugin_textdomain( 'speed-booster-pack', false, SPEED_BOOSTER_PACK_PATH . '/lang/' );
106
+ }
107
+
108
+
109
+ /*----------------------------------------------------------------------------------------------------------
110
+ Display/dismiss admin notices if needed
111
+ -----------------------------------------------------------------------------------------------------------*/
112
+
113
+ function sbp_display_notices() {
114
+ if ( ! get_option( 'sbp_news' ) ) {
115
+ global $sbp_settings_page;
116
+ $screen = get_current_screen();
117
+ if ( $screen->id != $sbp_settings_page ) {
118
+ require_once( SPEED_BOOSTER_PACK_PATH . 'inc/template/notice.php' );
119
+ }
120
+ }
121
+ }
122
+
123
+ function sbp_dismiss_notices() {
124
+ update_option( 'sbp_news', true );
125
+
126
+ return json_encode( array( "Status" => 0 ) );
127
+ }
128
+
129
+ /*----------------------------------------------------------------------------------------------------------
130
+ Activate the plugin
131
+ -----------------------------------------------------------------------------------------------------------*/
132
+
133
+ public static function sbp_activate() {
134
+ $sbp_options = get_option( 'sbp_settings', '' );
135
+
136
+ $url = get_site_url();
137
+ $response = wp_remote_get( $url, array() );
138
+
139
+ $get_enqueued_scripts_handle = get_option( 'all_theme_scripts_handle' );
140
+ $get_enqueued_scripts_src = get_option( 'all_theme_scripts_src' );
141
+ $get_enqueued_styles_handle = get_option( 'all_theme_styles_handle' );
142
+
143
+ if ( get_option( 'all_theme_scripts_handle' ) == '' ) {
144
+ update_option( 'all_theme_scripts_handle', $get_enqueued_scripts_handle );
145
+ }
146
+
147
+ if ( get_option( 'all_theme_scripts_src' ) == '' ) {
148
+ update_option( 'all_theme_scripts_src', $get_enqueued_scripts_src );
149
+ }
150
+
151
+ if ( get_option( 'all_theme_styles_handle' ) == '' ) {
152
+ update_option( 'all_theme_styles_handle', $get_enqueued_styles_handle );
153
+ }
154
+
155
+ } // END public static function sb_activate
156
+
157
+
158
+ /*----------------------------------------------------------------------------------------------------------
159
+ Deactivate the plugin
160
+ -----------------------------------------------------------------------------------------------------------*/
161
+
162
+ public static function sbp_deactivate() {
163
+ }
164
+
165
+
166
+ /*----------------------------------------------------------------------------------------------------------
167
+ CSS style of the plugin options page
168
+ -----------------------------------------------------------------------------------------------------------*/
169
+
170
+ function sbp_enqueue_styles( $hook ) {
171
+
172
+ // load stylesheet only on plugin options page
173
+ global $sbp_settings_page;
174
+ if ( $hook != $sbp_settings_page ) {
175
+ return;
176
+ }
177
+ wp_enqueue_style( 'sbp-styles', plugin_dir_url( __FILE__ ) . 'css/style.css' );
178
+ wp_enqueue_style( 'jquery-ui', plugin_dir_url( __FILE__ ) . 'css/vendors/jquery-ui/jquery-ui.min.css' );
179
+
180
+ } // End function sbp_enqueue_styles
181
+
182
+
183
+ /*----------------------------------------------------------------------------------------------------------
184
+ Enqueue admin scripts to plugin options page
185
+ -----------------------------------------------------------------------------------------------------------*/
186
+
187
+ public function sbp_admin_enqueue_scripts( $hook_sbp ) {
188
+ // load scripts only on plugin options page
189
+ global $sbp_settings_page;
190
+ if ( $hook_sbp != $sbp_settings_page ) {
191
+ return;
192
+ }
193
+ wp_enqueue_script( 'jquery-ui-slider' );
194
+ wp_enqueue_script( 'postbox' );
195
+
196
+ wp_enqueue_script( 'sbp-admin-scripts', plugins_url( 'inc/js/admin-scripts.js', __FILE__ ), array(
197
+ 'jquery',
198
+ 'postbox',
199
+ 'jquery-ui-slider',
200
+ ), SPEED_BOOSTER_PACK_VERSION, true );
201
+
202
+ wp_enqueue_script( 'sbp-plugin-install', plugins_url( 'inc/js/plugin-install.js', __FILE__ ), array(
203
+ 'jquery',
204
+ 'updates',
205
+ ), SPEED_BOOSTER_PACK_VERSION, true );
206
+
207
+ }
208
+
209
+
210
+ /*----------------------------------------------------------------------------------------------------------
211
+ Add settings link on plugins page
212
+ -----------------------------------------------------------------------------------------------------------*/
213
+
214
+ function sbp_settings_link( $links ) {
215
+ $pro_link = ' <a href="https://optimocha.com/?ref=sbp" target="_blank">Pro Help</a > ';
216
+ $settings_link = ' <a href="admin.php?page=sbp-options">Settings</a > ';
217
+ array_unshift( $links, $settings_link );
218
+ array_unshift( $links, $pro_link );
219
+
220
+ return $links;
221
+
222
+ } // End function sbp_settings_link
223
+ }// End class Speed_Booster_Pack
224
+ } // End if (!class_exists("Speed_Booster_Pack")) (1)
225
+
226
+ if ( class_exists( 'Speed_Booster_Pack' ) ) {
227
+
228
+ // Installation and uninstallation hooks
229
+ register_activation_hook( __FILE__, array( 'Speed_Booster_Pack', 'sbp_activate' ) );
230
+ register_deactivation_hook( __FILE__, array( 'Speed_Booster_Pack', 'sbp_deactivate' ) );
231
+
232
+ // instantiate the plugin class
233
+ $speed_booster_pack = new Speed_Booster_Pack();
234
+
235
+ } // End if (!class_exists("Speed_Booster_Pack")) (2)
236
+
237
+ // make sure to update the path to where you cloned the projects to!
238
+
239
+ //review function
240
+ function sb_pack_check_for_review() {
241
+ if ( ! is_admin() ) {
242
+ return;
243
+ }
244
+ require_once SPEED_BOOSTER_PACK_PATH . 'inc/class-sb-pack-review.php';
245
+
246
+ SB_Pack_Review::get_instance( array(
247
+ 'slug' => 'speed-booster-pack',
248
+ ) );
249
+ }
250
+
251
+ sb_pack_check_for_review();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
widgets/dashboard-widget.php DELETED
@@ -1,70 +0,0 @@
1
- <?Php
2
-
3
- // WordPress Events and News
4
- wp_add_dashboard_widget( 'sbp_dashboard_primary', __( 'Speed Booster Pack Overview' ), 'sbp_dashboard_events_news' );
5
-
6
-
7
- /**
8
- * Renders the Events and News dashboard widget.
9
- *
10
- * @since 3.7
11
- */
12
- function sbp_dashboard_events_news() {
13
-
14
- ?>
15
-
16
- <div class="wordpress-news hide-if-no-js">
17
- <?php sbp_dashboard_widget(); ?>
18
- </div>
19
-
20
-
21
- <!--
22
- <p class="community-events-footer">
23
- see this:
24
- - https://github.com/WordPress/WordPress/blob/921e131eae45801b8fdb1ecfceb5d7839fdfd509/wp-admin/includes/dashboard.php#L1124-L1159
25
- - https://codex.wordpress.org/Dashboard_Widgets_API#Advanced:_Forcing_your_widget_to_the_top
26
-
27
- </p>
28
- -->
29
-
30
- <?php
31
- }
32
-
33
-
34
- /**
35
- * 'WordPress Events and News' dashboard widget.
36
- *
37
- * @since 3.7
38
- */
39
- function sbp_dashboard_widget() {
40
- $feeds = array(
41
- 'news' => array(
42
- 'link' => apply_filters( 'sbp_dashboard_primary_link', __( 'https://www.machothemes.com/' ) ),
43
- 'url' => apply_filters( 'sbp_dashboard_primary_feed', __( 'https://www.machothemes.com/blog/feed/' ) ),
44
- 'title' => apply_filters( 'sbp_dashboard_primary_title', __( 'Speed Booster Pack Overview' ) ),
45
- 'items' => 3,
46
- 'show_summary' => 1,
47
- 'show_author' => 0,
48
- 'show_date' => 0,
49
- ),
50
- );
51
-
52
- sbp_dashboard_primary_output( 'sbp_dashboard_primary', $feeds );
53
- }
54
-
55
- /**
56
- * Display the WordPress events and news feeds.
57
- *
58
- * @since 3.7
59
- *
60
- * @param string $widget_id Widget ID.
61
- * @param array $feeds Array of RSS feeds.
62
- */
63
- function sbp_dashboard_primary_output( $widget_id, $feeds ) {
64
- foreach ( $feeds as $type => $args ) {
65
- $args['type'] = $type;
66
- echo '<div class="rss-widget">';
67
- wp_widget_rss_output( $args['url'], $args );
68
- echo '</div>';
69
- }
70
- }