• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED 3rd Part Shortcodes stopped working

Messages
14
Likes
0
Points
1
#1
Hello,
I was using Woody snippets to add a token to our video player, FV Player. The code has been working for sometime. It creates a unique token an appends it to the end of the URL that is given in a FV Player's shortcode. This has been working for a few months. Then all of a sudden it stopped displaying the FV Player. We only see the shortcode test now. The Woody snippets is still funictioning, I can see my token getting created and appended to the URL, but the shortcode for the FV Player isn't used now for some reason.

So we only see this on the page now:
[fvplayer src=https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=dj3lsls9dd]

so as you can see the token is created, but the 3rd Party shortcode isn't executed.

the section of my code for the above is below:

echo "<p>[fvplayer src=https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=$token]";


This was all working below. What would affect the displaying of a shortcode?

Thanks!
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

Before updating plugin please read the changelog. It says that we have made options for executing shortcodes in snippets. Change it ON
1599460170561.png
 
Messages
14
Likes
0
Points
1
#3
Hi Temyk,

Before updating plugin please read the changelog. It says that we have made options for executing shortcodes in snippets. Change it ON
Probably always sage advise :).

I turned it On, but now my site gives me a 503 when I go to the page that uses that snippet.

Here is the error message I get:


[SIZE=7][B]Service Unavailable[/B][/SIZE]
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.25 (Debian) Server at mywebsite.net Port 80


If I turn off the "Execute shortcodes in snippets" config, and hit reload, then my page loads up showing my code had executed except for the shortcode.

