Custom Login Page Customizer | LoginPress - Version 1.5.11

Version Description

2022-01-31 = * New Feature: Introducing Language Switcher (Enable / Disable) settings on Login wp-login Page. * Enhancement: Code refactoring. * Compatibility: Compatible with WordPress 5.9.

Download this release

Release Info

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

Code changes from version 1.5.10 to 1.5.11

classes/class-loginpress-setup.php CHANGED
@@ -222,10 +222,19 @@ class LoginPress_Settings {
222
  // ) );
223
  // }
224
 
225
- // Add WooCommerce lostpassword_url field in version 1.1.7
 
 
 
 
 
 
 
 
 
226
  if ( class_exists( 'WooCommerce' ) ) {
227
- $_free_fields = $this->loginpress_woocommerce_lostpasword_url( $_free_fields );
228
- }
229
 
230
  // Add loginpress_uninstall field in version 1.1.9
231
  $_free_fields = $this->loginpress_uninstallation_tool( $_free_fields );
@@ -322,9 +331,9 @@ class LoginPress_Settings {
322
 
323
  /**
324
  * loginpress_woocommerce_lostpasword_url [merge a woocommerce lostpassword url field with the last element of array.]
325
- * @param array $fields_list
326
  * @since 1.1.7
327
- * @return array
328
  */
329
  function loginpress_woocommerce_lostpasword_url( $fields_list ) {
330
 
@@ -340,11 +349,32 @@ class LoginPress_Settings {
340
  return array_merge( $array_elements, $last_two_elements ); // merge an array and return.
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  /**
344
  * loginpress_uninstallation_filed [merge a uninstall loginpress field with array of element.]
345
- * @param array $fields_list
346
  * @since 1.1.9
347
- * @return array
348
  */
349
  function loginpress_uninstallation_filed( $fields_list ) {
350
 
222
  // ) );
223
  // }
224
 
225
+ /**
226
+ * Add option to remove language switcher option
227
+ *
228
+ * @since 1.5.11
229
+ */
230
+ if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) && ! empty( get_available_languages() ) ) {
231
+ $_free_fields = $this->loginpress_language_switcher( $_free_fields );
232
+ }
233
+
234
+ // Add WooCommerce lostpassword_url field in version 1.1.7
235
  if ( class_exists( 'WooCommerce' ) ) {
236
+ $_free_fields = $this->loginpress_woocommerce_lostpasword_url( $_free_fields );
237
+ }
238
 
239
  // Add loginpress_uninstall field in version 1.1.9
240
  $_free_fields = $this->loginpress_uninstallation_tool( $_free_fields );
331
 
332
  /**
333
  * loginpress_woocommerce_lostpasword_url [merge a woocommerce lostpassword url field with the last element of array.]
334
+ * @param array $fields_list The free fields of LoginPress.
335
  * @since 1.1.7
336
+ * @return array the total fields including the added field of WooCommerce lost password field.
337
  */
338
  function loginpress_woocommerce_lostpasword_url( $fields_list ) {
339
 
349
  return array_merge( $array_elements, $last_two_elements ); // merge an array and return.
350
  }
351
 
352
+ /**
353
+ * loginpress_language_switcher [merge a language switcher in the settings element of array.]
354
+ *
355
+ * @param array $fields_list The free fields of LoginPress.
356
+ * @since 1.5.11
357
+ * @return array the total fields including the added field of language switcher
358
+ */
359
+ function loginpress_language_switcher( $fields_list ) {
360
+
361
+ $array_elements = array_slice( $fields_list, 0, -1 ); //slice a last element of array.
362
+ $last_element = end( $fields_list ); // last element of array.
363
+ $switcher_option = array(
364
+ 'name' => 'enable_language_switcher',
365
+ 'label' => __( 'Language Switcher', 'loginpress' ),
366
+ 'desc' => __( 'Remove Language Switcher Dropdown On Login Page. ', 'loginpress' ),
367
+ 'type' => 'checkbox'
368
+ );
369
+ $lang_switch_element = array_merge( array( $switcher_option , $last_element ) ); // merge last 2 elements of array.
370
+ return array_merge( $array_elements, $lang_switch_element ); // merge an array and return.
371
+ }
372
+
373
  /**
374
  * loginpress_uninstallation_filed [merge a uninstall loginpress field with array of element.]
375
+ * @param array $fields_list The free fields of LoginPress.
376
  * @since 1.1.9
377
+ * @return array the total fields which are to be removed on uninstall.
378
  */
379
  function loginpress_uninstallation_filed( $fields_list ) {
380
 
css/style-login.php CHANGED
@@ -1135,12 +1135,33 @@ body.login{
1135
  display: flex;
1136
  flex-direction: column;
1137
  }
 
 
 
1138
  body.login label[for="authcode"]:after{
1139
  display: none;
1140
  }
1141
  body.login label[for="authcode"]+input{
1142
- padding-left: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1143
  }
 
1144
  </style>
1145
 
1146
  <?php // $content = ob_get_clean(); ?>
@@ -1157,8 +1178,9 @@ padding-left: 15px;
1157
  var el = document.getElementById('login');
1158
  var elChild = document.createElement('div');
1159
  elChild.setAttribute( 'id', 'loginpress_video-background-wrapper' );
1160
- elChild.innerHTML = '<video autoplay loop id=\"loginpress_video-background\" <?php echo $loginpress_video_voice; ?> playsinline>\n" + "<source src=\"<?php echo $loginpress_bg_video; ?>\">\n" + "</video>';
1161
-
 
1162
  // Prepend it
1163
  el.appendChild(elChild);
1164
  }, false );
@@ -1200,4 +1222,4 @@ padding-left: 15px;
1200
  <?php endif; ?>
1201
  </script>
1202
  <?php endif; ?>
1203
- <?php endif; ?>
1135
  display: flex;
1136
  flex-direction: column;
1137
  }
1138
+ body #login{
1139
+ margin-bottom: 0;
1140
+ }
1141
  body.login label[for="authcode"]:after{
1142
  display: none;
1143
  }
