PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / trunk
JetBackup – Backup, Restore & Migrate vtrunk
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 year ago
cron.php
43 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 $isWeb = isset($_SERVER['HTTP_TE']) || isset($_SERVER['HTTP_COOKIE']) || isset($_SERVER['HTTP_ACCEPT']) ?? null;
16 $location = ($_SERVER['SCRIPT_FILENAME'] ?? __FILE__);
17 // /home/user/public_html/wp-content/plugins/backup/public/cron/cron.php
18
19 define ('WP_ROOT', dirname($location, 6));
20
21 if (!file_exists(WP_ROOT . DIRECTORY_SEPARATOR . 'wp-load.php')) {
22 die('Error: Cannot locate wp-load.php. Ensure WP_ROOT is correct.');
23 }
24
25 // Get into WordPress ecosystem
26 require_once(WP_ROOT . DIRECTORY_SEPARATOR . 'wp-load.php');
27
28 $_active_plugins = is_multisite() ? array_keys(get_site_option('active_sitewide_plugins')) : Wordpress::getOption('active_plugins');
29 $_plugin_name = 'backup/backup.php'; // Cannot use DIRECTORY_SEPARATOR, will cause false positives with IIS
30 if (!in_array($_plugin_name, $_active_plugins)) die('JetBackup Plugin is inactive');
31
32 if ($isWeb) {
33 $key = Factory::getConfig()->getCronToken();
34 $token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
35 if (!$key || !$token || $key != $token) die(1);
36 }
37
38 try {
39 Cron::main();
40 } catch(Exception $e) {
41 die($e->getMessage() . PHP_EOL);
42 }
43