Custom Login Page Customizer | LoginPress - Version 1.1.16

Version Description

  • 2018-12-07 =
  • Bugfix: CapsLock JS issue.
  • Enhancement: Important Security update.
  • Enhancement: Code refactoring.
  • Compatibility: Compatible with WordPress 5.0
Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Custom Login Page Customizer | LoginPress
Version 1.1.16
Comparing to
See all releases

Code changes from version 1.1.15 to 1.1.16

classes/class-loginpress-ajax.php CHANGED
@@ -31,6 +31,7 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
31
  'help' => false,
32
  'deactivate' => false,
33
  'optout_yes' => false,
 
34
  );
35
 
36
  foreach ( $ajax_calls as $ajax_call => $no_priv ) {
@@ -282,6 +283,25 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
282
  update_option( '_loginpress_optin', 'no' );
283
  wp_die();
284
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  }
286
 
287
  endif;
31
  'help' => false,
32
  'deactivate' => false,
33
  'optout_yes' => false,
34
+ 'presets' => false
35
  );
36
 
37
  foreach ( $ajax_calls as $ajax_call => $no_priv ) {
283
  update_option( '_loginpress_optin', 'no' );
284
  wp_die();
285
  }
286
+
287
+ static function presets() {
288
+
289
+ check_ajax_referer( 'loginpress-preset-nonce', 'security' );
290
+
291
+ if ( ! current_user_can( 'manage_options' ) ) {
292
+ wp_die( 'No cheating, huh!' );
293
+ }
294
+
295
+ $selected_preset = get_option( 'customize_presets_settings', true );
296
+
297
+ if ( $selected_preset == 'default1' ) {
298
+ include_once LOGINPRESS_ROOT_PATH . 'css/themes/default-1.php';
299
+ echo first_presets();
300
+ } else {
301
+ do_action( 'loginpress_add_pro_theme', $selected_preset );
302
+ }
303
+ wp_die();
304
+ }
305
  }
306
 
307
  endif;
classes/class-loginpress-notifications.php CHANGED
@@ -259,7 +259,7 @@ if ( ! class_exists( 'LoginPress_Notification' ) ) :
259
  ?>
260
  <div class="loginpress-alert-notice black_friday_notic">
261
  <a href="<?php echo $dismiss_url ?>" class="notice-dismiss" ><span class="screen-reader-text"></span></a>
262
- <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner&utm_campaign=blackfriday2018" target="_blank">
263
  <div class="loginpress-alert-thumbnail">
264
  <img src="<?php echo plugins_url( '../img/notification_logo.svg', __FILE__ ) ?>" alt="">
265
  </div>
@@ -267,7 +267,7 @@ if ( ! class_exists( 'LoginPress_Notification' ) ) :
267
  <img src="<?php echo plugins_url( '../img/black-friday.png', __FILE__ ) ?>" alt="">
268
 
269
  <div class="loginpress-alert-button-section black_friday_sale_btn">
270
- <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner-button&utm_campaign=blackfriday2018" class="loginpress-alert-button" target="_blank"><?php _e( 'FLAT 51% OFF', 'loginpress' ) ?></a>
271
  </div>
272
  </div>
273
  </a>
