Custom Login Page Customizer | LoginPress - Version 1.1.9

Version Description

  • 2018-08-25 =
  • New Feature: Create a option for removing the LoginPress settings/page during uninstallation of the plugin.
  • Update: log file.
  • Update: LoginPress addon ( Social Login ).
  • Compatibility: Compatible with WordPress 4.9.
  • Enhancement: Code refactoring.
Download this release

Release Info

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

Code changes from version 1.1.8 to 1.1.9

classes/class-loginpress-log.php CHANGED
@@ -25,6 +25,7 @@ class LoginPress_Log_Info {
25
  $customization = isset( $loginpress_config ) ? print_r( $loginpress_config, true ) : 'No customization yet';
26
  $lostpassword_url = isset( $loginpress_setting['lostpassword_url'] ) ? $loginpress_setting['lostpassword_url'] : 'off';
27
  $_loginpassword_url = ( $lostpassword_url == 'on' ) ? 'WordPress Default' : "WooCommerce Custom URL";
 
28
 
29
  $html = '### Begin System Info ###' . "\n\n";
30
 
@@ -47,6 +48,7 @@ class LoginPress_Log_Info {
47
  if ( class_exists( 'WooCommerce' ) ) {
48
  $html .= 'Lost Password URL: ' . $_loginpassword_url . "\n";
49
  }
 
50
  $html .= 'Total Customized Fields: ' . count( $loginpress_config ) . "\n";
51
  $html .= 'Customization Detail: ' . $customization . "\n";
52
 
25
  $customization = isset( $loginpress_config ) ? print_r( $loginpress_config, true ) : 'No customization yet';
26
  $lostpassword_url = isset( $loginpress_setting['lostpassword_url'] ) ? $loginpress_setting['lostpassword_url'] : 'off';
27
  $_loginpassword_url = ( $lostpassword_url == 'on' ) ? 'WordPress Default' : "WooCommerce Custom URL";
28
+ $loginpress_uninstall= isset( $loginpress_setting['loginpress_uninstall'] ) ? $loginpress_setting['loginpress_uninstall'] : 'off';
29
 
30
  $html = '### Begin System Info ###' . "\n\n";
31
 
48
  if ( class_exists( 'WooCommerce' ) ) {
49
  $html .= 'Lost Password URL: ' . $_loginpassword_url . "\n";
50
  }
51
+ $html .= 'Uninstallation: ' . $loginpress_uninstall . "\n";
52
  $html .= 'Total Customized Fields: ' . count( $loginpress_config ) . "\n";
53
  $html .= 'Customization Detail: ' . $customization . "\n";
54
 
classes/class-loginpress-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * LoginPress Settings
4
  *
5
  * @since 1.0.9
6
- * @version 1.1.7
7
  */
8
  if ( ! class_exists( 'LoginPress_Settings' ) ):
9
 
@@ -190,6 +190,9 @@ class LoginPress_Settings {
190
  $_free_fields = $this->loginpress_woocommerce_lostpasword_url( $_free_fields );
191
  }
192
 
 
 
 
193
  $_settings_fields = apply_filters( 'loginpress_pro_settings', $_free_fields );
194
 
195
  $settings_fields = array( 'loginpress_setting' => $_settings_fields );
@@ -292,5 +295,46 @@ class LoginPress_Settings {
292
  return array_merge( $array_elements, $last_two_elements ); // merge an array and return.
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  }
296
  endif;
3
  * LoginPress Settings
4
  *
5
  * @since 1.0.9
6
+ * @version 1.1.9
7
  */
8
  if ( ! class_exists( 'LoginPress_Settings' ) ):
9
 
190
  $_free_fields = $this->loginpress_woocommerce_lostpasword_url( $_free_fields );
191
  }
192
 
193
+ // Add loginpress_uninstall field in version 1.1.9
194
+ $_free_fields = $this->loginpress_uninstallation_tool( $_free_fields );
195
+
196
  $_settings_fields = apply_filters( 'loginpress_pro_settings', $_free_fields );
197
 
198
  $settings_fields = array( 'loginpress_setting' => $_settings_fields );
295
  return array_merge( $array_elements, $last_two_elements ); // merge an array and return.
296
  }
