From 6fd8b5f03c3c2f31979f723db712c5cf3b10a8a6 Mon Sep 17 00:00:00 2001 From: jerryzwu Date: Mon, 14 Dec 2020 13:09:38 +0800 Subject: [PATCH] support windows --- README.md | 8 +++-- .../TencentWordPressIMSActions.php | 29 +++------------ .../TencentWordpressIMSSettingPage.php | 3 +- .../TencentWordpressPluginsSettingActions.php | 35 ++++++++----------- tencentcloud-ims/common/common.json | 2 +- tencentcloud-ims/readme.txt | 11 ++++-- tencentcloud-ims/tencentcloud-ims.php | 12 +++---- 7 files changed, 40 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index bffa620..f6af945 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ | ---------- | ------------------------------------------------------------ | | 中文名称 | 腾讯云图片内容安全(IMS)插件 | | 英文名称 | tencentcloud-ims | -| 最新版本 | v1.0.0 (2020.06.22) | +| 最新版本 | v1.0.1 (2020.12.11) | | 适用平台 | [WordPress](https://wordpress.org/) | | 适用产品 | [腾讯云图片内容安全(IMS)](https://cloud.tencent.com/product/ims) | | 文档中心 | [春雨文档中心](https://openapp.qq.com/docs/Wordpress/ims.html) | @@ -65,9 +65,11 @@ ## 7.GitHub版本迭代记录 -### 7.1 tencentcloud-wordpress-plugin-ims v1.0.0 -- 对用户在媒体库上传、通过URL插入的图片使用腾讯云图片内容安全接口进行内容检测和过滤 +### 2020.12.11 tencentcloud-wordpress-plugin-ims v1.0.1 +- 支持在windows环境下运行 +### 2020.6.22 tencentcloud-wordpress-plugin-ims v1.0.0 +- 对用户在媒体库上传、通过URL插入的图片使用腾讯云图片内容安全接口进行内容检测和过滤 --- 本项目由腾讯云中小企业产品中心建设和维护,了解与该插件使用相关的更多信息,请访问[春雨文档中心](https://openapp.qq.com/docs/Wordpress/ims.html) diff --git a/tencentcloud-ims/TencentWordPressIMSActions.php b/tencentcloud-ims/TencentWordPressIMSActions.php index d706293..5e779fe 100644 --- a/tencentcloud-ims/TencentWordPressIMSActions.php +++ b/tencentcloud-ims/TencentWordPressIMSActions.php @@ -113,30 +113,9 @@ class TencentWordPressIMSActions $staticData['data']['site_id'] = TencentWordpressPluginsSettingActions::getWordPressSiteID(); $staticData['data']['site_url'] = TencentWordpressPluginsSettingActions::getWordPressSiteUrl(); $staticData['data']['site_app'] = TencentWordpressPluginsSettingActions::getWordPressSiteApp(); - $commonOption = get_option(TENCENT_WORDPRESS_COMMON_OPTIONS); - if (!empty($commonOption)) { - $staticData['data']['site_report_on'] = intval($commonOption['site_report_on']); - $staticData['data']['site_sec_on'] = intval($commonOption['site_sec_on']); - if ($commonOption['site_report_on'] === true && isset($commonOption['secret_id']) && isset($commonOption['secret_key'])) { - $staticData['data']['site_global_uin'] = TencentWordpressPluginsSettingActions::getUserUinBySecret($commonOption['secret_id'], $commonOption['secret_key']); - } - } - $IMSOptions = self::getIMSOptionsObject(); - if ($IMSOptions->getCustomKey() === $IMSOptions::CUSTOM_KEY) { - $staticData['data']['ims_uin'] = TencentWordpressPluginsSettingActions::getUserUinBySecret($IMSOptions->getSecretID(), $IMSOptions->getSecretKey()); - } - $staticData['data']['ims_sec_on'] = $IMSOptions->getCustomKey(); - switch ($action){ - case 'activate': - case 'save_configuration': - $staticData['data']['ims_on_at'] = time(); - break; - case 'deactivate': - case 'uninstall': - $staticData['data']['ims_off_at'] = time(); - break; - } + $staticData['data']['uin'] = TencentWordpressPluginsSettingActions::getUserUinBySecret($IMSOptions->getSecretID(), $IMSOptions->getSecretKey()); + $staticData['data']['cust_sec_on'] = $IMSOptions->getCustomKey() === $IMSOptions::CUSTOM_KEY ?1:2; return $staticData; } @@ -285,7 +264,7 @@ class TencentWordPressIMSActions { //只在后台配置页引入 if (strpos($hookSuffix,'page_TencentWordpressIMSSettingPage') !== false){ - wp_register_style('IMS_back_admin_css', TENCENT_WORDPRESS_TMS_CSS_DIR . 'bootstrap.min.css'); + wp_register_style('IMS_back_admin_css', TENCENT_WORDPRESS_IMS_CSS_DIR . 'bootstrap.min.css'); wp_enqueue_style('IMS_back_admin_css'); } } @@ -317,7 +296,7 @@ class TencentWordPressIMSActions $IMSOptions->setSecretKey($this->filterPostParam('secretKey')); $IMSOptions->setCheckUrlImg($this->filterPostParam('checkUrlImg',$IMSOptions::DO_NOT_CHECK)); self::requirePluginCenterClass(); - $staticData = self::getTencentCloudWordPressStaticData('save_configuration'); + $staticData = self::getTencentCloudWordPressStaticData('save_config'); TencentWordpressPluginsSettingActions::sendUserExperienceInfo($staticData); update_option(TENCENT_WORDPRESS_IMS_OPTIONS,$IMSOptions,true); wp_send_json_success(array('msg'=>'保存成功')); diff --git a/tencentcloud-ims/TencentWordpressIMSSettingPage.php b/tencentcloud-ims/TencentWordpressIMSSettingPage.php index 014b316..5c41e4f 100644 --- a/tencentcloud-ims/TencentWordpressIMSSettingPage.php +++ b/tencentcloud-ims/TencentWordpressIMSSettingPage.php @@ -26,7 +26,6 @@ function TencentWordpressIMSSettingPage() $customKey = $IMSOptions->getCustomKey(); ?> -