Custom Login Page Customizer - Version 2.1.9

Version Description

  • Update immediately - compatible with 6.0

=

Download this release

Release Info

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

Code changes from version 2.1.8 to 2.1.9

Files changed (5) hide show
  1. Uninstall.php +25 -23
  2. login-customizer.php +1 -1
  3. readme.md +9 -5
  4. readme.txt +8 -4
  5. src/Settings/Setup.php +67 -32
Uninstall.php CHANGED
@@ -1,30 +1,31 @@
1
  <?php
2
  /**
3
  * Uninstall Login Customizer
 
4
  * @since 2.1.6
5
  */
6
 
7
- // if uninstall.php is not called by WordPress, die
8
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
9
- die;
10
  }
11
-
12
- // Get global wpdb
13
  global $wpdb;
14
 
15
  $logincust_settings = get_option( 'logincust_setting' );
16
 
17
- // If not a multisite
18
- if( !is_multisite() ) {
19
 
20
- if( isset( $logincust_settings ) && isset( $logincust_settings['logincust_delete_all'] ) && 'on' == $logincust_settings['logincust_delete_all'] ){
21
  delete_option( 'login_customizer_options' );
22
  delete_option( 'logincust_setting' );
23
  }
24
 
25
  $page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
26
 
27
- if( $page_id ) {
28
  wp_delete_post( $page_id, true );
29
  }
30
 
@@ -33,29 +34,30 @@ if( !is_multisite() ) {
33
  delete_option( 'logincustomizer_active_time' );
34
 
35
  } else {
36
-
37
- //if multisite then go through each blog and remove the page and its settings accordingly.
38
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
39
 
40
- foreach( $blog_ids as $blog_id ) {
 
 
41
  switch_to_blog( $blog_id );
42
 
43
- if( isset( $logincust_settings ) && isset( $logincust_settings['logincust_delete_all'] ) && 'on' == $logincust_settings['logincust_delete_all'] ){
44
- delete_option( 'login_customizer_options' );
45
- delete_option( 'logincust_setting' );
46
- }
47
-
48
  $page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
49
-
50
- if( $page_id ) {
51
  wp_delete_post( $page_id, true );
52
  }
53
-
54
- delete_option( 'login_customizer_settings' );
 
 
 
 
 
55
  delete_option( 'logincustomizer_review_dismiss' );
56
  delete_option( 'logincustomizer_active_time' );
57
-
58
  restore_current_blog();
59
 
60
  }
61
- }
1
  <?php
2
  /**
3
  * Uninstall Login Customizer
4
+ *
5
  * @since 2.1.6
6
  */
7
 
8
+ // if uninstall.php is not called by WordPress, die.
9
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
10
+ die;
11
  }
12
+
13
+ // Get global wpdb.
14
  global $wpdb;
15
 
16
  $logincust_settings = get_option( 'logincust_setting' );
17
 
18
+ // If not a multisite.
19
+ if ( ! is_multisite() ) {
20
 
21
+ if ( isset( $logincust_settings ) && isset( $logincust_settings['logincust_delete_all'] ) && 'on' === $logincust_settings['logincust_delete_all'] ) {
22
  delete_option( 'login_customizer_options' );
23
  delete_option( 'logincust_setting' );
24
  }
25
 
26
  $page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
27
 
28
+ if ( $page_id ) {
29
  wp_delete_post( $page_id, true );
30
  }
31
 
34
  delete_option( 'logincustomizer_active_time' );
35
 
36
  } else {
37
+
38
+ // if multisite then go through each blog and remove the page and its settings accordingly.
39
  $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
40
 
41
+ foreach ( $blog_ids as $blog_id ) {
42
+
43
+ // Switch to blogs if there are more than One(1).
44
  switch_to_blog( $blog_id );
45
 
 
 
 
 
 
46
  $page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
47
+ if ( $page_id ) {
 
48
  wp_delete_post( $page_id, true );
49
  }
50
+
51
+ if ( isset( $logincust_settings ) && isset( $logincust_settings['logincust_delete_all'] ) && 'on' === $logincust_settings['logincust_delete_all'] ) {
52
+ delete_option( 'login_customizer_options' );
53
+ delete_option( 'login_customizer_settings' );
54
+ delete_option( 'logincust_setting' );
55
+ }
56
+
57
  delete_option( 'logincustomizer_review_dismiss' );
58
  delete_option( 'logincustomizer_active_time' );
59
+
60
  restore_current_blog();
61
 
62
  }
63
+ }
login-customizer.php CHANGED
@@ -3,7 +3,7 @@
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.8
7
  * Requires at least: 5.0
