PluginProbe
LoginPress | wp-login Custom Login Page Customizer / trunk
LoginPress | wp-login Custom Login Page Customizer vtrunk
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.3 1.0.4 All 118 releases
loginpress / include / class-loginpress-static-addons.php

class-loginpress-static-addons.php in LoginPress | wp-login Custom Login Page Customizer trunk, at include/class-loginpress-static-addons.php

411 lines 18.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * LoginPress Static Addons File.
4 *
5 * This file contains the LoginPress Static Addons class.
6 * Purpose of this file is to manage static addon functionality and display.
7 *
8 * @package LoginPress
9 * @since 1.5.8
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 // Exit if accessed directly.
14 exit;
15 }
16
17 /**
18 * LoginPress Static Addons Class.
19 *
20 * This class handles all the static addons in LoginPress.
21 * Purpose of this class is to manage static addon functionality and display.
22 *
23 * @package LoginPress
24 * @since 1.5.8
25 */
26
27 if ( ! class_exists( 'LoginPress_Static_Addons' ) ) :
28
29 /**
30 * LoginPress Static Addons Class.
31 *
32 * Handles static addons functionality for LoginPress.
33 *
34 * @since 1.5.8
35 * @version 3.0.5
36 */
37 class LoginPress_Static_Addons {
38
39 /**
40 * The constructor function.
41 *
42 * @since 1.5.8
43 * @version 3.0.5
44 * @return void
45 */
46 public function __construct() {
47 if ( defined( 'LOGINPRESS_PRO_VERSION' ) && version_compare( '3.0.0', LOGINPRESS_PRO_VERSION, '<' ) ) {
48 /**
49 * Include deprecated addons class.
50 *
51 * @phpstan-ignore-next-line
52 */
53 require_once LOGINPRESS_DIR_PATH . 'classes/class-loginpress-deprecated-addons.php';
54 } else {
55 /**
56 * Include addons class.
57 *
58 * @phpstan-ignore-next-line
59 */
60 require_once LOGINPRESS_DIR_PATH . 'classes/class-loginpress-addons.php';
61 }
62 }
63
64 /**
65 * Check addons status.
66 *
67 * @since 1.5.8
68 * @param string $version The version type.
69 * @param string $slug The addon slug.
70 * @return void
71 */
72 public static function loginpress_check_addon_status( $version, $slug ) {
73 $slug_id = $slug;
74 $slug = $slug . '/' . $slug . '.php';
75 $plugins_list = get_plugins();
76 if ( is_plugin_active( $slug ) ) { ?>
77
78 <input name="loginpress_pro_addon_nonce" type="hidden"
79 value="<?php echo esc_attr( wp_create_nonce( 'uninstall_' . $slug ) ); ?>">
80 <input name="loginpress_pro_addon_slug" type="hidden" value="<?php echo esc_attr( $slug ); ?>">
81 <button type="button" class="button button-secondary loginpress-uninstall-pro-addon" data-slug="<?php echo esc_attr( $slug ); ?>"><?php esc_html_e( 'Deactivate', 'loginpress' ); ?></button>
82
83 <?php
84 } elseif ( array_key_exists( sanitize_text_field( $slug ), $plugins_list ) ) {
85 ?>
86
87 <input name="loginpress_pro_addon_nonce" type="hidden"
88 value="<?php echo esc_attr( wp_create_nonce( 'install-plugin_' . $slug ) ); ?>">
89 <input name="loginpress_pro_addon_slug" type="hidden" value="<?php echo esc_attr( $slug ); ?>">
90 <button type="button" class="button button-primary loginpress-active-pro-addon" data-slug="<?php echo esc_attr( $slug ); ?>"><?php esc_html_e( 'Activate', 'loginpress' ); ?></button>
91 <?php
92 } elseif ( 'free' === $version && ! array_key_exists( sanitize_text_field( $slug ), $plugins_list ) ) {
93 $action = 'install-plugin';
94 if ( empty( get_option( 'loginpress_pro_license_key' ) ) ) {
95 $slug = 'login-logout-menu';
96 }
97 $link = wp_nonce_url(
98 add_query_arg(
99 array(
100 'action' => $action,
101 'plugin' => sanitize_text_field( $slug ),
102 ),
103 admin_url( 'update.php' )
104 ),
105 $action . '_' . sanitize_text_field( $slug )
106 );
107 ?>
108 <input name="loginpress_pro_addon_nonce" type="hidden"
109 value="<?php echo esc_attr( wp_create_nonce( 'install-plugin_' . $slug ) ); ?>">
110 <input name="loginpress_pro_addon_slug" type="hidden" value="<?php echo esc_attr( $slug ); ?>">
111 <input name="loginpress_pro_addon_id" type="hidden" value="3536">
112 <button type="button" class="button button-primary loginpress-install-pro-addon" data-slug="<?php echo esc_attr( $slug_id ); ?>"><?php esc_html_e( 'Install', 'loginpress' ); ?></button>
113 <?php
114 } else {
115 ?>
116 <input name="loginpress_pro_addon_nonce" type="hidden"
117 value="<?php echo esc_attr( wp_create_nonce( 'install-plugin_' . sanitize_text_field( $slug ) ) ); ?>">
118 <input name="loginpress_pro_addon_slug" type="hidden" value="<?php echo esc_attr( $slug ); ?>">
119 <button type="button" class="button button-primary loginpress-active-pro-addon" data-slug="<?php echo esc_attr( $slug_id ); ?>"><?php esc_html_e( 'Activate', 'loginpress' ); ?></button>
120 <?php
121
122 }
123 }
124
125 /**
126 * The Static addons cards for pro.
127 *
128 * @version 1.5.8
129 * @return void
130 */
131 public static function pro_static_addon_cards() {
132 $obj_loginpress_addons = new LoginPress_Addons();
133 ?>
134 <div class="addon_cards_wraper">
135 <div class="loginpress-extension loginpress-free-add-ons">
136 <a target="_blank"
137 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
138 class="loginpress_addons_links">
139 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-logout-menu.svg' ); ?>"
140 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Login Logout Menu' ); ?></span>
141 </h3>
142 </a>
143 <p><?php esc_html_e( 'Login Logout Menu is a handy plugin which allows you to add login, logout, register and profile menu items in your selected menu.', 'loginpress' ); ?>
144 </p>
145 <?php
146 self::loginpress_check_addon_status( 'free', 'login-logout-menu' );
147 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Login Logout Menu', 'login-logout-menu' ) );
148 ?>
149 </div>
150
151
152 <div class="loginpress-extension">
153 <a target="_blank"
154 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
155 class="loginpress_addons_links">
156 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-redirects.png' ); ?>"
157 class="loginpress_addons_thumbnails"><span>
158 <?php
159 echo esc_html( 'Login Redirects' );
160 ?>
161 </span></h3>
162 </a>
163 <p>
164 <?php
165 echo esc_html( 'Redirects users based on their roles. This is helpful, If you have an editor and want to redirect him to his editor stats page. Restrict your subscribers, guests or even customers to certain pages instead of wp-admin. This add-on has a cool UX/UI to manage all the login redirects you have created on your site.' );
166 ?>
167 </p>
168 <?php
169 self::loginpress_check_addon_status( 'pro', 'loginpress-login-redirects' );
170 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Login Redirects', 'loginpress-login-redirects' ) );
171 ?>
172 </div>
173
174
175 <div class="loginpress-extension">
176 <a target="_blank"
177 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
178 class="loginpress_addons_links">
179 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/social-login.png' ); ?>"
180 class="loginpress_addons_thumbnails"><span>
181 <?php
182 echo esc_html( 'Social Login' );
183 ?>
184 </span></h3>
185 </a>
186 <p>
187 <?php
188 echo esc_html( 'Social login from LoginPress is an add-on which provides facility your users to log in and Register via Facebook, Google, and Twitter. This add-on will eliminate the Spam and Bot registrations. This add-on will help your users to hassle-free registrations/logins on your site.' );
189 ?>
190 </p>
191 <p>
192 <?php
193 self::loginpress_check_addon_status( 'pro', 'loginpress-social-login' );
194 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Social Login', 'loginpress-social-login' ) );
195 ?>
196 </div>
197
198
199 <div class="loginpress-extension">
200 <a target="_blank"
201 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
202 class="loginpress_addons_links">
203 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-widget.png' ); ?>"
204 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Login Widget' ); ?></span></h3>
205 </a>
206 <p><?php echo esc_html( 'This LoginPress add-on is a widget you can use into your blog sidebar. It uses an Ajax way to login via the sidebar. You may need to know HTML/CSS to give it style according to your site even we have styled it in general.' ); ?>
207 </p>
208 <p>
209 <?php
210 self::loginpress_check_addon_status( 'pro', 'loginpress-login-widget' );
211 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Login Widget', 'loginpress-login-widget' ) );
212 ?>
213 </div>
214
215
216 <div class="loginpress-extension">
217 <a target="_blank"
218 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
219 class="loginpress_addons_links">
220 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/limit-login-attempts.png' ); ?>"
221 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Limit Login Attempts' ); ?></span>
222 </h3>
223 </a>
224 <p><?php echo esc_html( 'Everybody needs a control of their Login page. This will help you to track your login attempts by each user. You can limit the login attempts for each user. Brute force attacks are the most common way to gain access to your website. This add-on acts as a sheild to these hacking attacks and gives you control to set the time between each login attempts.' ); ?>
225 </p>
226 <?php
227 self::loginpress_check_addon_status( 'pro', 'loginpress-limit-login-attempts' );
228 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Limit Login Attempts', 'loginpress-limit-login-attempts' ) );
229 ?>
230 </div>
231
232
233 <div class="loginpress-extension">
234 <a target="_blank"
235 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
236 class="loginpress_addons_links">
237 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/auto-login.png' ); ?>"
238 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Auto Login' ); ?></span></h3>
239 </a>
240 <p><?php echo esc_html( 'This LoginPress add-on lets you (Administrator) generates a unique URL for your certain users who you don\'t want to provide a password to login to your site. This Pro add-on gives you a list of all the users who you have given auto-generated login links. You can disable someone\'s access and delete certain users.' ); ?>
241 </p>
242 <?php
243 self::loginpress_check_addon_status( 'pro', 'loginpress-auto-login' );
244 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Auto Login', 'loginpress-auto-login' ) );
245 ?>
246 </div>
247
248
249 <div class="loginpress-extension">
250 <a target="_blank"
251 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
252 class="loginpress_addons_links">
253 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/hide-login.png' ); ?>"
254 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Hide Login' ); ?></span></h3>
255 </a>
256 <p><?php echo esc_html( 'This LoginPress add-on lets you change the login page URL to anything you want. It will give a hard time to spammers who keep hitting to your login page. This is helpful for Brute force attacks. One caution to use this add-on is you need to remember the custom login url after you change it. We have an option to email your custom login url so you remember it.' ); ?>
257 </p>
258 <?php
259 self::loginpress_check_addon_status( 'pro', 'loginpress-hide-login' );
260 echo wp_kses_post( $obj_loginpress_addons->_ajax_response( 'Limit Login Attempts', 'loginpress-hide-login' ) );
261 ?>
262 </div>
263
264 </div>
265 <?php
266 }
267
268 /** The Static addons cards for pro.
269 *
270 * @version 1.5.8
271 * @return void
272 */
273 public static function free_static_addon_cards() {
274 $obj_loginpress_addon = new LoginPress_Addons();
275 ?>
276
277 <div class="addon_cards_wraper">
278 <div class="loginpress-extension loginpress-free-add-ons">
279 <a target="_blank"
280 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
281 class="loginpress_addons_links">
282
283 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-logout-menu.svg' ); ?>"
284 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Login Logout Menu' ); ?></span>
285 </h3>
286 </a>
287
288 <p><?php echo esc_html( 'Login Logout Menu is a handy plugin which allows you to add login, logout, register and profile menu items in your selected menu.' ); ?>
289 </p>
290 <?php
291 self::loginpress_check_addon_status( 'free', 'login-logout-menu' );
292 echo wp_kses_post( $obj_loginpress_addon->_ajax_response( 'Login Logout Menu', 'login-logout-menu' ) );
293 ?>
294
295 </div>
296
297 <div class="loginpress-extension">
298 <a target="_blank"
299 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
300 class="loginpress_addons_links">
301
302 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-redirects.png' ); ?>"
303 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Login Redirects' ); ?></span></h3>
304 </a>
305
306 <p><?php echo esc_html( 'Redirects users based on their roles. This is helpful, If you have an editor and want to redirect him to his editor stats page. Restrict your subscribers, guests or even customers to certain pages instead of wp-admin. This add-on has a cool UX/UI to manage all the login redirects you have created on your site.' ); ?>
307 </p>
308 <p>
309 <a target="_blank"
310 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
311 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
312 </p>
313 </div>
314
315 <div class="loginpress-extension">
316 <a target="_blank"
317 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
318 class="loginpress_addons_links">
319
320 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/social-login.png' ); ?>"
321 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Social Login' ); ?></span></h3>
322 </a>
323
324 <p><?php echo esc_html( 'Social login from LoginPress is an add-on which provides facility your users to log in and Register via Facebook, Google, and Twitter. This add-on will eliminate the Spam and Bot registrations. This add-on will help your users to hassle-free registrations/logins on your site.' ); ?>
325 </p>
326 <p>
327 <a target="_blank"
328 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
329 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
330 </p>
331 </div>
332
333 <div class="loginpress-extension">
334 <a target="_blank"
335 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
336 class="loginpress_addons_links">
337
338 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/login-widget.png' ); ?>"
339 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Login Widget' ); ?></span></h3>
340 </a>
341
342 <p><?php echo esc_html( 'This LoginPress add-on is a widget you can use into your blog sidebar. It uses an Ajax way to login via the sidebar. You may need to know HTML/CSS to give it style according to your site even we have styled it in general.' ); ?>
343 </p>
344 <p>
345 <a target="_blank"
346 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
347 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
348 </p>
349
350 </div>
351
352 <div class="loginpress-extension">
353 <a target="_blank"
354 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
355 class="loginpress_addons_links">
356
357 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/limit-login-attempts.png' ); ?>"
358 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Limit Login Attempts' ); ?></span>
359 </h3>
360 </a>
361
362 <p><?php esc_html_e( 'Everybody needs a control of their Login page. This will help you to track your login attempts by each user. You can limit the login attempts for each user. Brute force attacks are the most common way to gain access to your website. This add-on acts as a sheild to these hacking attacks and gives you control to set the time between each login attempts.', 'loginpress' ); ?>
363 </p>
364 <p>
365 <a target="_blank"
366 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
367 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
368 </p>
369 </div>
370
371 <div class="loginpress-extension">
372 <a target="_blank"
373 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
374 class="loginpress_addons_links">
375
376 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/auto-login.png' ); ?>"
377 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Auto Login' ); ?></span></h3>
378 </a>
379
380 <p><?php echo esc_html( 'This LoginPress add-on lets you (Administrator) generates a unique URL for your certain users who you don\'t want to provide a password to login to your site. This Pro add-on gives you a list of all the users who you have given auto-generated login links. You can disable someone\'s access and delete certain users.' ); ?>
381 </p>
382 <p>
383 <a target="_blank"
384 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
385 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
386 </p>
387 </div>
388
389 <div class="loginpress-extension">
390 <a target="_blank"
391 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
392 class="loginpress_addons_links">
393
394 <h3><img src="<?php echo esc_url( LOGINPRESS_DIR_URL . 'img/addons/hide-login.png' ); ?>"
395 class="loginpress_addons_thumbnails"><span><?php echo esc_html( 'Hide Login' ); ?></span></h3>
396 </a>
397
398 <p><?php echo esc_html( 'This LoginPress add-on lets you change the login page URL to anything you want. It will give a hard time to spammers who keep hitting to your login page. This is helpful for Brute force attacks. One caution to use this add-on is you need to remember the custom login url after you change it. We have an option to email your custom login url so you remember it.' ); ?>
399 </p>
400 <p>
401 <a target="_blank"
402 href="https://loginpress.pro/pricing/?utm_source=loginpress-lite&amp;utm_medium=addons-coming-soon&amp;utm_campaign=pro-upgrade"
403 class="button-primary"><?php echo esc_html( 'UPGRADE NOW' ); ?></a>
404 </p>
405 </div>
406 </div>
407 <?php
408 }
409 }
410 endif;
411