403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.147.46.136
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Cron/ActionScheduler/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Cron/ActionScheduler/RemoteExecutorHandler.php
<?php declare(strict_types = 1);

namespace MailPoet\Cron\ActionScheduler;

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


use MailPoet\WP\Functions as WPFunctions;

class RemoteExecutorHandler {
  const AJAX_ACTION_NAME = 'mailpoet-cron-action-scheduler-run';

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

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

  public function init(): void {
    $this->wp->addAction('wp_ajax_nopriv_' . self::AJAX_ACTION_NAME, [$this, 'runActionScheduler'], 0);
  }

  /**
   * Attempts to spawn Action Scheduler runner via ajax request
   * @see https://actionscheduler.org/perf/#increasing-initialisation-rate-of-runners
   */
  public function triggerExecutor(): void {
    $this->wp->addFilter('https_local_ssl_verify', '__return_false', 100);
    $this->wp->wpRemotePost($this->wp->adminUrl('admin-ajax.php'), [
      'method' => 'POST',
      'timeout' => 5,
      'redirection' => 5,
      'httpversion' => '1.0',
      'blocking' => false,
      'headers' => [],
      'body' => [
        'action' => self::AJAX_ACTION_NAME,
      ],
      'cookies' => [],
    ]);
  }

  public function runActionScheduler(): void {
    $this->wp->addFilter('action_scheduler_queue_runner_concurrent_batches', [$this, 'ensureConcurrency']);
    \ActionScheduler_QueueRunner::instance()->run();
    wp_die();
  }

  /**
   * When triggering new runner at the end of a runner execution
   * we need to make sure the concurrency allows more one runner.
   */
  public function ensureConcurrency(int $concurrency): int {
    return ($concurrency) < 2 ? 2 : $concurrency;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit