Version Description
- Update immediately - compatible with 5.8
=
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Custom Login Page Customizer |
Version | 2.1.6 |
Comparing to | |
See all releases |
Code changes from version 2.1.5 to 2.1.6
- Uninstall.php +61 -0
- login-customizer.php +1 -1
- readme.txt +7 -2
- src/Customizer/Initial_Setup.php +17 -6
- src/Customizer/Panel/Custom_Code.php +4 -0
- src/Customizer/Setup.php +5 -2
- src/Settings/Setup.php +8 -1
Uninstall.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
31 |
+
delete_option( 'login_customizer_settings' );
|
32 |
+
delete_option( 'logincustomizer_review_dismiss' );
|
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 |
+
}
|
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.
|
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.6
|
7 |
* Requires at least: 5.0
|
8 |
* Requires PHP: 5.6
|
9 |
* Author: Hardeep Asrani
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tested up to: 5.8
|
|
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 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -46,11 +46,16 @@ Please visit <a target="_blank" rel="nofollow" href="https://loginpress.pro/?utm
|
|
46 |
|
47 |
== Upgrade Notice ==
|
48 |
|
49 |
-
= 2.1.
|
50 |
* Update immediately - compatible with 5.8
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
|
|
54 |
= 2.1.5 - 2021-07-23 =
|
55 |
* Enhancement: Optimized Code.
|
56 |
* Compatibility: Compatible with WordPress 5.8.
|
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.6
|
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.6 =
|
50 |
* Update immediately - compatible with 5.8
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
= 2.1.6 - 2021-09-07 =
|
55 |
+
* Bugfix: Fiexed PHP error for default Logo Height.
|
56 |
+
* Bugfix: Login Customizer Page delation issue.
|
57 |
+
* Enhancement: Create Uninstall.php for removing plugin options from DB & Login Customizer Page on uninstalling the plugin.
|
58 |
+
|
59 |
= 2.1.5 - 2021-07-23 =
|
60 |
* Enhancement: Optimized Code.
|
61 |
* Compatibility: Compatible with WordPress 5.8.
|
src/Customizer/Initial_Setup.php
CHANGED
@@ -37,12 +37,7 @@ class LoginCustomizerSetup {
|
|
37 |
*/
|
38 |
public function check_page() {
|
39 |
|
40 |
-
|
41 |
-
global $wpdb;
|
42 |
-
|
43 |
-
// Get page ID of page with Login Customizer template
|
44 |
-
$page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
|
45 |
-
|
46 |
// Update page if exists, else create a new one
|
47 |
if ( $page_id ) {
|
48 |
$this->update_page( $page_id );
|
@@ -51,6 +46,22 @@ class LoginCustomizerSetup {
|
|
51 |
}
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* If page exists, check if it's setup properly.
|
56 |
*/
|
37 |
*/
|
38 |
public function check_page() {
|
39 |
|
40 |
+
$page_id = $this->page_id();
|
|
|
|
|
|
|
|
|
|
|
41 |
// Update page if exists, else create a new one
|
42 |
if ( $page_id ) {
|
43 |
$this->update_page( $page_id );
|
46 |
}
|
47 |
}
|
48 |
|
49 |
+
/**
|
50 |
+
* Retrive page ID from DB for login-customizer page.
|
51 |
+
*
|
52 |
+
* @since 2.1.6
|
53 |
+
*/
|
54 |
+
public static function page_id(){
|
55 |
+
|
56 |
+
// Get global wpdb
|
57 |
+
global $wpdb;
|
58 |
+
|
59 |
+
// Get page ID of page with Login Customizer template
|
60 |
+
$page_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = 'login-customizer' LIMIT 1;" );
|
61 |
+
|
62 |
+
return $page_id;
|
63 |
+
}
|
64 |
+
|
65 |
/**
|
66 |
* If page exists, check if it's setup properly.
|
67 |
*/
|
src/Customizer/Panel/Custom_Code.php
CHANGED
@@ -66,6 +66,10 @@ namespace LoginCustomizer\Customizer\Panel;
|
|
66 |
$custom_css .= 'height: ' . $options['logincust_logo_height'] . ';';
|
67 |
}
|
68 |
if ( ! empty( $options['logincust_logo_width'] ) || ! empty( $options['logincust_logo_height'] ) ) {
|
|
|
|
|
|
|
|
|
69 |
$custom_css .= 'background-size: ' . $options['logincust_logo_width'] . ' ' . $options['logincust_logo_height'] . ';';
|
70 |
}
|
71 |
if ( ! empty( $options['logincust_logo_padding'] ) ) {
|
66 |
$custom_css .= 'height: ' . $options['logincust_logo_height'] . ';';
|
67 |
}
|
68 |
if ( ! empty( $options['logincust_logo_width'] ) || ! empty( $options['logincust_logo_height'] ) ) {
|
69 |
+
|
70 |
+
$options['logincust_logo_height'] = isset( $options['logincust_logo_height'] ) ? $options['logincust_logo_height'] : '84px';
|
71 |
+
$options['logincust_logo_width'] = isset( $options['logincust_logo_width'] ) ? $options['logincust_logo_width'] : '84px';
|
72 |
+
|
73 |
$custom_css .= 'background-size: ' . $options['logincust_logo_width'] . ' ' . $options['logincust_logo_height'] . ';';
|
74 |
}
|
75 |
if ( ! empty( $options['logincust_logo_padding'] ) ) {
|
src/Customizer/Setup.php
CHANGED
@@ -11,11 +11,14 @@ include( plugin_dir_path( __FILE__ ) . '/Initial_Setup.php' );
|
|
11 |
* Setup login page for new and updated instances.
|
12 |
*/
|
13 |
if ( get_option( 'login_customizer_settings' ) ) {
|
|
|
14 |
$db_version = get_option( 'login_customizer_settings', array() );
|
15 |
$db_version = $db_version['version'];
|
16 |
-
|
|
|
|
|
17 |
// Compare version of plugin with previously saved version
|
18 |
-
if ( version_compare( $db_version, LOGINCUST_FREE_VERSION, '<' ) ) {
|
19 |
// Setup login page
|
20 |
return LoginCustomizerSetup::get_instance();
|
21 |
}
|
11 |
* Setup login page for new and updated instances.
|
12 |
*/
|
13 |
if ( get_option( 'login_customizer_settings' ) ) {
|
14 |
+
|
15 |
$db_version = get_option( 'login_customizer_settings', array() );
|
16 |
$db_version = $db_version['version'];
|
17 |
+
|
18 |
+
if ( isset( $db_version ) ) {
|
19 |
+
|
20 |
// Compare version of plugin with previously saved version
|
21 |
+
if ( version_compare( $db_version, LOGINCUST_FREE_VERSION, '<' ) || ! LoginCustomizerSetup::page_id() ) {
|
22 |
// Setup login page
|
23 |
return LoginCustomizerSetup::get_instance();
|
24 |
}
|
src/Settings/Setup.php
CHANGED
@@ -166,6 +166,13 @@ class Setup {
|
|
166 |
* [$free_fields array of free fields]
|
167 |
* @var array
|
168 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
$remember_field = array(
|
171 |
'name' => 'auto_remember_me',
|
@@ -194,7 +201,7 @@ class Setup {
|
|
194 |
'type' => 'checkbox'
|
195 |
);
|
196 |
|
197 |
-
$free_fields = get_option( 'users_can_register' ) == '0' ? array( $remember_field, $login_order ) : array( $remember_field, $register_pass_field, $login_order );
|
198 |
|
199 |
$_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
|
200 |
$settings_fields = array( 'logincust_setting' => $_settings_fields );
|
166 |
* [$free_fields array of free fields]
|
167 |
* @var array
|
168 |
*/
|
169 |
+
$delete_all = array(
|
170 |
+
'name' => 'logincust_delete_all',
|
171 |
+
'label' => __( 'Delete All Settings', 'login-customizer' ),
|
172 |
+
'desc' => __( 'Enable this option to delete every settings of this plugin on uninstall', 'login-customizer' ),
|
173 |
+
|
174 |
+
'type' => 'checkbox'
|
175 |
+
);
|
176 |
|
177 |
$remember_field = array(
|
178 |
'name' => 'auto_remember_me',
|
201 |
'type' => 'checkbox'
|
202 |
);
|
203 |
|
204 |
+
$free_fields = get_option( 'users_can_register' ) == '0' ? array( $remember_field, $login_order, $delete_all ) : array( $remember_field, $register_pass_field, $login_order, $delete_all );
|
205 |
|
206 |
$_settings_fields = apply_filters( 'login_customizer_pro_settings', $free_fields );
|
207 |
$settings_fields = array( 'logincust_setting' => $_settings_fields );
|