[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.116.80.68: ~ $
<?php declare(strict_types = 1);

namespace MailPoet\Statistics\Track;

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


use MailPoet\Settings\TrackingConfig;
use MailPoet\Util\Cookies;

class PageViewCookie {
  const COOKIE_NAME = 'mailpoet_page_view';
  const COOKIE_EXPIRY = 10 * 365 * 24 * 60 * 60; // 10 years (~ no expiry)

  /** @var Cookies */
  private $cookies;

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

  public function __construct(
    Cookies $cookies,
    TrackingConfig $trackingConfig
  ) {
    $this->cookies = $cookies;
    $this->trackingConfig = $trackingConfig;
  }

  public function getPageViewTimestamp(): ?int {
    if (!$this->trackingConfig->isCookieTrackingEnabled()) {
      return null;
    }

    return $this->getTimestampCookie(self::COOKIE_NAME);
  }

  public function setPageViewTimestamp(int $timestamp): void {
    if (!$this->trackingConfig->isCookieTrackingEnabled()) {
      return;
    }

    $this->cookies->set(
      self::COOKIE_NAME,
      ['timestamp' => $timestamp],
      [
        'expires' => time() + self::COOKIE_EXPIRY,
        'path' => '/',
      ]
    );
  }

  private function getTimestampCookie(string $cookieName): ?int {
    $data = $this->cookies->get($cookieName);
    return is_array($data) && $data['timestamp']
      ? (int)$data['timestamp']
      : null;
  }
}

Filemanager

Name Type Size Permission Actions
Clicks.php File 5.82 KB 0644
Opens.php File 3.62 KB 0644
PageViewCookie.php File 1.3 KB 0644
SubscriberActivityTracker.php File 3.92 KB 0644
SubscriberCookie.php File 1.77 KB 0644
SubscriberHandler.php File 1.77 KB 0644
Unsubscribes.php File 2.51 KB 0644
WooCommercePurchases.php File 5.7 KB 0644
index.php File 6 B 0644