Plugin Directory

Changeset 2784117


Ignore:
Timestamp:
09/13/2022 03:44:00 PM (4 years ago)
Author:
ondoku3
Message:

22年5月分

Location:
ondoku/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ondoku/trunk/classes/core.php

    r2784085 r2784117  
    9292
    9393
    94         $params['url'] = 'https://ondoku3.com/ja/text_to_speech_api/';
     94        $params['url'] = ONDOKUSAN_API;
    9595        $params['body'] = array(
    9696            'pitch' => $option['pitch'],
    9797            'speed' => $option['speed'],
    98             'text' => '',
     98            'text' => 'Hi',
    9999            'voice' => $option['voice']
    100100        );
     
    116116
    117117
     118
     119        /*['code']部分を抜き取り*/
     120        $code = wp_remote_retrieve_response_code( $data );
     121        if( $code === 400 ){
     122            return false;
     123        }
     124
    118125        /*['body']部分を抜き取り*/
    119126        $response = wp_remote_retrieve_body( $data );
    120127
    121128        $result = json_decode( $response, true );
    122         $result = json_decode( $result, true );
    123129
    124130        /*レスポンスがメッセージの場合*/
    125         if( !is_array($result) && strpos($response,'Token dose not match.') !== false ){
     131        if( !is_array($result) ){
    126132            return false;
    127133        }
     134
    128135
    129136        return true;
  • ondoku/trunk/classes/hooks.php

    r2784110 r2784117  
    4949        $params['text'] = preg_replace('/\n|\r|\r\n/', '', strip_tags( $post->post_content ) );
    5050
    51         $params['url'] = 'https://ondoku3.com/ja/text_to_speech_api/';
     51        $params['url'] = ONDOKUSAN_API;
    5252
    5353        $params['body'] = array(
     
    8787
    8888            $result = json_decode( $response, true );
    89             $result = json_decode( $result, true );
    9089
    9190            /*レスポンスがメッセージの場合*/
    9291            if( !is_array($result) ){
    93                 if(strpos($response,'Token dose not match.') !== false){
     92                /*['code']部分を抜き取り*/
     93                $code = wp_remote_retrieve_response_code( $data );
     94                if( $code === 400 ){
    9495                    delete_post_meta( $post_id, 'ondoku_mp3_url' );
    9596                    $this->admin_message = 1;
  • ondoku/trunk/ondokusan.php

    r2784112 r2784117  
    44Description: Create an audio file that automatically reads the text aloud when posting a blog, and insert it with an HTML tag at the beginning of the blog.
    55Author: Ondoku
    6 Version: 1.0.14
     6Version: 1.0.15
    77Text Domain: ondoku3
    88Domain Path: /languages/
     
    1515define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) );
    1616define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
     17define( 'ONDOKUSAN_API', 'https://ondoku3.com/ja/text_to_speech_api/' );
    1718
    1819require_once( ONDOKUSAN_DIR . '/classes/core.php' );
  • ondoku/trunk/readme.txt

    r2784112 r2784117  
    22Contributors: ondoku3
    33Tags: speech, read, text ,mp3
    4 Tested up to: 5.6
     4Tested up to: 6.0
    55Requires at least: 5.1
    66Requires PHP: 7.0
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    61612021/03/12 Add new language and voices.
    6262
     632021/10/08 Add token check.
     64
    6365== Upgrade Notice ==
    6466
     
    7072
    71732021/03/12 Add new language and voices.
     74
     752021/10/08 Add token check.
Note: See TracChangeset for help on using the changeset viewer.