Plugin Directory

Changeset 3453470


Ignore:
Timestamp:
02/04/2026 05:21:20 AM (2 months ago)
Author:
ondoku3
Message:

v1.0.27: fix token_check timeout (5s -> 30s)

Location:
ondoku
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ondoku/tags/1.0.27/classes/setting.php

    r3452493 r3453470  
    191191    private function token_check( $option ) {
    192192        if ( empty( $option['token'] ) ) {
     193            $this->write_test_log( 'token_check: token is empty', 'WARN' );
    193194            return false;
    194195        }
     
    205206        );
    206207
     208        $this->write_test_log( sprintf(
     209            'token_check API request: url=%s, voice=%s, speed=%s, pitch=%s',
     210            ONDOKUSAN_API,
     211            $params['voice'],
     212            $params['speed'],
     213            $params['pitch']
     214        ), 'INFO' );
     215
    207216        $data = wp_remote_post( ONDOKUSAN_API, array(
    208217            'method' => 'POST',
    209218            'headers' => $headers,
     219            'timeout' => 30,
    210220            'httpversion' => '1.0',
    211221            'sslverify' => false,
     
    214224
    215225        if ( is_wp_error( $data ) ) {
     226            $this->write_test_log( sprintf(
     227                'token_check failed: %s',
     228                $data->get_error_message()
     229            ), 'ERROR' );
    216230            return false;
    217231        }
    218232
    219233        $code = wp_remote_retrieve_response_code( $data );
     234        $this->write_test_log( sprintf(
     235            'token_check response: status_code=%d',
     236            $code
     237        ), 'INFO' );
     238
    220239        if ( $code === 400 ) {
     240            $this->write_test_log( 'token_check: received 400 Bad Request', 'ERROR' );
    221241            return false;
    222242        }
     
    225245        $result = json_decode( $response, true );
    226246
    227         return is_array( $result );
     247        $is_valid = is_array( $result );
     248        $this->write_test_log( sprintf(
     249            'token_check result: valid=%s',
     250            $is_valid ? 'true' : 'false'
     251        ), 'INFO' );
     252
     253        return $is_valid;
    228254    }
    229255
  • ondoku/tags/1.0.27/ondokusan.php

    r3452574 r3453470  
    44Description: Text to Speech (TTS) plugin. Automatically convert posts to MP3 audio. 音読さん - ブログ読み上げ・音声化プラグイン。
    55Author: Ondoku
    6 Version: 1.0.26
     6Version: 1.0.27
    77Text Domain: ondoku3
    88Domain Path: /languages/
     
    1313
    1414define( 'ONDOKUSAN', __FILE__ );
    15 define( 'ONDOKUSAN_VERSION', '1.0.26' );
     15define( 'ONDOKUSAN_VERSION', '1.0.27' );
    1616define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) );
    1717define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
  • ondoku/tags/1.0.27/readme.txt

    r3452927 r3453470  
    55Requires at least: 5.1
    66Requires PHP: 8.0
    7 Stable tag: 1.0.26
     7Stable tag: 1.0.27
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • ondoku/trunk/classes/setting.php

    r3452493 r3453470  
    191191    private function token_check( $option ) {
    192192        if ( empty( $option['token'] ) ) {
     193            $this->write_test_log( 'token_check: token is empty', 'WARN' );
    193194            return false;
    194195        }
     
    205206        );
    206207
     208        $this->write_test_log( sprintf(
     209            'token_check API request: url=%s, voice=%s, speed=%s, pitch=%s',
     210            ONDOKUSAN_API,
     211            $params['voice'],
     212            $params['speed'],
     213            $params['pitch']
     214        ), 'INFO' );
     215
    207216        $data = wp_remote_post( ONDOKUSAN_API, array(
    208217            'method' => 'POST',
    209218            'headers' => $headers,
     219            'timeout' => 30,
    210220            'httpversion' => '1.0',
    211221            'sslverify' => false,
     
    214224
    215225        if ( is_wp_error( $data ) ) {
     226            $this->write_test_log( sprintf(
     227                'token_check failed: %s',
     228                $data->get_error_message()
     229            ), 'ERROR' );
    216230            return false;
    217231        }
    218232
    219233        $code = wp_remote_retrieve_response_code( $data );
     234        $this->write_test_log( sprintf(
     235            'token_check response: status_code=%d',
     236            $code
     237        ), 'INFO' );
     238
    220239        if ( $code === 400 ) {
     240            $this->write_test_log( 'token_check: received 400 Bad Request', 'ERROR' );
    221241            return false;
    222242        }
     
    225245        $result = json_decode( $response, true );
    226246
    227         return is_array( $result );
     247        $is_valid = is_array( $result );
     248        $this->write_test_log( sprintf(
     249            'token_check result: valid=%s',
     250            $is_valid ? 'true' : 'false'
     251        ), 'INFO' );
     252
     253        return $is_valid;
    228254    }
    229255
  • ondoku/trunk/ondokusan.php

    r3452574 r3453470  
    44Description: Text to Speech (TTS) plugin. Automatically convert posts to MP3 audio. 音読さん - ブログ読み上げ・音声化プラグイン。
    55Author: Ondoku
    6 Version: 1.0.26
     6Version: 1.0.27
    77Text Domain: ondoku3
    88Domain Path: /languages/
     
    1313
    1414define( 'ONDOKUSAN', __FILE__ );
    15 define( 'ONDOKUSAN_VERSION', '1.0.26' );
     15define( 'ONDOKUSAN_VERSION', '1.0.27' );
    1616define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) );
    1717define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
  • ondoku/trunk/readme.txt

    r3452927 r3453470  
    55Requires at least: 5.1
    66Requires PHP: 8.0
    7 Stable tag: 1.0.26
     7Stable tag: 1.0.27
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.