prefix . '_'; } /** * Hook in tabs. */ public function __construct() { add_action('admin_menu', array($this, 'admin_menus')); } /** * Add admin menus/screens. */ public function admin_menus() { add_theme_page(__('Theme Wizard', 'profit-lite'), __('Theme Wizard', 'profit-lite'), 'edit_theme_options', 'theme-setup', array($this, 'setup_wizard')); } /** * Show the setup wizard */ public function setup_wizard() { if (empty($_GET['page']) || 'theme-setup' !== $_GET['page']) { return; } $this->steps = array( 'introduction' => array( 'name' => __('Start', 'profit-lite'), 'view' => array($this, 'setup_introduction'), 'handler' => '' ), 'section' => array( 'name' => __('Front Page Setup', 'profit-lite'), 'view' => array($this, 'setup_section'), 'handler' => '' ), 'customizer' => array( 'name' => __('Customizer', 'profit-lite'), 'view' => array($this, 'setup_customizer'), 'handler' => '' ), 'plugins' => array( 'name' => __('Plugins', 'profit-lite'), 'view' => array($this, 'setup_plugins'), 'handler' => '' ), 'install_plugins' => array( 'name' => __('Install Plugins', 'profit-lite'), 'view' => array($this, 'setup_install_plugins'), 'handler' => '' ), 'ready' => array( 'name' => __('Ready', 'profit-lite'), 'view' => array($this, 'setup_ready'), 'handler' => '' ) ); $this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps)); $this->setup_wizard_header(); $this->setup_wizard_steps(); ?>
setup_wizard_content(); $this->setup_wizard_footer(); ?>
steps); return add_query_arg('step', $keys[array_search($this->step, array_keys($this->steps)) + 1], remove_query_arg('translation_updated')); } /* * Dismiss Theme Wizard admin notice */ private function wizard_dismiss() { update_user_meta(get_current_user_id(), $this->getPrefix() . 'wizard_dismiss', 1); } /** * Setup Wizard Header */ public function setup_wizard_header() { $this->wizard_dismiss(); ?>

steps; $i = 0; ?>
    $step) : $i++; ?>
  1. step, array_keys($this->steps)) >= array_search($step_key, array_keys($this->steps)) || $this->step === $step_key) { $text = '' . esc_html($step['name']) . ''; } echo $text; if ($i < sizeof($ouput_steps)): echo " > "; endif; ?>

'; call_user_func($this->steps[$this->step]['view']); echo ''; } /** * Introduction step */ public function setup_introduction() { ?>

  • -
  • -
  • -

Theme Wizard menu.', 'profit-lite'); ?>


checkPlugins()) : $keys = array_keys($this->steps); $url = add_query_arg('step', $keys[array_search($this->step, array_keys($this->steps)) + 3], remove_query_arg('translation_updated')); ?>

Appearance > Customize to change logo, website title, contact information, colors, background image, menus and so on. Once you are done with the changes click ”Save” button to display updates on the live site.', 'profit-lite'); ?>



checkPlugins()) : $keys = array_keys($this->steps); $url = add_query_arg('step', $keys[array_search($this->step, array_keys($this->steps)) + 3], remove_query_arg('translation_updated')); ?>

  • Reading', 'profit-lite'); ?>
  • Reading, set "Front page displays" to "A static page"', 'profit-lite'); ?>
  • Reading, set "Front page" to "Home" or "Front Page" you\'ve created in first step', 'profit-lite'); ?>

  • Reading, set "Posts page" to "Blog"', 'profit-lite'); ?>



steps); $url = add_query_arg('step', $keys[array_search($this->step, array_keys($this->steps)) + 2], remove_query_arg('translation_updated')); ?>



steps); $url = add_query_arg('step', $keys[array_search($this->step, array_keys($this->steps)) + 2], remove_query_arg('translation_updated')); ?>