1144
  body.login label[for="authcode"]+input{
1145
+ padding-left: 15px;
1146
+ }
1147
+ <?php
1148
+ /**
1149
+ * Load the following the Language Switcher with the language availability.
1150
+ *
1151
+ * @since 1.5.11
1152
+ */
1153
+ if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) && ! empty( get_available_languages() ) ) : ?>
1154
+ .login #language-switcher input[type="submit"]{
1155
+ margin: 0;
1156
+ color: #2271b1;
1157
+ border-color: #2271b1;
1158
+ background: #f6f7f7;
1159
+ vertical-align: top;
1160
+ height: inherit;
1161
+ width: inherit;
1162
+ font-size: inherit;
1163
  }
1164
+ <?php endif; ?>
1165
  </style>
1166
 
1167
  <?php // $content = ob_get_clean(); ?>
1178
  var el = document.getElementById('login');
1179
  var elChild = document.createElement('div');
1180
  elChild.setAttribute( 'id', 'loginpress_video-background-wrapper' );
1181
+ // elChild.innerHTML = '<video autoplay loop id=\"loginpress_video-background\" <?php echo $loginpress_video_voice; ?> playsinline>\n" + "<source src=\"<?php echo $loginpress_bg_video; ?>\">\n" + "</video>';
1182
+
1183
+ elChild.innerHTML = '<iframe id=\"loginpress_video-background\" src=\"<?php echo $loginpress_bg_video; ?>\">\n</iframe>';
1184
  // Prepend it
1185
  el.appendChild(elChild);
1186
  }, false );
1222
  <?php endif; ?>
1223
  </script>
1224
  <?php endif; ?>
1225
+ <?php endif; ?>
custom.php CHANGED
@@ -45,6 +45,10 @@ class LoginPress_Entities {
45
  add_action( 'admin_menu', array( $this, 'menu_url' ), 10 );
46
  add_filter( 'wp_login_errors', array( $this, 'remove_error_messages_in_wp_customizer' ), 10, 2 );
47
 
 
 
 
 
48
  /**
49
  * This function enqueues scripts and styles in the Customizer.
50
  */
@@ -1695,6 +1699,26 @@ class LoginPress_Entities {
1695
  remove_filter( 'lostpassword_url', 'llms_lostpassword_url', 10 );
1696
  }
1697
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1698
  /**
1699
  * Set Redirect Path of Logo
1700
  *
45
  add_action( 'admin_menu', array( $this, 'menu_url' ), 10 );
46
  add_filter( 'wp_login_errors', array( $this, 'remove_error_messages_in_wp_customizer' ), 10, 2 );
47
 
48
+ if ( version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) ) {
49
+ add_filter( 'login_display_language_dropdown', array( $this, 'loginpress_language_switch' ) );
50
+ }
51
+
52
  /**
53
  * This function enqueues scripts and styles in the Customizer.
54
  */
1699
  remove_filter( 'lostpassword_url', 'llms_lostpassword_url', 10 );
1700
  }
