REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.58 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Cron/ActionScheduler/RemoteExecutorHandler.php
Text
Base64
<?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; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Actions
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ActionScheduler.php
1.31 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RemoteExecutorHandler.php
1.58 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).