PluginProbe
UpdraftPlus: WP Backup & Migration Plugin / 1.9.31
UpdraftPlus: WP Backup & Migration Plugin v1.9.31
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 / insufficient.php

insufficient.php in UpdraftPlus: WP Backup & Migration Plugin 1.9.31, at methods/insufficient.php

74 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed.');
4
5 class UpdraftPlus_BackupModule_insufficientphp {
6
7 private $required_php;
8 private $error_msg;
9 private $method;
10
11 public function __construct($method, $desc, $php, $image = null) {
12 $this->method = $method;
13 $this->desc = $desc;
14 $this->required_php = $php;
15 $this->image = $image;
16 $this->error_msg = 'This remote storage method ('.$this->desc.') requires PHP '.$this->required_php.' or later';
17 $this->error_msg_trans = sprintf(__('This remote storage method (%s) requires PHP %s or later.', 'updraftplus'), $this->desc, $this->required_php);
18 }
19
20 private function log_error() {
21 global $updraftplus;
22 $updraftplus->log($this->error_msg);
23 $updraftplus->log($this->error_msg_trans, 'error', 'insufficientphp');
24 return false;
25 }
26
27 // backup method: takes an array, and shovels them off to the cloud storage
28 public function backup($backup_array) {
29 return $this->log_error();
30 }
31
32 # $match: a substring to require (tested via strpos() !== false)
33 public function listfiles($match = 'backup_') {
34 return new WP_Error('insufficient_php', $this->error_msg_trans);
35 }
36
37 // delete method: takes an array of file names (base name) or a single string, and removes them from the cloud storage
38 public function delete($files, $data = false) {
39 return $this->log_error();
40 }
41
42 // download method: takes a file name (base name), and brings it back from the cloud storage into Updraft's directory
43 // You can register errors with $updraftplus->log("my error message", 'error')
44 public function download($file) {
45 return $this->log_error();
46 }
47
48 private function extra_config() {
49 }
50
51 // config_print: prints out table rows for the configuration screen
52 // Your rows need to have a class exactly matching your method (in this example, insufficientphp), and also a class of updraftplusmethod
53 // Note that logging is not available from this context; it will do nothing.
54 public function config_print() {
55
56 $this->extra_config();
57 ?>
58 <tr class="updraftplusmethod <?php echo $this->method;?>">
59 <th><?php echo htmlspecialchars($this->desc);?>:</th>
60 <td>
61 <em>
62 <?php echo ((!empty($this->image)) ? '<p><img src="'.UPDRAFTPLUS_URL.'/images/'.$this->image.'"></p>' : ''); ?>
63 <?php echo htmlspecialchars($this->error_msg_trans);?>
64 <?php echo htmlspecialchars(__('You will need to ask your web hosting company to upgrade.', 'updraftplus'));?>
65 <?php echo sprintf(__('Your %s version: %s.', 'updraftplus'), 'PHP', phpversion());?>
66 </em>
67 </td>
68 </tr>
69 <?php
70
71 }
72
73 }
74