Changeset 1032393
- Timestamp:
- 11/25/2014 08:23:03 AM (11 years ago)
- Location:
- wp-obfuscator/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
files/class/seraum_obf.php (modified) (1 diff)
-
wpobfuscator.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-obfuscator/trunk/README.txt
r1028213 r1032393 3 3 Tags: Security, obfuscation, wp-config.php 4 4 Requires at least: 3.5 5 Tested up to: 4.0 6 Stable tag: 0. 35 Tested up to: 4.0.1 6 Stable tag: 0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 23 23 24 24 == Changelog == 25 version 0.4 : 26 Add an obfuscation depth parameter. Tested on Wordpress v4.0.1 27 25 28 version 0.3 : 26 29 Change Seraum_Obf lib with a free non-obfuscated lib -
wp-obfuscator/trunk/files/class/seraum_obf.php
r1028213 r1032393 10 10 { 11 11 var $dic = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_/ ,.:!'=+;"; 12 function doIt($c ){$it = rand(2, 4);for($i = 0; $i < $it; $i++){ $c = $this->h($c);}return $c;}12 function doIt($c, $it){for($i = 0; $i < $it; $i++){ $c = $this->h($c);}return $c;} 13 13 function h($c) 14 14 { -
wp-obfuscator/trunk/wpobfuscator.php
r1028213 r1032393 12 12 { 13 13 add_option("wpo_state", "0"); 14 add_option("wpo_depth", "1"); 14 15 $c = base64_encode(wpo_get_config()); 15 16 add_option("wpo_config", $c); … … 25 26 $p = ABSPATH . 'wp-config.php'; 26 27 $c = wpo_get_config(); 28 $it = get_option('wpo_depth'); 27 29 $sobf = new Free_Obfusc(); 28 $o = $sobf->doIt($c );30 $o = $sobf->doIt($c, $it); 29 31 file_put_contents($p, $o); 30 32 ob_clean(); … … 43 45 delete_option('wpo_state'); 44 46 delete_option("wpo_config"); 47 delete_option("wpo_depth"); 45 48 } 46 49 ob_clean(); … … 77 80 ?> 78 81 <div class="wrap"> 79 <form method="post" action="options.php">80 <?php settings_fields('wpo_settings'); ?>82 83 81 84 <?php $state = get_option('wpo_state'); ?> 85 <?php $wpo_depth = get_option('wpo_depth'); ?> 82 86 <?php 83 87 $code = file_get_contents(ABSPATH . "wp-config.php"); … … 99 103 ?> 100 104 <p><b style="color:<?php echo $color; ?>;"><?php _e($msg); ?></b></p> 105 <div style="display:inline-block"><?php _e("Obfuscation depth :"); ?></div> 106 <form style="display:inline-block" method="post" action="options.php"> 107 <?php settings_fields('wpo_settings'); ?> 108 <input type="hidden" name="wpo_state" value="<?php if($state) echo 0; else echo 1; ?>"> 109 <select style="display:inline-block" name="wpo_depth"> 110 <option value="1" <?php if ( $wpo_depth == 1 ) echo 'selected="selected"'; ?>>1</option> 111 <option value="2" <?php if ( $wpo_depth == 2 ) echo 'selected="selected"'; ?>>2</option> 112 <option value="3" <?php if ( $wpo_depth == 3 ) echo 'selected="selected"'; ?>>3</option> 113 <option value="4" <?php if ( $wpo_depth == 4 ) echo 'selected="selected"'; ?>>4</option> 114 <option value="5" <?php if ( $wpo_depth == 5 ) echo 'selected="selected"'; ?>>5</option> 115 </select> 116 <p style="display:inline-block" class="submit"> 117 <input style="display:inline-block" type="submit" class="button-primary" value="<?php _e("Save") ?>" /> 118 </p> 119 </form> 120 121 <form method="post" action="options.php"> 122 <?php settings_fields('wpo_settings'); ?> 101 123 <input type="hidden" name="wpo_state" value="<?php echo $state; ?>"> 124 <input type="hidden" name="wpo_depth" value="<?php echo $wpo_depth; ?>"> 102 125 <p class="submit"> 103 126 <input type="submit" class="button-primary" value="<?php _e($action) ?>" /> … … 113 136 function wpo_register() 114 137 { 115 register_setting( 'wpo_settings', 'wpo_state', 'wpo_clean'); 138 register_setting( 'wpo_settings', 'wpo_depth', 'wpo_cleandepth'); 139 register_setting( 'wpo_settings', 'wpo_state', 'wpo_clean'); 140 116 141 } 117 142 function wpo_clean( $input ) … … 130 155 } 131 156 } 157 return $input; 158 } 159 function wpo_cleandepth( $input ) 160 { 161 if(!is_numeric($input)) $input = 1; 162 else if($input < 0 || $input > 5) $input = 1; 132 163 return $input; 133 164 }
Note: See TracChangeset
for help on using the changeset viewer.