Simple Author Box - Version 2.0.6

Version Description

Download this release

Release Info

Developer machothemes
Plugin Icon 128x128 Simple Author Box
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

assets/css/sabox-admin-style.css CHANGED
@@ -1,267 +1,277 @@
1
  /* ADMIN PLUGIN STYLE
2
  -------------------------------------------------------------- */
3
  .sabox-table.form-table th {
4
- width: 400px;
5
- padding: 10px 15px;
6
- vertical-align: middle;
7
  }
8
 
9
  .sabox-table.form-table {
10
- margin-bottom: 30px;
11
  }
12
 
13
  .sabox-table .epfw-tooltip {
14
- color: #b8cad7;
15
- margin-right: 10px;
16
  }
17
 
18
- .sabox-table .wp-picker-container {text-align: right;}
 
 
19
 
20
- .sabox-table .wp-picker-holder {position: absolute; }
 
 
21
 
22
- .sabox-table select {float: right;}
 
 
23
 
24
  .sabox-table.form-table tr {
25
- background-color: #fff;
26
- border-bottom: 1px solid #eee;
27
- vertical-align: middle !important;
28
  }
29
 
30
- .sabox-table tbody {border: 1px solid #ddd;}
 
 
31
 
32
- .sabox-table.form-table tr:last-of-type {border-bottom: 0;}
 
 
33
 
34
  .sabox-wrap {
35
- max-width: 860px;
36
- padding-left: 20px;
37
- margin: 0 auto;
38
  }
39
 
40
  .hide {
41
- display: none;
42
  }
43
 
44
  /*.sabox-slider-container .saboxfield {
45
  display: none;
46
  }*/
47
  .sabox-slider-container {
48
- max-width: 390px;
49
- padding-bottom: 5px;
50
- box-sizing: border-box;
51
  }
52
 
53
  .sabox-slider-container .ui-slider .ui-slider-handle {
54
- width: auto;
55
- text-align: center;
56
- min-width: 1.2em;
57
  }
58
 
59
  .sabox-table p.description {
60
- font-weight: normal;
61
  }
62
 
63
  .wp-admin .checkbox_switch {
64
- display: inline-block;
65
- width: 100%;
66
- text-align: right;
67
  }
68
 
69
  .customize-control-title.onoffswitch_label {
70
- width: 71%;
71
  }
72
 
73
  .sabox-table .onoffswitch_label {
74
- display: inline-block;
75
- vertical-align: top;
76
- margin-right: 21px;
77
- margin-top: -1px;
78
  }
79
 
80
  .sabox-table .onoffswitch {
81
- position: relative;
82
- width: 52px;
83
- display: inline-block;
84
- -webkit-user-select: none;
85
- -moz-user-select: none;
86
- -ms-user-select: none;
87
  }
88
 
89
  .sabox-table .onoffswitch-checkbox {
90
- display: none !important;
91
  }
92
 
93
  .sabox-table .onoffswitch-label {
94
- display: block;
95
- overflow: hidden;
96
- cursor: pointer;
97
- height: 22px;
98
- padding: 0;
99
- line-height: 19px;
100
- transition: background-color 0.2s ease-in;
101
- -webkit-border-radius: 11px;
102
- -moz-border-radius: 11px;
103
- border-radius: 30px;
104
- background-color: #c4c4c4;
105
- -webkit-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
106
- -moz-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
107
- box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
108
  }
109
 
110
  .sabox-table .onoffswitch-label:before {
111
- content: "";
112
- display: block;
113
- width: 18px;
114
- height: 18px;
115
- margin: 0;
116
- position: absolute;
117
- top: 2px;
118
- bottom: 0;
119
- right: 32px;
120
- background-color: #fff;
121
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
122
- -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
123
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
124
- -webkit-border-radius: 10px;
125
- -moz-border-radius: 10px;
126
- border-radius: 10px;
127
- transition: all 0.2s ease-in 0s;
128
  }
129
 
130
  .sabox-table .onoffswitch-label:after {
131
- content: "OFF";
132
- display: block;
133
- color: #fff;
134
- position: absolute;
135
- top: 2px;
136
- bottom: 2px;
137
- right: 6px;
138
- font-size: 11px;
139
- font-family: 'Arial';
140
  }
141
 
142
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label {
143
- background-color: #3caf0e;
144
  }
145
 
146
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label,
147
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:before {
148
- border-color: #3caf0e;
149
  }
150
 
151
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:before {
152
- right: 2px;
153
  }
154
 
155
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:after {
156
- content: "ON";
157
- display: block;
158
- color: #fff;
159
- position: absolute;
160
- top: 2px;
161
- bottom: 2px;
162
- right: 27px;
163
- font-size: 11px;
164
- font-family: 'Arial';
165
  }
166
 
167
  .sabox-table .slider-container {
168
- position: relative;
169
- padding-left: 50px;
170
  }
171
 
172
  .sabox-table .slider-container input[type="text"] {
173
- border: none;
174
- text-align: center;
175
- padding: 2px;
176
- margin: 0;
177
- font-size: 12px;
178
- color: #333;
179
- border-radius: 10px;
180
- background-color: #f8f8f8;
181
- -webkit-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
182
- -moz-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
183
- box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
184
- width: 42px;
185
- height: 22px;
186
- position: absolute;
187
- left: 0;
188
- top: 2px;
189
  }
190
 
191
  .sabox-table .slider-container .ui-slider {
192
- position: relative;
193
- text-align: left;
194
- height: 2px;
195
- border-radius: 3px;
196
- border: none;
197
- margin-top: 10px;
198
- margin-left: 22px;
199
- display: inline-block;
200
- width: 97%;
201
- background: #d6d6d6;
202
  }
203
 
204
  .sabox-table .slider-container .ui-slider .ui-slider-handle {
205
- position: absolute;
206
- z-index: 2;
207
- top: -10px;
208
- cursor: default;
209
- -ms-touch-action: none;
210
- touch-action: none;
211
- width: 18px;
212
- height: 18px;
213
- -webkit-border-radius: 9px;
214
- -moz-border-radius: 9px;
215
- border-radius: 9px;
216
- background-color: #fff;
217
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
218
- -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
219
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
220
- border: solid 1px #d7d7d7;
221
- transform: translateX(-50%);
222
  }
223
 
224
  .sabox-table .slider-container .ui-slider .ui-slider-range {
225
- position: absolute;
226
- z-index: 1;
227
- font-size: 0.7em;
228
- display: block;
229
- border: 0;
230
- background-position: 0 0;
231
- background: #e04d43;
232
- top: 0;
233
- bottom: 0;
234
  }
235
 
236
  /* Social Links */
237
  .sabox-add-social-link {
238
- text-align: center;
239
- padding: 10px 0;
240
- max-width: 570px;
241
  }
242
 
243
  .sabox-add-social-link:hover {
244
- border-color: #000;
245
  }
246
 
247
  #sabox-social-table .dashicons-trash {
248
- vertical-align: middle;
249
- cursor: pointer;
250
- color: #a00;
251
  }
252
 
253
  #sabox-social-table .dashicons-trash:hover {
254
- color: #dc3232;
255
  }
256
 
257
  /* Simple Author Box Badge */
258
  #sab-current-image img {
259
- max-width: 130px;
260
- height: auto;
261
  }
262
 
263
  .checkbox-label {
264
- text-transform: capitalize;
265
  }
266
 
267
  /* EPFW Styles
@@ -272,175 +282,314 @@
272
 
273
  /* tab styling */
274
  .epfw-tab-wrapper.nav-tab-wrapper {
275
- background: #fff;
276
- padding: 0;
277
- border: 1px solid #ddd;
278
- text-align: center;
279
- margin-bottom: 40px;
280
  }
281
 
282
  .epfw-tab.nav-tab {
283
- background: #fff;
284
- border: 0;
285
- display: inline-block;
286
- margin-right: 20px;
287
- margin-left: 0;
288
- padding: 10px;
289
- border-bottom: 2px solid transparent;
290
- color: #0073aa;
291
- font-weight: 400;
292
  }
293
 
294
  .epfw-tab.nav-tab.nav-tab-active {
295
- border-bottom: 2px solid #2e4453;
296
- color: #2e4453;
297
  }
298
 
299
  /* admin options page styling */
300
  .masthead {
301
- background-color: #fff;
302
- text-align: center;
303
- box-shadow: 0 1px 0 rgba(200, 215, 225, 0.5), 0 1px 2px #ddd;
304
- margin-bottom: 40px;
305
- padding: 20px;
306
  }
307
 
308
  .masthead h1 {
309
- margin: 0;
310
- padding: 0;
311
- display: inline-block;
312
- font-size: 20px;
313
- color: #000;
314
- font-weight: 500;
315
  }
316
 
317
  .masthead a {
318
- display: inline-block;
319
- margin: 0 10px;
320
- text-decoration: none;
321
  }
322
 
323
  .sabox-version {
324
- margin: 20px auto;
325
- padding: 20px 0;
326
- display: block;
327
- text-align: center;
328
- border-bottom: 1px solid #ddd;
329
- border-top: 1px solid #ddd;
330
  }
331
 
332
  body.toplevel_page_simple-author-box-options {
333
- background-color: #f3f6f8;
334
  }
335
 
336
  body.toplevel_page_simple-author-box-options #wpcontent {
337
- padding-left: 0;
338
  }
339
 
340
  .sabox-masthead-left,
341
  .sabox-masthead-right {
342
- display: inline-block;
343
  }
344
 
345
- .sabox-masthead-left {float: left;}
 
 
346
 
347
- .sabox-masthead-right {float: right;}
 
 
348
 
349
  /* tooltips styling */
350
  .epfw-tooltip {
351
- position: relative;
352
- display: inline;
353
- margin-right: 10px;
354
  }
355
 
356
  .epfw-tooltip:after {
357
- font-weight: 400;
358
- display: block;
359
- visibility: hidden;
360
- position: absolute;
361
- bottom: 0;
362
- left: 20%;
363
- opacity: 0;
364
- content: attr(data-tooltip); /* might also use attr(title) */
365
- height: auto;
366
- min-width: 300px;
367
- z-index: 999;
368
- text-decoration: none;
369
- text-align: center;
370
- border: 1px solid #c8d7e1;
371
- border-radius: 4px;
372
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 0 56px rgba(0, 0, 0, 0.075);
373
- background: #fff;
374
- color: #4f748e;
375
- font-size: 13px;
376
- padding: 16px;
377
  }
378
 
379
  .epfw-tooltip:before {
380
- position: absolute;
381
- visibility: hidden;
382
- width: 0;
383
- height: 0;
384
- left: 50%;
385
- bottom: 0px;
386
- opacity: 0;
387
- content: "";
388
- border-style: solid;
389
- border-width: 6px 6px 0 6px;
390
- border-color: rgba(255, 255, 255, 0.85) transparent transparent transparent;
391
  }
392
 
393
- .epfw-tooltip:hover:after { visibility: visible; opacity: 1; bottom: 20px; }
 
 
 
 
394
 
395
- .epfw-tooltip:hover:before { visibility: visible; opacity: 1; bottom: 14px; }
 
 
 
 
396
 
397
  /* radio group styling */
398
  .sabox-table input[type="radio"] {
399
- display: none;
400
- margin: 10px;
401
  }
402
 
403
  .sabox-table input[type="radio"] + label {
404
- margin: .25em 0 .5em !important;
405
- min-width: 100px;
406
- display: inline-block;
407
- padding: 4px 12px;
408
- font-size: 14px;
409
- line-height: 20px;
410
- color: #333;
411
- text-align: center;
412
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
413
- vertical-align: middle;
414
- cursor: pointer;
415
- background-color: #f5f5f5;
416
- background-image: -moz-linear-gradient(top, #fff, #e6e6e6);
417
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));
418
- background-image: -webkit-linear-gradient(top, #fff, #e6e6e6);
419
- background-image: -o-linear-gradient(top, #fff, #e6e6e6);
420
- background-image: linear-gradient(to bottom, #fff, #e6e6e6);
421
- background-repeat: repeat-x;
422
- border: 1px solid #ccc;
423
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
424
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
425
- border-bottom-color: #b3b3b3;
426
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
427
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
428
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
429
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
430
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
431
  }
432
 
433
  .sabox-table input[type="radio"]:checked + label {
434
- background-image: none;
435
- outline: 0;
436
- -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
437
- -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
438
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
439
- background-color: #e0e0e0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  }
441
 
442
- .sabox-radio-group {text-align: right;}
 
 
 
 
443
 
444
- .sabox-multicheckbox {text-align: right;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
 
446
- .sabox-multicheckbox > div {display: inline-block; margin-left: 10px;}
 
 
 
 
 
1
  /* ADMIN PLUGIN STYLE
2
  -------------------------------------------------------------- */
3
  .sabox-table.form-table th {
4
+ width: 400px;
5
+ padding: 10px 15px;
6
+ vertical-align: middle;
7
  }
8
 
9
  .sabox-table.form-table {
10
+ margin-bottom: 30px;
11
  }
12
 
13
  .sabox-table .epfw-tooltip {
14
+ color: #b8cad7;
15
+ margin-right: 10px;
16
  }
17
 
18
+ .sabox-table .wp-picker-container {
19
+ text-align: right;
20
+ }
21
 
22
+ .sabox-table .wp-picker-holder {
23
+ position: absolute;
24
+ }
25
 
26
+ .sabox-table select {
27
+ float: right;
28
+ }
29
 
30
  .sabox-table.form-table tr {
31
+ background-color: #fff;
32
+ border-bottom: 1px solid #eee;
33
+ vertical-align: middle !important;
34
  }
35
 
36
+ .sabox-table tbody {
37
+ border: 1px solid #ddd;
38
+ }
39
 
40
+ .sabox-table.form-table tr:last-of-type {
41
+ border-bottom: 0;
42
+ }
43
 
44
  .sabox-wrap {
45
+ max-width: 860px;
46
+ padding-left: 20px;
47
+ margin: 0 auto;
48
  }
49
 
50
  .hide {
51
+ display: none;
52
  }
53
 
54
  /*.sabox-slider-container .saboxfield {
55
  display: none;
56
  }*/
57
  .sabox-slider-container {
58
+ max-width: 390px;
59
+ padding-bottom: 5px;
60
+ box-sizing: border-box;
61
  }
62
 
63
  .sabox-slider-container .ui-slider .ui-slider-handle {
64
+ width: auto;
65
+ text-align: center;
66
+ min-width: 1.2em;
67
  }
68
 
69
  .sabox-table p.description {
70
+ font-weight: normal;
71
  }
72
 
73
  .wp-admin .checkbox_switch {
74
+ display: inline-block;
75
+ width: 100%;
76
+ text-align: right;
77
  }
78
 
79
  .customize-control-title.onoffswitch_label {
80
+ width: 71%;
81
  }
82
 
83
  .sabox-table .onoffswitch_label {
84
+ display: inline-block;
85
+ vertical-align: top;
86
+ margin-right: 21px;
87
+ margin-top: -1px;
88
  }
89
 
90
  .sabox-table .onoffswitch {
91
+ position: relative;
92
+ width: 52px;
93
+ display: inline-block;
94
+ -webkit-user-select: none;
95
+ -moz-user-select: none;
96
+ -ms-user-select: none;
97
  }
98
 
99
  .sabox-table .onoffswitch-checkbox {
100
+ display: none !important;
101
  }
102
 
103
  .sabox-table .onoffswitch-label {
104
+ display: block;
105
+ overflow: hidden;
106
+ cursor: pointer;
107
+ height: 22px;
108
+ padding: 0;
109
+ line-height: 19px;
110
+ transition: background-color 0.2s ease-in;
111
+ -webkit-border-radius: 11px;
112
+ -moz-border-radius: 11px;
113
+ border-radius: 30px;
114
+ background-color: #c4c4c4;
115
+ -webkit-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
116
+ -moz-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
117
+ box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
118
  }
119
 
120
  .sabox-table .onoffswitch-label:before {
121
+ content: "";
122
+ display: block;
123
+ width: 18px;
124
+ height: 18px;
125
+ margin: 0;
126
+ position: absolute;
127
+ top: 2px;
128
+ bottom: 0;
129
+ right: 32px;
130
+ background-color: #fff;
131
+ -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
132
+ -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
133
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
134
+ -webkit-border-radius: 10px;
135
+ -moz-border-radius: 10px;
136
+ border-radius: 10px;
137
+ transition: all 0.2s ease-in 0s;
138
  }
139
 
140
  .sabox-table .onoffswitch-label:after {
141
+ content: "OFF";
142
+ display: block;
143
+ color: #fff;
144
+ position: absolute;
145
+ top: 2px;
146
+ bottom: 2px;
147
+ right: 6px;
148
+ font-size: 11px;
149
+ font-family: 'Arial';
150
  }
151
 
152
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label {
153
+ background-color: #3caf0e;
154
  }
155
 
156
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label,
157
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:before {
158
+ border-color: #3caf0e;
159
  }
160
 
161
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:before {
162
+ right: 2px;
163
  }
164
 
165
  .sabox-table .onoffswitch-checkbox:checked + .onoffswitch-label:after {
166
+ content: "ON";
167
+ display: block;
168
+ color: #fff;
169
+ position: absolute;
170
+ top: 2px;
171
+ bottom: 2px;
172
+ right: 27px;
173
+ font-size: 11px;
174
+ font-family: 'Arial';
175
  }
176
 
177
  .sabox-table .slider-container {
178
+ position: relative;
179
+ padding-left: 50px;
180
  }
181
 
182
  .sabox-table .slider-container input[type="text"] {
183
+ border: none;
184
+ text-align: center;
185
+ padding: 2px;
186
+ margin: 0;
187
+ font-size: 12px;
188
+ color: #333;
189
+ border-radius: 10px;
190
+ background-color: #f8f8f8;
191
+ -webkit-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
192
+ -moz-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
193
+ box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
194
+ width: 42px;
195
+ height: 22px;
196
+ position: absolute;
197
+ left: 0;
198
+ top: 2px;
199
  }
200
 
201
  .sabox-table .slider-container .ui-slider {
202
+ position: relative;
203
+ text-align: left;
204
+ height: 2px;
205
+ border-radius: 3px;
206
+ border: none;
207
+ margin-top: 10px;
208
+ margin-left: 22px;
209
+ display: inline-block;
210
+ width: 97%;
211
+ background: #d6d6d6;
212
  }
213
 
214
  .sabox-table .slider-container .ui-slider .ui-slider-handle {
215
+ position: absolute;
216
+ z-index: 2;
217
+ top: -10px;
218
+ cursor: default;
219
+ -ms-touch-action: none;
220
+ touch-action: none;
221
+ width: 18px;
222
+ height: 18px;
223
+ -webkit-border-radius: 9px;
224
+ -moz-border-radius: 9px;
225
+ border-radius: 9px;
226
+ background-color: #fff;
227
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
228
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
229
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
230
+ border: solid 1px #d7d7d7;
231
+ transform: translateX(-50%);
232
  }
233
 
234
  .sabox-table .slider-container .ui-slider .ui-slider-range {
235
+ position: absolute;
236
+ z-index: 1;
237
+ font-size: 0.7em;
238
+ display: block;
239
+ border: 0;
240
+ background-position: 0 0;
241
+ background: #e04d43;
242
+ top: 0;
243
+ bottom: 0;
244
  }
245
 
246
  /* Social Links */
247
  .sabox-add-social-link {
248
+ text-align: center;
249
+ padding: 10px 0;
250
+ max-width: 570px;
251
  }
252
 
253
  .sabox-add-social-link:hover {
254
+ border-color: #000;
255
  }
256
 
257
  #sabox-social-table .dashicons-trash {
258
+ vertical-align: middle;
259
+ cursor: pointer;
260
+ color: #a00;
261
  }
262
 
263
  #sabox-social-table .dashicons-trash:hover {
264
+ color: #dc3232;
265
  }
266
 
267
  /* Simple Author Box Badge */
268
  #sab-current-image img {
269
+ max-width: 130px;
270
+ height: auto;
271
  }
272
 
273
  .checkbox-label {
274
+ text-transform: capitalize;
275
  }
276
 
277
  /* EPFW Styles
282
 
283
  /* tab styling */
284
  .epfw-tab-wrapper.nav-tab-wrapper {
285
+ background: #fff;
286
+ padding: 0;
287
+ border: 1px solid #ddd;
288
+ text-align: center;
289
+ margin-bottom: 40px;
290
  }
291
 
292
  .epfw-tab.nav-tab {
293
+ background: #fff;
294
+ border: 0;
295
+ display: inline-block;
296
+ margin-right: 20px;
297
+ margin-left: 0;
298
+ padding: 10px;
299
+ border-bottom: 2px solid transparent;
300
+ color: #0073aa;
301
+ font-weight: 400;
302
  }
303
 
304
  .epfw-tab.nav-tab.nav-tab-active {
305
+ border-bottom: 2px solid #2e4453;
306
+ color: #2e4453;
307
  }
308
 
309
  /* admin options page styling */
310
  .masthead {
311
+ background-color: #fff;
312
+ text-align: center;
313
+ box-shadow: 0 1px 0 rgba(200, 215, 225, 0.5), 0 1px 2px #ddd;
314
+ margin-bottom: 40px;
315
+ padding: 20px;
316
  }
317
 
318
  .masthead h1 {
319
+ margin: 0;
320
+ padding: 0;
321
+ display: inline-block;
322
+ font-size: 20px;
323
+ color: #000;
324
+ font-weight: 500;
325
  }
326
 
327
  .masthead a {
328
+ display: inline-block;
329
+ margin: 0 10px;
330
+ text-decoration: none;
331
  }
332
 
333
  .sabox-version {
334
+ margin: 20px auto;
335
+ padding: 20px 0;
336
+ display: block;
337
+ text-align: center;
338
+ border-bottom: 1px solid #ddd;
339
+ border-top: 1px solid #ddd;
340
  }
341
 
342
  body.toplevel_page_simple-author-box-options {
343
+ background-color: #f3f6f8;
344
  }
345
 
346
  body.toplevel_page_simple-author-box-options #wpcontent {
347
+ padding-left: 0;
348
  }
349
 
350
  .sabox-masthead-left,
351
  .sabox-masthead-right {
352
+ display: inline-block;
353
  }
354
 
355
+ .sabox-masthead-left {
356
+ float: left;
357
+ }
358
 
359
+ .sabox-masthead-right {
360
+ float: right;
361
+ }
362
 
363
  /* tooltips styling */
364
  .epfw-tooltip {
365
+ position: relative;
366
+ display: inline;
367
+ margin-right: 10px;
368
  }
369
 
370
  .epfw-tooltip:after {
371
+ font-weight: 400;
372
+ display: block;
373
+ visibility: hidden;
374
+ position: absolute;
375
+ bottom: 0;
376
+ left: 20%;
377
+ opacity: 0;
378
+ content: attr(data-tooltip); /* might also use attr(title) */
379
+ height: auto;
380
+ min-width: 300px;
381
+ z-index: 999;
382
+ text-decoration: none;
383
+ text-align: center;
384
+ border: 1px solid #c8d7e1;
385
+ border-radius: 4px;
386
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 0 56px rgba(0, 0, 0, 0.075);
387
+ background: #fff;
388
+ color: #4f748e;
389
+ font-size: 13px;
390
+ padding: 16px;
391
  }
392
 
393
  .epfw-tooltip:before {
394
+ position: absolute;
395
+ visibility: hidden;
396
+ width: 0;
397
+ height: 0;
398
+ left: 50%;
399
+ bottom: 0px;
400
+ opacity: 0;
401
+ content: "";
402
+ border-style: solid;
403
+ border-width: 6px 6px 0 6px;
404
+ border-color: rgba(255, 255, 255, 0.85) transparent transparent transparent;
405
  }
406
 
407
+ .epfw-tooltip:hover:after {
408
+ visibility: visible;
409
+ opacity: 1;
410
+ bottom: 20px;
411
+ }
412
 
413
+ .epfw-tooltip:hover:before {
414
+ visibility: visible;
415
+ opacity: 1;
416
+ bottom: 14px;
417
+ }
418
 
419
  /* radio group styling */
420
  .sabox-table input[type="radio"] {
421
+ display: none;
422
+ margin: 10px;
423
  }
424
 
