PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / trunk
WP STAGING – WordPress Backups, Restore, Migration & Clone vtrunk
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 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 / freeBootstrap.php
wp-staging Last commit date
Backend 2 days ago Backup 2 days ago Basic 6 days ago Component 6 days ago Core 2 days ago Framework 2 days ago Frontend 6 days ago Notifications 6 days ago Staging 2 days ago assets 2 days ago languages 6 days ago resources 6 days ago vendor_wpstg 6 days ago views 2 days ago CONTRIBUTING.md 2 years ago Deactivate.php 6 days ago README.md 5 months ago SECURITY.md 4 weeks ago autoloader.php 6 days ago bootstrap.php 6 days ago commonBootstrap.php 6 days ago constantsFree.php 2 days ago freeBootstrap.php 6 days ago install.php 6 days ago opcacheBootstrap.php 2 days ago readme.txt 2 days ago runtimeRequirements.php 6 days ago uninstall.php 2 days ago wp-staging-error-handler.php 6 days ago wp-staging.php 2 days ago
freeBootstrap.php
125 lines
1 <?php
2
3 if (!function_exists('wpstgHandleMissingRequiredFile')) {
4
5
6
7 function wpstgHandleMissingRequiredFile(string $filePath)
8 {
9 $errorMessage = sprintf("WP STAGING WARNING: Attempted to require missing file: %s.", esc_html($filePath));
10 if (defined('WPSTG_DEBUG') && (bool)WPSTG_DEBUG) {
11 error_log($errorMessage);
12 }
13
14 if (defined('WPSTGPRO_VERSION')) {
15 return;
16 }
17
18 add_action('admin_notices', function () use ($errorMessage) {
19 $errorMessage = "$errorMessage Please contact support@wp-staging.com for help!";
20 echo '<div class="notice notice-error is-dismissible"><p>' . esc_html($errorMessage) . '</p></div>';
21 });
22
23 return;
24 }
25 }
26
27
28
29
30
31
32
33
34
35
36
37
38
39 $pluginFilePath = empty($pluginFilePath) ? '' : $pluginFilePath;
40
41 $commonBootstrap = __DIR__ . '/commonBootstrap.php';
42 if (file_exists($commonBootstrap)) {
43 require_once $commonBootstrap;
44 } else {
45 wpstgHandleMissingRequiredFile($commonBootstrap);
46 }
47
48 add_action('plugins_loaded', function () use ($pluginFilePath) {
49
50
51 try {
52 if (function_exists('wpstgShouldSkipBootstrap') && wpstgShouldSkipBootstrap()) {
53 return;
54 }
55
56 $files = [
57 __DIR__ . '/runtimeRequirements.php',
58 __DIR__ . '/bootstrap.php',
59 ];
60
61 foreach ($files as $file) {
62 if (file_exists($file)) {
63 require_once $file;
64 } else {
65 wpstgHandleMissingRequiredFile($file);
66 }
67 }
68 } catch (\Throwable $e) {
69
70
71
72 if (defined('WPSTG_DEBUG') && WPSTG_DEBUG) {
73 error_log('WP STAGING could not load: ' . $e->getMessage());
74 }
75 }
76 }, 11, 0);
77
78 register_activation_hook($pluginFilePath, function () use ($pluginFilePath) {
79
80
81 try {
82 $files = [
83 __DIR__ . '/runtimeRequirements.php',
84 __DIR__ . '/bootstrap.php',
85 __DIR__ . '/install.php',
86 ];
87
88 foreach ($files as $file) {
89 if (file_exists($file)) {
90 require_once $file;
91 } else {
92 wpstgHandleMissingRequiredFile($file);
93 }
94 }
95 } catch (\Throwable $e) {
96
97
98
99 if (defined('WPSTG_DEBUG') && WPSTG_DEBUG) {
100 error_log('WP STAGING: ' . $e->getMessage());
101 }
102 }
103 });
104
105 register_deactivation_hook($pluginFilePath, function () use ($pluginFilePath) {
106 if (!class_exists('WPStaging\Deactivate')) {
107 $file = __DIR__ . '/Deactivate.php';
108 if (file_exists($file)) {
109 require_once $file;
110 } else {
111 wpstgHandleMissingRequiredFile($file);
112 }
113 }
114
115 try {
116 new WPStaging\Deactivate($pluginFilePath);
117 } catch (\Throwable $e) {
118
119 if (defined('WPSTG_DEBUG') && WPSTG_DEBUG) {
120 error_log('WP STAGING: Deactivation cleanup failed: ' . $e->getMessage());
121 error_log($e->getTraceAsString());
122 }
123 }
124 });
125