Version Description
Release date: 10th Ianuary 2019
- change the JS name in order to circumveit cache problem on many WP installs
- sorting the Media Library entries by ShortPixel optimization: also sort based on compression level
- Fixed: case sensitive search for guid duplicates of image posts (needed for finding Polylang versions)
- Fixed: the data-lazy-src/srcset detection for WebP
- Improvements to the Deliver WebP options and especially messages with caveats
- Load the ShortPixel CSS only on admin pages that need it
Download this release
Release Info
Developer | ShortPixel |
Plugin | ShortPixel Image Optimizer |
Version | 4.12.5 |
Comparing to | |
See all releases |
Code changes from version 4.12.4 to 4.12.5
- class/db/shortpixel-meta-facade.php +15 -3
- class/front/img-to-picture-webp.php +2 -1
- class/shortpixel_queue.php +1 -1
- class/view/shortpixel-feedback.php +2 -1
- class/view/shortpixel_view.php +24 -17
- class/wp-short-pixel.php +51 -30
- readme.txt +14 -3
- res/css/short-pixel.css +14 -5
- res/css/short-pixel.min.css +1 -1
- res/img/.htaccess +15 -0
- res/img/test.jpg +0 -0
- res/img/test.webp +0 -0
- res/js/short-pixel.min.js +0 -1
- res/js/{short-pixel.js → shortpixel.js} +3 -1
- res/js/shortpixel.min.js +1 -0
- wp-shortpixel.php +2 -2
class/db/shortpixel-meta-facade.php
CHANGED
@@ -482,13 +482,25 @@ class ShortPixelMetaFacade {
|
|
482 |
", $id ) );
|
483 |
|
484 |
//Polylang
|
485 |
-
$moreDuplicates = $wpdb->
|
486 |
-
SELECT p.ID FROM {$wpdb->posts} p
|
487 |
INNER JOIN {$wpdb->posts} pbase ON p.guid = pbase.guid
|
488 |
WHERE pbase.ID = %s
|
489 |
", $id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
|
491 |
-
$duplicates = array_unique(
|
492 |
|
493 |
if(!in_array($id, $duplicates)) $duplicates[] = $id;
|
494 |
|
482 |
", $id ) );
|
483 |
|
484 |
//Polylang
|
485 |
+
$moreDuplicates = $wpdb->get_results( $wpdb->prepare( "
|
486 |
+
SELECT p.ID, p.guid FROM {$wpdb->posts} p
|
487 |
INNER JOIN {$wpdb->posts} pbase ON p.guid = pbase.guid
|
488 |
WHERE pbase.ID = %s
|
489 |
", $id ) );
|
490 |
+
//MySQL is doing a CASE INSENSITIVE join on p.guid!! so double check the results.
|
491 |
+
$guid = false;
|
492 |
+
foreach($moreDuplicates as $duplicate) {
|
493 |
+
if($duplicate->ID == $id) {
|
494 |
+
$guid = $duplicate->guid;
|
495 |
+
}
|
496 |
+
}
|
497 |
+
foreach($moreDuplicates as $duplicate) {
|
498 |
+
if($duplicate->guid == $guid) {
|
499 |
+
$duplicates[] = $duplicate->ID;
|
500 |
+
}
|
501 |
+
}
|
502 |
|
503 |
+
$duplicates = array_unique($duplicates);
|
504 |
|
505 |
if(!in_array($id, $duplicates)) $duplicates[] = $id;
|
506 |
|
class/front/img-to-picture-webp.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
class ShortPixelImgToPictureWebp {
|
8 |
|
9 |
public static function lazyGet($img, $type) {
|
|
|
10 |
return array(
|
11 |
'value' =>
|
12 |
(isset($img['data-lazy-' . $type]) && strlen($img['data-lazy-' . $type])) ?
|
@@ -180,4 +181,4 @@ class ShortPixelImgToPictureWebp {
|
|
180 |
return !empty($attachment_id) ? $attachment_id[0] : false;
|
181 |
}
|
182 |
|
183 |
-
}
|
7 |
class ShortPixelImgToPictureWebp {
|
8 |
|
9 |
public static function lazyGet($img, $type) {
|
10 |
+
|
11 |
return array(
|
12 |
'value' =>
|
13 |
(isset($img['data-lazy-' . $type]) && strlen($img['data-lazy-' . $type])) ?
|
181 |
return !empty($attachment_id) ? $attachment_id[0] : false;
|
182 |
}
|
183 |
|
184 |
+
}
|
class/shortpixel_queue.php
CHANGED
@@ -75,8 +75,8 @@ class ShortPixelQueue {
|
|
75 |
$fp = @fopen($queueName, "r+");
|
76 |
if(!$fp) {
|
77 |
$fp = @fopen($queueName, "w");
|
|
|
78 |
}
|
79 |
-
if(!$fp) return false;
|
80 |
flock($fp, $lock);
|
81 |
return $fp;
|
82 |
}
|
75 |
$fp = @fopen($queueName, "r+");
|
76 |
if(!$fp) {
|
77 |
$fp = @fopen($queueName, "w");
|
78 |
+
if(!$fp) return false;
|
79 |
}
|
|
|
80 |
flock($fp, $lock);
|
81 |
return $fp;
|
82 |
}
|
class/view/shortpixel-feedback.php
CHANGED
@@ -37,7 +37,7 @@ class ShortPixelFeedback {
|
|
37 |
$deactivation_link = str_replace( '<a ',
|
38 |
'<div class="shortpixel-deactivate-form-wrapper">
|
39 |
<span class="shortpixel-deactivate-form" id="shortpixel-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span>
|
40 |
-
</div><a
|
41 |
$links['deactivate'] = $deactivation_link;
|
42 |
}
|
43 |
return $links;
|
@@ -177,6 +177,7 @@ class ShortPixelFeedback {
|
|
177 |
'maintenance' : '<?php echo __( 'Please specify', $this->plugin_name ) ?>',
|
178 |
};
|
179 |
|
|
|
180 |
$( deactivateURL ).on("click", function(){
|
181 |
|
182 |
var SubmitFeedback = function(data, formContainer){
|
37 |
$deactivation_link = str_replace( '<a ',
|
38 |
'<div class="shortpixel-deactivate-form-wrapper">
|
39 |
<span class="shortpixel-deactivate-form" id="shortpixel-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span>
|
40 |
+
</div><a id="shortpixel-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
|
41 |
$links['deactivate'] = $deactivation_link;
|
42 |
}
|
43 |
return $links;
|
177 |
'maintenance' : '<?php echo __( 'Please specify', $this->plugin_name ) ?>',
|
178 |
};
|
179 |
|
180 |
+
$( deactivateURL).attr('onclick', "javascript:event.preventDefault();");
|
181 |
$( deactivateURL ).on("click", function(){
|
182 |
|
183 |
var SubmitFeedback = function(data, formContainer){
|
class/view/shortpixel_view.php
CHANGED
@@ -1066,6 +1066,11 @@ class ShortPixelView {
|
|
1066 |
} else {
|
1067 |
$deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
|
1068 |
}
|
|
|
|
|
|
|
|
|
|
|
1069 |
}
|
1070 |
}
|
1071 |
|
@@ -1200,13 +1205,15 @@ class ShortPixelView {
|
|
1200 |
<td>
|
1201 |
<input name="png2jpg" type="checkbox" id="png2jpg" <?php echo( $convertPng2Jpg );?> <?php echo($gdInstalled ? '' : 'disabled') ?>>
|
1202 |
<label for="png2jpg"><?php _e('Automatically convert the PNG images to JPEG if possible.','shortpixel-image-optimiser');?></label>
|
1203 |
-
<input name="png2jpgForce" type="checkbox" id="png2jpgForce" <?php echo( $convertPng2JpgForce );?> <?php echo($gdInstalled ? '' : 'disabled') ?>>
|
1204 |
-
<label for="png2jpgForce"><?php _e('Force conversion of images with transparency.','shortpixel-image-optimiser');
|
1205 |
-
if(!$gdInstalled) {echo(" <span style='color:red;'>" . __('You need PHP GD for this. Please ask your hosting to install it.','shortpixel-image-optimiser') . "</span>");}
|
1206 |
-
?></label>
|
1207 |
<p class="settings-info">
|
1208 |
<?php _e('Converts all PNGs that don\'t have transparent pixels to JPEG. This can dramatically reduce the file size, especially if you have camera pictures that are saved in PNG format. The plugin will also search for references of the image in posts and will replace them.','shortpixel-image-optimiser');?>
|
1209 |
-
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
1210 |
</td>
|
1211 |
</tr>
|
1212 |
<tr>
|
@@ -1236,21 +1243,10 @@ class ShortPixelView {
|
|
1236 |
<?php _e('Deliver the WebP versions of the images in the front-end:','shortpixel-image-optimiser');?>
|
1237 |
</label>
|
1238 |
<ul class="deliverWebpTypes">
|
1239 |
-
<li>
|
1240 |
-
<input type="radio" name="deliverWebpType" id="deliverWebpUnaltered" <?php echo( $deliverWebpUnaltered );?> <?php echo( $deliverWebpUnalteredDisabled );?> value="deliverWebpUnaltered">
|
1241 |
-
<label for="deliverWebpUnaltered">
|
1242 |
-
<?php _e('Without altering the page code (via .htaccess)','shortpixel-image-optimiser')?>
|
1243 |
-
</label>
|
1244 |
-
<?php if($deliverWebpUnalteredLabel){ ?>
|
1245 |
-
<p class="sp-notice">
|
1246 |
-
<?php echo( $deliverWebpUnalteredLabel );?>
|
1247 |
-
</p>
|
1248 |
-
<?php } ?>
|
1249 |
-
</li>
|
1250 |
<li>
|
1251 |
<input type="radio" name="deliverWebpType" id="deliverWebpAltered" <?php echo( $deliverWebpAltered );?> <?php echo( $deliverWebpAlteredDisabled );?> value="deliverWebpAltered">
|
1252 |
<label for="deliverWebpAltered">
|
1253 |
-
<?php _e('
|
1254 |
</label>
|
1255 |
<?php if($deliverWebpAlteredDisabledNotice){ ?>
|
1256 |
<p class="sp-notice">
|
@@ -1275,6 +1271,17 @@ class ShortPixelView {
|
|
1275 |
</li>
|
1276 |
</ul>
|
1277 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
</ul>
|
1279 |
</div>
|
1280 |
</td>
|
1066 |
} else {
|
1067 |
$deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
|
1068 |
}
|
1069 |
+
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false) {
|
1070 |
+
// Show a message about the risks and caveats of serving WEBP images via .htaccess
|
1071 |
+
$deliverWebpUnalteredLabel = '<span style="color: initial;">'.__('Based on testing your particular hosting configuration, we determined that your server','shortpixel-image-optimiser').
|
1072 |
+
'<img src="'.str_replace("/class/view", "/res", plugins_url( 'img/test.jpg' , __FILE__ )).'">'.
|
1073 |
+
__('serve the WEBP versions of the JPEG files seamlessly, via .htaccess.','shortpixel-image-optimiser').' <a href="javascript:void(0)" data-beacon-article="5c1d050e04286304a71d9ce4">Open article to read more about this.</a></span>';
|
1074 |
}
|
1075 |
}
|
1076 |
|
1205 |
<td>
|
1206 |
<input name="png2jpg" type="checkbox" id="png2jpg" <?php echo( $convertPng2Jpg );?> <?php echo($gdInstalled ? '' : 'disabled') ?>>
|
1207 |
<label for="png2jpg"><?php _e('Automatically convert the PNG images to JPEG if possible.','shortpixel-image-optimiser');?></label>
|
|
|
|
|
|
|
|
|
1208 |
<p class="settings-info">
|
1209 |
<?php _e('Converts all PNGs that don\'t have transparent pixels to JPEG. This can dramatically reduce the file size, especially if you have camera pictures that are saved in PNG format. The plugin will also search for references of the image in posts and will replace them.','shortpixel-image-optimiser');?>
|
1210 |
+
</p><br>
|
1211 |
+
<input name="png2jpgForce" type="checkbox" id="png2jpgForce" <?php echo( $convertPng2JpgForce );?> <?php echo($gdInstalled ? '' : 'disabled') ?>>
|
1212 |
+
<label for="png2jpgForce">
|
1213 |
+
<?php _e('Also force the conversion of images with transparency.','shortpixel-image-optimiser');
|
1214 |
+
if(!$gdInstalled) {echo(" <span style='color:red;'>" . __('You need PHP GD for this. Please ask your hosting to install it.','shortpixel-image-optimiser') . "</span>");}
|
1215 |
+
?>
|
1216 |
+
</label>
|
1217 |
</td>
|
1218 |
</tr>
|
1219 |
<tr>
|
1243 |
<?php _e('Deliver the WebP versions of the images in the front-end:','shortpixel-image-optimiser');?>
|
1244 |
</label>
|
1245 |
<ul class="deliverWebpTypes">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
<li>
|
1247 |
<input type="radio" name="deliverWebpType" id="deliverWebpAltered" <?php echo( $deliverWebpAltered );?> <?php echo( $deliverWebpAlteredDisabled );?> value="deliverWebpAltered">
|
1248 |
<label for="deliverWebpAltered">
|
1249 |
+
<?php _e('Using the <PICTURE> tag syntax','shortpixel-image-optimiser');?>
|
1250 |
</label>
|
1251 |
<?php if($deliverWebpAlteredDisabledNotice){ ?>
|
1252 |
<p class="sp-notice">
|
1271 |
</li>
|
1272 |
</ul>
|
1273 |
</li>
|
1274 |
+
<li>
|
1275 |
+
<input type="radio" name="deliverWebpType" id="deliverWebpUnaltered" <?php echo( $deliverWebpUnaltered );?> <?php echo( $deliverWebpUnalteredDisabled );?> value="deliverWebpUnaltered">
|
1276 |
+
<label for="deliverWebpUnaltered">
|
1277 |
+
<?php _e('Without altering the page code (via .htaccess)','shortpixel-image-optimiser')?>
|
1278 |
+
</label>
|
1279 |
+
<?php if($deliverWebpUnalteredLabel){ ?>
|
1280 |
+
<p class="sp-notice">
|
1281 |
+
<?php echo( $deliverWebpUnalteredLabel );?>
|
1282 |
+
</p>
|
1283 |
+
<?php } ?>
|
1284 |
+
</li>
|
1285 |
</ul>
|
1286 |
</div>
|
1287 |
</td>
|
class/wp-short-pixel.php
CHANGED
@@ -274,12 +274,14 @@ class WPShortPixel {
|
|
274 |
'action'=>'Deactivate',
|
275 |
'data'=>'simple-image-sizes/simple_image_sizes.php'
|
276 |
),
|
277 |
-
|
|
|
278 |
=> array(
|
279 |
'action'=>'Change Setting',
|
280 |
'data'=>'jetpack/jetpack.php',
|
281 |
'href'=>'admin.php?page=jetpack#/settings'
|
282 |
)
|
|
|
283 |
);
|
284 |
if($this->_settings->processThumbnails) {
|
285 |
$conflictPlugins = array_merge($conflictPlugins, array(
|
@@ -345,7 +347,7 @@ class WPShortPixel {
|
|
345 |
}
|
346 |
}
|
347 |
if( !isset($dismissed['unlisted']) && !$this->_settings->optimizeUnlisted
|
348 |
-
&& isset($this->_settings->currentStats['foundUnlistedThumbs']) && $this->_settings->currentStats['foundUnlistedThumbs']) {
|
349 |
ShortPixelView::displayActivationNotice('unlisted', $this->_settings->currentStats['foundUnlistedThumbs']);
|
350 |
return;
|
351 |
}
|
@@ -450,12 +452,18 @@ class WPShortPixel {
|
|
450 |
//require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
451 |
if(function_exists('get_current_screen')) {
|
452 |
$screen = get_current_screen();
|
453 |
-
if(is_object($screen)
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
}
|
460 |
}
|
461 |
?>
|
@@ -470,9 +478,8 @@ class WPShortPixel {
|
|
470 |
}
|
471 |
setTimeout(delayedInit, 10000);
|
472 |
</script> <?php
|
473 |
-
|
474 |
-
|
475 |
-
wp_register_script('short-pixel' . $this->jsSuffix, plugins_url('/res/js/short-pixel' . $this->jsSuffix,SHORTPIXEL_PLUGIN_FILE), array(), SHORTPIXEL_IMAGE_OPTIMISER_VERSION);
|
476 |
|
477 |
// Using an Array within another Array to protect the primitive values from being cast to strings
|
478 |
$ShortPixelConstants = array(array(
|
@@ -522,11 +529,13 @@ class WPShortPixel {
|
|
522 |
'pleaseDoNotSetLesser1024' => __( "Please do not set a {0} less than 1024, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
|
523 |
'confirmBulkRestore' => __( "Are you sure you want to restore from backup all the images in your Media Library optimized with ShortPixel?", 'shortpixel-image-optimiser' ),
|
524 |
'confirmBulkCleanup' => __( "Are you sure you want to cleanup the ShortPixel metadata info for the images in your Media Library optimized with ShortPixel? This will make ShortPixel 'forget' that it optimized them and will optimize them again if you re-run the Bulk Optimization process.", 'shortpixel-image-optimiser' ),
|
525 |
-
'confirmBulkCleanupPending' => __( "Are you sure you want to cleanup the pending metadata?", 'shortpixel-image-optimiser' )
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
|
|
|
|
530 |
|
531 |
wp_enqueue_script('jquery.knob.min.js', plugins_url('/res/js/jquery.knob.min.js',SHORTPIXEL_PLUGIN_FILE) );
|
532 |
wp_enqueue_script('jquery.tooltip.min.js', plugins_url('/res/js/jquery.tooltip.min.js',SHORTPIXEL_PLUGIN_FILE) );
|
@@ -978,11 +987,12 @@ class WPShortPixel {
|
|
978 |
$addIt = (strpos($meta->getMessage(), __('Image files are missing.', 'shortpixel-image-optimiser')) === false);
|
979 |
|
980 |
if(!$addIt) {
|
981 |
-
//in case the message is "Image files are missing", we
|
982 |
-
if (
|
983 |
-
|
984 |
-
$item = new ShortPixelMetaFacade($crtStartQueryID);
|
985 |
}
|
|
|
|
|
986 |
}
|
987 |
if($addIt) {
|
988 |
$itemList[] = $item;
|
@@ -2573,6 +2583,16 @@ class WPShortPixel {
|
|
2573 |
AddType image/webp .webp
|
2574 |
</IfModule>
|
2575 |
' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2576 |
}
|
2577 |
}
|
2578 |
|
@@ -2755,7 +2775,7 @@ class WPShortPixel {
|
|
2755 |
switch( $_POST['deliverWebpType'] ) {
|
2756 |
case 'deliverWebpUnaltered':
|
2757 |
$this->_settings->deliverWebp = 3;
|
2758 |
-
$this->alterHtaccess();
|
2759 |
break;
|
2760 |
case 'deliverWebpAltered':
|
2761 |
$this->alterHtaccess(true);
|
@@ -2773,9 +2793,11 @@ class WPShortPixel {
|
|
2773 |
}
|
2774 |
}
|
2775 |
} else {
|
|
|
2776 |
$this->_settings->deliverWebp = 0;
|
2777 |
}
|
2778 |
} else {
|
|
|
2779 |
$this->_settings->deliverWebp = 0;
|
2780 |
}
|
2781 |
|
@@ -2951,6 +2973,7 @@ class WPShortPixel {
|
|
2951 |
$args['body']['Settings'] = $settings;
|
2952 |
}
|
2953 |
|
|
|
2954 |
$comm = array();
|
2955 |
|
2956 |
//Try first HTTPS post. add the sslverify = false if https
|
@@ -2959,7 +2982,7 @@ class WPShortPixel {
|
|
2959 |
}
|
2960 |
$response = wp_remote_post($requestURL, $args);
|
2961 |
|
2962 |
-
$comm[] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
2963 |
|
2964 |
//some hosting providers won't allow https:// POST connections so we try http:// as well
|
2965 |
if(is_wp_error( $response )) {
|
@@ -2974,7 +2997,7 @@ class WPShortPixel {
|
|
2974 |
unset($args['sslverify']);
|
2975 |
}
|
2976 |
$response = wp_remote_post($requestURL, $args);
|
2977 |
-
$comm[] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
2978 |
|
2979 |
if(!is_wp_error( $response )){
|
2980 |
$this->_settings->httpProto = ($this->_settings->httpProto == 'https' ? 'http' : 'https');
|
@@ -2988,7 +3011,7 @@ class WPShortPixel {
|
|
2988 |
$args['body'] = null;
|
2989 |
$requestURL .= $argsStr;
|
2990 |
$response = wp_remote_get($requestURL, $args);
|
2991 |
-
$comm[] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
2992 |
}
|
2993 |
self::log("API STATUS COMM: " . json_encode($comm));
|
2994 |
|
@@ -3086,11 +3109,9 @@ class WPShortPixel {
|
|
3086 |
}
|
3087 |
|
3088 |
$file = get_attached_file($id);
|
3089 |
-
$data = wp_get_attachment_metadata($id);
|
3090 |
-
|
3091 |
-
|
3092 |
-
}
|
3093 |
-
//if($extended) {var_dump(wp_get_attachment_url($id)); echo('<br>BK: ' . apply_filters('shortpixel_get_backup', get_attached_file($id))); echo(json_encode($data));}
|
3094 |
$fileExtension = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
3095 |
$invalidKey = !$this->_settings->verifiedKey;
|
3096 |
$quotaExceeded = $this->_settings->quotaExceeded;
|
@@ -3318,7 +3339,7 @@ class WPShortPixel {
|
|
3318 |
}
|
3319 |
|
3320 |
public function columns( $defaults ) {
|
3321 |
-
$defaults['wp-shortPixel'] = 'ShortPixel Compression';
|
3322 |
if(current_user_can( 'manage_options' )) {
|
3323 |
$defaults['wp-shortPixel'] .=
|
3324 |
' <a href="options-general.php?page=wp-shortpixel#stats" title="'
|
274 |
'action'=>'Deactivate',
|
275 |
'data'=>'simple-image-sizes/simple_image_sizes.php'
|
276 |
),
|
277 |
+
//DEACTIVATED TEMPORARILY - it seems that the customers get scared.
|
278 |
+
/* 'Jetpack by WordPress.com - The Speed up image load times Option'
|
279 |
=> array(
|
280 |
'action'=>'Change Setting',
|
281 |
'data'=>'jetpack/jetpack.php',
|
282 |
'href'=>'admin.php?page=jetpack#/settings'
|
283 |
)
|
284 |
+
*/
|
285 |
);
|
286 |
if($this->_settings->processThumbnails) {
|
287 |
$conflictPlugins = array_merge($conflictPlugins, array(
|
347 |
}
|
348 |
}
|
349 |
if( !isset($dismissed['unlisted']) && !$this->_settings->optimizeUnlisted
|
350 |
+
&& isset($this->_settings->currentStats['foundUnlistedThumbs']) && is_array($this->_settings->currentStats['foundUnlistedThumbs'])) {
|
351 |
ShortPixelView::displayActivationNotice('unlisted', $this->_settings->currentStats['foundUnlistedThumbs']);
|
352 |
return;
|
353 |
}
|
452 |
//require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
453 |
if(function_exists('get_current_screen')) {
|
454 |
$screen = get_current_screen();
|
455 |
+
if(is_object($screen)) {
|
456 |
+
if( in_array($screen->id, array('attachment', 'upload'))) {
|
457 |
+
//output the comparer html
|
458 |
+
$this->view->outputComparerHTML();
|
459 |
+
//render a template of the list cell to be used by the JS
|
460 |
+
$this->view->renderListCell("__SP_ID__", 'imgOptimized', true, "__SP_THUMBS_TOTAL__", true, true,
|
461 |
+
array("__SP_FIRST_TYPE__", "__SP_SECOND_TYPE__"), "__SP_CELL_MESSAGE__", 'sp-column-actions-template');
|
462 |
+
}
|
463 |
+
|
464 |
+
if( in_array($screen->id, array('attachment', 'upload', 'settings_page_wp-shortpixel', 'media_page_wp-short-pixel-bulk', 'media_page_wp-short-pixel-custom'))) {
|
465 |
+
wp_enqueue_style('short-pixel.min.css', plugins_url('/res/css/short-pixel.min.css',SHORTPIXEL_PLUGIN_FILE), array(), SHORTPIXEL_IMAGE_OPTIMISER_VERSION);
|
466 |
+
}
|
467 |
}
|
468 |
}
|
469 |
?>
|
478 |
}
|
479 |
setTimeout(delayedInit, 10000);
|
480 |
</script> <?php
|
481 |
+
|
482 |
+
wp_register_script('shortpixel' . $this->jsSuffix, plugins_url('/res/js/shortpixel' . $this->jsSuffix,SHORTPIXEL_PLUGIN_FILE), array(), SHORTPIXEL_IMAGE_OPTIMISER_VERSION);
|
|
|
483 |
|
484 |
// Using an Array within another Array to protect the primitive values from being cast to strings
|
485 |
$ShortPixelConstants = array(array(
|
529 |
'pleaseDoNotSetLesser1024' => __( "Please do not set a {0} less than 1024, to be able to still regenerate all your thumbnails in case you'll ever need this.", 'shortpixel-image-optimiser' ),
|
530 |
'confirmBulkRestore' => __( "Are you sure you want to restore from backup all the images in your Media Library optimized with ShortPixel?", 'shortpixel-image-optimiser' ),
|
531 |
'confirmBulkCleanup' => __( "Are you sure you want to cleanup the ShortPixel metadata info for the images in your Media Library optimized with ShortPixel? This will make ShortPixel 'forget' that it optimized them and will optimize them again if you re-run the Bulk Optimization process.", 'shortpixel-image-optimiser' ),
|
532 |
+
'confirmBulkCleanupPending' => __( "Are you sure you want to cleanup the pending metadata?", 'shortpixel-image-optimiser' ),
|
533 |
+
'alertDeliverWebPAltered' => __( "Warning: Using this method alters the structure of the HTML code (IMG tags get included in PICTURE tags),\nwhich can lead to CSS/JS inconsistencies with the existing code.\n\nPlease test this functionality thoroughly before using it!", 'shortpixel-image-optimiser' ),
|
534 |
+
'alertDeliverWebPUnaltered' => __('This option will serve both WebP and the original image using the same URL, based on the web browser capabilities, please make sure you\'re serving the images from your server and not using a CDN which caches the images.', 'shortpixel-image-optimiser' ),
|
535 |
+
);
|
536 |
+
wp_localize_script( 'shortpixel' . $this->jsSuffix, '_spTr', $jsTranslation );
|
537 |
+
wp_localize_script( 'shortpixel' . $this->jsSuffix, 'ShortPixelConstants', $ShortPixelConstants );
|
538 |
+
wp_enqueue_script('shortpixel' . $this->jsSuffix);
|
539 |
|
540 |
wp_enqueue_script('jquery.knob.min.js', plugins_url('/res/js/jquery.knob.min.js',SHORTPIXEL_PLUGIN_FILE) );
|
541 |
wp_enqueue_script('jquery.tooltip.min.js', plugins_url('/res/js/jquery.tooltip.min.js',SHORTPIXEL_PLUGIN_FILE) );
|
987 |
$addIt = (strpos($meta->getMessage(), __('Image files are missing.', 'shortpixel-image-optimiser')) === false);
|
988 |
|
989 |
if(!$addIt) {
|
990 |
+
//in case the message is "Image files are missing", we first try a restore.
|
991 |
+
if (!$this->doRestore($crtStartQueryID)) {
|
992 |
+
delete_transient("shortpixel_thrown_notice"); // no need to display the error that a restore could not be performed.
|
|
|
993 |
}
|
994 |
+
$addIt = true;
|
995 |
+
$item = new ShortPixelMetaFacade($crtStartQueryID);
|
996 |
}
|
997 |
if($addIt) {
|
998 |
$itemList[] = $item;
|
2583 |
AddType image/webp .webp
|
2584 |
</IfModule>
|
2585 |
' );
|
2586 |
+
/* insert_with_markers( get_home_path() . '.htaccess', 'ShortPixelWebp', '
|
2587 |
+
RewriteEngine On
|
2588 |
+
RewriteBase /
|
2589 |
+
RewriteCond %{HTTP_USER_AGENT} Chrome [OR]
|
2590 |
+
RewriteCond %{HTTP_USER_AGENT} "Google Page Speed Insights" [OR]
|
2591 |
+
RewriteCond %{HTTP_ACCEPT} image/webp [OR]
|
2592 |
+
RewriteCond %{DOCUMENT_ROOT}/$1\.webp -f
|
2593 |
+
RewriteRule (.+)\.(?:jpe?g|png)$ $1.webp [NC,T=image/webp,E=webp,L]
|
2594 |
+
Header append Vary Accept env=REDIRECT_webp
|
2595 |
+
' ); */
|
2596 |
}
|
2597 |
}
|
2598 |
|
2775 |
switch( $_POST['deliverWebpType'] ) {
|
2776 |
case 'deliverWebpUnaltered':
|
2777 |
$this->_settings->deliverWebp = 3;
|
2778 |
+
if(!$isNginx) $this->alterHtaccess();
|
2779 |
break;
|
2780 |
case 'deliverWebpAltered':
|
2781 |
$this->alterHtaccess(true);
|
2793 |
}
|
2794 |
}
|
2795 |
} else {
|
2796 |
+
if(!$isNginx) $this->alterHtaccess(true);
|
2797 |
$this->_settings->deliverWebp = 0;
|
2798 |
}
|
2799 |
} else {
|
2800 |
+
if(!$isNginx) $this->alterHtaccess(true);
|
2801 |
$this->_settings->deliverWebp = 0;
|
2802 |
}
|
2803 |
|
2973 |
$args['body']['Settings'] = $settings;
|
2974 |
}
|
2975 |
|
2976 |
+
$time = microtime(true);
|
2977 |
$comm = array();
|
2978 |
|
2979 |
//Try first HTTPS post. add the sslverify = false if https
|
2982 |
}
|
2983 |
$response = wp_remote_post($requestURL, $args);
|
2984 |
|
2985 |
+
$comm['A: ' . (number_format(microtime(true) - $time, 2))] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
2986 |
|
2987 |
//some hosting providers won't allow https:// POST connections so we try http:// as well
|
2988 |
if(is_wp_error( $response )) {
|
2997 |
unset($args['sslverify']);
|
2998 |
}
|
2999 |
$response = wp_remote_post($requestURL, $args);
|
3000 |
+
$comm['B: ' . (number_format(microtime(true) - $time, 2))] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
3001 |
|
3002 |
if(!is_wp_error( $response )){
|
3003 |
$this->_settings->httpProto = ($this->_settings->httpProto == 'https' ? 'http' : 'https');
|
3011 |
$args['body'] = null;
|
3012 |
$requestURL .= $argsStr;
|
3013 |
$response = wp_remote_get($requestURL, $args);
|
3014 |
+
$comm['C: ' . (number_format(microtime(true) - $time, 2))] = array("sent" => "POST: " . $requestURL, "args" => $args, "received" => $response);
|
3015 |
}
|
3016 |
self::log("API STATUS COMM: " . json_encode($comm));
|
3017 |
|
3109 |
}
|
3110 |
|
3111 |
$file = get_attached_file($id);
|
3112 |
+
$data = ShortPixelMetaFacade::sanitizeMeta(wp_get_attachment_metadata($id));
|
3113 |
+
|
3114 |
+
//if($extended) {var_dump(wp_get_attachment_url($id)); echo(json_encode(ShortPixelMetaFacade::getWPMLDuplicates($id))); echo('<br>BK: ' . apply_filters('shortpixel_get_backup', get_attached_file($id))); echo(json_encode($data));}
|
|
|
|
|
3115 |
$fileExtension = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
3116 |
$invalidKey = !$this->_settings->verifiedKey;
|
3117 |
$quotaExceeded = $this->_settings->quotaExceeded;
|
3339 |
}
|
3340 |
|
3341 |
public function columns( $defaults ) {
|
3342 |
+
$defaults['wp-shortPixel'] = __('ShortPixel Compression', 'shortpixel-image-optimiser');
|
3343 |
if(current_user_can( 'manage_options' )) {
|
3344 |
$defaults['wp-shortPixel'] .=
|
3345 |
' <a href="options-general.php?page=wp-shortpixel#stats" title="'
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: compressor, image, compression, optimize, image optimizer, image optimiser
|
|
4 |
Requires at least: 3.2.0
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
-
Stable tag: 4.12.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -17,7 +17,7 @@ Speed up your website and boost your SEO by compressing old & new images and PDF
|
|
17 |
Increase your website's SEO ranking, number of visitors and ultimately your sales by optimizing any image or PDF document on your website.
|
18 |
ShortPixel is an easy to use, lightweight, install-and-forget-about-it <a href="https://shortpixel.com" target="_blank">image optimization</a> plugin that can compress all your past images and PDF documents with a single click. New images are automatically resized/rescaled and optimized on the fly, in the background.
|
19 |
|
20 |
-
**Ready for a quick DEMO? Test
|
21 |
|
22 |
Short Pixel uses minimal resources and works well with any shared, cloud, VPS or dedicated web hosting. It can optimize any image you have on your website even the images that aren't listed in Media Library like those in galleries like <a href="https://wordpress.org/plugins/nextgen-gallery/" target="_blank">NextGEN</a>, <a href="https://wordpress.org/plugins/modula-best-grid-gallery/" target="_blank">Modula</a> or added directly via FTP!
|
23 |
|
@@ -241,6 +241,17 @@ The ShortPixel Image Optimiser plugin calls the following actions and filters:
|
|
241 |
|
242 |
== Changelog ==
|
243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
= 4.12.4 =
|
245 |
|
246 |
Release date: 27th December 2018
|
@@ -388,4 +399,4 @@ Release date: 3rd July 2018
|
|
388 |
* display the x close link for the bulk warning box.
|
389 |
|
390 |
= EARLIER VERSIONS =
|
391 |
-
* please refer to the changelog.txt file inside the plugin archive.
|
4 |
Requires at least: 3.2.0
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 4.12.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
17 |
Increase your website's SEO ranking, number of visitors and ultimately your sales by optimizing any image or PDF document on your website.
|
18 |
ShortPixel is an easy to use, lightweight, install-and-forget-about-it <a href="https://shortpixel.com" target="_blank">image optimization</a> plugin that can compress all your past images and PDF documents with a single click. New images are automatically resized/rescaled and optimized on the fly, in the background.
|
19 |
|
20 |
+
**Ready for a quick DEMO? Test it <a href="http://poopy.life/create?url=/wp-admin/admin.php?page=sandbox" target="_blank">here</a>.**
|
21 |
|
22 |
Short Pixel uses minimal resources and works well with any shared, cloud, VPS or dedicated web hosting. It can optimize any image you have on your website even the images that aren't listed in Media Library like those in galleries like <a href="https://wordpress.org/plugins/nextgen-gallery/" target="_blank">NextGEN</a>, <a href="https://wordpress.org/plugins/modula-best-grid-gallery/" target="_blank">Modula</a> or added directly via FTP!
|
23 |
|
241 |
|
242 |
== Changelog ==
|
243 |
|
244 |
+
= 4.12.5 =
|
245 |
+
|
246 |
+
Release date: 10th Ianuary 2019
|
247 |
+
|
248 |
+
* change the JS name in order to circumveit cache problem on many WP installs
|
249 |
+
* sorting the Media Library entries by ShortPixel optimization: also sort based on compression level
|
250 |
+
* Fixed: case sensitive search for guid duplicates of image posts (needed for finding Polylang versions)
|
251 |
+
* Fixed: the data-lazy-src/srcset detection for WebP
|
252 |
+
* Improvements to the Deliver WebP options and especially messages with caveats
|
253 |
+
* Load the ShortPixel CSS only on admin pages that need it
|
254 |
+
|
255 |
= 4.12.4 =
|
256 |
|
257 |
Release date: 27th December 2018
|
399 |
* display the x close link for the bulk warning box.
|
400 |
|
401 |
= EARLIER VERSIONS =
|
402 |
+
* please refer to the changelog.txt file inside the plugin archive.
|
res/css/short-pixel.css
CHANGED
@@ -86,6 +86,9 @@ div.fb-like {
|
|
86 |
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
87 |
padding: 1px 12px;
|
88 |
}
|
|
|
|
|
|
|
89 |
@media(max-width: 1249px) {
|
90 |
.sp-notice {
|
91 |
margin: 5px 15px 2px;
|
@@ -434,7 +437,7 @@ div.shortpixel-modal .sptw-modal-spinner {
|
|
434 |
.wp-core-ui .bulk-play a.button{
|
435 |
height:60px;
|
436 |
margin-top: 27px;
|
437 |
-
width: 290px
|
438 |
overflow: hidden;
|
439 |
}
|
440 |
.wp-core-ui .column-wp-shortPixel .sp-column-actions {
|
@@ -462,12 +465,12 @@ th.sorted.column-wp-shortPixel a {
|
|
462 |
display: inline-block;
|
463 |
}
|
464 |
.wp-core-ui .bulk-play a.button .bulk-btn-img {
|
465 |
-
float:left
|
466 |
display:inline-block;
|
467 |
padding-top:6px;
|
468 |
}
|
469 |
.wp-core-ui .bulk-play a.button .bulk-btn-txt {
|
470 |
-
float:left
|
471 |
display:inline-block;
|
472 |
text-align: right;
|
473 |
line-height: 1.3em;
|
@@ -486,7 +489,6 @@ th.sorted.column-wp-shortPixel a {
|
|
486 |
.bulk-progress {
|
487 |
padding: 20px 32px 17px;
|
488 |
background-color: #ffffff;
|
489 |
-
/*border: 1px dotted #c4c2c2;*/
|
490 |
}
|
491 |
.bulk-progress.bulk-stats > div{
|
492 |
display:inline-block;
|
@@ -546,7 +548,6 @@ th.sorted.column-wp-shortPixel a {
|
|
546 |
.short-pixel-block-title {
|
547 |
font-size: 22px;
|
548 |
font-weight: bold;
|
549 |
-
margin-bottom: 15px;
|
550 |
text-align: center;
|
551 |
margin-bottom: 30px;
|
552 |
}
|
@@ -761,6 +762,14 @@ article.sp-tabs section.sel-tab h2 {
|
|
761 |
.deliverWebpTypes, .deliverWebpAlteringTypes {
|
762 |
margin: 16px 0 16px 16px;
|
763 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
article.sp-tabs section #createWebp:checked ~ .deliverWebpSettings,
|
765 |
article.sp-tabs section #deliverWebp:checked ~ .deliverWebpTypes,
|
766 |
article.sp-tabs section #deliverWebpAltered:checked ~ .deliverWebpAlteringTypes
|
86 |
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
87 |
padding: 1px 12px;
|
88 |
}
|
89 |
+
.sp-notice img {
|
90 |
+
vertical-align: bottom;
|
91 |
+
}
|
92 |
@media(max-width: 1249px) {
|
93 |
.sp-notice {
|
94 |
margin: 5px 15px 2px;
|
437 |
.wp-core-ui .bulk-play a.button{
|
438 |
height:60px;
|
439 |
margin-top: 27px;
|
440 |
+
/*width: 290px;*/
|
441 |
overflow: hidden;
|
442 |
}
|
443 |
.wp-core-ui .column-wp-shortPixel .sp-column-actions {
|
465 |
display: inline-block;
|
466 |
}
|
467 |
.wp-core-ui .bulk-play a.button .bulk-btn-img {
|
468 |
+
/*float:left;*/
|
469 |
display:inline-block;
|
470 |
padding-top:6px;
|
471 |
}
|
472 |
.wp-core-ui .bulk-play a.button .bulk-btn-txt {
|
473 |
+
/*float:left;*/
|
474 |
display:inline-block;
|
475 |
text-align: right;
|
476 |
line-height: 1.3em;
|
489 |
.bulk-progress {
|
490 |
padding: 20px 32px 17px;
|
491 |
background-color: #ffffff;
|
|
|
492 |
}
|
493 |
.bulk-progress.bulk-stats > div{
|
494 |
display:inline-block;
|
548 |
.short-pixel-block-title {
|
549 |
font-size: 22px;
|
550 |
font-weight: bold;
|
|
|
551 |
text-align: center;
|
552 |
margin-bottom: 30px;
|
553 |
}
|
762 |
.deliverWebpTypes, .deliverWebpAlteringTypes {
|
763 |
margin: 16px 0 16px 16px;
|
764 |
}
|
765 |
+
#png2jpg:not(:checked) ~ #png2jpgForce,
|
766 |
+
#png2jpg:not(:checked) ~ label[for=png2jpgForce] {
|
767 |
+
/*pointer-events: none;
|
768 |
+
opacity: .5;*/
|
769 |
+
display: none;
|
770 |
+
}
|
771 |
+
|
772 |
+
|
773 |
article.sp-tabs section #createWebp:checked ~ .deliverWebpSettings,
|
774 |
article.sp-tabs section #deliverWebp:checked ~ .deliverWebpTypes,
|
775 |
article.sp-tabs section #deliverWebpAltered:checked ~ .deliverWebpAlteringTypes
|
res/css/short-pixel.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.reset{font-weight:normal;font-style:normal}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.resumeLabel{float:right;line-height:30px;margin-right:20px;font-size:16px}.sp-dropbtn.button{padding:1px 24px 20px 5px;font-size:20px;cursor:pointer}.sp-dropdown{position:relative;display:inline-block}.sp-dropdown-content{display:none;right:0;position:absolute;background-color:#f9f9f9;min-width:190px;box-shadow:0 8px 16px 0 rgba(0,0,0,0.2);z-index:1}.sp-dropdown-content a{color:black;padding:12px 16px;text-decoration:none;display:block}.sp-dropdown-content a:hover{background-color:#f1f1f1}.sp-dropdown.sp-show .sp-dropdown-content{display:block}div.fb-like{transform:scale(1.3);-ms-transform:scale(1.3);-webkit-transform:scale(1.3);-o-transform:scale(1.3);-moz-transform:scale(1.3);transform-origin:bottom left;-ms-transform-origin:bottom left;-webkit-transform-origin:bottom left;-moz-transform-origin:bottom left;-webkit-transform-origin:bottom left}.wp-core-ui .button.button-alert,.wp-core-ui .button.button-alert:hover{background:#f79797}.wp-core-ui .button.remove-folder-button{min-width:120px}.sp-notice{background:#fff;border-left:4px solid #fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}.sp-notice-warning{border-left-color:#f1e02a}.sp-conflict-plugins{display:table;border-spacing:10px;border-collapse:separate}.sp-conflict-plugins li{display:table-row}.sp-conflict-plugins li>*{display:table-cell}li.sp-conflict-plugins-list{line-height:28px;list-style:disc;margin-left:80px}li.sp-conflict-plugins-list a.button{margin-left:10px}div.short-pixel-bulk-page input.dial{font-size:16px !important}div.short-pixel-bulk-page h1{margin-bottom:20px}div.bulk-progress div.sp-h2{margin-top:0;margin-bottom:10px;font-size:23px;font-weight:400;padding:9px 15px 4px 0;line-height:29px}div.bulk-progress-partners{margin-top:20px}div.bulk-progress.bulk-progress-partners a div{display:inline-block;vertical-align:top;line-height:50px;margin-left:30px;font-size:1.2em}div.bulk-progress .bulk-progress-indicator,div.sp-quota-exceeded-alert .bulk-progress-indicator{display:inline-block;text-align:center;padding:0 10px;margin-left:10px;float:left;height:90px;overflow:hidden;border:1px solid #1caecb}div.wrap.short-pixel-bulk-page .bulk-notice-container{margin-top:15px;position:absolute;width:500px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg{text-align:center;margin:10px 0 0 32px;overflow:hidden;border:1px solid #1caecb;background-color:#9ddbe0;border-radius:5px;padding:7px 10px 10px;display:none;max-width:600px;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error{border:1px solid #b5914d;background-color:#ffe996;margin-right:20px;position:relative;z-index:10}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error.bulk-error-fatal{border:1px solid #c32525;background-color:#ff969d}div.wrap.short-pixel-bulk-page .bulk-notice-msg img{float:left;margin-top:3px;margin-right:5px}div.sp-bulk-summary{float:right;margin:8px 5px 3px 20px}.sp-notice .bulk-error-show{cursor:pointer}.sp-notice div.bulk-error-list{background-color:#f1f1f1;padding:0 10px;display:none;max-height:200px;overflow-y:scroll}.sp-notice div.bulk-error-list ul{padding:3px 0 0;margin-top:5px}.sp-notice div.bulk-error-list ul>li:not(:last-child){border-bottom:1px solid white;padding-bottom:4px}input.dial{box-shadow:none}.shortpixel-table .column-filename{max-width:32em;width:40%}.shortpixel-table .column-folder{max-width:20em;width:20%}.shortpixel-table .column-media_type{max-width:8em;width:10%}.shortpixel-table .column-status{max-width:16em;width:15%}.shortpixel-table .column-options{max-width:16em;width:15%}.form-table th{width:220px}.form-table td{position:relative}.form-table table.shortpixel-folders-list tr{background-color:#eee}.form-table table.shortpixel-folders-list td{padding:5px 10px}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:bold}div.shortpixel-rate-us>a{vertical-align:middle;padding:1px 5px 0;text-align:center;display:inline-block}div.shortpixel-rate-us>a>span{display:inline-block;vertical-align:top;margin-top:5px}div.shortpixel-rate-us>a>img{padding-top:7px}div.shortpixel-rate-us>a:active,div.shortpixel-rate-us>a:hover,div.shortpixel-rate-us>a:focus{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}li.shortpixel-toolbar-processing>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div{height:33px;margin-top:-1px;padding:0 3px}li.shortpixel-toolbar-processing>a.ab-item>div>img,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>img{margin-right:2px;margin-top:6px}li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert{display:none}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert{display:inline;font-size:26px;color:red;font-weight:bold;vertical-align:top}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div{background-image:none}.sp-quota-exceeded-alert{background-color:#fff;border-left:4px solid red;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:1px 12px}.shortpixel-clearfix{width:100%;float:left}div.sp-modal-shade{display:none;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}div.shortpixel-modal{background-color:#fefefe;margin:8% auto;padding:20px;border:1px solid #888;width:30%;min-width:300px}div.shortpixel-modal .sp-close-button,div.shortpixel-modal .sp-close-upgrade-button{float:right;margin-top:0;background:transparent;border:0;font-size:22px;line-height:10px;cursor:pointer}.twentytwenty-horizontal .twentytwenty-before-label:before,.twentytwenty-horizontal .twentytwenty-after-label:before{font-family:inherit;font-size:16px}div.sp-modal-title{font-size:22px}div.sp-modal-body{margin-top:20px}.short-pixel-bulk-page p{margin:.6em 0}div.shortpixel-modal .sptw-modal-spinner{background-image:url("../img/spinner2.gif");background-repeat:no-repeat;background-position:center}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:white;padding:10px 10px 0;position:relative}.bulk-stats-container{display:inline-block;min-width:450px;width:45%;float:left;padding-right:50px;font-size:1.1em;line-height:1.5em}.bulk-text-container{display:inline-block;min-width:440px;width:45%;float:left;padding-right:50px}.bulk-text-container h3{border-bottom:1px solid #a8a8a8;margin-bottom:.5em;padding-bottom:.5em}.bulk-wide{display:inline-block;width:90%;float:left;margin-top:25px}.bulk-stats-container .bulk-label{width:220px;display:inline-block}.bulk-stats-container .bulk-val{width:50px;display:inline-block;text-align:right}.bulk-stats-container .bulk-total{font-weight:bold;margin-top:10px;margin-bottom:10px}.wp-core-ui .bulk-play{display:inline;width:310px;float:left;margin-bottom:20px}.wp-core-ui .bulk-play.bulk-nothing-optimize{font-weight:bold;color:#0080b2;border:1px solid;border-radius:5px;margin-top:60px;padding:5px 12px}.wp-core-ui .bulk-play a.button{height:60px;margin-top:27px;width:290px;overflow:hidden}.wp-core-ui .column-wp-shortPixel .sp-column-actions{max-width:140px;float:right;text-align:right}.wp-core-ui .column-wp-shortPixel .sp-column-actions .button.button-smaller{margin-right:0}.wp-core-ui .column-wp-shortPixel .button.button-smaller{font-size:13px;padding:0 5px;margin-bottom:4px;height:20px;line-height:16px;float:right}th.sortable.column-wp-shortPixel a,th.sorted.column-wp-shortPixel a{display:inline-block}.column-wp-shortPixel .sorting-indicator{display:inline-block}.wp-core-ui .bulk-play a.button .bulk-btn-img{float:left;display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{float:left;display:inline-block;text-align:right;line-height:1.3em;margin:11px 10px}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.label{font-size:1.6em}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.total{font-size:1.4em}.short-pixel-notice-icon{float:left;margin:10px 10px 10px 0}.bulk-progress{padding:20px 32px 17px;background-color:#fff}.bulk-progress.bulk-stats>div{display:inline-block}.bulk-progress.bulk-stats>div.label{width:320px}.bulk-progress.bulk-stats>div.stat-value{width:80px;text-align:right}.short-pixel-bulk-page .progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px;overflow:visible}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:bold}.progress .progress-img span{vertical-align:top;margin-left:-7px}.progress .progress-left{background-color:#1cbecb;bottom:0;left:0;position:absolute;top:0;z-index:1;font-size:22px;font-weight:bold;line-height:28px;text-align:center;color:#fff}.bulk-estimate{font-size:20px;line-height:30px;vertical-align:top;display:inline-block}.wp-core-ui .button-primary.bulk-cancel{float:right;height:30px}.short-pixel-block-title{font-size:22px;font-weight:bold;margin-bottom:15px;text-align:center;margin-bottom:30px}.sp-floating-block.bulk-slider-container{display:none}.sp-floating-block.sp-notice.bulk-notices-parent{padding:0;margin:0;float:right;margin-right:500px !important}.bulk-slider-container{margin-top:20px;min-height:300px;overflow:hidden}.bulk-slider-container h2{margin-bottom:15px}.bulk-slider-container span.filename{font-weight:normal}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:bold}.bulk-slider .img-original,.bulk-slider .img-optimized{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-original div,.bulk-slider .img-optimized div{max-height:450px;overflow:hidden}.bulk-slider .img-original img,.bulk-slider .img-optimized img{max-width:300px}.bulk-slider .img-info{display:inline-block;vertical-align:top;font-size:48px;max-width:150px;padding:10px 0 0 20px}.bulk-slide-images{display:inline-block;border:1px solid #1caecb;padding:15px 0 0 20px}p.settings-info{padding-top:0;color:#818181;font-size:13px !important}p.settings-info.shortpixel-settings-error{color:#c32525}.shortpixel-key-valid{font-weight:bold}.shortpixel-key-valid .dashicons-yes:before{font-size:2em;line-height:25px;color:#3485ba;margin-left:-20px}.shortpixel-compression .shortpixel-compression-options{color:#999}.shortpixel-compression strong{line-height:22px}.shortpixel-compression .shortpixel-compression-options{display:inline-block}.shortpixel-compression label{width:158px;margin:0 -2px;background-color:#e2faff;font-weight:bold;display:inline-block}.shortpixel-compression label span{text-align:center;font-size:18px;padding:8px 0;display:block}.shortpixel-compression label input{display:none}.shortpixel-compression input:checked+span{background-color:#0085ba;color:#f7f7f7}.shortpixel-compression .shortpixel-radio-info{min-height:60px}article.sp-tabs{position:relative;display:block;width:100%;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;width:100%;max-width:100%;box-sizing:border-box;padding:10px 20px;z-index:0}article.sp-tabs section.sel-tab{box-shadow:0 3px 3px rgba(0,0,0,0.1)}article.sp-tabs section .wp-shortpixel-tab-content{visibility:hidden}article.sp-tabs section.sel-tab .wp-shortpixel-tab-content{visibility:visible}article.sp-tabs section:first-child{z-index:1}article.sp-tabs section h2{position:absolute;font-size:1.3em;font-weight:normal;width:180px;height:1.8em;top:-1.8em;left:10px;padding:0;margin:0;color:#999;background-color:#ddd}article.sp-tabs section:nth-child(2) h2{left:192px}article.sp-tabs section:nth-child(3) h2{left:374px}article.sp-tabs section:nth-child(4) h2{left:556px}article.sp-tabs section:nth-child(5) h2{left:738px}article.sp-tabs section h2 a{display:block;width:100%;line-height:1.8em;text-align:center;text-decoration:none;color:#23282d;outline:0 none}article.sp-tabs section h2 a:focus,article.sp-tabs section#tab-resources a:focus{box-shadow:none;outline:0}article.sp-tabs section.sel-tab,article.sp-tabs section.sel-tab h2{color:#333;background-color:#fff;z-index:2}#tab-stats .sp-bulk-summary{position:absolute;right:0;top:0;z-index:100}.deliverWebpSettings,.deliverWebpTypes,.deliverWebpAlteringTypes{display:none}.deliverWebpTypes .sp-notice{color:red}.deliverWebpSettings{margin:16px 0}.deliverWebpSettings input:disabled+label{color:#818181}.deliverWebpTypes,.deliverWebpAlteringTypes{margin:16px 0 16px 16px}article.sp-tabs section #createWebp:checked ~ .deliverWebpSettings,article.sp-tabs section #deliverWebp:checked ~ .deliverWebpTypes,article.sp-tabs section #deliverWebpAltered:checked ~ .deliverWebpAlteringTypes{display:block}.shortpixel-help-link span.dashicons{text-decoration:none;margin-top:-1px}@media(min-width:1000px){section#tab-resources .col-md-6{display:inline-block;width:45%}}@media(max-width:999px){section#tab-resources .col-sm-12{display:inline-block;width:100%}}section#tab-resources .text-center{text-align:center}section#tab-resources p{font-size:16px}.wrap.short-pixel-bulk-page{margin-right:0}.sp-container{overflow:hidden;display:block;width:100%}.sp-floating-block{overflow:hidden;display:inline-block;float:left;margin-right:1.1% !important}.sp-full-width{width:98.8%;box-sizing:border-box}.sp-double-width{width:65.52%;box-sizing:border-box}.sp-single-width{width:32.23%;box-sizing:border-box}@media(max-width:1759px){.sp-floating-block{margin-right:1.3% !important}.sp-double-width,.sp-full-width{width:98.65%}.sp-single-width{width:48.7%}}@media(max-width:1249px){.sp-floating-block{margin-right:2% !important}.sp-double-width,.sp-full-width,.sp-single-width{width:97%}}.sp-tabs h2:before{content:none}.sp-column-actions-template+.sp-column-info{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-container{width:100%;height:24px;text-align:center;position:absolute;top:0;left:-1px}#wpadminbar .shortpixel-toolbar-processing.shortpixel-quota-exceeded .cssload-container,#wpadminbar .shortpixel-toolbar-processing.shortpixel-alert .cssload-container{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-speeding-wheel{width:24px;height:24px;opacity:.7;margin:0 auto;border:4px solid #1cbfcb;border-radius:50%;border-left-color:transparent;animation:cssload-spin 2000ms infinite linear;-o-animation:cssload-spin 2000ms infinite linear;-ms-animation:cssload-spin 2000ms infinite linear;-webkit-animation:cssload-spin 2000ms infinite linear;-moz-animation:cssload-spin 2000ms infinite linear}@keyframes cssload-spin{100%{transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes cssload-spin{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}
|
1 |
+
.reset{font-weight:normal;font-style:normal}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.resumeLabel{float:right;line-height:30px;margin-right:20px;font-size:16px}.sp-dropbtn.button{padding:1px 24px 20px 5px;font-size:20px;cursor:pointer}.sp-dropdown{position:relative;display:inline-block}.sp-dropdown-content{display:none;right:0;position:absolute;background-color:#f9f9f9;min-width:190px;box-shadow:0 8px 16px 0 rgba(0,0,0,0.2);z-index:1}.sp-dropdown-content a{color:black;padding:12px 16px;text-decoration:none;display:block}.sp-dropdown-content a:hover{background-color:#f1f1f1}.sp-dropdown.sp-show .sp-dropdown-content{display:block}div.fb-like{transform:scale(1.3);-ms-transform:scale(1.3);-webkit-transform:scale(1.3);-o-transform:scale(1.3);-moz-transform:scale(1.3);transform-origin:bottom left;-ms-transform-origin:bottom left;-webkit-transform-origin:bottom left;-moz-transform-origin:bottom left;-webkit-transform-origin:bottom left}.wp-core-ui .button.button-alert,.wp-core-ui .button.button-alert:hover{background:#f79797}.wp-core-ui .button.remove-folder-button{min-width:120px}.sp-notice{background:#fff;border-left:4px solid #fff;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}.sp-notice img{vertical-align:bottom}@media(max-width:1249px){.sp-notice{margin:5px 15px 2px}}.sp-notice-info{border-left-color:#00a0d2}.sp-notice-success{border-left-color:#46b450}.sp-notice-warning{border-left-color:#f1e02a}.sp-conflict-plugins{display:table;border-spacing:10px;border-collapse:separate}.sp-conflict-plugins li{display:table-row}.sp-conflict-plugins li>*{display:table-cell}li.sp-conflict-plugins-list{line-height:28px;list-style:disc;margin-left:80px}li.sp-conflict-plugins-list a.button{margin-left:10px}div.short-pixel-bulk-page input.dial{font-size:16px !important}div.short-pixel-bulk-page h1{margin-bottom:20px}div.bulk-progress div.sp-h2{margin-top:0;margin-bottom:10px;font-size:23px;font-weight:400;padding:9px 15px 4px 0;line-height:29px}div.bulk-progress-partners{margin-top:20px}div.bulk-progress.bulk-progress-partners a div{display:inline-block;vertical-align:top;line-height:50px;margin-left:30px;font-size:1.2em}div.bulk-progress .bulk-progress-indicator,div.sp-quota-exceeded-alert .bulk-progress-indicator{display:inline-block;text-align:center;padding:0 10px;margin-left:10px;float:left;height:90px;overflow:hidden;border:1px solid #1caecb}div.wrap.short-pixel-bulk-page .bulk-notice-container{margin-top:15px;position:absolute;width:500px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg{text-align:center;margin:10px 0 0 32px;overflow:hidden;border:1px solid #1caecb;background-color:#9ddbe0;border-radius:5px;padding:7px 10px 10px;display:none;max-width:600px;margin-right:20px}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error{border:1px solid #b5914d;background-color:#ffe996;margin-right:20px;position:relative;z-index:10}div.wrap.short-pixel-bulk-page .bulk-notice-container .bulk-notice-msg.bulk-error.bulk-error-fatal{border:1px solid #c32525;background-color:#ff969d}div.wrap.short-pixel-bulk-page .bulk-notice-msg img{float:left;margin-top:3px;margin-right:5px}div.sp-bulk-summary{float:right;margin:8px 5px 3px 20px}.sp-notice .bulk-error-show{cursor:pointer}.sp-notice div.bulk-error-list{background-color:#f1f1f1;padding:0 10px;display:none;max-height:200px;overflow-y:scroll}.sp-notice div.bulk-error-list ul{padding:3px 0 0;margin-top:5px}.sp-notice div.bulk-error-list ul>li:not(:last-child){border-bottom:1px solid white;padding-bottom:4px}input.dial{box-shadow:none}.shortpixel-table .column-filename{max-width:32em;width:40%}.shortpixel-table .column-folder{max-width:20em;width:20%}.shortpixel-table .column-media_type{max-width:8em;width:10%}.shortpixel-table .column-status{max-width:16em;width:15%}.shortpixel-table .column-options{max-width:16em;width:15%}.form-table th{width:220px}.form-table td{position:relative}.form-table table.shortpixel-folders-list tr{background-color:#eee}.form-table table.shortpixel-folders-list td{padding:5px 10px}div.shortpixel-rate-us{display:inline-block;margin-left:10px;vertical-align:top;font-weight:bold}div.shortpixel-rate-us>a{vertical-align:middle;padding:1px 5px 0;text-align:center;display:inline-block}div.shortpixel-rate-us>a>span{display:inline-block;vertical-align:top;margin-top:5px}div.shortpixel-rate-us>a>img{padding-top:7px}div.shortpixel-rate-us>a:active,div.shortpixel-rate-us>a:hover,div.shortpixel-rate-us>a:focus{outline:0;border-style:none}.sp-loading-small{margin-top:2px;float:left;margin-right:5px}li.shortpixel-toolbar-processing>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div{height:33px;margin-top:-1px;padding:0 3px}li.shortpixel-toolbar-processing>a.ab-item>div>img,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>img{margin-right:2px;margin-top:6px}li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing>a.ab-item>div>span.shp-alert{display:none}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div>span.shp-alert{display:inline;font-size:26px;color:red;font-weight:bold;vertical-align:top}li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div,#wpadminbar li.shortpixel-toolbar-processing.shortpixel-alert>a.ab-item>div{background-image:none}.sp-quota-exceeded-alert{background-color:#fff;border-left:4px solid red;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:1px 12px}.shortpixel-clearfix{width:100%;float:left}div.sp-modal-shade{display:none;position:fixed;z-index:10;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}div.shortpixel-modal{background-color:#fefefe;margin:8% auto;padding:20px;border:1px solid #888;width:30%;min-width:300px}div.shortpixel-modal .sp-close-button,div.shortpixel-modal .sp-close-upgrade-button{float:right;margin-top:0;background:transparent;border:0;font-size:22px;line-height:10px;cursor:pointer}.twentytwenty-horizontal .twentytwenty-before-label:before,.twentytwenty-horizontal .twentytwenty-after-label:before{font-family:inherit;font-size:16px}div.sp-modal-title{font-size:22px}div.sp-modal-body{margin-top:20px}.short-pixel-bulk-page p{margin:.6em 0}div.shortpixel-modal .sptw-modal-spinner{background-image:url("../img/spinner2.gif");background-repeat:no-repeat;background-position:center}.short-pixel-bulk-page form.start{display:table;content:" ";width:98%;background-color:white;padding:10px 10px 0;position:relative}.bulk-stats-container{display:inline-block;min-width:450px;width:45%;float:left;padding-right:50px;font-size:1.1em;line-height:1.5em}.bulk-text-container{display:inline-block;min-width:440px;width:45%;float:left;padding-right:50px}.bulk-text-container h3{border-bottom:1px solid #a8a8a8;margin-bottom:.5em;padding-bottom:.5em}.bulk-wide{display:inline-block;width:90%;float:left;margin-top:25px}.bulk-stats-container .bulk-label{width:220px;display:inline-block}.bulk-stats-container .bulk-val{width:50px;display:inline-block;text-align:right}.bulk-stats-container .bulk-total{font-weight:bold;margin-top:10px;margin-bottom:10px}.wp-core-ui .bulk-play{display:inline;width:310px;float:left;margin-bottom:20px}.wp-core-ui .bulk-play.bulk-nothing-optimize{font-weight:bold;color:#0080b2;border:1px solid;border-radius:5px;margin-top:60px;padding:5px 12px}.wp-core-ui .bulk-play a.button{height:60px;margin-top:27px;overflow:hidden}.wp-core-ui .column-wp-shortPixel .sp-column-actions{max-width:140px;float:right;text-align:right}.wp-core-ui .column-wp-shortPixel .sp-column-actions .button.button-smaller{margin-right:0}.wp-core-ui .column-wp-shortPixel .button.button-smaller{font-size:13px;padding:0 5px;margin-bottom:4px;height:20px;line-height:16px;float:right}th.sortable.column-wp-shortPixel a,th.sorted.column-wp-shortPixel a{display:inline-block}.column-wp-shortPixel .sorting-indicator{display:inline-block}.wp-core-ui .bulk-play a.button .bulk-btn-img{display:inline-block;padding-top:6px}.wp-core-ui .bulk-play a.button .bulk-btn-txt{display:inline-block;text-align:right;line-height:1.3em;margin:11px 10px}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.label{font-size:1.6em}.wp-core-ui .bulk-play a.button .bulk-btn-txt span.total{font-size:1.4em}.short-pixel-notice-icon{float:left;margin:10px 10px 10px 0}.bulk-progress{padding:20px 32px 17px;background-color:#fff}.bulk-progress.bulk-stats>div{display:inline-block}.bulk-progress.bulk-stats>div.label{width:320px}.bulk-progress.bulk-stats>div.stat-value{width:80px;text-align:right}.short-pixel-bulk-page .progress{background-color:#ecedee;height:30px;position:relative;width:60%;display:inline-block;margin-right:28px;overflow:visible}.progress .progress-img{position:absolute;top:-10px;z-index:2;margin-left:-35px;line-height:48px;font-size:22px;font-weight:bold}.progress .progress-img span{vertical-align:top;margin-left:-7px}.progress .progress-left{background-color:#1cbecb;bottom:0;left:0;position:absolute;top:0;z-index:1;font-size:22px;font-weight:bold;line-height:28px;text-align:center;color:#fff}.bulk-estimate{font-size:20px;line-height:30px;vertical-align:top;display:inline-block}.wp-core-ui .button-primary.bulk-cancel{float:right;height:30px}.short-pixel-block-title{font-size:22px;font-weight:bold;text-align:center;margin-bottom:30px}.sp-floating-block.bulk-slider-container{display:none}.sp-floating-block.sp-notice.bulk-notices-parent{padding:0;margin:0;float:right;margin-right:500px !important}.bulk-slider-container{margin-top:20px;min-height:300px;overflow:hidden}.bulk-slider-container h2{margin-bottom:15px}.bulk-slider-container span.filename{font-weight:normal}.bulk-slider{display:table;margin:0 auto}.bulk-slider .bulk-slide{margin:0 auto;padding-left:120px;display:inline-block;font-weight:bold}.bulk-slider .img-original,.bulk-slider .img-optimized{display:inline-block;margin-right:20px;text-align:center}.bulk-slider .img-original div,.bulk-slider .img-optimized div{max-height:450px;overflow:hidden}.bulk-slider .img-original img,.bulk-slider .img-optimized img{max-width:300px}.bulk-slider .img-info{display:inline-block;vertical-align:top;font-size:48px;max-width:150px;padding:10px 0 0 20px}.bulk-slide-images{display:inline-block;border:1px solid #1caecb;padding:15px 0 0 20px}p.settings-info{padding-top:0;color:#818181;font-size:13px !important}p.settings-info.shortpixel-settings-error{color:#c32525}.shortpixel-key-valid{font-weight:bold}.shortpixel-key-valid .dashicons-yes:before{font-size:2em;line-height:25px;color:#3485ba;margin-left:-20px}.shortpixel-compression .shortpixel-compression-options{color:#999}.shortpixel-compression strong{line-height:22px}.shortpixel-compression .shortpixel-compression-options{display:inline-block}.shortpixel-compression label{width:158px;margin:0 -2px;background-color:#e2faff;font-weight:bold;display:inline-block}.shortpixel-compression label span{text-align:center;font-size:18px;padding:8px 0;display:block}.shortpixel-compression label input{display:none}.shortpixel-compression input:checked+span{background-color:#0085ba;color:#f7f7f7}.shortpixel-compression .shortpixel-radio-info{min-height:60px}article.sp-tabs{position:relative;display:block;width:100%;margin:2em auto}article.sp-tabs section{position:absolute;display:block;top:1.8em;left:0;width:100%;max-width:100%;box-sizing:border-box;padding:10px 20px;z-index:0}article.sp-tabs section.sel-tab{box-shadow:0 3px 3px rgba(0,0,0,0.1)}article.sp-tabs section .wp-shortpixel-tab-content{visibility:hidden}article.sp-tabs section.sel-tab .wp-shortpixel-tab-content{visibility:visible}article.sp-tabs section:first-child{z-index:1}article.sp-tabs section h2{position:absolute;font-size:1.3em;font-weight:normal;width:180px;height:1.8em;top:-1.8em;left:10px;padding:0;margin:0;color:#999;background-color:#ddd}article.sp-tabs section:nth-child(2) h2{left:192px}article.sp-tabs section:nth-child(3) h2{left:374px}article.sp-tabs section:nth-child(4) h2{left:556px}article.sp-tabs section:nth-child(5) h2{left:738px}article.sp-tabs section h2 a{display:block;width:100%;line-height:1.8em;text-align:center;text-decoration:none;color:#23282d;outline:0 none}article.sp-tabs section h2 a:focus,article.sp-tabs section#tab-resources a:focus{box-shadow:none;outline:0}article.sp-tabs section.sel-tab,article.sp-tabs section.sel-tab h2{color:#333;background-color:#fff;z-index:2}#tab-stats .sp-bulk-summary{position:absolute;right:0;top:0;z-index:100}.deliverWebpSettings,.deliverWebpTypes,.deliverWebpAlteringTypes{display:none}.deliverWebpTypes .sp-notice{color:red}.deliverWebpSettings{margin:16px 0}.deliverWebpSettings input:disabled+label{color:#818181}.deliverWebpTypes,.deliverWebpAlteringTypes{margin:16px 0 16px 16px}#png2jpg:not(:checked) ~ #png2jpgForce,#png2jpg:not(:checked) ~ label[for=png2jpgForce]{display:none}article.sp-tabs section #createWebp:checked ~ .deliverWebpSettings,article.sp-tabs section #deliverWebp:checked ~ .deliverWebpTypes,article.sp-tabs section #deliverWebpAltered:checked ~ .deliverWebpAlteringTypes{display:block}.shortpixel-help-link span.dashicons{text-decoration:none;margin-top:-1px}@media(min-width:1000px){section#tab-resources .col-md-6{display:inline-block;width:45%}}@media(max-width:999px){section#tab-resources .col-sm-12{display:inline-block;width:100%}}section#tab-resources .text-center{text-align:center}section#tab-resources p{font-size:16px}.wrap.short-pixel-bulk-page{margin-right:0}.sp-container{overflow:hidden;display:block;width:100%}.sp-floating-block{overflow:hidden;display:inline-block;float:left;margin-right:1.1% !important}.sp-full-width{width:98.8%;box-sizing:border-box}.sp-double-width{width:65.52%;box-sizing:border-box}.sp-single-width{width:32.23%;box-sizing:border-box}@media(max-width:1759px){.sp-floating-block{margin-right:1.3% !important}.sp-double-width,.sp-full-width{width:98.65%}.sp-single-width{width:48.7%}}@media(max-width:1249px){.sp-floating-block{margin-right:2% !important}.sp-double-width,.sp-full-width,.sp-single-width{width:97%}}.sp-tabs h2:before{content:none}.sp-column-actions-template+.sp-column-info{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-container{width:100%;height:24px;text-align:center;position:absolute;top:0;left:-1px}#wpadminbar .shortpixel-toolbar-processing.shortpixel-quota-exceeded .cssload-container,#wpadminbar .shortpixel-toolbar-processing.shortpixel-alert .cssload-container{display:none}#wpadminbar .shortpixel-toolbar-processing .cssload-speeding-wheel{width:24px;height:24px;opacity:.7;margin:0 auto;border:4px solid #1cbfcb;border-radius:50%;border-left-color:transparent;animation:cssload-spin 2000ms infinite linear;-o-animation:cssload-spin 2000ms infinite linear;-ms-animation:cssload-spin 2000ms infinite linear;-webkit-animation:cssload-spin 2000ms infinite linear;-moz-animation:cssload-spin 2000ms infinite linear}@keyframes cssload-spin{100%{transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes cssload-spin{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes cssload-spin{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cssload-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes cssload-spin{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}
|
res/img/.htaccess
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<IfModule mod_rewrite.c>
|
2 |
+
RewriteEngine On
|
3 |
+
RewriteCond %{HTTP_ACCEPT} image/webp
|
4 |
+
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
|
5 |
+
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
|
6 |
+
</IfModule>
|
7 |
+
|
8 |
+
<IfModule mod_headers.c>
|
9 |
+
Header append Vary Accept env=REDIRECT_accept
|
10 |
+
</IfModule>
|
11 |
+
|
12 |
+
<IfModule mod_mime.c>
|
13 |
+
AddType image/webp .webp
|
14 |
+
</IfModule>
|
15 |
+
|
res/img/test.jpg
ADDED
Binary file
|
res/img/test.webp
ADDED
Binary file
|
res/js/short-pixel.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){ShortPixel.init()});var ShortPixel=function(){function I(){if(typeof ShortPixel.API_KEY!=="undefined"){return}if(jQuery("table.wp-list-table.media").length>0){jQuery('select[name^="action"] option:last-child').before('<option value="short-pixel-bulk">'+_spTr.optimizeWithSP+'</option><option value="short-pixel-bulk-lossy"> → '+_spTr.redoLossy+'</option><option value="short-pixel-bulk-glossy"> → '+_spTr.redoGlossy+'</option><option value="short-pixel-bulk-lossless"> → '+_spTr.redoLossless+'</option><option value="short-pixel-bulk-restore"> → '+_spTr.restoreOriginal+"</option>")}ShortPixel.setOptions(ShortPixelConstants[0]);if(jQuery("#backup-folder-size").length){jQuery("#backup-folder-size").html(ShortPixel.getBackupSize())}if(ShortPixel.MEDIA_ALERT=="todo"&&jQuery("div.media-frame.mode-grid").length>0){jQuery("div.media-frame.mode-grid").before('<div id="short-pixel-media-alert" class="notice notice-warning"><p>'+_spTr.changeMLToListMode.format('<a href="upload.php?mode=list" class="view-list"><span class="screen-reader-text">'," </span>",'</a><a class="alignright" href="javascript:ShortPixel.dismissMediaAlert();">',"</a>")+"</p></div>")}jQuery(window).on("beforeunload",function(){if(ShortPixel.bulkProcessor==true){clearBulkProcessor()}});checkQuotaExceededAlert();checkBulkProgress()}function m(Q){for(var R in Q){ShortPixel[R]=Q[R]}}function t(Q){return/^\w+([\.+-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,63})+$/.test(Q)}function n(){var Q=jQuery("#pluginemail").val();if(ShortPixel.isEmailValid(Q)){jQuery("#request_key").removeClass("disabled")}jQuery("#request_key").attr("href",jQuery("#request_key").attr("href").split("?")[0]+"?pluginemail="+Q)}function a(){jQuery("#valid").val("validate");jQuery("#wp_shortpixel_options").submit()}jQuery("#key").keypress(function(Q){if(Q.which==13){jQuery("#valid").val("validate")}});function L(Q){if(jQuery(Q).is(":checked")){jQuery("#width,#height").removeAttr("disabled")}else{jQuery("#width,#height").attr("disabled","disabled")}}function e(Q,S,U){for(var R=0,T=null;R<Q.length;R++){Q[R].onclick=function(){if(this!==T){T=this}if(typeof ShortPixel.setupGeneralTabAlert!=="undefined"){return}alert(_spTr.alertOnlyAppliesToNewImages);ShortPixel.setupGeneralTabAlert=1}}ShortPixel.enableResize("#resize");jQuery("#resize").change(function(){L(this)});jQuery(".resize-sizes").blur(function(W){var X=jQuery(this);if(ShortPixel.resizeSizesAlert==X.val()){return}ShortPixel.resizeSizesAlert=X.val();var V=jQuery("#min-"+X.attr("name")).val();if(X.val()<Math.min(V,1024)){if(V>1024){alert(_spTr.pleaseDoNotSetLesser1024.format(X.attr("name")))}else{alert(_spTr.pleaseDoNotSetLesserSize.format(X.attr("name"),X.attr("name"),V))}W.preventDefault();X.focus()}else{this.defaultValue=X.val()}});jQuery(".shortpixel-confirm").click(function(W){var V=confirm(W.target.getAttribute("data-confirm"));if(!V){W.preventDefault();return false}return true})}function C(){jQuery(".wp-shortpixel-options .shortpixel-key-valid").css("display","none");jQuery(".wp-shortpixel-options button#validate").css("display","inline-block")}function u(){jQuery("input.remove-folder-button").click(function(){var R=jQuery(this).data("value");var Q=confirm(_spTr.areYouSureStopOptimizing.format(R));if(Q==true){jQuery("#removeFolder").val(R);jQuery("#wp_shortpixel_options").submit()}});jQuery("input.recheck-folder-button").click(function(){var R=jQuery(this).data("value");var Q=confirm(_spTr.areYouSureStopOptimizing.format(R));if(Q==true){jQuery("#recheckFolder").val(R);jQuery("#wp_shortpixel_options").submit()}})}function K(Q){var R=jQuery("#"+(Q.checked?"total":"main")+"ToProcess").val();jQuery("div.bulk-play span.total").text(R);jQuery("#displayTotal").text(R)}function g(){ShortPixel.adjustSettingsTabs();jQuery(window).resize(function(){ShortPixel.adjustSettingsTabs()});if(window.location.hash){var Q=("tab-"+window.location.hash.substring(window.location.hash.indexOf("#")+1)).replace(/\//,"");if(jQuery("section#"+Q).length){ShortPixel.switchSettingsTab(Q)}}jQuery("article.sp-tabs a.tab-link").click(function(){var R=jQuery(this).data("id");ShortPixel.switchSettingsTab(R)});jQuery("input[type=radio][name=deliverWebpType]").change(function(){if(this.value=="deliverWebpAltered"){if(window.confirm("Warning: Using this method alters the structure of the HTML code (IMG tags get included in PICTURE tags),\nwhich can lead to CSS/JS inconsistencies with the existing code.\n\nPlease test this functionality thoroughly before using it!")){var R=jQuery("input[type=radio][name=deliverWebpAlteringType]:checked").length;if(R==0){jQuery("#deliverWebpAlteredWP").prop("checked",true)}}else{jQuery(this).prop("checked",false)}}})}function x(U){var S=U.replace("tab-",""),Q="",T=jQuery("section#"+U),R=location.href.replace(location.hash,"")+"#"+S;if(history.pushState){history.pushState(null,null,R)}else{location.hash=R}if(T.length>0){jQuery("section").removeClass("sel-tab");jQuery("section#"+U).addClass("sel-tab")}if(typeof HS.beacon.suggest!=="undefined"){switch(S){case"settings":Q=shortpixel_suggestions_settings;break;case"adv-settings":Q=shortpixel_suggestions_adv_settings;break;case"cloudflare":case"stats":Q=shortpixel_suggestions_cloudflare;break;default:break}HS.beacon.suggest(Q)}}function y(){var Q=jQuery("section#tab-settings .wp-shortpixel-options").height()+90;Q=Math.max(Q,jQuery("section#tab-adv-settings .wp-shortpixel-options").height()+20);Q=Math.max(Q,jQuery("section#tab-resources .area1").height()+60);jQuery("#shortpixel-settings-tabs").css("height",Q)}function M(){var Q={action:"shortpixel_dismiss_media_alert"};jQuery.get(ShortPixel.AJAX_URL,Q,function(R){Q=JSON.parse(R);if(Q.Status=="success"){jQuery("#short-pixel-media-alert").hide();console.log("dismissed")}})}function k(){var Q={action:"shortpixel_check_quota"};jQuery.get(ShortPixel.AJAX_URL,Q,function(){console.log("quota refreshed")})}function B(Q){if(Q.checked){jQuery("#with-thumbs").css("display","inherit");jQuery("#without-thumbs").css("display","none")}else{jQuery("#without-thumbs").css("display","inherit");jQuery("#with-thumbs").css("display","none")}}function b(U,S,R,T,Q){return(S>0?"<div class='sp-column-info'>"+_spTr.reducedBy+" <strong><span class='percent'>"+S+"%</span></strong> ":"")+(S>0&&S<5?"<br>":"")+(S<5?_spTr.bonusProcessing:"")+(R.length>0?" ("+R+")":"")+(0+T>0?"<br>"+_spTr.plusXthumbsOpt.format(T):"")+(0+Q>0?"<br>"+_spTr.plusXretinasOpt.format(Q):"")+"</div>"}function p(R,Q){jQuery(R).knob({readOnly:true,width:Q,height:Q,fgColor:"#1CAECB",format:function(S){return S+"%"}})}function c(X,S,V,U,R,W){if(R==1){var T=jQuery(".sp-column-actions-template").clone();if(!T.length){return false}var Q;if(S.length==0){Q=["lossy","lossless"]}else{Q=["lossy","glossy","lossless"].filter(function(Y){return !(Y==S)})}T.html(T.html().replace(/__SP_ID__/g,X));if(W.substr(W.lastIndexOf(".")+1).toLowerCase()=="pdf"){jQuery(".sp-action-compare",T).remove()}if(V==0&&U>0){T.html(T.html().replace("__SP_THUMBS_TOTAL__",U))}else{jQuery(".sp-action-optimize-thumbs",T).remove();jQuery(".sp-dropbtn",T).removeClass("button-primary")}T.html(T.html().replace(/__SP_FIRST_TYPE__/g,Q[0]));T.html(T.html().replace(/__SP_SECOND_TYPE__/g,Q[1]));return T.html()}return""}function i(U,T){U=U.substring(2);if(jQuery(".shortpixel-other-media").length){var S=["optimize","retry","restore","redo","quota","view"];for(var R=0,Q=S.length;R<Q;R++){jQuery("#"+S[R]+"_"+U).css("display","none")}for(var R=0,Q=T.length;R<Q;R++){jQuery("#"+T[R]+"_"+U).css("display","")}}}function j(Q){ShortPixel.retries++;if(isNaN(ShortPixel.retries)){ShortPixel.retries=1}if(ShortPixel.retries<6){console.log("Invalid response from server (Error: "+Q+"). Retrying pass "+(ShortPixel.retries+1)+"...");setTimeout(checkBulkProgress,5000)}else{ShortPixel.bulkShowError(-1,"Invalid response from server received 6 times. Please retry later by reloading this page, or <a href='https://shortpixel.com/contact' target='_blank'>contact support</a>. (Error: "+Q+")","");console.log("Invalid response from server 6 times. Giving up.")}}function l(Q){Q.action="shortpixel_browse_content";var R="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(S){R=S},async:false});return R}function d(){var Q={action:"shortpixel_get_backup_size"};var R="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(S){R=S},async:false});return R}function f(R){if(!jQuery("#tos").is(":checked")){R.preventDefault();jQuery("#tos-robo").fadeIn(400,function(){jQuery("#tos-hand").fadeIn()});jQuery("#tos").click(function(){jQuery("#tos-robo").css("display","none");jQuery("#tos-hand").css("display","none")});return}jQuery("#request_key").addClass("disabled");jQuery("#pluginemail_spinner").addClass("is-active");ShortPixel.updateSignupEmail();if(ShortPixel.isEmailValid(jQuery("#pluginemail").val())){jQuery("#pluginemail-error").css("display","none");var Q={action:"shortpixel_new_api_key",email:jQuery("#pluginemail").val()};jQuery.ajax({type:"POST",async:false,url:ShortPixel.AJAX_URL,data:Q,success:function(S){data=JSON.parse(S);if(data.Status=="success"){R.preventDefault();window.location.reload()}else{if(data.Status=="invalid"){jQuery("#pluginemail-error").html("<b>"+data.Details+"</b>");jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");R.preventDefault()}else{}}}});jQuery("#request_key").removeAttr("onclick")}else{jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");R.preventDefault()}jQuery("#request_key").removeClass("disabled");jQuery("#pluginemail_spinner").removeClass("is-active")}function N(){jQuery("#shortPixelProposeUpgrade .sp-modal-body").addClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html("");jQuery("#shortPixelProposeUpgradeShade").css("display","block");jQuery("#shortPixelProposeUpgrade").removeClass("shortpixel-hide");var Q={action:"shortpixel_propose_upgrade"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(R){jQuery("#shortPixelProposeUpgrade .sp-modal-body").removeClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html(R)}})}function G(){jQuery("#shortPixelProposeUpgradeShade").css("display","none");jQuery("#shortPixelProposeUpgrade").addClass("shortpixel-hide");if(ShortPixel.toRefresh){ShortPixel.recheckQuota()}}function v(){jQuery("#short-pixel-notice-unlisted").hide();jQuery("#optimizeUnlisted").prop("checked",true);var Q={action:"shortpixel_dismiss_notice",notice_id:"unlisted",notice_data:"true"};jQuery.get(ShortPixel.AJAX_URL,Q,function(R){Q=JSON.parse(R);if(Q.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function o(){jQuery(".select-folder-button").click(function(){jQuery(".sp-folder-picker-shade").css("display","block");jQuery(".sp-folder-picker").fileTree({script:ShortPixel.browseContent,multiFolder:false})});jQuery(".shortpixel-modal input.select-folder-cancel").click(function(){jQuery(".sp-folder-picker-shade").css("display","none")});jQuery(".shortpixel-modal input.select-folder").click(function(){var Q=jQuery("UL.jqueryFileTree LI.directory.selected A").attr("rel").trim();if(Q){var R=jQuery("#customFolderBase").val()+Q;if(R.slice(-1)=="/"){R=R.slice(0,-1)}jQuery("#addCustomFolder").val(R);jQuery("#addCustomFolderView").val(R);jQuery(".sp-folder-picker-shade").css("display","none")}else{alert("Please select a folder from the list.")}})}function F(U,T,S){var R=jQuery(".bulk-notice-msg.bulk-lengthy");if(R.length==0){return}var Q=jQuery("a",R);Q.text(T);if(S){Q.attr("href",S)}else{Q.attr("href",Q.data("href").replace("__ID__",U))}R.css("display","block")}function A(){jQuery(".bulk-notice-msg.bulk-lengthy").css("display","none")}function w(Q){var R=jQuery(".bulk-notice-msg.bulk-"+Q);if(R.length==0){return}R.css("display","block")}function O(Q){jQuery(".bulk-notice-msg.bulk-"+Q).css("display","none")}function s(W,U,V,T){var Q=jQuery("#bulk-error-template");if(Q.length==0){return}var S=Q.clone();S.attr("id","bulk-error-"+W);if(W==-1){jQuery("span.sp-err-title",S).remove();S.addClass("bulk-error-fatal")}else{jQuery("img",S).remove();jQuery("#bulk-error-".id).remove()}jQuery("span.sp-err-content",S).html(U);var R=jQuery("a.sp-post-link",S);if(T){R.attr("href",T)}else{R.attr("href",R.attr("href").replace("__ID__",W))}R.text(V);Q.after(S);S.css("display","block")}function D(Q,R){if(!confirm(_spTr["confirmBulk"+Q])){R.stopPropagation();R.preventDefault();return false}return true}function r(Q){jQuery(Q).parent().parent().remove()}function H(Q){return Q.substring(0,2)=="C-"}function J(){window.location.href=window.location.href+(window.location.href.indexOf("?")>0?"&":"?")+"checkquota=1"}function h(R){R.preventDefault();if(!this.menuCloseEvent){jQuery(window).click(function(S){if(!S.target.matches(".sp-dropbtn")){jQuery(".sp-dropdown.sp-show").removeClass("sp-show")}});this.menuCloseEvent=true}var Q=R.target.parentElement.classList.contains("sp-show");jQuery(".sp-dropdown.sp-show").removeClass("sp-show");if(!Q){R.target.parentElement.classList.add("sp-show")}}function P(Q){this.comparerData.origUrl=false;if(this.comparerData.cssLoaded===false){jQuery("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:this.WP_PLUGIN_URL+"/res/css/twentytwenty.min.css"});this.comparerData.cssLoaded=2}if(this.comparerData.jsLoaded===false){jQuery.getScript(this.WP_PLUGIN_URL+"/res/js/jquery.twentytwenty.min.js",function(){ShortPixel.comparerData.jsLoaded=2;if(ShortPixel.comparerData.origUrl.length>0){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}});this.comparerData.jsLoaded=1;jQuery(".sp-close-button").click(ShortPixel.closeComparerPopup)}if(this.comparerData.origUrl===false){jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:{action:"shortpixel_get_comparer_data",id:Q},success:function(R){data=JSON.parse(R);jQuery.extend(ShortPixel.comparerData,data);if(ShortPixel.comparerData.jsLoaded==2){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}}});this.comparerData.origUrl=""}}function E(U,S,R,T){var X=U;var W=(S<150||U<350);var V=jQuery(W?"#spUploadCompareSideBySide":"#spUploadCompare");if(!W){jQuery("#spCompareSlider").html('<img class="spUploadCompareOriginal"/><img class="spUploadCompareOptimized"/>')}U=Math.max(350,Math.min(800,(U<350?(U+25)*2:(S<150?U+25:U))));S=Math.max(150,(W?(X>350?2*(S+45):S+45):S*U/X));jQuery(".sp-modal-body",V).css("width",U);jQuery(".shortpixel-slider",V).css("width",U);V.css("width",U);jQuery(".sp-modal-body",V).css("height",S);V.css("display","block");V.parent().css("display","block");if(!W){jQuery("#spCompareSlider").twentytwenty({slider_move:"mousemove"})}jQuery(document).on("keyup.sp_modal_active",ShortPixel.closeComparerPopup);var Q=jQuery(".spUploadCompareOptimized",V);jQuery(".spUploadCompareOriginal",V).attr("src",R);setTimeout(function(){jQuery(window).trigger("resize")},1000);Q.load(function(){jQuery(window).trigger("resize")});Q.attr("src",T)}function q(Q){jQuery("#spUploadCompareSideBySide").parent().css("display","none");jQuery("#spUploadCompareSideBySide").css("display","none");jQuery("#spUploadCompare").css("display","none");jQuery(document).unbind("keyup.sp_modal_active")}function z(Q){var R=document.createElement("a");R.href=Q;if(Q.indexOf(R.protocol+"//"+R.hostname)<0){return R.href}return Q.replace(R.protocol+"//"+R.hostname,R.protocol+"//"+R.hostname.split(".").map(function(S){return sp_punycode.toASCII(S)}).join("."))}return{init:I,setOptions:m,isEmailValid:t,updateSignupEmail:n,validateKey:a,enableResize:L,setupGeneralTab:e,apiKeyChanged:C,setupAdvancedTab:u,checkThumbsUpdTotal:K,initSettings:g,switchSettingsTab:x,adjustSettingsTabs:y,onBulkThumbsCheck:B,dismissMediaAlert:M,checkQuota:k,percentDial:p,successMsg:b,successActions:c,otherMediaUpdateActions:i,retry:j,initFolderSelector:o,browseContent:l,getBackupSize:d,newApiKey:f,proposeUpgrade:N,closeProposeUpgrade:G,includeUnlisted:v,bulkShowLengthyMsg:F,bulkHideLengthyMsg:A,bulkShowMaintenanceMsg:w,bulkHideMaintenanceMsg:O,bulkShowError:s,confirmBulkAction:D,removeBulkMsg:r,isCustomImageId:H,recheckQuota:J,openImageMenu:h,menuCloseEvent:false,loadComparer:P,displayComparerPopup:E,closeComparerPopup:q,convertPunycode:z,comparerData:{cssLoaded:false,jsLoaded:false,origUrl:false,optUrl:false,width:0,height:0},toRefresh:false,resizeSizesAlert:false}}();function showToolBarAlert(c,b,d){var a=jQuery("li.shortpixel-toolbar-processing");switch(c){case ShortPixel.STATUS_QUOTA_EXCEEDED:if(window.location.href.search("wp-short-pixel-bulk")>0&&jQuery(".sp-quota-exceeded-alert").length==0){location.reload();return}a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","ShortPixel quota exceeded. Click for details.");break;case ShortPixel.STATUS_SKIP:case ShortPixel.STATUS_FAIL:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);if(typeof d!=="undefined"){jQuery("a",a).attr("href","post.php?post="+d+"&action=edit")}break;case ShortPixel.STATUS_NO_KEY:a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","Get API Key");break;case ShortPixel.STATUS_SUCCESS:case ShortPixel.STATUS_RETRY:a.addClass("shortpixel-processing");a.removeClass("shortpixel-alert");jQuery("a",a).removeAttr("target");jQuery("a",a).attr("href",jQuery("a img",a).attr("success-url"))}a.removeClass("shortpixel-hide")}function hideToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-processing").addClass("shortpixel-hide")}function hideQuotaExceededToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-quota-exceeded").addClass("shortpixel-hide")}function checkQuotaExceededAlert(){if(typeof shortPixelQuotaExceeded!="undefined"){if(shortPixelQuotaExceeded==1){showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED)}else{hideQuotaExceededToolBarAlert()}}}function checkBulkProgress(){var b=function(e){if(!d){d=true;return e}return"/"};var d=false;var a=window.location.href.toLowerCase().replace(/\/\//g,b);d=false;var c=ShortPixel.WP_ADMIN_URL.toLowerCase().replace(/\/\//g,b);if(a.search(c)<0){a=ShortPixel.convertPunycode(a);c=ShortPixel.convertPunycode(c)}if(a.search(c+"upload.php")<0&&a.search(c+"edit.php")<0&&a.search(c+"edit-tags.php")<0&&a.search(c+"post-new.php")<0&&a.search(c+"post.php")<0&&a.search("page=nggallery-manage-gallery")<0&&(ShortPixel.FRONT_BOOTSTRAP==0||a.search(c)==0)){hideToolBarAlert();return}if(ShortPixel.bulkProcessor==true&&window.location.href.search("wp-short-pixel-bulk")<0&&typeof localStorage.bulkPage!=="undefined"&&localStorage.bulkPage>0){ShortPixel.bulkProcessor=false}if(window.location.href.search("wp-short-pixel-bulk")>=0){ShortPixel.bulkProcessor=true;localStorage.bulkTime=Math.floor(Date.now()/1000);localStorage.bulkPage=1}if(ShortPixel.bulkProcessor==true||typeof localStorage.bulkTime=="undefined"||Math.floor(Date.now()/1000)-localStorage.bulkTime>90){ShortPixel.bulkProcessor=true;localStorage.bulkPage=(window.location.href.search("wp-short-pixel-bulk")>=0?1:0);localStorage.bulkTime=Math.floor(Date.now()/1000);console.log(localStorage.bulkTime);checkBulkProcessingCallApi()}else{setTimeout(checkBulkProgress,5000)}}function checkBulkProcessingCallApi(){var a={action:"shortpixel_image_processing"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:a,success:function(g){if(g.length>0){var i=null;try{var i=JSON.parse(g)}catch(k){ShortPixel.retry(k.message);return}ShortPixel.retries=0;var d=i.ImageID;var j=(jQuery("div.short-pixel-bulk-page").length>0);switch(i.Status){case ShortPixel.STATUS_NO_KEY:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/wp-apikey"+ShortPixel.AFFILIATE+'" target="_blank">'+_spTr.getApiKey+"</a>");showToolBarAlert(ShortPixel.STATUS_NO_KEY);break;case ShortPixel.STATUS_QUOTA_EXCEEDED:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"+ShortPixel.API_KEY+'" target="_blank">'+_spTr.extendQuota+"</a><a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>"+_spTr.check__Quota+"</a>");showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);if(i.Stop==false){setTimeout(checkBulkProgress,5000)}ShortPixel.otherMediaUpdateActions(d,["quota","view"]);break;case ShortPixel.STATUS_FAIL:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"javascript:manualOptimization('"+d+"', false)\">"+_spTr.retry+"</a>");showToolBarAlert(ShortPixel.STATUS_FAIL,i.Message,d);if(j){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink);if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}ShortPixel.otherMediaUpdateActions(d,["retry","view"])}console.log(i.Message);setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_EMPTY_QUEUE:console.log(i.Message);clearBulkProcessor();hideToolBarAlert();var c=jQuery("#bulk-progress");if(j&&c.length&&i.BulkStatus!="2"){progressUpdate(100,"Bulk finished!");jQuery("a.bulk-cancel").attr("disabled","disabled");hideSlider();setTimeout(function(){window.location.reload()},3000)}break;case ShortPixel.STATUS_SUCCESS:if(j){ShortPixel.bulkHideLengthyMsg();ShortPixel.bulkHideMaintenanceMsg()}var l=i.PercentImprovement;showToolBarAlert(ShortPixel.STATUS_SUCCESS,"");var b=ShortPixel.isCustomImageId(d)?"":ShortPixel.successActions(d,i.Type,i.ThumbsCount,i.ThumbsTotal,i.BackupEnabled,i.Filename);setCellMessage(d,ShortPixel.successMsg(d,l,i.Type,i.ThumbsCount,i.RetinasCount),b);var h=jQuery(["restore","view","redolossy","redoglossy","redolossless"]).not(["redo"+i.Type]).get();ShortPixel.otherMediaUpdateActions(d,h);var f=new PercentageAnimator("#sp-msg-"+d+" span.percent",l);f.animate(l);if(j&&typeof i.Thumb!=="undefined"){if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}if(i.Thumb.length>0){sliderUpdate(d,i.Thumb,i.BkThumb,i.PercentImprovement,i.Filename);if(typeof i.AverageCompression!=="undefined"&&0+i.AverageCompression>0){jQuery("#sp-avg-optimization").html('<input type="text" class="dial" value="'+Math.round(i.AverageCompression)+'"/>');ShortPixel.percentDial("#sp-avg-optimization .dial",60)}}}console.log("Server response: "+g);if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_SKIP:if(i.Silent!==1){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink)}case ShortPixel.STATUS_ERROR:if(typeof i.Message!=="undefined"){showToolBarAlert(ShortPixel.STATUS_SKIP,i.Message+" Image ID: "+d);setCellMessage(d,i.Message,"")}ShortPixel.otherMediaUpdateActions(d,["retry","view"]);case ShortPixel.STATUS_RETRY:console.log("Server response: "+g);showToolBarAlert(ShortPixel.STATUS_RETRY,"");if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}if(j&&i.Count>3){ShortPixel.bulkShowLengthyMsg(d,i.Filename,i.CustomImageLink)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_MAINTENANCE:ShortPixel.bulkShowMaintenanceMsg("maintenance");setTimeout(checkBulkProgress,60000);break;case ShortPixel.STATUS_QUEUE_FULL:ShortPixel.bulkShowMaintenanceMsg("queue-full");setTimeout(checkBulkProgress,60000);break;default:ShortPixel.retry("Unknown status "+i.Status+". Retrying...");break}}},error:function(b){ShortPixel.retry(b.statusText)}})}function clearBulkProcessor(){ShortPixel.bulkProcessor=false;localStorage.bulkTime=0;if(window.location.href.search("wp-short-pixel-bulk")>=0){localStorage.bulkPage=0}}function setCellMessage(d,a,c){var b=jQuery("#sp-msg-"+d);if(b.length>0){b.html("<div class='sp-column-actions'>"+c+"</div><div class='sp-column-info'>"+a+"</div>");b.css("color","")}b=jQuery("#sp-cust-msg-"+d);if(b.length>0){b.html("<div class='sp-column-info'>"+a+"</div>")}}function manualOptimization(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be processed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-alert");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_manual_optimization",image_id:c,cleanup:a};jQuery.ajax({type:"GET",url:ShortPixel.AJAX_URL,data:b,success:function(d){var e=JSON.parse(d);if(e.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(c,typeof e.Message!=="undefined"?e.Message:_spTr.thisContentNotProcessable,"")}},error:function(d){b.action="shortpixel_check_status";jQuery.ajax({type:"GET",url:ShortPixel.AJAX_URL,data:b,success:function(e){var f=JSON.parse(e);if(f.Status!==ShortPixel.STATUS_SUCCESS){setCellMessage(c,typeof f.Message!=="undefined"?f.Message:_spTr.thisContentNotProcessable,"")}}})}})}function reoptimize(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be reprocessed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_redo",attachment_ID:c,type:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{$msg=typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable;setCellMessage(c,$msg,"");showToolBarAlert(ShortPixel.STATUS_FAIL,$msg)}})}function optimizeThumbs(b){setCellMessage(b,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>"+_spTr.imageWaitOptThumbs,"");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var a={action:"shortpixel_optimize_thumbs",attachment_ID:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(b,typeof a.Message!=="undefined"?a.Message:_spTr.thisContentNotProcessable,"")}})}function dismissShortPixelNoticeExceed(b){jQuery("#wp-admin-bar-shortpixel_processing").hide();var a={action:"shortpixel_dismiss_notice",notice_id:"exceed"};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}});b.preventDefault()}function dismissShortPixelNotice(b){jQuery("#short-pixel-notice-"+b).hide();var a={action:"shortpixel_dismiss_notice",notice_id:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function PercentageAnimator(b,a){this.animationSpeed=10;this.increment=2;this.curPercentage=0;this.targetPercentage=a;this.outputSelector=b;this.animate=function(c){this.targetPercentage=c;setTimeout(PercentageTimer.bind(null,this),this.animationSpeed)}}function PercentageTimer(a){if(a.curPercentage-a.targetPercentage<-a.increment){a.curPercentage+=a.increment}else{if(a.curPercentage-a.targetPercentage>a.increment){a.curPercentage-=a.increment}else{a.curPercentage=a.targetPercentage}}jQuery(a.outputSelector).text(a.curPercentage+"%");if(a.curPercentage!=a.targetPercentage){setTimeout(PercentageTimer.bind(null,a),a.animationSpeed)}}function progressUpdate(c,b){var a=jQuery("#bulk-progress");if(a.length){jQuery(".progress-left",a).css("width",c+"%");jQuery(".progress-img",a).css("left",c+"%");if(c>24){jQuery(".progress-img span",a).html("");jQuery(".progress-left",a).html(c+"%")}else{jQuery(".progress-img span",a).html(c+"%");jQuery(".progress-left",a).html("")}jQuery(".bulk-estimate").html(b)}}function sliderUpdate(g,c,d,e,b){var f=jQuery(".bulk-slider div.bulk-slide:first-child");if(f.length===0){return}if(f.attr("id")!="empty-slide"){f.hide()}f.css("z-index",1000);jQuery(".bulk-img-opt",f).attr("src","");if(typeof d==="undefined"){d=""}if(d.length>0){jQuery(".bulk-img-orig",f).attr("src","")}var a=f.clone();a.attr("id","slide-"+g);jQuery(".bulk-img-opt",a).attr("src",c);if(d.length>0){jQuery(".img-original",a).css("display","inline-block");jQuery(".bulk-img-orig",a).attr("src",d)}else{jQuery(".img-original",a).css("display","none")}jQuery(".bulk-opt-percent",a).html('<input type="text" class="dial" value="'+e+'"/>');jQuery(".bulk-slider").append(a);ShortPixel.percentDial("#"+a.attr("id")+" .dial",100);jQuery(".bulk-slider-container span.filename").html(" "+b);if(f.attr("id")=="empty-slide"){f.remove();jQuery(".bulk-slider-container").css("display","block")}else{f.animate({left:f.width()+f.position().left},"slow","swing",function(){f.remove();a.fadeIn("slow")})}}function hideSlider(){jQuery(".bulk-slider-container").css("display","none")}function showStats(){var a=jQuery(".bulk-stats");if(a.length>0){}}if(!(typeof String.prototype.format=="function")){String.prototype.format=function(){var b=this,a=arguments.length;while(a--){b=b.replace(new RegExp("\\{"+a+"\\}","gm"),arguments[a])}return b}};
|
|
res/js/{short-pixel.js → shortpixel.js}
RENAMED
@@ -181,7 +181,7 @@ var ShortPixel = function() {
|
|
181 |
|
182 |
jQuery('input[type=radio][name=deliverWebpType]').change(function() {
|
183 |
if (this.value == 'deliverWebpAltered') {
|
184 |
-
if(window.confirm(
|
185 |
var selectedItems = jQuery('input[type=radio][name=deliverWebpAlteringType]:checked').length;
|
186 |
if (selectedItems == 0) {
|
187 |
jQuery('#deliverWebpAlteredWP').prop('checked',true);
|
@@ -189,6 +189,8 @@ var ShortPixel = function() {
|
|
189 |
} else {
|
190 |
jQuery(this).prop('checked', false);
|
191 |
}
|
|
|
|
|
192 |
}
|
193 |
});
|
194 |
}
|
181 |
|
182 |
jQuery('input[type=radio][name=deliverWebpType]').change(function() {
|
183 |
if (this.value == 'deliverWebpAltered') {
|
184 |
+
if(window.confirm(_spTr.alertDeliverWebPAltered)){
|
185 |
var selectedItems = jQuery('input[type=radio][name=deliverWebpAlteringType]:checked').length;
|
186 |
if (selectedItems == 0) {
|
187 |
jQuery('#deliverWebpAlteredWP').prop('checked',true);
|
189 |
} else {
|
190 |
jQuery(this).prop('checked', false);
|
191 |
}
|
192 |
+
} else if(this.value == 'deliverWebpUnaltered') {
|
193 |
+
window.alert(_spTr.alertDeliverWebPUnaltered);
|
194 |
}
|
195 |
});
|
196 |
}
|
res/js/shortpixel.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(){ShortPixel.init()});var ShortPixel=function(){function I(){if(typeof ShortPixel.API_KEY!=="undefined"){return}if(jQuery("table.wp-list-table.media").length>0){jQuery('select[name^="action"] option:last-child').before('<option value="short-pixel-bulk">'+_spTr.optimizeWithSP+'</option><option value="short-pixel-bulk-lossy"> → '+_spTr.redoLossy+'</option><option value="short-pixel-bulk-glossy"> → '+_spTr.redoGlossy+'</option><option value="short-pixel-bulk-lossless"> → '+_spTr.redoLossless+'</option><option value="short-pixel-bulk-restore"> → '+_spTr.restoreOriginal+"</option>")}ShortPixel.setOptions(ShortPixelConstants[0]);if(jQuery("#backup-folder-size").length){jQuery("#backup-folder-size").html(ShortPixel.getBackupSize())}if(ShortPixel.MEDIA_ALERT=="todo"&&jQuery("div.media-frame.mode-grid").length>0){jQuery("div.media-frame.mode-grid").before('<div id="short-pixel-media-alert" class="notice notice-warning"><p>'+_spTr.changeMLToListMode.format('<a href="upload.php?mode=list" class="view-list"><span class="screen-reader-text">'," </span>",'</a><a class="alignright" href="javascript:ShortPixel.dismissMediaAlert();">',"</a>")+"</p></div>")}jQuery(window).on("beforeunload",function(){if(ShortPixel.bulkProcessor==true){clearBulkProcessor()}});checkQuotaExceededAlert();checkBulkProgress()}function m(Q){for(var R in Q){ShortPixel[R]=Q[R]}}function t(Q){return/^\w+([\.+-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,63})+$/.test(Q)}function n(){var Q=jQuery("#pluginemail").val();if(ShortPixel.isEmailValid(Q)){jQuery("#request_key").removeClass("disabled")}jQuery("#request_key").attr("href",jQuery("#request_key").attr("href").split("?")[0]+"?pluginemail="+Q)}function a(){jQuery("#valid").val("validate");jQuery("#wp_shortpixel_options").submit()}jQuery("#key").keypress(function(Q){if(Q.which==13){jQuery("#valid").val("validate")}});function L(Q){if(jQuery(Q).is(":checked")){jQuery("#width,#height").removeAttr("disabled")}else{jQuery("#width,#height").attr("disabled","disabled")}}function e(Q,S,U){for(var R=0,T=null;R<Q.length;R++){Q[R].onclick=function(){if(this!==T){T=this}if(typeof ShortPixel.setupGeneralTabAlert!=="undefined"){return}alert(_spTr.alertOnlyAppliesToNewImages);ShortPixel.setupGeneralTabAlert=1}}ShortPixel.enableResize("#resize");jQuery("#resize").change(function(){L(this)});jQuery(".resize-sizes").blur(function(W){var X=jQuery(this);if(ShortPixel.resizeSizesAlert==X.val()){return}ShortPixel.resizeSizesAlert=X.val();var V=jQuery("#min-"+X.attr("name")).val();if(X.val()<Math.min(V,1024)){if(V>1024){alert(_spTr.pleaseDoNotSetLesser1024.format(X.attr("name")))}else{alert(_spTr.pleaseDoNotSetLesserSize.format(X.attr("name"),X.attr("name"),V))}W.preventDefault();X.focus()}else{this.defaultValue=X.val()}});jQuery(".shortpixel-confirm").click(function(W){var V=confirm(W.target.getAttribute("data-confirm"));if(!V){W.preventDefault();return false}return true})}function C(){jQuery(".wp-shortpixel-options .shortpixel-key-valid").css("display","none");jQuery(".wp-shortpixel-options button#validate").css("display","inline-block")}function u(){jQuery("input.remove-folder-button").click(function(){var R=jQuery(this).data("value");var Q=confirm(_spTr.areYouSureStopOptimizing.format(R));if(Q==true){jQuery("#removeFolder").val(R);jQuery("#wp_shortpixel_options").submit()}});jQuery("input.recheck-folder-button").click(function(){var R=jQuery(this).data("value");var Q=confirm(_spTr.areYouSureStopOptimizing.format(R));if(Q==true){jQuery("#recheckFolder").val(R);jQuery("#wp_shortpixel_options").submit()}})}function K(Q){var R=jQuery("#"+(Q.checked?"total":"main")+"ToProcess").val();jQuery("div.bulk-play span.total").text(R);jQuery("#displayTotal").text(R)}function g(){ShortPixel.adjustSettingsTabs();jQuery(window).resize(function(){ShortPixel.adjustSettingsTabs()});if(window.location.hash){var Q=("tab-"+window.location.hash.substring(window.location.hash.indexOf("#")+1)).replace(/\//,"");if(jQuery("section#"+Q).length){ShortPixel.switchSettingsTab(Q)}}jQuery("article.sp-tabs a.tab-link").click(function(){var R=jQuery(this).data("id");ShortPixel.switchSettingsTab(R)});jQuery("input[type=radio][name=deliverWebpType]").change(function(){if(this.value=="deliverWebpAltered"){if(window.confirm(_spTr.alertDeliverWebPAltered)){var R=jQuery("input[type=radio][name=deliverWebpAlteringType]:checked").length;if(R==0){jQuery("#deliverWebpAlteredWP").prop("checked",true)}}else{jQuery(this).prop("checked",false)}}else{if(this.value=="deliverWebpUnaltered"){window.alert(_spTr.alertDeliverWebPUnaltered)}}})}function x(U){var S=U.replace("tab-",""),Q="",T=jQuery("section#"+U),R=location.href.replace(location.hash,"")+"#"+S;if(history.pushState){history.pushState(null,null,R)}else{location.hash=R}if(T.length>0){jQuery("section").removeClass("sel-tab");jQuery("section#"+U).addClass("sel-tab")}if(typeof HS.beacon.suggest!=="undefined"){switch(S){case"settings":Q=shortpixel_suggestions_settings;break;case"adv-settings":Q=shortpixel_suggestions_adv_settings;break;case"cloudflare":case"stats":Q=shortpixel_suggestions_cloudflare;break;default:break}HS.beacon.suggest(Q)}}function y(){var Q=jQuery("section#tab-settings .wp-shortpixel-options").height()+90;Q=Math.max(Q,jQuery("section#tab-adv-settings .wp-shortpixel-options").height()+20);Q=Math.max(Q,jQuery("section#tab-resources .area1").height()+60);jQuery("#shortpixel-settings-tabs").css("height",Q)}function M(){var Q={action:"shortpixel_dismiss_media_alert"};jQuery.get(ShortPixel.AJAX_URL,Q,function(R){Q=JSON.parse(R);if(Q.Status=="success"){jQuery("#short-pixel-media-alert").hide();console.log("dismissed")}})}function k(){var Q={action:"shortpixel_check_quota"};jQuery.get(ShortPixel.AJAX_URL,Q,function(){console.log("quota refreshed")})}function B(Q){if(Q.checked){jQuery("#with-thumbs").css("display","inherit");jQuery("#without-thumbs").css("display","none")}else{jQuery("#without-thumbs").css("display","inherit");jQuery("#with-thumbs").css("display","none")}}function b(U,S,R,T,Q){return(S>0?"<div class='sp-column-info'>"+_spTr.reducedBy+" <strong><span class='percent'>"+S+"%</span></strong> ":"")+(S>0&&S<5?"<br>":"")+(S<5?_spTr.bonusProcessing:"")+(R.length>0?" ("+R+")":"")+(0+T>0?"<br>"+_spTr.plusXthumbsOpt.format(T):"")+(0+Q>0?"<br>"+_spTr.plusXretinasOpt.format(Q):"")+"</div>"}function p(R,Q){jQuery(R).knob({readOnly:true,width:Q,height:Q,fgColor:"#1CAECB",format:function(S){return S+"%"}})}function c(X,S,V,U,R,W){if(R==1){var T=jQuery(".sp-column-actions-template").clone();if(!T.length){return false}var Q;if(S.length==0){Q=["lossy","lossless"]}else{Q=["lossy","glossy","lossless"].filter(function(Y){return !(Y==S)})}T.html(T.html().replace(/__SP_ID__/g,X));if(W.substr(W.lastIndexOf(".")+1).toLowerCase()=="pdf"){jQuery(".sp-action-compare",T).remove()}if(V==0&&U>0){T.html(T.html().replace("__SP_THUMBS_TOTAL__",U))}else{jQuery(".sp-action-optimize-thumbs",T).remove();jQuery(".sp-dropbtn",T).removeClass("button-primary")}T.html(T.html().replace(/__SP_FIRST_TYPE__/g,Q[0]));T.html(T.html().replace(/__SP_SECOND_TYPE__/g,Q[1]));return T.html()}return""}function i(U,T){U=U.substring(2);if(jQuery(".shortpixel-other-media").length){var S=["optimize","retry","restore","redo","quota","view"];for(var R=0,Q=S.length;R<Q;R++){jQuery("#"+S[R]+"_"+U).css("display","none")}for(var R=0,Q=T.length;R<Q;R++){jQuery("#"+T[R]+"_"+U).css("display","")}}}function j(Q){ShortPixel.retries++;if(isNaN(ShortPixel.retries)){ShortPixel.retries=1}if(ShortPixel.retries<6){console.log("Invalid response from server (Error: "+Q+"). Retrying pass "+(ShortPixel.retries+1)+"...");setTimeout(checkBulkProgress,5000)}else{ShortPixel.bulkShowError(-1,"Invalid response from server received 6 times. Please retry later by reloading this page, or <a href='https://shortpixel.com/contact' target='_blank'>contact support</a>. (Error: "+Q+")","");console.log("Invalid response from server 6 times. Giving up.")}}function l(Q){Q.action="shortpixel_browse_content";var R="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(S){R=S},async:false});return R}function d(){var Q={action:"shortpixel_get_backup_size"};var R="";jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(S){R=S},async:false});return R}function f(R){if(!jQuery("#tos").is(":checked")){R.preventDefault();jQuery("#tos-robo").fadeIn(400,function(){jQuery("#tos-hand").fadeIn()});jQuery("#tos").click(function(){jQuery("#tos-robo").css("display","none");jQuery("#tos-hand").css("display","none")});return}jQuery("#request_key").addClass("disabled");jQuery("#pluginemail_spinner").addClass("is-active");ShortPixel.updateSignupEmail();if(ShortPixel.isEmailValid(jQuery("#pluginemail").val())){jQuery("#pluginemail-error").css("display","none");var Q={action:"shortpixel_new_api_key",email:jQuery("#pluginemail").val()};jQuery.ajax({type:"POST",async:false,url:ShortPixel.AJAX_URL,data:Q,success:function(S){data=JSON.parse(S);if(data.Status=="success"){R.preventDefault();window.location.reload()}else{if(data.Status=="invalid"){jQuery("#pluginemail-error").html("<b>"+data.Details+"</b>");jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");R.preventDefault()}else{}}}});jQuery("#request_key").removeAttr("onclick")}else{jQuery("#pluginemail-error").css("display","");jQuery("#pluginemail-info").css("display","none");R.preventDefault()}jQuery("#request_key").removeClass("disabled");jQuery("#pluginemail_spinner").removeClass("is-active")}function N(){jQuery("#shortPixelProposeUpgrade .sp-modal-body").addClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html("");jQuery("#shortPixelProposeUpgradeShade").css("display","block");jQuery("#shortPixelProposeUpgrade").removeClass("shortpixel-hide");var Q={action:"shortpixel_propose_upgrade"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:Q,success:function(R){jQuery("#shortPixelProposeUpgrade .sp-modal-body").removeClass("sptw-modal-spinner");jQuery("#shortPixelProposeUpgrade .sp-modal-body").html(R)}})}function G(){jQuery("#shortPixelProposeUpgradeShade").css("display","none");jQuery("#shortPixelProposeUpgrade").addClass("shortpixel-hide");if(ShortPixel.toRefresh){ShortPixel.recheckQuota()}}function v(){jQuery("#short-pixel-notice-unlisted").hide();jQuery("#optimizeUnlisted").prop("checked",true);var Q={action:"shortpixel_dismiss_notice",notice_id:"unlisted",notice_data:"true"};jQuery.get(ShortPixel.AJAX_URL,Q,function(R){Q=JSON.parse(R);if(Q.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function o(){jQuery(".select-folder-button").click(function(){jQuery(".sp-folder-picker-shade").css("display","block");jQuery(".sp-folder-picker").fileTree({script:ShortPixel.browseContent,multiFolder:false})});jQuery(".shortpixel-modal input.select-folder-cancel").click(function(){jQuery(".sp-folder-picker-shade").css("display","none")});jQuery(".shortpixel-modal input.select-folder").click(function(){var Q=jQuery("UL.jqueryFileTree LI.directory.selected A").attr("rel").trim();if(Q){var R=jQuery("#customFolderBase").val()+Q;if(R.slice(-1)=="/"){R=R.slice(0,-1)}jQuery("#addCustomFolder").val(R);jQuery("#addCustomFolderView").val(R);jQuery(".sp-folder-picker-shade").css("display","none")}else{alert("Please select a folder from the list.")}})}function F(U,T,S){var R=jQuery(".bulk-notice-msg.bulk-lengthy");if(R.length==0){return}var Q=jQuery("a",R);Q.text(T);if(S){Q.attr("href",S)}else{Q.attr("href",Q.data("href").replace("__ID__",U))}R.css("display","block")}function A(){jQuery(".bulk-notice-msg.bulk-lengthy").css("display","none")}function w(Q){var R=jQuery(".bulk-notice-msg.bulk-"+Q);if(R.length==0){return}R.css("display","block")}function O(Q){jQuery(".bulk-notice-msg.bulk-"+Q).css("display","none")}function s(W,U,V,T){var Q=jQuery("#bulk-error-template");if(Q.length==0){return}var S=Q.clone();S.attr("id","bulk-error-"+W);if(W==-1){jQuery("span.sp-err-title",S).remove();S.addClass("bulk-error-fatal")}else{jQuery("img",S).remove();jQuery("#bulk-error-".id).remove()}jQuery("span.sp-err-content",S).html(U);var R=jQuery("a.sp-post-link",S);if(T){R.attr("href",T)}else{R.attr("href",R.attr("href").replace("__ID__",W))}R.text(V);Q.after(S);S.css("display","block")}function D(Q,R){if(!confirm(_spTr["confirmBulk"+Q])){R.stopPropagation();R.preventDefault();return false}return true}function r(Q){jQuery(Q).parent().parent().remove()}function H(Q){return Q.substring(0,2)=="C-"}function J(){window.location.href=window.location.href+(window.location.href.indexOf("?")>0?"&":"?")+"checkquota=1"}function h(R){R.preventDefault();if(!this.menuCloseEvent){jQuery(window).click(function(S){if(!S.target.matches(".sp-dropbtn")){jQuery(".sp-dropdown.sp-show").removeClass("sp-show")}});this.menuCloseEvent=true}var Q=R.target.parentElement.classList.contains("sp-show");jQuery(".sp-dropdown.sp-show").removeClass("sp-show");if(!Q){R.target.parentElement.classList.add("sp-show")}}function P(Q){this.comparerData.origUrl=false;if(this.comparerData.cssLoaded===false){jQuery("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:this.WP_PLUGIN_URL+"/res/css/twentytwenty.min.css"});this.comparerData.cssLoaded=2}if(this.comparerData.jsLoaded===false){jQuery.getScript(this.WP_PLUGIN_URL+"/res/js/jquery.twentytwenty.min.js",function(){ShortPixel.comparerData.jsLoaded=2;if(ShortPixel.comparerData.origUrl.length>0){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}});this.comparerData.jsLoaded=1;jQuery(".sp-close-button").click(ShortPixel.closeComparerPopup)}if(this.comparerData.origUrl===false){jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:{action:"shortpixel_get_comparer_data",id:Q},success:function(R){data=JSON.parse(R);jQuery.extend(ShortPixel.comparerData,data);if(ShortPixel.comparerData.jsLoaded==2){ShortPixel.displayComparerPopup(ShortPixel.comparerData.width,ShortPixel.comparerData.height,ShortPixel.comparerData.origUrl,ShortPixel.comparerData.optUrl)}}});this.comparerData.origUrl=""}}function E(U,S,R,T){var X=U;var W=(S<150||U<350);var V=jQuery(W?"#spUploadCompareSideBySide":"#spUploadCompare");if(!W){jQuery("#spCompareSlider").html('<img class="spUploadCompareOriginal"/><img class="spUploadCompareOptimized"/>')}U=Math.max(350,Math.min(800,(U<350?(U+25)*2:(S<150?U+25:U))));S=Math.max(150,(W?(X>350?2*(S+45):S+45):S*U/X));jQuery(".sp-modal-body",V).css("width",U);jQuery(".shortpixel-slider",V).css("width",U);V.css("width",U);jQuery(".sp-modal-body",V).css("height",S);V.css("display","block");V.parent().css("display","block");if(!W){jQuery("#spCompareSlider").twentytwenty({slider_move:"mousemove"})}jQuery(document).on("keyup.sp_modal_active",ShortPixel.closeComparerPopup);var Q=jQuery(".spUploadCompareOptimized",V);jQuery(".spUploadCompareOriginal",V).attr("src",R);setTimeout(function(){jQuery(window).trigger("resize")},1000);Q.load(function(){jQuery(window).trigger("resize")});Q.attr("src",T)}function q(Q){jQuery("#spUploadCompareSideBySide").parent().css("display","none");jQuery("#spUploadCompareSideBySide").css("display","none");jQuery("#spUploadCompare").css("display","none");jQuery(document).unbind("keyup.sp_modal_active")}function z(Q){var R=document.createElement("a");R.href=Q;if(Q.indexOf(R.protocol+"//"+R.hostname)<0){return R.href}return Q.replace(R.protocol+"//"+R.hostname,R.protocol+"//"+R.hostname.split(".").map(function(S){return sp_punycode.toASCII(S)}).join("."))}return{init:I,setOptions:m,isEmailValid:t,updateSignupEmail:n,validateKey:a,enableResize:L,setupGeneralTab:e,apiKeyChanged:C,setupAdvancedTab:u,checkThumbsUpdTotal:K,initSettings:g,switchSettingsTab:x,adjustSettingsTabs:y,onBulkThumbsCheck:B,dismissMediaAlert:M,checkQuota:k,percentDial:p,successMsg:b,successActions:c,otherMediaUpdateActions:i,retry:j,initFolderSelector:o,browseContent:l,getBackupSize:d,newApiKey:f,proposeUpgrade:N,closeProposeUpgrade:G,includeUnlisted:v,bulkShowLengthyMsg:F,bulkHideLengthyMsg:A,bulkShowMaintenanceMsg:w,bulkHideMaintenanceMsg:O,bulkShowError:s,confirmBulkAction:D,removeBulkMsg:r,isCustomImageId:H,recheckQuota:J,openImageMenu:h,menuCloseEvent:false,loadComparer:P,displayComparerPopup:E,closeComparerPopup:q,convertPunycode:z,comparerData:{cssLoaded:false,jsLoaded:false,origUrl:false,optUrl:false,width:0,height:0},toRefresh:false,resizeSizesAlert:false}}();function showToolBarAlert(c,b,d){var a=jQuery("li.shortpixel-toolbar-processing");switch(c){case ShortPixel.STATUS_QUOTA_EXCEEDED:if(window.location.href.search("wp-short-pixel-bulk")>0&&jQuery(".sp-quota-exceeded-alert").length==0){location.reload();return}a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","ShortPixel quota exceeded. Click for details.");break;case ShortPixel.STATUS_SKIP:case ShortPixel.STATUS_FAIL:a.addClass("shortpixel-alert shortpixel-processing");jQuery("a div",a).attr("title",b);if(typeof d!=="undefined"){jQuery("a",a).attr("href","post.php?post="+d+"&action=edit")}break;case ShortPixel.STATUS_NO_KEY:a.addClass("shortpixel-alert");a.addClass("shortpixel-quota-exceeded");jQuery("a",a).attr("href","options-general.php?page=wp-shortpixel");jQuery("a div",a).attr("title","Get API Key");break;case ShortPixel.STATUS_SUCCESS:case ShortPixel.STATUS_RETRY:a.addClass("shortpixel-processing");a.removeClass("shortpixel-alert");jQuery("a",a).removeAttr("target");jQuery("a",a).attr("href",jQuery("a img",a).attr("success-url"))}a.removeClass("shortpixel-hide")}function hideToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-processing").addClass("shortpixel-hide")}function hideQuotaExceededToolBarAlert(){jQuery("li.shortpixel-toolbar-processing.shortpixel-quota-exceeded").addClass("shortpixel-hide")}function checkQuotaExceededAlert(){if(typeof shortPixelQuotaExceeded!="undefined"){if(shortPixelQuotaExceeded==1){showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED)}else{hideQuotaExceededToolBarAlert()}}}function checkBulkProgress(){var b=function(e){if(!d){d=true;return e}return"/"};var d=false;var a=window.location.href.toLowerCase().replace(/\/\//g,b);d=false;var c=ShortPixel.WP_ADMIN_URL.toLowerCase().replace(/\/\//g,b);if(a.search(c)<0){a=ShortPixel.convertPunycode(a);c=ShortPixel.convertPunycode(c)}if(a.search(c+"upload.php")<0&&a.search(c+"edit.php")<0&&a.search(c+"edit-tags.php")<0&&a.search(c+"post-new.php")<0&&a.search(c+"post.php")<0&&a.search("page=nggallery-manage-gallery")<0&&(ShortPixel.FRONT_BOOTSTRAP==0||a.search(c)==0)){hideToolBarAlert();return}if(ShortPixel.bulkProcessor==true&&window.location.href.search("wp-short-pixel-bulk")<0&&typeof localStorage.bulkPage!=="undefined"&&localStorage.bulkPage>0){ShortPixel.bulkProcessor=false}if(window.location.href.search("wp-short-pixel-bulk")>=0){ShortPixel.bulkProcessor=true;localStorage.bulkTime=Math.floor(Date.now()/1000);localStorage.bulkPage=1}if(ShortPixel.bulkProcessor==true||typeof localStorage.bulkTime=="undefined"||Math.floor(Date.now()/1000)-localStorage.bulkTime>90){ShortPixel.bulkProcessor=true;localStorage.bulkPage=(window.location.href.search("wp-short-pixel-bulk")>=0?1:0);localStorage.bulkTime=Math.floor(Date.now()/1000);console.log(localStorage.bulkTime);checkBulkProcessingCallApi()}else{setTimeout(checkBulkProgress,5000)}}function checkBulkProcessingCallApi(){var a={action:"shortpixel_image_processing"};jQuery.ajax({type:"POST",url:ShortPixel.AJAX_URL,data:a,success:function(g){if(g.length>0){var i=null;try{var i=JSON.parse(g)}catch(k){ShortPixel.retry(k.message);return}ShortPixel.retries=0;var d=i.ImageID;var j=(jQuery("div.short-pixel-bulk-page").length>0);switch(i.Status){case ShortPixel.STATUS_NO_KEY:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/wp-apikey"+ShortPixel.AFFILIATE+'" target="_blank">'+_spTr.getApiKey+"</a>");showToolBarAlert(ShortPixel.STATUS_NO_KEY);break;case ShortPixel.STATUS_QUOTA_EXCEEDED:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"https://shortpixel.com/login/"+ShortPixel.API_KEY+'" target="_blank">'+_spTr.extendQuota+"</a><a class='button button-smaller' href='admin.php?action=shortpixel_check_quota'>"+_spTr.check__Quota+"</a>");showToolBarAlert(ShortPixel.STATUS_QUOTA_EXCEEDED);if(i.Stop==false){setTimeout(checkBulkProgress,5000)}ShortPixel.otherMediaUpdateActions(d,["quota","view"]);break;case ShortPixel.STATUS_FAIL:setCellMessage(d,i.Message,"<a class='button button-smaller button-primary' href=\"javascript:manualOptimization('"+d+"', false)\">"+_spTr.retry+"</a>");showToolBarAlert(ShortPixel.STATUS_FAIL,i.Message,d);if(j){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink);if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}ShortPixel.otherMediaUpdateActions(d,["retry","view"])}console.log(i.Message);setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_EMPTY_QUEUE:console.log(i.Message);clearBulkProcessor();hideToolBarAlert();var c=jQuery("#bulk-progress");if(j&&c.length&&i.BulkStatus!="2"){progressUpdate(100,"Bulk finished!");jQuery("a.bulk-cancel").attr("disabled","disabled");hideSlider();setTimeout(function(){window.location.reload()},3000)}break;case ShortPixel.STATUS_SUCCESS:if(j){ShortPixel.bulkHideLengthyMsg();ShortPixel.bulkHideMaintenanceMsg()}var l=i.PercentImprovement;showToolBarAlert(ShortPixel.STATUS_SUCCESS,"");var b=ShortPixel.isCustomImageId(d)?"":ShortPixel.successActions(d,i.Type,i.ThumbsCount,i.ThumbsTotal,i.BackupEnabled,i.Filename);setCellMessage(d,ShortPixel.successMsg(d,l,i.Type,i.ThumbsCount,i.RetinasCount),b);var h=jQuery(["restore","view","redolossy","redoglossy","redolossless"]).not(["redo"+i.Type]).get();ShortPixel.otherMediaUpdateActions(d,h);var f=new PercentageAnimator("#sp-msg-"+d+" span.percent",l);f.animate(l);if(j&&typeof i.Thumb!=="undefined"){if(i.BulkPercent){progressUpdate(i.BulkPercent,i.BulkMsg)}if(i.Thumb.length>0){sliderUpdate(d,i.Thumb,i.BkThumb,i.PercentImprovement,i.Filename);if(typeof i.AverageCompression!=="undefined"&&0+i.AverageCompression>0){jQuery("#sp-avg-optimization").html('<input type="text" class="dial" value="'+Math.round(i.AverageCompression)+'"/>');ShortPixel.percentDial("#sp-avg-optimization .dial",60)}}}console.log("Server response: "+g);if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_SKIP:if(i.Silent!==1){ShortPixel.bulkShowError(d,i.Message,i.Filename,i.CustomImageLink)}case ShortPixel.STATUS_ERROR:if(typeof i.Message!=="undefined"){showToolBarAlert(ShortPixel.STATUS_SKIP,i.Message+" Image ID: "+d);setCellMessage(d,i.Message,"")}ShortPixel.otherMediaUpdateActions(d,["retry","view"]);case ShortPixel.STATUS_RETRY:console.log("Server response: "+g);showToolBarAlert(ShortPixel.STATUS_RETRY,"");if(j&&typeof i.BulkPercent!=="undefined"){progressUpdate(i.BulkPercent,i.BulkMsg)}if(j&&i.Count>3){ShortPixel.bulkShowLengthyMsg(d,i.Filename,i.CustomImageLink)}setTimeout(checkBulkProgress,5000);break;case ShortPixel.STATUS_MAINTENANCE:ShortPixel.bulkShowMaintenanceMsg("maintenance");setTimeout(checkBulkProgress,60000);break;case ShortPixel.STATUS_QUEUE_FULL:ShortPixel.bulkShowMaintenanceMsg("queue-full");setTimeout(checkBulkProgress,60000);break;default:ShortPixel.retry("Unknown status "+i.Status+". Retrying...");break}}},error:function(b){ShortPixel.retry(b.statusText)}})}function clearBulkProcessor(){ShortPixel.bulkProcessor=false;localStorage.bulkTime=0;if(window.location.href.search("wp-short-pixel-bulk")>=0){localStorage.bulkPage=0}}function setCellMessage(d,a,c){var b=jQuery("#sp-msg-"+d);if(b.length>0){b.html("<div class='sp-column-actions'>"+c+"</div><div class='sp-column-info'>"+a+"</div>");b.css("color","")}b=jQuery("#sp-cust-msg-"+d);if(b.length>0){b.html("<div class='sp-column-info'>"+a+"</div>")}}function manualOptimization(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be processed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-alert");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_manual_optimization",image_id:c,cleanup:a};jQuery.ajax({type:"GET",url:ShortPixel.AJAX_URL,data:b,success:function(d){var e=JSON.parse(d);if(e.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(c,typeof e.Message!=="undefined"?e.Message:_spTr.thisContentNotProcessable,"")}},error:function(d){b.action="shortpixel_check_status";jQuery.ajax({type:"GET",url:ShortPixel.AJAX_URL,data:b,success:function(e){var f=JSON.parse(e);if(f.Status!==ShortPixel.STATUS_SUCCESS){setCellMessage(c,typeof f.Message!=="undefined"?f.Message:_spTr.thisContentNotProcessable,"")}}})}})}function reoptimize(c,a){setCellMessage(c,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>Image waiting to be reprocessed","");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var b={action:"shortpixel_redo",attachment_ID:c,type:a};jQuery.get(ShortPixel.AJAX_URL,b,function(d){b=JSON.parse(d);if(b.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{$msg=typeof b.Message!=="undefined"?b.Message:_spTr.thisContentNotProcessable;setCellMessage(c,$msg,"");showToolBarAlert(ShortPixel.STATUS_FAIL,$msg)}})}function optimizeThumbs(b){setCellMessage(b,"<img src='"+ShortPixel.WP_PLUGIN_URL+"/res/img/loading.gif' class='sp-loading-small'>"+_spTr.imageWaitOptThumbs,"");jQuery("li.shortpixel-toolbar-processing").removeClass("shortpixel-hide");jQuery("li.shortpixel-toolbar-processing").addClass("shortpixel-processing");var a={action:"shortpixel_optimize_thumbs",attachment_ID:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){setTimeout(checkBulkProgress,2000)}else{setCellMessage(b,typeof a.Message!=="undefined"?a.Message:_spTr.thisContentNotProcessable,"")}})}function dismissShortPixelNoticeExceed(b){jQuery("#wp-admin-bar-shortpixel_processing").hide();var a={action:"shortpixel_dismiss_notice",notice_id:"exceed"};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}});b.preventDefault()}function dismissShortPixelNotice(b){jQuery("#short-pixel-notice-"+b).hide();var a={action:"shortpixel_dismiss_notice",notice_id:b};jQuery.get(ShortPixel.AJAX_URL,a,function(c){a=JSON.parse(c);if(a.Status==ShortPixel.STATUS_SUCCESS){console.log("dismissed")}})}function PercentageAnimator(b,a){this.animationSpeed=10;this.increment=2;this.curPercentage=0;this.targetPercentage=a;this.outputSelector=b;this.animate=function(c){this.targetPercentage=c;setTimeout(PercentageTimer.bind(null,this),this.animationSpeed)}}function PercentageTimer(a){if(a.curPercentage-a.targetPercentage<-a.increment){a.curPercentage+=a.increment}else{if(a.curPercentage-a.targetPercentage>a.increment){a.curPercentage-=a.increment}else{a.curPercentage=a.targetPercentage}}jQuery(a.outputSelector).text(a.curPercentage+"%");if(a.curPercentage!=a.targetPercentage){setTimeout(PercentageTimer.bind(null,a),a.animationSpeed)}}function progressUpdate(c,b){var a=jQuery("#bulk-progress");if(a.length){jQuery(".progress-left",a).css("width",c+"%");jQuery(".progress-img",a).css("left",c+"%");if(c>24){jQuery(".progress-img span",a).html("");jQuery(".progress-left",a).html(c+"%")}else{jQuery(".progress-img span",a).html(c+"%");jQuery(".progress-left",a).html("")}jQuery(".bulk-estimate").html(b)}}function sliderUpdate(g,c,d,e,b){var f=jQuery(".bulk-slider div.bulk-slide:first-child");if(f.length===0){return}if(f.attr("id")!="empty-slide"){f.hide()}f.css("z-index",1000);jQuery(".bulk-img-opt",f).attr("src","");if(typeof d==="undefined"){d=""}if(d.length>0){jQuery(".bulk-img-orig",f).attr("src","")}var a=f.clone();a.attr("id","slide-"+g);jQuery(".bulk-img-opt",a).attr("src",c);if(d.length>0){jQuery(".img-original",a).css("display","inline-block");jQuery(".bulk-img-orig",a).attr("src",d)}else{jQuery(".img-original",a).css("display","none")}jQuery(".bulk-opt-percent",a).html('<input type="text" class="dial" value="'+e+'"/>');jQuery(".bulk-slider").append(a);ShortPixel.percentDial("#"+a.attr("id")+" .dial",100);jQuery(".bulk-slider-container span.filename").html(" "+b);if(f.attr("id")=="empty-slide"){f.remove();jQuery(".bulk-slider-container").css("display","block")}else{f.animate({left:f.width()+f.position().left},"slow","swing",function(){f.remove();a.fadeIn("slow")})}}function hideSlider(){jQuery(".bulk-slider-container").css("display","none")}function showStats(){var a=jQuery(".bulk-stats");if(a.length>0){}}if(!(typeof String.prototype.format=="function")){String.prototype.format=function(){var b=this,a=arguments.length;while(a--){b=b.replace(new RegExp("\\{"+a+"\\}","gm"),arguments[a])}return b}};
|
wp-shortpixel.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: ShortPixel Image Optimizer
|
4 |
* Plugin URI: https://shortpixel.com/
|
5 |
* Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel" target="_blank">Settings > ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
|
6 |
-
* Version: 4.12.
|
7 |
* Author: ShortPixel
|
8 |
* Author URI: https://shortpixel.com
|
9 |
* Text Domain: shortpixel-image-optimiser
|
@@ -18,7 +18,7 @@ define('SHORTPIXEL_PLUGIN_FILE', __FILE__);
|
|
18 |
|
19 |
//define('SHORTPIXEL_AFFILIATE_CODE', '');
|
20 |
|
21 |
-
define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.12.
|
22 |
define('SHORTPIXEL_MAX_TIMEOUT', 10);
|
23 |
define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
|
24 |
define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
|
3 |
* Plugin Name: ShortPixel Image Optimizer
|
4 |
* Plugin URI: https://shortpixel.com/
|
5 |
* Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel" target="_blank">Settings > ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
|
6 |
+
* Version: 4.12.5
|
7 |
* Author: ShortPixel
|
8 |
* Author URI: https://shortpixel.com
|
9 |
* Text Domain: shortpixel-image-optimiser
|
18 |
|
19 |
//define('SHORTPIXEL_AFFILIATE_CODE', '');
|
20 |
|
21 |
+
define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.12.5-RC2");
|
22 |
define('SHORTPIXEL_MAX_TIMEOUT', 10);
|
23 |
define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
|
24 |
define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
|