|
3 | 3 | Plugin Name: Sync QCloud COS |
4 | 4 | Plugin URI: https://qq52o.me/2518.html |
5 | 5 | Description: 使用腾讯云对象存储服务 COS 作为附件存储空间。(Using Tencent Cloud Object Storage Service COS as Attachment Storage Space.) |
6 | | -Version: 2.6.2 |
| 6 | +Version: 2.6.3 |
7 | 7 | Author: 沈唁 |
8 | 8 | Author URI: https://qq52o.me |
9 | 9 | License: Apache2.0 |
|
27 | 27 | use SyncQcloudCos\Monitor\DataPoints; |
28 | 28 | use SyncQcloudCos\Object\Head; |
29 | 29 |
|
30 | | -define('COS_VERSION', '2.6.2'); |
| 30 | +define('COS_VERSION', '2.6.3'); |
31 | 31 | define('COS_PLUGIN_SLUG', 'sync-qcloud-cos'); |
32 | 32 | define('COS_PLUGIN_PAGE', plugin_basename(dirname(__FILE__)) . '%2F' . basename(__FILE__)); |
33 | 33 |
|
@@ -131,12 +131,11 @@ function cos_check_bucket($cos_options) |
131 | 131 | } elseif ($errorCode == ErrorCode::ACCESS_DENIED) { |
132 | 132 | $message = '<code>SecretID</code> 或 <code>SecretKey</code> 有误,请检查配置信息!'; |
133 | 133 | } |
134 | | - echo "<div class='error'><p><strong>{$message}</strong></p></div>"; |
135 | 134 | } catch (\Throwable $e) { |
136 | 135 | $message = (string)$e; |
137 | | - echo "<div class='error'><p><strong>{$message}</strong></p></div>"; |
138 | 136 | } |
139 | 137 |
|
| 138 | + echo "<div class='error'><p><strong>{$message}</strong></p></div>"; |
140 | 139 | return false; |
141 | 140 | } |
142 | 141 |
|
@@ -561,14 +560,14 @@ function cos_delete_remote_attachment($post_id) |
561 | 560 | add_action('delete_attachment', 'cos_delete_remote_attachment'); |
562 | 561 |
|
563 | 562 | // 当upload_path为根目录时,需要移除URL中出现的“绝对路径” |
564 | | -function cos_modefiy_img_url($url, $post_id) |
| 563 | +function cos_modify_img_url($url, $post_id) |
565 | 564 | { |
566 | 565 | // 移除 ./ 和 项目根路径 |
567 | 566 | return str_replace(['./', get_home_path()], '', $url); |
568 | 567 | } |
569 | 568 |
|
570 | 569 | if (cos_get_option('upload_path') == '.') { |
571 | | - add_filter('wp_get_attachment_url', 'cos_modefiy_img_url', 30, 2); |
| 570 | + add_filter('wp_get_attachment_url', 'cos_modify_img_url', 30, 2); |
572 | 571 | } |
573 | 572 |
|
574 | 573 | function cos_sanitize_file_name($filename) |
@@ -938,7 +937,7 @@ function cos_sync_setting_form($cos_options) |
938 | 937 | <input type="hidden" name="type" value="qcloud_cos_all"> |
939 | 938 | <td> |
940 | 939 | <input type="submit" class="button button-secondary" value="开始同步"/> |
941 | | - <p><b>注意:如果是首次同步,执行时间将会非常长(根据你的历史附件数量),有可能会因为执行时间过长,导致页面显示超时或者报错。<br> 所以,建议附件数量过多的用户,直接使用官方的<a target="_blank" rel="nofollow" href="https://cloud.tencent.com/document/product/436/63143">COSCLI 工具</a>进行迁移,具体可参考<a target="_blank" rel="nofollow" href="https://qq52o.me/2809.html">使用 COSCLI 快速迁移本地数据到 COS</a></b></p> |
| 940 | + <p><b>注意:如果是首次同步,执行时间将会非常长(根据你的历史附件数量),有可能会因为执行时间过长,导致页面显示超时或者报错。<br> 所以建议附件数量过多的用户,直接使用官方的<a target="_blank" rel="nofollow" href="https://cloud.tencent.com/document/product/436/63143">COSCLI 工具</a>进行迁移,具体可参考<a target="_blank" rel="nofollow" href="https://qq52o.me/2809.html">使用 COSCLI 快速迁移本地数据到 COS</a></b></p> |
942 | 941 | </td> |
943 | 942 | </tr> |
944 | 943 | </table> |
@@ -1104,7 +1103,7 @@ function cos_ci_image_slim_page($options) |
1104 | 1103 | <input type="checkbox" name="ci_image_slim_mode[]" value="API" {$checked_mode_api} /> |
1105 | 1104 | <span class="slider round"></span> |
1106 | 1105 | </label> |
1107 | | - <p>开通极智压缩的 API 使用方式,开通后可在图片时通过极智压缩参数(需要配置配置图片处理样式<code>?imageSlim</code>)对图片进行压缩;</p> |
| 1106 | + <p>开通极智压缩的 API 使用方式,开通后可在图片时通过极智压缩参数(需要配置图片处理样式<code>?imageSlim</code>)对图片进行压缩;</p> |
1108 | 1107 | </td> |
1109 | 1108 | </tr> |
1110 | 1109 | <tr> |
@@ -1383,7 +1382,7 @@ function cos_document_page($options) |
1383 | 1382 | } |
1384 | 1383 |
|
1385 | 1384 | $disableSubmit = !$status ? 'disabled=disabled' : ''; |
1386 | | - $disableMessage = !$status ? "<p>如需使用请先访问 <a href='https://console.cloud.tencent.com/ci/bucket?bucket={$bucket}®ion={$options['regional']}&type=document' target='_blank'>腾讯云控制台</a>开启。</p>" : ''; |
| 1385 | + $disableMessage = !$status ? "<p>如需使用请先访问 <a href='https://console.cloud.tencent.com/ci/bucket?bucket={$bucket}®ion={$options['regional']}&type=document' target='_blank'>腾讯云控制台</a> 开启。</p>" : ''; |
1387 | 1386 |
|
1388 | 1387 | return <<<EOF |
1389 | 1388 | <form method="post"> |
|
0 commit comments