PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.10.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.10.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 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / install.php
wp-staging Last commit date
Backend 5 days ago Backup 5 days ago Basic 1 week ago Component 1 month ago Core 5 days ago Framework 5 days ago Frontend 7 months ago Notifications 10 months ago Staging 5 days ago assets 5 days ago languages 5 days ago resources 1 year ago vendor_wpstg 5 days ago views 5 days ago CONTRIBUTING.md 2 years ago Deactivate.php 10 months ago README.md 5 months ago SECURITY.md 2 weeks ago autoloader.php 3 months ago bootstrap.php 2 weeks ago commonBootstrap.php 2 weeks ago constantsFree.php 5 days ago freeBootstrap.php 1 month ago install.php 5 days ago opcacheBootstrap.php 5 days ago readme.txt 5 days ago runtimeRequirements.php 4 months ago uninstall.php 5 days ago wp-staging-error-handler.php 8 months ago wp-staging.php 5 days ago
install.php
79 lines
1 <?php
2 /**
3 * This file is hooked as the \register_activation_hook of the plugin,
4 * therefore it runs as a standalone script that needs to be bootstrapped.
5 *
6 * @var string $pluginFilePath The absolute path to the main file of WP Staging.
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\Onboarding\FirstInstall;
15
16 if (!class_exists('WPStaging\Core\Cron\Cron')) {
17 return;
18 }
19
20 /**
21 * Flag a genuinely new installation before anything below writes an option,
22 * so first-run experiences never reach users who merely reactivated.
23 */
24 FirstInstall::markIfFirstInstall();
25
26 /**
27 * Register Cron Events
28 */
29 $cron = (new Cron)->scheduleEvent();
30
31 /**
32 * Install the Optimizer
33 */
34 $optimizer = (new Optimizer)->installOptimizer();
35
36 /**
37 * Add the transient to redirect for class Welcome (Not for multisites) and not for Pro version
38 */
39 if (!defined('WPSTGPRO_VERSION')) {
40 set_transient('wpstg_activation_redirect', true, 3600);
41 }
42
43 /**
44 * Create Htaccess
45 */
46 $htaccess = new Htaccess();
47 if (extension_loaded('litespeed')) {
48 $htaccess->createLitespeed(ABSPATH . '.htaccess');
49 }
50
51 /**
52 * Set default values for settings
53 */
54 $settings = (new Settings())->setDefault();
55
56 /**
57 * Add plugin install for free or pro version in wp options table.
58 * If that option already exists do not overwrite it to always keep it
59 */
60 if (defined('WPSTGPRO_VERSION')) {
61 add_option('wpstgpro_install_date', date('Y-m-d h:i:s'));
62 } else {
63 add_option('wpstg_free_install_date', date('Y-m-d h:i:s'));
64 }
65
66 // @deprecated since 13.10.2022 Remove in 2023
67 add_option('wpstg_installDate', date('Y-m-d h:i:s'));
68
69 /**
70 * Register the Cron Events for Scheduled Backups
71 */
72 $backupScheduler = WPStaging::make(\WPStaging\Backup\BackupScheduler::class);
73 $backupScheduler->reCreateCronIfSchedulesExist();
74
75 /**
76 * Create backups dir on activation.
77 */
78 WPStaging::make(\WPStaging\Backup\BackupServiceProvider::class)->createBackupsDirectory();
79