ersion_widgets_file = $this->_get_file_to_import( 'widgets-elementor.json' );
}
if ( $version_widgets_file ) {
$version_widgets = json_decode( $this->_get_local_file_content( $version_widgets_file ), true );
$widgets = wp_parse_args( $version_widgets, $widgets );
}
$widgets = json_decode( $this->links_replace( wp_json_encode( $widgets ) ), true );
// We don't want to undo user changes, so we look for changes first.
$this->_active_widgets = get_option( 'sidebars_widgets' );
$this->_widgets_counter = 1;
foreach ( $widgets as $area => $params ) {
if ( $params['flush'] ) {
$this->_flush_widget_area( $area );
}
if ( ! empty( $this->_active_widgets[ $area ] ) && $params['flush'] ) {
$this->_flush_widget_area( $area );
} elseif ( ! empty( $this->_active_widgets[ $area ] ) && ! $params['flush'] ) {
continue;
}
foreach ( $params['widgets'] as $widget => $args ) {
$this->_add_widget( $area, $widget, $args );
}
}
// Now save the $active_widgets array.
update_option( 'sidebars_widgets', $this->_active_widgets );
$this->response->add_msg( 'Widgets updated' );
}
private function _add_widget( $sidebar, $widget, $options = array() ) {
$this->_active_widgets[ $sidebar ][] = $widget . '-' . $this->_widgets_counter;
$widget_content = get_option( 'widget_' . $widget );
$widget_content[ $this->_widgets_counter ] = $options;
update_option( 'widget_' . $widget, $widget_content );
$this->_widgets_counter++;
}
private function _flush_widget_area( $area ) {
unset( $this->_active_widgets[ $area ] );
}
private function _import_sliders() {
if ( ! class_exists( 'RevSliderSlider' ) ) {
return;
}
foreach ( $this->_sliders as $slider_name ) {
$this->_revolution_import( $slider_name . '.zip' );
}
}
private function _import_wood_slider() {
for ( $i = 1; $i <= 5; $i++ ) {
if ( $file = $this->_get_file_to_import( 'slider-' . $i . '.json' ) ) {
$slider = json_decode( $this->_get_local_file_content( $file ), true );
$term = wp_insert_term(
$slider['name'],
'woodmart_slider',
array(
'slug' => $slider['slug'],
)
);
if ( is_wp_error( $term ) ) {
$id = $term->error_data['term_exists'];
} else {
$id = $term['term_id'];
}
foreach ( $slider['meta'] as $key => $value ) {
add_term_meta( $id, $key, $value, true );
}
}
}
}
private function _revolution_import( $filename ) {
if ( ! apply_filters( 'woodmart_old_sliders_import', false ) ) {
$file = $this->_download_file_to_import( $filename );
} else {
$file = $this->_get_file_to_import( $filename );
}
if ( ! $file ) {
return;
}
ob_start();
if ( class_exists( 'RevSliderSliderImport' ) ) {
$revapi = new RevSliderSliderImport();
$slider_result = $revapi->import_slider( true, $file );
} else {
$revapi = new RevSlider();
$slider_result = $revapi->importSliderFromPost( true, true, $file );
}
ob_end_clean();
}
private function _download_file_to_import( $filename ) {
$file = WOODMART_DUMMY_URL . $this->_version . '/' . $filename;
try {
$zip_file = download_url( $file );
if ( is_wp_error( $zip_file ) ) {
$this->response->add_msg( 'Can\'t download revslider file from the server ' . $file );
return false;
}
} catch ( Exception $e ) {
$this->response->add_msg( 'Can\'t download revslider file from the server ' . $file );
return false;
}
return $zip_file;
}
private function _get_file_to_import( $filename ) {
$file = $this->_get_version_folder() . $filename;
// Check if ZIP file exists
if ( ! file_exists( $file ) ) {
return false;
}
return $file;
}
private function _get_version_folder( $version = false ) {
if ( ! $version ) {
$version = $this->_version;
}
return $this->_file_path . $version . '/';
}
// Import extras
private function _import_extras() {
try {
$extra_file = $this->_get_version_folder( 'extras' ) . 'extras.xml';
ob_start();
// Run WP Importer for XML file
if ( file_exists( $extra_file ) ) {
$this->_importer->import( $extra_file );
}
$output = ob_get_contents();
ob_end_clean();
$this->response->add_msg( $output );
$this->add_menu_item_by_title(
'Shop',
3,
false,
'menu-left',
false,
array(
'block' => '201',
'design' => 'full-width',
)
);
} catch ( Exception $e ) {
$this->response->send_fail_msg( 'Error while importing extras' );
}
$this->response->add_msg( 'Extras updated' );
}
// Import header
private function _import_headers() {
try {
for ( $i = 1; $i <= 5; $i++ ) {
$header = $this->_get_file_to_import( 'header-' . $i . '.json' );
if ( 'elementor' === woodmart_get_current_page_builder() && file_exists( $this->_get_version_folder() . 'header-' . $i . '-elementor.json' ) ) {
$header = $this->_get_file_to_import( 'header-' . $i . '-elementor.json' );
}
if ( $header ) {
$default = ( $i == 1 ) ? true : false;
$this->_create_new_header( $header, $default );
}
}
} catch ( Exception $e ) {
$this->response->send_fail_msg( 'Error while importing header' );
}
$this->response->add_msg( 'Header updated' );
}
private function _create_new_header( $file, $default = false ) {
$builder = WOODMART_Header_Builder::get_instance();
$header_data = json_decode( $this->links_replace( $this->_get_local_file_content( $file ), '/' ), true );
$builder->list->add_header( $header_data['id'], $header_data['name'] );
$builder->factory->create_new( $header_data['id'], $header_data['name'], $header_data['structure'], $header_data['settings'] );
if ( $default ) {
update_option( 'whb_main_header', $header_data['id'] );
}
}
private function _import_options() {
global $xts_woodmart_options;
$file = $this->_get_file_to_import( 'options.json' );
if ( 'elementor' === woodmart_get_current_page_builder() && file_exists( $this->_get_version_folder() . 'options-elementor.json' ) ) {
$file = $this->_get_file_to_import( 'options-elementor.json' );
}
if ( ! $file ) {
return;
}
$new_options_json = $this->links_replace( $this->_get_local_file_content( $file ) );
$options = XTS\Options::get_instance();
// Merge new options with new resetting values
$version_type = $this->_woodmart_versions[ $this->_version ]['type'];
$new_options = wp_parse_args( json_decode( $new_options_json ), $this->_get_reset_options( $version_type ) );
// Set builder to WPB or Elementor.
$xts_woodmart_options['variation_gallery_storage_method'] = 'new';
$xts_woodmart_options['old_elements_classes'] = false;
// Merge new options with other existed ones
$new_options = wp_parse_args( $new_options, $xts_woodmart_options );
$pseudo_post_data = array(
'import-btn' => true,
'import_export' => json_encode( $new_options ),
);
$sanitized_options = $options->sanitize_before_save( $pseudo_post_data );
$options->update_options( $sanitized_options );
// Dynamic css options
delete_option( 'xts-theme_settings_default-file-data' );
delete_option( 'xts-theme_settings_default-css-data' );
delete_option( 'xts-theme_settings_default-version' );
delete_option( 'xts-theme_settings_default-site-url' );
delete_option( 'xts-theme_settings_default-status' );
$this->response->add_msg( 'Options updated' );
}
private function _get_reset_options( $version_type ) {
$reset_options = array();
( $version_type == 'base' ) ? $version_type = 'version' : '';
$reset_options_keys = woodmart_get_config( 'reset-options-' . $version_type );
foreach ( $reset_options_keys as $opt ) {
$reset_options[ $opt ] = $this->_get_default_option_value( $opt );
}
return $reset_options;
}
private function _get_default_option_value( $key ) {
$all_fields = Options::get_fields();
foreach ( $all_fields as $field ) {
if ( $field->args['id'] === $key ) {
return ( isset( $field->args['default'] ) ? $field->args['default'] : '' );
}
}
return '';
}
private function _get_local_file_content( $file ) {
ob_start();
include $file;
$file_content = ob_get_contents();
ob_end_clean();
return $file_content;
}
private function _load_importers() {
// Load Importer API
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! function_exists( 'WOODMART_Theme_Plugin' ) ) {
$this->response->send_fail_msg( 'Please install theme core plugin' );
}
// $this->_import_attachments = ( ! empty($_GET['import_attachments']) );
$importerError = false;
// check if wp_importer, the base importer class is available, otherwise include it
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) ) {
require_once $class_wp_importer;
} else {
$importerError = true;
}
}
$plugin_dir = WOODMART_Theme_Plugin()->plugin_path();
$path = apply_filters( 'woodmart_require', $plugin_dir . '/importer/wordpress-importer.php' );
if ( file_exists( $path ) ) {
require_once $path;
} else {
$this->response->send_fail_msg( 'wordpress-importer.php file doesn\'t exist' );
}
if ( $importerError !== false ) {
$this->response->send_fail_msg( 'The Auto importing script could not be loaded. Please use the WordPress importer and import the XML file that is located in your themes folder manually.' );
}
if ( class_exists( 'WP_Importer' ) && class_exists( 'WOODCORE_Import' ) ) {
$this->_importer = new WOODCORE_Import();
} else {
$this->response->send_fail_msg( 'Can\'t find WP_Importer or WOODCORE_Import class' );
}
}
private function _is_valid_version_slug( $ver ) {
if ( in_array( $ver, array_keys( $this->_woodmart_versions ) ) ) {
return true;
}
return false;
}
private function _need_process( $process ) {
return in_array( $process, $this->_process );
}
public function before_import() {
$file = $this->_get_version_folder() . 'after.php';
if ( ! file_exists( $file ) ) {
return;
}
require $file;
$base_import_class = 'WOODMART_Importversion_';
$version_import_class = $base_import_class . $this->_version;
if ( ! class_exists( $version_import_class ) ) {
return;
}
$this->after_import = new $version_import_class( false, false, false, false );
$this->after_import->before();
}
public function after_import() {
if ( $this->after_import == null ) {
return;
}
$this->after_import->after();
}
/**
* Replace link.
*
* @since 1.0.0
*
* @param string $data Data.
* @param string $replace Replace.
*
* @return string|string[]
*/
private function links_replace( $data, $replace = '\/' ) {
$links = $this->links;
foreach ( $links as $key => $value ) {
if ( 'uploads' === $key ) {
foreach ( $value as $link ) {
$url_data = wp_upload_dir();
$data = str_replace( str_replace( '/', $replace, $link ), str_replace( '/', $replace, $url_data['baseurl'] . '/' ), $data );
}
}
if ( 'simple' === $key ) {
foreach ( $value as $link ) {
$data = str_replace( str_replace( '/', $replace, $link ), str_replace( '/', $replace, get_home_url() . '/' ), $data );
}
}
}
return $data;
}
/**
* Replace URL.
*
* @since 1.0.0
*/
private function replace_db_urls() {
$links = $this->links;
foreach ( $links as $key => $value ) {
if ( 'uploads' === $key ) {
foreach ( $value as $link ) {
$url_data = wp_upload_dir();
if ( woodmart_is_elementor_installed() ) {
Utils::replace_urls( $link, $url_data['baseurl'] . '/' );
} else {
$this->wpb_replace_urls( $link, $url_data['baseurl'] . '/' );
}
}
}
if ( 'simple' === $key ) {
foreach ( $value as $link ) {
if ( woodmart_is_elementor_installed() ) {
Utils::replace_urls( $link, get_home_url() . '/' );
} else {
$this->wpb_replace_urls( $link, get_home_url() . '/' );
}
}
}
}
}
/**
* Replace URLs.
*
* Replace old URLs to new URLs. This method also updates all the Elementor data.
*
* @since 2.1.0
* @static
* @access public
*
* @param $from
* @param $to
*
* @return string
* @throws \Exception
*/
private function wpb_replace_urls( $from, $to ) {
$from = trim( $from );
$to = trim( $to );
if ( $from === $to ) {
throw new \Exception( __( 'The `from` and `to` URL\'s must be different', 'elementor' ) );
}
$is_valid_urls = ( filter_var( $from, FILTER_VALIDATE_URL ) && filter_var( $to, FILTER_VALIDATE_URL ) );
if ( ! $is_valid_urls ) {
throw new \Exception( __( 'The `from` and `to` URL\'s must be valid URL\'s', 'elementor' ) );
}
global $wpdb;
// @codingStandardsIgnoreStart cannot use `$wpdb->prepare` because it remove's the backslashes
$rows_affected = $wpdb->query(
"UPDATE {$wpdb->postmeta} " .
"SET `meta_value` = REPLACE(`meta_value`, '" . $from . "', '" . $to . "') " .
"WHERE `meta_key` = '_wpb_shortcodes_custom_css'" ); // meta_value LIKE '[%' are json formatted
// @codingStandardsIgnoreEnd
if ( false === $rows_affected ) {
throw new \Exception( __( 'An error occurred', 'elementor' ) );
}
return sprintf(
/* translators: %d: Number of rows */
_n( '%d row affected.', '%d rows affected.', $rows_affected, 'elementor' ),
$rows_affected
);
}
}
Samsung A71 anti shock back case – alibabatelecom
View cart “Samsung S10 plus battery” has been added to your cart.
Samsung A71 anti shock back case 199.00 kr
Note: the photos are general photos of transparent anti-shock case. we will send the correct model and size
Anti Shock military-grade protective case with shock-absorbent corners
Air-Guard Corners
This military-grade protective case has shock-absorbing Air-Guard corners that offer added protection against short-distance drops & bumps.
Hybrid Protection
Combining a flexible TPU frame and shock-absorbent corners
Looks and Feels Great
A fully-transparent design allows this clear case to showcase your phones original look. The flexible TPU bumper offers a secure and comfortable grip.
Brand
Gorilla Anti-Shock
samsung-a-series
Samsung A71
22 in stock
Description
Anti Shock military-grade protective case with shock-absorbent corners
Air-Guard Corners
This military-grade protective case has shock-absorbing Air-Guard corners that offer added protection against short-distance drops & bumps.
Hybrid Protection
Combining a flexible TPU frame and shock-absorbent corners, this case provides comprehensive protection without sacrificing clarity. Raised edges help prevent your screen and camera from rubbing against flat surfaces and getting scratched.
Looks and Feels Great
A fully-transparent design allows this clear case to showcase your phones original look. The flexible TPU bumper offers a secure and comfortable grip.
Ultra clear transparent case, anti scratch performance with higher quality back.
Precise cutout easy access to all accessories, button wrapped anti-dust and response as original.
Enhanced raised edge of the screen,protruding camera and 4 corners of the back offer strong protection against drops, bumps and shocks
About brand
This case can be easily installed or removed, without damaging your phone, due to its soft and flexible body. Added features include larger ports and precise cutting for all ports, camera, buttons, and speaker. Ultra-thin and slim design fits nicely in your hand and is pocket-friendly. Comfortable non-slip grip and soft touch. Not easy to be broken and extremely durable.
Reviews
There are no reviews yet.