✘✘ 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.36
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/mailpoet/lib/Analytics//Analytics.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Analytics;

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


use MailPoet\Settings\SettingsController;
use MailPoet\Util\Security;
use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Carbon\Carbon;

class Analytics {

  const SETTINGS_LAST_SENT_KEY = 'analytics_last_sent';
  const SETTINGS_LAST_SENT_TRACKS_KEY = 'analytics_last_sent_tracks';
  const SEND_AFTER_DAYS = 7;
  const ANALYTICS_FILTER = 'mailpoet_analytics';

  /** @var Reporter */
  private $reporter;

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

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

  public function __construct(
    Reporter $reporter,
    SettingsController $settingsController
  ) {
    $this->reporter = $reporter;
    $this->settings = $settingsController;
    $this->wp = new WPFunctions;
  }

  /** @return array|null */
  public function generateAnalytics() {
    if ($this->shouldSendToMixpanel()) {
      $data = $this->getAnalyticsData();
      $this->recordMixpanelDataSent();
      return $data;
    }
    return null;
  }

  public function getAnalyticsData() {
    return $this->wp->applyFilters(self::ANALYTICS_FILTER, $this->reporter->getData());
  }

  /** @return bool */
  public function isEnabled() {
    $analyticsSettings = $this->settings->get('analytics', []);
    return !empty($analyticsSettings['enabled']) === true;
  }

  public function setPublicId($newPublicId) {
    $currentPublicId = $this->settings->get('public_id');
    if ($currentPublicId !== $newPublicId) {
      $this->settings->set('public_id', $newPublicId);
      $this->settings->set('new_public_id', 'true');
      // Force user data to be resent
      $this->settings->delete(Analytics::SETTINGS_LAST_SENT_KEY);
    }
  }

  /** @return string */
  public function getPublicId() {
    $publicId = $this->settings->get('public_id', '');
    if (empty($publicId)) {
      // The previous implementation used md5, so this is just to ensure consistency
      $randomId = md5(Security::generateRandomString(32));
      $this->settings->set('public_id', $randomId);
      $this->settings->set('new_public_id', 'true');
      return $randomId;
    }
    return $publicId;
  }

  /**
   * Returns true if a the public_id was added and update new_public_id to false
   * @return bool
   */
  public function isPublicIdNew() {
    $newPublicId = $this->settings->get('new_public_id');
    if ($newPublicId === 'true') {
      $this->settings->set('new_public_id', 'false');
      return true;
    }
    return false;
  }

  public function shouldSendToMixpanel() {
    if (!$this->isEnabled()) {
      return false;
    }
    $nextSend = $this->getNextSendDateForMixpanel();
    return $nextSend->isPast();
  }

  public function getNextSendDateForMixpanel(): Carbon {
    $lastSent = $this->settings->get(Analytics::SETTINGS_LAST_SENT_KEY);
    if (!$lastSent) {
      return Carbon::now()->subMinute();
    }

    return Carbon::createFromTimestamp(strtotime($lastSent))->addDays(self::SEND_AFTER_DAYS);
  }

  public function recordMixpanelDataSent() {
    $this->settings->set(Analytics::SETTINGS_LAST_SENT_KEY, Carbon::now());
  }

  public function recordTracksDataSent() {
    $this->settings->set(Analytics::SETTINGS_LAST_SENT_TRACKS_KEY, Carbon::now());
  }

  public function shouldSendToTracks() {
    if (!$this->isEnabled()) {
      return false;
    }
    $nextSend = $this->getNextSendDateForTracks();
    return $nextSend->isPast();
  }

  public function getNextSendDateForTracks(): Carbon {
    $lastSent = $this->settings->get(Analytics::SETTINGS_LAST_SENT_TRACKS_KEY);
    if (!$lastSent) {
      return Carbon::now()->subMinute();
    }

    return Carbon::createFromTimestamp(strtotime($lastSent))->addDays(self::SEND_AFTER_DAYS);
  }
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 10.18 AM
tdhomesa / tdhomesa
0755
Analytics.php
3.755 KB
1 Oct 2025 6.53 AM
tdhomesa / tdhomesa
0644
Reporter.php
29.637 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
ReporterCampaignData.php
22.263 KB
23 Apr 2024 7.33 PM
tdhomesa / tdhomesa
0644
UnsubscribeReporter.php
1.367 KB
29 Nov 2022 5.23 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