Custom Login Page Customizer | LoginPress - Version 1.0.18

Version Description

  • 2017-07-03 =
  • Enhancement: Set login session expiration time.
  • Bugfix: Compatible with Rename wp-login.php
  • Bugfix: Conflict with Leaflet Maps Marker.
  • Bugfix: Password Reset Success Message
  • Bugfix: Enqueue settings page CSS & JS files only on settings page.
  • Bugfix: Optimized plugin speed and code improvement.
Download this release

Release Info

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

Code changes from version 1.0.17 to 1.0.18

classes/control-presets.php CHANGED
@@ -27,6 +27,7 @@ class LoginPress_Presets extends WP_Customize_Control {
27
  public function enqueue() {
28
  // wp_enqueue_script( 'jt-customize-controls', plugins_url( '/customize-controls.js' , __FILE__ ), array( 'jquery' ) );
29
  // wp_enqueue_script( 'jquery-ui-button' );
 
30
  }
31
 
32
  /**
@@ -94,6 +95,12 @@ class LoginPress_Presets extends WP_Customize_Control {
94
  function loginpress_presets_control_css() {
95
  ?>
96
  <style>
 
 
 
 
 
 
97
  .customize-control-checkbox-multiple .image.ui-buttonset input[type=radio] {
98
  height: auto;
99
  }
27
  public function enqueue() {
28
  // wp_enqueue_script( 'jt-customize-controls', plugins_url( '/customize-controls.js' , __FILE__ ), array( 'jquery' ) );
29
  // wp_enqueue_script( 'jquery-ui-button' );
30
+
31
  }
32
 
33
  /**
95
  function loginpress_presets_control_css() {
96
  ?>
97
  <style>
98
+ #customize-theme-controls #accordion-section-customize_presets .accordion-section-title{
99
+ background-color: #FFD700;
100
+ }
101
+ #customize-controls #accordion-section-customize_presets:hover>.accordion-section-title{
102
+ background-color: #FFD700;
103
+ }
104
  .customize-control-checkbox-multiple .image.ui-buttonset input[type=radio] {
105
  height: auto;
106
  }
classes/loginpress-settings-api.php CHANGED
@@ -30,11 +30,15 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
30
  /**
31
  * Enqueue scripts and styles
32
  */
33
- function admin_enqueue_scripts() {
34
- wp_enqueue_style( 'wp-color-picker' );
 
 
 
 
 
35
 
36
  wp_enqueue_media();
37
- wp_enqueue_script( 'wp-color-picker' );
38
  wp_enqueue_script( 'jquery' );
39
  }
40
 
@@ -201,7 +205,7 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
201
  $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
202
  $type = isset( $args['type'] ) ? $args['type'] : 'number';
203
  $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
204
- $min = empty( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
205
  $max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
206
  $step = empty( $args['max'] ) ? '' : ' step="' . $args['step'] . '"';
207
 
@@ -338,7 +342,8 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
338
  $editor_settings = array(
339
  'teeny' => true,
340
  'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
341
- 'textarea_rows' => 10
 
342
  );
343
 
344
  if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
@@ -578,7 +583,7 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
578
  <script>
579
  jQuery(document).ready(function($) {
580
  //Initiate Color Picker
581
- $('.wp-color-picker-field').wpColorPicker();
582
 
583
  // Switches option sections
584
  $('.group').hide();
30
  /**
31
  * Enqueue scripts and styles
32
  */
33
+ function admin_enqueue_scripts( $hook ) {
34
+
35
+ if( $hook != 'toplevel_page_loginpress-settings' ) {
36
+ return;
37
+ }
38
+ // wp_enqueue_style( 'wp-color-picker' );
39
+ // wp_enqueue_script( 'wp-color-picker' );
40
 
41
  wp_enqueue_media();
 
42
  wp_enqueue_script( 'jquery' );
43
  }
44
 
205
  $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
206
  $type = isset( $args['type'] ) ? $args['type'] : 'number';
207
  $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
208
+ $min = !isset( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
209
  $max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
210
  $step = empty( $args['max'] ) ? '' : ' step="' . $args['step'] . '"';
211
 
342
  $editor_settings = array(
343
  'teeny' => true,
344
  'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
345
+ 'textarea_rows' => 10,
346
+ 'media_buttons' => false,
347
  );
348
 
349
  if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
583
  <script>
584
  jQuery(document).ready(function($) {
585
  //Initiate Color Picker
586
+ // $('.wp-color-picker-field').wpColorPicker();
587
 
588
  // Switches option sections
589
  $('.group').hide();
classes/loginpress-setup.php CHANGED
@@ -93,6 +93,31 @@ class LoginPress_Settings {
93
  function get_settings_fields() {
94
 
95
  $_free_fields = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  array(
97
  'name' => 'reset_settings',
98
  'label' => __( 'Reset Default Settings', 'loginpress' ),
93
  function get_settings_fields() {
94
 
95
  $_free_fields = array(
96
+ array(
97
+ 'name' => 'session_expiration',
98
+ 'label' => __( 'Session Expire', 'loginpress' ),
99
+ 'desc' => __( 'Set the session expiration time in minutes. e.g: 10', 'loginpress' ),
100
+ 'placeholder' => __( '10', 'loginpress' ),
101
+ 'min' => 0,
102
+ // 'max' => 100,
103
+ 'step' => '1',
104
+ 'type' => 'number',
105
+ 'default' => 'Title',
106
+ 'sanitize_callback' => 'intval'
107
+ ),
108
+ // array(
109
+ // 'name' => 'enable_privacy_policy',
110
+ // 'label' => __( 'Enable Privacy Policy', 'loginpress' ),
111
+ // 'desc' => __( 'Enable Privacy Policy checkbox on registration page.', 'loginpress' ),
112
+ // 'type' => 'checkbox'
113
+ // ),
114
+ // array(
115
+ // 'name' => 'privacy_policy',
116
+ // 'label' => __( 'Privacy & Policy', 'loginpress' ),
117
+ // 'desc' => __( 'Right down the privacy and policy description.', 'loginpress' ),
118
+ // 'type' => 'wysiwyg',
119
+ // 'default' => __( sprintf( __( '%1$sPrivacy Policy%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress-settings' ) . '">', '</a>' ) )
120
+ // ),
121
  array(
122
  'name' => 'reset_settings',
123
  'label' => __( 'Reset Default Settings', 'loginpress' ),
css/style-login.php CHANGED
@@ -189,6 +189,12 @@ body.login {
189
  position: relative;
190
  }
191
 
 
 
 
 
 
 
192
  .login h1 a {
193
  <?php if ( ! empty( $loginpress_logo_img ) ) : ?>
194
  background-image: url( <?php echo $loginpress_logo_img; ?> );
@@ -231,6 +237,9 @@ body.login {
231
  border-color: <?php echo $loginpress_btn_hover_border; ?>;
232
  <?php endif; ?>
233
  }
 
 
 
234
  #loginform {
235
  <?php if ( ! empty( $loginpress_form_background_img ) ) : ?>
236
  background-image: url(<?php echo $loginpress_form_background_img; ?>);
@@ -296,12 +305,24 @@ body.login {
296
 
297
 
298
  .login .custom-message {
 
 
 
 
 
 
 
299
  <?php if ( ! empty( $loginpress_welcome_bg_color ) ) : ?>
300
  background-color: <?php echo $loginpress_welcome_bg_color; ?>;
 
 
301
  <?php endif; ?>
302
- <?php if ( ! empty( $loginpress_welcome_bg_border ) ) : ?>
303
- border: <?php echo $loginpress_welcome_bg_border; ?>;
304
- <?php endif; ?>
 
 
 
305
  }
306
 
307
  .login #nav {
189
  position: relative;
190
  }
191
 
192
+ .interim-login.login h1 a{
193
+ <?php if ( ! empty( $loginpress_logo_width ) ) : ?>
194
+ width: <?php echo $loginpress_logo_width; ?>;
195
+ <?php endif; ?>
196
+ }
197
+
198
  .login h1 a {
199
  <?php if ( ! empty( $loginpress_logo_img ) ) : ?>
200
  background-image: url( <?php echo $loginpress_logo_img; ?> );
237
  border-color: <?php echo $loginpress_btn_hover_border; ?>;
238
  <?php endif; ?>
239
  }
240
+ .wp-core-ui #login .button-primary{
241
+ box-shadow: none;
242
+ }
243
  #loginform {
244
  <?php if ( ! empty( $loginpress_form_background_img ) ) : ?>
245
  background-image: url(<?php echo $loginpress_form_background_img; ?>);
305
 
306
 
307
  .login .custom-message {
308
+
309
+ <?php if ( ! empty( $loginpress_welcome_bg_border ) ) : ?>
310
+ border: <?php echo $loginpress_welcome_bg_border; ?>;
311
+ <?php else : ?>
312
+ border-left: 4px solid #00a0d2;
313
+ <?php endif; ?>
314
+
315
  <?php if ( ! empty( $loginpress_welcome_bg_color ) ) : ?>
316
  background-color: <?php echo $loginpress_welcome_bg_color; ?>;
317
+ <?php else : ?>
318
+ background-color: #fff;
319
  <?php endif; ?>
320
+
321
+ padding: 12px;
322
+ margin-left: 0;
323
+ margin-bottom: 20px;
324
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
325
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
326
  }
327
 
328
  .login #nav {
css/style-review.css ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .loginpress-review-notice{
2
+ padding: 15px 15px 15px 0;
3
+ background-color: #fff;
4
+ border-radius: 3px;
5
+ margin: 20px 20px 0 0;
6
+ border-left: 4px solid transparent;
7
+ }
8
+ .loginpress-review-notice:after{
9
+ content: '';
10
+ display: table;
11
+ clear: both;
12
+ }
13
+ .loginpress-review-thumbnail{
14
+ width: 114px;
15
+ float: left;
16
+ line-height: 80px;
17
+ text-align: center;
18
+ border-right: 4px solid transparent;
19
+ }
20
+ .loginpress-review-thumbnail img{
21
+ width: 68px;
22
+ vertical-align: middle;
23
+ }
24
+ .loginpress-review-text{
25
+ overflow: hidden;
26
+ }
27
+ .loginpress-review-text h3{
28
+ font-size: 24px;
29
+ margin: 0 0 5px;
30
+ font-weight: 400;
31
+ line-height: 1.3;
32
+ }
33
+ .loginpress-review-text p{
34
+ font-size: 13px;
35
+ margin: 0 0 5px;
36
+ }
37
+ .loginpress-review-ul{
38
+ margin: 0;
39
+ padding: 0;
40
+ }
41
+ .loginpress-review-ul li{
42
+ display: inline-block;
43
+ margin-right: 15px;
44
+ }
45
+ .loginpress-review-ul li a{
46
+ display: inline-block;
47
+ color: #10738B;
48
+ text-decoration: none;
49
+ padding-left: 26px;
50
+ position: relative;
51
+ }
52
+ .loginpress-review-ul li a span{
53
+ position: absolute;
54
+ left: 0;
55
+ top: -2px;
56
+ }
57
+ .loginpress-dasboard-pro-link{
58
+ color: #0cbb0c;
59
+ }
css/style.css CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  .loginpress-admin-setting *, .login-action-login #login *, .login-action-lostpassword #login *, .login-action-register #login *{
2
  box-sizing: border-box;
3
  }
@@ -176,86 +179,7 @@
176
  margin-bottom: 0;
177
  font-size: 15px;
178
  }
179
- .loginpress-review-notice{
180
- padding: 15px 15px 15px 0;
181
- background-color: #fff;
182
- border-radius: 3px;
183
- margin: 20px 20px 0 0;
184
- border-left: 4px solid transparent;
185
- }
186
- .loginpress-review-notice:after{
187
- content: '';
188
- display: table;
189
- clear: both;
190
- }
191
- .loginpress-review-thumbnail{
192
- width: 114px;
193
- float: left;
194
- line-height: 80px;
195
- text-align: center;
196
- border-right: 4px solid transparent;
197
- }
198
- .loginpress-review-thumbnail img{
199
- width: 68px;
200
- vertical-align: middle;
201
- }
202
- .loginpress-review-text{
203
- overflow: hidden;
204
- }
205
- .loginpress-review-text h3{
206
- font-size: 24px;
207
- margin: 0 0 5px;
208
- font-weight: 400;
209
- line-height: 1.3;
210
- }
211
- .loginpress-review-text p{
212
- font-size: 13px;
213
- margin: 0 0 5px;
214
- }
215
- .loginpress-review-ul{
216
- margin: 0;
217
- padding: 0;
218
- }
219
- .loginpress-review-ul li{
220
- display: inline-block;
221
- margin-right: 15px;
222
- }
223
- .loginpress-review-ul li a{
224
- display: inline-block;
225
- color: #10738B;
226
- text-decoration: none;
227
- padding-left: 26px;
228
- position: relative;
229
- }
230
- .loginpress-review-ul li a span{
231
- position: absolute;
232
- left: 0;
233
- top: -2px;
234
- }
235
- .loginpress-dasboard-pro-link{
236
- color: #0cbb0c;
237
- }
238
- /*Preset section*/
239
- #customize-theme-controls #accordion-section-customize_presets .accordion-section-title{
240
- background-color: #FFD700;
241
- }
242
- #customize-controls #accordion-section-customize_presets:hover>.accordion-section-title{
243
- background-color: #FFD700;
244
- }
245
- /*Google font section*/
246
- /*#customize-theme-controls #accordion-section-lpcustomize_google_font .accordion-section-title{
247
- background-color: #FFD700;
248
- }
249
- #customize-controls #accordion-section-lpcustomize_google_font:hover>.accordion-section-title{
250
- background-color: #FFD700;
251
- }
252
- /*reCaptcha section*/
253
- /*#customize-theme-controls #accordion-section-customize_recaptcha .accordion-section-title{
254
- background-color: #FFD700;
255
- }
256
- #customize-controls #accordion-section-customize_recaptcha:hover>.accordion-section-title{
257
- background-color: #FFD700;
258
- }*/
259
  #loginpress_setting form>h2{
260
  display: none;
261
  }
@@ -266,7 +190,7 @@
266
  .form-table td fieldset label{
267
  font-size: 13px;
268
  }
269
- .site_key, .secret_key, .captcha_theme, .captcha_language, .captcha_enable{
270
  display: none;
271
  }
272
  .recapthca-promo-img{
1
+ /*
2
+ * LoginPress Style for Settings Page.
3
+ */
4
  .loginpress-admin-setting *, .login-action-login #login *, .login-action-lostpassword #login *, .login-action-register #login *{
5
  box-sizing: border-box;
6
  }
179
  margin-bottom: 0;
180
  font-size: 15px;
181
  }
182
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  #loginpress_setting form>h2{
184
  display: none;
185
  }
190
  .form-table td fieldset label{
191
  font-size: 13px;
192
  }
193
+ .site_key, .secret_key, .captcha_theme, .captcha_language, .captcha_enable, .privacy_policy{
194
  display: none;
195
  }
196
  .recapthca-promo-img{
custom.php CHANGED
@@ -1088,7 +1088,7 @@ class LoginPress_Entities {
1088
  ) ) );
1089
 
1090
  $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1091
- 'default' => sprintf( __('© 2017 %1$s, All Rights Reserved.', 'loginpress'), get_bloginfo('name') ),
1092
  'type' => 'option',
1093
  'capability' => 'manage_options',
1094
  'transport' => 'postMessage'
@@ -1118,12 +1118,12 @@ class LoginPress_Entities {
1118
  ) );
1119
 
1120
  // =============================
1121
- // = Section for Custom CSS =
1122
  // =============================
1123
  $wp_customize->add_section(
1124
- 'section_css',
1125
  array(
1126
- 'title' => __( 'Custom CSS', 'loginpress' ),
1127
  'description' => '',
1128
  'priority' => 50,
1129
  'panel' => 'loginpress_panel',
@@ -1138,24 +1138,12 @@ class LoginPress_Entities {
1138
  $wp_customize->add_control( 'loginpress_customization[loginpress_custom_css]', array(
1139
  'label' => __( 'Customize CSS', 'loginpress' ),
1140
  'type' => 'textarea',
1141
- 'section' => 'section_css',
1142
  'priority' => 5,
1143
  'settings' => 'loginpress_customization[loginpress_custom_css]',
1144
  'description' => sprintf( __( 'Custom CSS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1145
  ) );
1146
 
1147
- // =============================
1148
- // = Section for Custom JS =
1149
- // =============================
1150
- $wp_customize->add_section(
1151
- 'section_js',
1152
- array(
1153
- 'title' => __( 'Custom JS', 'loginpress' ),
1154
- 'description' => '',
1155
- 'priority' => 55,
1156
- 'panel' => 'loginpress_panel',
1157
- ) );
1158
-
1159
  $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_js]', array(
1160
  'type' => 'option',
1161
  'capability' => 'manage_options',
@@ -1165,11 +1153,37 @@ class LoginPress_Entities {
1165
  $wp_customize->add_control( 'loginpress_customization[loginpress_custom_js]', array(
1166
  'label' => __( 'Customize JS', 'loginpress' ),
1167
  'type' => 'textarea',
1168
- 'section' => 'section_js',
1169
- 'priority' => 5,
1170
  'settings' => 'loginpress_customization[loginpress_custom_js]',
1171
  'description' => sprintf( __( 'Custom JS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1172
  ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1173
  }
1174
 
1175
  /**
@@ -1179,11 +1193,11 @@ class LoginPress_Entities {
1179
  * * * * * * * * * * * * * * * */
1180
  public function login_page_custom_footer() {
1181
 
1182
- if ( $this->loginpress_key ) {
 
 
1183
 
1184
- if ( ! array_key_exists( 'loginpress_show_love', $this->loginpress_key ) || ( array_key_exists( 'loginpress_show_love', $this->loginpress_key ) && $this->loginpress_key['loginpress_show_love'] ) ) {
1185
- echo '<div class="loginpress-show-love">' . __( 'Powered by:', 'loginpress' ) . ' <a href="https://wpbrigade.com" target="_blank">LoginPress</a></div>';
1186
- }
1187
 
1188
  // echo '</div></div>';
1189
  echo '<div class="footer-wrapper">';
@@ -1248,7 +1262,7 @@ class LoginPress_Entities {
1248
  * * * * * * * * * * * * * */
1249
  public function login_page_logo_url() {
1250
 
1251
- if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) ) {
1252
  return $this->loginpress_key["customize_logo_hover"];
1253
  } else {
1254
  return home_url();
@@ -1276,7 +1290,7 @@ class LoginPress_Entities {
1276
  * * * * * * * * * * * * */
1277
  public function login_page_logo_title() {
1278
 
1279
- if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) ) {
1280
  return $this->loginpress_key["customize_logo_hover_title"];
1281
  } else {
1282
  return home_url();
@@ -1293,46 +1307,51 @@ class LoginPress_Entities {
1293
  public function login_error_messages($error) {
1294
 
1295
  global $errors;
1296
- $error_codes = $errors->get_error_codes();
1297
- if ( $this->loginpress_key ) {
1298
 
1299
- $invalid_usrname = array_key_exists( 'incorrect_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_username'] ) ? $this->loginpress_key['incorrect_username'] : sprintf( __( '%1$sError:%2$s Invalid Username.', 'loginpress' ), '<strong>', '</strong>' );
 
 
1300
 
1301
- $invalid_pasword = array_key_exists( 'incorrect_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_password'] ) ? $this->loginpress_key['incorrect_password'] : sprintf( __( '%1$sError:%2$s Invalid Password.', 'loginpress' ), '<strong>', '</strong>' );
1302
 
1303
- $empty_username = array_key_exists( 'empty_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_username'] ) ? $this->loginpress_key['empty_username'] : sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1304
 
1305
- $empty_password = array_key_exists( 'empty_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_password'] ) ? $this->loginpress_key['empty_password'] : sprintf( __( '%1$sError:%2$s The password field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1306
 
1307
- $invalid_email = array_key_exists( 'invalid_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalid_email'] ) ? $this->loginpress_key['invalid_email'] : sprintf( __( '%1$sError:%2$s The email address isn\'t correct..', 'loginpress' ), '<strong>', '</strong>' );
1308
 
1309
- $empty_email = array_key_exists( 'empty_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_email'] ) ? $this->loginpress_key['empty_email'] : sprintf( __( '%1$sError:%2$s Please type your email address.', 'loginpress' ), '<strong>', '</strong>' );
1310
 
1311
- $username_exists = array_key_exists( 'username_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['username_exists'] ) ? $this->loginpress_key['username_exists'] : sprintf( __( '%1$sError:%2$s This username is already registered. Please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1312
 
1313
- $email_exists = array_key_exists( 'email_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['email_exists'] ) ? $this->loginpress_key['email_exists'] : sprintf( __( '%1$sError:%2$s This email is already registered, please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1314
 
1315
- $invalidcombo = array_key_exists( 'invalidcombo_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalidcombo_message'] ) ? $this->loginpress_key['invalidcombo_message'] : sprintf( __( '%1$sError:%2$s Invalid username or email.', 'loginpress' ), '<strong>', '</strong>' );
1316
 
1317
- if ( in_array( 'invalid_username', $error_codes ) ) return $invalid_usrname;
1318
 
1319
- if ( in_array( 'incorrect_password', $error_codes ) ) return $invalid_pasword;
1320
 
1321
- if ( in_array( 'empty_username', $error_codes ) ) return $empty_username;
1322
 
1323
- if ( in_array( 'empty_password', $error_codes ) ) return $empty_password;
1324
 
1325
- // registeration Form enteries.
1326
- if ( in_array( 'invalid_email', $error_codes ) ) return $invalid_email;
1327
 
1328
- if ( in_array( 'empty_email', $error_codes ) ) return "</br>" . $empty_email;
1329
 
1330
- if ( in_array( 'username_exists', $error_codes ) ) return $username_exists;
 
1331
 
1332
- if ( in_array( 'email_exists', $error_codes ) ) return $email_exists;
1333
 
1334
- // forget password entery.
1335
- if ( in_array( 'invalidcombo', $error_codes ) ) return $invalidcombo;
 
 
 
 
 
1336
  }
1337
 
1338
  return $error;
@@ -1381,7 +1400,7 @@ class LoginPress_Entities {
1381
 
1382
  if ( array_key_exists( 'logout_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['logout_message'] ) ) {
1383
 
1384
- $message = $this->loginpress_key['logout_message'];
1385
  }
1386
  }
1387
 
@@ -1390,26 +1409,45 @@ class LoginPress_Entities {
1390
 
1391
  if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['lostpwd_welcome_message'] ) ) {
1392
 
1393
- $message = $this->loginpress_key['lostpwd_welcome_message'];
1394
  }
1395
  }
1396
 
1397
- else if( strpos( $message,"Register For This Site" ) == true ) {
1398
 
1399
  if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['register_welcome_message'] ) ) {
1400
 
1401
- $message = $this->loginpress_key['register_welcome_message'];
1402
  }
1403
  }
1404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1405
  else {
1406
  if ( array_key_exists( 'welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['welcome_message'] ) ) {
1407
 
1408
- $message = $this->loginpress_key['welcome_message'];
1409
  }
1410
  }
1411
 
1412
- return !empty($message) ? "<p class='custom-message'>" . $message. "</p>" : '';
 
1413
  }
1414
  }
1415
 
1088
  ) ) );
1089
 
1090
  $wp_customize->add_setting( 'loginpress_customization[login_footer_copy_right]', array(
1091
+ 'default' => sprintf( __('© %1$s %2$s, All Rights Reserved.', 'loginpress'), date("Y"), get_bloginfo('name') ),
1092
  'type' => 'option',
1093
  'capability' => 'manage_options',
1094
  'transport' => 'postMessage'
1118
  ) );
1119
 
1120
  // =============================
1121
+ // = Section for Custom CSS/JS =
1122
  // =============================
1123
  $wp_customize->add_section(
1124
+ 'loginpress_custom_css_js',
1125
  array(
1126
+ 'title' => __( 'Custom CSS/JS', 'loginpress' ),
1127
  'description' => '',
1128
  'priority' => 50,
1129
  'panel' => 'loginpress_panel',
1138
  $wp_customize->add_control( 'loginpress_customization[loginpress_custom_css]', array(
1139
  'label' => __( 'Customize CSS', 'loginpress' ),
1140
  'type' => 'textarea',
1141
+ 'section' => 'loginpress_custom_css_js',
1142
  'priority' => 5,
1143
  'settings' => 'loginpress_customization[loginpress_custom_css]',
1144
  'description' => sprintf( __( 'Custom CSS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1145
  ) );
1146
 
 
 
 
 
 
 
 
 
 
 
 
 
1147
  $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_js]', array(
1148
  'type' => 'option',
1149
  'capability' => 'manage_options',
1153
  $wp_customize->add_control( 'loginpress_customization[loginpress_custom_js]', array(
1154
  'label' => __( 'Customize JS', 'loginpress' ),
1155
  'type' => 'textarea',
1156
+ 'section' => 'loginpress_custom_css_js',
1157
+ 'priority' => 10,
1158
  'settings' => 'loginpress_customization[loginpress_custom_js]',
1159
  'description' => sprintf( __( 'Custom JS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1160
  ) );
1161
+ // =============================
1162
+ // = Section for Custom JS =
1163
+ // =============================
1164
+ // $wp_customize->add_section(
1165
+ // 'section_js',
1166
+ // array(
1167
+ // 'title' => __( 'Custom JS', 'loginpress' ),
1168
+ // 'description' => '',
1169
+ // 'priority' => 55,
1170
+ // 'panel' => 'loginpress_panel',
1171
+ // ) );
1172
+ //
1173
+ // $wp_customize->add_setting( 'loginpress_customization[loginpress_custom_js]', array(
1174
+ // 'type' => 'option',
1175
+ // 'capability' => 'manage_options',
1176
+ // 'transport' => 'postMessage'
1177
+ // ) );
1178
+ //
1179
+ // $wp_customize->add_control( 'loginpress_customization[loginpress_custom_js]', array(
1180
+ // 'label' => __( 'Customize JS', 'loginpress' ),
1181
+ // 'type' => 'textarea',
1182
+ // 'section' => 'section_js',
1183
+ // 'priority' => 5,
1184
+ // 'settings' => 'loginpress_customization[loginpress_custom_js]',
1185
+ // 'description' => sprintf( __( 'Custom JS doen\'t make effect live. For preview please save the setting and visit %1$s login%2$s page or after save refresh the customizer.', "loginpress" ), '<a href="' . wp_login_url() .'"title="Login" target="_blank">', '</a>')
1186
+ // ) );
1187
  }
1188
 
1189
  /**
1193
  * * * * * * * * * * * * * * * */
1194
  public function login_page_custom_footer() {
1195
 
1196
+ if ( empty( $this->loginpress_key ) || ( isset($this->loginpress_key['loginpress_show_love']) && $this->loginpress_key['loginpress_show_love'] != '' ) ) {
1197
+ echo '<div class="loginpress-show-love">' . __( 'Powered by:', 'loginpress' ) . ' <a href="https://wpbrigade.com" target="_blank">LoginPress</a></div>';
1198
+ }
1199
 
1200
+ if ( $this->loginpress_key ) {
 
 
1201
 
1202
  // echo '</div></div>';
1203
  echo '<div class="footer-wrapper">';
1262
  * * * * * * * * * * * * * */
1263
  public function login_page_logo_url() {
1264
 
1265
+ if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover'] ) ) {
1266
  return $this->loginpress_key["customize_logo_hover"];
1267
  } else {
1268
  return home_url();
1290
  * * * * * * * * * * * * */
1291
  public function login_page_logo_title() {
1292
 
1293
+ if ( $this->loginpress_key && array_key_exists( 'customize_logo_hover_title', $this->loginpress_key ) && ! empty( $this->loginpress_key['customize_logo_hover_title'] ) ) {
1294
  return $this->loginpress_key["customize_logo_hover_title"];
1295
  } else {
1296
  return home_url();
1307
  public function login_error_messages($error) {
1308
 
1309
  global $errors;
 
 
1310
 
1311
+ if ( isset( $errors ) ){
1312
+
1313
+ $error_codes = $errors->get_error_codes();
1314
 
1315
+ if ( $this->loginpress_key ) {
1316
 
1317
+ $invalid_usrname = array_key_exists( 'incorrect_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_username'] ) ? $this->loginpress_key['incorrect_username'] : sprintf( __( '%1$sError:%2$s Invalid Username.', 'loginpress' ), '<strong>', '</strong>' );
1318
 
1319
+ $invalid_pasword = array_key_exists( 'incorrect_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['incorrect_password'] ) ? $this->loginpress_key['incorrect_password'] : sprintf( __( '%1$sError:%2$s Invalid Password.', 'loginpress' ), '<strong>', '</strong>' );
1320
 
1321
+ $empty_username = array_key_exists( 'empty_username', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_username'] ) ? $this->loginpress_key['empty_username'] : sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1322
 
1323
+ $empty_password = array_key_exists( 'empty_password', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_password'] ) ? $this->loginpress_key['empty_password'] : sprintf( __( '%1$sError:%2$s The password field is empty.', 'loginpress' ), '<strong>', '</strong>' );
1324
 
1325
+ $invalid_email = array_key_exists( 'invalid_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalid_email'] ) ? $this->loginpress_key['invalid_email'] : sprintf( __( '%1$sError:%2$s The email address isn\'t correct..', 'loginpress' ), '<strong>', '</strong>' );
1326
 
1327
+ $empty_email = array_key_exists( 'empty_email', $this->loginpress_key ) && ! empty( $this->loginpress_key['empty_email'] ) ? $this->loginpress_key['empty_email'] : sprintf( __( '%1$sError:%2$s Please type your email address.', 'loginpress' ), '<strong>', '</strong>' );
1328
 
1329
+ $username_exists = array_key_exists( 'username_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['username_exists'] ) ? $this->loginpress_key['username_exists'] : sprintf( __( '%1$sError:%2$s This username is already registered. Please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1330
 
1331
+ $email_exists = array_key_exists( 'email_exists', $this->loginpress_key ) && ! empty( $this->loginpress_key['email_exists'] ) ? $this->loginpress_key['email_exists'] : sprintf( __( '%1$sError:%2$s This email is already registered, please choose another one.', 'loginpress' ), '<strong>', '</strong>' );
1332
 
1333
+ $invalidcombo = array_key_exists( 'invalidcombo_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['invalidcombo_message'] ) ? $this->loginpress_key['invalidcombo_message'] : sprintf( __( '%1$sError:%2$s Invalid username or email.', 'loginpress' ), '<strong>', '</strong>' );
1334
 
1335
+ if ( in_array( 'invalid_username', $error_codes ) ) return $invalid_usrname;
1336
 
1337
+ if ( in_array( 'incorrect_password', $error_codes ) ) return $invalid_pasword;
1338
 
1339
+ if ( in_array( 'empty_username', $error_codes ) ) return $empty_username;
 
1340
 
1341
+ if ( in_array( 'empty_password', $error_codes ) ) return $empty_password;
1342
 
1343
+ // registeration Form enteries.
1344
+ if ( in_array( 'invalid_email', $error_codes ) ) return $invalid_email;
1345
 
1346
+ if ( in_array( 'empty_email', $error_codes ) ) return "</br>" . $empty_email;
1347
 
1348
+ if ( in_array( 'username_exists', $error_codes ) ) return $username_exists;
1349
+
1350
+ if ( in_array( 'email_exists', $error_codes ) ) return $email_exists;
1351
+
1352
+ // forget password entery.
1353
+ if ( in_array( 'invalidcombo', $error_codes ) ) return $invalidcombo;
1354
+ }
1355
  }
1356
 
1357
  return $error;
1400
 
1401
  if ( array_key_exists( 'logout_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['logout_message'] ) ) {
1402
 
1403
+ $loginpress_message = $this->loginpress_key['logout_message'];
1404
  }
1405
  }
1406
 
1409
 
1410
  if ( array_key_exists( 'lostpwd_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['lostpwd_welcome_message'] ) ) {
1411
 
1412
+ $loginpress_message = $this->loginpress_key['lostpwd_welcome_message'];
1413
  }
1414
  }
1415
 
1416
+ else if( strpos( $message, "Register For This Site" ) == true ) {
1417
 
1418
  if ( array_key_exists( 'register_welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['register_welcome_message'] ) ) {
1419
 
1420
+ $loginpress_message = $this->loginpress_key['register_welcome_message'];
1421
  }
1422
  }
1423
 
1424
+ // @since 1.0.18
1425
+ // else if ( strpos( $message, "Enter your new password below." ) == true ) {
1426
+ //
1427
+ // if ( array_key_exists( 'reset_hint_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['reset_hint_message'] ) ) {
1428
+ //
1429
+ // $loginpress_message = $this->loginpress_key['reset_hint_message'];
1430
+ // }
1431
+ // }
1432
+
1433
+ // @since 1.0.18
1434
+ else if ( strpos( $message, "Your password has been reset." ) == true ) {
1435
+
1436
+ // if ( array_key_exists( 'after_reset_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['after_reset_message'] ) ) {
1437
+
1438
+ $loginpress_message = __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>';
1439
+ // }
1440
+ }
1441
+
1442
  else {
1443
  if ( array_key_exists( 'welcome_message', $this->loginpress_key ) && ! empty( $this->loginpress_key['welcome_message'] ) ) {
1444
 
1445
+ $loginpress_message = $this->loginpress_key['welcome_message'];
1446
  }
1447
  }
1448
 
1449
+
1450
+ return ! empty( $loginpress_message ) ? "<p class='custom-message'>" . $loginpress_message. "</p>" : $message;
1451
  }
1452
  }
1453
 
include/privacy-policy.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Privacy Policy Settings
4
+ *
5
+ * @since 1.0.18
6
+ */
7
+ $loginpress_setting = get_option( 'loginpress_setting' );
8
+ $loginpress_enable_ppolicy = isset( $loginpress_setting['enable_privacy_policy'] ) ? $loginpress_setting['enable_privacy_policy'] : 'off';
9
+
10
+ if ( 'off' == $loginpress_enable_ppolicy )
11
+ return;
12
+
13
+ // Add privacy policy field.
14
+ add_action( 'register_form', 'loginpress_add_privacy_policy_field' );
15
+ function loginpress_add_privacy_policy_field() {
16
+
17
+ $loginpress_setting = get_option( 'loginpress_setting' );
18
+ $privacy_policy = isset( $loginpress_setting['privacy_policy'] ) ? $loginpress_setting['privacy_policy'] : __( sprintf( __( '%1$sPrivacy Policy%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress-settings' ) . '">', '</a>' ) );
19
+ ?>
20
+ <p>
21
+ <label for="lp_privacy_policy"><br />
22
+ <input type="checkbox" name="lp_privacy_policy" id="lp_privacy_policy" class="checkbox" />
23
+ <?php echo $privacy_policy;?>
24
+ </label>
25
+ </p>
26
+ <?php
27
+ }
28
+
29
+ // Add validation. In this case, we make sure lp_privacy_policy is required.
30
+ add_filter( 'registration_errors', 'loginpresss_privacy_policy_auth', 10, 3 );
31
+
32
+ function loginpresss_privacy_policy_auth( $errors, $sanitized_user_login, $user_email ) {
33
+
34
+ if ( ! isset( $_POST['lp_privacy_policy'] ) ) :
35
+
36
+ $errors->add( 'policy_error', "<strong>ERROR</strong>: Please accept the privacy policy." );
37
+ return $errors;
38
+ endif;
39
+ return $errors;
40
+ }
41
+
42
+
43
+ // Lastly, save our extra registration user meta.
44
+ // add_action( 'user_register', 'loginpress_privacy_policy_save' );
45
+
46
+ function loginpress_privacy_policy_save( $user_id ) {
47
+
48
+ if ( isset( $_POST['lp_privacy_policy'] ) )
49
+ update_user_meta( $user_id, 'lp_privacy_policy', $_POST['lp_privacy_policy'] );
50
+ }
include/settings.php CHANGED
@@ -1,41 +1,3 @@
1
- <!-- <h2 class="nav-tab-wrapper">
2
- <a class="nav-tab nav-tab-active" href="<?php //echo admin_url( 'admin.php?page=loginpress-settings' ) ?>">Settings</a>
3
- <a class="nav-tab" href="<?php //echo admin_url( 'admin.php?page=loginpress-settings&get-premium=loginpress' ) ?>">Premium Version</a>
4
- </h2> -->
5
-
6
- <h2 style="margin: 20px 0 20px 0;">LoginPress - Rebranding your boring WordPress Login pages</h2>
7
- <div id="normal-sortables" class="meta-box-sortables wpbrigade-videobox-wrapper">
8
- <!-- <div id="wpbrigade_infs_general_videobox" class="postbox">
9
- <h3><span>Upgrade to the PREMIUM VERSION</span></h3>
10
- <div class="inside">
11
- <div class="wpbrigade_videobox">
12
- <div class="column"><span class="wpbrigade-heading">Discover the Advanced Features</span>
13
- <a class="wpbrigade-video-link" href="#" data-video-id="wpbrigade-video-iframe">
14
- <img src="<?php echo LOGINPRESS_DIR_URL . 'img/dummy.jpg' ?>">
15
- </a>
16
- <div class="wpbrigade-video-description-wrapper">
17
- <p class="wpbrigade-video-description">LonginPress Pro</p>
18
- <p>Upgrade to the PREMIUM VERSION of LonginPress to benefit from all features!</p>
19
- </div>
20
- </div>
21
- <div class="column right">
22
- <span class="wpbrigade-heading">Get Support and Pro Features?</span>
23
-
24
- <p>Our free version works superb as there are awesome reviews coming all the way. If you want to support our development, I will highly recommend to buy our Pro version</p>
25
-
26
- <p>
27
- <a class="button-primary" href="" target="_blank">Get Support and Pro Features</a>
28
- </p>
29
- </div>
30
- </div>
31
- </div>
32
- </div> -->
33
- </div>
34
- <div class="wpbrigade-video-popup-overlay" id="wpbrigade-video-iframe">
35
- <div class="wpbrigade-video-popup">
36
- <span class="dashicons dashicons-no-alt wpbrigade-close-popup"></span>
37
- <div class="wpbrigade-video-wrapper">
38
- <iframe width="560" height="315" src="https://www.youtube.com/embed/GMAwsHomJlE" frameborder="0" allowfullscreen></iframe>
39
- </div>
40
- </div>
41
- </div>
1
+ <h2 style="margin: 20px 0 20px 0;">
2
+ <?php _e( 'LoginPress - Rebranding your boring WordPress Login pages', 'loginpress' ); ?>
3
+ </h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin-custom.js CHANGED
@@ -24,6 +24,16 @@
24
  }
25
  }); // on click promo checkbox.
26
 
 
 
 
 
 
 
 
 
 
 
27
  $(window).on('load', function() {
28
 
29
  $('<tr class="recapthca-promo-img"><th class="recapthca-promo" colspan="2"><img src="' + loginpress_script.plugin_url + '/loginpress/img/promo/recaptcha_promo.png"><a class="recapthca-promo-link" href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&amp;utm_medium=recaptcha-settings&amp;utm_campaign=pro-upgrade" target="_blank"><span>Unlock Premium Feature</span></a></th></tr>').insertAfter( $(".enable_repatcha_promo").closest('tr') );
@@ -32,6 +42,11 @@
32
  if ( promotion.is(":checked") ) {
33
  $('tr.recapthca-promo-img').show();
34
  }
 
 
 
 
 
35
  }); // Window on load.
36
 
37
  });
24
  }
25
  }); // on click promo checkbox.
26
 
27
+ $("#wpuf-loginpress_setting\\[enable_privacy_policy\\]").on('click', function() {
28
+
29
+ var privacy_editor = $('#wpuf-loginpress_setting\\[enable_privacy_policy\\]');
30
+ if ( privacy_editor.is(":checked") ) {
31
+ $('tr.privacy_policy').show();
32
+ } else {
33
+ $('tr.privacy_policy').hide();
34
+ }
35
+ }); // on click promo checkbox.
36
+
37
  $(window).on('load', function() {
38
 
39
  $('<tr class="recapthca-promo-img"><th class="recapthca-promo" colspan="2"><img src="' + loginpress_script.plugin_url + '/loginpress/img/promo/recaptcha_promo.png"><a class="recapthca-promo-link" href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&amp;utm_medium=recaptcha-settings&amp;utm_campaign=pro-upgrade" target="_blank"><span>Unlock Premium Feature</span></a></th></tr>').insertAfter( $(".enable_repatcha_promo").closest('tr') );
42
  if ( promotion.is(":checked") ) {
43
  $('tr.recapthca-promo-img').show();
44
  }
45
+
46
+ var privacy_editor = $('#wpuf-loginpress_setting\\[enable_privacy_policy\\]');
47
+ if ( privacy_editor.is(":checked") ) {
48
+ $('tr.privacy_policy').show();
49
+ }
50
  }); // Window on load.
51
 
52
  });
loginpress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
- * Version: 1.0.17
7
  * Author: WPBrigade
8
  * Author URI: http://www.WPBrigade.com/
9
  * Text Domain: loginpress
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
22
  /**
23
  * @var string
24
  */
25
- public $version = '1.0.17';
26
 
27
  /**
28
  * @var The single instance of the class
@@ -78,6 +78,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
78
 
79
  include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
80
  include_once( LOGINPRESS_DIR_PATH . 'classes/loginpress-setup.php' );
 
81
  }
82
 
83
  /**
@@ -93,13 +94,13 @@ if ( ! class_exists( 'LoginPress' ) ) :
93
  add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
94
  add_action( 'admin_init', array( $this, 'loginpress_review_notice' ) );
95
  add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
96
- add_action( 'wp_ajax_loginpress_deactivate', array( $this, '_deactivate' ) );
97
-
98
 
99
- add_action( 'admin_init', array( $this, 'redirect_optin' ) );
100
  add_action( 'wp_ajax_loginpress_optout_yes', array( $this, 'optout_yes' ) );
101
- }
102
 
 
103
 
104
  /**
105
  * Opt-out
@@ -184,12 +185,6 @@ if ( ! class_exists( 'LoginPress' ) ) :
184
  }
185
  }
186
 
187
- /**
188
- * Include required ajax files.
189
- */
190
- public function ajax_includes() {
191
- // Ajax functions for admin and the front-end
192
- }
193
  /**
194
  * Init WPBrigade when WordPress Initialises.
195
  */
@@ -253,22 +248,42 @@ if ( ! class_exists( 'LoginPress' ) ) :
253
 
254
  }
255
 
256
- public function _loginpress_settings() {
 
 
 
 
 
 
 
 
257
 
258
- if ( isset( $_GET['get-premium'] ) && 'loginpress' == $_GET['get-premium'] ) {
259
- include_once LOGINPRESS_DIR_PATH . '/include/get-premium.php';
260
- } else {
261
- include_once LOGINPRESS_DIR_PATH . '/include/settings.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
- }
264
 
265
- function _admin_scripts() {
266
  wp_enqueue_style( 'loginpress_stlye', plugins_url( 'css/style.css', __FILE__ ), array(), LOGINPRESS_VERSION );
267
  wp_enqueue_script( 'loginpress_js', plugins_url( 'js/admin-custom.js', __FILE__ ), array(), LOGINPRESS_VERSION );
268
 
269
  // Array for localize.
270
  $loginpress_localize = array(
271
- 'plugin_url' => plugins_url(),
272
  );
273
 
274
  wp_localize_script( 'loginpress_js', 'loginpress_script', $loginpress_localize );
@@ -359,8 +374,8 @@ if ( ! class_exists( 'LoginPress' ) ) :
359
 
360
  static function plugin_activation() {
361
 
362
- $_loginpress_Setting = get_option( 'loginpress_setting' );
363
- if ( ! isset( $_loginpress_Setting['tracking_anonymous'] ) || 'off' == $_loginpress_Setting['tracking_anonymous'] ) {
364
  return;
365
  }
366
 
@@ -391,11 +406,6 @@ if ( ! class_exists( 'LoginPress' ) ) :
391
 
392
  static function plugin_uninstallation() {
393
 
394
- // $_loginpress_Setting = get_option( 'loginpress_setting' );
395
- // if ( ! isset( $_loginpress_Setting['tracking_anonymous'] ) || 'off' == $_loginpress_Setting['tracking_anonymous'] ) {
396
- // return;
397
- // }
398
-
399
  $email = get_option( 'admin_email' );
400
 
401
  $fields = array(
@@ -445,12 +455,14 @@ if ( ! class_exists( 'LoginPress' ) ) :
445
 
446
  // 1296000 = 15 Days in seconds.
447
  if ( time() - $activation_time > 1296000 ) :
 
 
448
  add_action( 'admin_notices' , array( $this, 'loginpress_review_notice_message' ) );
449
  endif;
450
 
451
  if ( is_multisite() ) {
452
- add_action( 'admin_notices' , array( $this, 'loginpress_multisite_admin_message' ) );
453
- add_action('network_admin_notices', array( $this, 'loginpress_multisite_admin_message' ) );
454
  }
455
  }
456
 
@@ -517,8 +529,8 @@ if ( ! class_exists( 'LoginPress' ) ) :
517
 
518
  $_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_later=yes';
519
  $later_url = wp_nonce_url( $_later_link, 'loginpress-review-nonce' );
 
520
 
521
- ?>
522
  <div class="loginpress-review-notice">
523
  <div class="loginpress-review-thumbnail">
524
  <img src="<?php echo plugins_url( 'img/thumbnail/gray-loginpress.png', __FILE__ ) ?>" alt="">
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
+ * Version: 1.0.18
7
  * Author: WPBrigade
8
  * Author URI: http://www.WPBrigade.com/
9
  * Text Domain: loginpress
22
  /**
23
  * @var string
24
  */
25
+ public $version = '1.0.18';
26
 
27
  /**
28
  * @var The single instance of the class
78
 
79
  include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
80
  include_once( LOGINPRESS_DIR_PATH . 'classes/loginpress-setup.php' );
81
+ include_once( LOGINPRESS_DIR_PATH . 'include/privacy-policy.php' );
82
  }
83
 
84
  /**
94
  add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
95
  add_action( 'admin_init', array( $this, 'loginpress_review_notice' ) );
96
  add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
97
+ add_action( 'admin_init', array( $this, 'redirect_optin' ) );
98
+ add_filter( 'auth_cookie_expiration', array( $this, '_change_auth_cookie_expiration' ), 10, 3 );
99
 
100
+ add_action( 'wp_ajax_loginpress_deactivate', array( $this, '_deactivate' ) );
101
  add_action( 'wp_ajax_loginpress_optout_yes', array( $this, 'optout_yes' ) );
 
102
 
103
+ }
104
 
105
  /**
106
  * Opt-out
185
  }
186
  }
187
 
 
 
 
 
 
 
188
  /**
189
  * Init WPBrigade when WordPress Initialises.
190
  */
248
 
249
  }
250
 
251
+ /**
252
+ * Session Expiration
253
+ *
254
+ * @since 1.0.18
255
+ */
256
+ function _change_auth_cookie_expiration( $expiration, $user_id, $remember ) {
257
+
258
+ $loginpress_setting = get_option( 'loginpress_setting' );
259
+ $_expiration = isset( $loginpress_setting['session_expiration'] ) ? intval( $loginpress_setting['session_expiration'] ) : '';
260
 
261
+ if ( empty( $_expiration ) || '0' == $_expiration ) {
262
+ return $expiration;
263
+ }
264
+
265
+ $expiration = $_expiration * 60; // Duration of the expiration period in seconds.
266
+
267
+ return $expiration;
268
+ }
269
+
270
+ /**
271
+ * Load JS or CSS files at admin side and enqueue them
272
+ * @param string tell you the Page ID
273
+ * @return void
274
+ */
275
+ function _admin_scripts( $hook ) {
276
+
277
+ if( $hook != 'toplevel_page_loginpress-settings' ) {
278
+ return;
279
  }
 
280
 
 
281
  wp_enqueue_style( 'loginpress_stlye', plugins_url( 'css/style.css', __FILE__ ), array(), LOGINPRESS_VERSION );
282
  wp_enqueue_script( 'loginpress_js', plugins_url( 'js/admin-custom.js', __FILE__ ), array(), LOGINPRESS_VERSION );
283
 
284
  // Array for localize.
285
  $loginpress_localize = array(
286
+ 'plugin_url' => plugins_url(),
287
  );
288
 
289
  wp_localize_script( 'loginpress_js', 'loginpress_script', $loginpress_localize );
374
 
375
  static function plugin_activation() {
376
 
377
+ $loginpress_setting = get_option( 'loginpress_setting' );
378
+ if ( ! isset( $loginpress_setting['tracking_anonymous'] ) || 'off' == $loginpress_setting['tracking_anonymous'] ) {
379
  return;
380
  }
381
 
406
 
407
  static function plugin_uninstallation() {
408
 
 
 
 
 
 
409
  $email = get_option( 'admin_email' );
410
 
411
  $fields = array(
455
 
456
  // 1296000 = 15 Days in seconds.
457
  if ( time() - $activation_time > 1296000 ) :
458
+
459
+ wp_enqueue_style( 'loginpress_review_stlye', plugins_url( 'css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
460
  add_action( 'admin_notices' , array( $this, 'loginpress_review_notice_message' ) );
461
  endif;
462
 
463
  if ( is_multisite() ) {
464
+ add_action( 'admin_notices' , array( $this, 'loginpress_multisite_admin_message' ) );
465
+ add_action( 'network_admin_notices', array( $this, 'loginpress_multisite_admin_message' ) );
466
  }
467
  }
468
 
529
 
530
  $_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_later=yes';
531
  $later_url = wp_nonce_url( $_later_link, 'loginpress-review-nonce' );
532
+ ?>
533
 
 
534
  <div class="loginpress-review-notice">
535
  <div class="loginpress-review-thumbnail">
536
  <img src="<?php echo plugins_url( 'img/thumbnail/gray-loginpress.png', __FILE__ ) ?>" alt="">
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WordPress Custom Login Page Customizer | LoginPress ===
2
  Requires at least: 4.0
3
  Tested up to: 4.8
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
  Tags: wp-login, custom wp-login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
- Stable tag: 1.0.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -163,6 +163,15 @@ Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/word
163
 
164
  == Changelog ==
165
 
 
 
 
 
 
 
 
 
 
166
  = 1.0.17 - 2017-06-14 =
167
  * Enhancement: Compatible with 4.8
168
  * Enhancement: Pro features promo introducing in Free version.
@@ -242,5 +251,5 @@ Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/word
242
 
243
  == Upgrade Notice ==
244
 
245
- = 1.0.17 =
246
- * Important release, Please upgrade immediately.
1
+ === Custom Login Page Customizer | LoginPress ===
2
  Requires at least: 4.0
3
  Tested up to: 4.8
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
  Tags: wp-login, custom wp-login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
+ Stable tag: 1.0.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
163
 
164
  == Changelog ==
165
 
166
+ = 1.0.18 - 2017-07-03 =
167
+ * Enhancement: Set login session expiration time.
168
+ * Bugfix: Compatible with Rename wp-login.php
169
+ * Bugfix: Conflict with Leaflet Maps Marker.
170
+ * Bugfix: Password Reset Success Message
171
+ * Bugfix: Enqueue settings page CSS & JS files only on settings page.
172
+ * Bugfix: Optimized plugin speed and code improvement.
173
+
174
+
175
  = 1.0.17 - 2017-06-14 =
176
  * Enhancement: Compatible with 4.8
177
  * Enhancement: Pro features promo introducing in Free version.
251
 
252
  == Upgrade Notice ==
253
 
254
+ = 1.0.18 =
255
+ * Important release, Multiple bugfixes and enhancements, Please upgrade immediately.