1701
  }
1702
+
1703
+ /**
1704
+ * Filters the Languages select input activation on the login screen.
1705
+ *
1706
+ * @param bool $arg Whether to display the Languages select input on the login screen.
1707
+ *
1708
+ * @since 1.5.11
1709
+ * @return bool
1710
+ */
1711
+ function loginpress_language_switch( $arg ) {
1712
+
1713
+ $loginpress_setting = get_option( 'loginpress_setting' );
1714
+ $language_switcher = isset( $loginpress_setting['enable_language_switcher'] ) ? $loginpress_setting['enable_language_switcher'] : 'off';
1715
+
1716
+ if ( 'off' === $language_switcher ) {
1717
+ return true;
1718
+ } else {
1719
+ return false;
1720
+ }
1721
+ }
1722
  /**
1723
  * Set Redirect Path of Logo
1724
  *
include/template-loginpress.php CHANGED
@@ -272,7 +272,70 @@ function login_footer($input_id = '') {
272
  </html>
273
  <?php
274
  }
275
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
  /**
278
  * @since 3.7.0
272
  </html>
273
  <?php
274
  }
275
+ ?>
276
+ </div><?php // End of <div id="login">.
277
+ if (
278
+ ! $interim_login && version_compare( $GLOBALS['wp_version'], '5.9', '>=' ) &&
279
+ /**
280
+ * Filters the Languages select input activation on the login screen.
281
+ *
282
+ * @since 1.5.11
283
+ *
284
+ * @param bool Whether to display the Languages select input on the login screen.
285
+ */
286
+ apply_filters( 'login_display_language_dropdown', true )
287
+ ) {
288
+ $languages = get_available_languages();
289
+
290
+ if ( ! empty( $languages ) ) {
291
+ ?>
292
+ <div class="language-switcher">
293
+ <form id="language-switcher" action="" method="get">
294
+
295
+ <label for="language-switcher-locales">
296
+ <span class="dashicons dashicons-translation" aria-hidden="true"></span>
297
+ <span class="screen-reader-text"><?php _e( 'Language' ); ?></span>
298
+ </label>
299
+
300
+ <?php
301
+ $args = array(
302
+ 'id' => 'language-switcher-locales',
303
+ 'name' => 'wp_lang',
304
+ 'selected' => determine_locale(),
305
+ 'show_available_translations' => false,
306
+ 'explicit_option_en_us' => true,
307
+ 'languages' => $languages,
308
+ );
309
+
310
+ /**
311
+ * Filters default arguments for the Languages select input on the login screen.
312
+ *
313
+ * @since 5.9.0
314
+ *
315
+ * @param array $args Arguments for the Languages select input on the login screen.
316
+ */
317
+ wp_dropdown_languages( apply_filters( 'login_language_dropdown_args', $args ) );
318
+ ?>
319
+
320
+ <?php if ( $interim_login ) { ?>
321
+ <input type="hidden" name="interim-login" value="1" />
322
+ <?php } ?>
323
+
324
+ <?php if ( isset( $_GET['redirect_to'] ) && '' !== $_GET['redirect_to'] ) { ?>
325
+ <input type="hidden" name="redirect_to" value="<?php echo esc_url_raw( $_GET['redirect_to'] ); ?>" />
326
+ <?php } ?>
327
+
328
+ <?php if ( isset( $_GET['action'] ) && '' !== $_GET['action'] ) { ?>
329
+ <input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action'] ); ?>" />
330
+ <?php } ?>
331
+
332
+ <input type="submit" class="button" value="<?php esc_attr_e( 'Change' ); ?>">
333
+
334
+ </form>
335
+ </div>
336
+ <?php } ?>
337
+ <?php } ?>
338
+ <?php
339
 
340
  /**
341
  * @since 3.7.0
loginpress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LoginPress - Customizing the WordPress Login Screen.
4
  * Plugin URI: https://loginpress.pro/?utm_source=loginpress-lite&utm_medium=plugin-inside&utm_campaign=pro-upgrade&utm_content=plugin_uri
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.5.10
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/
9
  * Text Domain: loginpress
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
22
  /**
23
  * @var string
24
  */
