{{{ssl_certificates_errors_link_text}}}
'.__('Examples of S3-compatible storage providers:', 'updraftplus').' DigitalOcean Spaces, Linode Object Storage, Cloudian, Connectria, Constant, Eucalyptus, Nifty, Cloudn, MEGA S4, IDrive e2'.__('... 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).", 'updraftplus'), 'XMLWriter').' '.__("Please contact your web hosting provider's support and ask for them to enable it.", 'updraftplus'), $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).", 'updraftplus'), 'SimpleXMLElement').' '.__("Please contact your web hosting provider's support.", 'updraftplus').' '.sprintf(__("UpdraftPlus's %s module requires %s.", 'updraftplus'), $updraftplus->backup_methods[$this->get_id()], 'SimpleXMLElement').' '.__('Please do not file any support requests; there is no alternative.', 'updraftplus'), $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.', 'updraftplus').' '.__('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_signature_version_label' => __('Signature version', 'updraftplus'), 'input_signature_version_readmore' => wp_kses(''.__('(Read more)', 'updraftplus').'', $this->allowed_html_for_content_sanitisation()), 'input_signature_version_option_labels' => array( 'v4' => __('SigV4', 'updraftplus'), 'v2' => __('SigV2', '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) { $signature_version = !empty($config['signature_version']) ? $config['signature_version'] : apply_filters('updraftplus_s3_signature_version', 'v2', false, $this); // the 'v2' value used to be handled by the use_v4 class variable, but since the signature_version (dropdown) setting has been introduced then use_v4 class variable has been removed and is no longer needed if (is_callable(array($storage, 'setSignatureVersion'))) $storage->setSignatureVersion($signature_version); // we don't prioritise the hardcoded endpoint if signature_version is set, which means users are aware of this new option and intentionally set this option and/or save the settings if ((!empty($config['endpoint']) && preg_match('/\.(leviia|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 (empty($config['signature_version']) && preg_match('/\.(leviia|amazonaws|r2\.cloudflarestorage)\.com$/i', $config['endpoint'])) { if (is_callable(array($storage, 'setSignatureVersion'))) $storage->setSignatureVersion('v4'); } return $this->use_dns_bucket_name($storage, ''); } return false; } /** * Acts as a WordPress options filter * * @param Array $settings - pre-filtered settings * * @return Array filtered settings */ public function options_filter($settings) { $settings = parent::options_filter($settings); if (!empty($settings['version']) && !empty($settings['settings'])) { foreach ($settings['settings'] as $instance_id => $instance_settings) { if (!empty($instance_settings['endpoint'])) { $settings['settings'][$instance_id]['endpoint'] = preg_replace('/^(http|https):\/\//i', '', trim($instance_settings['endpoint'])); } } } return $settings; } }