From 04023f72eb7b96811e67760c902131fec4a7d14e Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Fri, 14 Feb 2025 14:55:03 +0800 Subject: [PATCH] Optimize uninstall code (#49) --- aliyun-oss-wordpress.php | 4 ++-- readme.txt | 6 +++++- uninstall.php | 9 +-------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/aliyun-oss-wordpress.php b/aliyun-oss-wordpress.php index 8d6246b..21836b5 100644 --- a/aliyun-oss-wordpress.php +++ b/aliyun-oss-wordpress.php @@ -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.4.20 +Version: 1.4.21 Author: 沈唁 Author URI: https://qq52o.me License: Apache2.0 @@ -19,7 +19,7 @@ use OSS\Credentials\CredentialsProvider; use AlibabaCloud\Credentials\Credential; use OSS\Credentials\StaticCredentialsProvider; -define('OSS_VERSION', '1.4.20'); +define('OSS_VERSION', '1.4.21'); define('OSS_BASEFOLDER', plugin_basename(dirname(__FILE__))); if (!function_exists('get_home_path')) { diff --git a/readme.txt b/readme.txt index 9ad9a79..8c4b261 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: oss, 阿里云, 对象存储, aliyun Requires at least: 4.6 Tested up to: 6.7 Requires PHP: 7.1 -Stable tag: 1.4.20 +Stable tag: 1.4.21 License: Apache2.0 License URI: http://www.apache.org/licenses/LICENSE-2.0.html @@ -78,6 +78,10 @@ License URI: http://www.apache.org/licenses/LICENSE-2.0.html == Changelog == += 1.4.21 = + +- Optimize uninstall code + = 1.4.20 = - Fix origin_protect default value error diff --git a/uninstall.php b/uninstall.php index 3e26537..9db9f5b 100644 --- a/uninstall.php +++ b/uninstall.php @@ -4,12 +4,5 @@ if (!defined('WP_UNINSTALL_PLUGIN')) { exit; } -$options = get_option('oss_options', true); -$upload_url_path = get_option('upload_url_path'); -$oss_upload_url_path = esc_attr($options['upload_url_path']); - -if ($upload_url_path == $oss_upload_url_path) { - update_option('upload_url_path', ''); -} - +update_option('upload_url_path', ''); delete_option('oss_options');