@@ -292,7 +292,7 @@ if ( ! class_exists( 'LoginPress_Notification' ) ) :
292
  wp_enqueue_style( 'loginpress_review_stlye', plugins_url( '../css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
293
 
294
  $message = '<p> ';
295
- $message .= sprintf (__( '<strong>Biggest Winter Deal</strong> in the WordPress Universe! Get <strong>LoginPress Pro and all Premium Add-ons</strong> with <strong>51%% OFF</strong> [Limited Availability].<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner-button&utm_campaign=blackfriday2018" target="_blank" style="text-decoration: none;"><span class="dashicons dashicons-smiley" style="margin-left: 10px;"></span> Grab The Deal</a>
296
  <a href="%1$s" style="text-decoration: none; margin-left: 10px;"><span class="dashicons dashicons-dismiss"></span> I\'m good with free version</a>' ), $dismiss_url );
297
  $message .= "</p>";
298
  $class = 'loginpress-notice-success';
@@ -325,7 +325,7 @@ if ( ! class_exists( 'LoginPress_Notification' ) ) :
325
  * @since 1.1.3
326
  */
327
  private function loginpress_friday_sale_dismissal() {
328
-
329
  if ( ! is_admin() ||
330
  ! current_user_can( 'manage_options' ) ||
331
  ! isset( $_GET['_wpnonce'] ) ||
259
  ?>
260
  <div class="loginpress-alert-notice black_friday_notic">
261
  <a href="<?php echo $dismiss_url ?>" class="notice-dismiss" ><span class="screen-reader-text"></span></a>
262
+ <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner&utm_campaign=early20" target="_blank">
263
  <div class="loginpress-alert-thumbnail">
264
  <img src="<?php echo plugins_url( '../img/notification_logo.svg', __FILE__ ) ?>" alt="">
265
  </div>
267
  <img src="<?php echo plugins_url( '../img/black-friday.png', __FILE__ ) ?>" alt="">
268
 
269
  <div class="loginpress-alert-button-section black_friday_sale_btn">
270
+ <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner-button&utm_campaign=early20" class="loginpress-alert-button" target="_blank"><?php _e( 'FLAT 51% OFF', 'loginpress' ) ?></a>
271
  </div>
272
  </div>
273
  </a>
292
  wp_enqueue_style( 'loginpress_review_stlye', plugins_url( '../css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
293
 
294
  $message = '<p> ';
295
+ $message .= sprintf (__( '<strong>Biggest Winter Deal</strong> in the WordPress Universe! Get <strong>LoginPress Pro and all Premium Add-ons</strong> with <strong>20%% OFF</strong> [Limited Availability].<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner-button&utm_campaign=early20" target="_blank" style="text-decoration: none;"><span class="dashicons dashicons-smiley" style="margin-left: 10px;"></span> Grab The Deal</a>
296
  <a href="%1$s" style="text-decoration: none; margin-left: 10px;"><span class="dashicons dashicons-dismiss"></span> I\'m good with free version</a>' ), $dismiss_url );
297
  $message .= "</p>";
298
  $class = 'loginpress-notice-success';
325
  * @since 1.1.3
326
  */
327
  private function loginpress_friday_sale_dismissal() {
328
+ //delete_site_option( 'loginpress_friday_sale_dismiss' );
329
  if ( ! is_admin() ||
330
  ! current_user_can( 'manage_options' ) ||
331
  ! isset( $_GET['_wpnonce'] ) ||
css/style-login.php CHANGED
@@ -3,7 +3,7 @@
3
  * Get option and check the key exists in it.
4
  *
5
  * @since 1.0.0
6
- * @version 1.1.6
7
  * * * * * * * * * * * * * * * */
8
 
9
 
@@ -18,7 +18,12 @@ function loginpress_get_option_key( $loginpress_key, $loginpress_array ) {
18
 
19
  if ( array_key_exists( $loginpress_key, $loginpress_array ) ) {
20
 
21
- return $loginpress_array[ $loginpress_key ];
 
 
 
 
 
22
  }
23
  }
24
 
3
  * Get option and check the key exists in it.
4
  *
5
  * @since 1.0.0
6
+ * @version 1.1.16
7
  * * * * * * * * * * * * * * * */
8
 
9
 
18
 
19
  if ( array_key_exists( $loginpress_key, $loginpress_array ) ) {
20
 
21
+ if ( 'loginpress_custom_js' == $loginpress_key ) {
22
+ return $loginpress_array[ $loginpress_key ];
23
+ } else {
24
+ return esc_js( $loginpress_array[ $loginpress_key ] );
25
+ }
26
+
27
  }
28
  }
29
 
css/themes/default-1.php CHANGED
@@ -3,7 +3,7 @@
3
  function first_presets() {
4
  ob_start();
5
  ?>
6
- <style media="screen">
7
  /*************************************************************
8
  * Plugin: LoginPress - Customizing the WordPress Login.*
9
  * Description: LoginPress is the best Login Page Customizer *
@@ -65,7 +65,7 @@ function first_presets() {
65
  padding-left: 27px;
66
  font-weight: normal;
67
  }
68
- #​jetpack_protect_answer{
69
  padding-left: 0;
70
  text-align : center;
71
  }
3
  function first_presets() {
4
  ob_start();
5
  ?>
6
+ <style media="screen" id="loginpress-style">
7
  /*************************************************************
8
  * Plugin: LoginPress - Customizing the WordPress Login.*
9
  * Description: LoginPress is the best Login Page Customizer *
65
  padding-left: 27px;
66
  font-weight: normal;
67
  }
68
+ #jetpack_protect_answer{
69
  padding-left: 0;
70
  text-align : center;
71
  }
custom.php CHANGED
@@ -7,6 +7,7 @@ class LoginPress_Entities {
7
  *
8
  * @var string
9
  * @since 1.0.0
 
10
  */
11
  public $loginpress_key;
12
 
@@ -85,6 +86,8 @@ class LoginPress_Entities {
85
  'plugin_url' => plugins_url(),
86
  'login_theme' => get_option( 'customize_presets_settings', true ),
87
  'loginpress_bg_url' => $loginpress_bg_url,
 
 
88
  );
89
 
90
  wp_localize_script( 'loginpress-customize-control', 'loginpress_script', $loginpress_localize );
@@ -183,9 +186,10 @@ class LoginPress_Entities {
183
 
184
  $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
185
  // 'default' => $form_color_default[$form_color],
186
- 'type' => 'option',
187
- 'capability' => 'manage_options',
188
- 'transport' => 'postMessage'
 
189
  ) );
190
 
191
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
@@ -231,6 +235,8 @@ class LoginPress_Entities {
231
 
232
  include LOGINPRESS_ROOT_PATH . 'include/customizer-strings.php';
233
 
 
 
234
  if ( ! has_action( 'loginpress_pro_add_template' ) ) :
235
  include LOGINPRESS_ROOT_PATH . 'classes/class-loginpress-promo.php';
236
  endif;
@@ -250,7 +256,7 @@ class LoginPress_Entities {
250
  * =============================
251
  *
252
  * @since 1.0.9
253
- * @version 1.0.23
254
  */
255
  $wp_customize->add_section( 'customize_presets', array(
256
  'title' => __( 'Themes', 'loginpress' ),
@@ -262,6 +268,7 @@ class LoginPress_Entities {
262
  $wp_customize->add_setting( 'customize_presets_settings', array(
263
  'default' => 'default1',
264
  'type' => 'option',
 
265
  'capability' => 'manage_options',
266
  ) );
267
 
@@ -341,10 +348,11 @@ class LoginPress_Entities {
341
  */
342
 
343
  $wp_customize->add_setting( 'loginpress_customization[setting_logo_display]', array(
344
- 'default' => false,
345
- 'type' => 'option',
346
- 'capability' => 'manage_options',
347
- 'transport' => 'postMessage'
 
348
  ) );
349
 
350
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_logo_display]', array(
@@ -356,9 +364,10 @@ class LoginPress_Entities {
356
  ) ) );
357
 
358
  $wp_customize->add_setting( 'loginpress_customization[setting_logo]', array(
359
- 'type' => 'option',
360
- 'capability' => 'manage_options',
361
- 'transport' => 'postMessage'
 
362
  ) );
363
 
364
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_logo]', array(
@@ -381,15 +390,17 @@ class LoginPress_Entities {
381
  $logo_control = array( 'customize_logo_hover', 'customize_logo_hover_title' );
382
  $logo_default = array( '', '' );
383
  $logo_label = array( __( 'Logo URL:', 'loginpress' ), __( 'Logo Hover Title:', 'loginpress' ) );
 
384
 
385
  $logo = 0;
386
  while ( $logo < 2 ) :
387
 
388
  $wp_customize->add_setting( "loginpress_customization[{$logo_control[$logo]}]", array(
389
- 'default' => $logo_default[$logo],
390
- 'type' => 'option',
391
- 'capability' => 'manage_options',
392
- 'transport' => 'postMessage'
 
393
  ) );
394
 
395
  $wp_customize->add_control( "loginpress_customization[{$logo_control[$logo]}]", array(
@@ -414,23 +425,25 @@ class LoginPress_Entities {
414
 
415
  $wp_customize->add_setting( 'loginpress_customization[setting_background_color]', array(
416
  // 'default' => '#ddd5c3',
417
- 'type' => 'option',
418
- 'capability' => 'manage_options',
419
- 'transport' => 'postMessage'
 
420
  ) );
421
 
422
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[setting_background_color]', array(
423
- 'label' => __( 'Background Color:', 'loginpress' ),
424
- 'section' => 'section_background',
425
- 'priority' => 5,
426
- 'settings' => 'loginpress_customization[setting_background_color]'
427
  ) ) );
428
 
429
  $wp_customize->add_setting( 'loginpress_customization[loginpress_display_bg]', array(
430
  'default' => true,
431
  'type' => 'option',
432
  'capability' => 'manage_options',
433
- 'transport' => 'postMessage'
 
434
  ) );
435
  /**
436
  * [Enable / Disabe Background Image with LoginPress_Radio_Control]
@@ -447,9 +460,10 @@ class LoginPress_Entities {
447
 
448
  $wp_customize->add_setting( 'loginpress_customization[setting_background]', array(
449
  // 'default' => plugins_url( 'img/bg.jpg', LOGINPRESS_ROOT_FILE ) ,
450
- 'type' => 'option',
451
- 'capability' => 'manage_options',
452
- 'transport' => 'postMessage'
 
453
  ) );
454
 
455
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_background]', array(
@@ -506,10 +520,11 @@ class LoginPress_Entities {
506
 
507
 
508
  $wp_customize->add_setting( 'loginpress_customization[background_repeat_radio]', array(
509
- 'default' => 'no-repeat',
510
- 'type' => 'option',
511
- 'capability' => 'manage_options',
512
- 'transport' => 'postMessage'
 
513
  ) );
514
 
515
  $wp_customize->add_control( 'loginpress_customization[background_repeat_radio]', array(
@@ -529,10 +544,11 @@ class LoginPress_Entities {
529
  ) );
530
 
531
  $wp_customize->add_setting( 'loginpress_customization[background_position]', array(
532
- 'default' => 'center',
533
- 'type' => 'option',
534
- 'capability' => 'manage_options',
535
- 'transport' => 'postMessage'
 
536
  ) );
537
  $wp_customize->add_control( 'loginpress_customization[background_position]', array(
538
  'settings' => 'loginpress_customization[background_position]',
@@ -554,10 +570,11 @@ class LoginPress_Entities {
554
  ) );
555
 
556
  $wp_customize->add_setting( 'loginpress_customization[background_image_size]', array(
557
- 'default' => 'cover',
558
- 'type' => 'option',
559
- 'capability' => 'manage_options',
560
- 'transport' => 'postMessage'
 
561
  ));
562
 
563
  $wp_customize->add_control( 'loginpress_customization[background_image_size]', array(
@@ -593,24 +610,26 @@ class LoginPress_Entities {
593
  */
594
 
595
  $wp_customize->add_setting( 'loginpress_customization[setting_form_display_bg]', array(
596
- 'default' => false,
597
- 'type' => 'option',
598
- 'capability' => 'manage_options',
599
- 'transport' => 'postMessage'
 
600
  ) );
601
 
602
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_form_display_bg]', array(
603
- 'settings' => 'loginpress_customization[setting_form_display_bg]',
604
- 'label' => __( 'Enable Form Transparency:', 'loginpress'),
605
- 'section' => 'section_form',
606
  'priority' => 5,
607
- 'type' => 'ios',
608
  ) ) );
609
 
610
  $wp_customize->add_setting( 'loginpress_customization[setting_form_background]', array(
611
- 'type' => 'option',
612
- 'capability' => 'manage_options',
613
- 'transport' => 'postMessage'
 
614
  ) );
615
 
616
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_form_background]', array(
@@ -635,7 +654,8 @@ class LoginPress_Entities {
635
  'default' => $form_default[$form_padding],
636
  'type' => 'option',
637
  'capability' => 'manage_options',
638
- 'transport' => 'postMessage'
 
639
  ) );
640
 
641
  $wp_customize->add_control( "loginpress_customization[{$form_control[$form_padding]}]", array(
@@ -687,17 +707,18 @@ class LoginPress_Entities {
687
  while ( $input_padding < 3 ) :
688
 
689
  $wp_customize->add_setting( "loginpress_customization[{$form_control[$input_padding]}]", array(
690
- 'default' => $form_default[$input_padding],
691
- 'type' => 'option',
692
- 'capability' => 'manage_options',
693
- 'transport' => 'postMessage'
 
694
  ) );
695
 
696
  $wp_customize->add_control( "loginpress_customization[{$form_control[$input_padding]}]", array(
697
- 'label' => $form_label[$input_padding],
698
- 'section' => 'section_form',
699
- 'priority' => 85,
700
- 'settings' => "loginpress_customization[{$form_control[$input_padding]}]"
701
  ) );
702
 
703
  $input_padding++;
@@ -748,9 +769,10 @@ class LoginPress_Entities {
748
  ) );
749
 
750
  $wp_customize->add_setting( 'loginpress_customization[forget_form_background]', array(
751
- 'type' => 'option',
752
- 'capability' => 'manage_options',
753
- 'transport' => 'postMessage'
 
754
  ) );
755
 
756
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[forget_form_background]', array(
@@ -762,16 +784,17 @@ class LoginPress_Entities {
762
 
763
  $wp_customize->add_setting( 'loginpress_customization[forget_form_background_color]', array(
764
  // 'default' => '#FFF',
765
- 'type' => 'option',
766
- 'capability' => 'manage_options',
767
- 'transport' => 'postMessage'
 
768
  ) );
769
 
770
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[forget_form_background_color]', array(
771
- 'label' => __( 'Forget Form Background Color:', 'loginpress' ),
772
- 'section' => 'section_forget_form',
773
- 'priority' => 10,
774
- 'settings' => 'loginpress_customization[forget_form_background_color]'
775
  ) ) );
776
 
777
  // =============================
@@ -843,10 +866,11 @@ class LoginPress_Entities {
843
  while ( $error < 10 ) :
844
 
845
  $wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
846
- 'default' => $error_default[$error],
847
- 'type' => 'option',
848
- 'capability' => 'manage_options',
849
- 'transport' => 'postMessage'
 
850
  ) );
851
 
852
  $wp_customize->add_control( "loginpress_customization[{$error_control[$error]}]", array(
@@ -878,21 +902,23 @@ class LoginPress_Entities {
878
  __( 'Logout Message:', 'loginpress' ),
879
  __( 'Message Field Border: ( Example: 1px solid #00a0d2; )', 'loginpress' ),
880
  );
 
881
 
882
  $welcome = 0;
883
  while ( $welcome < 5 ) :
884
 
885
  $wp_customize->add_setting( "loginpress_customization[{$welcome_control[$welcome]}]", array(
886
- 'type' => 'option',
887
- 'capability' => 'manage_options',
888
- 'transport' => 'postMessage'
 
889
  ));
890
 
891
  $wp_customize->add_control( "loginpress_customization[{$welcome_control[$welcome]}]", array(
892
- 'label' => $welcome_label[ $welcome ],
893
- 'section' => 'section_welcome',
894
- 'priority' => 5,
895
- 'settings' => "loginpress_customization[{$welcome_control[$welcome]}]",
896
  'input_attrs' => array(
897
  'placeholder' => $welcome_default[ $welcome ],
898
  )
@@ -903,16 +929,17 @@ class LoginPress_Entities {
903
 
904
  $wp_customize->add_setting( 'loginpress_customization[message_background_color]', array(
905
  // 'default' => '#fff',
906
- 'type' => 'option',
907
- 'capability' => 'manage_options',
908
- 'transport' => 'postMessage'
 
909
  ) );
910
 
911
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[message_background_color]', array(
912
- 'label' => __( 'Message Field Background Color:', 'loginpress' ),
913
- 'section' => 'section_welcome',
914
- 'priority' => 30,
915
- 'settings' => 'loginpress_customization[message_background_color]'
916
  ) ) );
917
 
918
  // =============================
@@ -1030,10 +1057,11 @@ class LoginPress_Entities {
1030
  $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 3, 4 );
1031
 
1032
  $wp_customize->add_setting( 'loginpress_customization[footer_display_text]', array(
1033
- 'default' => true,
1034
- 'type' => 'option',
1035
- 'capability' => 'manage_options',
1036
- 'transport' => 'postMessage'
 
1037
  ));
1038
 
1039
  /**
@@ -1050,10 +1078,11 @@ class LoginPress_Entities {
1050
  ) ) );
1051
 
1052
  $wp_customize->add_setting( 'loginpress_customization[login_footer_text]', array(
1053
- 'default' => 'Lost your password?',
1054
- 'type' => 'option',
1055
- 'capability' => 'manage_options',
1056
- 'transport' => 'postMessage'
 
1057
  ) );
1058
 
1059
  $wp_customize->add_control( 'loginpress_customization[login_footer_text]', array(
@@ -1064,10 +1093,11 @@ class LoginPress_Entities {
1064
  ) );
1065
 
1066
  $wp_customize->add_setting( 'loginpress_customization[login_footer_text_decoration]', array(
1067
- 'default' => 'none',
1068
- 'type' => 'option',
1069
- 'capability' => 'manage_options',
1070
- 'transport' => 'postMessage'
 
1071
 
1072
  ) );
1073
  $wp_customize->add_control( 'loginpress_customization[login_footer_text_decoration]', array(
@@ -1086,9 +1116,10 @@ class LoginPress_Entities {
1086
 
1087
  $wp_customize->add_setting( 'loginpress_customization[login_footer_color]', array(
1088
  // 'default' => '#17a8e3',
1089
- 'type' => 'option',
1090
- 'capability' => 'manage_options',
1091
- 'transport' => 'postMessage'
 
1092
  ) );
1093
 
1094
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color]', array(
@@ -1100,9 +1131,10 @@ class LoginPress_Entities {
1100
 
1101
  $wp_customize->add_setting( 'loginpress_customization[login_footer_color_hover]', array(
1102
  // 'default' => '#17a8e3',
1103
- 'type' => 'option',
1104
- 'capability' => 'manage_options',
1105
- 'transport' => 'postMessage'
 
1106
  ) );
1107
 
1108
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color_hover]', array(
@@ -1137,16 +1169,17 @@ class LoginPress_Entities {
1137
 
1138
  $wp_customize->add_setting( 'loginpress_customization[login_footer_bg_color]', array(
1139
  // 'default' => '#17a8e3',
1140
- 'type' => 'option',
1141
- 'capability' => 'manage_options',
1142
- 'transport' => 'postMessage'
 
1143
  ) );
1144
 
1145
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_bg_color]', array(
1146
- 'label' => __( 'Footer Background Color:', 'loginpress' ),
1147
- 'section' => 'section_fotter',
1148
- 'priority' => 35,
1149
- 'settings' => 'loginpress_customization[login_footer_bg_color]'
1150
  ) ) );
1151
 
1152
  $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_fotter', 0, 36 );
@@ -1154,10 +1187,11 @@ class LoginPress_Entities {
1154
  $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 4, 40 );
1155
 
1156
  $wp_customize->add_setting( 'loginpress_customization[back_display_text]', array(
1157
- 'default' => true,
1158
- 'type' => 'option',
1159
- 'capability' => 'manage_options',
1160
- 'transport' => 'postMessage'
 
1161
  ) );
1162
 
1163
  /**
@@ -1170,14 +1204,15 @@ class LoginPress_Entities {
1170
  'label' => __( 'Enable "Back to" Text:', 'loginpress' ),
1171
  'section' => 'section_fotter',
1172
  'priority' => 45,
1173
- 'type' => 'ios',// light, ios, flat
1174
  ) ) );
1175
 
1176
  $wp_customize->add_setting( 'loginpress_customization[login_back_text_decoration]', array(
1177
- 'default' => 'none',
1178
- 'type' => 'option',
1179
- 'capability' => 'manage_options',
1180
- 'transport' => 'postMessage'
 
1181
 
1182
  ) );
1183
  $wp_customize->add_control( 'loginpress_customization[login_back_text_decoration]', array(
@@ -1196,9 +1231,10 @@ class LoginPress_Entities {
1196
 
1197
  $wp_customize->add_setting( 'loginpress_customization[login_back_color]', array(
1198
  // 'default' => '#17a8e3',
1199
- 'type' => 'option',
1200
- 'capability' => 'manage_options',
1201
- 'transport' => 'postMessage'
 
1202
  ) );
1203
 
1204
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color]', array(
@@ -1210,9 +1246,10 @@ class LoginPress_Entities {
1210
 
1211
  $wp_customize->add_setting( 'loginpress_customization[login_back_color_hover]', array(
1212
  // 'default' => '#17a8e3',
1213
- 'type' => 'option',
1214
- 'capability' => 'manage_options',
1215
- 'transport' => 'postMessage'
 
1216
  ) );
1217
 
1218
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color_hover]', array(
@@ -1247,9 +1284,10 @@ class LoginPress_Entities {
1247
 
1248
  $wp_customize->add_setting( 'loginpress_customization[login_back_bg_color]', array(
1249
  // 'default' => '#17a8e3',
1250
- 'type' => 'option',
1251
- 'capability' => 'manage_options',
1252
- 'transport' => 'postMessage'
 
1253
  ) );
1254
 
1255
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_bg_color]', array(
@@ -1268,10 +1306,11 @@ class LoginPress_Entities {
1268
  * @since 1.1.3
1269
  */
1270
  $wp_customize->add_setting( 'loginpress_customization[login_copy_right_display]', array(
1271
- 'default' => false,
1272
- 'type' => 'option',
1273
- 'capability' => 'manage_options',
1274
- 'transport' => 'postMessage'
 
1275
  ) );
1276
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[login_copy_right_display]', array(
1277
  'settings' => 'loginpress_customization[login_copy_right_display]',
@@ -1283,9 +1322,10 @@ class LoginPress_Entities {
1283
 
1284
  $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1285
  'default' => sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') ),
1286
- 'type' => 'option',
1287
- 'capability' => 'manage_options',
1288
- 'transport' => 'postMessage'
 
1289
  ) );
1290
 
1291
  $wp_customize->add_control( 'loginpress_customization[login_footer_copy_right]', array(
@@ -1297,10 +1337,11 @@ class LoginPress_Entities {
1297
  ) );
1298
 
1299
  $wp_customize->add_setting( 'loginpress_customization[loginpress_show_love]', array(
1300
- 'default' => true,
1301
- 'type' => 'option',
1302
- 'capability' => 'manage_options',
1303
- 'transport' => 'postMessage'
 
1304
  ) );
1305
 
1306
  /**
@@ -1321,10 +1362,11 @@ class LoginPress_Entities {
1321
  * @since 1.1.3
1322
  */
1323
  $wp_customize->add_setting( 'loginpress_customization[show_love_position]', array(
1324
- 'default' => 'right',
1325
- 'type' => 'option',
1326
- 'capability' => 'manage_options',
1327
- 'transport' => 'postMessage'
 
1328
  ) );
1329
 
1330
  $wp_customize->add_control( 'loginpress_customization[show_love_position]', array(
7
  *
8
  * @var string
9
  * @since 1.0.0
10
+ * @version 1.1.16
11
  */
12
  public $loginpress_key;
13
 
86
  'plugin_url' => plugins_url(),
87
  'login_theme' => get_option( 'customize_presets_settings', true ),
88
  'loginpress_bg_url' => $loginpress_bg_url,
89
+ 'preset_nonce' => wp_create_nonce('loginpress-preset-nonce'),
90
+ 'preset_loader' => includes_url( 'js/tinymce/skins/lightgray/img/loader.gif' ),
91
  );
92
 
93
  wp_localize_script( 'loginpress-customize-control', 'loginpress_script', $loginpress_localize );
186
 
187
  $wp_customize->add_setting( "loginpress_customization[{$control[$index]}]", array(
188
  // 'default' => $form_color_default[$form_color],
189
+ 'type' => 'option',
190
+ 'capability' => 'manage_options',
191
+ 'transport' => 'postMessage',
192
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
193
  ) );
194
 
195
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, "loginpress_customization[{$control[$index]}]", array(
235
 
236
  include LOGINPRESS_ROOT_PATH . 'include/customizer-strings.php';
237
 
238
+ include LOGINPRESS_ROOT_PATH . 'include/customizer-validation.php';
239
+
240
  if ( ! has_action( 'loginpress_pro_add_template' ) ) :
241
  include LOGINPRESS_ROOT_PATH . 'classes/class-loginpress-promo.php';
242
  endif;
256
  * =============================
257
  *
258
  * @since 1.0.9
259
+ * @version 1.1.16
260
  */
261
  $wp_customize->add_section( 'customize_presets', array(
262
  'title' => __( 'Themes', 'loginpress' ),
268
  $wp_customize->add_setting( 'customize_presets_settings', array(
269
  'default' => 'default1',
270
  'type' => 'option',
271
+ // 'transport' => 'postMessage',
272
  'capability' => 'manage_options',
273
  ) );
274
 
348
  */
349
 
350
  $wp_customize->add_setting( 'loginpress_customization[setting_logo_display]', array(
351
+ 'default' => false,
352
+ 'type' => 'option',
353
+ 'capability' => 'manage_options',
354
+ 'transport' => 'postMessage',
355
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
356
  ) );
357
 
358
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_logo_display]', array(
364
  ) ) );
365
 
366
  $wp_customize->add_setting( 'loginpress_customization[setting_logo]', array(
367
+ 'type' => 'option',
368
+ 'capability' => 'manage_options',
369
+ 'transport' => 'postMessage',
370
+ 'sanitize_callback' => 'loginpress_sanitize_image'
371
  ) );
372
 
373
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_logo]', array(
390
  $logo_control = array( 'customize_logo_hover', 'customize_logo_hover_title' );
391
  $logo_default = array( '', '' );
392
  $logo_label = array( __( 'Logo URL:', 'loginpress' ), __( 'Logo Hover Title:', 'loginpress' ) );
393
+ $logo_sanitization = array( 'esc_url_raw', 'wp_strip_all_tags' );
394
 
395
  $logo = 0;
396
  while ( $logo < 2 ) :
397
 
398
  $wp_customize->add_setting( "loginpress_customization[{$logo_control[$logo]}]", array(
399
+ 'default' => $logo_default[$logo],
400
+ 'type' => 'option',
401
+ 'capability' => 'manage_options',
402
+ 'transport' => 'postMessage',
403
+ 'sanitize_callback' => $logo_sanitization[$logo]
404
  ) );
405
 
406
  $wp_customize->add_control( "loginpress_customization[{$logo_control[$logo]}]", array(
425
 
426
  $wp_customize->add_setting( 'loginpress_customization[setting_background_color]', array(
427
  // 'default' => '#ddd5c3',
428
+ 'type' => 'option',
429
+ 'capability' => 'manage_options',
430
+ 'transport' => 'postMessage',
431
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
432
  ) );
433
 
434
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[setting_background_color]', array(
435
+ 'label' => __( 'Background Color:', 'loginpress' ),
436
+ 'section' => 'section_background',
437
+ 'priority' => 5,
438
+ 'settings' => 'loginpress_customization[setting_background_color]'
439
  ) ) );
440
 
441
  $wp_customize->add_setting( 'loginpress_customization[loginpress_display_bg]', array(
442
  'default' => true,
443
  'type' => 'option',
444
  'capability' => 'manage_options',
445
+ 'transport' => 'postMessage',
446
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
447
  ) );
448
  /**
449
  * [Enable / Disabe Background Image with LoginPress_Radio_Control]
460
 
461
  $wp_customize->add_setting( 'loginpress_customization[setting_background]', array(
462
  // 'default' => plugins_url( 'img/bg.jpg', LOGINPRESS_ROOT_FILE ) ,
463
+ 'type' => 'option',
464
+ 'capability' => 'manage_options',
465
+ 'transport' => 'postMessage',
466
+ 'sanitize_callback' => 'loginpress_sanitize_image'
467
  ) );
468
 
469
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_background]', array(
520
 
521
 
522
  $wp_customize->add_setting( 'loginpress_customization[background_repeat_radio]', array(
523
+ 'default' => 'no-repeat',
524
+ 'type' => 'option',
525
+ 'capability' => 'manage_options',
526
+ 'transport' => 'postMessage',
527
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
528
  ) );
529
 
530
  $wp_customize->add_control( 'loginpress_customization[background_repeat_radio]', array(
544
  ) );
545
 
546
  $wp_customize->add_setting( 'loginpress_customization[background_position]', array(
547
+ 'default' => 'center',
548
+ 'type' => 'option',
549
+ 'capability' => 'manage_options',
550
+ 'transport' => 'postMessage',
551
+ 'sanitize_callback' => 'loginpress_sanitize_select'
552
  ) );
553
  $wp_customize->add_control( 'loginpress_customization[background_position]', array(
554
  'settings' => 'loginpress_customization[background_position]',
570
  ) );
571
 
572
  $wp_customize->add_setting( 'loginpress_customization[background_image_size]', array(
573
+ 'default' => 'cover',
574
+ 'type' => 'option',
575
+ 'capability' => 'manage_options',
576
+ 'transport' => 'postMessage',
577
+ 'sanitize_callback' => 'loginpress_sanitize_select'
578
  ));
579
 
580
  $wp_customize->add_control( 'loginpress_customization[background_image_size]', array(
610
  */
611
 
612
  $wp_customize->add_setting( 'loginpress_customization[setting_form_display_bg]', array(
613
+ 'default' => false,
614
+ 'type' => 'option',
615
+ 'capability' => 'manage_options',
616
+ 'transport' => 'postMessage',
617
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
618
  ) );
619
 
620
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[setting_form_display_bg]', array(
621
+ 'settings' => 'loginpress_customization[setting_form_display_bg]',
622
+ 'label' => __( 'Enable Form Transparency:', 'loginpress'),
623
+ 'section' => 'section_form',
624
  'priority' => 5,
625
+ 'type' => 'ios',
626
  ) ) );
