• Resolved bjrnet21

    (@bjrnet21)


    Just finished updating my entire site to WP 5.0.3 and latest Twenty Fourteen Theme 2.5. Everything is working.

    Just noticed new Woody Snippets update.

    I have a staging site and after installing I find that it breaks at least one page on my site. I get the following error:

    Parse error: syntax error, unexpected ‘tdih_table’ (T_STRING) in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 2

    This page uses several snippets similar to [wbcr_php_snippet id=”xxxxxx”].

    It worked fine before. Now it is broken.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 16 through 24 (of 24 total)
  • I am having a similar issue after updating WordPress and the plugin.

    Here is the line that is causing an error:

    echo ' <span style="color: #000000;">' . do_shortcode('[sc_embed_player_template1 fileurl="https://redacted.org/audio/' . $sermon['file'] . '"]') . '</span>';

    Here is the error:

    Got error 'PHP message: PHP Parse error: syntax error, unexpected '"', expecting ')'

    This worked perfectly before the two updates. Until this is resolved I have moved this code out of Woody and into a separate php file on my server. I am then using Woody to simply include(‘file.php’) to run the code and it is working. This tells me what I already know, that my code is good.

    Also, I have noticed that I cannot use the “tab” key when editing a snippit.

    • This reply was modified 6 years, 1 month ago by jeremywj.
    • This reply was modified 6 years, 1 month ago by jeremywj.
    • This reply was modified 6 years, 1 month ago by jeremywj.
    Plugin Author webcraftic

    (@webcraftic)

    @jeremywj

    This worked perfectly before the two updates. Until this is resolved I have moved this code out of Woody and into a separate php file on my server. I am then using Woody to simply include(‘file.php’) to run the code and it is working. This tells me what I already know, that my code is good.

    I cannot reproduce this problem yet, your code works for me. As soon as I can get more information, it will be fixed.

    Also, I have noticed that I cannot use the “tab” key when editing a snippit.

    Try to just update the general settings of the plugin.

    Best regards, Alex

    Updating the settings fixed the tab issue.

    What do you need from me to further look into this?

    Plugin Author webcraftic

    (@webcraftic)

    @jeremywj
    I could quickly fix this problem. Can you give me access to your site? Or maybe you have a test site?

    I need more information. Here is a link to the form where you can send private data:
    https://woody-ad-snippets.webcraftic.com/other-question-support/

    Best regards, Alex

    • This reply was modified 6 years, 1 month ago by webcraftic.

    I just sent your credentials to login. I also reverted the snippit back to the code that causes the error.

    Thread Starter bjrnet21

    (@bjrnet21)

    I think I got my issue resolved. Previously I used code such as:

    if ($Month == “” AND $Year == “”) {$tdih = “[tdih_tab day= ” . $Day . “]”;} else if ($Day == “” AND $Year == “”) {$tdih = “[tdih_tab month= ” . $Month . “]”;} else if ($Month == “” AND $Day == “”) {$tdih = “[tdih_tab year= ” . $Year . “]”;} else if ($Month == “” AND $Day AND $Year) {$tdih = “[tdih_tab day= ” . $Day . ” year= ” . $Year . “]”;} else if ($Day == “” AND $Month AND $Year) {$tdih = “[tdih_tab month= ” . $Month . ” year= ” . $Year . “]”;} else if ($Year== “” AND $Month AND $Day) {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . “]”;} else {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . ” year= ” . $Year . “]”;}
    echo do_shortcode($tdih);

    I changed it to:

    if ($Month == “” AND $Year == “”) {$tdih = “tdih_tab day= ” . $Day;} else if ($Day == “” AND $Year == “”) {$tdih = “tdih_tab month= ” . $Month;} else if ($Month == “” AND $Day == “”) {$tdih = “tdih_tab year= ” . $Year;} else if ($Month == “” AND $Day AND $Year) {$tdih = “tdih_tab day= ” . $Day . ” year= ” . $Year;} else if ($Day == “” AND $Month AND $Year) {$tdih = “tdih_tab month= ” . $Month . ” year= ” . $Year;} else if ($Year== “” AND $Month AND $Day) {$tdih = “tdih_tab month= ” . $Month . ” day= ” . $Day;} else {$tdih = “tdih_tab month= ” . $Month . ” day= ” . $Day . ” year= ” . $Year;}
    echo do_shortcode(‘[‘ . $tdih . ‘]’);

    Notice that I removed all the “[” and “]” from the if block and made them a part of the do_shortcode call. That seemed to placate the plugin. The plugin breaks when you try something like { $A = “[xxxxx]”; } . I guess it doesn’t like the [].

    I’ll continue to test a bit before I deploy to my live site. Thank you for your quick response and help in this manner.

    In case you are wondering… I maintain the largest blackjack historical database. More information at blackjackreview.com/wp/historical-events/.

    Plugin Author webcraftic

    (@webcraftic)

    I analyzed the user code @jeremywj, thank him very much for help! The bug is in do_shortcode, our plugin seems to be trying to process the shortcode, which is why it creates syntax problems. This will be fixed in the next release.

    Best regards, Alex

    webcraftic: Thanks! Glad you found the bug. I will revert back to just using include() until you get that released.

    webcraftic: Just updated and reverted to original code. I can confirm 2.1.4 fixed the issue.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘New update Woody Snippets breaks page’ is closed to new replies.