Changeset 2784117
- Timestamp:
- 09/13/2022 03:44:00 PM (4 years ago)
- Location:
- ondoku/trunk
- Files:
-
- 4 edited
-
classes/core.php (modified) (2 diffs)
-
classes/hooks.php (modified) (2 diffs)
-
ondokusan.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ondoku/trunk/classes/core.php
r2784085 r2784117 92 92 93 93 94 $params['url'] = 'https://ondoku3.com/ja/text_to_speech_api/';94 $params['url'] = ONDOKUSAN_API; 95 95 $params['body'] = array( 96 96 'pitch' => $option['pitch'], 97 97 'speed' => $option['speed'], 98 'text' => ' ',98 'text' => 'Hi', 99 99 'voice' => $option['voice'] 100 100 ); … … 116 116 117 117 118 119 /*['code']部分を抜き取り*/ 120 $code = wp_remote_retrieve_response_code( $data ); 121 if( $code === 400 ){ 122 return false; 123 } 124 118 125 /*['body']部分を抜き取り*/ 119 126 $response = wp_remote_retrieve_body( $data ); 120 127 121 128 $result = json_decode( $response, true ); 122 $result = json_decode( $result, true );123 129 124 130 /*レスポンスがメッセージの場合*/ 125 if( !is_array($result) && strpos($response,'Token dose not match.') !== false){131 if( !is_array($result) ){ 126 132 return false; 127 133 } 134 128 135 129 136 return true; -
ondoku/trunk/classes/hooks.php
r2784110 r2784117 49 49 $params['text'] = preg_replace('/\n|\r|\r\n/', '', strip_tags( $post->post_content ) ); 50 50 51 $params['url'] = 'https://ondoku3.com/ja/text_to_speech_api/';51 $params['url'] = ONDOKUSAN_API; 52 52 53 53 $params['body'] = array( … … 87 87 88 88 $result = json_decode( $response, true ); 89 $result = json_decode( $result, true );90 89 91 90 /*レスポンスがメッセージの場合*/ 92 91 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 ){ 94 95 delete_post_meta( $post_id, 'ondoku_mp3_url' ); 95 96 $this->admin_message = 1; -
ondoku/trunk/ondokusan.php
r2784112 r2784117 4 4 Description: 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. 5 5 Author: Ondoku 6 Version: 1.0.1 46 Version: 1.0.15 7 7 Text Domain: ondoku3 8 8 Domain Path: /languages/ … … 15 15 define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) ); 16 16 define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) ); 17 define( 'ONDOKUSAN_API', 'https://ondoku3.com/ja/text_to_speech_api/' ); 17 18 18 19 require_once( ONDOKUSAN_DIR . '/classes/core.php' ); -
ondoku/trunk/readme.txt
r2784112 r2784117 2 2 Contributors: ondoku3 3 3 Tags: speech, read, text ,mp3 4 Tested up to: 5.64 Tested up to: 6.0 5 5 Requires at least: 5.1 6 6 Requires PHP: 7.0 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 61 61 2021/03/12 Add new language and voices. 62 62 63 2021/10/08 Add token check. 64 63 65 == Upgrade Notice == 64 66 … … 70 72 71 73 2021/03/12 Add new language and voices. 74 75 2021/10/08 Add token check.
Note: See TracChangeset
for help on using the changeset viewer.