627
 
628
  $wp_customize->add_setting( 'loginpress_customization[setting_form_background]', array(
629
+ 'type' => 'option',
630
+ 'capability' => 'manage_options',
631
+ 'transport' => 'postMessage',
632
+ 'sanitize_callback' => 'loginpress_sanitize_image'
633
  ) );
634
 
635
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[setting_form_background]', array(
654
  'default' => $form_default[$form_padding],
655
  'type' => 'option',
656
  'capability' => 'manage_options',
657
+ 'transport' => 'postMessage',
658
+ 'sanitize_callback' => $form_sanitization[$form_padding]
659
  ) );
660
 
661
  $wp_customize->add_control( "loginpress_customization[{$form_control[$form_padding]}]", array(
707
  while ( $input_padding < 3 ) :
708
 
709
  $wp_customize->add_setting( "loginpress_customization[{$form_control[$input_padding]}]", array(
710
+ 'default' => $form_default[$input_padding],
711
+ 'type' => 'option',
712
+ 'capability' => 'manage_options',
713
+ 'transport' => 'postMessage',
714
+ 'sanitize_callback' => $form_sanitization[$input_padding]
715
  ) );
716
 
717
  $wp_customize->add_control( "loginpress_customization[{$form_control[$input_padding]}]", array(
718
+ 'label' => $form_label[$input_padding],
719
+ 'section' => 'section_form',
720
+ 'priority' => 85,
721
+ 'settings' => "loginpress_customization[{$form_control[$input_padding]}]"
722
  ) );
723
 
724
  $input_padding++;
769
  ) );
