Skip to content

Commit

Permalink
4.8.6
Browse files Browse the repository at this point in the history
BETA
  • Loading branch information
xiaomac committed Dec 30, 2019
1 parent 8cf7ea1 commit d783748
Show file tree
Hide file tree
Showing 16 changed files with 242 additions and 190 deletions.
Binary file modified lang/oss-upload-zh_CN.mo
Binary file not shown.
197 changes: 106 additions & 91 deletions lang/oss-upload-zh_CN.po

Large diffs are not rendered by default.

Binary file modified lang/oss-upload.mo
Binary file not shown.
197 changes: 106 additions & 91 deletions lang/oss-upload.po

Large diffs are not rendered by default.

Empty file modified lib/OSS.php
100644 → 100755
Empty file.
Empty file modified lib/OSSWrapper.php
100644 → 100755
Empty file.
Empty file modified lib/lazyload.js
100644 → 100755
Empty file.
Empty file modified lib/mimetypes.class.php
100644 → 100755
Empty file.
Empty file modified lib/oss-php-sdk.md
100644 → 100755
Empty file.
Empty file modified lib/oss_util.class.php
100644 → 100755
Empty file.
Empty file modified lib/requestcore.class.README.md
100644 → 100755
Empty file.
Empty file modified lib/requestcore.class.php
100644 → 100755
Empty file.
Empty file modified lib/xml2array.class.php
100644 → 100755
Empty file.
Empty file modified lib/zh.inc.php
100644 → 100755
Empty file.
33 changes: 26 additions & 7 deletions oss-upload.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Plugin Name: OSS Upload
* Version: 4.8.5
* Version: 4.8.6
* Description: Upload with Aliyun OSS, with modified OSS Wrapper and fully native image edit function support.
* Plugin URI: https://www.xiaomac.com/oss-upload.html
* Author: Link
Expand Down Expand Up @@ -172,10 +172,8 @@ function oss_upload_after_setup_theme(){
function oss_upload_admin_init() {
register_setting('oss_upload_admin_options_group', 'ouop');
if(!ouops('oss')) return;
if(isset($_GET['page'], $_GET['action']) && $_GET['page'] == 'oss-upload'){
oss_upload_admin_action();
}
add_filter('big_image_size_threshold', '__return_false');//kiss my ass...
if(isset($_GET['page'], $_GET['action']) && $_GET['page'] == 'oss-upload') oss_upload_admin_action();
if(ouops('oss_hd_thumbnail')) add_filter('big_image_size_threshold', '__return_false');
add_filter('wp_privacy_exports_dir', 'oss_upload_privacy_exports_dir');
add_filter('wp_privacy_exports_url', 'oss_upload_privacy_exports_url');
}
Expand Down Expand Up @@ -396,6 +394,20 @@ function oss_upload_image_srcset($sources, $size, $image_src, $meta, $id){//wp_g
return $sources;
}

add_filter('intermediate_image_sizes', 'oss_upload_intermediate_sizes', 999);
function oss_upload_intermediate_sizes($sizes){
if(!ouops('oss_hd_thumbnail')) return $sizes;
return array_merge(array_diff($sizes, array('1536x1536', '2048x2048')));
}

add_filter('intermediate_image_sizes_advanced', 'oss_upload_intermediate_sizes_advanced', 999);
function oss_upload_intermediate_sizes_advanced($sizes){
if(!ouops('oss_hd_thumbnail')) return $sizes;
unset($sizes['1536x1536']);
unset($sizes['2048x2048']);
return $sizes;
}

add_filter('wp_get_attachment_url', 'oss_upload_attachment_url', 9999, 2);
function oss_upload_attachment_url($url, $id){
if(!ouops('oss') || !ouops('oss_url')) return $url;
Expand Down Expand Up @@ -663,8 +675,8 @@ function oss_upload_admin_action(){
wp_update_attachment_metadata($file->ID, $metadata);
echo $index++.". {$file->ID} {$img} {$postfix}<br/>\n";
flush();
echo '<br/><hr/>';
}
echo '<br/><hr/>';
echo __('Reset attachments metadata done','oss-upload');
}
flush();
Expand Down Expand Up @@ -770,7 +782,7 @@ function oss_upload_options_page(){
<tr valign="top">
<th scope="row"><?php _e('Thumbnail Quality', 'oss-upload')?></th>
<td>
<p><label><input type="number" name="ouop[oss_quality]" size="10" min="1" max="99" value="<?php echo ouops('oss_quality')?>" /></label></p>
<p><label><input type="number" name="ouop[oss_quality]" size="10" min="1" max="99" placeholder="15" value="<?php echo ouops('oss_quality')?>" /></label></p>
<p <?php oss_upload_show_more('oss_upload_desc'); ?>><small><?php _e('Set the quality of thumbnail for OSS Image Servie to speed up image loading, the smaller the faster', 'oss-upload');?>: <code>1 ~ 99</code></small></p>
</td></tr>
<tr valign="top">
Expand All @@ -783,6 +795,13 @@ function oss_upload_options_page(){
<p <?php oss_upload_show_more('oss_upload_desc'); ?>><small><?php _e('Set the featured image dimensions when thumbnails enabled (width x height)', 'oss-upload');?>: <code>800</code> x <code>450</code></small></p>
</td></tr>
<tr valign="top">
<th scope="row"><?php _e('HD Thumbnails', 'oss-upload')?></th>
<td>
<p><label><input name="ouop[oss_hd_thumbnail]" type="checkbox" value="1" <?php checked(ouops('oss_hd_thumbnail'),1);?> />
<?php _e('Disable <code>1356x1356</code>,<code>2048x2048</code> sizes when generate thumbnails','oss-upload')?></label></p>
<p <?php oss_upload_show_more('oss_upload_desc'); ?>><small><?php _e('Disable the whole high definition resolution things come with WordPress 5.3', 'oss-upload');?></small></p>
</td></tr>
<tr valign="top">
<th scope="row"><?php _e('Style Separator', 'oss-upload')?></th>
<td>
<p><label><input type="text" name="ouop[oss_style_separator]" size="60" value="<?php echo ouops('oss_style_separator')?>" /> <?php echo oss_upload_link('//help.aliyun.com/document_detail/48884.html', '?', 'blank'); ?></label></p>
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: Link
Donate link: https://www.xiaomac.com/about
Tags: aliyun, oss, upload, media, files, storage, cloud, 阿里云, 媒体库, 图片, 上传, 云存储
Tested up to: 5.3.2
Stable tag: 4.8.5
Stable tag: 4.8.6

== Description ==

Expand Down Expand Up @@ -45,6 +45,9 @@ None

== Changelog ==

= 4.8.6 =
* 支持禁用高清分辨率的缩略图相关

= 4.8.5 =
* 优化目录上传等功能支持重复执行
* 修复图片服务参数没编码引起的异常
Expand Down

0 comments on commit d783748

Please sign in to comment.