$dashboard_status, 'top_bg_type' => $top_bg_type, 'top_color' => $top_color, 'top_image' => $top_image, 'top_cover' => $top_cover, 'top_repeat' => $top_repeat, 'top_position' => $top_position, 'top_attachment' => $top_attachment, 'top_slideshow_no' => $top_slideshow_no, 'top_bg_slider_animation' => $top_bg_slider_animation, 'login_bg_type' => $login_bg_type, 'login_form_float' => $login_form_float, 'login_bg_color' => $login_bg_color, 'login_bg_effect' => $login_bg_effect, 'login_bg_image' => $login_bg_image, 'login_form_opacity' => $login_form_opacity, 'login_form_width' => $login_form_width, 'login_form_radius' => $login_form_radius, 'login_border_style' => $login_border_style, 'login_border_thikness' => $login_border_thikness, 'login_border_color' => $login_border_color, 'login_bg_repeat' => $login_bg_repeat, 'login_bg_position' => $login_bg_position, 'login_enable_shadow' => $login_enable_shadow, 'login_shadow_color' => $login_shadow_color, 'heading_font_color' => $heading_font_color, 'input_font_color' => $input_font_color, 'link_color' => $link_color, 'button_color' => $button_color, 'heading_font_size' => $heading_font_size, 'input_font_size' => $input_font_size, 'link_size' => $link_size, 'button_font_size' => $button_font_size, 'enable_link_shadow' => $enable_link_shadow, 'link_shadow_color' => $link_shadow_colo, 'heading_font_style' => $heading_font_style, 'input_font_style' => $input_font_style, 'link_font_style' => $link_font_style, 'button_font_style' => $button_font_style, 'enable_inputbox_icon' => $enable_inputbox_icon, 'user_input_icon' => $user_input_icon, 'password_input_icon' => $password_input_icon, 'logo_image' => $logo_image, 'logo_width' => $logo_width, 'logo_height' => $logo_height, 'logo_url' => $logo_url, 'logo_url_title' => $logo_url_title, 'enable_social_icon' => $enable_social_icon, 'social_icon_size' => $social_icon_size , 'social_icon_layout' => $social_icon_layout , 'social_icon_color' => $social_icon_color , 'social_icon_color_onhover' => $social_icon_color_onhover , 'social_icon_bg' => $social_icon_bg, 'social_icon_bg_onhover' => $social_icon_bg_onhover , 'social_facebook_link' => $social_facebook_link , 'social_twitter_link' => $social_twitter_link, 'social_linkedin_link' => $social_linkedin_link, 'social_google_plus_link' => $social_google_plus_link, 'social_pinterest_link' => $social_pinterest_link, 'Slidshow_image_1' => $Slidshow_image_1, 'Slidshow_image_2' => $Slidshow_image_2, 'Slidshow_image_3' => $Slidshow_image_3, 'Slidshow_image_4' => $Slidshow_image_4, 'Slidshow_image_5' => $Slidshow_image_5, 'Slidshow_image_6' => $Slidshow_image_6, 'Slidshow_image_label_1' => $Slidshow_image_label_1, 'Slidshow_image_label_2' => $Slidshow_image_label_2, 'Slidshow_image_label_3' => $Slidshow_image_label_3, 'Slidshow_image_label_4' => $Slidshow_image_label_4, 'Slidshow_image_label_5' => $Slidshow_image_label_5, 'Slidshow_image_label_6' => $Slidshow_image_label_6 )); ignore_user_abort( true ); nocache_headers(); header( 'Content-Type: application/json; charset=utf-8' ); header( 'Content-Disposition: attachment; filename=pwsix-settings-export-' . date( 'm-d-Y' ) . '.json' ); header( "Expires: 0" ); echo json_encode( $ACL_ALL_Settings ); exit; } add_action( 'admin_init', 'acl_export_settings' ); /** * Process a settings import from a json file */ function acl_import_settings() { if( empty( $_POST['acl_action'] ) || 'import_settings' != $_POST['acl_action'] ) return; if( ! wp_verify_nonce( $_POST['acl_import_nonce'], 'acl_import_nonce' ) ) return; if( ! current_user_can( 'manage_options' ) ) return; list($oteher_extension, $extension) = explode(".", $_FILES['import_file']['name']); //$extension = end( explode( '.', $_FILES['import_file']['name'] ) ); if( $extension != 'json' ) { wp_die( __( 'Please upload a valid .json file' ) ); } $import_file = $_FILES['import_file']['tmp_name']; if( empty( $import_file ) ) { wp_die( __( 'Please upload a file to import' ) ); } // Retrieve the settings from the file. $settings = json_decode( file_get_contents( $import_file ) ); $ACL_Settings = unserialize($settings); $dashboard_status = $ACL_Settings['dashboard_status']; $top_bg_type = $ACL_Settings['top_bg_type']; $top_color = $ACL_Settings['top_color']; $top_image = $ACL_Settings['top_image']; $top_cover = $ACL_Settings['top_cover']; $top_repeat = $ACL_Settings['top_repeat']; $top_position = $ACL_Settings['top_position']; $top_attachment = $ACL_Settings['top_attachment']; $top_slideshow_no = $ACL_Settings['top_slideshow_no']; $top_bg_slider_animation = $ACL_Settings['top_bg_slider_animation']; $login_bg_type = $ACL_Settings['login_bg_type']; $login_form_float = $ACL_Settings['login_form_float']; $login_bg_color = $ACL_Settings['login_bg_color']; $login_bg_effect = $ACL_Settings['login_bg_effect']; $login_bg_image = $ACL_Settings['login_bg_image']; $login_form_opacity = $ACL_Settings['login_form_opacity']; $login_form_width = $ACL_Settings['login_form_width']; $login_form_radius = $ACL_Settings['login_form_radius']; $login_border_style = $ACL_Settings['login_border_style']; $login_border_thikness = $ACL_Settings['login_border_thikness']; $login_border_color = $ACL_Settings['login_border_color']; $login_bg_repeat = $ACL_Settings['login_bg_repeat']; $login_bg_position = $ACL_Settings['login_bg_position']; $login_enable_shadow = $ACL_Settings['login_enable_shadow']; $login_shadow_color = $ACL_Settings['login_shadow_color']; $heading_font_color = $ACL_Settings['heading_font_color']; $input_font_color = $ACL_Settings['input_font_color']; $link_color = $ACL_Settings['link_color']; $button_color = $ACL_Settings['button_color']; $heading_font_size = $ACL_Settings['heading_font_size']; $input_font_size = $ACL_Settings['input_font_size']; $link_size = $ACL_Settings['link_size']; $button_font_size = $ACL_Settings['button_font_size']; $enable_link_shadow = $ACL_Settings['enable_link_shadow']; $link_shadow_color = $ACL_Settings['link_shadow_color']; $heading_font_style = $ACL_Settings['heading_font_style']; $input_font_style = $ACL_Settings['input_font_style']; $link_font_style = $ACL_Settings['link_font_style']; $button_font_style = $ACL_Settings['button_font_style']; $enable_inputbox_icon = $ACL_Settings['enable_inputbox_icon']; $user_input_icon = $ACL_Settings['user_input_icon']; $password_input_icon = $ACL_Settings['password_input_icon']; $logo_image = $ACL_Settings['logo_image']; $logo_width = $ACL_Settings['logo_width']; $logo_height = $ACL_Settings['logo_height']; $logo_url = $ACL_Settings['logo_url']; $logo_url_title = $ACL_Settings['logo_url_title']; $Slidshow_image_1 = $ACL_Settings['Slidshow_image_1']; $Slidshow_image_2 = $ACL_Settings['Slidshow_image_2']; $Slidshow_image_3 = $ACL_Settings['Slidshow_image_3']; $Slidshow_image_4 = $ACL_Settings['Slidshow_image_4']; $Slidshow_image_5 = $ACL_Settings['Slidshow_image_5']; $Slidshow_image_6 = $ACL_Settings['Slidshow_image_6']; $Slidshow_image_label_1 = $ACL_Settings['Slidshow_image_label_1']; $Slidshow_image_label_2 = $ACL_Settings['Slidshow_image_label_2']; $Slidshow_image_label_3 = $ACL_Settings['Slidshow_image_label_3']; $Slidshow_image_label_4 = $ACL_Settings['Slidshow_image_label_4']; $Slidshow_image_label_5 = $ACL_Settings['Slidshow_image_label_5']; $Slidshow_image_label_6 = $ACL_Settings['Slidshow_image_label_6']; $enable_social_icon = $ACL_Settings['enable_social_icon']; $social_icon_size = $ACL_Settings['social_icon_size']; $social_icon_layout = $ACL_Settings['social_icon_layout']; $social_icon_color = $ACL_Settings['social_icon_color']; $social_icon_color_onhover= $ACL_Settings['social_icon_color_onhover']; $social_icon_bg = $ACL_Settings['social_icon_bg']; $social_icon_bg_onhover = $ACL_Settings['social_icon_bg_onhover']; $social_facebook_link = $ACL_Settings['social_facebook_link']; $social_twitter_link = $ACL_Settings['social_twitter_link']; $social_linkedin_link = $ACL_Settings['social_linkedin_link']; $social_google_plus_link= $ACL_Settings['social_google_plus_link']; $social_pinterest_link = $ACL_Settings['social_pinterest_link']; $upload_dir = wp_upload_dir(); $plugins_dir = plugins_url(); // Top Background Image $data = $top_image; if (strpos($data,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $data); $top_image = $upload_dir['baseurl']. $image_path; }else if (strpos($data,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $data); $top_image = $plugins_dir. $image_path; } // Login From Background Image $data1 = $login_bg_image; if (strpos($data1,'uploads') == true) { list($oteher_path1, $image_path1) = explode("uploads", $data1); $login_bg_image = $upload_dir['baseurl']. $image_path1; }else if (strpos($data1,'plugins') == true){ list($oteher_path1, $image_path1) = explode("plugins", $data1); $login_bg_image = $plugins_dir. $image_path1; } // Login From Background Image $data2 = $logo_image; if (strpos($data2,'uploads') == true) { list($oteher_path2, $image_path2) = explode("uploads", $data2); $logo_image = $upload_dir['baseurl']. $image_path2; }else if (strpos($data2,'plugins') == true){ list($oteher_path2, $image_path2) = explode("plugins", $data2); $logo_image = $plugins_dir. $image_path2; } // Slider Image 1 $Slidshow_image_url_1 = $Slidshow_image_1; if (strpos($Slidshow_image_url_1,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_1); $Slidshow_image_1 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_1,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_1); $Slidshow_image_1 = $plugins_dir. $image_path; } // Slider Image 2 $Slidshow_image_url_2 = $Slidshow_image_2; if (strpos($Slidshow_image_url_2,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_2); $Slidshow_image_2 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_2,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_2); $Slidshow_image_2 = $plugins_dir. $image_path; } // Slider Image 3 $Slidshow_image_url_3 = $Slidshow_image_3; if (strpos($Slidshow_image_url_3,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_3); $Slidshow_image_3 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_3,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_3); $Slidshow_image_3 = $plugins_dir. $image_path; } // Slider Image 4 $Slidshow_image_url_4 = $Slidshow_image_4; if (strpos($Slidshow_image_url_4,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_4); $Slidshow_image_4 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_4,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_4); $Slidshow_image_4 = $plugins_dir. $image_path; } // Slider Image 5 $Slidshow_image_url_5 = $Slidshow_image_5; if (strpos($Slidshow_image_url_5,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_5); $Slidshow_image_5 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_5,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_5); $Slidshow_image_5 = $plugins_dir. $image_path; } // Slider Image 6 $Slidshow_image_url_6 = $Slidshow_image_6; if (strpos($Slidshow_image_url_6,'uploads') == true) { list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_6); $Slidshow_image_6 = $upload_dir['baseurl']. $image_path; }else if (strpos($Slidshow_image_url_6,'plugins') == true){ list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_6); $Slidshow_image_6 = $plugins_dir. $image_path; } $dashboard_page= serialize(array( 'dashboard_status' => $dashboard_status )); update_option('Admin_custome_login_dashboard', $dashboard_page); $top_page= serialize(array( 'top_bg_type' => $top_bg_type , 'top_color' => $top_color , 'top_image' => $top_image, 'top_cover' => $top_cover, 'top_repeat' => $top_repeat , 'top_position' => $top_position , 'top_attachment' => $top_attachment, 'top_slideshow_no' => $top_slideshow_no, 'top_bg_slider_animation' => $top_bg_slider_animation )); update_option('Admin_custome_login_top', $top_page); $login_page= serialize(array( 'login_bg_type' => $login_bg_type, 'login_form_float' => $login_form_float, 'login_bg_color' => $login_bg_color, 'login_bg_effect' => $login_bg_effect, 'login_bg_image' => $login_bg_image, 'login_form_opacity' => $login_form_opacity, 'login_form_width' => $login_form_width, 'login_form_radius' => $login_form_radius, 'login_border_style' => $login_border_style, 'login_border_thikness' => $login_border_thikness, 'login_border_color' => $login_border_color, 'login_bg_repeat' => $login_bg_repeat, 'login_bg_position' => $login_bg_position, 'login_enable_shadow' => $login_enable_shadow, 'login_shadow_color' => $login_shadow_color )); update_option('Admin_custome_login_login', $login_page); $text_and_color_page= serialize(array( 'heading_font_color' => $heading_font_color, 'input_font_color' => $input_font_color, 'link_color' => $link_color, 'button_color' => $button_color, 'heading_font_size' => $heading_font_size, 'input_font_size' => $input_font_size, 'link_size' => $link_size, 'button_font_size' => $button_font_size, 'enable_link_shadow' => $enable_link_shadow, 'link_shadow_color' => $link_shadow_color, 'heading_font_style' => $heading_font_style, 'input_font_style' => $input_font_style, 'link_font_style' => $link_font_style, 'button_font_style' => $button_font_style, 'enable_inputbox_icon' => $enable_inputbox_icon, 'user_input_icon' => $user_input_icon, 'password_input_icon' => $password_input_icon )); update_option('Admin_custome_login_text', $text_and_color_page); $logo_page= serialize(array( 'logo_image' => $logo_image, 'logo_width' => $logo_width, 'logo_height' => $logo_height, 'logo_url' => $logo_url, 'logo_url_title' => $logo_url_title )); update_option('Admin_custome_login_logo', $logo_page); $Social_page= serialize(array( 'enable_social_icon' => $enable_social_icon , 'social_icon_size' => $social_icon_size , 'social_icon_layout' => $social_icon_layout , 'social_icon_color' => $social_icon_color , 'social_icon_color_onhover'=> $social_icon_color_onhover , 'social_icon_bg' => $social_icon_bg, 'social_icon_bg_onhover'=> $social_icon_bg_onhover , 'social_facebook_link' => $social_facebook_link , 'social_twitter_link' => $social_twitter_link, 'social_linkedin_link' => $social_linkedin_link , 'social_google_plus_link'=> $social_google_plus_link , 'social_pinterest_link' => $social_pinterest_link )); update_option('Admin_custome_login_Social', $Social_page); $Slidshow_image= serialize(array( 'Slidshow_image_1' => $Slidshow_image_1 , 'Slidshow_image_2' => $Slidshow_image_2 , 'Slidshow_image_3' => $Slidshow_image_3 , 'Slidshow_image_4' => $Slidshow_image_4 , 'Slidshow_image_5' => $Slidshow_image_5 , 'Slidshow_image_6' => $Slidshow_image_6 , 'Slidshow_image_label_1'=> $Slidshow_image_label_1 , 'Slidshow_image_label_2'=> $Slidshow_image_label_2 , 'Slidshow_image_label_3'=> $Slidshow_image_label_3 , 'Slidshow_image_label_4'=> $Slidshow_image_label_4 , 'Slidshow_image_label_5'=> $Slidshow_image_label_5 , 'Slidshow_image_label_6'=> $Slidshow_image_label_6 )); update_option('Admin_custome_login_Slidshow', $Slidshow_image); //wp_safe_redirect( admin_url( 'options-general.php?page=admin_custom_login' ) ); exit; } add_action( 'admin_init', 'acl_import_settings' ); ?>