770
 
771
  $wp_customize->add_setting( 'loginpress_customization[forget_form_background]', array(
772
+ 'type' => 'option',
773
+ 'capability' => 'manage_options',
774
+ 'transport' => 'postMessage',
775
+ 'sanitize_callback' => 'loginpress_sanitize_image'
776
  ) );
777
 
778
  $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'loginpress_customization[forget_form_background]', array(
784
 
785
  $wp_customize->add_setting( 'loginpress_customization[forget_form_background_color]', array(
786
  // 'default' => '#FFF',
787
+ 'type' => 'option',
788
+ 'capability' => 'manage_options',
789
+ 'transport' => 'postMessage',
790
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
791
  ) );
792
 
793
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[forget_form_background_color]', array(
794
+ 'label' => __( 'Forget Form Background Color:', 'loginpress' ),
795
+ 'section' => 'section_forget_form',
796
+ 'priority' => 10,
797
+ 'settings' => 'loginpress_customization[forget_form_background_color]'
798
  ) ) );
799
 
800
  // =============================
866
  while ( $error < 10 ) :
867
 
868
  $wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
869
+ 'default' => $error_default[$error],
870
+ 'type' => 'option',
871
+ 'capability' => 'manage_options',
872
+ 'transport' => 'postMessage',
873
+ 'sanitize_callback' => 'wp_kses_post'
874
  ) );
