-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaskepott.php
548 lines (507 loc) · 23 KB
/
askepott.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
<?php
/*
Plugin Name: askepott
Plugin URI: https://github.com/glastopf/askepott
Description: Wordpress WAF plug-in with some magic
Version: 0.1
Author: Askepott Team
Author URI: https://github.com/glastopf/askepott
Updated: December 13, 2012
Copyright 2012 Askepott Team (email: [email protected])
This source file is subject to version 3.0 of the PHP license,
that is bundled with this package in the file LICENSE, and is
available at through the world-wide-web at http://www.php.net/license/3_0.txt.
If you did not receive a copy of the PHP license and are unable
to obtain it through the world-wide-web, please send a note to
[email protected] so we can mail you a copy immediately.
Inspired by: http://wordpress.org/extend/plugins/wordpress-firewall-2/
*/
// Prevent direct file access to the firewall
if(preg_match("#^askepott.php#", basename($_SERVER['PHP_SELF']))) {
exit();
}
add_option('askepott_redirect_page', 'homepage');
add_option('askepott_exclude_directory', 'allow');
add_option('askepott_exclude_queries', 'allow');
add_option('askepott_exclude_terms', 'allow');
add_option('askepott_exclude_spaces', 'allow');
add_option('askepott_exclude_file', 'allow');
add_option('askepott_exclude_http', 'disallow');
add_option('askepott_email_enable', 'enable');
add_option('askepott_email_type', 'html');
add_option('askepott_email_address', get_option('admin_email'));
add_option('askepott_whitelisted_ip',
serialize(array('0' => $_SERVER['REMOTE_ADDR']))
);
add_option('askepott_whitelisted_page', '');
add_option('askepott_whitelisted_variable', '');
add_option('askepott_plugin_url', get_option('siteurl') . '/wp-admin/options-general.php?page=' . basename(__FILE__));
add_option('askepott_default_whitelisted_page',
serialize(
array(
array(
'.*/wp-comments-post\.php',
array('url', 'comment')
),
array(
'.*/wp-admin/.*',
array(
'_wp_original_http_referer',
'_wp_http_referer'
)
),
array(
'.*wp-login.php',
array('redirect_to')
),
array(
'.*',
array(
'comment_author_url_.*',
'__utmz'
)
),
'.*/wp-admin/options-general\.php',
'.*/wp-admin/post-new\.php',
'.*/wp-admin/page-new\.php',
'.*/wp-admin/link-add\.php',
'.*/wp-admin/post\.php',
'.*/wp-admin/page\.php',
'.*/wp-admin/admin-ajax.php'
)
)
);
add_option('askepott_previous_attack_var', '');
add_option('askepott_previous_attack_ip', '');
add_option('askepott_email_limit', 'off');
if (!function_exists('array_diff_key')) {
function array_diff_key()
{
$args = func_get_args();
if (count($args) < 2) {
user_error('Wrong parameter count for array_diff_key()', E_USER_WARNING);
return;
}
$array_count = count($args);
for ($i = 0; $i !== $array_count; $i++) {
if (!is_array($args[$i])) {
user_error('array_diff_key() Argument #' .
($i + 1) . ' is not an array', E_USER_WARNING);
return;
}
}
$result = $args[0];
foreach ($args[0] as $key1 => $value1) {
for ($i = 1; $i !== $array_count; $i++) {
foreach ($args[$i] as $key2 => $value2) {
if ((string) $key1 === (string) $key2) {
unset($result[$key2]);
break 2;
}
}
}
}
return $result;
}
}
function askepott_recursive_flatten($array, &$newArray, $prefix='', $delimiter='][', $level=0) {
foreach($array as $key => $child) {
if (is_array($child)) {
$newPrefix = $prefix . $key . $delimiter;
if($level == 0) {
$newPrefix = $key . '[';
}
$newArray =& askepott_recursive_flatten($child, $newArray, $newPrefix, $delimiter, $level+1);
} else {
(!$level) ? $post='' : $post=']';
$newArray[$prefix . $key . $post] = $child;
}
}
return $newArray;
}
function askepott_check_default_whitelist($page_name, $new_arr) {
foreach(unserialize(get_option('askepott_default_whitelisted_page')) as $whitelisted_page) {
if(!is_array($whitelisted_page)) {
if(preg_match('#^' . $whitelisted_page . '$#', $page_name)) {
$new_arr = false;
}
} else {
if(preg_match('#^' . $whitelisted_page[0] . '$#', $page_name)) {
foreach($whitelisted_page[1] as $whitelisted_variable) {
foreach(array_keys($new_arr) as $var) {
if(preg_match('#^' . $whitelisted_variable . '$#', $var)) {
$new_arr = array_diff_key($new_arr,array($var=>''));
}
}
}
}
}
}
return $new_arr;
}
function askepott_check_whitelist($new_arr) {
$pages = unserialize(get_option('askepott_whitelisted_page'));
$variables = unserialize(get_option('askepott_whitelisted_variable'));
$count = 0;
while($count < sizeof($pages)) {
$page_regex = preg_quote($pages[$count], '#');
$page_regex = str_replace('\*', '.*', $page_regex);
$var_regex = preg_quote($variables[$count], '#');
$var_regex = str_replace('\*', '.*', $var_regex);
if( $variables[$count] != '') {
if(($pages[$count] == '') || (preg_match('#^' . $page_regex . '$#', $page_name))) {
$temp_arr = $new_arr;
foreach(array_keys($new_arr) as $var) {
if(preg_match('#^' . $var_regex . '$#', $var)) {
$new_arr = array_diff_key($new_arr, array($var=>''));
}
}
}
} elseif($pages[$count] != '') {
if(preg_match('#^' . $page_regex . '$#', $page_name)) {
return false;
}
}
$count++;
}
return $new_arr;
}
function askepott_get_request() {
preg_match('#([^?]+)?.*$#', $_SERVER['REQUEST_URI'], $url);
$page_name = $url[1];
$_a = array();
$new_arr = askepott_recursive_flatten($_REQUEST, $_a);
$new_arr = askepott_check_default_whitelist($page_name, $new_arr);
if ($new_arr) {
$new_arr = askepott_check_whitelist($new_arr);
}
return $new_arr;
}
function askepott_check_ip_whitelist() {
$current_ip = $_SERVER['REMOTE_ADDR'];
$ips = unserialize(get_option('askepott_whitelisted_ip'));
if(is_array($ips)) {
foreach($ips as $ip) {
if(($current_ip == $ip) || ($current_ip == gethostbyname($ip))) {
return true;
}
}
}
return false;
}
function askepottl_send_log_message($bad_variable = '', $bad_value = '', $attack_type = '', $attack_category = '') {
$bad_variable = htmlentities($bad_variable);
$bad_value = htmlentities($bad_value);
$offender_ip = $_SERVER['REMOTE_ADDR'];
// Missing Stuff
}
function askepott_send_redirect() {
$home_url = get_option('siteurl');
if(get_option('askepott_redirect_page') == '404page') {
// Not clear if just including the 404 template is safe.
// Not sure why it wouldn't be safe, but better safe than sorry...?
// 404 could contain errors relaying info which could be useful to attacker...?
header ("Location: $home_url/404/");
exit();
} else {
header ("Location: $home_url");
exit();
}
}
function askepott_check_attack_types() {
$request_string = askepott_get_request();
if($request_string == false) {
// Nothing to do, all white listed
} else {
// Directory traversal - check directories
if(get_option('askepott_exclude_directory') == 'allow') {
$exclude_terms = array('#etc/passwd#', '#proc/self/environ#', '#\.\./#');
foreach($exclude_terms as $preg) {
foreach($request_string as $key=>$value) {
if(preg_match($preg, $value)) {
if(!askepott_check_ip_whitelist()) {
askepottl_send_log_message($key, $value, 'directory-traversal-attack', 'Directory Traversal');
askepott_send_redirect();
}
}
}
}
}
// SQL injection - check queries
if(get_option('askepott_exclude_queries') == 'allow') {
$exclude_terms = array('#concat\s*\(#i', '#group_concat#i', '#union.*select#i');
foreach($exclude_terms as $preg) {
foreach($request_string as $key=>$value) {
if(preg_match($preg, $value)) {
if(!askepott_check_ip_whitelist()) {
askepottl_send_log_message($key, $value, 'sql-injection-attack', 'SQL Injection');
askepott_send_redirect();
}
}
}
}
}
// WP SQL injection - check wp terms
if(get_option('askepott_exclude_terms') == 'allow') {
$exclude_terms = array('#wp_#i', '#user_login#i', '#user_pass#i', '#0x[0-9a-f][0-9a-f]#i', '#/\*\*/#');
foreach($exclude_terms as $preg) {
foreach($request_string as $key=>$value) {
if(preg_match($preg, $value)) {
if(!askepott_check_ip_whitelist()) {
askepottl_send_log_message($key, $value, 'wp-specific-sql-injection-attack', 'WordPress-Specific SQL Injection');
askepott_send_redirect();
}
}
}
}
}
// Field truncation - check ... not sure yet
if(get_option('askepott_exclude_spaces') == 'allow') {
$exclude_terms = array('#\s{49,}#i','#\x00#');
foreach($exclude_terms as $preg) {
foreach($request_string as $key=>$value) {
if(preg_match('#\s{49,}#i', $value)) {
if(!askepott_check_ip_whitelist()) {
askepottl_send_log_message($key, $value, 'field-truncation-attack', 'Field Truncation');
askepott_send_redirect();
}
}
}
}
}
// Block executable file upload - check exluded file types
if(get_option('askepott_exclude_file') == 'allow') {
foreach ($_FILES as $file) {
$file_extensions =
array(
'#\.dll$#i', '#\.rb$#i', '#\.py$#i', '#\.exe$#i', '#\.php[3-6]?$#i', '#\.pl$#i',
'#\.perl$#i', '#\.ph[34]$#i', '#\.phl$#i', '#\.phtml$#i', '#\.phtm$#i'
);
foreach($file_extensions as $regex) {
if(preg_match($regex, $file['name'])) {
// no ip check, should there be one?
askepottl_send_log_message('$_FILE', $file['name'], 'executable-file-upload-attack', 'Executable File Upload');
askepott_send_redirect();
}
}
}
}
// Block remote file execution - check for leading http/https
// This can be problematic with many plugins, as it'll break requests
// starting with http/https, however, may be still be useful
if(get_option('askepott_exclude_http') == 'allow') {
$exclude_terms = array('#^http#i', '#\.shtml#i');
foreach($exclude_terms as $preg) {
foreach($request_string as $key=>$value) {
if(preg_match($preg, $value)) {
if(!askepott_check_ip_whitelist()) {
askepottl_send_log_message($key, $value, 'remote-file-execution-attack', 'Remote File Execution');
askepott_send_redirect();
}
}
}
}
}
}
}
askepott_check_attack_types();
function askepott_assert_first() {
$active_plugs = (get_option('active_plugins'));
$active_plugs = array_diff($active_plugs, array("askepott.php"));
array_unshift($active_plugs, "askepott.php");
}
function askepott_admin_menu() {
add_submenu_page('options-general.php', 'Askepott', 'Askepott', 10, __FILE__, 'askepott_submenu');
}
add_action('admin_menu', 'askepott_admin_menu');
function add_settings_link($links, $file) {
static $this_plugin;
if(!$this_plugin) {
$this_plugin = plugin_basename(__FILE__);
}
if($file == $this_plugin) {
$settings_link = '<a href="options-general.php?page=' . $this_plugin . '">' . __("Settings", "askeputt") . '</a>';
array_unshift($links, $settings_link);
}
return $links;
}
add_filter('plugin_action_links', 'add_settings_link', 10, 2);
function askepott_submenu() {
askepott_assert_first();
$action_url = $_SERVER['REQUEST_URI'];
if ($_REQUEST['set_exclusions']) {
update_option('askepott_redirect_page', $_REQUEST['redirect_type']);
update_option('askepott_exclude_directory', $_REQUEST['block_directory']);
update_option('askepott_exclude_queries', $_REQUEST['block_queries']);
update_option('askepott_exclude_terms', $_REQUEST['block_terms']);
update_option('askepott_exclude_spaces', $_REQUEST['block_spaces']);
update_option('askepott_exclude_file', $_REQUEST['block_file']);
update_option('askepott_exclude_http', $_REQUEST['block_http']);
echo '<div class="updated fade"><p>Security Filters and Redirect page updated.</p></div>';
} elseif($_REQUEST['turn_off_email']) {
update_option('askepott_email_address', '');
$action_url = str_replace('&turn_off_email=1', '', $_SERVER['REQUEST_URI']);
echo '<div class="updated fade"><p>Emails are now turned off.</p></div>';
} elseif($_REQUEST['set_whitelist_variable']) {
echo '<div class="updated fade"><p>Whitelisted ' . $_REQUEST['set_whitelist_variable'] . '</p></div>';
$pages = unserialize(get_option('askepott_whitelisted_page'));
$variables = unserialize(get_option('askepott_whitelisted_variable'));
$pages[] = '';
$variables[] = $_REQUEST['set_whitelist_variable'];
update_option('askepott_whitelisted_page', serialize($pages));
update_option('askepott_whitelisted_variable', serialize($variables));
$action_url = str_replace(('&set_whitelist_variable=' . $_REQUEST['set_whitelist_variable']), '', $_SERVER['REQUEST_URI']);
echo '<div class="updated fade"><p>Whitelisted Variable set.</p></div>';
} elseif($_REQUEST['set_email']) {
update_option('askepott_email_address', $_REQUEST['email_address']);
update_option('askepott_email_limit', $_REQUEST['email_limit']);
update_option('askepott_email_type', $_REQUEST['email_type']);
echo '<div class="updated fade"><p>Email settings updated.</p></div>';
} elseif($_REQUEST['set_whitelist_ip']) {
update_option('askepott_whitelisted_ip', serialize($_REQUEST['whitelisted_ip']));
echo '<div class="updated fade"><p>Whitelisted IP set.</p></div>';
} elseif($_REQUEST['set_whitelist_page']) {
update_option('askepott_whitelisted_page', serialize($_REQUEST['whitelist_page']));
update_option('askepott_whitelisted_variable', serialize($_REQUEST['whitelist_variable']));
echo '<div class="updated fade"><p>Whitelisted Page set.</p></div>';
} elseif($_REQUEST['suppress'] === '0') {
update_option('askepott_email_limit', 'off');
echo '<div class="updated fade"><p>Email limit set.</p></div>';
$action_url = str_replace('&suppress=0', '', $_SERVER['REQUEST_URI']);
}
?>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
<h2>Firewall Options:</h2>
<form name="set-exclusion-options" action="<?php echo $action_url; ?>" method="post" class="widefat" style="padding:0 0 20px; margin:20px 0 0;">
<div style="padding:0 20px;">
<h3>Apply Security Filters:</h3>
<p><input type="checkbox" value="allow" name="block_directory" <?php echo (get_option('askepott_exclude_directory') == 'allow') ? 'checked="checked"' : '' ?> /> Block directory traversals (../, ../../etc/passwd, etc.) in application parameters.</p>
<p><input type="checkbox" value="allow" name="block_queries" <?php echo (get_option('askepott_exclude_queries') == 'allow') ? 'checked="checked"' : '' ?> /> Block SQL queries (union select, concat(, /**/, etc.) in application parameters.</p>
<p><input type="checkbox" value="allow" name="block_terms" <?php echo (get_option('askepott_exclude_terms') == 'allow') ? 'checked="checked"' : ''?> /> Block WordPress specific terms (wp_, user_login, etc.) in application parameters.</p>
<p><input type="checkbox" value="allow" name="block_spaces" <?php echo (get_option('askepott_exclude_spaces') == 'allow') ? 'checked="checked"' : '' ?> /> Block field truncation attacks in application parameters.</p>
<p><input type="checkbox" value="allow" name="block_file" <?php echo (get_option('askepott_exclude_file') == 'allow') ? 'checked="checked"' : '' ?> /> Block executable file uploads (.php, .exe, etc.)</p>
<p><input type="checkbox" value="allow" name="block_http" <?php echo (get_option('askepott_exclude_http') == 'allow') ? 'checked="checked"' : '' ?> /> Block leading http:// and https:// in application parameters (<em>off</em> by default; may cause problems with many plugins).</p>
<h4>Upon Detecting Attack:</h4>
<table border="0" cellpadding="0" cellspacing="0" style="width:260px; margin-top:0; padding:0;">
<tr>
<td><strong>Show 404 Error Page:</strong></td>
<td><input type="radio" name="redirect_type" value="404page" <?php echo (get_option('askepott_redirect_page') == '404page') ? 'checked="checked"' : '' ?> /></td>
</tr>
<tr>
<td><strong>Redirect To Homepage:</strong></td>
<td><input type="radio" name="redirect_type" value="homepage" <?php echo (get_option('askepott_redirect_page') == 'homepage') ? 'checked="checked"' : '' ?> /></td>
</tr>
</table>
<p style="margin-top:5px;"><small><em>Note: All filters are subject to "Whitelisted IPs" and "Whitelisted Pages" below.</em></small></p>
<input type="submit" name="set_exclusions" value="Set Security Filters" class="button-secondary" />
</div>
</form>
<form name="email_address" action="<?php echo $action_url; ?>" method="post" class="widefat" style="padding:0 0 20px; margin:20px 0 0;">
<div style="padding:0 20px;">
<h3>Email:</h3>
<p><strong>Enter an email address for attack reports:</strong></p>
<input type="text" value="<?php echo get_option('askepott_email_address') ?>" name="email_address" />
<p style="margin-top:5px;"><small><em>Note: Leave this setting blank to disable emails.</em></small></p>
<p><strong>Email type:</strong> <input type="radio" name="email_type" value="html"<?php echo (get_option('askepott_email_type') == 'html') ? 'checked="checked"' : '' ?> />html <input type="radio" name="email_type" value="text" <?php echo (get_option('askepott_email_type') == 'text') ? 'checked="checked"' : '' ?> />text</p>
<p><strong>Suppress similar attack warning emails:</strong> <input type="radio" name="email_limit" value="on"<?php echo (get_option('askepott_email_limit') == 'on') ? 'checked="checked"' : '' ?> />On <input type="radio" name="email_limit" value="off" <?php echo (get_option('askepott_email_limit') == 'off') ? 'checked="checked"' : '' ?> />Off</p>
<input type="submit" name="set_email" value="Set Email" class="button-secondary" />
</div>
</form>
<form name="whitelist_ip" action="<?php echo $action_url; ?>" method="post" class="widefat" style="padding:0 0 20px; margin:20px 0 0;">
<div style="padding:0 20px;">
<h3>Whitelisted IPs:</h3>
<p>Enter IP(s) that are whitelisted — and not subject to security rules.</p>
<?php
if( !get_option('askepott_whitelisted_ip')) {
echo '<input type="text" value="" name="whitelisted_ip[]" /><br />';
} else {
//$ips = array_unique( unserialize(get_option('askepott_whitelisted_ip')) );
$ips_options = get_option('askepott_whitelisted_ip');
$ips_options_unserialized = unserialize($ips_options);
// Check to see if data needs to be unserialzed or not
if($ips_options_unserialized !== FALSE) {
$ips = array_unique($ips_options_unserialized);
foreach($ips as $ip){
if($ip != '') {
echo '<input type="text" value="' . $ip . '" name="whitelisted_ip[]" /><br />';
}
}
} else {
$ips = array_unique($ips_options);
foreach($ips as $ip) {
if($ip != '') {
echo '<input type="text" value="' . $ip . '" name="whitelisted_ip[]" /><br />';
}
}
}
echo '<input type="text" value="" name="whitelisted_ip[]" /><br />';
}
?>
<p style="margin-top:5px;"><small><em>Note: Set field(s) to blank to disable IP whitelist. Your current IP is: <strong><?php echo $_SERVER['REMOTE_ADDR']?></strong>.</em></small></p>
<input type="submit" name="set_whitelist_ip" value="Set Whitelisted IPs" class="button-secondary" />
</div>
</form>
<form name="whitelist_page_or_variable" action="<?php echo $action_url; ?>" method="post" class="widefat" style="padding:0 0 20px; margin:20px 0 0;">
<div style="padding:0 20px;">
<h3>Whitelisted Pages:</h3>
<p>Enter page and/or form variables that are whitelisted — and not subject to security rules:</p>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><strong>Page:</strong></td>
<td><strong>Form Variable:</strong></td>
</tr>
<?php
//!unserialize(get_option('askepott_whitelisted_page')) && !unserialize(get_option('askepott_whitelisted_variable'))
$whitelist_pages = get_option('askepott_whitelisted_page');
$whitelist_variables = get_option('askepott_whitelisted_variable');
$whitelist_pages_unserialized = unserialize($whitelist_pages);
$whitelist_variables_unserialized = unserialize($whitelist_variables);
if(($whitelist_pages == '') && ($whitelist_variables == '')) {
echo '<tr><td><input type="text" name="whitelist_page[]" /></td>';
echo '<td><input type="text" name="whitelist_variable[]" /></td></tr>';
} else {
//$pages = unserialize(get_option('askepott_whitelisted_page'));
//$variables = unserialize(get_option('askepott_whitelisted_variable'));
if(($whitelist_pages_unserialized !== FALSE) && ($whitelist_pages_unserialized !== FALSE)) {
$pages = $whitelist_pages_unserialized;
$variables = $whitelist_variables_unserialized;
$count = 0;
while($count < sizeof($pages)) {
if(($pages[$count] != '') || ($variables[$count] != '')) {
echo '<tr><td><input type="text" value="'. $pages[$count] . '" name="whitelist_page[]" /></td>';
echo '<td><input type="text" value="' . $variables[$count] . '" name="whitelist_variable[]" /></td></tr>';
}
$count++;
}
} else {
$pages = $whitelist_pages;
$variables = $whitelist_variables;
$count = 0;
while($count < sizeof($pages)) {
if(($pages[$count] != '') || ($variables[$count] != '')) {
echo '<tr><td><input type="text" value="'. $pages[$count] . '" name="whitelist_page[]" /></td>';
echo '<td><input type="text" value="' . $variables[$count] . '" name="whitelist_variable[]" /></td></tr>';
}
$count++;
}
}
echo '<tr><td><input type="text" name="whitelist_page[]" /></td>';
echo '<td><input type="text" name="whitelist_variable[]" /></td></tr>';
}
?>
</table>
<p style="margin-top:5px;"><small><em>Note: Set field(s) to blank to disable page whitelist.<br />Note: Use *'s for wildcard characters.</em></small></p>
<input type="submit" name="set_whitelist_page" value="Set Whitelisted Pages" class="button-secondary" />
</div>
</form>
<?php askepott_show_plugin_link(); ?>
</div>
<?php
}
function askepott_show_plugin_link() { ?>
<div style="margin:30px 0 20px; text-align:right;">
<p>Please report all issues on the project page: <a href="https://github.com/glastopf/askepott" target="_blank">Askepott</a>.</p>
<small>Original plugin by <a href="http://www.seoegghead.com/software/" target="_blank">SEO Egghead</a> and <a href="http://matthewpavkov.com" target="_blank">Matthew Pavkov</a>.</small>
</div>
<?php } ?>