Changeset 3262393
- Timestamp:
- 03/26/2025 07:00:21 PM (12 months ago)
- Location:
- seowriting
- Files:
-
- 3 edited
- 6 copied
-
tags/1.10.7 (copied) (copied from seowriting/trunk)
-
tags/1.10.7/assets/css/admin.css (copied) (copied from seowriting/trunk/assets/css/admin.css)
-
tags/1.10.7/classes/api-client.php (copied) (copied from seowriting/trunk/classes/api-client.php) (7 diffs)
-
tags/1.10.7/classes/settings-form.php (copied) (copied from seowriting/trunk/classes/settings-form.php)
-
tags/1.10.7/readme.txt (copied) (copied from seowriting/trunk/readme.txt) (2 diffs)
-
tags/1.10.7/seowriting.php (copied) (copied from seowriting/trunk/seowriting.php) (3 diffs)
-
trunk/classes/api-client.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/seowriting.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seowriting/tags/1.10.7/classes/api-client.php
r3262293 r3262393 21 21 public $error = ''; 22 22 23 const MAX_IMAGE_SIZE_KB = 1024;24 23 const MAX_FILENAME_LENGTH = 100; 25 24 … … 200 199 public function loadImage($url, $filename = '') 201 200 { 202 $settings = $this->plugin->getSettings();203 204 201 $args = [ 205 'headers' => [206 'API-Auth' => $settings['api_key']207 ],208 202 'timeout' => $this->http_timeout, 209 203 'sslverify' => $this->ssl_verify, … … 217 211 } elseif (wp_remote_retrieve_response_code($response) === 200) { 218 212 $content_type = wp_remote_retrieve_header($response, 'content-type'); 213 if (is_array($content_type)) { 214 $content_type = $content_type[0]; 215 } 219 216 $size = wp_remote_retrieve_header($response, 'content-length'); 220 217 if (is_array($size)) { … … 224 221 $mimes = get_allowed_mime_types(); 225 222 226 if ( ($size > 0) && ($size <= (self::MAX_IMAGE_SIZE_KB * 1024))&& in_array($content_type, $mimes)) {223 if ($size > 0 && in_array($content_type, $mimes)) { 227 224 $tmp_name = wp_tempnam(); 228 225 if (@file_put_contents($tmp_name, wp_remote_retrieve_body($response))) { … … 235 232 236 233 if (strlen($filename) > 0) { 237 $ext = substr($name, (int)strrpos($name, '.'));234 $ext = "." . explode("/", $content_type)[1]; 238 235 $max_length = self::MAX_FILENAME_LENGTH - strlen($ext); 239 236 … … 254 251 return [ 255 252 'name' => sanitize_file_name($name), 256 'type' => $ image_size['mime'],253 'type' => $content_type, 257 254 'tmp_name' => $tmp_name, 258 255 'error' => UPLOAD_ERR_OK, … … 264 261 } 265 262 @unlink($tmp_name); 263 } else { 264 $this->error = 'unknown_type='.$content_type; 266 265 } 267 266 } else { -
seowriting/tags/1.10.7/readme.txt
r3262293 r3262393 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.10. 57 Stable tag: 1.10.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.10.7 (2025/03/26) = 26 27 Feature: 28 * The limit on the size of the uploaded image has been removed 24 29 25 30 = 1.10.5 (2025/03/26) = -
seowriting/tags/1.10.7/seowriting.php
r3262293 r3262393 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.10. 511 * Version: 1.10.7 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.10. 5';30 public $version = '1.10.7'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 766 766 } else { 767 767 $this->writeLog([ 768 'type' => 'downloadImages WpError',768 'type' => 'downloadImagesApiError', 769 769 'path' => $path, 770 770 'data' => $api->error, -
seowriting/trunk/classes/api-client.php
r3262293 r3262393 21 21 public $error = ''; 22 22 23 const MAX_IMAGE_SIZE_KB = 1024;24 23 const MAX_FILENAME_LENGTH = 100; 25 24 … … 200 199 public function loadImage($url, $filename = '') 201 200 { 202 $settings = $this->plugin->getSettings();203 204 201 $args = [ 205 'headers' => [206 'API-Auth' => $settings['api_key']207 ],208 202 'timeout' => $this->http_timeout, 209 203 'sslverify' => $this->ssl_verify, … … 217 211 } elseif (wp_remote_retrieve_response_code($response) === 200) { 218 212 $content_type = wp_remote_retrieve_header($response, 'content-type'); 213 if (is_array($content_type)) { 214 $content_type = $content_type[0]; 215 } 219 216 $size = wp_remote_retrieve_header($response, 'content-length'); 220 217 if (is_array($size)) { … … 224 221 $mimes = get_allowed_mime_types(); 225 222 226 if ( ($size > 0) && ($size <= (self::MAX_IMAGE_SIZE_KB * 1024))&& in_array($content_type, $mimes)) {223 if ($size > 0 && in_array($content_type, $mimes)) { 227 224 $tmp_name = wp_tempnam(); 228 225 if (@file_put_contents($tmp_name, wp_remote_retrieve_body($response))) { … … 235 232 236 233 if (strlen($filename) > 0) { 237 $ext = substr($name, (int)strrpos($name, '.'));234 $ext = "." . explode("/", $content_type)[1]; 238 235 $max_length = self::MAX_FILENAME_LENGTH - strlen($ext); 239 236 … … 254 251 return [ 255 252 'name' => sanitize_file_name($name), 256 'type' => $ image_size['mime'],253 'type' => $content_type, 257 254 'tmp_name' => $tmp_name, 258 255 'error' => UPLOAD_ERR_OK, … … 264 261 } 265 262 @unlink($tmp_name); 263 } else { 264 $this->error = 'unknown_type='.$content_type; 266 265 } 267 266 } else { -
seowriting/trunk/readme.txt
r3262293 r3262393 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.10. 57 Stable tag: 1.10.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.10.7 (2025/03/26) = 26 27 Feature: 28 * The limit on the size of the uploaded image has been removed 24 29 25 30 = 1.10.5 (2025/03/26) = -
seowriting/trunk/seowriting.php
r3262293 r3262393 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.10. 511 * Version: 1.10.7 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.10. 5';30 public $version = '1.10.7'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 766 766 } else { 767 767 $this->writeLog([ 768 'type' => 'downloadImages WpError',768 'type' => 'downloadImagesApiError', 769 769 'path' => $path, 770 770 'data' => $api->error,
Note: See TracChangeset
for help on using the changeset viewer.