PluginProbe
UpdraftPlus: WP Backup & Migration Plugin / 1.8.13
UpdraftPlus: WP Backup & Migration Plugin v1.8.13
1.26.7 1.26.6 1.26.5 1.26.4 1.26.3 1.9.19 1.9.25 1.9.26 1.9.30 1.9.31 1.9.32 1.9.4 1.9.40 1.9.41 1.9.42 1.9.43 1.9.44 1.9.45 1.9.46 1.9.5 1.9.50 1.9.51 1.9.60 1.9.62 1.9.63 All 371 releases
updraftplus / methods / sftp.php

sftp.php in UpdraftPlus: WP Backup & Migration Plugin 1.8.13, at methods/sftp.php

82 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class UpdraftPlus_BackupModule_sftp {
4
5 // backup method: takes an array, and shovels them off to the cloud storage
6 public function backup($backup_array) {
7
8 global $updraftplus;
9
10 if (apply_filters('updraft_sftp_exists', 'no') !== 'yes') {
11 $updraftplus->log('You do not have the UpdraftPlus SFTP/SCP add-on installed - get it from http://updraftplus.com/shop/');
12 $updraftplus->log(sprintf(__('You do not have the UpdraftPlus %s add-on installed - get it from %s','updraftplus'),'SFTP/SCP','http://updraftplus.com/shop/'), 'error');
13 return false;
14 }
15
16 // Do our uploading stuff...
17
18 // If successful, then you must do this:
19 // $updraftplus->uploaded_file($file);
20
21 return apply_filters('updraft_sftp_upload_files', null, $backup_array);
22
23 }
24
25 // delete method: takes a file name (base name) (or array thereof), and removes it from the cloud storage
26 public function delete($files, $method_obj = false) {
27
28 global $updraftplus;
29
30 if (apply_filters('updraft_sftp_exists', 'no') !== 'yes') {
31 $updraftplus->log('You do not have the UpdraftPlus SFTP/SCP add-on installed - get it from http://updraftplus.com/shop/');
32 $updraftplus->log(sprintf(__('You do not have the UpdraftPlus %s add-on installed - get it from %s','updraftplus'),'SFTP/SCP','http://updraftplus.com/shop/'), 'error');
33 return false;
34 }
35
36 return apply_filters('updraft_sftp_delete_files', false, $files, $method_obj);
37
38 }
39
40 // download method: takes a file name (base name), and removes it from the cloud storage
41 public function download($file) {
42
43 global $updraftplus;
44
45 if (apply_filters('updraft_sftp_exists', 'no') !== 'yes') {
46 $updraftplus->log('You do not have the UpdraftPlus SFTP/SCP add-on installed - get it from http://updraftplus.com/shop/');
47 $updraftplus->log(sprintf(__('You do not have the UpdraftPlus %s add-on installed - get it from %s','updraftplus'),'SFTP/SCP','http://updraftplus.com/shop/'), 'error');
48 return false;
49 }
50
51 return apply_filters('updraft_sftp_download_file', false, $file);
52
53 }
54
55 // config_print: prints out table rows for the configuration screen
56 // Your rows need to have a class exactly matching your method (in this example, sftp), and also a class of updraftplusmethod
57 // Note that logging is not available from this context; it will do nothing.
58 public function config_print() {
59
60 $link = sprintf(__('%s support is available as an add-on','updraftplus'),'SFTP / SCP').' - <a href="http://updraftplus.com/shop/sftp/">'.__('follow this link to get it','updraftplus').'</a>';
61
62 $default = <<<ENDHERE
63 <tr class="updraftplusmethod sftp">
64 <th>SFTP / SCP:</th>
65 <td>$link</td>
66 </tr>
67 ENDHERE;
68
69 echo apply_filters('updraft_sftp_config_print', $default);
70 }
71
72 public function config_print_javascript_onready() {
73 do_action('updraft_sftp_config_javascript');
74 }
75
76 public function credentials_test() {
77 do_action('updraft_sftp_credentials_test');
78 die;
79 }
80
81 }
82