Version Description
- 2017-08-22 =
- Enhancement: (New Feature) User Login with Email only.
- Enhancement: (New Feature) Introduced Help Page with System Info.
- Enhancement: (New Feature) Introduced Add-ons page, list of all possible add-ons.
- Enhancement: (New Feature) Introduced Export/Import settings page.
- Enhancement: (New Feature) Compatible with WPML.
- Enhancement: Add 'px' automatically in input field.
- Bugfix: code cleanup.
Download this release
Release Info
Developer | hiddenpearls |
Plugin | Custom Login Page Customizer | LoginPress |
Version | 1.0.19 |
Comparing to | |
See all releases |
Code changes from version 1.0.18 to 1.0.19
- classes/class-loginpress-addons.php +276 -0
- classes/class-loginpress-ajax.php +245 -0
- classes/class-loginpress-email.php +101 -0
- classes/class-loginpress-filter-plugin.php +228 -0
- classes/class-loginpress-log.php +129 -0
- classes/{loginpress-promo.php → class-loginpress-promo.php} +4 -0
- classes/{loginpress-settings-api.php → class-loginpress-settings-api.php} +41 -9
- classes/{loginpress-setup.php → class-loginpress-setup.php} +95 -12
- css/style-login.php +22 -6
- css/style.css +84 -1
- custom.php +6 -4
- img/clock.png +0 -0
- include/get-premium.php +0 -1
- include/loginpress-import-export.php +43 -0
- include/privacy-policy.php +1 -6
- include/settings.php +0 -3
- js/admin-custom.js +150 -6
- js/customize-controls.js +2 -2
- languages/{loginpress-ar_AR.mo → loginpress-ar.mo} +0 -0
- languages/{loginpress-ar_AR.po → loginpress-ar.po} +0 -0
- loginpress.php +74 -81
- readme.txt +40 -4
classes/class-loginpress-addons.php
ADDED
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This is an Add-ons page. Purpose of this page is to show a list of all the add-ons available to extend the functionality of LoginPress.
|
4 |
+
*
|
5 |
+
* @package LoginPress
|
6 |
+
* @since 1.0.19
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! class_exists( 'LoginPress_Addons' ) ) :
|
11 |
+
|
12 |
+
class LoginPress_Addons {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get the plugins list.
|
16 |
+
*
|
17 |
+
* @since 1.0.19
|
18 |
+
* @access protected
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected $plugins_list;
|
22 |
+
|
23 |
+
/* * * * * * * * * *
|
24 |
+
* Class constructor
|
25 |
+
* * * * * * * * * */
|
26 |
+
function __construct() {
|
27 |
+
|
28 |
+
$this->plugins_list = get_plugins();
|
29 |
+
// add_filter( 'plugins_api', array( $this, 'get_addon_info' ), 100, 3 );
|
30 |
+
// $this->get_addons_link();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* [get_addons_name from server]
|
35 |
+
* @return [array] [description]
|
36 |
+
*/
|
37 |
+
function get_addons_name() {
|
38 |
+
|
39 |
+
$raw_response = wp_remote_post( 'https://wpbrigade.com/loginpress-api/api.php');
|
40 |
+
|
41 |
+
if ( is_wp_error( $raw_response ) || $raw_response['response']['code'] != 200 ) {
|
42 |
+
return false;
|
43 |
+
}
|
44 |
+
|
45 |
+
$addons = unserialize( $raw_response['body'] );
|
46 |
+
|
47 |
+
// echo '<pre>'; print_r( $addons ); echo '</pre>';
|
48 |
+
// $nonces = array();
|
49 |
+
// foreach ( $addons as $addon ) {
|
50 |
+
// $nonces[ $addon['key'] ] = wp_create_nonce( "install-plugin_{$addon['key']}" );
|
51 |
+
// }
|
52 |
+
// echo '<pre>'; print_r( $nonces ); echo '</pre>';
|
53 |
+
|
54 |
+
return $addons;
|
55 |
+
}
|
56 |
+
|
57 |
+
function get_addons_link() {
|
58 |
+
|
59 |
+
$addons = $this->get_addons_name();
|
60 |
+
|
61 |
+
foreach ( $addons as $addon ) {
|
62 |
+
|
63 |
+
$action = 'install-plugin';
|
64 |
+
$slug = $addon['key'];
|
65 |
+
$link = wp_nonce_url( add_query_arg( array( 'action' => $action, 'plugin' => $slug, 'lgp' => 1 ), admin_url( 'update.php' ) ), $action . '_' . $slug );
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Check plugin status
|
72 |
+
*
|
73 |
+
* @return array
|
74 |
+
* @since 1.0.19
|
75 |
+
*/
|
76 |
+
public function check_plugin_status( $slug, $extension ) {
|
77 |
+
|
78 |
+
if ( is_plugin_active( $slug ) ) {
|
79 |
+
|
80 |
+
echo sprintf( esc_html__( '%1$s Already Installed %2$s', 'loginpress' ), '<button class="button-primary">', '</button>' );
|
81 |
+
|
82 |
+
} else if ( array_key_exists( $slug, $this->plugins_list ) ) {
|
83 |
+
|
84 |
+
$link = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $slug ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $slug ) ;
|
85 |
+
echo sprintf( esc_html__( '%1$s Activate Plugin %2$s', 'loginpress' ), '<a href="' . $link . '" class="button-primary">', '</a>' );
|
86 |
+
|
87 |
+
} else if ( is_plugin_inactive( $slug ) ) {
|
88 |
+
|
89 |
+
$action = 'install-plugin';
|
90 |
+
$_slug = $extension['key'];
|
91 |
+
$link = wp_nonce_url( add_query_arg( array( 'action' => $action, 'plugin' => $_slug, 'lgp' => 1 ), admin_url( 'update.php' ) ), $action . '_' . $_slug );
|
92 |
+
echo sprintf( esc_html__( '%1$s Install %2$s', 'loginpress' ), '<a href="' . $link . '" class="button-primary">', '</a>' ); }
|
93 |
+
}
|
94 |
+
} // Enf of Class.
|
95 |
+
endif;
|
96 |
+
|
97 |
+
|
98 |
+
$obj_loginpress_addons = new LoginPress_Addons();
|
99 |
+
// $loginpress_addons = $obj_loginpress_addons->addons();
|
100 |
+
$loginpress_addons = $obj_loginpress_addons->get_addons_name();
|
101 |
+
|
102 |
+
?>
|
103 |
+
|
104 |
+
<!-- Style for Add-ons Page -->
|
105 |
+
<style media="screen">
|
106 |
+
.loginpress-extension h3 {
|
107 |
+
box-sizing: border-box;
|
108 |
+
height: 110px;
|
109 |
+
margin: 0;
|
110 |
+
padding: 20px 10px 0 135px;
|
111 |
+
border-bottom: 1px solid #e2e5e8;
|
112 |
+
background: #f9fafa no-repeat left 5px top 5px;
|
113 |
+
background-size: 115px 100px;
|
114 |
+
}
|
115 |
+
|
116 |
+
.loginpress-extension {
|
117 |
+
float: none;
|
118 |
+
box-sizing: border-box;
|
119 |
+
width: calc(50% - 12px);
|
120 |
+
margin: 10px 20px 10px 0;
|
121 |
+
border: 1px solid #e2e5e8;
|
122 |
+
display: inline-block;
|
123 |
+
height: auto;
|
124 |
+
vertical-align: top;
|
125 |
+
background: #fff;
|
126 |
+
min-height: 260px;
|
127 |
+
position: relative;
|
128 |
+
}
|
129 |
+
|
130 |
+
.loginpress-extension .button-primary{
|
131 |
+
border:0;
|
132 |
+
text-shadow:none;
|
133 |
+
background:#32373c;
|
134 |
+
padding:8px 18px;
|
135 |
+
height:auto;
|
136 |
+
font-size:15px;
|
137 |
+
cursor: pointer;
|
138 |
+
position:absolute;
|
139 |
+
right:-1px;
|
140 |
+
bottom:-1px;
|
141 |
+
box-shadow:none;
|
142 |
+
border-radius:0;
|
143 |
+
}
|
144 |
+
.loginpress-extension .button-primary:visited, .loginpress-extension .button-primary:active,.loginpress-extension .button-primary:hover,.loginpress-extension .button-primary:focus{
|
145 |
+
background: #595959;
|
146 |
+
box-shadow: none;
|
147 |
+
outline: none;
|
148 |
+
}
|
149 |
+
.loginpress-extension button.button-primary{
|
150 |
+
background: #f9fafa;
|
151 |
+
border-radius: 0;
|
152 |
+
box-shadow: none;
|
153 |
+
color: #444;
|
154 |
+
position: absolute;
|
155 |
+
right: 0px;
|
156 |
+
bottom: 0px;
|
157 |
+
border: 0;
|
158 |
+
border-left: 1px solid #e2e5e8;
|
159 |
+
border-top: 1px solid #e2e5e8;
|
160 |
+
cursor: default;
|
161 |
+
}
|
162 |
+
.loginpress-extension button.button-primary:visited,.loginpress-extension button.button-primary:active,.loginpress-extension button.button-primary:hover,.loginpress-extension button.button-primary:focus{
|
163 |
+
background: #f9fafa;
|
164 |
+
color: #444;
|
165 |
+
border: 0;
|
166 |
+
border-left: 1px solid #e2e5e8;
|
167 |
+
border-top: 1px solid #e2e5e8;
|
168 |
+
outline: none;
|
169 |
+
box-shadow: none;
|
170 |
+
}
|
171 |
+
.logoinpress_addons_thumbnails{
|
172 |
+
|
173 |
+
max-width: 100px;
|
174 |
+
position: absolute;
|
175 |
+
top: 5px;
|
176 |
+
left: 10px;
|
177 |
+
max-height: 95px;
|
178 |
+
height: auto;
|
179 |
+
width: auto;
|
180 |
+
}
|
181 |
+
.loginpress-extension .logoinpress_addons_links{
|
182 |
+
position: relative;
|
183 |
+
}
|
184 |
+
.loginpress-extension p {
|
185 |
+
margin: 0;
|
186 |
+
padding: 10px;
|
187 |
+
}
|
188 |
+
.loginpress-addons-loading-errors {
|
189 |
+
padding-top: 15px;
|
190 |
+
}
|
191 |
+
.loginpress-addons-loading-errors img {
|
192 |
+
float: left;
|
193 |
+
padding-right: 10px;
|
194 |
+
}
|
195 |
+
.loginpress-addons-wrap{
|
196 |
+
max-width: 1050px;
|
197 |
+
}
|
198 |
+
.loginpress-extension h3 {
|
199 |
+
box-sizing: border-box;
|
200 |
+
/* height: 110px; */
|
201 |
+
margin: 0;
|
202 |
+
padding: 0 10px 0 10px;
|
203 |
+
border-bottom: 2px solid #e2e5e8;
|
204 |
+
background-size: 115px 100px;
|
205 |
+
height: 100px;
|
206 |
+
color: #000000;
|
207 |
+
}
|
208 |
+
a.logoinpress_addons_links {
|
209 |
+
display: inline-block;
|
210 |
+
width: 100%;
|
211 |
+
line-height: 90px;
|
212 |
+
padding-bottom: 5px;
|
213 |
+
height: auto;
|
214 |
+
text-decoration: none;
|
215 |
+
}
|
216 |
+
.logoinpress_addons_thumbnails {
|
217 |
+
max-width: 100px;
|
218 |
+
position: absolute;
|
219 |
+
top: 5px;
|
220 |
+
left: 10px;
|
221 |
+
max-height: 75px;
|
222 |
+
height: auto;
|
223 |
+
width: auto;
|
224 |
+
position: static;
|
225 |
+
vertical-align: middle;
|
226 |
+
margin-right: 20px;
|
227 |
+
}
|
228 |
+
.loginpress-extension{
|
229 |
+
border-width: 2px;
|
230 |
+
}
|
231 |
+
.loginpress-extension:nth-child(even){
|
232 |
+
margin-right: 0;
|
233 |
+
}
|
234 |
+
@media only screen and (max-width: 600px) {
|
235 |
+
.loginpress-extension{
|
236 |
+
width:100%;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
</style>
|
241 |
+
|
242 |
+
<div class="wrap loginpress-addons-wrap">
|
243 |
+
|
244 |
+
<h2 class='opt-title'>
|
245 |
+
<?php esc_html_e( 'Extend the functionality of LoginPress with these awesome Add-ons', 'loginpress' ); ?>
|
246 |
+
</h2>
|
247 |
+
|
248 |
+
<div class="tabwrapper">
|
249 |
+
<?php if ( is_array( $loginpress_addons ) ) :
|
250 |
+
foreach ( $loginpress_addons as $name => $extension ) : ?>
|
251 |
+
<div class="loginpress-extension">
|
252 |
+
<a target="_blank" href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=addons-coming-soon&utm_campaign=pro-upgrade" class="logoinpress_addons_links">
|
253 |
+
|
254 |
+
<h3><img src=<?php echo plugins_url( '../img/thumbnail/gray-loginpress.png', __FILE__ );?> class="logoinpress_addons_thumbnails"/><span><?php echo $extension['title']; ?></span></h3>
|
255 |
+
</a>
|
256 |
+
|
257 |
+
<p><?php echo $extension['details']; ?></p>
|
258 |
+
<p>
|
259 |
+
<?php //$obj_loginpress_addons->check_plugin_status( $extension['key'], $extension ); ?>
|
260 |
+
<a target="_blank" href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=addons-coming-soon&utm_campaign=pro-upgrade" class="button-primary">Coming Soon</a>
|
261 |
+
</p>
|
262 |
+
</div>
|
263 |
+
<?php
|
264 |
+
endforeach;
|
265 |
+
else : ?>
|
266 |
+
<div class="loginpress-addons-loading-errors">
|
267 |
+
<img src="<?php echo plugins_url( '../img/clock.png', __FILE__ );?>" alt="clock">
|
268 |
+
<h3>
|
269 |
+
<?php esc_html_e( 'Trouble in loading Add-ons. Please reload the page.', 'loginpress' ) ?>
|
270 |
+
</h3>
|
271 |
+
<p><?php echo sprintf( __( 'Findout the LoginPress %1$s', 'loginpress' ), '<a href="https://wpbrigade.com/wordpress/plugins/loginpress/" target="_blank">Add-ons</a>') ?></p>
|
272 |
+
</div>
|
273 |
+
<?php endif; ?>
|
274 |
+
</div>
|
275 |
+
|
276 |
+
</div>
|
classes/class-loginpress-ajax.php
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
// Exit if accessed directly.
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Handling all the AJAX calls in LoginPress.
|
9 |
+
*
|
10 |
+
* @since 1.0.19
|
11 |
+
* @class LoginPress_AJAX
|
12 |
+
*/
|
13 |
+
|
14 |
+
if ( ! class_exists( 'LoginPress_AJAX' ) ) :
|
15 |
+
|
16 |
+
class LoginPress_AJAX {
|
17 |
+
|
18 |
+
/* * * * * * * * * *
|
19 |
+
* Class constructor
|
20 |
+
* * * * * * * * * */
|
21 |
+
public function __construct() {
|
22 |
+
|
23 |
+
$this::init();
|
24 |
+
}
|
25 |
+
public static function init() {
|
26 |
+
|
27 |
+
$ajax_calls = array(
|
28 |
+
'export' => false,
|
29 |
+
'import' => false,
|
30 |
+
'help' => false,
|
31 |
+
'deactivate' => false,
|
32 |
+
'optout_yes' => false,
|
33 |
+
);
|
34 |
+
|
35 |
+
foreach ( $ajax_calls as $ajax_call => $no_priv ) {
|
36 |
+
// code...
|
37 |
+
add_action( 'wp_ajax_loginpress_' . $ajax_call, array( __CLASS__, $ajax_call ) );
|
38 |
+
|
39 |
+
if ( $no_priv ) {
|
40 |
+
add_action( 'wp_ajax_nopriv_loginpress_' . $ajax_call, array( __CLASS__, $ajax_call ) );
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
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 );
|
55 |
+
|
56 |
+
if ( json_last_error() == JSON_ERROR_NONE ) {
|
57 |
+
|
58 |
+
foreach ( $loginpress_json as $object => $array ) {
|
59 |
+
|
60 |
+
// Check for LoginPress customizer images.
|
61 |
+
if ( 'loginpress_customization' == $object ) {
|
62 |
+
|
63 |
+
update_option( $object, $array );
|
64 |
+
|
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]
|
72 |
+
* @var [array]
|
73 |
+
*/
|
74 |
+
if ( in_array( $key, $imagesCheck ) ) {
|
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($query);
|
80 |
+
|
81 |
+
if ( $count < 1 && ! empty( $value ) ) {
|
82 |
+
$file = array();
|
83 |
+
$file['name'] = basename( $value );
|
84 |
+
$file['tmp_name'] = download_url( $value ); // Downloads a url to a local temporary file.
|
85 |
+
|
86 |
+
if ( is_wp_error( $file['tmp_name'] ) ) {
|
87 |
+
@unlink( $file['tmp_name'] );
|
88 |
+
// return new WP_Error( 'lpimgurl', 'Could not download image from remote source' );
|
89 |
+
} else {
|
90 |
+
$id = media_handle_sideload( $file, 0 ); // Handles a sideloaded file.
|
91 |
+
$src = wp_get_attachment_url( $id ); // Returns a full URI for an attachment file.
|
92 |
+
$loginpress_options = get_option( 'loginpress_customization' ); // Get option that was updated previously.
|
93 |
+
|
94 |
+
// Change the options array properly.
|
95 |
+
$loginpress_options["$key"] = $src;
|
96 |
+
|
97 |
+
// Update entire array again for save the attachment w.r.t $key.
|
98 |
+
update_option( $object, $loginpress_options );
|
99 |
+
}
|
100 |
+
} // media_upload.
|
101 |
+
} // images chaeck.
|
102 |
+
} // inner foreach.
|
103 |
+
} // loginpress_customization check.
|
104 |
+
|
105 |
+
if ( 'loginpress_setting' == $object ) {
|
106 |
+
|
107 |
+
$loginpress_options = get_option( 'loginpress_setting' );
|
108 |
+
// Check $loginpress_options is exists.
|
109 |
+
if ( isset( $loginpress_options ) && ! empty( $loginpress_options ) ) {
|
110 |
+
|
111 |
+
foreach ( $array as $key => $value ) {
|
112 |
+
|
113 |
+
// Array of loginpress Settings that import.
|
114 |
+
$setting_array = array( 'session_expiration', 'login_with_email' );
|
115 |
+
|
116 |
+
if ( in_array( $key, $setting_array ) ) {
|
117 |
+
|
118 |
+
// Change the options array properly.
|
119 |
+
$loginpress_options["$key"] = $value;
|
120 |
+
// Update array w.r.t $key exists.
|
121 |
+
update_option( $object, $loginpress_options );
|
122 |
+
}
|
123 |
+
} // inner foreach.
|
124 |
+
} else {
|
125 |
+
|
126 |
+
update_option( $object, $array );
|
127 |
+
}
|
128 |
+
} // loginpress_setting check.
|
129 |
+
} // endforeach.
|
130 |
+
} else {
|
131 |
+
echo "error";
|
132 |
+
}
|
133 |
+
wp_die();
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
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 ) {
|
150 |
+
|
151 |
+
$loginpress_db['loginpress_customization'] = $loginpress_customization;
|
152 |
+
}
|
153 |
+
if ( $loginpress_setting ) {
|
154 |
+
|
155 |
+
foreach ( $loginpress_setting as $key => $value) {
|
156 |
+
if ( in_array( $key, $loginpress_setting_fetch ) ) {
|
157 |
+
$loginpress_setting_opt[$key] = $value;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
$loginpress_db['loginpress_setting'] = $loginpress_setting_opt;
|
161 |
+
}
|
162 |
+
$loginpress_db = json_encode( $loginpress_db );
|
163 |
+
|
164 |
+
echo $loginpress_db;
|
165 |
+
|
166 |
+
wp_die();
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* [Download file from help information tab]
|
171 |
+
* @return [string] [description]
|
172 |
+
* @since 1.0.19
|
173 |
+
*/
|
174 |
+
public function help() {
|
175 |
+
|
176 |
+
include LOGINPRESS_DIR_PATH . 'classes/class-loginpress-log.php';
|
177 |
+
|
178 |
+
echo LoginPress_Log_Info::get_sysinfo();
|
179 |
+
|
180 |
+
wp_die();
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* [deactivate get response from user on deactivating plugin]
|
185 |
+
* @return [string] [response]
|
186 |
+
*/
|
187 |
+
public function deactivate() {
|
188 |
+
|
189 |
+
$email = get_option( 'admin_email' );
|
190 |
+
$_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
|
191 |
+
$reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
|
192 |
+
$reason = '';
|
193 |
+
|
194 |
+
if ( $_reason == '1' ) {
|
195 |
+
$reason = 'I only needed the plugin for a short period';
|
196 |
+
} elseif ( $_reason == '2' ) {
|
197 |
+
$reason = 'I found a better plugin';
|
198 |
+
} elseif ( $_reason == '3' ) {
|
199 |
+
$reason = 'The plugin broke my site';
|
200 |
+
} elseif ( $_reason == '4' ) {
|
201 |
+
$reason = 'The plugin suddenly stopped working';
|
202 |
+
} elseif ( $_reason == '5' ) {
|
203 |
+
$reason = 'I no longer need the plugin';
|
204 |
+
} elseif ( $_reason == '6' ) {
|
205 |
+
$reason = 'It\'s a temporary deactivation. I\'m just debugging an issue.';
|
206 |
+
} elseif ( $_reason == '7' ) {
|
207 |
+
$reason = 'Other';
|
208 |
+
}
|
209 |
+
$fields = array(
|
210 |
+
'email' => $email,
|
211 |
+
'website' => get_site_url(),
|
212 |
+
'action' => 'Deactivate',
|
213 |
+
'reason' => $reason,
|
214 |
+
'reason_detail' => $reason_detail,
|
215 |
+
'blog_language' => get_bloginfo( 'language' ),
|
216 |
+
'wordpress_version' => get_bloginfo( 'version' ),
|
217 |
+
'plugin_version' => LOGINPRESS_VERSION,
|
218 |
+
'plugin_name' => 'LoginPress Free',
|
219 |
+
);
|
220 |
+
|
221 |
+
$response = wp_remote_post( LOGINPRESS_FEEDBACK_SERVER, array(
|
222 |
+
'method' => 'POST',
|
223 |
+
'timeout' => 5,
|
224 |
+
'httpversion' => '1.0',
|
225 |
+
'blocking' => false,
|
226 |
+
'headers' => array(),
|
227 |
+
'body' => $fields,
|
228 |
+
) );
|
229 |
+
|
230 |
+
wp_die();
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Opt-out
|
235 |
+
* @since 1.0.15
|
236 |
+
*/
|
237 |
+
function optout_yes() {
|
238 |
+
update_option( '_loginpress_optin', 'no' );
|
239 |
+
wp_die();
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
endif;
|
244 |
+
new LoginPress_AJAX();
|
245 |
+
?>
|
classes/class-loginpress-email.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* LoginPress_Email_Auth.
|
5 |
+
*
|
6 |
+
* @description Login user with email address only instead username.
|
7 |
+
* @since 1.0.18
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! class_exists( 'LoginPress_Email_Auth' ) ) :
|
11 |
+
|
12 |
+
class LoginPress_Email_Auth {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Variable that Check for LoginPress Key.
|
16 |
+
* @access public
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
public $loginpress_key;
|
20 |
+
|
21 |
+
/* * * * * * * * * *
|
22 |
+
* Class constructor
|
23 |
+
* * * * * * * * * */
|
24 |
+
public function __construct() {
|
25 |
+
|
26 |
+
$this->loginpress_key = get_option( 'loginpress_customization' );
|
27 |
+
$this->_hooks();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function _hooks(){
|
31 |
+
|
32 |
+
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
|
33 |
+
add_filter( 'authenticate', array( $this, 'loginpress_email_login' ), 20, 3 );
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* If an email address is entered in the username field, then look up the matching username and authenticate as per normal, using that.
|
38 |
+
*
|
39 |
+
* @param string $user
|
40 |
+
* @param string $username
|
41 |
+
* @param string $password
|
42 |
+
* @return Results of autheticating via wp_authenticate_username_password(), using the username found when looking up via email.
|
43 |
+
*/
|
44 |
+
function loginpress_email_login( $user, $username, $password ) {
|
45 |
+
|
46 |
+
if ( $user instanceof WP_User ) {
|
47 |
+
return $user;
|
48 |
+
}
|
49 |
+
|
50 |
+
// is username or password foeld is empty.
|
51 |
+
if ( empty($username) || empty($password) ) {
|
52 |
+
|
53 |
+
if ( is_wp_error( $user ) )
|
54 |
+
return $user;
|
55 |
+
|
56 |
+
$error = new WP_Error();
|
57 |
+
|
58 |
+
$empty_username = isset( $this->loginpress_key['empty_username'] ) && ! empty( $this->loginpress_key['empty_username'] ) ? $this->loginpress_key['empty_username'] : sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' );
|
59 |
+
|
60 |
+
$empty_password = isset( $this->loginpress_key['empty_password'] ) && ! empty( $this->loginpress_key['empty_password'] ) ? $this->loginpress_key['empty_password'] : sprintf( __( '%1$sError:%2$s The password field is empty.', 'loginpress' ), '<strong>', '</strong>' );
|
61 |
+
|
62 |
+
if ( empty( $username ) )
|
63 |
+
$error->add( 'empty_username', $empty_username );
|
64 |
+
|
65 |
+
if ( empty( $password ) )
|
66 |
+
$error->add( 'empty_password', $empty_password );
|
67 |
+
|
68 |
+
return $error;
|
69 |
+
}
|
70 |
+
|
71 |
+
// if email is not set.
|
72 |
+
if ( ! empty( $username ) && ! is_email( $username ) ) {
|
73 |
+
|
74 |
+
$error = new WP_Error();
|
75 |
+
|
76 |
+
$force_email_login= isset( $this->loginpress_key['force_email_login'] ) && ! empty( $this->loginpress_key['force_email_login'] ) ? $this->loginpress_key['force_email_login'] : sprintf( __( '%1$sError:%2$s Invalid Email Address', 'loginpress' ), '<strong>', '</strong>' );
|
77 |
+
|
78 |
+
$error->add( 'loginpress_use_email', $force_email_login );
|
79 |
+
|
80 |
+
return $error;
|
81 |
+
}
|
82 |
+
|
83 |
+
if ( ! empty( $username ) && is_email( $username ) ) {
|
84 |
+
|
85 |
+
$username = str_replace( '&', '&', stripslashes( $username ) );
|
86 |
+
$user = get_user_by( 'email', $username );
|
87 |
+
|
88 |
+
if ( isset( $user, $user->user_login, $user->user_status ) && 0 === intval( $user->user_status ) )
|
89 |
+
$username = $user->user_login;
|
90 |
+
return wp_authenticate_username_password( null, $username, $password );
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( ! empty( $username ) || ! empty( $password ) ) {
|
94 |
+
return false;
|
95 |
+
} else {
|
96 |
+
return wp_authenticate_username_password( null, "", "" );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
} // End Of Class.
|
101 |
+
endif;
|
classes/class-loginpress-filter-plugin.php
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* LoginPress Settings
|
4 |
+
*
|
5 |
+
* @since 1.0.19
|
6 |
+
*/
|
7 |
+
if ( ! class_exists( 'LoginPress_Filter_API' ) ) :
|
8 |
+
|
9 |
+
class LoginPress_Filter_API {
|
10 |
+
|
11 |
+
|
12 |
+
public function __construct() {
|
13 |
+
|
14 |
+
add_filter( 'plugins_api_result', array( $this, 'filter_api_result' ), 10, 3 );
|
15 |
+
add_filter( 'plugin_install_action_links', array( $this, 'filter_action_links' ), 10, 2 );
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Override the installation link for pro plugins
|
20 |
+
*
|
21 |
+
* @param $links Download link.
|
22 |
+
* @param $plugin Plugins Attributes
|
23 |
+
*
|
24 |
+
* @since 1.0.19
|
25 |
+
*/
|
26 |
+
public function filter_action_links( $links, $plugin ) {
|
27 |
+
|
28 |
+
if ( empty( $plugin['loginpress-result'] ) ) {
|
29 |
+
return $links;
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( ! empty( $plugin['buy-now'] ) ) {
|
33 |
+
// End if().
|
34 |
+
array_pop( $links );
|
35 |
+
$link = '<a class="%s" target="_blank" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="%s" aria-label="%s" data-name="' . esc_attr( $plugin['name'] ) . '">%s</a>';
|
36 |
+
|
37 |
+
if ( ! empty( $links[0] ) && preg_match( '/install-now/', $links[0] ) ) {
|
38 |
+
$links[0] = sprintf(
|
39 |
+
$link,
|
40 |
+
'button',
|
41 |
+
esc_url( $plugin['buy-now'] ),
|
42 |
+
esc_attr( sprintf( __( 'Buy %s now', 'loginpress' ), $plugin['name'] ) ),
|
43 |
+
esc_html__( 'Buy Now', 'loginpress' )
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
// $links[] = sprintf(
|
48 |
+
// $link,
|
49 |
+
// 'thickbox open-plugin-details-modal',
|
50 |
+
// esc_url( $plugin['buy-now'] . '#TB_iframe=true&width=600&height=550' ),
|
51 |
+
// esc_attr( sprintf( __( 'More information about %s', 'loginpress' ), $plugin['name'] ) ),
|
52 |
+
// esc_html__( 'More Details', 'loginpress' )
|
53 |
+
// );
|
54 |
+
}
|
55 |
+
|
56 |
+
return $links;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Filter Plugin search result
|
62 |
+
*
|
63 |
+
* @since 1.0.19
|
64 |
+
*/
|
65 |
+
function filter_api_result( $result, $action, $args ) {
|
66 |
+
|
67 |
+
if ( empty( $args->browse ) ) {
|
68 |
+
return $result;
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( 'featured' !== $args->browse && 'recommended' !== $args->browse ) {
|
72 |
+
return $result;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! isset( $result->info['page'] ) || 1 < $result->info['page'] ) {
|
76 |
+
return $result;
|
77 |
+
}
|
78 |
+
|
79 |
+
$result_slugs = wp_list_pluck( $result->plugins, 'slug' );
|
80 |
+
|
81 |
+
$products = $this->get_products();
|
82 |
+
|
83 |
+
$count = 0;
|
84 |
+
$products_to_inject = array();
|
85 |
+
foreach ( $products as $key => $product ) {
|
86 |
+
|
87 |
+
$products[ $key ] = $product = $this->build_product_data( $product );
|
88 |
+
|
89 |
+
// if the product is already installed, skip it
|
90 |
+
if ( $product['is_activated'] || $product['is_installed'] ) {
|
91 |
+
continue;
|
92 |
+
}
|
93 |
+
|
94 |
+
// if the product is already in the results, skip it
|
95 |
+
if ( in_array( $product['slug'], $result_slugs ) ) {
|
96 |
+
continue;
|
97 |
+
}
|
98 |
+
|
99 |
+
$products_to_inject[] = $product;
|
100 |
+
|
101 |
+
$count++;
|
102 |
+
|
103 |
+
// no of products to show
|
104 |
+
if ( 3 === $count ) {
|
105 |
+
break;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
// prepend the products that we wish to inject
|
110 |
+
for ( $i = count( $products_to_inject ) - 1; 0 <= $i; $i-- ) {
|
111 |
+
array_unshift( $result->plugins, $products_to_inject[ $i ] );
|
112 |
+
}
|
113 |
+
return $result;
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Set plugin data structure acording to code.
|
120 |
+
*
|
121 |
+
* @since 1.0.19
|
122 |
+
*/
|
123 |
+
function build_product_data( $product_data ) {
|
124 |
+
$defaults = array(
|
125 |
+
'name' => null,
|
126 |
+
'slug' => null,
|
127 |
+
'version' => null,
|
128 |
+
'author' => '<a href="https://wpbrigade.com/">WPBrigade</a>',
|
129 |
+
'author_profile' => null,
|
130 |
+
'requires' => '3.9',
|
131 |
+
'tested' => '4.8',
|
132 |
+
'rating' => 100,
|
133 |
+
'ratings' => array(),
|
134 |
+
'num_ratings' => null,
|
135 |
+
'support_threads' => null,
|
136 |
+
'support_threads_resolved' => null,
|
137 |
+
'active_installs' => null,
|
138 |
+
'downloaded' => array(),
|
139 |
+
'last_updated' => null,
|
140 |
+
'added' => null,
|
141 |
+
'homepage' => '',
|
142 |
+
'sections' => array(),
|
143 |
+
'short_description' => null,
|
144 |
+
'download_link' => '',
|
145 |
+
'screenshots' => array(),
|
146 |
+
'tags' => array(),
|
147 |
+
'versions' => array(),
|
148 |
+
'donate_link' => null,
|
149 |
+
'contributors' => array(),
|
150 |
+
'loginpress-result' => true,
|
151 |
+
'is_activated' => false,
|
152 |
+
'is_installed' => false,
|
153 |
+
'icons' => array(
|
154 |
+
'default' => null,
|
155 |
+
),
|
156 |
+
);
|
157 |
+
|
158 |
+
$product = array_merge( $defaults, $product_data );
|
159 |
+
|
160 |
+
if ( ! empty( $product['title'] ) && empty( $product['name'] ) ) {
|
161 |
+
$product['name'] = $product['title'];
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( ! empty( $product['description'] ) && empty( $product['short_description'] ) ) {
|
165 |
+
$product['short_description'] = wp_trim_words( $product['description'], 27 );
|
166 |
+
}
|
167 |
+
|
168 |
+
if ( ! empty( $product['image'] ) && empty( $product['icons']['default'] ) ) {
|
169 |
+
if ( 0 === strpos( $product['image'], 'http' ) ) {
|
170 |
+
$product['icons']['default'] = $product['image'];
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
return $product;
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Get product info
|
180 |
+
*
|
181 |
+
* @since 1.0.19
|
182 |
+
*/
|
183 |
+
function get_products() {
|
184 |
+
$products = array(
|
185 |
+
'wp-analytify' => array(
|
186 |
+
'title' => __( 'Analytify', 'loginpress' ),
|
187 |
+
'slug' => 'wp-analytify',
|
188 |
+
'link' => 'https://analytify.io/',
|
189 |
+
'image' => 'https://ps.w.org/wp-analytify/assets/icon-128x128.png?rev=1299138',
|
190 |
+
'is_activated' => class_exists( 'WP_Analytify' ),
|
191 |
+
'is_installed' => file_exists( WP_PLUGIN_DIR . '/wp-analytify/wp-analytify.php' ),
|
192 |
+
'active_installs' => '10000',
|
193 |
+
'num_ratings' => 75,
|
194 |
+
'last_updated' => '2017-07-06 7:07pm GMT',
|
195 |
+
'description' => __( 'Analytify is reshaping Google Analytics in WordPress. See Social Media, Keywords, Realtime, Country, Mobile and Browsers Statistics under pages and posts.', 'loginpress' ),
|
196 |
+
),
|
197 |
+
'related-posts-thumbnails' => array(
|
198 |
+
'title' => __( 'Related Posts', 'loginpress' ),
|
199 |
+
'slug' => 'related-posts-thumbnails',
|
200 |
+
'link' => 'https://wpbrigade.com/wordpress/plugins/related-posts/',
|
201 |
+
'image' => 'https://ps.w.org/related-posts-thumbnails/assets/icon-128x128.png?rev=1299138',
|
202 |
+
'is_activated' => class_exists( 'RelatedPostsThumbnails' ),
|
203 |
+
'is_installed' => file_exists( WP_PLUGIN_DIR . '/related-posts-thumbnails/related-posts-thumbnails.php' ),
|
204 |
+
'active_installs' => '30000',
|
205 |
+
'num_ratings' => 28,
|
206 |
+
'last_updated' => '2017-06-14 8:37pm GMT',
|
207 |
+
'description' => __( 'Related Post Thumbnails plugin is for those who want the showcase of their related posts after the post detail. The plugin allows customizing thumbnail sizes, display settings, and type of relations. The plugin is using original WordPress taxonomy. It returns generated HTML, that is essential for page load speed of blogs that use many Javascript widgets.', 'loginpress' ),
|
208 |
+
),
|
209 |
+
'loginpress-pro' => array(
|
210 |
+
'title' => __( 'LoginPress Pro', 'loginpress' ),
|
211 |
+
'slug' => 'loginpress-pro',
|
212 |
+
'link' => 'https://wpbrigade.com/wordpress/plugins/loginpress/',
|
213 |
+
'image' => 'https://ps.w.org/loginpress/assets/icon-128x128.png?rev=1299138',
|
214 |
+
'is_activated' => class_exists( 'LoginPress_Pro' ),
|
215 |
+
'is_installed' => file_exists( WP_PLUGIN_DIR . '/loginpress-pro/loginpress-pro.php' ),
|
216 |
+
'active_installs' => '1000',
|
217 |
+
'buy-now' => 'https://wpbrigade.com/wordpress/plugins/loginpress/?utm_source=loginpress-lite&utm_medium=featured-filter&utm_campaign=pro-upgrade',
|
218 |
+
'num_ratings' => 51,
|
219 |
+
'last_updated' => '2017-07-06 7:07pm GMT',
|
220 |
+
'description' => __( 'LoginPress Plugin by LoginPress holds a lot of customization fields to change the layout of the login page of WordPress. You can modify the look and feel of login page completely even the login error messages, forgot error messages, registration error messages, forget password hint message and many more.', 'loginpress' ),
|
221 |
+
),
|
222 |
+
);
|
223 |
+
|
224 |
+
return $products;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
endif;
|
228 |
+
new LoginPress_Filter_API();
|
classes/class-loginpress-log.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Log file to know more about users website environment.
|
5 |
+
* helps in debugging and providing support.
|
6 |
+
*
|
7 |
+
* @package LoginPress
|
8 |
+
* @since 1.0.19
|
9 |
+
*/
|
10 |
+
|
11 |
+
class LoginPress_Log_Info {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Returns the plugin & system information.
|
15 |
+
* @access public
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
public static function get_sysinfo() {
|
19 |
+
|
20 |
+
global $wpdb;
|
21 |
+
$loginpress_setting = get_option( 'loginpress_setting' );
|
22 |
+
$loginpress_config = get_option( 'loginpress_customization' );
|
23 |
+
$session_expiration = ( isset( $loginpress_setting['session_expiration'] ) && '0' != $loginpress_setting['session_expiration'] ) ? $loginpress_setting['session_expiration'] . ' Seconds' : 'Not Set';
|
24 |
+
$login_with_email = isset( $loginpress_setting['login_with_email'] ) ? $loginpress_setting['login_with_email'] : 'off';
|
25 |
+
$reset_settings = isset( $loginpress_config['last_reset_on'] ) ? $loginpress_config['last_reset_on'] : 'Not reset yet';
|
26 |
+
|
27 |
+
$html = '### Begin System Info ###' . "\n\n";
|
28 |
+
|
29 |
+
// Basic site info
|
30 |
+
$html .= '-- WordPress Configuration --' . "\n\n";
|
31 |
+
$html .= 'Site URL: ' . site_url() . "\n";
|
32 |
+
$html .= 'Home URL: ' . home_url() . "\n";
|
33 |
+
$html .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
|
34 |
+
$html .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
|
35 |
+
$html .= 'Language: ' . get_locale() . "\n";
|
36 |
+
$html .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . "\n";
|
37 |
+
$html .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
|
38 |
+
$html .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
|
39 |
+
|
40 |
+
// Plugin Configuration
|
41 |
+
$html .= "\n" . '-- LoginPress Configuration --' . "\n\n";
|
42 |
+
$html .= 'Plugin Version: ' . LOGINPRESS_VERSION . "\n";
|
43 |
+
$html .= 'Expiration: ' . $session_expiration . "\n";
|
44 |
+
$html .= 'Force Login with Email: ' . $login_with_email . "\n";
|
45 |
+
$html .= 'Last Reset: ' . $reset_settings . "\n";
|
46 |
+
|
47 |
+
// Pro Plugin Configuration
|
48 |
+
if ( class_exists( 'LoginPress_Pro' ) ) {
|
49 |
+
|
50 |
+
$enable_repatcha = ( isset( $loginpress_setting['enable_repatcha'] ) ) ? $loginpress_setting['enable_repatcha'] : 'Off';
|
51 |
+
$loginpress_preset = get_option( 'customize_presets_settings', 'default1' );
|
52 |
+
|
53 |
+
$html .= "\n" . '-- LoginPress Pro Configuration --' . "\n\n";
|
54 |
+
$html .= 'Plugin Version: ' . LOGINPRESS_PRO_VERSION . "\n";
|
55 |
+
$html .= 'LoginPress Template: ' . $loginpress_preset . "\n";
|
56 |
+
$html .= 'Google Repatcha Status: ' . $enable_repatcha . "\n";
|
57 |
+
|
58 |
+
if ( 'on' == $enable_repatcha ) {
|
59 |
+
$site_key = ( isset( $loginpress_setting['site_key'] ) ) ? $loginpress_setting['site_key'] : 'Not Set';
|
60 |
+
$secret_key = ( isset( $loginpress_setting['secret_key'] ) ) ? $loginpress_setting['secret_key'] : 'Not Set';
|
61 |
+
$captcha_theme = ( isset( $loginpress_setting['captcha_theme'] ) ) ? $loginpress_setting['captcha_theme'] : 'Light';
|
62 |
+
$captcha_language = ( isset( $loginpress_setting['captcha_language'] ) ) ? $loginpress_setting['captcha_language'] : 'English (US)';
|
63 |
+
$captcha_enable_on = ( isset( $loginpress_setting['captcha_enable'] ) ) ? $loginpress_setting['captcha_enable'] : 'Not Set';
|
64 |
+
|
65 |
+
$html .= 'Repatcha Site Key: ' . $site_key . "\n";
|
66 |
+
$html .= 'Repatcha Secret Key: ' . $secret_key . "\n";
|
67 |
+
$html .= 'Repatcha Theme Used: ' . $captcha_theme . "\n";
|
68 |
+
$html .= 'Repatcha Language Used: ' . $captcha_language . "\n";
|
69 |
+
if ( is_array( $captcha_enable_on ) ) {
|
70 |
+
foreach ( $captcha_enable_on as $key ) {
|
71 |
+
$html .= 'Repatcha Enable On: ' . ucfirst( str_replace( "_", " ", $key ) ) . "\n";
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
// Server Configuration
|
77 |
+
$html .= "\n" . '-- Server Configuration --' . "\n\n";
|
78 |
+
$html .= 'Operating System: ' . php_uname( 's' ) . "\n";
|
79 |
+
$html .= 'PHP Version: ' . PHP_VERSION . "\n";
|
80 |
+
$html .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
|
81 |
+
|
82 |
+
$html .= 'Server Software: ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
|
83 |
+
|
84 |
+
// PHP configs... now we're getting to the important stuff
|
85 |
+
$html .= "\n" . '-- PHP Configuration --' . "\n\n";
|
86 |
+
$html .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
|
87 |
+
$html .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
|
88 |
+
$html .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
|
89 |
+
$html .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n";
|
90 |
+
$html .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n";
|
91 |
+
$html .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
|
92 |
+
$html .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
|
93 |
+
|
94 |
+
// WordPress active plugins
|
95 |
+
$html .= "\n" . '-- WordPress Active Plugins --' . "\n\n";
|
96 |
+
$plugins = get_plugins();
|
97 |
+
$active_plugins = get_option( 'active_plugins', array() );
|
98 |
+
foreach( $plugins as $plugin_path => $plugin ) {
|
99 |
+
if( !in_array( $plugin_path, $active_plugins ) )
|
100 |
+
continue;
|
101 |
+
$html .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
102 |
+
}
|
103 |
+
|
104 |
+
// WordPress inactive plugins
|
105 |
+
$html .= "\n" . '-- WordPress Inactive Plugins --' . "\n\n";
|
106 |
+
foreach( $plugins as $plugin_path => $plugin ) {
|
107 |
+
if( in_array( $plugin_path, $active_plugins ) )
|
108 |
+
continue;
|
109 |
+
$html .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
110 |
+
}
|
111 |
+
|
112 |
+
if( is_multisite() ) {
|
113 |
+
// WordPress Multisite active plugins
|
114 |
+
$html .= "\n" . '-- Network Active Plugins --' . "\n\n";
|
115 |
+
$plugins = wp_get_active_network_plugins();
|
116 |
+
$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
|
117 |
+
foreach( $plugins as $plugin_path ) {
|
118 |
+
$plugin_base = plugin_basename( $plugin_path );
|
119 |
+
if( !array_key_exists( $plugin_base, $active_plugins ) )
|
120 |
+
continue;
|
121 |
+
$plugin = get_plugin_data( $plugin_path );
|
122 |
+
$html .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
$html .= "\n" . '### End System Info ###';
|
127 |
+
return $html;
|
128 |
+
}
|
129 |
+
} // End of Class.
|
classes/{loginpress-promo.php → class-loginpress-promo.php}
RENAMED
@@ -1,4 +1,8 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
include LOGINPRESS_ROOT_PATH .'classes/control-promo.php';
|
3 |
|
4 |
$wp_customize->add_section( 'lpcustomize_google_font', array(
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Create controller for promotion.
|
4 |
+
* @var [array]
|
5 |
+
*/
|
6 |
include LOGINPRESS_ROOT_PATH .'classes/control-promo.php';
|
7 |
|
8 |
$wp_customize->add_section( 'lpcustomize_google_font', array(
|
classes/{loginpress-settings-api.php → class-loginpress-settings-api.php}
RENAMED
@@ -225,9 +225,9 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
|
|
225 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
226 |
|
227 |
$html = '<fieldset>';
|
228 |
-
$html .= sprintf( '<label for="
|
229 |
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
|
230 |
-
$html .= sprintf( '<input type="checkbox" class="checkbox" id="
|
231 |
$html .= sprintf( '%1$s</label>', $args['desc'] );
|
232 |
$html .= '</fieldset>';
|
233 |
|
@@ -246,8 +246,8 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
|
|
246 |
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
|
247 |
foreach ( $args['options'] as $key => $label ) {
|
248 |
$checked = isset( $value[$key] ) ? $value[$key] : '0';
|
249 |
-
$html .= sprintf( '<label for="
|
250 |
-
$html .= sprintf( '<input type="checkbox" class="checkbox" id="
|
251 |
$html .= sprintf( '%1$s</label><br>', $label );
|
252 |
}
|
253 |
|
@@ -268,8 +268,8 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
|
|
268 |
$html = '<fieldset>';
|
269 |
|
270 |
foreach ( $args['options'] as $key => $label ) {
|
271 |
-
$html .= sprintf( '<label for="
|
272 |
-
$html .= sprintf( '<input type="radio" class="radio" id="
|
273 |
$html .= sprintf( '%1$s</label><br>', $label );
|
274 |
}
|
275 |
|
@@ -408,6 +408,33 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
|
|
408 |
echo $html;
|
409 |
}
|
410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
/**
|
412 |
* Sanitize callback for Settings API
|
413 |
*
|
@@ -517,12 +544,17 @@ if ( !class_exists( 'LoginPress_Settings_API' ) ):
|
|
517 |
do_settings_sections( $form['id'] );
|
518 |
do_action( 'wsa_form_bottom_' . $form['id'], $form );
|
519 |
if ( isset( $this->settings_fields[ $form['id'] ] ) ) :
|
|
|
520 |
?>
|
521 |
-
|
522 |
-
|
523 |
-
|
|
|
524 |
<?php endif; ?>
|
525 |
</form>
|
|
|
|
|
|
|
526 |
</div>
|
527 |
<?php endforeach; ?>
|
528 |
|
225 |
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
226 |
|
227 |
$html = '<fieldset>';
|
228 |
+
$html .= sprintf( '<label for="wpb-%1$s[%2$s]">', $args['section'], $args['id'] );
|
229 |
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
|
230 |
+
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpb-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
|
231 |
$html .= sprintf( '%1$s</label>', $args['desc'] );
|
232 |
$html .= '</fieldset>';
|
233 |
|
246 |
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
|
247 |
foreach ( $args['options'] as $key => $label ) {
|
248 |
$checked = isset( $value[$key] ) ? $value[$key] : '0';
|
249 |
+
$html .= sprintf( '<label for="wpb-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
250 |
+
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpb-%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ) );
|
251 |
$html .= sprintf( '%1$s</label><br>', $label );
|
252 |
}
|
253 |
|
268 |
$html = '<fieldset>';
|
269 |
|
270 |
foreach ( $args['options'] as $key => $label ) {
|
271 |
+
$html .= sprintf( '<label for="wpb-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
272 |
+
$html .= sprintf( '<input type="radio" class="radio" id="wpb-%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $value, $key, false ) );
|
273 |
$html .= sprintf( '%1$s</label><br>', $label );
|
274 |
}
|
275 |
|
408 |
echo $html;
|
409 |
}
|
410 |
|
411 |
+
/**
|
412 |
+
* Displays a search field for a autologin field
|
413 |
+
*
|
414 |
+
* @param array $args settings field args
|
415 |
+
*/
|
416 |
+
function callback_autologin( $args ) {
|
417 |
+
|
418 |
+
$html = apply_filters( 'loginpress_autologin', $args );
|
419 |
+
$html .= $this->get_field_description( $args );
|
420 |
+
|
421 |
+
echo $html;
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Displays a text field for a hidelogin field
|
426 |
+
*
|
427 |
+
* @param array $args settings field args
|
428 |
+
*/
|
429 |
+
function callback_hidelogin( $args ) {
|
430 |
+
|
431 |
+
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
432 |
+
$html = apply_filters( 'loginpress_hidelogin', $args, $value );
|
433 |
+
$html .= $this->get_field_description( $args );
|
434 |
+
|
435 |
+
echo $html;
|
436 |
+
}
|
437 |
+
|
438 |
/**
|
439 |
* Sanitize callback for Settings API
|
440 |
*
|
544 |
do_settings_sections( $form['id'] );
|
545 |
do_action( 'wsa_form_bottom_' . $form['id'], $form );
|
546 |
if ( isset( $this->settings_fields[ $form['id'] ] ) ) :
|
547 |
+
if( $form['id'] !== 'loginpress_autologin' ) : // Remove submit button from Autologin tab.
|
548 |
?>
|
549 |
+
<div style="padding-left: 10px">
|
550 |
+
<?php submit_button(); ?>
|
551 |
+
</div>
|
552 |
+
<?php endif; ?>
|
553 |
<?php endif; ?>
|
554 |
</form>
|
555 |
+
<?php if ( $form['id'] == 'loginpress_autologin' ) {
|
556 |
+
do_action( 'loginpress_autologin_script' );
|
557 |
+
} ?>
|
558 |
</div>
|
559 |
<?php endforeach; ?>
|
560 |
|
classes/{loginpress-setup.php → class-loginpress-setup.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @since 1.0.9
|
6 |
*/
|
7 |
-
if ( !class_exists( 'LoginPress_Settings' ) ):
|
8 |
|
9 |
class LoginPress_Settings {
|
10 |
|
@@ -12,7 +12,7 @@ class LoginPress_Settings {
|
|
12 |
|
13 |
function __construct() {
|
14 |
|
15 |
-
include_once( LOGINPRESS_ROOT_PATH . '/classes/loginpress-settings-api.php' );
|
16 |
$this->settings_api = new LoginPress_Settings_API;
|
17 |
|
18 |
add_action( 'admin_init', array( $this, 'loginpress_setting_init' ) );
|
@@ -62,6 +62,12 @@ class LoginPress_Settings {
|
|
62 |
|
63 |
add_submenu_page( 'loginpress-settings', __( 'Customizer', 'loginpress' ), __( 'Customizer', 'loginpress' ), 'manage_options', "loginpress", '__return_null' );
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
function get_settings_sections() {
|
@@ -71,16 +77,35 @@ class LoginPress_Settings {
|
|
71 |
'id' => 'loginpress_setting',
|
72 |
'title' => __( 'Settings', 'loginpress' ),
|
73 |
'desc' => sprintf( __( 'Everything else is customizable through %1$sWordPress Customizer%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress' ) . '">', '</a>' ),
|
74 |
-
)
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
if ( ! has_action( 'loginpress_pro_add_template' ) ) {
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
-
$sections = $loginpress_general_tab;
|
84 |
|
85 |
return $sections;
|
86 |
}
|
@@ -92,6 +117,10 @@ class LoginPress_Settings {
|
|
92 |
*/
|
93 |
function get_settings_fields() {
|
94 |
|
|
|
|
|
|
|
|
|
95 |
$_free_fields = array(
|
96 |
array(
|
97 |
'name' => 'session_expiration',
|
@@ -118,6 +147,12 @@ class LoginPress_Settings {
|
|
118 |
// 'type' => 'wysiwyg',
|
119 |
// 'default' => __( sprintf( __( '%1$sPrivacy Policy%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress-settings' ) . '">', '</a>' ) )
|
120 |
// ),
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
array(
|
122 |
'name' => 'reset_settings',
|
123 |
'label' => __( 'Reset Default Settings', 'loginpress' ),
|
@@ -137,21 +172,69 @@ class LoginPress_Settings {
|
|
137 |
|
138 |
$_settings_fields = apply_filters( 'loginpress_pro_settings', $_free_fields );
|
139 |
|
140 |
-
$settings_fields = array( 'loginpress_setting' => $_settings_fields
|
|
|
|
|
141 |
|
142 |
-
return $
|
143 |
}
|
144 |
|
145 |
function plugin_page() {
|
|
|
146 |
echo '<div class="wrap loginpress-admin-setting">';
|
|
|
|
|
|
|
147 |
|
148 |
-
include_once LOGINPRESS_DIR_PATH . '/include/settings.php';
|
149 |
$this->settings_api->show_navigation();
|
150 |
$this->settings_api->show_forms();
|
151 |
|
152 |
echo '</div>';
|
153 |
}
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
/**
|
156 |
* Get all the pages
|
157 |
*
|
4 |
*
|
5 |
* @since 1.0.9
|
6 |
*/
|
7 |
+
if ( ! class_exists( 'LoginPress_Settings' ) ):
|
8 |
|
9 |
class LoginPress_Settings {
|
10 |
|
12 |
|
13 |
function __construct() {
|
14 |
|
15 |
+
include_once( LOGINPRESS_ROOT_PATH . '/classes/class-loginpress-settings-api.php' );
|
16 |
$this->settings_api = new LoginPress_Settings_API;
|
17 |
|
18 |
add_action( 'admin_init', array( $this, 'loginpress_setting_init' ) );
|
62 |
|
63 |
add_submenu_page( 'loginpress-settings', __( 'Customizer', 'loginpress' ), __( 'Customizer', 'loginpress' ), 'manage_options', "loginpress", '__return_null' );
|
64 |
|
65 |
+
add_submenu_page( 'loginpress-settings', __( 'Help', 'loginpress' ), __( 'Help', 'loginpress' ), 'manage_options', "loginpress-help", array( $this, 'loginpress_help_page' ) );
|
66 |
+
|
67 |
+
add_submenu_page( 'loginpress-settings', __( 'Import/Export LoginPress Settings', 'loginpress' ), __( 'Import / Export', 'loginpress' ), 'manage_options', "loginpress-import-export", array( $this, 'loginpress_import_export_page' ) );
|
68 |
+
|
69 |
+
add_submenu_page( 'loginpress-settings', __( 'Add-Ons', 'loginpress' ), __( 'Add-Ons', 'loginpress' ), 'manage_options', "loginpress-addons", array( $this, 'loginpress_addons_page' ) );
|
70 |
+
|
71 |
}
|
72 |
|
73 |
function get_settings_sections() {
|
77 |
'id' => 'loginpress_setting',
|
78 |
'title' => __( 'Settings', 'loginpress' ),
|
79 |
'desc' => sprintf( __( 'Everything else is customizable through %1$sWordPress Customizer%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress' ) . '">', '</a>' ),
|
80 |
+
),
|
81 |
+
// array(
|
82 |
+
// 'id' => 'loginpress_configure',
|
83 |
+
// 'title' => __( 'Import/Export', 'loginpress' ),
|
84 |
+
// 'desc' => __( 'Let\'s Import/Export your LoginPress Settings for/from other site', 'loginpress' ),
|
85 |
+
// )
|
86 |
+
);
|
87 |
+
// if ( has_action( 'loginpress_pro_add_template' ) ) {
|
88 |
+
//
|
89 |
+
// $loginpress_license =
|
90 |
+
// array(
|
91 |
+
// 'id' => 'loginpress_license',
|
92 |
+
// 'title' => __( 'License', 'loginpress' ),
|
93 |
+
// 'desc' => __( 'License Description', 'loginpress' ),
|
94 |
+
// );
|
95 |
+
// array_push( $loginpress_general_tab , $loginpress_license );
|
96 |
+
// }
|
97 |
if ( ! has_action( 'loginpress_pro_add_template' ) ) {
|
98 |
+
|
99 |
+
$loginpress_premium =
|
100 |
+
array(
|
101 |
+
'id' => 'loginpress_premium',
|
102 |
+
'title' => __( 'Upgrade to Pro for More Features', 'loginpress' )
|
103 |
+
);
|
104 |
+
|
105 |
+
array_push( $loginpress_general_tab , $loginpress_premium );
|
106 |
}
|
107 |
|
108 |
+
$sections = apply_filters( 'loginpress_settings_tab', $loginpress_general_tab );
|
109 |
|
110 |
return $sections;
|
111 |
}
|
117 |
*/
|
118 |
function get_settings_fields() {
|
119 |
|
120 |
+
/**
|
121 |
+
* [$_free_fields array of free fields]
|
122 |
+
* @var array
|
123 |
+
*/
|
124 |
$_free_fields = array(
|
125 |
array(
|
126 |
'name' => 'session_expiration',
|
147 |
// 'type' => 'wysiwyg',
|
148 |
// 'default' => __( sprintf( __( '%1$sPrivacy Policy%2$s.', 'loginpress' ), '<a href="' . admin_url( 'admin.php?page=loginpress-settings' ) . '">', '</a>' ) )
|
149 |
// ),
|
150 |
+
array(
|
151 |
+
'name' => 'login_with_email',
|
152 |
+
'label' => __( 'Login with Email', 'loginpress' ),
|
153 |
+
'desc' => __( 'Force user to login with Email Only Instead Username.', 'loginpress' ),
|
154 |
+
'type' => 'checkbox'
|
155 |
+
),
|
156 |
array(
|
157 |
'name' => 'reset_settings',
|
158 |
'label' => __( 'Reset Default Settings', 'loginpress' ),
|
172 |
|
173 |
$_settings_fields = apply_filters( 'loginpress_pro_settings', $_free_fields );
|
174 |
|
175 |
+
$settings_fields = array( 'loginpress_setting' => $_settings_fields );
|
176 |
+
|
177 |
+
$tab = apply_filters( 'loginpress_settings_fields', $settings_fields );
|
178 |
|
179 |
+
return $tab;
|
180 |
}
|
181 |
|
182 |
function plugin_page() {
|
183 |
+
|
184 |
echo '<div class="wrap loginpress-admin-setting">';
|
185 |
+
echo '<h2 style="margin: 20px 0 20px 0;">';
|
186 |
+
esc_html_e( 'LoginPress - Rebranding your boring WordPress Login pages', 'loginpress' );
|
187 |
+
echo '</h2>';
|
188 |
|
|
|
189 |
$this->settings_api->show_navigation();
|
190 |
$this->settings_api->show_forms();
|
191 |
|
192 |
echo '</div>';
|
193 |
}
|
194 |
|
195 |
+
/**
|
196 |
+
* [loginpress_help_page callback function for sub-page Help]
|
197 |
+
* @since 1.0.19
|
198 |
+
*/
|
199 |
+
function loginpress_help_page(){
|
200 |
+
|
201 |
+
include LOGINPRESS_DIR_PATH . 'classes/class-loginpress-log.php';
|
202 |
+
|
203 |
+
$html = '<div class="loginpress-help-page">';
|
204 |
+
$html .= '<h2>Help & Troubleshooting</h2>';
|
205 |
+
$html .= sprintf( __( 'Free support is available on the %1$s plugin support forums%2$s.', 'loginpress' ), '<a href="https://wordpress.org/support/plugin/loginpress" target="_blank">', '</a>' );
|
206 |
+
$html .="<br /><br />";
|
207 |
+
$html .= sprintf( __( 'For premium features, add-ons and priority email support, %1$s upgrade to pro%2$s.', 'loginpress' ), '<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=help-page&utm_campaign=pro-upgrade" target="_blank">', '</a>' );
|
208 |
+
$html .="<br /><br />";
|
209 |
+
$html .= 'Found a bug or have a feature request? Please submit an issue <a href="https://wpbrigade.com/contact/" target="_blank">here</a>!';
|
210 |
+
$html .= '<pre><textarea rows="25" cols="75" readonly="readonly">';
|
211 |
+
$html .= LoginPress_Log_Info::get_sysinfo();
|
212 |
+
$html .= '</textarea></pre>';
|
213 |
+
$html .= '<input type="button" class="button loginpress-log-file" value="' . __( 'Download Log File', 'loginpress' ) . '"/>';
|
214 |
+
$html .= '<span class="log-file-sniper"><img src="'. admin_url( 'images/wpspin_light.gif' ) .'" /></span>';
|
215 |
+
$html .= '<span class="log-file-text">LoginPress Log File Downloaded Successfully!</span>';
|
216 |
+
$html .= '</div>';
|
217 |
+
echo $html;
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* [loginpress_import_export_page callback function for sub-page Import / Export]
|
222 |
+
* @since 1.0.19
|
223 |
+
*/
|
224 |
+
function loginpress_import_export_page(){
|
225 |
+
|
226 |
+
include LOGINPRESS_DIR_PATH . 'include/loginpress-import-export.php';
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* [loginpress_addons_page callback function for sub-page Add-ons]
|
231 |
+
* @since 1.0.19
|
232 |
+
*/
|
233 |
+
function loginpress_addons_page() {
|
234 |
+
|
235 |
+
include LOGINPRESS_DIR_PATH . 'classes/class-loginpress-addons.php';
|
236 |
+
}
|
237 |
+
|
238 |
/**
|
239 |
* Get all the pages
|
240 |
*
|
css/style-login.php
CHANGED
@@ -30,10 +30,23 @@ function loginpress_bg_option( $loginpress_key, $loginpress_array ) {
|
|
30 |
}
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
$loginpress_logo_img = loginpress_get_option_key( 'setting_logo', $loginpress_array );
|
34 |
-
$
|
35 |
-
$
|
36 |
-
$
|
|
|
|
|
|
|
37 |
$loginpress_btn_bg = loginpress_get_option_key( 'custom_button_color', $loginpress_array );
|
38 |
$loginpress_btn_border = loginpress_get_option_key( 'button_border_color', $loginpress_array );
|
39 |
$loginpress_btn_shadow = loginpress_get_option_key( 'custom_button_shadow', $loginpress_array );
|
@@ -50,7 +63,8 @@ $loginpress_form_background_clr = loginpress_get_option_key( 'form_background_co
|
|
50 |
$loginpress_forget_form_bg_img = loginpress_get_option_key( 'forget_form_background', $loginpress_array );
|
51 |
$loginpress_forget_form_bg_clr = loginpress_get_option_key( 'forget_form_background_color', $loginpress_array );
|
52 |
$loginpress_form_width = loginpress_get_option_key( 'customize_form_width', $loginpress_array );
|
53 |
-
$
|
|
|
54 |
$loginpress_form_padding = loginpress_get_option_key( 'customize_form_padding', $loginpress_array );
|
55 |
$loginpress_form_border = loginpress_get_option_key( 'customize_form_border', $loginpress_array );
|
56 |
$loginpress_form_field_width = loginpress_get_option_key( 'textfield_width', $loginpress_array );
|
@@ -64,7 +78,8 @@ $loginpress_footer_display = loginpress_get_option_key( 'footer_display_text',
|
|
64 |
$loginpress_footer_decoration = loginpress_get_option_key( 'login_footer_text_decoration', $loginpress_array );
|
65 |
$loginpress_footer_text_color = loginpress_get_option_key( 'login_footer_color', $loginpress_array );
|
66 |
$loginpress_footer_text_hover = loginpress_get_option_key( 'login_footer_color_hover', $loginpress_array );
|
67 |
-
$
|
|
|
68 |
$loginpress_footer_bg_color = loginpress_get_option_key( 'login_footer_bg_color', $loginpress_array );
|
69 |
$loginpress_footer_links_font_size = loginpress_get_option_key( 'login_footer_links_text_size', $loginpress_array );
|
70 |
$loginpress_footer_links_hover_size = loginpress_get_option_key( 'login_footer_links_hover_size', $loginpress_array );
|
@@ -76,7 +91,8 @@ $loginpress_back_display = loginpress_get_option_key( 'back_display_text', $
|
|
76 |
$loginpress_back_decoration = loginpress_get_option_key( 'login_back_text_decoration', $loginpress_array );
|
77 |
$loginpress_back_text_color = loginpress_get_option_key( 'login_back_color', $loginpress_array );
|
78 |
$loginpress_back_text_hover = loginpress_get_option_key( 'login_back_color_hover', $loginpress_array );
|
79 |
-
$
|
|
|
80 |
$loginpress_back_bg_color = loginpress_get_option_key( 'login_back_bg_color', $loginpress_array );
|
81 |
$loginpress_footer_link_color = loginpress_get_option_key( 'login_footer_text_color', $loginpress_array );
|
82 |
$loginpress_footer_link_hover = loginpress_get_option_key( 'login_footer_text_hover', $loginpress_array );
|
30 |
}
|
31 |
}
|
32 |
|
33 |
+
function loginpress_check_px( $value ) {
|
34 |
+
|
35 |
+
if ( strpos( $value, "px" ) ) {
|
36 |
+
return $value;
|
37 |
+
} else {
|
38 |
+
return $value . 'px';
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
$loginpress_logo_img = loginpress_get_option_key( 'setting_logo', $loginpress_array );
|
44 |
+
$loginpress_get_logo_width = loginpress_get_option_key( 'customize_logo_width', $loginpress_array );
|
45 |
+
$loginpress_logo_width = loginpress_check_px( $loginpress_get_logo_width );
|
46 |
+
$loginpress_get_logo_height = loginpress_get_option_key( 'customize_logo_height', $loginpress_array );
|
47 |
+
$loginpress_logo_height = loginpress_check_px( $loginpress_get_logo_height );
|
48 |
+
$loginpress_get_logo_padding = loginpress_get_option_key( 'customize_logo_padding', $loginpress_array );
|
49 |
+
$loginpress_logo_padding = loginpress_check_px( $loginpress_get_logo_padding );
|
50 |
$loginpress_btn_bg = loginpress_get_option_key( 'custom_button_color', $loginpress_array );
|
51 |
$loginpress_btn_border = loginpress_get_option_key( 'button_border_color', $loginpress_array );
|
52 |
$loginpress_btn_shadow = loginpress_get_option_key( 'custom_button_shadow', $loginpress_array );
|
63 |
$loginpress_forget_form_bg_img = loginpress_get_option_key( 'forget_form_background', $loginpress_array );
|
64 |
$loginpress_forget_form_bg_clr = loginpress_get_option_key( 'forget_form_background_color', $loginpress_array );
|
65 |
$loginpress_form_width = loginpress_get_option_key( 'customize_form_width', $loginpress_array );
|
66 |
+
$loginpress_get_form_height = loginpress_get_option_key( 'customize_form_height', $loginpress_array );
|
67 |
+
$loginpress_form_height = loginpress_check_px( $loginpress_get_form_height );
|
68 |
$loginpress_form_padding = loginpress_get_option_key( 'customize_form_padding', $loginpress_array );
|
69 |
$loginpress_form_border = loginpress_get_option_key( 'customize_form_border', $loginpress_array );
|
70 |
$loginpress_form_field_width = loginpress_get_option_key( 'textfield_width', $loginpress_array );
|
78 |
$loginpress_footer_decoration = loginpress_get_option_key( 'login_footer_text_decoration', $loginpress_array );
|
79 |
$loginpress_footer_text_color = loginpress_get_option_key( 'login_footer_color', $loginpress_array );
|
80 |
$loginpress_footer_text_hover = loginpress_get_option_key( 'login_footer_color_hover', $loginpress_array );
|
81 |
+
$loginpress_get_footer_font_size= loginpress_get_option_key( 'login_footer_font_size', $loginpress_array );
|
82 |
+
$loginpress_footer_font_size = loginpress_check_px( $loginpress_get_footer_font_size );
|
83 |
$loginpress_footer_bg_color = loginpress_get_option_key( 'login_footer_bg_color', $loginpress_array );
|
84 |
$loginpress_footer_links_font_size = loginpress_get_option_key( 'login_footer_links_text_size', $loginpress_array );
|
85 |
$loginpress_footer_links_hover_size = loginpress_get_option_key( 'login_footer_links_hover_size', $loginpress_array );
|
91 |
$loginpress_back_decoration = loginpress_get_option_key( 'login_back_text_decoration', $loginpress_array );
|
92 |
$loginpress_back_text_color = loginpress_get_option_key( 'login_back_color', $loginpress_array );
|
93 |
$loginpress_back_text_hover = loginpress_get_option_key( 'login_back_color_hover', $loginpress_array );
|
94 |
+
$loginpress_get_back_font_size = loginpress_get_option_key( 'login_back_font_size', $loginpress_array );
|
95 |
+
$loginpress_back_font_size = loginpress_check_px( $loginpress_get_back_font_size );
|
96 |
$loginpress_back_bg_color = loginpress_get_option_key( 'login_back_bg_color', $loginpress_array );
|
97 |
$loginpress_footer_link_color = loginpress_get_option_key( 'login_footer_text_color', $loginpress_array );
|
98 |
$loginpress_footer_link_hover = loginpress_get_option_key( 'login_footer_text_hover', $loginpress_array );
|
css/style.css
CHANGED
@@ -190,9 +190,92 @@
|
|
190 |
.form-table td fieldset label{
|
191 |
font-size: 13px;
|
192 |
}
|
193 |
-
.site_key, .secret_key, .captcha_theme, .captcha_language, .captcha_enable, .privacy_policy{
|
194 |
display: none;
|
195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
.recapthca-promo-img{
|
197 |
display: none;
|
198 |
}
|
190 |
.form-table td fieldset label{
|
191 |
font-size: 13px;
|
192 |
}
|
193 |
+
.site_key, .secret_key, .captcha_theme, .captcha_language, .captcha_enable, .privacy_policy, .rename_email_send_to{
|
194 |
display: none;
|
195 |
}
|
196 |
+
|
197 |
+
/*************config-page*******/
|
198 |
+
|
199 |
+
.loginpress-import-export-page h2{
|
200 |
+
padding-top: 15px;
|
201 |
+
}
|
202 |
+
|
203 |
+
.export_setting .export-sniper{
|
204 |
+
padding: 5px;
|
205 |
+
display: none;
|
206 |
+
}
|
207 |
+
.export_setting .export-text{
|
208 |
+
padding: 5px;
|
209 |
+
display: none;
|
210 |
+
color: #009306;
|
211 |
+
}
|
212 |
+
.import_setting .import-sniper{
|
213 |
+
padding: 5px;
|
214 |
+
display: none;
|
215 |
+
}
|
216 |
+
.import_setting .import-text{
|
217 |
+
padding: 5px;
|
218 |
+
color: #009306;
|
219 |
+
display: none;
|
220 |
+
}
|
221 |
+
|
222 |
+
.import_setting .wrong-import{
|
223 |
+
padding: 5px;
|
224 |
+
color: #ff0000;
|
225 |
+
/*display: none;*/
|
226 |
+
}
|
227 |
+
/*************config-page*******/
|
228 |
+
|
229 |
+
|
230 |
+
/**********help-page**********/
|
231 |
+
.loginpress-help-page h2{
|
232 |
+
padding-top: 15px;
|
233 |
+
}
|
234 |
+
.loginpress-log-file{
|
235 |
+
background: #0085ba !important;
|
236 |
+
border-color: #0073aa #006799 #006799 !important;
|
237 |
+
-webkit-box-shadow: 0 1px 0 #006799 !important;
|
238 |
+
box-shadow: 0 1px 0 #006799 !important;
|
239 |
+
color: #fff !important;
|
240 |
+
text-decoration: none !important;
|
241 |
+
text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
|
242 |
+
}
|
243 |
+
.log-file-sniper{
|
244 |
+
padding: 5px;
|
245 |
+
display: none;
|
246 |
+
}
|
247 |
+
.log-file-text {
|
248 |
+
padding: 5px;
|
249 |
+
display: none;
|
250 |
+
color: #009306;
|
251 |
+
}
|
252 |
+
/**************help-page***************/
|
253 |
+
|
254 |
+
/**********license-page**********/
|
255 |
+
.loginpress-license-page h2{
|
256 |
+
padding-top: 15px;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**********license-page**********/
|
260 |
+
|
261 |
+
/**********autologin-settings**********/
|
262 |
+
.loginpress_autologin_users{
|
263 |
+
width: 100%;
|
264 |
+
text-align: left;
|
265 |
+
border-collapse: collapse;
|
266 |
+
border-bottom: 1px solid #ccc;
|
267 |
+
}
|
268 |
+
.loginpress_autologin_users tr th,.loginpress_autologin_users tr td{
|
269 |
+
text-align: left;
|
270 |
+
padding: 5px 10px;
|
271 |
+
border-top: 1px solid #ccc;
|
272 |
+
border-left: 1px solid #ccc;
|
273 |
+
}
|
274 |
+
.loginpress_autologin_users tr th:last-child,.loginpress_autologin_users tr td:last-child{
|
275 |
+
text-align: right;
|
276 |
+
border-right: 1px solid #ccc;
|
277 |
+
}
|
278 |
+
/**********autologin-settings**********/
|
279 |
.recapthca-promo-img{
|
280 |
display: none;
|
281 |
}
|
custom.php
CHANGED
@@ -84,7 +84,7 @@ class LoginPress_Entities {
|
|
84 |
include LOGINPRESS_ROOT_PATH .'classes/control-presets.php';
|
85 |
|
86 |
if ( ! has_action( 'loginpress_pro_add_template' ) ) :
|
87 |
-
include LOGINPRESS_ROOT_PATH .'classes/loginpress-promo.php';
|
88 |
endif;
|
89 |
|
90 |
// =============================
|
@@ -588,7 +588,7 @@ class LoginPress_Entities {
|
|
588 |
'panel' => 'loginpress_panel',
|
589 |
) );
|
590 |
|
591 |
-
$error_control = array( 'incorrect_username', 'incorrect_password', 'empty_username', 'empty_password', 'invalid_email', 'empty_email', 'username_exists', 'email_exists', 'invalidcombo_message' );
|
592 |
$error_default = array(
|
593 |
sprintf( __( '%1$sError:%2$s Invalid Username.', 'loginpress' ), '<strong>', '</strong>' ), sprintf( __( '%1$sError:%2$s Invalid Password.', 'loginpress' ), '<strong>', '</strong>' ),
|
594 |
sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' ),
|
@@ -597,7 +597,8 @@ class LoginPress_Entities {
|
|
597 |
sprintf( __( '%1$sError:%2$s Please type your email address.', 'loginpress' ), '<strong>', '</strong>' ),
|
598 |
sprintf( __( '%1$sError:%2$s This username is already registered. Please choose another one.', 'loginpress' ), '<strong>', '</strong>' ),
|
599 |
sprintf( __( '%1$sError:%2$s This email is already registered, please choose another one.', 'loginpress' ), '<strong>', '</strong>' ),
|
600 |
-
sprintf( __( '%1$sError:%2$s Invalid username or email.', 'loginpress' ), '<strong>', '</strong>' )
|
|
|
601 |
$error_label = array(
|
602 |
__( 'Incorrect Username Message:', 'loginpress' ),
|
603 |
__( 'Incorrect Password Message:', 'loginpress' ),
|
@@ -608,10 +609,11 @@ class LoginPress_Entities {
|
|
608 |
__( 'Username Already Exist Message:','loginpress' ),
|
609 |
__( 'Email Already Exist Message:', 'loginpress' ),
|
610 |
__( 'Forget Password Message:', 'loginpress' ),
|
|
|
611 |
);
|
612 |
|
613 |
$error = 0;
|
614 |
-
while ( $error <
|
615 |
|
616 |
$wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
|
617 |
'default' => $error_default[$error],
|
84 |
include LOGINPRESS_ROOT_PATH .'classes/control-presets.php';
|
85 |
|
86 |
if ( ! has_action( 'loginpress_pro_add_template' ) ) :
|
87 |
+
include LOGINPRESS_ROOT_PATH .'classes/class-loginpress-promo.php';
|
88 |
endif;
|
89 |
|
90 |
// =============================
|
588 |
'panel' => 'loginpress_panel',
|
589 |
) );
|
590 |
|
591 |
+
$error_control = array( 'incorrect_username', 'incorrect_password', 'empty_username', 'empty_password', 'invalid_email', 'empty_email', 'username_exists', 'email_exists', 'invalidcombo_message', 'force_email_login' );
|
592 |
$error_default = array(
|
593 |
sprintf( __( '%1$sError:%2$s Invalid Username.', 'loginpress' ), '<strong>', '</strong>' ), sprintf( __( '%1$sError:%2$s Invalid Password.', 'loginpress' ), '<strong>', '</strong>' ),
|
594 |
sprintf( __( '%1$sError:%2$s The username field is empty.', 'loginpress' ), '<strong>', '</strong>' ),
|
597 |
sprintf( __( '%1$sError:%2$s Please type your email address.', 'loginpress' ), '<strong>', '</strong>' ),
|
598 |
sprintf( __( '%1$sError:%2$s This username is already registered. Please choose another one.', 'loginpress' ), '<strong>', '</strong>' ),
|
599 |
sprintf( __( '%1$sError:%2$s This email is already registered, please choose another one.', 'loginpress' ), '<strong>', '</strong>' ),
|
600 |
+
sprintf( __( '%1$sError:%2$s Invalid username or email.', 'loginpress' ), '<strong>', '</strong>' ),
|
601 |
+
sprintf( __( '%1$sError:%2$s Invalid Email Address', 'loginpress' ), '<strong>', '</strong>' ) );
|
602 |
$error_label = array(
|
603 |
__( 'Incorrect Username Message:', 'loginpress' ),
|
604 |
__( 'Incorrect Password Message:', 'loginpress' ),
|
609 |
__( 'Username Already Exist Message:','loginpress' ),
|
610 |
__( 'Email Already Exist Message:', 'loginpress' ),
|
611 |
__( 'Forget Password Message:', 'loginpress' ),
|
612 |
+
__( 'Login with Email Message:', 'loginpress' ),
|
613 |
);
|
614 |
|
615 |
$error = 0;
|
616 |
+
while ( $error < 10 ) :
|
617 |
|
618 |
$wp_customize->add_setting( "loginpress_customization[{$error_control[$error]}]", array(
|
619 |
'default' => $error_default[$error],
|
img/clock.png
ADDED
Binary file
|
include/get-premium.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php echo '<a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/" style="font-size: 26px;"> Buy Now $29 </a>'; ?>
|
|
include/loginpress-import-export.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
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>
|
10 |
+
<div class=""><?php esc_html_e( "Import/Export your LoginPress Settings for/from other sites. This will export/import all the settings including Customizer settings as well.", 'loginpress' ); ?></div>
|
11 |
+
<table class="form-table">
|
12 |
+
<tbody>
|
13 |
+
<tr class="import_setting">
|
14 |
+
<th scope="row">
|
15 |
+
<label for="loginpress_configure[import_setting]"><?php esc_html_e( 'Import Settings:', 'loginpress' ); ?></label>
|
16 |
+
</th>
|
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>
|
23 |
+
<span class="import-text"><?php esc_html_e( 'LoginPress Settings Imported Successfully.', 'loginpress' ); ?></span>
|
24 |
+
<span class="wrong-import"></span>
|
25 |
+
<p class="description"><?php esc_html_e( 'Select a file and click on Import to start processing.', 'loginpress' ); ?></p>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
<tr class="export_setting">
|
29 |
+
<th scope="row">
|
30 |
+
<label for="loginpress_configure[export_setting]"><?php esc_html_e( 'Export Settings:', 'loginpress' ); ?></label>
|
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>
|
37 |
+
<span class="export-text"><?php esc_html_e( 'LoginPress Settings Exported Successfully!', 'loginpress' ); ?></span>
|
38 |
+
<p class="description"><?php esc_html_e( 'Export LoginPress Settings.', 'loginpress' ) ?></p>
|
39 |
+
</td>
|
40 |
+
</tr>
|
41 |
+
</tbody>
|
42 |
+
</table>
|
43 |
+
</div>
|
include/privacy-policy.php
CHANGED
@@ -2,13 +2,8 @@
|
|
2 |
/**
|
3 |
* Privacy Policy Settings
|
4 |
*
|
5 |
-
* @since 1.0.
|
6 |
*/
|
7 |
-
$loginpress_setting = get_option( 'loginpress_setting' );
|
8 |
-
$loginpress_enable_ppolicy = isset( $loginpress_setting['enable_privacy_policy'] ) ? $loginpress_setting['enable_privacy_policy'] : 'off';
|
9 |
-
|
10 |
-
if ( 'off' == $loginpress_enable_ppolicy )
|
11 |
-
return;
|
12 |
|
13 |
// Add privacy policy field.
|
14 |
add_action( 'register_form', 'loginpress_add_privacy_policy_field' );
|
2 |
/**
|
3 |
* Privacy Policy Settings
|
4 |
*
|
5 |
+
* @since 1.0.19
|
6 |
*/
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
// Add privacy policy field.
|
9 |
add_action( 'register_form', 'loginpress_add_privacy_policy_field' );
|
include/settings.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<h2 style="margin: 20px 0 20px 0;">
|
2 |
-
<?php _e( 'LoginPress - Rebranding your boring WordPress Login pages', 'loginpress' ); ?>
|
3 |
-
</h2>
|
|
|
|
|
|
js/admin-custom.js
CHANGED
@@ -14,9 +14,9 @@
|
|
14 |
'https://www.youtube.com/embed/GMAwsHomJlE');
|
15 |
});
|
16 |
|
17 |
-
$("#
|
18 |
|
19 |
-
var promotion = $('#
|
20 |
if ( promotion.is(":checked") ) {
|
21 |
$('tr.recapthca-promo-img').show();
|
22 |
} else {
|
@@ -24,9 +24,26 @@
|
|
24 |
}
|
25 |
}); // on click promo checkbox.
|
26 |
|
27 |
-
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
if ( privacy_editor.is(":checked") ) {
|
31 |
$('tr.privacy_policy').show();
|
32 |
} else {
|
@@ -38,16 +55,143 @@
|
|
38 |
|
39 |
$('<tr class="recapthca-promo-img"><th class="recapthca-promo" colspan="2"><img src="' + loginpress_script.plugin_url + '/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>').insertAfter( $(".enable_repatcha_promo").closest('tr') );
|
40 |
|
41 |
-
var promotion = $('#
|
42 |
if ( promotion.is(":checked") ) {
|
43 |
$('tr.recapthca-promo-img').show();
|
44 |
}
|
45 |
|
46 |
-
var privacy_editor = $('#
|
47 |
if ( privacy_editor.is(":checked") ) {
|
48 |
$('tr.privacy_policy').show();
|
49 |
}
|
|
|
50 |
}); // Window on load.
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
});
|
53 |
})(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
|
14 |
'https://www.youtube.com/embed/GMAwsHomJlE');
|
15 |
});
|
16 |
|
17 |
+
$("#wpb-loginpress_setting\\[enable_repatcha_promo\\]").on('click', function() {
|
18 |
|
19 |
+
var promotion = $('#wpb-loginpress_setting\\[enable_repatcha_promo\\]');
|
20 |
if ( promotion.is(":checked") ) {
|
21 |
$('tr.recapthca-promo-img').show();
|
22 |
} else {
|
24 |
}
|
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( loginpressFileImp.lastIndexOf('.') + 1 );
|
33 |
+
|
34 |
+
$( '.loginpress-import' ).attr( "disabled", "disabled" );
|
35 |
+
|
36 |
+
if ( 'json' == loginpressFileExt ) {
|
37 |
+
$(".import_setting .wrong-import").html("");
|
38 |
+
$( '.loginpress-import' ).removeAttr( "disabled" );
|
39 |
+
} else {
|
40 |
+
$(".import_setting .wrong-import").html("Choose LoginPress settings file only.");
|
41 |
+
}
|
42 |
+
});
|
43 |
+
|
44 |
+
$("#wpb-loginpress_setting\\[enable_privacy_policy\\]").on('click', function() {
|
45 |
+
|
46 |
+
var privacy_editor = $('#wpb-loginpress_setting\\[enable_privacy_policy\\]');
|
47 |
if ( privacy_editor.is(":checked") ) {
|
48 |
$('tr.privacy_policy').show();
|
49 |
} else {
|
55 |
|
56 |
$('<tr class="recapthca-promo-img"><th class="recapthca-promo" colspan="2"><img src="' + loginpress_script.plugin_url + '/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>').insertAfter( $(".enable_repatcha_promo").closest('tr') );
|
57 |
|
58 |
+
var promotion = $('#wpb-loginpress_setting\\[enable_repatcha_promo\\]');
|
59 |
if ( promotion.is(":checked") ) {
|
60 |
$('tr.recapthca-promo-img').show();
|
61 |
}
|
62 |
|
63 |
+
var privacy_editor = $('#wpb-loginpress_setting\\[enable_privacy_policy\\]');
|
64 |
if ( privacy_editor.is(":checked") ) {
|
65 |
$('tr.privacy_policy').show();
|
66 |
}
|
67 |
+
|
68 |
}); // Window on load.
|
69 |
|
70 |
+
$( '.loginpress-log-file' ).on( 'click', function( event ) {
|
71 |
+
|
72 |
+
event.preventDefault();
|
73 |
+
|
74 |
+
$.ajax({
|
75 |
+
|
76 |
+
url: ajaxurl,
|
77 |
+
type: 'POST',
|
78 |
+
data: {
|
79 |
+
action : 'loginpress_help',
|
80 |
+
},
|
81 |
+
beforeSend: function() {
|
82 |
+
$(".log-file-sniper").show();
|
83 |
+
},
|
84 |
+
success: function( response ) {
|
85 |
+
|
86 |
+
$(".log-file-sniper").hide();
|
87 |
+
$(".log-file-text").show();
|
88 |
+
|
89 |
+
if ( ! window.navigator.msSaveOrOpenBlob ) { // If msSaveOrOpenBlob() is supported, then so is msSaveBlob().
|
90 |
+
$("<a />", {
|
91 |
+
"download" : "loginpress-log.txt",
|
92 |
+
"href" : "data:text/plain;charset=utf-8," + encodeURIComponent( response ),
|
93 |
+
}).appendTo( "body" )
|
94 |
+
.click(function() {
|
95 |
+
$(this).remove()
|
96 |
+
})[0].click()
|
97 |
+
} else {
|
98 |
+
var blobObject = new Blob( [response] );
|
99 |
+
window.navigator.msSaveBlob( blobObject, 'loginpress-log.txt' );
|
100 |
+
}
|
101 |
+
|
102 |
+
setTimeout(function() {
|
103 |
+
$(".log-file-text").fadeOut()
|
104 |
+
}, 3000 );
|
105 |
+
}
|
106 |
+
});
|
107 |
+
|
108 |
+
});
|
109 |
+
|
110 |
+
$('.loginpress-export').on('click', function(event) {
|
111 |
+
|
112 |
+
event.preventDefault();
|
113 |
+
|
114 |
+
var dateObj = new Date();
|
115 |
+
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
116 |
+
var day = dateObj.getUTCDate();
|
117 |
+
var year = dateObj.getUTCFullYear();
|
118 |
+
var newdate = year + "-" + month + "-" + day;
|
119 |
+
|
120 |
+
$.ajax({
|
121 |
+
|
122 |
+
url: ajaxurl,
|
123 |
+
type: 'POST',
|
124 |
+
data: {
|
125 |
+
action : 'loginpress_export',
|
126 |
+
},
|
127 |
+
beforeSend: function() {
|
128 |
+
$(".export_setting .export-sniper").show();
|
129 |
+
},
|
130 |
+
success: function( response ) {
|
131 |
+
|
132 |
+
$(".export_setting .export-sniper").hide();
|
133 |
+
$(".export_setting .export-text").show();
|
134 |
+
|
135 |
+
if ( ! window.navigator.msSaveOrOpenBlob ) { // If msSaveOrOpenBlob() is supported, then so is msSaveBlob().
|
136 |
+
$("<a />", {
|
137 |
+
"download" : "loginpress-export-"+newdate+".json",
|
138 |
+
"href" : "data:application/json;charset=utf-8," + encodeURIComponent( response ),
|
139 |
+
}).appendTo( "body" )
|
140 |
+
.click(function() {
|
141 |
+
$(this).remove()
|
142 |
+
})[0].click()
|
143 |
+
} else {
|
144 |
+
var blobObject = new Blob( [response] );
|
145 |
+
window.navigator.msSaveBlob( blobObject, "loginpress-export-"+newdate+".json" );
|
146 |
+
}
|
147 |
+
|
148 |
+
setTimeout(function() {
|
149 |
+
$(".export_setting .export-text").fadeOut()
|
150 |
+
}, 3000 );
|
151 |
+
}
|
152 |
+
});
|
153 |
+
});
|
154 |
+
|
155 |
+
$('.loginpress-import').on( 'click', function(event) {
|
156 |
+
event.preventDefault();
|
157 |
+
|
158 |
+
var file = $('#loginPressImport');
|
159 |
+
var fileObj = new FormData();
|
160 |
+
var content = file[0].files[0];
|
161 |
+
|
162 |
+
fileObj.append( 'file', content );
|
163 |
+
fileObj.append( 'action', 'loginpress_import' );
|
164 |
+
|
165 |
+
$.ajax({
|
166 |
+
|
167 |
+
processData: false,
|
168 |
+
contentType: false,
|
169 |
+
url: ajaxurl,
|
170 |
+
type: 'POST',
|
171 |
+
data: fileObj, // file and action append into variable fileObj.
|
172 |
+
beforeSend: function() {
|
173 |
+
$(".import_setting .import-sniper").show();
|
174 |
+
$(".import_setting .wrong-import").html("");
|
175 |
+
$( '.loginpress-import' ).attr( "disabled", "disabled" );
|
176 |
+
},
|
177 |
+
success: function(response) {
|
178 |
+
|
179 |
+
$(".import_setting .import-sniper").hide();
|
180 |
+
// $(".import_setting .import-text").fadeIn();
|
181 |
+
if ( 'error' == response ) {
|
182 |
+
$(".import_setting .wrong-import").html("JSON File is not Valid.");
|
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 |
+
}
|
193 |
+
}); //!ajax.
|
194 |
+
});
|
195 |
+
|
196 |
});
|
197 |
})(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
|
js/customize-controls.js
CHANGED
@@ -42,7 +42,7 @@ jQuery(document).ready(function() {
|
|
42 |
$( '#customize-preview iframe' )
|
43 |
.contents()
|
44 |
.find( target )
|
45 |
-
.css( 'background-image', '' );
|
46 |
} else {
|
47 |
$( '#customize-preview iframe' )
|
48 |
.contents()
|
@@ -1264,7 +1264,7 @@ jQuery(document).ready(function() {
|
|
1264 |
loginpress_css_property(
|
1265 |
'loginpress_customization[message_background_color]',
|
1266 |
'.login .custom-message', 'background-color');
|
1267 |
-
|
1268 |
wp.customize( 'loginpress_customization[loginpress_show_love]', function( value ) {
|
1269 |
value.bind( function( loginPressVal ) {
|
1270 |
|
42 |
$( '#customize-preview iframe' )
|
43 |
.contents()
|
44 |
.find( target )
|
45 |
+
.css( 'background-image', 'none' );
|
46 |
} else {
|
47 |
$( '#customize-preview iframe' )
|
48 |
.contents()
|
1264 |
loginpress_css_property(
|
1265 |
'loginpress_customization[message_background_color]',
|
1266 |
'.login .custom-message', 'background-color');
|
1267 |
+
|
1268 |
wp.customize( 'loginpress_customization[loginpress_show_love]', function( value ) {
|
1269 |
value.bind( function( loginPressVal ) {
|
1270 |
|
languages/{loginpress-ar_AR.mo → loginpress-ar.mo}
RENAMED
File without changes
|
languages/{loginpress-ar_AR.po → loginpress-ar.po}
RENAMED
File without changes
|
loginpress.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: http://www.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.0.
|
7 |
* Author: WPBrigade
|
8 |
* Author URI: http://www.WPBrigade.com/
|
9 |
* Text Domain: loginpress
|
@@ -22,7 +22,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
22 |
/**
|
23 |
* @var string
|
24 |
*/
|
25 |
-
public $version = '1.0.
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
@@ -77,8 +77,22 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
77 |
public function includes() {
|
78 |
|
79 |
include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
|
80 |
-
include_once( LOGINPRESS_DIR_PATH . 'classes/loginpress-setup.php' );
|
81 |
-
include_once( LOGINPRESS_DIR_PATH . '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
/**
|
@@ -96,20 +110,9 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
96 |
add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
|
97 |
add_action( 'admin_init', array( $this, 'redirect_optin' ) );
|
98 |
add_filter( 'auth_cookie_expiration', array( $this, '_change_auth_cookie_expiration' ), 10, 3 );
|
|
|
|
|
99 |
|
100 |
-
add_action( 'wp_ajax_loginpress_deactivate', array( $this, '_deactivate' ) );
|
101 |
-
add_action( 'wp_ajax_loginpress_optout_yes', array( $this, 'optout_yes' ) );
|
102 |
-
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Opt-out
|
107 |
-
*
|
108 |
-
* @since 1.0.15
|
109 |
-
*/
|
110 |
-
function optout_yes() {
|
111 |
-
update_option( '_loginpress_optin', 'no' );
|
112 |
-
wp_die();
|
113 |
}
|
114 |
|
115 |
/**
|
@@ -148,6 +151,7 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
148 |
}
|
149 |
}
|
150 |
|
|
|
151 |
/**
|
152 |
* Main Instance
|
153 |
*
|
@@ -274,19 +278,19 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
274 |
*/
|
275 |
function _admin_scripts( $hook ) {
|
276 |
|
277 |
-
if( $hook
|
278 |
-
return;
|
279 |
-
}
|
280 |
|
281 |
-
|
282 |
-
|
283 |
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
|
|
288 |
|
289 |
-
wp_localize_script( 'loginpress_js', 'loginpress_script', $loginpress_localize );
|
290 |
}
|
291 |
|
292 |
|
@@ -318,60 +322,6 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
318 |
include LOGINPRESS_DIR_PATH . 'include/loginpress-optout-form.php';
|
319 |
}
|
320 |
|
321 |
-
function _deactivate() {
|
322 |
-
|
323 |
-
$email = get_option( 'admin_email' );
|
324 |
-
$_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
|
325 |
-
$reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
|
326 |
-
$reason = '';
|
327 |
-
|
328 |
-
if ( $_reason == '1' ) {
|
329 |
-
$reason = 'I only needed the plugin for a short period';
|
330 |
-
} elseif ( $_reason == '2' ) {
|
331 |
-
$reason = 'I found a better plugin';
|
332 |
-
} elseif ( $_reason == '3' ) {
|
333 |
-
$reason = 'The plugin broke my site';
|
334 |
-
} elseif ( $_reason == '4' ) {
|
335 |
-
$reason = 'The plugin suddenly stopped working';
|
336 |
-
} elseif ( $_reason == '5' ) {
|
337 |
-
$reason = 'I no longer need the plugin';
|
338 |
-
} elseif ( $_reason == '6' ) {
|
339 |
-
$reason = 'It\'s a temporary deactivation. I\'m just debugging an issue.';
|
340 |
-
} elseif ( $_reason == '7' ) {
|
341 |
-
$reason = 'Other';
|
342 |
-
}
|
343 |
-
$fields = array(
|
344 |
-
'email' => $email,
|
345 |
-
'website' => get_site_url(),
|
346 |
-
'action' => 'Deactivate',
|
347 |
-
'reason' => $reason,
|
348 |
-
'reason_detail' => $reason_detail,
|
349 |
-
'blog_language' => get_bloginfo( 'language' ),
|
350 |
-
'wordpress_version' => get_bloginfo( 'version' ),
|
351 |
-
'plugin_version' => LOGINPRESS_VERSION,
|
352 |
-
'plugin_name' => 'LoginPress Free',
|
353 |
-
);
|
354 |
-
|
355 |
-
$response = wp_remote_post( LOGINPRESS_FEEDBACK_SERVER, array(
|
356 |
-
'method' => 'POST',
|
357 |
-
'timeout' => 5,
|
358 |
-
'httpversion' => '1.0',
|
359 |
-
'blocking' => false,
|
360 |
-
'headers' => array(),
|
361 |
-
'body' => $fields,
|
362 |
-
) );
|
363 |
-
|
364 |
-
// if ( is_wp_error( $response ) ) {
|
365 |
-
// $error_message = $response->get_error_message();
|
366 |
-
// echo "Something went wrong: $error_message";
|
367 |
-
// } else {
|
368 |
-
// echo 'Response:<pre>';
|
369 |
-
// print_r( $response );
|
370 |
-
// echo '</pre>';
|
371 |
-
// }
|
372 |
-
wp_die();
|
373 |
-
}
|
374 |
-
|
375 |
static function plugin_activation() {
|
376 |
|
377 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
@@ -584,9 +534,52 @@ if ( ! class_exists( 'LoginPress' ) ) :
|
|
584 |
return $links;
|
585 |
}
|
586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
} // End Of Class.
|
588 |
endif;
|
589 |
|
|
|
590 |
/**
|
591 |
* Returns the main instance of WP to prevent the need to use globals.
|
592 |
*
|
3 |
* Plugin Name: LoginPress - Customizing the WordPress Login
|
4 |
* Plugin URI: http://www.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.0.19
|
7 |
* Author: WPBrigade
|
8 |
* Author URI: http://www.WPBrigade.com/
|
9 |
* Text Domain: loginpress
|
22 |
/**
|
23 |
* @var string
|
24 |
*/
|
25 |
+
public $version = '1.0.19';
|
26 |
|
27 |
/**
|
28 |
* @var The single instance of the class
|
77 |
public function includes() {
|
78 |
|
79 |
include_once( LOGINPRESS_DIR_PATH . 'custom.php' );
|
80 |
+
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-setup.php' );
|
81 |
+
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-ajax.php' );
|
82 |
+
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-filter-plugin.php' );
|
83 |
+
|
84 |
+
$loginpress_setting = get_option( 'loginpress_setting' );
|
85 |
+
|
86 |
+
$loginpress_privacy_policy = isset( $loginpress_setting['enable_privacy_policy'] ) ? $loginpress_setting['enable_privacy_policy'] : 'off';
|
87 |
+
if ( 'off' != $loginpress_privacy_policy ) {
|
88 |
+
include_once( LOGINPRESS_DIR_PATH . 'include/privacy-policy.php' );
|
89 |
+
}
|
90 |
+
|
91 |
+
$login_with_email = isset( $loginpress_setting['login_with_email'] ) ? $loginpress_setting['login_with_email'] : 'off';
|
92 |
+
if ( 'off' != $login_with_email ) {
|
93 |
+
include_once( LOGINPRESS_DIR_PATH . 'classes/class-loginpress-email.php' );
|
94 |
+
new LoginPress_Email_Auth();
|
95 |
+
}
|
96 |
}
|
97 |
|
98 |
/**
|
110 |
add_action( 'plugin_action_links', array( $this, 'loginpress_action_links' ), 10, 2 );
|
111 |
add_action( 'admin_init', array( $this, 'redirect_optin' ) );
|
112 |
add_filter( 'auth_cookie_expiration', array( $this, '_change_auth_cookie_expiration' ), 10, 3 );
|
113 |
+
add_action( 'activated_plugin', array( $this, 'loginpress_activate_redirect' ), 10, 1 );
|
114 |
+
// add_filter( 'plugins_api', array( $this, 'get_addon_info_' ) , 100, 3 );
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
/**
|
151 |
}
|
152 |
}
|
153 |
|
154 |
+
|
155 |
/**
|
156 |
* Main Instance
|
157 |
*
|
278 |
*/
|
279 |
function _admin_scripts( $hook ) {
|
280 |
|
281 |
+
if( $hook == 'toplevel_page_loginpress-settings' || $hook == 'loginpress_page_loginpress-help' || $hook == 'loginpress_page_loginpress-import-export' || $hook == 'loginpress_page_loginpress-license' ) {
|
|
|
|
|
282 |
|
283 |
+
wp_enqueue_style( 'loginpress_stlye', plugins_url( 'css/style.css', __FILE__ ), array(), LOGINPRESS_VERSION );
|
284 |
+
wp_enqueue_script( 'loginpress_js', plugins_url( 'js/admin-custom.js', __FILE__ ), array(), LOGINPRESS_VERSION );
|
285 |
|
286 |
+
// Array for localize.
|
287 |
+
$loginpress_localize = array(
|
288 |
+
'plugin_url' => plugins_url(),
|
289 |
+
);
|
290 |
+
|
291 |
+
wp_localize_script( 'loginpress_js', 'loginpress_script', $loginpress_localize );
|
292 |
+
}
|
293 |
|
|
|
294 |
}
|
295 |
|
296 |
|
322 |
include LOGINPRESS_DIR_PATH . 'include/loginpress-optout-form.php';
|
323 |
}
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
static function plugin_activation() {
|
326 |
|
327 |
$loginpress_setting = get_option( 'loginpress_setting' );
|
534 |
return $links;
|
535 |
}
|
536 |
|
537 |
+
/**
|
538 |
+
* [loginpress_activate_redirect redirect to loginpress settings page after activate plugin]
|
539 |
+
* @param [string] $plugins
|
540 |
+
* @since 1.0.19
|
541 |
+
*/
|
542 |
+
function loginpress_activate_redirect( $plugins ) {
|
543 |
+
|
544 |
+
// Redirect only if pluign is LoginPress.
|
545 |
+
if ( 'loginpress/loginpress.php' == $plugins ) {
|
546 |
+
wp_redirect( admin_url( 'admin.php?page=loginpress-settings' ) );
|
547 |
+
exit();
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
function get_addon_info_( $api, $action, $args ) {
|
552 |
+
|
553 |
+
if ( $action == 'plugin_information' && empty( $api ) && ( ! empty( $_GET['lgp'] ) ) ) {
|
554 |
+
|
555 |
+
$raw_response = wp_remote_post( 'https://wpbrigade.com/loginpress-api/search.php', array(
|
556 |
+
'body' => array(
|
557 |
+
'slug' => $args->slug
|
558 |
+
) )
|
559 |
+
);
|
560 |
+
|
561 |
+
if ( is_wp_error( $raw_response ) || $raw_response['response']['code'] != 200 ) {
|
562 |
+
return false;
|
563 |
+
}
|
564 |
+
|
565 |
+
$plugin = unserialize( $raw_response['body'] );
|
566 |
+
|
567 |
+
$api = new stdClass();
|
568 |
+
$api->name = $plugin['title'];
|
569 |
+
$api->version = $plugin['version'];
|
570 |
+
$api->download_link = $plugin['download_url'];
|
571 |
+
$api->tested = '10.0';
|
572 |
+
|
573 |
+
}
|
574 |
+
|
575 |
+
return $api;
|
576 |
+
|
577 |
+
}
|
578 |
+
|
579 |
} // End Of Class.
|
580 |
endif;
|
581 |
|
582 |
+
|
583 |
/**
|
584 |
* Returns the main instance of WP to prevent the need to use globals.
|
585 |
*
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tested up to: 4.8
|
|
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.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -131,9 +131,36 @@ Absolutely not. You can create and manage custom login page without any coding k
|
|
131 |
|
132 |
Yes, LoginPress has full translation and localization support via the loginpress textdomain. All .mo and .po translation files should go into the languages folder in the base of the plugin.
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
= How to donate or contribute? =
|
135 |
|
136 |
-
Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/wordpress/plugins/loginpress-pro
|
137 |
|
138 |
== Screenshots ==
|
139 |
|
@@ -163,6 +190,15 @@ Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/word
|
|
163 |
|
164 |
== Changelog ==
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.0.18 - 2017-07-03 =
|
167 |
* Enhancement: Set login session expiration time.
|
168 |
* Bugfix: Compatible with Rename wp-login.php
|
@@ -251,5 +287,5 @@ Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/word
|
|
251 |
|
252 |
== Upgrade Notice ==
|
253 |
|
254 |
-
= 1.0.
|
255 |
-
* Important release, Multiple
|
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.0.19
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
131 |
|
132 |
Yes, LoginPress has full translation and localization support via the loginpress textdomain. All .mo and .po translation files should go into the languages folder in the base of the plugin.
|
133 |
|
134 |
+
= Is LoginPress WPML Compatible? =
|
135 |
+
Yes.
|
136 |
+
|
137 |
+
= Do I Need LoginPress Pro? =
|
138 |
+
If you have a WordPress Website, and you want to add a cool looking login page. LoginPress is your must have plugin.
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
= How to upgrade to LoginPress Pro? =
|
143 |
+
|
144 |
+
Buy Pro version from <a target="_blank" rel="friend" href="http://www.WPBrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=readme-faqs&utm_campaign=pro-upgrade">this link</a>. LoginPress Pro is a premium plugin which works if you have installed Free version already. So, first install our Free version and then install the Pro package.
|
145 |
+
|
146 |
+
LoginPress Pro version extends the Premium functionality to our Core Free version of LoginPress.
|
147 |
+
|
148 |
+
= Step-by-step instructions on How to Upgrade from existing Free version to Pro =
|
149 |
+
|
150 |
+
1. You have installed and setup Free version already.
|
151 |
+
2. Buy Pro version from <a target="_blank" rel="friend" href="http://www.WPBrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=readme-faqs&utm_campaign=pro-upgrade">this link</a>.
|
152 |
+
3. Upload the Pro version.
|
153 |
+
4. Pro features will be enabled automatically.
|
154 |
+
5. You don't need to setup Free version options again.
|
155 |
+
6. Setup Pro features like Google fonts, Google reCaptcha, Choose themes etc
|
156 |
+
|
157 |
+
= Where is my license key? =
|
158 |
+
License key is the Order ID which looks like in this format. WHI150807-1234-12345
|
159 |
+
You can find it in the email Sales Receipt.
|
160 |
+
|
161 |
= How to donate or contribute? =
|
162 |
|
163 |
+
Please visit <a target="_blank" rel="friend" href="http://www.WPBrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=readme-donate&utm_campaign=pro-upgrade">this link</a> for more info.
|
164 |
|
165 |
== Screenshots ==
|
166 |
|
190 |
|
191 |
== Changelog ==
|
192 |
|
193 |
+
= 1.0.19 - 2017-08-22 =
|
194 |
+
* Enhancement: (New Feature) User Login with Email only.
|
195 |
+
* Enhancement: (New Feature) Introduced Help Page with System Info.
|
196 |
+
* Enhancement: (New Feature) Introduced Add-ons page, list of all possible add-ons.
|
197 |
+
* Enhancement: (New Feature) Introduced Export/Import settings page.
|
198 |
+
* Enhancement: (New Feature) Compatible with WPML.
|
199 |
+
* Enhancement: Add 'px' automatically in input field.
|
200 |
+
* Bugfix: code cleanup.
|
201 |
+
|
202 |
= 1.0.18 - 2017-07-03 =
|
203 |
* Enhancement: Set login session expiration time.
|
204 |
* Bugfix: Compatible with Rename wp-login.php
|
287 |
|
288 |
== Upgrade Notice ==
|
289 |
|
290 |
+
= 1.0.19 =
|
291 |
+
* Important release, Multiple New Features & enhancements, Please upgrade immediately.
|