297
 
298
+ /**
299
+ * loginpress_uninstallation_filed [merge a uninstall loginpress field with array of element.]
300
+ * @param array $fields_list
301
+ * @since 1.1.9
302
+ * @return array
303
+ */
304
+ function loginpress_uninstallation_filed( $fields_list ) {
305
+
306
+ $loginpress_page_check = '';
307
+ if ( is_multisite() ) {
308
+ $loginpress_page_check = __( 'and LoginPress page', 'loginpress' );
309
+ }
310
+
311
+ $loginpress_db_check = array( array(
312
+ 'name' => 'loginpress_uninstall',
313
+ 'label' => __( 'Remove Settings on Uninstall', 'loginpress' ),
314
+ 'desc' => sprintf( esc_html__( 'This tool will remove all LoginPress settings %1$s upon uninstall.', 'loginpress' ), $loginpress_page_check ),
315
+ 'type' => 'checkbox'
316
+ ) );
317
+ return array_merge( $fields_list, $loginpress_db_check ); // merge an array and return.
318
+ }
319
+
320
+ /**
321
+ * loginpress_uninstallation_tool [Pass return true in loginpress_multisite_uninstallation_tool filter's callback for enable uninsatalltion control on each site.]
322
+ * @param array $_free_fields
323
+ * @since 1.1.9
324
+ * @return array
325
+ */
326
+ function loginpress_uninstallation_tool( $_free_fields ) {
327
+
328
+ if ( is_multisite() && ! apply_filters( 'loginpress_multisite_uninstallation_tool', false ) ) {
329
+ if ( get_current_blog_id() == '1' ) {
330
+ $_free_fields = $this->loginpress_uninstallation_filed( $_free_fields );
331
+ }
332
+ } else {
333
+ $_free_fields = $this->loginpress_uninstallation_filed( $_free_fields );
334
+ }
335
+
336
+ return $_free_fields;
337
+ }
338
+
339
  }
340
  endif;
loginpress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: http://WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
- * Version: 1.1.8
7
  * Author: WPBrigade
8
  * Author URI: http://WPBrigade.com/
9
  * Text Domain: loginpress
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
22
  /**
23
  * @var string
24
  */
25
- public $version = '1.1.8';
26
 
27
  /**
28
  * @var The single instance of the class
3
  * Plugin Name: LoginPress - Customizing the WordPress Login
4
  * Plugin URI: http://WPBrigade.com/wordpress/plugins/loginpress/
5
  * Description: LoginPress is the best <code>wp-login</code> Login Page Customizer plugin by <a href="https://wpbrigade.com/">WPBrigade</a> which allows you to completely change the layout of login, register and forgot password forms.
6
+ * Version: 1.1.9
7
  * Author: WPBrigade
8
  * Author URI: http://WPBrigade.com/
9
  * Text Domain: loginpress
22
  /**
23
  * @var string
24
  */
25
+ public $version = '1.1.9';
26
 
