Version Description
- Unsupported image types are now gracefully skipped
- Renamed setting names and greyed out inapplicable settings to avoid confusion
- Increased size limit for Optimus HQ to 10MB
- Licences can now easily be extended
- Optimize images uploaded through the REST API
Download this release
Release Info
| Developer | keycdn |
| Plugin | |
| Version | 1.5.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.4.9 to 1.5.0
- css/styles.css +1 -1
- inc/optimus.class.php +5 -19
- inc/optimus_hq.class.php +56 -71
- inc/optimus_management.class.php +9 -1
- inc/optimus_request.class.php +5 -5
- inc/optimus_settings.class.php +12 -12
- optimus.php +15 -1
- readme.txt +12 -13
css/styles.css
CHANGED
|
@@ -75,7 +75,7 @@
|
|
| 75 |
}
|
| 76 |
|
| 77 |
#optimus-bulk-optimizer #media-items .bar.err {
|
| 78 |
-
background-color: #
|
| 79 |
}
|
| 80 |
|
| 81 |
#optimus-bulk-optimizer .media-item {
|
| 75 |
}
|
| 76 |
|
| 77 |
#optimus-bulk-optimizer #media-items .bar.err {
|
| 78 |
+
background-color: #bbb;
|
| 79 |
}
|
| 80 |
|
| 81 |
#optimus-bulk-optimizer .media-item {
|
inc/optimus.class.php
CHANGED
|
@@ -40,20 +40,6 @@ class Optimus
|
|
| 40 |
/* Get plugin options */
|
| 41 |
$options = Optimus::get_options();
|
| 42 |
|
| 43 |
-
/* Check if manual optimization is enabled */
|
| 44 |
-
if ( ! $options['manual_optimize'] ) {
|
| 45 |
-
/* Fire! */
|
| 46 |
-
add_filter(
|
| 47 |
-
'wp_generate_attachment_metadata',
|
| 48 |
-
array(
|
| 49 |
-
'Optimus_Request',
|
| 50 |
-
'optimize_upload_images'
|
| 51 |
-
),
|
| 52 |
-
10,
|
| 53 |
-
2
|
| 54 |
-
);
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
/* Remove converted files */
|
| 58 |
add_filter(
|
| 59 |
'wp_delete_file',
|
|
@@ -354,11 +340,11 @@ class Optimus
|
|
| 354 |
return wp_parse_args(
|
| 355 |
get_option('optimus'),
|
| 356 |
array(
|
| 357 |
-
'copy_markers'
|
| 358 |
-
'webp_convert'
|
| 359 |
-
'keep_original'
|
| 360 |
-
'secure_transport'
|
| 361 |
-
'manual_optimize'
|
| 362 |
)
|
| 363 |
);
|
| 364 |
}
|
| 40 |
/* Get plugin options */
|
| 41 |
$options = Optimus::get_options();
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
/* Remove converted files */
|
| 44 |
add_filter(
|
| 45 |
'wp_delete_file',
|
| 340 |
return wp_parse_args(
|
| 341 |
get_option('optimus'),
|
| 342 |
array(
|
| 343 |
+
'copy_markers' => 0,
|
| 344 |
+
'webp_convert' => 0,
|
| 345 |
+
'keep_original' => 0,
|
| 346 |
+
'secure_transport' => 0,
|
| 347 |
+
'manual_optimize' => 0
|
| 348 |
)
|
| 349 |
);
|
| 350 |
}
|
inc/optimus_hq.class.php
CHANGED
|
@@ -83,36 +83,10 @@ class Optimus_HQ
|
|
| 83 |
}
|
| 84 |
|
| 85 |
/* Timestamp from cache */
|
| 86 |
-
|
| 87 |
-
$response = wp_safe_remote_get(
|
| 88 |
-
sprintf(
|
| 89 |
-
'%s/%s',
|
| 90 |
-
'https://verify.optimus.io',
|
| 91 |
-
$key
|
| 92 |
-
)
|
| 93 |
-
);
|
| 94 |
-
|
| 95 |
-
/* Exit on error */
|
| 96 |
-
if ( is_wp_error($response) ) {
|
| 97 |
-
wp_die( $response->get_error_message() );
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
/* Initial state */
|
| 101 |
-
$purchase_time = -1;
|
| 102 |
-
|
| 103 |
-
/* Set the timestamp */
|
| 104 |
-
if ( wp_remote_retrieve_response_code($response) === 200 ) {
|
| 105 |
-
$purchase_time = (int) wp_remote_retrieve_body($response);
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
-
/* Store as option */
|
| 109 |
-
self::_update_purchase_time($purchase_time);
|
| 110 |
-
}
|
| 111 |
|
| 112 |
/* Invalid purchase time? */
|
| 113 |
if ( (int)$purchase_time <= 0 ) {
|
| 114 |
-
self::_delete_key();
|
| 115 |
-
|
| 116 |
return false;
|
| 117 |
}
|
| 118 |
|
|
@@ -124,7 +98,26 @@ class Optimus_HQ
|
|
| 124 |
|
| 125 |
/* Expired time? */
|
| 126 |
if ( $expiration_time < time() ) {
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
return false;
|
| 130 |
}
|
|
@@ -166,62 +159,54 @@ class Optimus_HQ
|
|
| 166 |
}
|
| 167 |
|
| 168 |
|
| 169 |
-
/**
|
| 170 |
-
* Delete the license key
|
| 171 |
-
*
|
| 172 |
-
* @since 1.1.9
|
| 173 |
-
* @change 1.1.9
|
| 174 |
-
*/
|
| 175 |
-
|
| 176 |
-
private static function _delete_key()
|
| 177 |
-
{
|
| 178 |
-
delete_site_option('optimus_key');
|
| 179 |
-
}
|
| 180 |
-
|
| 181 |
-
|
| 182 |
/**
|
| 183 |
* Return the purchase timestamp
|
| 184 |
*
|
| 185 |
* @since 1.1.9
|
| 186 |
-
* @change 1.
|
| 187 |
*
|
| 188 |
* @return string Optimus HQ purchase timestamp
|
| 189 |
*/
|
| 190 |
|
| 191 |
-
public static function get_purchase_time()
|
| 192 |
{
|
| 193 |
-
|
| 194 |
-
}
|
| 195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
*/
|
| 205 |
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
$value
|
| 211 |
-
);
|
| 212 |
-
}
|
| 213 |
|
|
|
|
|
|
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
* @change 1.1.9
|
| 220 |
-
*/
|
| 221 |
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
}
|
| 226 |
|
| 227 |
|
|
@@ -289,7 +274,7 @@ class Optimus_HQ
|
|
| 289 |
* @change 1.3.2
|
| 290 |
*/
|
| 291 |
|
| 292 |
-
|
| 293 |
{
|
| 294 |
/* Action check */
|
| 295 |
if ( empty($_POST['_optimus_action']) OR $_POST['_optimus_action'] !== 'verify' ) {
|
|
@@ -318,7 +303,7 @@ class Optimus_HQ
|
|
| 318 |
}
|
| 319 |
|
| 320 |
/* Delete purchase_time */
|
| 321 |
-
|
| 322 |
|
| 323 |
/* Store current key */
|
| 324 |
self::_update_key($optimus_key);
|
| 83 |
}
|
| 84 |
|
| 85 |
/* Timestamp from cache */
|
| 86 |
+
$purchase_time = self::get_purchase_time();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
/* Invalid purchase time? */
|
| 89 |
if ( (int)$purchase_time <= 0 ) {
|
|
|
|
|
|
|
| 90 |
return false;
|
| 91 |
}
|
| 92 |
|
| 98 |
|
| 99 |
/* Expired time? */
|
| 100 |
if ( $expiration_time < time() ) {
|
| 101 |
+
|
| 102 |
+
/* try to renew the licence once every 10 minutes */
|
| 103 |
+
if ( empty(get_transient('optimus_renew_licence')) ) {
|
| 104 |
+
set_transient('optimus_renew_licence', true, 600);
|
| 105 |
+
|
| 106 |
+
$purchase_time_new = self::get_purchase_time(true);
|
| 107 |
+
|
| 108 |
+
if ( $purchase_time_new <= $purchase_time ) {
|
| 109 |
+
/* unchanged */
|
| 110 |
+
return false;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/* re-calculate expiry time */
|
| 114 |
+
$expiration_time = strtotime(
|
| 115 |
+
'+1 year',
|
| 116 |
+
$purchase_time_new
|
| 117 |
+
);
|
| 118 |
+
|
| 119 |
+
return $expiration_time;
|
| 120 |
+
}
|
| 121 |
|
| 122 |
return false;
|
| 123 |
}
|
| 159 |
}
|
| 160 |
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
/**
|
| 163 |
* Return the purchase timestamp
|
| 164 |
*
|
| 165 |
* @since 1.1.9
|
| 166 |
+
* @change 1.5.0
|
| 167 |
*
|
| 168 |
* @return string Optimus HQ purchase timestamp
|
| 169 |
*/
|
| 170 |
|
| 171 |
+
public static function get_purchase_time($renew = false)
|
| 172 |
{
|
| 173 |
+
$purchase_time = get_site_option('optimus_purchase_time', 0);
|
|
|
|
| 174 |
|
| 175 |
+
if ( $purchase_time == 0 || $renew == true) {
|
| 176 |
+
if ( ! $key = self::get_key() ) {
|
| 177 |
+
return false;
|
| 178 |
+
}
|
| 179 |
|
| 180 |
+
$response = wp_safe_remote_get(
|
| 181 |
+
sprintf(
|
| 182 |
+
'%s/%s',
|
| 183 |
+
'https://verify.optimus.io',
|
| 184 |
+
$key
|
| 185 |
+
)
|
| 186 |
+
);
|
|
|
|
| 187 |
|
| 188 |
+
/* Exit on error */
|
| 189 |
+
if ( is_wp_error($response) ) {
|
| 190 |
+
wp_die( $response->get_error_message() );
|
| 191 |
+
}
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
+
/* Initial state */
|
| 194 |
+
$purchase_time = -1;
|
| 195 |
|
| 196 |
+
/* Set the timestamp */
|
| 197 |
+
if ( wp_remote_retrieve_response_code($response) === 200 ) {
|
| 198 |
+
$purchase_time = (int) wp_remote_retrieve_body($response);
|
| 199 |
+
}
|
|
|
|
|
|
|
| 200 |
|
| 201 |
+
/* Store as option */
|
| 202 |
+
update_site_option(
|
| 203 |
+
'optimus_purchase_time',
|
| 204 |
+
$purchase_time
|
| 205 |
+
);
|
| 206 |
+
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
return $purchase_time;
|
| 210 |
}
|
| 211 |
|
| 212 |
|
| 274 |
* @change 1.3.2
|
| 275 |
*/
|
| 276 |
|
| 277 |
+
public static function verify_key_input()
|
| 278 |
{
|
| 279 |
/* Action check */
|
| 280 |
if ( empty($_POST['_optimus_action']) OR $_POST['_optimus_action'] !== 'verify' ) {
|
| 303 |
}
|
| 304 |
|
| 305 |
/* Delete purchase_time */
|
| 306 |
+
delete_site_option('optimus_purchase_time');
|
| 307 |
|
| 308 |
/* Store current key */
|
| 309 |
self::_update_key($optimus_key);
|
inc/optimus_management.class.php
CHANGED
|
@@ -76,6 +76,13 @@ class Optimus_Management
|
|
| 76 |
/* Get plugin options */
|
| 77 |
$options = Optimus::get_options();
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
/* Check if images are already optimized */
|
| 80 |
if ( $options['webp_convert'] ) {
|
| 81 |
$optimus_query = '%optimus%webp";i:1%';
|
|
@@ -97,6 +104,7 @@ class Optimus_Management
|
|
| 97 |
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
|
| 98 |
AND $wpdb->posts.post_type = 'attachment'
|
| 99 |
AND $wpdb->posts.post_mime_type LIKE 'image/%'
|
|
|
|
| 100 |
AND $wpdb->postmeta.meta_key = '_wp_attachment_metadata'
|
| 101 |
AND $wpdb->postmeta.meta_value NOT LIKE '$optimus_query'
|
| 102 |
$id_query
|
|
@@ -107,7 +115,7 @@ class Optimus_Management
|
|
| 107 |
|
| 108 |
echo '<div class="wrap" id="optimus-bulk-optimizer">';
|
| 109 |
echo '<h2>' . __("Optimus Bulk Optimizer", "optimus") . '</h2>';
|
| 110 |
-
if (empty($_POST['optimus-bulk-optimizer']) && empty($_GET['ids'])) {
|
| 111 |
echo '<p>' . __("The Optimus bulk optimizer compresses all images that have not yet been compressed in your WordPress media library.", "optimus") . '</p>';
|
| 112 |
|
| 113 |
if ( Optimus_HQ::is_locked() ) {
|
| 76 |
/* Get plugin options */
|
| 77 |
$options = Optimus::get_options();
|
| 78 |
|
| 79 |
+
/* Supported image types */
|
| 80 |
+
$imageTypes = ['jpeg', 'png'];
|
| 81 |
+
foreach ($imageTypes as &$imageType) {
|
| 82 |
+
$imageType = "$wpdb->posts.post_mime_type = 'image/$imageType'";
|
| 83 |
+
}
|
| 84 |
+
$queryImageTypes = "(". join(" OR ", $imageTypes) .")";
|
| 85 |
+
|
| 86 |
/* Check if images are already optimized */
|
| 87 |
if ( $options['webp_convert'] ) {
|
| 88 |
$optimus_query = '%optimus%webp";i:1%';
|
| 104 |
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
|
| 105 |
AND $wpdb->posts.post_type = 'attachment'
|
| 106 |
AND $wpdb->posts.post_mime_type LIKE 'image/%'
|
| 107 |
+
AND $queryImageTypes
|
| 108 |
AND $wpdb->postmeta.meta_key = '_wp_attachment_metadata'
|
| 109 |
AND $wpdb->postmeta.meta_value NOT LIKE '$optimus_query'
|
| 110 |
$id_query
|
| 115 |
|
| 116 |
echo '<div class="wrap" id="optimus-bulk-optimizer">';
|
| 117 |
echo '<h2>' . __("Optimus Bulk Optimizer", "optimus") . '</h2>';
|
| 118 |
+
if ((empty($_POST['optimus-bulk-optimizer']) && empty($_GET['ids'])) || $count == 0) {
|
| 119 |
echo '<p>' . __("The Optimus bulk optimizer compresses all images that have not yet been compressed in your WordPress media library.", "optimus") . '</p>';
|
| 120 |
|
| 121 |
if ( Optimus_HQ::is_locked() ) {
|
inc/optimus_request.class.php
CHANGED
|
@@ -28,7 +28,7 @@ class Optimus_Request
|
|
| 28 |
* Image optimization post process (ajax)
|
| 29 |
*
|
| 30 |
* @since 1.3.8
|
| 31 |
-
* @change 1.4.
|
| 32 |
*
|
| 33 |
* @return json $metadata Update metadata information
|
| 34 |
*/
|
|
@@ -71,7 +71,7 @@ class Optimus_Request
|
|
| 71 |
|
| 72 |
/* check if optimus array empty */
|
| 73 |
if ( empty($optimus_metadata['optimus']) ) {
|
| 74 |
-
echo json_encode(array('error' => __("
|
| 75 |
exit;
|
| 76 |
}
|
| 77 |
|
|
@@ -586,9 +586,9 @@ class Optimus_Request
|
|
| 586 |
|
| 587 |
/* Optimus HQ */
|
| 588 |
true => array(
|
| 589 |
-
'image/jpeg' =>
|
| 590 |
-
'image/webp' =>
|
| 591 |
-
'image/png' =>
|
| 592 |
)
|
| 593 |
);
|
| 594 |
|
| 28 |
* Image optimization post process (ajax)
|
| 29 |
*
|
| 30 |
* @since 1.3.8
|
| 31 |
+
* @change 1.4.10
|
| 32 |
*
|
| 33 |
* @return json $metadata Update metadata information
|
| 34 |
*/
|
| 71 |
|
| 72 |
/* check if optimus array empty */
|
| 73 |
if ( empty($optimus_metadata['optimus']) ) {
|
| 74 |
+
echo json_encode(array('error' => __("Not found", "optimus")));
|
| 75 |
exit;
|
| 76 |
}
|
| 77 |
|
| 586 |
|
| 587 |
/* Optimus HQ */
|
| 588 |
true => array(
|
| 589 |
+
'image/jpeg' => 10000 * 1024,
|
| 590 |
+
'image/webp' => 10000 * 1024,
|
| 591 |
+
'image/png' => 10000 * 1024
|
| 592 |
)
|
| 593 |
);
|
| 594 |
|
inc/optimus_settings.class.php
CHANGED
|
@@ -39,7 +39,7 @@ class Optimus_Settings
|
|
| 39 |
* Valisierung der Optionsseite
|
| 40 |
*
|
| 41 |
* @since 1.0.0
|
| 42 |
-
* @change 1.
|
| 43 |
*
|
| 44 |
* @param array $data Array mit Formularwerten
|
| 45 |
* @return array Array mit geprüften Werten
|
|
@@ -48,11 +48,11 @@ class Optimus_Settings
|
|
| 48 |
public static function validate_settings($data)
|
| 49 |
{
|
| 50 |
return array(
|
| 51 |
-
'copy_markers'
|
| 52 |
-
'webp_convert'
|
| 53 |
-
'keep_original'
|
| 54 |
-
'secure_transport'
|
| 55 |
-
'manual_optimize'
|
| 56 |
);
|
| 57 |
}
|
| 58 |
|
|
@@ -126,7 +126,7 @@ class Optimus_Settings
|
|
| 126 |
|
| 127 |
<tr valign="top">
|
| 128 |
<th scope="row">
|
| 129 |
-
<?php _e("
|
| 130 |
</th>
|
| 131 |
<td>
|
| 132 |
<fieldset>
|
|
@@ -144,12 +144,12 @@ class Optimus_Settings
|
|
| 144 |
|
| 145 |
<tr valign="top">
|
| 146 |
<th scope="row">
|
| 147 |
-
<?php _e("
|
| 148 |
</th>
|
| 149 |
<td>
|
| 150 |
<fieldset>
|
| 151 |
<label for="optimus_copy_markers">
|
| 152 |
-
<input type="checkbox" name="optimus[copy_markers]" id="optimus_copy_markers" value="1" <?php checked(1, $options['copy_markers']) ?> />
|
| 153 |
<?php _e("No deletion of image metadata", "optimus"); ?>
|
| 154 |
</label>
|
| 155 |
|
|
@@ -167,7 +167,7 @@ class Optimus_Settings
|
|
| 167 |
<td>
|
| 168 |
<fieldset>
|
| 169 |
<label for="optimus_webp_convert">
|
| 170 |
-
<input type="checkbox" name="optimus[webp_convert]" id="optimus_webp_convert" value="1" <?php checked(1, $options['webp_convert']) ?> />
|
| 171 |
<?php _e("Creation of WebP files", "optimus"); ?>
|
| 172 |
</label>
|
| 173 |
|
|
@@ -185,7 +185,7 @@ class Optimus_Settings
|
|
| 185 |
<td>
|
| 186 |
<fieldset>
|
| 187 |
<label for="optimus_secure_transport">
|
| 188 |
-
<input type="checkbox" name="optimus[secure_transport]" id="optimus_secure_transport" value="1" <?php checked(1, $options['secure_transport']) ?> />
|
| 189 |
<?php _e("Transfer images using TLS encryption", "optimus"); ?>
|
| 190 |
</label>
|
| 191 |
|
|
@@ -198,7 +198,7 @@ class Optimus_Settings
|
|
| 198 |
|
| 199 |
<tr valign="top">
|
| 200 |
<th scope="row">
|
| 201 |
-
<?php _e("
|
| 202 |
</th>
|
| 203 |
<td>
|
| 204 |
<fieldset>
|
| 39 |
* Valisierung der Optionsseite
|
| 40 |
*
|
| 41 |
* @since 1.0.0
|
| 42 |
+
* @change 1.5.0
|
| 43 |
*
|
| 44 |
* @param array $data Array mit Formularwerten
|
| 45 |
* @return array Array mit geprüften Werten
|
| 48 |
public static function validate_settings($data)
|
| 49 |
{
|
| 50 |
return array(
|
| 51 |
+
'copy_markers' => (int)(!empty($data['copy_markers'])),
|
| 52 |
+
'webp_convert' => (int)(!empty($data['webp_convert'])),
|
| 53 |
+
'keep_original' => (int)(!empty($data['keep_original'])),
|
| 54 |
+
'secure_transport' => (int)(!empty($data['secure_transport'])),
|
| 55 |
+
'manual_optimize' => (int)(!empty($data['manual_optimize']))
|
| 56 |
);
|
| 57 |
}
|
| 58 |
|
| 126 |
|
| 127 |
<tr valign="top">
|
| 128 |
<th scope="row">
|
| 129 |
+
<?php _e("Ignore original images", "optimus"); ?>
|
| 130 |
</th>
|
| 131 |
<td>
|
| 132 |
<fieldset>
|
| 144 |
|
| 145 |
<tr valign="top">
|
| 146 |
<th scope="row">
|
| 147 |
+
<?php _e("Keep image metadata", "optimus"); ?>
|
| 148 |
</th>
|
| 149 |
<td>
|
| 150 |
<fieldset>
|
| 151 |
<label for="optimus_copy_markers">
|
| 152 |
+
<input type="checkbox" name="optimus[copy_markers]" id="optimus_copy_markers" value="1" <?php checked(1, $options['copy_markers']); if ( Optimus_HQ::is_locked() ) { _e("onclick=\"return false;\" disabled=\"disabled\""); } ?> />
|
| 153 |
<?php _e("No deletion of image metadata", "optimus"); ?>
|
| 154 |
</label>
|
| 155 |
|
| 167 |
<td>
|
| 168 |
<fieldset>
|
| 169 |
<label for="optimus_webp_convert">
|
| 170 |
+
<input type="checkbox" name="optimus[webp_convert]" id="optimus_webp_convert" value="1" <?php checked(1, $options['webp_convert']); if ( Optimus_HQ::is_locked() ) { _e("onclick=\"return false;\" disabled=\"disabled\""); } ?> />
|
| 171 |
<?php _e("Creation of WebP files", "optimus"); ?>
|
| 172 |
</label>
|
| 173 |
|
| 185 |
<td>
|
| 186 |
<fieldset>
|
| 187 |
<label for="optimus_secure_transport">
|
| 188 |
+
<input type="checkbox" name="optimus[secure_transport]" id="optimus_secure_transport" value="1" <?php checked(1, $options['secure_transport']); if ( Optimus_HQ::is_locked() ) { _e("onclick=\"return false;\" disabled=\"disabled\""); } ?> />
|
| 189 |
<?php _e("Transfer images using TLS encryption", "optimus"); ?>
|
| 190 |
</label>
|
| 191 |
|
| 198 |
|
| 199 |
<tr valign="top">
|
| 200 |
<th scope="row">
|
| 201 |
+
<?php _e("Manual optimization", "optimus"); ?>
|
| 202 |
</th>
|
| 203 |
<td>
|
| 204 |
<fieldset>
|
optimus.php
CHANGED
|
@@ -7,7 +7,7 @@ Author: KeyCDN
|
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
Plugin URI: https://optimus.io
|
| 9 |
License: GPLv2 or later
|
| 10 |
-
Version: 1.
|
| 11 |
*/
|
| 12 |
|
| 13 |
/*
|
|
@@ -100,6 +100,20 @@ register_activation_hook(
|
|
| 100 |
/* Autoload Init */
|
| 101 |
spl_autoload_register('optimus_autoload');
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
/* Autoload Funktion */
|
| 104 |
function optimus_autoload($class) {
|
| 105 |
if ( in_array($class, array('Optimus', 'Optimus_HQ', 'Optimus_Management', 'Optimus_Settings', 'Optimus_Media', 'Optimus_Request')) ) {
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
Plugin URI: https://optimus.io
|
| 9 |
License: GPLv2 or later
|
| 10 |
+
Version: 1.5.0
|
| 11 |
*/
|
| 12 |
|
| 13 |
/*
|
| 100 |
/* Autoload Init */
|
| 101 |
spl_autoload_register('optimus_autoload');
|
| 102 |
|
| 103 |
+
/* Check if manual optimization is enabled, hook in if not */
|
| 104 |
+
$options = Optimus::get_options();
|
| 105 |
+
|
| 106 |
+
if ( ! $options['manual_optimize'] ) {
|
| 107 |
+
add_action('wp_generate_attachment_metadata',
|
| 108 |
+
array(
|
| 109 |
+
'Optimus_Request',
|
| 110 |
+
'optimize_upload_images',
|
| 111 |
+
),
|
| 112 |
+
10,
|
| 113 |
+
2
|
| 114 |
+
);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
/* Autoload Funktion */
|
| 118 |
function optimus_autoload($class) {
|
| 119 |
if ( in_array($class, array('Optimus', 'Optimus_HQ', 'Optimus_Management', 'Optimus_Settings', 'Optimus_Media', 'Optimus_Request')) ) {
|
readme.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
Contributors: keycdn
|
| 3 |
Tags: images, optimize, compress, progressive, performance, png, jpeg, webp, image optimizer, wordpress image optimizer, optimize image, optimize jpg, optimize jpeg, optimize png, compress image, progressive jpeg, progressive jpg
|
| 4 |
Requires at least: 4.6
|
| 5 |
-
Tested up to: 4.
|
| 6 |
Stable tag: trunk
|
| 7 |
License: GPLv2 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
@@ -88,6 +88,13 @@ Optimus supports the conversion of images to the new [*WebP* image format](https
|
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
= 1.4.9 =
|
| 92 |
* Formatting updates
|
| 93 |
|
|
@@ -132,24 +139,19 @@ Optimus supports the conversion of images to the new [*WebP* image format](https
|
|
| 132 |
= 1.3.6 =
|
| 133 |
* Neue Option: Keine Optimierung der Originalbilder
|
| 134 |
* Korrektur: Löschung der WebP-Bilder im AJAX-Modus
|
| 135 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/hWjiVYht9yF)
|
| 136 |
|
| 137 |
= 1.3.5 =
|
| 138 |
* Erhöhung des Limits für PNG-Dateien auf 512 KB (Optimus HQ)
|
| 139 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/EUA797D8aYS)
|
| 140 |
|
| 141 |
= 1.3.4 =
|
| 142 |
* Umstellung des Plugins auf die neue Optimus API (cURL only)
|
| 143 |
-
* [Ausführlich auf Google+](https://plus.google.com/114450218898660299759/posts/GYrUK4YeXvU)
|
| 144 |
|
| 145 |
= 1.3.3 =
|
| 146 |
* Kompatibilität zu WooCommerce
|
| 147 |
* Einführung von Optimus HQ PRO
|
| 148 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/iNDtLhWw4p2)
|
| 149 |
|
| 150 |
= 1.3.2 =
|
| 151 |
* Anzeige der in WordPress registrierten Bildgrößen (Thumbnails)
|
| 152 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/jZVfeac5eHW)
|
| 153 |
|
| 154 |
= 1.3.1 =
|
| 155 |
* Anpassung für WordPress 3.9: Sicherstellung der Bildoptimierung im WordPress-Editor
|
|
@@ -166,7 +168,6 @@ Optimus supports the conversion of images to the new [*WebP* image format](https
|
|
| 166 |
= 1.2.0 =
|
| 167 |
* Optimierungen am Plugin-Rechtemanagement
|
| 168 |
* Überarbeitung der Plugin-Hinweise
|
| 169 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/2eynLwEsedi)
|
| 170 |
|
| 171 |
= 1.1.9 =
|
| 172 |
* Optimus HQ: Umbau der Lizenzverifizierung wegen einem [Bug](https://www.google.de/search?q=w3+total+cache+transient) im W3 Total Cache Plugin
|
|
@@ -175,7 +176,6 @@ Optimus supports the conversion of images to the new [*WebP* image format](https
|
|
| 175 |
= 1.1.8 =
|
| 176 |
* Anzeige des Optimus HQ Ablaufdatums
|
| 177 |
* Admin-Hinweis bei abgelaufener Optimus HQ Lizenz
|
| 178 |
-
* [Ausführlich auf Google+](https://plus.google.com/b/114450218898660299759/114450218898660299759/posts/9UGqj6UPjLv)
|
| 179 |
|
| 180 |
= 1.1.7 =
|
| 181 |
* Christmas-Edition (Code- & Performance-Optimierungen)
|
|
@@ -187,24 +187,23 @@ Optimus supports the conversion of images to the new [*WebP* image format](https
|
|
| 187 |
* Optimus HQ: Eingabe eines neuen Lizenzschlüssels möglich
|
| 188 |
* Selbstprüfung auf Erreichbarkeit der Upload-Bilder (Zugriffsschutz, etc.)
|
| 189 |
* Performance-Optimierungen
|
| 190 |
-
* [Ausführlich auf Google+](https://plus.google.com/114450218898660299759/posts/6nyJ3kPnFPu)
|
| 191 |
|
| 192 |
= 1.1.4 =
|
| 193 |
* Optimus HQ: Erhöhung des Limits für PNGs auf 200 KB
|
| 194 |
-
* Optimus HQ: Konvertierung der Bilder ins
|
| 195 |
|
| 196 |
= 1.1.3 =
|
| 197 |
-
* Unterstützung für WordPress Apps und Windows Live Writer
|
| 198 |
|
| 199 |
= 1.1.2 =
|
| 200 |
-
* Option: Bild-Metadaten nicht entfernen
|
| 201 |
|
| 202 |
= 1.1.1 =
|
| 203 |
* Interne Umstellung auf Mime-Type
|
| 204 |
* Code-Optimierungen
|
| 205 |
|
| 206 |
= 1.1.0 =
|
| 207 |
-
* Umstellung auf Freemium Modell
|
| 208 |
* Plugin Website: [optimus.io](https://optimus.io)
|
| 209 |
|
| 210 |
= 1.0.0 =
|
| 2 |
Contributors: keycdn
|
| 3 |
Tags: images, optimize, compress, progressive, performance, png, jpeg, webp, image optimizer, wordpress image optimizer, optimize image, optimize jpg, optimize jpeg, optimize png, compress image, progressive jpeg, progressive jpg
|
| 4 |
Requires at least: 4.6
|
| 5 |
+
Tested up to: 4.9
|
| 6 |
Stable tag: trunk
|
| 7 |
License: GPLv2 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
| 91 |
+
= 1.5.0 =
|
| 92 |
+
* Unsupported image types are now gracefully skipped
|
| 93 |
+
* Renamed setting names and greyed out inapplicable settings to avoid confusion
|
| 94 |
+
* Increased size limit for Optimus HQ to 10MB
|
| 95 |
+
* Licences can now easily be extended
|
| 96 |
+
* Optimize images uploaded through the REST API
|
| 97 |
+
|
| 98 |
= 1.4.9 =
|
| 99 |
* Formatting updates
|
| 100 |
|
| 139 |
= 1.3.6 =
|
| 140 |
* Neue Option: Keine Optimierung der Originalbilder
|
| 141 |
* Korrektur: Löschung der WebP-Bilder im AJAX-Modus
|
|
|
|
| 142 |
|
| 143 |
= 1.3.5 =
|
| 144 |
* Erhöhung des Limits für PNG-Dateien auf 512 KB (Optimus HQ)
|
|
|
|
| 145 |
|
| 146 |
= 1.3.4 =
|
| 147 |
* Umstellung des Plugins auf die neue Optimus API (cURL only)
|
|
|
|
| 148 |
|
| 149 |
= 1.3.3 =
|
| 150 |
* Kompatibilität zu WooCommerce
|
| 151 |
* Einführung von Optimus HQ PRO
|
|
|
|
| 152 |
|
| 153 |
= 1.3.2 =
|
| 154 |
* Anzeige der in WordPress registrierten Bildgrößen (Thumbnails)
|
|
|
|
| 155 |
|
| 156 |
= 1.3.1 =
|
| 157 |
* Anpassung für WordPress 3.9: Sicherstellung der Bildoptimierung im WordPress-Editor
|
| 168 |
= 1.2.0 =
|
| 169 |
* Optimierungen am Plugin-Rechtemanagement
|
| 170 |
* Überarbeitung der Plugin-Hinweise
|
|
|
|
| 171 |
|
| 172 |
= 1.1.9 =
|
| 173 |
* Optimus HQ: Umbau der Lizenzverifizierung wegen einem [Bug](https://www.google.de/search?q=w3+total+cache+transient) im W3 Total Cache Plugin
|
| 176 |
= 1.1.8 =
|
| 177 |
* Anzeige des Optimus HQ Ablaufdatums
|
| 178 |
* Admin-Hinweis bei abgelaufener Optimus HQ Lizenz
|
|
|
|
| 179 |
|
| 180 |
= 1.1.7 =
|
| 181 |
* Christmas-Edition (Code- & Performance-Optimierungen)
|
| 187 |
* Optimus HQ: Eingabe eines neuen Lizenzschlüssels möglich
|
| 188 |
* Selbstprüfung auf Erreichbarkeit der Upload-Bilder (Zugriffsschutz, etc.)
|
| 189 |
* Performance-Optimierungen
|
|
|
|
| 190 |
|
| 191 |
= 1.1.4 =
|
| 192 |
* Optimus HQ: Erhöhung des Limits für PNGs auf 200 KB
|
| 193 |
+
* Optimus HQ: Konvertierung der Bilder ins WebP-Format
|
| 194 |
|
| 195 |
= 1.1.3 =
|
| 196 |
+
* Unterstützung für WordPress Apps und Windows Live Writer
|
| 197 |
|
| 198 |
= 1.1.2 =
|
| 199 |
+
* Option: Bild-Metadaten nicht entfernen
|
| 200 |
|
| 201 |
= 1.1.1 =
|
| 202 |
* Interne Umstellung auf Mime-Type
|
| 203 |
* Code-Optimierungen
|
| 204 |
|
| 205 |
= 1.1.0 =
|
| 206 |
+
* Umstellung auf Freemium Modell
|
| 207 |
* Plugin Website: [optimus.io](https://optimus.io)
|
| 208 |
|
| 209 |
= 1.0.0 =
|
