update version to 1.1.1

pull/6/head v1.1.1
sy-records 2020-04-16 09:22:50 +08:00
parent 6580bc31ee
commit 57ef61d5ab
3 changed files with 25 additions and 6 deletions

View File

@ -39,6 +39,13 @@ Github 下载节点:[https://github.com/sy-records/aliyun-oss-wordpress/releas
因为Bucket是2019年9月23日后创建的使用默认域名时会自动下载需要绑定自有域名访问。具体参考[阿里云文档](https://help.aliyun.com/document_detail/142631.html)。
* 如果存在第三方插件或者主题自带上传功能,内容上传到`本地文件夹`(即默认`wp-content/uploads`)中怎么上传到oss中
解决方案有两种,推荐使用第二种。
一是修改第三方插件或者主题的上传功能,调用插件的`oss_file_upload`方法(不推荐,一般人不会修改)
二是使用对象存储OSS提供的回源功能配置为镜像方式。如果配置了镜像回源当用户对该存储空间内一个不存在的文件进行GET操作时OSS会向回源地址请求这个文件返回给用户同时会将该文件存入OSS。这样就达到了上传到OSS的需求。具体配置参考阿里云文档[设置回源规则](https://help.aliyun.com/document_detail/31906.html)
## 插件截图
![设置页面](screenshot-1.png)

View File

@ -3,7 +3,7 @@
Plugin Name: OSS Aliyun
Plugin URI: https://github.com/sy-records/aliyun-oss-wordpress
Description: 使用阿里云对象存储 OSS 作为附件存储空间。This is a plugin that uses Aliyun Object Storage Service for attachments remote saving.
Version: 1.1.0
Version: 1.1.1
Author: 沈唁
Author URI: https://qq52o.me
License: Apache 2.0
@ -14,7 +14,7 @@ require_once 'sdk/vendor/autoload.php';
use OSS\OssClient;
use OSS\Core\OssException;
define('OSS_VERSION', "1.1.0");
define('OSS_VERSION', "1.1.1");
define('OSS_BASEFOLDER', plugin_basename(dirname(__FILE__)));
// 初始化选项
@ -196,16 +196,16 @@ function oss_upload_thumbs($metadata)
//获取上传路径
$wp_uploads = wp_upload_dir();
$basedir = $wp_uploads['basedir'];
//获取oss插件的配置信息
$oss_options = get_option('oss_options', true);
if (isset($metadata['file'])) {
// Maybe there is a problem with the old version
$object ='/' . get_option('upload_path') . '/' . $metadata['file'];
$file = $basedir . '/' . $metadata['file'];
oss_file_upload($object, $file, oss_is_delete_local_file());
oss_file_upload($object, $file, (esc_attr($oss_options['nolocalsaving']) == 'true'));
}
//上传所有缩略图
if (isset($metadata['sizes']) && count($metadata['sizes']) > 0) {
//获取oss插件的配置信息
$oss_options = get_option('oss_options', true);
//是否需要上传缩略图
$nothumb = (esc_attr($oss_options['nothumb']) == 'true');
//如果禁止上传缩略图,就不用继续执行了

View File

@ -5,7 +5,7 @@ Tags: oss, 阿里云, 对象存储, aliyun
Requires at least: 4.2
Tested up to: 5.4
Requires PHP: 5.6.0
Stable tag: 1.1.0
Stable tag: 1.1.1
License: Apache 2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0.html
@ -61,8 +61,20 @@ License URI: http://www.apache.org/licenses/LICENSE-2.0.html
因为Bucket是2019年9月23日后创建的使用默认域名时会自动下载需要绑定自有域名访问。具体参考[阿里云文档](https://help.aliyun.com/document_detail/142631.html)。
= 如果存在第三方插件或者主题自带上传功能,内容上传到本地文件夹(即默认wp-content/uploads)中怎么上传到OSS中 =
解决方案有两种,推荐使用第二种。
一是修改第三方插件或者主题的上传功能,调用插件的`oss_file_upload`方法(不推荐,一般人不会修改)
二是使用对象存储OSS提供的回源功能配置为镜像方式。如果配置了镜像回源当用户对该存储空间内一个不存在的文件进行GET操作时OSS会向回源地址请求这个文件返回给用户同时会将该文件存入OSS。这样就达到了上传到OSS的需求。具体配置参考阿里云文档[设置回源规则](https://help.aliyun.com/document_detail/31906.html)
== Changelog ==
= 1.1.1 =
* 修复本地文件夹为根目录时路径错误
* 减少一次获取配置代码...
* 增加回源说明
= 1.1.0 =
* 优化删除文件使用删除多个接口
* 修复勾选不在本地保存图片后媒体库显示默认图片问题