PluginProbe ʕ •ᴥ•ʔ
SiteGuard WP Plugin / 1.0.4
SiteGuard WP Plugin v1.0.4
1.8.6 1.8.6-beta1 1.8.6-beta2 1.8.4 1.8.5 1.8.3 1.8.2 1.8.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.4.3 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.11 1.7.12 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.0-beta1 1.8.0-beta2 1.8.0-beta3 1.8.0-beta4
siteguard / classes / siteguard-base.php
siteguard / classes Last commit date
siteguard-admin-filter.php 11 years ago siteguard-base.php 11 years ago siteguard-captcha.php 11 years ago siteguard-config.php 11 years ago siteguard-disable-pingback.php 11 years ago siteguard-htaccess.php 11 years ago siteguard-login-history.php 11 years ago siteguard-login-lock.php 11 years ago siteguard-rename-login.php 11 years ago siteguard-waf-exclude-rule.php 11 years ago
siteguard-base.php
62 lines
1 <?php
2
3 function siteguard_error_log( $message ) {
4 $logfile = SITEGUARD_PATH . 'error.log';
5 $f = @fopen( $logfile, 'a+' );
6 if ( false != $f ) {
7 fwrite( $f, date_i18n( 'Y/m/d H:i:s:' ) . $message . "\n" );
8 fclose( $f );
9 }
10 }
11
12 function siteguard_error_dump( $title, $obj ) {
13 ob_start();
14 var_dump( $obj );
15 $msg = ob_get_contents( );
16 ob_end_clean( );
17 siteguard_error_log( "$title: $msg" );
18 }
19
20 class SiteGuard_Base {
21 function __construct() {
22 }
23 function is_switch_value( $value ) {
24 if ( '0' == $value || '1' == $value ) {
25 return true;
26 }
27 return false;
28 }
29 function check_module( $name, $default = false ) {
30 if ( isset( $_SERVER['SERVER_SOFTWARE'] ) ) {
31 return ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false);
32 } else {
33 return $default;
34 }
35
36 # It does not work in FastCGI well.
37 #$module = 'mod_' . $name;
38 #return apache_mod_loaded( $module, $default );
39 #if ( function_exists('phpinfo') ) {
40 # ob_start( );
41 # phpinfo(8);
42 # $phpinfo = ob_get_clean( );
43 # if ( false !== strpos( $phpinfo, $module ) ) {
44 # return true;
45 # }
46 #}
47 #return $default;
48 }
49 function is_active_plugin( $plugin ) {
50 if ( function_exists('is_plugin_active') ) {
51 return is_plugin_active( $plugin );
52 } else {
53 return in_array(
54 $plugin,
55 get_option('active_plugins')
56 );
57 }
58 }
59 }
60
61 ?>
62