PluginProbe
Loginizer / 1.3.0
Loginizer v1.3.0
2.1.0 2.0.9 2.0.8 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 74 releases
← All changes | init.php +30 -266 1.3.21.3.0 View file →
@@ -4,13 +4,12 @@
4 4 echo 'You are not allowed to access this page directly.';
5 5 exit;
6 6 }
7 7
8 -define('LOGINIZER_VERSION', '1.3.2');
8 +define('LOGINIZER_VERSION', '1.3.0');
9 9 define('LOGINIZER_DIR', WP_PLUGIN_DIR.'/'.basename(dirname(LOGINIZER_FILE)));
10 10 define('LOGINIZER_URL', plugins_url('', LOGINIZER_FILE));
11 11 define('LOGINIZER_PRO_URL', 'https://loginizer.com/features#compare');
12 -define('LOGINIZER_DOCS', 'https://loginizer.com/wiki/');
13 12
14 13 include_once(LOGINIZER_DIR.'/functions.php');
15 14
16 15 // Ok so we are now ready to go
@@ -174,16 +173,11 @@
174 173
175 174 // Check if the installed version is outdated
176 175 loginizer_update_check();
177 176
178 - // Set the array
177 + $options = get_option('loginizer_options');
178 +
179 179 $loginizer = array();
180 -
181 - // The IP Method to use
182 - $loginizer['ip_method'] = get_option('loginizer_ip_method');
183 -
184 - // Load settings
185 - $options = get_option('loginizer_options');
186 180 $loginizer['max_retries'] = empty($options['max_retries']) ? 3 : $options['max_retries'];
187 181 $loginizer['lockout_time'] = empty($options['lockout_time']) ? 900 : $options['lockout_time']; // 15 minutes
188 182 $loginizer['max_lockouts'] = empty($options['max_lockouts']) ? 5 : $options['max_lockouts'];
189 183 $loginizer['lockouts_extend'] = empty($options['lockouts_extend']) ? 86400 : $options['lockouts_extend']; // 24 hours
@@ -235,148 +229,13 @@
235 229 // Include the file
236 230 include_once(LOGINIZER_DIR.'/premium.php');
237 231
238 232 loginizer_security_init();
239 -
240 - // Its the free version
241 - }else{
242 233
243 - // The promo time
244 - $loginizer['promo_time'] = get_option('loginizer_promo_time');
245 - if(empty($loginizer['promo_time'])){
246 - $loginizer['promo_time'] = time();
247 - update_option('loginizer_promo_time', $loginizer['promo_time']);
248 - }
249 -
250 - // Are we to show the loginizer promo
251 - if(!empty($loginizer['promo_time']) && $loginizer['promo_time'] > 0 && $loginizer['promo_time'] < (time() - (30*24*3600))){
252 -
253 - add_action('admin_notices', 'loginizer_promo');
254 -
255 - }
256 -
257 - // Are we to disable the promo
258 - if(isset($_GET['loginizer_promo']) && (int)$_GET['loginizer_promo'] == 0){
259 - update_option('loginizer_promo_time', (0 - time()) );
260 - die('DONE');
261 - }
262 -
263 234 }
264 235
265 236 }
266 237
267 -// Show the promo
268 -function loginizer_promo(){
269 -
270 - echo '
271 -<style>
272 -.lz_button {
273 -background-color: #4CAF50; /* Green */
274 -border: none;
275 -color: white;
276 -padding: 8px 16px;
277 -text-align: center;
278 -text-decoration: none;
279 -display: inline-block;
280 -font-size: 16px;
281 -margin: 4px 2px;
282 --webkit-transition-duration: 0.4s; /* Safari */
283 -transition-duration: 0.4s;
284 -cursor: pointer;
285 -}
286 -
287 -.lz_button:focus{
288 -border: none;
289 -color: white;
290 -}
291 -
292 -.lz_button1 {
293 -color: white;
294 -background-color: #4CAF50;
295 -border:3px solid #4CAF50;
296 -}
297 -
298 -.lz_button1:hover {
299 -box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
300 -color: white;
301 -border:3px solid #4CAF50;
302 -}
303 -
304 -.lz_button2 {
305 -color: white;
306 -background-color: #0085ba;
307 -}
308 -
309 -.lz_button2:hover {
310 -box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
311 -color: white;
312 -}
313 -
314 -.lz_button3 {
315 -color: white;
316 -background-color: #365899;
317 -}
318 -
319 -.lz_button3:hover {
320 -box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
321 -color: white;
322 -}
323 -
324 -.lz_button4 {
325 -color: white;
326 -background-color: rgb(66, 184, 221);
327 -}
328 -
329 -.lz_button4:hover {
330 -box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
331 -color: white;
332 -}
333 -
334 -.loginizer_promo-close{
335 -float:right;
336 -text-decoration:none;
337 -margin: 5px 10px 0px 0px;
338 -}
339 -
340 -.loginizer_promo-close:hover{
341 -color: red;
342 -}
343 -</style>
344 -
345 -<script>
346 -jQuery(document).ready( function() {
347 - (function($) {
348 - $("#loginizer_promo .loginizer_promo-close").click(function(){
349 - var data;
350 -
351 - // Hide it
352 - $("#loginizer_promo").hide();
353 -
354 - // Save this preference
355 - $.post("'.admin_url('?loginizer_promo=0').'", data, function(response) {
356 - //alert(response);
357 - });
358 - });
359 - })(jQuery);
360 -});
361 -</script>
362 -
363 -<div class="notice notice-success" id="loginizer_promo" style="min-height:120px">
364 - <a class="loginizer_promo-close" href="javascript:" aria-label="Dismiss this Notice">
365 - <span class="dashicons dashicons-dismiss"></span> Dismiss
366 - </a>
367 - <img src="'.LOGINIZER_URL.'/loginizer-200.png" style="float:left; margin:10px 20px 10px 10px" width="100" />
368 - <p style="font-size:16px">We are glad you like Loginizer and have been using it since the past few days. It is time to take the next step </p>
369 - <p>
370 - <a class="lz_button lz_button1" target="_blank" href="https://loginizer.com/features">Upgrade to Pro</a>
371 - <a class="lz_button lz_button2" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/loginizer">Rate it 5★\'s</a>
372 - <a class="lz_button lz_button3" target="_blank" href="https://www.facebook.com/Loginizer-815504798591884/">Like Us on Facebook</a>
373 - <a class="lz_button lz_button4" target="_blank" href="https://twitter.com/home?status='.rawurlencode('I use @loginizer to secure my #WordPress site - https://loginizer.com').'">Tweet about Loginizer</a>
374 - </p>
375 -</div>';
376 -
377 -}
378 -
379 238 // Should return NULL if everything is fine
380 239 function loginizer_wp_authenticate($user, $username, $password){
381 240
382 241 global $loginizer, $lz_error, $lz_cannot_login, $lz_user_pass;
@@ -396,16 +255,8 @@
396 255 $lz_cannot_login = 1;
397 256 return new WP_Error('ip_blacklisted', implode('', $lz_error), 'loginizer');
398 257 }
399 258
400 - // Is the username blacklisted ?
401 - if(function_exists('loginizer_user_blacklisted')){
402 - if(loginizer_user_blacklisted($username)){
403 - $lz_cannot_login = 1;
404 - return new WP_Error('user_blacklisted', implode('', $lz_error), 'loginizer');
405 - }
406 - }
407 -
408 259 if(loginizer_can_login()){
409 260 return $user;
410 261 }
411 262
@@ -732,10 +583,8 @@
732 583 <table cellpadding="2" cellspacing="1" width="100%" class="fixed" border="0">
733 584 <tr>
734 585 <td valign="top"><h3>'.$title.'</h3></td>
735 586 <td align="right"><a target="_blank" class="button button-primary" href="https://wordpress.org/support/view/plugin-reviews/loginizer">Review Loginizer</a></td>
736 - <td align="right" width="40"><a target="_blank" href="https://twitter.com/loginizer"><img src="'.LOGINIZER_URL.'/twitter.png" /></a></td>
737 - <td align="right" width="40"><a target="_blank" href="https://www.facebook.com/Loginizer-815504798591884"><img src="'.LOGINIZER_URL.'/facebook.png" /></a></td>
738 587 </tr>
739 588 </table>
740 589 <hr />
741 590
@@ -779,9 +628,9 @@
779 628
780 629 echo '
781 630 <div class="postbox" style="min-width:0px !important;">
782 631 <h2 class="hndle ui-sortable-handle">
783 - <span>Recommendations</span>
632 + <span>Recommedations</span>
784 633 </h2>
785 634 <div class="inside">
786 635 <i>We recommed that you enable atleast one of the following security features</i>:<br>
787 636 <ul class="lz-right-ul">
@@ -789,9 +638,8 @@
789 638 <li>Login Challenge Question</li>
790 639 <li>reCAPTCHA</li>
791 640 <li>Two Factor Auth - Email</li>
792 641 <li>Two Factor Auth - App</li>
793 - <li>Change \'admin\' Username</li>
794 642 </ul>
795 643 </div>
796 644 </div>';
797 645 }
@@ -830,9 +678,9 @@
830 678 // The Loginizer Admin Options Page
831 679 function loginizer_page_dashboard(){
832 680
833 681 global $loginizer, $lz_error, $lz_env;
834 -
682 +
835 683 // Is there a license key ?
836 684 if(isset($_POST['save_lz'])){
837 685
838 686 $license = lz_optpost('lz_license');
@@ -865,20 +713,8 @@
865 713 }
866 714
867 715 }
868 716
869 -
870 - // Is there a IP Method ?
871 - if(isset($_POST['save_lz_ip_method'])){
872 -
873 - $ip_method = (int) lz_optpost('lz_ip_method');
874 -
875 - if($ip_method >= 0 && $ip_method <= 2){
876 - update_option('loginizer_ip_method', $ip_method);
877 - }
878 -
879 - }
880 -
881 717 loginizer_page_dashboard_T();
882 718
883 719 }
884 720
@@ -908,9 +744,9 @@
908 744 }
909 745 </style>
910 746
911 747 <?php
912 - echo '<script src="https://api.loginizer.com/'.(defined('LOGINIZER_PREMIUM') ? 'news_security.js' : 'news.js').'"></script><br>';
748 + echo '<script src="http://api.loginizer.com/'.(defined('LOGINIZER_PREMIUM') ? 'news_security.js' : 'news.js').'"></script><br>';
913 749
914 750 // Saved ?
915 751 if(!empty($GLOBALS['lz_saved'])){
916 752 echo '<div id="message" class="updated"><p>'. __('The settings were saved successfully', 'loginizer'). '</p></div><br />';
@@ -1016,19 +852,9 @@
1016 852 <td>'.$_SERVER['SERVER_ADDR'].'</td>
1017 853 </tr>
1018 854 <tr>
1019 855 <th align="left">'.__('Your IP Address', 'loginizer').'</th>
1020 - <td>'.lz_getip().'
1021 - <div style="float:right">
1022 - Method :
1023 - <select name="lz_ip_method" style="font-size:11px; width:150px">
1024 - <option value="0" '.lz_POSTselect('lz_ip_method', 0, (@$loginizer['ip_method'] == 0)).'>REMOTE_ADDR</option>
1025 - <option value="1" '.lz_POSTselect('lz_ip_method', 1, (@$loginizer['ip_method'] == 1)).'>HTTP_X_FORWARDED_FOR</option>
1026 - <option value="2" '.lz_POSTselect('lz_ip_method', 2, (@$loginizer['ip_method'] == 2)).'>HTTP_CLIENT_IP</option>
1027 - </select>
1028 - <input name="save_lz_ip_method" class="button button-primary" value="Save" type="submit" />
1029 - </div>
1030 - </td>
856 + <td>'.$_SERVER['REMOTE_ADDR'].'</td>
1031 857 </tr>
1032 858 <tr>
1033 859 <th align="left">'.__('wp-config.php is writable', 'loginizer').'</th>
1034 860 <td>'.(is_writable(ABSPATH.'/wp-config.php') ? '<span style="color:red">Yes</span>' : '<span style="color:green">No</span>').'</td>
@@ -1212,56 +1038,8 @@
1212 1038 . '</p></div><br />';
1213 1039
1214 1040 }
1215 1041
1216 - // Reset All Logs
1217 - if(isset($_POST['lz_reset_all_ip'])){
1218 -
1219 - $result = $wpdb->query("DELETE FROM `".$wpdb->prefix."loginizer_logs`
1220 - WHERE `time` > 0");
1221 -
1222 - echo '<div id="message" class="updated fade"><p>'
1223 - . __('All the IP Logs have been cleared', 'loginizer')
1224 - . '</p></div><br />';
1225 - }
1226 -
1227 - // Reset Logs
1228 - if(isset($_POST['lz_reset_ips']) && is_array($_POST['lz_reset_ips'])){
1229 -
1230 - $ips = $_POST['lz_reset_ips'];
1231 -
1232 - foreach($ips as $ip){
1233 - if(!lz_valid_ip($ip)){
1234 - $error[] = 'The IP - '.$ip.' is invalid !';
1235 - }
1236 - }
1237 -
1238 - if(count($ips) < 1){
1239 - $error[] = 'There are no IPs submitted';
1240 - }
1241 -
1242 - // Should we start deleting logs
1243 - if(empty($error)){
1244 -
1245 - $result = $wpdb->query("DELETE FROM `".$wpdb->prefix."loginizer_logs`
1246 - WHERE `ip` IN ('".implode("', '", $ips)."')");
1247 -
1248 - if(empty($error)){
1249 -
1250 - echo '<div id="message" class="updated fade"><p>'
1251 - . __('The selected IP Logs have been reset', 'loginizer')
1252 - . '</p></div><br />';
1253 -
1254 - }
1255 -
1256 - }
1257 -
1258 - if(!empty($error)){
1259 - lz_report_error($error);echo '<br />';
1260 - }
1261 -
1262 - }
1263 -
1264 1042 if(isset($_POST['blacklist_iprange'])){
1265 1043
1266 1044 $start_ip = lz_optpost('start_ip');
1267 1045 $end_ip = lz_optpost('end_ip');
@@ -1495,14 +1273,11 @@
1495 1273 </p>
1496 1274 </div>
1497 1275 </form>
1498 1276
1499 - <form action="" method="post" enctype="multipart/form-data">
1500 - <?php wp_nonce_field('loginizer-options'); ?>
1501 1277 <div class="inside">
1502 1278 <table class="wp-list-table widefat fixed users" border="0">
1503 1279 <tr>
1504 - <th scope="row" valign="top" style="background:#EFEFEF;" width="20">#</th>
1505 1280 <th scope="row" valign="top" style="background:#EFEFEF;"><?php echo __('IP','loginizer'); ?></th>
1506 1281 <th scope="row" valign="top" style="background:#EFEFEF;"><?php echo __('Last Failed Attempt (DD/MM/YYYY)','loginizer'); ?></th>
1507 1282 <th scope="row" valign="top" style="background:#EFEFEF;"><?php echo __('Failed Attempts Count','loginizer'); ?></th>
1508 1283 <th scope="row" valign="top" style="background:#EFEFEF;" width="150"><?php echo __('Lockouts Count','loginizer'); ?></th>
@@ -1507,50 +1282,39 @@
1507 1282 <th scope="row" valign="top" style="background:#EFEFEF;"><?php echo __('Failed Attempts Count','loginizer'); ?></th>
1508 1283 <th scope="row" valign="top" style="background:#EFEFEF;" width="150"><?php echo __('Lockouts Count','loginizer'); ?></th>
1509 1284 </tr>
1510 1285 <?php
1511 -
1512 - if(empty($result)){
1513 - echo '
1514 - <tr>
1515 - <td colspan="4">
1516 - No Logs. You will see logs about failed login attempts here.
1517 - </td>
1518 - </tr>';
1519 - }else{
1520 - foreach($result as $ik => $iv){
1521 - $status_button = (!empty($iv['status']) ? 'disable' : 'enable');
1286 + if(empty($result)){
1522 1287 echo '
1523 1288 <tr>
1524 - <td>
1525 - <input type="checkbox" value="'.$iv['ip'].'" name="lz_reset_ips[]" />
1289 + <td colspan="4">
1290 + No Logs. You will see logs about failed login attempts here.
1526 1291 </td>
1527 - <td>
1528 - '.$iv['ip'].'
1529 - </td>
1530 - <td>
1531 - '.date('d/m/Y H:i:s', $iv['time']).'
1532 - </td>
1533 - <td>
1534 - '.$iv['count'].'
1535 - </td>
1536 - <td>
1537 - '.$iv['lockout'].'
1538 - </td>
1539 1292 </tr>';
1293 + }else{
1294 + foreach($result as $ik => $iv){
1295 + $status_button = (!empty($iv['status']) ? 'disable' : 'enable');
1296 + echo '
1297 + <tr>
1298 + <td>
1299 + '.$iv['ip'].'
1300 + </td>
1301 + <td>
1302 + '.date('d/m/Y H:i:s', $iv['time']).'
1303 + </td>
1304 + <td>
1305 + '.$iv['count'].'
1306 + </td>
1307 + <td>
1308 + '.$iv['lockout'].'
1309 + </td>
1310 + </tr>';
1311 + }
1540 1312 }
1541 - }
1542 -
1543 1313 ?>
1544 1314 </table>
1545 -
1546 - <br>
1547 - <input name="lz_reset_ip" class="button button-primary action" value="<?php echo __('Remove From Logs', 'loginizer'); ?>" type="submit" />
1548 - &nbsp; &nbsp;
1549 - <input name="lz_reset_all_ip" class="button button-primary action" value="<?php echo __('Clear All Logs', 'loginizer'); ?>" type="submit" />
1550 1315 </div>
1551 - </div>
1552 - </form>
1316 + </div>
1553 1317 <br />
1554 1318
1555 1319 <div id="" class="postbox">
1556 1320