File "wp-shortpixel.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/shortpixel-image-optimiser/wp-shortpixel.php
File size: 3 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

if (function_exists('wpSPIO')) {
    add_action('admin_notices', function () {
        echo '<div class="error"><h4>';
        printf(__('Shortpixel plugin already loaded. You might have two versions active. Not loaded: %s', 'shortpixel-image-optimiser'), __FILE__);
        echo '</h4></div>';
    });
    return;
}
if (!defined('SHORTPIXEL_RESET_ON_ACTIVATE')) {
    define('SHORTPIXEL_RESET_ON_ACTIVATE', false);
}
define('SHORTPIXEL_PLUGIN_FILE', __FILE__);
define('SHORTPIXEL_PLUGIN_DIR', __DIR__);
define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.22.6");
define('SHORTPIXEL_MAX_TIMEOUT', 10);
define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
define('SHORTPIXEL_MAX_API_RETRIES', 50);
define('SHORTPIXEL_MAX_ERR_RETRIES', 5);
define('SHORTPIXEL_MAX_FAIL_RETRIES', 3);
if (!defined('SHORTPIXEL_MAX_THUMBS')) {
    define('SHORTPIXEL_MAX_THUMBS', 149);
}
if (!defined('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION')) {
    define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', false);
}
define('SHORTPIXEL_PRESEND_ITEMS', 3);
define('SHORTPIXEL_API', 'api.shortpixel.com');
$max_exec = intval(ini_get('max_execution_time'));
if ($max_exec === 0) {
    $max_exec = 60;
} elseif ($max_exec < 0) {
    $max_exec = 30;
}
define('SHORTPIXEL_MAX_EXECUTION_TIME', $max_exec);
require_once SHORTPIXEL_PLUGIN_DIR . '/build/shortpixel/autoload.php';
$sp__uploads = wp_upload_dir();
define('SHORTPIXEL_UPLOADS_BASE', (file_exists($sp__uploads['basedir']) ? '' : ABSPATH) . $sp__uploads['basedir']);
define('SHORTPIXEL_UPLOADS_NAME', basename(is_main_site() ? SHORTPIXEL_UPLOADS_BASE : dirname(dirname(SHORTPIXEL_UPLOADS_BASE))));
$sp__backupBase = is_main_site() ? SHORTPIXEL_UPLOADS_BASE : dirname(dirname(SHORTPIXEL_UPLOADS_BASE));
define('SHORTPIXEL_BACKUP_FOLDER', $sp__backupBase . '/' . SHORTPIXEL_BACKUP);
define('SHORTPIXEL_BACKUP_URL', (is_main_site() || defined('SUBDOMAIN_INSTALL') && SUBDOMAIN_INSTALL ? $sp__uploads['baseurl'] : dirname(dirname($sp__uploads['baseurl']))) . '/' . SHORTPIXEL_BACKUP);
define('SHORTPIXEL_MAX_EXECUTION_TIME2', 2);
define("SHORTPIXEL_MAX_RESULTS_QUERY", 30);
if (!defined('SHORTPIXEL_DEBUG')) {
    define('SHORTPIXEL_DEBUG', false);
}
$log = \ShortPixel\ShortPixelLogger\ShortPixelLogger::getInstance();
if (\ShortPixel\ShortPixelLogger\ShortPixelLogger::debugIsActive()) {
    $log->setLogPath(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
}
if (!function_exists("wpSPIO")) {
    function wpSPIO()
    {
        return \ShortPixel\ShortPixelPlugin::getInstance();
    }
}
require_once SHORTPIXEL_PLUGIN_DIR . '/shortpixel-plugin.php';
$loader = new ShortPixel\Build\PackageLoader();
$loader->setComposerFile(SHORTPIXEL_PLUGIN_DIR . '/class/plugin.json');
$loader->load(SHORTPIXEL_PLUGIN_DIR);
wpSPIO();
register_activation_hook(__FILE__, array('\\ShortPixel\\ShortPixelPlugin', 'activatePlugin'));
register_deactivation_hook(__FILE__, array('\\ShortPixel\\ShortPixelPlugin', 'deactivatePlugin'));
register_uninstall_hook(__FILE__, array('\\ShortPixel\\ShortPixelPlugin', 'uninstallPlugin'));