25
- public $version = '1.5.10';
26
 
27
  /**
28
  * @var The single instance of the class
@@ -159,7 +159,13 @@ if ( ! class_exists( 'LoginPress' ) ) :
159
 
160
  } elseif ( ! get_option( '_loginpress_optin' ) && isset( $_GET['page'] ) && ( $_GET['page'] === 'loginpress-settings' || $_GET['page'] === 'loginpress' || $_GET['page'] === 'abw' ) ) {
161
 
162
- wp_redirect( admin_url('admin.php?page=loginpress-optin&redirect-page=' . $_GET['page'] ) );
 
 
 
 
 
 
163
  exit;
164
  } elseif ( get_option( '_loginpress_optin' ) && ( get_option( '_loginpress_optin' ) == 'yes' || get_option( '_loginpress_optin' ) == 'no' ) && isset( $_GET['page'] ) && $_GET['page'] === 'loginpress-optin' ) {
165
  wp_redirect( admin_url( 'admin.php?page=loginpress-settings' ) );
3
  * Plugin Name: LoginPress - Customizing the WordPress Login Screen.
4
  * Plugin URI: https://loginpress.pro/?utm_source=loginpress-lite&utm_medium=plugin-inside&utm_campaign=pro-upgrade&utm_content=plugin_uri
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.5.11
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/
9
  * Text Domain: loginpress
22
  /**
23
  * @var string
24
  */
25
+ public $version = '1.5.11';
26
 
27
  /**
28
  * @var The single instance of the class
159
 
160
  } elseif ( ! get_option( '_loginpress_optin' ) && isset( $_GET['page'] ) && ( $_GET['page'] === 'loginpress-settings' || $_GET['page'] === 'loginpress' || $_GET['page'] === 'abw' ) ) {
161
 
162
+ /**
163
+ * XSS Attack vector found and fixed.
164
+ *
165
+ * @since 1.5.11
166
+ */
167
+ $page_redirect = $_GET['page'] === 'loginpress' ? 'loginpress' : 'loginpress-settings';
168
+ wp_redirect( admin_url('admin.php?page=loginpress-optin&redirect-page=' . $page_redirect) );
169
  exit;
170
  } elseif ( get_option( '_loginpress_optin' ) && ( get_option( '_loginpress_optin' ) == 'yes' || get_option( '_loginpress_optin' ) == 'no' ) && isset( $_GET['page'] ) && $_GET['page'] === 'loginpress-optin' ) {
171
  wp_redirect( admin_url( 'admin.php?page=loginpress-settings' ) );
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === LoginPress | Custom Login Page Customizer ===
2
  Requires at least: 4.0
3
- Tested up to: 5.8
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com/?utm_source=loginpress-lite&utm_medium=author-url-link
6
  Tags: wp-login, login, login customizer, custom login, wordpress login,
7
- Stable tag: 1.5.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -220,6 +220,11 @@ Please visit <a target="_blank" rel="friend" href="https://loginpress.pro?utm_so
220
 
221
  == Changelog ==
222
 
 
 
 
 
 
223
  = 1.5.10 – 2021-12-10 =
224
  * Enhancement: Code refactoring.
225
 
@@ -631,5 +636,5 @@ Please visit <a target="_blank" rel="friend" href="https://loginpress.pro?utm_so
631
 
632
  == Upgrade Notice ==
633
 
634
- = 1.5.10 =
635
- * Important Release, upgrade immediately. Compatible with 5.8
1
  === LoginPress | Custom Login Page Customizer ===
2
  Requires at least: 4.0
3
+ Tested up to: 5.9
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com/?utm_source=loginpress-lite&utm_medium=author-url-link
6
  Tags: wp-login, login, login customizer, custom login, wordpress login,
7
+ Stable tag: 1.5.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
220
 
221
  == Changelog ==
222
 
223
+ = 1.5.11 – 2022-01-31 =
224
+ * New Feature: Introducing Language Switcher (Enable / Disable) settings on Login wp-login Page.
225
+ * Enhancement: Code refactoring.
226
+ * Compatibility: Compatible with WordPress 5.9.
227
+
228
  = 1.5.10 – 2021-12-10 =
229
  * Enhancement: Code refactoring.
230
 
636
 
637
  == Upgrade Notice ==
638
 
639
+ = 1.5.11 =
640
+ * Important Release, upgrade immediately. Compatible with 5.9