- Removes unused method from Settings model
- Renames method to delete value
This commit is contained in:
@ -8,30 +8,30 @@ if(!defined('ABSPATH')) exit;
|
||||
class MailerLog {
|
||||
const MAILER_LOG_CONFIG = 'mta_log';
|
||||
|
||||
static function getMailerLog() {
|
||||
$mailer_log = Setting::getValue(self::MAILER_LOG_CONFIG);
|
||||
if(!$mailer_log) {
|
||||
$mailer_log = self::createOrResetMailerLog();
|
||||
static function getMailerLog() {
|
||||
$mailer_log = Setting::getValue(self::MAILER_LOG_CONFIG);
|
||||
if(!$mailer_log) {
|
||||
$mailer_log = self::createOrResetMailerLog();
|
||||
}
|
||||
return $mailer_log;
|
||||
}
|
||||
return $mailer_log;
|
||||
}
|
||||
|
||||
static function createOrResetMailerLog() {
|
||||
$mailer_log = array(
|
||||
'sent' => 0,
|
||||
'started' => time()
|
||||
);
|
||||
Setting::setValue(self::MAILER_LOG_CONFIG, $mailer_log);
|
||||
return $mailer_log;
|
||||
}
|
||||
static function createOrResetMailerLog() {
|
||||
$mailer_log = array(
|
||||
'sent' => 0,
|
||||
'started' => time()
|
||||
);
|
||||
Setting::setValue(self::MAILER_LOG_CONFIG, $mailer_log);
|
||||
return $mailer_log;
|
||||
}
|
||||
|
||||
static function updateMailerLog($mailer_log) {
|
||||
Setting::setValue(self::MAILER_LOG_CONFIG, $mailer_log);
|
||||
return $mailer_log;
|
||||
}
|
||||
static function updateMailerLog($mailer_log) {
|
||||
Setting::setValue(self::MAILER_LOG_CONFIG, $mailer_log);
|
||||
return $mailer_log;
|
||||
}
|
||||
|
||||
static function isSendingLimitReached() {
|
||||
$mailer_config = Mailer::getMailerConfig();
|
||||
static function isSendingLimitReached() {
|
||||
$mailer_config = Mailer::getMailerConfig();
|
||||
$mailer_log = self::getMailerLog();
|
||||
$elapsed_time = time() - (int)$mailer_log['started'];
|
||||
if($mailer_log['sent'] === $mailer_config['frequency_limit'] &&
|
||||
|
Reference in New Issue
Block a user