8
  * Requires PHP: 5.6
9
  * Author: Hardeep Asrani
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.9
7
  * Requires at least: 5.0
8
  * Requires PHP: 5.6
9
  * Author: Hardeep Asrani
readme.md CHANGED
@@ -1,7 +1,7 @@
1
  # Custom Login Page Customizer #
2
  **Stable tag:** trunk
3
  **Requires at least:** 4.0
4
- **Tested up to:** 5.9
5
  **Contributors:** [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [hiddenpearls](https://profiles.wordpress.org/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
@@ -41,19 +41,23 @@ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/">th
41
 
42
  ## Changelog ##
43
 
44
- = 2.1.7 – 2022-02-18 =
 
 
 
 
45
  * New Feature: Introducing Language Switcher (On / Off) setting.
46
  * Compatibility: Compatible with WordPress 5.9.
47
 
48
- = 2.1.6 - 2021-09-07 =
49
  * Bugfix: Fiexed PHP error for default Logo Height.
50
  * Bugfix: Login Customizer Page delation issue.
51
  * Enhancement: Create Uninstall.php for removing plugin options from DB & Login Customizer Page on uninstalling the plugin.
52
 
53
- = 2.1.5 - 2021-07-23 =
54
  * Enhancement: Optimized Code.
55
  * Compatibility: Compatible with WordPress 5.8.
56
 
57
- = 2.1.4 - 2021-06-16 =
58
  * New Feature: Introducing a new control for change wp-login.php page title.
59
  * Enhancement: Optimized Code & fix PHP 8.0 Error.
1
  # Custom Login Page Customizer #
2
  **Stable tag:** trunk
3
  **Requires at least:** 4.0
4
+ **Tested up to:** 6.0
5
  **Contributors:** [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [hiddenpearls](https://profiles.wordpress.org/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
41
 
42
  ## Changelog ##
43
 
44
+ ### 2.1.9 – 2022-05-19 ###
45
+ * BugFix: Uninstall plugin settings from database for Multi-sites.
46
+ * Compatibility: Compatible with WordPress 6.0
47
+
48
+ ### 2.1.7 – 2022-02-18 ###
49
  * New Feature: Introducing Language Switcher (On / Off) setting.
50
  * Compatibility: Compatible with WordPress 5.9.
51
 
52
+ ### 2.1.6 - 2021-09-07 ###
53
  * Bugfix: Fiexed PHP error for default Logo Height.
54
  * Bugfix: Login Customizer Page delation issue.
55
  * Enhancement: Create Uninstall.php for removing plugin options from DB & Login Customizer Page on uninstalling the plugin.
56
 
57
+ ### 2.1.5 - 2021-07-23 ###
58
  * Enhancement: Optimized Code.
59
  * Compatibility: Compatible with WordPress 5.8.
60
 
61
+ ### 2.1.4 - 2021-06-16 ###
62
  * New Feature: Introducing a new control for change wp-login.php page title.
63
  * Enhancement: Optimized Code & fix PHP 8.0 Error.
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Login Page Customizer ===
2
  Requires at least: 4.0
3
- Tested up to: 5.9
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.8
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -46,11 +46,15 @@ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/?utm
46
 
47
  == Upgrade Notice ==
48
 
49
- = 2.1.8 =
50
- * Update immediately - compatible with 5.9
51
 
52
  == Changelog ==
53
 
 
 
 
 
54
  = 2.1.8 – 2022-03-08 =
55
  * Security Fix: Update the Freemius SDK v2.4.3.
56
 
1
  === Custom Login Page Customizer ===
2
  Requires at least: 4.0
3
+ Tested up to: 6.0
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.9
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
46
 
47
  == Upgrade Notice ==
48
 
49
+ = 2.1.9 =
50
+ * Update immediately - compatible with 6.0
51
 
52
  == Changelog ==
53
 
54
+ = 2.1.9 – 2022-05-19 =
55
+ * BugFix: Uninstall plugin settings from database for Multi-sites.
56
+ * Compatibility: Compatible with WordPress 6.0
57
+
58
  = 2.1.8 – 2022-03-08 =
59
  * Security Fix: Update the Freemius SDK v2.4.3.
60
 
src/Settings/Setup.php CHANGED
@@ -185,12 +185,6 @@ class Setup {
185
  'email' => __( 'Only Email Address', 'login-customizer' ),
186
  ),
187
  ),
188
- array(
189
- 'name' => 'logincust_delete_all',
190
- 'label' => __( 'Delete All Settings', 'login-customizer' ),
191
- 'desc' => __( 'Enable this option to delete every settings of this plugin on uninstall', 'login-customizer' ),
192
- 'type' => 'checkbox',
193
- ),
194
  );
195
 
196
  if ( '0' !== get_option( 'users_can_register' ) ) {
@@ -206,7 +200,10 @@ class Setup {
206
  $free_fields = $this->logincust_language_switcher( $free_fields );
207
  }
208
 
209
- $_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
 
 
 
210
  $settings_fields = array( 'logincust_setting' => $_settings_fields );
211
  $tab = apply_filters( 'login_customizer_settings_fields', $settings_fields );
212
 
@@ -214,46 +211,84 @@ class Setup {
214
  }
215
 
216
  /**
217
- * logincust_language_switcher [merge a language switcher in the settings element of array.]
218
- *
219
- * @param array $fields_list The free fields of Login customizer.
220
- * @since 2.1.7
221
- * @return array the total fields including the added field of language switcher
222
- */
223
- public function logincust_language_switcher( $fields_list ) {
224
 
225
- $array_elements = array_slice( $fields_list, 0, -1 ); //slice a last element of array.
226
- $last_element = end( $fields_list ); // last element of array.
227
- $switcher_option = array(
228
- 'name' => 'enable_language_switcher',
229
- 'label' => __( 'Language Switcher', 'login-customizer' ),
230
- 'desc' => __( 'Remove Language Switcher Dropdown On Login Page. ', 'login-customizer' ),
231
- 'type' => 'checkbox',
232
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
- $lang_switch_element = array_merge( array( $switcher_option, $last_element ) );
235
- return array_merge( $array_elements, $lang_switch_element );
 
 
 
 
 
 
 
236
  }
237
 
238
  /**
239
- * logincust_custom_register_field [merge a custom password field in the settings element of array.]
240
  *
241
  * @param array $fields_list The free fields of Login customizer.
242
  * @since 2.1.7
 
243
  * @return array the total fields including the added field of custom password field
244
  */
245
  public function logincust_custom_register_field( $fields_list ) {
246
 
247
- $array_elements = array_slice( $fields_list, 0, -1 ); //slice a last element of array.
248
- $last_element = end( $fields_list ); // last element of array.
249
  $register_field_option = array(
250
- 'name' => 'enable_reg_pass_field',
251
- 'label' => __( 'Custom Password Fields', 'login-customizer' ),
252
- 'desc' => __( 'Enable custom password fields on registration form.', 'login-customizer' ),
253
- 'type' => 'checkbox',
 
 
254
  );
255
- $lang_switch_element = array_merge( array( $register_field_option, $last_element ) );
256
- return array_merge( $array_elements, $lang_switch_element );
257
  }
258
 
259
 
185
  'email' => __( 'Only Email Address', 'login-customizer' ),
186
  ),
187
  ),
 
 
 
 
 
 
188
  );
189
 
190
  if ( '0' !== get_option( 'users_can_register' ) ) {
200
  $free_fields = $this->logincust_language_switcher( $free_fields );
201
  }
202
 
203
+ // Add Login Customizer uninstall field for the main blog on multi-site.
204
+ $_free_fields = $this->logincust_uninstall_tool( $free_fields );
205
+
206
+ $_settings_fields = apply_filters( 'login_customizer_pro_settings', $_free_fields );
207
  $settings_fields = array( 'logincust_setting' => $_settings_fields );
208
  $tab = apply_filters( 'login_customizer_settings_fields', $settings_fields );
209
 
211
  }
