public function clean_cache()
 {
     $persistent_manager = new One_And_One_Persistence_Manager();
     $persistent_manager->erase_persistent_data();
     $transience_manager = new One_And_One_Transience_Manager();
     $transience_manager->erase_transient_data();
 }
Example #2
0
<?php

// Check if uninstall is called from WordPress!
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
include_once 'inc/persistence-manager.php';
$persistence_manager = new One_And_One_Persistence_Manager();
$persistence_manager->erase_persistent_data();
include_once 'inc/transience-manager.php';
$transience_manager = new One_And_One_Transience_Manager();
$transience_manager->erase_transient_data();
Example #3
0
    function setup_plugins_and_theme()
    {
        ignore_user_abort(true);
        set_time_limit(0);
        // check credentials first before starting the install process...
        if (!One_And_One_Utility::check_credentials($this->callback_url, $this->form_fields)) {
            // we don't have the credentials to install the plugin...
            return false;
        }
        do_action('one_and_one_batch_installer_start');
        $this->install_and_activate_theme();
        $this->install_and_activate_plugins();
        do_action('one_and_one_batch_installer_end');
        if (!$this->theme) {
            $this->theme = wp_get_theme();
        }
        //Deactivate the 1&1 setup plugin...
        if (apply_filters('one_and_one_wizard_deactivate_on_end', true)) {
            deactivate_plugins(One_And_One_Wizard::get_plugin_file_path());
            //Hide the menu item
            echo '<script>jQuery("#menu-tools .current", window.parent.document).hide();</script>';
            echo '<br/><h3 style="font-size: 1.2em;">';
            printf(esc_html__('The 1&1 WP Wizard has been deactivated, you can find it in the %s area.', '1and1-wordpress-wizard'), '<a href="' . admin_url('plugins.php') . '" target="_parent">' . esc_html_x('Plugins', 'area', '1and1-wordpress-wizard') . '</a>');
            echo '</h3>';
        }
        echo '<br/>';
        echo '<h2>' . esc_html__('Installation completed.', '1and1-wordpress-wizard') . '</h2>';
        echo '<p>' . esc_html__('You are now ready to use your WordPress installation. You can continue customizing the selected theme or write your first blog post.', '1and1-wordpress-wizard') . '</p>';
        echo '<p><a href="' . wp_customize_url($this->theme->slug) . '" class="hide-if-no-customize button button-primary" title="' . sprintf(esc_attr('Customize &#8220;%s&#8221;'), $this->theme->name) . '" target="_parent">' . esc_html__('Customize the Theme', '1and1-wordpress-wizard') . '</a> &nbsp; ';
        _ex('or', 'between two buttons');
        echo ' &nbsp; <a href="' . admin_url('post-new.php') . '" class="button" target="_parent">' . esc_html__('Write a post', '1and1-wordpress-wizard') . '</a></p>';
        //Dismiss the welcom panel...
        $perisistent_manager = new One_And_One_Persistence_Manager();
        $perisistent_manager->store(One_And_One_Persistence_Manager::WELCOME_PANEL_DISMISS_KEY, true);
        echo '<br/>';
        $community_portal_link = esc_url(__('http://community.1and1.com', '1and1-wordpress-wizard'));
        ?>

		<div id="oneandone-community-panel" class="updated welcome-panel oneandone-setup-panel">
			<div class="welcome-panel-content">
				<div class="oneandone-community-image">
					<a href="<?php 
        echo $community_portal_link;
        ?>
">
						<img src="<?php 
        echo One_And_One_Wizard::get_images_url('community-icon.png');
        ?>
" alt="<?php 
        esc_attr_e('Community logo', '1and1-wordpress-wizard');
        ?>
" />
					</a>
				</div>
				<div class="oneandone-setup-message">
					<h3><?php 
        _e('1&1 Community', '1and1-wordpress-wizard');
        ?>
</h3>
					<p><?php 
        echo wpautop(__('Use the 1&1 Community to talk about interesting web projects with WordPress, and get to know the people behind the projects.
Learn more about important strategies, themes, and plugins.
Discuss both simple and complex solutions to promote your next project.', '1and1-wordpress-wizard'));
        ?>
</p>

					<div class="oneandone-setup-links">
						<a href="<?php 
        echo $community_portal_link;
        ?>
" class="button button-primary button-hero">
							<?php 
        _e('Go to our community site', '1and1-wordpress-wizard');
        ?>
						</a>
					</div>
				</div>
			</div>
		</div>

		<?php 
        $catalog = new One_And_One_Catalog();
        $catalog->report_selection($this->theme->slug, wp_list_pluck($this->plugins, 'slug'));
    }