• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP ewww_image_optimizer_stl_check函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ewww_image_optimizer_stl_check函数的典型用法代码示例。如果您正苦于以下问题:PHP ewww_image_optimizer_stl_check函数的具体用法?PHP ewww_image_optimizer_stl_check怎么用?PHP ewww_image_optimizer_stl_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ewww_image_optimizer_stl_check函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ewww_image_optimizer


//.........这里部分代码省略.........
    // if the user has disabled the utility checks
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_skip_check') == TRUE || EWWW_IMAGE_OPTIMIZER_CLOUD) {
        $skip_jpegtran_check = true;
        $skip_optipng_check = true;
        $skip_gifsicle_check = true;
        $skip_pngout_check = true;
    } else {
        // otherwise we set the variables to false
        $skip_jpegtran_check = false;
        $skip_optipng_check = false;
        $skip_gifsicle_check = false;
        $skip_pngout_check = false;
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_jpg')) {
        $skip_jpegtran_check = true;
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_png')) {
        $skip_optipng_check = true;
        $skip_pngout_check = true;
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_gif')) {
        $skip_gifsicle_check = true;
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_metadata_skip_full') && $fullsize) {
        $keep_metadata = true;
    } else {
        $keep_metadata = false;
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_lossy_skip_full') && $fullsize) {
        $skip_lossy = true;
    } else {
        $skip_lossy = false;
    }
    if (ini_get('max_execution_time') < 90 && ewww_image_optimizer_stl_check()) {
        set_time_limit(0);
    }
    // if the full-size image was converted
    if ($converted) {
        $ewww_debug .= "full-size image was converted, need to rebuild filename for meta<br>";
        $filenum = $converted;
        // grab the file extension
        preg_match('/\\.\\w+$/', $file, $fileext);
        // strip the file extension
        $filename = str_replace($fileext[0], '', $file);
        // grab the dimensions
        preg_match('/-\\d+x\\d+(-\\d+)*$/', $filename, $fileresize);
        // strip the dimensions
        $filename = str_replace($fileresize[0], '', $filename);
        // reconstruct the filename with the same increment (stored in $converted) as the full version
        $refile = $filename . '-' . $filenum . $fileresize[0] . $fileext[0];
        // rename the file
        rename($file, $refile);
        $ewww_debug .= "moved {$file} to {$refile}<br>";
        // and set $file to the new filename
        $file = $refile;
        $original = $file;
    }
    // get the original image size
    $orig_size = filesize($file);
    $ewww_debug .= "original filesize: {$orig_size}<br>";
    if ($orig_size < ewww_image_optimizer_get_option('ewww_image_optimizer_skip_size')) {
        // tell the user optimization was skipped
        $msg = __("Optimization skipped", EWWW_IMAGE_OPTIMIZER_DOMAIN);
        $ewww_debug .= "optimization bypassed due to filesize: {$file} <br>";
        // send back the above message
        return array(false, $msg, $converted, $file);
开发者ID:Rudchyk,项目名称:wp-framework,代码行数:67,代码来源:ewww-image-optimizer.php


示例2: ewww_image_optimizer_count_optimized

function ewww_image_optimizer_count_optimized($gallery, $return_ids = false)
{
    global $ewww_debug;
    global $wpdb;
    $ewww_debug .= "<b>ewww_image_optimizer_count_optmized()</b><br>";
    $full_count = 0;
    $unoptimized_full = 0;
    $unoptimized_re = 0;
    $resize_count = 0;
    $attachment_query = '';
    $ewww_debug .= "scanning for {$gallery}<br>";
    // retrieve the time when the optimizer starts
    $started = microtime(true);
    if (ewww_image_optimizer_stl_check()) {
        set_time_limit(0);
    }
    $max_query = 3000;
    $attachment_query_count = 0;
    switch ($gallery) {
        case 'media':
            $ids = array();
            // see if we were given attachment IDs to work with via GET/POST
            if (!empty($_REQUEST['ids']) || get_option('ewww_image_optimizer_bulk_resume')) {
                $ewww_debug .= 'we have preloaded attachment ids<br>';
                // retrieve the attachment IDs that were pre-loaded in the database
                $attachment_ids = get_option('ewww_image_optimizer_bulk_attachments');
                while ($attachment_ids && $attachment_query_count < $max_query) {
                    $attachment_query .= "'" . array_pop($attachment_ids) . "',";
                    $attachment_query_count++;
                }
                $attachment_query = 'AND metas.post_id IN (' . substr($attachment_query, 0, -1) . ')';
            }
            $offset = 0;
            // retrieve all the image attachment metadata from the database
            while ($attachments = $wpdb->get_results("SELECT metas.meta_value,post_id FROM {$wpdb->postmeta} metas INNER JOIN {$wpdb->posts} posts ON posts.ID = metas.post_id WHERE posts.post_mime_type LIKE '%image%' AND metas.meta_key = '_wp_attachment_metadata' {$attachment_query} LIMIT {$offset}, {$max_query}", ARRAY_N)) {
                $ewww_debug .= "fetched " . count($attachments) . " attachments starting at {$offset}<br>";
                $disabled_sizes = ewww_image_optimizer_get_option('ewww_image_optimizer_disable_resizes');
                foreach ($attachments as $attachment) {
                    $meta = unserialize($attachment[0]);
                    if (empty($meta)) {
                        continue;
                    }
                    if (empty($meta['ewww_image_optimizer'])) {
                        $unoptimized_full++;
                        $ids[] = $attachment[1];
                    }
                    // resized versions, so we can continue
                    if (isset($meta['sizes'])) {
                        foreach ($meta['sizes'] as $size => $data) {
                            if (!empty($disabled_sizes[$size])) {
                                continue;
                            }
                            $resize_count++;
                            if (empty($meta['sizes'][$size]['ewww_image_optimizer'])) {
                                $unoptimized_re++;
                            }
                        }
                    }
                }
                $full_count += count($attachments);
                $offset += $max_query;
                if (!empty($attachment_ids)) {
                    $attachment_query = '';
                    $attachment_query_count = 0;
                    $offset = 0;
                    while ($attachment_ids && $attachment_query_count < $max_query) {
                        $attachment_query .= "'" . array_pop($attachment_ids) . "',";
                        $attachment_query_count++;
                    }
                    $attachment_query = 'AND metas.post_id IN (' . substr($attachment_query, 0, -1) . ')';
                }
            }
            break;
        case 'ngg':
            // see if we were given attachment IDs to work with via GET/POST
            if (!empty($_REQUEST['ewww_inline']) || get_option('ewww_image_optimizer_bulk_ngg_resume')) {
                // retrieve the attachment IDs that were pre-loaded in the database
                $attachment_ids = get_option('ewww_image_optimizer_bulk_ngg_attachments');
                while ($attachment_ids && $attachment_query_count < $max_query) {
                    $attachment_query .= "'" . array_pop($attachment_ids) . "',";
                    $attachment_query_count++;
                }
                $attachment_query = 'WHERE pid IN (' . substr($attachment_query, 0, -1) . ')';
            }
            // creating the 'registry' object for working with nextgen
            $registry = C_Component_Registry::get_instance();
            // creating a database storage object from the 'registry' object
            $storage = $registry->get_utility('I_Gallery_Storage');
            // get an array of sizes available for the $image
            $sizes = $storage->get_image_sizes();
            $offset = 0;
            while ($attachments = $wpdb->get_col("SELECT meta_data FROM {$wpdb->nggpictures} {$attachment_query} LIMIT {$offset}, {$max_query}")) {
                foreach ($attachments as $attachment) {
                    if (class_exists('Ngg_Serializable')) {
                        $serializer = new Ngg_Serializable();
                        $meta = $serializer->unserialize($attachment);
                    } else {
                        $meta = unserialize($attachment);
                    }
                    if (!is_array($meta)) {
//.........这里部分代码省略.........
开发者ID:Rudchyk,项目名称:wp-framework,代码行数:101,代码来源:bulk.php


示例3: ewww_image_optimizer_image_scan

function ewww_image_optimizer_image_scan($dir)
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    global $wpdb;
    $images = array();
    if (!is_dir($dir)) {
        return $images;
    }
    ewwwio_debug_message("scanning folder for images: {$dir}");
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
    $start = microtime(true);
    $query = "SELECT path,image_size FROM {$wpdb->ewwwio_images}";
    $already_optimized = $wpdb->get_results($query, ARRAY_A);
    $optimized_list = array();
    foreach ($already_optimized as $optimized) {
        $optimized_path = $optimized['path'];
        $optimized_list[$optimized_path] = $optimized['image_size'];
    }
    $file_counter = 0;
    if (ewww_image_optimizer_stl_check()) {
        set_time_limit(0);
    }
    foreach ($iterator as $file) {
        $file_counter++;
        $skip_optimized = false;
        if ($file->isFile()) {
            $path = $file->getPathname();
            if (preg_match('/(\\/|\\\\)\\./', $path) && apply_filters('ewww_image_optimizer_ignore_hidden_files', true)) {
                continue;
            }
            if (!ewww_image_optimizer_quick_mimetype($path)) {
                /*			$pathextension = strtolower( pathinfo( $path, PATHINFO_EXTENSION ) );
                			switch ( $pathextension ) {
                				case 'jpg':
                				case 'jpeg':
                				case 'jpe':
                				case 'png':
                				case 'gif':
                				case 'pdf':
                					break;
                				default:*/
                continue;
            }
            if (isset($optimized_list[$path])) {
                $image_size = $file->getSize();
                if ($optimized_list[$path] == $image_size) {
                    ewwwio_debug_message("match found for {$path}");
                    $skip_optimized = true;
                } else {
                    ewwwio_debug_message("mismatch found for {$path}, db says " . $optimized_list[$path] . " vs. current {$image_size}");
                }
            }
            if (empty($skip_optimized) || !empty($_REQUEST['ewww_force'])) {
                ewwwio_debug_message("queued {$path}");
                $images[] = utf8_encode($path);
            }
        }
        //		ewww_image_optimizer_debug_log();
    }
    $end = microtime(true) - $start;
    ewwwio_debug_message("query time for {$file_counter} files (seconds): {$end}");
    ewwwio_memory(__FUNCTION__);
    return $images;
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:64,代码来源:aux-optimize.php


示例4: ewww_image_optimizer_bulk_loop

function ewww_image_optimizer_bulk_loop()
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    global $ewww_defer;
    $ewww_defer = false;
    $output = array();
    // verify that an authorized user has started the optimizer
    $permissions = apply_filters('ewww_image_optimizer_bulk_permissions', '');
    if (!wp_verify_nonce($_REQUEST['ewww_wpnonce'], 'ewww-image-optimizer-bulk') || !current_user_can($permissions)) {
        $output['error'] = esc_html__('Access token has expired, please reload the page.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        echo json_encode($output);
        die;
    }
    session_write_close();
    // retrieve the time when the optimizer starts
    $started = microtime(true);
    if (ewww_image_optimizer_stl_check() && ini_get('max_execution_time')) {
        set_time_limit(0);
    }
    // find out if our nonce is on it's last leg/tick
    $tick = wp_verify_nonce($_REQUEST['ewww_wpnonce'], 'ewww-image-optimizer-bulk');
    if ($tick === 2) {
        $output['new_nonce'] = wp_create_nonce('ewww-image-optimizer-bulk');
    } else {
        $output['new_nonce'] = '';
    }
    // get the 'bulk attachments' with a list of IDs remaining
    $attachments = get_option('ewww_image_optimizer_bulk_attachments');
    $attachment = array_shift($attachments);
    $meta = wp_get_attachment_metadata($attachment, true);
    // do the optimization for the current attachment (including resizes)
    $meta = ewww_image_optimizer_resize_from_meta_data($meta, $attachment, false);
    $ewww_status = get_transient('ewww_image_optimizer_cloud_status');
    if (!empty($ewww_status) && preg_match('/exceeded/', $ewww_status)) {
        $output['error'] = esc_html__('License Exceeded', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        echo json_encode($output);
        die;
    }
    if (!empty($meta['file'])) {
        // output the filename (and path relative to 'uploads' folder)
        $output['results'] = sprintf("<p>" . esc_html__('Optimized', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <strong>%s</strong><br>", esc_html($meta['file']));
    } else {
        $output['results'] = sprintf("<p>" . esc_html__('Skipped image, ID:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <strong>%s</strong><br>", esc_html($attachment));
    }
    if (!empty($meta['ewww_image_optimizer'])) {
        // tell the user what the results were for the original image
        $output['results'] .= sprintf(esc_html__('Full size – %s', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "<br>", esc_html($meta['ewww_image_optimizer']));
    }
    // check to see if there are resized version of the image
    if (isset($meta['sizes']) && is_array($meta['sizes'])) {
        // cycle through each resize
        foreach ($meta['sizes'] as $size) {
            if (!empty($size['ewww_image_optimizer'])) {
                // output the results for the current resized version
                $output['results'] .= sprintf("%s – %s<br>", esc_html($size['file']), esc_html($size['ewww_image_optimizer']));
            }
        }
    }
    // calculate how much time has elapsed since we started
    $elapsed = microtime(true) - $started;
    // output how much time has elapsed since we started
    $output['results'] .= sprintf(esc_html__('Elapsed: %.3f seconds', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>", $elapsed);
    global $ewww_attachment;
    $ewww_attachment['id'] = $attachment;
    $ewww_attachment['meta'] = $meta;
    add_filter('w3tc_cdn_update_attachment_metadata', 'ewww_image_optimizer_w3tc_update_files');
    // update the metadata for the current attachment
    wp_update_attachment_metadata($attachment, $meta);
    // store the updated list of attachment IDs back in the 'bulk_attachments' option
    update_option('ewww_image_optimizer_bulk_attachments', $attachments);
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
        global $ewww_debug;
        $output['results'] .= '<div style="background-color:#ffff99;">' . $ewww_debug . '</div>';
    }
    if (!empty($attachments)) {
        $next_attachment = array_shift($attachments);
        $next_file = ewww_image_optimizer_bulk_filename($next_attachment);
        // generate the WP spinner image for display
        $loading_image = plugins_url('/images/wpspin.gif', __FILE__);
        if ($next_file) {
            $output['next_file'] = "<p>" . esc_html__('Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <b>{$next_file}</b>&nbsp;<img src='{$loading_image}' /></p>";
        } else {
            $output['next_file'] = "<p>" . esc_html__('Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "&nbsp;<img src='{$loading_image}' /></p>";
        }
    }
    echo json_encode($output);
    ewww_image_optimizer_debug_log();
    ewwwio_memory(__FUNCTION__);
    die;
}
开发者ID:crazyyy,项目名称:bessarabia,代码行数:90,代码来源:bulk.php


示例5: ewww_image_optimizer_image_scan

function ewww_image_optimizer_image_scan($dir)
{
    global $ewww_debug;
    global $wpdb;
    $ewww_debug .= "<b>ewww_image_optimizer_image_scan()</b><br>";
    $images = array();
    if (!is_dir($dir)) {
        return $images;
    }
    $ewww_debug .= "scanning folder for images: {$dir}<br>";
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
    $start = microtime(true);
    $query = "SELECT path,image_size FROM {$wpdb->ewwwio_images}";
    $already_optimized = $wpdb->get_results($query, ARRAY_A);
    $file_counter = 0;
    if (ewww_image_optimizer_stl_check()) {
        set_time_limit(0);
    }
    foreach ($iterator as $path) {
        $file_counter++;
        $skip_optimized = false;
        if ($path->isFile()) {
            //	continue;
            //} else {
            $path = $path->getPathname();
            if (preg_match('/\\.(po|mo|pot|php|txt|js|css|html|woff|webp|json|svg|xml|ttf|otf|eot|md)$/', $path)) {
                $ewww_debug .= "not a usable extension: {$path}<br>";
                continue;
            }
            $mimetype = ewww_image_optimizer_mimetype($path, 'i');
            if (empty($mimetype) || !preg_match('/^image\\/(jpeg|png|gif)/', $mimetype)) {
                $ewww_debug .= "not a usable mimetype: {$path}<br>";
                continue;
            }
            foreach ($already_optimized as $optimized) {
                if ($optimized['path'] === $path) {
                    $image_size = filesize($path);
                    if ($optimized['image_size'] == $image_size) {
                        $ewww_debug .= "match found for {$path}<br>";
                        $skip_optimized = true;
                        break;
                    } else {
                        $ewww_debug .= "mismatch found for {$path}, db says " . $optimized['image_size'] . " vs. current {$image_size}<br>";
                    }
                }
            }
            if (empty($skip_optimized) || !empty($_REQUEST['ewww_force'])) {
                $ewww_debug .= "queued {$path}<br>";
                $images[] = $path;
            }
        }
    }
    $end = microtime(true) - $start;
    $ewww_debug .= "query time for {$file_counter} files (seconds): {$end} <br>";
    ewwwio_memory(__FUNCTION__);
    return $images;
}
开发者ID:jrald1291,项目名称:atu,代码行数:57,代码来源:aux-optimize.php


示例6: ewww_image_optimizer_image_scan

function ewww_image_optimizer_image_scan($dir)
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    global $wpdb;
    $images = array();
    if (!is_dir($dir)) {
        return $images;
    }
    ewwwio_debug_message("scanning folder for images: {$dir}");
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
    $start = microtime(true);
    $query = "SELECT path,image_size FROM {$wpdb->ewwwio_images}";
    $already_optimized = $wpdb->get_results($query, ARRAY_A);
    $optimized_list = array();
    foreach ($already_optimized as $optimized) {
        $optimized_path = $optimized['path'];
        $optimized_list[$optimized_path] = $optimized['image_size'];
    }
    $file_counter = 0;
    if (ewww_image_optimizer_stl_check()) {
        set_time_limit(0);
    }
    foreach ($iterator as $file) {
        $file_counter++;
        $skip_optimized = false;
        if ($file->isFile()) {
            $path = $file->getPathname();
            if (preg_match('/(\\/|\\\\)\\./', $path) && apply_filters('ewww_image_optimizer_ignore_hidden_files', true)) {
                //			ewwwio_debug_message( "skipping hidden file: $path" );
                continue;
            }
            if (preg_match('/\\.(conf|crt|css|docx|eot|exe|git|gitignore|gitmodules|gz|hgignore|hgsub|hgsubstate|hgtags|htaccess|htm|html|ico|ini|js|json|key|less|lock|log|map|md|mo|mp3|mp4|otf|pdf|pem|php|po|pot|sample|scss|sh|svg|svnignore|swf|template|tiff|tmp|tpl|ttf|txt|url|vcl|woff|woff2|webp|xap|xml|yml|zip)$/', $path)) {
                //			ewwwio_debug_message( "not a usable extension: $path" );
                continue;
            }
            if (!preg_match('/\\./', $path)) {
                //			ewwwio_debug_message( "no extension: $path" );
                continue;
            }
            if (isset($optimized_list[$path])) {
                $image_size = $file->getSize();
                if ($optimized_list[$path] == $image_size) {
                    ewwwio_debug_message("match found for {$path}");
                    $skip_optimized = true;
                } else {
                    ewwwio_debug_message("mismatch found for {$path}, db says " . $optimized_list[$path] . " vs. current {$image_size}");
                }
            }
            if (empty($skip_optimized) || !empty($_REQUEST['ewww_force'])) {
                ewwwio_debug_message("queued {$path}");
                $images[] = $path;
            }
        }
    }
    $end = microtime(true) - $start;
    ewwwio_debug_message("query time for {$file_counter} files (seconds): {$end}");
    ewwwio_memory(__FUNCTION__);
    return $images;
}
开发者ID:ashenkar,项目名称:sanga,代码行数:59,代码来源:aux-optimize.php


示例7: ewww_image_optimizer_aux_images_loop

function ewww_image_optimizer_aux_images_loop($attachment = null, $auto = false)
{
    ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
    global $ewww_defer;
    $ewww_defer = false;
    $output = array();
    // verify that an authorized user has started the optimizer
    $permissions = apply_filters('ewww_image_optimizer_bulk_permissions', '');
    if (!$auto && (empty($_REQUEST['ewww_wpnonce']) || !wp_verify_nonce($_REQUEST['ewww_wpnonce'], 'ewww-image-optimizer-bulk') || !current_user_can($permissions))) {
        $output['error'] = esc_html__('Access token has expired, please reload the page.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
        echo json_encode($output);
        die;
    }
    session_write_close();
    if (!empty($_REQUEST['ewww_wpnonce'])) {
        // find out if our nonce is on it's last leg/tick
        $tick = wp_verify_nonce($_REQUEST['ewww_wpnonce'], 'ewww-image-optimizer-bulk');
        if ($tick === 2) {
            ewwwio_debug_message('nonce on its last leg');
            $output['new_nonce'] = wp_create_nonce('ewww-image-optimizer-bulk');
        } else {
            ewwwio_debug_message('nonce still alive and kicking');
            $output['new_nonce'] = '';
        }
    }
    // retrieve the time when the optimizer starts
    $started = microtime(true);
    if (ewww_image_optimizer_stl_check() && ini_get('max_execution_time') < 60) {
        set_time_limit(0);
    }
    // get the 'aux attachments' with a list of attachments remaining
    $attachments = get_option('ewww_image_optimizer_aux_attachments');
    if (empty($attachment)) {
        $attachment = array_shift($attachments);
    }
    // do the optimization for the current image
    $results = ewww_image_optimizer($attachment);
    //global $ewww_exceed;
    $ewww_status = get_transient('ewww_image_optimizer_cloud_status');
    if (!empty($ewww_status) && preg_match('/exceeded/', $ewww_status)) {
        if (!$auto) {
            $output['error'] = esc_html__('License Exceeded', EWWW_IMAGE_OPTIMIZER_DOMAIN);
            echo json_encode($output);
        }
        die;
    }
    // store the updated list of attachment IDs back in the 'bulk_attachments' option
    update_option('ewww_image_optimizer_aux_attachments', $attachments);
    if (!$auto) {
        // output the path
        $output['results'] = sprintf("<p>" . esc_html__('Optimized', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <strong>%s</strong><br>", esc_html($attachment));
        // tell the user what the results were for the original image
        $output['results'] .= sprintf("%s<br>", $results[1]);
        // calculate how much time has elapsed since we started
        $elapsed = microtime(true) - $started;
        // output how much time has elapsed since we started
        $output['results'] .= sprintf(esc_html__('Elapsed: %.3f seconds', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>", $elapsed);
        if (get_site_option('ewww_image_optimizer_debug')) {
            global $ewww_debug;
            $output['results'] .= '<div style="background-color:#ffff99;">' . $ewww_debug . '</div>';
        }
        if (!empty($attachments)) {
            $next_file = array_shift($attachments);
            $loading_image = plugins_url('/images/wpspin.gif', __FILE__);
            $output['next_file'] = "<p>" . esc_html__('Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <b>{$next_file}</b>&nbsp;<img src='{$loading_image}' alt='loading'/></p>";
        }
        echo json_encode($output);
        ewwwio_memory(__FUNCTION__);
        die;
    }
    ewwwio_memory(__FUNCTION__);
}
开发者ID:crazyyy,项目名称:bessarabia,代码行数:72,代码来源:common.php


示例8: ewww_image_optimizer_options


//.........这里部分代码省略.........
        ewwwio_debug_message($size . ': ' . (!empty($disabled_sizes_opt[$size]) ? "optimization=disabled " : "optimization=enabled ") . (!empty($disabled_sizes[$size]) ? "creation=disabled" : "creation=enabled"));
    }
    $output[] = "</table>\n";
    $output[] = "</td></tr>\n";
    $output[] = "<tr><th><label for='ewww_image_optimizer_skip_size'>" . esc_html__('Skip Small Images', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='text' id='ewww_image_optimizer_skip_size' name='ewww_image_optimizer_skip_size' size='8' value='" . ewww_image_optimizer_get_option('ewww_image_optimizer_skip_size') . "'> " . esc_html__('Do not optimize images smaller than this (in bytes)', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</td></tr>\n";
    ewwwio_debug_message("skip images smaller than: " . ewww_image_optimizer_get_option('ewww_image_optimizer_skip_size') . " bytes");
    $output[] = "<tr><th><label for='ewww_image_optimizer_skip_png_size'>" . esc_html__('Skip Large PNG Images', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='text' id='ewww_image_optimizer_skip_png_size' name='ewww_image_optimizer_skip_png_size' size='8' value='" . ewww_image_optimizer_get_option('ewww_image_optimizer_skip_png_size') . "'> " . esc_html__('Do not optimize PNG images larger than this (in bytes)', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</td></tr>\n";
    ewwwio_debug_message("skip PNG images larger than: " . ewww_image_optimizer_get_option('ewww_image_optimizer_skip_png_size') . " bytes");
    $output[] = "<tr><th><label for='ewww_image_optimizer_lossy_skip_full'>" . esc_html__('Exclude full-size images from lossy optimization', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='checkbox' id='ewww_image_optimizer_lossy_skip_full' name='ewww_image_optimizer_lossy_skip_full' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_lossy_skip_full') == TRUE ? "checked='true'" : "") . " /></td></tr>\n";
    ewwwio_debug_message("exclude originals from lossy: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_lossy_skip_full') == TRUE ? "on" : "off"));
    $output[] = "<tr><th><label for='ewww_image_optimizer_metadata_skip_full'>" . esc_html__('Exclude full-size images from metadata removal', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='checkbox' id='ewww_image_optimizer_metadata_skip_full' name='ewww_image_optimizer_metadata_skip_full' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_metadata_skip_full') == TRUE ? "checked='true'" : "") . " /></td></tr>\n";
    ewwwio_debug_message("exclude originals from metadata removal: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_metadata_skip_full') == TRUE ? "on" : "off"));
    $output[] = "<tr class='nocloud'><th><label for='ewww_image_optimizer_skip_bundle'>" . esc_html__('Use System Paths', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='checkbox' id='ewww_image_optimizer_skip_bundle' name='ewww_image_optimizer_skip_bundle' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_skip_bundle') == TRUE ? "checked='true'" : "") . " /> " . sprintf(esc_html__('If you have already installed the utilities in a system location, such as %s or %s, use this to force the plugin to use those versions and skip the auto-installers.', EWWW_IMAGE_OPTIMIZER_DOMAIN), '/usr/local/bin', '/usr/bin') . "</td></tr>\n";
    ewwwio_debug_message("use system binaries: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_skip_bundle') == TRUE ? "yes" : "no"));
    $output[] = "</table>\n</div>\n";
    $output[] = "<div id='ewww-conversion-settings'>\n";
    $output[] = "<p>" . esc_html__('Conversion is only available for images in the Media Library (except WebP). By default, all images have a link available in the Media Library for one-time conversion. Turning on individual conversion operations below will enable conversion filters any time an image is uploaded or modified.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "<br />\n" . "<b>" . esc_html__('NOTE:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b> " . esc_html__('The plugin will attempt to update image locations for any posts that contain the images. You may still need to manually update locations/urls for converted images.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "\n" . "</p>\n";
    $output[] = "<table class='form-table'>\n";
    $output[] = "<tr><th><label for='ewww_image_optimizer_disable_convert_links'>" . esc_html__('Hide Conversion Links', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label</th><td><input type='checkbox' id='ewww_image_optimizer_disable_convert_links' name='ewww_image_optimizer_disable_convert_links' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_disable_convert_links') == TRUE ? "checked='true'" : "") . " /> " . esc_html__('Site or Network admins can use this to prevent other users from using the conversion links in the Media Library which bypass the settings below.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</td></tr>\n";
    $output[] = "<tr><th><label for='ewww_image_optimizer_delete_originals'>" . esc_html__('Delete originals', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><input type='checkbox' id='ewww_image_optimizer_delete_originals' name='ewww_image_optimizer_delete_originals' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_delete_originals') == TRUE ? "checked='true'" : "") . " /> " . esc_html__('This will remove the original image from the server after a successful conversion.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</td></tr>\n";
    ewwwio_debug_message("delete originals: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_delete_originals') == TRUE ? "on" : "off"));
    //				$output[] = "<tr><th><label for='ewww_image_optimizer_webp_cdn_path'>" . esc_html__('WebP CDN URL', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_cdn_path' name='ewww_image_optimizer_webp_cdn_path' value='true' " . ( ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') == TRUE ? "checked='true'" : "" ) . " /> " . esc_html__('Uses output buffering and libxml functionality from PHP. Use this if the Apache rewrite rules do not work, or if your images are served from a CDN.', EWWW_IMAGE_OPTIMIZER_DOMAIN) .  "</span></td></tr>";
    $output[] = "<tr><th><label for='ewww_image_optimizer_jpg_to_png'>" . sprintf(esc_html__('enable %s to %s conversion', EWWW_IMAGE_OPTIMIZER_DOMAIN), 'JPG', 'PNG') . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_jpg_to_png' name='ewww_image_optimizer_jpg_to_png' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_jpg_to_png') == TRUE ? "checked='true'" : "") . " /> <b>" . esc_html__('WARNING:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b> " . esc_html__('Removes metadata and increases cpu usage dramatically.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span>\n" . "<p class='description'>" . esc_html__('PNG is generally much better than JPG for logos and other images with a limited range of colors. Checking this option will slow down JPG processing significantly, and you may want to enable it only temporarily.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p></td></tr>\n";
    ewwwio_debug_message("jpg2png: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_jpg_to_png') == TRUE ? "on" : "off"));
    $output[] = "<tr><th><label for='ewww_image_optimizer_png_to_jpg'>" . sprintf(esc_html__('enable %s to %s conversion', EWWW_IMAGE_OPTIMIZER_DOMAIN), 'PNG', 'JPG') . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_png_to_jpg' name='ewww_image_optimizer_png_to_jpg' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_png_to_jpg') == TRUE ? "checked='true'" : "") . " /> <b>" . esc_html__('WARNING:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b> " . esc_html__('This is not a lossless conversion.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span>\n" . "<p class='description'>" . esc_html__('JPG is generally much better than PNG for photographic use because it compresses the image and discards data. PNGs with transparency are not converted by default.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n" . "<span><label for='ewww_image_optimizer_jpg_background'> " . esc_html__('JPG background color:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label> #<input type='text' id='ewww_image_optimizer_jpg_background' name='ewww_image_optimizer_jpg_background' size='6' value='" . ewww_image_optimizer_jpg_background() . "' /> <span style='padding-left: 12px; font-size: 12px; border: solid 1px #555555; background-color: #" . ewww_image_optimizer_jpg_background() . "'>&nbsp;</span> " . esc_html__('HEX format (#123def)', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ".</span>\n" . "<p class='description'>" . esc_html__('Background color is used only if the PNG has transparency. Leave this value blank to skip PNGs with transparency.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p></td></tr>\n";
    //	"<span><label for='ewww_image_optimizer_jpg_quality'>" . esc_html__('JPG quality level:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label> <input type='text' id='ewww_image_optimizer_jpg_quality' name='ewww_image_optimizer_jpg_quality' class='small-text' value='" . ewww_image_optimizer_jpg_quality() . "' /> " . esc_html__('Valid values are 1-100.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span>\n" .
    //				"<p class='description'>" . esc_html__('If JPG quality is blank, the plugin will attempt to set the optimal quality level or default to 92. Remember, this is a lossy conversion, so you are losing pixels, and it is not recommended to actually set the level here unless you want noticable loss of image quality.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p></td></tr>\n";
    ewwwio_debug_message("png2jpg: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_png_to_jpg') == TRUE ? "on" : "off"));
    $output[] = "<tr><th><label for='ewww_image_optimizer_gif_to_png'>" . sprintf(esc_html__('enable %s to %s conversion', EWWW_IMAGE_OPTIMIZER_DOMAIN), 'GIF', 'PNG') . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_gif_to_png' name='ewww_image_optimizer_gif_to_png' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_gif_to_png') == TRUE ? "checked='true'" : "") . " /> " . esc_html__('No warnings here, just do it.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span>\n" . "<p class='description'> " . esc_html__('PNG is generally better than GIF, but animated images cannot be converted.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p></td></tr>\n";
    ewwwio_debug_message("gif2png: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_gif_to_png') == TRUE ? "on" : "off"));
    $output[] = "</table>\n</div>\n";
    $output[] = "<div id='ewww-webp-settings'>\n";
    $output[] = "<table class='form-table'>\n";
    $output[] = "<tr><th><label for='ewww_image_optimizer_webp'>" . esc_html__('JPG/PNG to WebP', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_webp' name='ewww_image_optimizer_webp' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp') == TRUE ? "checked='true'" : "") . " /> <b>" . esc_html__('WARNING:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</b> ' . esc_html__('JPG to WebP conversion is lossy, but quality loss is minimal. PNG to WebP conversion is lossless.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span>\n" . "<p class='description'>" . esc_html__('Originals are never deleted, and WebP images should only be served to supported browsers.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <a href='#webp-rewrite'>" . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp') && !ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') ? esc_html__('You can use the rewrite rules below to serve WebP images with Apache.', EWWW_IMAGE_OPTIMIZER_DOMAIN) : '') . "</a></td></tr>\n";
    ewwwio_debug_message("webp conversion: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp') == TRUE ? "on" : "off"));
    $output[] = "<tr><th><label for='ewww_image_optimizer_webp_force'>" . esc_html__('Force WebP', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_force' name='ewww_image_optimizer_webp_force' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_force') == TRUE ? "checked='true'" : "") . " /> " . esc_html__('WebP images will be generated and saved for all JPG/PNG images regardless of their size. The Alternative WebP Rewriting will not check if a file exists, only that the domain matches the home url.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</span></td></tr>\n";
    ewwwio_debug_message("forced webp: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_force') == TRUE ? "on" : "off"));
    //				ewwwio_debug_message( "webp paths: " . esc_attr( ewww_image_optimizer_get_option('ewww_image_optimizer_webp_paths') ) );
    if (!ewww_image_optimizer_ce_webp_enabled()) {
        $output[] = "<tr><th><label for='ewww_image_optimizer_webp_paths'>" . esc_html__('WebP URLs', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td>" . esc_html__('If Force WebP is enabled, enter URL patterns that should be permitted for Alternative WebP Rewriting. One pattern per line, may be partial URLs, but must include the domain name.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "<br>";
        $output[] = "<textarea id='ewww_image_optimizer_webp_paths' name='ewww_image_optimizer_webp_paths' rows='3' cols='60'>" . (($webp_paths = ewww_image_optimizer_get_option('ewww_image_optimizer_webp_paths')) ? esc_html(implode("\n", $webp_paths)) : "") . "</textarea></td></tr>\n";
        if (ewww_image_optimizer_iterable($webp_paths)) {
            ewwwio_debug_message("webp paths:");
            foreach ($webp_paths as $webp_path) {
                ewwwio_debug_message($webp_path);
            }
        }
        $output[] = "<tr><th><label for='ewww_image_optimizer_webp_for_cdn'>" . esc_html__('Alternative WebP Rewriting', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</label></th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_for_cdn' name='ewww_image_optimizer_webp_for_cdn' value='true' " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') == TRUE ? "checked='true'" : "") . " /> " . esc_html__('Uses output buffering and libxml functionality from PHP. Use this if the Apache rewrite rules do not work, or if your images are served from a CDN.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ' ' . sprintf(esc_html__('Sites using a CDN may also use the WebP option in the %s plugin.', EWWW_IMAGE_OPTIMIZER_DOMAIN), '<a href="https://wordpress.org/plugins/cache-enabler/">Cache Enabler</a>') . "</span></td></tr>";
    }
    ewwwio_debug_message("alt webp rewriting: " . (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') == TRUE ? "on" : "off"));
    $output[] = "</table>\n</div>\n";
    $output[] = "<p class='submit'><input type='submit' class='button-primary' value='" . esc_attr__('Save Changes', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "' /></p>\n";
    $output[] = "</form>\n";
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_webp') && !ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') && !ewww_image_optimizer_ce_webp_enabled()) {
        $output[] = "<form id='ewww-webp-rewrite'>\n";
        $output[] = "<p>" . esc_html__('There are many ways to serve WebP images to visitors with supported browsers. You may choose any you wish, but it is recommended to serve them with an .htaccess file using mod_rewrite and mod_headers. The plugin can insert the rules for you if the file is writable, or you can edit .htaccess yourself.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n";
        if (!ewww_image_optimizer_webp_rewrite_verify()) {
            $output[] = "<img id='webp-image' src='" . plugins_url('/images/test.png', __FILE__) . "' style='float: right; padding: 0 0 10px 10px;'>\n" . "<p id='ewww-webp-rewrite-status'><b>" . esc_html__('Rules verified successfully', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b></p>\n";
            ewwwio_debug_message('webp .htaccess rewriting enabled');
        } else {
            $output[] = "<pre id='webp-rewrite-rules' style='background: white; font-color: black; border: 1px solid black; clear: both; padding: 10px;'>\n" . "&lt;IfModule mod_rewrite.c&gt;\n" . "RewriteEngine On\n" . "RewriteCond %{HTTP_ACCEPT} image/webp\n" . "RewriteCond %{REQUEST_FILENAME} (.*)\\.(jpe?g|png)\$\n" . "RewriteCond %{REQUEST_FILENAME}\\.webp -f\n" . "RewriteRule (.+)\\.(jpe?g|png)\$ %{REQUEST_FILENAME}.webp [T=image/webp,E=accept:1]\n" . "&lt;/IfModule&gt;\n" . "&lt;IfModule mod_headers.c&gt;\n" . "Header append Vary Accept env=REDIRECT_accept\n" . "&lt;/IfModule&gt;\n" . "AddType image/webp .webp</pre>\n" . "<img id='webp-image' src='" . plugins_url('/images/test.png', __FILE__) . "' style='float: right; padding-left: 10px;'>\n" . "<p id='ewww-webp-rewrite-status'>" . esc_html__('The image to the right will display a WebP image with WEBP in white text, if your site is serving WebP images and your browser supports WebP.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n" . "<button type='submit' class='button-secondary action'>" . esc_html__('Insert Rewrite Rules', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</button>\n";
            ewwwio_debug_message('webp .htaccess rules not detected');
        }
        $output[] = "</form>\n";
    } elseif (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') && !ewww_image_optimizer_ce_webp_enabled()) {
        $test_webp_image = plugins_url('/images/test.png.webp', __FILE__);
        $test_png_image = plugins_url('/images/test.png', __FILE__);
        $output[] = "<noscript  data-img='{$test_png_image}' data-webp='{$test_webp_image}' data-style='float: right; padding: 0 0 10px 10px;' class='ewww_webp'><img src='{$test_png_image}' style='float: right; padding: 0 0 10px 10px;'></noscript>\n";
    }
    $output[] = "</div><!-- end container left -->\n";
    $output[] = "<div id='ewww-container-right' style='border: 1px solid #e5e5e5; float: right; margin-left: -215px; padding: 0em 1.5em 1em; background-color: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); display: inline-block; width: 174px;'>\n" . "<h2>" . esc_html__('Support EWWW I.O.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</h2>\n" . "<p>" . esc_html__('Would you like to help support development of this plugin?', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n" . "<p><a href='https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/'>" . esc_html__('Help translate EWWW I.O.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</a></p>\n" . "<p><a href='https://wordpress.org/support/view/plugin-reviews/ewww-image-optimizer#postform'>" . esc_html__('Write a review.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</a></p>\n" . "<p>" . wp_kses(sprintf(__('Contribute directly via %s.', EWWW_IMAGE_OPTIMIZER_DOMAIN), "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=MKMQKCBFFG3WW'>Paypal</a>"), array('a' => array('href' => array()))) . "</p>\n" . "<p>" . esc_html__('Use any of these referral links to show your appreciation:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n" . "<p><b>" . esc_html__('Web Hosting:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b><br>\n" . "<a href='http://www.a2hosting.com/?aid=b6322137'>A2 Hosting:</a> " . esc_html_x('with automatic EWWW IO setup', 'A2 Hosting:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "<br>\n" . "<a href='http://www.bluehost.com/track/nosilver4u'>Bluehost</a><br>\n" . "<a href='http://www.dreamhost.com/r.cgi?132143'>Dreamhost</a>\n" . "</p>\n" . "<p><b>" . esc_html_x('VPS:', 'abbreviation for Virtual Private Server', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b><br>\n" . "<a href='https://www.digitalocean.com/?refcode=89ef0197ec7e'>DigitalOcean</a><br>\n" . "<a href='https://clientarea.ramnode.com/aff.php?aff=1469'>RamNode</a><br>\n" . "</p>\n" . "<p><b>" . esc_html_x('CDN:', 'abbreviation for Content Delivery Network', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</b><br><a target='_blank' href='http://tracking.maxcdn.com/c/91625/36539/378'>" . esc_html__('Add MaxCDN to increase website speeds dramatically! Sign Up Now and Save 25%.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</a> " . esc_html__('Integrate MaxCDN within Wordpress using the W3 Total Cache plugin.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>\n" . "</div>\n" . "</div>\n";
    ewwwio_debug_message('max_execution_time: ' . ini_get('max_execution_time'));
    ewww_image_optimizer_stl_check();
    echo apply_filters('ewww_image_optimizer_settings', $output);
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_webp_for_cdn') && !ewww_image_optimizer_ce_webp_enabled()) {
        ewww_image_optimizer_webp_inline_script();
    }
    if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
        ?>
<script type="text/javascript">
    function selectText(containerid) {
        if (document.selection) {
            var range = document.body.createTextRange();
            range.moveToElementText(document.getElementById(containerid));
            range.select();
        } else if (window.getSelection) {
            var range = document.createRange();
            range.selectNode(document.getElementById(containerid));
            window.getSelection().addRange(range);
        }
    }
</script>
		<?php 
        global $ewww_debug;
        echo '<p style="clear:both"><b>' . esc_html__('Debugging Information', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ':</b> <button onclick="selectText(' . "'ewww-debug-info'" . ')">' . esc_html__('Select All', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</button></p>';
        echo '<div id="ewww-debug-info" style="background:#ffff99;margin-left:-20px;padding:10px" contenteditable="true">' . $ewww_debug . '</div>';
    }
    ewwwio_memory(__FUNCTION__);
    ewww_image_optimizer_debug_log();
}
开发者ID:aaronfrey,项目名称:PepperLillie-CVM,代码行数:101,代码来源:common.php


示例9: ewww_image_optimizer_webp_loop


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ewww_image_optimizer_tool_found函数代码示例发布时间:2022-05-15
下一篇:
PHP ewww_image_optimizer_safemode_check函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap