/home/techb158/balacoffee.com/wp-content/plugins/updraftplus/methods
NameSizeModeActions
addon-not-yet-present.php61980644editdlrm
azure.php11770644editdlrm
backblaze.php11990644editdlrm
backup-module.php317710644editdlrm
cloudfiles-new.php155860644editdlrm
cloudfiles.php229840644editdlrm
dreamobjects.php110840644editdlrm
dropbox.php444410644editdlrm
email.php59050644editdlrm
ftp.php191880644editdlrm
googlecloud.php12040644editdlrm
googledrive.php683480644editdlrm
insufficient.php50500644editdlrm
onedrive.php11330644editdlrm
openstack-base.php237300644editdlrm
openstack.php5790644editdlrm
openstack2.php126050644editdlrm
pcloud.php7260644editdlrm
s3.php659530644editdlrm
s3generic.php118860644editdlrm
sftp.php11880644editdlrm
template.php52810644editdlrm
updraftvault.php508200644editdlrm
webdav.php11220644editdlrm
Edit: /home/techb158/balacoffee.com/wp-content/plugins/updraftplus/methods/s3generic.php (11886B)
get_config(); $endpoint = ('' != $region && 'n/a' != $region) ? $region : $config['endpoint']; $log_message = "Set endpoint (".get_class($obj)."): $endpoint"; $log_message_append = ''; if (is_string($endpoint) && preg_match('/^(.*):(\d+)$/', $endpoint, $matches)) { $endpoint = $matches[1]; $port = $matches[2]; $log_message_append = ", port=$port"; $obj->setPort($port); } // This provider requires domain-style access. In future it might be better to provide an option rather than hard-coding the knowledge. if (is_string($endpoint) && preg_match('/\.aliyuncs\.com$/i', $endpoint)) { $obj->useDNSBucketName(true, $bucket_name); } global $updraftplus; if ($updraftplus->backup_time) $this->log($log_message.$log_message_append); $obj->setEndpoint($endpoint); } /** * This method overrides the parent method and lists the supported features of this remote storage option. * * @return Array - an array of supported features (any features not mentioned are asuumed to not be supported) */ public function get_supported_features() { // This options format is handled via only accessing options via $this->get_options() return array('multi_options', 'config_templates', 'multi_storage', 'conditional_logic'); } /** * Retrieve default options for this remote storage module. * * @return Array - an array of options */ public function get_default_options() { return array( 'accesskey' => '', 'secretkey' => '', 'path' => '', 'endpoint' => '', ); } /** * Retrieve specific options for this remote storage module * * @param Boolean $force_refresh - if set, and if relevant, don't use cached credentials, but get them afresh * * @return Array - an array of options */ protected function get_config($force_refresh = false) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- Filter use $opts = $this->get_options(); $opts['whoweare'] = 'S3'; $opts['whoweare_long'] = __('S3 (Compatible)', 'updraftplus'); $opts['key'] = 's3generic'; return $opts; } /** * Get the pre configuration template */ public function get_pre_configuration_template() { ?> {{{pre_template_opening_html}}}
{{{xmlwriter_existence_label}}} {{{simplexmlelement_existence_label}}} {{{curl_existence_label}}}

{{{ssl_certificates_errors_link_text}}}

partial_template_name }}) * * @return Array an associative array keyed by name of the partial templates */ public function get_partial_templates() { $partial_templates = array(); $partial_templates['s3generic_additional_configuration_top'] = ''; ob_start(); ?> {{input_endpoint_label}}: {{input_bucket_access_style_label}}:
{{{input_bucket_access_style_readmore}}} get_id().'_partial_templates', $partial_templates), parent::get_partial_templates()); } /** * Modifies handerbar template options * The function require because It should override parent class's UpdraftPlus_BackupModule_s3::transform_options_for_template() functionality with no operation. * * @param array $opts * @return Array - Modified handerbar template options */ public function transform_options_for_template($opts) { return $opts; } /** * Check whether options have been set up by the user, or not * * @param Array $opts - the potential options * * @return Boolean */ public function options_exist($opts) { return (parent::options_exist($opts) && !empty($opts['endpoint'])); } /** * Retrieve a list of template properties by taking all the persistent variables and methods of the parent class and combining them with the ones that are unique to this module, also the necessary HTML element attributes and texts which are also unique only to this backup module * NOTE: Please sanitise all strings that are required to be shown as HTML content on the frontend side (i.e. wp_kses()), or any other technique to prevent XSS attacks that could come via WP hooks * * @return Array an associative array keyed by names that describe themselves as they are */ public function get_template_properties() { global $updraftplus, $updraftplus_admin; $properties = array( 'pre_template_opening_html' => wp_kses('

'.__('Examples of S3-compatible storage providers:', 'updraftplus').' DigitalOcean Spaces, Linode Object Storage, Cloudian, Connectria, Constant, Eucalyptus, Nifty, Cloudn'.__('... and many more!', 'updraftplus').'

', $this->allowed_html_for_content_sanitisation()), 'xmlwriter_existence_label' => !apply_filters('updraftplus_s3generic_xmlwriter_exists', 'UpdraftPlus_S3_Compat' != $this->indicate_s3_class() || !class_exists('XMLWriter')) ? wp_kses($updraftplus_admin->show_double_warning(''.__('Warning', 'updraftplus').': '.sprintf(__("Your web server's PHP installation does not include a required module (%s). Please contact your web hosting provider's support and ask for them to enable it.", 'updraftplus'), 'XMLWriter'), $this->get_id(), false), $this->allowed_html_for_content_sanitisation()) : '', 'simplexmlelement_existence_label' => !apply_filters('updraftplus_s3generic_simplexmlelement_exists', class_exists('SimpleXMLElement')) ? wp_kses($updraftplus_admin->show_double_warning(''.__('Warning', 'updraftplus').': '.sprintf(__("Your web server's PHP installation does not include a required module (%s). Please contact your web hosting provider's support.", 'updraftplus'), 'SimpleXMLElement').' '.sprintf(__("UpdraftPlus's %s module requires %s. Please do not file any support requests; there is no alternative.", 'updraftplus'), $updraftplus->backup_methods[$this->get_id()], 'SimpleXMLElement'), $this->get_id(), false), $this->allowed_html_for_content_sanitisation()) : '', 'curl_existence_label' => wp_kses($updraftplus_admin->curl_check($updraftplus->backup_methods[$this->get_id()], true, $this->get_id().' hide-in-udc', false), $this->allowed_html_for_content_sanitisation()), 'ssl_certificates_errors_link_text' => wp_kses(''.__('If you see errors about SSL certificates, then please go here for help.', 'updraftplus').'', $this->allowed_html_for_content_sanitisation()), 'input_access_key_label' => sprintf(__('%s access key', 'updraftplus'), 'S3'), 'input_secret_key_label' => sprintf(__('%s secret key', 'updraftplus'), 'S3'), 'input_secret_key_type' => apply_filters('updraftplus_admin_secret_field_type', 'password'), 'input_location_label' => sprintf(__('%s location', 'updraftplus'), 'S3'), 'input_location_title' => __('Enter only a bucket name or a bucket and path. Examples: mybucket, mybucket/mypath', 'updraftplus'), 'input_endpoint_label' => sprintf(__('%s end-point', 'updraftplus'), 'S3'), 'input_bucket_access_style_label' => __('Bucket access style', 'updraftplus'), 'input_bucket_access_style_readmore' => wp_kses(''.__('(Read more)', 'updraftplus').'', $this->allowed_html_for_content_sanitisation()), 'input_bucket_access_style_option_labels' => array( 'path_style' => __('Path style', 'updraftplus'), 'virtual_host_style' => __('Virtual-host style', 'updraftplus'), ), 'input_test_label' => sprintf(__('Test %s Settings', 'updraftplus'), $updraftplus->backup_methods[$this->get_id()]), ); return wp_parse_args($properties, $this->get_persistent_variables_and_methods()); } /** * Use DNS bucket name if the remote storage is found to be using s3generic and its bucket access style is set to virtual-host * * @param Object $storage - S3 Name * @param String $bucket - storage path * @param Array $config - configuration - may not be complete at this stage, so be careful about which properties are used * * * @return Boolean true if currently processing s3generic remote storage that uses virtual-host style, false otherwise */ protected function maybe_use_dns_bucket_name($storage, $bucket, $config) { if ((!empty($config['endpoint']) && preg_match('/\.(aliyuncs|r2\.cloudflarestorage)\.com$/i', $config['endpoint'])) || (!empty($config['bucket_access_style']) && 'virtual_host_style' === $config['bucket_access_style'])) { // due to the recent merge of S3-generic bucket access style on March 2021, if virtual-host bucket access style is selected, connecting to an amazonaws bucket location where the user doesn't have an access to it will throw an S3 InvalidRequest exception. It requires the signature to be set to version 4 // Cloudflare R2 supports V4 only if (preg_match('/\.(amazonaws|r2\.cloudflarestorage)\.com$/i', $config['endpoint'])) { $this->use_v4 = true; if (is_callable(array($storage, 'setSignatureVersion'))) $storage->setSignatureVersion('v4'); } return $this->use_dns_bucket_name($storage, ''); } else { return false; } } }