Crazy Bone - Version 0.4.1

Version Description

Download this release

Release Info

Developer wokamoto
Plugin Icon wp plugin Crazy Bone
Version 0.4.1
Comparing to
See all releases

Code changes from version 0.4.0 to 0.4.1

Files changed (2) hide show
  1. plugin.php +18 -17
  2. readme.txt +1 -1
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Crazy Bone
4
  Plugin URI: https://github.com/wokamoto/crazy-bone
5
  Description: Tracks user name, time of login, IP address and browser user agent.
6
  Author: wokamoto
7
- Version: 0.4.0
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
@@ -329,7 +329,7 @@ function get_ull_info() {
329
  dataType: 'json',
330
  type: 'POST',
331
  success: function(res){
332
- <?php if (self::DEBUG_MODE) echo "tttconsole.log(res);�n" ?>
333
  if (!res.dismiss && res.IP !== res.login_IP) {
334
  jQuery('#wp-admin-bar-my-account').pointer({
335
  content: '<?php echo $caution; ?>',
@@ -494,13 +494,14 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
494
  }
495
 
496
  // Get country flag
497
- public static function get_country_flag($ip, $class = '') {
498
  list($country_name, $country_code) = self::detect_country($ip);
499
 
500
  $icon_dir = plugins_url('images/flags/', __FILE__);
501
  $style = 'width:16px;height:11px;';
502
 
503
- return self::icon_img_tag($icon_dir.strtolower($country_code).'.png', "{$country_name} ({$ip})", "{$country_name} ({$ip})", $style, $class);
 
504
  }
505
 
506
  // Get browser icon
@@ -540,20 +541,20 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
540
 
541
  $selectd = ' selected="selected"';
542
 
543
- echo '<select name="user_id">'."n";
544
- printf('<option value="%d"%s>%s</option>'."n", -1, $selected_user_id == -1 ? $selectd : '', __('All Users', self::TEXT_DOMAIN));
545
- printf('<option value="%d"%s>%s</option>'."n", 0, $selected_user_id == 0 ? $selectd : '', __('Unknown', self::TEXT_DOMAIN));
546
  $users = $wpdb->get_results("select ID, user_login from `{$wpdb->users}` order by ID");
547
  foreach((array)$users as $user) {
548
- printf('<option value="%d"%s>%s</option>'."n", $user->ID, $selected_user_id == $user->ID ? $selectd : '', $user->user_login);
549
  }
550
- echo "</select>�n";
551
 
552
- echo '<select name="status">'."n";
553
  foreach (array('', 'login', 'logout', 'login_error') as $status) {
554
- printf('<option value="%1$s"%2$s>%1$s</option>'."n", $status, $selected_status == $status ? ' selected="selected"' : '');
555
  }
556
- echo "</select>�n";
557
  }
558
 
559
  // Pagination
@@ -638,7 +639,7 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
638
  $wpdb->query($sql);
639
 
640
  $err_message = sprintf(
641
- '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>'."n",
642
  empty($err_message) ? __('Done!', self::TEXT_DOMAIN) : $err_message
643
  );
644
  }
@@ -675,7 +676,7 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
675
  <div class="wrap">
676
  <div id="icon-profile" class="icon32"></div>
677
  <h2><?php _e('Login Log', self::TEXT_DOMAIN); ?></h2>
678
- <?php echo $err_message."n"; ?>
679
 
680
  <div class="tablenav">
681
 
@@ -692,7 +693,7 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
692
  <?php if (current_user_can('manage_options')) { ?>
693
  <div class="alignleft actions">
694
  <form action="" method="post">
695
- <?php echo wp_nonce_field($nonce_action, $nonce_name, true, false) . "n"; ?>
696
  <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />
697
  <label for="truncate_date"><?php _e('Truncate Log', self::TEXT_DOMAIN);?></label>
698
  <input type="text" name="truncate_date" value="<?php echo $truncate_date;?>" size="2" style="text-align:right;" />
@@ -781,7 +782,7 @@ $errors =
781
  <?php } ?>
782
  <td class="date column-date"><?php echo $row->activity_date; ?></td>
783
  <td class="status column-status"><?php echo $row->activity_status; ?></td>
784
- <td class="ip column-ip"><?php echo trim(self::get_country_flag($row->activity_IP) . '<br>' . $row->activity_IP); ?></td>
785
  <td class="agent column-agent"><?php echo trim(self::get_browser_icon($row->activity_agent) . '<br>' . $ua); ?></td>
786
  <td class="errors column-errors"><?php echo $errors; ?></td>
787
  <td class="password column-errors"><?php echo $password; ?></td>
@@ -834,7 +835,7 @@ $errors =
834
  <div class="wrap">
835
  <div id="icon-profile" class="icon32"></div>
836
  <h2><?php _e('Summary Login Log', self::TEXT_DOMAIN); ?></h2>
837
- <?php echo $err_message."n"; ?>
838
 
839
  <div class="tablenav">
840
  <?php if (current_user_can('create_users')) { ?>
4
  Plugin URI: https://github.com/wokamoto/crazy-bone
5
  Description: Tracks user name, time of login, IP address and browser user agent.
6
  Author: wokamoto
7
+ Version: 0.4.1
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
329
  dataType: 'json',
330
  type: 'POST',
331
  success: function(res){
332
+ <?php if (self::DEBUG_MODE) echo "\t\t\tconsole.log(res);\n" ?>
333
  if (!res.dismiss && res.IP !== res.login_IP) {
334
  jQuery('#wp-admin-bar-my-account').pointer({
335
  content: '<?php echo $caution; ?>',
494
  }
495
 
496
  // Get country flag
497
+ public static function get_country_flag($ip, $class = '', $show_country_name = false) {
498
  list($country_name, $country_code) = self::detect_country($ip);
499
 
500
  $icon_dir = plugins_url('images/flags/', __FILE__);
501
  $style = 'width:16px;height:11px;';
502
 
503
+ return self::icon_img_tag($icon_dir.strtolower($country_code).'.png', "{$country_name} ({$ip})", "{$country_name} ({$ip})", $style, $class).
504
+ ($show_country_name ? "&nbsp;{$country_name}" : '');
505
  }
506
 
507
  // Get browser icon
541
 
542
  $selectd = ' selected="selected"';
543
 
544
+ echo '<select name="user_id">'."\n";
545
+ printf('<option value="%d"%s>%s</option>'."\n", -1, $selected_user_id == -1 ? $selectd : '', __('All Users', self::TEXT_DOMAIN));
546
+ printf('<option value="%d"%s>%s</option>'."\n", 0, $selected_user_id == 0 ? $selectd : '', __('Unknown', self::TEXT_DOMAIN));
547
  $users = $wpdb->get_results("select ID, user_login from `{$wpdb->users}` order by ID");
548
  foreach((array)$users as $user) {
549
+ printf('<option value="%d"%s>%s</option>'."\n", $user->ID, $selected_user_id == $user->ID ? $selectd : '', $user->user_login);
550
  }
551
+ echo "</select>\n";
552
 
553
+ echo '<select name="status">'."\n";
554
  foreach (array('', 'login', 'logout', 'login_error') as $status) {
555
+ printf('<option value="%1$s"%2$s>%1$s</option>'."\n", $status, $selected_status == $status ? ' selected="selected"' : '');
556
  }
557
+ echo "</select>\n";
558
  }
559
 
560
  // Pagination
639
  $wpdb->query($sql);
640
 
641
  $err_message = sprintf(
642
+ '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>'."\n",
643
  empty($err_message) ? __('Done!', self::TEXT_DOMAIN) : $err_message
644
  );
645
  }
676
  <div class="wrap">
677
  <div id="icon-profile" class="icon32"></div>
678
  <h2><?php _e('Login Log', self::TEXT_DOMAIN); ?></h2>
679
+ <?php echo $err_message."\n"; ?>
680
 
681
  <div class="tablenav">
682
 
693
  <?php if (current_user_can('manage_options')) { ?>
694
  <div class="alignleft actions">
695
  <form action="" method="post">
696
+ <?php echo wp_nonce_field($nonce_action, $nonce_name, true, false) . "\n"; ?>
697
  <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />
698
  <label for="truncate_date"><?php _e('Truncate Log', self::TEXT_DOMAIN);?></label>
699
  <input type="text" name="truncate_date" value="<?php echo $truncate_date;?>" size="2" style="text-align:right;" />
782
  <?php } ?>
783
  <td class="date column-date"><?php echo $row->activity_date; ?></td>
784
  <td class="status column-status"><?php echo $row->activity_status; ?></td>
785
+ <td class="ip column-ip"><?php echo trim(self::get_country_flag($row->activity_IP, '', true) . '<br>' . $row->activity_IP); ?></td>
786
  <td class="agent column-agent"><?php echo trim(self::get_browser_icon($row->activity_agent) . '<br>' . $ua); ?></td>
787
  <td class="errors column-errors"><?php echo $errors; ?></td>
788
  <td class="password column-errors"><?php echo $password; ?></td>
835
  <div class="wrap">
836
  <div id="icon-profile" class="icon32"></div>
837
  <h2><?php _e('Summary Login Log', self::TEXT_DOMAIN); ?></h2>
838
+ <?php echo $err_message."\n"; ?>
839
 
840
  <div class="tablenav">
841
  <?php if (current_user_can('create_users')) { ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJ
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
  Tested up to: 3.5.1
7
- Stable tag: 0.4.0
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10
 
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
  Tested up to: 3.5.1
7
+ Stable tag: 0.4.1
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10