27
  /**
28
  * @var The single instance of the class
readme.txt CHANGED
@@ -3,8 +3,8 @@ Requires at least: 4.0
3
  Tested up to: 4.9
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
- Tags: wp-login, custom wp-login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
- Stable tag: 1.1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -204,6 +204,13 @@ Please visit <a target="_blank" rel="friend" href="http://WPBrigade.com/wordpres
204
 
205
  == Changelog ==
206
 
 
 
 
 
 
 
 
207
  = 1.1.8 - 2018-08-08 =
208
  * Update: log file.
209
  * Compatibility: Compatible with WordPress 4.9.
@@ -211,7 +218,7 @@ Please visit <a target="_blank" rel="friend" href="http://WPBrigade.com/wordpres
211
  = 1.1.7 - 2018-07-13 =
212
  * New Feature: Create a setting option "Lost Password URL" for using WordPress default forget form instead WooCommerce forget form.
213
  * New Feature: Create a Hook for removing "Remember me" checkbox.
214
- * New Feature: Compatible with LoginPress new addon (Login Menus).
215
  * Bugfix: Multisite PHP error.
216
  * Update: French language.
217
  * Update: POT file.
@@ -398,5 +405,5 @@ Please visit <a target="_blank" rel="friend" href="http://WPBrigade.com/wordpres
398
 
399
  == Upgrade Notice ==
400
 
401
- = 1.1.8 =
402
  * Important Release, upgrade immediately.
3
  Tested up to: 4.9
4
  Contributors: WPBrigade, hiddenpearls, AbdulWahab610
5
  Author URI: https://wpbrigade.com
6
+ Tags: wp-login, login, login customizer, custom login, custom login logo, login customizer, custom login page, login error, login page style, loginpress
7
+ Stable tag: 1.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
204
 
205
  == Changelog ==
206
 
207
+ = 1.1.9 - 2018-08-25 =
208
+ * New Feature: Create a option for removing the LoginPress settings/page during uninstallation of the plugin.
209
+ * Update: log file.
210
+ * Update: LoginPress addon ( Social Login ).
211
+ * Compatibility: Compatible with WordPress 4.9.
212
+ * Enhancement: Code refactoring.
213
+
214
  = 1.1.8 - 2018-08-08 =
215
  * Update: log file.
216
  * Compatibility: Compatible with WordPress 4.9.
218
  = 1.1.7 - 2018-07-13 =
219
  * New Feature: Create a setting option "Lost Password URL" for using WordPress default forget form instead WooCommerce forget form.
220
  * New Feature: Create a Hook for removing "Remember me" checkbox.
221
+ * New Feature: Compatible with LoginPress new addon ( Login Menus ).
222
  * Bugfix: Multisite PHP error.
223
  * Update: French language.
224
  * Update: POT file.
405
 
406
  == Upgrade Notice ==
407
 
408
+ = 1.1.9 =
409
  * Important Release, upgrade immediately.
uninstall.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Uninstall LoginPress.
4
+ *
5
+ * @package loginpress
6
+ * @author WPBrigade
7
+ * @since 1.1.9
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12
+ exit;
13
+ }
14
+
15
+ $loginpress_setting = get_option( 'loginpress_setting' );
16
+ $loginpress_uninstall = isset( $loginpress_setting['loginpress_uninstall'] ) ? $loginpress_setting['loginpress_uninstall'] : 'off';
17
+ if ( 'on' != $loginpress_uninstall ) {
18
+ return;
19
+ }
20
+
21
+ // Load the LoginPress file.
22
+ require_once 'loginpress.php';
23
+
24
+ // Array of Plugin's Option.
25
+ $loginpress_uninstall_options = array(
26
+ 'loginpress_customization',
27
+ 'loginpress_setting',
28
+ 'loginpress_addon_active_time',
29
+ 'loginpress_addon_dismiss_1',
30
+ 'loginpress_review_dismiss',
31
+ 'loginpress_active_time',
32
+ '_loginpress_optin',
33
+ );
34
+
35
+ if ( ! is_multisite() ) {
36
+
37
+ // Delete all plugin Options.
38
+ foreach ( $loginpress_uninstall_options as $option ) {
39
+ if ( get_option( $option ) ) {
40
+ delete_option( $option );
41
+ }
42
+ }
43
+
44
+ } else {
45
+
46
+ global $wpdb;
47
+ $loginpress_blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
48
+
49
+ foreach ( $loginpress_blog_ids as $blog_id ) {
50
+
51
+ switch_to_blog( $blog_id );
52
+
53
+ // Pull the LoginPress page from options.
54
+ $loginpress = new LoginPress();
55
+ $loginpress_page = $loginpress->get_loginpress_page();
56
+ $loginpress_page_id = $loginpress_page->ID;
57
+
58
+ wp_trash_post( $loginpress_page_id );
59
+
60
+ // Delete all plugin Options.
61
+ foreach ( $loginpress_uninstall_options as $option ) {
62
+ if ( get_option( $option ) ) {
63
+ delete_option( $option );
64
+ }
65
+ }
66
+
67
+ restore_current_blog();
68
+ }
69
+ }
70
+
71
+
72
+ // Clear any cached data that has been removed.
73
+ // wp_cache_flush();