Plugin Directory

Changeset 3461407


Ignore:
Timestamp:
02/14/2026 03:47:28 PM (9 days ago)
Author:
rifaldye
Message:

v1.3.3: Increase all API timeouts to 10 minutes, fix false 'Request failed' errors on successful generation

Location:
apicoid-ghostwriter/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apicoid-ghostwriter/trunk/apicoid-ghostwriter.php

    r3461338 r3461407  
    44 * Plugin URI:  https://wordpress.org/plugins/apicoid-ghostwriter/
    55 * Description: Connects your WordPress site to Api.co.id to generate content and rewrite content automatically using AI. Features include article generation, content rewriting, automatic related article linking, SEO integration, and image generation.
    6  * Version:     1.3.2
     6 * Version:     1.3.3
    77 * Author:      Api.co.id
    88 * Author URI:  https://api.co.id
     
    2121
    2222// Define plugin constants
    23 define( 'APICOID_GW_VERSION', '1.3.2' );
     23define( 'APICOID_GW_VERSION', '1.3.3' );
    2424define( 'APICOID_GW_DIR', plugin_dir_path( __FILE__ ) );
    2525define( 'APICOID_GW_URL', plugin_dir_url( __FILE__ ) );
     
    784784                    'Content-Type' => 'application/json',
    785785                ),
    786                 'timeout' => 300, // 5 minutes timeout
     786                'timeout' => 600, // 10 minutes timeout
    787787            )
    788788        );
     
    10951095                ),
    10961096                'body'    => wp_json_encode( $request_body ),
    1097                 'timeout' => 300, // 5 minutes timeout for image generation
     1097                'timeout' => 600, // 10 minutes timeout for image generation
    10981098            )
    10991099        );
     
    15311531                ),
    15321532                'body'    => wp_json_encode( $data ),
    1533                 'timeout' => 300, // 5 minutes timeout for article generation
     1533                'timeout' => 600, // 10 minutes timeout for article generation
    15341534            )
    15351535        );
     
    19951995                ),
    19961996                'body'    => wp_json_encode( $data ),
    1997                 'timeout' => 300, // 5 minutes timeout for article rewriting
     1997                'timeout' => 600, // 10 minutes timeout for article rewriting
    19981998            )
    19991999        );
     
    22702270                ),
    22712271                'body'    => wp_json_encode( $request_data ),
    2272                 'timeout' => 300, // 5 minutes timeout for article suggestions
     2272                'timeout' => 600, // 10 minutes timeout for article suggestions
    22732273            )
    22742274        );
     
    24512451                ),
    24522452                'body'    => wp_json_encode( $request_body ),
    2453                 'timeout' => 300, // 5 minutes timeout for image generation
     2453                'timeout' => 600, // 10 minutes timeout for image generation
    24542454            )
    24552455        );
  • apicoid-ghostwriter/trunk/assets/js/article-generator.js

    r3461338 r3461407  
    497497                },
    498498                dataType: 'json',
     499                timeout: 600000, // 10 minutes timeout
    499500                success: function(response) {
    500501                    if (response.success) {
     
    518519                },
    519520                error: function(xhr, status, error) {
    520                     // Show error message
    521521                    var errorMsg = 'Request failed. Please try again.';
    522                     if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
     522                    if (xhr.status === 504 || xhr.status === 502) {
     523                        errorMsg = 'Server timeout. The article may still be generating in the background. Please check your drafts after a few minutes.';
     524                    } else if (status === 'timeout') {
     525                        errorMsg = 'Request timed out. The article may still be generating in the background. Please check your drafts after a few minutes.';
     526                    } else if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
    523527                        errorMsg = xhr.responseJSON.data.message;
    524528                    }
     
    622626                },
    623627                dataType: 'json',
     628                timeout: 600000, // 10 minutes timeout
    624629                success: function(response) {
    625630                    if (response.success) {
     
    643648                },
    644649                error: function(xhr, status, error) {
    645                     // Show error message
    646650                    var errorMsg = 'Request failed. Please try again.';
    647                     if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
     651                    if (xhr.status === 504 || xhr.status === 502) {
     652                        errorMsg = 'Server timeout. The article may still be generating in the background. Please check your drafts after a few minutes.';
     653                    } else if (status === 'timeout') {
     654                        errorMsg = 'Request timed out. The article may still be generating in the background. Please check your drafts after a few minutes.';
     655                    } else if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
    648656                        errorMsg = xhr.responseJSON.data.message;
    649657                    }
     
    16331641                    type: 'POST',
    16341642                    data: ajaxData,
    1635                     timeout: 300000, // 5 minutes timeout
     1643                    timeout: 600000, // 10 minutes timeout
    16361644                    dataType: 'json',
    16371645                    success: function(response) {
  • apicoid-ghostwriter/trunk/assets/js/media-library.js

    r3457596 r3461407  
    422422                        prompt: prompt
    423423                    },
    424                     timeout: 300000, // 5 minutes timeout
     424                    timeout: 600000, // 10 minutes timeout
    425425                    success: function(response) {
    426426                        if (response.success) {
  • apicoid-ghostwriter/trunk/readme.txt

    r3461338 r3461407  
    55Requires at least: 6.2
    66Tested up to: 6.9
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    129129
    130130== Changelog ==
     131
     132= 1.3.3 =
     133* Increased all API timeouts to 10 minutes: All API calls to api.co.id (article generation, rewriting, suggestions, image generation) now use 600-second timeout to prevent premature request failures
     134* Improved AJAX timeout handling: Added 10-minute client-side timeout to Generate Article and Rewrite Article forms that were previously missing explicit timeouts
     135* Better error messages for timeouts: Generate and Rewrite forms now show informative messages when server timeout (502/504) occurs, letting users know the article may still be generating in the background
     136* Fixed false "Request failed" errors: Resolved issue where articles were successfully generated but users saw error alerts due to web server gateway timeouts
    131137
    132138= 1.3.2 =
Note: See TracChangeset for help on using the changeset viewer.