0) { require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); if (array_key_exists("mp_profit_install", $array) || array_key_exists("mp_profit_activate", $array)) { _e('

Profit Theme Engine

', 'profit-lite'); } if (array_key_exists("mp_profit_install", $array)) { $plugin = 'mp-profit'; $url = 'https://downloads.wordpress.org/plugin/mp-profit.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'mp-profit/profit.php'; $plugin_name = __('Profit Theme Engine', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("mp_profit_activate", $array)) { $plugin_path = 'mp-profit/profit.php'; $plugin_name = __('Profit Theme Engine', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("another_mailchimp_install", $array) || array_key_exists("another_mailchimp_activate", $array)) { _e('

MailChimp widget for Profit theme

', 'profit-lite'); } if (array_key_exists("another_mailchimp_install", $array)) { $plugin = 'another-mailchimp-widget'; $url = 'https://downloads.wordpress.org/plugin/another-mailchimp-widget.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'another-mailchimp-widget/another-mailchimp-widget.php'; $plugin_name = __('MailChimp widget for Profit theme', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("another_mailchimp_activate", $array)) { $plugin_path = 'another-mailchimp-widget/another-mailchimp-widget.php'; $plugin_name = __('MailChimp widget for Profit theme', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("motopress_lite_install", $array) || array_key_exists("motopress_lite_activate", $array)) { _e('

MotoPress Content Editor Lite

', 'profit-lite'); } if (array_key_exists("motopress_lite_install", $array)) { $plugin = 'motopress-content-editor-lite'; $url = 'https://downloads.wordpress.org/plugin/motopress-content-editor-lite.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'motopress-content-editor-lite/motopress-content-editor.php'; $plugin_name = __('MotoPress Content Editor Lite','profit-lite'); echo '

'. sprintf( __('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("motopress_lite_activate", $array)) { $plugin_path = 'motopress-content-editor-lite/motopress-content-editor.php'; $plugin_name = __('MotoPress Content Editor Lite', 'profit-lite' ); echo '

' . sprintf( __('Activating %s plugin...', 'profit-lite' ), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("woocommerce_install", $array) || array_key_exists("woocommerce_activate", $array)) { _e('

WooCommerce

', 'profit-lite'); } if (array_key_exists("woocommerce_install", $array)) { $plugin = 'woocommerce'; $url = 'http://downloads.wordpress.org/plugin/woocommerce.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'woocommerce/woocommerce.php'; $plugin_name = __('WooCommerce', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("woocommerce_activate", $array)) { $plugin_path = 'woocommerce/woocommerce.php'; $plugin_name = __('WooCommerce', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("stock_ticker_install", $array) || array_key_exists("stock_ticker_activate", $array)) { _e('

Stock Ticker

', 'profit-lite'); } if (array_key_exists("stock_ticker_install", $array)) { $plugin = 'stock-ticker'; $url = 'https://downloads.wordpress.org/plugin/stock-ticker.0.1.7.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'stock-ticker/stock-ticker.php'; $plugin_name = __('Stock Ticker', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("stock_ticker_activate", $array)) { $plugin_path = 'stock-ticker/stock-ticker.php'; $plugin_name = __('Stock Ticker', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("regenerate_thumbnails_install", $array) || array_key_exists("regenerate_thumbnails_activate", $array)) { _e('

Regenerate Thumbnails

', 'profit-lite'); } if (array_key_exists("regenerate_thumbnails_install", $array)) { $plugin = 'regenerate-thumbnails'; $url = 'https://downloads.wordpress.org/plugin/regenerate-thumbnails.zip'; $this->install_plugin($plugin, $url); $plugin_path = 'regenerate-thumbnails/regenerate-thumbnails.php'; $plugin_name = __('Regenerate Thumbnails', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } if (array_key_exists("regenerate_thumbnails_activate", $array)) { $plugin_path = 'regenerate-thumbnails/regenerate-thumbnails.php'; $plugin_name = __('Regenerate Thumbnails', 'profit-lite'); echo '

' . sprintf(__('Activating %s plugin...', 'profit-lite'), $plugin_name) . '

'; $this->activate_plugin($plugin_name, $plugin_path); } } endif; ?>

install($url); //Flush plugins cache so we can make sure that the installed plugins list is always up to date wp_cache_flush(); } public function activate_plugin($plugin_name, $plugin_path) { $result = activate_plugin($plugin_path); if (is_wp_error($result)) { echo '

' . $plugin_name . ' ' . __('plugin is not activated', 'profit-lite') . '

'; } else { echo '

' . $plugin_name . ' ' . __('plugin is activated', 'profit-lite') . '

'; } } } new MP_Profit_Admin_Setup_Wizard();