Changeset 1996469
- Timestamp:
- 12/17/2018 02:08:44 PM (7 years ago)
- Location:
- amazon-polly/trunk
- Files:
-
- 7 edited
-
README.md (modified) (3 diffs)
-
README.txt (modified) (3 diffs)
-
admin/AmazonAI-Common.php (modified) (3 diffs)
-
admin/AmazonAI-PollyConfiguration.php (modified) (3 diffs)
-
admin/AmazonAI-Translator.php (modified) (3 diffs)
-
amazonpolly.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
amazon-polly/trunk/README.md
r1991560 r1996469 7 7 | Requires PHP | 5.6 | 8 8 | Tested up to | 4.9 | 9 | Stable tag | 2.6. 1|9 | Stable tag | 2.6.2 | 10 10 | License | GPLv3 ONLY | 11 11 | License URI | https://www.gnu.org/licenses/gpl-3.0.html | … … 38 38 39 39 ###### Other settings: 40 - Post Types: Specifies on which type of WordPress page plugin will be used. The default value is ‘posts’ 40 - Post types: Specifies on which type of WordPress page plugin will be used. The default value is ‘posts’ 41 - Display "Powered by AWS": This option let you to choose if you want to display Display by AWS logo on your website or (otherwise) add it to the content (like audio) which will be generated by the plugin 42 - Enable logging: Specifies if detailed pluging logging should be enabled. 43 - Skip tags: Allows to specify tags (for example audio) for which audio won't be generated. 41 44 42 45 … … 243 246 Important: Text will be shown in transcript if translate functionality is enabled, even if it was marked as "Audio Only". 244 247 245 #### Q: What is "Words Only" functionality?246 247 If you have a piece of content that you want on your page but not read by the plugin, you use the -AMAZONPOLLY-ONLYWORDS- tag. For example:248 249 -AMAZONPOLLY-ONLYWORDS-START-250 251 [Text that will be shown in the browser but not read by the plugin.]252 253 -AMAZONPOLLY-ONLYWORDS-END-254 255 Important: Text will be read in translated audio files if translate functionality is enabled, even if it was marked as "Words Only".256 257 258 248 259 249 #### Changelog 250 251 = 2.6.2 = 252 * Added possibility to specify tags, which won't be read (for example 'audio'). This option is available under 'Text-To-Speech' tab as 'Skip tags' option. 253 * Cleaning WordPress options when plugin is uninstalled. 260 254 261 255 = 2.6.1 = -
amazon-polly/trunk/README.txt
r1991560 r1996469 5 5 Requires PHP: 5.6 6 6 Tested up to: 4.9 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPLv3 ONLY 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 36 36 37 37 Other settings: 38 - Post Types: Specifies on which type of WordPress page plugin will be used. The default value is ‘posts’ 38 - Post types: Specifies on which type of WordPress page plugin will be used. The default value is ‘posts’ 39 - Display "Powered by AWS": This option let you to choose if you want to display Display by AWS logo on your website or (otherwise) add it to the content (like audio) which will be generated by the plugin 40 - Enable logging: Specifies if detailed pluging logging should be enabled. 41 - Skip tags: Allows to specify tags (for example audio) for which audio won't be generated. 42 39 43 40 44 … … 238 242 Important: Text will be shown in transcript if translate functionality is enabled, even if it was marked as "Audio Only". 239 243 240 == What is "Words Only" functionality? ==241 242 If you have a piece of content that you want on your page but not read by the plugin, you use the -AMAZONPOLLY-ONLYWORDS- tag. For example:243 244 -AMAZONPOLLY-ONLYWORDS-START-245 246 [Text that will be shown in the browser but not read by the plugin.]247 248 -AMAZONPOLLY-ONLYWORDS-END-249 250 Important: Text will be read in translated audio files if translate functionality is enabled, even if it was marked as "Words Only".251 252 244 == Changelog == 245 246 = 2.6.2 = 247 * Added possibility to specify tags, which won't be read (for example 'audio'). This option is available under 'Text-To-Speech' tab as 'Skip tags' option. 248 * Cleaning WordPress options when plugin is uninstalled. 253 249 254 250 = 2.6.1 = -
amazon-polly/trunk/admin/AmazonAI-Common.php
r1991560 r1996469 1136 1136 $clean_text = str_replace(' ', ' ', $clean_text); 1137 1137 $clean_text = do_shortcode($clean_text); 1138 1139 $clean_text = $this->skip_tags($clean_text); 1140 1138 1141 $is_ssml_enabled = $this->is_ssml_enabled(); 1139 1142 if ($is_ssml_enabled) { … … 1220 1223 } 1221 1224 1225 private function skip_tags($text) { 1226 1227 $skip_tags_array = $this->get_skiptags_array(); 1228 1229 foreach ($skip_tags_array as $value) { 1230 $text = preg_replace('/<' . $value . '>(\s*?)(.*?)(\s*?)<\/' . $value . '>/', '', $text); 1231 } 1232 1233 return $text; 1234 } 1222 1235 1223 1236 /** … … 1321 1334 1322 1335 /** 1336 * Return skip tags array. 1337 * 1338 * @since 1.0.7 1339 */ 1340 public function get_skiptags_array() { 1341 $array = get_option( 'amazon_ai_skip_tags' ); 1342 $array = explode( ' ', $array ); 1343 1344 return $array; 1345 1346 } 1347 1348 /** 1323 1349 * Return post type value array. 1324 1350 * -
amazon-polly/trunk/admin/AmazonAI-PollyConfiguration.php
r1942322 r1996469 75 75 add_settings_field( 'amazon_polly_add_post_excerpt', __( 'Add post excerpt to audio:', 'amazonpolly' ), array( $this, 'add_post_excerpt_gui' ), 'amazon_ai_polly', 'amazon_ai_pollyadditional', array( 'label_for' => 'amazon_polly_add_post_excerpt' ) ); 76 76 add_settings_field( 'amazon_ai_medialibrary_enabled', __( 'Enable Media Library support:', 'amazonpolly' ), array( $this, 'medialibrary_enabled_gui' ), 'amazon_ai_polly', 'amazon_ai_pollyadditional', array( 'label_for' => 'amazon_ai_medialibrary_enabled' ) ); 77 77 add_settings_field( 'amazon_ai_skip_tags', __( 'Skip tags:', 'amazonpolly' ), array( $this, 'skiptags_gui' ), 'amazon_ai_polly', 'amazon_ai_pollyadditional', array( 'label_for' => 'amazon_ai_skip_tags' ) ); 78 78 79 79 //Registration … … 94 94 register_setting('amazon_ai_polly', 'amazon_polly_add_post_excerpt'); 95 95 register_setting('amazon_ai_polly', 'amazon_ai_medialibrary_enabled'); 96 register_setting('amazon_ai_polly', 'amazon_ai_skip_tags'); 97 96 98 } 97 99 } … … 222 224 223 225 } 226 227 /** 228 * Render the Player Label input. 229 * 230 * @since 1.0.3 231 */ 232 public function skiptags_gui() { 233 234 $tags = get_option( 'amazon_ai_skip_tags' ); 235 echo '<input type="text" class="regular-text" name="amazon_ai_skip_tags" id="amazon_ai_skip_tags" value="' . esc_attr( $tags ) . '"> '; 236 237 } 224 238 225 239 /** -
amazon-polly/trunk/admin/AmazonAI-Translator.php
r1991560 r1996469 254 254 $langs = $all_langs; 255 255 update_post_meta( $post_id, 'amazon_ai_source_language', $source_language ); 256 256 257 257 } else { 258 258 … … 267 267 268 268 $logger->log(sprintf('%s Translating from ( %s ) to ( %s )', __METHOD__, $source_language, $language_code)); 269 270 269 $wp_filesystem = $common->prepare_wp_filesystem(); 271 270 … … 282 281 // Create audio files for files only if this functionality is enabled. 283 282 if ( $common->is_audio_for_translations_enabled() ) { 283 $logger->log(sprintf('%s Starting preparing audio version', __METHOD__)); 284 284 $polly->convert_to_audio( $post_id, '', '', $sentences, $wp_filesystem, $language_code ); 285 285 } -
amazon-polly/trunk/amazonpolly.php
r1991560 r1996469 17 17 * Plugin URI: https://wordpress.org/plugins/amazon-polly/ 18 18 * Description: Create audio version of your posts, translate them into other languages and create podcasts! Amazon Polly is a service that turns text into lifelike speech. With dozens of voices across a variety of languages, you can select the ideal voice and build engaging speech-enabled applications that work in many different countries. The Amazon Polly plugin for WordPress is a sample application that shows how WordPress creators can easily add Text-to-Speech capabilities to written content with Amazon Polly. You can generate an audio feed for text-based content and insert it into an embedded player to increase the accessibility of your WordPress site. The sample code also enables you to publish podcasts directly from your site and make them available for listeners in the form of podcasts. In addition, the plugin allows to translate your text from one language to another using Amazon Translate– which is a neural machine translation service that delivers fast, high-quality, and affordable language translation. Amazon Translate allows you to localize content - such as websites and applications - for international users, and to easily translate large volumes of text efficiently. 19 * Version: 2.6. 119 * Version: 2.6.2 20 20 * Author: AWS Labs, WP Engine 21 21 * Author URI: https://aws.amazon.com/ -
amazon-polly/trunk/uninstall.php
r1991560 r1996469 13 13 exit; 14 14 } 15 16 // General Options 17 delete_option('amazon_polly_access_key'); 18 delete_option('amazon_polly_secret_key'); 19 20 delete_option('amazon_ai_source_language'); 21 delete_option('amazon_polly_region'); 22 delete_option('amazon_polly_s3'); 23 delete_option('amazon_polly_cloudfront'); 24 delete_option('amazon_polly_posttypes'); 25 delete_option('amazon_polly_poweredby'); 26 delete_option('amazon_ai_logging'); 27 28 // Text-To-Speech Options 29 delete_option('amazon_polly_sample_rate'); 30 delete_option('amazon_polly_voice_id'); 31 delete_option('amazon_polly_auto_breaths'); 32 delete_option('amazon_polly_ssml'); 33 delete_option('amazon_polly_lexicons'); 34 delete_option('amazon_polly_speed'); 35 delete_option('amazon_polly_position'); 36 delete_option('amazon_polly_player_label'); 37 delete_option('amazon_polly_defconf'); 38 delete_option('amazon_polly_autoplay'); 39 delete_option('amazon_polly_update_all'); 40 delete_option('amazon_polly_add_post_title'); 41 delete_option('amazon_polly_add_post_excerpt'); 42 delete_option('amazon_ai_medialibrary_enabled'); 43 delete_option('amazon_ai_skip_tags'); 44 45 // Translate Options 46 delete_option('amazon_polly_trans_enabled'); 47 delete_option('amazon_polly_trans_src_lang'); 48 delete_option('amazon_ai_audio_for_translation_enabled'); 49 50 $languages = array('da','nl','zh','cs','en','fi','fr','de','he','it','id','ja','ko','nb','pl','pt','ro','ru','es','sv','tr','cy'); 51 foreach( $languages as $language_code ){ 52 delete_option('amazon_polly_trans_langs_' . $language_code, 'strval'); 53 delete_option('amazon_polly_trans_langs_' . $language_code . '_voice', 'strval'); 54 delete_option('amazon_polly_trans_langs_' . $language_code . '_label', 'strval'); 55 delete_option('amazon_polly_trans_langs_' . $language_code . '_display', 'strval'); 56 } 57 58 // Podcast Options 59 delete_option('amazon_polly_podcast_email'); 60 delete_option('amazon_polly_podcast_category'); 61 delete_option('amazon_polly_podcast_explicit'); 62 delete_option('amazon_polly_podcast_icon'); 63 delete_option('amazon_polly_podcast_feedsize'); 64 delete_option('amazon_polly_podcast_post_cat'); 65 delete_option('amazon_polly_podcast_author'); 66 delete_option('amazon_polly_podcast_https');
Note: See TracChangeset
for help on using the changeset viewer.