| 1 |
<?php |
| 2 |
|
| 3 |
namespace WP_Defender\Model\Setting; |
| 4 |
|
| 5 |
use Calotes\Model\Setting; |
| 6 |
|
| 7 |
class Audit_Logging extends Setting { |
| 8 |
/** |
| 9 |
* Option name. |
| 10 |
* @var string |
| 11 |
*/ |
| 12 |
protected $table = 'wd_audit_settings'; |
| 13 |
/** |
| 14 |
* @defender_property |
| 15 |
* @var bool |
| 16 |
*/ |
| 17 |
public $enabled = false; |
| 18 |
/** |
| 19 |
* @defender_property |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
public $storage_days = '6 months'; |
| 23 |
|
| 24 |
/** |
| 25 |
* Define labels for settings key. |
| 26 |
* |
| 27 |
* @param string|null $key |
| 28 |
* |
| 29 |
* @return string|array|null |
| 30 |
*/ |
| 31 |
public function labels( $key = null ) { |
| 32 |
$labels = array( |
| 33 |
'enabled' => __( 'Audit Logging', 'wpdef' ), |
| 34 |
'storage_days' => __( 'Storage for', 'wpdef' ), |
| 35 |
); |
| 36 |
|
| 37 |
if ( ! is_null( $key ) ) { |
| 38 |
return $labels[ $key ] ?? null; |
| 39 |
} |
| 40 |
|
| 41 |
return $labels; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* @since 2.6.5 |
| 46 |
* @return bool |
| 47 |
*/ |
| 48 |
public function is_active() { |
| 49 |
|
| 50 |
return (bool) apply_filters( 'wd_audit_enable', $this->enabled ); |
| 51 |
} |
| 52 |
} |
| 53 |
|