[ Avaa Bypassed ]




Upload:

Command:

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

namespace MailPoet\Cron\Workers;

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


use MailPoet\Entities\ScheduledTaskEntity;
use MailPoet\Settings\SettingsController;
use MailPoet\Settings\TrackingConfig;
use MailPoet\Subscribers\InactiveSubscribersController;
use MailPoet\Subscribers\SubscribersRepository;

class InactiveSubscribers extends SimpleWorker {
  const TASK_TYPE = 'inactive_subscribers';
  const BATCH_SIZE = 1000;
  const SUPPORT_MULTIPLE_INSTANCES = false;

  /** @var InactiveSubscribersController */
  private $inactiveSubscribersController;

  /** @var SettingsController */
  private $settings;

  /** @var TrackingConfig */
  private $trackingConfig;

  /** @var SubscribersRepository */
  private $subscribersRepository;

  public function __construct(
    InactiveSubscribersController $inactiveSubscribersController,
    SettingsController $settings,
    TrackingConfig $trackingConfig,
    SubscribersRepository $subscribersRepository
  ) {
    $this->inactiveSubscribersController = $inactiveSubscribersController;
    $this->settings = $settings;
    $this->trackingConfig = $trackingConfig;
    $this->subscribersRepository = $subscribersRepository;
    parent::__construct();
  }

  public function processTaskStrategy(ScheduledTaskEntity $task, $timer) {
    if (!$this->trackingConfig->isEmailTrackingEnabled()) {
      $this->schedule();
      return true;
    }
    $daysToInactive = (int)$this->settings->get('deactivate_subscriber_after_inactive_days');
    // Activate all inactive subscribers in case the feature is turned off
    if ($daysToInactive === 0) {
      $this->inactiveSubscribersController->reactivateInactiveSubscribers();
      $this->schedule();
      return true;
    }
    // Handle activation/deactivation within interval
    $meta = $task->getMeta();
    $lastSubscriberId = isset($meta['last_subscriber_id']) ? $meta['last_subscriber_id'] : 0;

    if (isset($meta['max_subscriber_id'])) {
      $maxSubscriberId = $meta['max_subscriber_id'];
    } else {
      $maxSubscriberId = $this->subscribersRepository->getMaxSubscriberId();
    }

    while ($lastSubscriberId <= $maxSubscriberId) {
      $count = $this->inactiveSubscribersController->markInactiveSubscribers($daysToInactive, self::BATCH_SIZE, $lastSubscriberId);
      if ($count === false) {
        break;
      }
      $lastSubscriberId += self::BATCH_SIZE;
      $task->setMeta(['last_subscriber_id' => $lastSubscriberId]);
      $this->scheduledTasksRepository->persist($task);
      $this->scheduledTasksRepository->flush();
      $this->cronHelper->enforceExecutionLimit($timer);
    };
    while ($this->inactiveSubscribersController->markActiveSubscribers($daysToInactive, self::BATCH_SIZE) === self::BATCH_SIZE) {
      $this->cronHelper->enforceExecutionLimit($timer);
    };
    $this->schedule();
    return true;
  }
}

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