Custom Login Page Customizer - Version 2.1.1

Version Description

  • Update immediately - compatible with 5.6 and bugfix release. Introducing New features and settings panel.

=

Download this release

Release Info

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

Code changes from version 2.1.0 to 2.1.1

Files changed (88) hide show
  1. assets/orbit-fox.png +0 -0
  2. autoload.php +40 -0
  3. inc/customizer/controls/alpha/alpha-control.php +0 -59
  4. inc/customizer/controls/cool-stuff/assets/css/cool-stuff-control.css +0 -6
  5. inc/customizer/controls/cool-stuff/cool-stuff-control.php +0 -51
  6. inc/customizer/controls/padding/padding-control.php +0 -47
  7. inc/customizer/controls/radio-images/radio-images-control.php +0 -64
  8. inc/customizer/controls/range-slider/range-slider-control.php +0 -96
  9. inc/customizer/controls/toggle/toggle-control.php +0 -66
  10. inc/customizer/custom-code.php +0 -258
  11. inc/customizer/customizer.php +0 -104
  12. inc/customizer/functions.php +0 -65
  13. inc/customizer/sanitizers.php +0 -38
  14. inc/customizer/sections/section-background.php +0 -169
  15. inc/customizer/sections/section-button.php +0 -390
  16. inc/customizer/sections/section-code.php +0 -57
  17. inc/customizer/sections/section-fields.php +0 -365
  18. inc/customizer/sections/section-form.php +0 -236
  19. inc/customizer/sections/section-logo.php +0 -177
  20. inc/customizer/sections/section-more.php +0 -26
  21. inc/customizer/sections/section-other.php +0 -169
  22. inc/customizer/sections/section-templates.php +0 -41
  23. inc/mailin.php +0 -868
  24. inc/template-login-customizer.php +0 -124
  25. index.php +2 -1
  26. languages/login-customizer.pot +0 -396
  27. login-customizer.php +42 -44
  28. readme.md +1 -1
  29. readme.txt +17 -9
  30. resources/languages/login-customizer.pot +715 -0
  31. resources/login-customizer-dashicon/icomoon.eot +0 -0
  32. resources/login-customizer-dashicon/icomoon.svg +12 -0
  33. resources/login-customizer-dashicon/icomoon.ttf +0 -0
  34. resources/login-customizer-dashicon/icomoon.woff +0 -0
  35. screenshot-1.png +0 -0
  36. screenshot-2.png +0 -0
  37. src/Customizer/Create_Customizer.php +37 -0
  38. src/Customizer/Customizer_Enqueue.php +51 -0
  39. inc/include-page-template.php → src/Customizer/Include_Page_Template.php +18 -33
  40. inc/initial-setup.php → src/Customizer/Initial_Setup.php +5 -2
  41. {inc/customizer/css → src/Customizer/Panel/Assets/CSS}/customizer.css +0 -0
  42. {inc/customizer/js → src/Customizer/Panel/Assets/JS}/customizer-preview.js +2 -4
  43. {inc/customizer/js → src/Customizer/Panel/Assets/JS}/customizer.js +4 -5
  44. src/Customizer/Panel/Controls/Alpha.php +67 -0
  45. inc/customizer/controls/alpha/assets/css/alpha-control.css → src/Customizer/Panel/Controls/Assets/CSS/alpha_control.css +1 -1
  46. {inc/customizer/controls/padding/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/padding-control.css +0 -0
  47. {inc/customizer/controls/radio-images/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/radio-images-control.css +0 -0
  48. {inc/customizer/controls/range-slider/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/range-slider-control.css +0 -0
  49. {inc/customizer/controls/toggle/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/toggle-control.css +0 -0
  50. {inc/customizer/controls/alpha/assets/js → src/Customizer/Panel/Controls/Assets/JS}/alpha-control.js +0 -0
  51. {inc/customizer/controls/padding/assets/js → src/Customizer/Panel/Controls/Assets/JS}/padding-control.js +0 -0
  52. {inc/customizer/controls/range-slider/assets/js → src/Customizer/Panel/Controls/Assets/JS}/range-slider-control.js +0 -0
  53. {inc/customizer/controls/toggle/assets/js → src/Customizer/Panel/Controls/Assets/JS}/toggle-control.js +0 -0
  54. {inc/customizer/controls/alpha/assets → src/Customizer/Panel/Controls/Assets}/img/transparency-grid.png +0 -0
  55. src/Customizer/Panel/Controls/Padding.php +53 -0
  56. src/Customizer/Panel/Controls/Radio_Images.php +60 -0
  57. src/Customizer/Panel/Controls/Range_Slider.php +91 -0
  58. src/Customizer/Panel/Controls/Toggle.php +61 -0
  59. src/Customizer/Panel/Custom_Code.php +272 -0
  60. src/Customizer/Panel/Functions.php +189 -0
  61. src/Customizer/Panel/Sanitizers.php +51 -0
  62. src/Customizer/Panel/Sections/Background.php +198 -0
  63. src/Customizer/Panel/Sections/Button.php +433 -0
  64. src/Customizer/Panel/Sections/Code.php +79 -0
  65. src/Customizer/Panel/Sections/Fields.php +390 -0
  66. src/Customizer/Panel/Sections/Form.php +262 -0
  67. src/Customizer/Panel/Sections/Logo.php +201 -0
  68. src/Customizer/Panel/Sections/Other.php +195 -0
  69. src/Customizer/Panel/Sections/Templates.php +98 -0
  70. src/Customizer/Panel/customizer.php +144 -0
  71. setup.php → src/Customizer/Setup.php +5 -2
  72. {assets/templates → src/Customizer/Templates/Dark/assets}/dark.png +0 -0
  73. {assets/templates → src/Customizer/Templates/Light/assets}/original.png +0 -0
  74. {assets → src/Customizer/Templates/Material/assets}/logo.png +0 -0
  75. {assets/templates → src/Customizer/Templates/Material/assets}/material.png +0 -0
  76. src/Customizer/template-login-customizer.php +128 -0
  77. src/Essentials.php +78 -0
  78. src/Includes/Ajax.php +122 -0
  79. src/Includes/Disband.php +348 -0
  80. src/Includes/Help.php +113 -0
  81. src/Includes/Plugin_Meta.php +137 -0
  82. src/Plugin.php +76 -0
  83. src/Settings/API.php +694 -0
  84. src/Settings/Assets/CSS/style.css +433 -0
  85. src/Settings/Assets/logincust-settings-icon.png +0 -0
  86. src/Settings/Features/Custom_Register_Password.php +142 -0
  87. src/Settings/Features/Login_Order.php +152 -0
  88. src/Settings/Setup.php +266 -0
assets/orbit-fox.png DELETED
Binary file
autoload.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin autoload.
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+
12
+ /**
13
+ * Use to autoload needed classes without Composer.
14
+ *
15
+ * @param string $class The fully-qualified class name.
16
+ * @return void
17
+ */
18
+
19
+ spl_autoload_register( function( $class ) {
20
+
21
+ $namespace = 'LoginCustomizer\\';
22
+ $path = 'src';
23
+
24
+ // Bail if the class is not in our namespace.
25
+ if ( 0 !== strpos( $class, $namespace ) ) {
26
+ return;
27
+ }
28
+
29
+ // Remove the namespace.
30
+ $class = str_replace( $namespace, '', $class );
31
+
32
+ // Build the filename.
33
+ $file = realpath( __DIR__ . "/{$path}" );
34
+ $file = $file . DIRECTORY_SEPARATOR . str_replace( '\\', DIRECTORY_SEPARATOR, $class ) . '.php';
35
+
36
+ // If the file exists for the class name, load it.
37
+ if ( file_exists( $file ) ) {
38
+ include( $file );
39
+ }
40
+ } );
inc/customizer/controls/alpha/alpha-control.php DELETED
@@ -1,59 +0,0 @@
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 <https://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/cool-stuff/assets/css/cool-stuff-control.css DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1,51 +0,0 @@
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/padding-control.php DELETED
@@ -1,47 +0,0 @@
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/radio-images-control.php DELETED
@@ -1,64 +0,0 @@
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 <https://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/range-slider-control.php DELETED
@@ -1,96 +0,0 @@
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 <https://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/toggle-control.php DELETED
@@ -1,66 +0,0 @@
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 <https://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/custom-code.php DELETED
@@ -1,258 +0,0 @@
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 DELETED
@@ -1,104 +0,0 @@
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
-
23
- /**
24
- * Register login customizer settings
25
- */
26
- function logincust_customize_register( $wp_customize ) {
27
-
28
- // Login Customizer Panel
29
- $wp_customize->add_panel(
30
- 'logincust_panel',
31
- array(
32
- 'priority' => 30,
33
- 'capability' => 'edit_theme_options',
34
- 'title' => __( 'Login Customizer', 'login-customizer' ),
35
- 'description' => __( 'This section allows you to customize the login page of your website. Made with ❤ by <a target="_blank" rel="nofollow" href="https://loginpress.pro/">Hardeep Asrani</a> team.', 'login-customizer' ),
36
- )
37
- );
38
-
39
- // Section #0: Templates
40
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-templates.php' );
41
-
42
- // Section #1: Background
43
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-background.php' );
44
-
45
- // Section #2: Logo
46
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-logo.php' );
47
-
48
- // Section #3: Form
49
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-form.php' );
50
-
51
- // Section #5: Fields
52
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-fields.php' );
53
-
54
- // Section #6: Button
55
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-button.php' );
56
-
57
- // Section #7: Other
58
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-other.php' );
59
-
60
- // Section #8: Custom CSS & JS
61
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/sections/section-code.php' );
62
-
63
- }
64
- add_action( 'customize_register', 'logincust_customize_register' );
65
-
66
- /**
67
- * Enqueue script to Customizer
68
- */
69
- function logincust_customizer_script() {
70
- // Enqueue script to Customizer
71
- wp_enqueue_script( 'logincust_control_js', LOGINCUST_FREE_URL . 'inc/customizer/js/customizer.js', array( 'jquery' ), null, true );
72
-
73
- // Generate the redirect url.
74
- $options = get_option( 'login_customizer_settings', array() );
75
-
76
- $localize = array(
77
- 'page' => get_permalink( $options['page'] ),
78
- 'url' => LOGINCUST_FREE_URL,
79
- );
80
-
81
- // Localize Script
82
- wp_localize_script( 'logincust_control_js', 'logincust_script', $localize );
83
- }
84
- add_action( 'customize_controls_print_scripts', 'logincust_customizer_script' );
85
-
86
- /**
87
- * Enqueue script to Customizer Preview
88
- */
89
- function logincust_customizer_preview_script() {
90
- // Enqueue script to Customizer Preview
91
- wp_enqueue_script( 'logincust_control_preview', LOGINCUST_FREE_URL . 'inc/customizer/js/customizer-preview.js', array( 'jquery', 'customize-preview' ), null, true );
92
-
93
- // Generate the redirect url.
94
- $options = get_option( 'login_customizer_settings', array() );
95
-
96
- $localize = array(
97
- 'page' => get_permalink( $options['page'] ),
98
- );
99
-
100
- // Action hook triggered after customize_controls_init was called
101
- wp_localize_script( 'logincust_control_preview', 'logincust_script', $localize );
102
- }
103
- add_action( 'customize_preview_init', 'logincust_customizer_preview_script' );
104
- add_action( 'customize_controls_enqueue_scripts', 'logincust_customizer_preview_script' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/functions.php DELETED
@@ -1,65 +0,0 @@
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
-
35
- /**
36
- * Compare WP version: login_headertitle was deprecated in WordPress 5.2
37
- *
38
- * @since 2.1.0
39
- *
40
- **/
41
-
42
-
43
- if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
44
- add_filter( 'login_headertitle', 'logincust_login_logo_url_title' );
45
- } else {
46
- add_filter( 'login_headertext', 'logincust_login_logo_url_title' );
47
- }
48
-
49
- /**
50
- * Remove register link
51
- */
52
- function logincust_no_register_link( $url ) {
53
- return '';
54
- }
55
-
56
- // Hook to register and login_link_separator
57
- if ( ! is_customize_preview() ) {
58
- if ( ! empty( $options['logincust_field_register_link'] ) && $options['logincust_field_register_link'] === 1 ) {
59
- add_filter( 'register', 'logincust_no_register_link' );
60
- add_filter( 'login_link_separator', 'logincust_no_register_link' );
61
- }
62
- if ( ! empty( $options['logincust_field_lost_password'] ) && $options['logincust_field_lost_password'] === 1 ) {
63
- add_filter( 'login_link_separator', 'logincust_no_register_link' );
64
- }
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sanitizers.php DELETED
@@ -1,38 +0,0 @@
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 DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Background Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_background_section',
8
- array(
9
- 'priority' => 5,
10
- 'title' => __( 'Background', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_bg_color]',
17
- array(
18
- 'default' => '#F1F1F1',
19
- 'type' => 'option',
20
- 'capability' => 'edit_theme_options',
21
- 'sanitize_callback' => 'sanitize_hex_color',
22
- 'transport' => 'postMessage',
23
- )
24
- );
25
-
26
- $wp_customize->add_control( new WP_Customize_Color_Control( $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]',
37
- array(
38
- 'type' => 'option',
39
- 'capability' => 'edit_theme_options',
40
- 'sanitize_callback' => 'esc_url_raw',
41
- 'transport' => 'postMessage',
42
- )
43
- );
44
-
45
- $wp_customize->add_control(
46
- new WP_Customize_Image_Control(
47
- $wp_customize,
48
- 'login_customizer_options[logincust_bg_image]',
49
- array(
50
- 'label' => __( 'Background Image', 'login-customizer' ),
51
- 'section' => 'logincust_background_section',
52
- 'priority' => 10,
53
- 'settings' => 'login_customizer_options[logincust_bg_image]',
54
- )
55
- )
56
- );
57
-
58
- $wp_customize->add_setting(
59
- 'login_customizer_options[logincust_bg_image_size]',
60
- array(
61
- 'default' => 'auto',
62
- 'type' => 'option',
63
- 'capability' => 'edit_theme_options',
64
- 'sanitize_callback' => 'logincust_sanitize_options',
65
- 'transport' => 'postMessage',
66
- )
67
- );
68
- $wp_customize->add_control(
69
- 'login_customizer_options[logincust_bg_image_size]',
70
- array(
71
- 'label' => __( 'Background Size', 'login-customizer' ),
72
- 'section' => 'logincust_background_section',
73
- 'type' => 'select',
74
- 'choices' => array(
75
- 'auto' => __( 'Original', 'login-customizer' ),
76
- 'contain' => __( 'Fit to Screen', 'login-customizer' ),
77
- 'cover' => __( 'Fill Screen', 'login-customizer' ),
78
- 'custom' => __( 'Custom', 'login-customizer' ),
79
- ),
80
- 'priority' => 15,
81
- 'settings' => 'login_customizer_options[logincust_bg_image_size]',
82
- )
83
- );
84
-
85
- $wp_customize->add_setting(
86
- 'login_customizer_options[logincust_bg_size]',
87
- array(
88
- 'type' => 'option',
89
- 'capability' => 'edit_theme_options',
90
- 'sanitize_callback' => 'esc_html',
91
- 'transport' => 'postMessage',
92
- )
93
- );
94
-
95
- $wp_customize->add_control(
96
- 'login_customizer_options[logincust_bg_size]',
97
- array(
98
- 'label' => __( 'Custom Size', 'login-customizer' ),
99
- 'section' => 'logincust_background_section',
100
- 'priority' => 20,
101
- 'settings' => 'login_customizer_options[logincust_bg_size]',
102
- )
103
- );
104
-
105
- $wp_customize->add_setting(
106
- 'login_customizer_options[logincust_bg_image_repeat]',
107
- array(
108
- 'default' => 'no-repeat',
109
- 'type' => 'option',
110
- 'capability' => 'edit_theme_options',
111
- 'sanitize_callback' => 'logincust_sanitize_options',
112
- 'transport' => 'postMessage',
113
- )
114
- );
115
- $wp_customize->add_control(
116
- 'login_customizer_options[logincust_bg_image_repeat]',
117
- array(
118
- 'label' => __( 'Background Repeat', 'login-customizer' ),
119
- 'section' => 'logincust_background_section',
120
- 'type' => 'select',
121
- 'choices' => array(
122
- 'no-repeat' => __( 'No Repeat', 'login-customizer' ),
123
- 'repeat' => __( 'Repeat', 'login-customizer' ),
124
- 'repeat-x' => __( 'Repeat Horizontally', 'login-customizer' ),
125
- 'repeat-y' => __( 'Repeat Vertically', 'login-customizer' ),
126
- ),
127
- 'priority' => 25,
128
- 'settings' => 'login_customizer_options[logincust_bg_image_repeat]',
129
- )
130
- );
131
-
132
- $wp_customize->add_setting(
133
- 'login_customizer_options[logincust_bg_image_position_x]',
134
- array(
135
- 'default' => 'left',
136
- 'type' => 'option',
137
- 'capability' => 'edit_theme_options',
138
- 'sanitize_callback' => 'logincust_sanitize_position',
139
- 'transport' => 'postMessage',
140
- )
141
- );
142
-
143
-
144
- $wp_customize->add_setting(
145
- 'login_customizer_options[logincust_bg_image_position_y]',
146
- array(
147
- 'default' => 'top',
148
- 'type' => 'option',
149
- 'capability' => 'edit_theme_options',
150
- 'sanitize_callback' => 'logincust_sanitize_position',
151
- 'transport' => 'postMessage',
152
- )
153
- );
154
-
155
- $wp_customize->add_control(
156
- new WP_Customize_Background_Position_Control(
157
- $wp_customize,
158
- 'login_customizer_options[logincust_bg_image_position]',
159
- array(
160
- 'label' => __( 'Background Position', 'login-customizer' ),
161
- 'section' => 'logincust_background_section',
162
- 'priority' => 30,
163
- 'settings' => array(
164
- 'x' => 'login_customizer_options[logincust_bg_image_position_x]',
165
- 'y' => 'login_customizer_options[logincust_bg_image_position_y]',
166
- ),
167
- )
168
- )
169
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-button.php DELETED
@@ -1,390 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Button Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_button_section',
8
- array(
9
- 'priority' => 30,
10
- 'title' => __( 'Button', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_button_bg]',
17
- array(
18
- 'default' => '#2EA2CC',
19
- 'type' => 'option',
20
- 'capability' => 'edit_theme_options',
21
- 'sanitize_callback' => 'sanitize_hex_color',
22
- 'transport' => 'postMessage',
23
- )
24
- );
25
-
26
- $wp_customize->add_control(
27
- new WP_Customize_Color_Control(
28
- $wp_customize,
29
- 'login_customizer_options[logincust_button_bg]',
30
- array(
31
- 'label' => __( 'Background', 'login-customizer' ),
32
- 'section' => 'logincust_button_section',
33
- 'priority' => 5,
34
- 'settings' => 'login_customizer_options[logincust_button_bg]',
35
- )
36
- )
37
- );
38
-
39
- $wp_customize->add_setting(
40
- 'login_customizer_options[logincust_button_hover_bg]',
41
- array(
42
- 'default' => '#1E8CBE',
43
- 'type' => 'option',
44
- 'capability' => 'edit_theme_options',
45
- 'sanitize_callback' => 'sanitize_hex_color',
46
- 'transport' => 'postMessage',
47
- )
48
- );
49
-
50
- $wp_customize->add_control(
51
- new WP_Customize_Color_Control(
52
- $wp_customize,
53
- 'login_customizer_options[logincust_button_hover_bg]',
54
- array(
55
- 'label' => __( 'Background (Hover)', 'login-customizer' ),
56
- 'section' => 'logincust_button_section',
57
- 'priority' => 10,
58
- 'settings' => 'login_customizer_options[logincust_button_hover_bg]',
59
- )
60
- )
61
- );
62
-
63
- $wp_customize->add_setting(
64
- 'login_customizer_options[logincust_button_height_width]',
65
- array(
66
- 'default' => 'auto',
67
- 'type' => 'option',
68
- 'capability' => 'edit_theme_options',
69
- 'sanitize_callback' => 'logincust_sanitize_options',
70
- 'transport' => 'postMessage',
71
- )
72
- );
73
- $wp_customize->add_control(
74
- 'login_customizer_options[logincust_button_height_width]',
75
- array(
76
- 'label' => __( 'Button Size', 'login-customizer' ),
77
- 'section' => 'logincust_button_section',
78
- 'type' => 'select',
79
- 'choices' => array(
80
- 'auto' => __( 'Auto', 'login-customizer' ),
81
- 'custom' => __( 'Custom', 'login-customizer' ),
82
- ),
83
- 'priority' => 15,
84
- 'settings' => 'login_customizer_options[logincust_button_height_width]',
85
- )
86
- );
87
-
88
- $wp_customize->add_setting(
89
- 'login_customizer_options[logincust_button_width_size]',
90
- array(
91
- 'default' => '63px',
92
- 'type' => 'option',
93
- 'capability' => 'edit_theme_options',
94
- 'sanitize_callback' => 'esc_html',
95
- 'transport' => 'postMessage',
96
- )
97
- );
98
-
99
- $wp_customize->add_control(
100
- new O2_Customizer_Range_Slider_Control(
101
- $wp_customize,
102
- 'login_customizer_options[logincust_button_width_size]',
103
- array(
104
- 'label' => __( 'Width', 'login-customizer' ),
105
- 'section' => 'logincust_button_section',
106
- 'priority' => 20,
107
- 'settings' => 'login_customizer_options[logincust_button_width_size]',
108
- 'choices' => array(
109
- 'percent' => true,
110
- ),
111
- 'input_attrs' => array(
112
- 'min' => 0,
113
- 'max' => 1000,
114
- 'step' => 1,
115
- ),
116
- )
117
- )
118
- );
119
-
120
- $wp_customize->add_setting(
121
- 'login_customizer_options[logincust_button_height_size]',
122
- array(
123
- 'default' => '32px',
124
- 'type' => 'option',
125
- 'capability' => 'edit_theme_options',
126
- 'sanitize_callback' => 'esc_html',
127
- 'transport' => 'postMessage',
128
- )
129
- );
130
-
131
- $wp_customize->add_control(
132
- new O2_Customizer_Range_Slider_Control(
133
- $wp_customize,
134
- 'login_customizer_options[logincust_button_height_size]',
135
- array(
136
- 'label' => __( 'Height', 'login-customizer' ),
137
- 'section' => 'logincust_button_section',
138
- 'priority' => 25,
139
- 'settings' => 'login_customizer_options[logincust_button_height_size]',
140
- 'choices' => array(
141
- 'percent' => false,
142
- ),
143
- 'input_attrs' => array(
144
- 'min' => 0,
145
- 'max' => 1000,
146
- 'step' => 1,
147
- ),
148
- )
149
- )
150
- );
151
-
152
- $wp_customize->add_setting(
153
- 'login_customizer_options[logincust_button_font_size]',
154
- array(
155
- 'default' => '13px',
156
- 'type' => 'option',
157
- 'capability' => 'edit_theme_options',
158
- 'sanitize_callback' => 'esc_html',
159
- 'transport' => 'postMessage',
160
- )
161
- );
162
-
163
- $wp_customize->add_control(
164
- new O2_Customizer_Range_Slider_Control(
165
- $wp_customize,
166
- 'login_customizer_options[logincust_button_font_size]',
167
- array(
168
- 'label' => __( 'Font Size', 'login-customizer' ),
169
- 'section' => 'logincust_button_section',
170
- 'priority' => 30,
171
- 'settings' => 'login_customizer_options[logincust_button_font_size]',
172
- 'choices' => array(
173
- 'percent' => false,
174
- ),
175
- 'input_attrs' => array(
176
- 'min' => 0,
177
- 'max' => 100,
178
- 'step' => 1,
179
- ),
180
- )
181
- )
182
- );
183
-
184
- $wp_customize->add_setting(
185
- 'login_customizer_options[logincust_button_color]',
186
- array(
187
- 'default' => '#FFF',
188
- 'type' => 'option',
189
- 'capability' => 'edit_theme_options',
190
- 'sanitize_callback' => 'sanitize_hex_color',
191
- 'transport' => 'postMessage',
192
- )
193
- );
194
-
195
- $wp_customize->add_control(
196
- new WP_Customize_Color_Control(
197
- $wp_customize,
198
- 'login_customizer_options[logincust_button_color]',
199
- array(
200
- 'label' => __( 'Text Color', 'login-customizer' ),
201
- 'section' => 'logincust_button_section',
202
- 'priority' => 35,
203
- 'settings' => 'login_customizer_options[logincust_button_color]',
204
- )
205
- )
206
- );
207
-
208
- $wp_customize->add_setting(
209
- 'login_customizer_options[logincust_button_padding]',
210
- array(
211
- 'default' => '0 12px 2px',
212
- 'type' => 'option',
213
- 'capability' => 'edit_theme_options',
214
- 'sanitize_callback' => 'esc_html',
215
- 'transport' => 'postMessage',
216
- )
217
- );
218
-
219
- $wp_customize->add_control(
220
- new LoginCust_Padding_Control(
221
- $wp_customize,
222
- 'login_customizer_options[logincust_button_padding]',
223
- array(
224
- 'label' => __( 'Padding', 'login-customizer' ),
225
- 'section' => 'logincust_button_section',
226
- 'priority' => 40,
227
- 'settings' => 'login_customizer_options[logincust_button_padding]',
228
- )
229
- )
230
- );
231
-
232
- $wp_customize->add_setting(
233
- 'login_customizer_options[logincust_button_border_width]',
234
- array(
235
- 'default' => '1px',
236
- 'type' => 'option',
237
- 'capability' => 'edit_theme_options',
238
- 'sanitize_callback' => 'esc_html',
239
- 'transport' => 'postMessage',
240
- )
241
- );
242
-
243
- $wp_customize->add_control(
244
- new O2_Customizer_Range_Slider_Control(
245
- $wp_customize,
246
- 'login_customizer_options[logincust_button_border_width]',
247
- array(
248
- 'label' => __( 'Border Width', 'login-customizer' ),
249
- 'section' => 'logincust_button_section',
250
- 'priority' => 45,
251
- 'settings' => 'login_customizer_options[logincust_button_border_width]',
252
- 'choices' => array(
253
- 'percent' => false,
254
- ),
255
- 'input_attrs' => array(
256
- 'min' => 0,
257
- 'max' => 20,
258
- 'step' => 1,
259
- ),
260
- )
261
- )
262
- );
263
-
264
- $wp_customize->add_setting(
265
- 'login_customizer_options[logincust_button_border]',
266
- array(
267
- 'default' => '#0074A2',
268
- 'type' => 'option',
269
- 'capability' => 'edit_theme_options',
270
- 'sanitize_callback' => 'sanitize_hex_color',
271
- 'transport' => 'postMessage',
272
- )
273
- );
274
-
275
- $wp_customize->add_control(
276
- new WP_Customize_Color_Control(
277
- $wp_customize,
278
- 'login_customizer_options[logincust_button_border]',
279
- array(
280
- 'label' => __( 'Border', 'login-customizer' ),
281
- 'section' => 'logincust_button_section',
282
- 'priority' => 55,
283
- 'settings' => 'login_customizer_options[logincust_button_border]',
284
- )
285
- )
286
- );
287
-
288
- $wp_customize->add_setting(
289
- 'login_customizer_options[logincust_button_hover_border]',
290
- array(
291
- 'default' => '#0074A2',
292
- 'type' => 'option',
293
- 'capability' => 'edit_theme_options',
294
- 'sanitize_callback' => 'sanitize_hex_color',
295
- 'transport' => 'postMessage',
296
- )
297
- );
298
-
299
- $wp_customize->add_control(
300
- new WP_Customize_Color_Control(
301
- $wp_customize,
302
- 'login_customizer_options[logincust_button_hover_border]',
303
- array(
304
- 'label' => __( 'Border (Hover)', 'login-customizer' ),
305
- 'section' => 'logincust_button_section',
306
- 'priority' => 60,
307
- 'settings' => 'login_customizer_options[logincust_button_hover_border]',
308
- )
309
- )
310
- );
311
-
312
- $wp_customize->add_setting(
313
- 'login_customizer_options[logincust_button_shadow_spread]',
314
- array(
315
- 'default' => '0px',
316
- 'type' => 'option',
317
- 'capability' => 'edit_theme_options',
318
- 'sanitize_callback' => 'esc_html',
319
- 'transport' => 'postMessage',
320
- )
321
- );
322
-
323
- $wp_customize->add_control(
324
- new O2_Customizer_Range_Slider_Control(
325
- $wp_customize,
326
- 'login_customizer_options[logincust_button_shadow_spread]',
327
- array(
328
- 'label' => __( 'Shadow Spread', 'login-customizer' ),
329
- 'section' => 'logincust_button_section',
330
- 'priority' => 65,
331
- 'settings' => 'login_customizer_options[logincust_button_shadow_spread]',
332
- 'choices' => array(
333
- 'percent' => false,
334
- ),
335
- 'input_attrs' => array(
336
- 'min' => 0,
337
- 'max' => 50,
338
- 'step' => 1,
339
- ),
340
- )
341
- )
342
- );
343
-
344
- $wp_customize->add_setting(
345
- 'login_customizer_options[logincust_button_shadow]',
346
- array(
347
- 'default' => '#78C8E6',
348
- 'type' => 'option',
349
- 'capability' => 'edit_theme_options',
350
- 'sanitize_callback' => 'sanitize_text_field',
351
- 'transport' => 'postMessage',
352
- )
353
- );
354
-
355
- $wp_customize->add_control(
356
- new LoginCust_Customize_Alpha_Color_Control(
357
- $wp_customize,
358
- 'login_customizer_options[logincust_button_shadow]',
359
- array(
360
- 'label' => __( 'Box Shadow', 'login-customizer' ),
361
- 'section' => 'logincust_button_section',
362
- 'priority' => 70,
363
- 'settings' => 'login_customizer_options[logincust_button_shadow]',
364
- )
365
- )
366
- );
367
-
368
- $wp_customize->add_setting(
369
- 'login_customizer_options[logincust_button_text_shadow]',
370
- array(
371
- 'default' => '#006799',
372
- 'type' => 'option',
373
- 'capability' => 'edit_theme_options',
374
- 'sanitize_callback' => 'sanitize_text_field',
375
- 'transport' => 'postMessage',
376
- )
377
- );
378
-
379
- $wp_customize->add_control(
380
- new WP_Customize_Color_Control(
381
- $wp_customize,
382
- 'login_customizer_options[logincust_button_text_shadow]',
383
- array(
384
- 'label' => __( 'Text Shadow', 'login-customizer' ),
385
- 'section' => 'logincust_button_section',
386
- 'priority' => 75,
387
- 'settings' => 'login_customizer_options[logincust_button_text_shadow]',
388
- )
389
- )
390
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-code.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Custom CSS Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_code_section',
8
- array(
9
- 'priority' => 40,
10
- 'title' => __( 'Custom CSS & JavaScript', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_other_css]',
17
- array(
18
- 'type' => 'option',
19
- 'capability' => 'edit_theme_options',
20
- )
21
- );
22
-
23
- $wp_customize->add_control(
24
- new WP_Customize_Code_Editor_Control(
25
- $wp_customize,
26
- 'login_customizer_options[logincust_other_css]',
27
- array(
28
- 'label' => __( 'Custom CSS', 'login-customizer' ),
29
- 'code_type' => 'text/css',
30
- 'section' => 'logincust_code_section',
31
- 'priority' => 5,
32
- 'settings' => 'login_customizer_options[logincust_other_css]',
33
- )
34
- )
35
- );
36
-
37
- $wp_customize->add_setting(
38
- 'login_customizer_options[logincust_other_js]',
39
- array(
40
- 'type' => 'option',
41
- 'capability' => 'edit_theme_options',
42
- )
43
- );
44
-
45
- $wp_customize->add_control(
46
- new WP_Customize_Code_Editor_Control(
47
- $wp_customize,
48
- 'login_customizer_options[logincust_other_js]',
49
- array(
50
- 'label' => __( 'Custom JavaScript', 'login-customizer' ),
51
- 'code_type' => 'text/javascript',
52
- 'section' => 'logincust_code_section',
53
- 'priority' => 10,
54
- 'settings' => 'login_customizer_options[logincust_other_js]',
55
- )
56
- )
57
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-fields.php DELETED
@@ -1,365 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Fields Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_field_section',
8
- array(
9
- 'priority' => 25,
10
- 'title' => __( 'Fields', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_field_remember_me]',
17
- 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,
29
- 'login_customizer_options[logincust_field_remember_me]',
30
- array(
31
- 'label' => __( 'Disable Remember Me?', 'login-customizer' ),
32
- 'section' => 'logincust_field_section',
33
- 'priority' => 5,
34
- 'settings' => 'login_customizer_options[logincust_field_remember_me]',
35
- )
36
- )
37
- );
38
-
39
- $wp_customize->add_setting(
40
- 'login_customizer_options[logincust_field_width]',
41
- array(
42
- 'default' => '100%',
43
- 'type' => 'option',
44
- 'capability' => 'edit_theme_options',
45
- 'sanitize_callback' => 'esc_html',
46
- 'transport' => 'postMessage',
47
- )
48
- );
49
-
50
- $wp_customize->add_control(
51
- new O2_Customizer_Range_Slider_Control(
52
- $wp_customize,
53
- 'login_customizer_options[logincust_field_width]',
54
- array(
55
- 'label' => __( 'Width', 'login-customizer' ),
56
- 'section' => 'logincust_field_section',
57
- 'priority' => 10,
58
- 'settings' => 'login_customizer_options[logincust_field_width]',
59
- 'choices' => array(
60
- 'percent' => true,
61
- ),
62
- 'input_attrs' => array(
63
- 'min' => 0,
64
- 'max' => 1000,
65
- 'step' => 1,
66
- ),
67
- )
68
- )
69
- );
70
-
71
- $wp_customize->add_setting(
72
- 'login_customizer_options[logincust_field_font_size]',
73
- array(
74
- 'default' => '24px',
75
- 'type' => 'option',
76
- 'capability' => 'edit_theme_options',
77
- 'sanitize_callback' => 'esc_html',
78
- 'transport' => 'postMessage',
79
- )
80
- );
81
-
82
- $wp_customize->add_control(
83
- new O2_Customizer_Range_Slider_Control(
84
- $wp_customize,
85
- 'login_customizer_options[logincust_field_font_size]',
86
- array(
87
- 'label' => __( 'Font Size', 'login-customizer' ),
88
- 'section' => 'logincust_field_section',
89
- 'priority' => 15,
90
- 'settings' => 'login_customizer_options[logincust_field_font_size]',
91
- 'choices' => array(
92
- 'percent' => false,
93
- ),
94
- 'input_attrs' => array(
95
- 'min' => 0,
96
- 'max' => 100,
97
- 'step' => 1,
98
- ),
99
- )
100
- )
101
- );
102
-
103
- $wp_customize->add_setting(
104
- 'login_customizer_options[logincust_field_border_width]',
105
- array(
106
- 'default' => '1px',
107
- 'type' => 'option',
108
- 'capability' => 'edit_theme_options',
109
- 'sanitize_callback' => 'esc_html',
110
- 'transport' => 'postMessage',
111
- )
112
- );
113
-
114
- $wp_customize->add_control(
115
- new O2_Customizer_Range_Slider_Control(
116
- $wp_customize,
117
- 'login_customizer_options[logincust_field_border_width]',
118
- array(
119
- 'label' => __( 'Border Width', 'login-customizer' ),
120
- 'section' => 'logincust_field_section',
121
- 'priority' => 20,
122
- 'settings' => 'login_customizer_options[logincust_field_border_width]',
123
- 'choices' => array(
124
- 'percent' => false,
125
- ),
126
- 'input_attrs' => array(
127
- 'min' => 0,
128
- 'max' => 10,
129
- 'step' => 1,
130
- ),
131
- )
132
- )
133
- );
134
-
135
- $wp_customize->add_setting(
136
- 'login_customizer_options[logincust_field_border_color]',
137
- array(
138
- 'default' => '#DDD',
139
- 'type' => 'option',
140
- 'capability' => 'edit_theme_options',
141
- 'sanitize_callback' => 'sanitize_hex_color',
142
- 'transport' => 'postMessage',
143
- )
144
- );
145
-
146
- $wp_customize->add_control(
147
- new WP_Customize_Color_Control(
148
- $wp_customize,
149
- 'login_customizer_options[logincust_field_border_color]',
150
- array(
151
- 'label' => __( 'Border Color', 'login-customizer' ),
152
- 'section' => 'logincust_field_section',
153
- 'priority' => 25,
154
- 'settings' => 'login_customizer_options[logincust_field_border_color]',
155
- )
156
- )
157
- );
158
-
159
- $wp_customize->add_setting(
160
- 'login_customizer_options[logincust_field_radius]',
161
- array(
162
- 'default' => '0px',
163
- 'type' => 'option',
164
- 'capability' => 'edit_theme_options',
165
- 'sanitize_callback' => 'esc_html',
166
- 'transport' => 'postMessage',
167
- )
168
- );
169
-
170
- $wp_customize->add_control(
171
- new O2_Customizer_Range_Slider_Control(
172
- $wp_customize,
173
- 'login_customizer_options[logincust_field_radius]',
174
- array(
175
- 'label' => __( 'Radius', 'login-customizer' ),
176
- 'section' => 'logincust_field_section',
177
- 'priority' => 30,
178
- 'settings' => 'login_customizer_options[logincust_field_radius]',
179
- 'choices' => array(
180
- 'percent' => false,
181
- ),
182
- 'input_attrs' => array(
183
- 'min' => 0,
184
- 'max' => 100,
185
- 'step' => 1,
186
- ),
187
- )
188
- )
189
- );
190
-
191
- $wp_customize->add_setting(
192
- 'login_customizer_options[logincust_field_box_shadow]',
193
- array(
194
- 'default' => false,
195
- 'type' => 'option',
196
- 'capability' => 'edit_theme_options',
197
- 'sanitize_callback' => 'absint',
198
- 'transport' => 'postMessage',
199
- )
200
- );
201
-
202
- $wp_customize->add_control(
203
- new O2_Customizer_Toggle_Control(
204
- $wp_customize,
205
- 'login_customizer_options[logincust_field_box_shadow]',
206
- array(
207
- 'label' => __( 'Disable Box Shadow?', 'login-customizer' ),
208
- 'section' => 'logincust_field_section',
209
- 'priority' => 35,
210
- 'settings' => 'login_customizer_options[logincust_field_box_shadow]',
211
- )
212
- )
213
- );
214
-
215
- $wp_customize->add_setting(
216
- 'login_customizer_options[logincust_field_margin]',
217
- array(
218
- 'default' => '2px 6px 16px 0px',
219
- 'type' => 'option',
220
- 'capability' => 'edit_theme_options',
221
- 'sanitize_callback' => 'esc_html',
222
- 'transport' => 'postMessage',
223
- )
224
- );
225
-
226
- $wp_customize->add_control(
227
- new LoginCust_Padding_Control(
228
- $wp_customize,
229
- 'login_customizer_options[logincust_field_margin]',
230
- array(
231
- 'label' => __( 'Margin', 'login-customizer' ),
232
- 'section' => 'logincust_field_section',
233
- 'priority' => 35,
234
- 'settings' => 'login_customizer_options[logincust_field_margin]',
235
- )
236
- )
237
- );
238
-
239
- $wp_customize->add_setting(
240
- 'login_customizer_options[logincust_field_padding]',
241
- array(
242
- 'default' => '3px 3px 3px 3px',
243
- 'type' => 'option',
244
- 'capability' => 'edit_theme_options',
245
- 'sanitize_callback' => 'esc_html',
246
- 'transport' => 'postMessage',
247
- )
248
- );
249
-
250
- $wp_customize->add_control(
251
- new LoginCust_Padding_Control(
252
- $wp_customize,
253
- 'login_customizer_options[logincust_field_padding]',
254
- array(
255
- 'label' => __( 'Padding', 'login-customizer' ),
256
- 'section' => 'logincust_field_section',
257
- 'priority' => 40,
258
- 'settings' => 'login_customizer_options[logincust_field_padding]',
259
- )
260
- )
261
- );
262
-
263
- $wp_customize->add_setting(
264
- 'login_customizer_options[logincust_field_bg]',
265
- array(
266
- 'default' => '#FFF',
267
- 'type' => 'option',
268
- 'capability' => 'edit_theme_options',
269
- 'sanitize_callback' => 'sanitize_hex_color',
270
- 'transport' => 'postMessage',
271
- )
272
- );
273
-
274
- $wp_customize->add_control(
275
- new WP_Customize_Color_Control(
276
- $wp_customize,
277
- 'login_customizer_options[logincust_field_bg]',
278
- array(
279
- 'label' => __( 'Background', 'login-customizer' ),
280
- 'section' => 'logincust_field_section',
281
- 'priority' => 45,
282
- 'settings' => 'login_customizer_options[logincust_field_bg]',
283
- )
284
- )
285
- );
286
-
287
- $wp_customize->add_setting(
288
- 'login_customizer_options[logincust_field_color]',
289
- array(
290
- 'default' => '#333',
291
- 'type' => 'option',
292
- 'capability' => 'edit_theme_options',
293
- 'sanitize_callback' => 'sanitize_hex_color',
294
- 'transport' => 'postMessage',
295
- )
296
- );
297
-
298
- $wp_customize->add_control(
299
- new WP_Customize_Color_Control(
300
- $wp_customize,
301
- 'login_customizer_options[logincust_field_color]',
302
- array(
303
- 'label' => __( 'Text Color', 'login-customizer' ),
304
- 'section' => 'logincust_field_section',
305
- 'priority' => 50,
306
- 'settings' => 'login_customizer_options[logincust_field_color]',
307
- )
308
- )
309
- );
310
-
311
- $wp_customize->add_setting(
312
- 'login_customizer_options[logincust_field_label]',
313
- array(
314
- 'default' => '#777',
315
- 'type' => 'option',
316
- 'capability' => 'edit_theme_options',
317
- 'sanitize_callback' => 'sanitize_hex_color',
318
- 'transport' => 'postMessage',
319
- )
320
- );
321
-
322
- $wp_customize->add_control(
323
- new WP_Customize_Color_Control(
324
- $wp_customize,
325
- 'login_customizer_options[logincust_field_label]',
326
- array(
327
- 'label' => __( 'Label Color', 'login-customizer' ),
328
- 'section' => 'logincust_field_section',
329
- 'priority' => 55,
330
- 'settings' => 'login_customizer_options[logincust_field_label]',
331
- )
332
- )
333
- );
334
-
335
- $wp_customize->add_setting(
336
- 'login_customizer_options[logincust_field_label_font_size]',
337
- array(
338
- 'default' => '14px',
339
- 'type' => 'option',
340
- 'capability' => 'edit_theme_options',
341
- 'sanitize_callback' => 'esc_html',
342
- 'transport' => 'postMessage',
343
- )
344
- );
345
-
346
- $wp_customize->add_control(
347
- new O2_Customizer_Range_Slider_Control(
348
- $wp_customize,
349
- 'login_customizer_options[logincust_field_label_font_size]',
350
- array(
351
- 'label' => __( 'Label Font Size', 'login-customizer' ),
352
- 'section' => 'logincust_field_section',
353
- 'priority' => 60,
354
- 'settings' => 'login_customizer_options[logincust_field_label_font_size]',
355
- 'choices' => array(
356
- 'percent' => false,
357
- ),
358
- 'input_attrs' => array(
359
- 'min' => 0,
360
- 'max' => 100,
361
- 'step' => 1,
362
- ),
363
- )
364
- )
365
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-form.php DELETED
@@ -1,236 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Form Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_form_section',
8
- array(
9
- 'priority' => 15,
10
- 'title' => __( 'Form', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_form_bg_image]',
17
- array(
18
- 'type' => 'option',
19
- 'capability' => 'edit_theme_options',
20
- 'sanitize_callback' => 'esc_url_raw',
21
- 'transport' => 'postMessage',
22
- )
23
- );
24
-
25
- $wp_customize->add_control(
26
- new WP_Customize_Image_Control(
27
- $wp_customize,
28
- 'login_customizer_options[logincust_form_bg_image]',
29
- array(
30
- 'label' => __( 'Background Image', 'login-customizer' ),
31
- 'section' => 'logincust_form_section',
32
- 'priority' => 5,
33
- 'settings' => 'login_customizer_options[logincust_form_bg_image]',
34
- )
35
- )
36
- );
37
-
38
- $wp_customize->add_setting(
39
- 'login_customizer_options[logincust_form_bg_color]',
40
- array(
41
- 'default' => '#FFFFFF',
42
- 'type' => 'option',
43
- 'capability' => 'edit_theme_options',
44
- 'sanitize_callback' => 'sanitize_text_field',
45
- 'transport' => 'postMessage',
46
- )
47
- );
48
-
49
- $wp_customize->add_control(
50
- new LoginCust_Customize_Alpha_Color_Control(
51
- $wp_customize,
52
- 'login_customizer_options[logincust_form_bg_color]',
53
- array(
54
- 'label' => __( 'Background Color', 'login-customizer' ),
55
- 'section' => 'logincust_form_section',
56
- 'priority' => 10,
57
- 'settings' => 'login_customizer_options[logincust_form_bg_color]',
58
- )
59
- )
60
- );
61
-
62
- $wp_customize->add_setting(
63
- 'login_customizer_options[logincust_form_width]',
64
- array(
65
- 'default' => '320px',
66
- 'type' => 'option',
67
- 'capability' => 'edit_theme_options',
68
- 'sanitize_callback' => 'esc_html',
69
- 'transport' => 'postMessage',
70
- )
71
- );
72
-
73
- $wp_customize->add_control(
74
- new O2_Customizer_Range_Slider_Control(
75
- $wp_customize,
76
- 'login_customizer_options[logincust_form_width]',
77
- array(
78
- 'label' => __( 'Width', 'login-customizer' ),
79
- 'section' => 'logincust_form_section',
80
- 'priority' => 15,
81
- 'settings' => 'login_customizer_options[logincust_form_width]',
82
- 'choices' => array(
83
- 'percent' => true,
84
- ),
85
- 'input_attrs' => array(
86
- 'min' => 0,
87
- 'max' => 1000,
88
- 'step' => 1,
89
- ),
90
- )
91
- )
92
- );
93
-
94
- $wp_customize->add_setting(
95
- 'login_customizer_options[logincust_form_height]',
96
- array(
97
- 'default' => '194px',
98
- 'type' => 'option',
99
- 'capability' => 'edit_theme_options',
100
- 'sanitize_callback' => 'esc_html',
101
- 'transport' => 'postMessage',
102
- )
103
- );
104
-
105
- $wp_customize->add_control(
106
- new O2_Customizer_Range_Slider_Control(
107
- $wp_customize,
108
- 'login_customizer_options[logincust_form_height]',
109
- array(
110
- 'label' => __( 'Height', 'login-customizer' ),
111
- 'section' => 'logincust_form_section',
112
- 'priority' => 20,
113
- 'settings' => 'login_customizer_options[logincust_form_height]',
114
- 'choices' => array(
115
- 'percent' => true,
116
- ),
117
- 'input_attrs' => array(
118
- 'min' => 0,
119
- 'max' => 1000,
120
- 'step' => 1,
121
- ),
122
- )
123
- )
124
- );
125
-
126
- $wp_customize->add_setting(
127
- 'login_customizer_options[logincust_form_padding]',
128
- array(
129
- 'default' => '26px 24px 46px',
130
- 'type' => 'option',
131
- 'capability' => 'edit_theme_options',
132
- 'sanitize_callback' => 'esc_html',
133
- 'transport' => 'postMessage',
134
- )
135
- );
136
-
137
- $wp_customize->add_control(
138
- new LoginCust_Padding_Control(
139
- $wp_customize,
140
- 'login_customizer_options[logincust_form_padding]',
141
- array(
142
- 'label' => __( 'Padding', 'login-customizer' ),
143
- 'section' => 'logincust_form_section',
144
- 'priority' => 25,
145
- 'settings' => 'login_customizer_options[logincust_form_padding]',
146
- )
147
- )
148
- );
149
-
150
- $wp_customize->add_setting(
151
- 'login_customizer_options[logincust_form_radius]',
152
- array(
153
- 'default' => '0px',
154
- 'type' => 'option',
155
- 'capability' => 'edit_theme_options',
156
- 'sanitize_callback' => 'esc_html',
157
- 'transport' => 'postMessage',
158
- )
159
- );
160
-
161
- $wp_customize->add_control(
162
- new O2_Customizer_Range_Slider_Control(
163
- $wp_customize,
164
- 'login_customizer_options[logincust_form_radius]',
165
- array(
166
- 'label' => __( 'Radius', 'login-customizer' ),
167
- 'section' => 'logincust_form_section',
168
- 'priority' => 30,
169
- 'settings' => 'login_customizer_options[logincust_form_radius]',
170
- 'choices' => array(
171
- 'percent' => false,
172
- ),
173
- 'input_attrs' => array(
174
- 'min' => 0,
175
- 'max' => 500,
176
- 'step' => 1,
177
- ),
178
- )
179
- )
180
- );
181
-
182
- $wp_customize->add_setting(
183
- 'login_customizer_options[logincust_form_shadow_spread]',
184
- array(
185
- 'default' => '3px',
186
- 'type' => 'option',
187
- 'capability' => 'edit_theme_options',
188
- 'sanitize_callback' => 'esc_html',
189
- 'transport' => 'postMessage',
190
- )
191
- );
192
-
193
- $wp_customize->add_control(
194
- new O2_Customizer_Range_Slider_Control(
195
- $wp_customize,
196
- 'login_customizer_options[logincust_form_shadow_spread]',
197
- array(
198
- 'label' => __( 'Shadow Spread', 'login-customizer' ),
199
- 'section' => 'logincust_form_section',
200
- 'priority' => 35,
201
- 'settings' => 'login_customizer_options[logincust_form_shadow_spread]',
202
- 'choices' => array(
203
- 'percent' => false,
204
- ),
205
- 'input_attrs' => array(
206
- 'min' => 0,
207
- 'max' => 50,
208
- 'step' => 1,
209
- ),
210
- )
211
- )
212
- );
213
-
214
- $wp_customize->add_setting(
215
- 'login_customizer_options[logincust_form_shadow]',
216
- array(
217
- 'default' => 'rgba(0,0,0, 0.13)',
218
- 'type' => 'option',
219
- 'capability' => 'edit_theme_options',
220
- 'sanitize_callback' => 'sanitize_text_field',
221
- 'transport' => 'postMessage',
222
- )
223
- );
224
-
225
- $wp_customize->add_control(
226
- new LoginCust_Customize_Alpha_Color_Control(
227
- $wp_customize,
228
- 'login_customizer_options[logincust_form_shadow]',
229
- array(
230
- 'label' => __( 'Box Shadow', 'login-customizer' ),
231
- 'section' => 'logincust_form_section',
232
- 'priority' => 40,
233
- 'settings' => 'login_customizer_options[logincust_form_shadow]',
234
- )
235
- )
236
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-logo.php DELETED
@@ -1,177 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Logo Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_logo_section',
8
- array(
9
- 'priority' => 10,
10
- 'title' => __( 'Logo', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_logo_show]',
17
- 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,
29
- 'login_customizer_options[logincust_logo_show]',
30
- array(
31
- 'label' => __( 'Disable Logo?', 'login-customizer' ),
32
- 'section' => 'logincust_logo_section',
33
- 'priority' => 5,
34
- 'settings' => 'login_customizer_options[logincust_logo_show]',
35
- )
36
- )
37
- );
38
-
39
- $wp_customize->add_setting(
40
- 'login_customizer_options[logincust_logo]',
41
- array(
42
- 'type' => 'option',
43
- 'capability' => 'edit_theme_options',
44
- 'sanitize_callback' => 'esc_url_raw',
45
- 'transport' => 'postMessage',
46
- )
47
- );
48
-
49
- $wp_customize->add_control(
50
- new WP_Customize_Image_Control(
51
- $wp_customize,
52
- 'login_customizer_options[logincust_logo]',
53
- array(
54
- 'label' => __( 'Logo', 'login-customizer' ),
55
- 'section' => 'logincust_logo_section',
56
- 'priority' => 10,
57
- 'settings' => 'login_customizer_options[logincust_logo]',
58
- )
59
- )
60
- );
61
-
62
- $wp_customize->add_setting(
63
- 'login_customizer_options[logincust_logo_width]',
64
- array(
65
- 'default' => '84px',
66
- 'type' => 'option',
67
- 'capability' => 'edit_theme_options',
68
- 'sanitize_callback' => 'esc_html',
69
- 'transport' => 'postMessage',
70
- )
71
- );
72
-
73
- $wp_customize->add_control(
74
- new O2_Customizer_Range_Slider_Control(
75
- $wp_customize,
76
- 'login_customizer_options[logincust_logo_width]',
77
- array(
78
- 'label' => __( 'Logo Width', 'login-customizer' ),
79
- 'section' => 'logincust_logo_section',
80
- 'priority' => 15,
81
- 'settings' => 'login_customizer_options[logincust_logo_width]',
82
- 'choices' => array(
83
- 'percent' => true,
84
- ),
85
- 'input_attrs' => array(
86
- 'min' => 0,
87
- 'max' => 1000,
88
- 'step' => 1,
89
- ),
90
- )
91
- )
92
- );
93
-
94
- $wp_customize->add_setting(
95
- 'login_customizer_options[logincust_logo_height]',
96
- array(
97
- 'default' => '84px',
98
- 'type' => 'option',
99
- 'capability' => 'edit_theme_options',
100
- 'sanitize_callback' => 'esc_html',
101
- 'transport' => 'postMessage',
102
- )
103
- );
104
-
105
- $wp_customize->add_control(
106
- new O2_Customizer_Range_Slider_Control(
107
- $wp_customize,
108
- 'login_customizer_options[logincust_logo_height]',
109
- array(
110
- 'label' => __( 'Logo Height', 'login-customizer' ),
111
- 'section' => 'logincust_logo_section',
112
- 'priority' => 20,
113
- 'settings' => 'login_customizer_options[logincust_logo_height]',
114
- 'choices' => array(
115
- 'percent' => true,
116
- ),
117
- 'input_attrs' => array(
118
- 'min' => 0,
119
- 'max' => 1000,
120
- 'step' => 1,
121
- ),
122
- )
123
- )
124
- );
125
-
126
- $wp_customize->add_setting(
127
- 'login_customizer_options[logincust_logo_padding]',
128
- array(
129
- 'default' => '5px',
130
- 'type' => 'option',
131
- 'capability' => 'edit_theme_options',
132
- 'sanitize_callback' => 'esc_html',
133
- 'transport' => 'postMessage',
134
- )
135
- );
136
-
137
- $wp_customize->add_control(
138
- new O2_Customizer_Range_Slider_Control(
139
- $wp_customize,
140
- 'login_customizer_options[logincust_logo_padding]',
141
- array(
142
- 'label' => __( 'Padding Bottom', 'login-customizer' ),
143
- 'section' => 'logincust_logo_section',
144
- 'priority' => 25,
145
- 'settings' => 'login_customizer_options[logincust_logo_padding]',
146
- 'choices' => array(
147
- 'percent' => true,
148
- ),
149
- 'input_attrs' => array(
150
- 'min' => 0,
151
- 'max' => 1000,
152
- 'step' => 1,
153
- ),
154
- )
155
- )
156
- );
157
-
158
- $wp_customize->add_setting(
159
- 'login_customizer_options[logincust_logo_link]',
160
- array(
161
- 'default' => 'https://wordpress.org/',
162
- 'type' => 'option',
163
- 'capability' => 'edit_theme_options',
164
- 'sanitize_callback' => 'esc_url_raw',
165
- )
166
- );
167
-
168
- $wp_customize->add_control(
169
- 'login_customizer_options[logincust_logo_link]',
170
- array(
171
- 'label' => __( 'Logo URL', 'login-customizer' ),
172
- 'description' => __( 'The page where your logo will take you.', 'login-customizer' ),
173
- 'section' => 'logincust_logo_section',
174
- 'priority' => 30,
175
- 'settings' => 'login_customizer_options[logincust_logo_link]',
176
- )
177
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-more.php DELETED
@@ -1,26 +0,0 @@
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 DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Other Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_other_section',
8
- array(
9
- 'priority' => 35,
10
- 'title' => __( 'Other', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- if ( get_option( 'users_can_register' ) ) {
16
-
17
- $wp_customize->add_setting(
18
- 'login_customizer_options[logincust_field_register_link]',
19
- array(
20
- 'default' => false,
21
- 'type' => 'option',
22
- 'capability' => 'edit_theme_options',
23
- 'sanitize_callback' => 'absint',
24
- 'transport' => 'postMessage',
25
- )
26
- );
27
-
28
- $wp_customize->add_control(
29
- new O2_Customizer_Toggle_Control(
30
- $wp_customize,
31
- 'login_customizer_options[logincust_field_register_link]',
32
- array(
33
- 'label' => __( 'Disable Register Link?', 'login-customizer' ),
34
- 'section' => 'logincust_other_section',
35
- 'priority' => 5,
36
- 'settings' => 'login_customizer_options[logincust_field_register_link]',
37
- )
38
- )
39
- );
40
-
41
- }
42
-
43
- $wp_customize->add_setting(
44
- 'login_customizer_options[logincust_field_lost_password]',
45
- array(
46
- 'default' => false,
47
- 'type' => 'option',
48
- 'capability' => 'edit_theme_options',
49
- 'sanitize_callback' => 'absint',
50
- 'transport' => 'postMessage',
51
- )
52
- );
53
-
54
- $wp_customize->add_control(
55
- new O2_Customizer_Toggle_Control(
56
- $wp_customize,
57
- 'login_customizer_options[logincust_field_lost_password]',
58
- array(
59
- 'label' => __( 'Disable Lost Password?', 'login-customizer' ),
60
- 'section' => 'logincust_other_section',
61
- 'priority' => 10,
62
- 'settings' => 'login_customizer_options[logincust_field_lost_password]',
63
- )
64
- )
65
- );
66
-
67
- $wp_customize->add_setting(
68
- 'login_customizer_options[logincust_field_back_blog]',
69
- array(
70
- 'default' => false,
71
- 'type' => 'option',
72
- 'capability' => 'edit_theme_options',
73
- 'sanitize_callback' => 'absint',
74
- 'transport' => 'postMessage',
75
- )
76
- );
77
-
78
- $wp_customize->add_control(
79
- new O2_Customizer_Toggle_Control(
80
- $wp_customize,
81
- 'login_customizer_options[logincust_field_back_blog]',
82
- array(
83
- 'label' => __( 'Disable "Back to Website"?', 'login-customizer' ),
84
- 'section' => 'logincust_other_section',
85
- 'priority' => 15,
86
- 'settings' => 'login_customizer_options[logincust_field_back_blog]',
87
- )
88
- )
89
- );
90
-
91
- $wp_customize->add_setting(
92
- 'login_customizer_options[logincust_other_font_size]',
93
- array(
94
- 'default' => '13px',
95
- 'type' => 'option',
96
- 'capability' => 'edit_theme_options',
97
- 'sanitize_callback' => 'esc_html',
98
- 'transport' => 'postMessage',
99
- )
100
- );
101
-
102
- $wp_customize->add_control(
103
- new O2_Customizer_Range_Slider_Control(
104
- $wp_customize,
105
- 'login_customizer_options[logincust_other_font_size]',
106
- array(
107
- 'label' => __( 'Font Size', 'login-customizer' ),
108
- 'section' => 'logincust_other_section',
109
- 'priority' => 15,
110
- 'settings' => 'login_customizer_options[logincust_other_font_size]',
111
- 'choices' => array(
112
- 'percent' => false,
113
- ),
114
- 'input_attrs' => array(
115
- 'min' => 0,
116
- 'max' => 100,
117
- 'step' => 1,
118
- ),
119
- )
120
- )
121
- );
122
-
123
- $wp_customize->add_setting(
124
- 'login_customizer_options[logincust_other_color]',
125
- array(
126
- 'default' => '#999',
127
- 'type' => 'option',
128
- 'capability' => 'edit_theme_options',
129
- 'sanitize_callback' => 'sanitize_hex_color',
130
- 'transport' => 'postMessage',
131
- )
132
- );
133
-
134
- $wp_customize->add_control(
135
- new WP_Customize_Color_Control(
136
- $wp_customize,
137
- 'login_customizer_options[logincust_other_color]',
138
- array(
139
- 'label' => __( 'Text Color', 'login-customizer' ),
140
- 'section' => 'logincust_other_section',
141
- 'priority' => 20,
142
- 'settings' => 'login_customizer_options[logincust_other_color]',
143
- )
144
- )
145
- );
146
-
147
- $wp_customize->add_setting(
148
- 'login_customizer_options[logincust_other_color_hover]',
149
- array(
150
- 'default' => '#2EA2CC',
151
- 'type' => 'option',
152
- 'capability' => 'edit_theme_options',
153
- 'sanitize_callback' => 'sanitize_hex_color',
154
- 'transport' => 'postMessage',
155
- )
156
- );
157
-
158
- $wp_customize->add_control(
159
- new WP_Customize_Color_Control(
160
- $wp_customize,
161
- 'login_customizer_options[logincust_other_color_hover]',
162
- array(
163
- 'label' => __( 'Text Color (Hover)', 'login-customizer' ),
164
- 'section' => 'logincust_other_section',
165
- 'priority' => 25,
166
- 'settings' => 'login_customizer_options[logincust_other_color_hover]',
167
- )
168
- )
169
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/customizer/sections/section-templates.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * Customizer controls for Background Section
4
- */
5
-
6
- $wp_customize->add_section(
7
- 'logincust_templates',
8
- array(
9
- 'priority' => 0,
10
- 'title' => __( 'Templates', 'login-customizer' ),
11
- 'panel' => 'logincust_panel',
12
- )
13
- );
14
-
15
- $wp_customize->add_setting(
16
- 'login_customizer_options[logincust_templates_control]',
17
- array(
18
- 'default' => 'original',
19
- 'type' => 'option',
20
- 'capability' => 'edit_theme_options',
21
- 'sanitize_callback' => 'logincust_sanitize_options',
22
- )
23
- );
24
-
25
- $wp_customize->add_control(
26
- new O2_Customizer_Radio_Images_Control(
27
- $wp_customize,
28
- 'login_customizer_options[logincust_templates_control]',
29
- array(
30
- 'label' => __( 'Templates', 'login-customizer' ),
31
- 'section' => 'logincust_templates',
32
- 'priority' => 5,
33
- 'settings' => 'login_customizer_options[logincust_templates_control]',
34
- 'choices' => array(
35
- 'original' => LOGINCUST_FREE_URL . 'assets/templates/original.png',
36
- 'dark' => LOGINCUST_FREE_URL . 'assets/templates/dark.png',
37
- 'material' => LOGINCUST_FREE_URL . 'assets/templates/material.png',
38
- ),
39
- )
40
- )
41
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/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
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/template-login-customizer.php DELETED
@@ -1,124 +0,0 @@
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' ),
28
- __( 'Log In', 'login-customizer' ),
29
- get_bloginfo( 'name', 'display' )
30
- );
31
- ?>
32
- <title><?php echo esc_attr( $login_title ); ?></title>
33
- <?php
34
- wp_enqueue_style( 'login' );
35
- do_action( 'login_enqueue_scripts' );
36
- do_action( 'login_head' );
37
- ?>
38
- </head>
39
- <?php
40
- do_action( 'login_form_login' );
41
-
42
- $action = 'login';
43
-
44
- $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
45
-
46
- if ( is_multisite() ) {
47
- $login_header_url = network_home_url();
48
- $login_header_title = get_network()->site_name;
49
- } else {
50
- $login_header_url = __( 'https://wordpress.org/', 'login-customizer' );
51
- $login_header_title = __( 'Powered by WordPress', 'login-customizer' );
52
- }
53
-
54
- $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
55
-
56
-
57
- //login_headertitle was deprecated in WordPress 5.2
58
-
59
- if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
60
- $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
61
- } else {
62
- $login_header_title = apply_filters( 'login_headertext', $login_header_title );
63
- }
64
- if ( is_multisite() ) {
65
- $login_header_text = get_bloginfo( 'name', 'display' );
66
- } else {
67
- $login_header_text = $login_header_title;
68
- }
69
-
70
- $classes = array( 'login-action-' . $action, 'wp-core-ui' );
71
- if ( is_rtl() ) {
72
- $classes[] = 'rtl';
73
- }
74
-
75
- $classes = apply_filters( 'login_body_class', $classes, $action );
76
- ?>
77
- <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
78
- <?php do_action( 'login_header' ); ?>
79
- <div id="login">
80
- <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>
81
- <form name="loginform" id="loginform">
82
- <p>
83
- <label for="user_login"><?php _e( 'Username or Email Address', 'login-customizer' ); ?><br />
84
- <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
85
- </p>
86
- <p>
87
- <label for="user_pass"><?php _e( 'Password', 'login-customizer' ); ?><br />
88
- <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
89
- </p>
90
- <?php do_action( 'login_form' ); ?>
91
- <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>
92
- <p class="submit">
93
- <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'login-customizer' ); ?>" />
94
- </p>
95
- </form>
96
- <p id="nav">
97
- <?php
98
- if ( get_option( 'users_can_register' ) ) :
99
- $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'login-customizer' ) );
100
- /** This filter is documented in wp-includes/general-template.php */
101
- echo apply_filters( 'register', $registration_url );
102
- echo esc_html( $login_link_separator );
103
- endif;
104
- ?>
105
- <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'login-customizer' ); ?></a>
106
- </p>
107
- <p id="backtoblog">
108
- <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
109
- <?php
110
- /* translators: %s: site title */
111
- printf( _x( '&larr; Back to %s', 'site', 'login-customizer' ), get_bloginfo( 'title', 'display' ) );
112
- ?>
113
- </a>
114
- </p>
115
- </div>
116
- <?php
117
- do_action( 'login_footer' );
118
- $options = get_option( 'login_customizer_options' );
119
- global $options;
120
- echo '<script type="text/javascript">' . $options['logincust_other_js'] . '</script>';
121
- wp_footer();
122
- ?>
123
- </body>
124
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.php CHANGED
@@ -1 +1,2 @@
1
- <?php // You're a Jedi!
 
1
+ <?php
2
+ // You're a Jedi in Minecraft!
languages/login-customizer.pot DELETED
@@ -1,396 +0,0 @@
1
- # Copyright (C) 2018 Hardeep Asrani
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"
11
- "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: Themeisle Translate Team <friends@themeisle.com>\n"
13
- "Language-Team: Themeisle Translate <friends@themeisle.com>\n"
14
- "X-Generator: grunt-wp-i18n 0.5.4\n"
15
- "X-Poedit-KeywordsList: "
16
- "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
17
- "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
18
- "Language: en\n"
19
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
- "X-Poedit-Country: United States\n"
21
- "X-Poedit-SourceCharset: UTF-8\n"
22
- "X-Poedit-Basepath: ../\n"
23
- "X-Poedit-SearchPath-0: .\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
371
- msgid "Custom Login Page Customizer"
372
- msgstr ""
373
-
374
- #. Plugin URI of the plugin/theme
375
- msgid "https://themeisle.com/plugins/login-customizer/"
376
- msgstr ""
377
-
378
- #. Description of the plugin/theme
379
- msgid ""
380
- "Custom Login Customizer plugin allows you to easily customize your login "
381
- "page straight from your WordPress Customizer! Awesome, right?"
382
- msgstr ""
383
-
384
- #. Author of the plugin/theme
385
- msgid "Hardeep Asrani"
386
- msgstr ""
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
@@ -1,53 +1,51 @@
1
  <?php
2
  /**
3
- * Plugin loader
4
- *
5
- * @package LOGINCUST
6
- * @author HardeepAsrani
7
- * @since 1.0.0
8
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  /**
11
- * Plugin Name: Custom Login Page Customizer
12
- * Plugin URI: https://wordpress.org/plugins/login-customizer/
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://loginpress.pro/
16
- * Version: 2.1.0
17
- * WordPress Available: yes
18
- * Requires License: no
19
- */
20
-
21
- define( 'LOGINCUST_VERSION', '2.1.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 . 'setup.php' );
26
- require_once( LOGINCUST_FREE_PATH . 'inc/include-page-template.php' );
27
- require_once( LOGINCUST_FREE_PATH . 'inc/customizer/customizer.php' );
28
-
29
- /**
30
- * Add link to Login Customizer in Appearances menu
31
  */
32
- function logincust_admin_link() {
33
-
34
- // Get global submenu
35
- global $submenu;
36
-
37
- // Generate the redirect url.
38
- $options = get_option( 'login_customizer_settings', array() );
39
-
40
- $url = add_query_arg(
41
- array(
42
- 'autofocus[panel]' => 'logincust_panel',
43
- 'url' => rawurlencode( get_permalink( $options['page'] ) ),
44
- ),
45
- admin_url( 'customize.php' )
46
- );
47
 
48
- // Add Login Customizer as a menu item
49
- $submenu['themes.php'][] = array( 'Login Customizer', 'manage_options', $url, 'login-customizer' );
 
50
 
 
51
  }
52
 
53
- add_action( 'admin_menu', 'logincust_admin_link' );
 
1
  <?php
2
  /**
3
+ * Plugin Name: Custom Login Page Customizer
4
+ * Plugin URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=plugin-url-link
5
+ * Description: Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
6
+ * Version: 2.1.1
7
+ * Requires at least: 5.0
8
+ * Requires PHP: 5.6
9
+ * Author: Hardeep Asrani
10
+ * Author URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=author-url-link
11
+ * WordPress Available: yes
12
+ * Requires License: no
13
+ * License: GPLv2+
14
+ * Text Domain: login-customizer
15
+ * Domain Path: /resources/languages
16
+ *
17
+ * @package LoginCustomizer
18
+ * @author WPBrigade
19
+ * @copyright Copyright (c) 2021, WPBrigade
20
+ * @link https://loginpress.pro/
21
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22
+ */
23
+
24
+ namespace LoginCustomizer;
25
+
26
+ defined( 'ABSPATH' ) || exit;
27
+
28
+ include_once 'autoload.php';
29
+
30
+ use LoginCustomizer\Plugin;
31
 
32
  /**
33
+ * Wrapper for the plugin instance.
34
+ *
35
+ * @since 2.2.0
36
+ * @access public
37
+ * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  */
39
+ function plugin() {
40
+
41
+ static $instance = null;
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ if ( is_null( $instance ) ) {
44
+ $instance = new Plugin( __DIR__, plugin_dir_url( __FILE__ ) );
45
+ }
46
 
47
+ return $instance;
48
  }
49
 
50
+ # Boot the plugin.
51
+ plugin();
readme.md CHANGED
@@ -14,7 +14,7 @@ Custom Login Customizer allows you to easily customize your admin login page, st
14
 
15
  Custom Login Page Customizer 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
 
14
 
15
  Custom Login Page Customizer 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=mOmgmN1iRac
18
 
19
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
20
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Login Page Customizer ===
2
- Stable tag: trunk
3
  Requires at least: 4.0
4
  Tested up to: 5.6
5
  Contributors: hardeepasrani, hiddenpearls
6
- Author URI: https://loginpress.pro/
7
  Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro
 
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,9 +12,9 @@ Custom Login Customizer allows you to easily customize your admin login page, st
12
 
13
  == Description ==
14
 
15
- <a href="https://loginpress.pro/" 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=wBWk-uC6Juc
18
 
19
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
20
 
@@ -33,7 +33,7 @@ In your WordPress Dashboard, navigate to Appearance > Custom Login Customizer to
33
 
34
  = How to donate or contribute? =
35
 
36
- Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/">this link</a> for more info.
37
 
38
  == Screenshots ==
39
 
@@ -44,15 +44,23 @@ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/">th
44
  5. Custom Login - Customize login form button
45
  6. Custom Login - Add logo of your own choice from settings
46
 
47
-
48
  == Upgrade Notice ==
49
 
50
- = 2.1.0 =
51
- * Update immediately - compatible with 5.6 and bugfix release. new ownership rolling out.
52
-
53
 
54
  == Changelog ==
55
 
 
 
 
 
 
 
 
 
 
 
56
  = 2.1.0 - 2021-01-12 =
57
 
58
  * Bugfix: Fixed live preview issues.
1
  === Custom Login Page Customizer ===
 
2
  Requires at least: 4.0
3
  Tested up to: 5.6
4
  Contributors: hardeepasrani, hiddenpearls
5
+ Author URI: https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=author-url-link
6
  Tags: login, customizer, logo, login logo, login customizer, login page,admin, branding, customization, custom login, error, login error, custom login pro
7
+ Stable tag: 2.1.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ <a href="https://loginpress.pro/?utm_source=login-customizer-lite-readme&?&utm_medium=link&utm_campaign=pro-loginpress" 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=mOmgmN1iRac
18
 
19
  In your WordPress Dashboard, navigate to Appearance > Custom Login Page Customizer to get started.
20
 
33
 
34
  = How to donate or contribute? =
35
 
36
+ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/?utm_source=login-customizer-lite-readme&?&utm_medium=link&utm_campaign=pro-loginpress">this link</a> for more info.
37
 
38
  == Screenshots ==
39
 
44
  5. Custom Login - Customize login form button
45
  6. Custom Login - Add logo of your own choice from settings
46
 
 
47
  == Upgrade Notice ==
48
 
49
+ = 2.1.1 =
50
+ * Update immediately - compatible with 5.6 and bugfix release. Introducing New features and settings panel.
 
51
 
52
  == Changelog ==
53
 
54
+ = 2.1.1 - 2021-01-27 =
55
+ * New Feature: Introducing new Login Customizer settings page.
56
+ * New Feature: Introducing "Remember Me" option already checked on login form.
57
+ * New Feature: Introducing "Custom Register Password Fields" which creates custom password field so you don't have to reset the password for the first time through a link in order to login (settings will be shown only if you enable register users for your site).
58
+ * New Feature: Introducing "Login Order", Enable users to login using their username or email address or both.
59
+ * New Feature: Introducing "Log Data Page" with System Info for troubleshooting.
60
+ * Enhancement: Code optimization and plugin speed improvements.
61
+ * Enhancement: Introducing Login Customizer dashicon.
62
+ * Compatibility: Compatibile with WordPress 5.6.
63
+
64
  = 2.1.0 - 2021-01-12 =
65
 
66
  * Bugfix: Fixed live preview issues.
resources/languages/login-customizer.pot ADDED
@@ -0,0 +1,715 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: Custom Login Page Customizer\n"
6
+ "POT-Creation-Date: 2021-01-25 16:12+0500\n"
7
+ "PO-Revision-Date: 2021-01-25 10:37+0500\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.4.2\n"
14
+ "X-Poedit-Basepath: ../..\n"
15
+ "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
+ "X-Poedit-WPHeader: plugin.php\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.min.js\n"
23
+
24
+ #: backup/trunk/inc/customizer/controls/cool-stuff/cool-stuff-control.php:36
25
+ msgid ""
26
+ "Our free, 4-lesson course on how to make your WordPress site run incredibly "
27
+ "fast is barely waiting for its students. Ready to learn how to reduce your "
28
+ "loading times by half? Come and join the 1st lesson here!"
29
+ msgstr ""
30
+
31
+ #: backup/trunk/inc/customizer/controls/cool-stuff/cool-stuff-control.php:41
32
+ msgid ""
33
+ "Thank you for subscribing! You have been added to the mailing list and will "
34
+ "receive the next email information in the coming weeks. If you ever wish to "
35
+ "unsubscribe, simply use the Unsubscribe link included in each newsletter."
36
+ msgstr ""
37
+
38
+ #: backup/trunk/inc/customizer/controls/padding/padding-control.php:26
39
+ #: src/Customizer/Panel/Controls/Padding.php:36
40
+ msgid "Top"
41
+ msgstr ""
42
+
43
+ #: backup/trunk/inc/customizer/controls/padding/padding-control.php:28
44
+ #: src/Customizer/Panel/Controls/Padding.php:38
45
+ msgid "Right"
46
+ msgstr ""
47
+
48
+ #: backup/trunk/inc/customizer/controls/padding/padding-control.php:32
49
+ #: src/Customizer/Panel/Controls/Padding.php:42
50
+ msgid "Down"
51
+ msgstr ""
52
+
53
+ #: backup/trunk/inc/customizer/controls/padding/padding-control.php:34
54
+ #: src/Customizer/Panel/Controls/Padding.php:44
55
+ msgid "Left"
56
+ msgstr ""
57
+
58
+ #: backup/trunk/inc/customizer/controls/range-slider/range-slider-control.php:67
59
+ #: src/Customizer/Panel/Controls/Range_Slider.php:67
60
+ msgid "px"
61
+ msgstr ""
62
+
63
+ #: backup/trunk/inc/customizer/controls/range-slider/range-slider-control.php:69
64
+ #: src/Customizer/Panel/Controls/Range_Slider.php:69
65
+ msgid "%"
66
+ msgstr ""
67
+
68
+ #: backup/trunk/inc/customizer/controls/range-slider/range-slider-control.php:84
69
+ #: src/Customizer/Panel/Controls/Range_Slider.php:83
70
+ msgid "Reset"
71
+ msgstr ""
72
+
73
+ #: backup/trunk/inc/customizer/customizer.php:34
74
+ #: backup/trunk/inc/initial-setup.php:92 src/Customizer/Initial_Setup.php:95
75
+ #: src/Customizer/Panel/customizer.php:74 src/Settings/Setup.php:68
76
+ msgid "Login Customizer"
77
+ msgstr ""
78
+
79
+ #: backup/trunk/inc/customizer/customizer.php:35
80
+ msgid ""
81
+ "This section allows you to customize the login page of your website. Made "
82
+ "with ❤ by <a target=\"_blank\" rel=\"nofollow\" href=\"http://www."
83
+ "hardeepasrani.com\">HardeepAsrani</a> team."
84
+ msgstr ""
85
+
86
+ #: backup/trunk/inc/customizer/sections/section-background.php:10
87
+ #: backup/trunk/inc/customizer/sections/section-button.php:31
88
+ #: backup/trunk/inc/customizer/sections/section-fields.php:279
89
+ #: src/Customizer/Panel/Sections/Background.php:33
90
+ #: src/Customizer/Panel/Sections/Button.php:57
91
+ #: src/Customizer/Panel/Sections/Fields.php:302
92
+ msgid "Background"
93
+ msgstr ""
94
+
95
+ #: backup/trunk/inc/customizer/sections/section-background.php:31
96
+ #: backup/trunk/inc/customizer/sections/section-form.php:54
97
+ #: src/Customizer/Panel/Sections/Background.php:50
98
+ #: src/Customizer/Panel/Sections/Form.php:77
99
+ msgid "Background Color"
100
+ msgstr ""
101
+
102
+ #: backup/trunk/inc/customizer/sections/section-background.php:54
103
+ #: backup/trunk/inc/customizer/sections/section-form.php:30
104
+ #: src/Customizer/Panel/Sections/Background.php:73
105
+ #: src/Customizer/Panel/Sections/Form.php:53
106
+ msgid "Background Image"
107
+ msgstr ""
108
+
109
+ #: backup/trunk/inc/customizer/sections/section-background.php:75
110
+ #: src/Customizer/Panel/Sections/Background.php:94
111
+ msgid "Background Size"
112
+ msgstr ""
113
+
114
+ #: backup/trunk/inc/customizer/sections/section-background.php:79
115
+ #: src/Customizer/Panel/Sections/Background.php:98
116
+ msgid "Original"
117
+ msgstr ""
118
+
119
+ #: backup/trunk/inc/customizer/sections/section-background.php:80
120
+ #: src/Customizer/Panel/Sections/Background.php:99
121
+ msgid "Fit to Screen"
122
+ msgstr ""
123
+
124
+ #: backup/trunk/inc/customizer/sections/section-background.php:81
125
+ #: src/Customizer/Panel/Sections/Background.php:100
126
+ msgid "Fill Screen"
127
+ msgstr ""
128
+
129
+ #: backup/trunk/inc/customizer/sections/section-background.php:82
130
+ #: backup/trunk/inc/customizer/sections/section-button.php:81
131
+ #: src/Customizer/Panel/Sections/Background.php:101
132
+ #: src/Customizer/Panel/Sections/Button.php:122
133
+ msgid "Custom"
134
+ msgstr ""
135
+
136
+ #: backup/trunk/inc/customizer/sections/section-background.php:102
137
+ #: src/Customizer/Panel/Sections/Background.php:121
138
+ msgid "Custom Size"
139
+ msgstr ""
140
+
141
+ #: backup/trunk/inc/customizer/sections/section-background.php:122
142
+ #: src/Customizer/Panel/Sections/Background.php:141
143
+ msgid "Background Repeat"
144
+ msgstr ""
145
+
146
+ #: backup/trunk/inc/customizer/sections/section-background.php:126
147
+ #: src/Customizer/Panel/Sections/Background.php:145
148
+ msgid "No Repeat"
149
+ msgstr ""
150
+
151
+ #: backup/trunk/inc/customizer/sections/section-background.php:127
152
+ #: src/Customizer/Panel/Sections/Background.php:146
153
+ msgid "Repeat"
154
+ msgstr ""
155
+
156
+ #: backup/trunk/inc/customizer/sections/section-background.php:128
157
+ #: src/Customizer/Panel/Sections/Background.php:147
158
+ msgid "Repeat Horizontally"
159
+ msgstr ""
160
+
161
+ #: backup/trunk/inc/customizer/sections/section-background.php:129
162
+ #: src/Customizer/Panel/Sections/Background.php:148
163
+ msgid "Repeat Vertically"
164
+ msgstr ""
165
+
166
+ #: backup/trunk/inc/customizer/sections/section-background.php:164
167
+ #: src/Customizer/Panel/Sections/Background.php:183
168
+ msgid "Background Position"
169
+ msgstr ""
170
+
171
+ #: backup/trunk/inc/customizer/sections/section-button.php:10
172
+ #: src/Customizer/Panel/Sections/Button.php:36
173
+ msgid "Button"
174
+ msgstr ""
175
+
176
+ #: backup/trunk/inc/customizer/sections/section-button.php:55
177
+ #: src/Customizer/Panel/Sections/Button.php:81
178
+ msgid "Background (Hover)"
179
+ msgstr ""
180
+
181
+ #: backup/trunk/inc/customizer/sections/section-button.php:76
182
+ #: src/Customizer/Panel/Sections/Button.php:117
183
+ msgid "Button Size"
184
+ msgstr ""
185
+
186
+ #: backup/trunk/inc/customizer/sections/section-button.php:80
187
+ #: src/Customizer/Panel/Sections/Button.php:121
188
+ msgid "Auto"
189
+ msgstr ""
190
+
191
+ #: backup/trunk/inc/customizer/sections/section-button.php:104
192
+ #: backup/trunk/inc/customizer/sections/section-fields.php:55
193
+ #: backup/trunk/inc/customizer/sections/section-form.php:78
194
+ #: src/Customizer/Panel/Sections/Button.php:145
195
+ #: src/Customizer/Panel/Sections/Fields.php:78
196
+ #: src/Customizer/Panel/Sections/Form.php:101
197
+ msgid "Width"
198
+ msgstr ""
199
+
200
+ #: backup/trunk/inc/customizer/sections/section-button.php:136
201
+ #: backup/trunk/inc/customizer/sections/section-form.php:110
202
+ #: src/Customizer/Panel/Sections/Button.php:177
203
+ #: src/Customizer/Panel/Sections/Form.php:133
204
+ msgid "Height"
205
+ msgstr ""
206
+
207
+ #: backup/trunk/inc/customizer/sections/section-button.php:168
208
+ #: backup/trunk/inc/customizer/sections/section-fields.php:87
209
+ #: backup/trunk/inc/customizer/sections/section-other.php:107
210
+ #: src/Customizer/Panel/Sections/Button.php:209
211
+ #: src/Customizer/Panel/Sections/Fields.php:110
212
+ #: src/Customizer/Panel/Sections/Other.php:129
213
+ msgid "Font Size"
214
+ msgstr ""
215
+
216
+ #: backup/trunk/inc/customizer/sections/section-button.php:200
217
+ #: backup/trunk/inc/customizer/sections/section-fields.php:303
218
+ #: backup/trunk/inc/customizer/sections/section-other.php:139
219
+ #: src/Customizer/Panel/Sections/Button.php:241
220
+ #: src/Customizer/Panel/Sections/Fields.php:326
221
+ #: src/Customizer/Panel/Sections/Other.php:161
222
+ msgid "Text Color"
223
+ msgstr ""
224
+
225
+ #: backup/trunk/inc/customizer/sections/section-button.php:224
226
+ #: backup/trunk/inc/customizer/sections/section-fields.php:255
227
+ #: backup/trunk/inc/customizer/sections/section-form.php:142
228
+ #: src/Customizer/Panel/Sections/Button.php:265
229
+ #: src/Customizer/Panel/Sections/Fields.php:278
230
+ #: src/Customizer/Panel/Sections/Form.php:165
231
+ msgid "Padding"
232
+ msgstr ""
233
+
234
+ #: backup/trunk/inc/customizer/sections/section-button.php:248
235
+ #: backup/trunk/inc/customizer/sections/section-fields.php:119
236
+ #: src/Customizer/Panel/Sections/Button.php:289
237
+ #: src/Customizer/Panel/Sections/Fields.php:142
238
+ msgid "Border Width"
239
+ msgstr ""
240
+
241
+ #: backup/trunk/inc/customizer/sections/section-button.php:280
242
+ #: src/Customizer/Panel/Sections/Button.php:321
243
+ msgid "Border"
244
+ msgstr ""
245
+
246
+ #: backup/trunk/inc/customizer/sections/section-button.php:304
247
+ #: src/Customizer/Panel/Sections/Button.php:345
248
+ msgid "Border (Hover)"
249
+ msgstr ""
250
+
251
+ #: backup/trunk/inc/customizer/sections/section-button.php:328
252
+ #: backup/trunk/inc/customizer/sections/section-form.php:198
253
+ #: src/Customizer/Panel/Sections/Button.php:369
254
+ #: src/Customizer/Panel/Sections/Form.php:221
255
+ msgid "Shadow Spread"
256
+ msgstr ""
257
+
258
+ #: backup/trunk/inc/customizer/sections/section-button.php:360
259
+ #: backup/trunk/inc/customizer/sections/section-form.php:230
260
+ #: src/Customizer/Panel/Sections/Button.php:401
261
+ #: src/Customizer/Panel/Sections/Form.php:253
262
+ msgid "Box Shadow"
263
+ msgstr ""
264
+
265
+ #: backup/trunk/inc/customizer/sections/section-button.php:384
266
+ #: src/Customizer/Panel/Sections/Button.php:425
267
+ msgid "Text Shadow"
268
+ msgstr ""
269
+
270
+ #: backup/trunk/inc/customizer/sections/section-code.php:10
271
+ #: src/Customizer/Panel/Sections/Code.php:30
272
+ msgid "Custom CSS & JavaScript"
273
+ msgstr ""
274
+
275
+ #: backup/trunk/inc/customizer/sections/section-code.php:28
276
+ #: src/Customizer/Panel/Sections/Code.php:48
277
+ msgid "Custom CSS"
278
+ msgstr ""
279
+
280
+ #: backup/trunk/inc/customizer/sections/section-code.php:50
281
+ #: src/Customizer/Panel/Sections/Code.php:70
282
+ msgid "Custom JavaScript"
283
+ msgstr ""
284
+
285
+ #: backup/trunk/inc/customizer/sections/section-fields.php:10
286
+ #: src/Customizer/Panel/Sections/Fields.php:33
287
+ msgid "Fields"
288
+ msgstr ""
289
+
290
+ #: backup/trunk/inc/customizer/sections/section-fields.php:31
291
+ #: src/Customizer/Panel/Sections/Fields.php:54
292
+ msgid "Disable Remember Me?"
293
+ msgstr ""
294
+
295
+ #: backup/trunk/inc/customizer/sections/section-fields.php:151
296
+ #: src/Customizer/Panel/Sections/Fields.php:174
297
+ msgid "Border Color"
298
+ msgstr ""
299
+
300
+ #: backup/trunk/inc/customizer/sections/section-fields.php:175
301
+ #: backup/trunk/inc/customizer/sections/section-form.php:166
302
+ #: src/Customizer/Panel/Sections/Fields.php:198
303
+ #: src/Customizer/Panel/Sections/Form.php:189
304
+ msgid "Radius"
305
+ msgstr ""
306
+
307
+ #: backup/trunk/inc/customizer/sections/section-fields.php:207
308
+ #: src/Customizer/Panel/Sections/Fields.php:230
309
+ msgid "Disable Box Shadow?"
310
+ msgstr ""
311
+
312
+ #: backup/trunk/inc/customizer/sections/section-fields.php:231
313
+ #: src/Customizer/Panel/Sections/Fields.php:254
314
+ msgid "Margin"
315
+ msgstr ""
316
+
317
+ #: backup/trunk/inc/customizer/sections/section-fields.php:327
318
+ #: src/Customizer/Panel/Sections/Fields.php:350
319
+ msgid "Label Color"
320
+ msgstr ""
321
+
322
+ #: backup/trunk/inc/customizer/sections/section-fields.php:351
323
+ #: src/Customizer/Panel/Sections/Fields.php:374
324
+ msgid "Label Font Size"
325
+ msgstr ""
326
+
327
+ #: backup/trunk/inc/customizer/sections/section-form.php:10
328
+ #: src/Customizer/Panel/Sections/Form.php:33
329
+ msgid "Form"
330
+ msgstr ""
331
+
332
+ #: backup/trunk/inc/customizer/sections/section-logo.php:10
333
+ #: backup/trunk/inc/customizer/sections/section-logo.php:54
334
+ #: src/Customizer/Panel/Sections/Logo.php:32
335
+ #: src/Customizer/Panel/Sections/Logo.php:76
336
+ msgid "Logo"
337
+ msgstr ""
338
+
339
+ #: backup/trunk/inc/customizer/sections/section-logo.php:31
340
+ #: src/Customizer/Panel/Sections/Logo.php:53
341
+ msgid "Disable Logo?"
342
+ msgstr ""
343
+
344
+ #: backup/trunk/inc/customizer/sections/section-logo.php:78
345
+ #: src/Customizer/Panel/Sections/Logo.php:100
346
+ msgid "Logo Width"
347
+ msgstr ""
348
+
349
+ #: backup/trunk/inc/customizer/sections/section-logo.php:110
350
+ #: src/Customizer/Panel/Sections/Logo.php:132
351
+ msgid "Logo Height"
352
+ msgstr ""
353
+
354
+ #: backup/trunk/inc/customizer/sections/section-logo.php:142
355
+ #: src/Customizer/Panel/Sections/Logo.php:164
356
+ msgid "Padding Bottom"
357
+ msgstr ""
358
+
359
+ #: backup/trunk/inc/customizer/sections/section-logo.php:171
360
+ #: src/Customizer/Panel/Sections/Logo.php:193
361
+ msgid "Logo URL"
362
+ msgstr ""
363
+
364
+ #: backup/trunk/inc/customizer/sections/section-logo.php:172
365
+ #: src/Customizer/Panel/Sections/Logo.php:194
366
+ msgid "The page where your logo will take you."
367
+ msgstr ""
368
+
369
+ #: backup/trunk/inc/customizer/sections/section-more.php:9
370
+ msgid "More Cool Stuff"
371
+ msgstr ""
372
+
373
+ #: backup/trunk/inc/customizer/sections/section-other.php:10
374
+ #: src/Customizer/Panel/Sections/Other.php:32 src/Includes/Disband.php:221
375
+ msgid "Other"
376
+ msgstr ""
377
+
378
+ #: backup/trunk/inc/customizer/sections/section-other.php:33
379
+ #: src/Customizer/Panel/Sections/Other.php:55
380
+ msgid "Disable Register Link?"
381
+ msgstr ""
382
+
383
+ #: backup/trunk/inc/customizer/sections/section-other.php:59
384
+ #: src/Customizer/Panel/Sections/Other.php:81
385
+ msgid "Disable Lost Password?"
386
+ msgstr ""
387
+
388
+ #: backup/trunk/inc/customizer/sections/section-other.php:83
389
+ #: src/Customizer/Panel/Sections/Other.php:105
390
+ msgid "Disable \"Back to Website\"?"
391
+ msgstr ""
392
+
393
+ #: backup/trunk/inc/customizer/sections/section-other.php:163
394
+ #: src/Customizer/Panel/Sections/Other.php:185
395
+ msgid "Text Color (Hover)"
396
+ msgstr ""
397
+
398
+ #: backup/trunk/inc/customizer/sections/section-templates.php:10
399
+ #: backup/trunk/inc/customizer/sections/section-templates.php:30
400
+ #: src/Customizer/Panel/Sections/Templates.php:34
401
+ #: src/Customizer/Panel/Sections/Templates.php:72
402
+ msgid "Templates"
403
+ msgstr ""
404
+
405
+ #: backup/trunk/inc/include-page-template.php:72
406
+ #: src/Customizer/Include_Page_Template.php:67
407
+ msgid "Login Customizer Template"
408
+ msgstr ""
409
+
410
+ #: backup/trunk/inc/initial-setup.php:93 src/Customizer/Initial_Setup.php:96
411
+ msgid ""
412
+ "This page is used for Login Customizer plugin. It will not be visible to "
413
+ "your readers. Do not delete it."
414
+ msgstr ""
415
+
416
+ #: backup/trunk/inc/template-login-customizer.php:27
417
+ #: src/Customizer/template-login-customizer.php:29
418
+ #, php-format
419
+ msgid "%1$s &lsaquo; %2$s &#8212; WordPress"
420
+ msgstr ""
421
+
422
+ #: backup/trunk/inc/template-login-customizer.php:28
423
+ #: backup/trunk/inc/template-login-customizer.php:87
424
+ #: src/Customizer/template-login-customizer.php:30
425
+ #: src/Customizer/template-login-customizer.php:98
426
+ msgid "Log In"
427
+ msgstr ""
428
+
429
+ #: backup/trunk/inc/template-login-customizer.php:50
430
+ #: src/Customizer/template-login-customizer.php:54
431
+ msgid "https://wordpress.org/"
432
+ msgstr ""
433
+
434
+ #: backup/trunk/inc/template-login-customizer.php:51
435
+ #: src/Customizer/template-login-customizer.php:55
436
+ msgid "Powered by WordPress"
437
+ msgstr ""
438
+
439
+ #: backup/trunk/inc/template-login-customizer.php:77
440
+ #: src/Customizer/Panel/functions.php:136
441
+ #: src/Customizer/template-login-customizer.php:88
442
+ msgid "Username or Email Address"
443
+ msgstr ""
444
+
445
+ #: backup/trunk/inc/template-login-customizer.php:81
446
+ #: src/Customizer/template-login-customizer.php:92
447
+ #: src/Settings/Features/Custom_Register_Password.php:53
448
+ msgid "Password"
449
+ msgstr ""
450
+
451
+ #: backup/trunk/inc/template-login-customizer.php:85
452
+ #: src/Customizer/template-login-customizer.php:96
453
+ msgid "Remember Me"
454
+ msgstr ""
455
+
456
+ #: backup/trunk/inc/template-login-customizer.php:93
457
+ #: src/Customizer/template-login-customizer.php:104
458
+ msgid "Register"
459
+ msgstr ""
460
+
461
+ #: backup/trunk/inc/template-login-customizer.php:99
462
+ #: src/Customizer/template-login-customizer.php:110
463
+ msgid "Lost your password?"
464
+ msgstr ""
465
+
466
+ #. translators: %s: site title
467
+ #: backup/trunk/inc/template-login-customizer.php:105
468
+ #: src/Customizer/template-login-customizer.php:116
469
+ #, php-format
470
+ msgctxt "site"
471
+ msgid "&larr; Back to %s"
472
+ msgstr ""
473
+
474
+ #: src/Customizer/Panel/customizer.php:75
475
+ msgid ""
476
+ "This section allows you to customize the login page of your website. Made "
477
+ "with ❤ by <a target=\"_blank\" rel=\"nofollow\" href=\"https://loginpress."
478
+ "pro/\">Hardeep Asrani</a> team."
479
+ msgstr ""
480
+
481
+ #: src/Customizer/Panel/functions.php:132
482
+ msgid "Username"
483
+ msgstr ""
484
+
485
+ #: src/Customizer/Panel/functions.php:134
486
+ msgid "Email Address"
487
+ msgstr ""
488
+
489
+ #: src/Includes/Disband.php:146
490
+ msgid "Quick feedback about Login Customizer"
491
+ msgstr ""
492
+
493
+ #: src/Includes/Disband.php:149
494
+ msgid "If you have a moment, please let us know why you are deactivating:"
495
+ msgstr ""
496
+
497
+ #: src/Includes/Disband.php:157
498
+ msgid "I upgraded to Login Customizer Pro"
499
+ msgstr ""
500
+
501
+ #: src/Includes/Disband.php:159
502
+ msgid ""
503
+ "No need to deactivate this Login Customizer Core version. Pro version works "
504
+ "as an add-on with Core version."
505
+ msgstr ""
506
+
507
+ #: src/Includes/Disband.php:166
508
+ msgid "I only needed the plugin for a short period"
509
+ msgstr ""
510
+
511
+ #: src/Includes/Disband.php:175
512
+ msgid "I found a better plugin"
513
+ msgstr ""
514
+
515
+ #: src/Includes/Disband.php:178
516
+ msgid "Kindly tell us the Plugin name."
517
+ msgstr ""
518
+
519
+ #: src/Includes/Disband.php:185
520
+ msgid "The plugin broke my site"
521
+ msgstr ""
522
+
523
+ #: src/Includes/Disband.php:194
524
+ msgid "The plugin suddenly stopped working"
525
+ msgstr ""
526
+
527
+ #: src/Includes/Disband.php:203
528
+ msgid "I no longer need the plugin"
529
+ msgstr ""
530
+
531
+ #: src/Includes/Disband.php:212
532
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
533
+ msgstr ""
534
+
535
+ #: src/Includes/Disband.php:224
536
+ msgid "Kindly tell us the reason so we can improve."
537
+ msgstr ""
538
+
539
+ #: src/Includes/Disband.php:229
540
+ msgid "Anonymous feedback"
541
+ msgstr ""
542
+
543
+ #: src/Includes/Disband.php:230
544
+ msgid "Skip & Deactivate"
545
+ msgstr ""
546
+
547
+ #: src/Includes/Disband.php:233
548
+ msgid "Submit & Deactivate"
549
+ msgstr ""
550
+
551
+ #: src/Includes/Disband.php:234
552
+ msgid "Cancel"
553
+ msgstr ""
554
+
555
+ #: src/Includes/Plugin_Meta.php:74
556
+ msgid "Support"
557
+ msgstr ""
558
+
559
+ #: src/Includes/Plugin_Meta.php:76
560
+ msgid "Vote!"
561
+ msgstr ""
562
+
563
+ #: src/Includes/Plugin_Meta.php:79
564
+ msgid "Rate"
565
+ msgstr ""
566
+
567
+ #: src/Includes/Plugin_Meta.php:102
568
+ #, php-format
569
+ msgid "%1$s Customize %2$s"
570
+ msgstr ""
571
+
572
+ #: src/Includes/Plugin_Meta.php:109
573
+ #, php-format
574
+ msgid " | %1$s Settings %2$s "
575
+ msgstr ""
576
+
577
+ #: src/Settings/API.php:398
578
+ msgid "Choose File"
579
+ msgstr ""
580
+
581
+ #: src/Settings/API.php:558
582
+ msgid "Plugin Support"
583
+ msgstr ""
584
+
585
+ #: src/Settings/API.php:561
586
+ msgid "Got a Question, Idea, Problem or Praise?"
587
+ msgstr ""
588
+
589
+ #: src/Settings/API.php:563
590
+ msgid "Support Request"
591
+ msgstr ""
592
+
593
+ #: src/Settings/Features/Custom_Register_Password.php:57
594
+ msgid "Confirm Password"
595
+ msgstr ""
596
+
597
+ #: src/Settings/Features/Custom_Register_Password.php:78
598
+ msgid "<strong>ERROR</strong>: Please enter your password twice."
599
+ msgstr ""
600
+
601
+ #: src/Settings/Features/Custom_Register_Password.php:82
602
+ msgid ""
603
+ "<strong>ERROR</strong>: Please enter the same password in the end password "
604
+ "fields."
605
+ msgstr ""
606
+
607
+ #: src/Settings/Features/Custom_Register_Password.php:135
608
+ msgid ""
609
+ "If you have already set your own password, you may disregard this email and "
610
+ "use the password you have already set."
611
+ msgstr ""
612
+
613
+ #: src/Settings/Features/Login_Order.php:84
614
+ #, php-format
615
+ msgid "%1$sError:%2$s The username field is empty."
616
+ msgstr ""
617
+
618
+ #: src/Settings/Features/Login_Order.php:86
619
+ #, php-format
620
+ msgid "%1$sError:%2$s The password field is empty."
621
+ msgstr ""
622
+
623
+ #: src/Settings/Features/Login_Order.php:107
624
+ #, php-format
625
+ msgid "%1$sError:%2$s Invalid Email Address"
626
+ msgstr ""
627
+
628
+ #: src/Settings/Features/Login_Order.php:130
629
+ #, php-format
630
+ msgid "%1$sError:%2$s Invalid Username."
631
+ msgstr ""
632
+
633
+ #: src/Settings/Setup.php:70 src/Settings/Setup.php:148
634
+ msgid "Settings"
635
+ msgstr ""
636
+
637
+ #: src/Settings/Setup.php:72
638
+ msgid "Customizer"
639
+ msgstr ""
640
+
641
+ #: src/Settings/Setup.php:74
642
+ msgid "Help"
643
+ msgstr ""
644
+
645
+ #: src/Settings/Setup.php:149
646
+ #, php-format
647
+ msgid "Everything else is customizable through %1$sLogin Customizer%2$s."
648
+ msgstr ""
649
+
650
+ #: src/Settings/Setup.php:172
651
+ msgid "Auto Remember Me"
652
+ msgstr ""
653
+
654
+ #: src/Settings/Setup.php:173
655
+ msgid "Keep remember me option always checked on login page"
656
+ msgstr ""
657
+
658
+ #: src/Settings/Setup.php:179
659
+ msgid "Login Order"
660
+ msgstr ""
661
+
662
+ #: src/Settings/Setup.php:180
663
+ msgid "Enable users to login using their username or email address."
664
+ msgstr ""
665
+
666
+ #: src/Settings/Setup.php:184
667
+ msgid "Both Username Or Email Address"
668
+ msgstr ""
669
+
670
+ #: src/Settings/Setup.php:185
671
+ msgid "Only Username"
672
+ msgstr ""
673
+
674
+ #: src/Settings/Setup.php:186
675
+ msgid "Only Email Address"
676
+ msgstr ""
677
+
678
+ #: src/Settings/Setup.php:192
679
+ msgid "Custom Password Fields"
680
+ msgstr ""
681
+
682
+ #: src/Settings/Setup.php:193
683
+ msgid "Enable custom password fields on registration form."
684
+ msgstr ""
685
+
686
+ #: src/Settings/Setup.php:217
687
+ msgid "Login Customizer - Design your boring WordPress Login page"
688
+ msgstr ""
689
+
690
+ #: src/Settings/Setup.php:235
691
+ #, php-format
692
+ msgid "Free plugin support is available on the %1$s plugin support forums%2$s."
693
+ msgstr ""
694
+
695
+ #. Plugin Name of the plugin/theme
696
+ msgid "Custom Login Page Customizer"
697
+ msgstr ""
698
+
699
+ #. Plugin URI of the plugin/theme
700
+ msgid "https://wordpress.org/plugins/login-customizer/"
701
+ msgstr ""
702
+
703
+ #. Description of the plugin/theme
704
+ msgid ""
705
+ "Custom Login Customizer plugin allows you to easily customize your login "
706
+ "page straight from your WordPress Customizer! Awesome, right?"
707
+ msgstr ""
708
+
709
+ #. Author of the plugin/theme
710
+ msgid "Hardeep Asrani"
711
+ msgstr ""
712
+
713
+ #. Author URI of the plugin/theme
714
+ msgid "https://loginpress.pro/"
715
+ msgstr ""
resources/login-customizer-dashicon/icomoon.eot ADDED
Binary file
resources/login-customizer-dashicon/icomoon.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="dashicon-20x20" d="M377.344 745.984c0 73.216 60.416 132.608 134.656 132.608s134.656-59.392 134.656-132.608v-77.824c26.624-9.216 52.224-20.992 76.288-35.328v113.152c0 114.688-94.72 207.872-210.944 207.872s-210.944-93.184-210.944-207.872v-113.152c23.552 14.336 49.152 26.112 76.288 35.328v77.824zM512 633.344c-194.048 0-351.232-154.624-351.232-345.6s157.184-345.6 351.232-345.6 351.232 154.624 351.232 345.6-157.184 345.6-351.232 345.6zM551.936 267.264l-3.584-134.144c-0.512-16.896-16.384-30.208-36.352-30.208s-35.84 13.312-36.352 30.208l-4.096 131.584c-59.904 34.304-18.944 155.136 45.568 170.496-1.536-46.080 64-69.12 64-114.176 0-25.088-12.288-43.008-29.184-53.76z" />
11
+ <glyph unicode="&#xe901;" glyph-name="login-customizer-dashicon" d="M377.344 745.984c0 73.216 60.416 132.608 134.656 132.608s134.656-59.392 134.656-132.608v-77.824c26.624-9.216 52.224-20.992 76.288-35.328v113.152c0 114.688-94.72 207.872-210.944 207.872s-210.944-93.184-210.944-207.872v-113.152c23.552 14.336 49.152 26.112 76.288 35.328v77.824zM512 633.344c-194.048 0-351.232-154.624-351.232-345.6s157.184-345.6 351.232-345.6 351.232 154.624 351.232 345.6-157.184 345.6-351.232 345.6zM551.936 267.264l-3.584-134.144c-0.512-16.896-16.384-30.208-36.352-30.208s-35.84 13.312-36.352 30.208l-4.096 131.584c-59.904 34.304-18.944 155.136 45.568 170.496-1.536-46.080 64-69.12 64-114.176 0-25.088-12.288-43.008-29.184-53.76z" />
12
+ </font></defs></svg>
resources/login-customizer-dashicon/icomoon.ttf ADDED
Binary file
resources/login-customizer-dashicon/icomoon.woff ADDED
Binary file
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
src/Customizer/Create_Customizer.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Essential things for Plugin
4
+ *
5
+ * Defines the plugin constants.
6
+ *
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ */
12
+
13
+ namespace LoginCustomizer\Customizer;
14
+
15
+ /**
16
+ * Constant class.
17
+ *
18
+ * @since 2.2.0
19
+ * @version 2.2.0
20
+ * @access public
21
+ */
22
+
23
+ class Create_Customizer {
24
+
25
+
26
+ public function __construct() {
27
+
28
+
29
+ }
30
+
31
+ public function customizer_settings_creation() {
32
+
33
+ require_once( plugin_dir_path( __FILE__ ) . 'Setup.php' );
34
+ require_once( plugin_dir_path( __FILE__ ) . 'Include_Page_Template.php' );
35
+ require_once( plugin_dir_path( __FILE__ ) . 'Panel/customizer.php' );
36
+ }
37
+ }
src/Customizer/Customizer_Enqueue.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Enqeueue Scripts and Styles for Plugin
6
+ *
7
+ * Defines the plugin constants.
8
+ *
9
+ * @author WPBrigade
10
+ * @copyright Copyright (c) 2021, WPBrigade
11
+ * @link https://loginpress.pro/
12
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13
+ */
14
+
15
+ namespace LoginCustomizer\Customizer;
16
+
17
+ /**
18
+ * Class to enqueue CSS and JS for Pro-templates.
19
+ *
20
+ * @since 2.2.0
21
+ * @access public
22
+ */
23
+
24
+ class Customizer_Enqueue {
25
+
26
+ /**
27
+ * Enqueue script to Customizer
28
+ */
29
+ function logincust_customizer_script() {
30
+ add_action( 'customize_controls_print_scripts',array( $this, 'Enqueue_js_script' ) );
31
+
32
+ }
33
+
34
+ public function Enqueue_js_script(){
35
+
36
+ // Enqueue script to Customizer
37
+ wp_enqueue_script( 'logincust_controls_free_js', LOGINCUST_FREE_URL . '/Templates/js/customizer.js', array( 'jquery' ), null, true );
38
+
39
+ // Generate the redirect url.
40
+ $options = get_option( 'login_customizer_settings', array() );
41
+
42
+ $localize = array(
43
+ 'page' => get_permalink( $options['page'] ),
44
+ 'url' => LOGINCUST_FREE_URL,
45
+ );
46
+
47
+ // Localize Script
48
+ wp_localize_script( 'logincust_controls_free_js', 'logincust_free', $localize );
49
+ }
50
+
51
+ }
inc/include-page-template.php → src/Customizer/Include_Page_Template.php RENAMED
@@ -1,8 +1,16 @@
1
  <?php
2
  /**
3
- * Including Login template as a page template.
4
- * This library was adapted from https://www.wpexplorer.com/wordpress-page-templates-plugin/
5
- */
 
 
 
 
 
 
 
 
6
  class LoginCustomizerTemplate {
7
 
8
  /**
@@ -39,38 +47,24 @@ class LoginCustomizerTemplate {
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',
52
- array( $this, 'add_new_template' )
53
- );
54
 
55
  }
56
 
57
  // Add a filter to the save post to inject out template into the page cache
58
- add_filter(
59
- 'wp_insert_post_data',
60
- array( $this, 'register_project_templates' )
61
- );
62
 
63
  // Add a filter to the template include to determine if the page has our
64
  // template assigned and return it's path
65
- add_filter(
66
- 'template_include',
67
- array( $this, 'view_project_template')
68
- );
69
 
70
  // Add your templates to this array.
71
- $this->templates = array(
72
- 'template-login-customizer.php' => __( 'Login Customizer Template', 'login-customizer' ),
73
- );
74
 
75
  }
76
 
@@ -128,20 +122,11 @@ class LoginCustomizerTemplate {
128
 
129
  // Return default template if we don't have a custom one defined
130
  if ( ! isset(
131
- $this->templates[ get_post_meta(
132
- $post->ID,
133
- '_wp_page_template',
134
- true
135
- ) ]
136
- ) ) {
137
  return $template;
138
  }
139
 
140
- $file = plugin_dir_path( __FILE__ ) . get_post_meta(
141
- $post->ID,
142
- '_wp_page_template',
143
- true
144
- );
145
 
146
  // Just to be safe, we check if the file exist first
147
  if ( file_exists( $file ) ) {
1
  <?php
2
  /**
3
+ * Including Login template as a page template.
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
  class LoginCustomizerTemplate {
15
 
16
  /**
47
  if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
48
 
49
  // 4.6 and older
50
+ add_filter( 'page_attributes_dropdown_pages_args', array( $this, 'register_project_templates' ) );
 
 
 
51
 
52
  } else {
53
 
54
  // Add a filter to the wp 4.7 version attributes metabox
55
+ add_filter( 'theme_page_templates', array( $this, 'add_new_template' ) );
 
 
 
56
 
57
  }
58
 
59
  // Add a filter to the save post to inject out template into the page cache
60
+ add_filter( 'wp_insert_post_data', array( $this, 'register_project_templates' ) );
 
 
 
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( 'template_include', array( $this, 'view_project_template') );
 
 
 
65
 
66
  // Add your templates to this array.
67
+ $this->templates = array( 'template-login-customizer.php' => __( 'Login Customizer Template', 'login-customizer' ), );
 
 
68
 
69
  }
70
 
122
 
123
  // Return default template if we don't have a custom one defined
124
  if ( ! isset(
125
+ $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {
 
 
 
 
 
126
  return $template;
127
  }
128
 
129
+ $file = plugin_dir_path( __FILE__ ) . get_post_meta( $post->ID, '_wp_page_template', true );
 
 
 
 
130
 
131
  // Just to be safe, we check if the file exist first
132
  if ( file_exists( $file ) ) {
inc/initial-setup.php → src/Customizer/Initial_Setup.php RENAMED
@@ -2,6 +2,10 @@
2
  /**
3
  * Automatically create a login page for the Customizer to use.
4
  */
 
 
 
 
5
  class LoginCustomizerSetup {
6
 
7
  /**
@@ -45,7 +49,6 @@ class LoginCustomizerSetup {
45
  } else {
46
  $this->setup_page( 'login-customizer' );
47
  }
48
-
49
  }
50
 
51
  /**
@@ -114,7 +117,7 @@ class LoginCustomizerSetup {
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
 
2
  /**
3
  * Automatically create a login page for the Customizer to use.
4
  */
5
+
6
+ use LoginCustomizer\Essentials;
7
+ new Essentials;
8
+
9
  class LoginCustomizerSetup {
10
 
11
  /**
49
  } else {
50
  $this->setup_page( 'login-customizer' );
51
  }
 
52
  }
53
 
54
  /**
117
  if ( get_option( 'login_customizer_settings' ) !== false ) {
118
  $options = get_option( 'login_customizer_settings', array() );
119
  $options['page'] = $page_id;
120
+ $options['version'] = LOGINCUST_FREE_VERSION;
121
  update_option( 'login_customizer_settings', $options );
122
  }
123
 
{inc/customizer/css → src/Customizer/Panel/Assets/CSS}/customizer.css RENAMED
File without changes
{inc/customizer/js → src/Customizer/Panel/Assets/JS}/customizer-preview.js RENAMED
@@ -5,10 +5,9 @@
5
 
6
  /*
7
  * Switch to the /login-customizer/ page, where we can live-preview Customizer options.
8
- * Source: Login Designer
9
- */
10
  wp.customize.preview.bind('logincust-url-switcher', function (data) {
11
- // When the section is expanded, open the login designer page.
12
  if (true === data.expanded) {
13
  wp.customize.preview.send('url', logincust_script.page);
14
  }
@@ -200,7 +199,6 @@
200
 
201
  wp.customize('login_customizer_options[logincust_logo_link]', function (value) {
202
  value.bind(function (newval) {
203
- console.log(newval);
204
  $("#customize-preview iframe")
205
  .contents()
206
  .find("body.login div#login h1 a").prop({'href' : 'url(' + newval.toString() + ')'});
5
 
6
  /*
7
  * Switch to the /login-customizer/ page, where we can live-preview Customizer options.
8
+ */
 
9
  wp.customize.preview.bind('logincust-url-switcher', function (data) {
10
+ // When the section is expanded, open the Login Customizer page.
11
  if (true === data.expanded) {
12
  wp.customize.preview.send('url', logincust_script.page);
13
  }
199
 
200
  wp.customize('login_customizer_options[logincust_logo_link]', function (value) {
201
  value.bind(function (newval) {
 
202
  $("#customize-preview iframe")
203
  .contents()
204
  .find("body.login div#login h1 a").prop({'href' : 'url(' + newval.toString() + ')'});
{inc/customizer/js → src/Customizer/Panel/Assets/JS}/customizer.js RENAMED
@@ -2,7 +2,7 @@
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://loginpress.pro/" target="_blank">Hardeep Asrani</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();
@@ -41,7 +41,6 @@ jQuery( document ).ready( function( $ ) {
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 ) {
@@ -49,7 +48,7 @@ jQuery( document ).ready( function( $ ) {
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
 
@@ -58,7 +57,7 @@ jQuery( document ).ready( function( $ ) {
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
  });
@@ -299,7 +298,7 @@ wp.customize( 'login_customizer_options[logincust_templates_control]', function(
299
  } else if ( value === 'material' ) {
300
  resetOptions( allOptions, allValues );
301
  changeValue( 'login_customizer_options[logincust_bg_color]', '#006eb7' );
302
- changeValue( 'login_customizer_options[logincust_logo]', logincust_script.url + 'assets/logo.png' );
303
  changeValue( 'login_customizer_options[logincust_form_radius]', '10px' );
304
  changeValue( 'login_customizer_options[logincust_form_shadow_spread]', '50px' );
305
  changeValue( 'login_customizer_options[logincust_form_shadow]', 'rgba(2,2,2,0.3)' );
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://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=customizer" target="_blank">Hardeep Asrani</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();
41
 
42
  /*
43
  * Detect when the Login Customizer panel is expanded (or closed) so we can preview the login form easily.
 
44
  */
45
  wp.customize.panel( 'logincust_panel', function( section ) {
46
  section.expanded.bind( function( isExpanding ) {
48
  // Value of isExpanding will = true if you're entering the section, false if you're leaving it.
49
  if ( isExpanding ) {
50
 
51
+ // Only send the previewer to the login Customizer page, if we're not already on it.
52
  var current_url = wp.customize.previewer.previewUrl();
53
  current_url = current_url.includes( logincust_script.page );
54
 
57
  }
58
 
59
  } else {
60
+ // Head back to the home page, if we leave the Login ustomizer panel.
61
  wp.customize.previewer.send( 'logincust-back-to-home', { home_url: wp.customize.settings.url.home } );
62
  }
63
  });
298
  } else if ( value === 'material' ) {
299
  resetOptions( allOptions, allValues );
300
  changeValue( 'login_customizer_options[logincust_bg_color]', '#006eb7' );
301
+ changeValue( 'login_customizer_options[logincust_logo]', logincust_script.url + 'Customizer/Templates/Material/assets/logo.png' );
302
  changeValue( 'login_customizer_options[logincust_form_radius]', '10px' );
303
  changeValue( 'login_customizer_options[logincust_form_shadow_spread]', '50px' );
304
  changeValue( 'login_customizer_options[logincust_form_shadow]', 'rgba(2,2,2,0.3)' );
src/Customizer/Panel/Controls/Alpha.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 <https://www.gnu.org/licenses/>.
21
+ */
22
+
23
+ namespace LoginCustomizer\Customizer\Panel\Controls;
24
+
25
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
26
+
27
+ /**
28
+ * Alpha Color Control Class for Customizer
29
+ * @author Hardeep Asrani
30
+ * @version 2.2.0
31
+ */
32
+
33
+ class Alpha extends \WP_Customize_Control {
34
+
35
+ public $type = 'alphacolor';
36
+ public $palette = true;
37
+ public $default = array();
38
+
39
+ public function to_json() {
40
+ if ( ! empty( $this->setting->default ) ) {
41
+ $this->json['default'] = $this->setting->default;
42
+ } else {
43
+ $this->json['default'] = false;
44
+ }
45
+ parent::to_json();
46
+ }
47
+
48
+ /**
49
+ * Function to Enqueue styling and scripts
50
+ *
51
+ * @return void
52
+ */
53
+ public function enqueue() {
54
+ wp_enqueue_script( 'logincust-alpha', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/JS/alpha-control.js', array( 'jquery' ), null, true );
55
+ wp_enqueue_style( 'logincust-alpha', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/CSS/alpha_control.css' );
56
+ }
57
+
58
+ public function render_content() { ?>
59
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
60
+ <span class="customize-control-description"><?php echo esc_html( $this->description ); ?></span>
61
+ <label>
62
+ <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(); ?> />
63
+ </label>
64
+ <?php
65
+ }
66
+ }
67
+
inc/customizer/controls/alpha/assets/css/alpha-control.css → src/Customizer/Panel/Controls/Assets/CSS/alpha_control.css RENAMED
@@ -4,7 +4,7 @@
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
 
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
 
{inc/customizer/controls/padding/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/padding-control.css RENAMED
File without changes
{inc/customizer/controls/radio-images/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/radio-images-control.css RENAMED
File without changes
{inc/customizer/controls/range-slider/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/range-slider-control.css RENAMED
File without changes
{inc/customizer/controls/toggle/assets/css → src/Customizer/Panel/Controls/Assets/CSS}/toggle-control.css RENAMED
File without changes
{inc/customizer/controls/alpha/assets/js → src/Customizer/Panel/Controls/Assets/JS}/alpha-control.js RENAMED
File without changes
{inc/customizer/controls/padding/assets/js → src/Customizer/Panel/Controls/Assets/JS}/padding-control.js RENAMED
File without changes
{inc/customizer/controls/range-slider/assets/js → src/Customizer/Panel/Controls/Assets/JS}/range-slider-control.js RENAMED
File without changes
{inc/customizer/controls/toggle/assets/js → src/Customizer/Panel/Controls/Assets/JS}/toggle-control.js RENAMED
File without changes
{inc/customizer/controls/alpha/assets → src/Customizer/Panel/Controls/Assets}/img/transparency-grid.png RENAMED
File without changes
src/Customizer/Panel/Controls/Padding.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Padding Control in Customizer
4
+ *
5
+ *
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+ namespace LoginCustomizer\Customizer\Panel\Controls;
12
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
13
+
14
+ /**
15
+ * Padding Control Class
16
+ */
17
+ class Padding extends \WP_Customize_Control {
18
+
19
+ public $type = 'logincust-padding';
20
+
21
+ public function enqueue() {
22
+ wp_enqueue_script( 'logincust-padding', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/JS/padding-control.js', '', '', true );
23
+ wp_enqueue_style( 'logincust-padding', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/CSS/padding-control.css' );
24
+ }
25
+
26
+ public function render_content() { ?>
27
+ <label>
28
+ <div id="<?php echo esc_attr( $this->id ); ?>">
29
+ <?php if ( ! empty( $this->label ) ) : ?>
30
+ <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
31
+ <?php endif; ?>
32
+ <?php if ( ! empty( $this->description ) ) : ?>
33
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
34
+ <?php endif; ?>
35
+ <div class="field-area">
36
+ <div class="field-icon"><i class="dashicons dashicons-arrow-up"></i><?php _e( 'Top', 'login-customizer' ); ?></div>
37
+ <input type="number" value="10" min="0" max="1000" />
38
+ <div class="field-icon"><i class="dashicons dashicons-arrow-right"></i><?php _e( 'Right', 'login-customizer' ); ?></div>
39
+ <input type="number" value="10" min="0" max="1000" />
40
+ </div>
41
+ <div class="field-area">
42
+ <div class="field-icon"><i class="dashicons dashicons-arrow-down"></i><?php _e( 'Down', 'login-customizer' ); ?></div>
43
+ <input type="number" value="10" min="0" max="1000" />
44
+ <div class="field-icon"><i class="dashicons dashicons-arrow-left"></i><?php _e( 'Left', 'login-customizer' ); ?></div>
45
+ <input type="number" value="10" min="0" max="1000" />
46
+ </div>
47
+ <input type="text" value="<?php echo esc_html( $this->value() ); ?>" <?php $this->link(); ?> />
48
+ </div>
49
+ </label>
50
+ <?php
51
+ }
52
+
53
+ }
src/Customizer/Panel/Controls/Radio_Images.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 <https://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Radio Images
24
+ * @since 0.1
25
+ */
26
+ namespace LoginCustomizer\Customizer\Panel\Controls;
27
+
28
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
29
+
30
+ class Radio_Images extends \WP_Customize_Control {
31
+
32
+ public $type = 'o2-radio-images';
33
+
34
+ public function enqueue() {
35
+ wp_enqueue_style( 'o2-radio-images', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/CSS/radio-images-control.css' );
36
+ }
37
+
38
+ public function render_content() { ?>
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
+ }
src/Customizer/Panel/Controls/Range_Slider.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 <https://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Range Slider
24
+ * @since 0.1
25
+ */
26
+ namespace LoginCustomizer\Customizer\Panel\Controls;
27
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
28
+
29
+ class Range_Slider 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 . 'Customizer/Panel/Controls/Assets/JS/range-slider-control.js', array( 'jquery' ), '', true );
56
+ wp_enqueue_style( 'o2-range-slider', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/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
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
77
+ <?php endif; ?>
78
+ <div id="<?php echo esc_attr( $this->id ); ?>">
79
+ <div class="o2-range-slider">
80
+ <input class="o2-range-slider-range" type="range" value="<?php echo intval( $this->value() ); ?>" <?php $this->input_attrs(); ?> />
81
+ <input class="o2-range-slider-value" type="number" value="<?php echo intval( $this->value() ); ?>" <?php $this->input_attrs(); ?> />
82
+ <?php if ( ! empty( $this->setting->default ) ) : ?>
83
+ <span class="o2-range-reset-slider" title="<?php _e( 'Reset', 'login-customizer' ); ?>"><span class="dashicons dashicons-image-rotate"></span></span>
84
+ <?php endif; ?>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ <?php
89
+ }
90
+
91
+ }
src/Customizer/Panel/Controls/Toggle.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 <https://www.gnu.org/licenses/>.
21
+ *
22
+ * @package O2 Customizer Library
23
+ * @subpackage Toggle
24
+ * @since 0.1
25
+ */
26
+
27
+ namespace LoginCustomizer\Customizer\Panel\Controls;
28
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
29
+
30
+ class Toggle extends \WP_Customize_Control {
31
+
32
+ public $type = 'o2-toggle';
33
+
34
+ public function enqueue() {
35
+ wp_enqueue_script( 'o2-toggle', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/JS/toggle-control.js', '', '', true );
36
+ wp_enqueue_style( 'o2-toggle', LOGINCUST_FREE_URL . 'Customizer/Panel/Controls/Assets/CSS/toggle-control.css' );
37
+ }
38
+
39
+ public function render_content() { ?>
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
+ <button type="button" class="o2-btn-toggle" for="<?php echo esc_attr( $this->id ); ?>">
51
+ <div class="handle"></div>
52
+ </button>
53
+ <?php if ( ! empty( $this->description ) ) : ?>
54
+ <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
55
+ <?php endif; ?>
56
+ </div>
57
+ </label>
58
+ <?php
59
+ }
60
+
61
+ }
src/Customizer/Panel/Custom_Code.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom CSS & JS output to customize login page.
4
+ *
5
+ *
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+
12
+ namespace LoginCustomizer\Customizer\Panel;
13
+
14
+ class Custom_Code {
15
+
16
+ function __construct() {
17
+ add_action( 'login_enqueue_scripts', array( $this, 'logincust_render_styles' ) );
18
+ add_action( 'login_footer', array( $this, 'logincust_render_script' ) );
19
+ }
20
+
21
+ function logincust_render_styles() {
22
+ // Enqueue stylesheet for login styles
23
+ wp_enqueue_style( 'logincust_styles', LOGINCUST_FREE_URL . 'Customizer/Panel/Assets/CSS/customizer.css' );
24
+
25
+ // Get plugin options array
26
+ $options = get_option( 'login_customizer_options' );
27
+
28
+ // Initialize empty string
29
+ $custom_css = '';
30
+
31
+ // Login Page Background CSS
32
+ $custom_css .= 'body.login {';
33
+ if ( ! empty( $options['logincust_bg_image'] ) ) {
34
+ $custom_css .= 'background-image: url(" ' . $options['logincust_bg_image'] . ' ");';
35
+ }
36
+ if ( ! empty( $options['logincust_bg_color'] ) ) {
37
+ $custom_css .= 'background-color: ' . $options['logincust_bg_color'] . ';';
38
+ }
39
+ if ( ! empty( $options['logincust_bg_image_size'] ) ) {
40
+ if ( $options['logincust_bg_image_size'] === 'custom' ) {
41
+ $custom_css .= 'background-size: ' . $options['logincust_bg_size'] . ';';
42
+ } else {
43
+ $custom_css .= 'background-size: ' . $options['logincust_bg_image_size'] . ';';
44
+ }
45
+ }
46
+ if ( ! empty( $options['logincust_bg_image_repeat'] ) ) {
47
+ $custom_css .= 'background-repeat: ' . $options['logincust_bg_image_repeat'] . ';';
48
+ }
49
+ if ( ! empty( $options['logincust_bg_image_position_x'] ) && ! empty( $options['logincust_bg_image_position_y'] ) ) {
50
+ $custom_css .= 'background-position: ' . $options['logincust_bg_image_position_x'] . ' ' . $options['logincust_bg_image_position_y'] . ';';
51
+ }
52
+ $custom_css .= '}';
53
+
54
+ // Login Page Logo CSS
55
+ $custom_css .= 'body.login div#login h1 a {';
56
+ if ( ! empty( $options['logincust_logo_show'] ) && $options['logincust_logo_show'] === 1 ) {
57
+ $custom_css .= 'display: none;';
58
+ } else {
59
+ if ( ! empty( $options['logincust_logo'] ) ) {
60
+ $custom_css .= 'background-image: url(" ' . $options['logincust_logo'] . ' ");';
61
+ }
62
+ if ( ! empty( $options['logincust_logo_width'] ) ) {
63
+ $custom_css .= 'width: ' . $options['logincust_logo_width'] . ';';
64
+ }
65
+ if ( ! empty( $options['logincust_logo_height'] ) ) {
66
+ $custom_css .= 'height: ' . $options['logincust_logo_height'] . ';';
67
+ }
68
+ if ( ! empty( $options['logincust_logo_width'] ) || ! empty( $options['logincust_logo_height'] ) ) {
69
+ $custom_css .= 'background-size: ' . $options['logincust_logo_width'] . ' ' . $options['logincust_logo_height'] . ';';
70
+ }
71
+ if ( ! empty( $options['logincust_logo_padding'] ) ) {
72
+ $custom_css .= 'padding-bottom: ' . $options['logincust_logo_padding'] . ';';
73
+ }
74
+ }
75
+ $custom_css .= '}';
76
+
77
+ // Login Page Form CSS
78
+ $custom_css .= '#login form#loginform, #login form#registerform, #login form#lostpasswordform {';
79
+ if ( ! empty( $options['logincust_form_bg_image'] ) ) {
80
+ $custom_css .= 'background-image: url(" ' . $options['logincust_form_bg_image'] . ' ");';
81
+ }
82
+ if ( ! empty( $options['logincust_form_bg_color'] ) ) {
83
+ $custom_css .= 'background-color: ' . $options['logincust_form_bg_color'] . ';';
84
+ }
85
+ if ( ! empty( $options['logincust_form_height'] ) ) {
86
+ $custom_css .= 'height: ' . $options['logincust_form_height'] . ';';
87
+ }
88
+ if ( ! empty( $options['logincust_form_padding'] ) ) {
89
+ $custom_css .= 'padding: ' . $options['logincust_form_padding'] . ';';
90
+ }
91
+ if ( ! empty( $options['logincust_form_radius'] ) ) {
92
+ $custom_css .= 'border-radius: ' . $options['logincust_form_radius'] . ';';
93
+ }
94
+ if ( ! empty( $options['logincust_form_shadow_spread'] ) && ! empty( $options['logincust_form_shadow'] ) ) {
95
+ $custom_css .= 'box-shadow: 0 1px ' . $options['logincust_form_shadow_spread'] . ' ' . $options['logincust_form_shadow'] . ';';
96
+ }
97
+ $custom_css .= '}';
98
+
99
+ // Login Form Width CSS
100
+ if ( ! empty( $options['logincust_form_width'] ) ) {
101
+ $custom_css .= 'div#login {';
102
+ $custom_css .= 'width: ' . $options['logincust_form_width'] . ';';
103
+ $custom_css .= '}';
104
+ }
105
+
106
+ // Rememer Me Link CSS
107
+ if ( ! empty( $options['logincust_field_remember_me'] ) && $options['logincust_field_remember_me'] === 1 ) {
108
+ $custom_css .= '#login form .forgetmenot {';
109
+ $custom_css .= 'display: none;';
110
+ $custom_css .= '}';
111
+ }
112
+
113
+ // Register Link CSS
114
+ if ( is_customize_preview() ) {
115
+ if ( ! empty( $options['logincust_field_register_link'] ) && $options['logincust_field_register_link'] === 1 ) {
116
+ $custom_css .= '#login #nav a:first-child {';
117
+ $custom_css .= 'display: none;';
118
+ $custom_css .= '}';
119
+ }
120
+ }
121
+
122
+ // Lost Password Link CSS
123
+ if ( ! empty( $options['logincust_field_lost_password'] ) && $options['logincust_field_lost_password'] === 1 ) {
124
+ $custom_css .= '#login #nav a:last-child {';
125
+ $custom_css .= 'display: none;';
126
+ $custom_css .= '}';
127
+ }
128
+
129
+ // Login Page Fields CSS
130
+ $custom_css .= '#login form#loginform .input, #login form#registerform .input, #login form#lostpasswordform .input {';
131
+ if ( ! empty( $options['logincust_field_width'] ) ) {
132
+ $custom_css .= 'width: ' . $options['logincust_field_width'] . ';';
133
+ }
134
+ if ( ! empty( $options['logincust_field_font_size'] ) ) {
135
+ $custom_css .= 'font-size: ' . $options['logincust_field_font_size'] . ';';
136
+ }
137
+ if ( ! empty( $options['logincust_field_border_width'] ) ) {
138
+ $custom_css .= 'border-width: ' . $options['logincust_field_border_width'] . ';';
139
+ }
140
+ if ( ! empty( $options['logincust_field_border_color'] ) ) {
141
+ $custom_css .= 'border-color: ' . $options['logincust_field_border_color'] . ';';
142
+ }
143
+ if ( ! empty( $options['logincust_field_radius'] ) ) {
144
+ $custom_css .= 'border-radius: ' . $options['logincust_field_radius'] . ';';
145
+ }
146
+ if ( ! empty( $options['logincust_field_box_shadow'] ) && $options['logincust_field_box_shadow'] === 1 ) {
147
+ $custom_css .= 'box-shadow: unset;';
148
+ }
149
+ if ( ! empty( $options['logincust_field_margin'] ) ) {
150
+ $custom_css .= 'margin: ' . $options['logincust_field_margin'] . ';';
151
+ }
152
+ if ( ! empty( $options['logincust_field_padding'] ) ) {
153
+ $custom_css .= 'padding: ' . $options['logincust_field_padding'] . ';';
154
+ }
155
+ if ( ! empty( $options['logincust_field_bg'] ) ) {
156
+ $custom_css .= 'background-color: ' . $options['logincust_field_bg'] . ';';
157
+ }
158
+ if ( ! empty( $options['logincust_field_color'] ) ) {
159
+ $custom_css .= 'color: ' . $options['logincust_field_color'] . ';';
160
+ }
161
+ $custom_css .= '}';
162
+
163
+ // Login Form Labels CSS
164
+ $custom_css .= '#login form#loginform label, #login form#registerform label, #login form#lostpasswordform label {';
165
+ if ( ! empty( $options['logincust_field_label'] ) ) {
166
+ $custom_css .= 'color: ' . $options['logincust_field_label'] . ';';
167
+ }
168
+ if ( ! empty( $options['logincust_field_label_font_size'] ) ) {
169
+ $custom_css .= 'font-size: ' . $options['logincust_field_label_font_size'] . ';';
170
+ }
171
+ $custom_css .= '}';
172
+ $custom_css .= '#login form#loginform .forgetmenot label, #login form#registerform .forgetmenot label, #login form#lostpasswordform .forgetmenot label {';
173
+ if ( ! empty( $options['logincust_field_label_font_size'] ) ) {
174
+ $custom_css .= 'font-size: ' . ( intval( $options['logincust_field_label_font_size'] ) - 2 ) . 'px;';
175
+ }
176
+ $custom_css .= '}';
177
+
178
+ // Login Button CSS
179
+ $custom_css .= '#login form .submit .button {';
180
+ $custom_css .= 'height: auto;';
181
+ if ( ! empty( $options['logincust_button_bg'] ) ) {
182
+ $custom_css .= 'background-color: ' . $options['logincust_button_bg'] . ';';
183
+ }
184
+ if ( ! empty( $options['logincust_button_font_size'] ) ) {
185
+ $custom_css .= 'font-size: ' . $options['logincust_button_font_size'] . ';';
186
+ }
187
+ if ( ! empty( $options['logincust_button_height_width'] ) && $options['logincust_button_height_width'] === 'custom' ) {
188
+ if ( ! empty( $options['logincust_button_width_size'] ) ) {
189
+ $custom_css .= 'width: ' . $options['logincust_button_width_size'] . ';';
190
+ }
191
+ if ( ! empty( $options['logincust_button_height_size'] ) ) {
192
+ $custom_css .= 'height: ' . $options['logincust_button_height_size'] . ';';
193
+ }
194
+ }
195
+ if ( ! empty( $options['logincust_button_color'] ) ) {
196
+ $custom_css .= 'color: ' . $options['logincust_button_color'] . ';';
197
+ }
198
+ if ( ! empty( $options['logincust_button_padding'] ) ) {
199
+ $custom_css .= 'padding: ' . $options['logincust_button_padding'] . ';';
200
+ }
201
+ if ( ! empty( $options['logincust_button_border_width'] ) ) {
202
+ $custom_css .= 'border-width: ' . $options['logincust_button_border_width'] . ';';
203
+ }
204
+ if ( ! empty( $options['logincust_button_border_radius'] ) ) {
205
+ $custom_css .= 'border-radius: ' . $options['logincust_button_border_radius'] . ';';
206
+ }
207
+ if ( ! empty( $options['logincust_button_border'] ) ) {
208
+ $custom_css .= 'border-color: ' . $options['logincust_button_border'] . ';';
209
+ }
210
+ if ( ! empty( $options['logincust_button_shadow'] ) && ! empty( $options['logincust_button_shadow_spread'] ) ) {
211
+ $custom_css .= 'box-shadow: 0px 1px ' . $options['logincust_button_shadow_spread'] . ' ' . $options['logincust_button_shadow'] . ';';
212
+ }
213
+ if ( ! empty( $options['logincust_button_text_shadow'] ) ) {
214
+ $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'] . ';';
215
+ }
216
+ $custom_css .= '}';
217
+
218
+ // Login Button on Hover CSS
219
+ $custom_css .= '#login form .submit .button:hover, #login form .submit .button:focus {';
220
+ if ( ! empty( $options['logincust_button_hover_bg'] ) ) {
221
+ $custom_css .= 'background-color: ' . $options['logincust_button_hover_bg'] . ';';
222
+ }
223
+ if ( ! empty( $options['logincust_button_hover_border'] ) ) {
224
+ $custom_css .= 'border-color: ' . $options['logincust_button_hover_border'] . ';';
225
+ }
226
+ $custom_css .= '}';
227
+
228
+ // Other Styling
229
+ if ( ! empty( $options['logincust_field_back_blog'] ) && $options['logincust_field_back_blog'] === 1 ) {
230
+ $custom_css .= '#login #backtoblog {';
231
+ $custom_css .= 'display: none;';
232
+ $custom_css .= '}';
233
+ }
234
+ if ( ! empty( $options['logincust_other_font_size'] ) ) {
235
+ $custom_css .= '.login #nav, .login #nav a, .login #backtoblog a {';
236
+ $custom_css .= 'font-size: ' . $options['logincust_other_font_size'] . ';';
237
+ $custom_css .= '}';
238
+ }
239
+ if ( ! empty( $options['logincust_other_color'] ) ) {
240
+ $custom_css .= '.login #nav, .login #nav a, .login #backtoblog a {';
241
+ $custom_css .= 'color: ' . $options['logincust_other_color'] . ';';
242
+ $custom_css .= '}';
243
+ }
244
+ if ( ! empty( $options['logincust_other_color_hover'] ) ) {
245
+ $custom_css .= '.login #backtoblog a:hover, .login #nav a:hover {';
246
+ $custom_css .= 'color: ' . $options['logincust_other_color_hover'] . ';';
247
+ $custom_css .= '}';
248
+ }
249
+
250
+ // Custom CSS
251
+ if ( ! empty( $options['logincust_other_css'] ) ) {
252
+ $custom_css .= $options['logincust_other_css'];
253
+ }
254
+
255
+ // Hook inline styles to stylesheet
256
+ wp_add_inline_style( 'logincust_styles', $custom_css );
257
+
258
+ }
259
+
260
+ // Hook stylesheet to login page
261
+
262
+ function logincust_render_script() {
263
+ // Get plugin options array
264
+ $options = get_option( 'login_customizer_options' );
265
+ if ( ! empty( $options['logincust_other_js'] ) ) {
266
+ echo '<script>' . "\n" . $options['logincust_other_js'] . "\n" . '</script>' . "\n";
267
+ }
268
+ }
269
+ }
270
+
271
+
272
+ // Hook script to login page
src/Customizer/Panel/Functions.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main File which is customized and changes make to a.k.a the login page
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ *
11
+ */
12
+ namespace LoginCustomizer\Customizer\Panel;
13
+
14
+ class Functions {
15
+
16
+ function __construct() {
17
+
18
+ // Get plugin options array
19
+ $options = get_option( 'login_customizer_options' );
20
+
21
+ if( !is_customize_preview() ) {
22
+
23
+ $logincust_setting = get_option( 'logincust_setting' );
24
+ $is_auto_remeber_on = isset( $logincust_setting['auto_remember_me'] ) ? $logincust_setting['auto_remember_me'] : 'off';
25
+
26
+ if ( 'off' != $is_auto_remeber_on ) {
27
+ add_filter( 'login_footer', array( $this, 'logincust_always_checked_rememberme' ) );
28
+ }
29
+ add_filter( 'gettext', array( $this, 'change_username_label'), 20, 3 );
30
+ }
31
+ add_action( 'login_head', array( $this, 'login_page_custom_head' ) );
32
+
33
+
34
+ // Hook to login_headerurl
35
+ if ( ! empty( $options['logincust_logo_link'] ) ) {
36
+ add_filter( 'login_headerurl', array( $this, 'logincust_login_logo_url' ), 99 );
37
+ }
38
+
39
+
40
+ /**
41
+ * Compare WP version: login_headertitle was deprecated in WordPress 5.2
42
+ *
43
+ * @since 2.1.0
44
+ *
45
+ **/
46
+ if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
47
+ add_filter( 'login_headertitle', array( $this, 'logincust_login_logo_url_title' ) );
48
+ } else {
49
+ add_filter( 'login_headertext', array( $this, 'logincust_login_logo_url_title' ) );
50
+ }
51
+
52
+
53
+ // Hook to register and login_link_separator
54
+ if ( ! is_customize_preview() ) {
55
+
56
+ if ( ! empty( $options['logincust_field_register_link'] ) && $options['logincust_field_register_link'] === 1 ) {
57
+ add_filter( 'register', array( $this, 'logincust_no_register_link' ) );
58
+ add_filter( 'login_link_separator', array( $this, 'logincust_no_register_link' ) );
59
+ }
60
+ if ( ! empty( $options['logincust_field_lost_password'] ) && $options['logincust_field_lost_password'] === 1 ) {
61
+ add_filter( 'login_link_separator', array( $this, 'logincust_no_register_link' ) );
62
+ }
63
+ }
64
+
65
+ }
66
+
67
+
68
+ /**
69
+ * Change login logo title attribute
70
+ *
71
+ * @since 2.0.0
72
+ *
73
+ */
74
+ function logincust_login_logo_url_title() {
75
+ // Get blog title
76
+ $title = get_bloginfo( 'name', 'display' );
77
+
78
+ // Return blog title
79
+ return $title;
80
+ }
81
+
82
+
83
+ /**
84
+ * Change login logo URL
85
+ *
86
+ * @since 2.0.0
87
+ *
88
+ */
89
+
90
+ function logincust_login_logo_url() {
91
+ // Return logo link option
92
+ $options = get_option( 'login_customizer_options' );
93
+
94
+ return $options['logincust_logo_link'];
95
+ }
96
+
97
+
98
+ /**
99
+ * Change Label of the Username from login Form.
100
+ *
101
+ * @param [string] $translated_text
102
+ * @param [string] $text
103
+ * @param [string] $domain
104
+ * @return string
105
+ * @since 2.2.0
106
+ * @version 2.2.0
107
+ *
108
+ */
109
+ function change_username_label( $translated_text, $text, $domain ){
110
+
111
+ $logincust_setting = get_option( 'logincust_setting' );
112
+ $login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : '';
113
+
114
+ if ( $logincust_setting ) {
115
+
116
+ $default = 'Username or Email Address';
117
+
118
+ $login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : '';
119
+
120
+ // If the option does not exist, return the text unchanged.
121
+ if ( ! $logincust_setting && $default === $text ) {
122
+ return $translated_text;
123
+ }
124
+
125
+ // If options exsit, then translate away.
126
+ if ( $logincust_setting && $default === $text ) {
127
+
128
+ // Check if the option exists.
129
+ if ( '' != $login_order && 'default' != $login_order ) {
130
+
131
+ if ( 'username' == $login_order ) {
132
+ $label = __( 'Username', 'login-customizer' );
133
+ } elseif ( 'email' == $login_order ) {
134
+ $label = __( 'Email Address', 'login-customizer' );
135
+ } else {
136
+ $label = __('Username or Email Address', 'login-customizer' );
137
+ }
138
+
139
+ $translated_text = esc_html( $label );
140
+ } else {
141
+ return $translated_text;
142
+ }
143
+ }
144
+ }
145
+ return $translated_text;
146
+ }
147
+
148
+
149
+ /**
150
+ * Remove register link
151
+ */
152
+ function logincust_no_register_link( $url ) {
153
+ return '';
154
+ }
155
+
156
+
157
+ /**
158
+ * logincust_always_checked_rememberme
159
+ * @since 2.2.0
160
+ * @version 2.0.0
161
+ * @return void
162
+ */
163
+ function logincust_always_checked_rememberme() {
164
+ echo "<script>document.getElementById('rememberme').checked = true;</script>";
165
+ }
166
+
167
+
168
+ /**
169
+ * Manage the Login Head
170
+ *
171
+ * @since 2.0.0
172
+ * @version 2.2.0
173
+ * * * * * * * * * * * */
174
+ function login_page_custom_head() {
175
+
176
+ do_action( 'logincust_header_menu' );
177
+
178
+ }
179
+
180
+
181
+
182
+
183
+ }
184
+
185
+
186
+
187
+
188
+
189
+
src/Customizer/Panel/Sanitizers.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom sanitizers for Customizer controls
4
+ */
5
+
6
+ /**
7
+ * Sanitizer's Claas for Customizer Controls
8
+ *
9
+ * @package LoginCustomizer
10
+ * @author WPBrigade
11
+ * @copyright Copyright (c) 2021, WPBrigade
12
+ * @link https://loginpress.pro/
13
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
14
+ *
15
+ */
16
+ namespace LoginCustomizer\Customizer\Panel;
17
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
18
+
19
+ class Sanitizers {
20
+
21
+ static function radio_option( $input, $setting ) {
22
+ // global wp_customize
23
+ global $wp_customize;
24
+
25
+ // Get control ID
26
+ $control = $wp_customize->get_control( $setting->id );
27
+
28
+ // Check if option exists in choice array
29
+ if ( array_key_exists( $input, $control->choices ) ) {
30
+ // If it does, return the value
31
+ return $input;
32
+ } else {
33
+ // Else, return default value
34
+ return $setting->default;
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Sanitizer for Background Position Control
40
+ */
41
+ function logincust_sanitize_position( $input, $setting ) {
42
+ // Check if value is one of the positions
43
+ if ( in_array( $input, array( 'top', 'bottom', 'left', 'right', 'center' ), true ) ) {
44
+ // If it does, return the value
45
+ return $input;
46
+ } else {
47
+ // Else, return default value
48
+ return $setting->default;
49
+ }
50
+ }
51
+ }
src/Customizer/Panel/Sections/Background.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Background Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+ use LoginCustomizer\Customizer\Panel\Sanitizers;
16
+
17
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
18
+ include_once ABSPATH . 'wp-includes/customize/class-wp-customize-background-position-control.php';
19
+
20
+ /**
21
+ * Backgruond Section in customizer
22
+ *
23
+ * @version 2.2.0
24
+ */
25
+ class Background{
26
+
27
+ function __construct( $wp_customize ) {
28
+
29
+ $wp_customize->add_section(
30
+ 'logincust_background_section',
31
+ array(
32
+ 'priority' => 5,
33
+ 'title' => __( 'Background', 'login-customizer' ),
34
+ 'panel' => 'logincust_panel',
35
+ )
36
+ );
37
+
38
+ $wp_customize->add_setting(
39
+ 'login_customizer_options[logincust_bg_color]',
40
+ array(
41
+ 'default' => '#F1F1F1',
42
+ 'type' => 'option',
43
+ 'capability' => 'edit_theme_options',
44
+ 'sanitize_callback' => 'sanitize_hex_color',
45
+ 'transport' => 'postMessage',
46
+ )
47
+ );
48
+
49
+ $wp_customize->add_control( new \WP_Customize_Color_Control( $wp_customize, 'login_customizer_options[logincust_bg_color]', array(
50
+ 'label' => __( 'Background Color', 'login-customizer' ),
51
+ 'section' => 'logincust_background_section',
52
+ 'priority' => 5,
53
+ 'settings' => 'login_customizer_options[logincust_bg_color]',
54
+ )
55
+ )
56
+ );
57
+
58
+ $wp_customize->add_setting(
59
+ 'login_customizer_options[logincust_bg_image]',
60
+ array(
61
+ 'type' => 'option',
62
+ 'capability' => 'edit_theme_options',
63
+ 'sanitize_callback' => 'esc_url_raw',
64
+ 'transport' => 'postMessage',
65
+ )
66
+ );
67
+
68
+ $wp_customize->add_control(
69
+ new \WP_Customize_Image_Control(
70
+ $wp_customize,
71
+ 'login_customizer_options[logincust_bg_image]',
72
+ array(
73
+ 'label' => __( 'Background Image', 'login-customizer' ),
74
+ 'section' => 'logincust_background_section',
75
+ 'priority' => 10,
76
+ 'settings' => 'login_customizer_options[logincust_bg_image]',
77
+ )
78
+ )
79
+ );
80
+
81
+ $wp_customize->add_setting(
82
+ 'login_customizer_options[logincust_bg_image_size]',
83
+ array(
84
+ 'default' => 'auto',
85
+ 'type' => 'option',
86
+ 'capability' => 'edit_theme_options',
87
+ 'sanitize_callback' => 'logincust_radio_option',
88
+ 'transport' => 'postMessage',
89
+ )
90
+ );
91
+ $wp_customize->add_control(
92
+ 'login_customizer_options[logincust_bg_image_size]',
93
+ array(
94
+ 'label' => __( 'Background Size', 'login-customizer' ),
95
+ 'section' => 'logincust_background_section',
96
+ 'type' => 'select',
97
+ 'choices' => array(
98
+ 'auto' => __( 'Original', 'login-customizer' ),
99
+ 'contain' => __( 'Fit to Screen', 'login-customizer' ),
100
+ 'cover' => __( 'Fill Screen', 'login-customizer' ),
101
+ 'custom' => __( 'Custom', 'login-customizer' ),
102
+ ),
103
+ 'priority' => 15,
104
+ 'settings' => 'login_customizer_options[logincust_bg_image_size]',
105
+ )
106
+ );
107
+
108
+ $wp_customize->add_setting(
109
+ 'login_customizer_options[logincust_bg_size]',
110
+ array(
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
+ 'login_customizer_options[logincust_bg_size]',
120
+ array(
121
+ 'label' => __( 'Custom Size', 'login-customizer' ),
122
+ 'section' => 'logincust_background_section',
123
+ 'priority' => 20,
124
+ 'settings' => 'login_customizer_options[logincust_bg_size]',
125
+ )
126
+ );
127
+
128
+ $wp_customize->add_setting(
129
+ 'login_customizer_options[logincust_bg_image_repeat]',
130
+ array(
131
+ 'default' => 'no-repeat',
132
+ 'type' => 'option',
133
+ 'capability' => 'edit_theme_options',
134
+ 'sanitize_callback' => 'logincust_radio_option',
135
+ 'transport' => 'postMessage',
136
+ )
137
+ );
138
+ $wp_customize->add_control(
139
+ 'login_customizer_options[logincust_bg_image_repeat]',
140
+ array(
141
+ 'label' => __( 'Background Repeat', 'login-customizer' ),
142
+ 'section' => 'logincust_background_section',
143
+ 'type' => 'select',
144
+ 'choices' => array(
145
+ 'no-repeat' => __( 'No Repeat', 'login-customizer' ),
146
+ 'repeat' => __( 'Repeat', 'login-customizer' ),
147
+ 'repeat-x' => __( 'Repeat Horizontally', 'login-customizer' ),
148
+ 'repeat-y' => __( 'Repeat Vertically', 'login-customizer' ),
149
+ ),
150
+ 'priority' => 25,
151
+ 'settings' => 'login_customizer_options[logincust_bg_image_repeat]',
152
+ )
153
+ );
154
+
155
+ $wp_customize->add_setting(
156
+ 'login_customizer_options[logincust_bg_image_position_x]',
157
+ array(
158
+ 'default' => 'left',
159
+ 'type' => 'option',
160
+ 'capability' => 'edit_theme_options',
161
+ 'sanitize_callback' => 'logincust_sanitize_position',
162
+ 'transport' => 'postMessage',
163
+ )
164
+ );
165
+
166
+
167
+ $wp_customize->add_setting(
168
+ 'login_customizer_options[logincust_bg_image_position_y]',
169
+ array(
170
+ 'default' => 'top',
171
+ 'type' => 'option',
172
+ 'capability' => 'edit_theme_options',
173
+ 'sanitize_callback' => 'logincust_sanitize_position',
174
+ 'transport' => 'postMessage',
175
+ )
176
+ );
177
+
178
+ $wp_customize->add_control(
179
+ new \WP_Customize_Background_Position_Control(
180
+ $wp_customize,
181
+ 'login_customizer_options[logincust_bg_image_position]',
182
+ array(
183
+ 'label' => __( 'Background Position', 'login-customizer' ),
184
+ 'section' => 'logincust_background_section',
185
+ 'priority' => 30,
186
+ 'settings' => array(
187
+ 'x' => 'login_customizer_options[logincust_bg_image_position_x]',
188
+ 'y' => 'login_customizer_options[logincust_bg_image_position_y]',
189
+ ),
190
+ )
191
+ )
192
+ );
193
+ }
194
+
195
+
196
+
197
+
198
+ }
src/Customizer/Panel/Sections/Button.php ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Button Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ use LoginCustomizer\Customizer\Panel\Controls\Alpha;
17
+ use LoginCustomizer\Customizer\Panel\Controls\Padding;
18
+ use LoginCustomizer\Customizer\Panel\Controls\Range_Slider;
19
+
20
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
21
+
22
+ /**
23
+ * Button Section in customizer
24
+ *
25
+ * @version 2.2.0
26
+ */
27
+
28
+ class Button{
29
+
30
+ function __construct( $wp_customize ) {
31
+
32
+ $wp_customize->add_section(
33
+ 'logincust_button_section',
34
+ array(
35
+ 'priority' => 30,
36
+ 'title' => __( 'Button', 'login-customizer' ),
37
+ 'panel' => 'logincust_panel',
38
+ )
39
+ );
40
+
41
+ $wp_customize->add_setting(
42
+ 'login_customizer_options[logincust_button_bg]',
43
+ array(
44
+ 'default' => '#2EA2CC',
45
+ 'type' => 'option',
46
+ 'capability' => 'edit_theme_options',
47
+ 'sanitize_callback' => 'sanitize_hex_color',
48
+ 'transport' => 'postMessage',
49
+ )
50
+ );
51
+
52
+ $wp_customize->add_control(
53
+ new \WP_Customize_Color_Control(
54
+ $wp_customize,
55
+ 'login_customizer_options[logincust_button_bg]',
56
+ array(
57
+ 'label' => __( 'Background', 'login-customizer' ),
58
+ 'section' => 'logincust_button_section',
59
+ 'priority' => 5,
60
+ 'settings' => 'login_customizer_options[logincust_button_bg]',
61
+ )
62
+ )
63
+ );
64
+
65
+ $wp_customize->add_setting(
66
+ 'login_customizer_options[logincust_button_hover_bg]',
67
+ array(
68
+ 'default' => '#1E8CBE',
69
+ 'type' => 'option',
70
+ 'capability' => 'edit_theme_options',
71
+ 'sanitize_callback' => 'sanitize_hex_color',
72
+ 'transport' => 'postMessage',
73
+ )
74
+ );
75
+
76
+ $wp_customize->add_control(
77
+ new \WP_Customize_Color_Control(
78
+ $wp_customize,
79
+ 'login_customizer_options[logincust_button_hover_bg]',
80
+ array(
81
+ 'label' => __( 'Background (Hover)', 'login-customizer' ),
82
+ 'section' => 'logincust_button_section',
83
+ 'priority' => 10,
84
+ 'settings' => 'login_customizer_options[logincust_button_hover_bg]',
85
+ )
86
+ )
87
+ );
88
+
89
+ $wp_customize->add_setting(
90
+ 'login_customizer_options[logincust_button_height_width]',
91
+ array(
92
+ 'default' => 'auto',
93
+ 'type' => 'option',
94
+ 'capability' => 'edit_theme_options',
95
+ 'sanitize_callback' => function( $input, $setting ) {
96
+ // global wp_customize
97
+ global $wp_customize;
98
+
99
+ // Get control ID
100
+ $control = $wp_customize->get_control( $setting->id );
101
+
102
+ // Check if option exists in choice array
103
+ if ( array_key_exists( $input, $control->choices ) ) {
104
+ // If it does, return the value
105
+ return $input;
106
+ } else {
107
+ // Else, return default value
108
+ return $setting->default;
109
+ }
110
+ },
111
+ 'transport' => 'postMessage',
112
+ )
113
+ );
114
+ $wp_customize->add_control(
115
+ 'login_customizer_options[logincust_button_height_width]',
116
+ array(
117
+ 'label' => __( 'Button Size', 'login-customizer' ),
118
+ 'section' => 'logincust_button_section',
119
+ 'type' => 'select',
120
+ 'choices' => array(
121
+ 'auto' => __( 'Auto', 'login-customizer' ),
122
+ 'custom' => __( 'Custom', 'login-customizer' ),
123
+ ),
124
+ 'priority' => 15,
125
+ 'settings' => 'login_customizer_options[logincust_button_height_width]',
126
+ )
127
+ );
128
+
129
+ $wp_customize->add_setting(
130
+ 'login_customizer_options[logincust_button_width_size]',
131
+ array(
132
+ 'default' => '63px',
133
+ 'type' => 'option',
134
+ 'capability' => 'edit_theme_options',
135
+ 'sanitize_callback' => 'esc_html',
136
+ 'transport' => 'postMessage',
137
+ )
138
+ );
139
+
140
+ $wp_customize->add_control(
141
+ new Range_Slider(
142
+ $wp_customize,
143
+ 'login_customizer_options[logincust_button_width_size]',
144
+ array(
145
+ 'label' => __( 'Width', 'login-customizer' ),
146
+ 'section' => 'logincust_button_section',
147
+ 'priority' => 20,
148
+ 'settings' => 'login_customizer_options[logincust_button_width_size]',
149
+ 'choices' => array(
150
+ 'percent' => true,
151
+ ),
152
+ 'input_attrs' => array(
153
+ 'min' => 0,
154
+ 'max' => 1000,
155
+ 'step' => 1,
156
+ ),
157
+ )
158
+ )
159
+ );
160
+
161
+ $wp_customize->add_setting(
162
+ 'login_customizer_options[logincust_button_height_size]',
163
+ array(
164
+ 'default' => '32px',
165
+ 'type' => 'option',
166
+ 'capability' => 'edit_theme_options',
167
+ 'sanitize_callback' => 'esc_html',
168
+ 'transport' => 'postMessage',
169
+ )
170
+ );
171
+
172
+ $wp_customize->add_control(
173
+ new Range_Slider(
174
+ $wp_customize,
175
+ 'login_customizer_options[logincust_button_height_size]',
176
+ array(
177
+ 'label' => __( 'Height', 'login-customizer' ),
178
+ 'section' => 'logincust_button_section',
179
+ 'priority' => 25,
180
+ 'settings' => 'login_customizer_options[logincust_button_height_size]',
181
+ 'choices' => array(
182
+ 'percent' => false,
183
+ ),
184
+ 'input_attrs' => array(
185
+ 'min' => 0,
186
+ 'max' => 1000,
187
+ 'step' => 1,
188
+ ),
189
+ )
190
+ )
191
+ );
192
+
193
+ $wp_customize->add_setting(
194
+ 'login_customizer_options[logincust_button_font_size]',
195
+ array(
196
+ 'default' => '13px',
197
+ 'type' => 'option',
198
+ 'capability' => 'edit_theme_options',
199
+ 'sanitize_callback' => 'esc_html',
200
+ 'transport' => 'postMessage',
201
+ )
202
+ );
203
+
204
+ $wp_customize->add_control(
205
+ new Range_Slider(
206
+ $wp_customize,
207
+ 'login_customizer_options[logincust_button_font_size]',
208
+ array(
209
+ 'label' => __( 'Font Size', 'login-customizer' ),
210
+ 'section' => 'logincust_button_section',
211
+ 'priority' => 30,
212
+ 'settings' => 'login_customizer_options[logincust_button_font_size]',
213
+ 'choices' => array(
214
+ 'percent' => false,
215
+ ),
216
+ 'input_attrs' => array(
217
+ 'min' => 0,
218
+ 'max' => 100,
219
+ 'step' => 1,
220
+ ),
221
+ )
222
+ )
223
+ );
224
+
225
+ $wp_customize->add_setting(
226
+ 'login_customizer_options[logincust_button_color]',
227
+ array(
228
+ 'default' => '#FFF',
229
+ 'type' => 'option',
230
+ 'capability' => 'edit_theme_options',
231
+ 'sanitize_callback' => 'sanitize_hex_color',
232
+ 'transport' => 'postMessage',
233
+ )
234
+ );
235
+
236
+ $wp_customize->add_control(
237
+ new \WP_Customize_Color_Control(
238
+ $wp_customize,
239
+ 'login_customizer_options[logincust_button_color]',
240
+ array(
241
+ 'label' => __( 'Text Color', 'login-customizer' ),
242
+ 'section' => 'logincust_button_section',
243
+ 'priority' => 35,
244
+ 'settings' => 'login_customizer_options[logincust_button_color]',
245
+ )
246
+ )
247
+ );
248
+
249
+ $wp_customize->add_setting(
250
+ 'login_customizer_options[logincust_button_padding]',
251
+ array(
252
+ 'default' => '0 12px 2px',
253
+ 'type' => 'option',
254
+ 'capability' => 'edit_theme_options',
255
+ 'sanitize_callback' => 'esc_html',
256
+ 'transport' => 'postMessage',
257
+ )
258
+ );
259
+
260
+ $wp_customize->add_control(
261
+ new Padding(
262
+ $wp_customize,
263
+ 'login_customizer_options[logincust_button_padding]',
264
+ array(
265
+ 'label' => __( 'Padding', 'login-customizer' ),
266
+ 'section' => 'logincust_button_section',
267
+ 'priority' => 40,
268
+ 'settings' => 'login_customizer_options[logincust_button_padding]',
269
+ )
270
+ )
271
+ );
272
+
273
+ $wp_customize->add_setting(
274
+ 'login_customizer_options[logincust_button_border_width]',
275
+ array(
276
+ 'default' => '1px',
277
+ 'type' => 'option',
278
+ 'capability' => 'edit_theme_options',
279
+ 'sanitize_callback' => 'esc_html',
280
+ 'transport' => 'postMessage',
281
+ )
282
+ );
283
+
284
+ $wp_customize->add_control(
285
+ new Range_Slider(
286
+ $wp_customize,
287
+ 'login_customizer_options[logincust_button_border_width]',
288
+ array(
289
+ 'label' => __( 'Border Width', 'login-customizer' ),
290
+ 'section' => 'logincust_button_section',
291
+ 'priority' => 45,
292
+ 'settings' => 'login_customizer_options[logincust_button_border_width]',
293
+ 'choices' => array(
294
+ 'percent' => false,
295
+ ),
296
+ 'input_attrs' => array(
297
+ 'min' => 0,
298
+ 'max' => 20,
299
+ 'step' => 1,
300
+ ),
301
+ )
302
+ )
303
+ );
304
+
305
+ $wp_customize->add_setting(
306
+ 'login_customizer_options[logincust_button_border]',
307
+ array(
308
+ 'default' => '#0074A2',
309
+ 'type' => 'option',
310
+ 'capability' => 'edit_theme_options',
311
+ 'sanitize_callback' => 'sanitize_hex_color',
312
+ 'transport' => 'postMessage',
313
+ )
314
+ );
315
+
316
+ $wp_customize->add_control(
317
+ new \WP_Customize_Color_Control(
318
+ $wp_customize,
319
+ 'login_customizer_options[logincust_button_border]',
320
+ array(
321
+ 'label' => __( 'Border', 'login-customizer' ),
322
+ 'section' => 'logincust_button_section',
323
+ 'priority' => 55,
324
+ 'settings' => 'login_customizer_options[logincust_button_border]',
325
+ )
326
+ )
327
+ );
328
+
329
+ $wp_customize->add_setting(
330
+ 'login_customizer_options[logincust_button_hover_border]',
331
+ array(
332
+ 'default' => '#0074A2',
333
+ 'type' => 'option',
334
+ 'capability' => 'edit_theme_options',
335
+ 'sanitize_callback' => 'sanitize_hex_color',
336
+ 'transport' => 'postMessage',
337
+ )
338
+ );
339
+
340
+ $wp_customize->add_control(
341
+ new \WP_Customize_Color_Control(
342
+ $wp_customize,
343
+ 'login_customizer_options[logincust_button_hover_border]',
344
+ array(
345
+ 'label' => __( 'Border (Hover)', 'login-customizer' ),
346
+ 'section' => 'logincust_button_section',
347
+ 'priority' => 60,
348
+ 'settings' => 'login_customizer_options[logincust_button_hover_border]',
349
+ )
350
+ )
351
+ );
352
+
353
+ $wp_customize->add_setting(
354
+ 'login_customizer_options[logincust_button_shadow_spread]',
355
+ array(
356
+ 'default' => '0px',
357
+ 'type' => 'option',
358
+ 'capability' => 'edit_theme_options',
359
+ 'sanitize_callback' => 'esc_html',
360
+ 'transport' => 'postMessage',
361
+ )
362
+ );
363
+
364
+ $wp_customize->add_control(
365
+ new Range_Slider(
366
+ $wp_customize,
367
+ 'login_customizer_options[logincust_button_shadow_spread]',
368
+ array(
369
+ 'label' => __( 'Shadow Spread', 'login-customizer' ),
370
+ 'section' => 'logincust_button_section',
371
+ 'priority' => 65,
372
+ 'settings' => 'login_customizer_options[logincust_button_shadow_spread]',
373
+ 'choices' => array(
374
+ 'percent' => false,
375
+ ),
376
+ 'input_attrs' => array(
377
+ 'min' => 0,
378
+ 'max' => 50,
379
+ 'step' => 1,
380
+ ),
381
+ )
382
+ )
383
+ );
384
+
385
+ $wp_customize->add_setting(
386
+ 'login_customizer_options[logincust_button_shadow]',
387
+ array(
388
+ 'default' => '#78C8E6',
389
+ 'type' => 'option',
390
+ 'capability' => 'edit_theme_options',
391
+ 'sanitize_callback' => 'sanitize_text_field',
392
+ 'transport' => 'postMessage',
393
+ )
394
+ );
395
+
396
+ $wp_customize->add_control(
397
+ new Alpha(
398
+ $wp_customize,
399
+ 'login_customizer_options[logincust_button_shadow]',
400
+ array(
401
+ 'label' => __( 'Box Shadow', 'login-customizer' ),
402
+ 'section' => 'logincust_button_section',
403
+ 'priority' => 70,
404
+ 'settings' => 'login_customizer_options[logincust_button_shadow]',
405
+ )
406
+ )
407
+ );
408
+
409
+ $wp_customize->add_setting(
410
+ 'login_customizer_options[logincust_button_text_shadow]',
411
+ array(
412
+ 'default' => '#006799',
413
+ 'type' => 'option',
414
+ 'capability' => 'edit_theme_options',
415
+ 'sanitize_callback' => 'sanitize_text_field',
416
+ 'transport' => 'postMessage',
417
+ )
418
+ );
419
+
420
+ $wp_customize->add_control(
421
+ new \WP_Customize_Color_Control(
422
+ $wp_customize,
423
+ 'login_customizer_options[logincust_button_text_shadow]',
424
+ array(
425
+ 'label' => __( 'Text Shadow', 'login-customizer' ),
426
+ 'section' => 'logincust_button_section',
427
+ 'priority' => 75,
428
+ 'settings' => 'login_customizer_options[logincust_button_text_shadow]',
429
+ )
430
+ )
431
+ );
432
+ }
433
+ }
src/Customizer/Panel/Sections/Code.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Custom CSS Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ /**
17
+ * Custom CSS/JS Section in customizer
18
+ *
19
+ * @version 2.2.0
20
+ */
21
+ class Code{
22
+
23
+ public function __construct( $wp_customize ) {
24
+
25
+
26
+ $wp_customize->add_section(
27
+ 'logincust_code_section',
28
+ array(
29
+ 'priority' => 40,
30
+ 'title' => __( 'Custom CSS & JavaScript', 'login-customizer' ),
31
+ 'panel' => 'logincust_panel',
32
+ )
33
+ );
34
+
35
+ $wp_customize->add_setting(
36
+ 'login_customizer_options[logincust_other_css]',
37
+ array(
38
+ 'type' => 'option',
39
+ 'capability' => 'edit_theme_options',
40
+ )
41
+ );
42
+
43
+ $wp_customize->add_control(
44
+ new \WP_Customize_Code_Editor_Control(
45
+ $wp_customize,
46
+ 'login_customizer_options[logincust_other_css]',
47
+ array(
48
+ 'label' => __( 'Custom CSS', 'login-customizer' ),
49
+ 'code_type' => 'text/css',
50
+ 'section' => 'logincust_code_section',
51
+ 'priority' => 5,
52
+ 'settings' => 'login_customizer_options[logincust_other_css]',
53
+ )
54
+ )
55
+ );
56
+
57
+ $wp_customize->add_setting(
58
+ 'login_customizer_options[logincust_other_js]',
59
+ array(
60
+ 'type' => 'option',
61
+ 'capability' => 'edit_theme_options',
62
+ )
63
+ );
64
+
65
+ $wp_customize->add_control(
66
+ new \WP_Customize_Code_Editor_Control(
67
+ $wp_customize,
68
+ 'login_customizer_options[logincust_other_js]',
69
+ array(
70
+ 'label' => __( 'Custom JavaScript', 'login-customizer' ),
71
+ 'code_type' => 'text/javascript',
72
+ 'section' => 'logincust_code_section',
73
+ 'priority' => 10,
74
+ 'settings' => 'login_customizer_options[logincust_other_js]',
75
+ )
76
+ )
77
+ );
78
+ }
79
+ }
src/Customizer/Panel/Sections/Fields.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Fields Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ use LoginCustomizer\Customizer\Panel\Controls\Padding;
17
+ use LoginCustomizer\Customizer\Panel\Controls\Toggle;
18
+ use LoginCustomizer\Customizer\Panel\Controls\Range_Slider;
19
+
20
+ /**
21
+ * Fields Section in customizer
22
+ *
23
+ * @version 2.2.0
24
+ */
25
+ class Fields{
26
+
27
+ public function __construct( $wp_customize ) {
28
+
29
+ $wp_customize->add_section(
30
+ 'logincust_field_section',
31
+ array(
32
+ 'priority' => 25,
33
+ 'title' => __( 'Fields', 'login-customizer' ),
34
+ 'panel' => 'logincust_panel',
35
+ )
36
+ );
37
+
38
+ $wp_customize->add_setting(
39
+ 'login_customizer_options[logincust_field_remember_me]',
40
+ 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 Toggle(
51
+ $wp_customize,
52
+ 'login_customizer_options[logincust_field_remember_me]',
53
+ array(
54
+ 'label' => __( 'Disable Remember Me?', 'login-customizer' ),
55
+ 'section' => 'logincust_field_section',
56
+ 'priority' => 5,
57
+ 'settings' => 'login_customizer_options[logincust_field_remember_me]',
58
+ )
59
+ )
60
+ );
61
+
62
+ $wp_customize->add_setting(
63
+ 'login_customizer_options[logincust_field_width]',
64
+ array(
65
+ 'default' => '100%',
66
+ 'type' => 'option',
67
+ 'capability' => 'edit_theme_options',
68
+ 'sanitize_callback' => 'esc_html',
69
+ 'transport' => 'postMessage',
70
+ )
71
+ );
72
+
73
+ $wp_customize->add_control(
74
+ new Range_Slider(
75
+ $wp_customize,
76
+ 'login_customizer_options[logincust_field_width]',
77
+ array(
78
+ 'label' => __( 'Width', 'login-customizer' ),
79
+ 'section' => 'logincust_field_section',
80
+ 'priority' => 10,
81
+ 'settings' => 'login_customizer_options[logincust_field_width]',
82
+ 'choices' => array(
83
+ 'percent' => true,
84
+ ),
85
+ 'input_attrs' => array(
86
+ 'min' => 0,
87
+ 'max' => 1000,
88
+ 'step' => 1,
89
+ ),
90
+ )
91
+ )
92
+ );
93
+
94
+ $wp_customize->add_setting(
95
+ 'login_customizer_options[logincust_field_font_size]',
96
+ array(
97
+ 'default' => '24px',
98
+ 'type' => 'option',
99
+ 'capability' => 'edit_theme_options',
100
+ 'sanitize_callback' => 'esc_html',
101
+ 'transport' => 'postMessage',
102
+ )
103
+ );
104
+
105
+ $wp_customize->add_control(
106
+ new Range_Slider(
107
+ $wp_customize,
108
+ 'login_customizer_options[logincust_field_font_size]',
109
+ array(
110
+ 'label' => __( 'Font Size', 'login-customizer' ),
111
+ 'section' => 'logincust_field_section',
112
+ 'priority' => 15,
113
+ 'settings' => 'login_customizer_options[logincust_field_font_size]',
114
+ 'choices' => array(
115
+ 'percent' => false,
116
+ ),
117
+ 'input_attrs' => array(
118
+ 'min' => 0,
119
+ 'max' => 100,
120
+ 'step' => 1,
121
+ ),
122
+ )
123
+ )
124
+ );
125
+
126
+ $wp_customize->add_setting(
127
+ 'login_customizer_options[logincust_field_border_width]',
128
+ array(
129
+ 'default' => '1px',
130
+ 'type' => 'option',
131
+ 'capability' => 'edit_theme_options',
132
+ 'sanitize_callback' => 'esc_html',
133
+ 'transport' => 'postMessage',
134
+ )
135
+ );
136
+
137
+ $wp_customize->add_control(
138
+ new Range_Slider(
139
+ $wp_customize,
140
+ 'login_customizer_options[logincust_field_border_width]',
141
+ array(
142
+ 'label' => __( 'Border Width', 'login-customizer' ),
143
+ 'section' => 'logincust_field_section',
144
+ 'priority' => 20,
145
+ 'settings' => 'login_customizer_options[logincust_field_border_width]',
146
+ 'choices' => array(
147
+ 'percent' => false,
148
+ ),
149
+ 'input_attrs' => array(
150
+ 'min' => 0,
151
+ 'max' => 10,
152
+ 'step' => 1,
153
+ ),
154
+ )
155
+ )
156
+ );
157
+
158
+ $wp_customize->add_setting(
159
+ 'login_customizer_options[logincust_field_border_color]',
160
+ array(
161
+ 'default' => '#DDD',
162
+ 'type' => 'option',
163
+ 'capability' => 'edit_theme_options',
164
+ 'sanitize_callback' => 'sanitize_hex_color',
165
+ 'transport' => 'postMessage',
166
+ )
167
+ );
168
+
169
+ $wp_customize->add_control(
170
+ new \WP_Customize_Color_Control(
171
+ $wp_customize,
172
+ 'login_customizer_options[logincust_field_border_color]',
173
+ array(
174
+ 'label' => __( 'Border Color', 'login-customizer' ),
175
+ 'section' => 'logincust_field_section',
176
+ 'priority' => 25,
177
+ 'settings' => 'login_customizer_options[logincust_field_border_color]',
178
+ )
179
+ )
180
+ );
181
+
182
+ $wp_customize->add_setting(
183
+ 'login_customizer_options[logincust_field_radius]',
184
+ array(
185
+ 'default' => '0px',
186
+ 'type' => 'option',
187
+ 'capability' => 'edit_theme_options',
188
+ 'sanitize_callback' => 'esc_html',
189
+ 'transport' => 'postMessage',
190
+ )
191
+ );
192
+
193
+ $wp_customize->add_control(
194
+ new Range_Slider(
195
+ $wp_customize,
196
+ 'login_customizer_options[logincust_field_radius]',
197
+ array(
198
+ 'label' => __( 'Radius', 'login-customizer' ),
199
+ 'section' => 'logincust_field_section',
200
+ 'priority' => 30,
201
+ 'settings' => 'login_customizer_options[logincust_field_radius]',
202
+ 'choices' => array(
203
+ 'percent' => false,
204
+ ),
205
+ 'input_attrs' => array(
206
+ 'min' => 0,
207
+ 'max' => 100,
208
+ 'step' => 1,
209
+ ),
210
+ )
211
+ )
212
+ );
213
+
214
+ $wp_customize->add_setting(
215
+ 'login_customizer_options[logincust_field_box_shadow]',
216
+ array(
217
+ 'default' => false,
218
+ 'type' => 'option',
219
+ 'capability' => 'edit_theme_options',
220
+ 'sanitize_callback' => 'absint',
221
+ 'transport' => 'postMessage',
222
+ )
223
+ );
224
+
225
+ $wp_customize->add_control(
226
+ new Toggle(
227
+ $wp_customize,
228
+ 'login_customizer_options[logincust_field_box_shadow]',
229
+ array(
230
+ 'label' => __( 'Disable Box Shadow?', 'login-customizer' ),
231
+ 'section' => 'logincust_field_section',
232
+ 'priority' => 35,
233
+ 'settings' => 'login_customizer_options[logincust_field_box_shadow]',
234
+ )
235
+ )
236
+ );
237
+
238
+ $wp_customize->add_setting(
239
+ 'login_customizer_options[logincust_field_margin]',
240
+ array(
241
+ 'default' => '2px 6px 16px 0px',
242
+ 'type' => 'option',
243
+ 'capability' => 'edit_theme_options',
244
+ 'sanitize_callback' => 'esc_html',
245
+ 'transport' => 'postMessage',
246
+ )
247
+ );
248
+
249
+ $wp_customize->add_control(
250
+ new Padding(
251
+ $wp_customize,
252
+ 'login_customizer_options[logincust_field_margin]',
253
+ array(
254
+ 'label' => __( 'Margin', 'login-customizer' ),
255
+ 'section' => 'logincust_field_section',
256
+ 'priority' => 35,
257
+ 'settings' => 'login_customizer_options[logincust_field_margin]',
258
+ )
259
+ )
260
+ );
261
+
262
+ $wp_customize->add_setting(
263
+ 'login_customizer_options[logincust_field_padding]',
264
+ array(
265
+ 'default' => '3px 3px 3px 3px',
266
+ 'type' => 'option',
267
+ 'capability' => 'edit_theme_options',
268
+ 'sanitize_callback' => 'esc_html',
269
+ 'transport' => 'postMessage',
270
+ )
271
+ );
272
+
273
+ $wp_customize->add_control(
274
+ new Padding(
275
+ $wp_customize,
276
+ 'login_customizer_options[logincust_field_padding]',
277
+ array(
278
+ 'label' => __( 'Padding', 'login-customizer' ),
279
+ 'section' => 'logincust_field_section',
280
+ 'priority' => 40,
281
+ 'settings' => 'login_customizer_options[logincust_field_padding]',
282
+ )
283
+ )
284
+ );
285
+
286
+ $wp_customize->add_setting(
287
+ 'login_customizer_options[logincust_field_bg]',
288
+ array(
289
+ 'default' => '#FFF',
290
+ 'type' => 'option',
291
+ 'capability' => 'edit_theme_options',
292
+ 'sanitize_callback' => 'sanitize_hex_color',
293
+ 'transport' => 'postMessage',
294
+ )
295
+ );
296
+
297
+ $wp_customize->add_control(
298
+ new \WP_Customize_Color_Control(
299
+ $wp_customize,
300
+ 'login_customizer_options[logincust_field_bg]',
301
+ array(
302
+ 'label' => __( 'Background', 'login-customizer' ),
303
+ 'section' => 'logincust_field_section',
304
+ 'priority' => 45,
305
+ 'settings' => 'login_customizer_options[logincust_field_bg]',
306
+ )
307
+ )
308
+ );
309
+
310
+ $wp_customize->add_setting(
311
+ 'login_customizer_options[logincust_field_color]',
312
+ array(
313
+ 'default' => '#333',
314
+ 'type' => 'option',
315
+ 'capability' => 'edit_theme_options',
316
+ 'sanitize_callback' => 'sanitize_hex_color',
317
+ 'transport' => 'postMessage',
318
+ )
319
+ );
320
+
321
+ $wp_customize->add_control(
322
+ new \WP_Customize_Color_Control(
323
+ $wp_customize,
324
+ 'login_customizer_options[logincust_field_color]',
325
+ array(
326
+ 'label' => __( 'Text Color', 'login-customizer' ),
327
+ 'section' => 'logincust_field_section',
328
+ 'priority' => 50,
329
+ 'settings' => 'login_customizer_options[logincust_field_color]',
330
+ )
331
+ )
332
+ );
333
+
334
+ $wp_customize->add_setting(
335
+ 'login_customizer_options[logincust_field_label]',
336
+ array(
337
+ 'default' => '#777',
338
+ 'type' => 'option',
339
+ 'capability' => 'edit_theme_options',
340
+ 'sanitize_callback' => 'sanitize_hex_color',
341
+ 'transport' => 'postMessage',
342
+ )
343
+ );
344
+
345
+ $wp_customize->add_control(
346
+ new \WP_Customize_Color_Control(
347
+ $wp_customize,
348
+ 'login_customizer_options[logincust_field_label]',
349
+ array(
350
+ 'label' => __( 'Label Color', 'login-customizer' ),
351
+ 'section' => 'logincust_field_section',
352
+ 'priority' => 55,
353
+ 'settings' => 'login_customizer_options[logincust_field_label]',
354
+ )
355
+ )
356
+ );
357
+
358
+ $wp_customize->add_setting(
359
+ 'login_customizer_options[logincust_field_label_font_size]',
360
+ array(
361
+ 'default' => '14px',
362
+ 'type' => 'option',
363
+ 'capability' => 'edit_theme_options',
364
+ 'sanitize_callback' => 'esc_html',
365
+ 'transport' => 'postMessage',
366
+ )
367
+ );
368
+
369
+ $wp_customize->add_control(
370
+ new Range_Slider(
371
+ $wp_customize,
372
+ 'login_customizer_options[logincust_field_label_font_size]',
373
+ array(
374
+ 'label' => __( 'Label Font Size', 'login-customizer' ),
375
+ 'section' => 'logincust_field_section',
376
+ 'priority' => 60,
377
+ 'settings' => 'login_customizer_options[logincust_field_label_font_size]',
378
+ 'choices' => array(
379
+ 'percent' => false,
380
+ ),
381
+ 'input_attrs' => array(
382
+ 'min' => 0,
383
+ 'max' => 100,
384
+ 'step' => 1,
385
+ ),
386
+ )
387
+ )
388
+ );
389
+ }
390
+ }
src/Customizer/Panel/Sections/Form.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Form Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ use LoginCustomizer\Customizer\Panel\Controls\Alpha;
17
+ use LoginCustomizer\Customizer\Panel\Controls\Padding;
18
+ use LoginCustomizer\Customizer\Panel\Controls\Range_Slider;
19
+
20
+ /**
21
+ * Form Section in customizer
22
+ *
23
+ * @version 2.2.0
24
+ */
25
+ class Form{
26
+
27
+ function __construct( $wp_customize ) {
28
+
29
+ $wp_customize->add_section(
30
+ 'logincust_form_section',
31
+ array(
32
+ 'priority' => 15,
33
+ 'title' => __( 'Form', 'login-customizer' ),
34
+ 'panel' => 'logincust_panel',
35
+ )
36
+ );
37
+
38
+ $wp_customize->add_setting(
39
+ 'login_customizer_options[logincust_form_bg_image]',
40
+ array(
41
+ 'type' => 'option',
42
+ 'capability' => 'edit_theme_options',
43
+ 'sanitize_callback' => 'esc_url_raw',
44
+ 'transport' => 'postMessage',
45
+ )
46
+ );
47
+
48
+ $wp_customize->add_control(
49
+ new \WP_Customize_Image_Control(
50
+ $wp_customize,
51
+ 'login_customizer_options[logincust_form_bg_image]',
52
+ array(
53
+ 'label' => __( 'Background Image', 'login-customizer' ),
54
+ 'section' => 'logincust_form_section',
55
+ 'priority' => 5,
56
+ 'settings' => 'login_customizer_options[logincust_form_bg_image]',
57
+ )
58
+ )
59
+ );
60
+
61
+ $wp_customize->add_setting(
62
+ 'login_customizer_options[logincust_form_bg_color]',
63
+ array(
64
+ 'default' => '#FFFFFF',
65
+ 'type' => 'option',
66
+ 'capability' => 'edit_theme_options',
67
+ 'sanitize_callback' => 'sanitize_text_field',
68
+ 'transport' => 'postMessage',
69
+ )
70
+ );
71
+
72
+ $wp_customize->add_control(
73
+ new Alpha(
74
+ $wp_customize,
75
+ 'login_customizer_options[logincust_form_bg_color]',
76
+ array(
77
+ 'label' => __( 'Background Color', 'login-customizer' ),
78
+ 'section' => 'logincust_form_section',
79
+ 'priority' => 10,
80
+ 'settings' => 'login_customizer_options[logincust_form_bg_color]',
81
+ )
82
+ )
83
+ );
84
+
85
+ $wp_customize->add_setting(
86
+ 'login_customizer_options[logincust_form_width]',
87
+ array(
88
+ 'default' => '320px',
89
+ 'type' => 'option',
90
+ 'capability' => 'edit_theme_options',
91
+ 'sanitize_callback' => 'esc_html',
92
+ 'transport' => 'postMessage',
93
+ )
94
+ );
95
+
96
+ $wp_customize->add_control(
97
+ new Range_Slider(
98
+ $wp_customize,
99
+ 'login_customizer_options[logincust_form_width]',
100
+ array(
101
+ 'label' => __( 'Width', 'login-customizer' ),
102
+ 'section' => 'logincust_form_section',
103
+ 'priority' => 15,
104
+ 'settings' => 'login_customizer_options[logincust_form_width]',
105
+ 'choices' => array(
106
+ 'percent' => true,
107
+ ),
108
+ 'input_attrs' => array(
109
+ 'min' => 0,
110
+ 'max' => 1000,
111
+ 'step' => 1,
112
+ ),
113
+ )
114
+ )
115
+ );
116
+
117
+ $wp_customize->add_setting(
118
+ 'login_customizer_options[logincust_form_height]',
119
+ array(
120
+ 'default' => '194px',
121
+ 'type' => 'option',
122
+ 'capability' => 'edit_theme_options',
123
+ 'sanitize_callback' => 'esc_html',
124
+ 'transport' => 'postMessage',
125
+ )
126
+ );
127
+
128
+ $wp_customize->add_control(
129
+ new Range_Slider(
130
+ $wp_customize,
131
+ 'login_customizer_options[logincust_form_height]',
132
+ array(
133
+ 'label' => __( 'Height', 'login-customizer' ),
134
+ 'section' => 'logincust_form_section',
135
+ 'priority' => 20,
136
+ 'settings' => 'login_customizer_options[logincust_form_height]',
137
+ 'choices' => array(
138
+ 'percent' => true,
139
+ ),
140
+ 'input_attrs' => array(
141
+ 'min' => 0,
142
+ 'max' => 1000,
143
+ 'step' => 1,
144
+ ),
145
+ )
146
+ )
147
+ );
148
+
149
+ $wp_customize->add_setting(
150
+ 'login_customizer_options[logincust_form_padding]',
151
+ array(
152
+ 'default' => '26px 24px 46px',
153
+ 'type' => 'option',
154
+ 'capability' => 'edit_theme_options',
155
+ 'sanitize_callback' => 'esc_html',
156
+ 'transport' => 'postMessage',
157
+ )
158
+ );
159
+
160
+ $wp_customize->add_control(
161
+ new Padding(
162
+ $wp_customize,
163
+ 'login_customizer_options[logincust_form_padding]',
164
+ array(
165
+ 'label' => __( 'Padding', 'login-customizer' ),
166
+ 'section' => 'logincust_form_section',
167
+ 'priority' => 25,
168
+ 'settings' => 'login_customizer_options[logincust_form_padding]',
169
+ )
170
+ )
171
+ );
172
+
173
+ $wp_customize->add_setting(
174
+ 'login_customizer_options[logincust_form_radius]',
175
+ array(
176
+ 'default' => '0px',
177
+ 'type' => 'option',
178
+ 'capability' => 'edit_theme_options',
179
+ 'sanitize_callback' => 'esc_html',
180
+ 'transport' => 'postMessage',
181
+ )
182
+ );
183
+
184
+ $wp_customize->add_control(
185
+ new Range_Slider(
186
+ $wp_customize,
187
+ 'login_customizer_options[logincust_form_radius]',
188
+ array(
189
+ 'label' => __( 'Radius', 'login-customizer' ),
190
+ 'section' => 'logincust_form_section',
191
+ 'priority' => 30,
192
+ 'settings' => 'login_customizer_options[logincust_form_radius]',
193
+ 'choices' => array(
194
+ 'percent' => false,
195
+ ),
196
+ 'input_attrs' => array(
197
+ 'min' => 0,
198
+ 'max' => 500,
199
+ 'step' => 1,
200
+ ),
201
+ )
202
+ )
203
+ );
204
+
205
+ $wp_customize->add_setting(
206
+ 'login_customizer_options[logincust_form_shadow_spread]',
207
+ array(
208
+ 'default' => '3px',
209
+ 'type' => 'option',
210
+ 'capability' => 'edit_theme_options',
211
+ 'sanitize_callback' => 'esc_html',
212
+ 'transport' => 'postMessage',
213
+ )
214
+ );
215
+
216
+ $wp_customize->add_control(
217
+ new Range_Slider(
218
+ $wp_customize,
219
+ 'login_customizer_options[logincust_form_shadow_spread]',
220
+ array(
221
+ 'label' => __( 'Shadow Spread', 'login-customizer' ),
222
+ 'section' => 'logincust_form_section',
223
+ 'priority' => 35,
224
+ 'settings' => 'login_customizer_options[logincust_form_shadow_spread]',
225
+ 'choices' => array(
226
+ 'percent' => false,
227
+ ),
228
+ 'input_attrs' => array(
229
+ 'min' => 0,
230
+ 'max' => 50,
231
+ 'step' => 1,
232
+ ),
233
+ )
234
+ )
235
+ );
236
+
237
+ $wp_customize->add_setting(
238
+ 'login_customizer_options[logincust_form_shadow]',
239
+ array(
240
+ 'default' => 'rgba(0,0,0, 0.13)',
241
+ 'type' => 'option',
242
+ 'capability' => 'edit_theme_options',
243
+ 'sanitize_callback' => 'sanitize_text_field',
244
+ 'transport' => 'postMessage',
245
+ )
246
+ );
247
+
248
+ $wp_customize->add_control(
249
+ new Alpha(
250
+ $wp_customize,
251
+ 'login_customizer_options[logincust_form_shadow]',
252
+ array(
253
+ 'label' => __( 'Box Shadow', 'login-customizer' ),
254
+ 'section' => 'logincust_form_section',
255
+ 'priority' => 40,
256
+ 'settings' => 'login_customizer_options[logincust_form_shadow]',
257
+ )
258
+ )
259
+ );
260
+
261
+ }
262
+ }
src/Customizer/Panel/Sections/Logo.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Logo Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ use LoginCustomizer\Customizer\Panel\Controls\Toggle;
17
+ use LoginCustomizer\Customizer\Panel\Controls\Range_Slider;
18
+
19
+ /**
20
+ * Logo Section in customizer
21
+ *
22
+ * @version 2.2.0
23
+ */
24
+ class Logo{
25
+
26
+ function __construct( $wp_customize ) {
27
+
28
+ $wp_customize->add_section(
29
+ 'logincust_logo_section',
30
+ array(
31
+ 'priority' => 10,
32
+ 'title' => __( 'Logo', 'login-customizer' ),
33
+ 'panel' => 'logincust_panel',
34
+ )
35
+ );
36
+
37
+ $wp_customize->add_setting(
38
+ 'login_customizer_options[logincust_logo_show]',
39
+ array(
40
+ 'default' => false,
41
+ 'type' => 'option',
42
+ 'capability' => 'edit_theme_options',
43
+ 'sanitize_callback' => 'absint',
44
+ 'transport' => 'postMessage',
45
+ )
46
+ );
47
+
48
+ $wp_customize->add_control(
49
+ new Toggle(
50
+ $wp_customize,
51
+ 'login_customizer_options[logincust_logo_show]',
52
+ array(
53
+ 'label' => __( 'Disable Logo?', 'login-customizer' ),
54
+ 'section' => 'logincust_logo_section',
55
+ 'priority' => 5,
56
+ 'settings' => 'login_customizer_options[logincust_logo_show]',
57
+ )
58
+ )
59
+ );
60
+
61
+ $wp_customize->add_setting(
62
+ 'login_customizer_options[logincust_logo]',
63
+ array(
64
+ 'type' => 'option',
65
+ 'capability' => 'edit_theme_options',
66
+ 'sanitize_callback' => 'esc_url_raw',
67
+ 'transport' => 'postMessage',
68
+ )
69
+ );
70
+
71
+ $wp_customize->add_control(
72
+ new \WP_Customize_Image_Control(
73
+ $wp_customize,
74
+ 'login_customizer_options[logincust_logo]',
75
+ array(
76
+ 'label' => __( 'Logo', 'login-customizer' ),
77
+ 'section' => 'logincust_logo_section',
78
+ 'priority' => 10,
79
+ 'settings' => 'login_customizer_options[logincust_logo]',
80
+ )
81
+ )
82
+ );
83
+
84
+ $wp_customize->add_setting(
85
+ 'login_customizer_options[logincust_logo_width]',
86
+ array(
87
+ 'default' => '84px',
88
+ 'type' => 'option',
89
+ 'capability' => 'edit_theme_options',
90
+ 'sanitize_callback' => 'esc_html',
91
+ 'transport' => 'postMessage',
92
+ )
93
+ );
94
+
95
+ $wp_customize->add_control(
96
+ new Range_Slider(
97
+ $wp_customize,
98
+ 'login_customizer_options[logincust_logo_width]',
99
+ array(
100
+ 'label' => __( 'Logo Width', 'login-customizer' ),
101
+ 'section' => 'logincust_logo_section',
102
+ 'priority' => 15,
103
+ 'settings' => 'login_customizer_options[logincust_logo_width]',
104
+ 'choices' => array(
105
+ 'percent' => true,
106
+ ),
107
+ 'input_attrs' => array(
108
+ 'min' => 0,
109
+ 'max' => 1000,
110
+ 'step' => 1,
111
+ ),
112
+ )
113
+ )
114
+ );
115
+
116
+ $wp_customize->add_setting(
117
+ 'login_customizer_options[logincust_logo_height]',
118
+ array(
119
+ 'default' => '84px',
120
+ 'type' => 'option',
121
+ 'capability' => 'edit_theme_options',
122
+ 'sanitize_callback' => 'esc_html',
123
+ 'transport' => 'postMessage',
124
+ )
125
+ );
126
+
127
+ $wp_customize->add_control(
128
+ new Range_Slider(
129
+ $wp_customize,
130
+ 'login_customizer_options[logincust_logo_height]',
131
+ array(
132
+ 'label' => __( 'Logo Height', 'login-customizer' ),
133
+ 'section' => 'logincust_logo_section',
134
+ 'priority' => 20,
135
+ 'settings' => 'login_customizer_options[logincust_logo_height]',
136
+ 'choices' => array(
137
+ 'percent' => true,
138
+ ),
139
+ 'input_attrs' => array(
140
+ 'min' => 0,
141
+ 'max' => 1000,
142
+ 'step' => 1,
143
+ ),
144
+ )
145
+ )
146
+ );
147
+
148
+ $wp_customize->add_setting(
149
+ 'login_customizer_options[logincust_logo_padding]',
150
+ array(
151
+ 'default' => '5px',
152
+ 'type' => 'option',
153
+ 'capability' => 'edit_theme_options',
154
+ 'sanitize_callback' => 'esc_html',
155
+ 'transport' => 'postMessage',
156
+ )
157
+ );
158
+
159
+ $wp_customize->add_control(
160
+ new Range_Slider(
161
+ $wp_customize,
162
+ 'login_customizer_options[logincust_logo_padding]',
163
+ array(
164
+ 'label' => __( 'Padding Bottom', 'login-customizer' ),
165
+ 'section' => 'logincust_logo_section',
166
+ 'priority' => 25,
167
+ 'settings' => 'login_customizer_options[logincust_logo_padding]',
168
+ 'choices' => array(
169
+ 'percent' => true,
170
+ ),
171
+ 'input_attrs' => array(
172
+ 'min' => 0,
173
+ 'max' => 1000,
174
+ 'step' => 1,
175
+ ),
176
+ )
177
+ )
178
+ );
179
+
180
+ $wp_customize->add_setting(
181
+ 'login_customizer_options[logincust_logo_link]',
182
+ array(
183
+ 'default' => 'https://wordpress.org/',
184
+ 'type' => 'option',
185
+ 'capability' => 'edit_theme_options',
186
+ 'sanitize_callback' => 'esc_url_raw',
187
+ )
188
+ );
189
+
190
+ $wp_customize->add_control(
191
+ 'login_customizer_options[logincust_logo_link]',
192
+ array(
193
+ 'label' => __( 'Logo URL', 'login-customizer' ),
194
+ 'description' => __( 'The page where your logo will take you.', 'login-customizer' ),
195
+ 'section' => 'logincust_logo_section',
196
+ 'priority' => 30,
197
+ 'settings' => 'login_customizer_options[logincust_logo_link]',
198
+ )
199
+ );
200
+ }
201
+ }
src/Customizer/Panel/Sections/Other.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Other Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+ *
13
+ */
14
+ namespace LoginCustomizer\Customizer\Panel\Sections;
15
+
16
+ use LoginCustomizer\Customizer\Panel\Controls\Toggle;
17
+ use LoginCustomizer\Customizer\Panel\Controls\Range_slider;
18
+
19
+ /**
20
+ * Others Section in customizer
21
+ *
22
+ * @version 2.2.0
23
+ */
24
+ class Other{
25
+
26
+ function __construct( $wp_customize ) {
27
+
28
+ $wp_customize->add_section(
29
+ 'logincust_other_section',
30
+ array(
31
+ 'priority' => 35,
32
+ 'title' => __( 'Other', 'login-customizer' ),
33
+ 'panel' => 'logincust_panel',
34
+ )
35
+ );
36
+
37
+ if ( get_option( 'users_can_register' ) ) {
38
+
39
+ $wp_customize->add_setting(
40
+ 'login_customizer_options[logincust_field_register_link]',
41
+ array(
42
+ 'default' => false,
43
+ 'type' => 'option',
44
+ 'capability' => 'edit_theme_options',
45
+ 'sanitize_callback' => 'absint',
46
+ 'transport' => 'postMessage',
47
+ )
48
+ );
49
+
50
+ $wp_customize->add_control(
51
+ new Toggle(
52
+ $wp_customize,
53
+ 'login_customizer_options[logincust_field_register_link]',
54
+ array(
55
+ 'label' => __( 'Disable Register Link?', 'login-customizer' ),
56
+ 'section' => 'logincust_other_section',
57
+ 'priority' => 5,
58
+ 'settings' => 'login_customizer_options[logincust_field_register_link]',
59
+ )
60
+ )
61
+ );
62
+
63
+ }
64
+
65
+ $wp_customize->add_setting(
66
+ 'login_customizer_options[logincust_field_lost_password]',
67
+ array(
68
+ 'default' => false,
69
+ 'type' => 'option',
70
+ 'capability' => 'edit_theme_options',
71
+ 'sanitize_callback' => 'absint',
72
+ 'transport' => 'postMessage',
73
+ )
74
+ );
75
+
76
+ $wp_customize->add_control(
77
+ new Toggle(
78
+ $wp_customize,
79
+ 'login_customizer_options[logincust_field_lost_password]',
80
+ array(
81
+ 'label' => __( 'Disable Lost Password?', 'login-customizer' ),
82
+ 'section' => 'logincust_other_section',
83
+ 'priority' => 10,
84
+ 'settings' => 'login_customizer_options[logincust_field_lost_password]',
85
+ )
86
+ )
87
+ );
88
+
89
+ $wp_customize->add_setting(
90
+ 'login_customizer_options[logincust_field_back_blog]',
91
+ array(
92
+ 'default' => false,
93
+ 'type' => 'option',
94
+ 'capability' => 'edit_theme_options',
95
+ 'sanitize_callback' => 'absint',
96
+ 'transport' => 'postMessage',
97
+ )
98
+ );
99
+
100
+ $wp_customize->add_control(
101
+ new Toggle(
102
+ $wp_customize,
103
+ 'login_customizer_options[logincust_field_back_blog]',
104
+ array(
105
+ 'label' => __( 'Disable "Back to Website"?', 'login-customizer' ),
106
+ 'section' => 'logincust_other_section',
107
+ 'priority' => 15,
108
+ 'settings' => 'login_customizer_options[logincust_field_back_blog]',
109
+ )
110
+ )
111
+ );
112
+
113
+ $wp_customize->add_setting(
114
+ 'login_customizer_options[logincust_other_font_size]',
115
+ array(
116
+ 'default' => '13px',
117
+ 'type' => 'option',
118
+ 'capability' => 'edit_theme_options',
119
+ 'sanitize_callback' => 'esc_html',
120
+ 'transport' => 'postMessage',
121
+ )
122
+ );
123
+
124
+ $wp_customize->add_control(
125
+ new Range_Slider(
126
+ $wp_customize,
127
+ 'login_customizer_options[logincust_other_font_size]',
128
+ array(
129
+ 'label' => __( 'Font Size', 'login-customizer' ),
130
+ 'section' => 'logincust_other_section',
131
+ 'priority' => 15,
132
+ 'settings' => 'login_customizer_options[logincust_other_font_size]',
133
+ 'choices' => array(
134
+ 'percent' => false,
135
+ ),
136
+ 'input_attrs' => array(
137
+ 'min' => 0,
138
+ 'max' => 100,
139
+ 'step' => 1,
140
+ ),
141
+ )
142
+ )
143
+ );
144
+
145
+ $wp_customize->add_setting(
146
+ 'login_customizer_options[logincust_other_color]',
147
+ array(
148
+ 'default' => '#999',
149
+ 'type' => 'option',
150
+ 'capability' => 'edit_theme_options',
151
+ 'sanitize_callback' => 'sanitize_hex_color',
152
+ 'transport' => 'postMessage',
153
+ )
154
+ );
155
+
156
+ $wp_customize->add_control(
157
+ new \WP_Customize_Color_Control(
158
+ $wp_customize,
159
+ 'login_customizer_options[logincust_other_color]',
160
+ array(
161
+ 'label' => __( 'Text Color', 'login-customizer' ),
162
+ 'section' => 'logincust_other_section',
163
+ 'priority' => 20,
164
+ 'settings' => 'login_customizer_options[logincust_other_color]',
165
+ )
166
+ )
167
+ );
168
+
169
+ $wp_customize->add_setting(
170
+ 'login_customizer_options[logincust_other_color_hover]',
171
+ array(
172
+ 'default' => '#2EA2CC',
173
+ 'type' => 'option',
174
+ 'capability' => 'edit_theme_options',
175
+ 'sanitize_callback' => 'sanitize_hex_color',
176
+ 'transport' => 'postMessage',
177
+ )
178
+ );
179
+
180
+ $wp_customize->add_control(
181
+ new \WP_Customize_Color_Control(
182
+ $wp_customize,
183
+ 'login_customizer_options[logincust_other_color_hover]',
184
+ array(
185
+ 'label' => __( 'Text Color (Hover)', 'login-customizer' ),
186
+ 'section' => 'logincust_other_section',
187
+ 'priority' => 25,
188
+ 'settings' => 'login_customizer_options[logincust_other_color_hover]',
189
+ )
190
+ )
191
+ );
192
+ }
193
+
194
+
195
+ }
src/Customizer/Panel/Sections/Templates.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Background Section
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ * @since 2.2.0
11
+ *
12
+ */
13
+ namespace LoginCustomizer\Customizer\Panel\Sections;
14
+
15
+ use LoginCustomizer\Customizer\Panel\Controls\Radio_Images;
16
+ use LoginCustomizer\Customizer\Panel\Sanitizers;
17
+
18
+ include_once ABSPATH . 'wp-includes/class-wp-customize-control.php';
19
+
20
+ class Templates extends Sanitizers{
21
+
22
+ function __construct( $wp_customize ) {
23
+
24
+ $free_templates = array(
25
+ 'original' => LOGINCUST_FREE_URL . 'Customizer/Templates/Light/assets/original.png',
26
+ 'dark' => LOGINCUST_FREE_URL . 'Customizer/Templates/Dark/assets/dark.png',
27
+ 'material' => LOGINCUST_FREE_URL . 'Customizer/Templates/Material/assets/material.png',
28
+ );
29
+
30
+ $wp_customize->add_section(
31
+ 'logincust_templates',
32
+ array(
33
+ 'priority' => 0,
34
+ 'title' => __( 'Templates', 'login-customizer' ),
35
+ 'panel' => 'logincust_panel',
36
+ )
37
+ );
38
+
39
+ $templates = apply_filters( 'pro_theme_inclusion', $free_templates );
40
+
41
+ $wp_customize->add_setting(
42
+ 'login_customizer_options[logincust_templates_control]',
43
+ array(
44
+ 'default' => 'original',
45
+ 'type' => 'option',
46
+ 'capability' => 'edit_theme_options',
47
+ 'sanitize_callback' => function( $input, $setting ) {
48
+ // global wp_customize
49
+ global $wp_customize;
50
+
51
+ // Get control ID
52
+ $control = $wp_customize->get_control( $setting->id );
53
+
54
+ // Check if option exists in choice array
55
+ if ( array_key_exists( $input, $control->choices ) ) {
56
+ // If it does, return the value
57
+ return $input;
58
+ } else {
59
+ // Else, return default value
60
+ return $setting->default;
61
+ }
62
+ },
63
+ )
64
+ );
65
+
66
+
67
+ $wp_customize->add_control(
68
+ new Radio_Images(
69
+ $wp_customize,
70
+ 'login_customizer_options[logincust_templates_control]',
71
+ array(
72
+ 'label' => __( 'Templates', 'login-customizer' ),
73
+ 'section' => 'logincust_templates',
74
+ 'priority' => 5,
75
+ 'settings' => 'login_customizer_options[logincust_templates_control]',
76
+ 'choices' => $templates
77
+ )
78
+ )
79
+ );
80
+ }
81
+
82
+ static function radio_option( $input, $setting ) {
83
+ // global wp_customize
84
+ global $wp_customize;
85
+
86
+ // Get control ID
87
+ $control = $wp_customize->get_control( $setting->id );
88
+
89
+ // Check if option exists in choice array
90
+ if ( array_key_exists( $input, $control->choices ) ) {
91
+ // If it does, return the value
92
+ return $input;
93
+ } else {
94
+ // Else, return default value
95
+ return $setting->default;
96
+ }
97
+ }
98
+ }
src/Customizer/Panel/customizer.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customizer controls for Login Customizer
4
+ */
5
+ // ------------------------------------- Helping Classes --------------------------------------
6
+
7
+ use LoginCustomizer\Essentials;
8
+ use LoginCustomizer\Customizer\Panel\Sanitizers;
9
+ use LoginCustomizer\Customizer\Panel\Custom_Code;
10
+ use LoginCustomizer\Customizer\Panel\Functions;
11
+
12
+
13
+ // ------------------------------- Customizer Sections ----------------------------------------
14
+ use LoginCustomizer\Customizer\Panel\Sections\Templates;
15
+ use LoginCustomizer\Customizer\Panel\Sections\Background;
16
+ use LoginCustomizer\Customizer\Panel\Sections\Logo;
17
+ use LoginCustomizer\Customizer\Panel\Sections\Form;
18
+ use LoginCustomizer\Customizer\Panel\Sections\Fields;
19
+ use LoginCustomizer\Customizer\Panel\Sections\Button;
20
+ use LoginCustomizer\Customizer\Panel\Sections\Other;
21
+ use LoginCustomizer\Customizer\Panel\Sections\Code;
22
+
23
+ new Essentials;
24
+ new Custom_Code;
25
+ new Functions;
26
+
27
+ /**
28
+ * Register login customizer settings
29
+ */
30
+ function logincust_customize_register( $wp_customize ) {
31
+
32
+ /**
33
+ * Sanitizer for Background Radio Control
34
+ */
35
+ function logincust_radio_option( $input, $setting ) {
36
+ // global wp_customize
37
+ global $wp_customize;
38
+
39
+ // Get control ID
40
+ $control = $wp_customize->get_control( $setting->id );
41
+
42
+ // Check if option exists in choice array
43
+ if ( array_key_exists( $input, $control->choices ) ) {
44
+ // If it does, return the value
45
+ return $input;
46
+ } else {
47
+ // Else, return default value
48
+ return $setting->default;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Sanitizer for Background Position Control
54
+ */
55
+ function logincust_sanitize_position( $input, $setting ) {
56
+ // Check if value is one of the positions
57
+ if ( in_array( $input, array( 'top', 'bottom', 'left', 'right', 'center' ), true ) ) {
58
+ // If it does, return the value
59
+ return $input;
60
+ } else {
61
+ // Else, return default value
62
+ return $setting->default;
63
+ }
64
+ }
65
+
66
+ // Login Customizer Panel
67
+ $wp_customize->add_panel(
68
+ 'logincust_panel',
69
+ array(
70
+ 'priority' => 30,
71
+ 'capability' => 'edit_theme_options',
72
+ 'title' => __( 'Login Customizer', 'login-customizer' ),
73
+ 'description' => __( 'This section allows you to customize the login page of your website. Made with ❤ by <a target="_blank" rel="nofollow" href="https://loginpress.pro/?utm_source=login-customizer-lite&utm_medium=customizer">Hardeep Asrani</a> team.', 'login-customizer' ),
74
+ )
75
+ );
76
+
77
+ // Section #1: Templates
78
+ new Templates( $wp_customize );
79
+
80
+ // Section #2: Background
81
+ new Background( $wp_customize );
82
+
83
+ // Section #3: Logo
84
+ new Logo( $wp_customize );
85
+
86
+ // Section #4: Form
87
+ new Form( $wp_customize );
88
+
89
+ // Section #5: Fields
90
+ new Fields( $wp_customize );
91
+
92
+ // Section #6: Button
93
+ new Button( $wp_customize );
94
+
95
+ // Section #7: Other
96
+ new Other( $wp_customize );
97
+
98
+ // Section #8: Custom CSS & JS
99
+ new Code( $wp_customize );
100
+
101
+ }
102
+ //Register Customizer Page
103
+ add_action( 'customize_register', 'logincust_customize_register' );
104
+
105
+ /**
106
+ * Enqueue script to Customizer Page
107
+ */
108
+ function logincust_customizer_script() {
109
+ // Enqueue script to Customizer
110
+ wp_enqueue_script( 'logincust_control_js', LOGINCUST_FREE_URL . 'Customizer/Panel/Assets/JS/customizer.js', array( 'jquery' ), LOGINCUST_FREE_VERSION, true );
111
+
112
+ // Generate the redirect url.
113
+ $options = get_option( 'login_customizer_settings', array() );
114
+
115
+ $localize = array(
116
+ 'page' => get_permalink( $options['page'] ),
117
+ 'url' => LOGINCUST_FREE_URL,
118
+ );
119
+
120
+ // Localize Script
121
+ wp_localize_script( 'logincust_control_js', 'logincust_script', $localize );
122
+ }
123
+ add_action( 'customize_controls_print_scripts', 'logincust_customizer_script' );
124
+
125
+ /**
126
+ * Enqueue script/s to Customizer Preview
127
+ */
128
+ function logincust_customizer_preview_script() {
129
+ // Enqueue script to Customizer Preview
130
+ wp_enqueue_script( 'logincust_control_preview', LOGINCUST_FREE_URL . 'Customizer/Panel/Assets/JS/customizer-preview.js', array( 'jquery', 'customize-preview' ), LOGINCUST_FREE_VERSION, true );
131
+
132
+ // Generate the redirect url.
133
+ $options = get_option( 'login_customizer_settings', array() );
134
+
135
+ $localize = array(
136
+ 'page' => get_permalink( $options['page'] ),
137
+ );
138
+
139
+ // Action hook triggered after customize_controls_init was called
140
+ wp_localize_script( 'logincust_control_preview', 'logincust_script', $localize );
141
+ }
142
+
143
+ add_action( 'customize_preview_init', 'logincust_customizer_preview_script' );
144
+ add_action( 'customize_controls_enqueue_scripts', 'logincust_customizer_preview_script' );
setup.php → src/Customizer/Setup.php RENAMED
@@ -2,7 +2,10 @@
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.
@@ -12,7 +15,7 @@ if ( get_option( 'login_customizer_settings' ) ) {
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
  }
2
  /**
3
  * Include Login Customizer Setup class.
4
  */
5
+ use LoginCustomizer\Essentials;
6
+ new Essentials;
7
+
8
+ include( plugin_dir_path( __FILE__ ) . '/Initial_Setup.php' );
9
 
10
  /**
11
  * Setup login page for new and updated instances.
15
  $db_version = $db_version['version'];
16
  if ( isset( $db_version ) ) {
17
  // Compare version of plugin with previously saved version
18
+ if ( version_compare( $db_version, LOGINCUST_FREE_VERSION, '<' ) ) {
19
  // Setup login page
20
  return LoginCustomizerSetup::get_instance();
21
  }
{assets/templates → src/Customizer/Templates/Dark/assets}/dark.png RENAMED
File without changes
{assets/templates → src/Customizer/Templates/Light/assets}/original.png RENAMED
File without changes
{assets → src/Customizer/Templates/Material/assets}/logo.png RENAMED
File without changes
{assets/templates → src/Customizer/Templates/Material/assets}/material.png RENAMED
File without changes
src/Customizer/template-login-customizer.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
23
+ <!DOCTYPE html>
24
+ <html>
25
+ <head>
26
+ <?php
27
+ $login_title = sprintf(
28
+ __( '%1$s &lsaquo; %2$s &#8212; WordPress', 'login-customizer' ),
29
+ __( 'Log In', 'login-customizer' ),
30
+ get_bloginfo( 'name', 'display' )
31
+ );
32
+
33
+
34
+ ?>
35
+ <title><?php echo esc_attr( $login_title ); ?></title>
36
+ <?php
37
+ wp_enqueue_style( 'login' );
38
+ do_action( 'login_enqueue_scripts' );
39
+ do_action( 'login_head' );
40
+ ?>
41
+ </head>
42
+ <?php
43
+ do_action( 'login_form_login' );
44
+
45
+ $action = 'login';
46
+
47
+ $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
48
+
49
+ if ( is_multisite() ) {
50
+ $login_header_url = network_home_url();
51
+ $login_header_title = get_network()->site_name;
52
+ } else {
53
+ $login_header_url = __( 'https://wordpress.org/', 'login-customizer' );
54
+ $login_header_title = __( 'Powered by WordPress', 'login-customizer' );
55
+ }
56
+
57
+ $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
58
+
59
+
60
+ //login_headertitle was deprecated in WordPress 5.2
61
+
62
+ if ( version_compare( $GLOBALS['wp_version'], '5.2', '<' ) ) {
63
+ $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
64
+ } else {
65
+ $login_header_title = apply_filters( 'login_headertext', $login_header_title );
66
+ }
67
+ if ( is_multisite() ) {
68
+ $login_header_text = get_bloginfo( 'name', 'display' );
69
+ } else {
70
+ $login_header_text = $login_header_title;
71
+ }
72
+
73
+ $classes = array( 'login-action-' . $action, 'wp-core-ui' );
74
+ if ( is_rtl() ) {
75
+ $classes[] = 'rtl';
76
+ }
77
+
78
+ $classes = apply_filters( 'login_body_class', $classes, $action );
79
+
80
+ ?>
81
+ <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
82
+ <?php do_action( 'login_header' ); ?>
83
+ <div id="login">
84
+ <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>
85
+ <form name="loginform" id="loginform">
86
+ <p>
87
+ <label for="user_login"><?php _e( 'Username or Email Address', 'login-customizer' ); ?><br />
88
+ <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
89
+ </p>
90
+ <p>
91
+ <label for="user_pass"><?php _e( 'Password', 'login-customizer' ); ?><br />
92
+ <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
93
+ </p>
94
+ <?php do_action( 'login_form' ); ?>
95
+ <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>
96
+ <p class="submit">
97
+ <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'login-customizer' ); ?>" />
98
+ </p>
99
+ </form>
100
+ <p id="nav">
101
+ <?php
102
+ if ( get_option( 'users_can_register' ) ) :
103
+ $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'login-customizer' ) );
104
+ /** This filter is documented in wp-includes/general-template.php */
105
+ echo apply_filters( 'register', $registration_url );
106
+ echo esc_html( $login_link_separator );
107
+ endif;
108
+ ?>
109
+ <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'login-customizer' ); ?></a>
110
+ </p>
111
+ <p id="backtoblog">
112
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
113
+ <?php
114
+ /* translators: %s: site title */
115
+ printf( _x( '&larr; Back to %s', 'site', 'login-customizer' ), get_bloginfo( 'title', 'display' ) );
116
+ ?>
117
+ </a>
118
+ </p>
119
+ </div>
120
+ <?php
121
+ do_action( 'login_footer' );
122
+ $options = get_option( 'login_customizer_options' );
123
+ global $options;
124
+ echo '<script type="text/javascript">' . $options['logincust_other_js'] . '</script>';
125
+ wp_footer();
126
+ ?>
127
+ </body>
128
+ </html>
src/Essentials.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Essential tools for Plugin
4
+ *
5
+ * @package LoginCustomizer
6
+ * @author WPBrigade
7
+ * @copyright Copyright (c) 2021, WPBrigade
8
+ * @link https://loginpress.pro/
9
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+
12
+ namespace LoginCustomizer;
13
+
14
+ /**
15
+ * Constant class.
16
+ *
17
+ * @since 2.2.0
18
+ * @version 2.2.0
19
+ * @access public
20
+ */
21
+
22
+ class Essentials {
23
+
24
+ /**
25
+ * Plugin Version
26
+ *
27
+ * @var string
28
+ */
29
+ public $version = '2.1.0';
30
+ /**
31
+ * Class Essentials construct
32
+ * @version 2.2.0
33
+ */
34
+ public function __construct() {
35
+
36
+ $this->define_constants();
37
+ add_action( 'plugins_loaded', array($this, 'load_text_domain' ) );
38
+ }
39
+
40
+ /**
41
+ * Defining Constants
42
+ *
43
+ * @since 2.2.0
44
+ * @access public
45
+ * @return void
46
+ */
47
+ public function define_constants() {
48
+
49
+ $this->define( 'LOGINCUST_FREE_URL', plugin_dir_url( __FILE__ ) );
50
+ $this->define( 'LOGINCUST_DIR_PATH', plugin_dir_path( __FILE__ ) );
51
+ $this->define( 'LOGINCUST_FREE_VERSION', $this->version );
52
+ $this->define( 'LOGINCUST_FEEDBACK_SERVER', 'https://wpbrigade.com/' );
53
+ $this->define( 'LOGINCUST_FREE_RESOURCES', plugins_url( 'resources', dirname( __FILE__ ) ) );
54
+ }
55
+
56
+ /**
57
+ * Plugin Translation languages
58
+ * @version 2.2.0
59
+ *
60
+ * @return void
61
+ */
62
+ public function load_text_domain() {
63
+
64
+ load_plugin_textdomain( 'login-customizer', false, LOGINCUST_FREE_RESOURCES . '/languages/' );
65
+ }
66
+
67
+ /**
68
+ * Callback to Define constant if not already set
69
+ * @param string $name
70
+ * @param string|bool $value
71
+ */
72
+ private function define( $name, $value ) {
73
+ if ( ! defined( $name ) ) {
74
+ define( $name, $value );
75
+ }
76
+ }
77
+ }
78
+
src/Includes/Ajax.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ // Exit if accessed directly.
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * Handling all the AJAX calls in Login Customizer.
9
+ *
10
+ * @since 2.2.0
11
+ * @version 2.2.0
12
+
13
+ * @class Deactivate_Login_Customizer
14
+ */
15
+
16
+ if ( ! class_exists( 'Deactivate_Login_Customizer' ) ) :
17
+
18
+ class Deactivate_Login_Customizer {
19
+
20
+ /* * * * * * * * * *
21
+ * Class constructor
22
+ * * * * * * * * * */
23
+ public function __construct() {
24
+
25
+ $this::init();
26
+ }
27
+
28
+ /**
29
+ * Ajax Calls for Deactivation box
30
+ *
31
+ * @return void
32
+ *
33
+ */
34
+ public static function init() {
35
+
36
+ $ajax_calls = array(
37
+ 'deactivate' => false,
38
+ );
39
+
40
+ foreach ( $ajax_calls as $ajax_call => $no_priv ) {
41
+
42
+ add_action( 'wp_ajax_login_customizer_' . $ajax_call, array( __CLASS__, $ajax_call ) );
43
+
44
+ if ( $no_priv ) {
45
+ add_action( 'wp_ajax_nopriv_login_customizer_' . $ajax_call, array( __CLASS__, $ajax_call ) );
46
+ }
47
+ }
48
+ }
49
+
50
+
51
+ /**
52
+ * [deactivate get response from user on deactivating plugin]
53
+ * @return [string] [response]
54
+ * @since 2.2.0
55
+ * @version 2.2.0
56
+ */
57
+ public function deactivate() {
58
+
59
+ check_ajax_referer( 'login-customizer-deactivate-nonce', 'security' );
60
+
61
+ if ( ! current_user_can( 'manage_options' ) ) {
62
+ wp_die( 'No cheating, huh!' );
63
+ }
64
+
65
+ $email = get_option( 'admin_email' );
66
+ $_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
67
+ $reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
68
+ $reason = '';
69
+
70
+ /*
71
+ ** I upgraded to login-customizer Pro
72
+ *
73
+ * The above option doesn't send response to server that's why it is omitted.
74
+ *
75
+ **/
76
+
77
+
78
+ if ( $_reason == '1' ) {
79
+ $reason = 'I only needed the plugin for a short period';
80
+ } elseif ( $_reason == '2' ) {
81
+ $reason = 'I found a better plugin';
82
+ } elseif ( $_reason == '3' ) {
83
+ $reason = 'The plugin broke my site';
84
+ } elseif ( $_reason == '4' ) {
85
+ $reason = 'The plugin suddenly stopped working';
86
+ } elseif ( $_reason == '5' ) {
87
+ $reason = 'I no longer need the plugin';
88
+ } elseif ( $_reason == '6' ) {
89
+ $reason = 'It\'s a temporary deactivation. I\'m just debugging an issue.';
90
+ } elseif ( $_reason == '7' ) {
91
+ $reason = 'Other';
92
+ }
93
+ $fields = array(
94
+ 'email' => $email,
95
+ 'website' => get_site_url(),
96
+ 'action' => 'Deactivate',
97
+ 'reason' => $reason,
98
+ 'reason_detail' => $reason_detail,
99
+ 'blog_language' => get_bloginfo( 'language' ),
100
+ 'wordpress_version' => get_bloginfo( 'version' ),
101
+ 'php_version' => PHP_VERSION,
102
+ 'plugin_version' => LOGINCUST_FREE_VERSION,
103
+ 'plugin_name' => 'Login Customizer Free',
104
+ );
105
+
106
+ $response = wp_remote_post( LOGINCUST_FEEDBACK_SERVER, array(
107
+ 'method' => 'POST',
108
+ 'timeout' => 5,
109
+ 'httpversion' => '1.0',
110
+ 'blocking' => false,
111
+ 'headers' => array(),
112
+ 'body' => $fields,
113
+ ) );
114
+
115
+ wp_die();
116
+ }
117
+
118
+ }
119
+
120
+ endif;
121
+ new Deactivate_Login_Customizer();
122
+ ?>
src/Includes/Disband.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Plugin deactivation box
5
+ *
6
+ * @package LoginCustomizer\Includes
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ *
12
+ */
13
+ namespace LoginCustomizer\Includes;
14
+
15
+ class Disband{
16
+
17
+ function __construct() {
18
+
19
+ $deactivate_nonce = wp_create_nonce( 'login-customizer-deactivate-nonce' ); ?>
20
+
21
+ <style>
22
+ .login-customizer-hidden{
23
+ overflow: hidden;
24
+ }
25
+ .login-customizer-popup-overlay .login-customizer-internal-message{
26
+ margin: 3px 0 3px 22px;
27
+ display: none;
28
+ }
29
+ .login-customizer-reason-input{
30
+ margin: 3px 0 3px 22px;
31
+ display: none;
32
+ }
33
+ .login-customizer-reason-input input[type="text"]{
34
+ width: 100%;
35
+ display: block;
36
+ }
37
+ .login-customizer-popup-overlay{
38
+ background: rgba(0,0,0, .8);
39
+ position: fixed;
40
+ top:0;
41
+ left: 0;
42
+ height: 100%;
43
+ width: 100%;
44
+ z-index: 1000;
45
+ overflow: auto;
46
+ visibility: hidden;
47
+ opacity: 0;
48
+ transition: opacity 0.3s ease-in-out;
49
+ display: flex;
50
+ justify-content: center;
51
+ align-items: center;
52
+ }
53
+ .login-customizer-popup-overlay.login-customizer-active{
54
+ opacity: 1;
55
+ visibility: visible;
56
+ }
57
+ .login-customizer-serveypanel{
58
+ width: 600px;
59
+ background: #fff;
60
+ margin: 0 auto 0;
61
+ border-radius: 3px;
62
+ }
63
+ .login-customizer-popup-header{
64
+ background: #f1f1f1;
65
+ padding: 20px;
66
+ border-bottom: 1px solid #ccc;
67
+ }
68
+ .login-customizer-popup-header h2{
69
+ margin: 0;
70
+ text-transform: uppercase;
71
+ }
72
+ .login-customizer-popup-body{
73
+ padding: 10px 20px;
74
+ }
75
+ .login-customizer-popup-footer{
76
+ background: #f9f3f3;
77
+ padding: 10px 20px;
78
+ border-top: 1px solid #ccc;
79
+ }
80
+ .login-customizer-popup-footer:after{
81
+ content:"";
82
+ display: table;
83
+ clear: both;
84
+ }
85
+ .action-btns{
86
+ float: right;
87
+ }
88
+ .login-customizer-anonymous{
89
+
90
+ display: none;
91
+ }
92
+ .attention, .error-message {
93
+ color: red;
94
+ font-weight: 600;
95
+ display: none;
96
+ }
97
+ .login-customizer-spinner{
98
+ display: none;
99
+ }
100
+ .login-customizer-spinner img{
101
+ margin-top: 3px;
102
+ }
103
+ .login-customizer-pro-message{
104
+ padding-left: 24px;
105
+ color: red;
106
+ font-weight: 600;
107
+ display: none;
108
+ }
109
+ .login-customizer-popup-header{
110
+ background: none;
111
+ padding: 18px 15px;
112
+ -webkit-box-shadow: 0 0 8px rgba(0,0,0,.1);
113
+ box-shadow: 0 0 8px rgba(0,0,0,.1);
114
+ border: 0;
115
+ }
116
+ .login-customizer-popup-body h3{
117
+ margin-top: 0;
118
+ margin-bottom: 30px;
119
+ font-weight: 700;
120
+ font-size: 15px;
121
+ color: #495157;
122
+ line-height: 1.4;
123
+ text-tranform: uppercase;
124
+ }
125
+ .login-customizer-reason{
126
+ font-size: 13px;
127
+ color: #6d7882;
128
+ margin-bottom: 15px;
129
+ }
130
+ .login-customizer-reason input[type="radio"]{
131
+ margin-right: 15px;
132
+ }
133
+ .login-customizer-popup-body{
134
+ padding: 30px 30px 0;
135
+ }
136
+ .login-customizer-popup-footer{
137
+ background: none;
138
+ border: 0;
139
+ padding: 29px 39px 39px;
140
+ }
141
+ </style>
142
+ <div class="login-customizer-popup-overlay">
143
+ <div class="login-customizer-serveypanel">
144
+ <form action="#" method="post" id="login-customizer-deactivate-form">
145
+ <div class="login-customizer-popup-header">
146
+ <h2><?php _e( 'Quick feedback about Login Customizer', 'login-customizer' ); ?></h2>
147
+ </div>
148
+ <div class="login-customizer-popup-body">
149
+ <h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'login-customizer' ); ?></h3>
150
+ <input type="hidden" class="login-customizer_deactivate_nonce" name="login-customizer_deactivate_nonce" value="<?php echo $deactivate_nonce; ?>">
151
+ <ul id="login-customizer-reason-list">
152
+ <li class="login-customizer-reason login-customizer-reason-pro" data-input-type="" data-input-placeholder="">
153
+ <label>
154
+ <span>
155
+ <input type="radio" name="login-customizer-selected-reason" value="pro">
156
+ </span>
157
+ <span><?php _e( "I upgraded to Login Customizer Pro", 'login-customizer' ); ?></span>
158
+ </label>
159
+ <div class="login-customizer-pro-message"><?php _e( 'No need to deactivate this Login Customizer Core version. Pro version works as an add-on with Core version.', 'login-customizer' ); ?></div>
160
+ </li>
161
+ <li class="login-customizer-reason" data-input-type="" data-input-placeholder="">
162
+ <label>
163
+ <span>
164
+ <input type="radio" name="login-customizer-selected-reason" value="1">
165
+ </span>
166
+ <span><?php _e( 'I only needed the plugin for a short period', 'login-customizer' ); ?></span>
167
+ </label>
168
+ <div class="login-customizer-internal-message"></div>
169
+ </li>
170
+ <li class="login-customizer-reason has-input" data-input-type="textfield">
171
+ <label>
172
+ <span>
173
+ <input type="radio" name="login-customizer-selected-reason" value="2">
174
+ </span>
175
+ <span><?php _e( 'I found a better plugin', 'login-customizer' ); ?></span>
176
+ </label>
177
+ <div class="login-customizer-internal-message"></div>
178
+ <div class="login-customizer-reason-input"><span class="message error-message "><?php _e( 'Kindly tell us the Plugin name.', 'login-customizer' ); ?></span><input type="text" name="better_plugin" placeholder="What's the plugin's name?"></div>
179
+ </li>
180
+ <li class="login-customizer-reason" data-input-type="" data-input-placeholder="">
181
+ <label>
182
+ <span>
183
+ <input type="radio" name="login-customizer-selected-reason" value="3">
184
+ </span>
185
+ <span><?php _e( 'The plugin broke my site', 'login-customizer' ); ?></span>
186
+ </label>
187
+ <div class="login-customizer-internal-message"></div>
188
+ </li>
189
+ <li class="login-customizer-reason" data-input-type="" data-input-placeholder="">
190
+ <label>
191
+ <span>
192
+ <input type="radio" name="login-customizer-selected-reason" value="4">
193
+ </span>
194
+ <span><?php _e( 'The plugin suddenly stopped working', 'login-customizer' ); ?></span>
195
+ </label>
196
+ <div class="login-customizer-internal-message"></div>
197
+ </li>
198
+ <li class="login-customizer-reason" data-input-type="" data-input-placeholder="">
199
+ <label>
200
+ <span>
201
+ <input type="radio" name="login-customizer-selected-reason" value="5">
202
+ </span>
203
+ <span><?php _e( 'I no longer need the plugin', 'login-customizer' ); ?></span>
204
+ </label>
205
+ <div class="login-customizer-internal-message"></div>
206
+ </li>
207
+ <li class="login-customizer-reason" data-input-type="" data-input-placeholder="">
208
+ <label>
209
+ <span>
210
+ <input type="radio" name="login-customizer-selected-reason" value="6">
211
+ </span>
212
+ <span><?php _e( "It's a temporary deactivation. I'm just debugging an issue.", 'login-customizer' ); ?></span>
213
+ </label>
214
+ <div class="login-customizer-internal-message"></div>
215
+ </li>
216
+ <li class="login-customizer-reason has-input" data-input-type="textfield" >
217
+ <label>
218
+ <span>
219
+ <input type="radio" name="login-customizer-selected-reason" value="7">
220
+ </span>
221
+ <span><?php _e( 'Other', 'login-customizer' ); ?></span>
222
+ </label>
223
+ <div class="login-customizer-internal-message"></div>
224
+ <div class="login-customizer-reason-input"><span class="message error-message "><?php _e( 'Kindly tell us the reason so we can improve.', 'login-customizer' ); ?></span><input type="text" name="other_reason" placeholder="Kindly tell us the reason so we can improve."></div>
225
+ </li>
226
+ </ul>
227
+ </div>
228
+ <div class="login-customizer-popup-footer">
229
+ <label class="login-customizer-anonymous"><input type="checkbox" /><?php _e( 'Anonymous feedback', 'login-customizer' ); ?></label>
230
+ <input type="button" class="button button-secondary button-skip login-customizer-popup-skip-feedback" value="<?php _e( 'Skip & Deactivate', 'login-customizer'); ?>" >
231
+ <div class="action-btns">
232
+ <span class="login-customizer-spinner"><img src="<?php echo admin_url( '/images/spinner.gif' ); ?>" alt=""></span>
233
+ <input type="submit" class="button button-secondary button-deactivate login-customizer-popup-allow-deactivate" value="<?php _e( 'Submit & Deactivate', 'login-customizer'); ?>" disabled="disabled">
234
+ <a href="#" class="button button-primary login-customizer-popup-button-close"><?php _e( 'Cancel', 'login-customizer' ); ?></a>
235
+
236
+ </div>
237
+ </div>
238
+ </form>
239
+ </div>
240
+ </div>
241
+
242
+
243
+ <script>
244
+ (function( $ ) {
245
+
246
+ $(function() {
247
+
248
+ var pluginSlug = 'login-customizer';
249
+ // Code to fire when the DOM is ready.
250
+
251
+ $(document).on('click', 'tr[data-slug="' + pluginSlug + '"] .deactivate', function(e){
252
+ e.preventDefault();
253
+ $('.login-customizer-popup-overlay').addClass('login-customizer-active');
254
+ $('body').addClass('login-customizer-hidden');
255
+ });
256
+ $(document).on('click', '.login-customizer-popup-button-close', function () {
257
+ close_popup();
258
+ });
259
+ $(document).on('click', ".login-customizer-serveypanel,tr[data-slug='" + pluginSlug + "'] .deactivate",function(e){
260
+ e.stopPropagation();
261
+ });
262
+
263
+ $(document).click(function(){
264
+ close_popup();
265
+ });
266
+ $('.login-customizer-reason label').on('click', function(){
267
+ if($(this).find('input[type="radio"]').is(':checked')){
268
+ //$('.login-customizer-anonymous').show();
269
+ $(this).next().next('.login-customizer-reason-input').show().end().end().parent().siblings().find('.login-customizer-reason-input').hide();
270
+ }
271
+ });
272
+ $('input[type="radio"][name="login-customizer-selected-reason"]').on('click', function(event) {
273
+ $(".login-customizer-popup-allow-deactivate").removeAttr('disabled');
274
+ $(".login-customizer-popup-skip-feedback").removeAttr('disabled');
275
+ $('.message.error-message').hide();
276
+ $('.login-customizer-pro-message').hide();
277
+ });
278
+
279
+ $('.login-customizer-reason-pro label').on('click', function(){
280
+ if($(this).find('input[type="radio"]').is(':checked')){
281
+ $(this).next('.login-customizer-pro-message').show().end().end().parent().siblings().find('.login-customizer-reason-input').hide();
282
+ $(this).next('.login-customizer-pro-message').show()
283
+ $('.login-customizer-popup-allow-deactivate').attr('disabled', 'disabled');
284
+ $('.login-customizer-popup-skip-feedback').attr('disabled', 'disabled');
285
+ }
286
+ });
287
+ $(document).on('submit', '#login-customizer-deactivate-form', function(event) {
288
+
289
+ event.preventDefault();
290
+
291
+ var _reason = $('input[type="radio"][name="login-customizer-selected-reason"]:checked').val();
292
+ var _reason_details = '';
293
+ var deactivate_nonce = $('.login-customizer_deactivate_nonce').val();
294
+
295
+ if ( _reason == 2 ) {
296
+ _reason_details = $("input[type='text'][name='better_plugin']").val();
297
+ } else if ( _reason == 7 ) {
298
+ _reason_details = $("input[type='text'][name='other_reason']").val();
299
+ }
300
+
301
+ if ( ( _reason == 7 || _reason == 2 ) && _reason_details == '' ) {
302
+ $('.message.error-message').show();
303
+ return ;
304
+ }
305
+
306
+ $.ajax({
307
+ url: ajaxurl,
308
+ type: 'POST',
309
+ data: {
310
+ action : 'login_customizer_deactivate',
311
+ reason : _reason,
312
+ reason_detail : _reason_details,
313
+ security : deactivate_nonce
314
+ },
315
+ beforeSend: function(){
316
+ $(".login-customizer-spinner").show();
317
+ $(".login-customizer-popup-allow-deactivate").attr("disabled", "disabled");
318
+ }
319
+ })
320
+ .done(function() {
321
+ $(".login-customizer-spinner").hide();
322
+ $(".login-customizer-popup-allow-deactivate").removeAttr("disabled");
323
+ window.location.href = $("tr[data-slug='"+ pluginSlug +"'] .deactivate a").attr('href');
324
+ });
325
+
326
+ });
327
+
328
+ $('.login-customizer-popup-skip-feedback').on('click', function(e){
329
+ // e.preventDefault();
330
+ window.location.href = $("tr[data-slug='"+ pluginSlug +"'] .deactivate a").attr('href');
331
+ })
332
+
333
+ function close_popup() {
334
+ $('.login-customizer-popup-overlay').removeClass('login-customizer-active');
335
+ $('#login-customizer-deactivate-form').trigger("reset");
336
+ $(".login-customizer-popup-allow-deactivate").attr('disabled', 'disabled');
337
+ $(".login-customizer-reason-input").hide();
338
+ $('body').removeClass('login-customizer-hidden');
339
+ $('.message.error-message').hide();
340
+ $('.login-customizer-pro-message').hide();
341
+ }
342
+ });
343
+
344
+ })( jQuery ); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
345
+ </script>
346
+ <?php
347
+ }
348
+ }
src/Includes/Help.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Log file to know more about users website environment.
5
+ * helps in debugging and providing support.
6
+ *
7
+ * @package LoginCustomizer
8
+ * @since 2.2.0
9
+ * @version 2.2.0
10
+ */
11
+ namespace LoginCustomizer\Includes;
12
+ use LoginCustomizer\Essentials;
13
+
14
+ class Help {
15
+
16
+ /**
17
+ * Returns the plugin & system information.
18
+ * @access public
19
+ * @return string
20
+ */
21
+ public static function get_sysinfo() {
22
+
23
+ global $wpdb;
24
+ new Essentials;
25
+
26
+ $settings = get_option( 'login_customizer_settings' );
27
+ $login_customizer = get_option( 'login_customizer_options' );
28
+ $login_order = isset( $settings['login_order'] ) ? $settings['login_order'] : 'Default';
29
+ $customization = isset( $login_customizer ) ? print_r( $login_customizer, true ) : 'No customization yet';
30
+
31
+
32
+ $html = '### Begin System Info ###' . "\n\n";
33
+
34
+ // Basic site info
35
+ $html .= '-- WordPress Configuration --' . "\n\n";
36
+ $html .= 'Site URL: ' . site_url() . "\n";
37
+ $html .= 'Home URL: ' . home_url() . "\n";
38
+ $html .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
39
+ $html .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
40
+ $html .= 'Language: ' . get_locale() . "\n";
41
+ $html .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . "\n";
42
+ $html .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
43
+ $html .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
44
+
45
+ // Plugin Configuration
46
+ $html .= "\n" . '-- Login Customizer Configuration --' . "\n\n";
47
+ $html .= 'Plugin Version: ' . LOGINCUST_FREE_VERSION . "\n";
48
+ $html .= 'Login Order: ' . ucfirst( $login_order ) . "\n";
49
+
50
+ // Server Configuration
51
+ $html .= "\n" . '-- Server Configuration --' . "\n\n";
52
+ $html .= 'Operating System: ' . php_uname( 's' ) . "\n";
53
+ $html .= 'PHP Version: ' . PHP_VERSION . "\n";
54
+ $html .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
55
+
56
+ $html .= 'Server Software: ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
57
+
58
+ // PHP configs... now we're getting to the important stuff
59
+ $html .= "\n" . '-- PHP Configuration --' . "\n\n";
60
+ // $html .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
61
+ $html .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
62
+ $html .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
63
+ $html .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n";
64
+ $html .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n";
65
+ $html .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
66
+ $html .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
67
+
68
+ // WordPress active themes
69
+ $html .= "\n" . '-- WordPress Active Theme --' . "\n\n";
70
+ $my_theme = wp_get_theme();
71
+ $html .= 'Name: ' . $my_theme->get( 'Name' ) . "\n";
72
+ $html .= 'URI: ' . $my_theme->get( 'ThemeURI' ) . "\n";
73
+ $html .= 'Author: ' . $my_theme->get( 'Author' ) . "\n";
74
+ $html .= 'Version: ' . $my_theme->get( 'Version' ) . "\n";
75
+
76
+ // WordPress active plugins
77
+ $html .= "\n" . '-- WordPress Active Plugins --' . "\n\n";
78
+ $plugins = get_plugins();
79
+ $active_plugins = get_option( 'active_plugins', array() );
80
+ foreach( $plugins as $plugin_path => $plugin ) {
81
+ if( !in_array( $plugin_path, $active_plugins ) )
82
+ continue;
83
+ $html .= $plugin['Name'] . ': v(' . $plugin['Version'] . ")\n";
84
+ }
85
+
86
+ // WordPress inactive plugins
87
+ $html .= "\n" . '-- WordPress Inactive Plugins --' . "\n\n";
88
+ foreach( $plugins as $plugin_path => $plugin ) {
89
+ if( in_array( $plugin_path, $active_plugins ) )
90
+ continue;
91
+ $html .= $plugin['Name'] . ': v(' . $plugin['Version'] . ")\n";
92
+ }
93
+
94
+ if( is_multisite() ) {
95
+ // WordPress Multisite active plugins
96
+ $html .= "\n" . '-- Network Active Plugins --' . "\n\n";
97
+ $plugins = wp_get_active_network_plugins();
98
+ $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
99
+ foreach( $plugins as $plugin_path ) {
100
+ $plugin_base = plugin_basename( $plugin_path );
101
+ if( ! array_key_exists( $plugin_base, $active_plugins ) )
102
+ continue;
103
+ $plugin = get_plugin_data( $plugin_path );
104
+ $html .= $plugin['Name'] . ': v(' . $plugin['Version'] . ")\n";
105
+ }
106
+ }
107
+ $html .= "\n\n".'Total Customized Fields: ' . count( $login_customizer ) . "\n";
108
+ $html .= 'Customization Detail: ' . $customization . "\n";
109
+
110
+ $html .= "\n" . '### End System Info ###';
111
+ return $html;
112
+ }
113
+ } // End of Class.
src/Includes/Plugin_Meta.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Meta Class to add meta tags on Plugins page.
4
+ *
5
+ *
6
+ * @package LoginCustomizer
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://Loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ */
12
+
13
+ namespace LoginCustomizer\Includes;
14
+ use LoginCustomizer\Includes\Disband;
15
+
16
+
17
+ /**
18
+ * Plugin Meta class.
19
+ *
20
+ * @since 2.2.0
21
+ * @access public
22
+ */
23
+ class Plugin_Meta {
24
+
25
+ /* * * * * * * * * *
26
+ * Class constructor
27
+ * * * * * * * * * */
28
+
29
+ public function __construct() {
30
+
31
+ // $this->hooks();
32
+
33
+ }
34
+
35
+ /**
36
+ * Hook into actions and filters
37
+ * @since 2.2.0
38
+ */
39
+ function hooks( ) {
40
+
41
+ include_once( LOGINCUST_DIR_PATH . 'Includes/Ajax.php' );
42
+
43
+ add_action( 'admin_footer', array( $this, 'disband_model' ) );
44
+ add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
45
+ add_action( 'plugin_action_links', array( $this, 'login_customizer_action_links' ), 10, 2 );
46
+
47
+ }
48
+
49
+ /**
50
+ * Add rating icon on plugins page.
51
+ *
52
+ * @since 2.2.0
53
+ * @return void
54
+ */
55
+
56
+ public function _row_meta( $meta_fields, $file ) {
57
+
58
+ if ( $file != 'login-customizer/login-customizer.php' ) {
59
+
60
+ return $meta_fields;
61
+ }
62
+
63
+ echo "<style>.login-customizer-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px; }.login-customizer-rate-stars svg{ fill:#ffb900; } .login-customizer-rate-stars svg:hover{ fill:#ffb900 } .login-customizer-rate-stars svg:hover ~ svg{ fill:none; } </style>";
64
+
65
+ $plugin_rate = "https://wordpress.org/support/plugin/login-customizer/reviews/?rate=5#new-post";
66
+ $plugin_filter = "https://wordpress.org/support/plugin/login-customizer/reviews/?filter=5";
67
+ $plugin_support = "https://wordpress.org/support/plugin/login-customizer/";
68
+ $svg_xmlns = "https://www.w3.org/2000/svg";
69
+ $svg_icon = '';
70
+
71
+ for ( $i = 0; $i < 5; $i++ ) {
72
+ $svg_icon .= "<svg xmlns='" . esc_url( $svg_xmlns ) . "' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>";
73
+ }
74
+ $meta_fields[] = '<a href="' . esc_url( $plugin_support ) . '" target="_blank">' . __( 'Support', 'login-customizer' ) . '</a>';
75
+ // Set icon for thumbsup.
76
+ $meta_fields[] = '<a href="' . esc_url( $plugin_filter ) . '" target="_blank"><span class="dashicons dashicons-thumbs-up"></span>' . __( 'Vote!', 'login-customizer' ) . '</a>';
77
+
78
+ // Set icon for 5-star reviews. v1.1.22
79
+ $meta_fields[] = "<a href='" . esc_url( $plugin_rate ) . "' target='_blank' title='" . esc_html__( 'Rate', 'login-customizer' ) . "'><i class='login-customizer-rate-stars'>" . $svg_icon . "</i></a>";
80
+
81
+ return $meta_fields;
82
+ }
83
+
84
+ /**
85
+ * Add a link to the settings page to the plugins list
86
+ *
87
+ * @since 2.2.0
88
+ * @return void
89
+ */
90
+ public function login_customizer_action_links( $links, $file ) {
91
+
92
+ static $this_plugin;
93
+ $options = get_option( 'login_customizer_settings', array() );
94
+
95
+ if ( empty( $this_plugin ) ) {
96
+
97
+ $this_plugin = 'login-customizer/login-customizer.php';
98
+ }
99
+
100
+ if ( $file == $this_plugin ) {
101
+
102
+ $settings_link = sprintf( esc_html__( '%1$s Customize %2$s', 'login-customizer' ), '<a href="' . add_query_arg(
103
+ array(
104
+ 'autofocus[panel]' => 'logincust_panel',
105
+ 'url' => rawurlencode( get_permalink( $options['page'] ) ),
106
+ ),
107
+ admin_url( 'customize.php' )
108
+ ) . '">', '</a>' );
109
+ $settings_link .= sprintf( esc_html__( ' | %1$s Settings %2$s ', 'login-customizer'), '<a href="' . admin_url( 'admin.php?page=login-customizer-settings' ) . '">', '</a>' );
110
+
111
+ array_unshift( $links, $settings_link );
112
+
113
+ }
114
+
115
+ return $links;
116
+ }
117
+
118
+ /**
119
+ * Disband Model Box
120
+ *
121
+ * [Description] Option form shown on deactivation of Login Customizer
122
+ *
123
+ * @version 2.2.0
124
+ */
125
+ function disband_model() {
126
+ global $pagenow;
127
+
128
+ if ( 'plugins.php' !== $pagenow ) {
129
+ return;
130
+ }
131
+
132
+ new Disband;
133
+
134
+ }
135
+
136
+ }
137
+
src/Plugin.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main Plugin File to run Everything
4
+ *
5
+ * Runs every main function
6
+ *
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ */
12
+
13
+ namespace LoginCustomizer;
14
+
15
+ use LoginCustomizer\Essentials;
16
+ use LoginCustomizer\Includes\Plugin_Meta;
17
+ use LoginCustomizer\Settings\Setup;
18
+ use LoginCustomizer\Customizer\Create_Customizer;
19
+ use LoginCustomizer\Settings\Features\Login_Order;
20
+ use LoginCustomizer\Settings\Features\Custom_Register_Password;
21
+
22
+ /**
23
+ * Constant class.
24
+ *
25
+ * @since 2.2.0
26
+ * @version 2.2.0
27
+ * @access public
28
+ */
29
+
30
+ class Plugin {
31
+
32
+ function __construct() {
33
+
34
+ /**
35
+ * Instance of Essentials Class for Defining Variables
36
+ */
37
+ add_action( 'init', function() {
38
+ new Essentials;
39
+ }, 1 );
40
+
41
+
42
+ // Customizer Settings Creation
43
+ $customizer_settings = new Create_Customizer;
44
+ $customizer_settings->customizer_settings_creation();
45
+
46
+ /**
47
+ * Plugin Settings API and Plugin Meta
48
+ */
49
+ $settings = new Setup;
50
+
51
+ // PLugin Meta in Plugins.php
52
+ $plugin_meta = new Plugin_Meta;
53
+ $plugin_meta->hooks();
54
+
55
+
56
+ /**
57
+ * Settings
58
+ */
59
+
60
+ $logincust_setting = get_option( 'logincust_setting' );
61
+ $login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : '';
62
+ $enable_reg_pass_field = isset( $logincust_setting['enable_reg_pass_field'] ) ? $logincust_setting['enable_reg_pass_field'] : 'off';
63
+
64
+
65
+ //Custom Register Fields if option is enbled from Login Customizer and WordPress Settings
66
+ if ( 'off' != $enable_reg_pass_field && get_option( 'users_can_register' ) !== '0' ) {
67
+ new Custom_Register_Password;
68
+ }
69
+
70
+ //Login Order
71
+ if ( 'default' != $login_order ) {
72
+ new Login_Order();
73
+ }
74
+
75
+ }
76
+ }
src/Settings/API.php ADDED
@@ -0,0 +1,694 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * login Customizer Settings API
5
+ *
6
+ * @package LoginCustomizer
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ * @since 2.2.0
12
+ *
13
+ */
14
+
15
+ namespace LoginCustomizer\Settings;
16
+
17
+ class API {
18
+
19
+ /**
20
+ * settings sections array
21
+ *
22
+ * @var array
23
+ */
24
+ protected $settings_sections = array();
25
+
26
+ /**
27
+ * Settings fields array
28
+ *
29
+ * @var array
30
+ */
31
+ protected $settings_fields = array();
32
+
33
+ public function __construct() {
34
+
35
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
36
+
37
+ }
38
+
39
+ /**
40
+ * Enqueue scripts and styles
41
+ */
42
+ function admin_enqueue_scripts( $hook ) {
43
+
44
+ if( $hook != 'toplevel_page_login-customizer-settings' ) {
45
+ return;
46
+ }
47
+
48
+ wp_enqueue_style( 'login_customizer_stlye', plugins_url( '/Assets/CSS/style.css', __FILE__ ), array(), LOGINCUST_FREE_VERSION );
49
+ }
50
+
51
+ /**
52
+ * Set settings sections
53
+ *
54
+ * @param array $sections setting sections array
55
+ */
56
+ function set_sections( $sections ) {
57
+ $this->settings_sections = $sections;
58
+
59
+ return $this;
60
+ }
61
+
62
+ /**
63
+ * Add a single section
64
+ *
65
+ * @param array $section
66
+ */
67
+ function add_section( $section ) {
68
+ $this->settings_sections[] = $section;
69
+
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ * Set settings fields
75
+ *
76
+ * @param array $fields settings fields array
77
+ */
78
+ function set_fields( $fields ) {
79
+ $this->settings_fields = $fields;
80
+
81
+ return $this;
82
+ }
83
+
84
+ function add_field( $section, $field ) {
85
+ $defaults = array(
86
+ 'name' => '',
87
+ 'label' => '',
88
+ 'desc' => '',
89
+ 'type' => 'text'
90
+ );
91
+
92
+ $arg = wp_parse_args( $field, $defaults );
93
+ $this->settings_fields[$section][] = $arg;
94
+
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Initialize and registers the settings sections and fileds to WordPress
100
+ *
101
+ * Usually this should be called at `admin_init` hook.
102
+ *
103
+ * This function gets the initiated settings sections and fields. Then
104
+ * registers them to WordPress and ready for use.
105
+ */
106
+ function admin_init() {
107
+ //register settings sections
108
+ foreach ( $this->settings_sections as $section ) {
109
+ if ( false == get_option( $section['id'] ) ) {
110
+ add_option( $section['id'] );
111
+ }
112
+
113
+ if ( isset( $section['desc'] ) && !empty( $section['desc'] ) ) {
114
+ $section['desc'] = '<div class="inside">' . $section['desc'] . '</div>';
115
+ $callback = call_user_func( array( $this, 'get_description' ), $section['desc'] );
116
+ } else if ( isset( $section['callback'] ) ) {
117
+ $callback = $section['callback'];
118
+ } else {
119
+ $callback = null;
120
+ }
121
+
122
+ add_settings_section( $section['id'], $section['title'], $callback, $section['id'] );
123
+ }
124
+
125
+ //register settings fields
126
+ foreach ( $this->settings_fields as $section => $field ) {
127
+ foreach ( $field as $option ) {
128
+
129
+ $name = $option['name'];
130
+ $type = isset( $option['type'] ) ? $option['type'] : 'text';
131
+ $label = isset( $option['label'] ) ? $option['label'] : '';
132
+ $callback = isset( $option['callback'] ) ? $option['callback'] : array( $this, 'callback_' . $type );
133
+
134
+ $args = array(
135
+ 'id' => $name,
136
+ 'class' => isset( $option['class'] ) ? $option['class'] : $name,
137
+ 'label_for' => "{$section}[{$name}]",
138
+ 'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
139
+ 'name' => $label,
140
+ 'section' => $section,
141
+ 'size' => isset( $option['size'] ) ? $option['size'] : null,
142
+ 'options' => isset( $option['options'] ) ? $option['options'] : '',
143
+ 'std' => isset( $option['default'] ) ? $option['default'] : '',
144
+ 'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
145
+ 'type' => $type,
146
+ 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
147
+ 'min' => isset( $option['min'] ) ? $option['min'] : '',
148
+ 'max' => isset( $option['max'] ) ? $option['max'] : '',
149
+ 'step' => isset( $option['step'] ) ? $option['step'] : '',
150
+ 'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : '',
151
+ );
152
+
153
+ add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args );
154
+ }
155
+ }
156
+
157
+ // creates our settings in the options table
158
+ foreach ( $this->settings_sections as $section ) {
159
+ register_setting( $section['id'], $section['id'], array( $this, 'sanitize_options' ) );
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Get field description for display
165
+ *
166
+ * @param array $args settings field args
167
+ */
168
+ public function get_field_description( $args ) {
169
+ if ( ! empty( $args['desc'] ) ) {
170
+ $desc = sprintf( '<p class="description">%s</p>', $args['desc'] );
171
+ } else {
172
+ $desc = '';
173
+ }
174
+
175
+ return $desc;
176
+ }
177
+
178
+ /**
179
+ * Displays a text field for a settings field
180
+ *
181
+ * @param array $args settings field args
182
+ */
183
+ function callback_text( $args ) {
184
+
185
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
186
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
187
+ $type = isset( $args['type'] ) ? $args['type'] : 'text';
188
+ $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
189
+
190
+ $html = sprintf( '<input type="%1$s" class="%2$s-text" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder );
191
+ $html .= $this->get_field_description( $args );
192
+
193
+ echo $html;
194
+ }
195
+
196
+ /**
197
+ * Displays a text field for a settings field with type email.
198
+ *
199
+ * @param array $args settings field args
200
+ * @since 2.2.0 */
201
+ function callback_email( $args ) {
202
+
203
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
204
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
205
+ $type = isset( $args['type'] ) ? $args['type'] : 'email';
206
+ $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
207
+ $multiple = empty( $args['multiple'] ) ? '' : 'multiple';
208
+
209
+ $html = sprintf( '<input type="%1$s" class="%2$s-text" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s%7$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder, $multiple );
210
+ $html .= $this->get_field_description( $args );
211
+
212
+ echo $html;
213
+ }
214
+
215
+ /**
216
+ * Displays a url field for a settings field
217
+ *
218
+ * @param array $args settings field args
219
+ */
220
+ function callback_url( $args ) {
221
+ $this->callback_text( $args );
222
+ }
223
+
224
+ /**
225
+ * Displays a number field for a settings field
226
+ *
227
+ * @param array $args settings field args
228
+ */
229
+ function callback_number( $args ) {
230
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
231
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
232
+ $type = isset( $args['type'] ) ? $args['type'] : 'number';
233
+ $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
234
+ $min = !isset( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
235
+ $max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
236
+ $step = empty( $args['max'] ) ? '' : ' step="' . $args['step'] . '"';
237
+
238
+ $html = sprintf( '<input type="%1$s" class="%2$s-number" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s%7$s%8$s%9$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step );
239
+ $html .= $this->get_field_description( $args );
240
+
241
+ echo $html;
242
+ }
243
+
244
+ /**
245
+ * Displays a checkbox for a settings field
246
+ *
247
+ * @param array $args settings field args
248
+ * @version 1.0.23
249
+ */
250
+ function callback_checkbox( $args ) {
251
+
252
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
253
+
254
+ $html = '<fieldset>';
255
+ $html .= sprintf( '<label for="wpb-%1$s[%2$s]">', $args['section'], $args['id'] );
256
+ $html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
257
+ $html .= sprintf( '<input type="checkbox" class="checkbox logincust-check-hidden" id="wpb-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
258
+ $html .= sprintf( '%2$s%1$s</label>', $args['desc'], '<span class="logincust-checkbox"></span>' );
259
+ $html .= '</fieldset>';
260
+
261
+ echo $html;
262
+ }
263
+
264
+ /**
265
+ * Displays a multicheckbox a settings field
266
+ *
267
+ * @param array $args settings field args
268
+ * @version 1.0.23
269
+ */
270
+ function callback_multicheck( $args ) {
271
+
272
+ $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
273
+ $html = '<fieldset>';
274
+ $html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
275
+ foreach ( $args['options'] as $key => $label ) {
276
+ $checked = isset( $value[$key] ) ? $value[$key] : '0';
277
+ $html .= sprintf( '<label for="wpb-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
278
+ $html .= sprintf( '<input type="checkbox" class="checkbox logincust-check-hidden" id="wpb-%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ) );
279
+ $html .= sprintf( '%2$s%1$s</label><br>', $label, '<span class="logincust-checkbox"></span>' );
280
+ }
281
+
282
+ $html .= $this->get_field_description( $args );
283
+ $html .= '</fieldset>';
284
+
285
+ echo $html;
286
+ }
287
+
288
+ /**
289
+ * Displays a multicheckbox a settings field
290
+ *
291
+ * @param array $args settings field args
292
+ */
293
+ function callback_radio( $args ) {
294
+
295
+ $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
296
+ $html = '<fieldset>';
297
+
298
+ foreach ( $args['options'] as $key => $label ) {
299
+ $html .= sprintf( '<label for="wpb-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
300
+ $html .= sprintf( '<input type="radio" class="radio" id="wpb-%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $value, $key, false ) );
301
+ $html .= sprintf( '%1$s</label><br>', $label );
302
+ }
303
+
304
+ $html .= $this->get_field_description( $args );
305
+ $html .= '</fieldset>';
306
+
307
+ echo $html;
308
+ }
309
+
310
+ /**
311
+ * Displays a selectbox for a settings field
312
+ *
313
+ * @param array $args settings field args
314
+ */
315
+ function callback_select( $args ) {
316
+
317
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
318
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
319
+ $html = sprintf( '<select class="%1$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
320
+
321
+ foreach ( $args['options'] as $key => $label ) {
322
+ $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $value, $key, false ), $label );
323
+ }
324
+
325
+ $html .= sprintf( '</select>' );
326
+ $html .= $this->get_field_description( $args );
327
+
328
+ echo $html;
329
+ }
330
+
331
+ /**
332
+ * Displays a textarea for a settings field
333
+ *
334
+ * @param array $args settings field args
335
+ */
336
+ function callback_textarea( $args ) {
337
+
338
+ $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
339
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
340
+ $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="'.$args['placeholder'].'"';
341
+
342
+ $html = sprintf( '<textarea rows="5" cols="55" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]"%4$s>%5$s</textarea>', $size, $args['section'], $args['id'], $placeholder, $value );
343
+ $html .= $this->get_field_description( $args );
344
+
345
+ echo $html;
346
+ }
347
+
348
+ /**
349
+ * Displays a textarea for a settings field
350
+ *
351
+ * @param array $args settings field args
352
+ * @return string
353
+ */
354
+ function callback_html( $args ) {
355
+ echo $this->get_field_description( $args );
356
+ }
357
+
358
+ /**
359
+ * Displays a rich text textarea for a settings field
360
+ *
361
+ * @param array $args settings field args
362
+ */
363
+ function callback_wysiwyg( $args ) {
364
+
365
+ $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
366
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : '500px';
367
+
368
+ echo '<div style="max-width: ' . $size . ';">';
369
+
370
+ $editor_settings = array(
371
+ 'teeny' => true,
372
+ 'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
373
+ 'textarea_rows' => 10,
374
+ 'media_buttons' => false,
375
+ );
376
+
377
+ if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
378
+ $editor_settings = array_merge( $editor_settings, $args['options'] );
379
+ }
380
+
381
+ wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings );
382
+
383
+ echo '</div>';
384
+
385
+ echo $this->get_field_description( $args );
386
+ }
387
+
388
+ /**
389
+ * Displays a file upload field for a settings field
390
+ *
391
+ * @param array $args settings field args
392
+ */
393
+ function callback_file( $args ) {
394
+
395
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
396
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
397
+ $id = $args['section'] . '[' . $args['id'] . ']';
398
+ $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File' );
399
+
400
+ $html = sprintf( '<input type="text" class="%1$s-text wpsa-url" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
401
+ $html .= '<input type="button" class="button wpsa-browse" value="' . $label . '" />';
402
+ $html .= $this->get_field_description( $args );
403
+
404
+ echo $html;
405
+ }
406
+
407
+ /**
408
+ * Displays a password field for a settings field
409
+ *
410
+ * @param array $args settings field args
411
+ */
412
+ function callback_password( $args ) {
413
+
414
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
415
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
416
+
417
+ $html = sprintf( '<input type="password" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
418
+ $html .= $this->get_field_description( $args );
419
+
420
+ echo $html;
421
+ }
422
+
423
+ /**
424
+ * Displays a color picker field for a settings field
425
+ *
426
+ * @param array $args settings field args
427
+ */
428
+ function callback_color( $args ) {
429
+
430
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
431
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
432
+
433
+ $html = sprintf( '<input type="text" class="%1$s-text wp-color-picker-field" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s" data-default-color="%5$s" />', $size, $args['section'], $args['id'], $value, $args['std'] );
434
+ $html .= $this->get_field_description( $args );
435
+
436
+ echo $html;
437
+ }
438
+
439
+ /**
440
+ * Sanitize callback for Settings API
441
+ *
442
+ * @return mixed
443
+ */
444
+ function sanitize_options( $options ) {
445
+
446
+ if ( !$options ) {
447
+ return $options;
448
+ }
449
+
450
+ foreach( $options as $option_slug => $option_value ) {
451
+ $sanitize_callback = $this->get_sanitize_callback( $option_slug );
452
+
453
+ // If callback is set, call it
454
+ if ( $sanitize_callback ) {
455
+ $options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value );
456
+ continue;
457
+ }
458
+ }
459
+
460
+ return $options;
461
+ }
462
+
463
+ /**
464
+ * Get sanitization callback for given option slug
465
+ *
466
+ * @param string $slug option slug
467
+ *
468
+ * @return mixed string or bool false
469
+ */
470
+ function get_sanitize_callback( $slug = '' ) {
471
+ if ( empty( $slug ) ) {
472
+ return false;
473
+ }
474
+
475
+ // Iterate over registered fields and see if we can find proper callback
476
+ foreach( $this->settings_fields as $section => $options ) {
477
+ foreach ( $options as $option ) {
478
+ if ( $option['name'] != $slug ) {
479
+ continue;
480
+ }
481
+
482
+ // Return the callback name
483
+ return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false;
484
+ }
485
+ }
486
+
487
+ return false;
488
+ }
489
+
490
+ /**
491
+ * Get the value of a settings field
492
+ *
493
+ * @param string $option settings field name
494
+ * @param string $section the section name this field belongs to
495
+ * @param string $default default text if it's not found
496
+ * @return string
497
+ */
498
+ function get_option( $option, $section, $default = '' ) {
499
+
500
+ $options = get_option( $section );
501
+
502
+ if ( isset( $options[$option] ) ) {
503
+ return $options[$option];
504
+ }
505
+
506
+ return $default;
507
+ }
508
+
509
+ /**
510
+ * Show navigations as tab
511
+ *
512
+ * Shows all the settings section labels as tab
513
+ */
514
+ function show_navigation() {
515
+ $html = '<h2 class="nav-tab-wrapper">';
516
+
517
+ foreach ( $this->settings_sections as $tab ) {
518
+ if ( 'logincust_premium' != $tab['id'] ) {
519
+ $html .= sprintf( '<a href="#%1$s" class="nav-tab" id="%1$s-tab">%2$s</a>', $tab['id'], $tab['title'] );
520
+ }
521
+ }
522
+
523
+ $html .= '</h2>';
524
+
525
+ echo $html;
526
+ }
527
+
528
+ /**
529
+ * Show the section settings forms
530
+ *
531
+ * This function displays every sections in a different form.
532
+ * @since 2.2.0 * @version 1.1.6
533
+ */
534
+ function show_forms() {
535
+ ?>
536
+ <div class="metabox-holder logincust-settings">
537
+ <?php foreach ( $this->settings_sections as $form ) : ?>
538
+ <div id="<?php echo $form['id']; ?>" class="group" style="display: none;">
539
+ <form method="post" action="options.php">
540
+ <?php
541
+ do_action( 'wsa_form_top_' . $form['id'], $form );
542
+ settings_fields( $form['id'] );
543
+ $this->do_settings_sections( $form['id'] );
544
+ do_action( 'wsa_form_bottom_' . $form['id'], $form );
545
+ if ( isset( $this->settings_fields[ $form['id'] ] ) ) : ?>
546
+ <div style="padding-left: 10px">
547
+ <?php submit_button(); ?>
548
+ </div>
549
+ <?php endif; ?>
550
+ </form>
551
+ </div>
552
+ <?php endforeach; ?>
553
+
554
+ </div>
555
+ <!-- Plugin Support Advertisement -->
556
+ <div class="logincust-advertise">
557
+ <div class="logincust-support">
558
+ <h3><span class="dashicons dashicons-editor-help"></span>&nbsp;&nbsp;<?php _e( 'Plugin Support', 'login-customizer' ); ?></h3>
559
+ <hr style=" border-top: 1px solid #000; border-bottom: none">
560
+ <div class="inside">
561
+ <p><?php _e( 'Got a Question, Idea, Problem or Praise?', 'login-customizer' ); ?></p>
562
+ <ul>
563
+ <li>» <a href="https://wordpress.org/support/plugin/login-customizer" target="_blank"><?php _e( 'Support Request', 'login-customizer' ); ?></a></li>
564
+ <!-- <li>» <a href="#" target="_blank">Common Caching Issues Resolutions</a></li> -->
565
+ </ul>
566
+ </div>
567
+ </div> <!-- logincust-support -->
568
+ </div>
569
+ <?php
570
+ $this->script();
571
+ }
572
+
573
+ /**
574
+ * Tabbable JavaScript codes & Initiate Color Picker
575
+ *
576
+ * This code uses localstorage for displaying active tabs
577
+ */
578
+ function script() {
579
+ ?>
580
+ <script>
581
+ jQuery(document).ready(function($) {
582
+ //Initiate Color Picker
583
+ // $('.wp-color-picker-field').wpColorPicker();
584
+
585
+ // Switches option sections
586
+ $('.group').hide();
587
+ var activetab = '';
588
+ if (typeof(localStorage) != 'undefined' ) {
589
+ activetab = localStorage.getItem("activetab");
590
+ }
591
+ if (activetab != '' && $(activetab).length ) {
592
+ $(activetab).fadeIn();
593
+ } else {
594
+ $('.group:first').fadeIn();
595
+ }
596
+ $('.group .collapsed').each(function(){
597
+ $(this).find('input:checked').parent().parent().parent().nextAll().each(
598
+ function(){
599
+ if ($(this).hasClass('last')) {
600
+ $(this).removeClass('hidden');
601
+ return false;
602
+ }
603
+ $(this).filter('.hidden').removeClass('hidden');
604
+ });
605
+ });
606
+
607
+ if ( activetab != '' && $( activetab + '-tab' ).length ) {
608
+ $( activetab + '-tab' ).addClass('nav-tab-active');
609
+ }
610
+ else {
611
+ $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
612
+ }
613
+ $('.nav-tab-wrapper a:not(".logincust-premium")').click(function(evt) {
614
+ $('.nav-tab-wrapper a').removeClass('nav-tab-active');
615
+ $(this).addClass('nav-tab-active').blur();
616
+ var clicked_group = $(this).attr('href');
617
+ if (typeof(localStorage) != 'undefined' ) {
618
+ localStorage.setItem("activetab", $(this).attr('href'));
619
+ }
620
+ $('.group').hide();
621
+ $(clicked_group).fadeIn();
622
+ evt.preventDefault();
623
+ });
624
+
625
+ $('.wpsa-browse').on('click', function (event) {
626
+ event.preventDefault();
627
+
628
+ var self = $(this);
629
+
630
+ // Create the media frame.
631
+ var file_frame = wp.media.frames.file_frame = wp.media({
632
+ title: self.data('uploader_title'),
633
+ button: {
634
+ text: self.data('uploader_button_text'),
635
+ },
636
+ multiple: false
637
+ });
638
+
639
+ file_frame.on('select', function () {
640
+ attachment = file_frame.state().get('selection').first().toJSON();
641
+ self.prev('.wpsa-url').val(attachment.url).change();
642
+ });
643
+
644
+ // Finally, open the modal
645
+ file_frame.open();
646
+ });
647
+ });
648
+ </script>
649
+ <?php
650
+ $this->_style_fix();
651
+ }
652
+
653
+ function _style_fix() {
654
+ global $wp_version;
655
+
656
+ if ( version_compare( $wp_version, '3.8', '<=' ) ) : ?>
657
+ <style type="text/css">
658
+ /** WordPress 3.8 Fix **/
659
+ .form-table th { padding: 20px 10px; }
660
+ #wpbody-content .metabox-holder { padding-top: 5px; }
661
+ </style>
662
+ <?php
663
+ endif;
664
+ }
665
+
666
+ /**
667
+ * Get Section Description
668
+ * @param string $desc [description]
669
+ */
670
+ function get_description( $desc ) {
671
+ return $desc;
672
+ }
673
+
674
+ /**
675
+ * Prints out all settings sections added to a particular settings page
676
+ */
677
+ function do_settings_sections( $page ) {
678
+ global $wp_settings_sections, $wp_settings_fields;
679
+
680
+ if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
681
+ return;
682
+
683
+ foreach ( (array) $wp_settings_sections[$page] as $section ) {
684
+ echo "<h3>{$section['title']}</h3>\n";
685
+ echo $section['callback'] ;
686
+ if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) )
687
+ continue;
688
+ echo '<table class="form-table">';
689
+ do_settings_fields($page, $section['id']);
690
+ echo '</table>';
691
+ }
692
+ }
693
+
694
+ }
src/Settings/Assets/CSS/style.css ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Logincust Style for Settings Page.
3
+ */
4
+ .admin-settings-title{
5
+
6
+ padding-bottom: 3px;
7
+ margin-top: 0.5rem;
8
+ padding-right: 14px;
9
+ display: flex;
10
+ margin-bottom: 15px !important;
11
+ }
12
+ .settings-img{
13
+ padding-bottom: 0px;
14
+ margin-top: 0;
15
+ padding-right: 5px;
16
+ margin-bottom: 0px;
17
+ max-height: 35px;
18
+ display: inline-block;
19
+ vertical-align: middle;
20
+ max-width: 40px;
21
+ }
22
+
23
+ .logincust_page_logincust-settings #normal-sortables{
24
+ padding-top: 20px;
25
+ }
26
+ #wpbrigade_infs_general_videobox h3{
27
+ padding: 0px 10px 10px;
28
+ border-bottom: 1px solid #eee;
29
+ }
30
+ .wpbrigade_videobox .column{
31
+ width: 50%;
32
+ float: left;
33
+ padding-right: 2.5%;
34
+ border-right: 1px solid #ebebeb;
35
+ padding-bottom: 2em;
36
+ }
37
+ .wpbrigade_videobox .column h2{
38
+ font-size: 16px;
39
+ margin-bottom: 20px;
40
+ }
41
+ .wpbrigade_videobox .column.right{
42
+ margin-right: 0;
43
+ padding-right: 0;
44
+ padding-left: 2.5%;
45
+ border: 0;
46
+ max-width: 49%;
47
+ }
48
+ .wpbrigade_videobox::after{
49
+ content: '';
50
+ display: table;
51
+ clear: both;
52
+ }
53
+ .wpbrigade-video-link{
54
+ width: 100%;
55
+ max-width: 200px;
56
+ float: left;
57
+ margin: 0 1.5em 1.5em 0;
58
+ }
59
+ .wpbrigade-video-link img{
60
+ max-width: 100%;
61
+ height: auto;
62
+ }
63
+ .wpbrigade-video-popup-overlay{
64
+ position: fixed;
65
+ height: 100%;
66
+ width: 100%;
67
+ top: 0;
68
+ left: 0;
69
+ background: rgba(0,0,0, .9);
70
+ display: none;
71
+ }
72
+ .wpbrigade-video-popup{
73
+ width: 600px;
74
+ position: absolute;
75
+ top: 50%;
76
+ left: 50%;
77
+ background: #fff;
78
+ height: 450px;
79
+ -webkit-transform: translate(-50%, -50%);
80
+ -moz-transform: translate(-50%, -50%);
81
+ -ms-transform: translate(-50%, -50%);
82
+ transform: translate(-50%, -50%);
83
+ padding: 50px 20px 20px;
84
+ }
85
+ .wpbrigade-video-popup iframe{
86
+ width: 100%;
87
+ height: 380px;
88
+ }
89
+ .wpbrigade-close-popup{
90
+ position: absolute;
91
+ top: 10px;
92
+ right: 20px;
93
+ cursor: pointer;
94
+ }
95
+ .wpbrigade-video-description-wrapper{
96
+ overflow: hidden;
97
+ }
98
+ .wpbrigade-video-description-wrapper p{
99
+ margin: 0;
100
+ }
101
+ .wpbrigade-video-description-wrapper p ~ p{
102
+ margin-top: 10px;
103
+ }
104
+ .wpbrigade-heading {
105
+ font-size: 16px;
106
+ margin-bottom: 20px;
107
+ font-weight: 400;
108
+ margin: 0;
109
+ padding: 9px 0 4px;
110
+ line-height: 29px;
111
+ display: block;
112
+ }
113
+ .logincust-premium{
114
+ float: left;
115
+ border: 1px solid #ccc;
116
+ border-bottom: none;
117
+ margin-left: .5em;
118
+ padding: 5px 10px;
119
+ font-size: 14px;
120
+ line-height: 24px;
121
+ background: #444;
122
+ color: #fff;
123
+ text-decoration: none;
124
+ }
125
+ .logincust-premium:hover, .logincust-premium:focus{
126
+ color: #fff;
127
+ background-color: #616060;
128
+ }
129
+ html[dir="rtl"] .logincust-premium{
130
+ float: right;
131
+ margin-right: .5em;
132
+ margin-left: 0;
133
+ }
134
+ .dashicons-star-filled:before {
135
+ color: #FFD700;
136
+ font-size: 14px;
137
+ }
138
+ #wpbody-content .metabox-holder.logincust-settings{
139
+ padding-top: 25px;
140
+ }
141
+ #wpbody-content .form-table{
142
+ margin-top: 15px;
143
+ }
144
+ .logincust-settings{
145
+ box-sizing: border-box;
146
+ width: 70%;
147
+ float: left;
148
+ padding-right: 30px;
149
+ }
150
+ .logincust-advertise {
151
+ float: right;
152
+ max-width: 335px;
153
+ width: 30%;
154
+ }
155
+ .logincust-advertise .inside iframe{
156
+ height: 118px;
157
+ display: block;
158
+ margin: 0 auto;
159
+ width: 100%;
160
+ }
161
+ .advertise-box .inside iframe{
162
+ height: 114px;
163
+ display: block;
164
+ margin: 0 auto;
165
+ }
166
+ .logincust-support{
167
+ background-color: #fff;
168
+ padding: 13px;
169
+ margin-top: 25px;
170
+ }
171
+ .logincust-support h3{
172
+ margin-bottom: 0;
173
+ }
174
+ .advertise-box{
175
+ background-color:#fff;
176
+ color:#000 !important;
177
+ border-color:#734726 !important;
178
+ margin-top: 25px;
179
+ }
180
+ .advertise-box h3{
181
+ color: #fff !important;
182
+ border-color: #23282d !important;
183
+ background-color: #23282d;
184
+ padding: 5px;
185
+ text-align: center;
186
+ }
187
+ .inside-advertise ul li .dashicons-admin-post{
188
+ font-size: 14px;
189
+ }
190
+ .inside-advertise{
191
+ padding-left: 15px;
192
+ padding-right: 15px;
193
+ padding-bottom: 15px;
194
+ }
195
+ .logincust-video{
196
+ margin-top: 25px;
197
+ background-color: #fff;
198
+ padding: 13px;
199
+ }
200
+ .logincust-video h3{
201
+ margin-bottom: 0;
202
+ font-size: 15px;
203
+ }
204
+ .logincust-addon-promotion-video{
205
+ text-align: center;
206
+ }
207
+ .logincust-promotion-big-button{
208
+ margin-top: 2.75%;
209
+ text-align: center
210
+ }
211
+ .logincust-promotion-big-button a{
212
+ border-radius: 5px !important;
213
+ background-color: #338eef !important;
214
+ color: #fff !important;
215
+ border-color: #338eef !important;
216
+ font-weight: 600 !important;
217
+ font-size: 30px !important;
218
+ padding: 10px 30px !important;
219
+ height: auto !important;
220
+ line-height: 1.7em !important;
221
+ border: 2px solid;
222
+ text-shadow: none !important;
223
+ transition: all 300ms ease 0ms;
224
+ }
225
+ .logincust-promotion-big-button a:hover{
226
+ transform: translateY(-10px);
227
+ opacity: 0.9;
228
+ }
229
+ #logincust_setting form>h2{
230
+ display: none;
231
+ }
232
+ #logincust_setting .form-table th {
233
+ padding: 15px 10px 15px 0 !important;
234
+ width: 170px !important;
235
+ }
236
+ .form-table td fieldset label{
237
+ font-size: 13px;
238
+ }
239
+ .site_key, .secret_key, .captcha_theme, .captcha_language, .good_score, .captcha_enable, .privacy_policy, .rename_email_send_to{
240
+ display: none;
241
+ }
242
+
243
+ /*************config-page*******/
244
+
245
+ .logincust-import-export-page h2{
246
+ padding-top: 15px;
247
+ }
248
+
249
+ .export_setting .export-sniper{
250
+ padding: 5px;
251
+ display: none;
252
+ }
253
+ .export_setting .export-text{
254
+ padding: 5px;
255
+ display: none;
256
+ color: #009306;
257
+ }
258
+ .import_setting .import-sniper{
259
+ padding: 5px;
260
+ display: none;
261
+ }
262
+ .import_setting .import-text{
263
+ padding: 5px;
264
+ color: #009306;
265
+ display: none;
266
+ }
267
+
268
+ .import_setting .wrong-import{
269
+ padding: 5px;
270
+ color: #ff0000;
271
+ /*display: none;*/
272
+ }
273
+ /*************config-page*******/
274
+
275
+
276
+ /**********help-page**********/
277
+ .logincust-help-page h2{
278
+ padding-top: 15px;
279
+ }
280
+ .logincust-log-file{
281
+ background: #0085ba !important;
282
+ border-color: #0073aa #006799 #006799 !important;
283
+ -webkit-box-shadow: 0 1px 0 #006799 !important;
284
+ box-shadow: 0 1px 0 #006799 !important;
285
+ color: #fff !important;
286
+ text-decoration: none !important;
287
+ text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
288
+ }
289
+ .log-file-sniper{
290
+ padding: 5px;
291
+ display: none;
292
+ }
293
+ .log-file-text {
294
+ padding: 5px;
295
+ display: none;
296
+ color: #009306;
297
+ }
298
+ /**************help-page***************/
299
+
300
+ /**********license-page**********/
301
+ .logincust-license-page h2{
302
+ padding-top: 15px;
303
+ }
304
+
305
+ /**********license-page**********/
306
+
307
+
308
+ .recapthca-promo-img{
309
+ display: none;
310
+ }
311
+ /*.recapthca-promo-img img{
312
+ margin-left: -9px;
313
+ width: 353%;
314
+ }*/
315
+ .recapthca-promo{
316
+ position: relative;
317
+ }
318
+ .recapthca-promo-link{
319
+ position: absolute;
320
+ top: 0;
321
+ left: 0;
322
+ width: 100%;
323
+ height: 100%;
324
+ background: rgba(0,0,0, .7);
325
+ opacity: 0;
326
+ }
327
+ .recapthca-promo-link span{
328
+ position: absolute;
329
+ top: 50%;
330
+ left: 50%;
331
+ -webkit-transform: translate(-50%, -50%);
332
+ -moz-transform: translate(-50%, -50%);
333
+ -ms-transform: translate(-50%, -50%);
334
+ transform: translate(-50%, -50%);
335
+ content: '';
336
+ font-size: 37px;
337
+ color: #fff;
338
+ width: 100%;
339
+ text-align: center;
340
+ text-transform: capitalize;
341
+ }
342
+ .recapthca-promo:hover .recapthca-promo-link{
343
+ opacity: 1;
344
+ }
345
+
346
+ /*---- Logincust-Settings-Checkbox ----*/
347
+
348
+ /* .checkbox.logincust-check-hidden{
349
+ display: none;
350
+ }
351
+ .logincust-check-hidden + .logincust-checkbox{
352
+ display: inline-block;
353
+ outline: 0;
354
+ width: 32px;
355
+ height: 18px;
356
+ position: relative;
357
+ cursor: pointer;
358
+ -webkit-user-select: none;
359
+ -moz-user-select: none;
360
+ -ms-user-select: none;
361
+ user-select: none;
362
+ vertical-align: middle;
363
+ border-radius: 2em;
364
+ padding: 2px;
365
+ -webkit-transition: all .4s ease;
366
+ transition: all .4s ease;
367
+ border: 2px solid #555d66;
368
+ background: #fff;
369
+ margin-right: 5px;
370
+ margin-top: -4px;
371
+ }
372
+ html[dir="rtl"] .logincust-check-hidden + .logincust-checkbox{
373
+ margin-right: 0;
374
+ margin-left: 5px;
375
+ }
376
+ input[type=checkbox].logincust-check-hidden + .logincust-checkbox:after {
377
+ position: relative;
378
+ display: block;
379
+ content: "";
380
+ width: 10px;
381
+ height: 10px;
382
+ box-sizing: border-box;
383
+ border:2px solid #555d66;
384
+ border-radius: 2em;
385
+ background: #fbfbfb;
386
+ -webkit-transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
387
+ transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
388
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 0 rgba(0, 0, 0, 0.08);
389
+ left: 0;
390
+ } */
391
+ /* input[type=checkbox].logincust-check-hidden + .logincust-checkbox:active:after{
392
+ border-width: 5px;
393
+ } */
394
+ /* input[type=checkbox].logincust-check-hidden:checked + .logincust-checkbox:after {
395
+ left: 14px;
396
+ background: #33b3db;
397
+ border-color: #fff;
398
+ }
399
+ html[dir="rtl"] input[type=checkbox].logincust-check-hidden:checked + .logincust-checkbox:after {
400
+ left: -14px;
401
+ }
402
+ html[dir="rtl"] .login form .input, .login input[type="text"]{
403
+ margin-right: 0;
404
+ }
405
+ input[type=checkbox].logincust-check-hidden:checked + .logincust-checkbox {
406
+ background: #33b3db;
407
+ border-color: #33b3db;
408
+ }
409
+ input[type=checkbox].logincust-check-hidden:checked + .logincust-checkbox:active:after{
410
+ background: #fff;
411
+ } */
412
+ /*---- !Logincust-Settings-Checkbox ----*/
413
+
414
+ @media screen and (max-width: 1170px) {
415
+
416
+ }
417
+ @media screen and (max-width: 950px) {
418
+
419
+ h1 .nav-tab, h2 .nav-tab, h3 .nav-tab{
420
+ margin: 0 !important;
421
+ }
422
+ }
423
+ @media screen and (max-width: 767px) {
424
+ .logincust-settings{
425
+ width: 100%;
426
+ padding-right: 0;
427
+ }
428
+ .logincust-advertise {
429
+ float: left;
430
+ max-width: 400px;
431
+ width: 100%;
432
+ }
433
+ }
src/Settings/Assets/logincust-settings-icon.png ADDED
Binary file
src/Settings/Features/Custom_Register_Password.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Login Customizer Custom_Password
4
+ *
5
+ * Description: Enable Custom Password for Register User.
6
+ *
7
+ * @package Login Customizer
8
+ * @since 2.2.0
9
+ */
10
+
11
+ namespace LoginCustomizer\Settings\Features;
12
+ use WP_Error;
13
+
14
+ class Custom_Register_Password {
15
+
16
+ /* * * * * * * * * *
17
+ * Class constructor
18
+ * * * * * * * * * */
19
+ public function __construct() {
20
+
21
+ $this->add_custom_fields();
22
+ }
23
+
24
+ /**
25
+ * Custom Password Fields on Register form
26
+ *
27
+ * @return void
28
+ */
29
+ public function add_custom_fields() {
30
+
31
+ add_action( 'register_form', array( $this, 'logincust_reg_password_fields' ) );
32
+ add_filter( 'registration_errors', array( $this, 'logincust_reg_pass_errors' ), 10, 3 );
33
+ add_filter( 'random_password', array( $this, 'logincust_set_password' ) );
34
+ add_action( 'register_new_user', array( $this, 'update_default_password_nag' ) );
35
+ add_filter( 'wp_new_user_notification_email', array( $this, 'logincust_new_user_email_notification' ) );
36
+ }
37
+
38
+ /**
39
+ * Custom Password Fields on Registration Form.
40
+ *
41
+ * @access public
42
+ * @since 2.2.0
43
+ * @return string html.
44
+ */
45
+ public function logincust_reg_password_fields() { ?>
46
+ <style>
47
+ #registerform {
48
+ height: 540px !important;
49
+ /* background: transparent; */
50
+ }
51
+ </style>
52
+ <p class="logincust-reg-pass-wrap">
53
+ <label for="logincust-reg-pass"><?php _e( 'Password', 'login-customizer' ); ?></label>
54
+ <input autocomplete="off" name="logincust-reg-pass" id="logincust-reg-pass" class="input" size="20" value="" type="password" />
55
+ </p>
56
+ <p class="logincust-reg-pass-2-wrap">
57
+ <label for="logincust-reg-pass-2"><?php _e( 'Confirm Password', 'login-customizer' ); ?></label>
58
+ <input autocomplete="off" name="logincust-reg-pass-2" id="logincust-reg-pass-2" class="input" size="20" value="" type="password" />
59
+ </p>
60
+ <?php
61
+ }
62
+
63
+ /**
64
+ * Handles password field errors for registration form.
65
+ *
66
+ * @access public
67
+ * @param Object $errors WP_Error
68
+ * @param Object $sanitized_user_login user login.
69
+ * @param Object $user_email user email.
70
+ *
71
+ * @since 2.2.0
72
+ * @return WP_Error object.
73
+ */
74
+ public function logincust_reg_pass_errors( $errors, $sanitized_user_login, $user_email ) {
75
+
76
+ // Ensure passwords aren't empty.
77
+ if ( empty( $_POST['logincust-reg-pass'] ) || empty( $_POST['logincust-reg-pass-2'] ) ) {
78
+ $errors->add( 'empty_password', __( '<strong>ERROR</strong>: Please enter your password twice.', 'login-customizer' ) );
79
+
80
+ // Ensure passwords are matched.
81
+ } elseif ( $_POST['logincust-reg-pass'] != $_POST['logincust-reg-pass-2'] ) {
82
+ $errors->add( 'password_mismatch', __( '<strong>ERROR</strong>: Please enter the same password in the end password fields.', 'login-customizer' ) );
83
+
84
+ // Password Set? assign password to a user_pass
85
+ } else {
86
+ $_POST['user_pass'] = $_POST['logincust-reg-pass'];
87
+ }
88
+
89
+ return $errors;
90
+ }
91
+
92
+ /**
93
+ * Let's set the user password.
94
+ *
95
+ * @access public
96
+ * @param string $password Auto-generated password passed in from filter.
97
+ *
98
+ * @since 2.2.0
99
+ * @return string Password Choose by User.
100
+ */
101
+ public function logincust_set_password( $password ) {
102
+
103
+ // Make sure password field isn't empty.
104
+ if ( ! empty( $_POST['user_pass'] ) ) {
105
+ $password = $_POST['user_pass'];
106
+ }
107
+
108
+ return $password;
109
+ }
110
+
111
+ /**
112
+ * Sets the value of default password nag.
113
+ *
114
+ * @access public
115
+ * @param int $user_id.
116
+ *
117
+ * @since 2.2.0
118
+ */
119
+ public function update_default_password_nag( $user_id ) {
120
+
121
+ // False => User not using WordPress default password.
122
+ update_user_meta( $user_id, 'default_password_nag', false );
123
+ }
124
+
125
+ /**
126
+ * Filter the new user email notification.
127
+ *
128
+ * @param array $email The new user email notification parameters.
129
+ * @return array The new user email notification parameters.
130
+ *
131
+ * @since 2.2.0
132
+ */
133
+ function logincust_new_user_email_notification( $email ) {
134
+
135
+ $email['message'] .= "\r\n" . __( 'If you have already set your own password, you may disregard this email and use the password you have already set.', 'login-customizer' );
136
+
137
+ return $email;
138
+ }
139
+
140
+ } // End Of Class.
141
+
142
+
src/Settings/Features/Login_Order.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * login Customizer Login_Order.
5
+ *
6
+ * Enable user to login using their username and/or email address.
7
+ *
8
+ * @package LoginCustomizer
9
+ * @author WPBrigade
10
+ * @copyright Copyright (c) 2021, WPBrigade
11
+ * @link https://loginpress.pro/
12
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13
+ *
14
+ * @since 2.2.0
15
+ */
16
+
17
+ namespace LoginCustomizer\Settings\Features;
18
+ use WP_Error;
19
+
20
+ class Login_Order {
21
+
22
+ /**
23
+ * Variable that Check for login customizer settings.
24
+ * @access public
25
+ * @var string
26
+ */
27
+ public $logincust_key;
28
+
29
+ /* * * * * * * * * *
30
+ * Class constructor
31
+ * * * * * * * * * */
32
+ public function __construct() {
33
+
34
+ $this->logincust_key = get_option( 'logincust_setting' );
35
+ $this->login_order();
36
+ }
37
+
38
+ /**
39
+ * Custom Login Order
40
+ * Lets you change the order of login to just email or username
41
+ *
42
+ * @return void
43
+ */
44
+ public function login_order() {
45
+
46
+ $wp_version = get_bloginfo( 'version' );
47
+ $logincust_setting = get_option( 'logincust_setting' );
48
+ $login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : 'default';
49
+
50
+ if( 'default' != $login_order ) {
51
+ remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
52
+ add_filter( 'authenticate', array( $this, 'logincust_login_order' ), 20, 3 );
53
+ }
54
+
55
+ if ( 'username' == $login_order && '4.5.0' < $wp_version ) {
56
+ // For WP 4.5.0 remove email authentication.
57
+ remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );
58
+ }
59
+ }
60
+
61
+ /**
62
+ * If an email address is entered in the username field, then look up the matching username and authenticate as per normal, using that.
63
+ *
64
+ * @param string $user
65
+ * @param string $username
66
+ * @param string $password
67
+ * @since 2.2.0
68
+ * @return Results of autheticating via wp_authenticate_username_password(), using the username found when looking up via email.
69
+ */
70
+ function logincust_login_order( $user, $username, $password ) {
71
+
72
+ if ( $user instanceof \WP_User ) {
73
+ return $user;
74
+ }
75
+
76
+ // Is username or password field empty?
77
+ if ( empty( $username ) || empty( $password ) ) {
78
+
79
+ if ( is_wp_error( $user ) )
80
+ return $user;
81
+
82
+ $error = new WP_Error();
83
+
84
+ $empty_username = isset( $this->logincust_key['empty_username'] ) && ! empty( $this->logincust_key['empty_username'] ) ? $this->logincust_key['empty_username'] : sprintf( __( '%1$sError:%2$s The username field is empty.', 'logincust' ), '<strong>', '</strong>' );
85
+
86
+ $empty_password = isset( $this->logincust_key['empty_password'] ) && ! empty( $this->logincust_key['empty_password'] ) ? $this->logincust_key['empty_password'] : sprintf( __( '%1$sError:%2$s The password field is empty.', 'logincust' ), '<strong>', '</strong>' );
87
+
88
+ if ( empty( $username ) )
89
+ $error->add( 'empty_username', $empty_username );
90
+
91
+ if ( empty( $password ) )
92
+ $error->add( 'empty_password', $empty_password );
93
+
94
+ return $error;
95
+ } // close empty_username || empty_password.
96
+
97
+ $logincust_setting = get_option( 'logincust_setting' );
98
+ $login_order = isset( $logincust_setting['login_order'] ) ? $logincust_setting['login_order'] : 'default';
99
+
100
+ // Is login order is set to be 'email'.
101
+ if ( 'email' == $login_order ) {
102
+
103
+ if ( ! empty( $username ) && ! is_email( $username ) ) {
104
+
105
+ $error = new WP_Error();
106
+
107
+ $force_email_login= isset( $this->logincust_key['force_email_login'] ) && ! empty( $this->logincust_key['force_email_login'] ) ? $this->logincust_key['force_email_login'] : sprintf( __( '%1$sError:%2$s Invalid Email Address', 'logincust' ), '<strong>', '</strong>' );
108
+
109
+ $error->add( 'logincust_use_email', $force_email_login );
110
+
111
+ return $error;
112
+ }
113
+
114
+ if ( ! empty( $username ) && is_email( $username ) ) {
115
+
116
+ $username = str_replace( '&', '&amp;', stripslashes( $username ) );
117
+ $user = get_user_by( 'email', $username );
118
+
119
+ if ( isset( $user, $user->user_login, $user->user_status ) && 0 === intval( $user->user_status ) )
120
+ $username = $user->user_login;
121
+ return wp_authenticate_username_password( null, $username, $password );
122
+ }
123
+ } // login order 'email'.
124
+
125
+ // Is login order is set to be 'username'.
126
+ if ( 'username' == $login_order ) {
127
+
128
+ $user = get_user_by('login', $username);
129
+
130
+ $invalid_usrname = array_key_exists( 'incorrect_username', $this->logincust_key ) && ! empty( $this->logincust_key['incorrect_username'] ) ? $this->logincust_key['incorrect_username'] : sprintf( __( '%1$sError:%2$s Invalid Username.', 'logincust' ), '<strong>', '</strong>' );
131
+
132
+ if ( ! $user ) {
133
+ return new WP_Error( 'invalid_username', $invalid_usrname );
134
+ }
135
+
136
+ if ( ! empty( $username ) || ! empty( $password ) ) {
137
+
138
+ $username = str_replace( '&', '&amp;', stripslashes( $username ) );
139
+ $user = get_user_by( 'login', $username );
140
+
141
+ if ( isset( $user, $user->user_login, $user->user_status ) && 0 === intval( $user->user_status ) )
142
+ $username = $user->user_login;
143
+ if ( ! empty( $username ) && is_email( $username ) ) {
144
+ return wp_authenticate_username_password( null, "", "" );
145
+ } else {
146
+ return wp_authenticate_username_password( null, $username, $password );
147
+ }
148
+ }
149
+ } // login order 'username'.
150
+ }
151
+ } // End Of Class.
152
+
src/Settings/Setup.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * login Customizer setup settings
4
+ * Which includes the WordPress Settings API and Log Data.
5
+ *
6
+ * @package LoginCustomizer
7
+ * @author WPBrigade
8
+ * @copyright Copyright (c) 2021, WPBrigade
9
+ * @link https://loginpress.pro/
10
+ * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ * @since 2.2.0
12
+ */
13
+
14
+ namespace LoginCustomizer\Settings;
15
+ use LoginCustomizer\Settings\API;
16
+ use LoginCustomizer\Includes\Help;
17
+
18
+ class Setup {
19
+
20
+ private $settings_api;
21
+
22
+ /**
23
+ * Constructor
24
+ * @since 2.2.0
25
+ *
26
+ */
27
+ function __construct() {
28
+
29
+ $this->settings_api = new API;
30
+ add_action( 'admin_init', array( $this, 'logincust_setting_init' ) );
31
+ add_action( 'admin_menu', array( $this, 'logincust_setting_menu' ) );
32
+ // add_action( 'wp_enqueue_scripts', array( $this, 'logincust_setting_enqueue' ) );
33
+ }
34
+
35
+ /**
36
+ * Initialize Login Customizer settings.
37
+ */
38
+ function logincust_setting_init() {
39
+
40
+ //Set the settings sections & fields.
41
+ $this->settings_api->set_sections( $this->get_settings_sections() );
42
+ $this->settings_api->set_fields( $this->get_settings_fields() );
43
+
44
+ //Initialize settings.
45
+ $this->settings_api->admin_init();
46
+ }
47
+
48
+ /**
49
+ * Login Customizer Admin Menu's
50
+ * @since 2.2.0
51
+ */
52
+ function logincust_setting_menu() {
53
+
54
+ global $submenu;
55
+ add_action( 'admin_head', array( $this, 'loginCustomizerIcon' ) ); // admin_head is a hook loginCustomizerIcon is a function we are adding it to the hook
56
+
57
+ $options = get_option( 'login_customizer_settings', array() );
58
+
59
+ $url = add_query_arg( array(
60
+ 'autofocus[panel]' => 'logincust_panel',
61
+ 'url' => rawurlencode( get_permalink( $options['page'] ) ),
62
+ ),
63
+ admin_url( 'customize.php' )
64
+ );
65
+
66
+ $submenu['themes.php'][] = array( 'Login Customizer', 'manage_options', $url, 'login-customizer' );
67
+ //Side-bar Menu listing
68
+ add_menu_page( __( 'Login Customizer', 'login-customizer' ), __( 'Login Customizer', 'login-customizer' ), 'manage_options', "login-customizer-settings", array( $this, 'plugin_page' ), false, 50 );
69
+
70
+ add_submenu_page( 'login-customizer-settings', __( 'Settings', 'login-customizer' ), __( 'Settings', 'login-customizer' ), 'manage_options', "login-customizer-settings", array( $this, 'plugin_page' ) );
71
+
72
+ add_submenu_page( 'login-customizer-settings', __( 'Customizer', 'login-customizer' ), __( 'Customizer', 'login-customizer' ), 'manage_options', "$url" );
73
+
74
+ add_submenu_page( 'login-customizer-settings', __( 'Help', 'login-customizer' ), __( 'Help', 'login-customizer' ), 'manage_options', "login-customizer-help", array( $this, 'logincust_help_page' ) );
75
+
76
+ }
77
+
78
+ /**
79
+ * Style for Login Customizer Dashicon
80
+ * @since 2.2.0
81
+ * @return void
82
+ */
83
+ function loginCustomizerIcon() {
84
+
85
+ $dashicon = LOGINCUST_FREE_RESOURCES . '/login-customizer-dashicon/icomoon.';
86
+ $rand = '?mhskqw';
87
+
88
+ $ttf = $dashicon . 'ttf' . $rand;
89
+ $woff = $dashicon . 'woff' . $rand;
90
+ $svg = $dashicon . 'svg' . $rand;
91
+ $eotie = $dashicon . 'eot' . $rand . '#iefix';
92
+ $eot = $dashicon . 'eot' . $rand;
93
+
94
+ echo "<style>
95
+ @font-face {
96
+ font-family: 'login-customizer';
97
+ src: url('".$eot."');
98
+ src: url('".$eotie."') format('embedded-opentype'),
99
+ url('".$ttf."') format('truetype'),
100
+ url('".$woff."') format('woff'),
101
+ url('".$svg."') format('svg');
102
+ font-weight: normal;
103
+ font-style: normal;
104
+ }
105
+
106
+ .icon-login-customizer-dashicon:before {
107
+ content: '\\e901';
108
+ color: #fff;
109
+ }
110
+
111
+ #adminmenu li#toplevel_page_login-customizer-settings>a>div.wp-menu-image:before{
112
+ content: '\\e901';
113
+ font-family: 'login-customizer' !important;
114
+ speak: none;
115
+ font-style: normal;
116
+ font-weight: normal;
117
+ font-variant: normal;
118
+ text-transform: none;
119
+ line-height: 1;
120
+
121
+ /* Better Font Rendering =========== */
122
+ -webkit-font-smoothing: antialiased;
123
+ -moz-osx-font-smoothing: grayscale;
124
+ }
125
+ </style>";
126
+ }
127
+
128
+ /**
129
+ * Settings section/s
130
+ * @since 2.2.0
131
+ * @return void
132
+ */
133
+ function get_settings_sections() {
134
+
135
+ $options = get_option( 'login_customizer_settings', array() );
136
+
137
+ $url = add_query_arg(
138
+ array(
139
+ 'autofocus[panel]' => 'logincust_panel',
140
+ 'url' => rawurlencode( get_permalink( $options['page'] ) ),
141
+ ),
142
+ admin_url( 'customize.php' )
143
+ );
144
+
145
+ $logincust_general_tab = array(
146
+ array(
147
+ 'id' => 'logincust_setting',
148
+ 'title' => __( 'Settings', 'login-customizer' ),
149
+ 'desc' => sprintf( __( 'Everything else is customizable through %1$sLogin Customizer%2$s.', 'login-customizer' ), '<a href="' . $url . '">', '</a>' ),
150
+ ),
151
+ );
152
+
153
+ $sections = apply_filters( 'login_customizer_settings_tab', $logincust_general_tab );
154
+
155
+ return $sections;
156
+ }
157
+
158
+ /**
159
+ * Returns all the settings fields
160
+ *
161
+ * @return array settings fields
162
+ */
163
+ function get_settings_fields() {
164
+
165
+ /**
166
+ * [$free_fields array of free fields]
167
+ * @var array
168
+ */
169
+
170
+ $remember_field = array(
171
+ 'name' => 'auto_remember_me',
172
+ 'label' => __( 'Auto Remember Me', 'login-customizer' ),
173
+ 'desc' => __( 'Keep remember me option always checked on login page', 'login-customizer' ),
174
+ 'type' => 'checkbox'
175
+ );
176
+
177
+ $login_order = array(
178
+ 'name' => 'login_order',
179
+ 'label' => __( 'Login Order', 'login-customizer' ),
180
+ 'desc' => __( 'Enable users to login using their username or email address.', 'login-customizer' ),
181
+ 'type' => 'radio',
182
+ 'default' => 'default',
183
+ 'options' => array(
184
+ 'default' => __( 'Both Username Or Email Address', 'login-customizer' ),
185
+ 'username' => __( 'Only Username', 'login-customizer' ),
186
+ 'email' => __( 'Only Email Address', 'login-customizer' )
187
+ )
188
+ );
189
+
190
+ $register_pass_field = array(
191
+ 'name' => 'enable_reg_pass_field',
192
+ 'label' => __( 'Custom Password Fields', 'login-customizer' ),
193
+ 'desc' => __( 'Enable custom password fields on registration form.', 'login-customizer' ),
194
+ 'type' => 'checkbox'
195
+ );
196
+
197
+ $free_fields = get_option( 'users_can_register' ) == '0' ? array( $remember_field, $login_order ) : array( $remember_field, $register_pass_field, $login_order );
198
+
199
+ $_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
200
+ $settings_fields = array( 'logincust_setting' => $_settings_fields );
201
+ $tab = apply_filters( 'login_customizer_settings_fields', $settings_fields );
202
+
203
+ return $tab;
204
+ }
205
+
206
+ /**
207
+ * Create the plugin's settings page.
208
+ * @since 2.2.0
209
+ * @return void
210
+ */
211
+ function plugin_page() {
212
+
213
+ $image = LOGINCUST_FREE_URL.'Settings/Assets/logincust-settings-icon.png';
214
+ echo '<div class="wrap logincust-admin-setting">';
215
+ echo '<h2 class="admin-settings-title">';
216
+ echo "<img src= '$image' class='settings-img'>";
217
+ _e( 'Login Customizer - Design your boring WordPress Login page', 'login-customizer' );
218
+ echo '</h2>';
219
+
220
+ $this->settings_api->show_navigation();
221
+ $this->settings_api->show_forms();
222
+
223
+ echo '</div>';
224
+ }
225
+
226
+ /**
227
+ * Create the plugin's Help page which load the plugin log information.
228
+ * @since 2.2.0
229
+ * @return void
230
+ */
231
+ function logincust_help_page() {
232
+
233
+ $html = '<div class="logincust-help-page">';
234
+ $html .= '<h2>Help & Troubleshooting</h2>';
235
+ $html .= sprintf( __( 'Free plugin support is available on the %1$s plugin support forums%2$s.', 'login-customizer' ), '<a href="https://wordpress.org/support/plugin/login-customizer" target="_blank">', '</a>' );
236
+ // $html .="<br /><br />";
237
+
238
+ $html .="<br />";
239
+ // $html .= 'Found a bug or have a feature request? Please submit an issue <a href="https://loginpress.pro/contact/" target="_blank">here</a>!';
240
+ $html .= '<pre><textarea rows="25" cols="75" readonly="readonly">';
241
+ $html .= Help::get_sysinfo();
242
+ $html .= '</textarea></pre>';
243
+ $html .= '</div>';
244
+ echo $html;
245
+ }
246
+
247
+ /**
248
+ * Get all the pages
249
+ * @since 2.2.0
250
+ * @return array page names with key value pairs
251
+ */
252
+ function get_pages() {
253
+
254
+ $pages = get_pages();
255
+ $pages_options = array();
256
+ if ( $pages ) {
257
+ foreach ($pages as $page) {
258
+ $pages_options[$page->ID] = $page->post_title;
259
+ }
260
+ }
261
+
262
+ return $pages_options;
263
+ }
264
+
265
+ }
266
+