[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.182.217: ~ $
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Cron\Workers;

if (!defined('ABSPATH')) exit;


use MailPoet\Cron\CronHelper;
use MailPoet\Cron\CronWorkerInterface;
use MailPoet\Cron\CronWorkerRunner;
use MailPoet\Cron\CronWorkerScheduler;
use MailPoet\DI\ContainerWrapper;
use MailPoet\Entities\ScheduledTaskEntity;
use MailPoet\Newsletter\Sending\ScheduledTasksRepository;
use MailPoetVendor\Carbon\Carbon;

abstract class SimpleWorker implements CronWorkerInterface {
  const TASK_TYPE = null;
  const AUTOMATIC_SCHEDULING = true;
  const SUPPORT_MULTIPLE_INSTANCES = true;

  public $timer;

  /** @var CronHelper */
  protected $cronHelper;

  /** @var CronWorkerScheduler */
  protected $cronWorkerScheduler;

  /** @var ScheduledTasksRepository */
  protected $scheduledTasksRepository;

  public function __construct() {
    if (static::TASK_TYPE === null) {
      throw new \Exception('Constant TASK_TYPE is not defined on subclass ' . get_class($this));
    }
    $this->cronHelper = ContainerWrapper::getInstance()->get(CronHelper::class);
    $this->cronWorkerScheduler = ContainerWrapper::getInstance()->get(CronWorkerScheduler::class);
    $this->scheduledTasksRepository = ContainerWrapper::getInstance()->get(ScheduledTasksRepository::class);
  }

  public function getTaskType() {
    return static::TASK_TYPE;
  }

  public function supportsMultipleInstances() {
    return static::SUPPORT_MULTIPLE_INSTANCES;
  }

  public function schedule() {
    $this->cronWorkerScheduler->schedule(static::TASK_TYPE, $this->getNextRunDate());
  }

  protected function scheduleImmediately(): void {
    $this->cronWorkerScheduler->schedule(static::TASK_TYPE, $this->getNextRunDateImmediately());
  }

  public function checkProcessingRequirements() {
    return true;
  }

  public function init() {
  }

  public function prepareTaskStrategy(ScheduledTaskEntity $task, $timer) {
    return true;
  }

  public function processTaskStrategy(ScheduledTaskEntity $task, $timer) {
    return true;
  }

  public function getNextRunDate() {
    // random day of the next week
    $date = Carbon::now()->millisecond(0);
    $date->setISODate((int)$date->format('o'), ((int)$date->format('W')) + 1, mt_rand(1, 7));
    $date->startOfDay();
    return $date;
  }

  protected function getNextRunDateImmediately(): Carbon {
    return Carbon::now()->millisecond(0);
  }

  public function scheduleAutomatically() {
    return static::AUTOMATIC_SCHEDULING;
  }

  protected function getCompletedTasks() {
    return $this->scheduledTasksRepository->findCompletedByType(static::TASK_TYPE, CronWorkerRunner::TASK_BATCH_SIZE);
  }
}

Filemanager

Name Type Size Permission Actions
Automations Folder 0755
KeyCheck Folder 0755
SendingQueue Folder 0755
StatsNotifications Folder 0755
AuthorizedSendingEmailsCheck.php File 996 B 0644
BackfillEngagementData.php File 1.42 KB 0644
Bounce.php File 5.67 KB 0644
ExportFilesCleanup.php File 971 B 0644
InactiveSubscribers.php File 2.87 KB 0644
Mixpanel.php File 1.52 KB 0644
NewsletterTemplateThumbnails.php File 755 B 0644
ReEngagementEmailsScheduler.php File 865 B 0644
Scheduler.php File 17.09 KB 0644
SimpleWorker.php File 2.64 KB 0644
SubscriberLinkTokens.php File 1.74 KB 0644
SubscribersCountCacheRecalculation.php File 3.44 KB 0644
SubscribersEmailCount.php File 3.27 KB 0644
SubscribersEngagementScore.php File 2.34 KB 0644
SubscribersLastEngagement.php File 2.82 KB 0644
SubscribersStatsReport.php File 1.8 KB 0644
UnsubscribeTokens.php File 2.86 KB 0644
WooCommercePastOrders.php File 2.61 KB 0644
WooCommerceSync.php File 1.97 KB 0644
WorkersFactory.php File 5.6 KB 0644
index.php File 6 B 0644