Plugin Directory

Changeset 2072847


Ignore:
Timestamp:
04/23/2019 03:24:16 AM (7 years ago)
Author:
awslabs
Message:

3.0.4 trunk

Location:
amazon-polly/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • amazon-polly/trunk/README.md

    r2064724 r2072847  
    77| Requires PHP | 5.6 |
    88| Tested up to | 5.0 |
    9 | Stable tag | 3.0.3 |
     9| Stable tag | 3.0.4 |
    1010| License | GPLv3 ONLY |
    1111| License URI | https://www.gnu.org/licenses/gpl-3.0.html |
     
    237237#### Changelog
    238238
     239= 3.0.4 =
     240* Added support for Arabic Language
     241* Bug Fixing
     242
    239243= 3.0.3 =
    240244* Added detailed logging
  • amazon-polly/trunk/README.txt

    r2064724 r2072847  
    55Requires PHP: 5.6
    66Tested up to: 5.0
    7 Stable tag: 3.0.3
     7Stable tag: 3.0.4
    88License: GPLv3 ONLY
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    232232== Changelog ==
    233233
     234= 3.0.4 =
     235* Added support for Arabic Language
     236* Bug Fixing
     237
    234238= 3.0.3 =
    235239* Added detailed logging
  • amazon-polly/trunk/admin/AmazonAI-Common.php

    r2047075 r2072847  
    1313    // Information about languages supported by the Amazon AI plugin
    1414    private $languages = [
     15        ['code' => 'ar', 'name' => 'Arabic', 'transable' => '1', 'polly' => '1'],
    1516        ['code' => 'da', 'name' => 'Danish', 'transable' => '1', 'polly' => '1'],
    1617        ['code' => 'nl', 'name' => 'Dutch', 'transable' => '1', 'polly' => '1'],
     
    10061007        // Estimating the total price of convertion of all posts.
    10071008
    1008         $total_price = $amazon_polly_price * $count_posts * $post_chars_count_avg;
     1009        $total_price = 2 * $amazon_polly_price * $count_posts * $post_chars_count_avg;
    10091010        $message = 'You are about to convert ' . number_format($count_posts, 0, '.', ',') . ' pieces of text-based content, which totals approximately ' . number_format($number_of_characters, 0, '.', ',') . ' characters. Based on the Amazon Polly pricing ($4 dollars per 1 million characters) it will cost you about $' . $total_price . ' to convert all of your content into to speech-based audio. Some or all of your costs might be covered by the Free Tier (conversion of 5 million characters per month for free, for the first 12 months, starting from the first request for speech). Learn more https://aws.amazon.com/polly/';
    10101011        return $message;
  • amazon-polly/trunk/admin/AmazonAI-PollyService.php

    r2064724 r2072847  
    1515    const NONCE_NAME = 'amazon-polly-post-nonce';
    1616
     17
    1718    /**
    1819     * Important. Run whenever new post is being created (or updated). The method generates a background task to generate the audio file.
     
    6364        }
    6465
    65     $background_task = new AmazonAI_BackgroundTask();
    66     $background_task->trigger(self::GENERATE_POST_AUDIO_TASK, [ $post_id ]);
     66        if( ! ( wp_is_post_revision( $post_id) || wp_is_post_autosave( $post_id ) ) ) {
     67            $logger->log(sprintf('%s Starting background task process ( id=%s )', __METHOD__, $post_id));
     68        $background_task = new AmazonAI_BackgroundTask();
     69        $background_task->trigger(self::GENERATE_POST_AUDIO_TASK, [ $post_id ]);
     70        }
    6771    }
    6872
     
    285289
    286290        // Preparing locations and names of temporary files which will be used.
     291        $random                             = rand(5, 10);
    287292        $upload_dir           = wp_upload_dir()['basedir'];
    288293        $file_prefix          = 'amazon_polly_';
    289294        $file_name            = $file_prefix . $post_id . $lang . '.mp3';
    290         $file_temp_full_name  = trailingslashit($upload_dir) . 'temp_' . $file_name;
     295        $file_temp_full_name  = trailingslashit($upload_dir) . 'temp_' . $file_name . $random;
    291296        $dir_final_full_name  = trailingslashit($upload_dir);
    292297        if ( get_option('uploads_use_yearmonth_folders') ) {
  • amazon-polly/trunk/admin/AmazonAI-TranslateConfiguration.php

    r2020984 r2072847  
    157157        echo '<td>';
    158158        $display_values   = [ 'Flag', 'Label', 'Flag + Label' ];
     159
     160        //For some languages flags are not supported.
     161        if ($lanuage == 'ar') {
     162          $display_values   = [ 'Label' ];
     163        }
    159164
    160165        echo 'Display: <select name="' . $lan_display . '" id="' . $lan_display . '" >';
  • amazon-polly/trunk/amazonpolly.php

    r2064724 r2072847  
    1717 * Plugin URI:        https://wordpress.org/plugins/amazon-polly/
    1818 * 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:           3.0.3
     19 * Version:           3.0.4
    2020 * Author:            AWS Labs, WP Engine
    2121 * Author URI:        https://aws.amazon.com/
Note: See TracChangeset for help on using the changeset viewer.