875
 
876
  $wp_customize->add_control( "loginpress_customization[{$error_control[$error]}]", array(
902
  __( 'Logout Message:', 'loginpress' ),
903
  __( 'Message Field Border: ( Example: 1px solid #00a0d2; )', 'loginpress' ),
904
  );
905
+ $welcome_sanitization = array( 'wp_kses_post', 'wp_kses_post', 'wp_kses_post', 'wp_kses_post', 'wp_strip_all_tags' );
906
 
907
  $welcome = 0;
908
  while ( $welcome < 5 ) :
909
 
910
  $wp_customize->add_setting( "loginpress_customization[{$welcome_control[$welcome]}]", array(
911
+ 'type' => 'option',
912
+ 'capability' => 'manage_options',
913
+ 'transport' => 'postMessage',
914
+ 'sanitize_callback' => $welcome_sanitization[$welcome]
915
  ));
916
 
917
  $wp_customize->add_control( "loginpress_customization[{$welcome_control[$welcome]}]", array(
918
+ 'label' => $welcome_label[ $welcome ],
919
+ 'section' => 'section_welcome',
920
+ 'priority' => 5,
921
+ 'settings' => "loginpress_customization[{$welcome_control[$welcome]}]",
922
  'input_attrs' => array(
923
  'placeholder' => $welcome_default[ $welcome ],
924
  )
929
 
930
  $wp_customize->add_setting( 'loginpress_customization[message_background_color]', array(
931
  // 'default' => '#fff',
932
+ 'type' => 'option',
933
+ 'capability' => 'manage_options',
934
+ 'transport' => 'postMessage',
935
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
936
  ) );
937
 
938
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[message_background_color]', array(
939
+ 'label' => __( 'Message Field Background Color:', 'loginpress' ),
940
+ 'section' => 'section_welcome',
941
+ 'priority' => 30,
942
+ 'settings' => 'loginpress_customization[message_background_color]'
943
  ) ) );
