Submit
Path:
~
/
home
/
getwphos
/
public_html
/
deerguard
/
wp-content
/
plugins
/
garland-addon
/
admin
/
extension
/
demo-importer
/
File Content:
class.demo-importer.php
<?php class Garland_Demo_Importer { private static $_instance = null; public static $ins_demo_stat; public static $ins_demo_id; public function __construct() { $this->set_installed_demo_details(); add_action( 'admin_menu', array( $this, 'garland_addon_admin_menu' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'garland_enqueue_admin_script' ) ); } public static function garland_addon_admin_menu(){ add_submenu_page( 'garland-welcome', esc_html__( 'Demo Importer', 'garland-addon' ), esc_html__( 'Demo Importer', 'garland-addon' ), 'manage_options', 'garland-importer', array( 'Garland_Demo_Importer', 'garland_demo_import_admin_page' ) ); } private function set_installed_demo_details(){ self::$ins_demo_stat = get_theme_mod( 'garland_demo_installed' ); self::$ins_demo_id = get_theme_mod( 'garland_installed_demo_id' ); } public function garland_enqueue_admin_script(){ if( isset( $_GET['page'] ) && $_GET['page'] == 'garland-importer' ){ wp_enqueue_style( 'garland-confirm', GARLAND_ADDON_URL . 'admin/extension/demo-importer/assets/css/jquery-confirm.min.css' ); wp_enqueue_script( 'garland-confirm', GARLAND_ADDON_URL . 'admin/extension/demo-importer/assets/js/jquery-confirm.min.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'garland-import-scripts', GARLAND_ADDON_URL . 'admin/extension/demo-importer/assets/js/demo-import.js', array( 'jquery' ), '1.7.5', true ); //Import Localize Script $demo_import_args = array( 'admin_ajax_url' => esc_url( admin_url('admin-ajax.php') ), 'nonce' => wp_create_nonce('garland-options-import'), 'proceed' => esc_html__('Proceed', 'garland'), 'cancel' => esc_html__('Cancel', 'garland'), 'process' => esc_html__( 'Processing', 'garland-addon' ), 'uninstalling' => esc_html__('Uninstalling...', 'garland'), 'uninstalled' => esc_html__('Uninstalled.', 'garland'), 'unins_pbm' => esc_html__('Uninstall Problem!.', 'garland'), 'downloading' => esc_html__('Demo import process running...', 'garland'), 'garland_import_url' => admin_url( 'admin.php?page=garland-importer' ), 'regenerate_thumbnails_url' => admin_url( 'plugin-install.php?tab=plugin-information&plugin=regenerate-thumbnails' ) ); $demo_import_args = apply_filters( 'garland_demo_import_args', $demo_import_args ); wp_localize_script( 'garland-import-scripts', 'garland_admin_ajax_var', $demo_import_args ); } } public static function garland_demo_div_generater( $demo_array ){ $ins_demo_stat = self::$ins_demo_stat; $ins_demo_id = self::$ins_demo_id; $demo_class = ''; if( $ins_demo_stat == 1 ){ if( $ins_demo_id == $demo_array['demo_id'] ){ $demo_class .= ' demo-actived'; }else{ $demo_class .= ' demo-inactive'; } }else{ $demo_class .= ' demo-active'; } $revslider = isset( $demo_array['revslider'] ) && $demo_array['revslider'] != '' ? $demo_array['revslider'] : ''; $media_parts = isset( $demo_array['media_parts'] ) && $demo_array['media_parts'] != '' ? $demo_array['media_parts'] : ''; ?> <div class="admin-box demo-wrap"> <div class="install-plugin-wrap theme zozothemes-demo-item<?php echo esc_attr( $demo_class ); ?>"> <div class="install-plugin-inner"> <div class="zozo-demo-import-loader zozo-preview-<?php echo esc_attr( $demo_array['demo_id'] ); ?>"><i class="dashicons dashicons-admin-generic"></i></div> <div class="installation-progress"> <span class="progress-text"></span> <div class="progress"> <div class="progress-bar" style="width:0%"></div> </div> </div> <div class="theme-screenshot zozotheme-screenshot"> <a href="<?php echo esc_url( $demo_array['demo_url'] ); ?>" target="_blank"><img src="<?php echo esc_url( GARLAND_ADDON_URL . 'admin/extension/demo-importer/assets/images/demo/' . $demo_array['demo_img'] ); ?>" class="demo-img" /></a> </div> <div class="install-plugin-right"> <div class="install-plugin-right-inner"> <h3 class="theme-name" id="<?php echo esc_attr( $demo_array['demo_id'] ); ?>"><?php echo esc_attr( $demo_array['demo_name'] ); ?></h3> <a href="#" class="theme-demo-install-custom"><?php esc_html_e( "Custom Choice", "garland" ); ?></a> <div class="theme-demo-install-parts" id="<?php echo esc_attr( 'demo-install-parts-'. $demo_array['demo_id'] ); ?>"> <div class="demo-install-instructions"> <ul class="install-instructions"> <li><strong><?php esc_html_e( "General", "garland" ); ?></strong></li> <li><?php esc_html_e( 'Choose "Media" -> All the media\'s are ready to be import.', "garland" ); ?></li> <li><?php esc_html_e( 'Choose "Theme Options" -> Theme options are ready to be import.', "garland" ); ?></li> <li><?php esc_html_e( 'Choose "Widgets" -> Custom sidebars and widgets are ready to be import.', "garland" ); ?></li> <?php if( $revslider ) : ?> <li><?php esc_html_e( 'Choose "Revolution Sliders" -> Revolution slides are ready to be import.', "garland" ); ?></li> <?php endif; ?> <li><?php esc_html_e( 'Choose "All Posts" -> Posts, menus, custom post types are ready to be import.', "garland" ); ?></li> <li><p class="lead"><strong>*</strong><?php esc_html_e( 'If you check "All Posts" and Uncheck any of page, then menu will not imported.', "garland" ); ?></p></li> <li><strong><?php esc_html_e( "Pages", "garland" ); ?></strong></li> <li><?php esc_html_e( 'Choose pages which you want to show on your site. If you choose all the pages and check "All Post" menu will be import. If any one will not check even page or All posts, then menu will not import.', "garland" ); ?></li> </ul> </div> <div class="zozo-col-3"> <h5><?php esc_html_e( "General", "garland" ); ?></h5> <?php if( isset( $demo_array['general'] ) ){ echo '<ul class="general-install-parts-list">'; foreach( $demo_array['general'] as $key => $value ){ echo '<li><input type="checkbox" value="'. esc_attr( $key ) .'" data-text="'. esc_attr( $value ) .'" /> '. esc_html( $value ) .'</li>'; } echo '</ul>'; } ?> </div><!-- .zozo-col-3 --> <div class="zozo-col-3"> <h5><?php esc_html_e( "Pages", "garland" ); ?></h5> <?php if( isset( $demo_array['pages'] ) ){ echo '<ul class="page-install-parts-list">'; foreach( $demo_array['pages'] as $key => $value ){ echo '<li><input type="checkbox" value="'. esc_attr( $key ) .'" data-text="'. esc_attr( $value ) .'" /> '. esc_html( $value ) .'</li>'; } echo '</ul>'; } ?> </div><!-- .zozo-col-3 --> <a href="#" class="theme-demo-install-checkall"><?php esc_html_e( "Check/Uncheck All", "garland" ); ?></a> <p><?php esc_html_e( "Leave empty/uncheck all to full install.", "garland" ); ?></p> </div><!-- .theme-demo-install-parts --> <div class="theme-actions theme-buttons"> <a class="button button-primary button-install-demo" data-demo-id="<?php echo esc_attr( $demo_array['demo_id'] ); ?>" data-revslider="<?php echo esc_attr( $revslider ); ?>" data-media="<?php echo esc_attr( $media_parts ); ?>" href="#"> <?php esc_html_e( "Import", "garland" ); ?> </a> <a class="button button-primary button-uninstall-demo" data-demo-id="<?php echo esc_attr( $demo_array['demo_id'] ); ?>" href="#"> <?php esc_html_e( "Uninstall", "garland" ); ?> </a> <a class="button button-primary button-preview-demo" target="_blank" href="<?php echo esc_url( $demo_array['demo_url'] ); ?>"> <?php esc_html_e( "Preview", "garland" ); ?> </a> </div> </div><!-- .install-plugin-right-inner --> </div><!-- .install-plugin-right --> </div> </div><!-- .admin-box --> <?php } public static function garland_demo_import_admin_page(){ $garland_theme = wp_get_theme(); ?> <div class="garland-settings-wrap"> <?php wp_nonce_field( 'garland_demo_import_*&^^$#(*', 'garland_demo_import_nonce' ); ?> <div class="garland-header-bar"> <div class="garland-header-left"> <div class="garland-admin-logo-inline"> <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/brand-logo.png' ); ?>" alt="garland-logo"> </div><!-- .garland-admin-logo-inline --> <h2 class="title"><?php esc_html_e( 'Garland Demo Importer', 'garland-addon' ); ?></h2> </div><!-- .garland-header-left --> <div class="garland-header-right"> <a href="<?php echo admin_url('admin.php?page=garland-options'); ?>" class="button garland-btn"><i class="fa fa-caret-square-o-left" aria-hidden="true"></i><?php esc_html_e('Theme Options', 'garland-addon'); ?></a> <a href="<?php echo esc_url( 'https://wordpress.zozothemes.com/garland/' ); ?>" class="button garland-btn"><?php esc_html_e( 'Live Demo', 'garland-addon' ); ?></a> </div><!-- .garland-header-right --> </div><!-- .garland-header-bar --> <div class="garland-settings-tabs garland-demo-import-wrap"> <div id="garland-general" class="garland-settings-tab active"> <div class="container"> <div class="row"> <div class="col-6"> <?php //Demo Classic $demo_array = array( 'demo_id' => 'demo', 'demo_name' => esc_html__( 'Garland Main Demo', 'garland-addon' ), 'demo_img' => 'demo-1.jpg', 'demo_url' => 'https://wordpress.zozothemes.com/garland/', 'revslider' => '5', 'media_parts' => '26', 'general' => array( 'media' => esc_html__( "Media", "garland" ), 'theme-options' => esc_html__( "Theme Options", "garland" ), 'widgets' => esc_html__( "Widgets", "garland" ), 'revslider' => esc_html__( "Revolution Sliders", "garland" ), 'post' => esc_html__( "All Posts", "garland" ) ), 'pages'=> array( '1' => esc_html__( "Shop", "garland" ), '2' => esc_html__( "Cart", "garland" ), '3' => esc_html__( "Checkout", "garland" ), '4' => esc_html__( "My account", "garland" ), '5' => esc_html__( "2 Columns", "garland" ), '6' => esc_html__( "2 Columns + Sidebar", "garland" ), '7' => esc_html__( "3 Columns", "garland" ), '8' => esc_html__( "4 Columns Fullwidth", "garland" ), '9' => esc_html__( "About Us", "garland" ), '10' => esc_html__( "Blog", "garland" ), '11' => esc_html__( "Blog Grid", "garland" ), '12' => esc_html__( "Blog Grid + Overlay", "garland" ), '13' => esc_html__( "Blog List", "garland" ), '14' => esc_html__( "Blogs", "garland" ), '15' => esc_html__( "Career", "garland" ), '16' => esc_html__( "Charts", "garland" ), '17' => esc_html__( "Circle Progress", "garland" ), '18' => esc_html__( "Coming Soon", "garland" ), '19' => esc_html__( "Contact", "garland" ), '20' => esc_html__( "Contact Forms", "garland" ), '21' => esc_html__( "Day Counter", "garland" ), '22' => esc_html__( "Feature Box", "garland" ), '23' => esc_html__( "Flipbox", "garland" ), '24' => esc_html__( "Frequently asked question", "garland" ), '25' => esc_html__( "Garden Booking", "garland" ), '26' => esc_html__( "Google Maps", "garland" ), '27' => esc_html__( "home", "garland" ), '28' => esc_html__( "Home 2", "garland" ), '29' => esc_html__( "Home 3", "garland" ), '30' => esc_html__( "Home 4", "garland" ), '31' => esc_html__( "Home 5", "garland" ), '32' => esc_html__( "Landing Page", "garland" ), '33' => esc_html__( "Mailchimp", "garland" ), '34' => esc_html__( "Modal Popup", "garland" ), '35' => esc_html__( "Our Services", "garland" ), '36' => esc_html__( "Our Team", "garland" ), '37' => esc_html__( "Popover", "garland" ), '38' => esc_html__( "Portfolio", "garland" ), '39' => esc_html__( "Portfolio 2 Columns", "garland" ), '40' => esc_html__( "Portfolio 3 Columns", "garland" ), '41' => esc_html__( "Portfolio 4 Columns Wide", "garland" ), '42' => esc_html__( "Portfolio Masonry", "garland" ), '43' => esc_html__( "Portfolio Masonry Classic", "garland" ), '44' => esc_html__( "Portfolio Masonry Classic Pro", "garland" ), '45' => esc_html__( "Portfolio Masonry Modern", "garland" ), '46' => esc_html__( "Portfolio No Gutter", "garland" ), '47' => esc_html__( "Portfolio Slider", "garland" ), '48' => esc_html__( "Pricing", "garland" ), '49' => esc_html__( "Privacy Policy", "garland" ), '50' => esc_html__( "Progress Bar", "garland" ), '51' => esc_html__( "Refund and Returns Policy", "garland" ), '52' => esc_html__( "Service Styles", "garland" ), '53' => esc_html__( "Services 2", "garland" ), '54' => esc_html__( "Services 3", "garland" ), '55' => esc_html__( "Tabs", "garland" ), '56' => esc_html__( "Testimonials", "garland" ), '57' => esc_html__( "Timeline", "garland" ), '58' => esc_html__( "Unlimited Footers", "garland" ), '59' => esc_html__( "Unlimited Headers", "garland" ), '60' => esc_html__( "Video Popup", "garland" ), '61' => esc_html__( "Who We Are", "garland" ), '62' => esc_html__( "Counters", "garland" ) ) ); self::garland_demo_div_generater( $demo_array ); ?> <div class="theme-requirements" data-requirements="<?php printf( '<h2>%1$s</h2> <p>%2$s</p> <h3>%3$s</h3> <ol><li>%4$s</li></ol>', esc_html__( 'WARNING:', 'garland-addon' ), esc_html__( 'Importing demo content will give you pages, posts, theme options, sidebars and other settings. This will replicate the live demo. Clicking this option will replace your current theme options and widgets. It can also take a minutes to complete.', 'garland-addon' ), esc_html__( 'DEMO REQUIREMENTS:', 'garland-addon' ), esc_html__( 'Memory Limit of 128 MB and max execution time (php time limit) of 300 seconds.', 'garland-addon' ) ); ?>"> </div> </div> </div> </div> </div> </div> </div> <?php } public static function get_instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } } Garland_Demo_Importer::get_instance(); /* Demo Import AJAX */ if( ! function_exists('garland_demo_import_fun') ) { function garland_demo_import_fun() { if( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'garland_demo_import_*&^^$#(*' ) ) { echo "!security issue"; wp_die(); } $process = isset( $_POST['process'] ) ? sanitize_text_field($_POST['process']) : ''; if( $process ){ include GARLAND_ADDON_DIR . 'admin/extension/demo-importer/zozo-importer.php'; if( $process == 'permission' ){ garlandZozoImporterModule::garland_check_file_access_permission(); }elseif( $process == 'general_download' ){ garlandZozoImporterModule::garland_general_file_ajax(); }elseif( $process == 'xml_download' ){ garlandZozoImporterModule::garland_xml_file_ajax(); }elseif( $process == 'general_install' ){ garlandZozoImporterModule::garland_general_file_install_ajax(); }elseif( $process == 'xml_install' ){ garlandZozoImporterModule::garland_xml_file_install_ajax(); }elseif( $process == 'final' ){ garlandZozoImporterModule::garland_import_set_default_settings(); }elseif( $process == 'uninstall' ){ garlandZozoImporterModule::garland_uninstall_demo(); } } wp_die(); } add_action('wp_ajax_garland_demo_import', 'garland_demo_import_fun'); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
assets
---
0755
data
---
0755
class.demo-importer.php
16741 bytes
0644
parsers.php
25097 bytes
0644
wordpress-importer.php
57561 bytes
0644
zozo-importer.php
23325 bytes
0644
N4ST4R_ID | Naxtarrr