Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../methods
File: insufficient.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed.');
[2] Fix | Delete
[3] Fix | Delete
if (!class_exists('UpdraftPlus_BackupModule')) require_once(UPDRAFTPLUS_DIR.'/methods/backup-module.php');
[4] Fix | Delete
[5] Fix | Delete
class UpdraftPlus_BackupModule_insufficientphp extends UpdraftPlus_BackupModule {
[6] Fix | Delete
[7] Fix | Delete
private $required_php;
[8] Fix | Delete
[9] Fix | Delete
private $error_msg;
[10] Fix | Delete
[11] Fix | Delete
private $method;
[12] Fix | Delete
[13] Fix | Delete
public function __construct($method, $desc, $php, $image = null) {
[14] Fix | Delete
$this->method = $method;
[15] Fix | Delete
$this->desc = $desc;
[16] Fix | Delete
$this->required_php = $php;
[17] Fix | Delete
$this->image = $image;
[18] Fix | Delete
$this->error_msg = 'This remote storage method ('.$this->desc.') requires PHP '.$this->required_php.' or later';
[19] Fix | Delete
$this->error_msg_trans = sprintf(__('This remote storage method (%s) requires PHP %s or later.', 'updraftplus'), $this->desc, $this->required_php);
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
private function log_error() {
[23] Fix | Delete
global $updraftplus;
[24] Fix | Delete
$updraftplus->log($this->error_msg);
[25] Fix | Delete
$updraftplus->log($this->error_msg_trans, 'error', 'insufficientphp');
[26] Fix | Delete
return false;
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* backup method: takes an array, and shovels them off to the cloud storage
[31] Fix | Delete
*
[32] Fix | Delete
* @param array $backup_array An array backups
[33] Fix | Delete
* @return Array
[34] Fix | Delete
*/
[35] Fix | Delete
public function backup($backup_array) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[36] Fix | Delete
return $this->log_error();
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Retrieve a list of supported features for this storage method
[41] Fix | Delete
*
[42] Fix | Delete
* Currently known features:
[43] Fix | Delete
*
[44] Fix | Delete
* - multi_options : indicates that the remote storage module
[45] Fix | Delete
* can handle its options being in the Feb-2017 multi-options
[46] Fix | Delete
* format. N.B. This only indicates options handling, not any
[47] Fix | Delete
* other multi-destination options.
[48] Fix | Delete
*
[49] Fix | Delete
* - multi_servers : not implemented yet: indicates that the
[50] Fix | Delete
* remote storage module can handle multiple servers at backup
[51] Fix | Delete
* time. This should not be specified without multi_options.
[52] Fix | Delete
* multi_options without multi_servers is fine - it will just
[53] Fix | Delete
* cause only the first entry in the options array to be used.
[54] Fix | Delete
*
[55] Fix | Delete
* - config_templates : not implemented yet: indicates that
[56] Fix | Delete
* the remote storage module can output its configuration in
[57] Fix | Delete
* Handlebars format via the get_configuration_template() method.
[58] Fix | Delete
*
[59] Fix | Delete
* @return Array - an array of supported features (any features not
[60] Fix | Delete
* mentioned are assumed to not be supported)
[61] Fix | Delete
*/
[62] Fix | Delete
public function get_supported_features() {
[63] Fix | Delete
// The 'multi_options' options format is handled via only accessing options via $this->get_options()
[64] Fix | Delete
return array('multi_options', 'config_templates');
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
/**
[68] Fix | Delete
* $match: a substring to require (tested via strpos() !== false)
[69] Fix | Delete
*
[70] Fix | Delete
* @param String $match THis will specify which match is used for the SQL but by default it is set to 'backup_' unless specified
[71] Fix | Delete
* @return Array
[72] Fix | Delete
*/
[73] Fix | Delete
public function listfiles($match = 'backup_') {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[74] Fix | Delete
return new WP_Error('insufficient_php', $this->error_msg_trans);
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* delete method: takes an array of file names (base name) or a single string, and removes them from the cloud storage
[79] Fix | Delete
*
[80] Fix | Delete
* @param String $files List of files
[81] Fix | Delete
* @param Boolean $data Specifies data or not
[82] Fix | Delete
* @param array $sizeinfo This is the size info on the file.
[83] Fix | Delete
* @return Array
[84] Fix | Delete
*/
[85] Fix | Delete
public function delete($files, $data = false, $sizeinfo = array()) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[86] Fix | Delete
return $this->log_error();
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* download method: takes a file name (base name), and brings it back from the cloud storage into Updraft's directory
[91] Fix | Delete
* You can register errors with $updraftplus->log("my error message", 'error')
[92] Fix | Delete
*
[93] Fix | Delete
* @param String $file List of files
[94] Fix | Delete
* @return Array
[95] Fix | Delete
*/
[96] Fix | Delete
public function download($file) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[97] Fix | Delete
return $this->log_error();
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
private function extra_config() {
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
/**
[104] Fix | Delete
* Get the configuration template
[105] Fix | Delete
*
[106] Fix | Delete
* @return String - the template, ready for substitutions to be carried out
[107] Fix | Delete
*/
[108] Fix | Delete
public function get_configuration_template() {
[109] Fix | Delete
ob_start();
[110] Fix | Delete
$this->extra_config();
[111] Fix | Delete
?>
[112] Fix | Delete
<tr class="updraftplusmethod <?php echo $this->method;?>">
[113] Fix | Delete
<th><?php echo htmlspecialchars($this->desc);?>:</th>
[114] Fix | Delete
<td>
[115] Fix | Delete
<em>
[116] Fix | Delete
<?php echo (!empty($this->image)) ? '<p><img src="'.UPDRAFTPLUS_URL.'/images/'.$this->image.'"></p>' : ''; ?>
[117] Fix | Delete
<?php echo htmlspecialchars($this->error_msg_trans);?>
[118] Fix | Delete
<?php echo htmlspecialchars(__('You will need to ask your web hosting company to upgrade.', 'updraftplus'));?>
[119] Fix | Delete
<?php echo sprintf(__('Your %s version: %s.', 'updraftplus'), 'PHP', phpversion());?>
[120] Fix | Delete
</em>
[121] Fix | Delete
</td>
[122] Fix | Delete
</tr>
[123] Fix | Delete
<?php
[124] Fix | Delete
return ob_get_clean();
[125] Fix | Delete
}
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function