944
 
945
  // =============================
1057
  $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 3, 4 );
1058
 
1059
  $wp_customize->add_setting( 'loginpress_customization[footer_display_text]', array(
1060
+ 'default' => true,
1061
+ 'type' => 'option',
1062
+ 'capability' => 'manage_options',
1063
+ 'transport' => 'postMessage',
1064
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1065
  ));
1066
 
1067
  /**
1078
  ) ) );
1079
 
1080
  $wp_customize->add_setting( 'loginpress_customization[login_footer_text]', array(
1081
+ 'default' => 'Lost your password?',
1082
+ 'type' => 'option',
1083
+ 'capability' => 'manage_options',
1084
+ 'transport' => 'postMessage',
1085
+ 'sanitize_callback' => 'wp_kses_post'
1086
  ) );
1087
 
1088
  $wp_customize->add_control( 'loginpress_customization[login_footer_text]', array(
1093
  ) );
1094
 
1095
  $wp_customize->add_setting( 'loginpress_customization[login_footer_text_decoration]', array(
1096
+ 'default' => 'none',
1097
+ 'type' => 'option',
1098
+ 'capability' => 'manage_options',
1099
+ 'transport' => 'postMessage',
1100
+ 'sanitize_callback' => 'loginpress_sanitize_select'
1101
 
1102
  ) );
1103
  $wp_customize->add_control( 'loginpress_customization[login_footer_text_decoration]', array(
1116
 
1117
  $wp_customize->add_setting( 'loginpress_customization[login_footer_color]', array(
1118
  // 'default' => '#17a8e3',
1119
+ 'type' => 'option',
1120
+ 'capability' => 'manage_options',
1121
+ 'transport' => 'postMessage',
1122
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1123
  ) );
1124
 
1125
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color]', array(
1131
 
1132
  $wp_customize->add_setting( 'loginpress_customization[login_footer_color_hover]', array(
1133
  // 'default' => '#17a8e3',
1134
+ 'type' => 'option',
1135
+ 'capability' => 'manage_options',
1136
+ 'transport' => 'postMessage',
1137
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1138
  ) );
1139
 
1140
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_color_hover]', array(
1169
 
1170
  $wp_customize->add_setting( 'loginpress_customization[login_footer_bg_color]', array(
1171
  // 'default' => '#17a8e3',
1172
+ 'type' => 'option',
1173
+ 'capability' => 'manage_options',
1174
+ 'transport' => 'postMessage',
1175
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1176
  ) );
1177
 
1178
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_footer_bg_color]', array(
1179
+ 'label' => __( 'Footer Background Color:', 'loginpress' ),
1180
+ 'section' => 'section_fotter',
1181
+ 'priority' => 35,
1182
+ 'settings' => 'loginpress_customization[login_footer_bg_color]'
1183
  ) ) );
1184
 
1185
  $this->loginpress_hr_setting( $wp_customize, $close_control, 'section_fotter', 0, 36 );
1187
  $this->loginpress_group_setting( $wp_customize, $group_control, $group_label, $group_info, 'section_fotter', 4, 40 );
1188
 
1189
  $wp_customize->add_setting( 'loginpress_customization[back_display_text]', array(
1190
+ 'default' => true,
1191
+ 'type' => 'option',
1192
+ 'capability' => 'manage_options',
1193
+ 'transport' => 'postMessage',
1194
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1195
  ) );
1196
 
1197
  /**
1204
  'label' => __( 'Enable "Back to" Text:', 'loginpress' ),
1205
  'section' => 'section_fotter',
1206
  'priority' => 45,
1207
+ 'type' => 'ios', // light, ios, flat
1208
  ) ) );
1209
 
1210
  $wp_customize->add_setting( 'loginpress_customization[login_back_text_decoration]', array(
1211
+ 'default' => 'none',
1212
+ 'type' => 'option',
1213
+ 'capability' => 'manage_options',
1214
+ 'transport' => 'postMessage',
1215
+ 'sanitize_callback' => 'loginpress_sanitize_select'
1216
 
1217
  ) );
1218
  $wp_customize->add_control( 'loginpress_customization[login_back_text_decoration]', array(
1231
 
1232
  $wp_customize->add_setting( 'loginpress_customization[login_back_color]', array(
1233
  // 'default' => '#17a8e3',
1234
+ 'type' => 'option',
1235
+ 'capability' => 'manage_options',
1236
+ 'transport' => 'postMessage',
1237
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1238
  ) );
1239
 
1240
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color]', array(
1246
 
1247
  $wp_customize->add_setting( 'loginpress_customization[login_back_color_hover]', array(
1248
  // 'default' => '#17a8e3',
1249
+ 'type' => 'option',
1250
+ 'capability' => 'manage_options',
1251
+ 'transport' => 'postMessage',
1252
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1253
  ) );
1254
 
1255
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_color_hover]', array(
1284
 
1285
  $wp_customize->add_setting( 'loginpress_customization[login_back_bg_color]', array(
1286
  // 'default' => '#17a8e3',
1287
+ 'type' => 'option',
1288
+ 'capability' => 'manage_options',
1289
+ 'transport' => 'postMessage',
1290
+ 'sanitize_callback' => 'sanitize_hex_color' // validates 3 or 6 digit HTML hex color code.
1291
  ) );
1292
 
1293
  $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'loginpress_customization[login_back_bg_color]', array(
1306
  * @since 1.1.3
1307
  */
