Exemplo n.º 1
0
/**
 * Plugin initialization function
 */
function ewww_image_optimizer_init()
{
    global $ewww_debug;
    $ewww_debug .= "<b>ewww_image_optimizer_init()</b><br>";
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    load_plugin_textdomain(EWWW_IMAGE_OPTIMIZER_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages/');
    ewww_image_optimizer_cloud_init();
}
/**
 * Plugin initialization function
 */
function ewww_image_optimizer_init()
{
    global $ewww_debug;
    $ewww_debug .= "<b>ewww_image_optimizer_init()</b><br>";
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    ewww_image_optimizer_cloud_verify();
    if (!defined('EWWW_IMAGE_OPTIMIZER_CLOUD') && ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_jpg') && ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_png') && ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_gif')) {
        define('EWWW_IMAGE_OPTIMIZER_CLOUD', TRUE);
        wp_enqueue_style('ewww-nocloud', plugins_url('nocloud.css', __FILE__));
    } elseif (!defined('EWWW_IMAGE_OPTIMIZER_CLOUD')) {
        define('EWWW_IMAGE_OPTIMIZER_CLOUD', FALSE);
    }
    load_plugin_textdomain(EWWW_IMAGE_OPTIMIZER_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages/');
}
Exemplo n.º 3
0
/**
 * Plugin initialization function
 */
function ewww_image_optimizer_init()
{
    ewwwio_memory(__FUNCTION__);
    global $ewww_debug;
    global $ewww_memory;
    //	global $ewww_admin;
    //	$ewww_admin = $admin;
    $ewww_debug .= "<b>ewww_image_optimizer_init()</b><br>";
    /*	if ( $ewww_admin ) {
    		$ewww_debug .= 'we are in the admin, feel free to shout<br>';
    	} else {
    		$ewww_debug .= 'no admin, be quiet<br>';
    	}*/
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    ewww_image_optimizer_cloud_init();
    //	if ( ! $ewww_admin ) {
    //		ewww_image_optimizer_tool_init();
    //	}
    ewwwio_memory(__FUNCTION__);
}
Exemplo n.º 4
0
/**
 * Plugin initialization function
 */
function ewww_image_optimizer_init()
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    ewwwio_memory(__FUNCTION__);
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    ewww_image_optimizer_cloud_init();
    ewwwio_memory(__FUNCTION__);
    //	ewww_image_optimizer_debug_log();
}
Exemplo n.º 5
0
/**
 * Plugin initialization function
 */
function ewww_image_optimizer_init()
{
    ewwwio_memory(__FUNCTION__);
    global $ewww_debug;
    global $ewww_memory;
    $ewww_debug .= "<b>ewww_image_optimizer_init()</b><br>";
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    ewww_image_optimizer_cloud_init();
    ewwwio_memory(__FUNCTION__);
}
Exemplo n.º 6
0
/**
 * Plugin upgrade function
 */
function ewww_image_optimizer_upgrade()
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    ewwwio_memory(__FUNCTION__);
    if (get_option('ewww_image_optimizer_version') < EWWW_IMAGE_OPTIMIZER_VERSION) {
        if (defined('DOING_AJAX') && DOING_AJAX) {
            return;
        }
        ewww_image_optimizer_enable_background_optimization();
        ewww_image_optimizer_install_table();
        ewww_image_optimizer_set_defaults();
        if (get_option('ewww_image_optimizer_version') < 297.5) {
            // cleanup background test mess
            wp_clear_scheduled_hook('wp_ewwwio_test_optimize_cron');
            global $wpdb;
            $table = $wpdb->options;
            $column = 'option_name';
            if (is_multisite()) {
                $table = $wpdb->sitemeta;
                $column = 'meta_key';
            }
            $key = 'wp_ewwwio_test_optimize_batch_%';
            $wpdb->query("DELETE FROM {$table} WHERE {$column} LIKE '{$key}'");
        }
        if (get_option('ewww_image_optimizer_version') < 280) {
            ewww_image_optimizer_migrate_settings_to_levels();
        }
        update_option('ewww_image_optimizer_version', EWWW_IMAGE_OPTIMIZER_VERSION);
    }
    ewwwio_memory(__FUNCTION__);
}