-
-
Notifications
You must be signed in to change notification settings - Fork 402
增加Lsky Pro V2支持 #1325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
增加Lsky Pro V2支持 #1325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Lsky Pro V2 API alongside the existing V1 support for image uploads in comments. The changes allow users to configure which API version to use and provide necessary V2-specific configuration options.
- Adds API version selection with dropdown for V1/V2 choice
- Implements V2 API upload functionality with different endpoint and parameters
- Adds Storage ID configuration field required for V2 API
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
opt/options/theme-options.php | Adds configuration options for API version selection and V2 Storage ID |
inc/classes/Images.php | Implements V2 API upload method and routing logic between V1/V2 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* LSky Pro upload interface | ||
*/ | ||
public function LSKY_API($image) { | ||
if ($this->lsky_api_version == 'v1') { |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case mismatch in version comparison. The configuration options use uppercase 'V1' and 'V2', but this comparison uses lowercase 'v1'. This will cause V1 API calls to incorrectly route to V2.
if ($this->lsky_api_version == 'v1') { | |
if (strtoupper($this->lsky_api_version) == 'V1') { |
Copilot uses AI. Check for mistakes.
'link' => $link, | ||
'proxy' => $proxy, | ||
); | ||
error_log("LSKY API Response:\n" . print_r($output, true)); |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug logging should not be left in production code. This error_log statement should be removed or wrapped in a debug flag check.
error_log("LSKY API Response:\n" . print_r($output, true)); | |
if (defined('WP_DEBUG') && WP_DEBUG) { | |
error_log("LSKY API Response:\n" . print_r($output, true)); | |
} |
Copilot uses AI. Check for mistakes.
error_log("LSKY API Response:\n" . print_r($output, true)); | ||
return $output; | ||
|
||
|
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Unnecessary blank lines should be removed to maintain consistent code formatting.
Copilot uses AI. Check for mistakes.
评论区上传图片到Lsky Pro v2