1308
  $wp_customize->add_setting( 'loginpress_customization[login_copy_right_display]', array(
1309
+ 'default' => false,
1310
+ 'type' => 'option',
1311
+ 'capability' => 'manage_options',
1312
+ 'transport' => 'postMessage',
1313
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1314
  ) );
1315
  $wp_customize->add_control( new LoginPress_Radio_Control( $wp_customize, 'loginpress_customization[login_copy_right_display]', array(
1316
  'settings' => 'loginpress_customization[login_copy_right_display]',
1322
 
1323
  $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1324
  'default' => sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') ),
1325
+ 'type' => 'option',
1326
+ 'capability' => 'manage_options',
1327
+ 'transport' => 'postMessage',
1328
+ 'sanitize_callback' => 'wp_kses_post'
1329
  ) );
1330
 
1331
  $wp_customize->add_control( 'loginpress_customization[login_footer_copy_right]', array(
1337
  ) );
1338
 
1339
  $wp_customize->add_setting( 'loginpress_customization[loginpress_show_love]', array(
1340
+ 'default' => true,
1341
+ 'type' => 'option',
1342
+ 'capability' => 'manage_options',
1343
+ 'transport' => 'postMessage',
1344
+ 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1345
  ) );
1346
 
1347
  /**
1362
  * @since 1.1.3
1363
  */
1364
  $wp_customize->add_setting( 'loginpress_customization[show_love_position]', array(
1365
+ 'default' => 'right',
1366
+ 'type' => 'option',
1367
+ 'capability' => 'manage_options',
1368
+ 'transport' => 'postMessage',
1369
+ // 'sanitize_callback' => 'loginpress_sanitize_checkbox'
1370
  ) );
1371
 
1372
  $wp_customize->add_control( 'loginpress_customization[show_love_position]', array(
include/customizer-strings.php CHANGED
@@ -87,6 +87,7 @@ $form_label = array(
87
  __( 'Username Label:', 'loginpress' ),
88
  __( 'Password Label:', 'loginpress' ),
89
  );
 
90
  /** -----------------Sectin Login Form------------------ */
91
 
92
  /**
87
  __( 'Username Label:', 'loginpress' ),
88
  __( 'Password Label:', 'loginpress' ),
89
  );
90
+ $form_sanitization = array( 'wp_strip_all_tags', 'wp_strip_all_tags', 'wp_strip_all_tags', 'wp_strip_all_tags', 'wp_strip_all_tags' );
91
  /** -----------------Sectin Login Form------------------ */
92
 
93
  /**
include/customizer-validation.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer: Sanitization Callbacks
4
+ *
5
+ * This file demonstrates how to define sanitization callback functions for various data types.
6
+ * @since 1.1.16
7
+ */
8
+
9
+ /**
10
+ * Checkbox sanitization callback example.
11
+ *
12
+ * Sanitization callback for 'checkbox' type controls. This callback sanitizes `$checked`
13
+ * as a boolean value, either TRUE or FALSE.
14
+ *
15
+ * @param bool $checked Whether the checkbox is checked.
16
+ * @return bool Whether the checkbox is checked.
17
+ */
18
+ function loginpress_sanitize_checkbox( $checked ) {
19
+ // Boolean check.
20
+ return ( ( isset( $checked ) && true == $checked ) ? true : false );
21
+ }
22
+
23
+ /**
24
+ * Select sanitization callback example.
25
+ *
26
+ * - Sanitization: select
27
+ * - Control: select, radio
28
+ *
29
+ * Sanitization callback for 'select' and 'radio' type controls. This callback sanitizes `$input`
30
+ * as a slug, and then validates `$input` against the choices defined for the control.
31
+ *
32
+ * @see sanitize_key() https://developer.wordpress.org/reference/functions/sanitize_key/
33
+ * @see $wp_customize->get_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/get_control/
34
+ *
35
+ * @param string $input Slug to sanitize.
36
+ * @param WP_Customize_Setting $setting Setting instance.
37
+ * @return string Sanitized slug if it is a valid choice; otherwise, the setting default.
38
+ */
39
+ function loginpress_sanitize_select( $input, $setting ) {
40
+
41
+ // Ensure input is a slug.
42
+ $input = sanitize_key( $input );
43
+
44
+ // Get list of choices from the control associated with the setting.
45
+ $choices = $setting->manager->get_control( $setting->id )->choices;
46
+
47
+ // If the input is a valid key, return it; otherwise, return the default.
48
+ return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
49
+ }
50
+
51
+ /**
52
+ * Image sanitization callback example.
53
+ *
54
+ * Checks the image's file extension and mime type against a whitelist. If they're allowed,
55
+ * send back the filename, otherwise, return the setting default.
56
+ *
57
+ * - Sanitization: image file extension
58
+ * - Control: text, WP_Customize_Image_Control
59
+ *
60
+ * @see wp_check_filetype() https://developer.wordpress.org/reference/functions/wp_check_filetype/
61
+ *
62
+ * @param string $image Image filename.
63
+ * @param WP_Customize_Setting $setting Setting instance.
64
+ * @return string The image filename if the extension is allowed; otherwise, the setting default.
65
+ */
66
+ function loginpress_sanitize_image( $image, $setting ) {
67
+ /*
68
+ * Array of valid image file types.
69
+ *
70
+ * The array includes image mime types that are included in wp_get_mime_types()
71
+ */
72
+ $mimes = array(
73
+ 'jpg|jpeg|jpe' => 'image/jpeg',
74
+ 'gif' => 'image/gif',
75
+ 'png' => 'image/png',
76
+ 'bmp' => 'image/bmp',
77
+ 'tif|tiff' => 'image/tiff',
78
+ 'ico' => 'image/x-icon'
79
+ );
80
+ // Return an array with file extension and mime_type.
81
+ $file = wp_check_filetype( $image, $mimes );
82
+ // If $image has a valid mime_type, return it; otherwise, return the default.
83
+ return ( $file['ext'] ? $image : $setting->default );
84
+ }
js/customize-controls.js CHANGED
@@ -811,6 +811,39 @@ jQuery(document).ready(function($) {
811
  });
812
  });
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
 
815
  loginpress_background_img( 'loginpress_customization[setting_form_background]', '#loginform');
816
 
@@ -891,7 +924,6 @@ jQuery(document).ready(function($) {
891
  // Update the login form button border-color in real time...
892
  wp.customize( 'loginpress_customization[button_hover_color]', function(value) {
893
  value.bind( function(loginPressVal) {
894
- console.log(loginPressVal);
895
  if ( loginPressVal == '' ) {
896
  loginPressBtnHvr = undefined;
897
  // loginpress_find('.wp-core-ui #login .button-primary').css( 'background', '' );
811
  });
812
  });
813
 
814
+ // Live Templates Change. 1.1.16
815
+ // wp.customize( 'customize_presets_settings', function(value) {
816
+ // value.bind( function(loginPressVal) {
817
+ //
818
+ // customizer_bg = change_theme ? change_theme : loginpress_script.login_theme;
819
+ //
820
+ // var preset_nonce = loginpress_script.preset_nonce;
821
+ //
822
+ // $.ajax({
823
+ //
824
+ // url : ajaxurl,
825
+ // type: 'POST',
826
+ // data: {
827
+ // action : 'loginpress_presets',
828
+ // security : preset_nonce
829
+ // },
830
+ // beforeSend: function() {
831
+ // loginpress_find('.login').append('<div class="loginpres-previewer-loader" style="position: fixed;top: 0;left: 0; height: 100%; width: 100%; background: rgba(255,255, 255, .5) url(' + loginpress_script.preset_loader + ') no-repeat center center; z-index: 9999999;"></div>');
832
+ // },
833
+ // success: function(response) {
834
+ //
835
+ // loginpress_find('#loginpress-style').remove();
836
+ // loginpress_find('head').append(response);
837
+ // loginpress_find('.loginpres-previewer-loader').remove();
838
+ //
839
+ // // setTimeout(function() {
840
+ // // $(".log-file-text").fadeOut()
841
+ // // }, 3000);
842
+ // }
843
+ // });
844
+ // });
845
+ // });
846
+
847
 
848
  loginpress_background_img( 'loginpress_customization[setting_form_background]', '#loginform');
849
 
924
  // Update the login form button border-color in real time...
925
  wp.customize( 'loginpress_customization[button_hover_color]', function(value) {
926
  value.bind( function(loginPressVal) {
 
927
  if ( loginPressVal == '' ) {
928
  loginPressBtnHvr = undefined;
929
  // loginpress_find('.wp-core-ui #login .button-primary').css( 'background', '' );
js/loginpress.js CHANGED
@@ -2,38 +2,51 @@
2
  'use strict';
3
 
4
  $(function() {
 
5
  $('#user_pass').each(function() {
6
  $(this).wrap('<div class="user-pass-fields"></div>');
7
  });
 
8
  $('.user-pass-fields').each(function() {
9
- $(this).append('<div class="loginpress-caps-lock">' +
10
- loginpress_script.caps_lock + '</div>');
11
  });
12
  });
13
- })(jQuery);
14
- (function() {
15
  window.onload = function(e) {
 
16
  var capsLock = 'off';
17
  var passwordField = document.getElementById("user_pass");
 
18
  passwordField.onkeydown = function(e) {
19
  var el = this;
20
- if (e.getModifierState("CapsLock")) {
 
 
21
  capsLock = 'on';
22
  el.nextElementSibling.style.display = "block";
23
  } else {
 
24
  capsLock = 'off';
25
  el.nextElementSibling.style.display = "none";
26
  }
27
  };
 
28
  passwordField.onblur = function(e) {
 
29
  var el = this;
30
  el.nextElementSibling.style.display = "none";
31
  };
 
32
  passwordField.onfocus = function(e) {
 
33
  var el = this;
34
- if (capsLock == 'on') {
 
35
  el.nextElementSibling.style.display = "block";
 
 
 
36
  }
37
  };
38
  };
39
- }());
 
2
  'use strict';
3
 
4
  $(function() {
5
+
6
  $('#user_pass').each(function() {
7
  $(this).wrap('<div class="user-pass-fields"></div>');
8
  });
9
+
10
  $('.user-pass-fields').each(function() {
11
+ $(this).append('<div class="loginpress-caps-lock">' + loginpress_script.caps_lock + '</div>');
 
12
  });
13
  });
 
 
14
  window.onload = function(e) {
15
+
16
  var capsLock = 'off';
17
  var passwordField = document.getElementById("user_pass");
18
+
19
  passwordField.onkeydown = function(e) {
20
  var el = this;
21
+ var caps = event.getModifierState && event.getModifierState( 'CapsLock' );
22
+ if ( caps ) {
23
+
24
  capsLock = 'on';
25
  el.nextElementSibling.style.display = "block";
26
  } else {
27
+
28
  capsLock = 'off';
29
  el.nextElementSibling.style.display = "none";
30
  }
31
  };
32
+
33
  passwordField.onblur = function(e) {
34
+
35
  var el = this;
36
  el.nextElementSibling.style.display = "none";
37
  };
38
+
39
  passwordField.onfocus = function(e) {
40
+
41
  var el = this;
42
+ if ( capsLock == 'on' ) {
43
+
44
  el.nextElementSibling.style.display = "block";
45
+ }else{
46
+
47
+ el.nextElementSibling.style.display = "none";
48
  }
49
  };
50
  };
51
+
52
+ })(jQuery);
loginpress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: https://WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
- * Version: 1.1.15
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/
9
  * Text Domain: loginpress
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
22
  /**
23
  * @var string
24
  */
25
- public $version = '1.1.15';
26
 
27
  /**
28
  * @var The single instance of the class
@@ -81,7 +81,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
81
  include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
82
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-setup.php' );
83
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-ajax.php' );
84
- include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-filter-plugin.php' );
85
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-developer-hooks.php' );
86
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-notifications.php' );
87
  if ( is_multisite() ) {
@@ -335,7 +335,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
335
  */
336
  function load_loginpress_assets() {
337
 
338
- wp_enqueue_script( 'loginpress-script', plugins_url( 'js/loginpress.js', __FILE__ ), false, LOGINPRESS_VERSION );
339
 
340
  // Array for localize.
341
  $loginpress_localize = array(
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: https://WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
+ * Version: 1.1.16
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/
9
  * Text Domain: loginpress
22
  /**
23
  * @var string
24
  */
25
+ public $version = '1.1.16';
26
 
27
  /**
28
  * @var The single instance of the class
81
  include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
82
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-setup.php' );
83
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-ajax.php' );
84
+ // include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-filter-plugin.php' );
85
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-developer-hooks.php' );
86
  include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-notifications.php' );
87
  if ( is_multisite() ) {
335
  */
336
  function load_loginpress_assets() {
337
 
338
+ wp_enqueue_script( 'loginpress-script', plugins_url( 'js/loginpress.js', __FILE__ ), array( 'jquery' ), LOGINPRESS_VERSION );
339
 
340
  // Array for localize.
341
  $loginpress_localize = array(
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Login Page Customizer | LoginPress ===
2
  Requires at least: 4.0
3
- Tested up to: 4.9
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
  Tags: wp-login, custom wp-login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
- Stable tag: 1.1.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -205,6 +205,12 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
205
 
206
  == Changelog ==
207
 
 
 
 
 
 
 
208
  = 1.1.15 - 2018-11-20 =
209
  * Enhancement: hide banner.
210
 
@@ -220,7 +226,7 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
220
  * Enhancement: Code refactoring.
221
 
222
  = 1.1.12 - 2018-10-10 =
223
- * Bugfix: On load hide login form control if transparency enabled.
224
 
225
  = 1.1.11 - 2018-09-19 =
226
  * Bugfix: Social Login CSS Confliction with Default Template.
@@ -432,5 +438,5 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
432
 
433
  == Upgrade Notice ==
434
 
435
- = 1.1.15 =
436
  * Important Security Release, upgrade immediately.
1
  === Custom Login Page Customizer | LoginPress ===
2
  Requires at least: 4.0
3
+ Tested up to: 5.0
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
  Tags: wp-login, custom wp-login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
+ Stable tag: 1.1.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
205
 
206
  == Changelog ==
207
 
208
+ = 1.1.16 - 2018-12-07 =
209
+ * Bugfix: CapsLock JS issue.
210
+ * Enhancement: Important Security update.
211
+ * Enhancement: Code refactoring.
212
+ * Compatibility: Compatible with WordPress 5.0
213
+
214
  = 1.1.15 - 2018-11-20 =
215
  * Enhancement: hide banner.
216
 
226
  * Enhancement: Code refactoring.
227
 
228
  = 1.1.12 - 2018-10-10 =
229
+ * Bugfix: On load hide login form control if transparency enabled. (in customizer)
230
 
231
  = 1.1.11 - 2018-09-19 =
232
  * Bugfix: Social Login CSS Confliction with Default Template.
438
 
439
  == Upgrade Notice ==
440
 
441
+ = 1.1.16 =
442
  * Important Security Release, upgrade immediately.