Trying to see if it was my code possibly (even though it hadn't changed), I went ahead and commented everything out, except for the shortcode:

echo "<p>[fvplayer src=https://mystreamingserverurl.net:443/live/news/playlist.m3u8?token=$token]";

But If go back to my page, and shift reload, I still get the Service Unavailable. Go back and turn "Executes shortcodes in snippets" off and I see

[fvplayer src=https://mystreamingserverurl.net:443/live/news/playlist.m3u8?token=]


So I removed all of my code except for the one echo command that has the Shortplayer as it's value. Why am I getting Service Unavailable when turning on the "Execute shortcodes in snippets" function.

How do I go back to WS 2.3.7 to see if I can get my code working that way?


Thanks!
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#4
Try replacing the fvplayer shortcode with the woody shortcode. Create a test snippet with simple output and paste it instead of fvplayer. If this works, it means that the problem is in the fvplayer shortcode
 
Messages
14
Likes
0
Points
1
#5
So do you mean make a snippet like this:


add_shortcode( 'shortcode_name', function () {

$out = '<p>write your HTML shortcode content here</p>';

return $out;
} );


and then I make another snippet that uses that shortcode, so like this:

echo "<p>[shortcode_name]";

When I did that, it shows the same thing, Service Unavailable and unable to execute the shortcode

If take out the woodysnippets shortcode and replace the page with just [shortcode_name] and save and view then I the shortcode works:


This is what I see:
write your HTML shortcode content here


So that shows me that using a simple shortcode, within a woodysnippets, still provides the same Service Unavailable errror.


Thanks,
David
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#6
Can you view the error logs? And send them to me.
 
Messages
14
Likes
0
Points
1
#7
Sorry for the long delay, based in Oregon and had to deal with a level 2 evacuation. Things are looking better, so I was able to test.

I'm attaching the debug.log output from when I was trying to access the page and received the 503
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

error.

Looking the log, I see it showing this:

Code:
[14-Sep-2020 07:44:35 UTC] PHP Parse error:  syntax error, unexpected '<', expecting end of file in /home/591181.cloudwaysapps.com/ltsfeyyuas/public_html/wp-content/plugins/insert-p
hp/includes/shortcodes/shortcode-php.php(52) : eval()'d code on line 16
line 16 is the only active line, I've commented out the rest.
line 16 is this:
Code:
 echo "<p>[shortcode_name]";

Let me know what you see? Is it possible to get the old version of the plugin before this was enabled for now, while we track things down?


Thanks!
 

Attachments

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#8
Hello

Check the snippet code -> [shortcode_name]
or send the snippet code here
 
Messages
14
Likes
0
Points
1
#9
Hi,
here it is:
Code:
add_shortcode( 'shortcode_name', function () {

    $out = '<p>write your HTML shortcode content here</p>';

    return $out;
} );
Thanks
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#10
And the code of the main snippet that contains this line?
echo "<p>[shortcode_name]";
 
Messages
14
Likes
0
Points
1
#11
That was it! Just that.

but I've gone ahead and made it easier, using the built in Wordpress shortcodes, I was able to reproduce it.

Here are the steps.

In Woody Ad Snippets create a new php snippet with just this in it:

Code:
echo '<p>[audio src="https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"]';
save it, which gives me this shortcode:

Code:
[wbcr_php_snippet id="10"]
I then put that on a wordpress page and load the page and the audio shortcode is NOT diplayed.

I see this error on the page:

Code:
Parse error: syntax error, unexpected 'audio' (T_STRING), expecting ';' or ',' in /home/391181.cloudwaysapps.com/egfdyysryc/public_html/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(52) : eval()'d code on line 1

There has been a critical error on your website.
It should work with the default wordpress shortcode's , correct?

I can take the shortcode here:
[audio src="https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"]

without using Woody Ad Snippet and it works fine. It's just when we want to use it with Woody ad snippets.


Is there any way to get the older version that was working before we upgraded, so we can get a functional website?



Thanks
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#12
I understand what the problem is. First, woody executes the snippet's shortcodes, and then executes the snippet's code. Therefore, the entire HTML code of the audio player is enclosed in quotation marks. From this and errors.
You can write your code like this:
PHP:
echo "<p>";
?>
[fvplayer src=https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=<?=$token;?>]
 
Messages
14
Likes
0
Points
1
#13
HI Temyk,
Thanks. You're on to something here. So that does launch the FV Player shortcode, but my variable $token, no longer populates.

I can see in my Streaming Server logs the Player coming in with no token and getting rejected because of this.

In your code change above, you added this:
Code:
?>
in between.

That ends the php and goes into html right?


this:
Code:
<?=$token;?>
should call $token if it's set? As all the items below the ?> aren't able to access it.

As a test, I put some additional code above the ?> to verify the $token variable is actually getting set and it is:
Code:
echo "<p><a href='https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=$token'>Watch my video in the New Room</a></p>";
echo "<p>";
?>
[fvplayer src=https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=<?=$token;?>]

and it is, this is the link that is created from the first echo command:
Code:
https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=5f61b51726b81
so the items above the
Code:
?>
show the $token variable, but the ones below do not, when using
Code:
<?=$token;?>

Any ideas? Any idea on why this was working before the Woody upgrade?

Thank you! Appreciate your help.
 
Messages
14
Likes
0
Points
1
#14
This is what the Streaming Server receives:

Code:
WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/new/playlist.m3u8?token=]: Session not accepted[308447569]
the token variable never get's populated.
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#15
Any ideas? Any idea on why this was working before the Woody upgrade?
Before the woody update, shortcodes were not executed in the snippet text.

In your case, you need to disable the execution of shortcodes in snippets, then the token should be added to the shortcode and executed
 
Messages
14
Likes
0
Points
1
#16
Hi Temyk,
Thanks. I tried that, I turned of the execution of shortcodes in snippets - and that did make it so that the token was added to the end of the url, in the variable, but then the shortcode was not executed, and I see this on the page, rather then the Player:
Code:
 [fvplayer src=https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=5f6203ace9c3a]
So we see the token is created and appended to the url as expected but it does not launch the FV Player with the url.
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#17
Then the only way:
PHP:
echo "<p>";
echo do_shortcode("[fvplayer src='https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token={$token}']");
 
Messages
14
Likes
0
Points
1
#18
argggh! Still not working. I added the above and I get the following on the page, so it just prints it out, instead of launching the shortcode:

Code:
echo do_shortcode("[fvplayer src='https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token=5f62a59f2bd7c']");
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#19
PHP code is not executed. Make sure that you write the code correctly in the snippet.
 
Messages
14
Likes
0
Points
1
#20
Bear with me, I'm new to this.
I do see a typo, so I copy and pasted what you had added:

Code:
echo "<p>";
echo do_shortcode("[fvplayer src='https://mystreaming.serversurl.com:443/live/new/playlist.m3u8?token={$token}']");
now it does pop up the FV Player but again w/ no token and we see this on the page:

Code:
echo "
"; echo do_shortcode("
<----FV Player is shown here --->
");