Custom Login Page Customizer - Version 2.0.0

Version Description

  • 2018-08-06
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Custom Login Page Customizer
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.2.1 to 2.0.0

Files changed (72) hide show
  1. CHANGELOG.md +6 -0
  2. assets/logo.png +0 -0
  3. assets/orbit-fox.png +0 -0
  4. assets/templates/dark.png +0 -0
  5. assets/templates/material.png +0 -0
  6. assets/templates/original.png +0 -0
  7. css/admin.css +0 -37
  8. css/bg.png +0 -0
  9. css/disable_controls.css +0 -29
  10. css/logo.png +0 -0
  11. css/security.png +0 -0
  12. customizer.php +0 -718
  13. inc/customizer/controls/alpha/alpha-control.php +59 -0
  14. inc/customizer/controls/alpha/assets/css/alpha-control.css +51 -0
  15. inc/customizer/controls/alpha/assets/img/transparency-grid.png +0 -0
  16. inc/customizer/controls/alpha/assets/js/alpha-control.js +100 -0
  17. inc/customizer/controls/cool-stuff/assets/css/cool-stuff-control.css +6 -0
  18. inc/customizer/controls/cool-stuff/cool-stuff-control.php +51 -0
  19. inc/customizer/controls/padding/assets/css/padding-control.css +16 -0
  20. inc/customizer/controls/padding/assets/js/padding-control.js +41 -0
  21. inc/customizer/controls/padding/padding-control.php +47 -0
  22. inc/customizer/controls/radio-images/assets/css/radio-images-control.css +28 -0
  23. inc/customizer/controls/radio-images/radio-images-control.php +64 -0
  24. inc/customizer/controls/range-slider/assets/css/range-slider-control.css +118 -0
  25. inc/customizer/controls/range-slider/assets/js/range-slider-control.js +97 -0
  26. inc/customizer/controls/range-slider/range-slider-control.php +96 -0
  27. inc/customizer/controls/toggle/assets/css/toggle-control.css +47 -0
  28. inc/customizer/controls/toggle/assets/js/toggle-control.js +16 -0
  29. inc/customizer/controls/toggle/toggle-control.php +66 -0
  30. inc/customizer/css/customizer.css +0 -0
  31. inc/customizer/custom-code.php +258 -0
  32. inc/customizer/customizer.php +111 -0
  33. inc/customizer/functions.php +53 -0
  34. inc/customizer/js/customizer-preview.js +446 -0
  35. inc/customizer/js/customizer.js +325 -0
  36. inc/customizer/sanitizers.php +38 -0
  37. inc/customizer/sections/section-background.php +156 -0
  38. inc/customizer/sections/section-button.php +348 -0
  39. inc/customizer/sections/section-code.php +50 -0
  40. inc/customizer/sections/section-fields.php +325 -0
  41. inc/customizer/sections/section-form.php +211 -0
  42. inc/customizer/sections/section-logo.php +159 -0
  43. inc/customizer/sections/section-more.php +26 -0
  44. inc/customizer/sections/section-other.php +150 -0
  45. inc/customizer/sections/section-templates.php +37 -0
  46. inc/include-page-template.php +155 -0
  47. inc/initial-setup.php +123 -0
  48. inc/mailin.php +868 -0
  49. inc/template-login-customizer.php +116 -0
  50. index.php +1 -0
  51. js/admin.js +0 -8
  52. languages/login-customizer.pot +246 -118
  53. login-customizer.php +32 -22
  54. mailin.php +0 -868
  55. option-panel.php +0 -93
  56. readme.md +18 -1
  57. readme.txt +18 -1
  58. setup.php +65 -0
  59. themeisle-hash.json +1 -1
  60. vendor/autoload.php +1 -1
  61. vendor/autoload_52.php +1 -1
  62. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-endpoints.php +2 -2
  63. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php +6 -6
  64. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php +51 -57
  65. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php +1 -1
  66. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php +10 -10
  67. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php +90 -10
  68. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php +113 -84
  69. vendor/codeinwp/themeisle-sdk/load.php +1 -1
  70. vendor/composer/autoload_real.php +5 -5
  71. vendor/composer/autoload_real_52.php +3 -3
  72. vendor/composer/installed.json +4 -4
CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
 
 
 
 
 
 
 
2
  ### v1.2.1 - 2018-01-05
3
  **Changes:**
4
  * Improves compatiblity with latest WordPress version.
1
 
2
+ ### v2.0.0 - 2018-08-06
3
+ **Changes:**
4
+ * Added Template Feature
5
+ * Added Instant Refresh for Controls
6
+ * Fixed issue with Security plugins and Multisite
7
+
8
  ### v1.2.1 - 2018-01-05
9
  **Changes:**
10
  * Improves compatiblity with latest WordPress version.
assets/logo.png ADDED
Binary file
assets/orbit-fox.png ADDED
Binary file
assets/templates/dark.png ADDED
Binary file
assets/templates/material.png ADDED
Binary file
assets/templates/original.png ADDED
Binary file
css/admin.css DELETED
@@ -1,37 +0,0 @@
1
- .logincust-success {
2
- border: 2px solid #398f14;
3
- }
4
-
5
- .appearance_page_logincust_options #wpcontent #wrap h3,
6
- .appearance_page_logincust_options #wpcontent #wrap h2,
7
- .appearance_page_logincust_options #wpcontent #wrap a,
8
- .appearance_page_logincust_options #wpcontent #wrap {
9
- color: #777;
10
- }
11
-
12
- #logincust-logo {
13
- position: absolute;
14
- right: 13%;
15
- width: 123px;
16
- height: 85px;
17
- background: url("<?php echo LOGINCUST_FREE_URL; ?>/css/logo.png");
18
- background-repeat: no-repeat;
19
- background-position: center;
20
- }
21
-
22
- .appearance_page_logincust_options #submit:hover {
23
- border-color: #ff9d89 !important;
24
- background: #ff907a !important;
25
- }
26
-
27
- .appearance_page_logincust_options #submit {
28
- border-color: #ff5f3f !important;
29
- color: #fff !important;
30
- background: #ff7f66 !important;
31
- box-shadow: 0 1px 0 #ff9682 inset, 0 1px 0 rgba(0, 0, 0, 0.15);
32
- text-shadow: none;
33
- }
34
-
35
- .appearance_page_logincust_options #wpcontent {
36
- background: #fff;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/bg.png DELETED
Binary file
css/disable_controls.css DELETED
@@ -1,29 +0,0 @@
1
- .logincust_pro_text a {
2
- color: #a00;
3
- }
4
-
5
- .logincust_pro_text {
6
- width: 94%;
7
- margin-top: 0;
8
- margin-top: -10px;
9
- margin-left: -21px;
10
- padding: 10px;
11
- padding: 0;
12
- padding-top: 3px;
13
- padding-right: 28px;
14
- padding-left: 28px;
15
- background-color: #f5f5f5;
16
- font-size: 12px;
17
- font-weight: bold;
18
- text-align: center;
19
- }
20
-
21
- #accordion-section-logincust_security_section h3:hover,
22
- #accordion-section-logincust_security_section h3 {
23
- background-image: url("security.png") !important;
24
- background-repeat: no-repeat!important;
25
- background-position: 85% !important;
26
- background-size: 25% !important;
27
- ;
28
- ;
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/logo.png DELETED
Binary file
css/security.png DELETED
Binary file
customizer.php DELETED
@@ -1,718 +0,0 @@
1
- <?php
2
-
3
-
4
- function logincust_customize_register( $wp_customize ) {
5
- $wp_customize->add_panel(
6
- 'logincust_panel', array(
7
- 'priority' => 30,
8
- 'capability' => 'edit_theme_options',
9
- 'title' => __( 'Login Customizer', 'login-customizer' ),
10
- 'description' => __( 'This section allows you to customize the login page of your website.<br/>Login Customizer by <a target="_blank" rel="nofollow" href="https://themeisle.com">ThemeIsle</a>', 'login-customizer' ),
11
- )
12
- );
13
-
14
- $wp_customize->add_section(
15
- 'logincust_logo_section', array(
16
- 'priority' => 5,
17
- 'title' => __( 'Logo', 'login-customizer' ),
18
- 'panel' => 'logincust_panel',
19
- )
20
- );
21
-
22
- $wp_customize->add_section(
23
- 'logincust_background_section', array(
24
- 'priority' => 10,
25
- 'title' => __( 'Background', 'login-customizer' ),
26
- 'panel' => 'logincust_panel',
27
- )
28
- );
29
-
30
- $wp_customize->add_section(
31
- 'logincust_form_bg_section', array(
32
- 'priority' => 15,
33
- 'title' => __( 'Form Background', 'login-customizer' ),
34
- 'panel' => 'logincust_panel',
35
- )
36
- );
37
-
38
- $wp_customize->add_section(
39
- 'logincust_form_section', array(
40
- 'priority' => 20,
41
- 'title' => __( 'Form Styling', 'login-customizer' ),
42
- 'panel' => 'logincust_panel',
43
- )
44
- );
45
-
46
- $wp_customize->add_section(
47
- 'logincust_field_section', array(
48
- 'priority' => 25,
49
- 'title' => __( 'Fields Styling', 'login-customizer' ),
50
- 'panel' => 'logincust_panel',
51
- )
52
- );
53
-
54
- $wp_customize->add_section(
55
- 'logincust_button_section', array(
56
- 'priority' => 30,
57
- 'title' => __( 'Button Styling', 'login-customizer' ),
58
- 'panel' => 'logincust_panel',
59
- )
60
- );
61
-
62
- $wp_customize->add_section(
63
- 'logincust_other_section', array(
64
- 'priority' => 35,
65
- 'title' => __( 'Other', 'login-customizer' ),
66
- 'panel' => 'logincust_panel',
67
- )
68
- );
69
-
70
- $wp_customize->add_section(
71
- 'logincust_security_section', array(
72
- 'priority' => 40,
73
- 'title' => __( 'Security', 'login-customizer' ),
74
- 'panel' => 'logincust_panel',
75
- )
76
- );
77
-
78
- $wp_customize->add_setting(
79
- 'logincust_logo', array(
80
- 'type' => 'option',
81
- 'capability' => 'edit_theme_options',
82
- )
83
- );
84
-
85
- $wp_customize->add_control(
86
- new WP_Customize_Image_Control(
87
- $wp_customize, 'logincust_logo', array(
88
- 'label' => __( 'Login Logo', 'login-customizer' ),
89
- 'section' => 'logincust_logo_section',
90
- 'priority' => 5,
91
- 'settings' => 'logincust_logo',
92
- )
93
- )
94
- );
95
-
96
- $wp_customize->add_setting(
97
- 'logincust_logo_width', array(
98
- 'default' => '84px',
99
- 'type' => 'option',
100
- 'capability' => 'edit_theme_options',
101
- )
102
- );
103
-
104
- $wp_customize->add_control(
105
- 'logincust_logo_width', array(
106
- 'label' => __( 'Logo Width', 'login-customizer' ),
107
- 'section' => 'logincust_logo_section',
108
- 'priority' => 10,
109
- 'settings' => 'logincust_logo_width',
110
- )
111
- );
112
-
113
- $wp_customize->add_setting(
114
- 'logincust_logo_height', array(
115
- 'default' => '84px',
116
- 'type' => 'option',
117
- 'capability' => 'edit_theme_options',
118
- )
119
- );
120
-
121
- $wp_customize->add_control(
122
- 'logincust_logo_height', array(
123
- 'label' => __( 'Logo Height', 'login-customizer' ),
124
- 'section' => 'logincust_logo_section',
125
- 'priority' => 15,
126
- 'settings' => 'logincust_logo_height',
127
- )
128
- );
129
-
130
- $wp_customize->add_setting(
131
- 'logincust_logo_padding', array(
132
- 'default' => '5px',
133
- 'type' => 'option',
134
- 'capability' => 'edit_theme_options',
135
- )
136
- );
137
-
138
- $wp_customize->add_control(
139
- 'logincust_logo_padding', array(
140
- 'label' => __( 'Padding Bottom', 'login-customizer' ),
141
- 'section' => 'logincust_logo_section',
142
- 'priority' => 20,
143
- 'settings' => 'logincust_logo_padding',
144
- )
145
- );
146
-
147
- $wp_customize->add_setting(
148
- 'logincust_bg_image', array(
149
- 'type' => 'option',
150
- 'capability' => 'edit_theme_options',
151
- )
152
- );
153
-
154
- $wp_customize->add_control(
155
- new WP_Customize_Image_Control(
156
- $wp_customize, 'logincust_bg_image', array(
157
- 'label' => __( 'Background Image', 'login-customizer' ),
158
- 'section' => 'logincust_background_section',
159
- 'priority' => 5,
160
- 'settings' => 'logincust_bg_image',
161
- )
162
- )
163
- );
164
-
165
- $wp_customize->add_setting(
166
- 'logincust_bg_color', array(
167
- 'default' => '#F1F1F1',
168
- 'type' => 'option',
169
- 'capability' => 'edit_theme_options',
170
- )
171
- );
172
-
173
- $wp_customize->add_control(
174
- new WP_Customize_Color_Control(
175
- $wp_customize, 'logincust_bg_color', array(
176
- 'label' => __( 'Background Color', 'login-customizer' ),
177
- 'section' => 'logincust_background_section',
178
- 'priority' => 10,
179
- 'settings' => 'logincust_bg_color',
180
- )
181
- )
182
- );
183
-
184
- $wp_customize->add_setting(
185
- 'logincust_bg_size', array(
186
- 'type' => 'option',
187
- 'capability' => 'edit_theme_options',
188
- )
189
- );
190
-
191
- $wp_customize->add_control(
192
- 'logincust_bg_size', array(
193
- 'label' => __( 'Background Size', 'login-customizer' ),
194
- 'section' => 'logincust_background_section',
195
- 'priority' => 15,
196
- 'settings' => 'logincust_bg_size',
197
- )
198
- );
199
-
200
- $wp_customize->add_setting(
201
- 'logincust_form_bg_image', array(
202
- 'type' => 'option',
203
- 'capability' => 'edit_theme_options',
204
- )
205
- );
206
-
207
- $wp_customize->add_control(
208
- new WP_Customize_Image_Control(
209
- $wp_customize, 'logincust_form_bg_image', array(
210
- 'label' => __( 'Background Image', 'login-customizer' ),
211
- 'section' => 'logincust_form_bg_section',
212
- 'priority' => 5,
213
- 'settings' => 'logincust_form_bg_image',
214
- )
215
- )
216
- );
217
-
218
- $wp_customize->add_setting(
219
- 'logincust_form_bg_color', array(
220
- 'default' => '#FFF',
221
- 'type' => 'option',
222
- 'capability' => 'edit_theme_options',
223
- )
224
- );
225
-
226
- $wp_customize->add_control(
227
- new WP_Customize_Color_Control(
228
- $wp_customize, 'logincust_form_bg_color', array(
229
- 'label' => __( 'Background Color', 'login-customizer' ),
230
- 'section' => 'logincust_form_bg_section',
231
- 'priority' => 10,
232
- 'settings' => 'logincust_form_bg_color',
233
- )
234
- )
235
- );
236
-
237
- $wp_customize->add_setting(
238
- 'logincust_form_width', array(
239
- 'default' => '320px',
240
- 'type' => 'option',
241
- 'capability' => 'edit_theme_options',
242
- )
243
- );
244
-
245
- $wp_customize->add_control(
246
- 'logincust_form_width', array(
247
- 'label' => __( 'Width', 'login-customizer' ),
248
- 'section' => 'logincust_form_section',
249
- 'priority' => 15,
250
- 'settings' => 'logincust_form_width',
251
- )
252
- );
253
-
254
- $wp_customize->add_setting(
255
- 'logincust_form_height', array(
256
- 'default' => '194px',
257
- 'type' => 'option',
258
- 'capability' => 'edit_theme_options',
259
- )
260
- );
261
-
262
- $wp_customize->add_control(
263
- 'logincust_form_height', array(
264
- 'label' => __( 'Height', 'login-customizer' ),
265
- 'section' => 'logincust_form_section',
266
- 'priority' => 20,
267
- 'settings' => 'logincust_form_height',
268
- )
269
- );
270
-
271
- $wp_customize->add_setting(
272
- 'logincust_form_padding', array(
273
- 'default' => '26px 24px 46px',
274
- 'type' => 'option',
275
- 'capability' => 'edit_theme_options',
276
- )
277
- );
278
-
279
- $wp_customize->add_control(
280
- 'logincust_form_padding', array(
281
- 'label' => __( 'Padding', 'login-customizer' ),
282
- 'section' => 'logincust_form_section',
283
- 'priority' => 25,
284
- 'settings' => 'logincust_form_padding',
285
- )
286
- );
287
-
288
- $wp_customize->add_setting(
289
- 'logincust_form_border', array(
290
- 'type' => 'option',
291
- 'capability' => 'edit_theme_options',
292
- )
293
- );
294
-
295
- $wp_customize->add_control(
296
- 'logincust_form_border', array(
297
- 'label' => __( 'Border (Example: 2px dotted black) ', 'login-customizer' ),
298
- 'section' => 'logincust_form_section',
299
- 'priority' => 30,
300
- 'settings' => 'logincust_form_border',
301
- )
302
- );
303
-
304
- $wp_customize->add_setting(
305
- 'logincust_field_width', array(
306
- 'default' => '100%',
307
- 'type' => 'option',
308
- 'capability' => 'edit_theme_options',
309
- )
310
- );
311
-
312
- $wp_customize->add_control(
313
- 'logincust_field_width', array(
314
- 'label' => __( 'Input Field Width', 'login-customizer' ),
315
- 'section' => 'logincust_field_section',
316
- 'priority' => 5,
317
- 'settings' => 'logincust_field_width',
318
- )
319
- );
320
-
321
- $wp_customize->add_setting(
322
- 'logincust_field_margin', array(
323
- 'default' => '2px 6px 16px 0px',
324
- 'type' => 'option',
325
- 'capability' => 'edit_theme_options',
326
- )
327
- );
328
-
329
- $wp_customize->add_control(
330
- 'logincust_field_margin', array(
331
- 'label' => __( 'Input Field Margin', 'login-customizer' ),
332
- 'section' => 'logincust_field_section',
333
- 'priority' => 10,
334
- 'settings' => 'logincust_field_margin',
335
- )
336
- );
337
-
338
- $wp_customize->add_setting(
339
- 'logincust_field_bg', array(
340
- 'default' => '#FFF',
341
- 'type' => 'option',
342
- 'capability' => 'edit_theme_options',
343
- )
344
- );
345
-
346
- $wp_customize->add_control(
347
- new WP_Customize_Color_Control(
348
- $wp_customize, 'logincust_field_bg', array(
349
- 'label' => __( 'Input Field Background', 'login-customizer' ),
350
- 'section' => 'logincust_field_section',
351
- 'priority' => 15,
352
- 'settings' => 'logincust_field_bg',
353
- )
354
- )
355
- );
356
-
357
- $wp_customize->add_setting(
358
- 'logincust_field_color', array(
359
- 'default' => '#333',
360
- 'type' => 'option',
361
- 'capability' => 'edit_theme_options',
362
- )
363
- );
364
-
365
- $wp_customize->add_control(
366
- new WP_Customize_Color_Control(
367
- $wp_customize, 'logincust_field_color', array(
368
- 'label' => __( 'Input Field Color', 'login-customizer' ),
369
- 'section' => 'logincust_field_section',
370
- 'priority' => 20,
371
- 'settings' => 'logincust_field_color',
372
- )
373
- )
374
- );
375
-
376
- $wp_customize->add_setting(
377
- 'logincust_field_label', array(
378
- 'default' => '#777',
379
- 'type' => 'option',
380
- 'capability' => 'edit_theme_options',
381
- )
382
- );
383
-
384
- $wp_customize->add_control(
385
- new WP_Customize_Color_Control(
386
- $wp_customize, 'logincust_field_label', array(
387
- 'label' => __( 'Label Color', 'login-customizer' ),
388
- 'section' => 'logincust_field_section',
389
- 'priority' => 25,
390
- 'settings' => 'logincust_field_label',
391
- )
392
- )
393
- );
394
-
395
- $wp_customize->add_setting(
396
- 'logincust_button_bg', array(
397
- 'default' => '#2EA2CC',
398
- 'type' => 'option',
399
- 'capability' => 'edit_theme_options',
400
- )
401
- );
402
-
403
- $wp_customize->add_control(
404
- new WP_Customize_Color_Control(
405
- $wp_customize, 'logincust_button_bg', array(
406
- 'label' => __( 'Button Background', 'login-customizer' ),
407
- 'section' => 'logincust_button_section',
408
- 'priority' => 5,
409
- 'settings' => 'logincust_button_bg',
410
- )
411
- )
412
- );
413
-
414
- $wp_customize->add_setting(
415
- 'logincust_button_border', array(
416
- 'default' => '#0074A2',
417
- 'type' => 'option',
418
- 'capability' => 'edit_theme_options',
419
- )
420
- );
421
-
422
- $wp_customize->add_control(
423
- new WP_Customize_Color_Control(
424
- $wp_customize, 'logincust_button_border', array(
425
- 'label' => __( 'Button Border', 'login-customizer' ),
426
- 'section' => 'logincust_button_section',
427
- 'priority' => 10,
428
- 'settings' => 'logincust_button_border',
429
- )
430
- )
431
- );
432
-
433
- $wp_customize->add_setting(
434
- 'logincust_button_hover_bg', array(
435
- 'default' => '#1E8CBE',
436
- 'type' => 'option',
437
- 'capability' => 'edit_theme_options',
438
- )
439
- );
440
-
441
- $wp_customize->add_control(
442
- new WP_Customize_Color_Control(
443
- $wp_customize, 'logincust_button_hover_bg', array(
444
- 'label' => __( 'Button Background (Hover)', 'login-customizer' ),
445
- 'section' => 'logincust_button_section',
446
- 'priority' => 15,
447
- 'settings' => 'logincust_button_hover_bg',
448
- )
449
- )
450
- );
451
-
452
- $wp_customize->add_setting(
453
- 'logincust_button_hover_border', array(
454
- 'default' => '#0074A2',
455
- 'type' => 'option',
456
- 'capability' => 'edit_theme_options',
457
- )
458
- );
459
-
460
- $wp_customize->add_control(
461
- new WP_Customize_Color_Control(
462
- $wp_customize, 'logincust_button_hover_border', array(
463
- 'label' => __( 'Button Border (Hover)', 'login-customizer' ),
464
- 'section' => 'logincust_button_section',
465
- 'priority' => 20,
466
- 'settings' => 'logincust_button_hover_border',
467
- )
468
- )
469
- );
470
-
471
- $wp_customize->add_setting(
472
- 'logincust_button_shadow', array(
473
- 'default' => '#78C8E6',
474
- 'type' => 'option',
475
- 'capability' => 'edit_theme_options',
476
- )
477
- );
478
-
479
- $wp_customize->add_control(
480
- new WP_Customize_Color_Control(
481
- $wp_customize, 'logincust_button_shadow', array(
482
- 'label' => __( 'Button Box Shadow', 'login-customizer' ),
483
- 'section' => 'logincust_button_section',
484
- 'priority' => 25,
485
- 'settings' => 'logincust_button_shadow',
486
- )
487
- )
488
- );
489
-
490
- $wp_customize->add_setting(
491
- 'logincust_button_color', array(
492
- 'default' => '#FFF',
493
- 'type' => 'option',
494
- 'capability' => 'edit_theme_options',
495
- )
496
- );
497
-
498
- $wp_customize->add_control(
499
- new WP_Customize_Color_Control(
500
- $wp_customize, 'logincust_button_color', array(
501
- 'label' => __( 'Button Color', 'login-customizer' ),
502
- 'section' => 'logincust_button_section',
503
- 'priority' => 30,
504
- 'settings' => 'logincust_button_color',
505
- )
506
- )
507
- );
508
-
509
- $wp_customize->add_setting(
510
- 'logincust_other_color', array(
511
- 'default' => '#999',
512
- 'type' => 'option',
513
- 'capability' => 'edit_theme_options',
514
- )
515
- );
516
-
517
- $wp_customize->add_control(
518
- new WP_Customize_Color_Control(
519
- $wp_customize, 'logincust_other_color', array(
520
- 'label' => __( 'Text Color', 'login-customizer' ),
521
- 'section' => 'logincust_other_section',
522
- 'priority' => 5,
523
- 'settings' => 'logincust_other_color',
524
- )
525
- )
526
- );
527
-
528
- $wp_customize->add_setting(
529
- 'logincust_other_color_hover', array(
530
- 'default' => '#2EA2CC',
531
- 'type' => 'option',
532
- 'capability' => 'edit_theme_options',
533
- )
534
- );
535
-
536
- $wp_customize->add_control(
537
- new WP_Customize_Color_Control(
538
- $wp_customize, 'logincust_other_color_hover', array(
539
- 'label' => __( 'Text Color (Hover)', 'login-customizer' ),
540
- 'section' => 'logincust_other_section',
541
- 'priority' => 10,
542
- 'settings' => 'logincust_other_color_hover',
543
- )
544
- )
545
- );
546
-
547
- $wp_customize->add_setting(
548
- 'logincust_other_css', array(
549
- 'type' => 'option',
550
- 'capability' => 'edit_theme_options',
551
- )
552
- );
553
-
554
- $wp_customize->add_control(
555
- 'logincust_other_css', array(
556
- 'label' => __( 'Custom CSS', 'login-customizer' ),
557
- 'type' => 'textarea',
558
- 'section' => 'logincust_other_section',
559
- 'priority' => 15,
560
- 'settings' => 'logincust_other_css',
561
- )
562
- );
563
-
564
- }
565
- add_action( 'customize_register', 'logincust_customize_register' );
566
-
567
- function logincust_customizer() {
568
- $logo_url = get_option( 'logincust_logo' );
569
- $logo_width = get_option( 'logincust_logo_width' );
570
- $logo_height = get_option( 'logincust_logo_height' );
571
- $logo_padding = get_option( 'logincust_logo_padding' );
572
- $bg_img = get_option( 'logincust_bg_image' );
573
- $bg_color = get_option( 'logincust_bg_color' );
574
- $bg_size = get_option( 'logincust_bg_size' );
575
- $form_bg_image = get_option( 'logincust_form_bg_image' );
576
- $form_bg_color = get_option( 'logincust_form_bg_color' );
577
- $form_width = get_option( 'logincust_form_width' );
578
- $form_height = get_option( 'logincust_form_height' );
579
- $form_padding = get_option( 'logincust_form_padding' );
580
- $form_border = get_option( 'logincust_form_border' );
581
- $field_width = get_option( 'logincust_field_width' );
582
- $field_margin = get_option( 'logincust_field_margin' );
583
- $field_bg = get_option( 'logincust_field_bg' );
584
- $field_color = get_option( 'logincust_field_color' );
585
- $field_label = get_option( 'logincust_field_label' );
586
- $button_bg = get_option( 'logincust_button_bg' );
587
- $button_border = get_option( 'logincust_button_border' );
588
- $button_shadow = get_option( 'logincust_button_shadow' );
589
- $button_color = get_option( 'logincust_button_color' );
590
- $button_hover_bg = get_option( 'logincust_button_hover_bg' );
591
- $button_hover_border = get_option( 'logincust_button_hover_border' );
592
- $other_color = get_option( 'logincust_other_color' );
593
- $other_color_hover = get_option( 'logincust_other_color_hover' );
594
- $other_css = get_option( 'logincust_other_css' );
595
- ?>
596
- <style type="text/css">
597
- html, body {
598
- <?php if ( ! empty( $bg_img ) ) : ?>
599
- background-image: url(<?php echo $bg_img; ?>) !important;
600
- <?php endif; ?>
601
- <?php if ( ! empty( $bg_color ) ) : ?>
602
- background-color: <?php echo $bg_color; ?> !important;
603
- <?php endif; ?>
604
- <?php if ( ! empty( $bg_url ) ) : ?>
605
- background-size: <?php echo $bg_size; ?> !important;
606
- <?php endif; ?>
607
- }
608
- body.login div#login h1 a {
609
- <?php if ( ! empty( $logo_url ) ) : ?>
610
- background-image: url(<?php echo $logo_url; ?>) !important;
611
- <?php endif; ?>
612
- <?php if ( ! empty( $logo_width ) ) : ?>
613
- width: <?php echo $logo_width; ?> !important;
614
- <?php endif; ?>
615
- <?php if ( ! empty( $logo_height ) ) : ?>
616
- height: <?php echo $logo_height; ?> !important;
617
- <?php endif; ?>
618
- <?php if ( ! empty( $logo_width ) || ! empty( $logo_height ) ) : ?>
619
- background-size: <?php echo $logo_width; ?> <?php echo $logo_height; ?> !important;
620
- <?php endif; ?>
621
- <?php if ( ! empty( $logo_padding ) ) : ?>
622
- padding-bottom: <?php echo $logo_padding; ?> !important;
623
- <?php endif; ?>
624
- }
625
- #loginform {
626
- <?php if ( ! empty( $form_bg_image ) ) : ?>
627
- background-image: url(<?php echo $form_bg_image; ?>) !important;
628
- <?php endif; ?>
629
- <?php if ( ! empty( $form_bg_color ) ) : ?>
630
- background-color: <?php echo $form_bg_color; ?> !important;
631
- <?php endif; ?>
632
- <?php if ( ! empty( $form_height ) ) : ?>
633
- height: <?php echo $form_height; ?> !important;
634
- <?php endif; ?>
635
- <?php if ( ! empty( $form_padding ) ) : ?>
636
- padding: <?php echo $form_padding; ?> !important;
637
- <?php endif; ?>
638
- <?php if ( ! empty( $form_border ) ) : ?>
639
- border: <?php echo $form_border; ?> !important;
640
- <?php endif; ?>
641
- }
642
- #login {
643
- <?php if ( ! empty( $form_width ) ) : ?>
644
- width: <?php echo $form_width; ?> !important;
645
- <?php endif; ?>
646
- }
647
- .login form .input, .login input[type="text"] {
648
- <?php if ( ! empty( $field_width ) ) : ?>
649
- width: <?php echo $field_width; ?> !important;
650
- <?php endif; ?>
651
- <?php if ( ! empty( $field_margin ) ) : ?>
652
- margin: <?php echo $field_margin; ?> !important;
653
- <?php endif; ?>
654
- <?php if ( ! empty( $field_bg ) ) : ?>
655
- background: <?php echo $field_bg; ?> !important;
656
- <?php endif; ?>
657
- <?php if ( ! empty( $field_color ) ) : ?>
658
- color: <?php echo $field_color; ?> !important;
659
- <?php endif; ?>
660
- }
661
- .login label {
662
- <?php if ( ! empty( $field_label ) ) : ?>
663
- color: <?php echo $field_label; ?> !important;
664
- <?php endif; ?>
665
- }
666
- .wp-core-ui .button-primary {
667
- <?php if ( ! empty( $button_bg ) ) : ?>
668
- background: <?php echo $button_bg; ?> !important;
669
- <?php endif; ?>
670
- <?php if ( ! empty( $button_border ) ) : ?>
671
- border-color: <?php echo $button_border; ?> !important;
672
- <?php endif; ?>
673
- <?php if ( ! empty( $button_shadow ) ) : ?>
674
- box-shadow: 0px 1px 0px <?php echo $button_shadow; ?> inset, 0px 1px 0px rgba(0, 0, 0, 0.15);
675
- <?php endif; ?>
676
- <?php if ( ! empty( $button_color ) ) : ?>
677
- color: <?php echo $button_color; ?> !important;
678
- <?php endif; ?>
679
- }
680
- .wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover {
681
- <?php if ( ! empty( $button_hover_bg ) ) : ?>
682
- background: <?php echo $button_hover_bg; ?> !important;
683
- <?php endif; ?>
684
- <?php if ( ! empty( $button_hover_border ) ) : ?>
685
- border-color: <?php echo $button_hover_border; ?> !important;
686
- <?php endif; ?>
687
- }
688
- .login #backtoblog a, .login #nav a {
689
- <?php if ( ! empty( $other_color ) ) : ?>
690
- color: <?php echo $other_color; ?> !important;
691
- <?php endif; ?>
692
- }
693
- .login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover {
694
- <?php if ( ! empty( $other_color_hover ) ) : ?>
695
- color: <?php echo $other_color_hover; ?> !important;
696
- <?php endif; ?>
697
- }
698
- <?php if ( ! empty( $other_css ) ) : ?>
699
- <?php echo $other_css; ?>
700
- <?php endif; ?>
701
- </style>
702
- <?php
703
- }
704
-
705
- add_action( 'login_enqueue_scripts', 'logincust_customizer' );
706
-
707
- function logincust_login_logo_url() {
708
- return get_bloginfo( 'url' );
709
- }
710
- add_filter( 'login_headerurl', 'logincust_login_logo_url' );
711
-
712
- function logincust_login_logo_url_title() {
713
- $title = get_bloginfo( 'name', 'display' );
714
- return $title;
715
- }
716
- add_filter( 'login_headertitle', 'logincust_login_logo_url_title' );
717
-
718
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/controls/alpha/alpha-control.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Alpha Color Picker Customizer Control
4
+ *
5
+ * This control adds a second slider for opacity to the stock WordPress color picker,
6
+ * and it includes logic to seamlessly convert between RGBa and Hex color values as
7
+ * opacity is added to or removed from a color.
8
+ *
9
+ * This Alpha Color Picker is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this Alpha Color Picker. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+
23
+ if ( ! function_exists( 'logincust_alpha_control' ) ) :
24
+
25
+ function logincust_alpha_control( $wp_customize ) {
26
+ class LoginCust_Customize_Alpha_Color_Control extends WP_Customize_Control {
27
+
28
+ public $type = 'alphacolor';
29
+ public $palette = true;
30
+ public $default = array();
31
+
32
+ public function to_json() {
33
+ if ( ! empty( $this->setting->default ) ) {
34
+ $this->json['default'] = $this->setting->default;
35
+ } else {
36
+ $this->json['default'] = false;
37
+ }
38
+ parent::to_json();
39
+ }
40
+
41
+ public function enqueue() {
42
+ wp_enqueue_script( 'logincust-alpha', LOGINCUST_FREE_URL . 'inc/customizer/controls/alpha/assets/js/alpha-control.js', array( 'jquery' ), null, true );
43
+ wp_enqueue_style( 'logincust-alpha', LOGINCUST_FREE_URL . 'inc/customizer/controls/alpha/assets/css/alpha-control.css' );
44
+ }
45
+
46
+ public function render_content() {
47
+ ?>
48
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
49
+ <span class="customize-control-description"><?php echo esc_html( $this->description ); ?></span>
50
+ <label>
51
+ <input type="text" data-palette="<?php echo $this->palette; ?>" data-default-color="<?php echo $this->setting->default; ?>" value="<?php echo intval( $this->value() ); ?>" class="logincust-color-control" <?php $this->link(); ?> />
52
+ </label>
53
+ <?php
54
+ }
55
+ }
56
+ }
57
+ add_action( 'customize_register', 'logincust_alpha_control' );
58
+
59
+ endif;
inc/customizer/controls/alpha/assets/css/alpha-control.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .logincust-alpha-container .transparency {
2
+ width: 100%;
3
+ height: 24px;
4
+ padding: 0;
5
+ border-radius: 3px;
6
+ background-color: #fff;
7
+ background-image: url(../../assets/img/transparency-grid.png);
8
+ box-shadow: 0 0 5px rgba(0,0,0,0.4) inset;
9
+ }
10
+
11
+ .logincust-alpha-container .ui-slider-handle {
12
+ position: absolute;
13
+ z-index: 2;
14
+ height: 20px;
15
+ margin-top: -2px;
16
+ padding: 3px;
17
+ border: 1px solid #aaa;
18
+ border-radius: 4px;
19
+ opacity: 0.9;
20
+ color: #777;
21
+ background-color: #fff;
22
+ box-shadow: 0 1px 2px rgba(0,0,0,0.2);
23
+ text-shadow: 0 1px 0 #fff;
24
+ font-size: 12px;
25
+ text-decoration: none;
26
+ cursor: ew-resize;
27
+ }
28
+
29
+ .logincust-alpha-container .ui-slider {
30
+ position: relative;
31
+ width: 88%;
32
+ text-align: center;
33
+ }
34
+
35
+ .wp-picker-container button.wp-picker-open ~ div.logincust-alpha-container {
36
+ display: block;
37
+ }
38
+
39
+ .logincust-alpha-container {
40
+ display: none;
41
+ box-sizing: padding-box;
42
+ width: 233px;
43
+ padding: 0 11px 6px;
44
+ border: 1px solid #dfdfdf;
45
+ border-top: none;
46
+ background: #fff;
47
+ }
48
+
49
+ .customize-control-alphacolor .wp-picker-container .iris-picker {
50
+ border-bottom: none;
51
+ }
inc/customizer/controls/alpha/assets/img/transparency-grid.png ADDED
Binary file
inc/customizer/controls/alpha/assets/js/alpha-control.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global Color */
2
+
3
+ jQuery(document).ready(function($) {
4
+
5
+ Color.prototype.toString = function(remove_alpha) {
6
+ if (remove_alpha === 'no-alpha') {
7
+ return this.toCSS('rgba', '1').replace(/\s+/g, '');
8
+ }
9
+ if (this._alpha < 1) {
10
+ return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
11
+ }
12
+ var hex = parseInt(this._color, 10).toString(16);
13
+ if (this.error) {
14
+ return '';
15
+ }
16
+ if (hex.length < 6) {
17
+ for (var i = 6 - hex.length - 1; i >= 0; i--) {
18
+ hex = '0' + hex;
19
+ }
20
+ }
21
+ return '#' + hex;
22
+ };
23
+
24
+ $('.logincust-color-control').each(function() {
25
+ var $control = $(this),
26
+ value = $control.val().replace(/\s+/g, '');
27
+ // Manage Palettes
28
+ var palette_input = $control.attr('data-palette');
29
+ var palette = '';
30
+ if (palette_input === '0') {
31
+ palette = false;
32
+ } else if (palette_input === '1') {
33
+ palette = true;
34
+ } else {
35
+ palette = $control.attr('data-palette').split(',');
36
+ }
37
+ $control.wpColorPicker({ // change some things with the color picker
38
+ // clear: function(event, ui) {
39
+ // TODO reset Alpha Slider to 100
40
+ // },
41
+ change: function(event, ui) {
42
+ // send ajax request to wp.customizer to enable Save & Publish button
43
+ var _new_value = $control.val();
44
+ var key = $control.attr('data-customize-setting-link');
45
+ wp.customize(key, function(obj) {
46
+ obj.set(_new_value);
47
+ });
48
+ // change the background color of our transparency container whenever a color is updated
49
+ var $transparency = $control.parents('.wp-picker-container:first').find('.transparency');
50
+ // we only want to show the color at 100% alpha
51
+ $transparency.css('backgroundColor', ui.color.toString('no-alpha'));
52
+ },
53
+ palettes: palette // remove the color palettes
54
+ });
55
+ $('<div class="logincust-alpha-container"><div class="slider-alpha"></div><div class="transparency"></div></div>').appendTo($control.parents('.wp-picker-container'));
56
+ var $alpha_slider = $control.parents('.wp-picker-container:first').find('.slider-alpha');
57
+ // if in format RGBA - grab A channel value
58
+ var alpha_val = '';
59
+ if (value.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)) {
60
+ alpha_val = parseFloat(value.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)[1]) * 100;
61
+ alpha_val = parseInt(alpha_val);
62
+ } else {
63
+ alpha_val = 100;
64
+ }
65
+ $alpha_slider.slider({
66
+ slide: function(event, ui) {
67
+ $(this).find('.ui-slider-handle').text(ui.value); // show value on slider handle
68
+ // send ajax request to wp.customizer to enable Save & Publish button
69
+ var _new_value = $control.val();
70
+ var key = $control.attr('data-customize-setting-link');
71
+ wp.customize(key, function(obj) {
72
+ obj.set(_new_value);
73
+ });
74
+ },
75
+ create: function() {
76
+ var v = $(this).slider('value');
77
+ $(this).find('.ui-slider-handle').text(v);
78
+ },
79
+ value: alpha_val,
80
+ range: 'max',
81
+ step: 1,
82
+ min: 1,
83
+ max: 100
84
+ }); // slider
85
+ $alpha_slider.slider().on('slidechange', function(event, ui) {
86
+ var new_alpha_val = parseFloat(ui.value),
87
+ iris = $control.data('a8cIris'),
88
+ color_picker = $control.data('wpWpColorPicker');
89
+ iris._color._alpha = new_alpha_val / 100.0;
90
+ $control.val(iris._color.toString());
91
+ color_picker.toggler.css({
92
+ backgroundColor: $control.val()
93
+ });
94
+ // fix relationship between alpha slider and the 'side slider not updating.
95
+ var get_val = $control.val();
96
+ $($control).wpColorPicker('color', get_val);
97
+ });
98
+ }); // each
99
+
100
+ });
inc/customizer/controls/cool-stuff/assets/css/cool-stuff-control.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .logincust-submit-mail {
2
+ width: auto;
3
+ margin-bottom: 10px;
4
+ padding: 10px;
5
+ background: #fff;
6
+ }
inc/customizer/controls/cool-stuff/cool-stuff-control.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Sendinblue Subscription Box
3
+
4
+ if ( ! function_exists( 'logincust_more_cool_stuff_control' ) ) :
5
+
6
+ function logincust_more_cool_stuff_control( $wp_customize ) {
7
+ class Logincust_Cool_Stuff_Control extends WP_Customize_Control {
8
+
9
+ public function enqueue() {
10
+ wp_enqueue_style( 'logincust-cool', LOGINCUST_FREE_URL . 'inc/customizer/controls/cool-stuff/assets/css/cool-stuff-control.css' );
11
+ }
12
+
13
+ public function render_content() {
14
+ if ( ! empty( $_POST['logincust_mail'] ) ) {
15
+ $was_submited = get_option( 'logincust_mail_was_submited', false );
16
+ $user_info = get_userdata( 1 );
17
+ $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
18
+ $data = array(
19
+ 'email' => $_POST['logincust_mail'],
20
+ 'attributes' => array('NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name),
21
+ 'blacklisted' => 0,
22
+ 'listid' => array(34),
23
+ 'blacklisted_sms' => 0,
24
+ );
25
+ $status = $mailin->create_update_user( $data );
26
+ if ( $status['code'] == 'success' ) {
27
+ if ( empty( $was_submited ) ) {
28
+ add_option( 'logincust_mail_was_submited', true );
29
+ }
30
+ }
31
+ }
32
+ $was_submited = get_option( 'logincust_mail_was_submited', false );
33
+ if ( $was_submited === false ) {
34
+ echo sprintf(
35
+ '<form class="logincust-submit-mail" method="post"><p> %s </p><input name="logincust_mail" type="email" class="wp-pointer-input" value="' . get_option( 'admin_email' ) . '" /><input class="button wp-pointer-submit" type="submit" value="Submit"></form>',
36
+ esc_html__( 'Our free, 4-lesson course on how to make your WordPress site run incredibly fast is barely waiting for its students. Ready to learn how to reduce your loading times by half? Come and join the 1st lesson here!', 'login-customizer' )
37
+ );
38
+ } else {
39
+ echo sprintf(
40
+ '<p class="logincust-submit-mail">%s</p>',
41
+ esc_html__( 'Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the Unsubscribe link included in each newsletter.', 'login-customizer' )
42
+ );
43
+ }
44
+ echo '<a href="https://themeisle.com/plugins/orbit-fox-companion/" target="_blank"><img src="' . LOGINCUST_FREE_URL . 'assets/orbit-fox.png" /></a>';
45
+ }
46
+
47
+ }
48
+ }
49
+ add_action( 'customize_register', 'logincust_more_cool_stuff_control' );
50
+
51
+ endif;
inc/customizer/controls/padding/assets/css/padding-control.css ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .customize-control-logincust-padding .field-area {
2
+ width: 100%;
3
+ }
4
+
5
+ .customize-control-logincust-padding .field-icon {
6
+ display: inline-table;
7
+ width: 20%;
8
+ }
9
+
10
+ .customize-control-logincust-padding input[type=number] {
11
+ width: 25%;
12
+ }
13
+
14
+ .customize-control-logincust-padding input[type=text] {
15
+ display: none;
16
+ }
inc/customizer/controls/padding/assets/js/padding-control.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wp.customize.controlConstructor['logincust-padding'] = wp.customize.Control.extend({
2
+
3
+ ready: function() {
4
+ 'use strict';
5
+
6
+ var control = this,
7
+ value = control.setting._value,
8
+ fields = control.container.find( 'input[type=number]' );
9
+ var values = value.split( ' ' );
10
+ fields = Array.from( fields );
11
+
12
+ if ( values.length === 1 ) {
13
+ fields.forEach( function( field ) {
14
+ field.value = parseInt( values[0] );
15
+ });
16
+ } else if ( values.length === 2 ) {
17
+ fields[0].value = parseInt( values[0] );
18
+ fields[1].value = parseInt( values[1] );
19
+ fields[2].value = parseInt( values[0] );
20
+ fields[3].value = parseInt( values[1] );
21
+ } else if ( values.length === 3 ) {
22
+ fields[0].value = parseInt( values[0] );
23
+ fields[1].value = parseInt( values[1] );
24
+ fields[2].value = parseInt( values[2] );
25
+ fields[3].value = parseInt( values[1] );
26
+ } else if ( values.length === 4 ) {
27
+ fields[0].value = parseInt( values[0] );
28
+ fields[1].value = parseInt( values[1] );
29
+ fields[2].value = parseInt( values[2] );
30
+ fields[3].value = parseInt( values[3] );
31
+ }
32
+
33
+ fields.forEach( function( field ) {
34
+ field.oninput = function() {
35
+ control.setting.set( fields[0].value + 'px ' + fields[1].value + 'px ' + fields[2].value + 'px ' + fields[3].value + 'px' );
36
+ };
37
+ });
38
+
39
+ }
40
+
41
+ });
inc/customizer/controls/padding/padding-control.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! function_exists( 'logincust_padding_control' ) ) :
4
+
5
+ function logincust_padding_control( $wp_customize ) {
6
+ class LoginCust_Padding_Control extends WP_Customize_Control {
7
+
8
+ public $type = 'logincust-padding';
9
+
10
+ public function enqueue() {
11
+ wp_enqueue_script( 'logincust-padding', LOGINCUST_FREE_URL . 'inc/customizer/controls/padding/assets/js/padding-control.js', '', '', true );
12
+ wp_enqueue_style( 'logincust-padding', LOGINCUST_FREE_URL . 'inc/customizer/controls/padding/assets/css/padding-control.css' );
13
+ }
14
+
15
+ public function render_content() {
16
+ ?>
17
+ <label>
18
+ <div id="<?php echo esc_attr( $this->id ); ?>">
19
+ <?php if ( ! empty( $this->label ) ) : ?>
20
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
21
+ <?php endif; ?>
22
+ <?php if ( ! empty( $this->description ) ) : ?>
23
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
24
+ <?php endif; ?>
25
+ <div class="field-area">
26
+ <div class="field-icon"><i class="dashicons dashicons-arrow-up"></i><?php _e( 'Top', 'login-customizer' ); ?></div>
27
+ <input type="number" value="10" min="0" max="1000" />
28
+ <div class="field-icon"><i class="dashicons dashicons-arrow-right"></i><?php _e( 'Right', 'login-customizer' ); ?></div>
29
+ <input type="number" value="10" min="0" max="1000" />
30
+ </div>
31
+ <div class="field-area">
32
+ <div class="field-icon"><i class="dashicons dashicons-arrow-down"></i><?php _e( 'Down', 'login-customizer' ); ?></div>
33
+ <input type="number" value="10" min="0" max="1000" />
34
+ <div class="field-icon"><i class="dashicons dashicons-arrow-left"></i><?php _e( 'Left', 'login-customizer' ); ?></div>
35
+ <input type="number" value="10" min="0" max="1000" />
36
+ </div>
37
+ <input type="text" value="<?php echo esc_html( $this->value() ); ?>" <?php $this->link(); ?> />
38
+ </div>
39
+ </label>
40
+ <?php
41
+ }
42
+
43
+ }
44
+ }
45
+ add_action( 'customize_register', 'logincust_padding_control' );
46
+
47
+ endif;
inc/customizer/controls/radio-images/assets/css/radio-images-control.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .customize-control-o2-radio-images label {
2
+ display: inline-block;
3
+ position: relative;
4
+ }
5
+
6
+ .customize-control-o2-radio-images input {
7
+ display: none;
8
+ }
9
+
10
+ .customize-control-o2-radio-images input img {
11
+ max-width: 250px !important;
12
+ border: 1px solid transparent;
13
+ }
14
+
15
+ .customize-control-o2-radio-images input:checked + label img {
16
+ border: 1px solid #3498db;
17
+ box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
18
+ }
19
+
20
+ .customize-control-o2-radio-images input + label .image-clickable {
21
+ position: absolute;
22
+ top: 0;
23
+ right: 0;
24
+ bottom: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ }
inc/customizer/controls/radio-images/radio-images-control.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Radio Images Customizer Control - O2 Customizer Library
4
+ *
5
+ * This control adds radio images to the Customizer which allows
6
+ * you to choose one of the listed images.
7
+ *
8
+ * Radio Buttonset is a part of O2 library, which is a
9
+ * free software: you can redistribute it and/or modify it under
10
+ * the terms of the GNU General Public License as published by the
11
+ * Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Radio Images
24
+ * @since 0.1
25
+ */
26
+ if ( ! function_exists( 'o2_add_radio_images_control' ) ) :
27
+
28
+ function o2_add_radio_images_control( $wp_customize ) {
29
+ class O2_Customizer_Radio_Images_Control extends WP_Customize_Control {
30
+
31
+ public $type = 'o2-radio-images';
32
+
33
+ public function enqueue() {
34
+ wp_enqueue_style( 'o2-radio-images', LOGINCUST_FREE_URL . 'inc/customizer/controls/radio-images/assets/css/radio-images-control.css' );
35
+ }
36
+
37
+ public function render_content() {
38
+ ?>
39
+ <label>
40
+ <?php if ( ! empty( $this->label ) ) : ?>
41
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
42
+ <?php endif; ?>
43
+ <?php if ( ! empty( $this->description ) ) : ?>
44
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
45
+ <?php endif; ?>
46
+ <div id="input_<?php echo esc_attr( $this->id ); ?>" class="image">
47
+ <?php foreach ( $this->choices as $value => $label ) : ?>
48
+ <input class="image-select" type="radio" value="<?php echo esc_attr( $value ); ?>" name="_customize-radio-<?php echo esc_attr( $this->id ); ?>" id="<?php echo esc_attr( $this->id ); ?><?php echo esc_attr( $value ); ?>" <?php $this->link(); ?> <?php checked( $this->value(), $value ); ?> >
49
+ <label for="<?php echo esc_attr( $this->id ); ?><?php echo esc_attr( $value ); ?>">
50
+ <img src="<?php echo esc_attr( $label ); ?>">
51
+ <span class="image-clickable"></span>
52
+ </label>
53
+ </input>
54
+ <?php endforeach; ?>
55
+ </div>
56
+ </label>
57
+ <?php
58
+ }
59
+
60
+ }
61
+ }
62
+ add_action( 'customize_register', 'o2_add_radio_images_control' );
63
+
64
+ endif;
inc/customizer/controls/range-slider/assets/css/range-slider-control.css ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .o2-range-slider {
2
+ width: 100%;
3
+ }
4
+
5
+ .o2-range-slider-range::-moz-range-track,
6
+ .o2-range-slider-range::-moz-focus-inner,
7
+ .o2-range-slider-range::-moz-focus-outer {
8
+ border: 0;
9
+ background: #d7dcdf;
10
+ }
11
+
12
+ .o2-range-slider-range {
13
+ width: -webkit-calc(100% - (100px));
14
+ width: calc(100% - (100px));
15
+ height: 10px;
16
+ margin: 0;
17
+ padding: 0;
18
+ border-radius: 5px;
19
+ outline: none;
20
+ background: #d7dcdf;
21
+
22
+ -webkit-appearance: none;
23
+ }
24
+
25
+ .o2-range-slider-range::-webkit-slider-thumb {
26
+ width: 20px;
27
+ height: 20px;
28
+ border-radius: 50%;
29
+ background: #0085ba;
30
+ cursor: pointer;
31
+ -webkit-transition: background 0.15s ease-in-out;
32
+ transition: background 0.15s ease-in-out;
33
+
34
+ -webkit-appearance: none;
35
+ appearance: none;
36
+ }
37
+
38
+ .o2-range-slider-range::-webkit-slider-thumb:hover {
39
+ background: #0071a8;
40
+ }
41
+
42
+ .o2-range-slider-range:active::-webkit-slider-thumb {
43
+ background: #0071a8;
44
+ }
45
+
46
+ .o2-range-slider-range::-moz-range-thumb {
47
+ width: 20px;
48
+ height: 20px;
49
+ border: 0;
50
+ border-radius: 50%;
51
+ background: #0085ba;
52
+ cursor: pointer;
53
+ -webkit-transition: background 0.15s ease-in-out;
54
+ transition: background 0.15s ease-in-out;
55
+ }
56
+
57
+ .o2-range-reset-slider .dashicons {
58
+ width: 16px;
59
+ height: 16px;
60
+ font-size: 16px;
61
+ line-height: 1;
62
+ }
63
+
64
+ .o2-range-reset-slider {
65
+ display: inline-block;
66
+ position: relative;
67
+ width: 6%;
68
+ color: rgba(0,0,0,0.2);
69
+ line-height: 1;
70
+ text-align: center;
71
+ cursor: pointer;
72
+ -webkit-transition: all 0.3s ease;
73
+ transition: all 0.3s ease;
74
+ }
75
+
76
+ .o2-range-reset-slider:hover {
77
+ color: #fe5252;
78
+ }
79
+
80
+ .o2-range-slider-range::-moz-range-thumb:hover {
81
+ background: #0071a8;
82
+ }
83
+
84
+ .o2-range-slider-range:active::-moz-range-thumb {
85
+ background: #0071a8;
86
+ }
87
+
88
+ input[type="number"].o2-range-slider-value {
89
+ display: inline-block;
90
+ position: relative;
91
+ width: 60px;
92
+ margin-left: 8px;
93
+ padding: 5px 10px;
94
+ border-radius: 3px;
95
+ line-height: 20px;
96
+ text-align: center;
97
+ }
98
+
99
+ input[type=radio].o2-range-slider-buttonset {
100
+ display: none;
101
+ }
102
+
103
+ input[type=radio]:checked.o2-range-slider-buttonset + label {
104
+ border-color: #999;
105
+ background: #eee;
106
+ box-shadow: inset 0 2px 5px -3px rgba(0,0,0,0.5);
107
+ -webkit-transform: translateY(1px);
108
+ -ms-transform: translateY(1px);
109
+ transform: translateY(1px);
110
+ }
111
+
112
+ .customize-control-o2-range-slider .button-group {
113
+ white-space: normal;
114
+ }
115
+
116
+ .customize-control-o2-range-slider .button-group .button {
117
+ font-size: 10px;
118
+ }
inc/customizer/controls/range-slider/assets/js/range-slider-control.js ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wp.customize.controlConstructor['o2-range-slider'] = wp.customize.Control.extend({
2
+
3
+ ready: function() {
4
+ 'use strict';
5
+
6
+ var control = this,
7
+ size = 'px',
8
+ slider = control.container.find( '.o2-range-slider-range' ),
9
+ output = control.container.find( '.o2-range-slider-value' ),
10
+ maxattr = control.params.max,
11
+ minattr = control.params.min,
12
+ currentSize = control.setting._value.replace(/[0-9]/g, ''),
13
+ buttonset = '';
14
+
15
+ if ( control.params.percent !== false ) {
16
+ buttonset = control.container.find( '.o2-range-slider-buttonset' );
17
+ }
18
+
19
+ if ( control.params.percent !== false ) {
20
+ if ( currentSize === 'px' ) {
21
+ buttonset[0].checked = true;
22
+ slider[0].attributes.min.value = minattr;
23
+ slider[0].attributes.max.value = maxattr;
24
+ } else if ( currentSize === '%' ) {
25
+ buttonset[1].checked = true;
26
+ slider[0].attributes.min.value = 0;
27
+ slider[0].attributes.max.value = 100;
28
+ }
29
+ }
30
+
31
+ slider[0].oninput = function() {
32
+ if ( control.params.percent !== false ) {
33
+ buttonset.forEach( function( button ) {
34
+ if ( button.checked ) {
35
+ size = button.value;
36
+ }
37
+ });
38
+ }
39
+ output[0].value = this.value;
40
+ control.setting.set( this.value + size );
41
+ };
42
+
43
+ output[0].oninput = function() {
44
+ if ( control.params.percent !== false ) {
45
+ buttonset.forEach( function( button ) {
46
+ if ( button.checked ) {
47
+ size = button.value;
48
+ }
49
+ });
50
+ }
51
+ slider[0].value = this.value;
52
+ control.setting.set( this.value + size );
53
+ };
54
+
55
+ if ( control.params.percent !== false ) {
56
+ buttonset = Array.from( buttonset);
57
+ }
58
+
59
+ if ( control.params.percent !== false ) {
60
+ buttonset.forEach( function( button ) {
61
+ button.onclick = function() {
62
+ if ( button.value === 'px' ) {
63
+ slider[0].attributes.min.value = minattr;
64
+ slider[0].attributes.max.value = maxattr;
65
+ } else if ( button.value === '%' ) {
66
+ slider[0].attributes.min.value = 0;
67
+ slider[0].attributes.max.value = 100;
68
+ }
69
+ control.setting.set( parseInt( control.setting._value ) + button.value );
70
+ };
71
+ });
72
+ }
73
+
74
+ if ( control.params.default !== false ) {
75
+ var reset = control.container.find( '.o2-range-reset-slider' );
76
+ var defaultSize = control.params.default.replace(/[0-9]/g, '');
77
+
78
+ reset[0].onclick = function() {
79
+ control.setting.set( control.params.default );
80
+ slider[0].value = parseInt( control.params.default );
81
+ output[0].value = parseInt( control.params.default );
82
+ if ( control.params.percent !== false ) {
83
+ if ( defaultSize === 'px' ) {
84
+ buttonset[0].click();
85
+ } else if ( defaultSize === '%' ) {
86
+ buttonset[1].click();
87
+ }
88
+ }
89
+ };
90
+ } else {
91
+ if ( control.params.percent !== false ) {
92
+ buttonset[0].checked = true;
93
+ }
94
+ }
95
+ }
96
+
97
+ });
inc/customizer/controls/range-slider/range-slider-control.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Range Slider Customizer Control - Modified version of O2 Customizer Library
4
+ *
5
+ * This control adds range slider to the Customizer which allows
6
+ * you to choose number from a range slider.
7
+ *
8
+ * Radio Buttonset is a part of O2 library, which is a
9
+ * free software: you can redistribute it and/or modify it under
10
+ * the terms of the GNU General Public License as published by the
11
+ * Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Range Slider
24
+ * @since 0.1
25
+ */
26
+ if ( ! function_exists( 'o2_add_range_slider_control' ) ) :
27
+
28
+ function o2_add_range_slider_control( $wp_customize ) {
29
+ class O2_Customizer_Range_Slider_Control extends WP_Customize_Control {
30
+
31
+ public $type = 'o2-range-slider';
32
+
33
+ public function to_json() {
34
+ if ( ! empty( $this->setting->default ) ) {
35
+ $this->json['default'] = $this->setting->default;
36
+ } else {
37
+ $this->json['default'] = false;
38
+ }
39
+ if ( ! empty( $this->input_attrs ) ) {
40
+ $this->json['max'] = $this->input_attrs['max'];
41
+ $this->json['min'] = $this->input_attrs['min'];
42
+ } else {
43
+ $this->json['max'] = 1000;
44
+ $this->json['min'] = 0;
45
+ }
46
+ if ( isset( $this->choices['percent'] ) ) {
47
+ $this->json['percent'] = $this->choices['percent'];
48
+ } else {
49
+ $this->json['percent'] = false;
50
+ }
51
+ parent::to_json();
52
+ }
53
+
54
+ public function enqueue() {
55
+ wp_enqueue_script( 'o2-range-slider', LOGINCUST_FREE_URL . 'inc/customizer/controls/range-slider/assets/js/range-slider-control.js', array( 'jquery' ), '', true );
56
+ wp_enqueue_style( 'o2-range-slider', LOGINCUST_FREE_URL . 'inc/customizer/controls/range-slider/assets/css/range-slider-control.css' );
57
+ }
58
+
59
+ public function render_content() {
60
+ ?>
61
+ <div>
62
+ <?php if ( ! empty( $this->label ) ) : ?>
63
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?>
64
+ <?php if ( isset( $this->choices['percent'] ) && ( $this->choices['percent'] !== false ) ) : ?>
65
+ <div class="button-group" data-setting="align">
66
+ <input type="radio" class="o2-range-slider-buttonset" id="px-<?php echo esc_attr( $this->id ); ?>" name="<?php echo esc_attr( $this->id ); ?>" value="px" />
67
+ <label class="button" for="px-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'px', 'login-customizer' ); ?></label>
68
+ <input type="radio" class="o2-range-slider-buttonset" id="percent-<?php echo esc_attr( $this->id ); ?>" name="<?php echo esc_attr( $this->id ); ?>" value="%" />
69
+ <label class="button" for="percent-<?php echo esc_attr( $this->id ); ?>"><?php _e( '%', 'login-customizer' ); ?></label>
70
+ </div>
71
+ <?php endif; ?>
72
+ </span>
73
+ <?php
74
+ endif;
75
+ if ( ! empty( $this->description ) ) :
76
+ ?>
77
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
78
+ <?php endif; ?>
79
+ <div id="<?php echo esc_attr( $this->id ); ?>">
80
+ <div class="o2-range-slider">
81
+ <input class="o2-range-slider-range" type="range" value="<?php echo intval( $this->value() ); ?>" <?php $this->input_attrs(); ?> />
82
+ <input class="o2-range-slider-value" type="number" value="<?php echo intval( $this->value() ); ?>" <?php $this->input_attrs(); ?> />
83
+ <?php if ( ! empty( $this->setting->default ) ) : ?>
84
+ <span class="o2-range-reset-slider" title="<?php _e( 'Reset', 'login-customizer' ); ?>"><span class="dashicons dashicons-image-rotate"></span></span>
85
+ <?php endif; ?>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ <?php
90
+ }
91
+
92
+ }
93
+ }
94
+ add_action( 'customize_register', 'o2_add_range_slider_control' );
95
+
96
+ endif;
inc/customizer/controls/toggle/assets/css/toggle-control.css ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .o2-toggle .customize-control-title {
2
+ display: inline-block;
3
+ }
4
+
5
+ .o2-toggle .o2-toggle-checkbox {
6
+ display: none;
7
+ }
8
+
9
+ .o2-toggle .o2-btn-toggle {
10
+ float: right;
11
+ position: relative;
12
+ width: 3rem;
13
+ height: 1.5rem;
14
+ padding: 0;
15
+ border: none;
16
+ border-radius: 1.5rem;
17
+ color: #6b7381;
18
+ background: #bdc1c8;
19
+ cursor: pointer;
20
+ }
21
+
22
+ .o2-toggle .o2-btn-toggle > .handle {
23
+ position: absolute;
24
+ top: 0.1875rem;
25
+ left: 0.1875rem;
26
+ width: 1.125rem;
27
+ height: 1.125rem;
28
+ border-radius: 1.125rem;
29
+ background: #fff;
30
+ -webkit-transition: left 0.25s;
31
+ transition: left 0.25s;
32
+ }
33
+
34
+ input[type=checkbox]:checked.o2-toggle-checkbox + button {
35
+ -webkit-transition: background-color 0.25s;
36
+ transition: background-color 0.25s;
37
+ }
38
+
39
+ input[type=checkbox]:checked.o2-toggle-checkbox + button > .handle {
40
+ left: 1.6875rem;
41
+ -webkit-transition: left 0.25s;
42
+ transition: left 0.25s;
43
+ }
44
+
45
+ input[type=checkbox]:checked.o2-toggle-checkbox + button {
46
+ background-color: #0085ba;
47
+ }
inc/customizer/controls/toggle/assets/js/toggle-control.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wp.customize.controlConstructor['o2-toggle'] = wp.customize.Control.extend({
2
+
3
+ ready: function() {
4
+ 'use strict';
5
+
6
+ var control = this,
7
+ button = control.container.find( '.o2-btn-toggle' ),
8
+ checkbox = control.container.find( '.o2-toggle-checkbox' );
9
+
10
+ button[0].onclick = function() {
11
+ checkbox[0].checked = !checkbox[0].checked;
12
+ control.setting.set( checkbox[0].checked );
13
+ };
14
+ }
15
+
16
+ });
inc/customizer/controls/toggle/toggle-control.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toggle Customizer Control - O2 Customizer Library
4
+ *
5
+ * This control adds a toggle box to the Customizer which allows
6
+ * you to have a checkbox field with toggle control.
7
+ *
8
+ * Toggle is a part of O2 library, which is a
9
+ * free software: you can redistribute it and/or modify it under
10
+ * the terms of the GNU General Public License as published by the
11
+ * Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Toggle
24
+ * @since 0.1
25
+ */
26
+ if ( ! function_exists( 'o2_add_toggle_control' ) ) :
27
+
28
+ function o2_add_toggle_control( $wp_customize ) {
29
+ class O2_Customizer_Toggle_Control extends WP_Customize_Control {
30
+
31
+ public $type = 'o2-toggle';
32
+
33
+ public function enqueue() {
34
+ wp_enqueue_script( 'o2-toggle', LOGINCUST_FREE_URL . 'inc/customizer/controls/toggle/assets/js/toggle-control.js', '', '', true );
35
+ wp_enqueue_style( 'o2-toggle', LOGINCUST_FREE_URL . 'inc/customizer/controls/toggle/assets/css/toggle-control.css' );
36
+ }
37
+
38
+ public function render_content() {
39
+ ?>
40
+ <label>
41
+ <div id="<?php echo esc_attr( $this->id ); ?>" class="o2-toggle">
42
+ <?php if ( ! empty( $this->label ) ) : ?>
43
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
44
+ <?php endif; ?>
45
+ <input type="checkbox" class="o2-toggle-checkbox" name="<?php echo esc_attr( $this->id ); ?>" value="<?php echo intval( $this->value() ); ?>"
46
+ <?php
47
+ $this->link();
48
+ checked( $this->value() );
49
+ ?>
50
+ />
51
+ <button type="button" class="o2-btn-toggle" for="<?php echo esc_attr( $this->id ); ?>">
52
+ <div class="handle"></div>
53
+ </button>
54
+ <?php if ( ! empty( $this->description ) ) : ?>
55
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
56
+ <?php endif; ?>
57
+ </div>
58
+ </label>
59
+ <?php
60
+ }
61
+
62
+ }
63
+ }
64
+ add_action( 'customize_register', 'o2_add_toggle_control' );
65
+
66
+ endif;
inc/customizer/css/customizer.css ADDED
File without changes
inc/customizer/custom-code.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom CSS & JS output to customize login page.
4
+ */
5
+
6
+ function logincust_render_styles() {
7
+ // Enqueue stylesheet for login styles
8
+ wp_enqueue_style( 'logincust_styles', LOGINCUST_FREE_URL . 'inc/customizer/css/customizer.css' );
9
+
10
+ // Get plugin options array
11
+ $options = get_option( 'login_customizer_options' );
12
+
13
+ // Initialize empty string
14
+ $custom_css = '';
15
+
16
+ // Login Page Background CSS
17
+ $custom_css .= 'body.login {';
18
+ if ( ! empty( $options['logincust_bg_image'] ) ) {
19
+ $custom_css .= 'background-image: url(" ' . $options['logincust_bg_image'] . ' ");';
20
+ }
21
+ if ( ! empty( $options['logincust_bg_color'] ) ) {
22
+ $custom_css .= 'background-color: ' . $options['logincust_bg_color'] . ';';
23
+ }
24
+ if ( ! empty( $options['logincust_bg_image_size'] ) ) {
25
+ if ( $options['logincust_bg_image_size'] === 'custom' ) {
26
+ $custom_css .= 'background-size: ' . $options['logincust_bg_size'] . ';';
27
+ } else {
28
+ $custom_css .= 'background-size: ' . $options['logincust_bg_image_size'] . ';';
29
+ }
30
+ }
31
+ if ( ! empty( $options['logincust_bg_image_repeat'] ) ) {
32
+ $custom_css .= 'background-repeat: ' . $options['logincust_bg_image_repeat'] . ';';
33
+ }
34
+ if ( ! empty( $options['logincust_bg_image_position_x'] ) && ! empty( $options['logincust_bg_image_position_y'] ) ) {
35
+ $custom_css .= 'background-position: ' . $options['logincust_bg_image_position_x'] . ' ' . $options['logincust_bg_image_position_y'] . ';';
36
+ }
37
+ $custom_css .= '}';
38
+
39
+ // Login Page Logo CSS
40
+ $custom_css .= 'body.login div#login h1 a {';
41
+ if ( ! empty( $options['logincust_logo_show'] ) && $options['logincust_logo_show'] === 1 ) {
42
+ $custom_css .= 'display: none;';
43
+ } else {
44
+ if ( ! empty( $options['logincust_logo'] ) ) {
45
+ $custom_css .= 'background-image: url(" ' . $options['logincust_logo'] . ' ");';
46
+ }
47
+ if ( ! empty( $options['logincust_logo_width'] ) ) {
48
+ $custom_css .= 'width: ' . $options['logincust_logo_width'] . ';';
49
+ }
50
+ if ( ! empty( $options['logincust_logo_height'] ) ) {
51
+ $custom_css .= 'height: ' . $options['logincust_logo_height'] . ';';
52
+ }
53
+ if ( ! empty( $options['logincust_logo_width'] ) || ! empty( $options['logincust_logo_height'] ) ) {
54
+ $custom_css .= 'background-size: ' . $options['logincust_logo_width'] . ' ' . $options['logincust_logo_height'] . ';';
55
+ }
56
+ if ( ! empty( $options['logincust_logo_padding'] ) ) {
57
+ $custom_css .= 'padding-bottom: ' . $options['logincust_logo_padding'] . ';';
58
+ }
59
+ }
60
+ $custom_css .= '}';
61
+
62
+ // Login Page Form CSS
63
+ $custom_css .= '#login form#loginform, #login form#registerform, #login form#lostpasswordform {';
64
+ if ( ! empty( $options['logincust_form_bg_image'] ) ) {
65
+ $custom_css .= 'background-image: url(" ' . $options['logincust_form_bg_image'] . ' ");';
66
+ }
67
+ if ( ! empty( $options['logincust_form_bg_color'] ) ) {
68
+ $custom_css .= 'background-color: ' . $options['logincust_form_bg_color'] . ';';
69
+ }
70
+ if ( ! empty( $options['logincust_form_height'] ) ) {
71
+ $custom_css .= 'height: ' . $options['logincust_form_height'] . ';';
72
+ }
73
+ if ( ! empty( $options['logincust_form_padding'] ) ) {
74
+ $custom_css .= 'padding: ' . $options['logincust_form_padding'] . ';';
75
+ }
76
+ if ( ! empty( $options['logincust_form_radius'] ) ) {
77
+ $custom_css .= 'border-radius: ' . $options['logincust_form_radius'] . ';';
78
+ }
79
+ if ( ! empty( $options['logincust_form_shadow_spread'] ) && ! empty( $options['logincust_form_shadow'] ) ) {
80
+ $custom_css .= 'box-shadow: 0 1px ' . $options['logincust_form_shadow_spread'] . ' ' . $options['logincust_form_shadow'] . ';';
81
+ }
82
+ $custom_css .= '}';
83
+
84
+ // Login Form Width CSS
85
+ if ( ! empty( $options['logincust_form_width'] ) ) {
86
+ $custom_css .= 'div#login {';
87
+ $custom_css .= 'width: ' . $options['logincust_form_width'] . ';';
88
+ $custom_css .= '}';
89
+ }
90
+
91
+ // Rememer Me Link CSS
92
+ if ( ! empty( $options['logincust_field_remember_me'] ) && $options['logincust_field_remember_me'] === 1 ) {
93
+ $custom_css .= '#login form .forgetmenot {';
94
+ $custom_css .= 'display: none;';
95
+ $custom_css .= '}';
96
+ }
97
+
98
+ // Register Link CSS
99
+ if ( is_customize_preview() ) {
100
+ if ( ! empty( $options['logincust_field_register_link'] ) && $options['logincust_field_register_link'] === 1 ) {
101
+ $custom_css .= '#login #nav a:first-child {';
102
+ $custom_css .= 'display: none;';
103
+ $custom_css .= '}';
104
+ }
105
+ }
106
+
107
+ // Lost Password Link CSS
108
+ if ( ! empty( $options['logincust_field_lost_password'] ) && $options['logincust_field_lost_password'] === 1 ) {
109
+ $custom_css .= '#login #nav a:last-child {';
110
+ $custom_css .= 'display: none;';
111
+ $custom_css .= '}';
112
+ }
113
+
114
+ // Login Page Fields CSS
115
+ $custom_css .= '#login form#loginform .input, #login form#registerform .input, #login form#lostpasswordform .input {';
116
+ if ( ! empty( $options['logincust_field_width'] ) ) {
117
+ $custom_css .= 'width: ' . $options['logincust_field_width'] . ';';
118
+ }
119
+ if ( ! empty( $options['logincust_field_font_size'] ) ) {
120
+ $custom_css .= 'font-size: ' . $options['logincust_field_font_size'] . ';';
121
+ }
122
+ if ( ! empty( $options['logincust_field_border_width'] ) ) {
123
+ $custom_css .= 'border-width: ' . $options['logincust_field_border_width'] . ';';
124
+ }
125
+ if ( ! empty( $options['logincust_field_border_color'] ) ) {
126
+ $custom_css .= 'border-color: ' . $options['logincust_field_border_color'] . ';';
127
+ }
128
+ if ( ! empty( $options['logincust_field_radius'] ) ) {
129
+ $custom_css .= 'border-radius: ' . $options['logincust_field_radius'] . ';';
130
+ }
131
+ if ( ! empty( $options['logincust_field_box_shadow'] ) && $options['logincust_field_box_shadow'] === 1 ) {
132
+ $custom_css .= 'box-shadow: unset;';
133
+ }
134
+ if ( ! empty( $options['logincust_field_margin'] ) ) {
135
+ $custom_css .= 'margin: ' . $options['logincust_field_margin'] . ';';
136
+ }
137
+ if ( ! empty( $options['logincust_field_padding'] ) ) {
138
+ $custom_css .= 'padding: ' . $options['logincust_field_padding'] . ';';
139
+ }
140
+ if ( ! empty( $options['logincust_field_bg'] ) ) {
141
+ $custom_css .= 'background-color: ' . $options['logincust_field_bg'] . ';';
142
+ }
143
+ if ( ! empty( $options['logincust_field_color'] ) ) {
144
+ $custom_css .= 'color: ' . $options['logincust_field_color'] . ';';
145
+ }
146
+ $custom_css .= '}';
147
+
148
+ // Login Form Labels CSS
149
+ $custom_css .= '#login form#loginform label, #login form#registerform label, #login form#lostpasswordform label {';
150
+ if ( ! empty( $options['logincust_field_label'] ) ) {
151
+ $custom_css .= 'color: ' . $options['logincust_field_label'] . ';';
152
+ }
153
+ if ( ! empty( $options['logincust_field_label_font_size'] ) ) {
154
+ $custom_css .= 'font-size: ' . $options['logincust_field_label_font_size'] . ';';
155
+ }
156
+ $custom_css .= '}';
157
+ $custom_css .= '#login form#loginform .forgetmenot label, #login form#registerform .forgetmenot label, #login form#lostpasswordform .forgetmenot label {';
158
+ if ( ! empty( $options['logincust_field_label_font_size'] ) ) {
159
+ $custom_css .= 'font-size: ' . ( intval( $options['logincust_field_label_font_size'] ) - 2 ) . 'px;';
160
+ }
161
+ $custom_css .= '}';
162
+
163
+ // Login Button CSS
164
+ $custom_css .= '#login form .submit .button {';
165
+ $custom_css .= 'height: auto;';
166
+ if ( ! empty( $options['logincust_button_bg'] ) ) {
167
+ $custom_css .= 'background-color: ' . $options['logincust_button_bg'] . ';';
168
+ }
169
+ if ( ! empty( $options['logincust_button_font_size'] ) ) {
170
+ $custom_css .= 'font-size: ' . $options['logincust_button_font_size'] . ';';
171
+ }
172
+ if ( ! empty( $options['logincust_button_height_width'] ) && $options['logincust_button_height_width'] === 'custom' ) {
173
+ if ( ! empty( $options['logincust_button_width_size'] ) ) {
174
+ $custom_css .= 'width: ' . $options['logincust_button_width_size'] . ';';
175
+ }
176
+ if ( ! empty( $options['logincust_button_height_size'] ) ) {
177
+ $custom_css .= 'height: ' . $options['logincust_button_height_size'] . ';';
178
+ }
179
+ }
180
+ if ( ! empty( $options['logincust_button_color'] ) ) {
181
+ $custom_css .= 'color: ' . $options['logincust_button_color'] . ';';
182
+ }
183
+ if ( ! empty( $options['logincust_button_padding'] ) ) {
184
+ $custom_css .= 'padding: ' . $options['logincust_button_padding'] . ';';
185
+ }
186
+ if ( ! empty( $options['logincust_button_border_width'] ) ) {
187
+ $custom_css .= 'border-width: ' . $options['logincust_button_border_width'] . ';';
188
+ }
189
+ if ( ! empty( $options['logincust_button_border_radius'] ) ) {
190
+ $custom_css .= 'border-radius: ' . $options['logincust_button_border_radius'] . ';';
191
+ }
192
+ if ( ! empty( $options['logincust_button_border'] ) ) {
193
+ $custom_css .= 'border-color: ' . $options['logincust_button_border'] . ';';
194
+ }
195
+ if ( ! empty( $options['logincust_button_shadow'] ) && ! empty( $options['logincust_button_shadow_spread'] ) ) {
196
+ $custom_css .= 'box-shadow: 0px 1px ' . $options['logincust_button_shadow_spread'] . ' ' . $options['logincust_button_shadow'] . ';';
197
+ }
198
+ if ( ! empty( $options['logincust_button_text_shadow'] ) ) {
199
+ $custom_css .= 'text-shadow: 0 -1px 1px ' . $options['logincust_button_text_shadow'] . ',1px 0 1px ' . $options['logincust_button_text_shadow'] . ',0 1px 1px ' . $options['logincust_button_text_shadow'] . ',-1px 0 1px ' . $options['logincust_button_text_shadow'] . ';';
200
+ }
201
+ $custom_css .= '}';
202
+
203
+ // Login Button on Hover CSS
204
+ $custom_css .= '#login form .submit .button:hover, #login form .submit .button:focus {';
205
+ if ( ! empty( $options['logincust_button_hover_bg'] ) ) {
206
+ $custom_css .= 'background-color: ' . $options['logincust_button_hover_bg'] . ';';
207
+ }
208
+ if ( ! empty( $options['logincust_button_hover_border'] ) ) {
209
+ $custom_css .= 'border-color: ' . $options['logincust_button_hover_border'] . ';';
210
+ }
211
+ $custom_css .= '}';
212
+
213
+ // Other Styling
214
+ if ( ! empty( $options['logincust_field_back_blog'] ) && $options['logincust_field_back_blog'] === 1 ) {
215
+ $custom_css .= '#login #backtoblog {';
216
+ $custom_css .= 'display: none;';
217
+ $custom_css .= '}';
218
+ }
219
+ if ( ! empty( $options['logincust_other_font_size'] ) ) {
220
+ $custom_css .= '.login #nav, .login #nav a, .login #backtoblog a {';
221
+ $custom_css .= 'font-size: ' . $options['logincust_other_font_size'] . ';';
222
+ $custom_css .= '}';
223
+ }
224
+ if ( ! empty( $options['logincust_other_color'] ) ) {
225
+ $custom_css .= '.login #nav, .login #nav a, .login #backtoblog a {';
226
+ $custom_css .= 'color: ' . $options['logincust_other_color'] . ';';
227
+ $custom_css .= '}';
228
+ }
229
+ if ( ! empty( $options['logincust_other_color_hover'] ) ) {
230
+ $custom_css .= '.login #backtoblog a:hover, .login #nav a:hover {';
231
+ $custom_css .= 'color: ' . $options['logincust_other_color_hover'] . ';';
232
+ $custom_css .= '}';
233
+ }
234
+
235
+ // Custom CSS
236
+ if ( ! empty( $options['logincust_other_css'] ) ) {
237
+ $custom_css .= $options['logincust_other_css'];
238
+ }
239
+
240
+ // Hook inline styles to stylesheet
241
+ wp_add_inline_style( 'logincust_styles', $custom_css );
242
+
243
+ }
244
+
245
+ // Hook stylesheet to login page
246
+ add_action( 'login_enqueue_scripts', 'logincust_render_styles' );
247
+
248
+
249
+ function logincust_render_script() {
250
+ // Get plugin options array
251
+ $options = get_option( 'login_customizer_options' );
252
+ if ( ! empty( $options['logincust_other_js'] ) ) {
253
+ echo '<script>' . "\n" . $options['logincust_other_js'] . "\n" . '</script>' . "\n";
254
+ }
255
+ }
256
+
257
+ // Hook script to login page
258
+ add_action( 'login_footer', 'logincust_render_script' );
inc/customizer/customizer.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Login Customizer
4
+ */
5
+
6
+ // Range Slider Control
7
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/range-slider/range-slider-control.php' );
8
+ // Toggle Control
9
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/toggle/toggle-control.php' );
10
+ // Padding/Margin Control
11
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/padding/padding-control.php' );
12
+ // Alpha Color Control
13
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/alpha/alpha-control.php' );
14
+ // Radio Images Control
15
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/radio-images/radio-images-control.php' );
16
+ // Sanitizer Functions
17
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sanitizers.php' );
18
+ // Enqueue CSS & JS for Login page
19
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/custom-code.php' );
20
+ // Functions to change login page
21
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/functions.php' );
22
+ // Sendinblue Class
23
+ if ( ! class_exists( 'Mailin' ) ) {
24
+ require_once( LOGINCUST_FREE_PATH . 'inc/mailin.php' );
25
+ }
26
+ // Cool Stuff Control
27
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/controls/cool-stuff/cool-stuff-control.php' );
28
+
29
+ /**
30
+ * Register login customizer settings
31
+ */
32
+ function logincust_customize_register( $wp_customize ) {
33
+
34
+ // Login Customizer Panel
35
+ $wp_customize->add_panel(
36
+ 'logincust_panel', array(
37
+ 'priority' => 30,
38
+ 'capability' => 'edit_theme_options',
39
+ 'title' => __( 'Login Customizer', 'login-customizer' ),
40
+ 'description' => __( 'This section allows you to customize the login page of your website. Made with ❤ by <a target="_blank" rel="nofollow" href="https://themeisle.com">ThemeIsle</a> team.', 'login-customizer' ),
41
+ )
42
+ );
43
+
44
+ // Section #0: Templates
45
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-templates.php' );
46
+
47
+ // Section #1: Background
48
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-background.php' );
49
+
50
+ // Section #2: Logo
51
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-logo.php' );
52
+
53
+ // Section #3: Form
54
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-form.php' );
55
+
56
+ // Section #5: Fields
57
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-fields.php' );
58
+
59
+ // Section #6: Button
60
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-button.php' );
61
+
62
+ // Section #7: Other
63
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-other.php' );
64
+
65
+ // Section #8: Custom CSS & JS
66
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-code.php' );
67
+
68
+ // Section #9: More Cool Stuff
69
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-more.php' );
70
+
71
+ }
72
+ add_action( 'customize_register', 'logincust_customize_register' );
73
+
74
+ /**
75
+ * Enqueue script to Customizer
76
+ */
77
+ function logincust_customizer_script() {
78
+ // Enqueue script to Customizer
79
+ wp_enqueue_script( 'logincust_control_js', LOGINCUST_FREE_URL . 'inc/customizer/js/customizer.js', array( 'jquery' ), null, true );
80
+
81
+ // Generate the redirect url.
82
+ $options = get_option( 'login_customizer_settings', array() );
83
+
84
+ $localize = array(
85
+ 'page' => get_permalink( $options['page'] ),
86
+ 'url' => LOGINCUST_FREE_URL,
87
+ );
88
+
89
+ // Localize Script
90
+ wp_localize_script( 'logincust_control_js', 'logincust_script', $localize );
91
+ }
92
+ add_action( 'customize_controls_print_scripts', 'logincust_customizer_script' );
93
+
94
+ /**
95
+ * Enqueeu script to Customizer Preview
96
+ */
97
+ function logincust_customizer_preview_script() {
98
+ // Enqueeu script to Customizer Preview
99
+ wp_enqueue_script( 'logincust_control_preview', LOGINCUST_FREE_URL . 'inc/customizer/js/customizer-preview.js', array( 'jquery', 'customize-preview' ), null, true );
100
+
101
+ // Generate the redirect url.
102
+ $options = get_option( 'login_customizer_settings', array() );
103
+
104
+ $localize = array(
105
+ 'page' => get_permalink( $options['page'] ),
106
+ );
107
+
108
+ // Localize Script
109
+ wp_localize_script( 'logincust_control_preview', 'logincust_script', $localize );
110
+ }
111
+ add_action( 'customize_preview_init', 'logincust_customizer_preview_script' );
inc/customizer/functions.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions to customize login page
4
+ */
5
+
6
+ // Get plugin options array
7
+ $options = get_option( 'login_customizer_options' );
8
+
9
+ /**
10
+ * Change login logo URL
11
+ */
12
+ function logincust_login_logo_url() {
13
+ // Return logo link option
14
+ global $options;
15
+ return $options['logincust_logo_link'];
16
+ }
17
+
18
+ // Hook to login_headerurl
19
+ if ( ! empty( $options['logincust_logo_link'] ) ) {
20
+ add_filter( 'login_headerurl', 'logincust_login_logo_url', 99 );
21
+ }
22
+
23
+ /**
24
+ * Change login logo title attribute
25
+ */
26
+ function logincust_login_logo_url_title() {
27
+ // Get blog title
28
+ $title = get_bloginfo( 'name', 'display' );
29
+
30
+ // Return blog title
31
+ return $title;
32
+ }
33
+
34
+ // Hook to login_headertitle
35
+ add_filter( 'login_headertitle', 'logincust_login_logo_url_title' );
36
+
37
+ /**
38
+ * Remove register link
39
+ */
40
+ function logincust_no_register_link( $url ) {
41
+ return '';
42
+ }
43
+
44
+ // Hook to register and login_link_separator
45
+ if ( ! is_customize_preview() ) {
46
+ if ( ! empty( $options['logincust_field_register_link'] ) && $options['logincust_field_register_link'] === 1 ) {
47
+ add_filter( 'register', 'logincust_no_register_link' );
48
+ add_filter( 'login_link_separator', 'logincust_no_register_link' );
49
+ }
50
+ if ( ! empty( $options['logincust_field_lost_password'] ) && $options['logincust_field_lost_password'] === 1 ) {
51
+ add_filter( 'login_link_separator', 'logincust_no_register_link' );
52
+ }
53
+ }
inc/customizer/js/customizer-preview.js ADDED
@@ -0,0 +1,446 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global logincust_script */
2
+
3
+ jQuery( document ).ready( function( $ ) {
4
+
5
+ /*
6
+ * Switch to the /login-customizer/ page, where we can live-preview Customizer options.
7
+ * Source: Login Designer
8
+ */
9
+ wp.customize.preview.bind( 'logincust-url-switcher', function( data ) {
10
+ // When the section is expanded, open the login designer page.
11
+ if ( true === data.expanded ) {
12
+ wp.customize.preview.send( 'url', logincust_script.page );
13
+ }
14
+ });
15
+
16
+ wp.customize.preview.bind( 'logincust-back-to-home', function( data ) {
17
+ wp.customize.preview.send( 'url', data.home_url );
18
+ });
19
+
20
+ wp.customize( 'login_customizer_options[logincust_bg_color]', function( value ) {
21
+ value.bind( function( newval ) {
22
+ $( 'body.login' ).css( 'background-color', newval );
23
+ });
24
+ });
25
+
26
+ wp.customize( 'login_customizer_options[logincust_bg_image]', function( value ) {
27
+ value.bind( function( newval ) {
28
+ $( 'body.login' ).css( 'background-image', 'url(' +newval+ ')' );
29
+ });
30
+ });
31
+
32
+ wp.customize( 'login_customizer_options[logincust_bg_image_repeat]', function( value ) {
33
+ value.bind( function( newval ) {
34
+ $( 'body.login' ).css( 'background-repeat', newval );
35
+ });
36
+ });
37
+
38
+ var imageCustom = false;
39
+ wp.customize( 'login_customizer_options[logincust_bg_image_size]', function( value ) {
40
+ value.bind( function( newval ) {
41
+ if ( newval !== 'custom' ) {
42
+ $( 'body.login' ).css( 'background-size', newval );
43
+ imageCustom = false;
44
+ } else {
45
+ imageCustom = true;
46
+ }
47
+ });
48
+ });
49
+
50
+ wp.customize( 'login_customizer_options[logincust_bg_size]', function( value ) {
51
+ value.bind( function( newval ) {
52
+ if ( imageCustom ) {
53
+ $( 'body.login' ).css( 'background-size', newval );
54
+ }
55
+ });
56
+ });
57
+
58
+ var bgpx = wp.customize( 'login_customizer_options[logincust_bg_image_position_x]' )._value;
59
+ wp.customize( 'login_customizer_options[logincust_bg_image_position_x]', function( value ) {
60
+ value.bind( function( newval ) {
61
+ bgpx = newval;
62
+ $( 'body.login' ).css( 'background-position', bgpx + ' ' + bgpy );
63
+ });
64
+ });
65
+
66
+ var bgpy = wp.customize( 'login_customizer_options[logincust_bg_image_position_y]' )._value;
67
+ wp.customize( 'login_customizer_options[logincust_bg_image_position_y]', function( value ) {
68
+ value.bind( function( newval ) {
69
+ bgpy = newval;
70
+ $( 'body.login' ).css( 'background-position', bgpx + ' ' + bgpy );
71
+ });
72
+ });
73
+
74
+ wp.customize( 'login_customizer_options[logincust_logo_show]', function( value ) {
75
+ value.bind( function( newval ) {
76
+ if ( newval === true ) {
77
+ $( 'body.login div#login h1 a' ).css( 'display', 'none' );
78
+ } else {
79
+ $( 'body.login div#login h1 a' ).css( 'display', 'block' );
80
+ }
81
+ });
82
+ });
83
+
84
+ wp.customize( 'login_customizer_options[logincust_logo]', function( value ) {
85
+ value.bind( function( newval ) {
86
+ $( 'body.login div#login h1 a' ).css( 'background-image', 'url(' +newval+ ')' );
87
+ });
88
+ });
89
+
90
+ var logowidth = wp.customize( 'login_customizer_options[logincust_logo_width]' )._value;
91
+ wp.customize( 'login_customizer_options[logincust_logo_width]', function( value ) {
92
+ value.bind( function( newval ) {
93
+ logowidth = newval;
94
+ $( 'body.login div#login h1 a' ).css( 'width', newval );
95
+ $( 'body.login div#login h1 a' ).css( 'background-size', logowidth + ' ' + logoheight );
96
+ });
97
+ });
98
+
99
+ var logoheight = wp.customize( 'login_customizer_options[logincust_logo_height]' )._value;
100
+ wp.customize( 'login_customizer_options[logincust_logo_height]', function( value ) {
101
+ value.bind( function( newval ) {
102
+ logoheight = newval;
103
+ $( 'body.login div#login h1 a' ).css( 'height', newval );
104
+ $( 'body.login div#login h1 a' ).css( 'background-size', logowidth + ' ' + logoheight );
105
+ });
106
+ });
107
+
108
+ wp.customize( 'login_customizer_options[logincust_logo_padding]', function( value ) {
109
+ value.bind( function( newval ) {
110
+ $( 'body.login div#login h1 a' ).css( 'padding-bottom', newval );
111
+ });
112
+ });
113
+
114
+ wp.customize( 'login_customizer_options[logincust_form_bg_image]', function( value ) {
115
+ value.bind( function( newval ) {
116
+ $( '#login form#loginform' ).css( 'background-image', 'url(' +newval+ ')' );
117
+ });
118
+ });
119
+
120
+ wp.customize( 'login_customizer_options[logincust_form_bg_color]', function( value ) {
121
+ value.bind( function( newval ) {
122
+ $( '#login form#loginform' ).css( 'background-color', newval );
123
+ });
124
+ });
125
+
126
+ wp.customize( 'login_customizer_options[logincust_form_width]', function( value ) {
127
+ value.bind( function( newval ) {
128
+ $( 'div#login' ).css( 'width', newval );
129
+ });
130
+ });
131
+
132
+ wp.customize( 'login_customizer_options[logincust_form_height]', function( value ) {
133
+ value.bind( function( newval ) {
134
+ $( '#login form#loginform' ).css( 'height', newval );
135
+ });
136
+ });
137
+
138
+ wp.customize( 'login_customizer_options[logincust_form_padding]', function( value ) {
139
+ value.bind( function( newval ) {
140
+ $( '#login form#loginform' ).css( 'padding', newval );
141
+ });
142
+ });
143
+
144
+ wp.customize( 'login_customizer_options[logincust_form_radius]', function( value ) {
145
+ value.bind( function( newval ) {
146
+ $( '#login form#loginform' ).css( 'border-radius', newval );
147
+ });
148
+ });
149
+
150
+ var formshadowspread = wp.customize( 'login_customizer_options[logincust_form_shadow_spread]' )._value;
151
+ wp.customize( 'login_customizer_options[logincust_form_shadow_spread]', function( value ) {
152
+ value.bind( function( newval ) {
153
+ formshadowspread = newval;
154
+ $( '#login form#loginform' ).css( 'box-shadow', '0 3px ' + formshadowspread + ' ' + formshadow );
155
+ });
156
+ });
157
+
158
+ var formshadow = wp.customize( 'login_customizer_options[logincust_form_shadow]' )._value;
159
+ wp.customize( 'login_customizer_options[logincust_form_shadow]', function( value ) {
160
+ value.bind( function( newval ) {
161
+ formshadow = newval;
162
+ $( '#login form#loginform' ).css( 'box-shadow', '0 3px ' + formshadowspread + ' ' + formshadow );
163
+ });
164
+ });
165
+
166
+ wp.customize( 'login_customizer_options[logincust_field_remember_me]', function( value ) {
167
+ value.bind( function( newval ) {
168
+ if ( newval === true ) {
169
+ $( '#login form .forgetmenot' ).css( 'display', 'none' );
170
+ } else {
171
+ $( '#login form .forgetmenot' ).css( 'display', 'block' );
172
+ }
173
+ });
174
+ });
175
+
176
+ var navNode = document.querySelector( '#nav' );
177
+ wp.customize( 'login_customizer_options[logincust_field_register_link]', function( value ) {
178
+ value.bind( function( newval ) {
179
+ if ( newval === true ) {
180
+ navNode.children[0].style.display = 'none';
181
+ } else {
182
+ navNode.children[0].style.display = 'inline';
183
+ }
184
+ });
185
+ });
186
+
187
+ wp.customize( 'login_customizer_options[logincust_field_lost_password]', function( value ) {
188
+ value.bind( function( newval ) {
189
+ if ( newval === true ) {
190
+ if ( navNode.children[1] === undefined ) {
191
+ navNode.children[0].style.display = 'none';
192
+ } else {
193
+ navNode.children[1].style.display = 'none';
194
+ }
195
+ } else {
196
+ if ( navNode.children[1] === undefined ) {
197
+ navNode.children[0].style.display = 'inline';
198
+ } else {
199
+ navNode.children[1].style.display = 'inline';
200
+ }
201
+ }
202
+ });
203
+ });
204
+
205
+ wp.customize( 'login_customizer_options[logincust_field_width]', function( value ) {
206
+ value.bind( function( newval ) {
207
+ $( '#login form#loginform .input' ).css( 'width', newval );
208
+ });
209
+ });
210
+
211
+ wp.customize( 'login_customizer_options[logincust_field_font_size]', function( value ) {
212
+ value.bind( function( newval ) {
213
+ $( '#login form#loginform .input' ).css( 'font-size', newval );
214
+ });
215
+ });
216
+
217
+ wp.customize( 'login_customizer_options[logincust_field_border_width]', function( value ) {
218
+ value.bind( function( newval ) {
219
+ $( '#login form#loginform .input' ).css( 'border-width', newval );
220
+ });
221
+ });
222
+
223
+ wp.customize( 'login_customizer_options[logincust_field_border_color]', function( value ) {
224
+ value.bind( function( newval ) {
225
+ $( '#login form#loginform .input' ).css( 'border-color', newval );
226
+ });
227
+ });
228
+
229
+ wp.customize( 'login_customizer_options[logincust_field_radius]', function( value ) {
230
+ value.bind( function( newval ) {
231
+ $( '#login form#loginform .input' ).css( 'border-radius', newval );
232
+ });
233
+ });
234
+
235
+ wp.customize( 'login_customizer_options[logincust_field_box_shadow]', function( value ) {
236
+ value.bind( function( newval ) {
237
+ if ( newval === true ) {
238
+ $( '#login form#loginform .input' ).css( 'box-shadow', 'unset' );
239
+ } else {
240
+ $( '#login form#loginform .input' ).css( 'box-shadow', 'inset 0 1px 2px rgba(0,0,0,.07)' );
241
+ }
242
+ });
243
+ });
244
+
245
+ wp.customize( 'login_customizer_options[logincust_field_margin]', function( value ) {
246
+ value.bind( function( newval ) {
247
+ $( '#login form#loginform .input' ).css( 'margin', newval );
248
+ });
249
+ });
250
+
251
+ wp.customize( 'login_customizer_options[logincust_field_padding]', function( value ) {
252
+ value.bind( function( newval ) {
253
+ $( '#login form#loginform .input' ).css( 'padding', newval );
254
+ });
255
+ });
256
+
257
+ wp.customize( 'login_customizer_options[logincust_field_bg]', function( value ) {
258
+ value.bind( function( newval ) {
259
+ $( '#login form#loginform .input' ).css( 'background-color', newval );
260
+ });
261
+ });
262
+
263
+ wp.customize( 'login_customizer_options[logincust_field_color]', function( value ) {
264
+ value.bind( function( newval ) {
265
+ $( '#login form#loginform .input' ).css( 'color', newval );
266
+ });
267
+ });
268
+
269
+ wp.customize( 'login_customizer_options[logincust_field_label]', function( value ) {
270
+ value.bind( function( newval ) {
271
+ $( '#login form#loginform label' ).css( 'color', newval );
272
+ });
273
+ });
274
+
275
+ wp.customize( 'login_customizer_options[logincust_field_label_font_size]', function( value ) {
276
+ value.bind( function( newval ) {
277
+ $( '#login form#loginform label' ).css( 'font-size', newval );
278
+ $( '#login form#loginform .forgetmenot label' ).css( 'font-size', ( parseInt( newval ) - 2 + 'px' ) );
279
+ });
280
+ });
281
+
282
+ var buttonbg = wp.customize( 'login_customizer_options[logincust_button_bg]' )._value;
283
+ wp.customize( 'login_customizer_options[logincust_button_bg]', function( value ) {
284
+ value.bind( function( newval ) {
285
+ buttonbg = newval;
286
+ $( '#login form .submit .button' ).css( 'background-color', newval );
287
+ });
288
+ });
289
+
290
+ wp.customize( 'login_customizer_options[logincust_button_hover_bg]', function( value ) {
291
+ value.bind( function( newval ) {
292
+ $( '#login form .submit .button' ).hover( function(){
293
+ $( this ).css( 'background-color', newval );
294
+ }, function(){
295
+ $( this ).css( 'background-color', buttonbg );
296
+ });
297
+ });
298
+ });
299
+
300
+ var customSize = wp.customize( 'login_customizer_options[logincust_button_height_width]' )._value;
301
+ var customWidth = wp.customize( 'login_customizer_options[logincust_button_width_size]' )._value;
302
+ var customHeight = wp.customize( 'login_customizer_options[logincust_button_height_size]' )._value;
303
+ wp.customize( 'login_customizer_options[logincust_button_height_width]', function( value ) {
304
+ value.bind( function( newval ) {
305
+ customSize = newval;
306
+ if ( customSize === 'auto' ) {
307
+ $( '#login form .submit .button' ).css( 'width', 'auto' );
308
+ $( '#login form .submit .button' ).css( 'height', 'auto' );
309
+ } else if ( customSize === 'custom' ) {
310
+ $( '#login form .submit .button' ).css( 'width', customWidth );
311
+ $( '#login form .submit .button' ).css( 'height', customHeight );
312
+ }
313
+ });
314
+ });
315
+
316
+ wp.customize( 'login_customizer_options[logincust_button_width_size]', function( value ) {
317
+ value.bind( function( newval ) {
318
+ if ( customSize === 'custom' ) {
319
+ customWidth = newval;
320
+ $( '#login form .submit .button' ).css( 'width', newval );
321
+ }
322
+ });
323
+ });
324
+
325
+ wp.customize( 'login_customizer_options[logincust_button_height_size]', function( value ) {
326
+ value.bind( function( newval ) {
327
+ if ( customSize === 'custom' ) {
328
+ customHeight = newval;
329
+ $( '#login form .submit .button' ).css( 'height', newval );
330
+ }
331
+ });
332
+ });
333
+
334
+ wp.customize( 'login_customizer_options[logincust_button_font_size]', function( value ) {
335
+ value.bind( function( newval ) {
336
+ $( '#login form .submit .button' ).css( 'font-size', newval );
337
+ });
338
+ });
339
+
340
+ wp.customize( 'login_customizer_options[logincust_button_color]', function( value ) {
341
+ value.bind( function( newval ) {
342
+ $( '#login form .submit .button' ).css( 'color', newval );
343
+ });
344
+ });
345
+
346
+ wp.customize( 'login_customizer_options[logincust_button_padding]', function( value ) {
347
+ value.bind( function( newval ) {
348
+ $( '#login form .submit .button' ).css( 'padding', newval );
349
+ });
350
+ });
351
+
352
+ wp.customize( 'login_customizer_options[logincust_button_border_width]', function( value ) {
353
+ value.bind( function( newval ) {
354
+ $( '#login form .submit .button' ).css( 'border-width', newval );
355
+ });
356
+ });
357
+
358
+ wp.customize( 'login_customizer_options[logincust_button_border_radius]', function( value ) {
359
+ value.bind( function( newval ) {
360
+ $( '#login form .submit .button' ).css( 'border-radius', newval );
361
+ });
362
+ });
363
+
364
+ var buttoncolor = wp.customize( 'login_customizer_options[logincust_button_border]' )._value;
365
+ wp.customize( 'login_customizer_options[logincust_button_border]', function( value ) {
366
+ value.bind( function( newval ) {
367
+ buttoncolor = newval;
368
+ $( '#login form .submit .button' ).css( 'border-color', newval );
369
+ });
370
+ });
371
+
372
+ wp.customize( 'login_customizer_options[logincust_button_hover_border]', function( value ) {
373
+ value.bind( function( newval ) {
374
+ $( '#login form .submit .button' ).hover( function(){
375
+ $( this ).css( 'border-color', newval );
376
+ }, function(){
377
+ $( this ).css( 'border-color', buttoncolor );
378
+ });
379
+ });
380
+ });
381
+
382
+ var buttonshadowspread = wp.customize( 'login_customizer_options[logincust_button_shadow_spread]' )._value;
383
+ wp.customize( 'login_customizer_options[logincust_button_shadow_spread]', function( value ) {
384
+ value.bind( function( newval ) {
385
+ buttonshadowspread = newval;
386
+ $( '#login form .submit .button' ).css( 'box-shadow', '0 3px ' + buttonshadowspread + ' ' + buttonshadow );
387
+ });
388
+ });
389
+
390
+ var buttonshadow = wp.customize( 'login_customizer_options[logincust_button_shadow]' )._value;
391
+ wp.customize( 'login_customizer_options[logincust_button_shadow]', function( value ) {
392
+ value.bind( function( newval ) {
393
+ buttonshadow = newval;
394
+ $( '#login form .submit .button' ).css( 'box-shadow', '0 1px ' + buttonshadowspread + ' ' + buttonshadow );
395
+ });
396
+ });
397
+
398
+ wp.customize( 'login_customizer_options[logincust_button_text_shadow]', function( value ) {
399
+ value.bind( function( newval ) {
400
+ $( '#login form .submit .button' ).css( 'text-shadow', '0 -1px 1px ' + newval + ',1px 0 1px ' + newval + ',0 1px 1px ' + newval + ',-1px 0 1px ' + newval );
401
+ });
402
+ });
403
+ wp.customize( 'login_customizer_options[logincust_field_back_blog]', function( value ) {
404
+ value.bind( function( newval ) {
405
+ if ( newval === true ) {
406
+ $( '.login #backtoblog' ).css( 'display', 'none' );
407
+ } else {
408
+ $( '.login #backtoblog' ).css( 'display', 'block' );
409
+ }
410
+ });
411
+ });
412
+
413
+ wp.customize( 'login_customizer_options[logincust_other_font_size]', function( value ) {
414
+ value.bind( function( newval ) {
415
+ $( '.login #nav' ).css( 'font-size', newval );
416
+ $( '.login #nav a' ).css( 'font-size', newval );
417
+ $( '.login #backtoblog a' ).css( 'font-size', newval );
418
+ });
419
+ });
420
+
421
+ var othercolor = wp.customize( 'login_customizer_options[logincust_other_color]' )._value;
422
+ wp.customize( 'login_customizer_options[logincust_other_color]', function( value ) {
423
+ value.bind( function( newval ) {
424
+ othercolor = newval;
425
+ $( '.login #nav' ).css( 'color', newval );
426
+ $( '.login #nav a' ).css( 'color', newval );
427
+ $( '.login #backtoblog a' ).css( 'color', newval );
428
+ });
429
+ });
430
+
431
+ wp.customize( 'login_customizer_options[logincust_other_color_hover]', function( value ) {
432
+ value.bind( function( newval ) {
433
+ $( '.login #backtoblog a' ).hover( function(){
434
+ $( this ).css( 'color', newval );
435
+ }, function(){
436
+ $( this ).css( 'color', othercolor );
437
+ });
438
+ $( '.login #nav a' ).hover( function(){
439
+ $( this ).css( 'color', newval );
440
+ }, function(){
441
+ $( this ).css( 'color', othercolor );
442
+ });
443
+ });
444
+ });
445
+
446
+ });
inc/customizer/js/customizer.js ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global logincust_script */
2
+
3
+ jQuery( document ).ready( function( $ ) {
4
+
5
+ $( '<li class="accordion-section control-section control-section-default control-subsection"><h4 class="accordion-section-title"><a href="https://wordpress.org/support/plugin/login-customizer/reviews/#new-post" target="_blank">Like our plugin? Leave a review here!</a></h4></li><li style="padding: 10px; text-align: center;">Made with ❤ by <a href="https://themeisle.com/" target="_blank">ThemeIsle</a></li>' ).appendTo( '#sub-accordion-panel-logincust_panel' );
6
+
7
+ if ( wp.customize( 'login_customizer_options[logincust_bg_image]' )._value === '' ) {
8
+ $( '#customize-control-login_customizer_options-logincust_bg_image_size' ).hide();
9
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).hide();
10
+ $( '#customize-control-login_customizer_options-logincust_bg_image_repeat' ).hide();
11
+ $( '#customize-control-login_customizer_options-logincust_bg_image_position' ).hide();
12
+ }
13
+
14
+ if ( wp.customize( 'login_customizer_options[logincust_bg_image_size]' )._value !== 'custom' ) {
15
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).hide();
16
+ }
17
+
18
+ if ( wp.customize( 'login_customizer_options[logincust_logo_show]' )._value === true ) {
19
+ $( '#customize-control-login_customizer_options-logincust_logo' ).hide();
20
+ $( '#customize-control-login_customizer_options-logincust_logo_width' ).hide();
21
+ $( '#customize-control-login_customizer_options-logincust_logo_height' ).hide();
22
+ $( '#customize-control-login_customizer_options-logincust_logo_padding' ).hide();
23
+ $( '#customize-control-login_customizer_options-logincust_logo_link' ).hide();
24
+ } else {
25
+ $( '#customize-control-login_customizer_options-logincust_logo' ).show();
26
+ $( '#customize-control-login_customizer_options-logincust_logo_width' ).show();
27
+ $( '#customize-control-login_customizer_options-logincust_logo_height' ).show();
28
+ $( '#customize-control-login_customizer_options-logincust_logo_padding' ).show();
29
+ $( '#customize-control-login_customizer_options-logincust_logo_link' ).show();
30
+ }
31
+
32
+ if ( wp.customize( 'login_customizer_options[logincust_button_height_width]' )._value === 'auto' ) {
33
+ $( '#customize-control-login_customizer_options-logincust_button_width_size' ).hide();
34
+ $( '#customize-control-login_customizer_options-logincust_button_height_size' ).hide();
35
+ }
36
+
37
+ if ( wp.customize( 'login_customizer_options[logincust_button_border_width]' )._value === '0px' ) {
38
+ $( '#customize-control-login_customizer_options-logincust_button_border' ).hide();
39
+ $( '#customize-control-login_customizer_options-logincust_button_hover_border' ).hide();
40
+ }
41
+
42
+ /*
43
+ * Detect when the Login Customizer panel is expanded (or closed) so we can preview the login form easily.
44
+ * Source: Login Designer
45
+ */
46
+ wp.customize.panel( 'logincust_panel', function( section ) {
47
+ section.expanded.bind( function( isExpanding ) {
48
+
49
+ // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
50
+ if ( isExpanding ) {
51
+
52
+ // Only send the previewer to the login designer page, if we're not already on it.
53
+ var current_url = wp.customize.previewer.previewUrl();
54
+ current_url = current_url.includes( logincust_script.page );
55
+
56
+ if ( ! current_url ) {
57
+ wp.customize.previewer.send( 'logincust-url-switcher', { expanded: isExpanding } );
58
+ }
59
+
60
+ } else {
61
+ // Head back to the home page, if we leave the Login Designer panel.
62
+ wp.customize.previewer.send( 'logincust-back-to-home', { home_url: wp.customize.settings.url.home } );
63
+ }
64
+ });
65
+ });
66
+
67
+ wp.customize( 'login_customizer_options[logincust_bg_image]', function( setting ) {
68
+ setting.bind( function( value ) {
69
+ if ( value === '' ) {
70
+ $( '#customize-control-login_customizer_options-logincust_bg_image_size' ).hide();
71
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).hide();
72
+ $( '#customize-control-login_customizer_options-logincust_bg_image_repeat' ).hide();
73
+ $( '#customize-control-login_customizer_options-logincust_bg_image_position' ).hide();
74
+ } else {
75
+ $( '#customize-control-login_customizer_options-logincust_bg_image_size' ).show();
76
+ if ( wp.customize( 'login_customizer_options[logincust_bg_image_size]' )._value === 'custom' ) {
77
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).show();
78
+ }
79
+ $( '#customize-control-login_customizer_options-logincust_bg_image_repeat' ).show();
80
+ $( '#customize-control-login_customizer_options-logincust_bg_image_position' ).show();
81
+ }
82
+ });
83
+ });
84
+
85
+ wp.customize( 'login_customizer_options[logincust_bg_image_size]', function( setting ) {
86
+ setting.bind( function( value ) {
87
+ if ( value === 'custom' ) {
88
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).show();
89
+ } else {
90
+ $( '#customize-control-login_customizer_options-logincust_bg_size' ).hide();
91
+ }
92
+ });
93
+ });
94
+
95
+ wp.customize( 'login_customizer_options[logincust_logo_show]', function( setting ) {
96
+ setting.bind( function( value ) {
97
+ if ( value === true ) {
98
+ $( '#customize-control-login_customizer_options-logincust_logo' ).hide();
99
+ $( '#customize-control-login_customizer_options-logincust_logo_width' ).hide();
100
+ $( '#customize-control-login_customizer_options-logincust_logo_height' ).hide();
101
+ $( '#customize-control-login_customizer_options-logincust_logo_padding' ).hide();
102
+ $( '#customize-control-login_customizer_options-logincust_logo_link' ).hide();
103
+ } else {
104
+ $( '#customize-control-login_customizer_options-logincust_logo' ).show();
105
+ $( '#customize-control-login_customizer_options-logincust_logo_width' ).show();
106
+ $( '#customize-control-login_customizer_options-logincust_logo_height' ).show();
107
+ $( '#customize-control-login_customizer_options-logincust_logo_padding' ).show();
108
+ $( '#customize-control-login_customizer_options-logincust_logo_link' ).show();
109
+ }
110
+ });
111
+ });
112
+
113
+ wp.customize( 'login_customizer_options[logincust_button_height_width]', function( setting ) {
114
+ setting.bind( function( value ) {
115
+ if ( value === 'custom' ) {
116
+ $( '#customize-control-login_customizer_options-logincust_button_width_size' ).show();
117
+ $( '#customize-control-login_customizer_options-logincust_button_height_size' ).show();
118
+ } else {
119
+ $( '#customize-control-login_customizer_options-logincust_button_width_size' ).hide();
120
+ $( '#customize-control-login_customizer_options-logincust_button_height_size' ).hide();
121
+ }
122
+ });
123
+ });
124
+
125
+ wp.customize( 'login_customizer_options[logincust_button_border_width]', function( setting ) {
126
+ setting.bind( function( value ) {
127
+ if ( value !== '0px' ) {
128
+ $( '#customize-control-login_customizer_options-logincust_button_border' ).show();
129
+ $( '#customize-control-login_customizer_options-logincust_button_hover_border' ).show();
130
+ } else {
131
+ $( '#customize-control-login_customizer_options-logincust_button_border' ).hide();
132
+ $( '#customize-control-login_customizer_options-logincust_button_hover_border' ).hide();
133
+ }
134
+ });
135
+ });
136
+
137
+ });
138
+
139
+ var materialCSS = '/* Custom CSS for Material Template */\n#login form#loginform .input,\n#login form#registerform .input,\n#login form#lostpasswordform .input {\n\tborder-bottom: 1px solid #d2d2d2;\n}\n\n.bar {\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n}\n\n.bar:before, .bar:after {\n\tcontent: "";\n\theight: 2px; \n\twidth: 0;\n\tbottom: 15px; \n\tposition: absolute;\n\tbackground: #e91e63; \n\ttransition: all 0.2s ease;\n}\n\n.bar:before { left: 50%; }\n\n.bar:after { right: 50%; }\n\ninput:focus ~ .bar:before, input:focus ~ .bar:after { width: 50%; }';
140
+
141
+ var materialJS = '// Custom JS for Material Template\nfunction insertAfter( newNode, referenceNode ) {\n referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );\n}\n\nvar inputFields = document.querySelectorAll( ".input" );\n\ninputFields.forEach( ( field ) => {\n\tvar bar = document.createElement("span");\n\t\tbar.setAttribute( "class", "bar" );\n\tinsertAfter( bar, field );\n});';
142
+
143
+ var allOptions = [
144
+ 'login_customizer_options[logincust_bg_color]',
145
+ 'login_customizer_options[logincust_bg_image]',
146
+ 'login_customizer_options[logincust_bg_image_size]',
147
+ 'login_customizer_options[logincust_bg_size]',
148
+ 'login_customizer_options[logincust_bg_image_repeat]',
149
+ 'login_customizer_options[logincust_bg_image_position_x]',
150
+ 'login_customizer_options[logincust_bg_image_position_y]',
151
+ 'login_customizer_options[logincust_logo_show]',
152
+ 'login_customizer_options[logincust_logo]', // Let's not change the logo for now.
153
+ 'login_customizer_options[logincust_logo_width]',
154
+ 'login_customizer_options[logincust_logo_height]',
155
+ 'login_customizer_options[logincust_logo_padding]',
156
+ 'login_customizer_options[logincust_logo_link]',
157
+ 'login_customizer_options[logincust_form_bg_image]',
158
+ 'login_customizer_options[logincust_form_bg_color]',
159
+ 'login_customizer_options[logincust_form_width]',
160
+ 'login_customizer_options[logincust_form_height]',
161
+ 'login_customizer_options[logincust_form_padding]',
162
+ 'login_customizer_options[logincust_form_radius]',
163
+ 'login_customizer_options[logincust_form_shadow_spread]',
164
+ 'login_customizer_options[logincust_form_shadow]',
165
+ 'login_customizer_options[logincust_field_remember_me]',
166
+ 'login_customizer_options[logincust_field_width]',
167
+ 'login_customizer_options[logincust_field_font_size]',
168
+ 'login_customizer_options[logincust_field_border_width]',
169
+ 'login_customizer_options[logincust_field_border_color]',
170
+ 'login_customizer_options[logincust_field_radius]',
171
+ 'login_customizer_options[logincust_field_box_shadow]',
172
+ 'login_customizer_options[logincust_field_margin]',
173
+ 'login_customizer_options[logincust_field_padding]',
174
+ 'login_customizer_options[logincust_field_bg]',
175
+ 'login_customizer_options[logincust_field_color]',
176
+ 'login_customizer_options[logincust_field_label]',
177
+ 'login_customizer_options[logincust_field_label_font_size]',
178
+ 'login_customizer_options[logincust_button_bg]',
179
+ 'login_customizer_options[logincust_button_hover_bg]',
180
+ 'login_customizer_options[logincust_button_height_width]',
181
+ 'login_customizer_options[logincust_button_width_size]',
182
+ 'login_customizer_options[logincust_button_height_size]',
183
+ 'login_customizer_options[logincust_button_font_size]',
184
+ 'login_customizer_options[logincust_button_color]',
185
+ 'login_customizer_options[logincust_button_padding]',
186
+ 'login_customizer_options[logincust_button_border_width]',
187
+ 'login_customizer_options[logincust_button_border_radius]',
188
+ 'login_customizer_options[logincust_button_border]',
189
+ 'login_customizer_options[logincust_button_hover_border]',
190
+ 'login_customizer_options[logincust_button_shadow_spread]',
191
+ 'login_customizer_options[logincust_button_shadow]',
192
+ 'login_customizer_options[logincust_button_text_shadow]',
193
+ 'login_customizer_options[logincust_other_font_size]',
194
+ 'login_customizer_options[logincust_other_color]',
195
+ 'login_customizer_options[logincust_other_color_hover]',
196
+ 'login_customizer_options[logincust_other_css]',
197
+ 'login_customizer_options[logincust_other_js]',
198
+ ];
199
+
200
+ var allValues = [
201
+ '#F1F1F1',
202
+ '',
203
+ 'auto',
204
+ '',
205
+ 'no-repeat',
206
+ 'left',
207
+ 'top',
208
+ false,
209
+ '', // Let's leave logo url empty as well
210
+ '84px',
211
+ '84px',
212
+ '5px',
213
+ 'https://wordpress.org/',
214
+ '',
215
+ '#FFFFFF',
216
+ '320px',
217
+ '194px',
218
+ '26px 24px 46px 25px',
219
+ '0px',
220
+ '3px',
221
+ 'rgba(0,0,0, 0.13)',
222
+ false,
223
+ '100%',
224
+ '24px',
225
+ '1px',
226
+ '#DDD',
227
+ '0px',
228
+ false,
229
+ '2px 6px 16px 0px',
230
+ '3px 3px 3px 3px',
231
+ '#FFF',
232
+ '#333',
233
+ '#777',
234
+ '14px',
235
+ '#2EA2CC',
236
+ '#1E8CBE',
237
+ 'auto',
238
+ '63px',
239
+ '32px',
240
+ '13px',
241
+ '#FFF',
242
+ '0px 12px 2px 12px',
243
+ '1px',
244
+ '3px',
245
+ '#0074A2',
246
+ '#0074A2',
247
+ '0px',
248
+ '#78C8E6',
249
+ '#006799',
250
+ '13px',
251
+ '#999',
252
+ '#2EA2CC',
253
+ '/* Your custom CSS goes here */',
254
+ '// Your custom JS goes here',
255
+ ];
256
+
257
+ function resetOptions( options, values ) {
258
+ options.forEach( function( option, i ) {
259
+ wp.customize( option, function( setting ) {
260
+ setting.set( values[i] );
261
+
262
+ // hack to reset color.
263
+ if( option.indexOf( 'color' ) !== -1 ){
264
+ var li = 'customize-control-' + option.replace( /\[/g, '-' ).replace( /\]/g, '' );
265
+ jQuery( '#' + li + ' button.wp-color-result' ).css( 'background-color', values[i] );
266
+ }
267
+ });
268
+ });
269
+ }
270
+
271
+ function changeValue( option, value ) {
272
+ wp.customize( option, function( setting ) {
273
+ setting.set( value );
274
+ });
275
+ }
276
+
277
+ wp.customize( 'login_customizer_options[logincust_templates_control]', function( setting ) {
278
+ setting.bind( function( value ) {
279
+ if ( value === 'original' ) {
280
+ resetOptions( allOptions, allValues );
281
+ } else if ( value === 'dark' ) {
282
+ resetOptions( allOptions, allValues );
283
+ changeValue( 'login_customizer_options[logincust_bg_color]', '#000' );
284
+ changeValue( 'login_customizer_options[logincust_form_bg_color]', '#000' );
285
+ changeValue( 'login_customizer_options[logincust_form_shadow_spread]', '0px' );
286
+ changeValue( 'login_customizer_options[logincust_form_shadow]', 'rgba(0,0,0,0.0)' );
287
+ changeValue( 'login_customizer_options[logincust_field_bg]', '#222' );
288
+ changeValue( 'login_customizer_options[logincust_field_radius]', '5px' );
289
+ changeValue( 'login_customizer_options[logincust_field_border_color]', '#2d2d2d' );
290
+ changeValue( 'login_customizer_options[logincust_field_color]', '#777' );
291
+ changeValue( 'login_customizer_options[logincust_field_padding]', '3px 10px 3px 10px' );
292
+ changeValue( 'login_customizer_options[logincust_button_bg]', '#fff' );
293
+ changeValue( 'login_customizer_options[logincust_button_hover_bg]', '#e2e2e2' );
294
+ changeValue( 'login_customizer_options[logincust_button_color]', '#000' );
295
+ changeValue( 'login_customizer_options[logincust_button_border_width]', '0px' );
296
+ changeValue( 'login_customizer_options[logincust_button_shadow]', 'rgba(0,146,232,0.01)' );
297
+ changeValue( 'login_customizer_options[logincust_button_text_shadow]', '#fff' );
298
+ changeValue( 'login_customizer_options[logincust_other_color]', '#777' );
299
+ changeValue( 'login_customizer_options[logincust_other_color_hover]', '#515151' );
300
+ } else if ( value === 'material' ) {
301
+ resetOptions( allOptions, allValues );
302
+ changeValue( 'login_customizer_options[logincust_bg_color]', '#006eb7' );
303
+ changeValue( 'login_customizer_options[logincust_logo]', logincust_script.url + 'assets/logo.png' );
304
+ changeValue( 'login_customizer_options[logincust_form_radius]', '10px' );
305
+ changeValue( 'login_customizer_options[logincust_form_shadow_spread]', '50px' );
306
+ changeValue( 'login_customizer_options[logincust_form_shadow]', 'rgba(2,2,2,0.3)' );
307
+ changeValue( 'login_customizer_options[logincust_field_remember_me]', true );
308
+ changeValue( 'login_customizer_options[logincust_field_border_width]', '0px' );
309
+ changeValue( 'login_customizer_options[logincust_field_box_shadow]', true );
310
+ changeValue( 'login_customizer_options[logincust_button_bg]', '#e91e63' );
311
+ changeValue( 'login_customizer_options[logincust_button_hover_bg]', '#e8004d' );
312
+ changeValue( 'login_customizer_options[logincust_button_height_width]', 'custom' );
313
+ changeValue( 'login_customizer_options[logincust_button_width_size]', '100%' );
314
+ changeValue( 'login_customizer_options[logincust_button_height_size]', '40px' );
315
+ changeValue( 'login_customizer_options[logincust_button_border_width]', '0px' );
316
+ changeValue( 'login_customizer_options[logincust_button_shadow_spread]', '0px' );
317
+ changeValue( 'login_customizer_options[logincust_button_shadow]', 'rgba(120,200,230,0.01)' );
318
+ changeValue( 'login_customizer_options[logincust_button_text_shadow]', '#e91e63' );
319
+ changeValue( 'login_customizer_options[logincust_other_color]', '#ffffff' );
320
+ changeValue( 'login_customizer_options[logincust_other_color_hover]', '#dddddd' );
321
+ changeValue( 'login_customizer_options[logincust_other_css]', materialCSS );
322
+ changeValue( 'login_customizer_options[logincust_other_js]', materialJS );
323
+ }
324
+ });
325
+ });
inc/customizer/sanitizers.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom sanitizers for Customizer controls
4
+ */
5
+
6
+ /**
7
+ * Sanitizer for Options Control
8
+ */
9
+ function logincust_sanitize_options( $input, $setting ) {
10
+ // global wp_customize
11
+ global $wp_customize;
12
+
13
+ // Get control ID
14
+ $control = $wp_customize->get_control( $setting->id );
15
+
16
+ // Check if option exists in choice array
17
+ if ( array_key_exists( $input, $control->choices ) ) {
18
+ // If it does, return the value
19
+ return $input;
20
+ } else {
21
+ // Else, return default value
22
+ return $setting->default;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Sanitizer for Background Position Control
28
+ */
29
+ function logincust_sanitize_position( $input, $setting ) {
30
+ // Check if value is one of the positions
31
+ if ( in_array( $input, array( 'top', 'bottom', 'left', 'right', 'center' ), true ) ) {
32
+ // If it does, return the value
33
+ return $input;
34
+ } else {
35
+ // Else, return default value
36
+ return $setting->default;
37
+ }
38
+ }
inc/customizer/sections/section-background.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Background Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_background_section', array(
8
+ 'priority' => 5,
9
+ 'title' => __( 'Background', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_bg_color]', array(
16
+ 'default' => '#F1F1F1',
17
+ 'type' => 'option',
18
+ 'capability' => 'edit_theme_options',
19
+ 'sanitize_callback' => 'sanitize_hex_color',
20
+ 'transport' => 'postMessage',
21
+ )
22
+ );
23
+
24
+ $wp_customize->add_control(
25
+ new WP_Customize_Color_Control(
26
+ $wp_customize, 'login_customizer_options[logincust_bg_color]', array(
27
+ 'label' => __( 'Background Color', 'login-customizer' ),
28
+ 'section' => 'logincust_background_section',
29
+ 'priority' => 5,
30
+ 'settings' => 'login_customizer_options[logincust_bg_color]',
31
+ )
32
+ )
33
+ );
34
+
35
+ $wp_customize->add_setting(
36
+ 'login_customizer_options[logincust_bg_image]', array(
37
+ 'type' => 'option',
38
+ 'capability' => 'edit_theme_options',
39
+ 'sanitize_callback' => 'esc_url_raw',
40
+ 'transport' => 'postMessage',
41
+ )
42
+ );
43
+
44
+ $wp_customize->add_control(
45
+ new WP_Customize_Image_Control(
46
+ $wp_customize, 'login_customizer_options[logincust_bg_image]', array(
47
+ 'label' => __( 'Background Image', 'login-customizer' ),
48
+ 'section' => 'logincust_background_section',
49
+ 'priority' => 10,
50
+ 'settings' => 'login_customizer_options[logincust_bg_image]',
51
+ )
52
+ )
53
+ );
54
+
55
+ $wp_customize->add_setting(
56
+ 'login_customizer_options[logincust_bg_image_size]', array(
57
+ 'default' => 'auto',
58
+ 'type' => 'option',
59
+ 'capability' => 'edit_theme_options',
60
+ 'sanitize_callback' => 'logincust_sanitize_options',
61
+ 'transport' => 'postMessage',
62
+ )
63
+ );
64
+ $wp_customize->add_control(
65
+ 'login_customizer_options[logincust_bg_image_size]', array(
66
+ 'label' => __( 'Background Size', 'login-customizer' ),
67
+ 'section' => 'logincust_background_section',
68
+ 'type' => 'select',
69
+ 'choices' => array(
70
+ 'auto' => __( 'Original', 'login-customizer' ),
71
+ 'contain' => __( 'Fit to Screen', 'login-customizer' ),
72
+ 'cover' => __( 'Fill Screen', 'login-customizer' ),
73
+ 'custom' => __( 'Custom', 'login-customizer' ),
74
+ ),
75
+ 'priority' => 15,
76
+ 'settings' => 'login_customizer_options[logincust_bg_image_size]',
77
+ )
78
+ );
79
+
80
+ $wp_customize->add_setting(
81
+ 'login_customizer_options[logincust_bg_size]', array(
82
+ 'type' => 'option',
83
+ 'capability' => 'edit_theme_options',
84
+ 'sanitize_callback' => 'esc_html',
85
+ 'transport' => 'postMessage',
86
+ )
87
+ );
88
+
89
+ $wp_customize->add_control(
90
+ 'login_customizer_options[logincust_bg_size]', array(
91
+ 'label' => __( 'Custom Size', 'login-customizer' ),
92
+ 'section' => 'logincust_background_section',
93
+ 'priority' => 20,
94
+ 'settings' => 'login_customizer_options[logincust_bg_size]',
95
+ )
96
+ );
97
+
98
+ $wp_customize->add_setting(
99
+ 'login_customizer_options[logincust_bg_image_repeat]', array(
100
+ 'default' => 'no-repeat',
101
+ 'type' => 'option',
102
+ 'capability' => 'edit_theme_options',
103
+ 'sanitize_callback' => 'logincust_sanitize_options',
104
+ 'transport' => 'postMessage',
105
+ )
106
+ );
107
+ $wp_customize->add_control(
108
+ 'login_customizer_options[logincust_bg_image_repeat]', array(
109
+ 'label' => __( 'Background Repeat', 'login-customizer' ),
110
+ 'section' => 'logincust_background_section',
111
+ 'type' => 'select',
112
+ 'choices' => array(
113
+ 'no-repeat' => __( 'No Repeat', 'login-customizer' ),
114
+ 'repeat' => __( 'Repeat', 'login-customizer' ),
115
+ 'repeat-x' => __( 'Repeat Horizontally', 'login-customizer' ),
116
+ 'repeat-y' => __( 'Repeat Vertically', 'login-customizer' ),
117
+ ),
118
+ 'priority' => 25,
119
+ 'settings' => 'login_customizer_options[logincust_bg_image_repeat]',
120
+ )
121
+ );
122
+
123
+ $wp_customize->add_setting(
124
+ 'login_customizer_options[logincust_bg_image_position_x]', array(
125
+ 'default' => 'left',
126
+ 'type' => 'option',
127
+ 'capability' => 'edit_theme_options',
128
+ 'sanitize_callback' => 'logincust_sanitize_position',
129
+ 'transport' => 'postMessage',
130
+ )
131
+ );
132
+
133
+
134
+ $wp_customize->add_setting(
135
+ 'login_customizer_options[logincust_bg_image_position_y]', array(
136
+ 'default' => 'top',
137
+ 'type' => 'option',
138
+ 'capability' => 'edit_theme_options',
139
+ 'sanitize_callback' => 'logincust_sanitize_position',
140
+ 'transport' => 'postMessage',
141
+ )
142
+ );
143
+
144
+ $wp_customize->add_control(
145
+ new WP_Customize_Background_Position_Control(
146
+ $wp_customize, 'login_customizer_options[logincust_bg_image_position]', array(
147
+ 'label' => __( 'Background Position', 'login-customizer' ),
148
+ 'section' => 'logincust_background_section',
149
+ 'priority' => 30,
150
+ 'settings' => array(
151
+ 'x' => 'login_customizer_options[logincust_bg_image_position_x]',
152
+ 'y' => 'login_customizer_options[logincust_bg_image_position_y]',
153
+ ),
154
+ )
155
+ )
156
+ );
inc/customizer/sections/section-button.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Button Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_button_section', array(
8
+ 'priority' => 30,
9
+ 'title' => __( 'Button', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_button_bg]', array(
16
+ 'default' => '#2EA2CC',
17
+ 'type' => 'option',
18
+ 'capability' => 'edit_theme_options',
19
+ 'sanitize_callback' => 'sanitize_hex_color',
20
+ 'transport' => 'postMessage',
21
+ )
22
+ );
23
+
24
+ $wp_customize->add_control(
25
+ new WP_Customize_Color_Control(
26
+ $wp_customize, 'login_customizer_options[logincust_button_bg]', array(
27
+ 'label' => __( 'Background', 'login-customizer' ),
28
+ 'section' => 'logincust_button_section',
29
+ 'priority' => 5,
30
+ 'settings' => 'login_customizer_options[logincust_button_bg]',
31
+ )
32
+ )
33
+ );
34
+
35
+ $wp_customize->add_setting(
36
+ 'login_customizer_options[logincust_button_hover_bg]', array(
37
+ 'default' => '#1E8CBE',
38
+ 'type' => 'option',
39
+ 'capability' => 'edit_theme_options',
40
+ 'sanitize_callback' => 'sanitize_hex_color',
41
+ 'transport' => 'postMessage',
42
+ )
43
+ );
44
+
45
+ $wp_customize->add_control(
46
+ new WP_Customize_Color_Control(
47
+ $wp_customize, 'login_customizer_options[logincust_button_hover_bg]', array(
48
+ 'label' => __( 'Background (Hover)', 'login-customizer' ),
49
+ 'section' => 'logincust_button_section',
50
+ 'priority' => 10,
51
+ 'settings' => 'login_customizer_options[logincust_button_hover_bg]',
52
+ )
53
+ )
54
+ );
55
+
56
+ $wp_customize->add_setting(
57
+ 'login_customizer_options[logincust_button_height_width]', array(
58
+ 'default' => 'auto',
59
+ 'type' => 'option',
60
+ 'capability' => 'edit_theme_options',
61
+ 'sanitize_callback' => 'logincust_sanitize_options',
62
+ 'transport' => 'postMessage',
63
+ )
64
+ );
65
+ $wp_customize->add_control(
66
+ 'login_customizer_options[logincust_button_height_width]', array(
67
+ 'label' => __( 'Button Size', 'login-customizer' ),
68
+ 'section' => 'logincust_button_section',
69
+ 'type' => 'select',
70
+ 'choices' => array(
71
+ 'auto' => __( 'Auto', 'login-customizer' ),
72
+ 'custom' => __( 'Custom', 'login-customizer' ),
73
+ ),
74
+ 'priority' => 15,
75
+ 'settings' => 'login_customizer_options[logincust_button_height_width]',
76
+ )
77
+ );
78
+
79
+ $wp_customize->add_setting(
80
+ 'login_customizer_options[logincust_button_width_size]', array(
81
+ 'default' => '63px',
82
+ 'type' => 'option',
83
+ 'capability' => 'edit_theme_options',
84
+ 'sanitize_callback' => 'esc_html',
85
+ 'transport' => 'postMessage',
86
+ )
87
+ );
88
+
89
+ $wp_customize->add_control(
90
+ new O2_Customizer_Range_Slider_Control(
91
+ $wp_customize, 'login_customizer_options[logincust_button_width_size]', array(
92
+ 'label' => __( 'Width', 'login-customizer' ),
93
+ 'section' => 'logincust_button_section',
94
+ 'priority' => 20,
95
+ 'settings' => 'login_customizer_options[logincust_button_width_size]',
96
+ 'choices' => array(
97
+ 'percent' => true,
98
+ ),
99
+ 'input_attrs' => array(
100
+ 'min' => 0,
101
+ 'max' => 1000,
102
+ 'step' => 1,
103
+ ),
104
+ )
105
+ )
106
+ );
107
+
108
+ $wp_customize->add_setting(
109
+ 'login_customizer_options[logincust_button_height_size]', array(
110
+ 'default' => '32px',
111
+ 'type' => 'option',
112
+ 'capability' => 'edit_theme_options',
113
+ 'sanitize_callback' => 'esc_html',
114
+ 'transport' => 'postMessage',
115
+ )
116
+ );
117
+
118
+ $wp_customize->add_control(
119
+ new O2_Customizer_Range_Slider_Control(
120
+ $wp_customize, 'login_customizer_options[logincust_button_height_size]', array(
121
+ 'label' => __( 'Height', 'login-customizer' ),
122
+ 'section' => 'logincust_button_section',
123
+ 'priority' => 25,
124
+ 'settings' => 'login_customizer_options[logincust_button_height_size]',
125
+ 'choices' => array(
126
+ 'percent' => false,
127
+ ),
128
+ 'input_attrs' => array(
129
+ 'min' => 0,
130
+ 'max' => 1000,
131
+ 'step' => 1,
132
+ ),
133
+ )
134
+ )
135
+ );
136
+
137
+ $wp_customize->add_setting(
138
+ 'login_customizer_options[logincust_button_font_size]', array(
139
+ 'default' => '13px',
140
+ 'type' => 'option',
141
+ 'capability' => 'edit_theme_options',
142
+ 'sanitize_callback' => 'esc_html',
143
+ 'transport' => 'postMessage',
144
+ )
145
+ );
146
+
147
+ $wp_customize->add_control(
148
+ new O2_Customizer_Range_Slider_Control(
149
+ $wp_customize, 'login_customizer_options[logincust_button_font_size]', array(
150
+ 'label' => __( 'Font Size', 'login-customizer' ),
151
+ 'section' => 'logincust_button_section',
152
+ 'priority' => 30,
153
+ 'settings' => 'login_customizer_options[logincust_button_font_size]',
154
+ 'choices' => array(
155
+ 'percent' => false,
156
+ ),
157
+ 'input_attrs' => array(
158
+ 'min' => 0,
159
+ 'max' => 100,
160
+ 'step' => 1,
161
+ ),
162
+ )
163
+ )
164
+ );
165
+
166
+ $wp_customize->add_setting(
167
+ 'login_customizer_options[logincust_button_color]', array(
168
+ 'default' => '#FFF',
169
+ 'type' => 'option',
170
+ 'capability' => 'edit_theme_options',
171
+ 'sanitize_callback' => 'sanitize_hex_color',
172
+ 'transport' => 'postMessage',
173
+ )
174
+ );
175
+
176
+ $wp_customize->add_control(
177
+ new WP_Customize_Color_Control(
178
+ $wp_customize, 'login_customizer_options[logincust_button_color]', array(
179
+ 'label' => __( 'Text Color', 'login-customizer' ),
180
+ 'section' => 'logincust_button_section',
181
+ 'priority' => 35,
182
+ 'settings' => 'login_customizer_options[logincust_button_color]',
183
+ )
184
+ )
185
+ );
186
+
187
+ $wp_customize->add_setting(
188
+ 'login_customizer_options[logincust_button_padding]', array(
189
+ 'default' => '0 12px 2px',
190
+ 'type' => 'option',
191
+ 'capability' => 'edit_theme_options',
192
+ 'sanitize_callback' => 'esc_html',
193
+ 'transport' => 'postMessage',
194
+ )
195
+ );
196
+
197
+ $wp_customize->add_control(
198
+ new LoginCust_Padding_Control(
199
+ $wp_customize, 'login_customizer_options[logincust_button_padding]', array(
200
+ 'label' => __( 'Padding', 'login-customizer' ),
201
+ 'section' => 'logincust_button_section',
202
+ 'priority' => 40,
203
+ 'settings' => 'login_customizer_options[logincust_button_padding]',
204
+ )
205
+ )
206
+ );
207
+
208
+ $wp_customize->add_setting(
209
+ 'login_customizer_options[logincust_button_border_width]', array(
210
+ 'default' => '1px',
211
+ 'type' => 'option',
212
+ 'capability' => 'edit_theme_options',
213
+ 'sanitize_callback' => 'esc_html',
214
+ 'transport' => 'postMessage',
215
+ )
216
+ );
217
+
218
+ $wp_customize->add_control(
219
+ new O2_Customizer_Range_Slider_Control(
220
+ $wp_customize, 'login_customizer_options[logincust_button_border_width]', array(
221
+ 'label' => __( 'Border Width', 'login-customizer' ),
222
+ 'section' => 'logincust_button_section',
223
+ 'priority' => 45,
224
+ 'settings' => 'login_customizer_options[logincust_button_border_width]',
225
+ 'choices' => array(
226
+ 'percent' => false,
227
+ ),
228
+ 'input_attrs' => array(
229
+ 'min' => 0,
230
+ 'max' => 20,
231
+ 'step' => 1,
232
+ ),
233
+ )
234
+ )
235
+ );
236
+
237
+ $wp_customize->add_setting(
238
+ 'login_customizer_options[logincust_button_border]', array(
239
+ 'default' => '#0074A2',
240
+ 'type' => 'option',
241
+ 'capability' => 'edit_theme_options',
242
+ 'sanitize_callback' => 'sanitize_hex_color',
243
+ 'transport' => 'postMessage',
244
+ )
245
+ );
246
+
247
+ $wp_customize->add_control(
248
+ new WP_Customize_Color_Control(
249
+ $wp_customize, 'login_customizer_options[logincust_button_border]', array(
250
+ 'label' => __( 'Border', 'login-customizer' ),
251
+ 'section' => 'logincust_button_section',
252
+ 'priority' => 55,
253
+ 'settings' => 'login_customizer_options[logincust_button_border]',
254
+ )
255
+ )
256
+ );
257
+
258
+ $wp_customize->add_setting(
259
+ 'login_customizer_options[logincust_button_hover_border]', array(
260
+ 'default' => '#0074A2',
261
+ 'type' => 'option',
262
+ 'capability' => 'edit_theme_options',
263
+ 'sanitize_callback' => 'sanitize_hex_color',
264
+ 'transport' => 'postMessage',
265
+ )
266
+ );
267
+
268
+ $wp_customize->add_control(
269
+ new WP_Customize_Color_Control(
270
+ $wp_customize, 'login_customizer_options[logincust_button_hover_border]', array(
271
+ 'label' => __( 'Border (Hover)', 'login-customizer' ),
272
+ 'section' => 'logincust_button_section',
273
+ 'priority' => 60,
274
+ 'settings' => 'login_customizer_options[logincust_button_hover_border]',
275
+ )
276
+ )
277
+ );
278
+
279
+ $wp_customize->add_setting(
280
+ 'login_customizer_options[logincust_button_shadow_spread]', array(
281
+ 'default' => '0px',
282
+ 'type' => 'option',
283
+ 'capability' => 'edit_theme_options',
284
+ 'sanitize_callback' => 'esc_html',
285
+ 'transport' => 'postMessage',
286
+ )
287
+ );
288
+
289
+ $wp_customize->add_control(
290
+ new O2_Customizer_Range_Slider_Control(
291
+ $wp_customize, 'login_customizer_options[logincust_button_shadow_spread]', array(
292
+ 'label' => __( 'Shadow Spread', 'login-customizer' ),
293
+ 'section' => 'logincust_button_section',
294
+ 'priority' => 65,
295
+ 'settings' => 'login_customizer_options[logincust_button_shadow_spread]',
296
+ 'choices' => array(
297
+ 'percent' => false,
298
+ ),
299
+ 'input_attrs' => array(
300
+ 'min' => 0,
301
+ 'max' => 50,
302
+ 'step' => 1,
303
+ ),
304
+ )
305
+ )
306
+ );
307
+
308
+ $wp_customize->add_setting(
309
+ 'login_customizer_options[logincust_button_shadow]', array(
310
+ 'default' => '#78C8E6',
311
+ 'type' => 'option',
312
+ 'capability' => 'edit_theme_options',
313
+ 'sanitize_callback' => 'sanitize_text_field',
314
+ 'transport' => 'postMessage',
315
+ )
316
+ );
317
+
318
+ $wp_customize->add_control(
319
+ new LoginCust_Customize_Alpha_Color_Control(
320
+ $wp_customize, 'login_customizer_options[logincust_button_shadow]', array(
321
+ 'label' => __( 'Box Shadow', 'login-customizer' ),
322
+ 'section' => 'logincust_button_section',
323
+ 'priority' => 70,
324
+ 'settings' => 'login_customizer_options[logincust_button_shadow]',
325
+ )
326
+ )
327
+ );
328
+
329
+ $wp_customize->add_setting(
330
+ 'login_customizer_options[logincust_button_text_shadow]', array(
331
+ 'default' => '#006799',
332
+ 'type' => 'option',
333
+ 'capability' => 'edit_theme_options',
334
+ 'sanitize_callback' => 'sanitize_text_field',
335
+ 'transport' => 'postMessage',
336
+ )
337
+ );
338
+
339
+ $wp_customize->add_control(
340
+ new WP_Customize_Color_Control(
341
+ $wp_customize, 'login_customizer_options[logincust_button_text_shadow]', array(
342
+ 'label' => __( 'Text Shadow', 'login-customizer' ),
343
+ 'section' => 'logincust_button_section',
344
+ 'priority' => 75,
345
+ 'settings' => 'login_customizer_options[logincust_button_text_shadow]',
346
+ )
347
+ )
348
+ );
inc/customizer/sections/section-code.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Custom CSS Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_code_section', array(
8
+ 'priority' => 40,
9
+ 'title' => __( 'Custom CSS & JavaScript', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_other_css]', array(
16
+ 'type' => 'option',
17
+ 'capability' => 'edit_theme_options',
18
+ )
19
+ );
20
+
21
+ $wp_customize->add_control(
22
+ new WP_Customize_Code_Editor_Control(
23
+ $wp_customize, 'login_customizer_options[logincust_other_css]', array(
24
+ 'label' => __( 'Custom CSS', 'login-customizer' ),
25
+ 'code_type' => 'text/css',
26
+ 'section' => 'logincust_code_section',
27
+ 'priority' => 5,
28
+ 'settings' => 'login_customizer_options[logincust_other_css]',
29
+ )
30
+ )
31
+ );
32
+
33
+ $wp_customize->add_setting(
34
+ 'login_customizer_options[logincust_other_js]', array(
35
+ 'type' => 'option',
36
+ 'capability' => 'edit_theme_options',
37
+ )
38
+ );
39
+
40
+ $wp_customize->add_control(
41
+ new WP_Customize_Code_Editor_Control(
42
+ $wp_customize, 'login_customizer_options[logincust_other_js]', array(
43
+ 'label' => __( 'Custom JavaScript', 'login-customizer' ),
44
+ 'code_type' => 'text/javascript',
45
+ 'section' => 'logincust_code_section',
46
+ 'priority' => 10,
47
+ 'settings' => 'login_customizer_options[logincust_other_js]',
48
+ )
49
+ )
50
+ );
inc/customizer/sections/section-fields.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Fields Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_field_section', array(
8
+ 'priority' => 25,
9
+ 'title' => __( 'Fields', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_field_remember_me]', array(
16
+ 'default' => false,
17
+ 'type' => 'option',
18
+ 'capability' => 'edit_theme_options',
19
+ 'sanitize_callback' => 'absint',
20
+ 'transport' => 'postMessage',
21
+ )
22
+ );
23
+
24
+ $wp_customize->add_control(
25
+ new O2_Customizer_Toggle_Control(
26
+ $wp_customize, 'login_customizer_options[logincust_field_remember_me]', array(
27
+ 'label' => __( 'Disable Remember Me?', 'login-customizer' ),
28
+ 'section' => 'logincust_field_section',
29
+ 'priority' => 5,
30
+ 'settings' => 'login_customizer_options[logincust_field_remember_me]',
31
+ )
32
+ )
33
+ );
34
+
35
+ $wp_customize->add_setting(
36
+ 'login_customizer_options[logincust_field_width]', array(
37
+ 'default' => '100%',
38
+ 'type' => 'option',
39
+ 'capability' => 'edit_theme_options',
40
+ 'sanitize_callback' => 'esc_html',
41
+ 'transport' => 'postMessage',
42
+ )
43
+ );
44
+
45
+ $wp_customize->add_control(
46
+ new O2_Customizer_Range_Slider_Control(
47
+ $wp_customize, 'login_customizer_options[logincust_field_width]', array(
48
+ 'label' => __( 'Width', 'login-customizer' ),
49
+ 'section' => 'logincust_field_section',
50
+ 'priority' => 10,
51
+ 'settings' => 'login_customizer_options[logincust_field_width]',
52
+ 'choices' => array(
53
+ 'percent' => true,
54
+ ),
55
+ 'input_attrs' => array(
56
+ 'min' => 0,
57
+ 'max' => 1000,
58
+ 'step' => 1,
59
+ ),
60
+ )
61
+ )
62
+ );
63
+
64
+ $wp_customize->add_setting(
65
+ 'login_customizer_options[logincust_field_font_size]', array(
66
+ 'default' => '24px',
67
+ 'type' => 'option',
68
+ 'capability' => 'edit_theme_options',
69
+ 'sanitize_callback' => 'esc_html',
70
+ 'transport' => 'postMessage',
71
+ )
72
+ );
73
+
74
+ $wp_customize->add_control(
75
+ new O2_Customizer_Range_Slider_Control(
76
+ $wp_customize, 'login_customizer_options[logincust_field_font_size]', array(
77
+ 'label' => __( 'Font Size', 'login-customizer' ),
78
+ 'section' => 'logincust_field_section',
79
+ 'priority' => 15,
80
+ 'settings' => 'login_customizer_options[logincust_field_font_size]',
81
+ 'choices' => array(
82
+ 'percent' => false,
83
+ ),
84
+ 'input_attrs' => array(
85
+ 'min' => 0,
86
+ 'max' => 100,
87
+ 'step' => 1,
88
+ ),
89
+ )
90
+ )
91
+ );
92
+
93
+ $wp_customize->add_setting(
94
+ 'login_customizer_options[logincust_field_border_width]', array(
95
+ 'default' => '1px',
96
+ 'type' => 'option',
97
+ 'capability' => 'edit_theme_options',
98
+ 'sanitize_callback' => 'esc_html',
99
+ 'transport' => 'postMessage',
100
+ )
101
+ );
102
+
103
+ $wp_customize->add_control(
104
+ new O2_Customizer_Range_Slider_Control(
105
+ $wp_customize, 'login_customizer_options[logincust_field_border_width]', array(
106
+ 'label' => __( 'Border Width', 'login-customizer' ),
107
+ 'section' => 'logincust_field_section',
108
+ 'priority' => 20,
109
+ 'settings' => 'login_customizer_options[logincust_field_border_width]',
110
+ 'choices' => array(
111
+ 'percent' => false,
112
+ ),
113
+ 'input_attrs' => array(
114
+ 'min' => 0,
115
+ 'max' => 10,
116
+ 'step' => 1,
117
+ ),
118
+ )
119
+ )
120
+ );
121
+
122
+ $wp_customize->add_setting(
123
+ 'login_customizer_options[logincust_field_border_color]', array(
124
+ 'default' => '#DDD',
125
+ 'type' => 'option',
126
+ 'capability' => 'edit_theme_options',
127
+ 'sanitize_callback' => 'sanitize_hex_color',
128
+ 'transport' => 'postMessage',
129
+ )
130
+ );
131
+
132
+ $wp_customize->add_control(
133
+ new WP_Customize_Color_Control(
134
+ $wp_customize, 'login_customizer_options[logincust_field_border_color]', array(
135
+ 'label' => __( 'Border Color', 'login-customizer' ),
136
+ 'section' => 'logincust_field_section',
137
+ 'priority' => 25,
138
+ 'settings' => 'login_customizer_options[logincust_field_border_color]',
139
+ )
140
+ )
141
+ );
142
+
143
+ $wp_customize->add_setting(
144
+ 'login_customizer_options[logincust_field_radius]', array(
145
+ 'default' => '0px',
146
+ 'type' => 'option',
147
+ 'capability' => 'edit_theme_options',
148
+ 'sanitize_callback' => 'esc_html',
149
+ 'transport' => 'postMessage',
150
+ )
151
+ );
152
+
153
+ $wp_customize->add_control(
154
+ new O2_Customizer_Range_Slider_Control(
155
+ $wp_customize, 'login_customizer_options[logincust_field_radius]', array(
156
+ 'label' => __( 'Radius', 'login-customizer' ),
157
+ 'section' => 'logincust_field_section',
158
+ 'priority' => 30,
159
+ 'settings' => 'login_customizer_options[logincust_field_radius]',
160
+ 'choices' => array(
161
+ 'percent' => false,
162
+ ),
163
+ 'input_attrs' => array(
164
+ 'min' => 0,
165
+ 'max' => 100,
166
+ 'step' => 1,
167
+ ),
168
+ )
169
+ )
170
+ );
171
+
172
+ $wp_customize->add_setting(
173
+ 'login_customizer_options[logincust_field_box_shadow]', array(
174
+ 'default' => false,
175
+ 'type' => 'option',
176
+ 'capability' => 'edit_theme_options',
177
+ 'sanitize_callback' => 'absint',
178
+ 'transport' => 'postMessage',
179
+ )
180
+ );
181
+
182
+ $wp_customize->add_control(
183
+ new O2_Customizer_Toggle_Control(
184
+ $wp_customize, 'login_customizer_options[logincust_field_box_shadow]', array(
185
+ 'label' => __( 'Disable Box Shadow?', 'login-customizer' ),
186
+ 'section' => 'logincust_field_section',
187
+ 'priority' => 35,
188
+ 'settings' => 'login_customizer_options[logincust_field_box_shadow]',
189
+ )
190
+ )
191
+ );
192
+
193
+ $wp_customize->add_setting(
194
+ 'login_customizer_options[logincust_field_margin]', array(
195
+ 'default' => '2px 6px 16px 0px',
196
+ 'type' => 'option',
197
+ 'capability' => 'edit_theme_options',
198
+ 'sanitize_callback' => 'esc_html',
199
+ 'transport' => 'postMessage',
200
+ )
201
+ );
202
+
203
+ $wp_customize->add_control(
204
+ new LoginCust_Padding_Control(
205
+ $wp_customize, 'login_customizer_options[logincust_field_margin]', array(
206
+ 'label' => __( 'Margin', 'login-customizer' ),
207
+ 'section' => 'logincust_field_section',
208
+ 'priority' => 35,
209
+ 'settings' => 'login_customizer_options[logincust_field_margin]',
210
+ )
211
+ )
212
+ );
213
+
214
+ $wp_customize->add_setting(
215
+ 'login_customizer_options[logincust_field_padding]', array(
216
+ 'default' => '3px 3px 3px 3px',
217
+ 'type' => 'option',
218
+ 'capability' => 'edit_theme_options',
219
+ 'sanitize_callback' => 'esc_html',
220
+ 'transport' => 'postMessage',
221
+ )
222
+ );
223
+
224
+ $wp_customize->add_control(
225
+ new LoginCust_Padding_Control(
226
+ $wp_customize, 'login_customizer_options[logincust_field_padding]', array(
227
+ 'label' => __( 'Padding', 'login-customizer' ),
228
+ 'section' => 'logincust_field_section',
229
+ 'priority' => 40,
230
+ 'settings' => 'login_customizer_options[logincust_field_padding]',
231
+ )
232
+ )
233
+ );
234
+
235
+ $wp_customize->add_setting(
236
+ 'login_customizer_options[logincust_field_bg]', array(
237
+ 'default' => '#FFF',
238
+ 'type' => 'option',
239
+ 'capability' => 'edit_theme_options',
240
+ 'sanitize_callback' => 'sanitize_hex_color',
241
+ 'transport' => 'postMessage',
242
+ )
243
+ );
244
+
245
+ $wp_customize->add_control(
246
+ new WP_Customize_Color_Control(
247
+ $wp_customize, 'login_customizer_options[logincust_field_bg]', array(
248
+ 'label' => __( 'Background', 'login-customizer' ),
249
+ 'section' => 'logincust_field_section',
250
+ 'priority' => 45,
251
+ 'settings' => 'login_customizer_options[logincust_field_bg]',
252
+ )
253
+ )
254
+ );
255
+
256
+ $wp_customize->add_setting(
257
+ 'login_customizer_options[logincust_field_color]', array(
258
+ 'default' => '#333',
259
+ 'type' => 'option',
260
+ 'capability' => 'edit_theme_options',
261
+ 'sanitize_callback' => 'sanitize_hex_color',
262
+ 'transport' => 'postMessage',
263
+ )
264
+ );
265
+
266
+ $wp_customize->add_control(
267
+ new WP_Customize_Color_Control(
268
+ $wp_customize, 'login_customizer_options[logincust_field_color]', array(
269
+ 'label' => __( 'Text Color', 'login-customizer' ),
270
+ 'section' => 'logincust_field_section',
271
+ 'priority' => 50,
272
+ 'settings' => 'login_customizer_options[logincust_field_color]',
273
+ )
274
+ )
275
+ );
276
+
277
+ $wp_customize->add_setting(
278
+ 'login_customizer_options[logincust_field_label]', array(
279
+ 'default' => '#777',
280
+ 'type' => 'option',
281
+ 'capability' => 'edit_theme_options',
282
+ 'sanitize_callback' => 'sanitize_hex_color',
283
+ 'transport' => 'postMessage',
284
+ )
285
+ );
286
+
287
+ $wp_customize->add_control(
288
+ new WP_Customize_Color_Control(
289
+ $wp_customize, 'login_customizer_options[logincust_field_label]', array(
290
+ 'label' => __( 'Label Color', 'login-customizer' ),
291
+ 'section' => 'logincust_field_section',
292
+ 'priority' => 55,
293
+ 'settings' => 'login_customizer_options[logincust_field_label]',
294
+ )
295
+ )
296
+ );
297
+
298
+ $wp_customize->add_setting(
299
+ 'login_customizer_options[logincust_field_label_font_size]', array(
300
+ 'default' => '14px',
301
+ 'type' => 'option',
302
+ 'capability' => 'edit_theme_options',
303
+ 'sanitize_callback' => 'esc_html',
304
+ 'transport' => 'postMessage',
305
+ )
306
+ );
307
+
308
+ $wp_customize->add_control(
309
+ new O2_Customizer_Range_Slider_Control(
310
+ $wp_customize, 'login_customizer_options[logincust_field_label_font_size]', array(
311
+ 'label' => __( 'Label Font Size', 'login-customizer' ),
312
+ 'section' => 'logincust_field_section',
313
+ 'priority' => 60,
314
+ 'settings' => 'login_customizer_options[logincust_field_label_font_size]',
315
+ 'choices' => array(
316
+ 'percent' => false,
317
+ ),
318
+ 'input_attrs' => array(
319
+ 'min' => 0,
320
+ 'max' => 100,
321
+ 'step' => 1,
322
+ ),
323
+ )
324
+ )
325
+ );
inc/customizer/sections/section-form.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Form Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_form_section', array(
8
+ 'priority' => 15,
9
+ 'title' => __( 'Form', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_form_bg_image]', array(
16
+ 'type' => 'option',
17
+ 'capability' => 'edit_theme_options',
18
+ 'sanitize_callback' => 'esc_url_raw',
19
+ 'transport' => 'postMessage',
20
+ )
21
+ );
22
+
23
+ $wp_customize->add_control(
24
+ new WP_Customize_Image_Control(
25
+ $wp_customize, 'login_customizer_options[logincust_form_bg_image]', array(
26
+ 'label' => __( 'Background Image', 'login-customizer' ),
27
+ 'section' => 'logincust_form_section',
28
+ 'priority' => 5,
29
+ 'settings' => 'login_customizer_options[logincust_form_bg_image]',
30
+ )
31
+ )
32
+ );
33
+
34
+ $wp_customize->add_setting(
35
+ 'login_customizer_options[logincust_form_bg_color]', array(
36
+ 'default' => '#FFFFFF',
37
+ 'type' => 'option',
38
+ 'capability' => 'edit_theme_options',
39
+ 'sanitize_callback' => 'sanitize_text_field',
40
+ 'transport' => 'postMessage',
41
+ )
42
+ );
43
+
44
+ $wp_customize->add_control(
45
+ new LoginCust_Customize_Alpha_Color_Control(
46
+ $wp_customize, 'login_customizer_options[logincust_form_bg_color]', array(
47
+ 'label' => __( 'Background Color', 'login-customizer' ),
48
+ 'section' => 'logincust_form_section',
49
+ 'priority' => 10,
50
+ 'settings' => 'login_customizer_options[logincust_form_bg_color]',
51
+ )
52
+ )
53
+ );
54
+
55
+ $wp_customize->add_setting(
56
+ 'login_customizer_options[logincust_form_width]', array(
57
+ 'default' => '320px',
58
+ 'type' => 'option',
59
+ 'capability' => 'edit_theme_options',
60
+ 'sanitize_callback' => 'esc_html',
61
+ 'transport' => 'postMessage',
62
+ )
63
+ );
64
+
65
+ $wp_customize->add_control(
66
+ new O2_Customizer_Range_Slider_Control(
67
+ $wp_customize, 'login_customizer_options[logincust_form_width]', array(
68
+ 'label' => __( 'Width', 'login-customizer' ),
69
+ 'section' => 'logincust_form_section',
70
+ 'priority' => 15,
71
+ 'settings' => 'login_customizer_options[logincust_form_width]',
72
+ 'choices' => array(
73
+ 'percent' => true,
74
+ ),
75
+ 'input_attrs' => array(
76
+ 'min' => 0,
77
+ 'max' => 1000,
78
+ 'step' => 1,
79
+ ),
80
+ )
81
+ )
82
+ );
83
+
84
+ $wp_customize->add_setting(
85
+ 'login_customizer_options[logincust_form_height]', array(
86
+ 'default' => '194px',
87
+ 'type' => 'option',
88
+ 'capability' => 'edit_theme_options',
89
+ 'sanitize_callback' => 'esc_html',
90
+ 'transport' => 'postMessage',
91
+ )
92
+ );
93
+
94
+ $wp_customize->add_control(
95
+ new O2_Customizer_Range_Slider_Control(
96
+ $wp_customize, 'login_customizer_options[logincust_form_height]', array(
97
+ 'label' => __( 'Height', 'login-customizer' ),
98
+ 'section' => 'logincust_form_section',
99
+ 'priority' => 20,
100
+ 'settings' => 'login_customizer_options[logincust_form_height]',
101
+ 'choices' => array(
102
+ 'percent' => true,
103
+ ),
104
+ 'input_attrs' => array(
105
+ 'min' => 0,
106
+ 'max' => 1000,
107
+ 'step' => 1,
108
+ ),
109
+ )
110
+ )
111
+ );
112
+
113
+ $wp_customize->add_setting(
114
+ 'login_customizer_options[logincust_form_padding]', array(
115
+ 'default' => '26px 24px 46px',
116
+ 'type' => 'option',
117
+ 'capability' => 'edit_theme_options',
118
+ 'sanitize_callback' => 'esc_html',
119
+ 'transport' => 'postMessage',
120
+ )
121
+ );
122
+
123
+ $wp_customize->add_control(
124
+ new LoginCust_Padding_Control(
125
+ $wp_customize, 'login_customizer_options[logincust_form_padding]', array(
126
+ 'label' => __( 'Padding', 'login-customizer' ),
127
+ 'section' => 'logincust_form_section',
128
+ 'priority' => 25,
129
+ 'settings' => 'login_customizer_options[logincust_form_padding]',
130
+ )
131
+ )
132
+ );
133
+
134
+ $wp_customize->add_setting(
135
+ 'login_customizer_options[logincust_form_radius]', array(
136
+ 'default' => '0px',
137
+ 'type' => 'option',
138
+ 'capability' => 'edit_theme_options',
139
+ 'sanitize_callback' => 'esc_html',
140
+ 'transport' => 'postMessage',
141
+ )
142
+ );
143
+
144
+ $wp_customize->add_control(
145
+ new O2_Customizer_Range_Slider_Control(
146
+ $wp_customize, 'login_customizer_options[logincust_form_radius]', array(
147
+ 'label' => __( 'Radius', 'login-customizer' ),
148
+ 'section' => 'logincust_form_section',
149
+ 'priority' => 30,
150
+ 'settings' => 'login_customizer_options[logincust_form_radius]',
151
+ 'choices' => array(
152
+ 'percent' => false,
153
+ ),
154
+ 'input_attrs' => array(
155
+ 'min' => 0,
156
+ 'max' => 500,
157
+ 'step' => 1,
158
+ ),
159
+ )
160
+ )
161
+ );
162
+
163
+ $wp_customize->add_setting(
164
+ 'login_customizer_options[logincust_form_shadow_spread]', array(
165
+ 'default' => '3px',
166
+ 'type' => 'option',
167
+ 'capability' => 'edit_theme_options',
168
+ 'sanitize_callback' => 'esc_html',
169
+ 'transport' => 'postMessage',
170
+ )
171
+ );
172
+
173
+ $wp_customize->add_control(
174
+ new O2_Customizer_Range_Slider_Control(
175
+ $wp_customize, 'login_customizer_options[logincust_form_shadow_spread]', array(
176
+ 'label' => __( 'Shadow Spread', 'login-customizer' ),
177
+ 'section' => 'logincust_form_section',
178
+ 'priority' => 35,
179
+ 'settings' => 'login_customizer_options[logincust_form_shadow_spread]',
180
+ 'choices' => array(
181
+ 'percent' => false,
182
+ ),
183
+ 'input_attrs' => array(
184
+ 'min' => 0,
185
+ 'max' => 50,
186
+ 'step' => 1,
187
+ ),
188
+ )
189
+ )
190
+ );
191
+
192
+ $wp_customize->add_setting(
193
+ 'login_customizer_options[logincust_form_shadow]', array(
194
+ 'default' => 'rgba(0,0,0, 0.13)',
195
+ 'type' => 'option',
196
+ 'capability' => 'edit_theme_options',
197
+ 'sanitize_callback' => 'sanitize_text_field',
198
+ 'transport' => 'postMessage',
199
+ )
200
+ );
201
+
202
+ $wp_customize->add_control(
203
+ new LoginCust_Customize_Alpha_Color_Control(
204
+ $wp_customize, 'login_customizer_options[logincust_form_shadow]', array(
205
+ 'label' => __( 'Box Shadow', 'login-customizer' ),
206
+ 'section' => 'logincust_form_section',
207
+ 'priority' => 40,
208
+ 'settings' => 'login_customizer_options[logincust_form_shadow]',
209
+ )
210
+ )
211
+ );
inc/customizer/sections/section-logo.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Logo Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_logo_section', array(
8
+ 'priority' => 10,
9
+ 'title' => __( 'Logo', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_logo_show]', array(
16
+ 'default' => false,
17
+ 'type' => 'option',
18
+ 'capability' => 'edit_theme_options',
19
+ 'sanitize_callback' => 'absint',
20
+ 'transport' => 'postMessage',
21
+ )
22
+ );
23
+
24
+ $wp_customize->add_control(
25
+ new O2_Customizer_Toggle_Control(
26
+ $wp_customize, 'login_customizer_options[logincust_logo_show]', array(
27
+ 'label' => __( 'Disable Logo?', 'login-customizer' ),
28
+ 'section' => 'logincust_logo_section',
29
+ 'priority' => 5,
30
+ 'settings' => 'login_customizer_options[logincust_logo_show]',
31
+ )
32
+ )
33
+ );
34
+
35
+ $wp_customize->add_setting(
36
+ 'login_customizer_options[logincust_logo]', array(
37
+ 'type' => 'option',
38
+ 'capability' => 'edit_theme_options',
39
+ 'sanitize_callback' => 'esc_url_raw',
40
+ 'transport' => 'postMessage',
41
+ )
42
+ );
43
+
44
+ $wp_customize->add_control(
45
+ new WP_Customize_Image_Control(
46
+ $wp_customize, 'login_customizer_options[logincust_logo]', array(
47
+ 'label' => __( 'Logo', 'login-customizer' ),
48
+ 'section' => 'logincust_logo_section',
49
+ 'priority' => 10,
50
+ 'settings' => 'login_customizer_options[logincust_logo]',
51
+ )
52
+ )
53
+ );
54
+
55
+ $wp_customize->add_setting(
56
+ 'login_customizer_options[logincust_logo_width]', array(
57
+ 'default' => '84px',
58
+ 'type' => 'option',
59
+ 'capability' => 'edit_theme_options',
60
+ 'sanitize_callback' => 'esc_html',
61
+ 'transport' => 'postMessage',
62
+ )
63
+ );
64
+
65
+ $wp_customize->add_control(
66
+ new O2_Customizer_Range_Slider_Control(
67
+ $wp_customize, 'login_customizer_options[logincust_logo_width]', array(
68
+ 'label' => __( 'Logo Width', 'login-customizer' ),
69
+ 'section' => 'logincust_logo_section',
70
+ 'priority' => 15,
71
+ 'settings' => 'login_customizer_options[logincust_logo_width]',
72
+ 'choices' => array(
73
+ 'percent' => true,
74
+ ),
75
+ 'input_attrs' => array(
76
+ 'min' => 0,
77
+ 'max' => 1000,
78
+ 'step' => 1,
79
+ ),
80
+ )
81
+ )
82
+ );
83
+
84
+ $wp_customize->add_setting(
85
+ 'login_customizer_options[logincust_logo_height]', array(
86
+ 'default' => '84px',
87
+ 'type' => 'option',
88
+ 'capability' => 'edit_theme_options',
89
+ 'sanitize_callback' => 'esc_html',
90
+ 'transport' => 'postMessage',
91
+ )
92
+ );
93
+
94
+ $wp_customize->add_control(
95
+ new O2_Customizer_Range_Slider_Control(
96
+ $wp_customize, 'login_customizer_options[logincust_logo_height]', array(
97
+ 'label' => __( 'Logo Height', 'login-customizer' ),
98
+ 'section' => 'logincust_logo_section',
99
+ 'priority' => 20,
100
+ 'settings' => 'login_customizer_options[logincust_logo_height]',
101
+ 'choices' => array(
102
+ 'percent' => true,
103
+ ),
104
+ 'input_attrs' => array(
105
+ 'min' => 0,
106
+ 'max' => 1000,
107
+ 'step' => 1,
108
+ ),
109
+ )
110
+ )
111
+ );
112
+
113
+ $wp_customize->add_setting(
114
+ 'login_customizer_options[logincust_logo_padding]', array(
115
+ 'default' => '5px',
116
+ 'type' => 'option',
117
+ 'capability' => 'edit_theme_options',
118
+ 'sanitize_callback' => 'esc_html',
119
+ 'transport' => 'postMessage',
120
+ )
121
+ );
122
+
123
+ $wp_customize->add_control(
124
+ new O2_Customizer_Range_Slider_Control(
125
+ $wp_customize, 'login_customizer_options[logincust_logo_padding]', array(
126
+ 'label' => __( 'Padding Bottom', 'login-customizer' ),
127
+ 'section' => 'logincust_logo_section',
128
+ 'priority' => 25,
129
+ 'settings' => 'login_customizer_options[logincust_logo_padding]',
130
+ 'choices' => array(
131
+ 'percent' => true,
132
+ ),
133
+ 'input_attrs' => array(
134
+ 'min' => 0,
135
+ 'max' => 1000,
136
+ 'step' => 1,
137
+ ),
138
+ )
139
+ )
140
+ );
141
+
142
+ $wp_customize->add_setting(
143
+ 'login_customizer_options[logincust_logo_link]', array(
144
+ 'default' => 'https://wordpress.org/',
145
+ 'type' => 'option',
146
+ 'capability' => 'edit_theme_options',
147
+ 'sanitize_callback' => 'esc_url_raw',
148
+ )
149
+ );
150
+
151
+ $wp_customize->add_control(
152
+ 'login_customizer_options[logincust_logo_link]', array(
153
+ 'label' => __( 'Logo URL', 'login-customizer' ),
154
+ 'description' => __( 'The page where your logo will take you.', 'login-customizer' ),
155
+ 'section' => 'logincust_logo_section',
156
+ 'priority' => 30,
157
+ 'settings' => 'login_customizer_options[logincust_logo_link]',
158
+ )
159
+ );
inc/customizer/sections/section-more.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for More Cool Stuff Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_more_section', array(
8
+ 'priority' => 40,
9
+ 'title' => __( 'More Cool Stuff', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'latte_required_info', array(
16
+ 'sanitize_callback' => 'esc_html',
17
+ )
18
+ );
19
+
20
+ $wp_customize->add_control(
21
+ new Logincust_Cool_Stuff_Control(
22
+ $wp_customize, 'latte_required_info', array(
23
+ 'section' => 'logincust_more_section',
24
+ )
25
+ )
26
+ );
inc/customizer/sections/section-other.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Other Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_other_section', array(
8
+ 'priority' => 35,
9
+ 'title' => __( 'Other', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ if ( get_option( 'users_can_register' ) ) {
15
+
16
+ $wp_customize->add_setting(
17
+ 'login_customizer_options[logincust_field_register_link]', array(
18
+ 'default' => false,
19
+ 'type' => 'option',
20
+ 'capability' => 'edit_theme_options',
21
+ 'sanitize_callback' => 'absint',
22
+ 'transport' => 'postMessage',
23
+ )
24
+ );
25
+
26
+ $wp_customize->add_control(
27
+ new O2_Customizer_Toggle_Control(
28
+ $wp_customize, 'login_customizer_options[logincust_field_register_link]', array(
29
+ 'label' => __( 'Disable Register Link?', 'login-customizer' ),
30
+ 'section' => 'logincust_other_section',
31
+ 'priority' => 5,
32
+ 'settings' => 'login_customizer_options[logincust_field_register_link]',
33
+ )
34
+ )
35
+ );
36
+
37
+ }
38
+
39
+ $wp_customize->add_setting(
40
+ 'login_customizer_options[logincust_field_lost_password]', array(
41
+ 'default' => false,
42
+ 'type' => 'option',
43
+ 'capability' => 'edit_theme_options',
44
+ 'sanitize_callback' => 'absint',
45
+ 'transport' => 'postMessage',
46
+ )
47
+ );
48
+
49
+ $wp_customize->add_control(
50
+ new O2_Customizer_Toggle_Control(
51
+ $wp_customize, 'login_customizer_options[logincust_field_lost_password]', array(
52
+ 'label' => __( 'Disable Lost Password?', 'login-customizer' ),
53
+ 'section' => 'logincust_other_section',
54
+ 'priority' => 10,
55
+ 'settings' => 'login_customizer_options[logincust_field_lost_password]',
56
+ )
57
+ )
58
+ );
59
+
60
+ $wp_customize->add_setting(
61
+ 'login_customizer_options[logincust_field_back_blog]', array(
62
+ 'default' => false,
63
+ 'type' => 'option',
64
+ 'capability' => 'edit_theme_options',
65
+ 'sanitize_callback' => 'absint',
66
+ 'transport' => 'postMessage',
67
+ )
68
+ );
69
+
70
+ $wp_customize->add_control(
71
+ new O2_Customizer_Toggle_Control(
72
+ $wp_customize, 'login_customizer_options[logincust_field_back_blog]', array(
73
+ 'label' => __( 'Disable "Back to Website"?', 'login-customizer' ),
74
+ 'section' => 'logincust_other_section',
75
+ 'priority' => 15,
76
+ 'settings' => 'login_customizer_options[logincust_field_back_blog]',
77
+ )
78
+ )
79
+ );
80
+
81
+ $wp_customize->add_setting(
82
+ 'login_customizer_options[logincust_other_font_size]', array(
83
+ 'default' => '13px',
84
+ 'type' => 'option',
85
+ 'capability' => 'edit_theme_options',
86
+ 'sanitize_callback' => 'esc_html',
87
+ 'transport' => 'postMessage',
88
+ )
89
+ );
90
+
91
+ $wp_customize->add_control(
92
+ new O2_Customizer_Range_Slider_Control(
93
+ $wp_customize, 'login_customizer_options[logincust_other_font_size]', array(
94
+ 'label' => __( 'Font Size', 'login-customizer' ),
95
+ 'section' => 'logincust_other_section',
96
+ 'priority' => 15,
97
+ 'settings' => 'login_customizer_options[logincust_other_font_size]',
98
+ 'choices' => array(
99
+ 'percent' => false,
100
+ ),
101
+ 'input_attrs' => array(
102
+ 'min' => 0,
103
+ 'max' => 100,
104
+ 'step' => 1,
105
+ ),
106
+ )
107
+ )
108
+ );
109
+
110
+ $wp_customize->add_setting(
111
+ 'login_customizer_options[logincust_other_color]', array(
112
+ 'default' => '#999',
113
+ 'type' => 'option',
114
+ 'capability' => 'edit_theme_options',
115
+ 'sanitize_callback' => 'sanitize_hex_color',
116
+ 'transport' => 'postMessage',
117
+ )
118
+ );
119
+
120
+ $wp_customize->add_control(
121
+ new WP_Customize_Color_Control(
122
+ $wp_customize, 'login_customizer_options[logincust_other_color]', array(
123
+ 'label' => __( 'Text Color', 'login-customizer' ),
124
+ 'section' => 'logincust_other_section',
125
+ 'priority' => 20,
126
+ 'settings' => 'login_customizer_options[logincust_other_color]',
127
+ )
128
+ )
129
+ );
130
+
131
+ $wp_customize->add_setting(
132
+ 'login_customizer_options[logincust_other_color_hover]', array(
133
+ 'default' => '#2EA2CC',
134
+ 'type' => 'option',
135
+ 'capability' => 'edit_theme_options',
136
+ 'sanitize_callback' => 'sanitize_hex_color',
137
+ 'transport' => 'postMessage',
138
+ )
139
+ );
140
+
141
+ $wp_customize->add_control(
142
+ new WP_Customize_Color_Control(
143
+ $wp_customize, 'login_customizer_options[logincust_other_color_hover]', array(
144
+ 'label' => __( 'Text Color (Hover)', 'login-customizer' ),
145
+ 'section' => 'logincust_other_section',
146
+ 'priority' => 25,
147
+ 'settings' => 'login_customizer_options[logincust_other_color_hover]',
148
+ )
149
+ )
150
+ );
inc/customizer/sections/section-templates.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Background Section
4
+ */
5
+
6
+ $wp_customize->add_section(
7
+ 'logincust_templates', array(
8
+ 'priority' => 0,
9
+ 'title' => __( 'Templates', 'login-customizer' ),
10
+ 'panel' => 'logincust_panel',
11
+ )
12
+ );
13
+
14
+ $wp_customize->add_setting(
15
+ 'login_customizer_options[logincust_templates_control]', array(
16
+ 'default' => 'original',
17
+ 'type' => 'option',
18
+ 'capability' => 'edit_theme_options',
19
+ 'sanitize_callback' => 'logincust_sanitize_options',
20
+ )
21
+ );
22
+
23
+ $wp_customize->add_control(
24
+ new O2_Customizer_Radio_Images_Control(
25
+ $wp_customize, 'login_customizer_options[logincust_templates_control]', array(
26
+ 'label' => __( 'Templates', 'login-customizer' ),
27
+ 'section' => 'logincust_templates',
28
+ 'priority' => 5,
29
+ 'settings' => 'login_customizer_options[logincust_templates_control]',
30
+ 'choices' => array(
31
+ 'original' => LOGINCUST_FREE_URL . 'assets/templates/original.png',
32
+ 'dark' => LOGINCUST_FREE_URL . 'assets/templates/dark.png',
33
+ 'material' => LOGINCUST_FREE_URL . 'assets/templates/material.png',
34
+ ),
35
+ )
36
+ )
37
+ );
inc/include-page-template.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Including Login template as a page template.
4
+ * This library was adapted from http://www.wpexplorer.com/wordpress-page-templates-plugin/
5
+ */
6
+ class LoginCustomizerTemplate {
7
+
8
+ /**
9
+ * A reference to an instance of this class.
10
+ */
11
+ private static $instance;
12
+
13
+ /**
14
+ * The array of templates that this plugin tracks.
15
+ */
16
+ protected $templates;
17
+
18
+ /**
19
+ * Returns an instance of this class.
20
+ */
21
+ public static function get_instance() {
22
+
23
+ if ( null == self::$instance ) {
24
+ self::$instance = new LoginCustomizerTemplate();
25
+ }
26
+
27
+ return self::$instance;
28
+
29
+ }
30
+
31
+ /**
32
+ * Initializes the plugin by setting filters and administration functions.
33
+ */
34
+ private function __construct() {
35
+
36
+ $this->templates = array();
37
+
38
+ // Add a filter to the attributes metabox to inject template into the cache.
39
+ if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
40
+
41
+ // 4.6 and older
42
+ add_filter(
43
+ 'page_attributes_dropdown_pages_args',
44
+ array( $this, 'register_project_templates' )
45
+ );
46
+
47
+ } else {
48
+
49
+ // Add a filter to the wp 4.7 version attributes metabox
50
+ add_filter(
51
+ 'theme_page_templates', array( $this, 'add_new_template' )
52
+ );
53
+
54
+ }
55
+
56
+ // Add a filter to the save post to inject out template into the page cache
57
+ add_filter(
58
+ 'wp_insert_post_data',
59
+ array( $this, 'register_project_templates' )
60
+ );
61
+
62
+ // Add a filter to the template include to determine if the page has our
63
+ // template assigned and return it's path
64
+ add_filter(
65
+ 'template_include',
66
+ array( $this, 'view_project_template')
67
+ );
68
+
69
+ // Add your templates to this array.
70
+ $this->templates = array(
71
+ 'template-login-customizer.php' => __( 'Login Customizer Template', 'login-customizer' ),
72
+ );
73
+
74
+ }
75
+
76
+ /**
77
+ * Adds our template to the page dropdown for v4.7+
78
+ */
79
+ public function add_new_template( $posts_templates ) {
80
+ $posts_templates = array_merge( $posts_templates, $this->templates );
81
+ return $posts_templates;
82
+ }
83
+
84
+ /**
85
+ * Adds our template to the pages cache in order to trick WordPress
86
+ * into thinking the template file exists where it doens't really exist.
87
+ */
88
+ public function register_project_templates( $atts ) {
89
+
90
+ // Create the key used for the themes cache
91
+ $cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );
92
+
93
+ // Retrieve the cache list.
94
+ // If it doesn't exist, or it's empty prepare an array
95
+ $templates = wp_get_theme()->get_page_templates();
96
+ if ( empty( $templates ) ) {
97
+ $templates = array();
98
+ }
99
+
100
+ // New cache, therefore remove the old one
101
+ wp_cache_delete( $cache_key, 'themes' );
102
+
103
+ // Now add our template to the list of templates by merging our templates
104
+ // with the existing templates array from the cache.
105
+ $templates = array_merge( $templates, $this->templates );
106
+
107
+ // Add the modified cache to allow WordPress to pick it up for listing
108
+ // available templates
109
+ wp_cache_add( $cache_key, $templates, 'themes', 1800 );
110
+
111
+ return $atts;
112
+
113
+ }
114
+
115
+ /**
116
+ * Checks if the template is assigned to the page
117
+ */
118
+ public function view_project_template( $template ) {
119
+
120
+ // Get global post
121
+ global $post;
122
+
123
+ // Return template if post is empty
124
+ if ( ! $post ) {
125
+ return $template;
126
+ }
127
+
128
+ // Return default template if we don't have a custom one defined
129
+ if ( ! isset(
130
+ $this->templates[ get_post_meta(
131
+ $post->ID, '_wp_page_template', true
132
+ ) ]
133
+ ) ) {
134
+ return $template;
135
+ }
136
+
137
+ $file = plugin_dir_path( __FILE__ ) . get_post_meta(
138
+ $post->ID, '_wp_page_template', true
139
+ );
140
+
141
+ // Just to be safe, we check if the file exist first
142
+ if ( file_exists( $file ) ) {
143
+ return $file;
144
+ } else {
145
+ echo $file;
146
+ }
147
+
148
+ // Return template
149
+ return $template;
150
+
151
+ }
152
+
153
+ }
154
+
155
+ add_action( 'plugins_loaded', array( 'LoginCustomizerTemplate', 'get_instance' ) );
inc/initial-setup.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Automatically create a login page for the Customizer to use.
4
+ */
5
+ class LoginCustomizerSetup {
6
+
7
+ /**
8
+ * A reference to an instance of this class.
9
+ */
10
+ private static $instance;
11
+
12
+ /**
13
+ * Returns an instance of this class.
14
+ */
15
+ public static function get_instance() {
16
+ if ( null == self::$instance ) {
17
+ self::$instance = new LoginCustomizerSetup();
18
+ }
19
+
20
+ return self::$instance;
21
+ }
22
+
23
+ /**
24
+ * Initializes the plugin by setting filters and administration functions.
25
+ */
26
+ private function __construct() {
27
+ // Add a filter to load check_page function when all plugins have been loaded
28
+ add_action( 'wp_loaded', array( $this, 'check_page' ) );
29
+ }
30
+
31
+ /**
32
+ * Check if Login Customizer page exists.
33
+ */
34
+ public function check_page() {
35
+
36
+ // Get global wpdb
37
+ global $wpdb;
38
+
39
+ // Get page ID of page with Login Customizer template
40
+ $page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
41
+
42
+ // Update page if exists, else create a new one
43
+ if ( $page_id ) {
44
+ $this->update_page( $page_id );
45
+ } else {
46
+ $this->setup_page( 'login-customizer' );
47
+ }
48
+
49
+ }
50
+
51
+ /**
52
+ * If page exists, check if it's setup properly.
53
+ */
54
+ public function update_page( $page_id ) {
55
+
56
+ // Get page template from post meta
57
+ $page_template = get_post_meta( $page_id, '_wp_page_template', true );
58
+
59
+ // Check if using Login Customizer's page template
60
+ if ( $page_template != 'template-login-customizer.php' ) {
61
+ update_post_meta( $page_id, '_wp_page_template', 'template-login-customizer.php' );
62
+ }
63
+
64
+ // Get status of the post
65
+ $post_status = get_post_status( $page_id );
66
+
67
+ // Check and update post status to publish
68
+ if ( $post_status != 'publish' ) {
69
+ $page_data = array(
70
+ 'ID' => $page_id,
71
+ 'post_status' => 'publish',
72
+ );
73
+ wp_update_post( $page_data );
74
+ }
75
+
76
+ // Run update_option function
77
+ $this->update_option( $page_id );
78
+
79
+ }
80
+
81
+ /**
82
+ * Create new page if Login Customizer page doesn't exist.
83
+ */
84
+ public function setup_page( $slug ) {
85
+
86
+ // Store data for the page
87
+ $page_data = array(
88
+ 'post_status' => 'publish',
89
+ 'post_type' => 'page',
90
+ 'post_author' => 1,
91
+ 'post_name' => $slug,
92
+ 'post_title' => __( 'Login Customizer', 'login-customizer' ),
93
+ 'post_content' => __( 'This page is used for Login Customizer plugin. It will not be visible to your readers. Do not delete it.', 'login-customizer' ),
94
+ 'comment_status' => 'closed',
95
+ );
96
+
97
+ // Insert post data
98
+ $page_id = wp_insert_post( $page_data );
99
+
100
+ // Set page template to Login Customizer template
101
+ update_post_meta( $page_id, '_wp_page_template', 'template-login-customizer.php' );
102
+
103
+ // Run update_option function
104
+ $this->update_option( $page_id );
105
+
106
+ }
107
+
108
+ /**
109
+ * Update plugin options.
110
+ */
111
+ public function update_option( $page_id ) {
112
+
113
+ // Update plugin option with page ID and plugin version
114
+ if ( get_option( 'login_customizer_settings' ) !== false ) {
115
+ $options = get_option( 'login_customizer_settings', array() );
116
+ $options['page'] = $page_id;
117
+ $options['version'] = LOGINCUST_VERSION;
118
+ update_option( 'login_customizer_settings', $options );
119
+ }
120
+
121
+ }
122
+
123
+ }
inc/mailin.php ADDED
@@ -0,0 +1,868 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * SendinBlue REST client
5
+ */
6
+
7
+ class Mailin {
8
+
9
+ public $api_key;
10
+ public $base_url;
11
+ public $curl_opts = array();
12
+ public function __construct( $base_url, $api_key ) {
13
+ if ( ! function_exists( 'curl_init' ) ) {
14
+ throw new Exception( 'Mailin requires CURL module' );
15
+ }
16
+ $this->base_url = $base_url;
17
+ $this->api_key = $api_key;
18
+ }
19
+ /**
20
+ * Do CURL request with authorization
21
+ */
22
+ private function do_request( $resource, $method, $input ) {
23
+ $called_url = $this->base_url . '/' . $resource;
24
+ $ch = curl_init( $called_url );
25
+ $auth_header = 'api-key:' . $this->api_key;
26
+ $content_header = 'Content-Type:application/json';
27
+ if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
28
+ // Windows only over-ride
29
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
30
+ }
31
+ curl_setopt( $ch, CURLOPT_HTTPHEADER, array($auth_header, $content_header) );
32
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
33
+ curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $method );
34
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
35
+ curl_setopt( $ch, CURLOPT_HEADER, 0 );
36
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $input );
37
+ $data = curl_exec( $ch );
38
+ if ( curl_errno( $ch ) ) {
39
+ echo 'Curl error: ' . curl_error( $ch ) . '\n';
40
+ }
41
+ curl_close( $ch );
42
+ return json_decode( $data, true );
43
+ }
44
+ public function get( $resource, $input ) {
45
+ return $this->do_request( $resource, 'GET', $input );
46
+ }
47
+ public function put( $resource, $input ) {
48
+ return $this->do_request( $resource, 'PUT', $input );
49
+ }
50
+ public function post( $resource, $input ) {
51
+ return $this->do_request( $resource, 'POST', $input );
52
+ }
53
+ public function delete( $resource, $input ) {
54
+ return $this->do_request( $resource, 'DELETE', $input );
55
+ }
56
+
57
+ /*
58
+ Get Account.
59
+ No input required
60
+ */
61
+ public function get_account() {
62
+ return $this->get( 'account', '' );
63
+ }
64
+
65
+ /*
66
+ Get SMTP details.
67
+ No input required
68
+ */
69
+ public function get_smtp_details() {
70
+ return $this->get( 'account/smtpdetail', '' );
71
+ }
72
+
73
+ /*
74
+ Create Child Account.
75
+ @param {Array} data contains php array with key value pair.
76
+ @options data {String} child_email: Email address of Reseller child [Mandatory]
77
+ @options data {String} password: Password of Reseller child to login [Mandatory]
78
+ @options data {String} company_org: Name of Reseller child’s company [Mandatory]
79
+ @options data {String} first_name: First name of Reseller child [Mandatory]
80
+ @options data {String} last_name: Last name of Reseller child [Mandatory]
81
+ @options data {Array} credits: Number of email & sms credits respectively, which will be assigned to the Reseller child’s account [Optional]
82
+ - email_credit {Integer} number of email credits
83
+ - sms_credit {Integer} Number of sms credts
84
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
85
+ */
86
+ public function create_child_account( $data ) {
87
+ return $this->post( 'account', json_encode( $data ) );
88
+ }
89
+
90
+ /*
91
+ Update Child Account.
92
+ @param {Array} data contains php array with key value pair.
93
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
94
+ @options data {String} company_org: Name of Reseller child’s company [Optional]
95
+ @options data {String} first_name: First name of Reseller child [Optional]
96
+ @options data {String} last_name: Last name of Reseller child [Optional]
97
+ @options data {String} password: Password of Reseller child to login [Optional]
98
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
99
+ @options data {Array} disassociate_ip: Disassociate dedicated IPs from reseller child. You can use commas to separate multiple IPs [Optional]
100
+ */
101
+ public function update_child_account( $data ) {
102
+ return $this->put( 'account', json_encode( $data ) );
103
+ }
104
+
105
+ /*
106
+ Delete Child Account.
107
+ @param {Array} data contains php array with key value pair.
108
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be deleted [Mandatory]
109
+ */
110
+ public function delete_child_account( $data ) {
111
+ return $this->delete( 'account/' . $data['auth_key'], '' );
112
+ }
113
+
114
+ /*
115
+ Get Reseller child Account.
116
+ @param {Array} data contains php array with key value pair.
117
+ @options data {String} auth_key: 16 character authorization key of Reseller child. Example : To get the details of more than one child account, use, {"key1":"abC01De2fGHI3jkL","key2":"mnO45Pq6rSTU7vWX"} [Mandatory]
118
+ */
119
+ public function get_reseller_child( $data ) {
120
+ return $this->post( 'account/getchildv2', json_encode( $data ) );
121
+ }
122
+
123
+ /*
124
+ Add/Remove Reseller child's Email/Sms credits.
125
+ @param {Array} data contains php array with key value pair.
126
+ @options data {String} auth_key: 16 character authorization key of Reseller child to modify credits [Mandatory]
127
+ @options data {Array} add_credit: Number of email & sms credits to be added. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if rmv_credit is empty]
128
+ - email_credit {Integer} number of email credits
129
+ - sms_credit {Integer} Number of sms credts
130
+ @options data {Array} rmv_credit: Number of email & sms credits to be removed. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if add_credits is empty]
131
+ - email_credit {Integer} number of email credits
132
+ - sms_credit {Integer} Number of sms credts
133
+ */
134
+ public function add_remove_child_credits( $data ) {
135
+ return $this->post( 'account/addrmvcredit', json_encode( $data ) );
136
+ }
137
+
138
+ /*
139
+ Get a particular campaign detail.
140
+ @param {Array} data contains php array with key value pair.
141
+ @options data {Integer} id: Unique Id of the campaign [Mandatory]
142
+ */
143
+ public function get_campaign_v2( $data ) {
144
+ return $this->get( 'campaign/' . $data['id'] . '/detailsv2', '' );
145
+ }
146
+
147
+ /*
148
+ Get all campaigns detail.
149
+ @param {Array} data contains php array with key value pair.
150
+ @options data {String} type: Type of campaign. Possible values – classic, trigger, sms, template ( case sensitive ) [Optional]
151
+ @options data {String} status: Status of campaign. Possible values – draft, sent, archive, queued, suspended, in_process, temp_active, temp_inactive ( case sensitive ) [Optional]
152
+ @options data {Integer} page: Maximum number of records per request is 500, if there are more than 500 campaigns then you can use this parameter to get next 500 results [Optional]
153
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
154
+ */
155
+ public function get_campaigns_v2( $data ) {
156
+ return $this->get( 'campaign/detailsv2', json_encode( $data ) );
157
+ }
158
+
159
+ /*
160
+ Create and Schedule your campaigns. It returns the ID of the created campaign.
161
+ @param {Array} data contains php array with key value pair.
162
+ @options data {String} category: Tag name of the campaign [Optional]
163
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
164
+ @options data {String} name: Name of the campaign [Mandatory]
165
+ @options data {String} bat: Email address for test mail [Optional]
166
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
167
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
168
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
169
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
170
+ @options data {String} subject: Subject of the campaign [Mandatory]
171
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
172
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
173
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact attributes here, these should already exist in SendinBlue account [Optional]
174
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
175
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
176
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
177
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
178
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
179
+
180
+ */
181
+ public function create_campaign( $data ) {
182
+ return $this->post( 'campaign', json_encode( $data ) );
183
+ }
184
+
185
+ /*
186
+ Update your campaign.
187
+ @param {Array} data contains php array with key value pair.
188
+ @options data {Integer} id: Id of campaign to be modified [Mandatory]
189
+ @options data {String} category: Tag name of the campaign [Optional]
190
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
191
+ @options data {String} name: Name of the campaign [Optional]
192
+ @options data {String} bat: Email address for test mail [Optional]
193
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Optional]
194
+ @options data {String} html_url: Url which content is the body of content [Optional]
195
+ @options data {Array} listid These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
196
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
197
+ @options data {String} subject: Subject of the campaign.
198
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
199
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
200
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
201
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
202
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
203
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
204
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
205
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
206
+ */
207
+ public function update_campaign( $data ) {
208
+ $id = $data['id'];
209
+ unset( $data['id'] );
210
+ return $this->put( 'campaign/' . $id, json_encode( $data ) );
211
+ }
212
+
213
+ /*
214
+ Delete your campaigns.
215
+ @param {Array} data contains php array with key value pair.
216
+ @options data {Integer} id: Id of campaign to be deleted [Mandatory]
217
+ */
218
+ public function delete_campaign( $data ) {
219
+ return $this->delete( 'campaign/' . $data['id'], '' );
220
+ }
221
+
222
+ /*
223
+ Send report of Sent and Archived campaign.
224
+ @param {Array} data contains php array with key value pair.
225
+ @options data {Integer} id: Id of campaign to send its report [Mandatory]
226
+ @options data {String} lang: Language of email content. Possible values – fr (default), en, es, it & pt [Optional]
227
+ @options data {String} email_subject: Message subject [Mandatory]
228
+ @options data {Array} email_to: Email address of the recipient(s). Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
229
+ @options data {String} email_content_type: Body of the message in text/HTML version. Possible values – text & html [Mandatory]
230
+ @options data {Array} email_bcc: Same as email_to but for Bcc [Optional]
231
+ @options data {Array} email_cc: Same as email_to but for Cc [Optional]
232
+ @options data {String} email_body: Body of the message [Mandatory]
233
+ */
234
+ public function campaign_report_email( $data ) {
235
+ $id = $data['id'];
236
+ unset( $data['id'] );
237
+ return $this->post( 'campaign/' . $id . '/report', json_encode( $data ) );
238
+ }
239
+
240
+ /*
241
+ Export the recipients of a specified campaign.
242
+ @param {Array} data contains php array with key value pair.
243
+ @options data {Integer} id: Id of campaign to export its recipients [Mandatory]
244
+ @options data {String} notify_url: URL that will be called once the export process is finished [Mandatory]
245
+ @options data {String} type: Type of recipients. Possible values – all, non_clicker, non_opener, clicker, opener, soft_bounces, hard_bounces & unsubscribes [Mandatory]
246
+ */
247
+ public function campaign_recipients_export( $data ) {
248
+ $id = $data['id'];
249
+ unset( $data['id'] );
250
+ return $this->post( 'campaign/' . $id . '/recipients', json_encode( $data ) );
251
+ }
252
+
253
+ /*
254
+ Get the Campaign name, subject and share link of the classic type campaigns only which are sent, for those which are not sent and the rest of campaign types like trigger, template & sms, will return an error message of share link not available.
255
+ @param {Array} data contains php array with key value pair.
256
+ @options data {Array} camp_ids: Id of campaign to get share link. You can use commas to separate multiple ids [Mandatory]
257
+ */
258
+
259
+ public function share_campaign( $data ) {
260
+ return $this->post( 'campaign/sharelinkv2', json_encode( $data ) );
261
+ }
262
+
263
+ /*
264
+ Send a Test Campaign.
265
+ @param {Array} data contains php array with key value pair.
266
+ @options data {Integer} id: Id of the campaign [Mandatory]
267
+ @options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
268
+ */
269
+ public function send_bat_email( $data ) {
270
+ $id = $data['id'];
271
+ unset( $data['id'] );
272
+ return $this->post( 'campaign/' . $id . '/test', json_encode( $data ) );
273
+ }
274
+
275
+ /*
276
+ Update the Campaign status.
277
+ @param {Array} data contains php array with key value pair.
278
+ @options data {Integer} id: Id of campaign to update its status [Mandatory]
279
+ @options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sensitive ) [Mandatory]
280
+ */
281
+ public function update_campaign_status( $data ) {
282
+ $id = $data['id'];
283
+ unset( $data['id'] );
284
+ return $this->put( 'campaign/' . $id . '/updatecampstatus', json_encode( $data ) );
285
+ }
286
+
287
+ /*
288
+ Create and schedule your Trigger campaigns.
289
+ @param {Array} data contains php array with key value pair.
290
+ @options data {String} category: Tag name of the campaign [Optional]
291
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
292
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
293
+ @options data {String} bat: Email address for test mail [Optional]
294
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
295
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
296
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
297
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
298
+ @options data {String} subject: Subject of the campaign [Mandatory]
299
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
300
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
301
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
302
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
303
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
304
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
305
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
306
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
307
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
308
+ */
309
+ public function create_trigger_campaign( $data ) {
310
+ return $this->post( 'campaign', json_encode( $data ) );
311
+ }
312
+
313
+ /*
314
+ Update and schedule your Trigger campaigns.
315
+ @param {Array} data contains php array with key value pair.
316
+ @options data {Integer} id: Id of Trigger campaign to be modified [Mandatory]
317
+ @options data {String} category: Tag name of the campaign [Optional]
318
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
319
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
320
+ @options data {String} bat Email address for test mail [Optional]
321
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
322
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
323
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
324
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
325
+ @options data {String} subject: Subject of the campaign [Mandatory]
326
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
327
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
328
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
329
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
330
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
331
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
332
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
333
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
334
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
335
+ */
336
+ public function update_trigger_campaign( $data ) {
337
+ $id = $data['id'];
338
+ unset( $data['id'] );
339
+ return $this->put( 'campaign/' . $id, json_encode( $data ) );
340
+ }
341
+
342
+ /*
343
+ Get all folders detail.
344
+ @param {Array} data contains php array with key value pair.
345
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 folders then you can use this parameter to get next 50 results [Mandatory]
346
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
347
+ */
348
+ public function get_folders( $data ) {
349
+ return $this->get( 'folder', json_encode( $data ) );
350
+ }
351
+
352
+ /*
353
+ Get a particular folder detail.
354
+ @param {Array} data contains php array with key value pair.
355
+ @options data {Integer} id: Id of folder to get details [Mandatory]
356
+ */
357
+ public function get_folder( $data ) {
358
+ return $this->get( 'folder/' . $data['id'], '' );
359
+ }
360
+
361
+ /*
362
+ Create a new folder.
363
+ @param {Array} data contains php array with key value pair.
364
+ @options data {String} name: Desired name of the folder to be created [Mandatory]
365
+ */
366
+ public function create_folder( $data ) {
367
+ return $this->post( 'folder', json_encode( $data ) );
368
+ }
369
+
370
+ /*
371
+ Delete a specific folder information.
372
+ @param {Array} data contains php array with key value pair.
373
+ @options data {Integer} id: Id of folder to be deleted [Mandatory]
374
+ */
375
+ public function delete_folder( $data ) {
376
+ return $this->delete( 'folder/' . $data['id'], '' );
377
+ }
378
+
379
+ /*
380
+ Update an existing folder.
381
+ @param {Array} data contains php array with key value pair.
382
+ @options data {Integer} id: Id of folder to be modified [Mandatory]
383
+ @options data {String} name: Desired name of the folder to be modified [Mandatory]
384
+ */
385
+ public function update_folder( $data ) {
386
+ $id = $data['id'];
387
+ unset( $data['id'] );
388
+ return $this->put( 'folder/' . $id, json_encode( $data ) );
389
+ }
390
+
391
+ /*
392
+ Get all lists detail.
393
+ @param {Array} data contains php array with key value pair.
394
+ @options data {Integer} list_parent: This is the existing folder id & can be used to get all lists belonging to it [Optional]
395
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
396
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
397
+ */
398
+ public function get_lists( $data ) {
399
+ return $this->get( 'list', json_encode( $data ) );
400
+ }
401
+
402
+ /*
403
+ Get a particular list detail.
404
+ @param {Array} data contains php array with key value pair.
405
+ @options data {Integer} id: Id of list to get details [Mandatory]
406
+ */
407
+ public function get_list( $data ) {
408
+ return $this->get( 'list/' . $data['id'], '' );
409
+ }
410
+
411
+ /*
412
+ Create a new list.
413
+ @param {Array} data contains php array with key value pair.
414
+ @options data {String} list_name: Desired name of the list to be created [Mandatory]
415
+ @options data {Integer} list_parent: Folder ID [Mandatory]
416
+ */
417
+ public function create_list( $data ) {
418
+ return $this->post( 'list', json_encode( $data ) );
419
+ }
420
+
421
+ /*
422
+ Update a list.
423
+ @param {Array} data contains php array with key value pair.
424
+ @options data {Integer} id: Id of list to be modified [Mandatory]
425
+ @options data {String} list_name: Desired name of the list to be modified [Optional]
426
+ @options data {Integer} list_parent: Folder ID [Mandatory]
427
+ */
428
+ public function update_list( $data ) {
429
+ $id = $data['id'];
430
+ unset( $data['id'] );
431
+ return $this->put( 'list/' . $id, json_encode( $data ) );
432
+ }
433
+
434
+ /*
435
+ Delete a specific list.
436
+ @param {Array} data contains php array with key value pair.
437
+ @options data {Integer} id: Id of list to be deleted [Mandatory]
438
+ */
439
+ public function delete_list( $data ) {
440
+ return $this->delete( 'list/' . $data['id'], '' );
441
+ }
442
+
443
+ /*
444
+ Display details of all users for the given lists.
445
+ @param {Array} data contains php array with key value pair.
446
+ @options data {Array} listids: These are the list ids to get their data. The ids found will display records [Mandatory]
447
+ @options data {String} timestamp: This is date-time filter to fetch modified user records >= this time. Valid format Y-m-d H:i:s. Example: "2015-05-22 14:30:00" [Optional]
448
+ @options data {Integer} page: Maximum number of records per request is 500, if in your list there are more than 500 users then you can use this parameter to get next 500 results [Optional]
449
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
450
+ */
451
+ public function display_list_users( $data ) {
452
+ return $this->post( 'list/display', json_encode( $data ) );
453
+ }
454
+
455
+ /*
456
+ Add already existing users in the SendinBlue contacts to the list.
457
+ @param {Array} data contains php array with key value pair.
458
+ @options data {Integer} id: Id of list to link users in it [Mandatory]
459
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
460
+ */
461
+
462
+ public function add_users_list( $data ) {
463
+ $id = $data['id'];
464
+ unset( $data['id'] );
465
+ return $this->post( 'list/' . $id . '/users', json_encode( $data ) );
466
+ }
467
+
468
+ /*
469
+ Delete already existing users in the SendinBlue contacts from the list.
470
+ @param {Array} data contains php array with key value pair.
471
+ @options data {Integer} id: Id of list to unlink users from it [Mandatory]
472
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be modified. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
473
+ */
474
+ public function delete_users_list( $data ) {
475
+ $id = $data['id'];
476
+ unset( $data['id'] );
477
+ return $this->delete( 'list/' . $id . '/delusers', json_encode( $data ) );
478
+ }
479
+
480
+ /*
481
+ Access all the attributes information under the account.
482
+ No input required
483
+ */
484
+ public function get_attributes() {
485
+ return $this->get( 'attribute', '' );
486
+ }
487
+
488
+ /*
489
+ Access the specific type of attribute information.
490
+ @param {Array} data contains php array with key value pair.
491
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global [Optional]
492
+ */
493
+ public function get_attribute( $data ) {
494
+ return $this->get( 'attribute/' . $data['type'], '' );
495
+ }
496
+
497
+ /*
498
+ Create an Attribute.
499
+ @param {Array} data contains php array with key value pair.
500
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global ( case sensitive ) [Mandatory]
501
+ @options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute to be created in your SendinBlue account. It should be sent as an associative array. Example: array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′).
502
+ The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string. Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2", "value":"Attribute_value2" }]’. You can use commas to separate multiple attributes [Mandatory]
503
+ */
504
+ public function create_attribute( $data ) {
505
+ return $this->post( 'attribute/', json_encode( $data ) );
506
+ }
507
+
508
+ /*
509
+ Delete a specific type of attribute information.
510
+ @param {Array} data contains php array with key value pair.
511
+ @options data {Integer} type: Type of attribute to be deleted [Mandatory]
512
+ */
513
+ public function delete_attribute( $type, $data ) {
514
+ $type = $data['type'];
515
+ unset( $data['type'] );
516
+ return $this->post( 'attribute/' . $type, json_encode( $data ) );
517
+ }
518
+
519
+ /*
520
+ Create a new user if an email provided as input, doesn’t exists in the contact list of your SendinBlue account, otherwise it will update the existing user.
521
+ @param {Array} data contains php array with key value pair.
522
+ @options data {String} email: Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory]
523
+ @options data {Array} attributes: The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
524
+ @options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional]
525
+ @options data {Array} listid: The list id(s) to be linked from user [Optional]
526
+ @options data {Array} listid_unlink: The list id(s) to be unlinked from user [Optional]
527
+ @options data {Array} blacklisted_sms: This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional]
528
+ */
529
+ public function create_update_user( $data ) {
530
+ return $this->post( 'user/createdituser', json_encode( $data ) );
531
+ }
532
+
533
+ /*
534
+ Get Access a specific user Information.
535
+ @param {Array} data contains php array with key value pair.
536
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts [Mandatory]
537
+ */
538
+ public function get_user( $data ) {
539
+ return $this->get( 'user/' . $data['email'], '' );
540
+ }
541
+
542
+ /*
543
+ Unlink existing user from all lists.
544
+ @param {Array} data contains php array with key value pair.
545
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory]
546
+ */
547
+ public function delete_user( $data ) {
548
+ return $this->delete( 'user/' . $data['email'], '' );
549
+ }
550
+
551
+ /*
552
+ Import Users Information.
553
+ @param {Array} data contains php array with key value pair.
554
+ @options data {String} url: The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty]
555
+ @options data {String} body: The Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n"Name1";"Surname1";"example1@example.net"\n"Name2";"Surname2";"example2@example.net"‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty]
556
+ @options data {Array} listids: These are the list ids in which the the users will be imported [Mandatory: if name is empty]
557
+ @options data {String} notify_url: URL that will be called once the import process is finished [Optional] In notify_url, we are sending the content using POST method
558
+ @options data {String} name: This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty]
559
+ @options data {Integer} list_parent: This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional]
560
+ */
561
+ public function import_users( $data ) {
562
+ return $this->post( 'user/import', json_encode( $data ) );
563
+ }
564
+
565
+ /*
566
+ Export Users Information.
567
+ @param {Array} data contains php array with key value pair.
568
+ @options data {String} export_attrib: The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional]
569
+ @options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}", will export all blacklisted users [Mandatory]
570
+ @options data {String} notify_url: URL that will be called once the export process is finished [Optional]
571
+ */
572
+ public function export_users( $data ) {
573
+ return $this->post( 'user/export', json_encode( $data ) );
574
+ }
575
+
576
+ /*
577
+ Get all the processes information under the account.
578
+ @param {Array} data contains php array with key value pair.
579
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
580
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
581
+ */
582
+ public function get_processes( $data ) {
583
+ return $this->get( 'process', json_encode( $data ) );
584
+ }
585
+
586
+ /*
587
+ Get the process information.
588
+ @param {Array} data contains php array with key value pair.
589
+ @options data {Integer} id: Id of process to get details [Mandatory]
590
+ */
591
+ public function get_process( $data ) {
592
+ return $this->get( 'process/' . $data['id'], '' );
593
+ }
594
+
595
+ /*
596
+ To retrieve details of all webhooks.
597
+ @param {Array} data contains php array with key value pair.
598
+ @options data {String} is_plat: Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat="" [Optional]
599
+ */
600
+ public function get_webhooks( $data ) {
601
+ return $this->get( 'webhook', json_encode( $data ) );
602
+ }
603
+
604
+ /*
605
+ To retrieve details of any particular webhook.
606
+ @param {Array} data contains php array with key value pair.
607
+ @options data {Integer} id: Id of webhook to get details [Mandatory]
608
+ */
609
+ public function get_webhook( $data ) {
610
+ return $this->get( 'webhook/' . $data['id'], '' );
611
+ }
612
+
613
+ /*
614
+ Create a Webhook.
615
+ @param {Array} data contains php array with key value pair.
616
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
617
+ @options data {String} description: Webook description [Optional]
618
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
619
+ @options data {Integer} is_plat: Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional]
620
+ */
621
+ public function create_webhook( $data ) {
622
+ return $this->post( 'webhook', json_encode( $data ) );
623
+ }
624
+
625
+ /*
626
+ Delete a webhook.
627
+ @param {Array} data contains php array with key value pair.
628
+ @options data {Integer} id: Id of webhook to be deleted [Mandatory]
629
+ */
630
+ public function delete_webhook( $data ) {
631
+ return $this->delete( 'webhook/' . $data['id'], '' );
632
+ }
633
+
634
+ /*
635
+ Update a webhook.
636
+ @param {Array} data contains php array with key value pair.
637
+ @options data {Integer} id: Id of webhook to be modified [Mandatory]
638
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
639
+ @options data {String} description: Webook description [Optional]
640
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
641
+ */
642
+ public function update_webhook( $data ) {
643
+ $id = $data['id'];
644
+ unset( $data['id'] );
645
+ return $this->put( 'webhook/' . $id, json_encode( $data ) );
646
+ }
647
+
648
+ /*
649
+ Get Access of created senders information.
650
+ @param {Array} data contains php array with key value pair.
651
+ @options data {String} option: Options to get senders. Possible options – IP-wise, & Domain-wise ( only for dedicated IP clients ). Example: to get senders with specific IP, use $option=’1.2.3.4′, to get senders with specific domain use, $option=’domain.com’, & to get all senders, use $option="" [Optional]
652
+ */
653
+ public function get_senders( $data ) {
654
+ return $this->get( 'advanced', json_encode( $data ) );
655
+ }
656
+
657
+ /*
658
+ Create your Senders.
659
+ @param {Array} data contains php array with key value pair.
660
+ @options data {String} name: Name of the sender [Mandatory]
661
+ @options data {String} email: Email address of the sender [Mandatory]
662
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
663
+ */
664
+ public function create_sender( $data ) {
665
+ return $this->post( 'advanced', json_encode( $data ) );
666
+ }
667
+
668
+ /*
669
+ Update your Senders.
670
+ @param {Array} data contains php array with key value pair.
671
+ @options data {Integer} id: Id of sender to be modified [Mandatory]
672
+ @options data {String} name: Name of the sender [Mandatory]
673
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
674
+ */
675
+ public function update_sender( $data ) {
676
+ $id = $data['id'];
677
+ unset( $data['id'] );
678
+ return $this->put( 'advanced/' . $id, json_encode( $data ) );
679
+ }
680
+
681
+ /*
682
+ Delete your Sender Information.
683
+ @param {Array} data contains php array with key value pair.
684
+ @options data {Integer} id: Id of sender to be deleted [Mandatory]
685
+ */
686
+ public function delete_sender( $data ) {
687
+ return $this->delete( 'advanced/' . $data['id'], '' );
688
+ }
689
+
690
+ /*
691
+ Send Transactional Email.
692
+ @param {Array} data contains php array with key value pair.
693
+ @options data {Array} to: Email address of the recipient(s). It should be sent as an associative array. Example: array("to@example.net"=>"to whom"). You can use commas to separate multiple recipients [Mandatory]
694
+ @options data {String} subject: Message subject [Mandatory]
695
+ @options data {Array} from Email address for From header. It should be sent as an array. Example: array("from@email.com","from email") [Mandatory]
696
+ @options data {String} html: Body of the message. (HTML version) [Mandatory]. To send inline images, use <img src="{YourFileName.Extension}" alt="image" border="0" >, the 'src' attribute value inside {} (curly braces) should be same as the filename used in 'inline_image' parameter
697
+ @options data {String} text: Body of the message. (text version) [Optional]
698
+ @options data {Array} cc: Same as to but for Cc. Example: array("cc@example.net","cc whom") [Optional]
699
+ @options data {Array} bcc: Same as to but for Bcc. Example: array("bcc@example.net","bcc whom") [Optional]
700
+ @options data {Array} replyto: Same as from but for Reply To. Example: array("from@email.com","from email") [Optional]
701
+ @options data {Array} attachment: Provide the absolute url of the attachment/s. Possible extension values = gif, png, bmp, cgm, jpg, jpeg, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, xls, ppt, tar, and ez. To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple attachments [Optional]
702
+ @options data {Array} headers: The headers will be sent along with the mail headers in original email. Example: array("Content-Type"=>"text/html; charset=iso-8859-1"). You can use commas to separate multiple headers [Optional]
703
+ @options data {Array} inline_image: Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple inline images [Optional]
704
+ */
705
+ public function send_email( $data ) {
706
+ return $this->post( 'email', json_encode( $data ) );
707
+ }
708
+
709
+ /*
710
+ Aggregate / date-wise report of the SendinBlue SMTP account.
711
+ @param {Array} data contains php array with key value pair.
712
+ @options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals. Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per day/date wise [Optional]
713
+ @options data {String} start_date: The start date to look up statistics. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
714
+ @options data {String} end_date: The end date to look up statistics. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
715
+ @options data {Integer} days: Number of days in the past to include statistics ( Includes today ). It must be an integer greater than 0 [Optional]
716
+ @options data {String} tag: The tag you will specify to retrieve detailed stats. It must be an existing tag that has statistics [Optional]
717
+ */
718
+ public function get_statistics( $data ) {
719
+ return $this->post( 'statistics', json_encode( $data ) );
720
+ }
721
+
722
+ /*
723
+ Get Email Event report.
724
+ @param {Array} data contains php array with key value pair.
725
+ @options data {Integer} limit: To limit the number of results returned. It should be an integer [Optional]
726
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
727
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
728
+ @options data {Integer} offset: Beginning point in the list to retrieve from. It should be an integer [Optional]
729
+ @options data {String} date: Specific date to get its report. Date must be in YYYY-MM-DD format and should be earlier than todays date [Optional]
730
+ @options data {Integer} days: Number of days in the past (includes today). If specified, must be an integer greater than 0 [Optional]
731
+ @options data {String} email: Email address to search report for [Optional]
732
+ */
733
+ public function get_report( $data ) {
734
+ return $this->post( 'report', json_encode( $data ) );
735
+ }
736
+
737
+ /*
738
+ Delete any hardbounce, which actually would have been blocked due to some temporary ISP failures.
739
+ @param {Array} data contains php array with key value pair.
740
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
741
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
742
+ @options data {String} email: Email address to delete its bounces [Optional]
743
+ */
744
+ public function delete_bounces( $data ) {
745
+ return $this->post( 'bounces', json_encode( $data ) );
746
+ }
747
+
748
+ /*
749
+ Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
750
+ @param {Array} data contains php array with key value pair.
751
+ @options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
752
+ @options data {String} to: Email address of the recipient(s). You can use pipe ( | ) to separate multiple recipients. Example: "to-example@example.net|to2-example@example.net" [Mandatory]
753
+ @options data {String} cc: Same as to but for Cc [Optional]
754
+ @options data {String} bcc: Same as to but for Bcc [Optional]
755
+ @options data {Array} attrv The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
756
+ @options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere [Optional]
757
+ @options data {Array} attachment: To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array [Optional]
758
+ */
759
+ public function send_transactional_template( $data ) {
760
+ $id = $data['id'];
761
+ unset( $data['id'] );
762
+ return $this->put( 'template/' . $id, json_encode( $data ) );
763
+ }
764
+
765
+ /*
766
+ Create a Template.
767
+ @param {Array} data contains php array with key value pair.
768
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
769
+ @options data {String} template_name: Name of the Template [Mandatory]
770
+ @options data {String} bat: Email address for test mail [Optional]
771
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
772
+ @options data {String} html_url Url: which content is the body of content [Mandatory: if html_content is empty]
773
+ @options data {String} subject: Subject of the campaign [Mandatory]
774
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
775
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
776
+ @options data {String} to_fieldv This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
777
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
778
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
779
+ */
780
+ public function create_template( $data ) {
781
+ return $this->post( 'template', json_encode( $data ) );
782
+ }
783
+
784
+ /*
785
+ Update a Template.
786
+ @param {Array} data contains php array with key value pair.
787
+ @options data {Integer} id: Id of Template to be modified [Mandatory]
788
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
789
+ @options data {String} template_name: Name of the Template [Mandatory]
790
+ @options data {String} bat: Email address for test mail [Optional]
791
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
792
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
793
+ @options data {String} subject: Subject of the campaign [Mandatory]
794
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
795
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
796
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
797
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
798
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
799
+ */
800
+ public function update_template( $data ) {
801
+ $id = $data['id'];
802
+ unset( $data['id'] );
803
+ return $this->put( 'template/' . $id, json_encode( $data ) );
804
+ }
805
+
806
+ /*
807
+ Send a transactional SMS.
808
+ @param {Array} data contains php array with key value pair.
809
+ @options data {String} to: The mobile number to send SMS to with country code [Mandatory]
810
+ @options data {String} from: The name of the sender. The number of characters is limited to 11 (alphanumeric format) [Mandatory]
811
+ @options data {String} text: The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory]
812
+ @options data {String} web_url: The web URL that can be called once the message is successfully delivered [Optional]
813
+ @options data {String} tag: The tag that you can associate with the message [Optional]
814
+ @options data {String} type: Type of message. Possible values – marketing (default) & transactional. You can use marketing for sending marketing SMS, & for sending transactional SMS, use transactional type [Optional]
815
+ */
816
+ public function send_sms( $data ) {
817
+ return $this->post( 'sms', json_encode( $data ) );
818
+ }
819
+
820
+ /*
821
+ Create & Schedule your SMS campaigns.
822
+ @param {Array} data contains php array with key value pair.
823
+ @options data {String} name: Name of the SMS campaign [Mandatory]
824
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
825
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
826
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
827
+ @options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
828
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
829
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
830
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
831
+ */
832
+ public function create_sms_campaign( $data ) {
833
+ return $this->post( 'sms', json_encode( $data ) );
834
+ }
835
+
836
+ /*
837
+ Update your SMS campaigns.
838
+ @param {Array} data contains php array with key value pair.
839
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
840
+ @options data {String} name: Name of the SMS campaign [Optional]
841
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
842
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
843
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
844
+ @options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
845
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
846
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
847
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
848
+ */
849
+ public function update_sms_campaign( $data ) {
850
+ $id = $data['id'];
851
+ unset( $data['id'] );
852
+ return $this->put( 'sms/' . $id, json_encode( $data ) );
853
+ }
854
+
855
+ /*
856
+ Send a Test SMS.
857
+ @param {Array} data contains php array with key value pair.
858
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
859
+ @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory]
860
+ */
861
+ public function send_bat_sms( $data ) {
862
+ $id = $data['id'];
863
+ unset( $data['id'] );
864
+ return $this->get( 'sms/' . $id, json_encode( $data ) );
865
+ }
866
+
867
+ }
868
+
inc/template-login-customizer.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Name: Login Customizer
4
+ *
5
+ * Template to display login page for customization purposes. It's used to avoid loading wp-login.php page, which isn't the best way to do it.
6
+ * A stripped-down version of wp-login.php form made to work with Login Customizer.
7
+ */
8
+
9
+ /**
10
+ * Redirect to homepage if not loaded inside Customizer.
11
+ */
12
+ if ( ! is_customize_preview() ) {
13
+ if ( is_multisite() ) {
14
+ $url = esc_url( network_home_url( '/' ) );
15
+ } else {
16
+ $url = esc_url( home_url( '/' ) );
17
+ }
18
+ wp_safe_redirect( $url );
19
+ }
20
+ ?>
21
+
22
+ <!DOCTYPE html>
23
+ <html>
24
+ <head>
25
+ <?php
26
+ $login_title = sprintf(
27
+ __( '%1$s &lsaquo; %2$s &#8212; WordPress', 'login-customizer' ), __( 'Log In', 'login-customizer' ), get_bloginfo( 'name', 'display' )
28
+ );
29
+ ?>
30
+ <title><?php echo esc_attr( $login_title ); ?></title>
31
+ <?php
32
+ wp_enqueue_style( 'login' );
33
+ do_action( 'login_enqueue_scripts' );
34
+ do_action( 'login_head' );
35
+ ?>
36
+ </head>
37
+ <?php
38
+ do_action( 'login_form_login' );
39
+
40
+ $action = 'login';
41
+
42
+ $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
43
+
44
+ if ( is_multisite() ) {
45
+ $login_header_url = network_home_url();
46
+ $login_header_title = get_network()->site_name;
47
+ } else {
48
+ $login_header_url = __( 'https://wordpress.org/', 'login-customizer' );
49
+ $login_header_title = __( 'Powered by WordPress', 'login-customizer' );
50
+ }
51
+
52
+ $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
53
+
54
+ $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
55
+
56
+ if ( is_multisite() ) {
57
+ $login_header_text = get_bloginfo( 'name', 'display' );
58
+ } else {
59
+ $login_header_text = $login_header_title;
60
+ }
61
+
62
+ $classes = array( 'login-action-' . $action, 'wp-core-ui' );
63
+ if ( is_rtl() ) {
64
+ $classes[] = 'rtl';
65
+ }
66
+
67
+ $classes = apply_filters( 'login_body_class', $classes, $action );
68
+ ?>
69
+ <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
70
+ <?php do_action( 'login_header' ); ?>
71
+ <div id="login">
72
+ <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1"><?php echo $login_header_text; ?></a></h1>
73
+ <form name="loginform" id="loginform">
74
+ <p>
75
+ <label for="user_login"><?php _e( 'Username or Email Address', 'login-customizer' ); ?><br />
76
+ <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
77
+ </p>
78
+ <p>
79
+ <label for="user_pass"><?php _e( 'Password', 'login-customizer' ); ?><br />
80
+ <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
81
+ </p>
82
+ <?php do_action( 'login_form' ); ?>
83
+ <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php esc_html_e( 'Remember Me', 'login-customizer' ); ?></label></p>
84
+ <p class="submit">
85
+ <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'login-customizer' ); ?>" />
86
+ </p>
87
+ </form>
88
+ <p id="nav">
89
+ <?php
90
+ if ( get_option( 'users_can_register' ) ) :
91
+ $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'login-customizer' ) );
92
+ /** This filter is documented in wp-includes/general-template.php */
93
+ echo apply_filters( 'register', $registration_url );
94
+ echo esc_html( $login_link_separator );
95
+ endif;
96
+ ?>
97
+ <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'login-customizer' ); ?></a>
98
+ </p>
99
+ <p id="backtoblog">
100
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
101
+ <?php
102
+ /* translators: %s: site title */
103
+ printf( _x( '&larr; Back to %s', 'site', 'login-customizer' ), get_bloginfo( 'title', 'display' ) );
104
+ ?>
105
+ </a>
106
+ </p>
107
+ </div>
108
+ <?php
109
+ do_action( 'login_footer' );
110
+ $options = get_option( 'login_customizer_options' );
111
+ global $options;
112
+ echo '<script type="text/javascript">' . $options['logincust_other_js'] . '</script>';
113
+ wp_footer();
114
+ ?>
115
+ </body>
116
+ </html>
index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // You're a Jedi!
js/admin.js DELETED
@@ -1,8 +0,0 @@
1
- /* global login_cust */
2
- (function($) {
3
- wp.customize( login_cust.name, function( value ) {
4
- value.bind( function( to ) {
5
- $( 'html, body' ).css('background-color', to);
6
- } );
7
- } );
8
- })( jQuery, login_cust );
 
 
 
 
 
 
 
 
languages/login-customizer.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the no.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Custom Login Page Customizer 1.2.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/login-customizer/issues\n"
7
- "POT-Creation-Date: 2018-01-05 15:00:54+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -24,225 +24,347 @@ msgstr ""
24
  "X-Poedit-Bookmarks: \n"
25
  "X-Textdomain-Support: yes\n"
26
 
27
- #: customizer.php:9 dist/customizer.php:9 dist/option-panel.php:3
28
- #: dist/option-panel.php:17 option-panel.php:3 option-panel.php:17
29
- msgid "Login Customizer"
 
 
30
  msgstr ""
31
 
32
- #: customizer.php:10 dist/customizer.php:10
33
  msgid ""
34
- "This section allows you to customize the login page of your "
35
- "website.<br/>Login Customizer by <a target=\"_blank\" rel=\"nofollow\" "
36
- "href=\"https://themeisle.com\">ThemeIsle</a>"
37
  msgstr ""
38
 
39
- #: customizer.php:17 dist/customizer.php:17
40
- msgid "Logo"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  msgstr ""
42
 
43
- #: customizer.php:25 dist/customizer.php:25
 
 
44
  msgid "Background"
45
  msgstr ""
46
 
47
- #: customizer.php:33 dist/customizer.php:33
48
- msgid "Form Background"
 
49
  msgstr ""
50
 
51
- #: customizer.php:41 dist/customizer.php:41
52
- msgid "Form Styling"
 
53
  msgstr ""
54
 
55
- #: customizer.php:49 dist/customizer.php:49
56
- msgid "Fields Styling"
57
  msgstr ""
58
 
59
- #: customizer.php:57 dist/customizer.php:57
60
- msgid "Button Styling"
61
  msgstr ""
62
 
63
- #: customizer.php:65 dist/customizer.php:65
64
- msgid "Other"
65
  msgstr ""
66
 
67
- #: customizer.php:73 dist/customizer.php:73
68
- msgid "Security"
69
  msgstr ""
70
 
71
- #: customizer.php:88 dist/customizer.php:88
72
- msgid "Login Logo"
 
73
  msgstr ""
74
 
75
- #: customizer.php:106 dist/customizer.php:106
76
- msgid "Logo Width"
77
  msgstr ""
78
 
79
- #: customizer.php:123 dist/customizer.php:123
80
- msgid "Logo Height"
81
  msgstr ""
82
 
83
- #: customizer.php:140 dist/customizer.php:140
84
- msgid "Padding Bottom"
85
  msgstr ""
86
 
87
- #: customizer.php:157 customizer.php:210 dist/customizer.php:157
88
- #: dist/customizer.php:210
89
- msgid "Background Image"
90
  msgstr ""
91
 
92
- #: customizer.php:176 customizer.php:229 dist/customizer.php:176
93
- #: dist/customizer.php:229
94
- msgid "Background Color"
95
  msgstr ""
96
 
97
- #: customizer.php:193 dist/customizer.php:193
98
- msgid "Background Size"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  msgstr ""
100
 
101
- #: customizer.php:247 dist/customizer.php:247
 
 
102
  msgid "Width"
103
  msgstr ""
104
 
105
- #: customizer.php:264 dist/customizer.php:264
 
106
  msgid "Height"
107
  msgstr ""
108
 
109
- #: customizer.php:281 dist/customizer.php:281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  msgid "Padding"
111
  msgstr ""
112
 
113
- #: customizer.php:297 dist/customizer.php:297
114
- msgid "Border (Example: 2px dotted black) "
 
115
  msgstr ""
116
 
117
- #: customizer.php:314 dist/customizer.php:314
118
- msgid "Input Field Width"
119
  msgstr ""
120
 
121
- #: customizer.php:331 dist/customizer.php:331
122
- msgid "Input Field Margin"
123
  msgstr ""
124
 
125
- #: customizer.php:349 dist/customizer.php:349
126
- msgid "Input Field Background"
 
127
  msgstr ""
128
 
129
- #: customizer.php:368 dist/customizer.php:368
130
- msgid "Input Field Color"
 
131
  msgstr ""
132
 
133
- #: customizer.php:387 dist/customizer.php:387
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  msgid "Label Color"
135
  msgstr ""
136
 
137
- #: customizer.php:406 dist/customizer.php:406
138
- msgid "Button Background"
139
  msgstr ""
140
 
141
- #: customizer.php:425 dist/customizer.php:425
142
- msgid "Button Border"
143
  msgstr ""
144
 
145
- #: customizer.php:444 dist/customizer.php:444
146
- msgid "Button Background (Hover)"
 
147
  msgstr ""
148
 
149
- #: customizer.php:463 dist/customizer.php:463
150
- msgid "Button Border (Hover)"
151
  msgstr ""
152
 
153
- #: customizer.php:482 dist/customizer.php:482
154
- msgid "Button Box Shadow"
155
  msgstr ""
156
 
157
- #: customizer.php:501 dist/customizer.php:501
158
- msgid "Button Color"
159
  msgstr ""
160
 
161
- #: customizer.php:520 dist/customizer.php:520
162
- msgid "Text Color"
163
  msgstr ""
164
 
165
- #: customizer.php:539 dist/customizer.php:539
166
- msgid "Text Color (Hover)"
167
  msgstr ""
168
 
169
- #: customizer.php:556 dist/customizer.php:556
170
- msgid "Custom CSS"
171
  msgstr ""
172
 
173
- #: dist/login-customizer.php:27 login-customizer.php:27
174
- msgid ""
175
- "<p class=\"logincust_pro_text\">You need to buy the <a "
176
- "href=\"http://themeisle.com/plugins/custom-login-customizer-security-addon/\""
177
- " target=\"_blank\">SECURITY ADDON</a> to have this options. </p>"
178
  msgstr ""
179
 
180
- #: dist/option-panel.php:18 option-panel.php:18
181
- msgid "Howdy!"
182
  msgstr ""
183
 
184
- #: dist/option-panel.php:19 option-panel.php:19
185
- msgid ""
186
- "Login Customizer plugin allows you to easily customize your login page "
187
- "straight from your WordPress Customizer! You can preview your changes "
188
- "before you save them! Awesome, right?"
189
  msgstr ""
190
 
191
- #: dist/option-panel.php:20 option-panel.php:20
192
- msgid "In Customizer, navigate to Login Customizer"
193
  msgstr ""
194
 
195
- #: dist/option-panel.php:21 option-panel.php:21
196
- msgid "Start Customizing!"
 
 
 
 
197
  msgstr ""
198
 
199
- #: dist/option-panel.php:22 option-panel.php:22
200
- msgid "Credits/Support (All the unwanted crap)"
 
201
  msgstr ""
202
 
203
- #: dist/option-panel.php:23 option-panel.php:23
 
 
 
 
204
  msgid ""
205
- "If you find any issues or if you want to contribute, then please free to "
206
- "drop me a mail at"
207
  msgstr ""
208
 
209
- #: dist/option-panel.php:23 option-panel.php:23
210
- msgid "this link"
211
  msgstr ""
212
 
213
- #: dist/option-panel.php:24 option-panel.php:24
214
- msgid "Thanks for using this plugin. Don not forget to leave a review."
215
  msgstr ""
216
 
217
- #: dist/option-panel.php:25 option-panel.php:25
218
- msgid "ThemeIsle :)"
219
  msgstr ""
220
 
221
- #: dist/option-panel.php:27 dist/option-panel.php:62 option-panel.php:27
222
- #: option-panel.php:62
223
- msgid "Subscribe"
224
  msgstr ""
225
 
226
- #: dist/option-panel.php:51 dist/option-panel.php:89 option-panel.php:51
227
- #: option-panel.php:89
228
- msgid ""
229
- "Our free, 4-lesson course on how to make your WordPress site run incredibly "
230
- "fast is barely waiting for its students. Ready to learn how to reduce your "
231
- "loading times by half? Come and join the 1st lesson here!"
232
  msgstr ""
233
 
234
- #: dist/option-panel.php:53 option-panel.php:53
235
- msgid ""
236
- "Thank you for subscribing! You have been added to the mailing list and will "
237
- "receive the next email information in the coming weeks. If you ever wish to "
238
- "unsubscribe, simply use the Unsubscribe link included in each newsletter."
239
  msgstr ""
240
 
241
- #: dist/option-panel.php:91 option-panel.php:91
242
- msgid ""
243
- "Thank you for subscribing! You have been added to the mailing list and will "
244
- "receive the next email information in the coming weeks. If you ever wish to "
245
- "unsubscribe, simply use the Unsubscribe link included in each newsletter."
 
 
 
 
 
246
  msgstr ""
247
 
248
  #. Plugin Name of the plugin/theme
@@ -265,4 +387,10 @@ msgstr ""
265
 
266
  #. Author URI of the plugin/theme
267
  msgid "https://themeisle.com/"
 
 
 
 
 
 
268
  msgstr ""
2
  # This file is distributed under the no.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Custom Login Page Customizer 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/login-customizer/issues\n"
7
+ "POT-Creation-Date: 2018-04-16 20:51:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
24
  "X-Poedit-Bookmarks: \n"
25
  "X-Textdomain-Support: yes\n"
26
 
27
+ #: inc/customizer/controls/cool-stuff/cool-stuff-control.php:36
28
+ msgid ""
29
+ "Our free, 4-lesson course on how to make your WordPress site run incredibly "
30
+ "fast is barely waiting for its students. Ready to learn how to reduce your "
31
+ "loading times by half? Come and join the 1st lesson here!"
32
  msgstr ""
33
 
34
+ #: inc/customizer/controls/cool-stuff/cool-stuff-control.php:41
35
  msgid ""
36
+ "Thank you for subscribing! You have been added to the mailing list and will "
37
+ "receive the next email information in the coming weeks. If you ever wish to "
38
+ "unsubscribe, simply use the Unsubscribe link included in each newsletter."
39
  msgstr ""
40
 
41
+ #: inc/customizer/controls/padding/padding-control.php:26
42
+ msgid "Top"
43
+ msgstr ""
44
+
45
+ #: inc/customizer/controls/padding/padding-control.php:28
46
+ msgid "Right"
47
+ msgstr ""
48
+
49
+ #: inc/customizer/controls/padding/padding-control.php:32
50
+ msgid "Down"
51
+ msgstr ""
52
+
53
+ #: inc/customizer/controls/padding/padding-control.php:34
54
+ msgid "Left"
55
+ msgstr ""
56
+
57
+ #: inc/customizer/controls/range-slider/range-slider-control.php:67
58
+ msgid "px"
59
+ msgstr ""
60
+
61
+ #: inc/customizer/controls/range-slider/range-slider-control.php:69
62
+ msgid "%"
63
+ msgstr ""
64
+
65
+ #: inc/customizer/controls/range-slider/range-slider-control.php:84
66
+ msgid "Reset"
67
+ msgstr ""
68
+
69
+ #: inc/customizer/customizer.php:37 inc/initial-setup.php:92
70
+ msgid "Login Customizer"
71
+ msgstr ""
72
+
73
+ #: inc/customizer/customizer.php:38
74
+ msgid ""
75
+ "This section allows you to customize the login page of your website. Made "
76
+ "with ❤ by <a target=\"_blank\" rel=\"nofollow\" "
77
+ "href=\"https://themeisle.com\">ThemeIsle</a> team."
78
  msgstr ""
79
 
80
+ #: inc/customizer/sections/section-background.php:9
81
+ #: inc/customizer/sections/section-button.php:27
82
+ #: inc/customizer/sections/section-fields.php:248
83
  msgid "Background"
84
  msgstr ""
85
 
86
+ #: inc/customizer/sections/section-background.php:27
87
+ #: inc/customizer/sections/section-form.php:47
88
+ msgid "Background Color"
89
  msgstr ""
90
 
91
+ #: inc/customizer/sections/section-background.php:47
92
+ #: inc/customizer/sections/section-form.php:26
93
+ msgid "Background Image"
94
  msgstr ""
95
 
96
+ #: inc/customizer/sections/section-background.php:66
97
+ msgid "Background Size"
98
  msgstr ""
99
 
100
+ #: inc/customizer/sections/section-background.php:70
101
+ msgid "Original"
102
  msgstr ""
103
 
104
+ #: inc/customizer/sections/section-background.php:71
105
+ msgid "Fit to Screen"
106
  msgstr ""
107
 
108
+ #: inc/customizer/sections/section-background.php:72
109
+ msgid "Fill Screen"
110
  msgstr ""
111
 
112
+ #: inc/customizer/sections/section-background.php:73
113
+ #: inc/customizer/sections/section-button.php:72
114
+ msgid "Custom"
115
  msgstr ""
116
 
117
+ #: inc/customizer/sections/section-background.php:91
118
+ msgid "Custom Size"
119
  msgstr ""
120
 
121
+ #: inc/customizer/sections/section-background.php:109
122
+ msgid "Background Repeat"
123
  msgstr ""
124
 
125
+ #: inc/customizer/sections/section-background.php:113
126
+ msgid "No Repeat"
127
  msgstr ""
128
 
129
+ #: inc/customizer/sections/section-background.php:114
130
+ msgid "Repeat"
 
131
  msgstr ""
132
 
133
+ #: inc/customizer/sections/section-background.php:115
134
+ msgid "Repeat Horizontally"
 
135
  msgstr ""
136
 
137
+ #: inc/customizer/sections/section-background.php:116
138
+ msgid "Repeat Vertically"
139
+ msgstr ""
140
+
141
+ #: inc/customizer/sections/section-background.php:147
142
+ msgid "Background Position"
143
+ msgstr ""
144
+
145
+ #: inc/customizer/sections/section-button.php:9
146
+ msgid "Button"
147
+ msgstr ""
148
+
149
+ #: inc/customizer/sections/section-button.php:48
150
+ msgid "Background (Hover)"
151
+ msgstr ""
152
+
153
+ #: inc/customizer/sections/section-button.php:67
154
+ msgid "Button Size"
155
+ msgstr ""
156
+
157
+ #: inc/customizer/sections/section-button.php:71
158
+ msgid "Auto"
159
  msgstr ""
160
 
161
+ #: inc/customizer/sections/section-button.php:92
162
+ #: inc/customizer/sections/section-fields.php:48
163
+ #: inc/customizer/sections/section-form.php:68
164
  msgid "Width"
165
  msgstr ""
166
 
167
+ #: inc/customizer/sections/section-button.php:121
168
+ #: inc/customizer/sections/section-form.php:97
169
  msgid "Height"
170
  msgstr ""
171
 
172
+ #: inc/customizer/sections/section-button.php:150
173
+ #: inc/customizer/sections/section-fields.php:77
174
+ #: inc/customizer/sections/section-other.php:94
175
+ msgid "Font Size"
176
+ msgstr ""
177
+
178
+ #: inc/customizer/sections/section-button.php:179
179
+ #: inc/customizer/sections/section-fields.php:269
180
+ #: inc/customizer/sections/section-other.php:123
181
+ msgid "Text Color"
182
+ msgstr ""
183
+
184
+ #: inc/customizer/sections/section-button.php:200
185
+ #: inc/customizer/sections/section-fields.php:227
186
+ #: inc/customizer/sections/section-form.php:126
187
  msgid "Padding"
188
  msgstr ""
189
 
190
+ #: inc/customizer/sections/section-button.php:221
191
+ #: inc/customizer/sections/section-fields.php:106
192
+ msgid "Border Width"
193
  msgstr ""
194
 
195
+ #: inc/customizer/sections/section-button.php:250
196
+ msgid "Border"
197
  msgstr ""
198
 
199
+ #: inc/customizer/sections/section-button.php:271
200
+ msgid "Border (Hover)"
201
  msgstr ""
202
 
203
+ #: inc/customizer/sections/section-button.php:292
204
+ #: inc/customizer/sections/section-form.php:176
205
+ msgid "Shadow Spread"
206
  msgstr ""
207
 
208
+ #: inc/customizer/sections/section-button.php:321
209
+ #: inc/customizer/sections/section-form.php:205
210
+ msgid "Box Shadow"
211
  msgstr ""
212
 
213
+ #: inc/customizer/sections/section-button.php:342
214
+ msgid "Text Shadow"
215
+ msgstr ""
216
+
217
+ #: inc/customizer/sections/section-code.php:9
218
+ msgid "Custom CSS & JavaScript"
219
+ msgstr ""
220
+
221
+ #: inc/customizer/sections/section-code.php:24
222
+ msgid "Custom CSS"
223
+ msgstr ""
224
+
225
+ #: inc/customizer/sections/section-code.php:43
226
+ msgid "Custom JavaScript"
227
+ msgstr ""
228
+
229
+ #: inc/customizer/sections/section-fields.php:9
230
+ msgid "Fields"
231
+ msgstr ""
232
+
233
+ #: inc/customizer/sections/section-fields.php:27
234
+ msgid "Disable Remember Me?"
235
+ msgstr ""
236
+
237
+ #: inc/customizer/sections/section-fields.php:135
238
+ msgid "Border Color"
239
+ msgstr ""
240
+
241
+ #: inc/customizer/sections/section-fields.php:156
242
+ #: inc/customizer/sections/section-form.php:147
243
+ msgid "Radius"
244
+ msgstr ""
245
+
246
+ #: inc/customizer/sections/section-fields.php:185
247
+ msgid "Disable Box Shadow?"
248
+ msgstr ""
249
+
250
+ #: inc/customizer/sections/section-fields.php:206
251
+ msgid "Margin"
252
+ msgstr ""
253
+
254
+ #: inc/customizer/sections/section-fields.php:290
255
  msgid "Label Color"
256
  msgstr ""
257
 
258
+ #: inc/customizer/sections/section-fields.php:311
259
+ msgid "Label Font Size"
260
  msgstr ""
261
 
262
+ #: inc/customizer/sections/section-form.php:9
263
+ msgid "Form"
264
  msgstr ""
265
 
266
+ #: inc/customizer/sections/section-logo.php:9
267
+ #: inc/customizer/sections/section-logo.php:47
268
+ msgid "Logo"
269
  msgstr ""
270
 
271
+ #: inc/customizer/sections/section-logo.php:27
272
+ msgid "Disable Logo?"
273
  msgstr ""
274
 
275
+ #: inc/customizer/sections/section-logo.php:68
276
+ msgid "Logo Width"
277
  msgstr ""
278
 
279
+ #: inc/customizer/sections/section-logo.php:97
280
+ msgid "Logo Height"
281
  msgstr ""
282
 
283
+ #: inc/customizer/sections/section-logo.php:126
284
+ msgid "Padding Bottom"
285
  msgstr ""
286
 
287
+ #: inc/customizer/sections/section-logo.php:153
288
+ msgid "Logo URL"
289
  msgstr ""
290
 
291
+ #: inc/customizer/sections/section-logo.php:154
292
+ msgid "The page where your logo will take you."
293
  msgstr ""
294
 
295
+ #: inc/customizer/sections/section-more.php:9
296
+ msgid "More Cool Stuff"
 
 
 
297
  msgstr ""
298
 
299
+ #: inc/customizer/sections/section-other.php:9
300
+ msgid "Other"
301
  msgstr ""
302
 
303
+ #: inc/customizer/sections/section-other.php:29
304
+ msgid "Disable Register Link?"
 
 
 
305
  msgstr ""
306
 
307
+ #: inc/customizer/sections/section-other.php:52
308
+ msgid "Disable Lost Password?"
309
  msgstr ""
310
 
311
+ #: inc/customizer/sections/section-other.php:73
312
+ msgid "Disable \"Back to Website\"?"
313
+ msgstr ""
314
+
315
+ #: inc/customizer/sections/section-other.php:144
316
+ msgid "Text Color (Hover)"
317
  msgstr ""
318
 
319
+ #: inc/customizer/sections/section-templates.php:9
320
+ #: inc/customizer/sections/section-templates.php:26
321
+ msgid "Templates"
322
  msgstr ""
323
 
324
+ #: inc/include-page-template.php:71
325
+ msgid "Login Customizer Template"
326
+ msgstr ""
327
+
328
+ #: inc/initial-setup.php:93
329
  msgid ""
330
+ "This page is used for Login Customizer plugin. It will not be visible to "
331
+ "your readers. Do not delete it."
332
  msgstr ""
333
 
334
+ #: inc/template-login-customizer.php:27
335
+ msgid "%1$s &lsaquo; %2$s &#8212; WordPress"
336
  msgstr ""
337
 
338
+ #: inc/template-login-customizer.php:27 inc/template-login-customizer.php:85
339
+ msgid "Log In"
340
  msgstr ""
341
 
342
+ #: inc/template-login-customizer.php:48
343
+ msgid "https://wordpress.org/"
344
  msgstr ""
345
 
346
+ #: inc/template-login-customizer.php:49
347
+ msgid "Powered by WordPress"
 
348
  msgstr ""
349
 
350
+ #: inc/template-login-customizer.php:75
351
+ msgid "Username or Email Address"
 
 
 
 
352
  msgstr ""
353
 
354
+ #: inc/template-login-customizer.php:79
355
+ msgid "Password"
 
 
 
356
  msgstr ""
357
 
358
+ #: inc/template-login-customizer.php:83
359
+ msgid "Remember Me"
360
+ msgstr ""
361
+
362
+ #: inc/template-login-customizer.php:91
363
+ msgid "Register"
364
+ msgstr ""
365
+
366
+ #: inc/template-login-customizer.php:97
367
+ msgid "Lost your password?"
368
  msgstr ""
369
 
370
  #. Plugin Name of the plugin/theme
387
 
388
  #. Author URI of the plugin/theme
389
  msgid "https://themeisle.com/"
390
+ msgstr ""
391
+
392
+ #: inc/template-login-customizer.php:103
393
+ #. translators: %s: site title
394
+ msgctxt "site"
395
+ msgid "&larr; Back to %s"
396
  msgstr ""
login-customizer.php CHANGED
@@ -13,32 +13,19 @@
13
  * Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
14
  * Author: Hardeep Asrani
15
  * Author URI: https://themeisle.com/
16
- * Version: 1.2.1
17
  * WordPress Available: yes
18
  * Requires License: no
19
  */
20
 
21
- define( 'LOGINCUST_VERSION', '1.2.1' );
22
  define( 'LOGINCUST_FREE_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
24
- if ( ! defined( 'login-customizer' ) ) {
25
- define( 'LOGINCUST_TEXTDOMAIN', 'login-customizer' );
26
- }
27
- define( 'LOGINCUST_PRO_TEXT', __( '<p class="logincust_pro_text">You need to buy the <a href="http://themeisle.com/plugins/custom-login-customizer-security-addon/" target="_blank">SECURITY ADDON</a> to have this options. </p>', 'login-customizer' ) );
28
 
29
- /**
30
- * Check if security addon is active
31
- *
32
- * @package LOGINCUST
33
- * @since 1.0.2
34
- * @version 1.0.0
35
- * @return bool
36
- */
37
- function logincust_check_security() {
38
- return ( defined( 'LOGINCUST_SECURITY_VERSION' ) );
39
- }
40
-
41
- add_filter( 'themeisle_sdk_products', 'login_customizer_register_sdk', 10, 1 );
42
 
43
  function login_customizer_register_sdk( $products ) {
44
  $products[] = __FILE__;
@@ -46,7 +33,30 @@ function login_customizer_register_sdk( $products ) {
46
  return $products;
47
  }
48
 
49
- include( LOGINCUST_FREE_PATH . 'vendor/autoload.php' );
50
- include( LOGINCUST_FREE_PATH . 'customizer.php' );
51
- include( LOGINCUST_FREE_PATH . 'option-panel.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
 
13
  * Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
14
  * Author: Hardeep Asrani
15
  * Author URI: https://themeisle.com/
16
+ * Version: 2.0.0
17
  * WordPress Available: yes
18
  * Requires License: no
19
  */
20
 
21
+ define( 'LOGINCUST_VERSION', '2.0.0' );
22
  define( 'LOGINCUST_FREE_PATH', plugin_dir_path( __FILE__ ) );
23
  define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
 
 
 
 
24
 
25
+ require_once( LOGINCUST_FREE_PATH . 'vendor/autoload.php' );
26
+ require_once( LOGINCUST_FREE_PATH . 'setup.php' );
27
+ require_once( LOGINCUST_FREE_PATH . 'inc/include-page-template.php' );
28
+ require_once( LOGINCUST_FREE_PATH . 'inc/customizer/customizer.php' );
 
 
 
 
 
 
 
 
 
29
 
30
  function login_customizer_register_sdk( $products ) {
31
  $products[] = __FILE__;
33
  return $products;
34
  }
35
 
36
+ add_filter( 'themeisle_sdk_products', 'login_customizer_register_sdk', 10, 1 );
37
+
38
+ /**
39
+ * Add link to Login Customizer in Appearances menu
40
+ */
41
+ function logincust_admin_link() {
42
+
43
+ // Get global submenu
44
+ global $submenu;
45
+
46
+ // Generate the redirect url.
47
+ $options = get_option( 'login_customizer_settings', array() );
48
+
49
+ $url = add_query_arg(
50
+ array(
51
+ 'autofocus[panel]' => 'logincust_panel',
52
+ 'url' => rawurlencode( get_permalink( $options['page'] ) ),
53
+ ),
54
+ admin_url( 'customize.php' )
55
+ );
56
+
57
+ // Add Login Customizer as a menu item
58
+ $submenu['themes.php'][] = array( 'Login Customizer', 'manage_options', $url, 'login-customizer' );
59
+
60
+ }
61
 
62
+ add_action( 'admin_menu', 'logincust_admin_link' );
mailin.php DELETED
@@ -1,868 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * SendinBlue REST client
5
- */
6
-
7
- class Mailin {
8
-
9
- public $api_key;
10
- public $base_url;
11
- public $curl_opts = array();
12
- public function __construct( $base_url, $api_key ) {
13
- if ( ! function_exists( 'curl_init' ) ) {
14
- throw new Exception( 'Mailin requires CURL module' );
15
- }
16
- $this->base_url = $base_url;
17
- $this->api_key = $api_key;
18
- }
19
- /**
20
- * Do CURL request with authorization
21
- */
22
- private function do_request( $resource, $method, $input ) {
23
- $called_url = $this->base_url . '/' . $resource;
24
- $ch = curl_init( $called_url );
25
- $auth_header = 'api-key:' . $this->api_key;
26
- $content_header = 'Content-Type:application/json';
27
- if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
28
- // Windows only over-ride
29
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
30
- }
31
- curl_setopt( $ch, CURLOPT_HTTPHEADER, array($auth_header, $content_header) );
32
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
33
- curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $method );
34
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
35
- curl_setopt( $ch, CURLOPT_HEADER, 0 );
36
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $input );
37
- $data = curl_exec( $ch );
38
- if ( curl_errno( $ch ) ) {
39
- echo 'Curl error: ' . curl_error( $ch ) . '\n';
40
- }
41
- curl_close( $ch );
42
- return json_decode( $data, true );
43
- }
44
- public function get( $resource, $input ) {
45
- return $this->do_request( $resource, 'GET', $input );
46
- }
47
- public function put( $resource, $input ) {
48
- return $this->do_request( $resource, 'PUT', $input );
49
- }
50
- public function post( $resource, $input ) {
51
- return $this->do_request( $resource, 'POST', $input );
52
- }
53
- public function delete( $resource, $input ) {
54
- return $this->do_request( $resource, 'DELETE', $input );
55
- }
56
-
57
- /*
58
- Get Account.
59
- No input required
60
- */
61
- public function get_account() {
62
- return $this->get( 'account', '' );
63
- }
64
-
65
- /*
66
- Get SMTP details.
67
- No input required
68
- */
69
- public function get_smtp_details() {
70
- return $this->get( 'account/smtpdetail', '' );
71
- }
72
-
73
- /*
74
- Create Child Account.
75
- @param {Array} data contains php array with key value pair.
76
- @options data {String} child_email: Email address of Reseller child [Mandatory]
77
- @options data {String} password: Password of Reseller child to login [Mandatory]
78
- @options data {String} company_org: Name of Reseller child’s company [Mandatory]
79
- @options data {String} first_name: First name of Reseller child [Mandatory]
80
- @options data {String} last_name: Last name of Reseller child [Mandatory]
81
- @options data {Array} credits: Number of email & sms credits respectively, which will be assigned to the Reseller child’s account [Optional]
82
- - email_credit {Integer} number of email credits
83
- - sms_credit {Integer} Number of sms credts
84
- @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
85
- */
86
- public function create_child_account( $data ) {
87
- return $this->post( 'account', json_encode( $data ) );
88
- }
89
-
90
- /*
91
- Update Child Account.
92
- @param {Array} data contains php array with key value pair.
93
- @options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
94
- @options data {String} company_org: Name of Reseller child’s company [Optional]
95
- @options data {String} first_name: First name of Reseller child [Optional]
96
- @options data {String} last_name: Last name of Reseller child [Optional]
97
- @options data {String} password: Password of Reseller child to login [Optional]
98
- @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
99
- @options data {Array} disassociate_ip: Disassociate dedicated IPs from reseller child. You can use commas to separate multiple IPs [Optional]
100
- */
101
- public function update_child_account( $data ) {
102
- return $this->put( 'account', json_encode( $data ) );
103
- }
104
-
105
- /*
106
- Delete Child Account.
107
- @param {Array} data contains php array with key value pair.
108
- @options data {String} auth_key: 16 character authorization key of Reseller child to be deleted [Mandatory]
109
- */
110
- public function delete_child_account( $data ) {
111
- return $this->delete( 'account/' . $data['auth_key'], '' );
112
- }
113
-
114
- /*
115
- Get Reseller child Account.
116
- @param {Array} data contains php array with key value pair.
117
- @options data {String} auth_key: 16 character authorization key of Reseller child. Example : To get the details of more than one child account, use, {"key1":"abC01De2fGHI3jkL","key2":"mnO45Pq6rSTU7vWX"} [Mandatory]
118
- */
119
- public function get_reseller_child( $data ) {
120
- return $this->post( 'account/getchildv2', json_encode( $data ) );
121
- }
122
-
123
- /*
124
- Add/Remove Reseller child's Email/Sms credits.
125
- @param {Array} data contains php array with key value pair.
126
- @options data {String} auth_key: 16 character authorization key of Reseller child to modify credits [Mandatory]
127
- @options data {Array} add_credit: Number of email & sms credits to be added. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if rmv_credit is empty]
128
- - email_credit {Integer} number of email credits
129
- - sms_credit {Integer} Number of sms credts
130
- @options data {Array} rmv_credit: Number of email & sms credits to be removed. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if add_credits is empty]
131
- - email_credit {Integer} number of email credits
132
- - sms_credit {Integer} Number of sms credts
133
- */
134
- public function add_remove_child_credits( $data ) {
135
- return $this->post( 'account/addrmvcredit', json_encode( $data ) );
136
- }
137
-
138
- /*
139
- Get a particular campaign detail.
140
- @param {Array} data contains php array with key value pair.
141
- @options data {Integer} id: Unique Id of the campaign [Mandatory]
142
- */
143
- public function get_campaign_v2( $data ) {
144
- return $this->get( 'campaign/' . $data['id'] . '/detailsv2', '' );
145
- }
146
-
147
- /*
148
- Get all campaigns detail.
149
- @param {Array} data contains php array with key value pair.
150
- @options data {String} type: Type of campaign. Possible values – classic, trigger, sms, template ( case sensitive ) [Optional]
151
- @options data {String} status: Status of campaign. Possible values – draft, sent, archive, queued, suspended, in_process, temp_active, temp_inactive ( case sensitive ) [Optional]
152
- @options data {Integer} page: Maximum number of records per request is 500, if there are more than 500 campaigns then you can use this parameter to get next 500 results [Optional]
153
- @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
154
- */
155
- public function get_campaigns_v2( $data ) {
156
- return $this->get( 'campaign/detailsv2', json_encode( $data ) );
157
- }
158
-
159
- /*
160
- Create and Schedule your campaigns. It returns the ID of the created campaign.
161
- @param {Array} data contains php array with key value pair.
162
- @options data {String} category: Tag name of the campaign [Optional]
163
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
164
- @options data {String} name: Name of the campaign [Mandatory]
165
- @options data {String} bat: Email address for test mail [Optional]
166
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
167
- @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
168
- @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
169
- @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
170
- @options data {String} subject: Subject of the campaign [Mandatory]
171
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
172
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
173
- @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact attributes here, these should already exist in SendinBlue account [Optional]
174
- @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
175
- @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
176
- @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
177
- @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
178
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
179
-
180
- */
181
- public function create_campaign( $data ) {
182
- return $this->post( 'campaign', json_encode( $data ) );
183
- }
184
-
185
- /*
186
- Update your campaign.
187
- @param {Array} data contains php array with key value pair.
188
- @options data {Integer} id: Id of campaign to be modified [Mandatory]
189
- @options data {String} category: Tag name of the campaign [Optional]
190
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
191
- @options data {String} name: Name of the campaign [Optional]
192
- @options data {String} bat: Email address for test mail [Optional]
193
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Optional]
194
- @options data {String} html_url: Url which content is the body of content [Optional]
195
- @options data {Array} listid These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
196
- @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
197
- @options data {String} subject: Subject of the campaign.
198
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
199
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
200
- @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
201
- @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
202
- @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
203
- @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
204
- @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
205
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
206
- */
207
- public function update_campaign( $data ) {
208
- $id = $data['id'];
209
- unset( $data['id'] );
210
- return $this->put( 'campaign/' . $id, json_encode( $data ) );
211
- }
212
-
213
- /*
214
- Delete your campaigns.
215
- @param {Array} data contains php array with key value pair.
216
- @options data {Integer} id: Id of campaign to be deleted [Mandatory]
217
- */
218
- public function delete_campaign( $data ) {
219
- return $this->delete( 'campaign/' . $data['id'], '' );
220
- }
221
-
222
- /*
223
- Send report of Sent and Archived campaign.
224
- @param {Array} data contains php array with key value pair.
225
- @options data {Integer} id: Id of campaign to send its report [Mandatory]
226
- @options data {String} lang: Language of email content. Possible values – fr (default), en, es, it & pt [Optional]
227
- @options data {String} email_subject: Message subject [Mandatory]
228
- @options data {Array} email_to: Email address of the recipient(s). Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
229
- @options data {String} email_content_type: Body of the message in text/HTML version. Possible values – text & html [Mandatory]
230
- @options data {Array} email_bcc: Same as email_to but for Bcc [Optional]
231
- @options data {Array} email_cc: Same as email_to but for Cc [Optional]
232
- @options data {String} email_body: Body of the message [Mandatory]
233
- */
234
- public function campaign_report_email( $data ) {
235
- $id = $data['id'];
236
- unset( $data['id'] );
237
- return $this->post( 'campaign/' . $id . '/report', json_encode( $data ) );
238
- }
239
-
240
- /*
241
- Export the recipients of a specified campaign.
242
- @param {Array} data contains php array with key value pair.
243
- @options data {Integer} id: Id of campaign to export its recipients [Mandatory]
244
- @options data {String} notify_url: URL that will be called once the export process is finished [Mandatory]
245
- @options data {String} type: Type of recipients. Possible values – all, non_clicker, non_opener, clicker, opener, soft_bounces, hard_bounces & unsubscribes [Mandatory]
246
- */
247
- public function campaign_recipients_export( $data ) {
248
- $id = $data['id'];
249
- unset( $data['id'] );
250
- return $this->post( 'campaign/' . $id . '/recipients', json_encode( $data ) );
251
- }
252
-
253
- /*
254
- Get the Campaign name, subject and share link of the classic type campaigns only which are sent, for those which are not sent and the rest of campaign types like trigger, template & sms, will return an error message of share link not available.
255
- @param {Array} data contains php array with key value pair.
256
- @options data {Array} camp_ids: Id of campaign to get share link. You can use commas to separate multiple ids [Mandatory]
257
- */
258
-
259
- public function share_campaign( $data ) {
260
- return $this->post( 'campaign/sharelinkv2', json_encode( $data ) );
261
- }
262
-
263
- /*
264
- Send a Test Campaign.
265
- @param {Array} data contains php array with key value pair.
266
- @options data {Integer} id: Id of the campaign [Mandatory]
267
- @options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
268
- */
269
- public function send_bat_email( $data ) {
270
- $id = $data['id'];
271
- unset( $data['id'] );
272
- return $this->post( 'campaign/' . $id . '/test', json_encode( $data ) );
273
- }
274
-
275
- /*
276
- Update the Campaign status.
277
- @param {Array} data contains php array with key value pair.
278
- @options data {Integer} id: Id of campaign to update its status [Mandatory]
279
- @options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sensitive ) [Mandatory]
280
- */
281
- public function update_campaign_status( $data ) {
282
- $id = $data['id'];
283
- unset( $data['id'] );
284
- return $this->put( 'campaign/' . $id . '/updatecampstatus', json_encode( $data ) );
285
- }
286
-
287
- /*
288
- Create and schedule your Trigger campaigns.
289
- @param {Array} data contains php array with key value pair.
290
- @options data {String} category: Tag name of the campaign [Optional]
291
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
292
- @options data {String} trigger_name: Name of the campaign [Mandatory]
293
- @options data {String} bat: Email address for test mail [Optional]
294
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
295
- @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
296
- @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
297
- @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
298
- @options data {String} subject: Subject of the campaign [Mandatory]
299
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
300
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
301
- @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
302
- @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
303
- @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
304
- @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
305
- @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
306
- @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
307
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
308
- */
309
- public function create_trigger_campaign( $data ) {
310
- return $this->post( 'campaign', json_encode( $data ) );
311
- }
312
-
313
- /*
314
- Update and schedule your Trigger campaigns.
315
- @param {Array} data contains php array with key value pair.
316
- @options data {Integer} id: Id of Trigger campaign to be modified [Mandatory]
317
- @options data {String} category: Tag name of the campaign [Optional]
318
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
319
- @options data {String} trigger_name: Name of the campaign [Mandatory]
320
- @options data {String} bat Email address for test mail [Optional]
321
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
322
- @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
323
- @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
324
- @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
325
- @options data {String} subject: Subject of the campaign [Mandatory]
326
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
327
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
328
- @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
329
- @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
330
- @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
331
- @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
332
- @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
333
- @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
334
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
335
- */
336
- public function update_trigger_campaign( $data ) {
337
- $id = $data['id'];
338
- unset( $data['id'] );
339
- return $this->put( 'campaign/' . $id, json_encode( $data ) );
340
- }
341
-
342
- /*
343
- Get all folders detail.
344
- @param {Array} data contains php array with key value pair.
345
- @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 folders then you can use this parameter to get next 50 results [Mandatory]
346
- @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
347
- */
348
- public function get_folders( $data ) {
349
- return $this->get( 'folder', json_encode( $data ) );
350
- }
351
-
352
- /*
353
- Get a particular folder detail.
354
- @param {Array} data contains php array with key value pair.
355
- @options data {Integer} id: Id of folder to get details [Mandatory]
356
- */
357
- public function get_folder( $data ) {
358
- return $this->get( 'folder/' . $data['id'], '' );
359
- }
360
-
361
- /*
362
- Create a new folder.
363
- @param {Array} data contains php array with key value pair.
364
- @options data {String} name: Desired name of the folder to be created [Mandatory]
365
- */
366
- public function create_folder( $data ) {
367
- return $this->post( 'folder', json_encode( $data ) );
368
- }
369
-
370
- /*
371
- Delete a specific folder information.
372
- @param {Array} data contains php array with key value pair.
373
- @options data {Integer} id: Id of folder to be deleted [Mandatory]
374
- */
375
- public function delete_folder( $data ) {
376
- return $this->delete( 'folder/' . $data['id'], '' );
377
- }
378
-
379
- /*
380
- Update an existing folder.
381
- @param {Array} data contains php array with key value pair.
382
- @options data {Integer} id: Id of folder to be modified [Mandatory]
383
- @options data {String} name: Desired name of the folder to be modified [Mandatory]
384
- */
385
- public function update_folder( $data ) {
386
- $id = $data['id'];
387
- unset( $data['id'] );
388
- return $this->put( 'folder/' . $id, json_encode( $data ) );
389
- }
390
-
391
- /*
392
- Get all lists detail.
393
- @param {Array} data contains php array with key value pair.
394
- @options data {Integer} list_parent: This is the existing folder id & can be used to get all lists belonging to it [Optional]
395
- @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
396
- @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
397
- */
398
- public function get_lists( $data ) {
399
- return $this->get( 'list', json_encode( $data ) );
400
- }
401
-
402
- /*
403
- Get a particular list detail.
404
- @param {Array} data contains php array with key value pair.
405
- @options data {Integer} id: Id of list to get details [Mandatory]
406
- */
407
- public function get_list( $data ) {
408
- return $this->get( 'list/' . $data['id'], '' );
409
- }
410
-
411
- /*
412
- Create a new list.
413
- @param {Array} data contains php array with key value pair.
414
- @options data {String} list_name: Desired name of the list to be created [Mandatory]
415
- @options data {Integer} list_parent: Folder ID [Mandatory]
416
- */
417
- public function create_list( $data ) {
418
- return $this->post( 'list', json_encode( $data ) );
419
- }
420
-
421
- /*
422
- Update a list.
423
- @param {Array} data contains php array with key value pair.
424
- @options data {Integer} id: Id of list to be modified [Mandatory]
425
- @options data {String} list_name: Desired name of the list to be modified [Optional]
426
- @options data {Integer} list_parent: Folder ID [Mandatory]
427
- */
428
- public function update_list( $data ) {
429
- $id = $data['id'];
430
- unset( $data['id'] );
431
- return $this->put( 'list/' . $id, json_encode( $data ) );
432
- }
433
-
434
- /*
435
- Delete a specific list.
436
- @param {Array} data contains php array with key value pair.
437
- @options data {Integer} id: Id of list to be deleted [Mandatory]
438
- */
439
- public function delete_list( $data ) {
440
- return $this->delete( 'list/' . $data['id'], '' );
441
- }
442
-
443
- /*
444
- Display details of all users for the given lists.
445
- @param {Array} data contains php array with key value pair.
446
- @options data {Array} listids: These are the list ids to get their data. The ids found will display records [Mandatory]
447
- @options data {String} timestamp: This is date-time filter to fetch modified user records >= this time. Valid format Y-m-d H:i:s. Example: "2015-05-22 14:30:00" [Optional]
448
- @options data {Integer} page: Maximum number of records per request is 500, if in your list there are more than 500 users then you can use this parameter to get next 500 results [Optional]
449
- @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
450
- */
451
- public function display_list_users( $data ) {
452
- return $this->post( 'list/display', json_encode( $data ) );
453
- }
454
-
455
- /*
456
- Add already existing users in the SendinBlue contacts to the list.
457
- @param {Array} data contains php array with key value pair.
458
- @options data {Integer} id: Id of list to link users in it [Mandatory]
459
- @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
460
- */
461
-
462
- public function add_users_list( $data ) {
463
- $id = $data['id'];
464
- unset( $data['id'] );
465
- return $this->post( 'list/' . $id . '/users', json_encode( $data ) );
466
- }
467
-
468
- /*
469
- Delete already existing users in the SendinBlue contacts from the list.
470
- @param {Array} data contains php array with key value pair.
471
- @options data {Integer} id: Id of list to unlink users from it [Mandatory]
472
- @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be modified. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
473
- */
474
- public function delete_users_list( $data ) {
475
- $id = $data['id'];
476
- unset( $data['id'] );
477
- return $this->delete( 'list/' . $id . '/delusers', json_encode( $data ) );
478
- }
479
-
480
- /*
481
- Access all the attributes information under the account.
482
- No input required
483
- */
484
- public function get_attributes() {
485
- return $this->get( 'attribute', '' );
486
- }
487
-
488
- /*
489
- Access the specific type of attribute information.
490
- @param {Array} data contains php array with key value pair.
491
- @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global [Optional]
492
- */
493
- public function get_attribute( $data ) {
494
- return $this->get( 'attribute/' . $data['type'], '' );
495
- }
496
-
497
- /*
498
- Create an Attribute.
499
- @param {Array} data contains php array with key value pair.
500
- @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global ( case sensitive ) [Mandatory]
501
- @options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute to be created in your SendinBlue account. It should be sent as an associative array. Example: array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′).
502
- The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string. Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2", "value":"Attribute_value2" }]’. You can use commas to separate multiple attributes [Mandatory]
503
- */
504
- public function create_attribute( $data ) {
505
- return $this->post( 'attribute/', json_encode( $data ) );
506
- }
507
-
508
- /*
509
- Delete a specific type of attribute information.
510
- @param {Array} data contains php array with key value pair.
511
- @options data {Integer} type: Type of attribute to be deleted [Mandatory]
512
- */
513
- public function delete_attribute( $type, $data ) {
514
- $type = $data['type'];
515
- unset( $data['type'] );
516
- return $this->post( 'attribute/' . $type, json_encode( $data ) );
517
- }
518
-
519
- /*
520
- Create a new user if an email provided as input, doesn’t exists in the contact list of your SendinBlue account, otherwise it will update the existing user.
521
- @param {Array} data contains php array with key value pair.
522
- @options data {String} email: Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory]
523
- @options data {Array} attributes: The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
524
- @options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional]
525
- @options data {Array} listid: The list id(s) to be linked from user [Optional]
526
- @options data {Array} listid_unlink: The list id(s) to be unlinked from user [Optional]
527
- @options data {Array} blacklisted_sms: This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional]
528
- */
529
- public function create_update_user( $data ) {
530
- return $this->post( 'user/createdituser', json_encode( $data ) );
531
- }
532
-
533
- /*
534
- Get Access a specific user Information.
535
- @param {Array} data contains php array with key value pair.
536
- @options data {String} email: Email address of the already existing user in the SendinBlue contacts [Mandatory]
537
- */
538
- public function get_user( $data ) {
539
- return $this->get( 'user/' . $data['email'], '' );
540
- }
541
-
542
- /*
543
- Unlink existing user from all lists.
544
- @param {Array} data contains php array with key value pair.
545
- @options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory]
546
- */
547
- public function delete_user( $data ) {
548
- return $this->delete( 'user/' . $data['email'], '' );
549
- }
550
-
551
- /*
552
- Import Users Information.
553
- @param {Array} data contains php array with key value pair.
554
- @options data {String} url: The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty]
555
- @options data {String} body: The Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n"Name1";"Surname1";"example1@example.net"\n"Name2";"Surname2";"example2@example.net"‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty]
556
- @options data {Array} listids: These are the list ids in which the the users will be imported [Mandatory: if name is empty]
557
- @options data {String} notify_url: URL that will be called once the import process is finished [Optional] In notify_url, we are sending the content using POST method
558
- @options data {String} name: This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty]
559
- @options data {Integer} list_parent: This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional]
560
- */
561
- public function import_users( $data ) {
562
- return $this->post( 'user/import', json_encode( $data ) );
563
- }
564
-
565
- /*
566
- Export Users Information.
567
- @param {Array} data contains php array with key value pair.
568
- @options data {String} export_attrib: The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional]
569
- @options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}", will export all blacklisted users [Mandatory]
570
- @options data {String} notify_url: URL that will be called once the export process is finished [Optional]
571
- */
572
- public function export_users( $data ) {
573
- return $this->post( 'user/export', json_encode( $data ) );
574
- }
575
-
576
- /*
577
- Get all the processes information under the account.
578
- @param {Array} data contains php array with key value pair.
579
- @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
580
- @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
581
- */
582
- public function get_processes( $data ) {
583
- return $this->get( 'process', json_encode( $data ) );
584
- }
585
-
586
- /*
587
- Get the process information.
588
- @param {Array} data contains php array with key value pair.
589
- @options data {Integer} id: Id of process to get details [Mandatory]
590
- */
591
- public function get_process( $data ) {
592
- return $this->get( 'process/' . $data['id'], '' );
593
- }
594
-
595
- /*
596
- To retrieve details of all webhooks.
597
- @param {Array} data contains php array with key value pair.
598
- @options data {String} is_plat: Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat="" [Optional]
599
- */
600
- public function get_webhooks( $data ) {
601
- return $this->get( 'webhook', json_encode( $data ) );
602
- }
603
-
604
- /*
605
- To retrieve details of any particular webhook.
606
- @param {Array} data contains php array with key value pair.
607
- @options data {Integer} id: Id of webhook to get details [Mandatory]
608
- */
609
- public function get_webhook( $data ) {
610
- return $this->get( 'webhook/' . $data['id'], '' );
611
- }
612
-
613
- /*
614
- Create a Webhook.
615
- @param {Array} data contains php array with key value pair.
616
- @options data {String} url: URL that will be triggered by a webhook [Mandatory]
617
- @options data {String} description: Webook description [Optional]
618
- @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
619
- @options data {Integer} is_plat: Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional]
620
- */
621
- public function create_webhook( $data ) {
622
- return $this->post( 'webhook', json_encode( $data ) );
623
- }
624
-
625
- /*
626
- Delete a webhook.
627
- @param {Array} data contains php array with key value pair.
628
- @options data {Integer} id: Id of webhook to be deleted [Mandatory]
629
- */
630
- public function delete_webhook( $data ) {
631
- return $this->delete( 'webhook/' . $data['id'], '' );
632
- }
633
-
634
- /*
635
- Update a webhook.
636
- @param {Array} data contains php array with key value pair.
637
- @options data {Integer} id: Id of webhook to be modified [Mandatory]
638
- @options data {String} url: URL that will be triggered by a webhook [Mandatory]
639
- @options data {String} description: Webook description [Optional]
640
- @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
641
- */
642
- public function update_webhook( $data ) {
643
- $id = $data['id'];
644
- unset( $data['id'] );
645
- return $this->put( 'webhook/' . $id, json_encode( $data ) );
646
- }
647
-
648
- /*
649
- Get Access of created senders information.
650
- @param {Array} data contains php array with key value pair.
651
- @options data {String} option: Options to get senders. Possible options – IP-wise, & Domain-wise ( only for dedicated IP clients ). Example: to get senders with specific IP, use $option=’1.2.3.4′, to get senders with specific domain use, $option=’domain.com’, & to get all senders, use $option="" [Optional]
652
- */
653
- public function get_senders( $data ) {
654
- return $this->get( 'advanced', json_encode( $data ) );
655
- }
656
-
657
- /*
658
- Create your Senders.
659
- @param {Array} data contains php array with key value pair.
660
- @options data {String} name: Name of the sender [Mandatory]
661
- @options data {String} email: Email address of the sender [Mandatory]
662
- @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
663
- */
664
- public function create_sender( $data ) {
665
- return $this->post( 'advanced', json_encode( $data ) );
666
- }
667
-
668
- /*
669
- Update your Senders.
670
- @param {Array} data contains php array with key value pair.
671
- @options data {Integer} id: Id of sender to be modified [Mandatory]
672
- @options data {String} name: Name of the sender [Mandatory]
673
- @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
674
- */
675
- public function update_sender( $data ) {
676
- $id = $data['id'];
677
- unset( $data['id'] );
678
- return $this->put( 'advanced/' . $id, json_encode( $data ) );
679
- }
680
-
681
- /*
682
- Delete your Sender Information.
683
- @param {Array} data contains php array with key value pair.
684
- @options data {Integer} id: Id of sender to be deleted [Mandatory]
685
- */
686
- public function delete_sender( $data ) {
687
- return $this->delete( 'advanced/' . $data['id'], '' );
688
- }
689
-
690
- /*
691
- Send Transactional Email.
692
- @param {Array} data contains php array with key value pair.
693
- @options data {Array} to: Email address of the recipient(s). It should be sent as an associative array. Example: array("to@example.net"=>"to whom"). You can use commas to separate multiple recipients [Mandatory]
694
- @options data {String} subject: Message subject [Mandatory]
695
- @options data {Array} from Email address for From header. It should be sent as an array. Example: array("from@email.com","from email") [Mandatory]
696
- @options data {String} html: Body of the message. (HTML version) [Mandatory]. To send inline images, use <img src="{YourFileName.Extension}" alt="image" border="0" >, the 'src' attribute value inside {} (curly braces) should be same as the filename used in 'inline_image' parameter
697
- @options data {String} text: Body of the message. (text version) [Optional]
698
- @options data {Array} cc: Same as to but for Cc. Example: array("cc@example.net","cc whom") [Optional]
699
- @options data {Array} bcc: Same as to but for Bcc. Example: array("bcc@example.net","bcc whom") [Optional]
700
- @options data {Array} replyto: Same as from but for Reply To. Example: array("from@email.com","from email") [Optional]
701
- @options data {Array} attachment: Provide the absolute url of the attachment/s. Possible extension values = gif, png, bmp, cgm, jpg, jpeg, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, xls, ppt, tar, and ez. To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple attachments [Optional]
702
- @options data {Array} headers: The headers will be sent along with the mail headers in original email. Example: array("Content-Type"=>"text/html; charset=iso-8859-1"). You can use commas to separate multiple headers [Optional]
703
- @options data {Array} inline_image: Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple inline images [Optional]
704
- */
705
- public function send_email( $data ) {
706
- return $this->post( 'email', json_encode( $data ) );
707
- }
708
-
709
- /*
710
- Aggregate / date-wise report of the SendinBlue SMTP account.
711
- @param {Array} data contains php array with key value pair.
712
- @options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals. Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per day/date wise [Optional]
713
- @options data {String} start_date: The start date to look up statistics. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
714
- @options data {String} end_date: The end date to look up statistics. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
715
- @options data {Integer} days: Number of days in the past to include statistics ( Includes today ). It must be an integer greater than 0 [Optional]
716
- @options data {String} tag: The tag you will specify to retrieve detailed stats. It must be an existing tag that has statistics [Optional]
717
- */
718
- public function get_statistics( $data ) {
719
- return $this->post( 'statistics', json_encode( $data ) );
720
- }
721
-
722
- /*
723
- Get Email Event report.
724
- @param {Array} data contains php array with key value pair.
725
- @options data {Integer} limit: To limit the number of results returned. It should be an integer [Optional]
726
- @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
727
- @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
728
- @options data {Integer} offset: Beginning point in the list to retrieve from. It should be an integer [Optional]
729
- @options data {String} date: Specific date to get its report. Date must be in YYYY-MM-DD format and should be earlier than todays date [Optional]
730
- @options data {Integer} days: Number of days in the past (includes today). If specified, must be an integer greater than 0 [Optional]
731
- @options data {String} email: Email address to search report for [Optional]
732
- */
733
- public function get_report( $data ) {
734
- return $this->post( 'report', json_encode( $data ) );
735
- }
736
-
737
- /*
738
- Delete any hardbounce, which actually would have been blocked due to some temporary ISP failures.
739
- @param {Array} data contains php array with key value pair.
740
- @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
741
- @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
742
- @options data {String} email: Email address to delete its bounces [Optional]
743
- */
744
- public function delete_bounces( $data ) {
745
- return $this->post( 'bounces', json_encode( $data ) );
746
- }
747
-
748
- /*
749
- Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
750
- @param {Array} data contains php array with key value pair.
751
- @options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
752
- @options data {String} to: Email address of the recipient(s). You can use pipe ( | ) to separate multiple recipients. Example: "to-example@example.net|to2-example@example.net" [Mandatory]
753
- @options data {String} cc: Same as to but for Cc [Optional]
754
- @options data {String} bcc: Same as to but for Bcc [Optional]
755
- @options data {Array} attrv The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
756
- @options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere [Optional]
757
- @options data {Array} attachment: To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array [Optional]
758
- */
759
- public function send_transactional_template( $data ) {
760
- $id = $data['id'];
761
- unset( $data['id'] );
762
- return $this->put( 'template/' . $id, json_encode( $data ) );
763
- }
764
-
765
- /*
766
- Create a Template.
767
- @param {Array} data contains php array with key value pair.
768
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
769
- @options data {String} template_name: Name of the Template [Mandatory]
770
- @options data {String} bat: Email address for test mail [Optional]
771
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
772
- @options data {String} html_url Url: which content is the body of content [Mandatory: if html_content is empty]
773
- @options data {String} subject: Subject of the campaign [Mandatory]
774
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
775
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
776
- @options data {String} to_fieldv This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
777
- @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
778
- @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
779
- */
780
- public function create_template( $data ) {
781
- return $this->post( 'template', json_encode( $data ) );
782
- }
783
-
784
- /*
785
- Update a Template.
786
- @param {Array} data contains php array with key value pair.
787
- @options data {Integer} id: Id of Template to be modified [Mandatory]
788
- @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
789
- @options data {String} template_name: Name of the Template [Mandatory]
790
- @options data {String} bat: Email address for test mail [Optional]
791
- @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
792
- @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
793
- @options data {String} subject: Subject of the campaign [Mandatory]
794
- @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
795
- @options data {String} reply_to: The reply to email in the campaign emails [Optional]
796
- @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
797
- @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
798
- @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
799
- */
800
- public function update_template( $data ) {
801
- $id = $data['id'];
802
- unset( $data['id'] );
803
- return $this->put( 'template/' . $id, json_encode( $data ) );
804
- }
805
-
806
- /*
807
- Send a transactional SMS.
808
- @param {Array} data contains php array with key value pair.
809
- @options data {String} to: The mobile number to send SMS to with country code [Mandatory]
810
- @options data {String} from: The name of the sender. The number of characters is limited to 11 (alphanumeric format) [Mandatory]
811
- @options data {String} text: The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory]
812
- @options data {String} web_url: The web URL that can be called once the message is successfully delivered [Optional]
813
- @options data {String} tag: The tag that you can associate with the message [Optional]
814
- @options data {String} type: Type of message. Possible values – marketing (default) & transactional. You can use marketing for sending marketing SMS, & for sending transactional SMS, use transactional type [Optional]
815
- */
816
- public function send_sms( $data ) {
817
- return $this->post( 'sms', json_encode( $data ) );
818
- }
819
-
820
- /*
821
- Create & Schedule your SMS campaigns.
822
- @param {Array} data contains php array with key value pair.
823
- @options data {String} name: Name of the SMS campaign [Mandatory]
824
- @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
825
- @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
826
- @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
827
- @options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
828
- @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
829
- @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
830
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
831
- */
832
- public function create_sms_campaign( $data ) {
833
- return $this->post( 'sms', json_encode( $data ) );
834
- }
835
-
836
- /*
837
- Update your SMS campaigns.
838
- @param {Array} data contains php array with key value pair.
839
- @options data {Integer} id: Id of the SMS campaign [Mandatory]
840
- @options data {String} name: Name of the SMS campaign [Optional]
841
- @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
842
- @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
843
- @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
844
- @options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
845
- @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
846
- @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
847
- @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
848
- */
849
- public function update_sms_campaign( $data ) {
850
- $id = $data['id'];
851
- unset( $data['id'] );
852
- return $this->put( 'sms/' . $id, json_encode( $data ) );
853
- }
854
-
855
- /*
856
- Send a Test SMS.
857
- @param {Array} data contains php array with key value pair.
858
- @options data {Integer} id: Id of the SMS campaign [Mandatory]
859
- @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory]
860
- */
861
- public function send_bat_sms( $data ) {
862
- $id = $data['id'];
863
- unset( $data['id'] );
864
- return $this->get( 'sms/' . $id, json_encode( $data ) );
865
- }
866
-
867
- }
868
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
option-panel.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- function logincust_register_options_page() {
3
- add_theme_page( __( 'Login Customizer', 'login-customizer' ), __( 'Login Customizer', 'login-customizer' ), 'manage_options', 'logincust_options', 'logincust_options_page' );
4
- }
5
- add_action( 'admin_menu', 'logincust_register_options_page' );
6
-
7
- function logincust_admin_style() {
8
- wp_enqueue_style( 'admin_style', LOGINCUST_FREE_URL . '/css/admin.css', array(), LOGINCUST_VERSION, false );
9
- }
10
- add_action( 'admin_enqueue_scripts', 'logincust_admin_style' );
11
-
12
-
13
- function logincust_options_page() {
14
- ?>
15
- <div class="wrap">
16
- <div id="logincust-logo"></div>
17
- <h2><?php _e( 'Login Customizer', 'login-customizer' ); ?></h2>
18
- <h3><?php _e( 'Howdy!', 'login-customizer' ); ?></h3>
19
- <p><?php _e( 'Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your changes before you save them! Awesome, right?', 'login-customizer' ); ?></p>
20
- <p><?php _e( 'In Customizer, navigate to Login Customizer', 'login-customizer' ); ?>.</p>
21
- <a href="<?php echo get_admin_url(); ?>customize.php?url=<?php echo wp_login_url(); ?>" id="submit" class="button button-primary"><?php _e( 'Start Customizing!', 'login-customizer' ); ?></a>
22
- <h3><?php _e( 'Credits/Support (All the unwanted crap)', 'login-customizer' ); ?></h3>
23
- <p><?php _e( 'If you find any issues or if you want to contribute, then please free to drop me a mail at', 'login-customizer' ); ?> <a href="https://themeisle.com/contact" target="_blank" rel="nofollow"><?php _e( 'this link', 'login-customizer' ); ?></a>.</p>
24
- <p><?php _e( 'Thanks for using this plugin. Don not forget to leave a review.', 'login-customizer' ); ?></p>
25
- <p> <a href="https://themeisle.com/" target="_blank" rel="nofollow"><?php _e( 'ThemeIsle :)', 'login-customizer' ); ?></a>.</p>
26
-
27
- <h3><?php _e( 'Subscribe', 'login-customizer' ); ?></h3>
28
- <?php
29
- if ( ! empty( $_POST['logincust_mail'] ) ) {
30
- require( LOGINCUST_FREE_PATH . 'mailin.php' );
31
- $was_submited = get_option( 'mail_was_submited', false );
32
- $user_info = get_userdata( 1 );
33
- $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
34
- $data = array(
35
- 'email' => $_POST['logincust_mail'],
36
- 'attributes' => array('NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name),
37
- 'blacklisted' => 0,
38
- 'listid' => array(34),
39
- 'blacklisted_sms' => 0,
40
- );
41
- $status = $mailin->create_update_user( $data );
42
- if ( $status['code'] == 'success' ) {
43
- if ( empty( $was_submited ) ) {
44
- add_option( 'logincust_mail_was_submited', true );
45
- }
46
- }
47
- }
48
-
49
- $was_submited = get_option( 'logincust_mail_was_submited', false );
50
- if ( $was_submited == false ) {
51
- echo sprintf( '<p> %s </p><form class="logincust-submit-mail" method="post"><input name="logincust_mail" type="email" class="wp-pointer-input" value="' . get_option( 'admin_email' ) . '" /><input class="button wp-pointer-submit button-primary" type="submit" value="Join Now !"></form>', esc_html__( 'Our free, 4-lesson course on how to make your WordPress site run incredibly fast is barely waiting for its students. Ready to learn how to reduce your loading times by half? Come and join the 1st lesson here!', 'login-customizer' ) );
52
- } else {
53
- echo sprintf( '<p> %s </p>', esc_html__( 'Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the Unsubscribe link included in each newsletter.', 'login-customizer' ) );
54
- }
55
- ?>
56
- </div>
57
- <?php
58
- }
59
-
60
-
61
- function logincust_dashboard_widget() {
62
- wp_add_dashboard_widget( 'logincust_subscribe_widget', __( 'Subscribe', 'login-customizer' ), 'logincust_subscribe_widget' );
63
- }
64
- add_action( 'wp_dashboard_setup', 'logincust_dashboard_widget' );
65
-
66
- function logincust_subscribe_widget() {
67
- if ( ! empty( $_POST['logincust_mail'] ) ) {
68
- require( LOGINCUST_FREE_PATH . 'mailin.php' );
69
- $was_submited = get_option( 'logincust_mail_was_submited', false );
70
- $user_info = get_userdata( 1 );
71
- $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
72
- $data = array(
73
- 'email' => $_POST['logincust_mail'],
74
- 'attributes' => array('NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name),
75
- 'blacklisted' => 0,
76
- 'listid' => array(34),
77
- 'blacklisted_sms' => 0,
78
- );
79
- $status = $mailin->create_update_user( $data );
80
- if ( $status['code'] == 'success' ) {
81
- if ( empty( $was_submited ) ) {
82
- add_option( 'logincust_mail_was_submited', true );
83
- }
84
- }
85
- }
86
-
87
- $was_submited = get_option( 'logincust_mail_was_submited', false );
88
- if ( $was_submited == false ) {
89
- echo sprintf( '<p> %s </p><form class="logincust-submit-mail" method="post"><input name="logincust_mail" type="email" class="wp-pointer-input" value="' . get_option( 'admin_email' ) . '" /><input class="button wp-pointer-submit" type="submit" value="Submit"></form>', esc_html__( 'Our free, 4-lesson course on how to make your WordPress site run incredibly fast is barely waiting for its students. Ready to learn how to reduce your loading times by half? Come and join the 1st lesson here!', 'login-customizer' ) );
90
- } else {
91
- echo sprintf( '<p> %s </p>', esc_html__( 'Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the Unsubscribe link included in each newsletter.', 'login-customizer' ) );
92
- }
93
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.md CHANGED
@@ -12,7 +12,9 @@ Custom Login Customizer allows you to easily customize your admin login page, st
12
 
13
  ## Description ##
14
 
15
- ><a href="https://themeisle.com/plugins/login-customizer/" target="_blank" rel="nofollow">Custom Login Page Customizer</a> plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your custom login changes before you save them! Awesome, right?
 
 
16
 
17
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
18
 
@@ -40,6 +42,21 @@ Please visit <a target="_blank" rel="nofollow" href="http://themeisle.com">this
40
  2. Another Great Custom Login Page Example
41
 
42
  ## Changelog ##
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ### 1.2.1 - 2018-01-05 ###
44
 
45
  * Improves compatiblity with latest WordPress version.
12
 
13
  ## Description ##
14
 
15
+ <a href="https://themeisle.com/plugins/login-customizer/" target="_blank" rel="nofollow">Custom Login Page Customizer</a> plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your custom login changes before you save them! Awesome, right?
16
+
17
+ https://www.youtube.com/watch?v=rtXJ44BsSWM
18
 
19
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
20
 
42
  2. Another Great Custom Login Page Example
43
 
44
  ## Changelog ##
45
+ ### 2.0.0 - 2018-08-06 ###
46
+
47
+ * Added Template Feature
48
+ * Added Instant Refresh for Controls
49
+ * Fixed issue with Security plugins and Multisite
50
+
51
+
52
+ ### 2.0 - 2018-03-09 ###
53
+
54
+ * Fixed issues with security plugins
55
+ * Added Instant Refresh
56
+ * Improved UX
57
+ * Added more controls
58
+
59
+
60
  ### 1.2.1 - 2018-01-05 ###
61
 
62
  * Improves compatiblity with latest WordPress version.
readme.txt CHANGED
@@ -12,7 +12,9 @@ Custom Login Customizer allows you to easily customize your admin login page, st
12
 
13
  == Description ==
14
 
15
- ><a href="https://themeisle.com/plugins/login-customizer/" target="_blank" rel="nofollow">Custom Login Page Customizer</a> plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your custom login changes before you save them! Awesome, right?
 
 
16
 
17
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
18
 
@@ -40,6 +42,21 @@ Please visit <a target="_blank" rel="nofollow" href="http://themeisle.com">this
40
  2. Another Great Custom Login Page Example
41
 
42
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  = 1.2.1 - 2018-01-05 =
44
 
45
  * Improves compatiblity with latest WordPress version.
12
 
13
  == Description ==
14
 
15
+ <a href="https://themeisle.com/plugins/login-customizer/" target="_blank" rel="nofollow">Custom Login Page Customizer</a> plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your custom login changes before you save them! Awesome, right?
16
+
17
+ https://www.youtube.com/watch?v=rtXJ44BsSWM
18
 
19
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
20
 
42
  2. Another Great Custom Login Page Example
43
 
44
  == Changelog ==
45
+ = 2.0.0 - 2018-08-06 =
46
+
47
+ * Added Template Feature
48
+ * Added Instant Refresh for Controls
49
+ * Fixed issue with Security plugins and Multisite
50
+
51
+
52
+ = 2.0 - 2018-03-09 =
53
+
54
+ * Fixed issues with security plugins
55
+ * Added Instant Refresh
56
+ * Improved UX
57
+ * Added more controls
58
+
59
+
60
  = 1.2.1 - 2018-01-05 =
61
 
62
  * Improves compatiblity with latest WordPress version.
setup.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Include Login Customizer Setup class.
4
+ */
5
+ include( LOGINCUST_FREE_PATH . 'inc/initial-setup.php' );
6
+
7
+ /**
8
+ * Setup login page for new and updated instances.
9
+ */
10
+ if ( get_option( 'login_customizer_settings' ) ) {
11
+ $db_version = get_option( 'login_customizer_settings', array() );
12
+ $db_version = $db_version['version'];
13
+ if ( isset( $db_version ) ) {
14
+ // Compare version of plugin with previously saved version
15
+ if ( version_compare( $db_version, LOGINCUST_VERSION, '<' ) ) {
16
+ // Setup login page
17
+ return LoginCustomizerSetup::get_instance();
18
+ }
19
+ }
20
+ } else {
21
+ // Array of old options
22
+ $options = array(
23
+ 'logincust_logo',
24
+ 'logincust_logo_width',
25
+ 'logincust_logo_height',
26
+ 'logincust_logo_padding',
27
+ 'logincust_bg_image',
28
+ 'logincust_bg_color',
29
+ 'logincust_bg_size',
30
+ 'logincust_form_bg_image',
31
+ 'logincust_form_bg_color',
32
+ 'logincust_form_width',
33
+ 'logincust_form_height',
34
+ 'logincust_form_padding',
35
+ 'logincust_field_width',
36
+ 'logincust_field_margin',
37
+ 'logincust_field_bg',
38
+ 'logincust_field_color',
39
+ 'logincust_field_label',
40
+ 'logincust_button_bg',
41
+ 'logincust_button_border',
42
+ 'logincust_button_shadow',
43
+ 'logincust_button_color',
44
+ 'logincust_button_hover_bg',
45
+ 'logincust_button_hover_border',
46
+ 'logincust_other_color',
47
+ 'logincust_other_color_hover',
48
+ 'logincust_other_css',
49
+ );
50
+
51
+ // if old options exist, update to new system
52
+ foreach ( $options as $key ) {
53
+ if ( $existing = get_option( $key ) ) {
54
+ $options[ $key ] = $existing;
55
+ delete_option( $key );
56
+ }
57
+ }
58
+
59
+ // Add new plugin options
60
+ add_option( 'login_customizer_options', $options );
61
+ add_option( 'login_customizer_settings', array() );
62
+
63
+ // Setup login page
64
+ return LoginCustomizerSetup::get_instance();
65
+ }
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"customizer.php":"5de7b49d0b22efeb70da838f348c9661","login-customizer.php":"899cb02ed51357d988778dda0799a10a","mailin.php":"dc3dba30341f92ce445c5cc376c32120","option-panel.php":"5cd0d73679fa104aa63cf0e8bf7e26e6"}
1
+ {"index.php":"ffd8a0a4acfad7aa420ae97774ec0791","login-customizer.php":"78665015126816b067ed6bc004de9de0","setup.php":"fd7a20c2256722ebae7bbcb252f935d5"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitabe70813613123366e24bb1f9e3ea955::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit7f363fc03e498c3d487caeb44664caa2::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit2f2e3a70d20cae0b59c0d1c8920b50f0::getLoader();
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-endpoints.php CHANGED
@@ -235,7 +235,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Endpoints' ) ) :
235
 
236
  // fetch the calculated hashes.
237
  if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
238
- return new WP_Error( 'themeisle_sdk_hash_not_found', sprintf( __( '%s not found', 'themeisle-sdk' ), self::HASH_FILE ) );
239
  }
240
 
241
  $hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
@@ -296,7 +296,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Endpoints' ) ) :
296
  $value = sanitize_text_field( $data[ $param ] );
297
  if ( empty( $value ) ) {
298
  return new WP_Error(
299
- 'themeisle_' . $param . '_invalid', sprintf( __( 'Invalid %', 'themeisle-sdk' ), $param ), array(
300
  'status' => 403,
301
  )
302
  );
235
 
236
  // fetch the calculated hashes.
237
  if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
238
+ return new WP_Error( 'themeisle_sdk_hash_not_found', sprintf( '%s not found', self::HASH_FILE ) );
239
  }
240
 
241
  $hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
296
  $value = sanitize_text_field( $data[ $param ] );
297
  if ( empty( $value ) ) {
298
  return new WP_Error(
299
+ 'themeisle_' . $param . '_invalid', sprintf( 'Invalid %', $param ), array(
300
  'status' => 403,
301
  )
302
  );
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php CHANGED
@@ -515,12 +515,12 @@ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
515
  return '<div id="' . $this->product->get_key() . '">'
516
  . '<ul class="ti-list">' . $list . '</ul>'
517
  . '<div class="actions">'
518
- . get_submit_button(
519
- $button_submit, 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
520
- 'data-after-text' => $button_submit,
521
- 'disabled' => true,
522
- )
523
- )
524
  . get_submit_button( $button_cancel, 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
525
  . '</div></div>';
526
  }
515
  return '<div id="' . $this->product->get_key() . '">'
516
  . '<ul class="ti-list">' . $list . '</ul>'
517
  . '<div class="actions">'
518
+ . get_submit_button(
519
+ $button_submit, 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
520
+ 'data-after-text' => $button_submit,
521
+ 'disabled' => true,
522
+ )
523
+ )
524
  . get_submit_button( $button_cancel, 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
525
  . '</div></div>';
526
  }
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php CHANGED
@@ -49,7 +49,8 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
49
  * @param ThemeIsle_SDK_Product $product The product object.
50
  */
51
  public function __construct( $product ) {
52
- $this->product = $product;
 
53
  $this->product_key = $this->product->get_key() . '-update-response';
54
  if ( ! $this->product->requires_license() ) {
55
  $this->license_key = 'free';
@@ -517,6 +518,39 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
517
  delete_transient( $this->product_key );
518
  }
519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  /**
521
  * Check for updates
522
  *
@@ -525,49 +559,29 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
525
  function check_for_update() {
526
  $theme = wp_get_theme( $this->product->get_slug() );
527
  $update_data = get_transient( $this->product_key );
 
528
  if ( false === $update_data ) {
529
  $failed = false;
530
- if ( empty( $this->license_key ) ) {
531
- return false;
532
- }
533
- $api_params = array(
534
- 'edd_action' => 'get_version',
535
- 'version' => $this->product->get_version(),
536
- 'license' => $this->license_key,
537
- 'name' => $this->product->get_name(),
538
- 'slug' => $this->product->get_slug(),
539
- 'author' => $this->product->get_store_name(),
540
- 'url' => rawurlencode( home_url() ),
541
- );
542
- $response = wp_remote_post(
543
- $this->product->get_store_url(), array(
544
- 'timeout' => 15,
545
- 'sslverify' => false,
546
- 'body' => $api_params,
547
- )
548
- );
549
- // make sure the response was successful
550
- if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
551
- $failed = true;
552
- }
553
- $update_data = json_decode( wp_remote_retrieve_body( $response ) );
554
- if ( ! is_object( $update_data ) ) {
555
  $failed = true;
556
  }
557
- // if the response failed, try again in 30 minutes
558
  if ( $failed ) {
559
  $data = new stdClass;
560
  $data->new_version = $this->product->get_version();
561
  set_transient( $this->product_key, $data, strtotime( '+30 minutes' ) );
562
 
563
  return false;
564
- }
565
- // if the status is 'ok', return the update arguments
566
- if ( ! $failed ) {
567
  $update_data->sections = maybe_unserialize( $update_data->sections );
568
  set_transient( $this->product_key, $update_data, strtotime( '+12 hours' ) );
569
  }
570
  }
 
 
 
571
  if ( version_compare( $this->product->get_version(), $update_data->new_version, '>=' ) ) {
572
  return false;
573
  }
@@ -618,34 +632,14 @@ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
618
  * @return false||object
619
  */
620
  private function api_request( $_action = '', $_data = '' ) {
621
- if ( empty( $this->license_key ) ) {
622
- return;
623
- }
624
- $api_params = array(
625
- 'edd_action' => 'get_version',
626
- 'license' => $this->license_key,
627
- 'name' => rawurlencode( $this->product->get_name() ),
628
- 'slug' => rawurlencode( $this->product->get_slug() ),
629
- 'author' => $this->product->get_store_name(),
630
- 'url' => rawurlencode( home_url() ),
631
- );
632
- $request = wp_remote_post(
633
- $this->product->get_store_url(), array(
634
- 'timeout' => 15,
635
- 'sslverify' => false,
636
- 'body' => $api_params,
637
- )
638
- );
639
- if ( ! is_wp_error( $request ) ) :
640
- $request = json_decode( wp_remote_retrieve_body( $request ) );
641
- if ( $request && isset( $request->sections ) ) {
642
- $request->sections = maybe_unserialize( $request->sections );
643
- }
644
-
645
- return $request;
646
- else :
647
  return false;
648
- endif;
 
 
 
 
649
  }
650
 
651
  /**
49
  * @param ThemeIsle_SDK_Product $product The product object.
50
  */
51
  public function __construct( $product ) {
52
+ $this->product = $product;
53
+
54
  $this->product_key = $this->product->get_key() . '-update-response';
55
  if ( ! $this->product->requires_license() ) {
56
  $this->license_key = 'free';
518
  delete_transient( $this->product_key );
519
  }
520
 
521
+ /**
522
+ * Check remote api for latest version.
523
+ *
524
+ * @return bool|mixed Update api response.
525
+ */
526
+ private function get_version_data() {
527
+ $api_params = array(
528
+ 'edd_action' => 'get_version',
529
+ 'version' => $this->product->get_version(),
530
+ 'license' => $this->license_key,
531
+ 'name' => $this->product->get_name(),
532
+ 'slug' => $this->product->get_slug(),
533
+ 'author' => $this->product->get_store_name(),
534
+ 'url' => rawurlencode( home_url() ),
535
+ );
536
+ $response = wp_remote_post(
537
+ $this->product->get_store_url(), array(
538
+ 'timeout' => 15,
539
+ 'sslverify' => false,
540
+ 'body' => $api_params,
541
+ )
542
+ );
543
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
544
+ return false;
545
+ }
546
+ $update_data = json_decode( wp_remote_retrieve_body( $response ) );
547
+ if ( ! is_object( $update_data ) ) {
548
+ return false;
549
+ }
550
+
551
+ return $update_data;
552
+ }
553
+
554
  /**
555
  * Check for updates
556
  *
559
  function check_for_update() {
560
  $theme = wp_get_theme( $this->product->get_slug() );
561
  $update_data = get_transient( $this->product_key );
562
+
563
  if ( false === $update_data ) {
564
  $failed = false;
565
+
566
+ $update_data = $this->get_version_data();
567
+ if ( empty( $update_data ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
  $failed = true;
569
  }
570
+ // If the response failed, try again in 30 minutes.
571
  if ( $failed ) {
572
  $data = new stdClass;
573
  $data->new_version = $this->product->get_version();
574
  set_transient( $this->product_key, $data, strtotime( '+30 minutes' ) );
575
 
576
  return false;
577
+ } else {
 
 
578
  $update_data->sections = maybe_unserialize( $update_data->sections );
579
  set_transient( $this->product_key, $update_data, strtotime( '+12 hours' ) );
580
  }
581
  }
582
+ if ( ! isset( $update_data->new_version ) ) {
583
+ return false;
584
+ }
585
  if ( version_compare( $this->product->get_version(), $update_data->new_version, '>=' ) ) {
586
  return false;
587
  }
632
  * @return false||object
633
  */
634
  private function api_request( $_action = '', $_data = '' ) {
635
+ $update_data = $this->get_version_data();
636
+ if ( empty( $update_data ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  return false;
638
+ }
639
+ if ( $update_data && isset( $update_data->sections ) ) {
640
+ $update_data->sections = maybe_unserialize( $update_data->sections );
641
+ }
642
+ return $update_data;
643
  }
644
 
645
  /**
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Loader' ) ) :
48
 
49
  $notifications = array();
50
  // Based on the WordPress Available file header we enable the logger or not.
51
- if ( ! $product_object->is_wordpress_available() ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
54
  }
48
 
49
  $notifications = array();
50
  // Based on the WordPress Available file header we enable the logger or not.
51
+ if ( ! $product_object->is_wordpress_available() && apply_filters( $product_object->get_key() . '_enable_licenser', true ) === true ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
54
  }
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php CHANGED
@@ -170,16 +170,16 @@ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
170
  return '<div >'
171
  . '<p>' . $heading . '</p>'
172
  . '<div class="actions">'
173
- . get_submit_button(
174
- $button_submit, 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
175
- 'data-ti-log-enable' => 1,
176
- )
177
- )
178
- . get_submit_button(
179
- $button_cancel, 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
180
- 'data-ti-log-enable' => 0,
181
- )
182
- )
183
  . '</div></div>';
184
  }
185
 
170
  return '<div >'
171
  . '<p>' . $heading . '</p>'
172
  . '<div class="actions">'
173
+ . get_submit_button(
174
+ $button_submit, 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
175
+ 'data-ti-log-enable' => 1,
176
+ )
177
+ )
178
+ . get_submit_button(
179
+ $button_cancel, 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
180
+ 'data-ti-log-enable' => 0,
181
+ )
182
+ )
183
  . '</div></div>';
184
  }
185
 
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php CHANGED
@@ -60,7 +60,38 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
60
  /**
61
  * @var array $allowed_authors The allowed authors.
62
  */
63
- private $allowed_authors = array( 'proteusthemes.com', 'anarieldesign.com', 'prothemedesign.com', 'cssigniter.com' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  /**
65
  * @var bool $requires_license Either user needs to activate it with license.
66
  */
@@ -168,6 +199,9 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
168
  if ( strpos( $this->author_url, $author ) !== false ) {
169
  return true;
170
  }
 
 
 
171
  }
172
 
173
  return false;
@@ -278,6 +312,52 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
278
  return $versions;
279
  }
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  /**
282
  * Return theme versions.
283
  *
@@ -315,20 +395,20 @@ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
315
  * @return array Array of versions.
316
  */
317
  private function get_api_versions() {
318
- if ( ! $this->is_wordpress_available() ) {
319
- return array();
320
- }
321
 
322
  $cache_key = $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions';
323
  $cache_versions = get_transient( $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions' );
324
  if ( false == $cache_versions ) {
325
  $versions = array();
326
- if ( $this->get_type() === 'plugin' ) {
327
- $versions = $this->get_plugin_versions();
328
- }
329
-
330
- if ( $this->get_type() === 'theme' ) {
331
- $versions = $this->get_theme_versions();
 
 
 
332
  }
333
  set_transient( $cache_key, $versions, MONTH_IN_SECONDS );
334
  } else {
60
  /**
61
  * @var array $allowed_authors The allowed authors.
62
  */
63
+ private $allowed_authors = array(
64
+ 'proteusthemes.com',
65
+ 'anarieldesign.com',
66
+ 'prothemedesign.com',
67
+ 'cssigniter.com',
68
+ );
69
+ /**
70
+ * @var array $allowed_external_products The allowed external_products.
71
+ */
72
+ private $allowed_products = array(
73
+ 'zermatt',
74
+ 'neto',
75
+ 'olsen',
76
+ 'benson',
77
+ 'romero',
78
+ 'carmack',
79
+ 'puzzle',
80
+ 'broadsheet',
81
+ 'girlywp',
82
+ 'veggie',
83
+ 'zeko',
84
+ 'maishawp',
85
+ 'didi',
86
+ 'liber',
87
+ 'medicpress-pt',
88
+ 'adrenaline-pt',
89
+ 'consultpress-pt',
90
+ 'legalpress-pt',
91
+ 'gympress-pt',
92
+ 'readable-pt',
93
+ 'bolts-pt',
94
+ );
95
  /**
96
  * @var bool $requires_license Either user needs to activate it with license.
97
  */
199
  if ( strpos( $this->author_url, $author ) !== false ) {
200
  return true;
201
  }
202
+ if ( in_array( $this->get_slug(), $this->allowed_products ) ) {
203
+ return true;
204
+ }
205
  }
206
 
207
  return false;
312
  return $versions;
313
  }
314
 
315
+ /**
316
+ * @return string Return license key, if available.
317
+ */
318
+ private function get_license() {
319
+ $license_data = get_option( $this->get_key() . '_license_data', '' );
320
+
321
+ if ( empty( $license_data ) ) {
322
+ return '';
323
+ }
324
+ if ( ! isset( $license_data->key ) ) {
325
+ return '';
326
+ }
327
+
328
+ return $license_data->key;
329
+ }
330
+
331
+ /**
332
+ * @return array Array of available versions.
333
+ */
334
+ private function get_pro_versions() {
335
+ $license = $this->get_license();
336
+ $store_url = trailingslashit( $this->store_url );
337
+ $url = sprintf( '%s?edd_action=get_versions&name=%s&url=%s&license=%s', $store_url, urlencode( $this->get_name() ), urlencode( get_site_url() ), $license );
338
+ $response = wp_remote_get( $url );
339
+ if ( is_wp_error( $response ) ) {
340
+ return array();
341
+ }
342
+ $response = wp_remote_retrieve_body( $response );
343
+ $response = json_decode( $response );
344
+ if ( ! is_object( $response ) ) {
345
+ return array();
346
+ }
347
+ if ( ! isset( $response->versions ) ) {
348
+ return array();
349
+ }
350
+ $versions = array();
351
+ foreach ( $response->versions as $key => $version ) {
352
+ $versions[] = array(
353
+ 'version' => $version->version,
354
+ 'url' => $version->file,
355
+ );
356
+ }
357
+
358
+ return $versions;
359
+ }
360
+
361
  /**
362
  * Return theme versions.
363
  *
395
  * @return array Array of versions.
396
  */
397
  private function get_api_versions() {
 
 
 
398
 
399
  $cache_key = $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions';
400
  $cache_versions = get_transient( $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions' );
401
  if ( false == $cache_versions ) {
402
  $versions = array();
403
+ if ( ! $this->is_wordpress_available() ) {
404
+ $versions = $this->get_pro_versions();
405
+ } else {
406
+ if ( $this->get_type() === 'plugin' ) {
407
+ $versions = $this->get_plugin_versions();
408
+ }
409
+ if ( $this->get_type() === 'theme' ) {
410
+ $versions = $this->get_theme_versions();
411
+ }
412
  }
413
  set_transient( $cache_key, $versions, MONTH_IN_SECONDS );
414
  } else {
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php CHANGED
@@ -108,144 +108,173 @@ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
108
  */
109
  function render_dashboard_widget() {
110
  $this->setup_feeds();
 
 
 
111
  ?>
112
  <style type="text/css">
113
- #themeisle ul {
114
- margin-bottom: 0px;
115
- }
116
-
117
  #themeisle ul li.ti-dw-recommend-item {
118
-
119
  padding-left: 7px;
120
  border-top: 1px solid #eee;
121
-
122
  margin-bottom: 0px;
123
  padding-top: 6px;
124
  }
125
 
126
  #themeisle h2.hndle {
127
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALfSURBVEhL7VW/ayJBFL7/5ZqziBzIcSCHxUE4hAiCgnAQsBASOAikEAIeCAaCiJAyIBICQURYwoJoEUmxa6MWioWxURu30mq77b57s86acX+oOQhp8sFjdmbfzrfve2/efMI74IP0VTB0gz/th/8iNbQxOt0eOmoN6WgAn78cwJeoYcLf78KrSPVneU3isEQZoz0D3pt03jhDrDTERJXxWM3A5yAOIPmgce/t2IvUGFzjkDa+7C5RTx0gWbxG0v8bBXUG3fLReigk4rh55gtbsAfpGDfhVTS+VA19bYbH7BkqU/56AzNU7nrYpbI7qfbEcxfBkSOHJGO27Vk0htqEYoXvARdS+tsEJyAJY1GRkOxnGTdq2zuaRZOkJ1Wi1+h7ODlJB/l1kYRKZVyKhMwoSmUw5M4uWMhIcl9f1l1qB2m/aMkZQIE2d5BeDTGiSD0VfC4jZPmSKiO+LMJGuoRE1bkiOIW00CAdW3NuxzLmxhD1hyHmug7dbBRD9KdLc4dR6Zfgn0ffXN2EjVSMLIcOrWxuwiyyPhYGI7X0m/agqPeIib5+yit/LWILKYuUlrTa5kbMwjko7J0AXc1RLZwifRF58Us1YXMzYSMV5WQ5ZWsG5VnYaG1BxM7zKBRzOAkHac460gxK9sUnVBqbu9rhKCS9lRaq1/poCeUq7tL6uPnjSLeoBRo9/KXjslqP4Na1gbiQssiULK9gP+VVqPnFQMblnwi+WmTfIji5amLES1mn/mz9yCFVuddZdiFlIJlTK+JtH2/AaPMogzipzrZ+4yQ1qCL1JSaNDL6bf81y1aOb5R6Vhow6G1tPNK9Borl0R2NLRiEaxNEF9Wa3yrHBSarTbeHot7ySqVmYR4AucDYuaJyzkfptZ0e/FeGa03m3jOQPizCAo0QG9W2ktL5HgGt45JRgaBh1x9R1WHY0KCTnLZOW5Kw0miuZq01ITGa6Z18Db9I3xAfpm+IdSIF/du91gSA2+I8AAAAASUVORK5CYII=');
128
  background-repeat: no-repeat;
129
- background-position: 90% 50%;
130
- background-size: 29px;
131
  }
132
 
133
- .ti-dw-feed-item {
 
 
 
 
 
 
 
 
 
 
134
  display: flex;
135
  align-items: center;
 
 
 
 
136
  }
137
 
138
- .ti-dw-feed-item a {
139
- float: left;
140
- width: 89.9%;
141
  }
142
 
143
- .ti-dw-feed-item .ti-dw-day-container {
144
- width: 100%;
145
- letter-spacing: 3px;
146
- display: block;
147
  }
148
 
149
  .ti-dw-feed-item .ti-dw-month-container {
150
-
151
- width: 100%;
152
- display: block;
153
- font-weight: 600;
154
- padding: 0px;
155
- margin-top: -6px;
156
  text-transform: uppercase;
157
  font-size: 10px;
158
  letter-spacing: 1px;
 
159
  }
160
 
161
  .ti-dw-feed-item .ti-dw-date-container {
162
- float: left;
163
- min-height: 30px;
164
- margin-right: 0.1%;
165
- width: 10%;
 
 
 
 
 
 
 
 
 
 
 
 
166
  text-align: center;
167
  }
168
 
 
 
 
 
169
  .ti-dw-recommend-item span {
170
  color: #72777c;
171
  }
172
 
173
  .ti-dw-powered-by {
174
- font-style: italic;
175
- text-align: right;
176
- margin-top:3px;
 
 
 
 
 
177
  }
178
 
179
  </style>
180
- <ul>
181
  <?php
182
  foreach ( $this->items as $item ) {
183
  ?>
184
- <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
185
- class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
186
- class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
187
- href="
188
- <?php
189
- echo add_query_arg(
190
- array(
191
- 'utm_campaign' => 'feed',
192
- 'utm_medium' => 'dashboard_widget',
193
- ), $item['link']
194
- );
195
- ?>
196
- " target="_blank"><?php echo $item['title']; ?></a>
197
- <div class="clear"></div>
 
198
  </li>
199
  <?php
200
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
 
202
- $recommend = apply_filters( 'themeisle_sdk_recommend_plugin_or_theme', array() );
203
- if ( is_array( $recommend ) && ! empty( $recommend ) ) {
204
 
205
- $type = $recommend['type'];
206
- if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
207
- add_thickbox();
208
  $url = add_query_arg(
209
  array(
210
- 'theme' => $recommend['slug'],
211
- ), network_admin_url( 'theme-install.php' )
 
212
  );
213
-
214
- if ( 'plugin' === $type ) {
215
-
216
- $url = add_query_arg(
217
- array(
218
- 'tab' => 'plugin-information',
219
- 'plugin' => $recommend['slug'],
220
- ), network_admin_url( 'plugin-install.php' )
221
- );
222
- }
223
- ?>
224
- <li class="ti-dw-recommend-item ">
225
  <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
226
  : </span>
227
- <?php
228
- echo trim(
229
- str_replace(
230
- array(
231
- 'lite',
232
- 'Lite',
233
- ), '', $recommend['name']
234
- )
235
- );
236
- ?>
237
- (<a class="thickbox open-plugin-details-modal"
238
- href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
239
- </li>
240
- <li class="ti-dw-powered-by">
241
- Powered by <?php echo esc_attr( $this->product->get_friendly_name() ); ?>
242
- </li>
243
-
244
  <?php
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
- ?>
248
- </ul>
249
 
250
  <?php
251
 
108
  */
109
  function render_dashboard_widget() {
110
  $this->setup_feeds();
111
+ if ( empty( $this->items ) || ! is_array( $this->items ) ) {
112
+ return;
113
+ }
114
  ?>
115
  <style type="text/css">
 
 
 
 
116
  #themeisle ul li.ti-dw-recommend-item {
 
117
  padding-left: 7px;
118
  border-top: 1px solid #eee;
 
119
  margin-bottom: 0px;
120
  padding-top: 6px;
121
  }
122
 
123
  #themeisle h2.hndle {
124
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3Ny4xMiA3Ny4xMiI+PHRpdGxlPkFzc2V0IDM8L3RpdGxlPjxwYXRoIGQ9Ik03NS43Niw0Ny42cS0xLjUsNi40Ni00LjA3LDkuMjZBMzYuMjIsMzYuMjIsMCwwLDEsNjMuMjYsNjNhNTEsNTEsMCwwLDEtOS43OSw0LjZoLS4xNXY0LjgyQTQuNjYsNC42NiwwLDAsMSw1Miw3NS43Niw0LjA3LDQuMDcsMCwwLDEsNDksNzcuMTJhNCw0LDAsMCwxLTIuMTgtLjYxQTQuOTQsNC45NCwwLDAsMSw0NS4xOSw3NWE0LjQyLDQuNDIsMCwwLDEtNy41NCwwLDQuOTQsNC45NCwwLDAsMS0xLjU4LDEuNSwzLjc1LDMuNzUsMCwwLDEtMiwuNjFBNC4yNyw0LjI3LDAsMCwxLDMwLjI3LDc1YTQuOTQsNC45NCwwLDAsMS0xLjU4LDEuNSw0LDQsMCwwLDEtMi4xOC42MSwzLjkzLDMuOTMsMCwwLDEtMy4xNi0xLjQzLDUuMyw1LjMsMCwwLDEtMS4yMS0zLjU0LDEzLjgxLDEzLjgxLDAsMCwxLTguNTgsMywxMy4yMywxMy4yMywwLDAsMS05LTMuNDdBMTguMjEsMTguMjEsMCwwLDAsOSw3MC43OWExNC4yNiwxNC4yNiwwLDAsMS03LjgzLTUuNDIsMTYuMTIsMTYuMTIsMCwwLDAsNS4xOS4wNywxMi44OSwxMi44OSwwLDAsMCw0LjktMS43M1EzLjE1LDU1LjQzLDEuMDUsNTAuNDZhMTgsMTgsMCwwLDEtMS02LjkzQTQwLDQwLDAsMCwxLDEuMjEsMzQsMjYuNTksMjYuNTksMCwwLDEsNS4yNywyNC4xUTguNDQsMTkuNDMsMTMsMTkuNDNhMy40MSwzLjQxLDAsMCwxLDMuNDcsMi4yNmMuNi0uOCwxLjItMS41NiwxLjgxLTIuMjZsLjQ1LS40NS43NS0uNzUsMS4wNS0xLjgxYTM1LjIsMzUuMiwwLDAsMSwyLjExLTMuMzIsMjguNTcsMjguNTcsMCwwLDEsOS4xMi03LjY4QTIzLjQsMjMuNCwwLDAsMSw0Mi45MywyLjU2YTIyLjIyLDIyLjIyLDAsMCwxLDIuNzEuMTVBOC4xNiw4LjE2LDAsMCwxLDUxLjgxLDAsOC42OSw4LjY5LDAsMCwxLDU4LDIuNDFhMS41MSwxLjUxLDAsMCwxLC4xNS42OGMwLC4yNS0uNTUuOTMtMS42NiwybC0uMy4zYTkuNjksOS42OSwwLDAsMSwxLjU4LjgzYy41NS4zNS44My42NS44My45YTEuNjIsMS42MiwwLDAsMS0uNiwxbC0uMTUuMTVxNi43OCw2LDguNTgsMTYuMjdBMy4zLDMuMywwLDAsMSw2OSwyMy4zNWE2LjQ4LDYuNDgsMCwwLDEsNC4yMiwyLjFxMy45MiwzLjMyLDMuOTIsMTEuOUE0Mi4wNSw0Mi4wNSwwLDAsMSw3NS43Niw0Ny42Wk01My42Miw1NC4wN2EyNCwyNCwwLDAsMS0xNCw0LjUyQTIxLjQxLDIxLjQxLDAsMCwxLDI3LDU0LjY3LDI0LjI4LDI0LjI4LDAsMCwxLDE4LjUzLDQ1YTI5LDI5LDAsMCwxLTMtMTMsMzEuNzgsMzEuNzgsMCwwLDEsLjkxLTcuNTNBMzIuMTcsMzIuMTcsMCwwLDAsMTEuOSw0MS4yN2EzMy41LDMzLjUsMCwwLDAsMi43OSwxMy40LDI5LjEsMjkuMSwwLDAsMCw3LjksMTAuODUsNC42OCw0LjY4LDAsMCwxLDEuNjYtMS44OCw0LjE3LDQuMTcsMCwwLDEsNC40NC0uMDgsNC41LDQuNSwwLDAsMSwxLjU4LDEuNjZBNC4yLDQuMiwwLDAsMSwzNCw2M2EzLjgzLDMuODMsMCwwLDEsMiwuNiw0LjUsNC41LDAsMCwxLDEuNTgsMS42Niw0LjI3LDQuMjcsMCwwLDEsNy41NCwwLDQuNSw0LjUsMCwwLDEsMS41OC0xLjY2LDQuMTcsNC4xNywwLDAsMSw0LjQ0LjA4LDMuODYsMy44NiwwLDAsMSwxLjUxLDEuNzMsMzAuMTcsMzAuMTcsMCwwLDAsNy42OC05Ljk0LDMxLjE4LDMxLjE4LDAsMCwwLDMuMTYtMTIuMzVBMjguMzksMjguMzksMCwwLDEsNTMuNjIsNTQuMDdaTTI4Ljc3LDY1LjM3YTMuMSwzLjEsMCwwLDAtNC4zNywwLDMuMDYsMy4wNiwwLDAsMC0uOSwyLjI2djQuODJhMy4zMiwzLjMyLDAsMCwwLC45LDIuMzMsMi45MywyLjkzLDAsMCwwLDQuMzcsMCwzLjMyLDMuMzIsMCwwLDAsLjktMi4zM1Y2Ny42M0EzLjA2LDMuMDYsMCwwLDAsMjguNzcsNjUuMzdabS45LTQ4YTQuMjQsNC4yNCwwLDAsMCwzLjQ3LDEuNzMsNC40NSw0LjQ1LDAsMCwwLDMuNTQtMS43Myw2LDYsMCwwLDAsMS40My0zLjkyLDUuNyw1LjcsMCwwLDAtMS40My0zLjg0QTQuNTMsNC41MywwLDAsMCwzMy4xNCw4YTQuMzEsNC4zMSwwLDAsMC0zLjQ3LDEuNjYsNS43OSw1Ljc5LDAsMCwwLTEuMzUsMy43N0E2LjMzLDYuMzMsMCwwLDAsMjkuNjcsMTcuNFptNi40OCw0OGEzLjEsMy4xLDAsMCwwLTQuMzcsMCwzLjA2LDMuMDYsMCwwLDAtLjksMi4yNnY0LjgyYTMuMzIsMy4zMiwwLDAsMCwuOSwyLjMzLDIuOTMsMi45MywwLDAsMCw0LjM3LDAsMy4zMiwzLjMyLDAsMCwwLC45LTIuMzNWNjcuNjNBMy4wNiwzLjA2LDAsMCwwLDM2LjE1LDY1LjM3Wm0tNC4wNy01NC4zYTIuMzcsMi4zNywwLDAsMSwyLTEsMi4xNywyLjE3LDAsMCwxLDEuODgsMSw0LjEsNC4xLDAsMCwxLDAsNC41MiwyLjE3LDIuMTcsMCwwLDEtMS44OCwxLDIuMzcsMi4zNywwLDAsMS0yLTEsMy43MiwzLjcyLDAsMCwxLS43NS0yLjM0QTMuNDksMy40OSwwLDAsMSwzMi4wOCwxMS4wN1ptNSw5LjQxYTIwLjYxLDIwLjYxLDAsMCwwLTMuNTQsMTIuMjgsMTcuMTUsMTcuMTUsMCwwLDAsNC4wNywxMSwxMi40MywxMi40MywwLDAsMCw5Ljg3LDQuNDUsMTUuMywxNS4zLDAsMCwwLDktMywxMywxMywwLDAsMCwuNi0zLjMycTAtMy4zMi0zLjE2LTMuMzFhOC41OCw4LjU4LDAsMCwwLTIsLjNxLTcuODMsMS41LTExLjU5LS4zLTQuNTMtMi4xMi00LjUyLTkuMzRBMzcuOTIsMzcuOTIsMCwwLDEsMzcuMDUsMjAuNDhaTTYxLjQ1LDE3QTEyLjg0LDEyLjg0LDAsMCwwLDUxLjIxLDEyLjJhMTUuMTEsMTUuMTEsMCwwLDAtNi40LDEuNDMsMTcuODMsMTcuODMsMCwwLDAtNS41LDRxLTYuMTgsMjAuNjQsNi4xOCwyMC42NEEyNC43NSwyNC43NSwwLDAsMCw0OSwzNy44MWEzOC45MiwzOC45MiwwLDAsMSw0LjgyLS40NmMxLjgxLDAsMy4wNi40NiwzLjc3LDEuMzZxMS4zNSwxLjUuNzUsNS4xMmEyMS43MiwyMS43MiwwLDAsMCw1LTcuMTVBMjEuMzgsMjEuMzgsMCwwLDAsNjUuMDcsMjgsMTcuNDQsMTcuNDQsMCwwLDAsNjEuNDUsMTdaTTQzLjYsNjUuMzdhMi43MiwyLjcyLDAsMCwwLTIuMS0uOSwzLDMsMCwwLDAtMi4xOS45LDMuMDYsMy4wNiwwLDAsMC0uOSwyLjI2djQuODJhMy4zMiwzLjMyLDAsMCwwLC45LDIuMzMsMi44NCwyLjg0LDAsMCwwLDIuMTksMSwyLjYxLDIuNjEsMCwwLDAsMi4xLTEsMy40NSwzLjQ1LDAsMCwwLC44My0yLjMzVjY3LjYzQTMuMTcsMy4xNywwLDAsMCw0My42LDY1LjM3Wm03LjQ2LDBhMywzLDAsMCwwLTIuMTgtLjksMi43MywyLjczLDAsMCwwLTIuMTEuOSwzLjE3LDMuMTcsMCwwLDAtLjgzLDIuMjZ2NC44MmEzLjQ1LDMuNDUsMCwwLDAsLjgzLDIuMzMsMi42MSwyLjYxLDAsMCwwLDIuMTEsMSwyLjgzLDIuODMsMCwwLDAsMi4xOC0xLDMuMzIsMy4zMiwwLDAsMCwuOS0yLjMzVjY3LjYzQTMuMDYsMy4wNiwwLDAsMCw1MS4wNiw2NS4zN1oiLz48L3N2Zz4=');
125
  background-repeat: no-repeat;
126
+ background-position: 92% 50%;
127
+ background-size: 30px;
128
  }
129
 
130
+ #themeisle .inside {
131
+ padding: 0;
132
+ }
133
+
134
+ .ti-feed-list {
135
+ padding: 0 12px 5px;
136
+ margin-bottom: 10px;
137
+ border-bottom: 1px solid #eee;
138
+ }
139
+
140
+ .ti-dw-feed-item a {
141
  display: flex;
142
  align-items: center;
143
+ margin-bottom: 5px;
144
+ padding: 5px;
145
+ transition: .2s ease;
146
+ border-radius: 3px;
147
  }
148
 
149
+ .ti-dw-feed-item a:hover {
150
+ background-color: #f8f8f8;
 
151
  }
152
 
153
+ .ti-dw-feed-item a:hover .ti-dw-date-container {
154
+ opacity: .9;
 
 
155
  }
156
 
157
  .ti-dw-feed-item .ti-dw-month-container {
158
+ margin-top: -5px;
 
 
 
 
 
159
  text-transform: uppercase;
160
  font-size: 10px;
161
  letter-spacing: 1px;
162
+ font-weight: 700;
163
  }
164
 
165
  .ti-dw-feed-item .ti-dw-date-container {
166
+ border-radius: 3px;
167
+ transition: .2s ease;
168
+ min-height: 35px;
169
+ margin-right: 5px;
170
+ min-width: 35px;
171
+ text-align: center;
172
+ border: 1px solid #2a6f97;
173
+ color: #fff;
174
+ background: #2ea2cc;
175
+ display: flex;
176
+ flex-direction: column;
177
+ justify-content: center;
178
+ }
179
+
180
+ .ti-dw-footer {
181
+ padding: 0 12px 5px;
182
  text-align: center;
183
  }
184
 
185
+ .ti-dw-recommend-item {
186
+ display: block;
187
+ }
188
+
189
  .ti-dw-recommend-item span {
190
  color: #72777c;
191
  }
192
 
193
  .ti-dw-powered-by {
194
+ font-size: 11px;
195
+ margin-top: 3px;
196
+ display: block;
197
+ color: #72777c;
198
+ }
199
+
200
+ .ti-dw-powered-by span {
201
+ font-weight: 600;
202
  }
203
 
204
  </style>
205
+ <ul class="ti-feed-list">
206
  <?php
207
  foreach ( $this->items as $item ) {
208
  ?>
209
+ <li class="ti-dw-feed-item">
210
+ <a href="
211
+ <?php
212
+ echo add_query_arg(
213
+ array(
214
+ 'utm_campaign' => 'feed',
215
+ 'utm_medium' => 'dashboard_widget',
216
+ ), $item['link']
217
+ );
218
+ ?>
219
+ " target="_blank">
220
+ <span class="ti-dw-date-container"><span
221
+ class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
222
+ class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><?php echo $item['title']; ?>
223
+ </a>
224
  </li>
225
  <?php
226
  }
227
+ ?>
228
+ </ul>
229
+ <?php
230
+ $recommend = apply_filters( 'themeisle_sdk_recommend_plugin_or_theme', array() );
231
+ if ( is_array( $recommend ) && ! empty( $recommend ) ) {
232
+
233
+ $type = $recommend['type'];
234
+ if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
235
+ add_thickbox();
236
+ $url = add_query_arg(
237
+ array(
238
+ 'theme' => $recommend['slug'],
239
+ ), network_admin_url( 'theme-install.php' )
240
+ );
241
 
242
+ if ( 'plugin' === $type ) {
 
243
 
 
 
 
244
  $url = add_query_arg(
245
  array(
246
+ 'tab' => 'plugin-information',
247
+ 'plugin' => $recommend['slug'],
248
+ ), network_admin_url( 'plugin-install.php' )
249
  );
250
+ }
251
+ ?>
252
+ <div class="ti-dw-footer">
253
+ <span class="ti-dw-recommend-item ">
 
 
 
 
 
 
 
 
254
  <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
255
  : </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  <?php
257
+ echo trim(
258
+ str_replace(
259
+ array(
260
+ 'lite',
261
+ 'Lite',
262
+ ), '', $recommend['name']
263
+ )
264
+ );
265
+ ?>
266
+ (<a class="thickbox open-plugin-details-modal"
267
+ href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
268
+ </span>
269
+ <span class="ti-dw-powered-by">
270
+ Powered by <span><?php echo esc_attr( $this->product->get_friendly_name() ); ?></span>
271
+ </span>
272
+ </div>
273
+
274
+ <?php
275
  }
276
+ }
277
+ ?>
278
 
279
  <?php
280
 
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -11,7 +11,7 @@
11
  */
12
 
13
  // Current SDK version and path.
14
- $themeisle_sdk_version = '2.1.0';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
11
  */
12
 
13
  // Current SDK version and path.
14
+ $themeisle_sdk_version = '2.2.7';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInitc96dc00b3482ebe8fca835e32b58a30f
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequirec96dc00b3482ebe8fca835e32b58a30f($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequirec96dc00b3482ebe8fca835e32b58a30f($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitabe70813613123366e24bb1f9e3ea955
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitabe70813613123366e24bb1f9e3ea955', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitabe70813613123366e24bb1f9e3ea955', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequireabe70813613123366e24bb1f9e3ea955($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequireabe70813613123366e24bb1f9e3ea955($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit7f363fc03e498c3d487caeb44664caa2 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit7f363fc03e498c3d487caeb44664caa2 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit7f363fc03e498c3d487caeb44664caa2', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit7f363fc03e498c3d487caeb44664caa2', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit2f2e3a70d20cae0b59c0d1c8920b50f0 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit2f2e3a70d20cae0b59c0d1c8920b50f0', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit2f2e3a70d20cae0b59c0d1c8920b50f0', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -6,15 +6,15 @@
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
- "reference": "ae69f3966081f0a7c7c468c00275c411cc0be063"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/ae69f3966081f0a7c7c468c00275c411cc0be063",
14
- "reference": "ae69f3966081f0a7c7c468c00275c411cc0be063",
15
  "shasum": ""
16
  },
17
- "time": "2018-01-04 13:30:43",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "caa9bf2b2c48c12a0ac745b6e2880c94339a777d"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/caa9bf2b2c48c12a0ac745b6e2880c94339a777d",
14
+ "reference": "caa9bf2b2c48c12a0ac745b6e2880c94339a777d",
15
  "shasum": ""
16
  },
17
+ "time": "2018-07-19 07:48:21",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {