| 1 |
<?php |
| 2 |
|
| 3 |
namespace WP_Defender\Model\Setting; |
| 4 |
|
| 5 |
use Calotes\Model\Setting; |
| 6 |
|
| 7 |
class Firewall extends Setting { |
| 8 |
/** |
| 9 |
* Option name |
| 10 |
* @var string |
| 11 |
*/ |
| 12 |
protected $table = 'wd_lockdown_settings'; |
| 13 |
|
| 14 |
/** |
| 15 |
* @var string |
| 16 |
* @defender_property |
| 17 |
*/ |
| 18 |
public $ip_blocklist_cleanup_interval = 'never'; |
| 19 |
|
| 20 |
/** |
| 21 |
* @var int |
| 22 |
* @defender_property |
| 23 |
*/ |
| 24 |
public $storage_days = 30; |
| 25 |
|
| 26 |
/** |
| 27 |
* Define labels for settings key |
| 28 |
* |
| 29 |
* @param string|null $key |
| 30 |
* |
| 31 |
* @return string|array|null |
| 32 |
*/ |
| 33 |
public function labels( $key = null ) { |
| 34 |
$labels = array( |
| 35 |
'storage_days' => __( 'Days to keep logs', 'wpdef' ), |
| 36 |
'ip_blocklist_cleanup_interval' => __( 'Clear Temporary IP Block List', 'wpdef' ), |
| 37 |
); |
| 38 |
|
| 39 |
if ( ! is_null( $key ) ) { |
| 40 |
return $labels[ $key ] ?? null; |
| 41 |
} |
| 42 |
|
| 43 |
return $labels; |
| 44 |
} |
| 45 |
} |
| 46 |
|