SiteGuard WP Plugin - Version 1.0.2

Version Description

  • Fix a minor html escape leakage
  • Reduced the problem of affinity with other plugin [WordPress HTTPS (SSL)]
Download this release

Release Info

Developer jp-secure
Plugin Icon 128x128 SiteGuard WP Plugin
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

admin/siteguard-menu-dashboard.php CHANGED
@@ -75,7 +75,7 @@ class SiteGuard_Menu_Dashboard extends SiteGuard_Base {
75
  <form name="form1" method="post" action="">
76
  <?php echo '<h3>' . esc_html__( 'Login history', 'siteguard' ) . "</h3>\n"; ?>
77
  <?php $this->wp_list_table->display( ) ?>
78
- <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>
79
  </form>
80
  </div>
81
  <?php
75
  <form name="form1" method="post" action="">
76
  <?php echo '<h3>' . esc_html__( 'Login history', 'siteguard' ) . "</h3>\n"; ?>
77
  <?php $this->wp_list_table->display( ) ?>
78
+ <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ) ?>">
79
  </form>
80
  </div>
81
  <?php
admin/siteguard-menu-rename-login.php CHANGED
@@ -30,6 +30,20 @@ class SiteGuard_Menu_Rename_Login extends SiteGuard_Base {
30
  echo '</strong></p></div>';
31
  $error = true;
32
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  if ( 1 != preg_match( '/^[a-zA-Z0-9_-]+$/', $_POST[ $opt_name_rename_login_path ] ) ) {
34
  echo '<div class="error settings-error"><p><strong>';
35
  esc_html_e( 'It is only an alphanumeric character, a hyphen, and an underbar that can be used for New Login Path.', 'siteguard' );
30
  echo '</strong></p></div>';
31
  $error = true;
32
  }
33
+ if ( '1' == $_POST[ $opt_name_feature ] ) {
34
+ $incompatible_plugin = $rename_login->get_active_incompatible_plugin( );
35
+ if ( NULL != $incompatible_plugin ) {
36
+ echo '<div class="error settings-error"><p><strong>';
37
+ echo esc_html__( 'This function and Plugin "', 'siteguard' ) . $incompatible_plugin . esc_html__( '" cannot be used at the same time.', 'siteguard' );
38
+ echo '</strong></p></div>';
39
+ $error = true;
40
+ $config->set( $opt_name_feature, '0' );
41
+ $config->update( );
42
+ $rename_login->feature_off( );
43
+ $opt_val_feature = '0';
44
+ $opt_val_rename_login_path = stripslashes( $_POST[ $opt_name_rename_login_path ] );
45
+ }
46
+ }
47
  if ( 1 != preg_match( '/^[a-zA-Z0-9_-]+$/', $_POST[ $opt_name_rename_login_path ] ) ) {
48
  echo '<div class="error settings-error"><p><strong>';
49
  esc_html_e( 'It is only an alphanumeric character, a hyphen, and an underbar that can be used for New Login Path.', 'siteguard' );
classes/siteguard-base.php CHANGED
@@ -44,6 +44,16 @@ class SiteGuard_Base {
44
  #}
45
  #return $default;
46
  }
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
  ?>
44
  #}
45
  #return $default;
46
  }
47
+ function is_active_plugin( $plugin ) {
48
+ if ( function_exists('is_plugin_active') ) {
49
+ return is_plugin_active( $plugin );
50
+ } else {
51
+ return in_array(
52
+ $plugin,
53
+ get_option('active_plugins')
54
+ );
55
+ }
56
+ }
57
  }
58
 
59
  ?>
classes/siteguard-login-history.php CHANGED
@@ -32,7 +32,7 @@ class SiteGuard_LoginHistory extends SiteGuard_Base {
32
  if ( '' == $current_user->user_login ) {
33
  return;
34
  }
35
- $this->add_operation( SITEGUARD_LOIGN_SUCCESS, $current_user->user_login );
36
  }
37
  function handler_wp_login_failed( $username ) {
38
  global $loginlock;
32
  if ( '' == $current_user->user_login ) {
33
  return;
34
  }
35
+ $this->add_operation( SITEGUARD_LOGIN_SUCCESS, $current_user->user_login );
36
  }
