Version Description
- 2018-11-20 =
- New Feature: Detect CapsLock ON.
- Bugfix: Jetpack captcha input field conflict.
- Enhancement: Important Security update.
- Enhancement: Code refactoring.
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Custom Login Page Customizer | LoginPress |
Version | 1.1.14 |
Comparing to | |
See all releases |
Code changes from version 1.1.13 to 1.1.14
- classes/class-loginpress-ajax.php +45 -4
- classes/class-loginpress-notifications.php +303 -0
- css/style-login.php +67 -1
- css/style-review.css +27 -0
- css/style.css +0 -1
- css/themes/default-1.php +5 -1
- img/black-friday.png +0 -0
- include/deactivate_modal.php +12 -0
- include/loginpress-import-export.php +6 -0
- include/loginpress-optout-form.php +13 -1
- js/admin-custom.js +78 -58
- js/loginpress.js +39 -0
- loginpress.php +23 -185
- readme.txt +9 -3
- uninstall.php +2 -0
classes/class-loginpress-ajax.php
CHANGED
@@ -8,6 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
* Handling all the AJAX calls in LoginPress.
|
9 |
*
|
10 |
* @since 1.0.19
|
|
|
11 |
* @class LoginPress_AJAX
|
12 |
*/
|
13 |
|
@@ -46,9 +47,16 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
46 |
* [Import LoginPress Settings]
|
47 |
* @return [array] [update settings meta]
|
48 |
* @since 1.0.19
|
|
|
49 |
*/
|
50 |
public function import() {
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
$lg_imp_tmp_name = $_FILES['file']['tmp_name'];
|
53 |
$lg_file_content = file_get_contents( $lg_imp_tmp_name );
|
54 |
$loginpress_json = json_decode( $lg_file_content, true );
|
@@ -65,7 +73,7 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
65 |
foreach ( $array as $key => $value ) {
|
66 |
|
67 |
// Array of loginpress customizer images.
|
68 |
-
$imagesCheck = array( 'setting_logo', 'setting_background', 'setting_form_background', 'forget_form_background' );
|
69 |
|
70 |
/**
|
71 |
* [if json fetched data has array of $imagesCheck]
|
@@ -75,8 +83,8 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
75 |
|
76 |
global $wpdb;
|
77 |
// Count the $value of that $key from {$wpdb->posts}.
|
78 |
-
$query = "SELECT COUNT(*) FROM {$wpdb->posts} WHERE guid='$value'";
|
79 |
-
$count = $wpdb->get_var($
|
80 |
|
81 |
if ( $count < 1 && ! empty( $value ) ) {
|
82 |
$file = array();
|
@@ -126,6 +134,12 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
126 |
update_option( $object, $array );
|
127 |
}
|
128 |
} // loginpress_setting check.
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
} // endforeach.
|
130 |
} else {
|
131 |
echo "error";
|
@@ -137,13 +151,21 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
137 |
* [Export LoginPress Settings]
|
138 |
* @return [string] [return settings in json formate]
|
139 |
* @since 1.0.19
|
|
|
140 |
*/
|
141 |
public function export(){
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$loginpress_db = array();
|
144 |
$loginpress_setting_opt = array();
|
145 |
$loginpress_customization = get_option( 'loginpress_customization' );
|
146 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
|
|
147 |
$loginpress_setting_fetch = array( 'session_expiration', 'login_with_email' );
|
148 |
|
149 |
if ( $loginpress_customization ) {
|
@@ -159,6 +181,12 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
159 |
}
|
160 |
$loginpress_db['loginpress_setting'] = $loginpress_setting_opt;
|
161 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
$loginpress_db = json_encode( $loginpress_db );
|
163 |
|
164 |
echo $loginpress_db;
|
@@ -184,10 +212,16 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
184 |
* [deactivate get response from user on deactivating plugin]
|
185 |
* @return [string] [response]
|
186 |
* @since 1.0.15
|
187 |
-
* @version 1.
|
188 |
*/
|
189 |
public function deactivate() {
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
$email = get_option( 'admin_email' );
|
192 |
$_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
|
193 |
$reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
|
@@ -238,6 +272,13 @@ if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
|
238 |
* @since 1.0.15
|
239 |
*/
|
240 |
function optout_yes() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
update_option( '_loginpress_optin', 'no' );
|
242 |
wp_die();
|
243 |
}
|
8 |
* Handling all the AJAX calls in LoginPress.
|
9 |
*
|
10 |
* @since 1.0.19
|
11 |
+
* @version 1.1.14
|
12 |
* @class LoginPress_AJAX
|
13 |
*/
|
14 |
|
47 |
* [Import LoginPress Settings]
|
48 |
* @return [array] [update settings meta]
|
49 |
* @since 1.0.19
|
50 |
+
* @version 1.1.14
|
51 |
*/
|
52 |
public function import() {
|
53 |
|
54 |
+
check_ajax_referer( 'loginpress-import-nonce', 'security' );
|
55 |
+
|
56 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
57 |
+
wp_die( 'No cheating, huh!' );
|
58 |
+
}
|
59 |
+
|
60 |
$lg_imp_tmp_name = $_FILES['file']['tmp_name'];
|
61 |
$lg_file_content = file_get_contents( $lg_imp_tmp_name );
|
62 |
$loginpress_json = json_decode( $lg_file_content, true );
|
73 |
foreach ( $array as $key => $value ) {
|
74 |
|
75 |
// Array of loginpress customizer images.
|
76 |
+
$imagesCheck = array( 'setting_logo', 'setting_background', 'setting_form_background', 'forget_form_background', 'gallery_background' );
|
77 |
|
78 |
/**
|
79 |
* [if json fetched data has array of $imagesCheck]
|
83 |
|
84 |
global $wpdb;
|
85 |
// Count the $value of that $key from {$wpdb->posts}.
|
86 |
+
// $query = "SELECT COUNT(*) FROM {$wpdb->posts} WHERE guid='$value'";
|
87 |
+
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE guid='%s'", $value ) );
|
88 |
|
89 |
if ( $count < 1 && ! empty( $value ) ) {
|
90 |
$file = array();
|
134 |
update_option( $object, $array );
|
135 |
}
|
136 |
} // loginpress_setting check.
|
137 |
+
|
138 |
+
if ( 'customize_presets_settings' == $object ) {
|
139 |
+
|
140 |
+
update_option( 'customize_presets_settings', $array );
|
141 |
+
|
142 |
+
}
|
143 |
} // endforeach.
|
144 |
} else {
|
145 |
echo "error";
|
151 |
* [Export LoginPress Settings]
|
152 |
* @return [string] [return settings in json formate]
|
153 |
* @since 1.0.19
|
154 |
+
* @version 1.1.14
|
155 |
*/
|
156 |
public function export(){
|
157 |
|
158 |
+
check_ajax_referer( 'loginpress-export-nonce', 'security' );
|
159 |
+
|
160 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
161 |
+
wp_die( 'No cheating, huh!' );
|
162 |
+
}
|
163 |
+
|
164 |
$loginpress_db = array();
|
165 |
$loginpress_setting_opt = array();
|
166 |
$loginpress_customization = get_option( 'loginpress_customization' );
|
167 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
168 |
+
$loginpress_preset = get_option( 'customize_presets_settings' );
|
169 |
$loginpress_setting_fetch = array( 'session_expiration', 'login_with_email' );
|
170 |
|
171 |
if ( $loginpress_customization ) {
|
181 |
}
|
182 |
$loginpress_db['loginpress_setting'] = $loginpress_setting_opt;
|
183 |
}
|
184 |
+
|
185 |
+
if ( $loginpress_preset ) {
|
186 |
+
|
187 |
+
$loginpress_db['customize_presets_settings'] = $loginpress_preset;
|
188 |
+
}
|
189 |
+
|
190 |
$loginpress_db = json_encode( $loginpress_db );
|
191 |
|
192 |
echo $loginpress_db;
|
212 |
* [deactivate get response from user on deactivating plugin]
|
213 |
* @return [string] [response]
|
214 |
* @since 1.0.15
|
215 |
+
* @version 1.1.14
|
216 |
*/
|
217 |
public function deactivate() {
|
218 |
|
219 |
+
check_ajax_referer( 'loginpress-deactivate-nonce', 'security' );
|
220 |
+
|
221 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
222 |
+
wp_die( 'No cheating, huh!' );
|
223 |
+
}
|
224 |
+
|
225 |
$email = get_option( 'admin_email' );
|
226 |
$_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
|
227 |
$reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
|
272 |
* @since 1.0.15
|
273 |
*/
|
274 |
function optout_yes() {
|
275 |
+
|
276 |
+
check_ajax_referer( 'loginpress-optout-nonce', 'security' );
|
277 |
+
|
278 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
279 |
+
wp_die( 'No cheating, huh!' );
|
280 |
+
}
|
281 |
+
|
282 |
update_option( '_loginpress_optin', 'no' );
|
283 |
wp_die();
|
284 |
}
|
classes/class-loginpress-notifications.php
ADDED
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
// Exit if accessed directly.
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Handling all the Notification calls in LoginPress.
|
9 |
+
*
|
10 |
+
* @since 1.1.14
|
11 |
+
* @class LoginPress_Notification
|
12 |
+
*/
|
13 |
+
|
14 |
+
if ( ! class_exists( 'LoginPress_Notification' ) ) :
|
15 |
+
|
16 |
+
class LoginPress_Notification {
|
17 |
+
|
18 |
+
/* * * * * * * * * *
|
19 |
+
* Class constructor
|
20 |
+
* * * * * * * * * */
|
21 |
+
public function __construct() {
|
22 |
+
|
23 |
+
$this->_hooks();
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Hook into actions and filters
|
29 |
+
* @since 1.0.0
|
30 |
+
*/
|
31 |
+
private function _hooks() {
|
32 |
+
add_action( 'admin_init', array( $this, 'loginpress_review_notice' ) );
|
33 |
+
// add_action( 'admin_init' , array( $this, 'loginpress_addon_notice' ) );
|
34 |
+
add_action( 'admin_init', array( $this, 'loginpress_friday_sale_notice' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Ask users to review our plugin on wordpress.org
|
39 |
+
*
|
40 |
+
* @since 1.0.11
|
41 |
+
* @return boolean false
|
42 |
+
* @version 1.1.3
|
43 |
+
*/
|
44 |
+
public function loginpress_review_notice() {
|
45 |
+
|
46 |
+
$this->loginpress_review_dismissal();
|
47 |
+
$this->loginpress_review_pending();
|
48 |
+
|
49 |
+
$activation_time = get_site_option( 'loginpress_active_time' );
|
50 |
+
$review_dismissal = get_site_option( 'loginpress_review_dismiss' );
|
51 |
+
|
52 |
+
if ( 'yes' == $review_dismissal ) return;
|
53 |
+
|
54 |
+
if ( ! $activation_time ) :
|
55 |
+
|
56 |
+
$activation_time = time();
|
57 |
+
add_site_option( 'loginpress_active_time', $activation_time );
|
58 |
+
endif;
|
59 |
+
|
60 |
+
// 1296000 = 15 Days in seconds.
|
61 |
+
if ( time() - $activation_time > 1296000 ) :
|
62 |
+
|
63 |
+
wp_enqueue_style( 'loginpress_review_stlye', plugins_url( '../css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
64 |
+
add_action( 'admin_notices' , array( $this, 'loginpress_review_notice_message' ) );
|
65 |
+
endif;
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Check and Dismiss review message.
|
72 |
+
*
|
73 |
+
* @since 1.0.11
|
74 |
+
*/
|
75 |
+
private function loginpress_review_dismissal() {
|
76 |
+
|
77 |
+
if ( ! is_admin() ||
|
78 |
+
! current_user_can( 'manage_options' ) ||
|
79 |
+
! isset( $_GET['_wpnonce'] ) ||
|
80 |
+
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-review-nonce' ) ||
|
81 |
+
! isset( $_GET['loginpress_review_dismiss'] ) ) :
|
82 |
+
|
83 |
+
return;
|
84 |
+
endif;
|
85 |
+
|
86 |
+
add_site_option( 'loginpress_review_dismiss', 'yes' );
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Set time to current so review notice will popup after 14 days
|
91 |
+
*
|
92 |
+
* @since 1.0.11
|
93 |
+
*/
|
94 |
+
function loginpress_review_pending() {
|
95 |
+
|
96 |
+
if ( ! is_admin() ||
|
97 |
+
! current_user_can( 'manage_options' ) ||
|
98 |
+
! isset( $_GET['_wpnonce'] ) ||
|
99 |
+
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-review-nonce' ) ||
|
100 |
+
! isset( $_GET['loginpress_review_later'] ) ) :
|
101 |
+
|
102 |
+
return;
|
103 |
+
endif;
|
104 |
+
|
105 |
+
// Reset Time to current time.
|
106 |
+
update_site_option( 'loginpress_active_time', time() );
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Review notice message
|
111 |
+
*
|
112 |
+
* @since 1.0.11
|
113 |
+
*/
|
114 |
+
public function loginpress_review_notice_message() {
|
115 |
+
|
116 |
+
$scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
|
117 |
+
$url = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_dismiss=yes';
|
118 |
+
$dismiss_url = wp_nonce_url( $url, 'loginpress-review-nonce' );
|
119 |
+
|
120 |
+
$_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_later=yes';
|
121 |
+
$later_url = wp_nonce_url( $_later_link, 'loginpress-review-nonce' );
|
122 |
+
?>
|
123 |
+
|
124 |
+
<div class="loginpress-review-notice">
|
125 |
+
<div class="loginpress-review-thumbnail">
|
126 |
+
<img src="<?php echo plugins_url( '../img/thumbnail/gray-loginpress.png', __FILE__ ) ?>" alt="">
|
127 |
+
</div>
|
128 |
+
<div class="loginpress-review-text">
|
129 |
+
<h3><?php _e( 'Leave A Review?', 'loginpress' ) ?></h3>
|
130 |
+
<p><?php _e( 'We hope you\'ve enjoyed using LoginPress! Would you consider leaving us a review on WordPress.org?', 'loginpress' ) ?></p>
|
131 |
+
<ul class="loginpress-review-ul">
|
132 |
+
<li><a href="https://wordpress.org/support/view/plugin-reviews/loginpress?rate=5#postform" target="_blank"><span class="dashicons dashicons-external"></span><?php _e( 'Sure! I\'d love to!', 'loginpress' ) ?></a></li>
|
133 |
+
<li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-smiley"></span><?php _e( 'I\'ve already left a review', 'loginpress' ) ?></a></li>
|
134 |
+
<li><a href="<?php echo $later_url ?>"><span class="dashicons dashicons-calendar-alt"></span><?php _e( 'Maybe Later', 'loginpress' ) ?></a></li>
|
135 |
+
<li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-dismiss"></span><?php _e( 'Never show again', 'loginpress' ) ?></a></li></ul>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
<?php
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Review notice message
|
143 |
+
*
|
144 |
+
* @since 1.1.3
|
145 |
+
*/
|
146 |
+
public function loginpress_addon_notice_text() {
|
147 |
+
|
148 |
+
$scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
|
149 |
+
$url = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_addon_dismiss_1=yes';
|
150 |
+
$dismiss_url = wp_nonce_url( $url, 'loginpress-addon-nonce' );
|
151 |
+
wp_enqueue_style( 'loginpress_review_stlye', plugins_url( '../css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
152 |
+
?>
|
153 |
+
<div class="loginpress-alert-notice">
|
154 |
+
<a href="<?php echo $dismiss_url ?>" class="notice-dismiss" ><span class="screen-reader-text"></span></a>
|
155 |
+
<a href="https://wpbrigade.com/wordpress/plugins/loginpress/addons/?utm_source=loginpress-lite&utm_medium=addons-notice-banner&utm_campaign=pro-upgrade" class="loginpress-addon-notice-link" target="_blank">
|
156 |
+
<div class="loginpress-alert-thumbnail">
|
157 |
+
<img src="<?php echo plugins_url( '../img/notification_logo.svg', __FILE__ ) ?>" alt="">
|
158 |
+
</div>
|
159 |
+
<div class="loginpress-alert-text">
|
160 |
+
<h3><?php _e( 'Introducing LoginPress Addons!', 'loginpress' ) ?></h3>
|
161 |
+
<p><?php _e( 'Extend LoginPress with these add-ons and supercharge your login pages.', 'loginpress' ) ?></p>
|
162 |
+
</div>
|
163 |
+
</a>
|
164 |
+
<div class="loginpress-alert-button-section">
|
165 |
+
<a href="https://wpbrigade.com/wordpress/plugins/loginpress/addons/?utm_source=loginpress-lite&utm_medium=addons-notice-more&utm_campaign=pro-upgrade" class="loginpress-alert-button" target="_blank"><?php _e( 'Learn More', 'loginpress' ) ?></a>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
<?php
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Check and Dismiss addon message.
|
173 |
+
*
|
174 |
+
* @since 1.1.3
|
175 |
+
*/
|
176 |
+
private function loginpress_addon_dismissal() {
|
177 |
+
|
178 |
+
if ( ! is_admin() ||
|
179 |
+
! current_user_can( 'manage_options' ) ||
|
180 |
+
! isset( $_GET['_wpnonce'] ) ||
|
181 |
+
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-addon-nonce' ) ||
|
182 |
+
! isset( $_GET['loginpress_addon_dismiss_1'] ) ) :
|
183 |
+
|
184 |
+
return;
|
185 |
+
endif;
|
186 |
+
|
187 |
+
add_site_option( 'loginpress_addon_dismiss_1', 'yes' );
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Ask users to review our plugin on wordpress.org
|
192 |
+
*
|
193 |
+
* @since 1.1.3
|
194 |
+
* @return boolean false
|
195 |
+
*/
|
196 |
+
public function loginpress_addon_notice() {
|
197 |
+
|
198 |
+
$this->loginpress_addon_dismissal();
|
199 |
+
|
200 |
+
$activation_time = get_site_option( 'loginpress_addon_active_time' );
|
201 |
+
$addon_dismissal = get_site_option( 'loginpress_addon_dismiss_1' );
|
202 |
+
|
203 |
+
if ( 'yes' == $addon_dismissal ) return;
|
204 |
+
|
205 |
+
if ( ! $activation_time ) :
|
206 |
+
|
207 |
+
$activation_time = time();
|
208 |
+
add_site_option( 'loginpress_addon_active_time', $activation_time );
|
209 |
+
endif;
|
210 |
+
|
211 |
+
// 432000 = 5 Days in seconds.
|
212 |
+
// if ( time() - $activation_time > 432000 ) :
|
213 |
+
|
214 |
+
add_action( 'admin_notices' , array( $this, 'loginpress_addon_notice_text' ) );
|
215 |
+
// endif;
|
216 |
+
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Ask users to review our plugin on wordpress.org
|
221 |
+
*
|
222 |
+
* @since 1.1.3
|
223 |
+
* @return boolean false
|
224 |
+
*/
|
225 |
+
public function loginpress_friday_sale_notice() {
|
226 |
+
|
227 |
+
$this->loginpress_friday_sale_dismissal();
|
228 |
+
|
229 |
+
$activation_time = get_site_option( 'loginpress_friday_sale_active_time' );
|
230 |
+
$addon_dismissal = get_site_option( 'loginpress_friday_sale_dismiss' );
|
231 |
+
|
232 |
+
if ( 'yes' == $addon_dismissal ) return;
|
233 |
+
|
234 |
+
if ( ! $activation_time ) :
|
235 |
+
|
236 |
+
$activation_time = time();
|
237 |
+
add_site_option( 'loginpress_friday_sale_active_time', $activation_time );
|
238 |
+
endif;
|
239 |
+
|
240 |
+
// 432000 = 5 Days in seconds.
|
241 |
+
// if ( time() - $activation_time > 432000 ) :
|
242 |
+
|
243 |
+
add_action( 'admin_notices' , array( $this, 'loginpress_friday_sale_notice_text' ) );
|
244 |
+
// endif;
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Review notice message
|
250 |
+
*
|
251 |
+
* @since 1.1.14
|
252 |
+
*/
|
253 |
+
public function loginpress_friday_sale_notice_text() {
|
254 |
+
|
255 |
+
$scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
|
256 |
+
$url = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_friday_sale_dismiss=yes';
|
257 |
+
$dismiss_url = wp_nonce_url( $url, 'loginpress-friday-sale-nonce' );
|
258 |
+
|
259 |
+
wp_enqueue_style( 'loginpress_review_stlye', plugins_url( '../css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
260 |
+
?>
|
261 |
+
<div class="loginpress-alert-notice black_friday_notic">
|
262 |
+
<a href="<?php echo $dismiss_url ?>" class="notice-dismiss" ><span class="screen-reader-text"></span></a>
|
263 |
+
<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner&utm_campaign=blackfriday2018" target="_blank">
|
264 |
+
<div class="loginpress-alert-thumbnail">
|
265 |
+
<img src="<?php echo plugins_url( '../img/notification_logo.svg', __FILE__ ) ?>" alt="">
|
266 |
+
</div>
|
267 |
+
<div class="loginpress-alert-text black_friday">
|
268 |
+
<img src="<?php echo plugins_url( '../img/black-friday.png', __FILE__ ) ?>" alt="">
|
269 |
+
|
270 |
+
<div class="loginpress-alert-button-section black_friday_sale_btn">
|
271 |
+
<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=freepluginbanner-button&utm_campaign=blackfriday2018" class="loginpress-alert-button" target="_blank"><?php _e( 'GET ALL 51% OFF', 'loginpress' ) ?></a>
|
272 |
+
</div>
|
273 |
+
</div>
|
274 |
+
</a>
|
275 |
+
|
276 |
+
</div>
|
277 |
+
<?php
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Check and Dismiss addon message.
|
282 |
+
*
|
283 |
+
* @since 1.1.3
|
284 |
+
*/
|
285 |
+
private function loginpress_friday_sale_dismissal() {
|
286 |
+
|
287 |
+
if ( ! is_admin() ||
|
288 |
+
! current_user_can( 'manage_options' ) ||
|
289 |
+
! isset( $_GET['_wpnonce'] ) ||
|
290 |
+
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-friday-sale-nonce' ) ||
|
291 |
+
! isset( $_GET['loginpress_friday_sale_dismiss'] ) ) :
|
292 |
+
|
293 |
+
return;
|
294 |
+
endif;
|
295 |
+
|
296 |
+
add_site_option( 'loginpress_friday_sale_dismiss', 'yes' );
|
297 |
+
}
|
298 |
+
|
299 |
+
}
|
300 |
+
|
301 |
+
endif;
|
302 |
+
new LoginPress_Notification();
|
303 |
+
?>
|
css/style-login.php
CHANGED
@@ -781,6 +781,55 @@ text-shadow: none;
|
|
781 |
display: flex;
|
782 |
justify-content: center;
|
783 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
@media screen and (max-width: 767px) {
|
785 |
.login h1 a {
|
786 |
max-width: 100%;
|
@@ -788,7 +837,24 @@ text-shadow: none;
|
|
788 |
}
|
789 |
.copyRight{
|
790 |
padding: 12px;
|
791 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
}
|
793 |
|
794 |
</style>
|
781 |
display: flex;
|
782 |
justify-content: center;
|
783 |
}
|
784 |
+
.loginpress-caps-lock{
|
785 |
+
background: rgba(51, 56, 61, 0.9);
|
786 |
+
color: #fff;
|
787 |
+
display: none;
|
788 |
+
font-size: 14px;
|
789 |
+
width: 120px;
|
790 |
+
padding: 5px 10px;
|
791 |
+
line-height: 20px;
|
792 |
+
position: absolute;
|
793 |
+
left: calc(100% + 10px);
|
794 |
+
top: 50%;
|
795 |
+
transform: translateY(-50%);
|
796 |
+
border-radius: 5px;
|
797 |
+
-webkit-transition: all 0.3s ease-in-out;
|
798 |
+
transition: all 0.3s ease-in-out;
|
799 |
+
text-align: center;
|
800 |
+
-webkit-box-shadow: 0 0 9px 0px rgba(0, 0, 0, 0.20);
|
801 |
+
box-shadow: 0 0 9px 0px rgba(0, 0, 0, 0.20);
|
802 |
+
margin-left: 5px;
|
803 |
+
font-weight: normal;
|
804 |
+
margin: 0;
|
805 |
+
display: none;
|
806 |
+
}
|
807 |
+
.loginpress-caps-lock:before{
|
808 |
+
content: '';
|
809 |
+
width: 0;
|
810 |
+
height: 0;
|
811 |
+
border-style: solid;
|
812 |
+
border-width: 5px 5px 5px 0;
|
813 |
+
border-color: transparent rgba(51, 56, 61, 0.9) transparent transparent;
|
814 |
+
position: absolute;
|
815 |
+
top: 50%;
|
816 |
+
right: 100%;
|
817 |
+
margin-left: 0;
|
818 |
+
margin-top: -5px;
|
819 |
+
-webkit-transition: all 0.3s ease-in-out;
|
820 |
+
transition: all 0.3s ease-in-out;
|
821 |
+
z-index: 1;
|
822 |
+
}
|
823 |
+
.login form{
|
824 |
+
overflow: visible;
|
825 |
+
}
|
826 |
+
#loginform .user-pass-fields input{
|
827 |
+
margin-bottom: 0;
|
828 |
+
}
|
829 |
+
#loginform .user-pass-fields {
|
830 |
+
margin-bottom: 18px;
|
831 |
+
position: relative;
|
832 |
+
}
|
833 |
@media screen and (max-width: 767px) {
|
834 |
.login h1 a {
|
835 |
max-width: 100%;
|
837 |
}
|
838 |
.copyRight{
|
839 |
padding: 12px;
|
840 |
+
}
|
841 |
+
.loginpress-caps-lock{
|
842 |
+
left: auto;
|
843 |
+
right: 0;
|
844 |
+
top: 149%;
|
845 |
+
}
|
846 |
+
.loginpress-caps-lock:before{
|
847 |
+
content: '';
|
848 |
+
width: 0;
|
849 |
+
height: 0;
|
850 |
+
border-style: solid;
|
851 |
+
border-width: 0 5px 5px 5px;
|
852 |
+
border-color: transparent transparent rgba(51, 56, 61, 0.9) transparent;
|
853 |
+
position: absolute;
|
854 |
+
top: 0px;
|
855 |
+
left: 5px;
|
856 |
+
right: auto;
|
857 |
+
}
|
858 |
}
|
859 |
|
860 |
</style>
|
css/style-review.css
CHANGED
@@ -93,6 +93,23 @@
|
|
93 |
position: relative;
|
94 |
flex: 1;
|
95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
.loginpress-addon-notice-link:focus{
|
97 |
outline: none;
|
98 |
box-shadow: none;
|
@@ -130,6 +147,16 @@
|
|
130 |
margin: 0;
|
131 |
color: #fff;
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
.loginpress-alert-button-section{
|
134 |
width: 300px;
|
135 |
text-align: center;
|
93 |
position: relative;
|
94 |
flex: 1;
|
95 |
}
|
96 |
+
.black_friday_notic .loginpress-alert-text {
|
97 |
+
padding: 16px 10px 16px 80px;
|
98 |
+
}
|
99 |
+
.black_friday{
|
100 |
+
background: #000 !important;
|
101 |
+
text-align: center;
|
102 |
+
}
|
103 |
+
.black_friday:after{
|
104 |
+
display: none;
|
105 |
+
}
|
106 |
+
.black_friday_notic .loginpress-alert-text {
|
107 |
+
display: flex;
|
108 |
+
align-items: center;
|
109 |
+
}
|
110 |
+
.black_friday_notic .loginpress-alert-button-section {
|
111 |
+
width: 450px;
|
112 |
+
}
|
113 |
.loginpress-addon-notice-link:focus{
|
114 |
outline: none;
|
115 |
box-shadow: none;
|
147 |
margin: 0;
|
148 |
color: #fff;
|
149 |
}
|
150 |
+
.black_friday_sale_btn .loginpress-alert-button {
|
151 |
+
display: inline-block;
|
152 |
+
padding: 24px 20px;
|
153 |
+
font-size: 38px;
|
154 |
+
background-color: #24afe9;
|
155 |
+
color: #000;
|
156 |
+
border-radius: 0px;
|
157 |
+
text-decoration: none;
|
158 |
+
font-weight: bold;
|
159 |
+
}
|
160 |
.loginpress-alert-button-section{
|
161 |
width: 300px;
|
162 |
text-align: center;
|
css/style.css
CHANGED
@@ -362,7 +362,6 @@ input[type=checkbox].loginpress-check-hidden:checked + .loginpress-checkbox {
|
|
362 |
input[type=checkbox].loginpress-check-hidden:checked + .loginpress-checkbox:active:after{
|
363 |
background: #fff;
|
364 |
}
|
365 |
-
|
366 |
/*---- !LoginPress-Settings-Checkbox ----*/
|
367 |
|
368 |
@media screen and (max-width: 1170px) {
|
362 |
input[type=checkbox].loginpress-check-hidden:checked + .loginpress-checkbox:active:after{
|
363 |
background: #fff;
|
364 |
}
|
|
|
365 |
/*---- !LoginPress-Settings-Checkbox ----*/
|
366 |
|
367 |
@media screen and (max-width: 1170px) {
|
css/themes/default-1.php
CHANGED
@@ -65,6 +65,10 @@ function first_presets() {
|
|
65 |
padding-left: 27px;
|
66 |
font-weight: normal;
|
67 |
}
|
|
|
|
|
|
|
|
|
68 |
.login input[type="submit"] {
|
69 |
background: #fff;
|
70 |
color: #fff;
|
@@ -255,7 +259,7 @@ function first_presets() {
|
|
255 |
}
|
256 |
.loginpress-show-love a:hover{
|
257 |
color: #4d5d95;
|
258 |
-
|
259 |
@media screen and (max-width: 767px) {
|
260 |
#login{
|
261 |
width: 300px;
|
65 |
padding-left: 27px;
|
66 |
font-weight: normal;
|
67 |
}
|
68 |
+
#jetpack_protect_answer{
|
69 |
+
padding-left: 0;
|
70 |
+
text-align : center;
|
71 |
+
}
|
72 |
.login input[type="submit"] {
|
73 |
background: #fff;
|
74 |
color: #fff;
|
259 |
}
|
260 |
.loginpress-show-love a:hover{
|
261 |
color: #4d5d95;
|
262 |
+
}
|
263 |
@media screen and (max-width: 767px) {
|
264 |
#login{
|
265 |
width: 300px;
|
img/black-friday.png
ADDED
Binary file
|
include/deactivate_modal.php
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<style>
|
2 |
.loginpress-hidden{
|
3 |
|
@@ -132,6 +140,7 @@ background: none;
|
|
132 |
</div>
|
133 |
<div class="loginpress-popup-body">
|
134 |
<h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'loginpress' ); ?></h3>
|
|
|
135 |
<ul id="loginpress-reason-list">
|
136 |
<li class="loginpress-reason loginpress-reason-pro" data-input-type="" data-input-placeholder="">
|
137 |
<label>
|
@@ -274,6 +283,8 @@ background: none;
|
|
274 |
var _reason = $('input[type="radio"][name="loginpress-selected-reason"]:checked').val();
|
275 |
var _reason_details = '';
|
276 |
|
|
|
|
|
277 |
if ( _reason == 2 ) {
|
278 |
_reason_details = $("input[type='text'][name='better_plugin']").val();
|
279 |
} else if ( _reason == 7 ) {
|
@@ -291,6 +302,7 @@ background: none;
|
|
291 |
action : 'loginpress_deactivate',
|
292 |
reason : _reason,
|
293 |
reason_detail : _reason_details,
|
|
|
294 |
},
|
295 |
beforeSend: function(){
|
296 |
$(".loginpress-spinner").show();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* LoginPress deactivation Content.
|
4 |
+
* @package LoginPress
|
5 |
+
* @version 1.1.14
|
6 |
+
*/
|
7 |
+
|
8 |
+
$loginpress_deactivate_nonce = wp_create_nonce( 'loginpress-deactivate-nonce' ); ?>
|
9 |
<style>
|
10 |
.loginpress-hidden{
|
11 |
|
140 |
</div>
|
141 |
<div class="loginpress-popup-body">
|
142 |
<h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'loginpress' ); ?></h3>
|
143 |
+
<input type="hidden" class="loginpress_deactivate_nonce" name="loginpress_deactivate_nonce" value="<?php echo $loginpress_deactivate_nonce; ?>">
|
144 |
<ul id="loginpress-reason-list">
|
145 |
<li class="loginpress-reason loginpress-reason-pro" data-input-type="" data-input-placeholder="">
|
146 |
<label>
|
283 |
var _reason = $('input[type="radio"][name="loginpress-selected-reason"]:checked').val();
|
284 |
var _reason_details = '';
|
285 |
|
286 |
+
var deactivate_nonce = $('.loginpress_deactivate_nonce').val();
|
287 |
+
|
288 |
if ( _reason == 2 ) {
|
289 |
_reason_details = $("input[type='text'][name='better_plugin']").val();
|
290 |
} else if ( _reason == 7 ) {
|
302 |
action : 'loginpress_deactivate',
|
303 |
reason : _reason,
|
304 |
reason_detail : _reason_details,
|
305 |
+
security : deactivate_nonce
|
306 |
},
|
307 |
beforeSend: function(){
|
308 |
$(".loginpress-spinner").show();
|
include/loginpress-import-export.php
CHANGED
@@ -3,7 +3,11 @@
|
|
3 |
* LoginPress Import Export Page Content.
|
4 |
* @package LoginPress
|
5 |
* @since 1.0.19
|
|
|
6 |
*/
|
|
|
|
|
|
|
7 |
?>
|
8 |
<div class="loginpress-import-export-page">
|
9 |
<h2><?php esc_html_e( 'Import/Export LoginPress Settings', 'loginpress' ); ?></h2>
|
@@ -17,6 +21,7 @@
|
|
17 |
<td>
|
18 |
<input type="file" name="loginPressImport" id="loginPressImport">
|
19 |
<input type="button" class="button loginpress-import" value="<?php esc_html_e( 'Import', 'loginpress' ); ?>" multiple="multiple" disabled="disabled">
|
|
|
20 |
<span class="import-sniper">
|
21 |
<img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>">
|
22 |
</span>
|
@@ -31,6 +36,7 @@
|
|
31 |
</th>
|
32 |
<td>
|
33 |
<input type="button" class="button loginpress-export" value="<?php esc_html_e( 'Export', 'loginpress' ); ?>">
|
|
|
34 |
<span class="export-sniper">
|
35 |
<img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>">
|
36 |
</span>
|
3 |
* LoginPress Import Export Page Content.
|
4 |
* @package LoginPress
|
5 |
* @since 1.0.19
|
6 |
+
* @version 1.1.14
|
7 |
*/
|
8 |
+
|
9 |
+
$loginpress_import_nonce = wp_create_nonce('loginpress-import-nonce');
|
10 |
+
$loginpress_export_nonce = wp_create_nonce('loginpress-export-nonce');
|
11 |
?>
|
12 |
<div class="loginpress-import-export-page">
|
13 |
<h2><?php esc_html_e( 'Import/Export LoginPress Settings', 'loginpress' ); ?></h2>
|
21 |
<td>
|
22 |
<input type="file" name="loginPressImport" id="loginPressImport">
|
23 |
<input type="button" class="button loginpress-import" value="<?php esc_html_e( 'Import', 'loginpress' ); ?>" multiple="multiple" disabled="disabled">
|
24 |
+
<input type="hidden" class="loginpress_import_nonce" name="loginpress_import_nonce" value="<?php echo $loginpress_import_nonce; ?>">
|
25 |
<span class="import-sniper">
|
26 |
<img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>">
|
27 |
</span>
|
36 |
</th>
|
37 |
<td>
|
38 |
<input type="button" class="button loginpress-export" value="<?php esc_html_e( 'Export', 'loginpress' ); ?>">
|
39 |
+
<input type="hidden" class="loginpress_export_nonce" name="loginpress_export_nonce" value="<?php echo $loginpress_export_nonce; ?>">
|
40 |
<span class="export-sniper">
|
41 |
<img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>">
|
42 |
</span>
|
include/loginpress-optout-form.php
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<style media="screen">
|
2 |
.loginpress-modal.active {
|
3 |
display: block;
|
@@ -95,6 +104,7 @@
|
|
95 |
</div>
|
96 |
<div class="loginpress-modal-body">
|
97 |
<div class="loginpress-modal-panel active">
|
|
|
98 |
<h2><?php _e( 'We appreciate your help in making the plugin better by letting us track some usage data.', 'loginpress' ); ?></h2>
|
99 |
<div class="notice notice-error inline opt-out-error-message" style="display: none;">
|
100 |
<p></p>
|
@@ -121,6 +131,7 @@
|
|
121 |
|
122 |
$(function() {
|
123 |
var pluginSlug = 'loginpress';
|
|
|
124 |
// Code to fire when the DOM is ready.
|
125 |
|
126 |
$(document).on('click', 'tr[data-slug="' + pluginSlug + '"] .opt-out', function(e){
|
@@ -139,7 +150,8 @@
|
|
139 |
url: ajaxurl,
|
140 |
type: 'POST',
|
141 |
data: {
|
142 |
-
action: 'loginpress_optout_yes'
|
|
|
143 |
},
|
144 |
beforeSend: function(){
|
145 |
$(".loginpress-optout-spinner").show();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* LoginPress optout Content.
|
4 |
+
* @package LoginPress
|
5 |
+
* @version 1.1.14
|
6 |
+
*/
|
7 |
+
|
8 |
+
$loginpress_optout_nonce = wp_create_nonce('loginpress-optout-nonce');
|
9 |
+
?>
|
10 |
<style media="screen">
|
11 |
.loginpress-modal.active {
|
12 |
display: block;
|
104 |
</div>
|
105 |
<div class="loginpress-modal-body">
|
106 |
<div class="loginpress-modal-panel active">
|
107 |
+
<input type="hidden" class="loginpress_optout_nonce" name="loginpress_optout_nonce" value="<?php echo $loginpress_optout_nonce; ?>">
|
108 |
<h2><?php _e( 'We appreciate your help in making the plugin better by letting us track some usage data.', 'loginpress' ); ?></h2>
|
109 |
<div class="notice notice-error inline opt-out-error-message" style="display: none;">
|
110 |
<p></p>
|
131 |
|
132 |
$(function() {
|
133 |
var pluginSlug = 'loginpress';
|
134 |
+
var optout_nonce = $('.loginpress_optout_nonce').val();
|
135 |
// Code to fire when the DOM is ready.
|
136 |
|
137 |
$(document).on('click', 'tr[data-slug="' + pluginSlug + '"] .opt-out', function(e){
|
150 |
url: ajaxurl,
|
151 |
type: 'POST',
|
152 |
data: {
|
153 |
+
action : 'loginpress_optout_yes',
|
154 |
+
security : optout_nonce,
|
155 |
},
|
156 |
beforeSend: function(){
|
157 |
$(".loginpress-optout-spinner").show();
|
js/admin-custom.js
CHANGED
@@ -25,49 +25,59 @@
|
|
25 |
// }); // on click promo checkbox.
|
26 |
|
27 |
// Remove Disabled attribute from Import Button.
|
28 |
-
$(
|
29 |
|
30 |
event.preventDefault();
|
31 |
-
var loginpressFileImp = $(
|
32 |
-
var loginpressFileExt = loginpressFileImp.substr(
|
|
|
33 |
|
34 |
-
$(
|
35 |
|
36 |
-
if (
|
37 |
$(".import_setting .wrong-import").html("");
|
38 |
-
$(
|
39 |
} else {
|
40 |
-
$(".import_setting .wrong-import").html(
|
|
|
41 |
}
|
42 |
});
|
43 |
|
44 |
-
$("#wpb-loginpress_setting\\[enable_privacy_policy\\]").on('click',
|
|
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
53 |
|
54 |
$(window).on('load', function() {
|
55 |
|
56 |
-
$(
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
var promotion = $(
|
59 |
-
|
|
|
60 |
$('tr.recapthca-promo-img').show();
|
61 |
}
|
62 |
|
63 |
-
var privacy_editor = $(
|
64 |
-
|
|
|
65 |
$('tr.privacy_policy').show();
|
66 |
}
|
67 |
|
68 |
}); // Window on load.
|
69 |
|
70 |
-
$(
|
71 |
|
72 |
event.preventDefault();
|
73 |
|
@@ -76,91 +86,100 @@
|
|
76 |
url: ajaxurl,
|
77 |
type: 'POST',
|
78 |
data: {
|
79 |
-
action
|
80 |
},
|
81 |
beforeSend: function() {
|
82 |
$(".log-file-sniper").show();
|
83 |
},
|
84 |
-
success: function(
|
85 |
|
86 |
$(".log-file-sniper").hide();
|
87 |
$(".log-file-text").show();
|
88 |
|
89 |
-
if (
|
90 |
$("<a />", {
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
97 |
} else {
|
98 |
-
var blobObject = new Blob(
|
99 |
-
window.navigator.msSaveBlob(
|
|
|
100 |
}
|
101 |
|
102 |
setTimeout(function() {
|
103 |
$(".log-file-text").fadeOut()
|
104 |
-
}, 3000
|
105 |
}
|
106 |
});
|
107 |
|
108 |
});
|
109 |
|
110 |
-
$('.loginpress-export').on('click',
|
111 |
|
112 |
event.preventDefault();
|
113 |
|
114 |
var dateObj = new Date();
|
115 |
-
var month
|
116 |
-
var day
|
117 |
-
var year
|
118 |
var newdate = year + "-" + month + "-" + day;
|
|
|
119 |
|
120 |
$.ajax({
|
121 |
|
122 |
url: ajaxurl,
|
123 |
type: 'POST',
|
124 |
data: {
|
125 |
-
action
|
|
|
126 |
},
|
127 |
beforeSend: function() {
|
128 |
$(".export_setting .export-sniper").show();
|
129 |
},
|
130 |
-
success: function(
|
131 |
|
132 |
$(".export_setting .export-sniper").hide();
|
133 |
$(".export_setting .export-text").show();
|
134 |
|
135 |
-
if (
|
136 |
$("<a />", {
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
143 |
} else {
|
144 |
-
var blobObject = new Blob(
|
145 |
-
window.navigator.msSaveBlob(
|
|
|
146 |
}
|
147 |
|
148 |
setTimeout(function() {
|
149 |
$(".export_setting .export-text").fadeOut()
|
150 |
-
}, 3000
|
151 |
}
|
152 |
});
|
153 |
});
|
154 |
|
155 |
-
$('.loginpress-import').on(
|
156 |
event.preventDefault();
|
157 |
|
158 |
-
var file
|
|
|
159 |
var fileObj = new FormData();
|
160 |
var content = file[0].files[0];
|
161 |
|
162 |
-
fileObj.append(
|
163 |
-
fileObj.append(
|
|
|
164 |
|
165 |
$.ajax({
|
166 |
|
@@ -172,21 +191,22 @@
|
|
172 |
beforeSend: function() {
|
173 |
$(".import_setting .import-sniper").show();
|
174 |
$(".import_setting .wrong-import").html("");
|
175 |
-
$(
|
176 |
},
|
177 |
success: function(response) {
|
178 |
-
|
179 |
$(".import_setting .import-sniper").hide();
|
180 |
// $(".import_setting .import-text").fadeIn();
|
181 |
-
if (
|
182 |
-
$(".import_setting .wrong-import").html(
|
|
|
183 |
} else {
|
184 |
$(".import_setting .import-text").show();
|
185 |
setTimeout(function() {
|
186 |
$(".import_setting .import-text").fadeOut();
|
187 |
// $(".import_setting .wrong-import").html("");
|
188 |
file.val('');
|
189 |
-
}, 3000
|
190 |
}
|
191 |
|
192 |
}
|
25 |
// }); // on click promo checkbox.
|
26 |
|
27 |
// Remove Disabled attribute from Import Button.
|
28 |
+
$('#loginPressImport').on('change', function(event) {
|
29 |
|
30 |
event.preventDefault();
|
31 |
+
var loginpressFileImp = $('#loginPressImport').val();
|
32 |
+
var loginpressFileExt = loginpressFileImp.substr(
|
33 |
+
loginpressFileImp.lastIndexOf('.') + 1);
|
34 |
|
35 |
+
$('.loginpress-import').attr("disabled", "disabled");
|
36 |
|
37 |
+
if ('json' == loginpressFileExt) {
|
38 |
$(".import_setting .wrong-import").html("");
|
39 |
+
$('.loginpress-import').removeAttr("disabled");
|
40 |
} else {
|
41 |
+
$(".import_setting .wrong-import").html(
|
42 |
+
"Choose LoginPress settings file only.");
|
43 |
}
|
44 |
});
|
45 |
|
46 |
+
$("#wpb-loginpress_setting\\[enable_privacy_policy\\]").on('click',
|
47 |
+
function() {
|
48 |
|
49 |
+
var privacy_editor = $(
|
50 |
+
'#wpb-loginpress_setting\\[enable_privacy_policy\\]');
|
51 |
+
if (privacy_editor.is(":checked")) {
|
52 |
+
$('tr.privacy_policy').show();
|
53 |
+
} else {
|
54 |
+
$('tr.privacy_policy').hide();
|
55 |
+
}
|
56 |
+
}); // on click promo checkbox.
|
57 |
|
58 |
$(window).on('load', function() {
|
59 |
|
60 |
+
$(
|
61 |
+
'<tr class="recapthca-promo-img"><th class="recapthca-promo" colspan="2"><img src="' +
|
62 |
+
loginpress_script.plugin_url +
|
63 |
+
'/loginpress/img/promo/recaptcha_promo.png"><a class="recapthca-promo-link" href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=recaptcha-settings&utm_campaign=pro-upgrade" target="_blank"><span>Unlock Premium Feature</span></a></th></tr>'
|
64 |
+
).insertAfter($(".enable_repatcha_promo").closest('tr'));
|
65 |
|
66 |
+
var promotion = $(
|
67 |
+
'#wpb-loginpress_setting\\[enable_repatcha_promo\\]');
|
68 |
+
if (promotion.is(":checked")) {
|
69 |
$('tr.recapthca-promo-img').show();
|
70 |
}
|
71 |
|
72 |
+
var privacy_editor = $(
|
73 |
+
'#wpb-loginpress_setting\\[enable_privacy_policy\\]');
|
74 |
+
if (privacy_editor.is(":checked")) {
|
75 |
$('tr.privacy_policy').show();
|
76 |
}
|
77 |
|
78 |
}); // Window on load.
|
79 |
|
80 |
+
$('.loginpress-log-file').on('click', function(event) {
|
81 |
|
82 |
event.preventDefault();
|
83 |
|
86 |
url: ajaxurl,
|
87 |
type: 'POST',
|
88 |
data: {
|
89 |
+
action: 'loginpress_help',
|
90 |
},
|
91 |
beforeSend: function() {
|
92 |
$(".log-file-sniper").show();
|
93 |
},
|
94 |
+
success: function(response) {
|
95 |
|
96 |
$(".log-file-sniper").hide();
|
97 |
$(".log-file-text").show();
|
98 |
|
99 |
+
if (!window.navigator.msSaveOrOpenBlob) { // If msSaveOrOpenBlob() is supported, then so is msSaveBlob().
|
100 |
$("<a />", {
|
101 |
+
"download": "loginpress-log.txt",
|
102 |
+
"href": "data:text/plain;charset=utf-8," +
|
103 |
+
encodeURIComponent(response),
|
104 |
+
}).appendTo("body")
|
105 |
+
.click(function() {
|
106 |
+
$(this).remove()
|
107 |
+
})[0].click()
|
108 |
} else {
|
109 |
+
var blobObject = new Blob([response]);
|
110 |
+
window.navigator.msSaveBlob(blobObject,
|
111 |
+
'loginpress-log.txt');
|
112 |
}
|
113 |
|
114 |
setTimeout(function() {
|
115 |
$(".log-file-text").fadeOut()
|
116 |
+
}, 3000);
|
117 |
}
|
118 |
});
|
119 |
|
120 |
});
|
121 |
|
122 |
+
$('.loginpress-export').on('click', function(event) {
|
123 |
|
124 |
event.preventDefault();
|
125 |
|
126 |
var dateObj = new Date();
|
127 |
+
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
128 |
+
var day = dateObj.getUTCDate();
|
129 |
+
var year = dateObj.getUTCFullYear();
|
130 |
var newdate = year + "-" + month + "-" + day;
|
131 |
+
var export_nonce = $('.loginpress_export_nonce').val();
|
132 |
|
133 |
$.ajax({
|
134 |
|
135 |
url: ajaxurl,
|
136 |
type: 'POST',
|
137 |
data: {
|
138 |
+
action: 'loginpress_export',
|
139 |
+
security: export_nonce,
|
140 |
},
|
141 |
beforeSend: function() {
|
142 |
$(".export_setting .export-sniper").show();
|
143 |
},
|
144 |
+
success: function(response) {
|
145 |
|
146 |
$(".export_setting .export-sniper").hide();
|
147 |
$(".export_setting .export-text").show();
|
148 |
|
149 |
+
if (!window.navigator.msSaveOrOpenBlob) { // If msSaveOrOpenBlob() is supported, then so is msSaveBlob().
|
150 |
$("<a />", {
|
151 |
+
"download": "loginpress-export-" + newdate +
|
152 |
+
".json",
|
153 |
+
"href": "data:application/json;charset=utf-8," +
|
154 |
+
encodeURIComponent(response),
|
155 |
+
}).appendTo("body")
|
156 |
+
.click(function() {
|
157 |
+
$(this).remove()
|
158 |
+
})[0].click()
|
159 |
} else {
|
160 |
+
var blobObject = new Blob([response]);
|
161 |
+
window.navigator.msSaveBlob(blobObject,
|
162 |
+
"loginpress-export-" + newdate + ".json");
|
163 |
}
|
164 |
|
165 |
setTimeout(function() {
|
166 |
$(".export_setting .export-text").fadeOut()
|
167 |
+
}, 3000);
|
168 |
}
|
169 |
});
|
170 |
});
|
171 |
|
172 |
+
$('.loginpress-import').on('click', function(event) {
|
173 |
event.preventDefault();
|
174 |
|
175 |
+
var file = $('#loginPressImport');
|
176 |
+
var import_nonce = $('.loginpress_import_nonce').val();
|
177 |
var fileObj = new FormData();
|
178 |
var content = file[0].files[0];
|
179 |
|
180 |
+
fileObj.append('file', content);
|
181 |
+
fileObj.append('action', 'loginpress_import');
|
182 |
+
fileObj.append('security', import_nonce);
|
183 |
|
184 |
$.ajax({
|
185 |
|
191 |
beforeSend: function() {
|
192 |
$(".import_setting .import-sniper").show();
|
193 |
$(".import_setting .wrong-import").html("");
|
194 |
+
$('.loginpress-import').attr("disabled", "disabled");
|
195 |
},
|
196 |
success: function(response) {
|
197 |
+
// console.log(response);
|
198 |
$(".import_setting .import-sniper").hide();
|
199 |
// $(".import_setting .import-text").fadeIn();
|
200 |
+
if ('error' == response) {
|
201 |
+
$(".import_setting .wrong-import").html(
|
202 |
+
"JSON File is not Valid.");
|
203 |
} else {
|
204 |
$(".import_setting .import-text").show();
|
205 |
setTimeout(function() {
|
206 |
$(".import_setting .import-text").fadeOut();
|
207 |
// $(".import_setting .wrong-import").html("");
|
208 |
file.val('');
|
209 |
+
}, 3000);
|
210 |
}
|
211 |
|
212 |
}
|
js/loginpress.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
$(function() {
|
5 |
+
$('#user_pass').each(function() {
|
6 |
+
$(this).wrap('<div class="user-pass-fields"></div>');
|
7 |
+
});
|
8 |
+
$('.user-pass-fields').each(function() {
|
9 |
+
$(this).append('<div class="loginpress-caps-lock">' +
|
10 |
+
loginpress_script.caps_lock + '</div>');
|
11 |
+
});
|
12 |
+
});
|
13 |
+
})(jQuery);
|
14 |
+
(function() {
|
15 |
+
window.onload = function(e) {
|
16 |
+
var capsLock = 'off';
|
17 |
+
var passwordField = document.getElementById("user_pass");
|
18 |
+
passwordField.onkeydown = function(e) {
|
19 |
+
var el = this;
|
20 |
+
if (e.getModifierState("CapsLock")) {
|
21 |
+
capsLock = 'on';
|
22 |
+
el.nextElementSibling.style.display = "block";
|
23 |
+
} else {
|
24 |
+
capsLock = 'off';
|
25 |
+
el.nextElementSibling.style.display = "none";
|
26 |
+
}
|
27 |
+
};
|
28 |
+
passwordField.onblur = function(e) {
|
29 |
+
var el = this;
|
30 |
+
el.nextElementSibling.style.display = "none";
|
31 |
+
};
|
32 |
+
passwordField.onfocus = function(e) {
|
33 |
+
var el = this;
|
34 |
+
if (capsLock == 'on') {
|
35 |
+
el.nextElementSibling.style.display = "block";
|
36 |
+
}
|
37 |
+
};
|
38 |
+
};
|
39 |
+
}());
|
loginpress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: https://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.
|
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.1.
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
@@ -83,6 +83,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
83 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-ajax.php' );
|
84 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-filter-plugin.php' );
|
85 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-developer-hooks.php' );
|
|
|
86 |
if ( is_multisite() ) {
|
87 |
require_once( LOGINPRESS_DIR_PATH . 'include/class-loginpress-theme-template.php' );
|
88 |
}
|
@@ -118,12 +119,11 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
118 |
add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
|
119 |
add_action( 'admin_enqueue_scripts', array( $this, '_admin_scripts' ) );
|
120 |
add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
|
121 |
-
add_action( 'admin_init', array( $this, 'loginpress_review_notice' ) );
|
122 |
-
add_action( 'admin_init' , array( $this, 'loginpress_addon_notice' ) );
|
123 |
add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
|
124 |
add_action( 'admin_init', array( $this, 'redirect_optin' ) );
|
125 |
add_filter( 'auth_cookie_expiration', array( $this, '_change_auth_cookie_expiration' ), 10, 3 );
|
126 |
//add_filter( 'plugins_api', array( $this, 'get_addon_info_' ) , 100, 3 );
|
|
|
127 |
if ( is_multisite() ) {
|
128 |
add_action( 'admin_init', array( $this, 'redirect_loginpress_edit_page' ) );
|
129 |
add_action( 'admin_init', array( $this, 'check_loginpress_page' ) );
|
@@ -161,8 +161,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
161 |
wp_redirect( admin_url('admin.php?page=loginpress-optin&redirect-page=' . $_GET['page'] ) );
|
162 |
exit;
|
163 |
} elseif ( get_option( '_loginpress_optin' ) && ( get_option( '_loginpress_optin' ) == 'yes' || get_option( '_loginpress_optin' ) == 'no' ) && isset( $_GET['page'] ) && $_GET['page'] === 'loginpress-optin' ) {
|
164 |
-
|
165 |
-
wp_redirect( admin_url( 'admin.php?page=loginpress-settings' ) );
|
166 |
exit;
|
167 |
}
|
168 |
}
|
@@ -328,6 +327,24 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
328 |
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
/**
|
332 |
* Session Expiration
|
333 |
*
|
@@ -448,186 +465,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
448 |
|
449 |
}
|
450 |
|
451 |
-
/**
|
452 |
-
* Ask users to review our plugin on wordpress.org
|
453 |
-
*
|
454 |
-
* @since 1.1.3
|
455 |
-
* @return boolean false
|
456 |
-
*/
|
457 |
-
public function loginpress_addon_notice() {
|
458 |
-
|
459 |
-
$this->loginpress_addon_dismissal();
|
460 |
-
|
461 |
-
$activation_time = get_site_option( 'loginpress_addon_active_time' );
|
462 |
-
$addon_dismissal = get_site_option( 'loginpress_addon_dismiss_1' );
|
463 |
-
|
464 |
-
if ( 'yes' == $addon_dismissal ) return;
|
465 |
-
|
466 |
-
if ( ! $activation_time ) :
|
467 |
-
|
468 |
-
$activation_time = time();
|
469 |
-
add_site_option( 'loginpress_addon_active_time', $activation_time );
|
470 |
-
endif;
|
471 |
-
|
472 |
-
// 432000 = 5 Days in seconds.
|
473 |
-
// if ( time() - $activation_time > 432000 ) :
|
474 |
-
|
475 |
-
add_action( 'admin_notices' , array( $this, 'loginpress_addon_notice_text' ) );
|
476 |
-
// endif;
|
477 |
-
|
478 |
-
}
|
479 |
-
|
480 |
-
/**
|
481 |
-
* Ask users to review our plugin on wordpress.org
|
482 |
-
*
|
483 |
-
* @since 1.0.11
|
484 |
-
* @return boolean false
|
485 |
-
* @version 1.1.3
|
486 |
-
*/
|
487 |
-
public function loginpress_review_notice() {
|
488 |
-
|
489 |
-
$this->loginpress_review_dismissal();
|
490 |
-
$this->loginpress_review_pending();
|
491 |
-
|
492 |
-
$activation_time = get_site_option( 'loginpress_active_time' );
|
493 |
-
$review_dismissal = get_site_option( 'loginpress_review_dismiss' );
|
494 |
-
|
495 |
-
if ( 'yes' == $review_dismissal ) return;
|
496 |
-
|
497 |
-
if ( ! $activation_time ) :
|
498 |
-
|
499 |
-
$activation_time = time();
|
500 |
-
add_site_option( 'loginpress_active_time', $activation_time );
|
501 |
-
endif;
|
502 |
-
|
503 |
-
// 1296000 = 15 Days in seconds.
|
504 |
-
if ( time() - $activation_time > 1296000 ) :
|
505 |
-
|
506 |
-
wp_enqueue_style( 'loginpress_review_stlye', plugins_url( 'css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
507 |
-
add_action( 'admin_notices' , array( $this, 'loginpress_review_notice_message' ) );
|
508 |
-
endif;
|
509 |
-
|
510 |
-
}
|
511 |
|
512 |
-
/**
|
513 |
-
* Check and Dismiss review message.
|
514 |
-
*
|
515 |
-
* @since 1.0.11
|
516 |
-
*/
|
517 |
-
private function loginpress_review_dismissal() {
|
518 |
-
|
519 |
-
if ( ! is_admin() ||
|
520 |
-
! current_user_can( 'manage_options' ) ||
|
521 |
-
! isset( $_GET['_wpnonce'] ) ||
|
522 |
-
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-review-nonce' ) ||
|
523 |
-
! isset( $_GET['loginpress_review_dismiss'] ) ) :
|
524 |
-
|
525 |
-
return;
|
526 |
-
endif;
|
527 |
-
|
528 |
-
add_site_option( 'loginpress_review_dismiss', 'yes' );
|
529 |
-
}
|
530 |
-
|
531 |
-
/**
|
532 |
-
* Set time to current so review notice will popup after 14 days
|
533 |
-
*
|
534 |
-
* @since 1.0.11
|
535 |
-
*/
|
536 |
-
function loginpress_review_pending() {
|
537 |
-
|
538 |
-
if ( ! is_admin() ||
|
539 |
-
! current_user_can( 'manage_options' ) ||
|
540 |
-
! isset( $_GET['_wpnonce'] ) ||
|
541 |
-
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-review-nonce' ) ||
|
542 |
-
! isset( $_GET['loginpress_review_later'] ) ) :
|
543 |
-
|
544 |
-
return;
|
545 |
-
endif;
|
546 |
-
|
547 |
-
// Reset Time to current time.
|
548 |
-
update_site_option( 'loginpress_active_time', time() );
|
549 |
-
}
|
550 |
-
|
551 |
-
/**
|
552 |
-
* Review notice message
|
553 |
-
*
|
554 |
-
* @since 1.0.11
|
555 |
-
*/
|
556 |
-
public function loginpress_review_notice_message() {
|
557 |
-
|
558 |
-
$scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
|
559 |
-
$url = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_dismiss=yes';
|
560 |
-
$dismiss_url = wp_nonce_url( $url, 'loginpress-review-nonce' );
|
561 |
-
|
562 |
-
$_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_review_later=yes';
|
563 |
-
$later_url = wp_nonce_url( $_later_link, 'loginpress-review-nonce' );
|
564 |
-
?>
|
565 |
-
|
566 |
-
<div class="loginpress-review-notice">
|
567 |
-
<div class="loginpress-review-thumbnail">
|
568 |
-
<img src="<?php echo plugins_url( 'img/thumbnail/gray-loginpress.png', __FILE__ ) ?>" alt="">
|
569 |
-
</div>
|
570 |
-
<div class="loginpress-review-text">
|
571 |
-
<h3><?php _e( 'Leave A Review?', 'loginpress' ) ?></h3>
|
572 |
-
<p><?php _e( 'We hope you\'ve enjoyed using LoginPress! Would you consider leaving us a review on WordPress.org?', 'loginpress' ) ?></p>
|
573 |
-
<ul class="loginpress-review-ul">
|
574 |
-
<li><a href="https://wordpress.org/support/view/plugin-reviews/loginpress?rate=5#postform" target="_blank"><span class="dashicons dashicons-external"></span><?php _e( 'Sure! I\'d love to!', 'loginpress' ) ?></a></li>
|
575 |
-
<li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-smiley"></span><?php _e( 'I\'ve already left a review', 'loginpress' ) ?></a></li>
|
576 |
-
<li><a href="<?php echo $later_url ?>"><span class="dashicons dashicons-calendar-alt"></span><?php _e( 'Maybe Later', 'loginpress' ) ?></a></li>
|
577 |
-
<li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-dismiss"></span><?php _e( 'Never show again', 'loginpress' ) ?></a></li></ul>
|
578 |
-
</div>
|
579 |
-
</div>
|
580 |
-
<?php
|
581 |
-
}
|
582 |
-
|
583 |
-
/**
|
584 |
-
* Review notice message
|
585 |
-
*
|
586 |
-
* @since 1.1.3
|
587 |
-
*/
|
588 |
-
public function loginpress_addon_notice_text() {
|
589 |
-
|
590 |
-
$scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
|
591 |
-
$url = $_SERVER['REQUEST_URI'] . $scheme . 'loginpress_addon_dismiss_1=yes';
|
592 |
-
$dismiss_url = wp_nonce_url( $url, 'loginpress-addon-nonce' );
|
593 |
-
wp_enqueue_style( 'loginpress_review_stlye', plugins_url( 'css/style-review.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
594 |
-
?>
|
595 |
-
<div class="loginpress-alert-notice">
|
596 |
-
<a href="<?php echo $dismiss_url ?>" class="notice-dismiss" ><span class="screen-reader-text"></span></a>
|
597 |
-
<a href="https://wpbrigade.com/wordpress/plugins/loginpress/addons/?utm_source=loginpress-lite&utm_medium=addons-notice-banner&utm_campaign=pro-upgrade" class="loginpress-addon-notice-link" target="_blank">
|
598 |
-
<div class="loginpress-alert-thumbnail">
|
599 |
-
<img src="<?php echo plugins_url( 'img/notification_logo.svg', __FILE__ ) ?>" alt="">
|
600 |
-
</div>
|
601 |
-
<div class="loginpress-alert-text">
|
602 |
-
<h3><?php _e( 'Introducing LoginPress Addons!', 'loginpress' ) ?></h3>
|
603 |
-
<p><?php _e( 'Extend LoginPress with these add-ons and supercharge your login pages.', 'loginpress' ) ?></p>
|
604 |
-
</div>
|
605 |
-
</a>
|
606 |
-
<div class="loginpress-alert-button-section">
|
607 |
-
<a href="https://wpbrigade.com/wordpress/plugins/loginpress/addons/?utm_source=loginpress-lite&utm_medium=addons-notice-more&utm_campaign=pro-upgrade" class="loginpress-alert-button" target="_blank"><?php _e( 'Learn More', 'loginpress' ) ?></a>
|
608 |
-
</div>
|
609 |
-
</div>
|
610 |
-
<?php
|
611 |
-
}
|
612 |
-
|
613 |
-
/**
|
614 |
-
* Check and Dismiss addon message.
|
615 |
-
*
|
616 |
-
* @since 1.1.3
|
617 |
-
*/
|
618 |
-
private function loginpress_addon_dismissal() {
|
619 |
-
|
620 |
-
if ( ! is_admin() ||
|
621 |
-
! current_user_can( 'manage_options' ) ||
|
622 |
-
! isset( $_GET['_wpnonce'] ) ||
|
623 |
-
! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'loginpress-addon-nonce' ) ||
|
624 |
-
! isset( $_GET['loginpress_addon_dismiss_1'] ) ) :
|
625 |
-
|
626 |
-
return;
|
627 |
-
endif;
|
628 |
-
|
629 |
-
add_site_option( 'loginpress_addon_dismiss_1', 'yes' );
|
630 |
-
}
|
631 |
|
632 |
/**
|
633 |
* Pull the LoginPress page from options.
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: https://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.14
|
7 |
* Author: WPBrigade
|
8 |
* Author URI: https://WPBrigade.com/
|
9 |
* Text Domain: loginpress
|
22 |
/**
|
23 |
* @var string
|
24 |
*/
|
25 |
+
public $version = '1.1.14';
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
83 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-ajax.php' );
|
84 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-filter-plugin.php' );
|
85 |
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-developer-hooks.php' );
|
86 |
+
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-notifications.php' );
|
87 |
if ( is_multisite() ) {
|
88 |
require_once( LOGINPRESS_DIR_PATH . 'include/class-loginpress-theme-template.php' );
|
89 |
}
|
119 |
add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
|
120 |
add_action( 'admin_enqueue_scripts', array( $this, '_admin_scripts' ) );
|
121 |
add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
|
|
|
|
|
122 |
add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
|
123 |
add_action( 'admin_init', array( $this, 'redirect_optin' ) );
|
124 |
add_filter( 'auth_cookie_expiration', array( $this, '_change_auth_cookie_expiration' ), 10, 3 );
|
125 |
//add_filter( 'plugins_api', array( $this, 'get_addon_info_' ) , 100, 3 );
|
126 |
+
add_action( 'login_enqueue_scripts', array( $this, 'load_loginpress_assets' ) );
|
127 |
if ( is_multisite() ) {
|
128 |
add_action( 'admin_init', array( $this, 'redirect_loginpress_edit_page' ) );
|
129 |
add_action( 'admin_init', array( $this, 'check_loginpress_page' ) );
|
161 |
wp_redirect( admin_url('admin.php?page=loginpress-optin&redirect-page=' . $_GET['page'] ) );
|
162 |
exit;
|
163 |
} elseif ( get_option( '_loginpress_optin' ) && ( get_option( '_loginpress_optin' ) == 'yes' || get_option( '_loginpress_optin' ) == 'no' ) && isset( $_GET['page'] ) && $_GET['page'] === 'loginpress-optin' ) {
|
164 |
+
wp_redirect( admin_url( 'admin.php?page=loginpress-settings' ) );
|
|
|
165 |
exit;
|
166 |
}
|
167 |
}
|
327 |
|
328 |
}
|
329 |
|
330 |
+
/**
|
331 |
+
* Load assets on login screen.
|
332 |
+
*
|
333 |
+
* @since 1.0.0
|
334 |
+
* @version 1.1.14
|
335 |
+
*/
|
336 |
+
function load_loginpress_assets() {
|
337 |
+
|
338 |
+
wp_enqueue_script( 'loginpress-script', plugins_url( 'js/loginpress.js', __FILE__ ), false, LOGINPRESS_VERSION );
|
339 |
+
|
340 |
+
// Array for localize.
|
341 |
+
$loginpress_localize = array(
|
342 |
+
'caps_lock' => __( 'Caps Lock is on', 'loginpress' ),
|
343 |
+
);
|
344 |
+
|
345 |
+
wp_localize_script( 'loginpress-script', 'loginpress_script', $loginpress_localize );
|
346 |
+
}
|
347 |
+
|
348 |
/**
|
349 |
* Session Expiration
|
350 |
*
|
465 |
|
466 |
}
|
467 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
|
470 |
/**
|
471 |
* Pull the LoginPress page from options.
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ 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 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -205,6 +205,12 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
|
|
205 |
|
206 |
== Changelog ==
|
207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
= 1.1.13 - 2018-11-05 =
|
209 |
* Update: log file (active theme info).
|
210 |
* Compatibility: LoginPress is compatible with Russian language now. Special thanks to <a href="https://profiles.wordpress.org/satone667" rel="friend">satone667</a> to contribute.
|
@@ -423,5 +429,5 @@ Please visit <a target="_blank" rel="friend" href="https://WPBrigade.com/wordpre
|
|
423 |
|
424 |
== Upgrade Notice ==
|
425 |
|
426 |
-
= 1.1.
|
427 |
-
* Important Release, upgrade immediately.
|
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.14
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
205 |
|
206 |
== Changelog ==
|
207 |
|
208 |
+
= 1.1.14 - 2018-11-20 =
|
209 |
+
* New Feature: Detect CapsLock ON.
|
210 |
+
* Bugfix: Jetpack captcha input field conflict.
|
211 |
+
* Enhancement: Important Security update.
|
212 |
+
* Enhancement: Code refactoring.
|
213 |
+
|
214 |
= 1.1.13 - 2018-11-05 =
|
215 |
* Update: log file (active theme info).
|
216 |
* Compatibility: LoginPress is compatible with Russian language now. Special thanks to <a href="https://profiles.wordpress.org/satone667" rel="friend">satone667</a> to contribute.
|
429 |
|
430 |
== Upgrade Notice ==
|
431 |
|
432 |
+
= 1.1.14 =
|
433 |
+
* Important Security Release, upgrade immediately.
|
uninstall.php
CHANGED
@@ -30,6 +30,8 @@ $loginpress_uninstall_options = array(
|
|
30 |
'loginpress_review_dismiss',
|
31 |
'loginpress_active_time',
|
32 |
'_loginpress_optin',
|
|
|
|
|
33 |
);
|
34 |
|
35 |
if ( ! is_multisite() ) {
|
30 |
'loginpress_review_dismiss',
|
31 |
'loginpress_active_time',
|
32 |
'_loginpress_optin',
|
33 |
+
'loginpress_friday_sale_active_time',
|
34 |
+
'loginpress_friday_sale_dismiss',
|
35 |
);
|
36 |
|
37 |
if ( ! is_multisite() ) {
|