Ejemplo n.º 1
0
function wpo_admin_actions()
{
    if (current_user_can('manage_options')) {
        if (function_exists('add_meta_box')) {
            add_menu_page("WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url(__FILE__) . 'wpo.png');
        } else {
            add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url(__FILE__) . 'wpo.png');
        }
        // end if addmeta box
        if (get_option(OPTION_NAME_ENABLE_ADMIN_MENU, 'false') == 'true') {
            add_action('wp_before_admin_bar_render', 'wpo_admin_bar');
        }
        //wpo_detectDBType();
        wpo_PluginOptionsSetDefaults();
        wpo_cron_activate();
    }
}
?>
    				<br />

				<?php 
if (get_option(OPTION_NAME_SCHEDULE, 'false') == 'true') {
    echo '<b>';
    echo '<i>';
    echo '<font color="green">';
    _e('Scheduled cleaning enabled', 'wp-optimize');
    echo ', ';
    echo '</font>';
    echo '</i>';
    echo '</b>';
    if (wp_next_scheduled('wpo_cron_event2')) {
        //$timestamp = wp_next_scheduled( 'wpo_cron_event2' );
        wpo_cron_activate();
        $timestamp = wp_next_scheduled('wpo_cron_event2');
        $date = new DateTime("@{$timestamp}");
        echo '<i>';
        _e('Next schedule:', 'wp-optimize');
        echo ' ';
        echo '<font color="green">';
        //echo $date->format('l jS \of F Y') . "\n";
        //echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $timestamp + (get_option('gmt_offset')));
        echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $timestamp);
        echo '</i>';
        echo '</font>';
        echo '<i>';
        echo ' - ';
        echo '<a href="?page=WP-Optimize">';
        _e('Refresh', 'wp-optimize');
Ejemplo n.º 3
0
function wpo_admin_actions()
{
    if (current_user_can('manage_options')) {
        if (function_exists('add_meta_box')) {
            add_menu_page("WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url(__FILE__) . 'wpo.png');
        } else {
            add_submenu_page("index.php", "WP-Optimize", "WP-Optimize", "manage_options", "WP-Optimize", "wp_optimize_menu", plugin_dir_url(__FILE__) . 'wpo.png');
        }
        // end if addmetabox
        wpo_PluginOptionsSetDefaults();
        wpo_cron_activate();
    }
}