PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 3.1.23.3
JetBackup – Backup, Restore & Migrate v3.1.23.3
3.1.23.3 3.1.22.4 3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / public / cron / cron.php
backup / public / cron Last commit date
cron.php 1 week ago
cron.php
48 lines
1 <?php
2 if (function_exists('opcache_get_status')) ini_set('opcache.enable', 0);
3 ini_set('display_errors', 1);
4 ini_set('display_startup_errors', 1);
5 error_reporting(E_ALL);
6
7 header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
8 header('Pragma: no-cache');
9 header('Expires: 0');
10
11 use JetBackup\Cron\Cron;
12 use JetBackup\Factory;
13 use JetBackup\Wordpress\Wordpress;
14
15 //Use PHP_SAPI instead of HTTP headers to reliably distinguish CLI from web requests..
16 $isWeb = PHP_SAPI !== 'cli';
17 $location = ($_SERVER['SCRIPT_FILENAME'] ?? __FILE__);
18 // /home/user/public_html/wp-content/plugins/backup/public/cron/cron.php
19
20 define ('WP_ROOT', dirname($location, 6));
21
22 if (!file_exists(WP_ROOT . DIRECTORY_SEPARATOR . 'wp-load.php')) {
23 die('Error: Cannot locate wp-load.php. Ensure WP_ROOT is correct.');
24 }
25
26 // Get into WordPress ecosystem
27 require_once(WP_ROOT . DIRECTORY_SEPARATOR . 'wp-load.php');
28
29 $_active_plugins = is_multisite() ? array_keys(get_site_option('active_sitewide_plugins')) : Wordpress::getOption('active_plugins');
30 $_plugin_name = 'backup/backup.php'; // Cannot use DIRECTORY_SEPARATOR, will cause false positives with IIS
31 if (!in_array($_plugin_name, $_active_plugins)) die('JetBackup Plugin is inactive');
32
33 if ($isWeb) {
34 $key = Factory::getConfig()->getCronToken();
35 $token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
36 // hash_equals() for a timing-safe comparison (avoids leaking the token via response timing).
37 if (!$key || !$token || !hash_equals($key, $token)) {
38 http_response_code(403);
39 die('Forbidden');
40 }
41 }
42
43 try {
44 Cron::main();
45 } catch(Exception $e) {
46 die($e->getMessage() . PHP_EOL);
47 }
48