212
 
213
  /**
214
+ * Function logincust_uninstall_field [merge a uninstall Login Customizer field with array of element.]
215
+ * @param array $fields_list The free fields of Login Customizer.
216
+ * @since 2.1.9
217
+ * @return array the total fields which are to be removed on uninstall.
218
+ */
219
+ function logincust_uninstall_field( $fields_list ) {
 
220
 
221
+ $logincust_uninstall = array(
222
+ array(
223
+ 'name' => 'logincust_delete_all',
224
+ 'label' => __( 'Delete All Settings', 'login-customizer' ),
225
+ 'desc' => esc_html__( 'Enable this option to delete every settings of this plugin on uninstall', 'login-customizer' ),
226
+ 'type' => 'checkbox',
227
+ )
228
  );
229
+ return array_merge( $fields_list, $logincust_uninstall ); // merge an array and return.
230
+ }
231
+
232
+ /**
233
+ * Function logincust_uninstall_tool[Pass return true in logincust_multisite_uninstall_tool filter's callback for enable uninstall control on each site.]
234
+ *
235
+ * @param array $_free_fields [array of free fields]
236
+ * @since 2.1.9
237
+ * @return array
238
+ */
239
+ function logincust_uninstall_tool( $_free_fields ) {
240
+
241
+ if ( is_multisite() && ! apply_filters( 'logincust_multisite_uninstall_tool', false ) ) {
242
+ if ( get_current_blog_id() == '1' ) {
243
+ $_free_fields = $this->logincust_uninstall_field( $_free_fields );
244
+ }
245
+ } else {
246
+ $_free_fields = $this->logincust_uninstall_field( $_free_fields );
247
+ }
248
+
249
+ return $_free_fields;
250
+ }
251
+
252
+ /**
253
+ * Function logincust_language_switcher [merge a language switcher in the settings element of array.]
254
+ *
255
+ * @param array $fields_list The free fields of Login customizer.
256
+ * @since 2.1.7
257
+ * @version 2.1.9
258
+ * @return array the total fields including the added field of language switcher
259
+ */
260
+ public function logincust_language_switcher( $fields_list ) {
261
 
262
+ $language_switcher = array(
263
+ array(
264
+ 'name' => 'enable_language_switcher',
265
+ 'label' => __( 'Language Switcher', 'login-customizer' ),
266
+ 'desc' => __( 'Remove Language Switcher Dropdown On Login Page. ', 'login-customizer' ),
267
+ 'type' => 'checkbox',
268
+ ),
269
+ );
270
+ return array_merge( $fields_list, $language_switcher ); // merge an array and return.
271
  }
272
 
273
  /**
274
+ * Function logincust_custom_register_field [merge a custom password field in the settings element of array.]
275
  *
276
  * @param array $fields_list The free fields of Login customizer.
277
  * @since 2.1.7
278
+ * @version 2.1.9
279
  * @return array the total fields including the added field of custom password field
280
  */
281
  public function logincust_custom_register_field( $fields_list ) {
282
 
 
 
283
  $register_field_option = array(
284
+ array(
285
+ 'name' => 'enable_reg_pass_field',
286
+ 'label' => __( 'Custom Password Fields', 'login-customizer' ),
287
+ 'desc' => __( 'Enable custom password fields on registration form.', 'login-customizer' ),
288
+ 'type' => 'checkbox',
289
+ ),
290
  );
291
+ return array_merge( $fields_list, $register_field_option ); // merge an array and return.
 
292
  }
293
 
294