Status: Not Configured '; if($wp_db_backup_destination_bb == 1 && !empty($wpdb_dest_bb_s3_bucket) && !empty($wpdb_dest_bb_s3_bucket_key) && !empty($wpdb_dest_bb_s3_bucket_secret) && !empty($wpdb_dest_bb_s3_bucket_host)) { $wpdbbkp_bb_s3_status=' '; } ?>

'.esc_html( $update_msg ).'

'; } if ( get_option( 'wpdb_dest_bb_s3_bucket_key' ) && get_option( 'wpdb_dest_bb_s3_bucket_secret' ) ) { try { // Check for CURL. if ( ! extension_loaded( 'curl' ) && ! @dl( 'so' === PHP_SHLIB_SUFFIX ? 'curl.so' : 'php_curl.dll' ) ) { // phpcs:ignore echo esc_html__("ERROR: CURL extension not loaded\n\n", 'wpdbbkp'); } $b2_authorize_url = "https://api.backblazeb2.com/b2api/v2/b2_authorize_account"; $credentials = base64_encode($wpdb_dest_bb_s3_bucket_key . ":" . $wpdb_dest_bb_s3_bucket_secret); // Authorize account $response = wp_remote_get($b2_authorize_url, array( 'headers' => array( 'Authorization' => 'Basic ' . $credentials ), 'timeout' => 60 // Extend timeout )); if(!is_wp_error($response)){ $body = wp_remote_retrieve_body($response); $data = json_decode($body); } if(is_wp_error($response) || empty($data->authorizationToken)){ echo ''.esc_html__( 'Invalid bucket name or Backblaze details' ,'wpdbbkp').''; } } catch ( Exception $e ) { echo ''.esc_html__( 'Invalid details' ,'wpdbbkp').''; } } ?>

name="wp_db_backup_destination_bb">