PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.1.2
Backup Migration v2.1.2
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / includes / bodies / storage / dropbox.php
backup-backup / includes / bodies / storage Last commit date
aws.php 3 months ago backupbliss.php 3 months ago dropbox.php 3 months ago ftp.php 3 months ago gdrive.php 3 months ago wasabi.php 3 months ago
dropbox.php
99 lines
1 <?php
2
3 // Namespace
4 namespace BMI\Plugin;
5 use BMI\Plugin\Dashboard as Dashboard;
6
7 // Exit on direct access
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11
12 // Drop Box template
13 add_action('bmi_pro_dropbox_template', function () {
14 $dropbox_auth_code = get_option('bmip_dropbox_auth_code', false);
15 $dropbox_access_token = get_transient('bmip_dropbox_access_token');
16 $shouldBeConnected = false;
17 if (is_string($dropbox_access_token) && is_string($dropbox_auth_code)) {
18 $shouldBeConnected = true;
19 }
20
21 $isEnabled = Dashboard\bmi_get_config('STORAGE::EXTERNAL::DROPBOX');
22 if ($isEnabled === true || $isEnabled === 'true') {
23 $isEnabled = ' checked';
24 } else $isEnabled = '';
25
26 ?>
27 <!-- External: Drop Box -->
28 <div class="tab2-item d-flex jst-sb ia-center<?php echo (($isEnabled == ' checked') ? ' activeList' : ''); ?>">
29 <div class="d-flex ia-center">
30 <img src="<?php echo esc_url( $this->get_asset('images', 'dropbox.svg') ); ?>" alt="logo" class="tab2-img">
31 <span class="ml25 d-flex ia-center">
32 <span class="title_whereStored"><?php esc_html_e("Dropbox", 'backup-backup'); ?></span>
33 </span>
34 </div>
35 <div class="ia-center">
36 <div class="b2 bmi-switch"><input type="checkbox" class="checkbox storage-checkbox"<?php echo esc_attr( $isEnabled ); ?> data-toggle="storage-dropbox-row" id="bmi-pro-storage-dropbox-toggle">
37 <div class="bmi-knobs"><span></span></div>
38 <div class="bmi-layer_str"></div>
39 </div>
40 </div>
41 </div>
42 <div class="bg_grey storage_target" id="storage-dropbox-row"<?php echo (($isEnabled == ' checked') ? '' : ' style="display: none;"'); ?>>
43 <?php
44 $disabled_functions = explode(',', ini_get('disable_functions'));
45 $vA = !in_array('curl_exec', $disabled_functions);
46 $vB = !in_array('curl_init', $disabled_functions);
47
48 if (function_exists('curl_version') && function_exists('curl_exec') && function_exists('curl_init') && $vA && $vB) {
49 ?>
50
51 <div id="dropbox-unauthenticated-box" class="container-40 lh30 pt30 pb30" <?php echo (($shouldBeConnected) ? 'style="display: none;"' : ''); ?>>
52 <div class="d-flex">
53 <div class="w270" style="margin-top: 11px;"><span id="dropbox-not-authed-content-box">Current status:&nbsp;<b>Inactive</b></span></div>
54 <div>
55 <div class="w100 pos-r">
56 <a href="#" id="dropbox-connect-btn" class="btn"><?php esc_html_e("Connect", 'backup-backup'); ?></a>
57 </div>
58 </div>
59 </div>
60 <div class="d-flex">
61 <blockquote class="bmi-dropbox-info">
62 <?php echo wp_kses_post( sprintf(
63 __('The plugin only requests the permissions it needs to function and can view or edit only the files it creates within the app folder—nothing else. If you’re concerned, you can set up a new, empty Dropbox account %shere%s and provide access to that.', 'backup-backup'),
64 '<a href="https://www.dropbox.com/register" target="_blank">',
65 '</a>'
66 ) ); ?>
67
68 </blockquote>
69 </div>
70 </div>
71 <div id="dropbox-authenticated-box" class="container-40 lh30 pt30 pb30" <?php echo ((!$shouldBeConnected) ? 'style="display: none;"' : ''); ?>>
72
73 <div class="d-flex">
74 <div class="w270" style="margin-top: 11px;"><span id="dropbox-authed-content-box">Current status:&nbsp;<b>Active</b></span></div>
75 <div>
76 <div class="w100 pos-r">
77 <a href="#" id="dropbox-disconnect-btn" class="btn"><?php esc_html_e("Disconnect", 'backup-backup'); ?></a>
78 </div>
79 </div>
80 </div>
81
82 </div>
83 <?php
84 } else {
85 ?>
86 <div class="container-40 lh30 pt30 pb30">
87 <div class="center">
88 It seem like you don't have cURL extension (PHP module) installed on your server.<br />
89 Without this module it's impossible to upload backups to Drop Box.<br />
90 If you wish to use this feature, please enable cURL module.
91 </div>
92 </div>
93 <?php
94 }
95 ?>
96 </div>
97 <?php
98 });
99