Plugin Directory

Changeset 3446193


Ignore:
Timestamp:
01/24/2026 03:49:59 PM (2 months ago)
Author:
aipost
Message:

fix bugs, 4.3.5.3

Location:
ai-wp-writer
Files:
34 added
3 edited

Legend:

Unmodified
Added
Removed
  • ai-wp-writer/trunk/class.assistant.php

    r3429656 r3446193  
    13481348    }
    13491349   
    1350     private function loadFile( $url, $post_id ){
    1351         $tmp = download_url( $url, 300 );
    1352        
    1353         if( preg_match('/image=([^\.]+).(png|jpg)/i', $url, $matches ) ){
    1354             $file = [ 'name' => $matches[1] .'.'. $matches[2], 'tmp_name' => $tmp ];
    1355             $id = media_handle_sideload( $file, $post_id );
    1356            
    1357             if( is_wp_error( $id ) ){
    1358                 @unlink($file['tmp_name']);
    1359                 return false;
    1360             }
    1361             @unlink( $file['tmp_name'] );
    1362        
    1363             return $id;
     1350    private function loadFile( $image, $post_id ){
     1351        if( preg_match('/image=([^\.]+)\.(png|jpg)/i', $image, $match ) )
     1352            $image = $match[1] .'.'. $match[2];
     1353       
     1354        if( $data = $this->wpCurl( [ 'action' => 'getImage', 'image' => $image ], [], 3 ) ){
     1355            $tmp = wp_tempnam();
     1356           
     1357            if( file_put_contents( $tmp, $data ) ){
     1358                $file = [ 'name' => $image, 'tmp_name' => $tmp ];
     1359                $id = media_handle_sideload( $file, $post_id );
     1360               
     1361                if( is_wp_error( $id ) ){
     1362                    @unlink($file['tmp_name']);
     1363                    return false;
     1364                }
     1365                @unlink( $file['tmp_name'] );
     1366           
     1367                return $id;
     1368            }
    13641369        }
    13651370        return false;
  • ai-wp-writer/trunk/index.php

    r3434431 r3446193  
    11<?php
    22/*
    3     Version: 4.3.5.2
     3    Version: 4.3.5.3
    44    Plugin Name: AI WP Writer
    55    Description: Fast generation of articles with images in Wordpress editor, automatic content writer on schedule, mass rewriting of articles. Powered by ChatGPT, GPT-5, GPT-5 mini/nano, o3 (reasoning), Dalle 3, GPT-image, FLUX, Nano Banana.
  • ai-wp-writer/trunk/readme.txt

    r3434431 r3446193  
    55Tested up to: 6.9
    66Requires PHP: 5.6.0
    7 Stable tag: 4.3.5.2
     7Stable tag: 4.3.5.3
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.