Forum Replies Created

Viewing 15 replies - 1 through 15 (of 25 total)
  • Thread Starter WriterDan

    (@writerdan)

    In the interim, we moved our site to a different server for performance reasons, and the issue between the Yotpo plugin and Unbounce pages has resolved itself. Not sure what might have affected the change, but whatever it was, it’s not causing an issue anymore. My developer brain is a little concerned, as we weren’t able to find what was causing the problem and it may climb up to bite us later, but my manager brain says count your blessings and move on.

    So, we can close this ticket for now. If the issue comes up again, I’ll let you know.

    Thanks for your response. Hope you’re doing well after your medical leave.

    Cheers.

    Thread Starter WriterDan

    (@writerdan)

    Have you been able to look at this issue?

    Thread Starter WriterDan

    (@writerdan)

    @hxii, nope. The error still persists.

    We’ve updating some of the details of our hosting package since I started this ticket.

    The new analogous page for the url I presented above is:

    https://transformhq-staging.qw97gx7f-liquidwebsites.com/unbounce-staging-test/

    Thread Starter WriterDan

    (@writerdan)

    Sorry it took me so long to get back with you on this. I’ve followed all of your instructions, and the behavior of my site is still the same.

    After a cache clearing event, the first page load for every page on my site looks like the screenshot I referenced above, and the second page load (infrequently until the third page load) shows up fine.

    Any other ideas that I can check? I have a couple other sites that are using this plugin and having no issues. Currently only two that are.

    Thread Starter WriterDan

    (@writerdan)

    Hi, Marko.

    I have tried all of your suggested means of fixing the plugin’s performance, and none of them seem to have worked.

    We’ve been using this plugin for a LONG time (6-7 years?) and it’s only recently that we’ve had this problem. I tried reverting the plugin to a previous version (went back two versions) without any luck. I don’t believe that anything on our servers has changed.

    The weird piece is that it doesn’t work for the initial page load, but then does work when I reload the page. Occasionally, it’ll take two page loads before the actual html show up. Can’t figure it out.

    Any other ideas?

    Thread Starter WriterDan

    (@writerdan)

    Sounds good, Tomasz. I’ll check this out, and if there’s still something that needs to be changed to have this work, I’ll put together a new ticket.

    Thanks for all of the great updates!

    Thread Starter WriterDan

    (@writerdan)

    Essentially, as a work around, yes. We’d just have to re-up the audio files from the WordPress Importer every time we updated the post. Annoying, true, but doable until a more direct method of integrating with CDN plugins can be found.

    Still haven’t heard back from that other plugin developer, by the way. Will ping them again.

    Thread Starter WriterDan

    (@writerdan)

    Hey Tomasz,

    Sent you a direct email.

    Thanks.

    Thread Starter WriterDan

    (@writerdan)

    Essentially, right now my only options are to place the player:

    1) At the very beginning of the post
    2) At the very end of the post
    3) Nowhere in the post

    I’ve actually written my own custom shortcode to accomplish this on our site for the time being. I did this so that we could place the player in the correct location for this post:

    https://www.esupplements.com/best-l-glutamine-supplements/

    We have that left-floating meta-information section that comes first in the article, and we wanted the player to show up at the “top” of the article content but after that meta-information section.

    Here’s my custom code:

    function amazon_polly_player_shortcode($atts, $content = NULL) {
    	global $post;
    
    	$tagged_content = '';
    	if(intval(get_post_meta($post->ID, 'amazon_polly_enable', TRUE))===1) {
    		$player_source = get_post_meta($post->ID, 'amazon_polly_audio_link_location', TRUE);
    		$tagged_content = PHP_EOL.'-AMAZONPOLLY-ONLYWORDS-START-'.PHP_EOL.'
    <table id="amazon-polly-audio-table">
    	<tbody>
    		<tr>
    			<td id="amazon-polly-audio-tab">
    				<div id="amazon-polly-label-tab">Listen to this article</div>
    				<div id="amazon-polly-play-tab">
    					<audio id="amazon-polly-audio-play" preload="none" controls="">
    						<source type="audio/mpeg" src="'.$player_source.'">
    					</audio>
    				</div>
    				<div id="amazon-polly-by-tab">
    					<a href="https://aws.amazon.com/polly/" target="_blank" rel="noopener noreferrer">
    						<img src=" https://d12ee1u74lotna.cloudfront.net/images/Voiced_by_Amazon_Polly_EN.png" width="100">
    					</a>
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>'.PHP_EOL.'-AMAZONPOLLY-ONLYWORDS-END-'.PHP_EOL;
    	} else {
    		$tagged_content = PHP_EOL.'<!-- Amazon Polly not enabled on this post -->'.PHP_EOL;
    	}
    	return $tagged_content;
    }
    add_shortcode('polly_player', 'amazon_polly_player_shortcode');

    Then I just put the [polly_player] shortcode in my content where I wanted the player to render. Seems to be working great for us, and it provided the ability to customize the post to how we wanted it to be.

    Thread Starter WriterDan

    (@writerdan)

    You know, I’ve rethought this, and I think it’s probably more hassle than it’s worth. The nuances of when you might not want to redo the audio when you do need to update the post probably won’t make that much of a difference.

    I’ll close this out. If someone else brings it up, you can take a look at it then.

    Thread Starter WriterDan

    (@writerdan)

    Hey Tomasz,

    Thanks for the quick response.

    1) Yes, I use the “Text” tab. The visual tab kills me. I’m a developer though. So I like to see the code and have control over everything. 🙂

    2) I get the CDN issue. And there are so many CDN plugins out there, there’s no way that you should be responsible for integrating with all possibilities. The one easy way that I can see out of this bind (for my particular case) is to add the converted audio files into the WordPress Media Uploader tool. This is because my CDN plugin adds in custom functionality to re-up files to our CDN that are listed within the Media Uploader tool. They’ve just added a extra link to those that show up when you hover over a given item listed in the Uploader tool. I’ll contact the developer of the particular plugin we use and see if they’ve hooked in their CDN save functionality into some of the core WordPress functionality that would make your job in this regard easier. Will let you know what I hear from them.

    3) My most recent comment deals more with my understanding of the workings of the Amazon bucket that gets created as part of the service this plugin provides. Right now I’m in the free tier, but I found out recently (by an automated email from Amazon) that I won’t be able to stay in the free tier for long if I keep pushing these audio converted files to their CDN. This is because the free Amazon CDN bucket has a limit on the number of GET requests that are made against the files I host there, and a GET request is made every time a page on my site loads if I have the Amazon-Polly-rendered player included on it. When I signed up for their CDN service, I was under the impression that the GET requests would occur when someone listened to the audio. That’s obviously not the case though. Now that I’ve thought about how everything seems to work, I get it. I just hadn’t thought this all through before. It’s not really something that you can change directly; however, fixing the issues that I’m currently having (described here and elsewhere) will allow me to move the hosting of converted audio files to our own CDN, and that way I won’t have to deal with the additional cost of the Amazon CDN. Does that make sense?

    You guys have been great about responding to my issues. Thanks for working so hard on this. I really appreciate it.

    Thread Starter WriterDan

    (@writerdan)

    Hi. I really need to have some movement on this issue. I’ve just found out that the Amazon CDN option that I currently have to use because of this issue is charging me on a per-page-load basis for serving these Amazon Polly files instead of on a per-instance-played basis. Thus, my costs for hosting the converted audio files on the Amazon CDN instead of having them available through the CDN that the rest of my site is using, is going to start costing me a bunch.

    Can you please take a look at this?

    Thread Starter WriterDan

    (@writerdan)

    Okay. I’ve realized that this ticket is kind of a mix of two different issues. I’ll try to separate them here.

    First:
    The issue that the “How Much Will This Cost to Convert?” button on the admin page is reporting that my content is zero (0) characters long. I’m still not sure what is going on there, or why it’s reporting nothing.

    Second:
    The player/downloader on the front-facing page isn’t working. I figured out what was wrong here.

    I set up the plugin to keep the audio files on my local server instead of using the Amazon CDN. The issue lies in that we’re using a CDN through another plugin to serve our media content to viewers of our site, and the plugin responsible for that functionality is replacing the url in the player from our site to the url of the cdn.

    The easy answer to this issue is just to use the Amazon CDN.

    The more complicated, but completely free way of doing it though (as long as our CDN stays free) is to upload the polly-created files to our CDN.

    I’m guessing that there is something missing in your plugin that is causing this action to not take place. I say this for two reasons:

    1) The action of uploading a file through other plugins doesn’t seem to have this issue

    2) I can’t view the polly-generated files on our web server (despite the fact that they’re located within our uploads directory) when searching for them using the WordPress Media page.

    At the very least, the polly-generated files should be showing up in the Media search tool. This for basic WordPress functionality. From there, the CDN plugin we’re using has inserted an “Update File to CDN” link to all files. This would allow us to push the polly-generated files to the CDN manually after they’re created. Not optimal, but it would be a work-around until the automatic CDN-upload that is associated with uploading a file through the typical WordPress Media adder, could be figured out and applied to your plugin’s actions.

    Let me know if I should handle this in a different way (such as closing out this ticket and creating two new ones, or whatever), or if you need any more information.

    Thanks.

    Thread Starter WriterDan

    (@writerdan)

    I can just use the words-only exclusion to handle this.

    Thanks.

    Thread Starter WriterDan

    (@writerdan)

    Boy, that code block didn’t turn out at all. Here’s another go at it.

    
    function amazon_polly_audio_only_shortcode($atts, $content = NULL) {
    	global $post;
    
    	$tagged_content = '';
    	if($content!==NULL) {
    		$tagged_content = do_shortcode($content);
    		if(intval(get_post_meta($post->ID, 'amazon_polly_enable', TRUE))===1) {
    			$tagged_content = PHP_EOL.'-AMAZONPOLLY-ONLYAUDIO-START-'.PHP_EOL.$tagged_content.PHP_EOL.'-AMAZONPOLLY-ONLYAUDIO-END-'.PHP_EOL;
    		} else {
    			$tagged_content = PHP_EOL.'<!-- Amazon Polly not enabled on this post -->'.PHP_EOL.$tagged_content.PHP_EOL.'<!-- Amazon Polly not enabled on this post -->'.PHP_EOL;
    		}
    	}
    	return $tagged_content;
    }
    add_shortcode('polly_only_audio', 'amazon_polly_audio_only_shortcode');
    
    function amazon_polly_words_only_shortcode($atts, $content = NULL) {
    	global $post;
    
    	$tagged_content = '';
    	if($content!==NULL) {
    		$tagged_content = do_shortcode($content);
    		if(intval(get_post_meta($post->ID, 'amazon_polly_enable', TRUE))===1) {
    			$tagged_content = PHP_EOL.'-AMAZONPOLLY-ONLYWORDS-START-'.PHP_EOL.$tagged_content.PHP_EOL.'-AMAZONPOLLY-ONLYWORDS-END-'.PHP_EOL;
    		} else {
    			$tagged_content = PHP_EOL.'<!-- Amazon Polly not enabled on this post -->'.PHP_EOL.$tagged_content.PHP_EOL.'<!-- Amazon Polly not enabled on this post -->'.PHP_EOL;
    		}
    	}
    	return $tagged_content;
    }
    add_shortcode('polly_no_audio', 'amazon_polly_words_only_shortcode');
    

    Hope that’s better.

    Then to use the short codes, just wrap the content you want to include, like:

    
    [polly_no_audio]
    Some content here that I don't want to include in the audio version.
    [/polly_no_audio]
    

    Best.

Viewing 15 replies - 1 through 15 (of 25 total)