PluginProbe
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.12.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.12.0
4.12.0 4.11.2 4.11.1 4.11.0 4.10.0 4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 All 67 releases
wp-staging / install.php
install.php
84 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4
5
6
7
8
9 use WPStaging\Backend\Optimizer\Optimizer;
10 use WPStaging\Core\Cron\Cron;
11 use WPStaging\Core\DTO\Settings;
12 use WPStaging\Core\Utils\Htaccess;
13 use WPStaging\Core\WPStaging;
14 use WPStaging\Framework\Analytics\Actions\PluginLifecycle;
15 use WPStaging\Framework\Onboarding\FirstInstall;
16
17 if (!class_exists('WPStaging\Core\Cron\Cron')) {
18 return;
19 }
20
21
22
23
24
25 $isNewInstall = FirstInstall::hasNeverSeenWpStaging();
26
27 FirstInstall::markIfFirstInstall();
28
29 PluginLifecycle::recordActivation($isNewInstall);
30
31
32
33
34 $cron = (new Cron)->scheduleEvent();
35
36
37
38
39 $optimizer = (new Optimizer)->installOptimizer();
40
41
42
43
44 if (!defined('WPSTGPRO_VERSION')) {
45 set_transient('wpstg_activation_redirect', true, 3600);
46 }
47
48
49
50
51 $htaccess = new Htaccess();
52 if (extension_loaded('litespeed')) {
53 $htaccess->createLitespeed(ABSPATH . '.htaccess');
54 }
55
56
57
58
59 $settings = (new Settings())->setDefault();
60
61
62
63
64
65 if (defined('WPSTGPRO_VERSION')) {
66 add_option('wpstgpro_install_date', date('Y-m-d h:i:s'));
67 } else {
68 add_option('wpstg_free_install_date', date('Y-m-d h:i:s'));
69 }
70
71
72 add_option('wpstg_installDate', date('Y-m-d h:i:s'));
73
74
75
76
77 $backupScheduler = WPStaging::make(\WPStaging\Backup\BackupScheduler::class);
78 $backupScheduler->reCreateCronIfSchedulesExist();
79
80
81
82
83 WPStaging::make(\WPStaging\Backup\BackupServiceProvider::class)->createBackupsDirectory();
84