425
  .sabox-table input[type="radio"] + label {
426
+ margin: .25em 0 .5em !important;
427
+ min-width: 100px;
428
+ display: inline-block;
429
+ padding: 4px 12px;
430
+ font-size: 14px;
431
+ line-height: 20px;
432
+ color: #333;
433
+ text-align: center;
434
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
435
+ vertical-align: middle;
436
+ cursor: pointer;
437
+ background-color: #f5f5f5;
438
+ background-image: -moz-linear-gradient(top, #fff, #e6e6e6);
439
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));
440
+ background-image: -webkit-linear-gradient(top, #fff, #e6e6e6);
441
+ background-image: -o-linear-gradient(top, #fff, #e6e6e6);
442
+ background-image: linear-gradient(to bottom, #fff, #e6e6e6);
443
+ background-repeat: repeat-x;
444
+ border: 1px solid #ccc;
445
+ border-color: #e6e6e6 #e6e6e6 #bfbfbf;
446
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
447
+ border-bottom-color: #b3b3b3;
448
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
449
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
450
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
451
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
452
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
453
  }
454
 
455
  .sabox-table input[type="radio"]:checked + label {
456
+ background-image: none;
457
+ outline: 0;
458
+ -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
459
+ -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
460
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
461
+ background-color: #e0e0e0;
462
+ }
463
+
464
+ .sabox-radio-group {
465
+ text-align: right;
466
+ }
467
+
468
+ .sabox-multicheckbox {
469
+ text-align: right;
470
+ }
471
+
472
+ .sabox-multicheckbox > div {
473
+ display: inline-block;
474
+ margin-left: 10px;
475
+ }
476
+
477
+ /* Upsell */
478
+ a.upgrade-pro {
479
+ float: right;
480
+ color: red !important;
481
+ margin-right: 0 !important;
482
+ text-decoration: none;
483
+ font-size: 14px;
484
+ padding: 12px;
485
+ }
486
+
487
+ a.upgrade-pro:after {
488
+ font-family: 'dashicons';
489
+ content: '\f155';
490
+ margin-left: 7px;
491
+ vertical-align: middle;
492
+ }
493
+
494
+ .wp-has-submenu a[href*="admin.php?page=sab-upgrade"] {
495
+ color: red !important;
496
+ }
497
+
498
+ .wp-has-submenu a[href*="admin.php?page=sab-upgrade"]:after {
499
+ font-family: 'dashicons';
500
+ content: '\f155';
501
+ margin-left: 7px;
502
+ vertical-align: middle;
503
+ }
504
+
505
+ /* Lite vs PRO SEction */
506
+ .featured-section.features .row {
507
+ display: inline-block;
508
+ width: 97%;
509
+ padding: 15px;
510
+ border-bottom: 1px solid rgba(0, 0, 0, .06);
511
+ }
512
+
513
+ .featured-section.features .row .dashicons-yes {
514
+ color: #2cbe4e;
515
+ }
516
+
517
+ .featured-section.features .row .dashicons-no-alt {
518
+ color: #FF3D2E;
519
+ }
520
+
521
+ .featured-section.features .row > div {
522
+ display: inline-block;
523
+ float: left;
524
+ width: 15%;
525
+ text-align: center;
526
+ }
527
+
528
+ .featured-section.features .row > .feature {
529
+ width: 70%;
530
+ text-align: left;
531
  }
532
 
533
+ .featured-section .free-pro-table {
534
+ border-spacing: 0;
535
+ width: 100%;
536
+ margin-top: 40px;
537
+ }
538
 
539
+ .featured-section .free-pro-table th {
540
+ padding-bottom: 20px;
541
+ }
542
+
543
+ .featured-section .free-pro-table td {
544
+ border-top: 1px solid #ccc;
545
+ padding: 20px 0 25px;
546
+ }
547
+
548
+ .featured-section .free-pro-table h3 {
549
+ margin: 0;
550
+ }
551
+
552
+ .featured-section .free-pro-table td p {
553
+ margin: 0;
554
+ }
555
+
556
+ .featured-section .free-pro-table .sab-feature,
557
+ .featured-section .free-pro-table .sab-pro-feature {
558
+ text-align: center;
559
+ width: 15%;
560
+ }
561
+
562
+ .featured-section .free-pro-table .dashicons-yes {
563
+ color: #00A878;
564
+ }
565
+
566
+ .featured-section .free-pro-table .dashicons-no-alt {
567
+ color: #ff3439;
568
+ }
569
+
570
+ .featured-section .free-pro-table .dashicons-before:before,
571
+ .featured-section .free-pro-table .dashicons-before:before {
572
+ font-size: 35px;
573
+ height: 35px;
574
+ width: 35px;
575
+ }
576
+
577
+ .featured-section .button-hero .dashicons {
578
+ font-size: 16px;
579
+ vertical-align: middle;
580
+ }
581
+
582
+ .featured-section .ti-about-page-text-center {
583
+ text-align: center;
584
+ }
585
+
586
+ .free-pro-table .text-right {
587
+ text-align: right;
588
+ }
589
 
590
+ body .simple-author-box-wrap .wp-badge {
591
+ background: url('../img/sab-big-icon.png') center 35px no-repeat #27547D;
592
+ padding-top: 160px;
593
+ height: 0;
594
+ background-size: 80%;
595
+ }
assets/css/sabox-admin-style.min.css CHANGED
@@ -1 +1 @@
1
- .sabox-table.form-table th{width:400px;padding:10px 15px;vertical-align:middle}.sabox-table.form-table{margin-bottom:30px}.sabox-table .epfw-tooltip{color:#b8cad7;margin-right:10px}.sabox-table .wp-picker-container{text-align:right}.sabox-table .wp-picker-holder{position:absolute}.sabox-table select{float:right}.sabox-table.form-table tr{background-color:#fff;border-bottom:1px solid #eee;vertical-align:middle!important}.sabox-table tbody{border:1px solid #ddd}.sabox-table.form-table tr:last-of-type{border-bottom:0}.sabox-wrap{max-width:860px;padding-left:20px;margin:0 auto}.hide{display:none}.sabox-slider-container{max-width:390px;padding-bottom:5px;box-sizing:border-box}.sabox-slider-container .ui-slider .ui-slider-handle{width:auto;text-align:center;min-width:1.2em}.sabox-table p.description{font-weight:400}.wp-admin .checkbox_switch{display:inline-block;width:100%;text-align:right}.customize-control-title.onoffswitch_label{width:71%}.sabox-table .onoffswitch_label{display:inline-block;vertical-align:top;margin-right:21px;margin-top:-1px}.sabox-table .onoffswitch{position:relative;width:52px;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.sabox-table .onoffswitch-checkbox{display:none!important}.sabox-table .onoffswitch-label{display:block;overflow:hidden;cursor:pointer;height:22px;padding:0;line-height:19px;transition:background-color .2s ease-in;-webkit-border-radius:11px;-moz-border-radius:11px;border-radius:30px;background-color:#c4c4c4;-webkit-box-shadow:inset 0 2px 1px rgba(0,0,0,.11);-moz-box-shadow:inset 0 2px 1px rgba(0,0,0,.11);box-shadow:inset 0 2px 1px rgba(0,0,0,.11)}.sabox-table .onoffswitch-label:before{content:"";display:block;width:18px;height:18px;margin:0;position:absolute;top:2px;bottom:0;right:32px;background-color:#fff;-webkit-box-shadow:0 0 3px rgba(0,0,0,.1);-moz-box-shadow:0 0 3px rgba(0,0,0,.1);box-shadow:0 0 3px rgba(0,0,0,.1);-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;transition:all .2s ease-in 0s}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:after,.sabox-table .onoffswitch-label:after{display:block;color:#fff;position:absolute;bottom:2px;font-size:11px;font-family:Arial;top:2px}.sabox-table .onoffswitch-label:after{content:"OFF";right:6px}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label{background-color:#3caf0e}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label,.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:before{border-color:#3caf0e}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:before{right:2px}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:after{content:"ON";right:27px}.sabox-table .slider-container{position:relative;padding-left:50px}.sabox-table .slider-container input[type=text]{border:none;text-align:center;padding:2px;margin:0;font-size:12px;color:#333;border-radius:10px;background-color:#f8f8f8;-webkit-box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);width:42px;height:22px;position:absolute;left:0;top:2px}.sabox-table .slider-container .ui-slider{position:relative;text-align:left;height:2px;border-radius:3px;border:none;margin-top:10px;margin-left:22px;display:inline-block;width:97%;background:#d6d6d6}.sabox-table .slider-container .ui-slider .ui-slider-handle{position:absolute;z-index:2;top:-10px;cursor:default;-ms-touch-action:none;touch-action:none;width:18px;height:18px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;background-color:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid #d7d7d7;transform:translateX(-50%)}.sabox-table .slider-container .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background:#e04d43;top:0;bottom:0}.sabox-add-social-link{text-align:center;padding:10px 0;max-width:570px}.sabox-add-social-link:hover{border-color:#000}#sabox-social-table .dashicons-trash{vertical-align:middle;cursor:pointer;color:#a00}#sabox-social-table .dashicons-trash:hover{color:#dc3232}#sab-current-image img{max-width:130px;height:auto}.checkbox-label{text-transform:capitalize}.epfw-tab-wrapper.nav-tab-wrapper{background:#fff;padding:0;border:1px solid #ddd;text-align:center;margin-bottom:40px}.epfw-tab.nav-tab{background:#fff;border:0;display:inline-block;margin-right:20px;margin-left:0;padding:10px;border-bottom:2px solid transparent;color:#0073aa;font-weight:400}.epfw-tab.nav-tab.nav-tab-active{border-bottom:2px solid #2e4453;color:#2e4453}.masthead{background-color:#fff;text-align:center;box-shadow:0 1px 0 rgba(200,215,225,.5),0 1px 2px #ddd;margin-bottom:40px;padding:20px}.masthead h1{margin:0;padding:0;display:inline-block;font-size:20px;color:#000;font-weight:500}.masthead a{display:inline-block;margin:0 10px;text-decoration:none}.sabox-version{margin:20px auto;padding:20px 0;display:block;text-align:center;border-bottom:1px solid #ddd;border-top:1px solid #ddd}body.toplevel_page_simple-author-box-options{background-color:#f3f6f8}body.toplevel_page_simple-author-box-options #wpcontent{padding-left:0}.sabox-masthead-left,.sabox-masthead-right{display:inline-block}.sabox-masthead-left{float:left}.sabox-masthead-right{float:right}.epfw-tooltip{position:relative;display:inline;margin-right:10px}.epfw-tooltip:after,.epfw-tooltip:before{position:absolute;visibility:hidden;opacity:0}.epfw-tooltip:after{font-weight:400;display:block;bottom:0;left:20%;content:attr(data-tooltip);height:auto;min-width:300px;z-index:999;text-decoration:none;text-align:center;border:1px solid #c8d7e1;border-radius:4px;box-shadow:0 2px 5px rgba(0,0,0,.1),0 0 56px rgba(0,0,0,.075);background:#fff;color:#4f748e;font-size:13px;padding:16px}.epfw-tooltip:before{width:0;height:0;left:50%;bottom:0;content:"";border-style:solid;border-width:6px 6px 0;border-color:rgba(255,255,255,.85) transparent transparent}.epfw-tooltip:hover:after{visibility:visible;opacity:1;bottom:20px}.epfw-tooltip:hover:before{visibility:visible;opacity:1;bottom:14px}.sabox-table input[type=radio]{display:none;margin:10px}.sabox-table input[type=radio]+label{margin:.25em 0 .5em!important;min-width:100px;display:inline-block;padding:4px 12px;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);border-bottom-color:#b3b3b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.sabox-table input[type=radio]:checked+label{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#e0e0e0}.sabox-multicheckbox,.sabox-radio-group{text-align:right}.sabox-multicheckbox>div{display:inline-block;margin-left:10px}
1
+ .sabox-table.form-table th{width:400px;padding:10px 15px;vertical-align:middle}.sabox-table.form-table{margin-bottom:30px}.sabox-table .epfw-tooltip{color:#b8cad7;margin-right:10px}.sabox-table .wp-picker-container{text-align:right}.sabox-table .wp-picker-holder{position:absolute}.sabox-table select{float:right}.sabox-table.form-table tr{background-color:#fff;border-bottom:1px solid #eee;vertical-align:middle!important}.sabox-table tbody{border:1px solid #ddd}.sabox-table.form-table tr:last-of-type{border-bottom:0}.sabox-wrap{max-width:860px;padding-left:20px;margin:0 auto}.hide{display:none}.sabox-slider-container{max-width:390px;padding-bottom:5px;box-sizing:border-box}.sabox-slider-container .ui-slider .ui-slider-handle{width:auto;text-align:center;min-width:1.2em}.sabox-table p.description{font-weight:400}.wp-admin .checkbox_switch{display:inline-block;width:100%;text-align:right}.customize-control-title.onoffswitch_label{width:71%}.sabox-table .onoffswitch_label{display:inline-block;vertical-align:top;margin-right:21px;margin-top:-1px}.sabox-table .onoffswitch{position:relative;width:52px;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.sabox-table .onoffswitch-checkbox{display:none!important}.sabox-table .onoffswitch-label{display:block;overflow:hidden;cursor:pointer;height:22px;padding:0;line-height:19px;transition:background-color .2s ease-in;-webkit-border-radius:11px;-moz-border-radius:11px;border-radius:30px;background-color:#c4c4c4;-webkit-box-shadow:inset 0 2px 1px rgba(0,0,0,.11);-moz-box-shadow:inset 0 2px 1px rgba(0,0,0,.11);box-shadow:inset 0 2px 1px rgba(0,0,0,.11)}.sabox-table .onoffswitch-label:before{content:"";display:block;width:18px;height:18px;margin:0;position:absolute;top:2px;bottom:0;right:32px;background-color:#fff;-webkit-box-shadow:0 0 3px rgba(0,0,0,.1);-moz-box-shadow:0 0 3px rgba(0,0,0,.1);box-shadow:0 0 3px rgba(0,0,0,.1);-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;transition:all .2s ease-in 0s}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:after,.sabox-table .onoffswitch-label:after{display:block;color:#fff;position:absolute;bottom:2px;font-size:11px;font-family:Arial;top:2px}.sabox-table .onoffswitch-label:after{content:"OFF";right:6px}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label{background-color:#3caf0e}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label,.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:before{border-color:#3caf0e}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:before{right:2px}.sabox-table .onoffswitch-checkbox:checked+.onoffswitch-label:after{content:"ON";right:27px}.sabox-table .slider-container{position:relative;padding-left:50px}.sabox-table .slider-container input[type=text]{border:none;text-align:center;padding:2px;margin:0;font-size:12px;color:#333;border-radius:10px;background-color:#f8f8f8;-webkit-box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);-moz-box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);box-shadow:inset 0 2px 5px 0 rgba(0,0,0,.1);width:42px;height:22px;position:absolute;left:0;top:2px}.sabox-table .slider-container .ui-slider{position:relative;text-align:left;height:2px;border-radius:3px;border:none;margin-top:10px;margin-left:22px;display:inline-block;width:97%;background:#d6d6d6}.sabox-table .slider-container .ui-slider .ui-slider-handle{position:absolute;z-index:2;top:-10px;cursor:default;-ms-touch-action:none;touch-action:none;width:18px;height:18px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;background-color:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border:1px solid #d7d7d7;transform:translateX(-50%)}.sabox-table .slider-container .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background:#e04d43;top:0;bottom:0}.sabox-add-social-link{text-align:center;padding:10px 0;max-width:570px}.sabox-add-social-link:hover{border-color:#000}#sabox-social-table .dashicons-trash{vertical-align:middle;cursor:pointer;color:#a00}#sabox-social-table .dashicons-trash:hover{color:#dc3232}#sab-current-image img{max-width:130px;height:auto}.checkbox-label{text-transform:capitalize}.epfw-tab-wrapper.nav-tab-wrapper{background:#fff;padding:0;border:1px solid #ddd;text-align:center;margin-bottom:40px}.epfw-tab.nav-tab{background:#fff;border:0;display:inline-block;margin-right:20px;margin-left:0;padding:10px;border-bottom:2px solid transparent;color:#0073aa;font-weight:400}.epfw-tab.nav-tab.nav-tab-active{border-bottom:2px solid #2e4453;color:#2e4453}.masthead{background-color:#fff;text-align:center;box-shadow:0 1px 0 rgba(200,215,225,.5),0 1px 2px #ddd;margin-bottom:40px;padding:20px}.masthead h1{margin:0;padding:0;display:inline-block;font-size:20px;color:#000;font-weight:500}.masthead a{display:inline-block;margin:0 10px;text-decoration:none}.sabox-version{margin:20px auto;padding:20px 0;display:block;text-align:center;border-bottom:1px solid #ddd;border-top:1px solid #ddd}body.toplevel_page_simple-author-box-options{background-color:#f3f6f8}body.toplevel_page_simple-author-box-options #wpcontent{padding-left:0}.sabox-masthead-left,.sabox-masthead-right{display:inline-block}.sabox-masthead-left{float:left}.sabox-masthead-right{float:right}.epfw-tooltip{position:relative;display:inline;margin-right:10px}.epfw-tooltip:after,.epfw-tooltip:before{position:absolute;visibility:hidden;bottom:0;opacity:0}.epfw-tooltip:after{font-weight:400;display:block;left:20%;content:attr(data-tooltip);height:auto;min-width:300px;z-index:999;text-decoration:none;text-align:center;border:1px solid #c8d7e1;border-radius:4px;box-shadow:0 2px 5px rgba(0,0,0,.1),0 0 56px rgba(0,0,0,.075);background:#fff;color:#4f748e;font-size:13px;padding:16px}.epfw-tooltip:before{width:0;height:0;left:50%;content:"";border-style:solid;border-width:6px 6px 0;border-color:rgba(255,255,255,.85) transparent transparent}.epfw-tooltip:hover:after{visibility:visible;opacity:1;bottom:20px}.epfw-tooltip:hover:before{visibility:visible;opacity:1;bottom:14px}.sabox-table input[type=radio]{display:none;margin:10px}.sabox-table input[type=radio]+label{margin:.25em 0 .5em!important;min-width:100px;display:inline-block;padding:4px 12px;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);border-bottom-color:#b3b3b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.wp-has-submenu a[href*="admin.php?page=sab-upgrade"],a.upgrade-pro{color:red!important}.sabox-table input[type=radio]:checked+label{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#e0e0e0}.sabox-multicheckbox,.sabox-radio-group{text-align:right}.sabox-multicheckbox>div{display:inline-block;margin-left:10px}.wp-has-submenu a[href*="admin.php?page=sab-upgrade"]:after,a.upgrade-pro:after{font-family:dashicons;content:'\f155';margin-left:7px;vertical-align:middle}a.upgrade-pro{float:right;margin-right:0!important;text-decoration:none;font-size:14px;padding:12px}.featured-section.features .row{display:inline-block;width:97%;padding:15px;border-bottom:1px solid rgba(0,0,0,.06)}.featured-section.features .row .dashicons-yes{color:#2cbe4e}.featured-section.features .row .dashicons-no-alt{color:#FF3D2E}.featured-section.features .row>div{display:inline-block;float:left;width:15%;text-align:center}.featured-section.features .row>.feature{width:70%;text-align:left}.featured-section .free-pro-table{border-spacing:0;width:100%;margin-top:40px}.featured-section .free-pro-table th{padding-bottom:20px}.featured-section .free-pro-table td{border-top:1px solid #ccc;padding:20px 0 25px}.featured-section .free-pro-table h3,.featured-section .free-pro-table td p{margin:0}.featured-section .free-pro-table .sab-feature,.featured-section .free-pro-table .sab-pro-feature{text-align:center;width:15%}.featured-section .free-pro-table .dashicons-yes{color:#00A878}.featured-section .free-pro-table .dashicons-no-alt{color:#ff3439}.featured-section .free-pro-table .dashicons-before:before{font-size:35px;height:35px;width:35px}.featured-section .button-hero .dashicons{font-size:16px;vertical-align:middle}.featured-section .ti-about-page-text-center{text-align:center}.free-pro-table .text-right{text-align:right}body .simple-author-box-wrap .wp-badge{background:url(../img/sab-big-icon.png) center 35px no-repeat #27547D;padding-top:160px;height:0;background-size:80%}
assets/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( 'sab-updating' );
18
- el.text( message );
19
- }
20
- } );
21
- }
22
-
23
- $( function() {
24
- $( document ).on( 'click', '.sab-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( 'sab-updating disabled' );
34
-
35
- wp.updates.installPlugin( {
36
- slug: slug
37
- } );
38
-
39
- } else if ( 'activate' === action ) {
40
-
41
- $( this ).addClass( 'sab-updating disabled' );
42
- activatePlugin( url, $( this ) );
43
-
44
- }
45
-
46
- } );
47
-
48
- $( document ).on( 'wp-plugin-install-success', function( response, data ) {
49
- var el = $( '.sab-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( 'sab-updating' );
18
+ el.text( message );
19
+ }
20
+ } );
21
+ }
22
+
23
+ $( function() {
24
+ $( document ).on( 'click', '.sab-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( 'sab-updating disabled' );
34
+
35
+ wp.updates.installPlugin( {
36
+ slug: slug
37
+ } );
38
+
39
+ } else if ( 'activate' === action ) {
40
+
41
+ $( this ).addClass( 'sab-updating disabled' );
42
+ activatePlugin( url, $( this ) );
43
+
44
+ }
45
+
46
+ } );
47
+
48
+ $( document ).on( 'wp-plugin-install-success', function( response, data ) {
49
+ var el = $( '.sab-plugin-button[data-slug="' + data.slug + '"]' );
50
+ event.preventDefault();
51
+ activatePlugin( data.activateUrl, el );
52
+ } );
53
+
54
+ } );
55
+ })( window.wp, jQuery );
assets/js/sabox-admin.js CHANGED
@@ -1,125 +1,130 @@
1
- (function( $ ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- 'use strict';
4
- var context = $( '#sabox-container' );
5
- context.find( '.saboxfield' ).on( 'change', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- var value = getElementValue( $( this ) );
8
 
9
- var elements = context.find( '.show_if_' + $( this ).attr( 'id' ) );
 
 
10
 
11
- if ( value && '0' !== value ) {
12
- elements.show( 300 );
13
- } else {
14
- elements.hide( 250 );
15
- }
16
- } );
17
-
18
- function getElementValue( $element ) {
19
- var type = $element.attr( 'type' );
20
- var name = $element.attr( 'name' );
21
-
22
- if ( 'checkbox' === type ) {
23
- if ( $element.is( ':checked' ) ) {
24
- return 1;
25
- } else {
26
- return 0;
27
- }
28
- } else {
29
- return $element.val();
30
- }
31
- }
32
 
33
- /**
34
- * Handle UI tab switching via jQuery instead of relying on CSS only
35
- */
36
- function adminTabSwitching() {
 
 
37
 
38
- var navTabSelector = '.nav-tab-wrapper a';
 
 
 
39
 
40
- // Get the first tab href
41
- var initialTabHref = $( navTabSelector + ':first' ).attr( 'href' );
 
42
 
43
- /**
44
- * Default tab handling
45
- */
 
46
 
47
- // Make the first tab active by default
48
- $( navTabSelector + ':first' ).addClass( 'nav-tab-active' );
49
 
50
- // Make all the tabs, except the first one hidden
51
- $( '.epfw-turn-into-tab' ).each( function( index, value ) {
52
- if ( '#' + $( this ).attr( 'id' ) !== initialTabHref ) {
53
- $( this ).hide();
54
- }
55
- } );
56
 
57
- /**
58
- * Listen for click events on nav-tab links
59
- */
60
- $( navTabSelector ).click( function( event ) {
61
-
62
- var clickedTab = $( this ).attr( 'href' );
63
- $( navTabSelector ).removeClass( 'nav-tab-active' ); // Remove class from previous selector
64
- $( this ).addClass( 'nav-tab-active' ).blur(); // Add class to currently clicked selector
65
 
66
- $( '.epfw-turn-into-tab' ).each( function( index, value ) {
67
- if ( '#' + $( this ).attr( 'id' ) !== clickedTab ) {
68
- $( this ).hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
 
71
- $( clickedTab ).fadeIn();
72
-
73
- } );
74
-
75
- // Prevent default behavior
76
- event.preventDefault();
77
-
78
- } );
79
- }
80
-
81
- $( document ).ready( function() {
82
- var elements = context.find( '.saboxfield' ),
83
- sliders = context.find( '.sabox-slider' ),
84
- colorpickers = context.find( '.sabox-color' );
85
-
86
- elements.each( function( $index, $element ) {
87
- var element = $( $element ),
88
- value = getElementValue( element ),
89
- elements = context.find( '.show_if_' + element.attr( 'id' ) );
90
- if ( value && '0' !== value ) {
91
- elements.removeClass( 'hide' );
92
- } else {
93
- elements.addClass( 'hide' );
94
- }
95
- } );
96
- if ( sliders.length > 0 ) {
97
- sliders.each( function( $index, $slider ) {
98
- var input = $( $slider ).parent().find( '.saboxfield' ),
99
- max = input.data( 'max' ),
100
- min = input.data( 'min' ),
101
- step = input.data( 'step' ),
102
- value = parseInt( input.val(), 10 );
103
-
104
- $( $slider ).slider( {
105
- value: value,
106
- min: min,
107
- max: max,
108
- step: step,
109
- slide: function( event, ui ) {
110
- input.val( ui.value + 'px' ).trigger( 'change' );
111
- }
112
- } );
113
- } );
114
- }
115
- if ( colorpickers.length > 0 ) {
116
- colorpickers.each( function( $index, $colorpicker ) {
117
- $( $colorpicker ).wpColorPicker();
118
- } );
119
- }
120
-
121
- adminTabSwitching();
122
 
123
- } );
124
 
125
  })( jQuery );
 
