awslabs / aws-for-wordpress

Amazon Polly Plugin for WordPress, which enables functionality for converting any text content on the wordpress site into audio.
https://wordpress.org/plugins/amazon-polly/
GNU General Public License v3.0
80 stars 36 forks source link

reader stops after one paragraph or the title #16

Closed haroldus- closed 6 years ago

haroldus- commented 6 years ago

Using WordPress 4.9.8 Plugin version is 2.0.5 If the title is included, the audio recording only reads the title. If it is disabled it only reads the first paragraph of the post. If the post is updated to include a new first paragraph only the new first paragraph is read and recorded. I think this is a bug. Any ideas?

tstachlewski commented 6 years ago

Hi, Could you provide example of the title/post? (does it happens always?). Any errors in log files?

Cheers, Tomasz

haroldus- commented 6 years ago

Hi Tomasz, Yes it always happens. This is what an article looks like, (I will comment separately with any logs):

<div id="main-wrap">
  <div id="primary" class="site-content cf" role="main">

  <article id="post-[number]" class="post-[number] post type-post status-publish format-standard has-post-thumbnail hentry category-top-stories">
  
  <header class="entry-header">
  <div class="entry-cats">
    <a href="[href]" rel="category tag">Top Stories</a>
  </div><!-- end .entry-cats -->
  <div class="entry-date">
    Published on <a href="[href]">[date]</a>
  </div><!-- end .entry-date -->
  <div class="entry-comments">
    <a href="[href]#comments">comments 23</a>           </div><!-- end .entry-comments -->
  <h1 class="entry-title">Title</h1>
  <div class="entry-author">
  written by <a href="[href]" title="All posts by Author">Author</a>        </div><!-- end .entry-author -->
  </header><!-- end .entry-header -->
  
  <div class="entry-thumbnail">
  <a href="[href]" title="Permalink to Title"><img width="1200" height="674" src="https://[domain]/wp-content/plugins/jetpack/modules/lazy-images/images/1x1.trans.gif" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" data-lazy-src="[url delivered through cloudfront]" pagespeed_url_hash="[number]" onload="pagespeed.CriticalImages.checkImageForCriticality(this);"/></a>
</div><!-- end .entry-thumbnail -->

<div class="entry-content">
  <div class='mailmunch-forms-before-post' style='display: none !important;'></div>
<p><code class="code"></code></p>
  <p>[first para]</p>
  <p>[second para]</p>
...

So if the insert title option is selected only the title is read. If it is false, only the first paragraph is read.

haroldus- commented 6 years ago

@tstachlewski there don't appear to be any php errors, Cheers, Harry

haroldus- commented 6 years ago

@tstachlewski it is a permissions issue in my filesystem with the upload directory. By changing the permissions of /wp-content/uploads the plugin now has the ability to modify the temp files in the convert_to_audio function. Prior, the function was able to create just the one file from the first snippet (whatever that happened to be) and that was all.

As a closing thought, perhaps there should be an option for the string manipulation and file merging etc. to be carried out on AWS Lambda (managed hosting environments may have permissions issues too e.g. this one seems to be such an issue https://wordpress.org/support/topic/error-white-screen-of-death-with-saving-a-draft-of-a-post/). Especially if the wordpress site is already using s3, cloudfront and rds, the user is likely to want to keep this kind of thing off the instance. Also, AWS gets another customer and/or increased custom for another of its services ;).

jon1wt commented 3 years ago

Hi, I have the same problem, part of the problem is that I already have my wp-content / uploads in s3 with another plugin, and I configure the plugin in local mode because s3 mode is not working, I think that is part of the problem, how can I make the polly plugin do the convert_to_audio in the s3 folder which is my equivalent of wp-content / uploads?, I use wordpress in docker environment and can't do many server configurations, and to user IAM from the polly plugin I assigned full privileges on s3 and it still can't make the full audio file