37
  function handler_wp_login_failed( $username ) {
38
  global $loginlock;
classes/siteguard-rename-login.php CHANGED
@@ -6,6 +6,13 @@ class SiteGuard_RenameLogin extends SiteGuard_Base {
6
  function __construct( ) {
7
  global $config;
8
  if ( '1' == $config->get( 'renamelogin_enable' ) ) {
 
 
 
 
 
 
 
9
  $this->add_filter( );
10
  }
11
  }
@@ -15,7 +22,7 @@ class SiteGuard_RenameLogin extends SiteGuard_Base {
15
  function init( ) {
16
  global $config;
17
  $config->set( 'renamelogin_path', 'login_' . sprintf( '%05d', mt_rand( 1, 99999 ) ) );
18
- if ( $this->check_module( 'rewrite' ) ) {
19
  $config->set( 'renamelogin_enable', '1' );
20
  $config->update( );
21
  $this->feature_on( );
@@ -24,6 +31,17 @@ class SiteGuard_RenameLogin extends SiteGuard_Base {
24
  $config->update( );
25
  }
26
  }
 
 
 
 
 
 
 
 
 
 
 
27
  function add_filter( ) {
28
  add_filter( 'login_init', array( $this, 'handler_login_init' ), 10, 2 );
29
  add_filter( 'site_url', array( $this, 'handler_site_url' ), 10, 2 );
@@ -74,7 +92,9 @@ class SiteGuard_RenameLogin extends SiteGuard_Base {
74
  }
75
  function flush_rules( ) {
76
  global $wp_rewrite;
77
- $wp_rewrite->flush_rules( );
 
 
78
  }
79
  function insert_rewrite_rules( $rules ) {
80
  global $config;
@@ -117,8 +137,10 @@ class SiteGuard_RenameLogin extends SiteGuard_Base {
117
  $htaccess->update_settings( $mark, $data );
118
  }
119
  function feature_off( ) {
120
-
121
- flush_rewrite_rules( );
 
 
122
 
123
  $mark = SiteGuard_RenameLogin::get_mark( );
124
  SiteGuard_Htaccess::clear_settings( $mark );
6
  function __construct( ) {
7
  global $config;
8
  if ( '1' == $config->get( 'renamelogin_enable' ) ) {
9
+ if ( NULL != $this->get_active_incompatible_plugin( ) ) {
10
+ $config->set( 'renamelogin_enable', '0' );
11
+ $config->update( );
12
+ $this->feature_off( );
13
+ return;
14
+ }
15
+
16
  $this->add_filter( );
17
  }
18
  }
22
  function init( ) {
23
  global $config;
24
  $config->set( 'renamelogin_path', 'login_' . sprintf( '%05d', mt_rand( 1, 99999 ) ) );
25
+ if ( $this->check_module( 'rewrite' ) && NULL == $this->get_active_incompatible_plugin( ) ) {
26
  $config->set( 'renamelogin_enable', '1' );
27
  $config->update( );
28
  $this->feature_on( );
31
  $config->update( );
32
  }
33
  }
34
+ function get_active_incompatible_plugin( ) {
35
+ $incompatible_plugins = array(
36
+ 'WordPress HTTPS (SSL)' => 'wordpress-https/wordpress-https.php',
37
+ );
38
+ foreach ( $incompatible_plugins as $name => $path ) {
39
+ if ( $this->is_active_plugin( $path ) ) {
40
+ return $name;
41
+ }
42
+ }
43
+ return NULL;
44
+ }
45
  function add_filter( ) {
46
  add_filter( 'login_init', array( $this, 'handler_login_init' ), 10, 2 );
47
  add_filter( 'site_url', array( $this, 'handler_site_url' ), 10, 2 );
92
  }
93
  function flush_rules( ) {
94
  global $wp_rewrite;
95
+ if ( is_object( $wp_rewrite ) ) {
96
+ $wp_rewrite->flush_rules( );
97
+ }
98
  }
99
  function insert_rewrite_rules( $rules ) {
100
  global $config;
137
  $htaccess->update_settings( $mark, $data );
138
  }
139
  function feature_off( ) {
140
+ global $wp_rewrite;
141
+ if ( is_object( $wp_rewrite ) ) {
142
+ flush_rewrite_rules( );
143
+ }
144
 
145
  $mark = SiteGuard_RenameLogin::get_mark( );
146
  SiteGuard_Htaccess::clear_settings( $mark );
languages/siteguard-ja.mo CHANGED
Binary file
languages/siteguard-ja.po CHANGED
@@ -36,6 +36,12 @@ msgid "To use this function, “mod_rewrite” should be loaded on Apache."
36
  msgstr ""
37
  "この機能を使用するには、mod_rewriteがサーバーにロードされている必要があります。"
38
 
 
 
 
 
 
 
39
  #: admin/siteguard-menu-admin-filter.php:42
40
  #: admin/siteguard-menu-captcha.php:38
41
  #: admin/siteguard-menu-disable-pingback.php:17
@@ -585,7 +591,7 @@ msgid ""
585
  "SiteGurad WP Plugin is the plugin specialized for the protection against the attack to the management page and login. "
586
  "It also have the function to create the exclude rule for WAF (SiteGuard Lite, to use it, WAF should be installed on the Web server.)"
587
  msgstr ""
588
- "SiteGuard WP Pluginは、WordPressにインストールするだけで、セキュリティを向上することができます。"
589
  "SiteGurad WP Pluginは、管理ページとログインに関する攻撃からの防御に特化したセキュリティプラグインです。"
590
  "WAF ( SiteGuard Lite )の除外ルールを作成する機能もあります。( 使用するにはWAFがWebサーバーにインストールされている必要があります )"
591
 
36
  msgstr ""
37
  "この機能を使用するには、mod_rewriteがサーバーにロードされている必要があります。"
38
 
39
+ msgid "This function and Plugin \""
40
+ msgstr "この機能を、プラグイン \""
41
+
42
+ msgid "\" cannot be used at the same time."
43
+ msgstr "\" と同時に使用することはできません。"
44
+
45
  #: admin/siteguard-menu-admin-filter.php:42
46
  #: admin/siteguard-menu-captcha.php:38
47
  #: admin/siteguard-menu-disable-pingback.php:17
591
  "SiteGurad WP Plugin is the plugin specialized for the protection against the attack to the management page and login. "
592
  "It also have the function to create the exclude rule for WAF (SiteGuard Lite, to use it, WAF should be installed on the Web server.)"
593
  msgstr ""
594
+ "SiteGuard WP Pluginは、WordPressにインストールするだけで、セキュリティを向上させることができます。"
595
  "SiteGurad WP Pluginは、管理ページとログインに関する攻撃からの防御に特化したセキュリティプラグインです。"
596
  "WAF ( SiteGuard Lite )の除外ルールを作成する機能もあります。( 使用するにはWAFがWebサーバーにインストールされている必要があります )"
597
 
readme.txt CHANGED
@@ -4,18 +4,16 @@ Donate link: -
4
  Tags: security, waf
5
  Requires at least: 3.9
6
  Tested up to: 4.0
7
- Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Only installing SiteGuard WP Plugin on WordPress, its security can be improved.
12
  SiteGurad WP Plugin is the plugin specialized for the protection against the attack to the management page and login.
13
- It also have the function to create the exclude rule for WAF (SiteGuard Lite, to use it, WAF should be installed on the Web server.)
14
 
15
  == Description ==
16
 
17
- Simply install the SiteGuard-WP-Plugin, WordPress security is improved.
18
- This plug-in is a security plug-in that specializes in the login attack of brute force, such as protection and management capabilities.
19
 
20
  Notes
21
 
@@ -83,8 +81,10 @@ By creating the WAF exclude rule, the WAF protection function can be activated w
83
  http://www.jp-secure.com/cont/products/siteguard_wp_plugin/faq_en.html
84
 
85
  == Changelog ==
86
-
 
 
87
  = 1.0.1 =
88
- * Tested with WP 4.0.
89
  = 1.0.0 =
90
- * First release.
4
  Tags: security, waf
5
  Requires at least: 3.9
6
  Tested up to: 4.0
7
+ Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
 
11
  SiteGurad WP Plugin is the plugin specialized for the protection against the attack to the management page and login.
 
12
 
13
  == Description ==
14
 
15
+ Simply install the SiteGuard WP Plugin, WordPress security is improved.
16
+ This plugin is a security plugin that specializes in the login attack of brute force, such as protection and management capabilities.
17
 
18
  Notes
19
 
81
  http://www.jp-secure.com/cont/products/siteguard_wp_plugin/faq_en.html
82
 
83
  == Changelog ==
84
+ = 1.0.2 =
85
+ * Fix a minor html escape leakage
86
+ * Reduced the problem of affinity with other plugin [WordPress HTTPS (SSL)]
87
  = 1.0.1 =
88
+ * Supported with WP 4.0
89
  = 1.0.0 =
90
+ * First release
siteguard.php CHANGED
@@ -7,10 +7,10 @@ Author: JP-Secure
7
  Author URI: http://www.jp-secure.com/eng/
8
  Text Domain: siteguard
9
  Domain Path: /languages/
10
- Version: 1.0.1
11
  */
12
 
13
- /* Copyright 2014 JP-Secure Inc (email : support@jp-secure.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
7
  Author URI: http://www.jp-secure.com/eng/
8
  Text Domain: siteguard
9
  Domain Path: /languages/
10
+ Version: 1.0.2
11
  */
12
 
13
+ /* Copyright 2014 JP-Secure Inc
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as