1
+ ( function( $ ) {
2
+
3
+ 'use strict';
4
+ var context = $( '#sabox-container' );
5
+ context.find( '.saboxfield' ).on( 'change', function() {
6
+ var value = getElementValue( $( this ) );
7
+ var elements = context.find( '.show_if_' + $( this ).attr( 'id' ) );
8
+
9
+ if ( value && '0' !== value ) {
10
+ elements.show( 300 );
11
+ } else {
12
+ elements.hide( 250 );
13
+ }
14
+ });
15
+
16
+ function getElementValue( $element ) {
17
+ var type = $element.attr( 'type' );
18
+ var name = $element.attr( 'name' );
19
+
20
+ if ( 'checkbox' === type ) {
21
+ if ( $element.is( ':checked' ) ) {
22
+ return 1;
23
+ } else {
24
+ return 0;
25
+ }
26
+ } else {
27
+ return $element.val();
28
+ }
29
+ }
30
 
31
+ /**
32
+ * Handle UI tab switching via jQuery instead of relying on CSS only
33
+ */
34
+ function adminTabSwitching() {
35
+
36
+ var navTabSelector = '.nav-tab-wrapper .epfw-tab:not( .epfw-tab-link )',
37
+ initialTabHref,
38
+ initialTabID,
39
+ url;
40
+
41
+ // Get the current tab
42
+ if ( '' !== window.location.hash && $( window.location.hash + '-tab.epfw-turn-into-tab' ).length > 0 ) {
43
+ initialTabHref = window.location.hash;
44
+ } else {
45
+ initialTabHref = $( navTabSelector + ':first' ).attr( 'href' );
46
+ }
47
 
48
+ initialTabID = initialTabHref + '-tab';
49
 
50
+ /**
51
+ * Default tab handling
52
+ */
53
 
54
+ // Make the first tab active by default
55
+ $( navTabSelector + '[href="' + initialTabHref + '"]' ).addClass( 'nav-tab-active' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
+ // Make all the tabs, except the first one hidden
58
+ $( '.epfw-turn-into-tab' ).each( function( index, value ) {
59
+ if ( '#' + $( this ).attr( 'id' ) !== initialTabID ) {
60
+ $( this ).hide();
61
+ }
62
+ });
63
 
64
+ /**
65
+ * Listen for click events on nav-tab links
66
+ */
67
+ $( navTabSelector ).click( function( event ) {
68
 
69
+ var clickedTab = $( this ).attr( 'href' ) + '-tab';
70
+ $( navTabSelector ).removeClass( 'nav-tab-active' ); // Remove class from previous selector
71
+ $( this ).addClass( 'nav-tab-active' ).blur(); // Add class to currently clicked selector
72
 
73
+ $( '.epfw-turn-into-tab' ).each( function( index, value ) {
74
+ if ( '#' + $( this ).attr( 'id' ) !== clickedTab ) {
75
+ $( this ).hide();
76
+ }
77
 
78
+ $( clickedTab ).fadeIn();
 
79
 
80
+ });
 
 
 
 
 
81
 
82
+ });
83
+ }
 
 
 
 
 
 
84
 
85
+ $( document ).ready( function() {
86
+ var elements = context.find( '.saboxfield' ),
87
+ sliders = context.find( '.sabox-slider' ),
88
+ colorpickers = context.find( '.sabox-color' );
89
+
90
+ elements.each( function( $index, $element ) {
91
+ var element = $( $element ),
92
+ value = getElementValue( element ),
93
+ elements = context.find( '.show_if_' + element.attr( 'id' ) );
94
+ if ( value && '0' !== value ) {
95
+ elements.removeClass( 'hide' );
96
+ } else {
97
+ elements.addClass( 'hide' );
98
+ }
99
+ });
100
+ if ( sliders.length > 0 ) {
101
+ sliders.each( function( $index, $slider ) {
102
+ var input = $( $slider ).parent().find( '.saboxfield' ),
103
+ max = input.data( 'max' ),
104
+ min = input.data( 'min' ),
105
+ step = input.data( 'step' ),
106
+ value = parseInt( input.val(), 10 );
107
+
108
+ $( $slider ).slider({
109
+ value: value,
110
+ min: min,
111
+ max: max,
112
+ step: step,
113
+ slide: function( event, ui ) {
114
+ input.val( ui.value + 'px' ).trigger( 'change' );
115
+ }
116
+ });
117
+ });
118
+ }
119
+ if ( colorpickers.length > 0 ) {
120
+ colorpickers.each( function( $index, $colorpicker ) {
121
+ $( $colorpicker ).wpColorPicker();
122
+ });
123
  }
124
 
125
+ adminTabSwitching();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
+ });
128
 
129
  })( jQuery );
130
+
inc/class-simple-author-box-admin-page.php CHANGED
@@ -26,6 +26,11 @@ class Simple_Author_Box_Admin_Page {
26
  'miscellaneous-options' => array(
27
  'label' => __( 'Misc', 'saboxplugin' ),
28
  ),
 
 
 
 
 
29
  );
30
 
31
  $settings = array(
@@ -55,19 +60,19 @@ class Simple_Author_Box_Admin_Page {
55
  'group' => 'saboxplugin_options',
56
  ),
57
 
58
- 'sab_email' => array(
59
  'label' => __( 'Show author email', 'saboxplugin' ),
60
  'description' => __( 'When turned ON, the plugin will add an email option next to the social icons.', 'saboxplugin' ),
61
  'type' => 'toggle',
62
  'group' => 'saboxplugin_options',
63
  ),
64
- 'sab_link_target' => array(
65
  'label' => __( 'Open social icon links in a new tab', 'saboxplugin' ),
66
  'description' => __( 'When turned ON, the author’s social links will open in a new tab.', 'saboxplugin' ),
67
  'type' => 'toggle',
68
  'group' => 'saboxplugin_options',
69
  ),
70
- 'sab_hide_socials' => array(
71
  'label' => __( 'Hide the social icons on author box', 'saboxplugin' ),
72
  'description' => __( 'When turned ON, the author’s social icons will be hidden.', 'saboxplugin' ),
73
  'type' => 'toggle',
@@ -144,14 +149,14 @@ class Simple_Author_Box_Admin_Page {
144
  'group' => 'saboxplugin_options',
145
  ),
146
 
147
- 'sab_web_target' => array(
148
  'label' => __( 'Open author website link in a new tab', 'saboxplugin' ),
149
  'description' => __( 'If you check this the author\'s link will open in a new tab', 'saboxplugin' ),
150
  'type' => 'toggle',
151
  'condition' => 'sab_web',
152
  'group' => 'saboxplugin_options',
153
  ),
154
- 'sab_web_rel' => array(
155
  'label' => __( 'Add "nofollow" attribute on author website link', 'saboxplugin' ),
156
  'description' => __( 'Toggling this to ON will make the author website have the no-follow parameter added.', 'saboxplugin' ),
157
  'type' => 'toggle',
@@ -159,8 +164,7 @@ class Simple_Author_Box_Admin_Page {
159
  'group' => 'saboxplugin_options',
160
  ),
161
 
162
-
163
- 'sab_web_position' => array(
164
  'label' => __( 'Author website position', 'saboxplugin' ),
165
  'description' => __( 'Select where you want to show the website ( left or right )', 'saboxplugin' ),
166
  'type' => 'select',
@@ -172,7 +176,7 @@ class Simple_Author_Box_Admin_Page {
172
  'condition' => 'sab_web',
173
  'group' => 'saboxplugin_options',
174
  ),
175
- 'sab_colored' => array(
176
  'label' => __( 'Social icons type', 'saboxplugin' ),
177
  'description' => __( 'Colored background adds a background behind the social icon symbol', 'saboxplugin' ),
178
  'type' => 'select',
@@ -183,7 +187,7 @@ class Simple_Author_Box_Admin_Page {
183
  'default' => '0',
184
  'group' => 'saboxplugin_options',
185
  ),
186
- 'sab_icons_style' => array(
187
  'label' => __( 'Social icons style', 'saboxplugin' ),
188
  'description' => __( 'Select the shape of social icons\' container', 'saboxplugin' ),
189
  'type' => 'select',
@@ -195,21 +199,21 @@ class Simple_Author_Box_Admin_Page {
195
  'condition' => 'sab_colored',
196
  'group' => 'saboxplugin_options',
197
  ),
198
- 'sab_social_hover' => array(
199
  'label' => __( 'Rotate effect on social icons hover (works only for circle icons)', 'saboxplugin' ),
200
  'description' => __( 'Add a rotate effect when you hover on social icons hover', 'saboxplugin' ),
201
  'type' => 'toggle',
202
  'condition' => 'sab_colored',
203
  'group' => 'saboxplugin_options',
204
  ),
205
- 'sab_box_long_shadow' => array(
206
  'label' => __( 'Use flat long shadow effect', 'saboxplugin' ),
207
  'description' => __( 'Check this if you want a flat shodow for social icons', 'saboxplugin' ),
208
  'type' => 'toggle',
209
  'condition' => 'sab_colored',
210
  'group' => 'saboxplugin_options',
211
  ),
212
- 'sab_box_thin_border' => array(
213
  'label' => __( 'Show a thin border on colored social icons', 'saboxplugin' ),
214
  'description' => __( 'Add a border to social icons container.', 'saboxplugin' ),
215
  'type' => 'toggle',
@@ -423,10 +427,24 @@ class Simple_Author_Box_Admin_Page {
423
  }
424
 
425
  public function menu_page() {
426
- add_menu_page( __( 'Simple Author Box', 'saboxplugin' ), __( 'Simple Author', 'saboxplugin' ), 'manage_options', 'simple-author-box-options', array(
427
- $this,
428
- 'setting_page',
429
- ), SIMPLE_AUTHOR_BOX_ASSETS . 'img/sab-icon.png' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  }
431
 
432
  public function setting_page() {
@@ -438,15 +456,19 @@ class Simple_Author_Box_Admin_Page {
438
  <h1 class="wp-heading-inline">
439
  <?php
440
  /* Translators: Welcome Screen Title. */
441
- echo esc_html__( 'Simple Author Box', 'saboxplugin' );
442
  ?>
443
- <a target="_blank" href="<?php echo get_edit_user_link(); ?>" class="page-title-action"><?php _e( 'Edit user profile', 'saboxplugin' ); ?></a>
 
444
  </h1>
445
 
446
  </div>
447
 
448
  <div class="sabox-masthead-right">
449
- <a target="_blank" href="https://www.machothemes.com/support/?utm_source=sab&utm_medium=about-page&utm_campaign=support-button"><?php _e( 'Support', 'saboxplugin' ); ?>&nbsp; &nbsp;<i class="dashicons dashicons-sos"></i></a>
 
 
 
450
  </div>
451
  <div class="wp-clearfix"></div>
452
  </div>
@@ -456,7 +478,23 @@ class Simple_Author_Box_Admin_Page {
456
 
457
  <h2 class="epfw-tab-wrapper nav-tab-wrapper wp-clearfix">
458
  <?php foreach ( $this->sections as $id => $section ) { ?>
459
- <a class="epfw-tab nav-tab" href="#<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $section['label'] ); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  <?php } ?>
461
  </h2>
462
  <form method="post" id="sabox-container">
@@ -464,9 +502,8 @@ class Simple_Author_Box_Admin_Page {
464
 
465
  wp_nonce_field( 'sabox-plugin-settings', 'sabox_plugin_settings_page' );
466
 
467
-
468
  foreach ( $this->settings as $tab_name => $fields ) {
469
- echo '<div class="epfw-turn-into-tab" id="' . esc_attr( $tab_name ) . '">';
470
  echo '<table class="form-table sabox-table">';
471
  foreach ( $fields as $field_name => $field ) {
472
  $this->generate_setting_field( $field_name, $field );
@@ -479,15 +516,23 @@ class Simple_Author_Box_Admin_Page {
479
  submit_button( esc_html__( 'Save Settings', 'saboxplugin' ), 'button button-primary button-hero', '', false );
480
  echo '</div>';
481
 
482
-
483
  ?>
484
  </form>
485
 
486
  </div>
487
 
488
  <span class="sabox-version">
489
- <?php echo _e( 'Version: ', 'saboxplugin' ) . esc_html( SIMPLE_AUTHOR_BOX_VERSION ); ?>&nbsp; &middot; &nbsp;
490
- <?php echo '<a target="_blank" href="https://github.com/MachoThemes/simple-author-box/blob/master/readme.txt">' . __( 'Changelog', 'saboxplugin' ) . '</a>'; ?>
 
 
 
 
 
 
 
 
 
491
  </span>
492
 
493
  <?php
@@ -642,7 +687,9 @@ class Simple_Author_Box_Admin_Page {
642
  }
643
  }
644
 
645
- $field['default'] = array_keys( $field['choices'] );
 
 
646
 
647
  $values = isset( $this->options[ $field_name ] ) ? $this->options[ $field_name ] : $field['default'];
648
  foreach ( $field['choices'] as $key => $choice ) {
@@ -670,6 +717,145 @@ class Simple_Author_Box_Admin_Page {
670
  echo '</tr>';
671
  }
672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  }
674
 
675
  new Simple_Author_Box_Admin_Page();
26
  'miscellaneous-options' => array(
27
  'label' => __( 'Misc', 'saboxplugin' ),
28
  ),
29
+ 'upgrade-pro' => array(
30
+ 'label' => esc_html__( 'Upgrade', 'saboxplugin' ),
31
+ 'link' => admin_url( 'admin.php?page=sab-upgrade' ),
32
+ 'class' => 'upgrade-pro',
33
+ ),
34
  );
35
 
36
  $settings = array(
60
  'group' => 'saboxplugin_options',
61
  ),
62
 
63
+ 'sab_email' => array(
64
  'label' => __( 'Show author email', 'saboxplugin' ),
65
  'description' => __( 'When turned ON, the plugin will add an email option next to the social icons.', 'saboxplugin' ),
66
  'type' => 'toggle',
67
  'group' => 'saboxplugin_options',
68
  ),
69
+ 'sab_link_target' => array(
70
  'label' => __( 'Open social icon links in a new tab', 'saboxplugin' ),
71
  'description' => __( 'When turned ON, the author’s social links will open in a new tab.', 'saboxplugin' ),
72
  'type' => 'toggle',
73
  'group' => 'saboxplugin_options',
74
  ),
75
+ 'sab_hide_socials' => array(
76
  'label' => __( 'Hide the social icons on author box', 'saboxplugin' ),
77
  'description' => __( 'When turned ON, the author’s social icons will be hidden.', 'saboxplugin' ),
78
  'type' => 'toggle',
149
  'group' => 'saboxplugin_options',
150
  ),
151
 
152
+ 'sab_web_target' => array(
153
  'label' => __( 'Open author website link in a new tab', 'saboxplugin' ),
154
  'description' => __( 'If you check this the author\'s link will open in a new tab', 'saboxplugin' ),
155
  'type' => 'toggle',
156
  'condition' => 'sab_web',
157
  'group' => 'saboxplugin_options',
158
  ),
159
+ 'sab_web_rel' => array(
160
  'label' => __( 'Add "nofollow" attribute on author website link', 'saboxplugin' ),
161
  'description' => __( 'Toggling this to ON will make the author website have the no-follow parameter added.', 'saboxplugin' ),
162
  'type' => 'toggle',
164
  'group' => 'saboxplugin_options',
165
  ),
166
 
167
+ 'sab_web_position' => array(
 
168
  'label' => __( 'Author website position', 'saboxplugin' ),
169
  'description' => __( 'Select where you want to show the website ( left or right )', 'saboxplugin' ),
170
  'type' => 'select',
176
  'condition' => 'sab_web',
177
  'group' => 'saboxplugin_options',
178
  ),
179
+ 'sab_colored' => array(
180
  'label' => __( 'Social icons type', 'saboxplugin' ),
181
  'description' => __( 'Colored background adds a background behind the social icon symbol', 'saboxplugin' ),
182
  'type' => 'select',
187
  'default' => '0',
188
  'group' => 'saboxplugin_options',
189
  ),
190
+ 'sab_icons_style' => array(
191
  'label' => __( 'Social icons style', 'saboxplugin' ),
192
  'description' => __( 'Select the shape of social icons\' container', 'saboxplugin' ),
193
  'type' => 'select',
199
  'condition' => 'sab_colored',
200
  'group' => 'saboxplugin_options',
201
  ),
202
+ 'sab_social_hover' => array(
203
  'label' => __( 'Rotate effect on social icons hover (works only for circle icons)', 'saboxplugin' ),
204
  'description' => __( 'Add a rotate effect when you hover on social icons hover', 'saboxplugin' ),
205
  'type' => 'toggle',
206
  'condition' => 'sab_colored',
207
  'group' => 'saboxplugin_options',
208
  ),
209
+ 'sab_box_long_shadow' => array(
210
  'label' => __( 'Use flat long shadow effect', 'saboxplugin' ),
211
  'description' => __( 'Check this if you want a flat shodow for social icons', 'saboxplugin' ),
212
  'type' => 'toggle',
213
  'condition' => 'sab_colored',
214
  'group' => 'saboxplugin_options',
215
  ),
216
+ 'sab_box_thin_border' => array(
217
  'label' => __( 'Show a thin border on colored social icons', 'saboxplugin' ),
218
  'description' => __( 'Add a border to social icons container.', 'saboxplugin' ),
219
  'type' => 'toggle',
427
  }
428
 
429
  public function menu_page() {
430
+ add_menu_page(
431
+ __( 'Simple Author Box', 'saboxplugin' ), __( 'Simple Author', 'saboxplugin' ), 'manage_options', 'simple-author-box-options', array(
432
+ $this,
433
+ 'setting_page',
434
+ ), SIMPLE_AUTHOR_BOX_ASSETS . 'img/sab-icon.png'
435
+ );
436
+
437
+ $show_upsell = apply_filters( 'sabox_show_upsell', true );
438
+
439
+ if ( $show_upsell ) {
440
+ add_submenu_page(
441
+ 'simple-author-box-options', __( 'Upgrade to PRO', 'saboxplugin' ), __( 'Upgrade', 'saboxplugin' ), 'manage_options', 'sab-upgrade', array(
442
+ $this,
443
+ 'render_pro_page',
444
+ )
445
+ );
446
+ }
447
+
448
  }
449
 
450
  public function setting_page() {
456
  <h1 class="wp-heading-inline">
457
  <?php
458
  /* Translators: Welcome Screen Title. */
459
+ echo esc_html( apply_filters( 'sabox_show_pro_title', __( 'Simple Author Box', 'saboxplugin' ) ) );
460
  ?>
461
+ <a target="_blank" href="<?php echo get_edit_user_link(); ?>"
462
+ class="page-title-action"><?php _e( 'Edit user profile', 'saboxplugin' ); ?></a>
463
  </h1>
464
 
465
  </div>
466
 
467
  <div class="sabox-masthead-right">
468
+ <a target="_blank"
469
+ href="https://www.machothemes.com/support/?utm_source=sab&utm_medium=about-page&utm_campaign=support-button"><?php _e( 'Support', 'saboxplugin' ); ?>
470
+ &nbsp; &nbsp;<i class="dashicons dashicons-sos"></i>
471
+ </a>
472
  </div>
473
  <div class="wp-clearfix"></div>
474
  </div>
478
 
479
  <h2 class="epfw-tab-wrapper nav-tab-wrapper wp-clearfix">
480
  <?php foreach ( $this->sections as $id => $section ) { ?>
481
+ <?php
482
+ $class = 'epfw-tab nav-tab';
483
+
484
+ if ( isset( $section['link'] ) ) {
485
+ $url = $section['link'];
486
+ $class .= ' epfw-tab-link';
487
+ } else {
488
+ $url = '#' . $id;
489
+ }
490
+
491
+ if ( isset( $section['class'] ) ) {
492
+ $class .= ' ' . $section['class'];
493
+ }
494
+
495
+ ?>
496
+ <a class="<?php echo esc_attr( $class ); ?>"
497
+ href="<?php echo esc_url( $url ); ?>"><?php echo wp_kses_post( $section['label'] ); ?></a>
498
  <?php } ?>
499
  </h2>
500
  <form method="post" id="sabox-container">
502
 
503
  wp_nonce_field( 'sabox-plugin-settings', 'sabox_plugin_settings_page' );
504
 
 
505
  foreach ( $this->settings as $tab_name => $fields ) {
506
+ echo '<div class="epfw-turn-into-tab" id="' . esc_attr( $tab_name ) . '-tab">';
507
  echo '<table class="form-table sabox-table">';
508
  foreach ( $fields as $field_name => $field ) {
509
  $this->generate_setting_field( $field_name, $field );
516
  submit_button( esc_html__( 'Save Settings', 'saboxplugin' ), 'button button-primary button-hero', '', false );
517
  echo '</div>';
518
 
 
519
  ?>
520
  </form>
521
 
522
  </div>
523
 
524
  <span class="sabox-version">
525
+ <?php echo _e( 'Version: ', 'saboxplugin' ) . esc_html( apply_filters( 'sabox_show_pro_version', SIMPLE_AUTHOR_BOX_VERSION ) ); ?>
526
+
527
+ <?php
528
+
529
+ $show_changelog = apply_filters( 'sabox_show_changelog', true );
530
+
531
+ if ( $show_changelog ) {
532
+ echo '&nbsp; &middot; &nbsp;';
533
+ echo '<a target="_blank" href="https://github.com/MachoThemes/simple-author-box/blob/master/readme.txt">' . __( 'Changelog', 'saboxplugin' ) . '</a>';
534
+ }
535
+ ?>
536
  </span>
537
 
538
  <?php
687
  }
688
  }
689
 
690
+ if ( ! isset( $field['default'] ) ) {
691
+ $field['default'] = array_keys( $field['choices'] );
692
+ }
693
 
694
  $values = isset( $this->options[ $field_name ] ) ? $this->options[ $field_name ] : $field['default'];
695
  foreach ( $field['choices'] as $key => $choice ) {
717
  echo '</tr>';
718
  }
719
 
720
+ public function render_pro_page() {
721
+
722
+ $features = array(
723
+ 'slider-options' => array(
724
+ 'label' => esc_html__( 'Typography control', 'saboxplugin' ),
725
+ 'sub' => esc_html__( 'Control Simple Author Box\'s typography. ', 'saboxplugin' ),
726
+ 'sab' => '<span class="dashicons dashicons-yes"></span>',
727
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
728
+ ),
729
+ 'woocommerce' => array(
730
+ 'label' => esc_html__( 'Appearance control', 'saboxplugin' ),
731
+ 'sub' => esc_html__( 'Manage the looks of your Author Box. Color controls, margins, paddings, pre-defined color layouts & more.', 'saboxplugin' ),
732
+ 'sab' => '<span class="dashicons dashicons-yes"></span>',
733
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
734
+ ),
735
+ 'reorder-sections' => array(
736
+ 'label' => esc_html__( 'Visible on desired post types', 'saboxplugin' ),
737
+ 'sub' => esc_html__( 'Select the post types where you want the author box to show up.', 'saboxplugin' ),
738
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
739
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
740
+ ),
741
+ 'custom-colors' => array(
742
+ 'label' => esc_html__( 'Author name link control', 'saboxplugin' ),
743
+ 'sub' => esc_html__( 'Control how author name links behave. Open in new tab, add nofollow parameter.', 'saboxplugin' ),
744
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
745
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
746
+ ),
747
+ 'typography' => array(
748
+ 'label' => esc_html__( 'Color controls', 'saboxplugin' ),
749
+ 'sub' => esc_html__( 'Customize the look of your author box. Make it yours!', 'saboxplugin' ),
750
+ 'sab' => '<span class="dashicons dashicons-yes"></span>',
751
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
752
+ ),
753
+
754
+ 'features' => array(
755
+ 'label' => esc_html__( 'Pre-defined color schemes', 'saboxplugin' ),
756
+ 'sub' => esc_html__( 'Easily change your author box\'s looks with one of the included professionally designed pre-defined color schemes.', 'saboxplugin' ),
757
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
758
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
759
+ ),
760
+ 'portfolio' => array(
761
+ 'label' => esc_html__( 'Author title', 'saboxplugin' ),
762
+ 'sub' => '',
763
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
764
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
765
+ ),
766
+ 'services' => array(
767
+ 'label' => esc_html__( 'Guest authors', 'saboxplugin' ),
768
+ 'sub' => esc_html__( 'Easily assign post to guest authors. Make blogging & contributing easier.', 'saboxplugin' ),
769
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
770
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
771
+ ),
772
+ 'team' => array(
773
+ 'label' => esc_html__( 'Post co-authors', 'saboxplugin' ),
774
+ 'sub' => esc_html__( 'Working on a bigger piece with more colleagues? Get everyone\'s name listed without an issue.', 'saboxplugin' ),
775
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
776
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
777
+ ),
778
+ 'testimonials' => array(
779
+ 'label' => esc_html__( 'Popular authors widget', 'saboxplugin' ),
780
+ 'sub' => esc_html__( 'Showcase your most popular authors. Give back to the people who contribute to your blog.', 'saboxplugin' ),
781
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
782
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
783
+ ),
784
+ 'clients' => array(
785
+ 'label' => esc_html__( 'Authors widget', 'saboxplugin' ),
786
+ 'sub' => '',
787
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
788
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
789
+ ),
790
+ 'dedicated-support' => array(
791
+ 'label' => esc_html__( 'Dedicated Support Team', 'saboxplugin' ),
792
+ 'sab' => '<span class="dashicons dashicons-yes"></span>',
793
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
794
+ ),
795
+ 'security-updates' => array(
796
+ 'label' => esc_html__( 'Critical security updates ', 'saboxplugin' ),
797
+ 'sab' => '<span class="dashicons dashicons-yes"></span>',
798
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
799
+ ),
800
+
801
+ 'featured-updates' => array(
802
+ 'label' => esc_html__( 'Future feature updates ', 'saboxplugin' ),
803
+ 'sab' => '<span class="dashicons dashicons-no-alt"></span>',
804
+ 'sab-pro' => '<span class="dashicons dashicons-yes"></span></i>',
805
+ ),
806
+ );
807
+
808
+ ?>
809
+
810
+ <div class="wrap about-wrap simple-author-box-wrap">
811
+ <h1><?php echo esc_html__( 'Why you should be upgrading', 'saboxplugin' ); ?></h1>
812
+ <p class="about-text"><?php echo esc_html__( 'Introducing one of the most author box systems ever made for WordPress. Simple Author Box is an exquisite WordPress Author Box plugin perfectly fit for any needs. We\'ve outlined the PRO features below.', 'saboxplugin' ); ?></p>
813
+ <div class="wp-badge"></div>
814
+ <h2 class="nav-tab-wrapper wp-clearfix">
815
+ <a href="<?php echo admin_url( 'admin.php?page=sab-upgrade' ); ?>"
816
+ class="nav-tab nav-tab-active"><?php echo esc_html__( 'Comparison Table: Lite vs PRO', 'saboxplugin' ); ?></a>
817
+ </h2>
818
+ <div class="featured-section features">
819
+ <table class="free-pro-table">
820
+ <thead>
821
+ <tr>
822
+ <th></th>
823
+ <th><?php _e( 'Free', 'saboxplugin' ); ?></th>
824
+ <th><?php _e( 'PRO', 'saboxplugin' ); ?></th>
825
+ </tr>
826
+ </thead>
827
+ <tbody>
828
+ <?php foreach ( $features as $feature ) : ?>
829
+ <tr>
830
+ <td class="feature">
831
+ <h3><?php echo $feature['label']; ?></h3>
832
+ <?php if ( isset( $feature['sub'] ) ) : ?>
833
+ <p><?php echo $feature['sub']; ?></p>
834
+ <?php endif ?>
835
+ </td>
836
+ <td class="sab-feature">
837
+ <?php echo $feature['sab']; ?>
838
+ </td>
839
+ <td class="sab-pro-feature">
840
+ <?php echo $feature['sab-pro']; ?>
841
+ </td>
842
+ </tr>
843
+ <?php endforeach; ?>
844
+ <tr>
845
+ <td></td>
846
+ <td colspan="2" class="text-right">
847
+ <a href="//www.machothemes.com/plugin/simple-author-box-pro?utm_source=sab&utm_medium=about-page&utm_campaign=upsell"
848
+ target="_blank" class="button button-primary button-hero">
849
+ <span class="dashicons dashicons-cart"></span>
850
+ <?php _e( 'Get The Pro Version Now!', 'saboxplugin' ); ?>
851
+ </a></td>
852
+ </tr>
853
+ </tbody>
854
+ </table>
855
+ </div>
856
+ </div>
857
+ <?php
858
+ }
859
  }
860
 
861
  new Simple_Author_Box_Admin_Page();
inc/class-simple-author-box-helper.php CHANGED
@@ -1,933 +1,935 @@
1
- <?php
2
-
3
- /**
4
- *
5
- */
6
- class Simple_Author_Box_Helper {
7
-
8
- public static $fonts = array();
9
-
10
- static $social_icons = array(
11
- 'addthis' => 'Add This',
12
- 'behance' => 'Behance',
13
- 'delicious' => 'Delicious',
14
- 'deviantart' => 'Deviantart',
15
- 'digg' => 'Digg',
16
- 'dribbble' => 'Dribbble',
17
- 'facebook' => 'Facebook',
18
- 'flickr' => 'Flickr',
19
- 'github' => 'Github',
20
- 'google' => 'Google',
21
- 'googleplus' => 'Google Plus',
22
- 'html5' => 'Html5',
23
- 'instagram' => 'Instagram',
24
- 'linkedin' => 'Linkedin',
25
- 'pinterest' => 'Pinterest',
26
- 'reddit' => 'Reddit',
27
- 'rss' => 'Rss',
28
- 'sharethis' => 'Sharethis',
29
- 'skype' => 'Skype',
30
- 'soundcloud' => 'Soundcloud',
31
- 'spotify' => 'Spotify',
32
- 'stackoverflow' => 'Stackoverflow',
33
- 'steam' => 'Steam',
34
- 'stumbleUpon' => 'StumbleUpon',
35
- 'tumblr' => 'Tumblr',
36
- 'twitter' => 'Twitter',
37
- 'vimeo' => 'Vimeo',
38
- 'windows' => 'Windows',
39
- 'wordpress' => 'Wordpress',
40
- 'yahoo' => 'Yahoo',
41
- 'youtube' => 'Youtube',
42
- 'xing' => 'Xing',
43
- 'mixcloud' => 'MixCloud',
44
- 'goodreads' => 'Goodreads',
45
- 'twitch' => 'Twitch',
46
- 'vk' => 'VK',
47
- 'medium' => 'Medium',
48
- 'quora' => 'Quora',
49
- 'meetup' => 'Meetup',
50
- 'user_email' => 'Email',
51
- 'snapchat' => 'Snapchat',
52
- '500px' => '500px',
53
- );
54
-
55
- public static function get_sabox_social_icon( $url, $icon_name ) {
56
-
57
- $options = get_option( 'saboxplugin_options' );
58
-
59
- if ( isset( $options['sab_link_target'] ) && '0' != $options['sab_link_target'] ) {
60
- $sabox_blank = '_blank';
61
- } else {
62
- $sabox_blank = '_self';
63
- }
64
-
65
- if ( isset( $options['sab_colored'] ) && '0' != $options['sab_colored'] ) {
66
- $sab_color = 'saboxplugin-icon-color';
67
- } else {
68
- $sab_color = 'saboxplugin-icon-grey';
69
- }
70
-
71
- return '<a target="' . esc_attr( $sabox_blank ) . '" href="' . esc_url( $url ) . '" rel="nofollow"><span class="' . esc_attr( $sab_color ) . ' saboxplugin-icon-' . esc_attr( $icon_name ) . '"></span></a>';
72
-
73
- }
74
-
75
- public static function get_user_social_links( $userd_id, $show_email = false ) {
76
-
77
- $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
78
- $social_links = get_user_meta( $userd_id, 'sabox_social_links', true );
79
-
80
- if ( ! is_array( $social_links ) ) {
81
- $social_links = array();
82
- }
83
-
84
- if ( $show_email ) {
85
- $social_links['user_email'] = get_the_author_meta( 'user_email', $userd_id );
86
- }
87
-
88
- return $social_links;
89
-
90
- }
91
-
92
- public static function get_google_font_subsets() {
93
- return array(
94
- 'none' => 'None',
95
- 'latin' => 'Latin',
96
- 'latin-ext' => 'Latin Extended',
97
- 'cyrillic' => 'Cyrillic',
98
- 'cyrillic-ext' => 'Cyrillic Extended',
99
- 'devanagari' => 'Devanagari',
100
- 'greek' => 'Greek',
101
- 'greek-ext' => 'Greek Extended',
102
- 'vietnamese' => 'Vietnamese',
103
- 'khmer' => 'Khmer',
104
- );
105
- }
106
-
107
- public static function get_google_fonts() {
108
- $fonts = array(
109
- 'None',
110
- 'ABeeZee',
111
- 'Abel',
112
- 'Abril Fatface',
113
- 'Aclonica',
114
- 'Acme',
115
- 'Actor',
116
- 'Adamina',
117
- 'Advent Pro',
118
- 'Aguafina Script',
119
- 'Akronim',
120
- 'Aladin',
121
- 'Aldrich',
122
- 'Alef',
123
- 'Alegreya',
124
- 'Alegreya SC',
125
- 'Alegreya Sans',
126
- 'Alegreya Sans SC',
127
- 'Alex Brush',
128
- 'Alfa Slab One',
129
- 'Alice',
130
- 'Alike',
131
- 'Alike Angular',
132
- 'Allan',
133
- 'Allerta',
134
- 'Allerta Stencil',
135
- 'Allura',
136
- 'Almendra',
137
- 'Almendra Display',
138
- 'Almendra SC',
139
- 'Amarante',
140
- 'Amaranth',
141
- 'Amatic SC',
142
- 'Amethysta',
143
- 'Anaheim',
144
- 'Andada',
145
- 'Andika',
146
- 'Angkor',
147
- 'Annie Use Your Telescope',
148
- 'Anonymous Pro',
149
- 'Antic',
150
- 'Antic Didone',
151
- 'Antic Slab',
152
- 'Anton',
153
- 'Arapey',
154
- 'Arbutus',
155
- 'Arbutus Slab',
156
- 'Architects Daughter',
157
- 'Archivo Black',
158
- 'Archivo Narrow',
159
- 'Arimo',
160
- 'Arizonia',
161
- 'Armata',
162
- 'Artifika',
163
- 'Arvo',
164
- 'Asap',
165
- 'Asset',
166
- 'Astloch',
167
- 'Asul',
168
- 'Atomic Age',
169
- 'Aubrey',
170
- 'Audiowide',
171
- 'Autour One',
172
- 'Average',
173
- 'Average Sans',
174
- 'Averia Gruesa Libre',
175
- 'Averia Libre',
176
- 'Averia Sans Libre',
177
- 'Averia Serif Libre',
178
- 'Bad Script',
179
- 'Balthazar',
180
- 'Bangers',
181
- 'Basic',
182
- 'Battambang',
183
- 'Baumans',
184
- 'Bayon',
185
- 'Belgrano',
186
- 'Belleza',
187
- 'BenchNine',
188
- 'Bentham',
189
- 'Berkshire Swash',
190
- 'Bevan',
191
- 'Bigelow Rules',
192
- 'Bigshot One',
193
- 'Bilbo',
194
- 'Bilbo Swash Caps',
195
- 'Bitter',
196
- 'Black Ops One',
197
- 'Bokor',
198
- 'Bonbon',
199
- 'Boogaloo',
200
- 'Bowlby One',
201
- 'Bowlby One SC',
202
- 'Brawler',
203
- 'Bree Serif',
204
- 'Bubblegum Sans',
205
- 'Bubbler One',
206
- 'Buda',
207
- 'Buenard',
208
- 'Butcherman',
209
- 'Butterfly Kids',
210
- 'Cabin',
211
- 'Cabin Condensed',
212
- 'Cabin Sketch',
213
- 'Caesar Dressing',
214
- 'Cagliostro',
215
- 'Calligraffitti',
216
- 'Cambo',
217
- 'Candal',
218
- 'Cantarell',
219
- 'Cantata One',
220
- 'Cantora One',
221
- 'Capriola',
222
- 'Cardo',
223
- 'Carme',
224
- 'Carrois Gothic',
225
- 'Carrois Gothic SC',
226
- 'Carter One',
227
- 'Caudex',
228
- 'Cedarville Cursive',
229
- 'Ceviche One',
230
- 'Changa One',
231
- 'Chango',
232
- 'Chau Philomene One',
233
- 'Chela One',
234
- 'Chelsea Market',
235
- 'Chenla',
236
- 'Cherry Cream Soda',
237
- 'Cherry Swash',
238
- 'Chewy',
239
- 'Chicle',
240
- 'Chivo',
241
- 'Cinzel',
242
- 'Cinzel Decorative',
243
- 'Clicker Script',
244
- 'Coda',
245
- 'Coda Caption',
246
- 'Codystar',
247
- 'Combo',
248
- 'Comfortaa',
249
- 'Coming Soon',
250
- 'Concert One',
251
- 'Condiment',
252
- 'Content',
253
- 'Contrail One',
254
- 'Convergence',
255
- 'Cookie',
256
- 'Copse',
257
- 'Corben',
258
- 'Courgette',
259
- 'Cousine',
260
- 'Coustard',
261
- 'Covered By Your Grace',
262
- 'Crafty Girls',
263
- 'Creepster',
264
- 'Crete Round',
265
- 'Crimson Text',
266
- 'Croissant One',
267
- 'Crushed',
268
- 'Cuprum',
269
- 'Cutive',
270
- 'Cutive Mono',
271
- 'Damion',
272
- 'Dancing Script',
273
- 'Dangrek',
274
- 'Dawning of a New Day',
275
- 'Days One',
276
- 'Delius',
277
- 'Delius Swash Caps',
278
- 'Delius Unicase',
279
- 'Della Respira',
280
- 'Denk One',
281
- 'Devonshire',
282
- 'Didact Gothic',
283
- 'Diplomata',
284
- 'Diplomata SC',
285
- 'Domine',
286
- 'Donegal One',
287
- 'Doppio One',
288
- 'Dorsa',
289
- 'Dosis',
290
- 'Dr Sugiyama',
291
- 'Droid Sans',
292
- 'Droid Sans Mono',
293
- 'Droid Serif',
294
- 'Duru Sans',
295
- 'Dynalight',
296
- 'EB Garamond',
297
- 'Eagle Lake',
298
- 'Eater',
299
- 'Economica',
300
- 'Ek Mukta',
301
- 'Electrolize',
302
- 'Elsie',
303
- 'Elsie Swash Caps',
304
- 'Emblema One',
305
- 'Emilys Candy',
306
- 'Engagement',
307
- 'Englebert',
308
- 'Enriqueta',
309
- 'Erica One',
310
- 'Esteban',
311
- 'Euphoria Script',
312
- 'Ewert',
313
- 'Exo',
314
- 'Exo 2',
315
- 'Expletus Sans',
316
- 'Fanwood Text',
317
- 'Fascinate',
318
- 'Fascinate Inline',
319
- 'Faster One',
320
- 'Fasthand',
321
- 'Fauna One',
322
- 'Federant',
323
- 'Federo',
324
- 'Felipa',
325
- 'Fenix',
326
- 'Finger Paint',
327
- 'Fira Mono',
328
- 'Fira Sans',
329
- 'Fjalla One',
330
- 'Fjord One',
331
- 'Flamenco',
332
- 'Flavors',
333
- 'Fondamento',
334
- 'Fontdiner Swanky',
335
- 'Forum',
336
- 'Francois One',
337
- 'Freckle Face',
338
- 'Fredericka the Great',
339
- 'Fredoka One',
340
- 'Freehand',
341
- 'Fresca',
342
- 'Frijole',
343
- 'Fruktur',
344
- 'Fugaz One',
345
- 'GFS Didot',
346
- 'GFS Neohellenic',
347
- 'Gabriela',
348
- 'Gafata',
349
- 'Galdeano',
350
- 'Galindo',
351
- 'Gentium Basic',
352
- 'Gentium Book Basic',
353
- 'Geo',
354
- 'Geostar',
355
- 'Geostar Fill',
356
- 'Germania One',
357
- 'Gilda Display',
358
- 'Give You Glory',
359
- 'Glass Antiqua',
360
- 'Glegoo',
361
- 'Gloria Hallelujah',
362
- 'Goblin One',
363
- 'Gochi Hand',
364
- 'Gorditas',
365
- 'Goudy Bookletter 1911',
366
- 'Graduate',
367
- 'Grand Hotel',
368
- 'Gravitas One',
369
- 'Great Vibes',
370
- 'Griffy',
371
- 'Gruppo',
372
- 'Gudea',
373
- 'Habibi',
374
- 'Hammersmith One',
375
- 'Hanalei',
376
- 'Hanalei Fill',
377
- 'Handlee',
378
- 'Hanuman',
379
- 'Happy Monkey',
380
- 'Headland One',
381
- 'Henny Penny',
382
- 'Herr Von Muellerhoff',
383
- 'Hind',
384
- 'Holtwood One SC',
385
- 'Homemade Apple',
386
- 'Homenaje',
387
- 'IM Fell DW Pica',
388
- 'IM Fell DW Pica SC',
389
- 'IM Fell Double Pica',
390
- 'IM Fell Double Pica SC',
391
- 'IM Fell English',
392
- 'IM Fell English SC',
393
- 'IM Fell French Canon',
394
- 'IM Fell French Canon SC',
395
- 'IM Fell Great Primer',
396
- 'IM Fell Great Primer SC',
397
- 'Iceberg',
398
- 'Iceland',
399
- 'Imprima',
400
- 'Inconsolata',
401
- 'Inder',
402
- 'Indie Flower',
403
- 'Inika',
404
- 'Irish Grover',
405
- 'Istok Web',
406
- 'Italiana',
407
- 'Italianno',
408
- 'Jacques Francois',
409
- 'Jacques Francois Shadow',
410
- 'Jim Nightshade',
411
- 'Jockey One',
412
- 'Jolly Lodger',
413
- 'Josefin Sans',
414
- 'Josefin Slab',
415
- 'Joti One',
416
- 'Judson',
417
- 'Julee',
418
- 'Julius Sans One',
419
- 'Junge',
420
- 'Jura',
421
- 'Just Another Hand',
422
- 'Just Me Again Down Here',
423
- 'Kalam',
424
- 'Kameron',
425
- 'Kantumruy',
426
- 'Karla',
427
- 'Karma',
428
- 'Kaushan Script',
429
- 'Kavoon',
430
- 'Kdam Thmor',
431
- 'Keania One',
432
- 'Kelly Slab',
433
- 'Kenia',
434
- 'Khmer',
435
- 'Kite One',
436
- 'Knewave',
437
- 'Kotta One',
438
- 'Koulen',
439
- 'Kranky',
440
- 'Kreon',
441
- 'Kristi',
442
- 'Krona One',
443
- 'La Belle Aurore',
444
- 'Lancelot',
445
- 'Lato',
446
- 'League Script',
447
- 'Leckerli One',
448
- 'Ledger',
449
- 'Lekton',
450
- 'Lemon',
451
- 'Libre Baskerville',
452
- 'Life Savers',
453
- 'Lilita One',
454
- 'Lily Script One',
455
- 'Limelight',
456
- 'Linden Hill',
457
- 'Lobster',
458
- 'Lobster Two',
459
- 'Londrina Outline',
460
- 'Londrina Shadow',
461
- 'Londrina Sketch',
462
- 'Londrina Solid',
463
- 'Lora',
464
- 'Love Ya Like A Sister',
465
- 'Loved by the King',
466
- 'Lovers Quarrel',
467
- 'Luckiest Guy',
468
- 'Lusitana',
469
- 'Lustria',
470
- 'Macondo',
471
- 'Macondo Swash Caps',
472
- 'Magra',
473
- 'Maiden Orange',
474
- 'Mako',
475
- 'Marcellus',
476
- 'Marcellus SC',
477
- 'Marck Script',
478
- 'Margarine',
479
- 'Marko One',
480
- 'Marmelad',
481
- 'Marvel',
482
- 'Mate',
483
- 'Mate SC',
484
- 'Maven Pro',
485
- 'McLaren',
486
- 'Meddon',
487
- 'MedievalSharp',
488
- 'Medula One',
489
- 'Megrim',
490
- 'Meie Script',
491
- 'Merienda',
492
- 'Merienda One',
493
- 'Merriweather',
494
- 'Merriweather Sans',
495
- 'Metal',
496
- 'Metal Mania',
497
- 'Metamorphous',
498
- 'Metrophobic',
499
- 'Michroma',
500
- 'Milonga',
501
- 'Miltonian',
502
- 'Miltonian Tattoo',
503
- 'Miniver',
504
- 'Miss Fajardose',
505
- 'Modern Antiqua',
506
- 'Molengo',
507
- 'Molle',
508
- 'Monda',
509
- 'Monofett',
510
- 'Monoton',
511
- 'Monsieur La Doulaise',
512
- 'Montaga',
513
- 'Montez',
514
- 'Montserrat',
515
- 'Montserrat Alternates',
516
- 'Montserrat Subrayada',
517
- 'Moul',
518
- 'Moulpali',
519
- 'Mountains of Christmas',
520
- 'Mouse Memoirs',
521
- 'Mr Bedfort',
522
- 'Mr Dafoe',
523
- 'Mr De Haviland',
524
- 'Mrs Saint Delafield',
525
- 'Mrs Sheppards',
526
- 'Muli',
527
- 'Mystery Quest',
528
- 'Neucha',
529
- 'Neuton',
530
- 'New Rocker',
531
- 'News Cycle',
532
- 'Niconne',
533
- 'Nixie One',
534
- 'Nobile',
535
- 'Nokora',
536
- 'Norican',
537
- 'Nosifer',
538
- 'Nothing You Could Do',
539
- 'Noticia Text',
540
- 'Noto Sans',
541
- 'Noto Serif',
542
- 'Nova Cut',
543
- 'Nova Flat',
544
- 'Nova Mono',
545
- 'Nova Oval',
546
- 'Nova Round',
547
- 'Nova Script',
548
- 'Nova Slim',
549
- 'Nova Square',
550
- 'Numans',
551
- 'Nunito',
552
- 'Odor Mean Chey',
553
- 'Offside',
554
- 'Old Standard TT',
555
- 'Oldenburg',
556
- 'Oleo Script',
557
- 'Oleo Script Swash Caps',
558
- 'Open Sans',
559
- 'Open Sans Condensed',
560
- 'Oranienbaum',
561
- 'Orbitron',
562
- 'Oregano',
563
- 'Orienta',
564
- 'Original Surfer',
565
- 'Oswald',
566
- 'Over the Rainbow',
567
- 'Overlock',
568
- 'Overlock SC',
569
- 'Ovo',
570
- 'Oxygen',
571
- 'Oxygen Mono',
572
- 'PT Mono',
573
- 'PT Sans',
574
- 'PT Sans Caption',
575
- 'PT Sans Narrow',
576
- 'PT Serif',
577
- 'PT Serif Caption',
578
- 'Pacifico',
579
- 'Paprika',
580
- 'Parisienne',
581
- 'Passero One',
582
- 'Passion One',
583
- 'Pathway Gothic One',
584
- 'Patrick Hand',
585
- 'Patrick Hand SC',
586
- 'Patua One',
587
- 'Paytone One',
588
- 'Peralta',
589
- 'Permanent Marker',
590
- 'Petit Formal Script',
591
- 'Petrona',
592
- 'Philosopher',
593
- 'Piedra',
594
- 'Pinyon Script',
595
- 'Pirata One',
596
- 'Plaster',
597
- 'Play',
598
- 'Playball',
599
- 'Playfair Display',
600
- 'Playfair Display SC',
601
- 'Podkova',
602
- 'Poiret One',
603
- 'Poller One',
604
- 'Poly',
605
- 'Pompiere',
606
- 'Pontano Sans',
607
- 'Port Lligat Sans',
608
- 'Port Lligat Slab',
609
- 'Prata',
610
- 'Preahvihear',
611
- 'Press Start 2P',
612
- 'Princess Sofia',
613
- 'Prociono',
614
- 'Prosto One',
615
- 'Puritan',
616
- 'Purple Purse',
617
- 'Quando',
618
- 'Quantico',
619
- 'Quattrocento',
620
- 'Quattrocento Sans',
621
- 'Questrial',
622
- 'Quicksand',
623
- 'Quintessential',
624
- 'Qwigley',
625
- 'Racing Sans One',
626
- 'Radley',
627
- 'Rajdhani',
628
- 'Raleway',
629
- 'Raleway Dots',
630
- 'Rambla',
631
- 'Rammetto One',
632
- 'Ranchers',
633
- 'Rancho',
634
- 'Rationale',
635
- 'Redressed',
636
- 'Reenie Beanie',
637
- 'Revalia',
638
- 'Ribeye',
639
- 'Ribeye Marrow',
640
- 'Righteous',
641
- 'Risque',
642
- 'Roboto',
643
- 'Roboto Condensed',
644
- 'Roboto Slab',
645
- 'Rochester',
646
- 'Rock Salt',
647
- 'Rokkitt',
648
- 'Romanesco',
649
- 'Ropa Sans',
650
- 'Rosario',
651
- 'Rosarivo',
652
- 'Rouge Script',
653
- 'Rubik Mono One',
654
- 'Rubik One',
655
- 'Ruda',
656
- 'Rufina',
657
- 'Ruge Boogie',
658
- 'Ruluko',
659
- 'Rum Raisin',
660
- 'Ruslan Display',
661
- 'Russo One',
662
- 'Ruthie',
663
- 'Rye',
664
- 'Sacramento',
665
- 'Sail',
666
- 'Salsa',
667
- 'Sanchez',
668
- 'Sancreek',
669
- 'Sansita One',
670
- 'Sarina',
671
- 'Satisfy',
672
- 'Scada',
673
- 'Schoolbell',
674
- 'Seaweed Script',
675
- 'Sevillana',
676
- 'Seymour One',
677
- 'Shadows Into Light',
678
- 'Shadows Into Light Two',
679
- 'Shanti',
680
- 'Share',
681
- 'Share Tech',
682
- 'Share Tech Mono',
683
- 'Shojumaru',
684
- 'Short Stack',
685
- 'Siemreap',
686
- 'Sigmar One',
687
- 'Signika',
688
- 'Signika Negative',
689
- 'Simonetta',
690
- 'Sintony',
691
- 'Sirin Stencil',
692
- 'Six Caps',
693
- 'Skranji',
694
- 'Slabo 13px',
695
- 'Slabo 27px',
696
- 'Slackey',
697
- 'Smokum',
698
- 'Smythe',
699
- 'Sniglet',
700
- 'Snippet',
701
- 'Snowburst One',
702
- 'Sofadi One',
703
- 'Sofia',
704
- 'Sonsie One',
705
- 'Sorts Mill Goudy',
706
- 'Source Code Pro',
707
- 'Source Sans Pro',
708
- 'Source Serif Pro',
709
- 'Special Elite',
710
- 'Spicy Rice',
711
- 'Spinnaker',
712
- 'Spirax',
713
- 'Squada One',
714
- 'Stalemate',
715
- 'Stalinist One',
716
- 'Stardos Stencil',
717
- 'Stint Ultra Condensed',
718
- 'Stint Ultra Expanded',
719
- 'Stoke',
720
- 'Strait',
721
- 'Sue Ellen Francisco',
722
- 'Sunshiney',
723
- 'Supermercado One',
724
- 'Suwannaphum',
725
- 'Swanky and Moo Moo',
726
- 'Syncopate',
727
- 'Tangerine',
728
- 'Taprom',
729
- 'Tauri',
730
- 'Teko',
731
- 'Telex',
732
- 'Tenor Sans',
733
- 'Text Me One',
734
- 'The Girl Next Door',
735
- 'Tienne',
736
- 'Tinos',
737
- 'Titan One',
738
- 'Titillium Web',
739
- 'Trade Winds',
740
- 'Trocchi',
741
- 'Trochut',
742
- 'Trykker',
743
- 'Tulpen One',
744
- 'Ubuntu',
745
- 'Ubuntu Condensed',
746
- 'Ubuntu Mono',
747
- 'Ultra',
748
- 'Uncial Antiqua',
749
- 'Underdog',
750
- 'Unica One',
751
- 'UnifrakturCook',
752
- 'UnifrakturMaguntia',
753
- 'Unkempt',
754
- 'Unlock',
755
- 'Unna',
756
- 'VT323',
757
- 'Vampiro One',
758
- 'Varela',
759
- 'Varela Round',
760
- 'Vast Shadow',
761
- 'Vibur',
762
- 'Vidaloka',
763
- 'Viga',
764
- 'Voces',
765
- 'Volkhov',
766
- 'Vollkorn',
767
- 'Voltaire',
768
- 'Waiting for the Sunrise',
769
- 'Wallpoet',
770
- 'Walter Turncoat',
771
- 'Warnes',
772
- 'Wellfleet',
773
- 'Wendy One',
774
- 'Wire One',
775
- 'Yanone Kaffeesatz',
776
- 'Yellowtail',
777
- 'Yeseva One',
778
- 'Yesteryear',
779
- 'Zeyada',
780
- );
781
-
782
- if ( empty( Simple_Author_Box_Helper::$fonts ) ) {
783
- foreach ( $fonts as $font ) {
784
- Simple_Author_Box_Helper::$fonts[ $font ] = $font;
785
- }
786
- }
787
-
788
- return Simple_Author_Box_Helper::$fonts;
789
-
790
- }
791
-
792
- public static function get_custom_post_type() {
793
- $post_types = get_post_types( array(
794
- 'publicly_queryable' => true,
795
- '_builtin' => false,
796
- ) );
797
-
798
- $post_types['post'] = __( 'Post', 'saboxplugin' );
799
- $post_types['page'] = __( 'Page', 'saboxplugin' );
800
-
801
- return $post_types;
802
- }
803
-
804
- public static function get_template( $template_name = 'template-sab.php' ) {
805
-
806
- $template = '';
807
-
808
- if ( ! $template ) {
809
- $template = locate_template( array( 'sab/' . $template_name ) );
810
- }
811
-
812
- if ( ! $template && file_exists( SIMPLE_AUTHOR_BOX_PATH . 'template/' . $template_name ) ) {
813
- $template = SIMPLE_AUTHOR_BOX_PATH . 'template/' . $template_name;
814
- }
815
-
816
- if ( ! $template ) {
817
- $template = SIMPLE_AUTHOR_BOX_PATH . 'template/template-sab.php';
818
- }
819
-
820
- // Allow 3rd party plugins to filter template file from their plugin.
821
- $template = apply_filters( 'sabox_get_template_part', $template, $template_name );
822
- if ( $template ) {
823
- return $template;
824
- }
825
-
826
- }
827
-
828
- public static function generate_inline_css() {
829
-
830
- $padding_top_bottom = get_option( 'sab_box_padding_top_bottom', 0 );
831
- $padding_left_right = get_option( 'sab_box_padding_left_right', 0 );
832
- $sabox_top_margin = get_option( 'sab_box_margin_top', 0 );
833
- $sabox_bottom_margin = get_option( 'sab_box_margin_bottom', 0 );
834
- $sabox_name_size = get_option( 'sab_box_name_size', 18 );
835
- $sabox_desc_size = get_option( 'sab_box_desc_size', 14 );
836
- $sabox_icon_size = get_option( 'sab_box_icon_size', 14 );
837
- $sabox_options = get_option( 'saboxplugin_options', array() );
838
-
839
- if ( isset( $sabox_options['sab_web'] ) and get_option( 'sab_box_web_size' ) ) {
840
- $sabox_web_size = get_option( 'sab_box_web_size' );
841
- } else {
842
- $sabox_web_size = 14;
843
- }
844
-
845
- $style = '';
846
-
847
- // Border color of Simple Author Box
848
- if ( isset( $sabox_options['sab_box_border'] ) && ! empty( $sabox_options['sab_box_border'] ) ) {
849
- $style .= '.saboxplugin-wrap {border-color:' . esc_html( $sabox_options['sab_box_border'] ) . ';}';
850
- $style .= '.saboxplugin-wrap .saboxplugin-socials {-webkit-box-shadow: 0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset; -moz-box-shadow:0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset;box-shadow:0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset;}';
851
- }
852
- // Avatar image style
853
- if ( isset( $sabox_options['sab_avatar_style'] ) && '0' != $sabox_options['sab_avatar_style'] ) {
854
- $style .= '.saboxplugin-wrap .saboxplugin-gravatar img {-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;}';
855
- }
856
- // Social icons style
857
- if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && isset( $sabox_options['sab_icons_style'] ) && '0' != $sabox_options['sab_icons_style'] ) {
858
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;}';
859
- }
860
- // Long Shadow
861
- if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && ! isset( $sabox_options['sab_box_long_shadow'] ) ) {
862
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:before {text-shadow: none;}';
863
- }
864
- // Avatar hover effect
865
- if ( isset( $sabox_options['sab_avatar_style'] ) && '0' != $sabox_options['sab_avatar_style'] && isset( $sabox_options['sab_avatar_hover'] ) ) {
866
- $style .= '.saboxplugin-wrap .saboxplugin-gravatar img {-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}';
867
- $style .= '.saboxplugin-wrap .saboxplugin-gravatar img:hover {-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);}';
868
- }
869
- // Social icons hover effect
870
- if ( isset( $sabox_options['sab_icons_style'] ) && '0' != $sabox_options['sab_icons_style'] && isset( $sabox_options['sab_social_hover'] ) ) {
871
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color, .saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {-webkit-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;-ms-transition: all 0.3s ease-in-out;transition: all 0.3s ease-in-out;}.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:hover,.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey:hover {-webkit-transform: rotate(360deg);-moz-transform: rotate(360deg);-o-transform: rotate(360deg);-ms-transform: rotate(360deg);transform: rotate(360deg);}';
872
- }
873
- // Thin border
874
- if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && ! isset( $sabox_options['sab_box_thin_border'] ) ) {
875
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {border: medium none !important;}';
876
- }
877
- // Background color of social icons bar
878
- if ( isset( $sabox_options['sab_box_icons_back'] ) && ! empty( $sabox_options['sab_box_icons_back'] ) ) {
879
- $style .= '.saboxplugin-wrap .saboxplugin-socials{background-color:' . esc_html( $sabox_options['sab_box_icons_back'] ) . ';}';
880
- }
881
- // Color of social icons (for symbols only):
882
- if ( isset( $sabox_options['sab_box_icons_color'] ) && ! empty( $sabox_options['sab_box_icons_color'] ) ) {
883
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {color:' . esc_html( $sabox_options['sab_box_icons_color'] ) . ';}';
884
- }
885
- // Author name color
886
- if ( isset( $sabox_options['sab_box_author_color'] ) && ! empty( $sabox_options['sab_box_author_color'] ) ) {
887
- $style .= '.saboxplugin-wrap .saboxplugin-authorname a {color:' . esc_html( $sabox_options['sab_box_author_color'] ) . ';}';
888
- }
889
-
890
- // Author web color
891
- if ( isset( $sabox_options['sab_web'] ) && isset( $sabox_options['sab_box_web_color'] ) && ! empty( $sabox_options['sab_box_web_color'] ) ) {
892
- $style .= '.saboxplugin-wrap .saboxplugin-web a {color:' . esc_html( $sabox_options['sab_box_web_color'] ) . ';}';
893
- }
894
-
895
- // Author name font family
896
- if ( get_option( 'sab_box_name_font', 'None' ) != 'None' ) {
897
- $author_name_font = get_option( 'sab_box_name_font' );
898
- $style .= '.saboxplugin-wrap .saboxplugin-authorname {font-family:"' . esc_html( $author_name_font ) . '";}';
899
- }
900
-
901
- // Author description font family
902
- if ( get_option( 'sab_box_desc_font', 'None' ) != 'None' ) {
903
- $author_desc_font = get_option( 'sab_box_desc_font' );
904
- $style .= '.saboxplugin-wrap .saboxplugin-desc {font-family:' . esc_html( $author_desc_font ) . ';}';
905
- }
906
-
907
- // Author web font family
908
- if ( isset( $sabox_options['sab_web'] ) && get_option( 'sab_box_web_font', 'None' ) != 'None' ) {
909
- $author_web_font = get_option( 'sab_box_web_font' );
910
- $style .= '.saboxplugin-wrap .saboxplugin-web {font-family:"' . esc_html( $author_web_font ) . '";}';
911
- }
912
-
913
- // Author description font style
914
- if ( isset( $sabox_options['sab_desc_style'] ) && '0' != $sabox_options['sab_desc_style'] ) {
915
- $style .= '.saboxplugin-wrap .saboxplugin-desc {font-style:italic;}';
916
- }
917
- // Margin top & bottom, Padding
918
- $style .= '.saboxplugin-wrap {margin-top:' . absint( $sabox_top_margin ) . 'px; margin-bottom:' . absint( $sabox_bottom_margin ) . 'px; padding: ' . absint( $padding_top_bottom ) . 'px ' . absint( $padding_left_right ) . 'px }';
919
- // Author name text size
920
- $style .= '.saboxplugin-wrap .saboxplugin-authorname {font-size:' . absint( $sabox_name_size ) . 'px; line-height:' . absint( $sabox_name_size + 7 ) . 'px;}';
921
- // Author description font size
922
- $style .= '.saboxplugin-wrap .saboxplugin-desc {font-size:' . absint( $sabox_desc_size ) . 'px; line-height:' . absint( $sabox_desc_size + 7 ) . 'px;}';
923
- // Author website text size
924
- $style .= '.saboxplugin-wrap .saboxplugin-web {font-size:' . absint( $sabox_web_size ) . 'px;}';
925
- // Icons size
926
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {font-size:' . absint( $sabox_icon_size + 3 ) . 'px;}';
927
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:before {width:' . absint( $sabox_icon_size + $sabox_icon_size ) . 'px; height:' . absint( $sabox_icon_size + $sabox_icon_size ) . 'px; line-height:' . absint( $sabox_icon_size + $sabox_icon_size + 1 ) . 'px; }';
928
- $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {font-size:' . absint( $sabox_icon_size ) . 'px;}';
929
-
930
- return apply_filters( 'sabox_inline_css', $style );
931
- }
932
-
933
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Simple_Author_Box_Helper {
7
+
8
+ public static $fonts = array();
9
+
10
+ static $social_icons = array(
11
+ 'addthis' => 'Add This',
12
+ 'behance' => 'Behance',
13
+ 'delicious' => 'Delicious',
14
+ 'deviantart' => 'Deviantart',
15
+ 'digg' => 'Digg',
16
+ 'dribbble' => 'Dribbble',
17
+ 'facebook' => 'Facebook',
18
+ 'flickr' => 'Flickr',
19
+ 'github' => 'Github',
20
+ 'google' => 'Google',
21
+ 'googleplus' => 'Google Plus',
22
+ 'html5' => 'Html5',
23
+ 'instagram' => 'Instagram',
24
+ 'linkedin' => 'Linkedin',
25
+ 'pinterest' => 'Pinterest',
26
+ 'reddit' => 'Reddit',
27
+ 'rss' => 'Rss',
28
+ 'sharethis' => 'Sharethis',
29
+ 'skype' => 'Skype',
30
+ 'soundcloud' => 'Soundcloud',
31
+ 'spotify' => 'Spotify',
32
+ 'stackoverflow' => 'Stackoverflow',
33
+ 'steam' => 'Steam',
34
+ 'stumbleUpon' => 'StumbleUpon',
35
+ 'tumblr' => 'Tumblr',
36
+ 'twitter' => 'Twitter',
37
+ 'vimeo' => 'Vimeo',
38
+ 'windows' => 'Windows',
39
+ 'wordpress' => 'Wordpress',
40
+ 'yahoo' => 'Yahoo',
41
+ 'youtube' => 'Youtube',
42
+ 'xing' => 'Xing',
43
+ 'mixcloud' => 'MixCloud',
44
+ 'goodreads' => 'Goodreads',
45
+ 'twitch' => 'Twitch',
46
+ 'vk' => 'VK',
47
+ 'medium' => 'Medium',
48
+ 'quora' => 'Quora',
49
+ 'meetup' => 'Meetup',
50
+ 'user_email' => 'Email',
51
+ 'snapchat' => 'Snapchat',
52
+ '500px' => '500px',
53
+ );
54
+
55
+ public static function get_sabox_social_icon( $url, $icon_name ) {
56
+
57
+ $options = get_option( 'saboxplugin_options' );
58
+
59
+ if ( isset( $options['sab_link_target'] ) && '0' != $options['sab_link_target'] ) {
60
+ $sabox_blank = '_blank';
61
+ } else {
62
+ $sabox_blank = '_self';
63
+ }
64
+
65
+ if ( isset( $options['sab_colored'] ) && '0' != $options['sab_colored'] ) {
66
+ $sab_color = 'saboxplugin-icon-color';
67
+ } else {
68
+ $sab_color = 'saboxplugin-icon-grey';
69
+ }
70
+
71
+ return '<a target="' . esc_attr( $sabox_blank ) . '" href="' . esc_url( $url ) . '" rel="nofollow"><span class="' . esc_attr( $sab_color ) . ' saboxplugin-icon-' . esc_attr( $icon_name ) . '"></span></a>';
72
+
73
+ }
74
+
75
+ public static function get_user_social_links( $userd_id, $show_email = false ) {
76
+
77
+ $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
78
+ $social_links = get_user_meta( $userd_id, 'sabox_social_links', true );
79
+
80
+ if ( ! is_array( $social_links ) ) {
81
+ $social_links = array();
82
+ }
83
+
84
+ if ( $show_email ) {
85
+ $social_links['user_email'] = get_the_author_meta( 'user_email', $userd_id );
86
+ }
87
+
88
+ return $social_links;
89
+
90
+ }
91
+
92
+ public static function get_google_font_subsets() {
93
+ return array(
94
+ 'none' => 'None',
95
+ 'latin' => 'Latin',
96
+ 'latin-ext' => 'Latin Extended',
97
+ 'cyrillic' => 'Cyrillic',
98
+ 'cyrillic-ext' => 'Cyrillic Extended',
99
+ 'devanagari' => 'Devanagari',
100
+ 'greek' => 'Greek',
101
+ 'greek-ext' => 'Greek Extended',
102
+ 'vietnamese' => 'Vietnamese',
103
+ 'khmer' => 'Khmer',
104
+ );
105
+ }
106
+
107
+ public static function get_google_fonts() {
108
+ $fonts = array(
109
+ 'None',
110
+ 'ABeeZee',
111
+ 'Abel',
112
+ 'Abril Fatface',
113
+ 'Aclonica',
114
+ 'Acme',
115
+ 'Actor',
116
+ 'Adamina',
117
+ 'Advent Pro',
118
+ 'Aguafina Script',
119
+ 'Akronim',
120
+ 'Aladin',
121
+ 'Aldrich',
122
+ 'Alef',
123
+ 'Alegreya',
124
+ 'Alegreya SC',
125
+ 'Alegreya Sans',
126
+ 'Alegreya Sans SC',
127
+ 'Alex Brush',
128
+ 'Alfa Slab One',
129
+ 'Alice',
130
+ 'Alike',
131
+ 'Alike Angular',
132
+ 'Allan',
133
+ 'Allerta',
134
+ 'Allerta Stencil',
135
+ 'Allura',
136
+ 'Almendra',
137
+ 'Almendra Display',
138
+ 'Almendra SC',
139
+ 'Amarante',
140
+ 'Amaranth',
141
+ 'Amatic SC',
142
+ 'Amethysta',
143
+ 'Anaheim',
144
+ 'Andada',
145
+ 'Andika',
146
+ 'Angkor',
147
+ 'Annie Use Your Telescope',
148
+ 'Anonymous Pro',
149
+ 'Antic',
150
+ 'Antic Didone',
151
+ 'Antic Slab',
152
+ 'Anton',
153
+ 'Arapey',
154
+ 'Arbutus',
155
+ 'Arbutus Slab',
156
+ 'Architects Daughter',
157
+ 'Archivo Black',
158
+ 'Archivo Narrow',
159
+ 'Arimo',
160
+ 'Arizonia',
161
+ 'Armata',
162
+ 'Artifika',
163
+ 'Arvo',
164
+ 'Asap',
165
+ 'Asset',
166
+ 'Astloch',
167
+ 'Asul',
168
+ 'Atomic Age',
169
+ 'Aubrey',
170
+ 'Audiowide',
171
+ 'Autour One',
172
+ 'Average',
173
+ 'Average Sans',
174
+ 'Averia Gruesa Libre',
175
+ 'Averia Libre',
176
+ 'Averia Sans Libre',
177
+ 'Averia Serif Libre',
178
+ 'Bad Script',
179
+ 'Balthazar',
180
+ 'Bangers',
181
+ 'Basic',
182
+ 'Battambang',
183
+ 'Baumans',
184
+ 'Bayon',
185
+ 'Belgrano',
186
+ 'Belleza',
187
+ 'BenchNine',
188
+ 'Bentham',
189
+ 'Berkshire Swash',
190
+ 'Bevan',
191
+ 'Bigelow Rules',
192
+ 'Bigshot One',
193
+ 'Bilbo',
194
+ 'Bilbo Swash Caps',
195
+ 'Bitter',
196
+ 'Black Ops One',
197
+ 'Bokor',
198
+ 'Bonbon',
199
+ 'Boogaloo',
200
+ 'Bowlby One',
201
+ 'Bowlby One SC',
202
+ 'Brawler',
203
+ 'Bree Serif',
204
+ 'Bubblegum Sans',
205
+ 'Bubbler One',
206
+ 'Buda',
207
+ 'Buenard',
208
+ 'Butcherman',
209
+ 'Butterfly Kids',
210
+ 'Cabin',
211
+ 'Cabin Condensed',
212
+ 'Cabin Sketch',
213
+ 'Caesar Dressing',
214
+ 'Cagliostro',
215
+ 'Calligraffitti',
216
+ 'Cambo',
217
+ 'Candal',
218
+ 'Cantarell',
219
+ 'Cantata One',
220
+ 'Cantora One',
221
+ 'Capriola',
222
+ 'Cardo',
223
+ 'Carme',
224
+ 'Carrois Gothic',
225
+ 'Carrois Gothic SC',
226
+ 'Carter One',
227
+ 'Caudex',
228
+ 'Cedarville Cursive',
229
+ 'Ceviche One',
230
+ 'Changa One',
231
+ 'Chango',
232
+ 'Chau Philomene One',
233
+ 'Chela One',
234
+ 'Chelsea Market',
235
+ 'Chenla',
236
+ 'Cherry Cream Soda',
237
+ 'Cherry Swash',
238
+ 'Chewy',
239
+ 'Chicle',
240
+ 'Chivo',
241
+ 'Cinzel',
242
+ 'Cinzel Decorative',
243
+ 'Clicker Script',
244
+ 'Coda',
245
+ 'Coda Caption',
246
+ 'Codystar',
247
+ 'Combo',
248
+ 'Comfortaa',
249
+ 'Coming Soon',
250
+ 'Concert One',
251
+ 'Condiment',
252
+ 'Content',
253
+ 'Contrail One',
254
+ 'Convergence',
255
+ 'Cookie',
256
+ 'Copse',
257
+ 'Corben',
258
+ 'Courgette',
259
+ 'Cousine',
260
+ 'Coustard',
261
+ 'Covered By Your Grace',
262
+ 'Crafty Girls',
263
+ 'Creepster',
264
+ 'Crete Round',
265
+ 'Crimson Text',
266
+ 'Croissant One',
267
+ 'Crushed',
268
+ 'Cuprum',
269
+ 'Cutive',
270
+ 'Cutive Mono',
271
+ 'Damion',
272
+ 'Dancing Script',
273
+ 'Dangrek',
274
+ 'Dawning of a New Day',
275
+ 'Days One',
276
+ 'Delius',
277
+ 'Delius Swash Caps',
278
+ 'Delius Unicase',
279
+ 'Della Respira',
280
+ 'Denk One',
281
+ 'Devonshire',
282
+ 'Didact Gothic',
283
+ 'Diplomata',
284
+ 'Diplomata SC',
285
+ 'Domine',
286
+ 'Donegal One',
287
+ 'Doppio One',
288
+ 'Dorsa',
289
+ 'Dosis',
290
+ 'Dr Sugiyama',
291
+ 'Droid Sans',
292
+ 'Droid Sans Mono',
293
+ 'Droid Serif',
294
+ 'Duru Sans',
295
+ 'Dynalight',
296
+ 'EB Garamond',
297
+ 'Eagle Lake',
298
+ 'Eater',
299
+ 'Economica',
300
+ 'Ek Mukta',
301
+ 'Electrolize',
302
+ 'Elsie',
303
+ 'Elsie Swash Caps',
304
+ 'Emblema One',
305
+ 'Emilys Candy',
306
+ 'Engagement',
307
+ 'Englebert',
308
+ 'Enriqueta',
309
+ 'Erica One',
310
+ 'Esteban',
311
+ 'Euphoria Script',
312
+ 'Ewert',
313
+ 'Exo',
314
+ 'Exo 2',
315
+ 'Expletus Sans',
316
+ 'Fanwood Text',
317
+ 'Fascinate',
318
+ 'Fascinate Inline',
319
+ 'Faster One',
320
+ 'Fasthand',
321
+ 'Fauna One',
322
+ 'Federant',
323
+ 'Federo',
324
+ 'Felipa',
325
+ 'Fenix',
326
+ 'Finger Paint',
327
+ 'Fira Mono',
328
+ 'Fira Sans',
329
+ 'Fjalla One',
330
+ 'Fjord One',
331
+ 'Flamenco',
332
+ 'Flavors',
333
+ 'Fondamento',
334
+ 'Fontdiner Swanky',
335
+ 'Forum',
336
+ 'Francois One',
337
+ 'Freckle Face',
338
+ 'Fredericka the Great',
339
+ 'Fredoka One',
340
+ 'Freehand',
341
+ 'Fresca',
342
+ 'Frijole',
343
+ 'Fruktur',
344
+ 'Fugaz One',
345
+ 'GFS Didot',
346
+ 'GFS Neohellenic',
347
+ 'Gabriela',
348
+ 'Gafata',
349
+ 'Galdeano',
350
+ 'Galindo',
351
+ 'Gentium Basic',
352
+ 'Gentium Book Basic',
353
+ 'Geo',
354
+ 'Geostar',
355
+ 'Geostar Fill',
356
+ 'Germania One',
357
+ 'Gilda Display',
358
+ 'Give You Glory',
359
+ 'Glass Antiqua',
360
+ 'Glegoo',
361
+ 'Gloria Hallelujah',
362
+ 'Goblin One',
363
+ 'Gochi Hand',
364
+ 'Gorditas',
365
+ 'Goudy Bookletter 1911',
366
+ 'Graduate',
367
+ 'Grand Hotel',
368
+ 'Gravitas One',
369
+ 'Great Vibes',
370
+ 'Griffy',
371
+ 'Gruppo',
372
+ 'Gudea',
373
+ 'Habibi',
374
+ 'Hammersmith One',
375
+ 'Hanalei',
376
+ 'Hanalei Fill',
377
+ 'Handlee',
378
+ 'Hanuman',
379
+ 'Happy Monkey',
380
+ 'Headland One',
381
+ 'Henny Penny',
382
+ 'Herr Von Muellerhoff',
383
+ 'Hind',
384
+ 'Holtwood One SC',
385
+ 'Homemade Apple',
386
+ 'Homenaje',
387
+ 'IM Fell DW Pica',
388
+ 'IM Fell DW Pica SC',
389
+ 'IM Fell Double Pica',
390
+ 'IM Fell Double Pica SC',
391
+ 'IM Fell English',
392
+ 'IM Fell English SC',
393
+ 'IM Fell French Canon',
394
+ 'IM Fell French Canon SC',
395
+ 'IM Fell Great Primer',
396
+ 'IM Fell Great Primer SC',
397
+ 'Iceberg',
398
+ 'Iceland',
399
+ 'Imprima',
400
+ 'Inconsolata',
401
+ 'Inder',
402
+ 'Indie Flower',
403
+ 'Inika',
404
+ 'Irish Grover',
405
+ 'Istok Web',
406
+ 'Italiana',
407
+ 'Italianno',
408
+ 'Jacques Francois',
409
+ 'Jacques Francois Shadow',
410
+ 'Jim Nightshade',
411
+ 'Jockey One',
412
+ 'Jolly Lodger',
413
+ 'Josefin Sans',
414
+ 'Josefin Slab',
415
+ 'Joti One',
416
+ 'Judson',
417
+ 'Julee',
418
+ 'Julius Sans One',
419
+ 'Junge',
420
+ 'Jura',
421
+ 'Just Another Hand',
422
+ 'Just Me Again Down Here',
423
+ 'Kalam',
424
+ 'Kameron',
425
+ 'Kantumruy',
426
+ 'Karla',
427
+ 'Karma',
428
+ 'Kaushan Script',
429
+ 'Kavoon',
430
+ 'Kdam Thmor',
431
+ 'Keania One',
432
+ 'Kelly Slab',
433
+ 'Kenia',
434
+ 'Khmer',
435
+ 'Kite One',
436
+ 'Knewave',
437
+ 'Kotta One',
438
+ 'Koulen',
439
+ 'Kranky',
440
+ 'Kreon',
441
+ 'Kristi',
442
+ 'Krona One',
443
+ 'La Belle Aurore',
444
+ 'Lancelot',
445
+ 'Lato',
446
+ 'League Script',
447
+ 'Leckerli One',
448
+ 'Ledger',
449
+ 'Lekton',
450
+ 'Lemon',
451
+ 'Libre Baskerville',
452
+ 'Life Savers',
453
+ 'Lilita One',
454
+ 'Lily Script One',
455
+ 'Limelight',
456
+ 'Linden Hill',
457
+ 'Lobster',
458
+ 'Lobster Two',
459
+ 'Londrina Outline',
460
+ 'Londrina Shadow',
461
+ 'Londrina Sketch',
462
+ 'Londrina Solid',
463
+ 'Lora',
464
+ 'Love Ya Like A Sister',
465
+ 'Loved by the King',
466
+ 'Lovers Quarrel',
467
+ 'Luckiest Guy',
468
+ 'Lusitana',
469
+ 'Lustria',
470
+ 'Macondo',
471
+ 'Macondo Swash Caps',
472
+ 'Magra',
473
+ 'Maiden Orange',
474
+ 'Mako',
475
+ 'Marcellus',
476
+ 'Marcellus SC',
477
+ 'Marck Script',
478
+ 'Margarine',
479
+ 'Marko One',
480
+ 'Marmelad',
481
+ 'Marvel',
482
+ 'Mate',
483
+ 'Mate SC',
484
+ 'Maven Pro',
485
+ 'McLaren',
486
+ 'Meddon',
487
+ 'MedievalSharp',
488
+ 'Medula One',
489
+ 'Megrim',
490
+ 'Meie Script',
491
+ 'Merienda',
492
+ 'Merienda One',
493
+ 'Merriweather',
494
+ 'Merriweather Sans',
495
+ 'Metal',
496
+ 'Metal Mania',
497
+ 'Metamorphous',
498
+ 'Metrophobic',
499
+ 'Michroma',
500
+ 'Milonga',
501
+ 'Miltonian',
502
+ 'Miltonian Tattoo',
503
+ 'Miniver',
504
+ 'Miss Fajardose',
505
+ 'Modern Antiqua',
506
+ 'Molengo',
507
+ 'Molle',
508
+ 'Monda',
509
+ 'Monofett',
510
+ 'Monoton',
511
+ 'Monsieur La Doulaise',
512
+ 'Montaga',
513
+ 'Montez',
514
+ 'Montserrat',
515
+ 'Montserrat Alternates',
516
+ 'Montserrat Subrayada',
517
+ 'Moul',
518
+ 'Moulpali',
519
+ 'Mountains of Christmas',
520
+ 'Mouse Memoirs',
521
+ 'Mr Bedfort',
522
+ 'Mr Dafoe',
523
+ 'Mr De Haviland',
524
+ 'Mrs Saint Delafield',
525
+ 'Mrs Sheppards',
526
+ 'Muli',
527
+ 'Mystery Quest',
528
+ 'Neucha',
529
+ 'Neuton',
530
+ 'New Rocker',
531
+ 'News Cycle',
532
+ 'Niconne',
533
+ 'Nixie One',
534
+ 'Nobile',
535
+ 'Nokora',
536
+ 'Norican',
537
+ 'Nosifer',
538
+ 'Nothing You Could Do',
539
+ 'Noticia Text',
540
+ 'Noto Sans',
541
+ 'Noto Serif',
542
+ 'Nova Cut',
543
+ 'Nova Flat',
544
+ 'Nova Mono',
545
+ 'Nova Oval',
546
+ 'Nova Round',
547
+ 'Nova Script',
548
+ 'Nova Slim',
549
+ 'Nova Square',
550
+ 'Numans',
551
+ 'Nunito',
552
+ 'Odor Mean Chey',
553
+ 'Offside',
554
+ 'Old Standard TT',
555
+ 'Oldenburg',
556
+ 'Oleo Script',
557
+ 'Oleo Script Swash Caps',
558
+ 'Open Sans',
559
+ 'Open Sans Condensed',
560
+ 'Oranienbaum',
561
+ 'Orbitron',
562
+ 'Oregano',
563
+ 'Orienta',
564
+ 'Original Surfer',
565
+ 'Oswald',
566
+ 'Over the Rainbow',
567
+ 'Overlock',
568
+ 'Overlock SC',
569
+ 'Ovo',
570
+ 'Oxygen',
571
+ 'Oxygen Mono',
572
+ 'PT Mono',
573
+ 'PT Sans',
574
+ 'PT Sans Caption',
575
+ 'PT Sans Narrow',
576
+ 'PT Serif',
577
+ 'PT Serif Caption',
578
+ 'Pacifico',
579
+ 'Paprika',
580
+ 'Parisienne',
581
+ 'Passero One',
582
+ 'Passion One',
583
+ 'Pathway Gothic One',
584
+ 'Patrick Hand',
585
+ 'Patrick Hand SC',
586
+ 'Patua One',
587
+ 'Paytone One',
588
+ 'Peralta',
589
+ 'Permanent Marker',
590
+ 'Petit Formal Script',
591
+ 'Petrona',
592
+ 'Philosopher',
593
+ 'Piedra',
594
+ 'Pinyon Script',
595
+ 'Pirata One',
596
+ 'Plaster',
597
+ 'Play',
598
+ 'Playball',
599
+ 'Playfair Display',
600
+ 'Playfair Display SC',
601
+ 'Podkova',
602
+ 'Poiret One',
603
+ 'Poller One',
604
+ 'Poly',
605
+ 'Pompiere',
606
+ 'Pontano Sans',
607
+ 'Port Lligat Sans',
608
+ 'Port Lligat Slab',
609
+ 'Prata',
610
+ 'Preahvihear',
611
+ 'Press Start 2P',
612
+ 'Princess Sofia',
613
+ 'Prociono',
614
+ 'Prosto One',
615
+ 'Puritan',
616
+ 'Purple Purse',
617
+ 'Quando',
618
+ 'Quantico',
619
+ 'Quattrocento',
620
+ 'Quattrocento Sans',
621
+ 'Questrial',
622
+ 'Quicksand',
623
+ 'Quintessential',
624
+ 'Qwigley',
625
+ 'Racing Sans One',
626
+ 'Radley',
627
+ 'Rajdhani',
628
+ 'Raleway',
629
+ 'Raleway Dots',
630
+ 'Rambla',
631
+ 'Rammetto One',
632
+ 'Ranchers',
633
+ 'Rancho',
634
+ 'Rationale',
635
+ 'Redressed',
636
+ 'Reenie Beanie',
637
+ 'Revalia',
638
+ 'Ribeye',
639
+ 'Ribeye Marrow',
640
+ 'Righteous',
641
+ 'Risque',
642
+ 'Roboto',
643
+ 'Roboto Condensed',
644
+ 'Roboto Slab',
645
+ 'Rochester',
646
+ 'Rock Salt',
647
+ 'Rokkitt',
648
+ 'Romanesco',
649
+ 'Ropa Sans',
650
+ 'Rosario',
651
+ 'Rosarivo',
652
+ 'Rouge Script',
653
+ 'Rubik Mono One',
654
+ 'Rubik One',
655
+ 'Ruda',
656
+ 'Rufina',
657
+ 'Ruge Boogie',
658
+ 'Ruluko',
659
+ 'Rum Raisin',
660
+ 'Ruslan Display',
661
+ 'Russo One',
662
+ 'Ruthie',
663
+ 'Rye',
664
+ 'Sacramento',
665
+ 'Sail',
666
+ 'Salsa',
667
+ 'Sanchez',
668
+ 'Sancreek',
669
+ 'Sansita One',
670
+ 'Sarina',
671
+ 'Satisfy',
672
+ 'Scada',
673
+ 'Schoolbell',
674
+ 'Seaweed Script',
675
+ 'Sevillana',
676
+ 'Seymour One',
677
+ 'Shadows Into Light',
678
+ 'Shadows Into Light Two',
679
+ 'Shanti',
680
+ 'Share',
681
+ 'Share Tech',
682
+ 'Share Tech Mono',
683
+ 'Shojumaru',
684
+ 'Short Stack',
685
+ 'Siemreap',
686
+ 'Sigmar One',
687
+ 'Signika',
688
+ 'Signika Negative',
689
+ 'Simonetta',
690
+ 'Sintony',
691
+ 'Sirin Stencil',
692
+ 'Six Caps',
693
+ 'Skranji',
694
+ 'Slabo 13px',
695
+ 'Slabo 27px',
696
+ 'Slackey',
697
+ 'Smokum',
698
+ 'Smythe',
699
+ 'Sniglet',
700
+ 'Snippet',
701
+ 'Snowburst One',
702
+ 'Sofadi One',
703
+ 'Sofia',
704
+ 'Sonsie One',
705
+ 'Sorts Mill Goudy',
706
+ 'Source Code Pro',
707
+ 'Source Sans Pro',
708
+ 'Source Serif Pro',
709
+ 'Special Elite',
710
+ 'Spicy Rice',
711
+ 'Spinnaker',
712
+ 'Spirax',
713
+ 'Squada One',
714
+ 'Stalemate',
715
+ 'Stalinist One',
716
+ 'Stardos Stencil',
717
+ 'Stint Ultra Condensed',
718
+ 'Stint Ultra Expanded',
719
+ 'Stoke',
720
+ 'Strait',
721
+ 'Sue Ellen Francisco',
722
+ 'Sunshiney',
723
+ 'Supermercado One',
724
+ 'Suwannaphum',
725
+ 'Swanky and Moo Moo',
726
+ 'Syncopate',
727
+ 'Tangerine',
728
+ 'Taprom',
729
+ 'Tauri',
730
+ 'Teko',
731
+ 'Telex',
732
+ 'Tenor Sans',
733
+ 'Text Me One',
734
+ 'The Girl Next Door',
735
+ 'Tienne',
736
+ 'Tinos',
737
+ 'Titan One',
738
+ 'Titillium Web',
739
+ 'Trade Winds',
740
+ 'Trocchi',
741
+ 'Trochut',
742
+ 'Trykker',
743
+ 'Tulpen One',
744
+ 'Ubuntu',
745
+ 'Ubuntu Condensed',
746
+ 'Ubuntu Mono',
747
+ 'Ultra',
748
+ 'Uncial Antiqua',
749
+ 'Underdog',
750
+ 'Unica One',
751
+ 'UnifrakturCook',
752
+ 'UnifrakturMaguntia',
753
+ 'Unkempt',
754
+ 'Unlock',
755
+ 'Unna',
756
+ 'VT323',
757
+ 'Vampiro One',
758
+ 'Varela',
759
+ 'Varela Round',
760
+ 'Vast Shadow',
761
+ 'Vibur',
762
+ 'Vidaloka',
763
+ 'Viga',
764
+ 'Voces',
765
+ 'Volkhov',
766
+ 'Vollkorn',
767
+ 'Voltaire',
768
+ 'Waiting for the Sunrise',
769
+ 'Wallpoet',
770
+ 'Walter Turncoat',
771
+ 'Warnes',
772
+ 'Wellfleet',
773
+ 'Wendy One',
774
+ 'Wire One',
775
+ 'Yanone Kaffeesatz',
776
+ 'Yellowtail',
777
+ 'Yeseva One',
778
+ 'Yesteryear',
779
+ 'Zeyada',
780
+ );
781
+
782
+ if ( empty( Simple_Author_Box_Helper::$fonts ) ) {
783
+ foreach ( $fonts as $font ) {
784
+ Simple_Author_Box_Helper::$fonts[ $font ] = $font;
785
+ }
786
+ }
787
+
788
+ return Simple_Author_Box_Helper::$fonts;
789
+
790
+ }
791
+
792
+ public static function get_custom_post_type() {
793
+ $post_types = get_post_types(
794
+ array(
795
+ 'publicly_queryable' => true,
796
+ '_builtin' => false,
797
+ )
798
+ );
799
+
800
+ $post_types['post'] = __( 'Post', 'saboxplugin' );
801
+ $post_types['page'] = __( 'Page', 'saboxplugin' );
802
+
803
+ return $post_types;
804
+ }
805
+
806
+ public static function get_template( $template_name = 'template-sab.php' ) {
807
+
808
+ $template = '';
809
+
810
+ if ( ! $template ) {
811
+ $template = locate_template( array( 'sab/' . $template_name ) );
812
+ }
813
+
814
+ if ( ! $template && file_exists( SIMPLE_AUTHOR_BOX_PATH . 'template/' . $template_name ) ) {
815
+ $template = SIMPLE_AUTHOR_BOX_PATH . 'template/' . $template_name;
816
+ }
817
+
818
+ if ( ! $template ) {
819
+ $template = SIMPLE_AUTHOR_BOX_PATH . 'template/template-sab.php';
820
+ }
821
+
822
+ // Allow 3rd party plugins to filter template file from their plugin.
823
+ $template = apply_filters( 'sabox_get_template_part', $template, $template_name );
824
+ if ( $template ) {
825
+ return $template;
826
+ }
827
+
828
+ }
829
+
830
+ public static function generate_inline_css() {
831
+
832
+ $padding_top_bottom = get_option( 'sab_box_padding_top_bottom', 0 );
833
+ $padding_left_right = get_option( 'sab_box_padding_left_right', 0 );
834
+ $sabox_top_margin = get_option( 'sab_box_margin_top', 0 );
835
+ $sabox_bottom_margin = get_option( 'sab_box_margin_bottom', 0 );
836
+ $sabox_name_size = get_option( 'sab_box_name_size', 18 );
837
+ $sabox_desc_size = get_option( 'sab_box_desc_size', 14 );
838
+ $sabox_icon_size = get_option( 'sab_box_icon_size', 14 );
839
+ $sabox_options = get_option( 'saboxplugin_options', array() );
840
+
841
+ if ( isset( $sabox_options['sab_web'] ) and get_option( 'sab_box_web_size' ) ) {
842
+ $sabox_web_size = get_option( 'sab_box_web_size' );
843
+ } else {
844
+ $sabox_web_size = 14;
845
+ }
846
+
847
+ $style = '';
848
+
849
+ // Border color of Simple Author Box
850
+ if ( isset( $sabox_options['sab_box_border'] ) && ! empty( $sabox_options['sab_box_border'] ) ) {
851
+ $style .= '.saboxplugin-wrap {border-color:' . esc_html( $sabox_options['sab_box_border'] ) . ';}';
852
+ $style .= '.saboxplugin-wrap .saboxplugin-socials {-webkit-box-shadow: 0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset; -moz-box-shadow:0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset;box-shadow:0 0.05em 0 0 ' . esc_html( $sabox_options['sab_box_border'] ) . ' inset;}';
853
+ }
854
+ // Avatar image style
855
+ if ( isset( $sabox_options['sab_avatar_style'] ) && '0' != $sabox_options['sab_avatar_style'] ) {
856
+ $style .= '.saboxplugin-wrap .saboxplugin-gravatar img {-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;}';
857
+ }
858
+ // Social icons style
859
+ if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && isset( $sabox_options['sab_icons_style'] ) && '0' != $sabox_options['sab_icons_style'] ) {
860
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;}';
861
+ }
862
+ // Long Shadow
863
+ if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && ! isset( $sabox_options['sab_box_long_shadow'] ) ) {
864
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:before {text-shadow: none;}';
865
+ }
866
+ // Avatar hover effect
867
+ if ( isset( $sabox_options['sab_avatar_style'] ) && '0' != $sabox_options['sab_avatar_style'] && isset( $sabox_options['sab_avatar_hover'] ) ) {
868
+ $style .= '.saboxplugin-wrap .saboxplugin-gravatar img {-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}';
869
+ $style .= '.saboxplugin-wrap .saboxplugin-gravatar img:hover {-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);}';
870
+ }
871
+ // Social icons hover effect
872
+ if ( isset( $sabox_options['sab_icons_style'] ) && '0' != $sabox_options['sab_icons_style'] && isset( $sabox_options['sab_social_hover'] ) ) {
873
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color, .saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {-webkit-transition: all 0.3s ease-in-out;-moz-transition: all 0.3s ease-in-out;-o-transition: all 0.3s ease-in-out;-ms-transition: all 0.3s ease-in-out;transition: all 0.3s ease-in-out;}.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:hover,.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey:hover {-webkit-transform: rotate(360deg);-moz-transform: rotate(360deg);-o-transform: rotate(360deg);-ms-transform: rotate(360deg);transform: rotate(360deg);}';
874
+ }
875
+ // Thin border
876
+ if ( isset( $sabox_options['sab_colored'] ) && '0' != $sabox_options['sab_colored'] && ! isset( $sabox_options['sab_box_thin_border'] ) ) {
877
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {border: medium none !important;}';
878
+ }
879
+ // Background color of social icons bar
880
+ if ( isset( $sabox_options['sab_box_icons_back'] ) && ! empty( $sabox_options['sab_box_icons_back'] ) ) {
881
+ $style .= '.saboxplugin-wrap .saboxplugin-socials{background-color:' . esc_html( $sabox_options['sab_box_icons_back'] ) . ';}';
882
+ }
883
+ // Color of social icons (for symbols only):
884
+ if ( isset( $sabox_options['sab_box_icons_color'] ) && ! empty( $sabox_options['sab_box_icons_color'] ) ) {
885
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {color:' . esc_html( $sabox_options['sab_box_icons_color'] ) . ';}';
886
+ }
887
+ // Author name color
888
+ if ( isset( $sabox_options['sab_box_author_color'] ) && ! empty( $sabox_options['sab_box_author_color'] ) ) {
889
+ $style .= '.saboxplugin-wrap .saboxplugin-authorname a {color:' . esc_html( $sabox_options['sab_box_author_color'] ) . ';}';
890
+ }
891
+
892
+ // Author web color
893
+ if ( isset( $sabox_options['sab_web'] ) && isset( $sabox_options['sab_box_web_color'] ) && ! empty( $sabox_options['sab_box_web_color'] ) ) {
894
+ $style .= '.saboxplugin-wrap .saboxplugin-web a {color:' . esc_html( $sabox_options['sab_box_web_color'] ) . ';}';
895
+ }
896
+
897
+ // Author name font family
898
+ if ( get_option( 'sab_box_name_font', 'None' ) != 'None' ) {
899
+ $author_name_font = get_option( 'sab_box_name_font' );
900
+ $style .= '.saboxplugin-wrap .saboxplugin-authorname {font-family:"' . esc_html( $author_name_font ) . '";}';
901
+ }
902
+
903
+ // Author description font family
904
+ if ( get_option( 'sab_box_desc_font', 'None' ) != 'None' ) {
905
+ $author_desc_font = get_option( 'sab_box_desc_font' );
906
+ $style .= '.saboxplugin-wrap .saboxplugin-desc {font-family:' . esc_html( $author_desc_font ) . ';}';
907
+ }
908
+
909
+ // Author web font family
910
+ if ( isset( $sabox_options['sab_web'] ) && get_option( 'sab_box_web_font', 'None' ) != 'None' ) {
911
+ $author_web_font = get_option( 'sab_box_web_font' );
912
+ $style .= '.saboxplugin-wrap .saboxplugin-web {font-family:"' . esc_html( $author_web_font ) . '";}';
913
+ }
914
+
915
+ // Author description font style
916
+ if ( isset( $sabox_options['sab_desc_style'] ) && '0' != $sabox_options['sab_desc_style'] ) {
917
+ $style .= '.saboxplugin-wrap .saboxplugin-desc {font-style:italic;}';
918
+ }
919
+ // Margin top & bottom, Padding
920
+ $style .= '.saboxplugin-wrap {margin-top:' . absint( $sabox_top_margin ) . 'px; margin-bottom:' . absint( $sabox_bottom_margin ) . 'px; padding: ' . absint( $padding_top_bottom ) . 'px ' . absint( $padding_left_right ) . 'px }';
921
+ // Author name text size
922
+ $style .= '.saboxplugin-wrap .saboxplugin-authorname {font-size:' . absint( $sabox_name_size ) . 'px; line-height:' . absint( $sabox_name_size + 7 ) . 'px;}';
923
+ // Author description font size
924
+ $style .= '.saboxplugin-wrap .saboxplugin-desc {font-size:' . absint( $sabox_desc_size ) . 'px; line-height:' . absint( $sabox_desc_size + 7 ) . 'px;}';
925
+ // Author website text size
926
+ $style .= '.saboxplugin-wrap .saboxplugin-web {font-size:' . absint( $sabox_web_size ) . 'px;}';
927
+ // Icons size
928
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color {font-size:' . absint( $sabox_icon_size + 3 ) . 'px;}';
929
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color:before {width:' . absint( $sabox_icon_size + $sabox_icon_size ) . 'px; height:' . absint( $sabox_icon_size + $sabox_icon_size ) . 'px; line-height:' . absint( $sabox_icon_size + $sabox_icon_size + 1 ) . 'px; }';
930
+ $style .= '.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey {font-size:' . absint( $sabox_icon_size ) . 'px;}';
931
+
932
+ return apply_filters( 'sabox_inline_css', $style );
933
+ }
934
+
935
+ }
inc/class-simple-author-box-user-profile.php CHANGED
@@ -1,159 +1,160 @@
1
- <?php
2
-
3
- class Simple_Author_Box_User_Profile {
4
-
5
- function __construct() {
6
-
7
- // Social Links
8
- add_action( 'show_user_profile', array( $this, 'add_social_area' ) );
9
- add_action( 'edit_user_profile', array( $this, 'add_social_area' ) );
10
-
11
- // Custom Profile Image
12
- add_action( 'show_user_profile', array( $this, 'add_profile_image' ), 9, 1 );
13
- add_action( 'edit_user_profile', array( $this, 'add_profile_image' ), 9, 1 );
14
-
15
- add_action( 'personal_options_update', array( $this, 'save_user_profile' ) );
16
- add_action( 'edit_user_profile_update', array( $this, 'save_user_profile' ) );
17
-
18
- // Allow HTML in user description.
19
- remove_filter( 'pre_user_description', 'wp_filter_kses' );
20
- add_filter( 'pre_user_description', 'wp_kses_post' );
21
-
22
- }
23
-
24
- public function add_social_area( $profileuser ) {
25
- $user_id = $profileuser->data->ID;
26
-
27
- $social_links = Simple_Author_Box_Helper::get_user_social_links( $user_id );
28
- $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
29
- unset( $social_icons['user_email'] );
30
-
31
- ?>
32
- <div class="sab-user-profile-wrapper">
33
- <h2><?php _e( 'Social Media Links (Simple Author Box)', 'saboxplugin' ); ?></h2>
34
- <table class="form-table" id="sabox-social-table">
35
- <?php
36
-
37
- if ( ! empty( $social_links ) ) {
38
- foreach ( $social_links as $social_platform => $social_link ) {
39
- ?>
40
- <tr>
41
- <th>
42
- <span class="sabox-drag"></span>
43
- <select name="sabox-social-icons[]">
44
- <?php foreach ( $social_icons as $sabox_social_id => $sabox_social_name ) { ?>
45
- <option value="<?php echo $sabox_social_id; ?>" <?php selected( $sabox_social_id, $social_platform ); ?>><?php echo $sabox_social_name; ?></option>
46
- <?php } ?>
47
- </select>
48
- </th>
49
- <td>
50
- <input name="sabox-social-links[]" type="text" class="regular-text" value="<?php echo esc_url( $social_link ); ?>">
51
- <span class="dashicons dashicons-trash"></span>
52
- <td>
53
- </tr>
54
- <?php
55
- }
56
- } else {
57
- ?>
58
- <tr>
59
- <th>
60
- <select name="sabox-social-icons[]">
61
- <?php foreach ( $social_icons as $sabox_social_id => $sabox_social_name ) { ?>
62
- <option value="<?php echo $sabox_social_id; ?>"><?php echo $sabox_social_name; ?></option>
63
- <?php } ?>
64
- </select>
65
- </th>
66
- <td>
67
- <input name="sabox-social-links[]" type="text" class="regular-text" value="">
68
- <span class="dashicons dashicons-trash"></span>
69
- <td>
70
- </tr>
71
- <?php
72
- }
73
-
74
- ?>
75
-
76
- </table>
77
-
78
- <div class="sabox-add-social-link">
79
- <a href="#" class="button button-primary button-hero"></span><?php esc_html_e( '+ Add new social platform', 'saboxplugin' ); ?></a>
80
- </div>
81
- </div>
82
-
83
- <?php
84
- }
85
-
86
- public function add_profile_image( $user ) {
87
-
88
- if ( ! current_user_can( 'upload_files' ) ) {
89
- return;
90
- }
91
-
92
- $default_url = SIMPLE_AUTHOR_BOX_ASSETS . 'img/default.png';
93
- $image_url = get_user_meta( $user->ID, 'sabox-profile-image', true );
94
-
95
- ?>
96
-
97
- <div id="sabox-custom-profile-image">
98
- <h3><?php _e( 'Custom User Profile Image (Simple Author Box)', 'saboxplugin' ); ?></h3>
99
- <table class="form-table">
100
- <tr>
101
- <th><label for="cupp_meta"><?php _e( 'Profile Image', 'saboxplugin' ); ?></label></th>
102
- <td>
103
- <div id="sab-current-image">
104
- <?php wp_nonce_field( 'sabox-profile-image', 'sabox-profile-nonce' ); ?>
105
- <input type="hidden" name="sabox-custom-image" id="sabox-custom-image" value="<?php echo esc_attr( $image_url ); ?>">
106
- <img data-default="<?php echo esc_url_raw( $default_url ); ?>" src="<?php echo '' != $image_url ? esc_url_raw( $image_url ) : esc_url_raw( $default_url ); ?>">
107
- </div>
108
- <div class="actions">
109
- <a href="#" class="button-secondary" id="sabox-remove-image"><?php _e( 'Remove Image', 'saboxplugin' ); ?></a>
110
- <a href="#" class="button-primary" id="sabox-add-image"><?php _e( 'Upload Image', 'saboxplugin' ); ?></a>
111
- </div>
112
- </td>
113
- </tr>
114
- </table>
115
- </div>
116
-
117
- <?php
118
- }
119
-
120
- public function save_user_profile( $user_id ) {
121
-
122
- if ( isset( $_POST['sabox-social-icons'] ) && isset( $_POST['sabox-social-links'] ) ) {
123
-
124
- $social_platforms = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
125
- $social_links = array();
126
- foreach ( $_POST['sabox-social-links'] as $index => $social_link ) {
127
- if ( $social_link ) {
128
- $social_platform = isset( $_POST['sabox-social-icons'][ $index ] ) ? $_POST['sabox-social-icons'][ $index ] : false;
129
- if ( $social_platform && isset( $social_platforms[ $social_platform ] ) ) {
130
- $social_links[ $social_platform ] = esc_url_raw( $social_link );
131
- }
132
- }
133
- }
134
-
135
- update_user_meta( $user_id, 'sabox_social_links', $social_links );
136
-
137
- }else{
138
- delete_user_meta( $user_id, 'sabox_social_links' );
139
- }
140
-
141
- if ( ! isset( $_POST['sabox-profile-nonce'] ) || ! wp_verify_nonce( $_POST['sabox-profile-nonce'], 'sabox-profile-image' ) ) {
142
- return;
143
- }
144
-
145
- if ( ! current_user_can( 'upload_files', $user_id ) ) {
146
- return;
147
- }
148
-
149
- if ( isset( $_POST['sabox-custom-image'] ) && '' != $_POST['sabox-custom-image'] ) {
150
- update_user_meta( $user_id, 'sabox-profile-image', esc_url_raw( $_POST['sabox-custom-image'] ) );
151
- } else {
152
- delete_user_meta( $user_id, 'sabox-profile-image' );
153
- }
154
-
155
- }
156
-
157
- }
158
-
159
- new Simple_Author_Box_User_Profile();
 
1
+ <?php
2
+
3
+ class Simple_Author_Box_User_Profile {
4
+
5
+ function __construct() {
6
+
7
+ // Social Links
8
+ add_action( 'show_user_profile', array( $this, 'add_social_area' ) );
9
+ add_action( 'edit_user_profile', array( $this, 'add_social_area' ) );
10
+
11
+ // Custom Profile Image
12
+ add_action( 'show_user_profile', array( $this, 'add_profile_image' ), 9, 1 );
13
+ add_action( 'edit_user_profile', array( $this, 'add_profile_image' ), 9, 1 );
14
+
15
+ add_action( 'personal_options_update', array( $this, 'save_user_profile' ) );
16
+ add_action( 'edit_user_profile_update', array( $this, 'save_user_profile' ) );
17
+
18
+ // Allow HTML in user description.
19
+ remove_filter( 'pre_user_description', 'wp_filter_kses' );
20
+ add_filter( 'pre_user_description', 'wp_kses_post' );
21
+
22
+ }
23
+
24
+ public function add_social_area( $profileuser ) {
25
+ $user_id = $profileuser->data->ID;
26
+
27
+ $social_links = Simple_Author_Box_Helper::get_user_social_links( $user_id );
28
+ $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
29
+ unset( $social_icons['user_email'] );
30
+
31
+ ?>
32
+ <div class="sab-user-profile-wrapper">
33
+ <h2><?php _e( 'Social Media Links (Simple Author Box)', 'saboxplugin' ); ?></h2>
34
+ <table class="form-table" id="sabox-social-table">
35
+ <?php
36
+
37
+ if ( ! empty( $social_links ) ) {
38
+ foreach ( $social_links as $social_platform => $social_link ) {
39
+ ?>
40
+ <tr>
41
+ <th>
42
+ <span class="sabox-drag"></span>
43
+ <select name="sabox-social-icons[]">
44
+ <?php foreach ( $social_icons as $sabox_social_id => $sabox_social_name ) { ?>
45
+ <option value="<?php echo $sabox_social_id; ?>" <?php selected( $sabox_social_id, $social_platform ); ?>><?php echo $sabox_social_name; ?></option>
46
+ <?php } ?>
47
+ </select>
48
+ </th>
49
+ <td>
50
+ <input name="sabox-social-links[]" type="text" class="regular-text" value="<?php echo esc_url( $social_link ); ?>">
51
+ <span class="dashicons dashicons-trash"></span>
52
+ <td>
53
+ </tr>
54
+ <?php
55
+ }
56
+ } else {
57
+ ?>
58
+ <tr>
59
+ <th>
60
+ <span class="sabox-drag"></span>
61
+ <select name="sabox-social-icons[]">
62
+ <?php foreach ( $social_icons as $sabox_social_id => $sabox_social_name ) { ?>
63
+ <option value="<?php echo $sabox_social_id; ?>"><?php echo $sabox_social_name; ?></option>
64
+ <?php } ?>
65
+ </select>
66
+ </th>
67
+ <td>
68
+ <input name="sabox-social-links[]" type="text" class="regular-text" value="">
69
+ <span class="dashicons dashicons-trash"></span>
70
+ <td>
71
+ </tr>
72
+ <?php
73
+ }
74
+
75
+ ?>
76
+
77
+ </table>
78
+
79
+ <div class="sabox-add-social-link">
80
+ <a href="#" class="button button-primary button-hero"></span><?php esc_html_e( '+ Add new social platform', 'saboxplugin' ); ?></a>
81
+ </div>
82
+ </div>
83
+
84
+ <?php
85
+ }
86
+
87
+ public function add_profile_image( $user ) {
88
+
89
+ if ( ! current_user_can( 'upload_files' ) ) {
90
+ return;
91
+ }
92
+
93
+ $default_url = SIMPLE_AUTHOR_BOX_ASSETS . 'img/default.png';
94
+ $image_url = get_user_meta( $user->ID, 'sabox-profile-image', true );
95
+
96
+ ?>
97
+
98
+ <div id="sabox-custom-profile-image">
99
+ <h3><?php _e( 'Custom User Profile Image (Simple Author Box)', 'saboxplugin' ); ?></h3>
100
+ <table class="form-table">
101
+ <tr>
102
+ <th><label for="cupp_meta"><?php _e( 'Profile Image', 'saboxplugin' ); ?></label></th>
103
+ <td>
104
+ <div id="sab-current-image">
105
+ <?php wp_nonce_field( 'sabox-profile-image', 'sabox-profile-nonce' ); ?>
106
+ <input type="hidden" name="sabox-custom-image" id="sabox-custom-image" value="<?php echo esc_attr( $image_url ); ?>">
107
+ <img data-default="<?php echo esc_url_raw( $default_url ); ?>" src="<?php echo '' != $image_url ? esc_url_raw( $image_url ) : esc_url_raw( $default_url ); ?>">
108
+ </div>
109
+ <div class="actions">
110
+ <a href="#" class="button-secondary" id="sabox-remove-image"><?php _e( 'Remove Image', 'saboxplugin' ); ?></a>
111
+ <a href="#" class="button-primary" id="sabox-add-image"><?php _e( 'Upload Image', 'saboxplugin' ); ?></a>
112
+ </div>
113
+ </td>
114
+ </tr>
115
+ </table>
116
+ </div>
117
+
118
+ <?php
119
+ }
120
+
121
+ public function save_user_profile( $user_id ) {
122
+
123
+ if ( isset( $_POST['sabox-social-icons'] ) && isset( $_POST['sabox-social-links'] ) ) {
124
+
125
+ $social_platforms = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
126
+ $social_links = array();
127
+ foreach ( $_POST['sabox-social-links'] as $index => $social_link ) {
128
+ if ( $social_link ) {
129
+ $social_platform = isset( $_POST['sabox-social-icons'][ $index ] ) ? $_POST['sabox-social-icons'][ $index ] : false;
130
+ if ( $social_platform && isset( $social_platforms[ $social_platform ] ) ) {
131
+ $social_links[ $social_platform ] = esc_url_raw( $social_link );
132
+ }
133
+ }
134
+ }
135
+
136
+ update_user_meta( $user_id, 'sabox_social_links', $social_links );
137
+
138
+ } else {
139
+ delete_user_meta( $user_id, 'sabox_social_links' );
140
+ }
141
+
142
+ if ( ! isset( $_POST['sabox-profile-nonce'] ) || ! wp_verify_nonce( $_POST['sabox-profile-nonce'], 'sabox-profile-image' ) ) {
143
+ return;
144
+ }
145
+
146
+ if ( ! current_user_can( 'upload_files', $user_id ) ) {
147
+ return;
148
+ }
149
+
150
+ if ( isset( $_POST['sabox-custom-image'] ) && '' != $_POST['sabox-custom-image'] ) {
151
+ update_user_meta( $user_id, 'sabox-profile-image', esc_url_raw( $_POST['sabox-custom-image'] ) );
152
+ } else {
153
+ delete_user_meta( $user_id, 'sabox-profile-image' );
154
+ }
155
+
156
+ }
157
+
158
+ }
159
+
160
+ new Simple_Author_Box_User_Profile();
inc/class-simple-author-box.php CHANGED
@@ -1,313 +1,336 @@
1
- <?php
2
-
3
- /**
4
- *
5
- */
6
- class Simple_Author_Box {
7
-
8
- private static $instance = null;
9
- private $options;
10
-
11
- function __construct() {
12
-
13
- $this->options = get_option( 'saboxplugin_options', array() );
14
-
15
- $this->load_dependencies();
16
- $this->define_admin_hooks();
17
- $this->define_public_hooks();
18
-
19
- }
20
-
21
- public static function get_instance() {
22
- if ( is_null( self::$instance ) ) {
23
- self::$instance = new self();
24
- }
25
-
26
- return self::$instance;
27
- }
28
-
29
- private function load_dependencies() {
30
-
31
- require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-helper.php';
32
- require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/functions.php';
33
-
34
- if ( is_admin() ) {
35
- require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-admin-page.php';
36
- require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-user-profile.php';
37
- }
38
- }
39
-
40
-
41
- private function define_admin_hooks() {
42
-
43
- add_filter( 'get_avatar', array( $this, 'replace_gravatar_image' ), 10, 6 );
44
-
45
- if ( ! is_admin() ) {
46
- return;
47
- }
48
-
49
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_style_and_scripts' ) );
50
- add_filter( 'user_contactmethods', array( $this, 'add_extra_fields' ) );
51
- add_filter( 'plugin_action_links_' . SIMPLE_AUTHOR_BOX_SLUG, array( $this, 'settings_link' ) );
52
-
53
- }
54
-
55
-
56
- public function replace_gravatar_image( $avatar, $id_or_email, $size, $default, $alt, $args ) {
57
-
58
- // Process the user identifier.
59
- $user = false;
60
- if ( is_numeric( $id_or_email ) ) {
61
- $user = get_user_by( 'id', absint( $id_or_email ) );
62
- } elseif ( is_string( $id_or_email ) ) {
63
-
64
- $user = get_user_by( 'email', $id_or_email );
65
-
66
- } elseif ( $id_or_email instanceof WP_User ) {
67
- // User Object
68
- $user = $id_or_email;
69
- } elseif ( $id_or_email instanceof WP_Post ) {
70
- // Post Object
71
- $user = get_user_by( 'id', (int) $id_or_email->post_author );
72
- } elseif ( $id_or_email instanceof WP_Comment ) {
73
-
74
- if ( ! empty( $id_or_email->user_id ) ) {
75
- $user = get_user_by( 'id', (int) $id_or_email->user_id );
76
- }
77
-
78
- }
79
-
80
- if ( ! $user || is_wp_error( $user ) ) {
81
- return $avatar;
82
- }
83
-
84
-
85
- $custom_profile_image = get_user_meta( $user->ID, 'sabox-profile-image', true );
86
- $class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
87
-
88
- if ( ! $args['found_avatar'] || $args['force_default'] ) {
89
- $class[] = 'avatar-default';
90
- }
91
-
92
- if ( $args['class'] ) {
93
- if ( is_array( $args['class'] ) ) {
94
- $class = array_merge( $class, $args['class'] );
95
- } else {
96
- $class[] = $args['class'];
97
- }
98
- }
99
-
100
- if ( $custom_profile_image !== '' && $args['force_default'] !== true ) {
101
-
102
- $avatar = sprintf(
103
- "<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
104
- esc_attr( $args['alt'] ),
105
- esc_url( $custom_profile_image ),
106
- esc_url( $custom_profile_image ) . ' 2x',
107
- esc_attr( join( ' ', $class ) ),
108
- (int) $args['height'],
109
- (int) $args['width'],
110
- $args['extra_attr']
111
- );
112
- }
113
-
114
- return $avatar;
115
- }
116
-
117
- private function define_public_hooks() {
118
-
119
- if ( ! isset( $this->options['sab_autoinsert'] ) ) {
120
- add_filter( 'the_content', 'wpsabox_author_box' );
121
- }
122
-
123
- add_action( 'wp_enqueue_scripts', array( $this, 'saboxplugin_author_box_style' ), 10 );
124
-
125
- if ( isset( $this->options['sab_footer_inline_style'] ) ) {
126
- add_action( 'wp_footer', array(
127
- $this,
128
- 'inline_style',
129
- ), 13 );
130
- } else {
131
- add_action( 'wp_head', array( $this, 'inline_style' ), 15 );
132
- }
133
-
134
- add_shortcode( 'simple-author-box', array( $this, 'shortcode' ) );
135
- add_filter( 'sabox_hide_social_icons', array( $this, 'show_social_media_icons' ), 10, 2 );
136
-
137
- }
138
-
139
- public function settings_link( $links ) {
140
- $settings_link = '<a href="' . admin_url( 'admin.php?page=simple-author-box-options' ) . '">' . __( 'Settings', 'saboxplugin' ) . '</a>';
141
- array_unshift( $links, $settings_link );
142
-
143
- return $links;
144
- }
145
-
146
- public function admin_style_and_scripts( $hook ) {
147
-
148
- $suffix = '.min';
149
- if ( SIMPLE_AUTHOR_SCRIPT_DEBUG ) {
150
- $suffix = '';
151
- }
152
-
153
- wp_enqueue_style( 'sabox-css', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox.css' );
154
-
155
- if ( 'toplevel_page_simple-author-box-options' == $hook ) {
156
-
157
- // Styles
158
- wp_enqueue_style( 'wp-color-picker' );
159
- wp_enqueue_style( 'jquery-ui', SIMPLE_AUTHOR_BOX_ASSETS . 'css/jquery-ui.min.css' );
160
- wp_enqueue_style( 'saboxplugin-admin-style', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox-admin-style' . $suffix . '.css' );
161
-
162
- // Scripts
163
- wp_enqueue_script( 'sabox-admin-js', SIMPLE_AUTHOR_BOX_ASSETS . 'js/sabox-admin.js', array(
164
- 'jquery-ui-slider',
165
- 'wp-color-picker',
166
- ), false, true );
167
- wp_enqueue_script( 'sabox-plugin-install', SIMPLE_AUTHOR_BOX_ASSETS . 'js/plugin-install.js', array(
168
- 'jquery',
169
- 'updates',
170
- ), '1.0.0', 'all' );
171
-
172
- } elseif ( 'profile.php' == $hook || 'user-edit.php' == $hook ) {
173
-
174
- wp_enqueue_style( 'saboxplugin-admin-style', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox-admin-style' . $suffix . '.css' );
175
-
176
- wp_enqueue_media();
177
- wp_enqueue_editor();
178
- wp_enqueue_script( 'sabox-admin-editor-js', SIMPLE_AUTHOR_BOX_ASSETS . 'js/sabox-editor.js', array(), false, true );
179
- $sabox_js_helper = array();
180
- $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
181
- unset( $social_icons['user_email'] );
182
- $sabox_js_helper['socialIcons'] = $social_icons;
183
-
184
- wp_localize_script( 'sabox-admin-editor-js', 'SABHerlper', $sabox_js_helper );
185
-
186
- }
187
-
188
- }
189
-
190
- public function add_extra_fields( $extra_fields ) {
191
-
192
- unset( $extra_fields['aim'] );
193
- unset( $extra_fields['jabber'] );
194
- unset( $extra_fields['yim'] );
195
-
196
- return $extra_fields;
197
-
198
- }
199
-
200
- /*----------------------------------------------------------------------------------------------------------
201
- Adding the author box main CSS
202
- -----------------------------------------------------------------------------------------------------------*/
203
- public function saboxplugin_author_box_style() {
204
-
205
- $suffix = '.min';
206
- if ( SIMPLE_AUTHOR_SCRIPT_DEBUG ) {
207
- $suffix = '';
208
- }
209
-
210
- $sab_protocol = is_ssl() ? 'https' : 'http';
211
- $sab_box_subset = get_option( 'sab_box_subset' );
212
-
213
-
214
- /**
215
- * Check for duplicate font families, remove duplicates & re-work the font enqueue procedure
216
- *
217
- * @since 2.0.4
218
- */
219
- if ( 'none' != strtolower( $sab_box_subset ) ) {
220
- $sab_subset = '&amp;subset=' . strtolower( $sab_box_subset );
221
- } else {
222
- $sab_subset = '&amp;subset=latin';
223
- }
224
-
225
- $sab_author_font = get_option( 'sab_box_name_font', 'None' );
226
- $sab_desc_font = get_option( 'sab_box_desc_font', 'None' );
227
- $sab_web_font = get_option( 'sab_box_web_font', 'None' );
228
-
229
- $google_fonts = array();
230
-
231
- if ( $sab_author_font && 'none' != strtolower( $sab_author_font ) ) {
232
- $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_author_font ) );
233
- }
234
-
235
- if ( $sab_desc_font && 'none' != strtolower( $sab_desc_font ) ) {
236
- $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_desc_font ) );
237
- }
238
-
239
- if ( isset( $this->options['sab_web'] ) && $sab_web_font && 'none' != strtolower( $sab_web_font ) ) {
240
- $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_web_font ) );
241
- }
242
-
243
- $google_fonts = apply_filters( 'sabox_google_fonts', $google_fonts );
244
-
245
- $google_fonts = array_unique( $google_fonts );
246
-
247
-
248
- if ( ! empty( $google_fonts ) ) { // let's check the array's not empty before actually loading; we want to avoid loading 'none' font-familes
249
- $final_google_fonts = array();
250
-
251
- foreach ( $google_fonts as $v ) {
252
- $final_google_fonts[] = $v . ':400,700,400italic,700italic';
253
- }
254
-
255
- wp_register_style( 'sab-font', $sab_protocol . '://fonts.googleapis.com/css?family=' . implode( '|', $final_google_fonts ) . $sab_subset, array(), null );
256
-
257
- }
258
- /**
259
- * end changes introduced in 2.0.4
260
- */
261
-
262
-
263
- if ( ! isset( $this->options['sab_load_fa'] ) ) {
264
- wp_register_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
265
- }
266
-
267
- wp_register_style( 'sab-plugin', SIMPLE_AUTHOR_BOX_ASSETS . 'css/simple-author-box' . $suffix . '.css', false, SIMPLE_AUTHOR_BOX_VERSION );
268
-
269
- if ( ! is_single() and ! is_page() and ! is_author() and ! is_archive() ) {
270
- return;
271
- }
272
-
273
- if ( ! empty( $google_fonts ) ) {
274
- wp_enqueue_style( 'sab-font' );
275
- }
276
-
277
- if ( ! isset( $this->options['sab_load_fa'] ) ) {
278
- wp_enqueue_style( 'font-awesome' );
279
- }
280
-
281
- wp_enqueue_style( 'sab-plugin' );
282
-
283
- }
284
-
285
- public function inline_style() {
286
-
287
- if ( ! is_single() and ! is_page() and ! is_author() and ! is_archive() ) {
288
- return;
289
- }
290
-
291
- $style = '<style type="text/css">';
292
- $style .= Simple_Author_Box_Helper::generate_inline_css();
293
- $style .= '</style>';
294
-
295
- echo $style;
296
- }
297
-
298
- public function shortcode( $atts ) {
299
- $html = wpsabox_author_box();
300
-
301
- return $html;
302
- }
303
-
304
-
305
- public function show_social_media_icons( $return, $user ) {
306
- if ( in_array( 'sab-guest-author', (array) $user->roles ) ) {
307
- return false;
308
- }
309
-
310
- return true;
311
- }
312
-
313
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Simple_Author_Box {
7
+
8
+ private static $instance = null;
9
+ private $options;
10
+
11
+ function __construct() {
12
+
13
+ $this->options = get_option( 'saboxplugin_options', array() );
14
+
15
+ $this->load_dependencies();
16
+ $this->define_admin_hooks();
17
+ $this->define_public_hooks();
18
+
19
+ }
20
+
21
+ public static function get_instance() {
22
+ if ( is_null( self::$instance ) ) {
23
+ self::$instance = new self();
24
+ }
25
+
26
+ return self::$instance;
27
+ }
28
+
29
+ private function load_dependencies() {
30
+
31
+ require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-helper.php';
32
+ require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/functions.php';
33
+
34
+ if ( is_admin() ) {
35
+ require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-admin-page.php';
36
+ require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box-user-profile.php';
37
+ }
38
+ }
39
+
40
+
41
+ private function define_admin_hooks() {
42
+
43
+ add_filter( 'get_avatar', array( $this, 'replace_gravatar_image' ), 10, 6 );
44
+
45
+ if ( ! is_admin() ) {
46
+ return;
47
+ }
48
+
49
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_style_and_scripts' ) );
50
+ add_filter( 'user_contactmethods', array( $this, 'add_extra_fields' ) );
51
+ add_filter( 'plugin_action_links_' . SIMPLE_AUTHOR_BOX_SLUG, array( $this, 'settings_link' ) );
52
+
53
+ }
54
+
55
+
56
+ public function replace_gravatar_image( $avatar, $id_or_email, $size, $default, $alt, $args ) {
57
+
58
+ // Process the user identifier.
59
+ $user = false;
60
+ if ( is_numeric( $id_or_email ) ) {
61
+ $user = get_user_by( 'id', absint( $id_or_email ) );
62
+ } elseif ( is_string( $id_or_email ) ) {
63
+
64
+ $user = get_user_by( 'email', $id_or_email );
65
+
66
+ } elseif ( $id_or_email instanceof WP_User ) {
67
+ // User Object
68
+ $user = $id_or_email;
69
+ } elseif ( $id_or_email instanceof WP_Post ) {
70
+ // Post Object
71
+ $user = get_user_by( 'id', (int) $id_or_email->post_author );
72
+ } elseif ( $id_or_email instanceof WP_Comment ) {
73
+
74
+ if ( ! empty( $id_or_email->user_id ) ) {
75
+ $user = get_user_by( 'id', (int) $id_or_email->user_id );
76
+ }
77
+ }
78
+
79
+ if ( ! $user || is_wp_error( $user ) ) {
80
+ return $avatar;
81
+ }
82
+
83
+ $custom_profile_image = get_user_meta( $user->ID, 'sabox-profile-image', true );
84
+ $class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
85
+
86
+ if ( ! $args['found_avatar'] || $args['force_default'] ) {
87
+ $class[] = 'avatar-default';
88
+ }
89
+
90
+ if ( $args['class'] ) {
91
+ if ( is_array( $args['class'] ) ) {
92
+ $class = array_merge( $class, $args['class'] );
93
+ } else {
94
+ $class[] = $args['class'];
95
+ }
96
+ }
97
+
98
+ if ( '' !== $custom_profile_image && true !== $args['force_default'] ) {
99
+
100
+ $avatar = sprintf(
101
+ "<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
102
+ esc_attr( $args['alt'] ),
103
+ esc_url( $custom_profile_image ),
104
+ esc_url( $custom_profile_image ) . ' 2x',
105
+ esc_attr( join( ' ', $class ) ),
106
+ (int) $args['height'],
107
+ (int) $args['width'],
108
+ $args['extra_attr']
109
+ );
110
+ }
111
+
112
+ return $avatar;
113
+ }
114
+
115
+ private function define_public_hooks() {
116
+
117
+ if ( ! isset( $this->options['sab_autoinsert'] ) ) {
118
+ add_filter( 'the_content', 'wpsabox_author_box' );
119
+ }
120
+
121
+ add_action( 'wp_enqueue_scripts', array( $this, 'saboxplugin_author_box_style' ), 10 );
122
+
123
+ if ( isset( $this->options['sab_footer_inline_style'] ) ) {
124
+ add_action(
125
+ 'wp_footer', array(
126
+ $this,
127
+ 'inline_style',
128
+ ), 13
129
+ );
130
+ } else {
131
+ add_action( 'wp_head', array( $this, 'inline_style' ), 15 );
132
+ }
133
+
134
+ add_shortcode( 'simple-author-box', array( $this, 'shortcode' ) );
135
+ add_filter( 'sabox_hide_social_icons', array( $this, 'show_social_media_icons' ), 10, 2 );
136
+
137
+ }
138
+
139
+ public function settings_link( $links ) {
140
+ $settings_link = '<a href="' . admin_url( 'admin.php?page=simple-author-box-options' ) . '">' . __( 'Settings', 'saboxplugin' ) . '</a>';
141
+ array_unshift( $links, $settings_link );
142
+
143
+ return $links;
144
+ }
145
+
146
+ public function admin_style_and_scripts( $hook ) {
147
+
148
+ $suffix = '.min';
149
+ if ( SIMPLE_AUTHOR_SCRIPT_DEBUG ) {
150
+ $suffix = '';
151
+ }
152
+
153
+ wp_enqueue_style( 'sabox-css', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox.css' );
154
+ wp_enqueue_style( 'saboxplugin-admin-style', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox-admin-style' . $suffix . '.css' );
155
+
156
+ if ( 'toplevel_page_simple-author-box-options' == $hook ) {
157
+
158
+ // Styles
159
+ wp_enqueue_style( 'wp-color-picker' );
160
+ wp_enqueue_style( 'jquery-ui', SIMPLE_AUTHOR_BOX_ASSETS . 'css/jquery-ui.min.css' );
161
+
162
+ // Scripts
163
+ wp_enqueue_script(
164
+ 'sabox-admin-js', SIMPLE_AUTHOR_BOX_ASSETS . 'js/sabox-admin.js', array(
165
+ 'jquery-ui-slider',
166
+ 'wp-color-picker',
167
+ ), false, true
168
+ );
169
+ wp_enqueue_script(
170
+ 'sabox-plugin-install', SIMPLE_AUTHOR_BOX_ASSETS . 'js/plugin-install.js', array(
171
+ 'jquery',
172
+ 'updates',
173
+ ), '1.0.0', 'all'
174
+ );
175
+
176
+ } elseif ( 'profile.php' == $hook || 'user-edit.php' == $hook ) {
177
+
178
+ wp_enqueue_style( 'saboxplugin-admin-style', SIMPLE_AUTHOR_BOX_ASSETS . 'css/sabox-admin-style' . $suffix . '.css' );
179
+
180
+ wp_enqueue_media();
181
+ wp_enqueue_editor();
182
+ wp_enqueue_script( 'sabox-admin-editor-js', SIMPLE_AUTHOR_BOX_ASSETS . 'js/sabox-editor.js', array(), false, true );
183
+ $sabox_js_helper = array();
184
+ $social_icons = apply_filters( 'sabox_social_icons', Simple_Author_Box_Helper::$social_icons );
185
+ unset( $social_icons['user_email'] );
186
+ $sabox_js_helper['socialIcons'] = $social_icons;
187
+
188
+ wp_localize_script( 'sabox-admin-editor-js', 'SABHerlper', $sabox_js_helper );
189
+
190
+ }
191
+
192
+ }
193
+
194
+ public function add_extra_fields( $extra_fields ) {
195
+
196
+ unset( $extra_fields['aim'] );
197
+ unset( $extra_fields['jabber'] );
198
+ unset( $extra_fields['yim'] );
199
+
200
+ return $extra_fields;
201
+
202
+ }
203
+
204
+ /*----------------------------------------------------------------------------------------------------------
205
+ Adding the author box main CSS
206
+ -----------------------------------------------------------------------------------------------------------*/
207
+ public function saboxplugin_author_box_style() {
208
+
209
+ $suffix = '.min';
210
+ if ( SIMPLE_AUTHOR_SCRIPT_DEBUG ) {
211
+ $suffix = '';
212
+ }
213
+
214
+ $sab_protocol = is_ssl() ? 'https' : 'http';
215
+ $sab_box_subset = get_option( 'sab_box_subset' );
216
+
217
+ /**
218
+ * Check for duplicate font families, remove duplicates & re-work the font enqueue procedure
219
+ *
220
+ * @since 2.0.4
221
+ */
222
+ if ( 'none' != strtolower( $sab_box_subset ) ) {
223
+ $sab_subset = '&amp;subset=' . strtolower( $sab_box_subset );
224
+ } else {
225
+ $sab_subset = '&amp;subset=latin';
226
+ }
227
+
228
+ $sab_author_font = get_option( 'sab_box_name_font', 'None' );
229
+ $sab_desc_font = get_option( 'sab_box_desc_font', 'None' );
230
+ $sab_web_font = get_option( 'sab_box_web_font', 'None' );
231
+
232
+ $google_fonts = array();
233
+
234
+ if ( $sab_author_font && 'none' != strtolower( $sab_author_font ) ) {
235
+ $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_author_font ) );
236
+ }
237
+
238
+ if ( $sab_desc_font && 'none' != strtolower( $sab_desc_font ) ) {
239
+ $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_desc_font ) );
240
+ }
241
+
242
+ if ( isset( $this->options['sab_web'] ) && $sab_web_font && 'none' != strtolower( $sab_web_font ) ) {
243
+ $google_fonts[] = str_replace( ' ', '+', esc_attr( $sab_web_font ) );
244
+ }
245
+
246
+ $google_fonts = apply_filters( 'sabox_google_fonts', $google_fonts );
247
+
248
+ $google_fonts = array_unique( $google_fonts );
249
+
250
+ if ( ! empty( $google_fonts ) ) { // let's check the array's not empty before actually loading; we want to avoid loading 'none' font-familes
251
+ $final_google_fonts = array();
252
+
253
+ foreach ( $google_fonts as $v ) {
254
+ $final_google_fonts[] = $v . ':400,700,400italic,700italic';
255
+ }
256
+
257
+ wp_register_style( 'sab-font', $sab_protocol . '://fonts.googleapis.com/css?family=' . implode( '|', $final_google_fonts ) . $sab_subset, array(), null );
258
+
259
+ }
260
+ /**
261
+ * end changes introduced in 2.0.4
262
+ */
263
+
264
+ if ( ! isset( $this->options['sab_load_fa'] ) ) {
265
+ wp_register_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
266
+ }
267
+
268
+ wp_register_style( 'sab-plugin', SIMPLE_AUTHOR_BOX_ASSETS . 'css/simple-author-box' . $suffix . '.css', false, SIMPLE_AUTHOR_BOX_VERSION );
269
+
270
+ if ( ! is_single() and ! is_page() and ! is_author() and ! is_archive() ) {
271
+ return;
272
+ }
273
+
274
+ if ( ! empty( $google_fonts ) ) {
275
+ wp_enqueue_style( 'sab-font' );
276
+ }
277
+
278
+ if ( ! isset( $this->options['sab_load_fa'] ) ) {
279
+ wp_enqueue_style( 'font-awesome' );
280
+ }
281
+
282
+ wp_enqueue_style( 'sab-plugin' );
283
+
284
+ }
285
+
286
+ public function inline_style() {
287
+
288
+ if ( ! is_single() and ! is_page() and ! is_author() and ! is_archive() ) {
289
+ return;
290
+ }
291
+
292
+ $style = '<style type="text/css">';
293
+ $style .= Simple_Author_Box_Helper::generate_inline_css();
294
+ $style .= '</style>';
295
+
296
+ echo $style;
297
+ }
298
+
299
+ public function shortcode( $atts ) {
300
+ $defaults = array(
301
+ 'ids' => '',
302
+ );
303
+
304
+ $atts = wp_parse_args( $atts, $defaults );
305
+
306
+ if ( '' != $atts['ids'] ) {
307
+ $ids = explode( ',', $atts['ids'] );
308
+ ob_start();
309
+ $sabox_options = get_option( 'saboxplugin_options' );
310
+ foreach ( $ids as $user_id ) {
311
+
312
+ $template = Simple_Author_Box_Helper::get_template();
313
+ $sabox_author_id = $user_id;
314
+ echo '<div class="sabox-plus-item">';
315
+ include( $template );
316
+ echo '</div>';
317
+
318
+ }
319
+ $html = ob_get_clean();
320
+ } else {
321
+ $html = wpsabox_author_box();
322
+ }
323
+
324
+ return $html;
325
+ }
326
+
327
+
328
+ public function show_social_media_icons( $return, $user ) {
329
+ if ( in_array( 'sab-guest-author', (array) $user->roles ) ) {
330
+ return false;
331
+ }
332
+
333
+ return true;
334
+ }
335
+
336
+ }
inc/feedback/class-epsilon-feedback-sab.php CHANGED
@@ -1,274 +1,283 @@
1
- <?php
2
-
3
- class Epsilon_Feedback_SAB {
4
-
5
- private $plugin_file = '';
6
- private $plugin_name = '';
7
-
8
- function __construct( $_plugin_file ) {
9
-
10
- $this->plugin_file = $_plugin_file;
11
- $this->plugin_name = basename( $this->plugin_file, '.php' );
12
-
13
- // Deactivation
14
- add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array(
15
- $this,
16
- 'filter_action_links',
17
- ) );
18
- add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
19
- add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
20
-
21
- }
22
-
23
- /**
24
- * Filter the deactivation link to allow us to present a form when the user deactivates the plugin
25
- *
26
- * @since 1.0.0
27
- */
28
- public function filter_action_links( $links ) {
29
-
30
- if ( isset( $links['deactivate'] ) ) {
31
- $deactivation_link = $links['deactivate'];
32
- // Insert an onClick action to allow form before deactivating
33
- $deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
34
- $links['deactivate'] = $deactivation_link;
35
- }
36
-
37
- return $links;
38
- }
39
-
40
- /**
41
- * Form text strings
42
- * These can be filtered
43
- *
44
- * @since 1.0.0
45
- */
46
- public function goodbye_ajax() {
47
- // Get our strings for the form
48
- $form = $this->get_form_info();
49
-
50
- // Build the HTML to go in the form
51
- $html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
52
- $html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
53
- if ( is_array( $form['options'] ) ) {
54
- $html .= '<div class="epsilon-deactivate-options"><p>';
55
- foreach ( $form['options'] as $key => $option ) {
56
- if ( 'features' == $key ) {
57
- $html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
58
- } else {
59
- $html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
60
- }
61
- }
62
- $html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) . '</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
63
- $html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'saboxplugin' ) . '</label><br>';
64
- $html .= '</div><!-- .epsilon-deactivate-options -->';
65
- }
66
- $html .= '</div><!-- .epsilon-deactivate-form-body -->';
67
- $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'saboxplugin' ) . '</p>';
68
- $html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'saboxplugin' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'saboxplugin' ) . '</a></p></div>'
69
- ?>
70
- <div class="epsilon-deactivate-form-bg"></div>
71
- <style type="text/css">
72
- .epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
73
- background: rgba(0, 0, 0, .5);
74
- position: fixed;
75
- top: 0;
76
- left: 0;
77
- width: 100%;
78
- height: 100%;
79
- }
80
-
81
- .epsilon-deactivate-form-wrapper {
82
- position: relative;
83
- z-index: 999;
84
- display: none;
85
- }
86
-
87
- .epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
88
- display: block;
89
- }
90
-
91
- .epsilon-deactivate-form {
92
- display: none;
93
- }
94
-
95
- .epsilon-deactivate-form-active .epsilon-deactivate-form {
96
- position: absolute;
97
- bottom: 30px;
98
- left: 0;
99
- max-width: 400px;
100
- background: #fff;
101
- white-space: normal;
102
- }
103
-
104
- .epsilon-deactivate-form-head {
105
- background: #272754;
106
- color: #fff;
107
- padding: 8px 18px;
108
- }
109
-
110
- .epsilon-deactivate-form-body {
111
- padding: 8px 18px;
112
- color: #444;
113
- }
114
-
115
- .deactivating-spinner {
116
- display: none;
117
- }
118
-
119
- .deactivating-spinner .spinner {
120
- float: none;
121
- margin: 4px 4px 0 18px;
122
- vertical-align: bottom;
123
- visibility: visible;
124
- }
125
-
126
- .epsilon-deactivate-form-footer {
127
- padding: 8px 18px;
128
- }
129
-
130
- .epsilon-deactivate-form-footer p {
131
- display: flex;
132
- align-items: center;
133
- justify-content: space-between;
134
- }
135
-
136
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
137
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
138
- position: relative;
139
- }
140
-
141
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
142
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
143
- content: "";
144
- display: block;
145
- position: absolute;
146
- top: 0;
147
- left: 0;
148
- width: 100%;
149
- height: 100%;
150
- background-color: rgba(255, 255, 255, .5);
151
- }
152
- </style>
153
- <script>
154
- jQuery( document ).ready( function( $ ) {
155
- var deactivateURL = $( "#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>" ),
156
- formContainer = $( '#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>' ),
157
- detailsStrings = {
158
- 'setup': '<?php echo __( 'What was the dificult part ?', 'saboxplugin' ) ?>',
159
- 'documentation': '<?php echo __( 'What can we describe more ?', 'saboxplugin' ) ?>',
160
- 'features': '<?php echo __( 'How could we improve ?', 'saboxplugin' ) ?>',
161
- 'better-plugin': '<?php echo __( 'Can you mention it ?', 'saboxplugin' ) ?>',
162
- 'incompatibility': '<?php echo __( 'With what plugin or theme is incompatible ?', 'saboxplugin' ) ?>',
163
- };
164
-
165
- $( deactivateURL ).on( "click", function() {
166
- // We'll send the user to this deactivation link when they've completed or dismissed the form
167
- var url = deactivateURL.attr( 'href' );
168
- $( 'body' ).toggleClass( 'epsilon-deactivate-form-active' );
169
- formContainer.fadeIn( {
170
- complete: function() {
171
- var offset = formContainer.offset();
172
- $( 'body' ).animate( { scrollTop: Math.max( 0, offset.top - 50 ) } );
173
- }
174
- } );
175
- formContainer.html( '<?php echo $html; ?>' );
176
-
177
- formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function() {
178
- var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
179
- var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
180
- detailsLabel.text( detailsStrings[ value ] );
181
- } );
182
-
183
- formContainer.on( 'click', '#epsilon-deactivate-submit-form', function( e ) {
184
- var data = {
185
- 'action': 'epsilon_deactivate_plugin',
186
- 'security': "<?php echo wp_create_nonce( 'epsilon_deactivate_plugin' ); ?>",
187
- 'dataType': "json"
188
- };
189
- e.preventDefault();
190
- // As soon as we click, the body of the form should disappear
191
- formContainer.addClass( 'process-response' );
192
- // Fade in spinner
193
- formContainer.find( ".deactivating-spinner" ).fadeIn();
194
-
195
- data[ 'reason' ] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
196
- data[ 'details' ] = formContainer.find( '#epsilon-deactivate-details' ).val();
197
- data[ 'tracking' ] = formContainer.find( '#allow-tracking:checked' ).length;
198
-
199
- $.post(
200
- ajaxurl,
201
- data,
202
- function( response ) {
203
- // Redirect to original deactivation URL
204
- window.location.href = url;
205
- }
206
- );
207
- } );
208
-
209
- formContainer.on( 'click', '#epsilon-deactivate-plugin', function( e ) {
210
- e.preventDefault();
211
- window.location.href = url;
212
- } );
213
-
214
- // If we click outside the form, the form will close
215
- $( '.epsilon-deactivate-form-bg' ).on( 'click', function() {
216
- formContainer.fadeOut();
217
- $( 'body' ).removeClass( 'epsilon-deactivate-form-active' );
218
- } );
219
- } );
220
- } );
221
- </script>
222
- <?php }
223
-
224
- /*
225
- * Form text strings
226
- * These are non-filterable and used as fallback in case filtered strings aren't set correctly
227
- * @since 1.0.0
228
- */
229
- public function get_form_info() {
230
- $form = array();
231
- $form['heading'] = __( 'Sorry to see you go', 'saboxplugin' );
232
- $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'saboxplugin' );
233
- $form['options'] = array(
234
- 'setup' => __( 'Set up is too difficult', 'saboxplugin' ),
235
- 'documentation' => __( 'Lack of documentation', 'saboxplugin' ),
236
- 'features' => __( 'Not the features I wanted', 'saboxplugin' ),
237
- 'better-plugin' => __( 'Found a better plugin', 'saboxplugin' ),
238
- 'incompatibility' => __( 'Incompatible with theme or plugin', 'saboxplugin' ),
239
- );
240
- $form['details'] = __( 'How could we improve ?', 'saboxplugin' );
241
-
242
- return $form;
243
- }
244
-
245
- public function epsilon_deactivate_plugin_callback() {
246
-
247
- check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
248
-
249
- if ( isset( $_POST['reason'] ) && isset( $_POST['details'] ) && isset( $_POST['tracking'] ) ) {
250
- require_once 'class-epsilon-plugin-request-sab.php';
251
- $args = array(
252
- 'reason' => $_POST['reason'],
253
- 'details' => $_POST['details'],
254
- 'tracking' => $_POST['tracking'],
255
- );
256
- $request = new Epsilon_Plugin_Request_SAB( $this->plugin_file, $args );
257
- if ( $request->request_successful ) {
258
- echo json_encode( array(
259
- 'status' => 'ok',
260
- ) );
261
- } else {
262
- echo json_encode( array(
263
- 'status' => 'nok',
264
- ) );
265
- }
266
- } else {
267
- echo json_encode( array(
268
- 'status' => 'ok',
269
- ) );
270
- }
271
-
272
- die();
273
- }
274
- }
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Epsilon_Feedback_SAB {
4
+
5
+ private $plugin_file = '';
6
+ private $plugin_name = '';
7
+
8
+ function __construct( $_plugin_file ) {
9
+
10
+ $this->plugin_file = $_plugin_file;
11
+ $this->plugin_name = basename( $this->plugin_file, '.php' );
12
+
13
+ // Deactivation
14
+ add_filter(
15
+ 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array(
16
+ $this,
17
+ 'filter_action_links',
18
+ )
19
+ );
20
+ add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
21
+ add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
22
+
23
+ }
24
+
25
+ /**
26
+ * Filter the deactivation link to allow us to present a form when the user deactivates the plugin
27
+ *
28
+ * @since 1.0.0
29
+ */
30
+ public function filter_action_links( $links ) {
31
+
32
+ if ( isset( $links['deactivate'] ) ) {
33
+ $deactivation_link = $links['deactivate'];
34
+ // Insert an onClick action to allow form before deactivating
35
+ $deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
36
+ $links['deactivate'] = $deactivation_link;
37
+ }
38
+
39
+ return $links;
40
+ }
41
+
42
+ /**
43
+ * Form text strings
44
+ * These can be filtered
45
+ *
46
+ * @since 1.0.0
47
+ */
48
+ public function goodbye_ajax() {
49
+ // Get our strings for the form
50
+ $form = $this->get_form_info();
51
+
52
+ // Build the HTML to go in the form
53
+ $html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
54
+ $html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
55
+ if ( is_array( $form['options'] ) ) {
56
+ $html .= '<div class="epsilon-deactivate-options"><p>';
57
+ foreach ( $form['options'] as $key => $option ) {
58
+ if ( 'features' == $key ) {
59
+ $html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
60
+ } else {
61
+ $html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
62
+ }
63
+ }
64
+ $html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) . '</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
65
+ $html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'saboxplugin' ) . '</label><br>';
66
+ $html .= '</div><!-- .epsilon-deactivate-options -->';
67
+ }
68
+ $html .= '</div><!-- .epsilon-deactivate-form-body -->';
69
+ $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'saboxplugin' ) . '</p>';
70
+ $html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'saboxplugin' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'saboxplugin' ) . '</a></p></div>'
71
+ ?>
72
+ <div class="epsilon-deactivate-form-bg"></div>
73
+ <style type="text/css">
74
+ .epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
75
+ background: rgba(0, 0, 0, .5);
76
+ position: fixed;
77
+ top: 0;
78
+ left: 0;
79
+ width: 100%;
80
+ height: 100%;
81
+ }
82
+
83
+ .epsilon-deactivate-form-wrapper {
84
+ position: relative;
85
+ z-index: 999;
86
+ display: none;
87
+ }
88
+
89
+ .epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
90
+ display: block;
91
+ }
92
+
93
+ .epsilon-deactivate-form {
94
+ display: none;
95
+ }
96
+
97
+ .epsilon-deactivate-form-active .epsilon-deactivate-form {
98
+ position: absolute;
99
+ bottom: 30px;
100
+ left: 0;
101
+ max-width: 400px;
102
+ background: #fff;
103
+ white-space: normal;
104
+ }
105
+
106
+ .epsilon-deactivate-form-head {
107
+ background: #272754;
108
+ color: #fff;
109
+ padding: 8px 18px;
110
+ }
111
+
112
+ .epsilon-deactivate-form-body {
113
+ padding: 8px 18px;
114
+ color: #444;
115
+ }
116
+
117
+ .deactivating-spinner {
118
+ display: none;
119
+ }
120
+
121
+ .deactivating-spinner .spinner {
122
+ float: none;
123
+ margin: 4px 4px 0 18px;
124
+ vertical-align: bottom;
125
+ visibility: visible;
126
+ }
127
+
128
+ .epsilon-deactivate-form-footer {
129
+ padding: 8px 18px;
130
+ }
131
+
132
+ .epsilon-deactivate-form-footer p {
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: space-between;
136
+ }
137
+
138
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
139
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
140
+ position: relative;
141
+ }
142
+
143
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
144
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
145
+ content: "";
146
+ display: block;
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ width: 100%;
151
+ height: 100%;
152
+ background-color: rgba(255, 255, 255, .5);
153
+ }
154
+ </style>
155
+ <script>
156
+ jQuery( document ).ready( function( $ ) {
157
+ var deactivateURL = $( "#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>" ),
158
+ formContainer = $( '#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>' ),
159
+ detailsStrings = {
160
+ 'setup': '<?php echo __( 'What was the dificult part ?', 'saboxplugin' ); ?>',
161
+ 'documentation': '<?php echo __( 'What can we describe more ?', 'saboxplugin' ); ?>',
162
+ 'features': '<?php echo __( 'How could we improve ?', 'saboxplugin' ); ?>',
163
+ 'better-plugin': '<?php echo __( 'Can you mention it ?', 'saboxplugin' ); ?>',
164
+ 'incompatibility': '<?php echo __( 'With what plugin or theme is incompatible ?', 'saboxplugin' ); ?>',
165
+ };
166
+
167
+ $( deactivateURL ).on( "click", function() {
168
+ // We'll send the user to this deactivation link when they've completed or dismissed the form
169
+ var url = deactivateURL.attr( 'href' );
170
+ $( 'body' ).toggleClass( 'epsilon-deactivate-form-active' );
171
+ formContainer.fadeIn( {
172
+ complete: function() {
173
+ var offset = formContainer.offset();
174
+ $( 'body' ).animate( { scrollTop: Math.max( 0, offset.top - 50 ) } );
175
+ }
176
+ } );
177
+ formContainer.html( '<?php echo $html; ?>' );
178
+
179
+ formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function() {
180
+ var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
181
+ var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
182
+ detailsLabel.text( detailsStrings[ value ] );
183
+ } );
184
+
185
+ formContainer.on( 'click', '#epsilon-deactivate-submit-form', function( e ) {
186
+ var data = {
187
+ 'action': 'epsilon_deactivate_plugin',
188
+ 'security': "<?php echo wp_create_nonce( 'epsilon_deactivate_plugin' ); ?>",
189
+ 'dataType': "json"
190
+ };
191
+ e.preventDefault();
192
+ // As soon as we click, the body of the form should disappear
193
+ formContainer.addClass( 'process-response' );
194
+ // Fade in spinner
195
+ formContainer.find( ".deactivating-spinner" ).fadeIn();
196
+
197
+ data[ 'reason' ] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
198
+ data[ 'details' ] = formContainer.find( '#epsilon-deactivate-details' ).val();
199
+ data[ 'tracking' ] = formContainer.find( '#allow-tracking:checked' ).length;
200
+
201
+ $.post(
202
+ ajaxurl,
203
+ data,
204
+ function( response ) {
205
+ // Redirect to original deactivation URL
206
+ window.location.href = url;
207
+ }
208
+ );
209
+ } );
210
+
211
+ formContainer.on( 'click', '#epsilon-deactivate-plugin', function( e ) {
212
+ e.preventDefault();
213
+ window.location.href = url;
214
+ } );
215
+
216
+ // If we click outside the form, the form will close
217
+ $( '.epsilon-deactivate-form-bg' ).on( 'click', function() {
218
+ formContainer.fadeOut();
219
+ $( 'body' ).removeClass( 'epsilon-deactivate-form-active' );
220
+ } );
221
+ } );
222
+ } );
223
+ </script>
224
+ <?php
225
+ }
226
+
227
+ /*
228
+ * Form text strings
229
+ * These are non-filterable and used as fallback in case filtered strings aren't set correctly
230
+ * @since 1.0.0
231
+ */
232
+ public function get_form_info() {
233
+ $form = array();
234
+ $form['heading'] = __( 'Sorry to see you go', 'saboxplugin' );
235
+ $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'saboxplugin' );
236
+ $form['options'] = array(
237
+ 'setup' => __( 'Set up is too difficult', 'saboxplugin' ),
238
+ 'documentation' => __( 'Lack of documentation', 'saboxplugin' ),
239
+ 'features' => __( 'Not the features I wanted', 'saboxplugin' ),
240
+ 'better-plugin' => __( 'Found a better plugin', 'saboxplugin' ),
241
+ 'incompatibility' => __( 'Incompatible with theme or plugin', 'saboxplugin' ),
242
+ );
243
+ $form['details'] = __( 'How could we improve ?', 'saboxplugin' );
244
+
245
+ return $form;
246
+ }
247
+
248
+ public function epsilon_deactivate_plugin_callback() {
249
+
250
+ check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
251
+
252
+ if ( isset( $_POST['reason'] ) && isset( $_POST['details'] ) && isset( $_POST['tracking'] ) ) {
253
+ require_once 'class-epsilon-plugin-request-sab.php';
254
+ $args = array(
255
+ 'reason' => $_POST['reason'],
256
+ 'details' => $_POST['details'],
257
+ 'tracking' => $_POST['tracking'],
258
+ );
259
+ $request = new Epsilon_Plugin_Request_SAB( $this->plugin_file, $args );
260
+ if ( $request->request_successful ) {
261
+ echo json_encode(
262
+ array(
263
+ 'status' => 'ok',
264
+ )
265
+ );
266
+ } else {
267
+ echo json_encode(
268
+ array(
269
+ 'status' => 'nok',
270
+ )
271
+ );
272
+ }
273
+ } else {
274
+ echo json_encode(
275
+ array(
276
+ 'status' => 'ok',
277
+ )
278
+ );
279
+ }
280
+
281
+ die();
282
+ }
283
+ }
inc/feedback/class-epsilon-plugin-request-sab.php CHANGED
@@ -1,225 +1,227 @@
1
- <?php
2
-
3
- class Epsilon_Plugin_Request_SAB {
4
-
5
- /**
6
- * Url for the request
7
- *
8
- * @var string
9
- */
10
- private $url = 'https://tamewp.com/';
11
- /**
12
- * Api endpoint
13
- *
14
- * @var string
15
- */
16
- private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
17
- /**
18
- * Private data
19
- *
20
- * @var array
21
- */
22
- private $data = array(
23
- 'server' => array(),
24
- 'user' => array(),
25
- 'wordpress' => array(
26
- 'deactivated_plugin' => array(),
27
- ),
28
- );
29
- /**
30
- * Plugin file
31
- *
32
- * @var string
33
- */
34
- private $plugin_file = '';
35
-
36
- private $allow_tracking = 0;
37
-
38
- public $request_successful = false;
39
-
40
- function __construct( $_plugin_file, $args ) {
41
-
42
- // Set variables
43
- $this->allow_tracking = $args['tracking'];
44
- $this->plugin_file = $_plugin_file;
45
- $this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
46
- $this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
47
- $this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
48
-
49
- // Start collecting data
50
- $this->_collect_data();
51
- $this->_generate_url();
52
- $this->request_successful = $this->_send_request();
53
- }
54
-
55
- /**
56
- * Collect all data for the request.
57
- *
58
- */
59
- private function _collect_data() {
60
-
61
- $current_plugin = get_plugin_data( $this->plugin_file );
62
-
63
- // Plugin data
64
- $this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
65
- $this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
66
- $this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
67
- $this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
68
-
69
- if ( $this->allow_tracking ) {
70
- $this->_collect_wordpress_data();
71
- $this->_collect_server_data();
72
- $this->_collect_user_data();
73
- }
74
-
75
- }
76
-
77
- /**
78
- * Collect WordPress data.
79
- *
80
- */
81
- private function _collect_wordpress_data() {
82
- $this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
83
- $this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
84
- $this->data['wordpress']['multisite'] = is_multisite();
85
-
86
- $this->data['wordpress']['themes'] = $this->get_themes();
87
- $this->data['wordpress']['plugins'] = $this->get_plugins();
88
- }
89
-
90
- /**
91
- * Collect server data.
92
- *
93
- */
94
- private function _collect_server_data() {
95
- $this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
96
- $this->data['server']['php_version'] = phpversion();
97
- $this->data['server']['url'] = home_url();
98
- }
99
-
100
- /**
101
- * Collect user data.
102
- *
103
- */
104
- private function _collect_user_data() {
105
- $admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
106
- if ( ! $admin ) {
107
- $this->data['user']['email'] = '';
108
- $this->data['user']['first_name'] = '';
109
- $this->data['user']['last_name'] = '';
110
- }else{
111
- $this->data['user']['email'] = get_bloginfo( 'admin_email' );
112
- $this->data['user']['first_name'] = $admin->first_name;
113
- $this->data['user']['last_name'] = $admin->last_name;
114
- }
115
- }
116
-
117
- /**
118
- * Get current themes
119
- *
120
- * @return array
121
- */
122
- private function get_themes() {
123
- $theme = wp_get_theme();
124
-
125
- return array(
126
- 'installed' => $this->_get_installed_themes(),
127
- 'active' => array(
128
- 'slug' => get_stylesheet(),
129
- 'name' => $theme->get( 'Name' ),
130
- 'version' => $theme->get( 'Version' ),
131
- 'author' => $theme->get( 'Author' ),
132
- ),
133
- );
134
- }
135
-
136
- /**
137
- * Get an array of installed themes
138
- */
139
- private function _get_installed_themes() {
140
- $installed = wp_get_themes();
141
- $theme = get_stylesheet();
142
- $arr = array();
143
-
144
- foreach ( $installed as $slug => $info ) {
145
- if ( $slug === $theme ) {
146
- continue;
147
- }
148
- $arr[ $slug ] = array(
149
- 'slug' => $slug,
150
- 'name' => $info->get( 'Name' ),
151
- 'version' => $info->get( 'Version' ),
152
- 'author' => $info->get( 'Author' )
153
- );
154
- };
155
-
156
- return $arr;
157
- }
158
-
159
- /**
160
- * Get a list of installed plugins
161
- */
162
- private function get_plugins() {
163
- if ( ! function_exists( 'get_plugins' ) ) {
164
- include ABSPATH . '/wp-admin/includes/plugin.php';
165
- }
166
-
167
- $plugins = get_plugins();
168
- $option = get_option( 'active_plugins', array() );
169
- $active = array();
170
- $installed = array();
171
- foreach ( $plugins as $id => $info ) {
172
- if ( in_array( $id, $active ) ) {
173
- continue;
174
- }
175
-
176
- $id = explode( '/', $id );
177
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
178
-
179
- $installed[] = $id;
180
- }
181
-
182
- foreach ( $option as $id ) {
183
- $id = explode( '/', $id );
184
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
185
-
186
- $active[] = $id;
187
- }
188
-
189
- return array(
190
- 'installed' => $installed,
191
- 'active' => $active,
192
- );
193
- }
194
-
195
- /**
196
- * Generate the url
197
- */
198
- protected function _generate_url() {
199
- $this->url = $this->url . $this->endpoint;
200
- }
201
-
202
- /**
203
- * Send dat to server.
204
- *
205
- */
206
- private function _send_request() {
207
-
208
- $request = wp_remote_post( $this->url, array(
209
- 'method' => 'POST',
210
- 'timeout' => 20,
211
- 'redirection' => 5,
212
- 'httpversion' => '1.1',
213
- 'blocking' => true,
214
- 'body' => $this->data,
215
- 'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() )
216
- ) );
217
-
218
- if ( is_wp_error( $request ) ) {
219
- return false;
220
- }
221
-
222
- return true;
223
-
224
- }
225
- }
 
 
1
+ <?php
2
+
3
+ class Epsilon_Plugin_Request_SAB {
4
+
5
+ /**
6
+ * Url for the request
7
+ *
8
+ * @var string
9
+ */
10
+ private $url = 'https://tamewp.com/';
11
+ /**
12
+ * Api endpoint
13
+ *
14
+ * @var string
15
+ */
16
+ private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
17
+ /**
18
+ * Private data
19
+ *
20
+ * @var array
21
+ */
22
+ private $data = array(
23
+ 'server' => array(),
24
+ 'user' => array(),
25
+ 'wordpress' => array(
26
+ 'deactivated_plugin' => array(),
27
+ ),
28
+ );
29
+ /**
30
+ * Plugin file
31
+ *
32
+ * @var string
33
+ */
34
+ private $plugin_file = '';
35
+
36
+ private $allow_tracking = 0;
37
+
38
+ public $request_successful = false;
39
+
40
+ function __construct( $_plugin_file, $args ) {
41
+
42
+ // Set variables
43
+ $this->allow_tracking = $args['tracking'];
44
+ $this->plugin_file = $_plugin_file;
45
+ $this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
46
+ $this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
47
+ $this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
48
+
49
+ // Start collecting data
50
+ $this->_collect_data();
51
+ $this->_generate_url();
52
+ $this->request_successful = $this->_send_request();
53
+ }
54
+
55
+ /**
56
+ * Collect all data for the request.
57
+ *
58
+ */
59
+ private function _collect_data() {
60
+
61
+ $current_plugin = get_plugin_data( $this->plugin_file );
62
+
63
+ // Plugin data
64
+ $this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
65
+ $this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
66
+ $this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
67
+ $this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
68
+
69
+ if ( $this->allow_tracking ) {
70
+ $this->_collect_wordpress_data();
71
+ $this->_collect_server_data();
72
+ $this->_collect_user_data();
73
+ }
74
+
75
+ }
76
+
77
+ /**
78
+ * Collect WordPress data.
79
+ *
80
+ */
81
+ private function _collect_wordpress_data() {
82
+ $this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
83
+ $this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
84
+ $this->data['wordpress']['multisite'] = is_multisite();
85
+
86
+ $this->data['wordpress']['themes'] = $this->get_themes();
87
+ $this->data['wordpress']['plugins'] = $this->get_plugins();
88
+ }
89
+
90
+ /**
91
+ * Collect server data.
92
+ *
93
+ */
94
+ private function _collect_server_data() {
95
+ $this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
96
+ $this->data['server']['php_version'] = phpversion();
97
+ $this->data['server']['url'] = home_url();
98
+ }
99
+
100
+ /**
101
+ * Collect user data.
102
+ *
103
+ */
104
+ private function _collect_user_data() {
105
+ $admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
106
+ if ( ! $admin ) {
107
+ $this->data['user']['email'] = '';
108
+ $this->data['user']['first_name'] = '';
109
+ $this->data['user']['last_name'] = '';
110
+ } else {
111
+ $this->data['user']['email'] = get_bloginfo( 'admin_email' );
112
+ $this->data['user']['first_name'] = $admin->first_name;
113
+ $this->data['user']['last_name'] = $admin->last_name;
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Get current themes
119
+ *
120
+ * @return array
121
+ */
122
+ private function get_themes() {
123
+ $theme = wp_get_theme();
124
+
125
+ return array(
126
+ 'installed' => $this->_get_installed_themes(),
127
+ 'active' => array(
128
+ 'slug' => get_stylesheet(),
129
+ 'name' => $theme->get( 'Name' ),
130
+ 'version' => $theme->get( 'Version' ),
131
+ 'author' => $theme->get( 'Author' ),
132
+ ),
133
+ );
134
+ }
135
+
136
+ /**
137
+ * Get an array of installed themes
138
+ */
139
+ private function _get_installed_themes() {
140
+ $installed = wp_get_themes();
141
+ $theme = get_stylesheet();
142
+ $arr = array();
143
+
144
+ foreach ( $installed as $slug => $info ) {
145
+ if ( $slug === $theme ) {
146
+ continue;
147
+ }
148
+ $arr[ $slug ] = array(
149
+ 'slug' => $slug,
150
+ 'name' => $info->get( 'Name' ),
151
+ 'version' => $info->get( 'Version' ),
152
+ 'author' => $info->get( 'Author' ),
153
+ );
154
+ };
155
+
156
+ return $arr;
157
+ }
158
+
159
+ /**
160
+ * Get a list of installed plugins
161
+ */
162
+ private function get_plugins() {
163
+ if ( ! function_exists( 'get_plugins' ) ) {
164
+ include ABSPATH . '/wp-admin/includes/plugin.php';
165
+ }
166
+
167
+ $plugins = get_plugins();
168
+ $option = get_option( 'active_plugins', array() );
169
+ $active = array();
170
+ $installed = array();
171
+ foreach ( $plugins as $id => $info ) {
172
+ if ( in_array( $id, $active ) ) {
173
+ continue;
174
+ }
175
+
176
+ $id = explode( '/', $id );
177
+ $id = ucwords( str_replace( '-', ' ', $id[0] ) );
178
+
179
+ $installed[] = $id;
180
+ }
181
+
182
+ foreach ( $option as $id ) {
183
+ $id = explode( '/', $id );
184
+ $id = ucwords( str_replace( '-', ' ', $id[0] ) );
185
+
186
+ $active[] = $id;
187
+ }
188
+
189
+ return array(
190
+ 'installed' => $installed,
191
+ 'active' => $active,
192
+ );
193
+ }
194
+
195
+ /**
196
+ * Generate the url
197
+ */
198
+ protected function _generate_url() {
199
+ $this->url = $this->url . $this->endpoint;
200
+ }
201
+
202
+ /**
203
+ * Send dat to server.
204
+ *
205
+ */
206
+ private function _send_request() {
207
+
208
+ $request = wp_remote_post(
209
+ $this->url, array(
210
+ 'method' => 'POST',
211
+ 'timeout' => 20,
212
+ 'redirection' => 5,
213
+ 'httpversion' => '1.1',
214
+ 'blocking' => true,
215
+ 'body' => $this->data,
216
+ 'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() ),
217
+ )
218
+ );
219
+
220
+ if ( is_wp_error( $request ) ) {
221
+ return false;
222
+ }
223
+
224
+ return true;
225
+
226
+ }
227
+ }
inc/functions.php CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
6
  }
7
 
8
  /*----------------------------------------------------------------------------------------------------------
9
- Adding the author box to the end of your single post
10
  -----------------------------------------------------------------------------------------------------------*/
11
  if ( ! function_exists( 'wpsabox_author_box' ) ) {
12
 
@@ -34,7 +34,11 @@ if ( ! function_exists( 'wpsabox_author_box' ) ) {
34
 
35
  do_action( 'sabox_after_author_box', $sabox_options );
36
 
37
- $saboxmeta .= ob_get_clean();
 
 
 
 
38
 
39
  }
40
  return $saboxmeta;
6
  }
7
 
8
  /*----------------------------------------------------------------------------------------------------------
9
+ Adding the author box to the end of your single post
10
  -----------------------------------------------------------------------------------------------------------*/
11
  if ( ! function_exists( 'wpsabox_author_box' ) ) {
12
 
34
 
35
  do_action( 'sabox_after_author_box', $sabox_options );
36
 
37
+ $sabox = ob_get_clean();
38
+ $return = $saboxmeta . $sabox;
39
+
40
+ // Filter returning HTML of the Author Box
41
+ $saboxmeta = apply_filters( 'sabox_return_html', $return, $sabox, $saboxmeta );
42
 
43
  }
44
  return $saboxmeta;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: machothemes, silkalns
3
  Tags: author box, responsive author box, author profile fields, author social icons, profile fields, author bio, author description, author profile, user profile, post author, rtl author box
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
- Stable tag: 2.0.5
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -41,7 +41,9 @@ The Simple Author Box plugin was designed to display the author information on p
41
 
42
  = Can I remove the SAB from WooCommerce/Category/Tags pages? Can I have only on posts? =
43
 
44
- We are working on a feature for this.
 
 
45
 
46
  = I have two author boxes. How can I hide one? =
47
 
3
  Tags: author box, responsive author box, author profile fields, author social icons, profile fields, author bio, author description, author profile, user profile, post author, rtl author box
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
+ Stable tag: 2.0.6
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
41
 
42
  = Can I remove the SAB from WooCommerce/Category/Tags pages? Can I have only on posts? =
43
 
44
+ We are working on a feature for this, but in the meantime we have made a plugin containing a small fix for this.
45
+ Please download it from here: <a href="https://www.dropbox.com/s/gdkumeuilogui6g/wp-sab-fix.zip?dl=0">https://www.dropbox.com/s/gdkumeuilogui6g/wp-sab-fix.zip?dl=0</a>
46
+ Then go to your dashboard > Plugins > install and activate it and it will solve it.
47
 
48
  = I have two author boxes. How can I hide one? =
49
 
simple-author-box.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Author Box
4
  * Plugin URI: http://wordpress.org/plugins/simple-author-box/
5
  * Description: Adds a responsive author box with social icons on your posts.
6
- * Version: 2.0.5
7
  * Author: Macho Themes
8
  * Author URI: https://www.machothemes.com/
9
  * License: GPLv3
@@ -11,26 +11,26 @@
11
 
12
  /* Copyright 2017 Machothemes (email : office [at] machothemes [dot] com)
13
 
14
- THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
15
- IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
16
- THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
17
- (AT YOUR OPTION) ANY LATER VERSION.
18
 
19
- THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
20
- BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
21
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE
22
- GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.
23
 
24
- YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
25
- ALONG WITH THIS PROGRAM; IF NOT, WRITE TO THE FREE SOFTWARE
26
- FOUNDATION, INC., 51 FRANKLIN ST, FIFTH FLOOR, BOSTON, MA 02110-1301 USA
27
 
28
  */
29
 
30
  define( 'SIMPLE_AUTHOR_BOX_PATH', plugin_dir_path( __FILE__ ) );
31
  define( 'SIMPLE_AUTHOR_BOX_ASSETS', plugins_url( '/assets/', __FILE__ ) );
32
  define( 'SIMPLE_AUTHOR_BOX_SLUG', plugin_basename( __FILE__ ) );
33
- define( 'SIMPLE_AUTHOR_BOX_VERSION', '2.0.5' );
34
  define( 'SIMPLE_AUTHOR_SCRIPT_DEBUG', false );
35
 
36
 
@@ -39,4 +39,4 @@ Simple_Author_Box::get_instance();
39
 
40
  // load the uninstall feedback class
41
  require_once 'inc/feedback/class-epsilon-feedback-sab.php';
42
- new Epsilon_Feedback_SAB( __FILE__ );
3
  * Plugin Name: Simple Author Box
4
  * Plugin URI: http://wordpress.org/plugins/simple-author-box/
5
  * Description: Adds a responsive author box with social icons on your posts.
6
+ * Version: 2.0.6
7
  * Author: Macho Themes
8
  * Author URI: https://www.machothemes.com/
9
  * License: GPLv3
11
 
12
  /* Copyright 2017 Machothemes (email : office [at] machothemes [dot] com)
13
 
14
+ THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
15
+ IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
16
+ THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
17
+ (AT YOUR OPTION) ANY LATER VERSION.
18
 
19
+ THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
20
+ BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
21
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE
22
+ GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.
23
 
24
+ YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
25
+ ALONG WITH THIS PROGRAM; IF NOT, WRITE TO THE FREE SOFTWARE
26
+ FOUNDATION, INC., 51 FRANKLIN ST, FIFTH FLOOR, BOSTON, MA 02110-1301 USA
27
 
28
  */
29
 
30
  define( 'SIMPLE_AUTHOR_BOX_PATH', plugin_dir_path( __FILE__ ) );
31
  define( 'SIMPLE_AUTHOR_BOX_ASSETS', plugins_url( '/assets/', __FILE__ ) );
32
  define( 'SIMPLE_AUTHOR_BOX_SLUG', plugin_basename( __FILE__ ) );
33
+ define( 'SIMPLE_AUTHOR_BOX_VERSION', '2.0.6' );
34
  define( 'SIMPLE_AUTHOR_SCRIPT_DEBUG', false );
35
 
36
 
39
 
40
  // load the uninstall feedback class
41
  require_once 'inc/feedback/class-epsilon-feedback-sab.php';
42
+ new Epsilon_Feedback_SAB( __FILE__ );
template/template-sab.php CHANGED
@@ -1,120 +1,120 @@
1
- <?php
2
- if ( isset( $sabox_options['sab_colored'] ) ) {
3
- $sabox_color = 'sabox-colored';
4
- } else {
5
- $sabox_color = '';
6
- }
7
-
8
- if ( isset( $sabox_options['sab_web_position'] ) && '0' != $sabox_options['sab_web_position'] ) {
9
- $sab_web_align = 'sab-web-position';
10
- } else {
11
- $sab_web_align = '';
12
- }
13
-
14
- if ( isset( $sabox_options['sab_web_target'] ) ) {
15
- $sab_web_target = '_blank';
16
- } else {
17
- $sab_web_target = '_self';
18
- }
19
-
20
- if ( isset( $sabox_options['sab_web_rel'] ) ) {
21
- $sab_web_rel = 'rel="nofollow"';
22
- } else {
23
- $sab_web_rel = '';
24
- }
25
-
26
- $sab_author_link = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $sabox_author_id ) ), esc_html( get_the_author_meta( 'display_name', $sabox_author_id ) ) );
27
-
28
- if ( get_the_author_meta( 'description' ) != '' || ! isset( $sabox_options['sab_no_description'] ) ) { // hide the author box if no description is provided
29
-
30
-
31
- echo '<div class="saboxplugin-wrap">'; // start saboxplugin-wrap div
32
-
33
- // author box gravatar
34
- echo '<div class="saboxplugin-gravatar">';
35
- $custom_profile_image = get_the_author_meta( 'sabox-profile-image', $sabox_author_id );
36
- if ( '' != $custom_profile_image ) {
37
- echo '<img src="' . esc_url( $custom_profile_image ) . '">';
38
- } else {
39
- echo get_avatar( get_the_author_meta( 'user_email', $sabox_author_id ), '100' );
40
- }
41
-
42
- echo '</div>';
43
-
44
- // author box name
45
- echo '<div class="saboxplugin-authorname">';
46
- echo apply_filters( 'sabox_author_html', $sab_author_link, $sabox_options, $sabox_author_id );
47
- if ( is_user_logged_in() && $sabox_author_id == get_current_user_id() ) {
48
- echo '<a class="sab-profile-edit" target="_blank" href="' . get_edit_user_link() . '"> ' . __( 'Edit profile', 'saboxplugin' ) . '</a>';
49
- }
50
- echo '</div>';
51
-
52
-
53
- // author box description
54
- echo '<div class="saboxplugin-desc">';
55
- echo '<div class="vcard author"><div class="fn">';
56
- $description = get_the_author_meta( 'description', $sabox_author_id );
57
- $description = wptexturize( $description );
58
- $description = wpautop( $description );
59
- echo wp_kses_post( $description );
60
- echo '</div></div>';
61
- echo '</div>';
62
-
63
- if ( is_single() ) {
64
- if ( get_the_author_meta( 'user_url' ) != '' and isset( $sabox_options['sab_web'] ) ) { // author website on single
65
- echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
66
- echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . esc_attr( $sab_web_rel ) . '>' . esc_html( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '</a>';
67
- echo '</div>';
68
- }
69
- }
70
-
71
-
72
- if ( is_author() or is_archive() ) {
73
- if ( get_the_author_meta( 'user_url' ) != '' ) { // force show author website on author.php or archive.php
74
- echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
75
- echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . esc_attr( $sab_web_rel ) . '>' . esc_html( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '</a>';
76
- echo '</div>';
77
- }
78
- }
79
-
80
- // author box clearfix
81
- echo '<div class="clearfix"></div>';
82
-
83
- // author box social icons
84
- $author = get_userdata( $sabox_author_id );
85
- $show_social_icons = apply_filters( 'sabox_hide_social_icons', true, $author );
86
-
87
-
88
-
89
- if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
90
- echo '<div class="sab-edit-settings">';
91
- echo '<a target="_blank" href="'.admin_url().'admin.php?page=simple-author-box-options">' . __( 'Settings', 'saboxplugin' ) . '<i class="dashicons dashicons-admin-settings"></i></a>';
92
- echo '</div>';
93
- }
94
-
95
-
96
- if ( ! isset( $sabox_options['sab_hide_socials'] ) && $show_social_icons ) { // hide social icons div option
97
- echo '<div class="saboxplugin-socials ' . esc_attr( $sabox_color ) . '">';
98
-
99
-
100
- $social_links = Simple_Author_Box_Helper::get_user_social_links( $sabox_author_id, true );
101
- foreach ( $social_links as $social_platform => $social_link ) {
102
-
103
- if ( 'user_email' == $social_platform ) {
104
- if ( ! isset( $sabox_options['sab_email'] ) ) {
105
- continue;
106
- } else {
107
- $social_link = 'mailto:' . antispambot( $social_link );
108
- }
109
- }
110
-
111
- if ( ! empty( $social_link ) ) {
112
- echo Simple_Author_Box_Helper::get_sabox_social_icon( $social_link, $social_platform );
113
- }
114
- }
115
-
116
-
117
- echo '</div>';
118
- } // end of social icons
119
- echo '</div>'; // end of saboxplugin-wrap div
120
- }
1
+ <?php
2
+ if ( isset( $sabox_options['sab_colored'] ) ) {
3
+ $sabox_color = 'sabox-colored';
4
+ } else {
5
+ $sabox_color = '';
6
+ }
7
+
8
+ if ( isset( $sabox_options['sab_web_position'] ) && '0' != $sabox_options['sab_web_position'] ) {
9
+ $sab_web_align = 'sab-web-position';
10
+ } else {
11
+ $sab_web_align = '';
12
+ }
13
+
14
+ if ( isset( $sabox_options['sab_web_target'] ) ) {
15
+ $sab_web_target = '_blank';
16
+ } else {
17
+ $sab_web_target = '_self';
18
+ }
19
+
20
+ if ( isset( $sabox_options['sab_web_rel'] ) ) {
21
+ $sab_web_rel = 'rel="nofollow"';
22
+ } else {
23
+ $sab_web_rel = '';
24
+ }
25
+
26
+ $sab_author_link = sprintf( '<a href="%s" class="vcard author"><span class="fn">%s</span></a>', esc_url( get_author_posts_url( $sabox_author_id ) ), esc_html( get_the_author_meta( 'display_name', $sabox_author_id ) ) );
27
+
28
+ if ( get_the_author_meta( 'description' ) != '' || ! isset( $sabox_options['sab_no_description'] ) ) { // hide the author box if no description is provided
29
+
30
+
31
+ echo '<div class="saboxplugin-wrap">'; // start saboxplugin-wrap div
32
+
33
+ // author box gravatar
34
+ echo '<div class="saboxplugin-gravatar">';
35
+ $custom_profile_image = get_the_author_meta( 'sabox-profile-image', $sabox_author_id );
36
+ if ( '' != $custom_profile_image ) {
37
+ echo '<img src="' . esc_url( $custom_profile_image ) . '">';
38
+ } else {
39
+ echo get_avatar( get_the_author_meta( 'user_email', $sabox_author_id ), '100' );
40
+ }
41
+
42
+ echo '</div>';
43
+
44
+ // author box name
45
+ echo '<div class="saboxplugin-authorname">';
46
+ echo apply_filters( 'sabox_author_html', $sab_author_link, $sabox_options, $sabox_author_id );
47
+ if ( is_user_logged_in() && get_current_user_id() == $sabox_author_id ) {
48
+ echo '<a class="sab-profile-edit" target="_blank" href="' . get_edit_user_link() . '"> ' . __( 'Edit profile', 'saboxplugin' ) . '</a>';
49
+ }
50
+ echo '</div>';
51
+
52
+
53
+ // author box description
54
+ echo '<div class="saboxplugin-desc">';
55
+ echo '<div>';
56
+ $description = get_the_author_meta( 'description', $sabox_author_id );
57
+ $description = wptexturize( $description );
58
+ $description = wpautop( $description );
59
+ echo wp_kses_post( $description );
60
+ echo '</div>';
61
+ echo '</div>';
62
+
63
+ if ( is_single() ) {
64
+ if ( get_the_author_meta( 'user_url' ) != '' and isset( $sabox_options['sab_web'] ) ) { // author website on single
65
+ echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
66
+ echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . esc_attr( $sab_web_rel ) . '>' . esc_html( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '</a>';
67
+ echo '</div>';
68
+ }
69
+ }
70
+
71
+
72
+ if ( is_author() or is_archive() ) {
73
+ if ( get_the_author_meta( 'user_url' ) != '' ) { // force show author website on author.php or archive.php
74
+ echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
75
+ echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . esc_attr( $sab_web_rel ) . '>' . esc_html( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '</a>';
76
+ echo '</div>';
77
+ }
78
+ }
79
+
80
+ // author box clearfix
81
+ echo '<div class="clearfix"></div>';
82
+
83
+ // author box social icons
84
+ $author = get_userdata( $sabox_author_id );
85
+ $show_social_icons = apply_filters( 'sabox_hide_social_icons', true, $author );
86
+
87
+
88
+
89
+ if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
90
+ echo '<div class="sab-edit-settings">';
91
+ echo '<a target="_blank" href="' . admin_url() . 'admin.php?page=simple-author-box-options">' . __( 'Settings', 'saboxplugin' ) . '<i class="dashicons dashicons-admin-settings"></i></a>';
92
+ echo '</div>';
93
+ }
94
+
95
+
96
+ if ( ! isset( $sabox_options['sab_hide_socials'] ) && $show_social_icons ) { // hide social icons div option
97
+ echo '<div class="saboxplugin-socials ' . esc_attr( $sabox_color ) . '">';
98
+
99
+
100
+ $social_links = Simple_Author_Box_Helper::get_user_social_links( $sabox_author_id, true );
101
+ foreach ( $social_links as $social_platform => $social_link ) {
102
+
103
+ if ( 'user_email' == $social_platform ) {
104
+ if ( ! isset( $sabox_options['sab_email'] ) ) {
105
+ continue;
106
+ } else {
107
+ $social_link = 'mailto:' . antispambot( $social_link );
108
+ }
109
+ }
110
+
111
+ if ( ! empty( $social_link ) ) {
112
+ echo Simple_Author_Box_Helper::get_sabox_social_icon( $social_link, $social_platform );
113
+ }
114
+ }
115
+
116
+
117
+ echo '</div>';
118
+ } // end of social icons
119
+ echo '</div>'; // end of saboxplugin-wrap div
120
+ }
uninstall.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*----------------------------------------------------------------------------------------------------------
4
- Uninstall Simple Author Box plugin - deletes plugin data in database
5
  -----------------------------------------------------------------------------------------------------------*/
6
 
7
  // Exit if accessed directly
1
  <?php
2
 
3
  /*----------------------------------------------------------------------------------------------------------
4
+ Uninstall Simple Author Box plugin - deletes plugin data in database
5
  -----------------------------------------------------------------------------------------------------------*/
6
 
7
  // Exit if accessed directly