Plugin Directory

Changeset 3262393


Ignore:
Timestamp:
03/26/2025 07:00:21 PM (12 months ago)
Author:
seowriting
Message:

New version of plugin: 1.10.7

Location:
seowriting
Files:
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • seowriting/tags/1.10.7/classes/api-client.php

    r3262293 r3262393  
    2121    public $error = '';
    2222
    23     const MAX_IMAGE_SIZE_KB = 1024;
    2423    const MAX_FILENAME_LENGTH = 100;
    2524
     
    200199    public function loadImage($url, $filename = '')
    201200    {
    202         $settings = $this->plugin->getSettings();
    203 
    204201        $args = [
    205             'headers' => [
    206                 'API-Auth' => $settings['api_key']
    207             ],
    208202            'timeout' => $this->http_timeout,
    209203            'sslverify' => $this->ssl_verify,
     
    217211        } elseif (wp_remote_retrieve_response_code($response) === 200) {
    218212            $content_type = wp_remote_retrieve_header($response, 'content-type');
     213            if (is_array($content_type)) {
     214                $content_type = $content_type[0];
     215            }
    219216            $size = wp_remote_retrieve_header($response, 'content-length');
    220217            if (is_array($size)) {
     
    224221            $mimes = get_allowed_mime_types();
    225222
    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)) {
    227224                $tmp_name = wp_tempnam();
    228225                if (@file_put_contents($tmp_name, wp_remote_retrieve_body($response))) {
     
    235232
    236233                            if (strlen($filename) > 0) {
    237                                 $ext = substr($name, (int)strrpos($name, '.'));
     234                                $ext = "." . explode("/", $content_type)[1];
    238235                                $max_length = self::MAX_FILENAME_LENGTH - strlen($ext);
    239236
     
    254251                        return [
    255252                            'name' => sanitize_file_name($name),
    256                             'type' => $image_size['mime'],
     253                            'type' => $content_type,
    257254                            'tmp_name' => $tmp_name,
    258255                            'error' => UPLOAD_ERR_OK,
     
    264261                }
    265262                @unlink($tmp_name);
     263            } else {
     264                $this->error = 'unknown_type='.$content_type;
    266265            }
    267266        } else {
  • seowriting/tags/1.10.7/readme.txt

    r3262293 r3262393  
    55Requires at least: 4.9
    66Requires PHP: 5.6.20
    7 Stable tag: 1.10.5
     7Stable tag: 1.10.7
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323== Changelog ==
     24
     25= 1.10.7 (2025/03/26) =
     26
     27Feature:
     28* The limit on the size of the uploaded image has been removed
    2429
    2530= 1.10.5 (2025/03/26) =
  • seowriting/tags/1.10.7/seowriting.php

    r3262293 r3262393  
    99 * Plugin Name:       SEOWriting
    1010 * Description:       SEOWriting - AI Writing Tool Plugin For Text Generation
    11  * Version:           1.10.5
     11 * Version:           1.10.7
    1212 * Author:            SEOWriting
    1313 * Author URI:        https://seowriting.ai/?utm_source=wp_plugin
     
    2828        public $plugin_slug;
    2929        public $plugin_path;
    30         public $version = '1.10.5';
     30        public $version = '1.10.7';
    3131        /**
    3232         * @var \SEOWriting\APIClient|null
     
    766766                    } else {
    767767                        $this->writeLog([
    768                             'type' => 'downloadImagesWpError',
     768                            'type' => 'downloadImagesApiError',
    769769                            'path' => $path,
    770770                            'data' => $api->error,
  • seowriting/trunk/classes/api-client.php

    r3262293 r3262393  
    2121    public $error = '';
    2222
    23     const MAX_IMAGE_SIZE_KB = 1024;
    2423    const MAX_FILENAME_LENGTH = 100;
    2524
     
    200199    public function loadImage($url, $filename = '')
    201200    {
    202         $settings = $this->plugin->getSettings();
    203 
    204201        $args = [
    205             'headers' => [
    206                 'API-Auth' => $settings['api_key']
    207             ],
    208202            'timeout' => $this->http_timeout,
    209203            'sslverify' => $this->ssl_verify,
     
    217211        } elseif (wp_remote_retrieve_response_code($response) === 200) {
    218212            $content_type = wp_remote_retrieve_header($response, 'content-type');
     213            if (is_array($content_type)) {
     214                $content_type = $content_type[0];
     215            }
    219216            $size = wp_remote_retrieve_header($response, 'content-length');
    220217            if (is_array($size)) {
     
    224221            $mimes = get_allowed_mime_types();
    225222
    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)) {
    227224                $tmp_name = wp_tempnam();
    228225                if (@file_put_contents($tmp_name, wp_remote_retrieve_body($response))) {
     
    235232
    236233                            if (strlen($filename) > 0) {
    237                                 $ext = substr($name, (int)strrpos($name, '.'));
     234                                $ext = "." . explode("/", $content_type)[1];
    238235                                $max_length = self::MAX_FILENAME_LENGTH - strlen($ext);
    239236
     
    254251                        return [
    255252                            'name' => sanitize_file_name($name),
    256                             'type' => $image_size['mime'],
     253                            'type' => $content_type,
    257254                            'tmp_name' => $tmp_name,
    258255                            'error' => UPLOAD_ERR_OK,
     
    264261                }
    265262                @unlink($tmp_name);
     263            } else {
     264                $this->error = 'unknown_type='.$content_type;
    266265            }
    267266        } else {
  • seowriting/trunk/readme.txt

    r3262293 r3262393  
    55Requires at least: 4.9
    66Requires PHP: 5.6.20
    7 Stable tag: 1.10.5
     7Stable tag: 1.10.7
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323== Changelog ==
     24
     25= 1.10.7 (2025/03/26) =
     26
     27Feature:
     28* The limit on the size of the uploaded image has been removed
    2429
    2530= 1.10.5 (2025/03/26) =
  • seowriting/trunk/seowriting.php

    r3262293 r3262393  
    99 * Plugin Name:       SEOWriting
    1010 * Description:       SEOWriting - AI Writing Tool Plugin For Text Generation
    11  * Version:           1.10.5
     11 * Version:           1.10.7
    1212 * Author:            SEOWriting
    1313 * Author URI:        https://seowriting.ai/?utm_source=wp_plugin
     
    2828        public $plugin_slug;
    2929        public $plugin_path;
    30         public $version = '1.10.5';
     30        public $version = '1.10.7';
    3131        /**
    3232         * @var \SEOWriting\APIClient|null
     
    766766                    } else {
    767767                        $this->writeLog([
    768                             'type' => 'downloadImagesWpError',
     768                            'type' => 'downloadImagesApiError',
    769769                            'path' => $path,
    770770                            'data' => $api->error,
Note: See TracChangeset for help on using the changeset viewer.